1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.service.impl;
17
18 import org.kuali.rice.kew.api.WorkflowDocument;
19 import org.kuali.rice.krad.bo.DocumentHeader;
20 import org.kuali.rice.krad.data.DataObjectService;
21 import org.kuali.rice.krad.data.PersistenceOption;
22 import org.kuali.rice.krad.service.DocumentHeaderService;
23
24
25
26
27
28
29 public class DocumentHeaderServiceImpl implements DocumentHeaderService {
30
31 protected DataObjectService dataObjectService;
32
33
34
35
36 @Override
37 public DocumentHeader getDocumentHeaderById(String documentHeaderId) {
38 return dataObjectService.find(DocumentHeader.class, documentHeaderId);
39 }
40
41
42
43
44 @Override
45 public DocumentHeader saveDocumentHeader(DocumentHeader documentHeader) {
46 WorkflowDocument workflowDocument = documentHeader.getWorkflowDocument();
47 DocumentHeader savedDocumentHeader = dataObjectService.save(documentHeader, PersistenceOption.FLUSH);
48 savedDocumentHeader.setWorkflowDocument( workflowDocument );
49 return savedDocumentHeader;
50 }
51
52
53
54
55 @Override
56 public void deleteDocumentHeader(DocumentHeader documentHeader) {
57 dataObjectService.delete(documentHeader);
58 }
59
60 public void setDataObjectService(DataObjectService dataObjectService) {
61 this.dataObjectService = dataObjectService;
62 }
63
64 }