View Javadoc

1   package org.kuali.ole.describe.service.impl;
2   
3   import org.kuali.ole.describe.service.ExternalDSConfigMaintenanceDocumentService;
4   import org.kuali.rice.krad.maintenance.MaintenanceDocument;
5   import org.kuali.rice.krad.service.impl.MaintenanceDocumentServiceImpl;
6   import org.kuali.rice.krad.util.ObjectUtils;
7   
8   import java.io.Serializable;
9   import java.util.Map;
10  
11  /**
12   * Created with IntelliJ IDEA.
13   * User: PJ7789
14   * Date: 10/12/12
15   * Time: 5:34 PM
16   * To change this template use File | Settings | File Templates.
17   */
18  public class ExternalDSConfigMaintenanceDocumentServiceImpl
19          extends MaintenanceDocumentServiceImpl
20          implements ExternalDSConfigMaintenanceDocumentService {
21  
22      /**
23       * @see org.kuali.rice.krad.service.impl.MaintenanceDocumentServiceImpl#setupMaintenanceObject
24       */
25      /**
26       * This method creates maintenance object for delete operation using maintenanceAction.
27       *
28       * @param document
29       * @param maintenanceAction
30       * @param requestParameters
31       */
32      public void setupMaintenanceObjectForDelete(MaintenanceDocument document, String maintenanceAction,
33                                                  Map<String, String[]> requestParameters) {
34          document.getNewMaintainableObject().setMaintenanceAction(maintenanceAction);
35          document.getOldMaintainableObject().setMaintenanceAction(maintenanceAction);
36  
37          Object oldDataObject = retrieveObjectForMaintenance(document, requestParameters);
38          Object newDataObject = ObjectUtils.deepCopy((Serializable) oldDataObject);
39  
40          document.getOldMaintainableObject().setDataObject(oldDataObject);
41          document.getNewMaintainableObject().setDataObject(newDataObject);
42      }
43  }