Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
ExtractServiceImpl |
|
| 2.2;2.2 |
1 | /* | |
2 | * Copyright 2007-2009 The Kuali Foundation | |
3 | * | |
4 | * Licensed under the Educational Community License, Version 2.0 (the "License"); | |
5 | * you may not use this file except in compliance with the License. | |
6 | * You may obtain a copy of the License at | |
7 | * | |
8 | * http://www.opensource.org/licenses/ecl2.php | |
9 | * | |
10 | * Unless required by applicable law or agreed to in writing, software | |
11 | * distributed under the License is distributed on an "AS IS" BASIS, | |
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
13 | * See the License for the specific language governing permissions and | |
14 | * limitations under the License. | |
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 | 0 | public class ExtractServiceImpl implements ExtractService { |
24 | ||
25 | 0 | 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 | 0 | return getExtractDAO().getDumpByRouteHeaderId(noteId); |
31 | } | |
32 | ||
33 | public void saveDump(Dump dump) { | |
34 | try { | |
35 | 0 | getExtractDAO().saveDump(dump); |
36 | 0 | if (! dump.getFields().isEmpty()){ |
37 | 0 | for (Iterator iter = dump.getFields().iterator(); iter.hasNext();) { |
38 | 0 | Fields field = (Fields) iter.next(); |
39 | 0 | getExtractDAO().saveField(field); |
40 | 0 | } |
41 | } | |
42 | 0 | } catch (Exception e) { |
43 | 0 | throw new RuntimeException(e); |
44 | 0 | } |
45 | 0 | } |
46 | ||
47 | public void setExtractDAO(ExtractDAO extractDAO) { | |
48 | 0 | this.extractDAO = extractDAO; |
49 | 0 | } |
50 | ||
51 | ||
52 | public void deleteDump(Long docId) { | |
53 | try { | |
54 | 0 | getExtractDAO().deleteDump(docId); |
55 | 0 | } catch (Exception e) { |
56 | 0 | throw new RuntimeException(e); |
57 | 0 | } |
58 | 0 | } |
59 | ||
60 | public ExtractDAO getExtractDAO() { | |
61 | 0 | return extractDAO; |
62 | } | |
63 | } |