View Javadoc

1   /**
2    * Copyright 2011 The Kuali Foundation Licensed under the
3    * Educational Community License, Version 2.0 (the "License"); you may
4    * not use this file except in compliance with the License. You may
5    * obtain a copy of the License at
6    *
7    * http://www.osedu.org/licenses/ECL-2.0
8    *
9    * Unless required by applicable law or agreed to in writing,
10   * software distributed under the License is distributed on an "AS IS"
11   * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12   * or implied. See the License for the specific language governing
13   * permissions and limitations under the License.
14   */
15  
16  package org.kuali.mobility.reporting.service;
17  
18  import java.util.List;
19  
20  import javax.ws.rs.GET;
21  import javax.ws.rs.Path;
22  import javax.ws.rs.QueryParam;
23  
24  import org.kuali.mobility.file.entity.File;
25  import org.kuali.mobility.reporting.dao.ReportingDao;
26  import org.kuali.mobility.reporting.entity.Submission;
27  import org.springframework.beans.factory.annotation.Autowired;
28  import org.springframework.transaction.annotation.Transactional;
29  
30  /**
31   * @author Kuali Mobility Team (mobility.collab@kuali.org)
32   */
33  public class ReportingServiceImpl implements ReportingService {
34  
35      @Autowired
36      private ReportingDao reportingDao;
37  
38      @GET
39      @Path("/submission/search")
40  	@Override
41  	@Transactional
42      public Submission findSubmissionById(@QueryParam(value = "id")Long id) {
43  		return reportingDao.findSubmissionById(id);
44      }
45      
46      @GET
47      @Path("/submission/lookup")
48  	@Override
49  	@Transactional
50      public List<Submission> findAllSubmissions() {
51  		return reportingDao.findAllSubmissions();
52      }
53      
54  	@Override
55  	@Transactional
56  	public Long saveSubmission(Submission submission) {		
57  		return reportingDao.saveSubmission(submission);
58  	} 
59      
60  	@Override
61  	@Transactional
62      public Long saveAttachment(File file) {
63  		return reportingDao.saveAttachment(file);
64      }
65      
66  	@GET
67      @Path("/submission/byparent")
68  	@Override
69  	@Transactional
70      public List<Submission> findAllSubmissionsByParentId(@QueryParam(value = "id") Long id) {
71  		return reportingDao.findAllSubmissionsByParentId(id);
72  	}
73  
74      public ReportingDao getReportingDao() {
75          return reportingDao;
76      }
77  
78      public void setReportingDao(ReportingDao reportingDao) {
79          this.reportingDao = reportingDao;
80      }
81  }