View Javadoc

1   package org.kuali.ole.service.impl;
2   
3   import org.kuali.rice.krad.maintenance.MaintenanceDocument;
4   import org.kuali.rice.krad.service.DocumentService;
5   import org.kuali.rice.krad.service.impl.MaintenanceDocumentServiceImpl;
6   import org.kuali.rice.krad.util.KRADConstants;
7   import org.kuali.rice.krad.util.ObjectUtils;
8   
9   import java.io.Serializable;
10  import java.util.Map;
11  
12  /**
13   * Created with IntelliJ IDEA.
14   * User: ?
15   * Date: 10/11/12
16   * Time: 7:16 PM
17   * To change this template use File | Settings | File Templates.
18   */
19  public class OlePatronBillMaintenanceDocumentServiceImpl extends MaintenanceDocumentServiceImpl {
20  
21      private DocumentService documentService;
22  
23      /**
24       * Gets the value of documentService which is of type DocumentService
25       * @return documentService(DocumentService)
26       */
27      protected DocumentService getDocumentService() {
28          return this.documentService;
29      }
30      /**
31       * Sets the value for documentService which is of type DocumentService
32       * @param documentService(DocumentService)
33       */
34      public void setDocumentService(DocumentService documentService) {
35          this.documentService = documentService;
36      }
37  
38  
39      public void setupMaintenanceObjectForDelete(MaintenanceDocument document, String maintenanceAction,
40                                                  Map<String, String[]> requestParameters) {
41          document.getNewMaintainableObject().setMaintenanceAction(maintenanceAction);
42          document.getOldMaintainableObject().setMaintenanceAction(maintenanceAction);
43  
44          Object oldDataObject = retrieveObjectForMaintenance(document, requestParameters);
45          Object newDataObject = ObjectUtils.deepCopy((Serializable) oldDataObject);
46  
47          document.getOldMaintainableObject().setDataObject(oldDataObject);
48          document.getNewMaintainableObject().setDataObject(newDataObject);
49      }
50  
51  
52  }