1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.kew.edl.extract;
17
18 import java.util.Iterator;
19
20 import org.kuali.rice.kew.edl.extract.dao.ExtractDAO;
21
22
23 public class ExtractServiceImpl implements ExtractService {
24
25 private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(ExtractServiceImpl.class);
26
27 private ExtractDAO extractDAO;
28
29 public Dump getDumpByDocumentId(Long noteId) {
30 return getExtractDAO().getDumpByRouteHeaderId(noteId);
31 }
32
33 public void saveDump(Dump dump) {
34 try {
35 getExtractDAO().saveDump(dump);
36 if (! dump.getFields().isEmpty()){
37 for (Iterator iter = dump.getFields().iterator(); iter.hasNext();) {
38 Fields field = (Fields) iter.next();
39 getExtractDAO().saveField(field);
40 }
41 }
42 } catch (Exception e) {
43 throw new RuntimeException(e);
44 }
45 }
46
47 public void setExtractDAO(ExtractDAO extractDAO) {
48 this.extractDAO = extractDAO;
49 }
50
51
52 public void deleteDump(Long docId) {
53 try {
54 getExtractDAO().deleteDump(docId);
55 } catch (Exception e) {
56 throw new RuntimeException(e);
57 }
58 }
59
60 public ExtractDAO getExtractDAO() {
61 return extractDAO;
62 }
63 }