Coverage Report - org.kuali.rice.edl.impl.extract.ExtractServiceImpl
 
Classes in this File Line Coverage Branch Coverage Complexity
ExtractServiceImpl
0%
0/22
0%
0/4
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.edl.impl.extract;
 17  
 
 18  
 import java.util.Iterator;
 19  
 
 20  
 import org.kuali.rice.edl.framework.extract.DumpDTO;
 21  
 import org.kuali.rice.edl.framework.extract.ExtractService;
 22  
 import org.kuali.rice.edl.impl.extract.dao.ExtractDAO;
 23  
 
 24  
 
 25  0
 public class ExtractServiceImpl implements ExtractService {
 26  
 
 27  0
         private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(ExtractServiceImpl.class);
 28  
 
 29  
         private ExtractDAO extractDAO;
 30  
 
 31  
         public DumpDTO getDumpByDocumentId(String documentId) {
 32  0
                 return Dump.to(getExtractDAO().getDumpByDocumentId(documentId));
 33  
         }
 34  
 
 35  
         public void saveDump(DumpDTO dumpDTO) {
 36  
                 try {
 37  0
                         Dump dump = Dump.from(dumpDTO);
 38  0
                         getExtractDAO().saveDump(dump);
 39  0
                         if (! dump.getFields().isEmpty()){
 40  0
                                 for (Iterator iter = dump.getFields().iterator(); iter.hasNext();) {
 41  0
                                         Fields field = (Fields) iter.next();
 42  0
                                         getExtractDAO().saveField(field);
 43  0
                                 }
 44  
                         }
 45  0
                 } catch (Exception e) {
 46  0
                         throw new RuntimeException(e);
 47  0
                 }
 48  0
         }
 49  
 
 50  
         public void setExtractDAO(ExtractDAO extractDAO) {
 51  0
                 this.extractDAO = extractDAO;
 52  0
         }
 53  
 
 54  
 
 55  
         public void deleteDump(String docId) {
 56  
                 try {
 57  0
                         getExtractDAO().deleteDump(docId);
 58  0
                 } catch (Exception e) {
 59  0
                         throw new RuntimeException(e);
 60  0
                 }
 61  0
         }
 62  
 
 63  
         public ExtractDAO getExtractDAO() {
 64  0
                 return extractDAO;
 65  
         }
 66  
 }