View Javadoc
1   /**
2    * Copyright 2005-2016 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.krad.maintenance;
17  
18  import org.kuali.rice.krad.document.DocumentControllerService;
19  import org.kuali.rice.krad.web.form.MaintenanceDocumentForm;
20  import org.springframework.web.servlet.ModelAndView;
21  
22  import javax.servlet.http.HttpServletResponse;
23  
24  /**
25   * Controller service that extends {@link org.kuali.rice.krad.document.DocumentControllerService} and adds
26   * methods specific to maintenance documents.
27   *
28   * @author Kuali Rice Team (rice.collab@kuali.org)
29   */
30  public interface MaintenanceDocumentControllerService extends DocumentControllerService {
31  
32      /**
33       * Sets up a new maintenance document for an edit action on the data object identified by the form
34       * parameters.
35       *
36       * @param form form instance containing the maintenance data
37       * @return ModelAndView instance for rendering the edit maintenance view
38       */
39      ModelAndView setupMaintenanceEdit(MaintenanceDocumentForm form);
40  
41      /**
42       * Sets up a new maintenance document for a copy action on the data object identified by the form
43       * parameters.
44       *
45       * @param form form instance containing the maintenance data
46       * @return ModelAndView instance for rendering the copy maintenance view
47       */
48      ModelAndView setupMaintenanceCopy(MaintenanceDocumentForm form);
49  
50      /**
51       * Sets up a new maintenance document for a new with existing action on the data object identified by the form
52       * parameters.
53       *
54       * @param form form instance containing the maintenance data
55       * @return ModelAndView instance for rendering the new maintenance view
56       */
57      ModelAndView setupMaintenanceNewWithExisting(MaintenanceDocumentForm form);
58  
59      /**
60       * Sets up a new maintenance document for a delete action on the data object identified by the form
61       * parameters.
62       *
63       * @param form form instance containing the maintenance data
64       * @return ModelAndView instance for rendering the delete maintenance view
65       */
66      ModelAndView setupMaintenanceDelete(MaintenanceDocumentForm form);
67  
68      /**
69       * Invoked to setup a new maintenance document for the maintenance data contained on the form
70       * and the given maintenance action.
71       *
72       * @param form form instance containing the maintenance data
73       * @param maintenanceAction type of maintenance action being requested (new, edit, copy, delete)
74       */
75      void setupMaintenanceDocument(MaintenanceDocumentForm form, String maintenanceAction);
76  
77      /**
78       * When the maintenance data object is a {@link org.kuali.rice.krad.bo.PersistableAttachment} or
79       * {@link org.kuali.rice.krad.bo.PersistableAttachmentList}, streams the selected attachment back to the
80       * response.
81       *
82       * @param form form instance containing the maintenance data
83       * @param response Http response for returning the attachment contents
84       */
85      void downloadDataObjectAttachment(MaintenanceDocumentForm form, HttpServletResponse response);
86  }