| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
package org.kuali.rice.krad.web.controller; |
| 17 | |
|
| 18 | |
import org.apache.commons.lang.ArrayUtils; |
| 19 | |
import org.apache.commons.lang.StringUtils; |
| 20 | |
import org.kuali.rice.core.api.util.RiceKeyConstants; |
| 21 | |
import org.kuali.rice.core.framework.parameter.ParameterConstants; |
| 22 | |
import org.kuali.rice.core.framework.services.CoreFrameworkServiceLocator; |
| 23 | |
import org.kuali.rice.kew.api.WorkflowDocument; |
| 24 | |
import org.kuali.rice.kew.exception.WorkflowException; |
| 25 | |
import org.kuali.rice.kew.util.KEWConstants; |
| 26 | |
import org.kuali.rice.kim.bo.Person; |
| 27 | |
import org.kuali.rice.krad.bo.AdHocRouteRecipient; |
| 28 | |
import org.kuali.rice.krad.bo.Attachment; |
| 29 | |
import org.kuali.rice.krad.bo.Note; |
| 30 | |
import org.kuali.rice.krad.document.Document; |
| 31 | |
import org.kuali.rice.krad.exception.DocumentAuthorizationException; |
| 32 | |
import org.kuali.rice.krad.exception.UnknownDocumentIdException; |
| 33 | |
import org.kuali.rice.krad.exception.ValidationException; |
| 34 | |
import org.kuali.rice.krad.question.ConfirmationQuestion; |
| 35 | |
import org.kuali.rice.krad.service.BusinessObjectService; |
| 36 | |
import org.kuali.rice.krad.service.DataDictionaryService; |
| 37 | |
import org.kuali.rice.krad.service.DocumentHelperService; |
| 38 | |
import org.kuali.rice.krad.service.DocumentService; |
| 39 | |
import org.kuali.rice.krad.service.KRADServiceLocator; |
| 40 | |
import org.kuali.rice.krad.service.KRADServiceLocatorWeb; |
| 41 | |
import org.kuali.rice.krad.uif.UifParameters; |
| 42 | |
import org.kuali.rice.krad.uif.container.CollectionGroup; |
| 43 | |
import org.kuali.rice.krad.uif.util.ObjectPropertyUtils; |
| 44 | |
import org.kuali.rice.krad.util.GlobalVariables; |
| 45 | |
import org.kuali.rice.krad.util.KRADConstants; |
| 46 | |
import org.kuali.rice.krad.util.KRADPropertyConstants; |
| 47 | |
import org.kuali.rice.krad.util.SessionTicket; |
| 48 | |
import org.kuali.rice.krad.web.form.DocumentFormBase; |
| 49 | |
import org.kuali.rice.krad.web.form.UifFormBase; |
| 50 | |
import org.springframework.util.FileCopyUtils; |
| 51 | |
import org.springframework.validation.BindingResult; |
| 52 | |
import org.springframework.web.bind.ServletRequestBindingException; |
| 53 | |
import org.springframework.web.bind.annotation.ModelAttribute; |
| 54 | |
import org.springframework.web.bind.annotation.RequestMapping; |
| 55 | |
import org.springframework.web.bind.annotation.RequestMethod; |
| 56 | |
import org.springframework.web.multipart.MultipartFile; |
| 57 | |
import org.springframework.web.servlet.ModelAndView; |
| 58 | |
|
| 59 | |
import javax.servlet.http.HttpServletRequest; |
| 60 | |
import javax.servlet.http.HttpServletResponse; |
| 61 | |
|
| 62 | |
import java.io.FileNotFoundException; |
| 63 | |
import java.io.IOException; |
| 64 | |
import java.io.InputStream; |
| 65 | |
import java.util.ArrayList; |
| 66 | |
import java.util.HashMap; |
| 67 | |
import java.util.Map; |
| 68 | |
|
| 69 | |
|
| 70 | |
|
| 71 | |
|
| 72 | |
|
| 73 | |
|
| 74 | |
|
| 75 | |
|
| 76 | |
|
| 77 | |
|
| 78 | |
|
| 79 | |
|
| 80 | |
|
| 81 | 0 | public abstract class DocumentControllerBase extends UifControllerBase { |
| 82 | 0 | private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(DocumentControllerBase.class); |
| 83 | |
|
| 84 | |
|
| 85 | |
|
| 86 | 0 | protected static final String[] DOCUMENT_LOAD_COMMANDS = { KEWConstants.ACTIONLIST_COMMAND, |
| 87 | |
KEWConstants.DOCSEARCH_COMMAND, KEWConstants.SUPERUSER_COMMAND, KEWConstants.HELPDESK_ACTIONLIST_COMMAND }; |
| 88 | |
|
| 89 | |
private BusinessObjectService businessObjectService; |
| 90 | |
private DataDictionaryService dataDictionaryService; |
| 91 | |
private DocumentService documentService; |
| 92 | |
private DocumentHelperService documentHelperService; |
| 93 | |
|
| 94 | |
@Override |
| 95 | |
public abstract DocumentFormBase createInitialForm(HttpServletRequest request); |
| 96 | |
|
| 97 | |
|
| 98 | |
|
| 99 | |
|
| 100 | |
|
| 101 | |
|
| 102 | |
|
| 103 | |
|
| 104 | |
|
| 105 | |
|
| 106 | |
@RequestMapping(params = "methodToCall=docHandler") |
| 107 | |
public ModelAndView docHandler(@ModelAttribute("KualiForm") DocumentFormBase form, BindingResult result, HttpServletRequest request, |
| 108 | |
HttpServletResponse response) throws Exception { |
| 109 | 0 | String command = form.getCommand(); |
| 110 | |
|
| 111 | |
|
| 112 | 0 | if (ArrayUtils.contains(DOCUMENT_LOAD_COMMANDS, command) && form.getDocId() != null) { |
| 113 | 0 | loadDocument(form); |
| 114 | |
} |
| 115 | 0 | else if (KEWConstants.INITIATE_COMMAND.equals(command)) { |
| 116 | 0 | createDocument(form); |
| 117 | |
} |
| 118 | |
else { |
| 119 | 0 | LOG.error("docHandler called with invalid parameters"); |
| 120 | 0 | throw new IllegalStateException("docHandler called with invalid parameters"); |
| 121 | |
} |
| 122 | |
|
| 123 | |
|
| 124 | |
|
| 125 | |
|
| 126 | |
|
| 127 | |
|
| 128 | 0 | return getUIFModelAndView(form); |
| 129 | |
} |
| 130 | |
|
| 131 | |
|
| 132 | |
|
| 133 | |
|
| 134 | |
|
| 135 | |
|
| 136 | |
|
| 137 | |
|
| 138 | |
|
| 139 | |
|
| 140 | |
protected void loadDocument(DocumentFormBase form) throws WorkflowException { |
| 141 | 0 | String docId = form.getDocId(); |
| 142 | |
|
| 143 | 0 | Document doc = null; |
| 144 | 0 | doc = getDocumentService().getByDocumentHeaderId(docId); |
| 145 | 0 | if (doc == null) { |
| 146 | 0 | throw new UnknownDocumentIdException( |
| 147 | |
"Document no longer exists. It may have been cancelled before being saved."); |
| 148 | |
} |
| 149 | |
|
| 150 | 0 | WorkflowDocument workflowDocument = doc.getDocumentHeader().getWorkflowDocument(); |
| 151 | 0 | if (!getDocumentHelperService().getDocumentAuthorizer(doc).canOpen(doc, |
| 152 | |
GlobalVariables.getUserSession().getPerson())) { |
| 153 | 0 | throw buildAuthorizationException("open", doc); |
| 154 | |
} |
| 155 | |
|
| 156 | |
|
| 157 | |
|
| 158 | 0 | if (workflowDocument != doc.getDocumentHeader().getWorkflowDocument()) { |
| 159 | 0 | LOG.warn("Workflow document changed via canOpen check"); |
| 160 | 0 | doc.getDocumentHeader().setWorkflowDocument(workflowDocument); |
| 161 | |
} |
| 162 | |
|
| 163 | 0 | form.setDocument(doc); |
| 164 | 0 | WorkflowDocument workflowDoc = doc.getDocumentHeader().getWorkflowDocument(); |
| 165 | 0 | form.setDocTypeName(workflowDoc.getDocumentTypeName()); |
| 166 | |
|
| 167 | 0 | KRADServiceLocatorWeb.getSessionDocumentService().addDocumentToUserSession(GlobalVariables.getUserSession(), workflowDoc); |
| 168 | 0 | } |
| 169 | |
|
| 170 | |
|
| 171 | |
|
| 172 | |
|
| 173 | |
|
| 174 | |
|
| 175 | |
|
| 176 | |
|
| 177 | |
|
| 178 | |
|
| 179 | |
protected void createDocument(DocumentFormBase form) throws WorkflowException { |
| 180 | 0 | Document doc = getDocumentService().getNewDocument(form.getDocTypeName()); |
| 181 | |
|
| 182 | 0 | form.setDocument(doc); |
| 183 | 0 | form.setDocTypeName(doc.getDocumentHeader().getWorkflowDocument().getDocumentTypeName()); |
| 184 | 0 | } |
| 185 | |
|
| 186 | |
|
| 187 | |
|
| 188 | |
|
| 189 | |
@RequestMapping(params = "methodToCall=save") |
| 190 | |
public ModelAndView save(@ModelAttribute("KualiForm") DocumentFormBase form, BindingResult result, HttpServletRequest request, |
| 191 | |
HttpServletResponse response) throws Exception { |
| 192 | |
|
| 193 | 0 | doProcessingAfterPost(form, request); |
| 194 | |
|
| 195 | |
|
| 196 | |
|
| 197 | |
|
| 198 | |
|
| 199 | 0 | Document document = form.getDocument(); |
| 200 | |
|
| 201 | 0 | String viewName = checkAndWarnAboutSensitiveData(form, request, response, |
| 202 | |
KRADPropertyConstants.DOCUMENT_EXPLANATION, document.getDocumentHeader().getExplanation(), "save", ""); |
| 203 | |
|
| 204 | |
|
| 205 | 0 | if (viewName != null) { |
| 206 | 0 | return new ModelAndView(viewName); |
| 207 | |
} |
| 208 | |
|
| 209 | |
try { |
| 210 | |
|
| 211 | 0 | getDocumentService().saveDocument(document); |
| 212 | |
|
| 213 | |
|
| 214 | |
|
| 215 | 0 | form.setAnnotation(""); |
| 216 | |
} |
| 217 | 0 | catch(ValidationException vex) { |
| 218 | |
|
| 219 | |
|
| 220 | 0 | if(GlobalVariables.getMessageMap().hasNoErrors()) { |
| 221 | 0 | throw new RuntimeException("Validation Exception with no error message.", vex); |
| 222 | |
} |
| 223 | 0 | } |
| 224 | |
|
| 225 | 0 | return getUIFModelAndView(form); |
| 226 | |
} |
| 227 | |
|
| 228 | |
|
| 229 | |
|
| 230 | |
|
| 231 | |
@RequestMapping(params = "methodToCall=route") |
| 232 | |
public ModelAndView route(@ModelAttribute("KualiForm") DocumentFormBase form, BindingResult result, HttpServletRequest request, |
| 233 | |
HttpServletResponse response) throws Exception { |
| 234 | 0 | doProcessingAfterPost(form, request); |
| 235 | |
|
| 236 | |
|
| 237 | |
|
| 238 | |
|
| 239 | |
|
| 240 | |
|
| 241 | |
|
| 242 | |
|
| 243 | |
|
| 244 | 0 | Document document = form.getDocument(); |
| 245 | |
|
| 246 | 0 | String viewName = checkAndWarnAboutSensitiveData(form, request, response, |
| 247 | |
KRADPropertyConstants.DOCUMENT_EXPLANATION, document.getDocumentHeader().getExplanation(), "route", ""); |
| 248 | 0 | if (viewName != null) { |
| 249 | 0 | return new ModelAndView(viewName); |
| 250 | |
} |
| 251 | |
|
| 252 | |
|
| 253 | |
|
| 254 | |
|
| 255 | 0 | getDocumentService().routeDocument(document, form.getAnnotation(), new ArrayList<AdHocRouteRecipient>()); |
| 256 | |
|
| 257 | |
|
| 258 | |
|
| 259 | 0 | form.setAnnotation(""); |
| 260 | |
|
| 261 | |
|
| 262 | 0 | return getUIFModelAndView(form); |
| 263 | |
} |
| 264 | |
|
| 265 | |
|
| 266 | |
|
| 267 | |
|
| 268 | |
|
| 269 | |
|
| 270 | |
|
| 271 | |
|
| 272 | |
|
| 273 | |
@RequestMapping(method = RequestMethod.POST, params = "methodToCall=insertNote") |
| 274 | |
public ModelAndView insertNote(@ModelAttribute("KualiForm") UifFormBase uifForm, |
| 275 | |
BindingResult result, HttpServletRequest request, HttpServletResponse response) { |
| 276 | |
|
| 277 | |
|
| 278 | |
|
| 279 | |
|
| 280 | 0 | String selectedCollectionPath = uifForm.getActionParamaterValue(UifParameters.SELLECTED_COLLECTION_PATH); |
| 281 | 0 | CollectionGroup collectionGroup = uifForm.getPreviousView().getViewIndex().getCollectionGroupByPath(selectedCollectionPath); |
| 282 | 0 | String addLinePath = collectionGroup.getAddLineBindingInfo().getBindingPath(); |
| 283 | 0 | Object addLine = ObjectPropertyUtils.getPropertyValue(uifForm, addLinePath); |
| 284 | 0 | Note newNote = (Note)addLine; |
| 285 | 0 | newNote.setNotePostedTimestampToCurrent(); |
| 286 | |
|
| 287 | |
|
| 288 | 0 | String attachmentTypeCode = null; |
| 289 | 0 | MultipartFile attachmentFile = uifForm.getAttachmentFile(); |
| 290 | 0 | if (attachmentFile == null) { |
| 291 | 0 | GlobalVariables.getMessageMap().putError( |
| 292 | |
String.format("%s.%s", |
| 293 | |
KRADConstants.NEW_DOCUMENT_NOTE_PROPERTY_NAME, |
| 294 | |
KRADConstants.NOTE_ATTACHMENT_FILE_PROPERTY_NAME), |
| 295 | |
RiceKeyConstants.ERROR_UPLOADFILE_NULL); |
| 296 | |
|
| 297 | |
|
| 298 | |
} |
| 299 | |
|
| 300 | 0 | if (newNote.getAttachment() != null) { |
| 301 | 0 | attachmentTypeCode = newNote.getAttachment().getAttachmentTypeCode(); |
| 302 | |
} |
| 303 | |
|
| 304 | |
|
| 305 | |
|
| 306 | |
|
| 307 | |
|
| 308 | |
|
| 309 | |
|
| 310 | 0 | Attachment attachment = null; |
| 311 | 0 | if (attachmentFile != null && !StringUtils.isBlank(attachmentFile.getOriginalFilename())) { |
| 312 | 0 | if (attachmentFile.getSize() == 0) { |
| 313 | 0 | GlobalVariables.getMessageMap().putError( |
| 314 | |
String.format("%s.%s", |
| 315 | |
KRADConstants.NEW_DOCUMENT_NOTE_PROPERTY_NAME, |
| 316 | |
KRADConstants.NOTE_ATTACHMENT_FILE_PROPERTY_NAME), |
| 317 | |
RiceKeyConstants.ERROR_UPLOADFILE_EMPTY, |
| 318 | |
attachmentFile.getOriginalFilename()); |
| 319 | |
|
| 320 | |
|
| 321 | |
} else { |
| 322 | 0 | String attachmentType = null; |
| 323 | |
try { |
| 324 | 0 | attachment = KRADServiceLocator.getAttachmentService().createAttachment(((DocumentFormBase)uifForm).getDocument().getNoteTarget(), attachmentFile.getOriginalFilename(), attachmentFile.getContentType(), (int)attachmentFile.getSize(), attachmentFile.getInputStream(), ""); |
| 325 | 0 | newNote.addAttachment(attachment); |
| 326 | 0 | } catch (IOException e) { |
| 327 | 0 | e.printStackTrace(); |
| 328 | 0 | } |
| 329 | |
} |
| 330 | |
} |
| 331 | |
|
| 332 | |
|
| 333 | 0 | Person kualiUser = GlobalVariables.getUserSession().getPerson(); |
| 334 | 0 | if (kualiUser == null) { |
| 335 | 0 | throw new IllegalStateException("Current UserSession has a null Person."); |
| 336 | |
} |
| 337 | 0 | newNote.setAuthorUniversalIdentifier(kualiUser.getPrincipalId()); |
| 338 | |
|
| 339 | 0 | Note tmpNote = KRADServiceLocator.getNoteService().createNote(newNote, ((DocumentFormBase)uifForm).getDocument().getNoteTarget(), kualiUser.getPrincipalId()); |
| 340 | |
|
| 341 | 0 | return addLine(uifForm, result, request, response); |
| 342 | |
} |
| 343 | |
|
| 344 | |
|
| 345 | |
|
| 346 | |
|
| 347 | |
|
| 348 | |
|
| 349 | |
|
| 350 | |
@RequestMapping(method = RequestMethod.POST, params = "methodToCall=deleteNote") |
| 351 | |
public ModelAndView deleteNote(@ModelAttribute("KualiForm") UifFormBase uifForm, |
| 352 | |
BindingResult result, HttpServletRequest request, HttpServletResponse response) { |
| 353 | |
|
| 354 | 0 | return deleteLine(uifForm, result, request, response); |
| 355 | |
} |
| 356 | |
|
| 357 | |
|
| 358 | |
|
| 359 | |
|
| 360 | |
|
| 361 | |
|
| 362 | |
|
| 363 | |
@RequestMapping(method = RequestMethod.POST, params = "methodToCall=downloadAttachment") |
| 364 | |
public ModelAndView downloadAttachment(@ModelAttribute("KualiForm") UifFormBase uifForm, |
| 365 | |
BindingResult result, HttpServletRequest request, HttpServletResponse response) throws ServletRequestBindingException, FileNotFoundException, IOException { |
| 366 | |
|
| 367 | 0 | String selectedLineIndex = uifForm.getActionParamaterValue("selectedLineIndex"); |
| 368 | 0 | Note note = ((DocumentFormBase)uifForm).getDocument().getNote(Integer.parseInt(selectedLineIndex)); |
| 369 | 0 | Attachment attachment = note.getAttachment(); |
| 370 | 0 | InputStream is = KRADServiceLocator.getAttachmentService().retrieveAttachmentContents(attachment); |
| 371 | |
|
| 372 | |
|
| 373 | 0 | response.setContentType(attachment.getAttachmentMimeTypeCode()); |
| 374 | 0 | response.setContentLength(attachment.getAttachmentFileSize().intValue()); |
| 375 | 0 | response.setHeader("Expires", "0"); |
| 376 | 0 | response.setHeader("Cache-Control", "must-revalidate, post-check=0, pre-check=0"); |
| 377 | 0 | response.setHeader("Pragma", "public"); |
| 378 | 0 | response.setHeader("Content-Disposition","attachment; filename=\"" + attachment.getAttachmentFileName() + "\""); |
| 379 | |
|
| 380 | |
|
| 381 | 0 | FileCopyUtils.copy(is, response.getOutputStream()); |
| 382 | 0 | return null; |
| 383 | |
} |
| 384 | |
|
| 385 | |
|
| 386 | |
|
| 387 | |
|
| 388 | |
|
| 389 | |
|
| 390 | |
@RequestMapping(method = RequestMethod.POST, params = "methodToCall=cancelAttachment") |
| 391 | |
public ModelAndView cancelAttachment(@ModelAttribute("KualiForm") UifFormBase uifForm, |
| 392 | |
BindingResult result, HttpServletRequest request, HttpServletResponse response) { |
| 393 | |
|
| 394 | 0 | uifForm.setAttachmentFile(null); |
| 395 | 0 | return getUIFModelAndView(uifForm); |
| 396 | |
} |
| 397 | |
|
| 398 | |
|
| 399 | |
|
| 400 | |
|
| 401 | |
|
| 402 | |
|
| 403 | |
|
| 404 | |
|
| 405 | |
|
| 406 | |
|
| 407 | |
|
| 408 | |
protected void doProcessingAfterPost(DocumentFormBase form, HttpServletRequest request) { |
| 409 | 0 | getBusinessObjectService().linkUserFields(form.getDocument()); |
| 410 | 0 | } |
| 411 | |
|
| 412 | |
|
| 413 | |
|
| 414 | |
|
| 415 | |
|
| 416 | |
|
| 417 | |
|
| 418 | |
|
| 419 | |
|
| 420 | |
|
| 421 | |
|
| 422 | |
|
| 423 | |
|
| 424 | |
|
| 425 | |
|
| 426 | |
|
| 427 | |
|
| 428 | |
|
| 429 | |
|
| 430 | |
|
| 431 | |
|
| 432 | |
|
| 433 | |
|
| 434 | |
|
| 435 | |
|
| 436 | |
|
| 437 | |
|
| 438 | |
|
| 439 | |
|
| 440 | |
|
| 441 | |
|
| 442 | |
|
| 443 | |
|
| 444 | |
|
| 445 | |
|
| 446 | |
|
| 447 | |
|
| 448 | |
|
| 449 | |
|
| 450 | |
|
| 451 | |
|
| 452 | |
|
| 453 | |
|
| 454 | |
|
| 455 | |
|
| 456 | |
|
| 457 | |
|
| 458 | |
|
| 459 | |
|
| 460 | |
|
| 461 | |
|
| 462 | |
|
| 463 | |
|
| 464 | |
|
| 465 | |
|
| 466 | |
|
| 467 | |
|
| 468 | |
|
| 469 | |
|
| 470 | |
|
| 471 | |
|
| 472 | |
|
| 473 | |
|
| 474 | |
|
| 475 | |
|
| 476 | |
|
| 477 | |
|
| 478 | |
|
| 479 | |
|
| 480 | |
|
| 481 | |
|
| 482 | |
|
| 483 | |
protected String checkAndWarnAboutSensitiveData(DocumentFormBase form, HttpServletRequest request, |
| 484 | |
HttpServletResponse response, String fieldName, String fieldValue, String caller, String context) |
| 485 | |
throws Exception { |
| 486 | |
|
| 487 | 0 | String viewName = null; |
| 488 | 0 | Document document = form.getDocument(); |
| 489 | |
|
| 490 | |
|
| 491 | 0 | boolean containsSensitiveData = false; |
| 492 | |
|
| 493 | |
|
| 494 | |
|
| 495 | |
|
| 496 | 0 | boolean warnForSensitiveData = CoreFrameworkServiceLocator.getParameterService().getParameterValueAsBoolean( |
| 497 | |
KRADConstants.KRAD_NAMESPACE, ParameterConstants.ALL_COMPONENT, |
| 498 | |
KRADConstants.SystemGroupParameterNames.SENSITIVE_DATA_PATTERNS_WARNING_IND); |
| 499 | |
|
| 500 | |
|
| 501 | 0 | Map<String, String> ticketContext = new HashMap<String, String>(); |
| 502 | 0 | ticketContext.put(KRADPropertyConstants.DOCUMENT_NUMBER, document.getDocumentNumber()); |
| 503 | 0 | ticketContext.put(KRADConstants.CALLING_METHOD, caller); |
| 504 | 0 | ticketContext.put(KRADPropertyConstants.NAME, fieldName); |
| 505 | |
|
| 506 | 0 | boolean questionAsked = GlobalVariables.getUserSession().hasMatchingSessionTicket( |
| 507 | |
KRADConstants.SENSITIVE_DATA_QUESTION_SESSION_TICKET, ticketContext); |
| 508 | |
|
| 509 | |
|
| 510 | 0 | if (containsSensitiveData && warnForSensitiveData && !questionAsked) { |
| 511 | 0 | Object question = request.getParameter(KRADConstants.QUESTION_INST_ATTRIBUTE_NAME); |
| 512 | 0 | if (question == null || !KRADConstants.DOCUMENT_SENSITIVE_DATA_QUESTION.equals(question)) { |
| 513 | |
|
| 514 | |
|
| 515 | |
|
| 516 | |
|
| 517 | |
|
| 518 | |
|
| 519 | |
|
| 520 | |
|
| 521 | |
|
| 522 | |
|
| 523 | |
|
| 524 | 0 | viewName = "ask_user_questions"; |
| 525 | |
} |
| 526 | |
else { |
| 527 | 0 | Object buttonClicked = request.getParameter(KRADConstants.QUESTION_CLICKED_BUTTON); |
| 528 | |
|
| 529 | |
|
| 530 | 0 | if (ConfirmationQuestion.NO.equals(buttonClicked)) { |
| 531 | |
|
| 532 | 0 | viewName = "user_says_no"; |
| 533 | |
} |
| 534 | |
|
| 535 | |
|
| 536 | |
|
| 537 | 0 | SessionTicket ticket = new SessionTicket(KRADConstants.SENSITIVE_DATA_QUESTION_SESSION_TICKET); |
| 538 | 0 | ticket.setTicketContext(ticketContext); |
| 539 | 0 | GlobalVariables.getUserSession().putSessionTicket(ticket); |
| 540 | |
} |
| 541 | |
} |
| 542 | |
|
| 543 | |
|
| 544 | 0 | return viewName; |
| 545 | |
} |
| 546 | |
|
| 547 | |
|
| 548 | |
|
| 549 | |
|
| 550 | |
|
| 551 | |
|
| 552 | |
|
| 553 | |
|
| 554 | |
|
| 555 | |
protected DocumentAuthorizationException buildAuthorizationException(String action, Document document) { |
| 556 | 0 | return new DocumentAuthorizationException(GlobalVariables.getUserSession().getPerson().getPrincipalName(), |
| 557 | |
action, document.getDocumentNumber()); |
| 558 | |
} |
| 559 | |
|
| 560 | |
public BusinessObjectService getBusinessObjectService() { |
| 561 | 0 | if (this.businessObjectService == null) { |
| 562 | 0 | this.businessObjectService = KRADServiceLocator.getBusinessObjectService(); |
| 563 | |
} |
| 564 | 0 | return this.businessObjectService; |
| 565 | |
} |
| 566 | |
|
| 567 | |
public void setBusinessObjectService(BusinessObjectService businessObjectService) { |
| 568 | 0 | this.businessObjectService = businessObjectService; |
| 569 | 0 | } |
| 570 | |
|
| 571 | |
public DataDictionaryService getDataDictionaryService() { |
| 572 | 0 | if (this.dataDictionaryService == null) { |
| 573 | 0 | this.dataDictionaryService = KRADServiceLocatorWeb.getDataDictionaryService(); |
| 574 | |
} |
| 575 | 0 | return this.dataDictionaryService; |
| 576 | |
} |
| 577 | |
|
| 578 | |
public void setDataDictionaryService(DataDictionaryService dataDictionaryService) { |
| 579 | 0 | this.dataDictionaryService = dataDictionaryService; |
| 580 | 0 | } |
| 581 | |
|
| 582 | |
public DocumentService getDocumentService() { |
| 583 | 0 | if (this.documentService == null) { |
| 584 | 0 | this.documentService = KRADServiceLocatorWeb.getDocumentService(); |
| 585 | |
} |
| 586 | 0 | return this.documentService; |
| 587 | |
} |
| 588 | |
|
| 589 | |
public void setDocumentService(DocumentService documentService) { |
| 590 | 0 | this.documentService = documentService; |
| 591 | 0 | } |
| 592 | |
|
| 593 | |
public DocumentHelperService getDocumentHelperService() { |
| 594 | 0 | if (this.documentHelperService == null) { |
| 595 | 0 | this.documentHelperService = KRADServiceLocatorWeb.getDocumentHelperService(); |
| 596 | |
} |
| 597 | 0 | return this.documentHelperService; |
| 598 | |
} |
| 599 | |
|
| 600 | |
public void setDocumentHelperService(DocumentHelperService documentHelperService) { |
| 601 | 0 | this.documentHelperService = documentHelperService; |
| 602 | 0 | } |
| 603 | |
} |