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.apache.commons.lang.StringUtils; |
19 | |
import org.kuali.rice.krad.bo.DocumentHeader; |
20 | |
import org.kuali.rice.krad.dao.DocumentHeaderDao; |
21 | |
import org.kuali.rice.krad.service.DocumentHeaderService; |
22 | |
import org.kuali.rice.krad.service.KRADServiceLocator; |
23 | |
import org.springframework.transaction.annotation.Transactional; |
24 | |
|
25 | |
|
26 | |
|
27 | |
|
28 | |
|
29 | |
|
30 | |
|
31 | |
|
32 | |
@Transactional |
33 | 0 | public class DocumentHeaderServiceImpl implements DocumentHeaderService { |
34 | 0 | private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(DocumentHeaderServiceImpl.class); |
35 | |
private DocumentHeaderDao documentHeaderDao; |
36 | |
|
37 | |
|
38 | |
|
39 | |
|
40 | |
public Class<? extends DocumentHeader> getDocumentHeaderBaseClass() { |
41 | 0 | Class documentHeaderClass = documentHeaderDao.getDocumentHeaderBaseClass(); |
42 | 0 | if ( (documentHeaderClass == null) || (!DocumentHeader.class.isAssignableFrom(documentHeaderClass)) ) { |
43 | 0 | throw new RuntimeException("invalid document header base class '" + documentHeaderClass + "' returned by dao '" + documentHeaderDao.getClass().getName() + "'"); |
44 | |
} |
45 | 0 | return documentHeaderClass; |
46 | |
} |
47 | |
|
48 | |
|
49 | |
|
50 | |
|
51 | |
public DocumentHeader getDocumentHeaderById(String documentHeaderId) { |
52 | 0 | if (StringUtils.isBlank(documentHeaderId)) { |
53 | 0 | throw new IllegalArgumentException("document header id given is blank"); |
54 | |
} |
55 | 0 | return documentHeaderDao.getByDocumentHeaderId(documentHeaderId); |
56 | |
} |
57 | |
|
58 | |
|
59 | |
|
60 | |
|
61 | |
public void saveDocumentHeader(DocumentHeader documentHeader) { |
62 | 0 | KRADServiceLocator.getBusinessObjectService().save(documentHeader); |
63 | 0 | } |
64 | |
|
65 | |
|
66 | |
|
67 | |
|
68 | |
public void deleteDocumentHeader(DocumentHeader documentHeader) { |
69 | 0 | KRADServiceLocator.getBusinessObjectService().delete(documentHeader); |
70 | 0 | } |
71 | |
|
72 | |
|
73 | |
|
74 | |
|
75 | |
|
76 | |
|
77 | |
public void setDocumentHeaderDao(DocumentHeaderDao documentHeaderDao) { |
78 | 0 | this.documentHeaderDao = documentHeaderDao; |
79 | 0 | } |
80 | |
|
81 | |
} |