001    package org.kuali.ole.service.impl;
002    
003    import org.kuali.rice.krad.maintenance.MaintenanceDocument;
004    import org.kuali.rice.krad.service.DocumentService;
005    import org.kuali.rice.krad.service.impl.MaintenanceDocumentServiceImpl;
006    import org.kuali.rice.krad.util.KRADConstants;
007    import org.kuali.rice.krad.util.ObjectUtils;
008    
009    import java.io.Serializable;
010    import java.util.Map;
011    
012    /**
013     * Created with IntelliJ IDEA.
014     * User: ?
015     * Date: 10/11/12
016     * Time: 7:16 PM
017     * To change this template use File | Settings | File Templates.
018     */
019    public class OlePatronBillMaintenanceDocumentServiceImpl extends MaintenanceDocumentServiceImpl {
020    
021        private DocumentService documentService;
022    
023        /**
024         * Gets the value of documentService which is of type DocumentService
025         * @return documentService(DocumentService)
026         */
027        protected DocumentService getDocumentService() {
028            return this.documentService;
029        }
030        /**
031         * Sets the value for documentService which is of type DocumentService
032         * @param documentService(DocumentService)
033         */
034        public void setDocumentService(DocumentService documentService) {
035            this.documentService = documentService;
036        }
037    
038    
039        public void setupMaintenanceObjectForDelete(MaintenanceDocument document, String maintenanceAction,
040                                                    Map<String, String[]> requestParameters) {
041            document.getNewMaintainableObject().setMaintenanceAction(maintenanceAction);
042            document.getOldMaintainableObject().setMaintenanceAction(maintenanceAction);
043    
044            Object oldDataObject = retrieveObjectForMaintenance(document, requestParameters);
045            Object newDataObject = ObjectUtils.deepCopy((Serializable) oldDataObject);
046    
047            document.getOldMaintainableObject().setDataObject(oldDataObject);
048            document.getNewMaintainableObject().setDataObject(newDataObject);
049        }
050    
051    
052    }