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.config.property.ConfigurationService;
21 import org.kuali.rice.core.api.exception.RiceRuntimeException;
22 import org.kuali.rice.core.api.util.RiceKeyConstants;
23 import org.kuali.rice.kew.api.KewApiConstants;
24 import org.kuali.rice.kew.api.WorkflowDocument;
25 import org.kuali.rice.kew.api.exception.WorkflowException;
26 import org.kuali.rice.kim.api.identity.Person;
27 import org.kuali.rice.krad.bo.AdHocRouteRecipient;
28 import org.kuali.rice.krad.bo.Attachment;
29 import org.kuali.rice.krad.bo.DocumentHeader;
30 import org.kuali.rice.krad.bo.Note;
31 import org.kuali.rice.krad.document.Document;
32 import org.kuali.rice.krad.document.DocumentAuthorizer;
33 import org.kuali.rice.krad.maintenance.MaintenanceDocument;
34 import org.kuali.rice.krad.exception.DocumentAuthorizationException;
35 import org.kuali.rice.krad.exception.UnknownDocumentIdException;
36 import org.kuali.rice.krad.exception.ValidationException;
37 import org.kuali.rice.krad.rules.rule.event.AddNoteEvent;
38 import org.kuali.rice.krad.service.AttachmentService;
39 import org.kuali.rice.krad.service.BusinessObjectService;
40 import org.kuali.rice.krad.service.DataDictionaryService;
41 import org.kuali.rice.krad.service.DocumentDictionaryService;
42 import org.kuali.rice.krad.service.DocumentService;
43 import org.kuali.rice.krad.service.KRADServiceLocator;
44 import org.kuali.rice.krad.service.KRADServiceLocatorWeb;
45 import org.kuali.rice.krad.service.NoteService;
46 import org.kuali.rice.krad.uif.UifConstants.WorkflowAction;
47 import org.kuali.rice.krad.uif.UifParameters;
48 import org.kuali.rice.krad.uif.UifPropertyPaths;
49 import org.kuali.rice.krad.uif.container.CollectionGroup;
50 import org.kuali.rice.krad.uif.util.ObjectPropertyUtils;
51 import org.kuali.rice.krad.util.GlobalVariables;
52 import org.kuali.rice.krad.util.KRADConstants;
53 import org.kuali.rice.krad.util.NoteType;
54 import org.kuali.rice.krad.web.form.DocumentFormBase;
55 import org.kuali.rice.krad.web.form.UifFormBase;
56 import org.springframework.util.FileCopyUtils;
57 import org.springframework.validation.BindingResult;
58 import org.springframework.web.bind.ServletRequestBindingException;
59 import org.springframework.web.bind.annotation.ModelAttribute;
60 import org.springframework.web.bind.annotation.RequestMapping;
61 import org.springframework.web.bind.annotation.RequestMethod;
62 import org.springframework.web.multipart.MultipartFile;
63 import org.springframework.web.servlet.ModelAndView;
64
65 import javax.servlet.http.HttpServletRequest;
66 import javax.servlet.http.HttpServletResponse;
67 import java.io.FileNotFoundException;
68 import java.io.IOException;
69 import java.io.InputStream;
70 import java.util.ArrayList;
71 import java.util.List;
72 import java.util.Properties;
73
74
75
76
77
78
79
80
81
82
83
84
85 public abstract class DocumentControllerBase extends UifControllerBase {
86 private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(DocumentControllerBase.class);
87
88
89
90 protected static final String[] DOCUMENT_LOAD_COMMANDS =
91 {KewApiConstants.ACTIONLIST_COMMAND, KewApiConstants.DOCSEARCH_COMMAND, KewApiConstants.SUPERUSER_COMMAND,
92 KewApiConstants.HELPDESK_ACTIONLIST_COMMAND};
93
94 private BusinessObjectService businessObjectService;
95 private DataDictionaryService dataDictionaryService;
96 private DocumentService documentService;
97 private DocumentDictionaryService documentDictionaryService;
98 private AttachmentService attachmentService;
99 private NoteService noteService;
100
101
102
103
104 @Override
105 protected abstract DocumentFormBase createInitialForm(HttpServletRequest request);
106
107
108
109
110
111
112
113
114
115
116 @RequestMapping(params = "methodToCall=docHandler")
117 public ModelAndView docHandler(@ModelAttribute("KualiForm") DocumentFormBase form, BindingResult result,
118 HttpServletRequest request, HttpServletResponse response) throws Exception {
119 String command = form.getCommand();
120
121
122 if (ArrayUtils.contains(DOCUMENT_LOAD_COMMANDS, command) && form.getDocId() != null) {
123 loadDocument(form);
124 } else if (KewApiConstants.INITIATE_COMMAND.equals(command)) {
125 createDocument(form);
126 } else {
127 LOG.error("docHandler called with invalid parameters");
128 throw new IllegalArgumentException("docHandler called with invalid parameters");
129 }
130
131
132
133
134
135
136 return getUIFModelAndView(form);
137 }
138
139
140
141
142
143
144
145
146 protected void loadDocument(DocumentFormBase form) throws WorkflowException {
147 String docId = form.getDocId();
148
149 LOG.debug("Loading document" + docId);
150
151 Document doc = null;
152 doc = getDocumentService().getByDocumentHeaderId(docId);
153 if (doc == null) {
154 throw new UnknownDocumentIdException(
155 "Document no longer exists. It may have been cancelled before being saved.");
156 }
157
158 WorkflowDocument workflowDocument = doc.getDocumentHeader().getWorkflowDocument();
159 if (!getDocumentDictionaryService().getDocumentAuthorizer(doc).canOpen(doc,
160 GlobalVariables.getUserSession().getPerson())) {
161 throw buildAuthorizationException("open", doc);
162 }
163
164
165
166 if (workflowDocument != doc.getDocumentHeader().getWorkflowDocument()) {
167 LOG.warn("Workflow document changed via canOpen check");
168 doc.getDocumentHeader().setWorkflowDocument(workflowDocument);
169 }
170
171 form.setDocument(doc);
172 WorkflowDocument workflowDoc = doc.getDocumentHeader().getWorkflowDocument();
173 form.setDocTypeName(workflowDoc.getDocumentTypeName());
174
175 KRADServiceLocatorWeb.getSessionDocumentService().addDocumentToUserSession(GlobalVariables.getUserSession(),
176 workflowDoc);
177 }
178
179
180
181
182
183
184
185
186 protected void createDocument(DocumentFormBase form) throws WorkflowException {
187 LOG.debug("Creating new document instance for doc type: " + form.getDocTypeName());
188 Document doc = getDocumentService().getNewDocument(form.getDocTypeName());
189
190 form.setDocument(doc);
191 form.setDocTypeName(doc.getDocumentHeader().getWorkflowDocument().getDocumentTypeName());
192 }
193
194
195
196
197
198
199
200
201 @RequestMapping(params = "methodToCall=reload")
202 public ModelAndView reload(@ModelAttribute("KualiForm") DocumentFormBase form, BindingResult result,
203 HttpServletRequest request, HttpServletResponse response) throws Exception {
204 Document document = form.getDocument();
205
206
207 form.setDocId(document.getDocumentNumber());
208 form.setCommand(DOCUMENT_LOAD_COMMANDS[1]);
209
210 GlobalVariables.getMessageMap().putInfo(KRADConstants.GLOBAL_MESSAGES, RiceKeyConstants.MESSAGE_RELOADED);
211
212
213 return docHandler(form, result, request, response);
214 }
215
216
217
218
219
220
221
222
223 @RequestMapping(params = "methodToCall=cancel")
224 @Override
225 public ModelAndView cancel(@ModelAttribute("KualiForm") UifFormBase form, BindingResult result,
226 HttpServletRequest request, HttpServletResponse response) {
227 DocumentFormBase documentForm = (DocumentFormBase) form;
228
229
230
231 performWorkflowAction(documentForm, WorkflowAction.CANCEL, false);
232
233 return returnToPrevious(form);
234 }
235
236
237
238
239
240
241
242 @RequestMapping(params = "methodToCall=save")
243 public ModelAndView save(@ModelAttribute("KualiForm") DocumentFormBase form, BindingResult result,
244 HttpServletRequest request, HttpServletResponse response) throws Exception {
245 performWorkflowAction(form, WorkflowAction.SAVE, true);
246
247 return getUIFModelAndView(form);
248 }
249
250
251
252
253
254
255
256 @RequestMapping(params = "methodToCall=complete")
257 public ModelAndView complete(@ModelAttribute("KualiForm")
258 DocumentFormBase form, BindingResult result, HttpServletRequest request, HttpServletResponse response) throws Exception {
259 performWorkflowAction(form, WorkflowAction.COMPLETE, true);
260
261 return getUIFModelAndView(form);
262 }
263
264
265
266
267
268
269
270 @RequestMapping(params = "methodToCall=route")
271 public ModelAndView route(@ModelAttribute("KualiForm") DocumentFormBase form, BindingResult result,
272 HttpServletRequest request, HttpServletResponse response) {
273 performWorkflowAction(form, WorkflowAction.ROUTE, true);
274
275 return getUIFModelAndView(form);
276 }
277
278
279
280
281
282
283
284 @RequestMapping(params = "methodToCall=blanketApprove")
285 public ModelAndView blanketApprove(@ModelAttribute("KualiForm") DocumentFormBase form, BindingResult result,
286 HttpServletRequest request, HttpServletResponse response) throws Exception {
287 performWorkflowAction(form, WorkflowAction.BLANKETAPPROVE, true);
288
289 return getUIFModelAndView(form);
290 }
291
292
293
294
295
296
297
298 @RequestMapping(params = "methodToCall=approve")
299 public ModelAndView approve(@ModelAttribute("KualiForm") DocumentFormBase form, BindingResult result,
300 HttpServletRequest request, HttpServletResponse response) throws Exception {
301 performWorkflowAction(form, WorkflowAction.APPROVE, true);
302
303 return returnToPrevious(form);
304 }
305
306
307
308
309
310
311
312 @RequestMapping(params = "methodToCall=disapprove")
313 public ModelAndView disapprove(@ModelAttribute("KualiForm") DocumentFormBase form, BindingResult result,
314 HttpServletRequest request, HttpServletResponse response) throws Exception {
315
316 performWorkflowAction(form, WorkflowAction.DISAPPROVE, true);
317
318 return returnToPrevious(form);
319 }
320
321
322
323
324
325
326
327 @RequestMapping(params = "methodToCall=fyi")
328 public ModelAndView fyi(@ModelAttribute("KualiForm") DocumentFormBase form, BindingResult result,
329 HttpServletRequest request, HttpServletResponse response) throws Exception {
330 performWorkflowAction(form, WorkflowAction.FYI, false);
331
332 return returnToPrevious(form);
333 }
334
335
336
337
338
339
340
341 @RequestMapping(params = "methodToCall=acknowledge")
342 public ModelAndView acknowledge(@ModelAttribute("KualiForm") DocumentFormBase form, BindingResult result,
343 HttpServletRequest request, HttpServletResponse response) throws Exception {
344 performWorkflowAction(form, WorkflowAction.ACKNOWLEDGE, false);
345
346 return returnToPrevious(form);
347 }
348
349
350
351
352
353
354
355
356
357 protected void performWorkflowAction(DocumentFormBase form, WorkflowAction action, boolean checkSensitiveData) {
358 Document document = form.getDocument();
359
360 LOG.debug("Performing workflow action " + action.name() + "for document: " + document.getDocumentNumber());
361
362
363 if (checkSensitiveData) {
364
365
366
367
368
369 }
370
371 try {
372 String successMessageKey = null;
373 switch (action) {
374 case SAVE:
375 getDocumentService().saveDocument(document);
376 successMessageKey = RiceKeyConstants.MESSAGE_SAVED;
377 break;
378 case ROUTE:
379 getDocumentService().routeDocument(document, form.getAnnotation(), combineAdHocRecipients(form));
380 successMessageKey = RiceKeyConstants.MESSAGE_ROUTE_SUCCESSFUL;
381 break;
382 case BLANKETAPPROVE:
383 getDocumentService().blanketApproveDocument(document, form.getAnnotation(), combineAdHocRecipients(
384 form));
385 successMessageKey = RiceKeyConstants.MESSAGE_ROUTE_APPROVED;
386 break;
387 case APPROVE:
388 getDocumentService().approveDocument(document, form.getAnnotation(), combineAdHocRecipients(form));
389 successMessageKey = RiceKeyConstants.MESSAGE_ROUTE_APPROVED;
390 break;
391 case DISAPPROVE:
392
393 String disapprovalNoteText = "";
394 getDocumentService().disapproveDocument(document, disapprovalNoteText);
395 successMessageKey = RiceKeyConstants.MESSAGE_ROUTE_DISAPPROVED;
396 break;
397 case FYI:
398 getDocumentService().clearDocumentFyi(document, combineAdHocRecipients(form));
399 successMessageKey = RiceKeyConstants.MESSAGE_ROUTE_FYIED;
400 break;
401 case ACKNOWLEDGE:
402 getDocumentService().acknowledgeDocument(document, form.getAnnotation(), combineAdHocRecipients(
403 form));
404 successMessageKey = RiceKeyConstants.MESSAGE_ROUTE_ACKNOWLEDGED;
405 break;
406 case CANCEL:
407 if (getDocumentService().documentExists(document.getDocumentNumber())) {
408 getDocumentService().cancelDocument(document, form.getAnnotation());
409 successMessageKey = RiceKeyConstants.MESSAGE_CANCELLED;
410 }
411 break;
412 case COMPLETE:
413 if (getDocumentService().documentExists(document.getDocumentNumber())) {
414 getDocumentService().completeDocument(document, form.getAnnotation(), combineAdHocRecipients(form));
415 successMessageKey = RiceKeyConstants.MESSAGE_ROUTE_SUCCESSFUL;
416 }
417 break;
418 }
419
420 if (successMessageKey != null) {
421 GlobalVariables.getMessageMap().putInfo(KRADConstants.GLOBAL_MESSAGES, successMessageKey);
422 }
423 } catch (ValidationException e) {
424
425
426 if (GlobalVariables.getMessageMap().hasNoErrors()) {
427 throw new RiceRuntimeException("Validation Exception with no error message.", e);
428 }
429 } catch (Exception e) {
430 throw new RiceRuntimeException(
431 "Exception trying to invoke action " + action.name() + "for document: " + document
432 .getDocumentNumber(), e);
433 }
434
435 form.setAnnotation("");
436 }
437
438
439
440
441
442
443 @RequestMapping(params = "methodToCall=supervisorFunctions")
444 public ModelAndView supervisorFunctions(@ModelAttribute("KualiForm") DocumentFormBase form, BindingResult result,
445 HttpServletRequest request, HttpServletResponse response) throws Exception {
446
447 String workflowSuperUserUrl = getConfigurationService().getPropertyValueAsString(KRADConstants.WORKFLOW_URL_KEY)
448 + "/" + KRADConstants.SUPERUSER_ACTION;
449
450 Properties props = new Properties();
451 props.put(UifParameters.METHOD_TO_CALL, "displaySuperUserDocument");
452 props.put(UifPropertyPaths.DOCUMENT_ID, form.getDocument().getDocumentNumber());
453
454 return performRedirect(form, workflowSuperUserUrl, props);
455 }
456
457
458
459
460
461
462
463
464 @RequestMapping(method = RequestMethod.POST, params = "methodToCall=insertNote")
465 public ModelAndView insertNote(@ModelAttribute("KualiForm") UifFormBase uifForm, BindingResult result,
466 HttpServletRequest request, HttpServletResponse response) {
467
468
469 String selectedCollectionPath = uifForm.getActionParamaterValue(UifParameters.SELLECTED_COLLECTION_PATH);
470 CollectionGroup collectionGroup = uifForm.getPostedView().getViewIndex().getCollectionGroupByPath(
471 selectedCollectionPath);
472 String addLinePath = collectionGroup.getAddLineBindingInfo().getBindingPath();
473 Object addLine = ObjectPropertyUtils.getPropertyValue(uifForm, addLinePath);
474 Note newNote = (Note) addLine;
475 newNote.setNotePostedTimestampToCurrent();
476
477 Document document = ((DocumentFormBase) uifForm).getDocument();
478
479 newNote.setRemoteObjectIdentifier(document.getNoteTarget().getObjectId());
480
481
482 String attachmentTypeCode = null;
483 MultipartFile attachmentFile = uifForm.getAttachmentFile();
484 Attachment attachment = null;
485 if (attachmentFile != null && !StringUtils.isBlank(attachmentFile.getOriginalFilename())) {
486 if (attachmentFile.getSize() == 0) {
487 GlobalVariables.getMessageMap().putError(String.format("%s.%s",
488 KRADConstants.NEW_DOCUMENT_NOTE_PROPERTY_NAME,
489 KRADConstants.NOTE_ATTACHMENT_FILE_PROPERTY_NAME), RiceKeyConstants.ERROR_UPLOADFILE_EMPTY,
490 attachmentFile.getOriginalFilename());
491 } else {
492 if (newNote.getAttachment() != null) {
493 attachmentTypeCode = newNote.getAttachment().getAttachmentTypeCode();
494 }
495
496 DocumentAuthorizer documentAuthorizer = getDocumentDictionaryService().getDocumentAuthorizer(document);
497 if (!documentAuthorizer.canAddNoteAttachment(document, attachmentTypeCode,
498 GlobalVariables.getUserSession().getPerson())) {
499 throw buildAuthorizationException("annotate", document);
500 }
501
502 try {
503 String attachmentType = null;
504 Attachment newAttachment = newNote.getAttachment();
505 if (newAttachment != null) {
506 attachmentType = newAttachment.getAttachmentTypeCode();
507 }
508
509 attachment = getAttachmentService().createAttachment(document.getNoteTarget(),
510 attachmentFile.getOriginalFilename(), attachmentFile.getContentType(),
511 (int) attachmentFile.getSize(), attachmentFile.getInputStream(), attachmentType);
512 } catch (IOException e) {
513 throw new RiceRuntimeException("Unable to store attachment", e);
514 }
515 }
516 }
517
518 Person kualiUser = GlobalVariables.getUserSession().getPerson();
519 if (kualiUser == null) {
520 throw new IllegalStateException("Current UserSession has a null Person.");
521 }
522
523 newNote.setAuthorUniversalIdentifier(kualiUser.getPrincipalId());
524
525
526 boolean rulePassed = KRADServiceLocatorWeb.getKualiRuleService().applyRules(new AddNoteEvent(document,
527 newNote));
528
529
530 if (rulePassed) {
531 newNote.refresh();
532
533 DocumentHeader documentHeader = document.getDocumentHeader();
534
535
536
537
538 if (attachment != null) {
539 newNote.addAttachment(attachment);
540 }
541
542 if (!documentHeader.getWorkflowDocument().isInitiated() && StringUtils.isNotEmpty(
543 document.getNoteTarget().getObjectId()) && !(document instanceof MaintenanceDocument && NoteType
544 .BUSINESS_OBJECT.getCode().equals(newNote.getNoteTypeCode()))) {
545
546 getNoteService().save(newNote);
547 }
548
549 }
550
551 return addLine(uifForm, result, request, response);
552 }
553
554
555
556
557
558
559 @RequestMapping(method = RequestMethod.POST, params = "methodToCall=deleteNote")
560 public ModelAndView deleteNote(@ModelAttribute("KualiForm") UifFormBase uifForm, BindingResult result,
561 HttpServletRequest request, HttpServletResponse response) {
562
563 String selectedLineIndex = uifForm.getActionParamaterValue("selectedLineIndex");
564 Document document = ((DocumentFormBase) uifForm).getDocument();
565 Note note = document.getNote(Integer.parseInt(selectedLineIndex));
566
567 Attachment attachment = note.getAttachment();
568 String attachmentTypeCode = null;
569 if (attachment != null) {
570 attachmentTypeCode = attachment.getAttachmentTypeCode();
571 }
572
573
574 Person user = GlobalVariables.getUserSession().getPerson();
575 String authorUniversalIdentifier = note.getAuthorUniversalIdentifier();
576 if (!getDocumentDictionaryService().getDocumentAuthorizer(document).canDeleteNoteAttachment(document,
577 attachmentTypeCode, authorUniversalIdentifier, user)) {
578 throw buildAuthorizationException("annotate", document);
579 }
580
581 if (attachment != null && attachment.isComplete()) {
582
583
584
585 if (note.getNoteIdentifier()
586 != null) {
587 attachment.refreshNonUpdateableReferences();
588 }
589 getAttachmentService().deleteAttachmentContents(attachment);
590 }
591
592 if (!document.getDocumentHeader().getWorkflowDocument().isInitiated()) {
593 getNoteService().deleteNote(note);
594 }
595
596 return deleteLine(uifForm, result, request, response);
597 }
598
599
600
601
602
603
604 @RequestMapping(method = RequestMethod.POST, params = "methodToCall=downloadAttachment")
605 public ModelAndView downloadAttachment(@ModelAttribute("KualiForm") UifFormBase uifForm, BindingResult result,
606 HttpServletRequest request,
607 HttpServletResponse response) throws ServletRequestBindingException, FileNotFoundException, IOException {
608
609 String selectedLineIndex = uifForm.getActionParamaterValue("selectedLineIndex");
610 Note note = ((DocumentFormBase) uifForm).getDocument().getNote(Integer.parseInt(selectedLineIndex));
611 Attachment attachment = note.getAttachment();
612 InputStream is = getAttachmentService().retrieveAttachmentContents(attachment);
613
614
615 response.setContentType(attachment.getAttachmentMimeTypeCode());
616 response.setContentLength(attachment.getAttachmentFileSize().intValue());
617 response.setHeader("Expires", "0");
618 response.setHeader("Cache-Control", "must-revalidate, post-check=0, pre-check=0");
619 response.setHeader("Pragma", "public");
620 response.setHeader("Content-Disposition",
621 "attachment; filename=\"" + attachment.getAttachmentFileName() + "\"");
622
623
624 FileCopyUtils.copy(is, response.getOutputStream());
625 return null;
626 }
627
628
629
630
631
632 @RequestMapping(method = RequestMethod.POST, params = "methodToCall=cancelAttachment")
633 public ModelAndView cancelAttachment(@ModelAttribute("KualiForm") UifFormBase uifForm, BindingResult result,
634 HttpServletRequest request, HttpServletResponse response) {
635
636 uifForm.setAttachmentFile(null);
637 return getUIFModelAndView(uifForm);
638 }
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657 protected String checkAndWarnAboutSensitiveData(DocumentFormBase form, HttpServletRequest request,
658 HttpServletResponse response, String fieldName, String fieldValue, String caller,
659 String context) throws Exception {
660
661 String viewName = null;
662 Document document = form.getDocument();
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717 return viewName;
718 }
719
720
721
722
723
724
725
726
727 protected List<AdHocRouteRecipient> combineAdHocRecipients(DocumentFormBase form) {
728 Document document = form.getDocument();
729
730 List<AdHocRouteRecipient> adHocRecipients = new ArrayList<AdHocRouteRecipient>();
731 adHocRecipients.addAll(document.getAdHocRoutePersons());
732 adHocRecipients.addAll(document.getAdHocRouteWorkgroups());
733
734 return adHocRecipients;
735 }
736
737
738
739
740
741
742
743 protected DocumentAuthorizationException buildAuthorizationException(String action, Document document) {
744 return new DocumentAuthorizationException(GlobalVariables.getUserSession().getPerson().getPrincipalName(),
745 action, document.getDocumentNumber());
746 }
747
748 public BusinessObjectService getBusinessObjectService() {
749 if (this.businessObjectService == null) {
750 this.businessObjectService = KRADServiceLocator.getBusinessObjectService();
751 }
752 return this.businessObjectService;
753 }
754
755 public void setBusinessObjectService(BusinessObjectService businessObjectService) {
756 this.businessObjectService = businessObjectService;
757 }
758
759 public DataDictionaryService getDataDictionaryService() {
760 if (this.dataDictionaryService == null) {
761 this.dataDictionaryService = KRADServiceLocatorWeb.getDataDictionaryService();
762 }
763 return this.dataDictionaryService;
764 }
765
766 public void setDataDictionaryService(DataDictionaryService dataDictionaryService) {
767 this.dataDictionaryService = dataDictionaryService;
768 }
769
770 public DocumentService getDocumentService() {
771 if (this.documentService == null) {
772 this.documentService = KRADServiceLocatorWeb.getDocumentService();
773 }
774 return this.documentService;
775 }
776
777 public void setDocumentService(DocumentService documentService) {
778 this.documentService = documentService;
779 }
780
781 public DocumentDictionaryService getDocumentDictionaryService() {
782 if (this.documentDictionaryService == null) {
783 this.documentDictionaryService = KRADServiceLocatorWeb.getDocumentDictionaryService();
784 }
785 return this.documentDictionaryService;
786 }
787
788 public void setDocumentDictionaryService(DocumentDictionaryService documentDictionaryService) {
789 this.documentDictionaryService = documentDictionaryService;
790 }
791
792 public AttachmentService getAttachmentService() {
793 if (attachmentService == null) {
794 attachmentService = KRADServiceLocator.getAttachmentService();
795 }
796 return this.attachmentService;
797 }
798
799 public NoteService getNoteService() {
800 if (noteService == null) {
801 noteService = KRADServiceLocator.getNoteService();
802 }
803
804 return this.noteService;
805 }
806
807 public ConfigurationService getConfigurationService() {
808 return KRADServiceLocator.getKualiConfigurationService();
809 }
810
811 }