View Javadoc
1   package org.kuali.ole.deliver.maintenance;
2   
3   import org.kuali.ole.OLEConstants;
4   import org.kuali.ole.alert.bo.AlertDocument;
5   import org.kuali.ole.deliver.bo.OleDeliverRequestBo;
6   import org.kuali.rice.krad.maintenance.MaintainableImpl;
7   import org.kuali.rice.krad.maintenance.MaintenanceDocument;
8   import org.kuali.rice.krad.util.GlobalVariables;
9   
10  import java.sql.Date;
11  import java.util.Map;
12  
13  /**
14   * Created by angelind on 12/24/14.
15   */
16  public class AlertDocumentMaintenanceImpl extends MaintainableImpl {
17  
18      @Override
19      public void processAfterNew(MaintenanceDocument document,
20                                  Map<String, String[]> requestParameters) {
21          super.processAfterNew(document, requestParameters);
22          document.getDocumentHeader().setDocumentDescription(OLEConstants.NEW_ALERT_DESCRIPTION);
23          AlertDocument alertDocument = (AlertDocument)document.getNewMaintainableObject().getDataObject();
24          if(GlobalVariables.getUserSession()!=null){
25          alertDocument.setAlertDocumentCreatorId(GlobalVariables.getUserSession().getPrincipalId());
26          }
27      }
28  
29  
30      /**
31       * This method will set the description when copy is selected
32       *
33       * @param document
34       * @param requestParameters
35       */
36      @Override
37      public void processAfterCopy(MaintenanceDocument document, Map<String, String[]> requestParameters) {
38          super.processAfterCopy(document, requestParameters);
39          document.getDocumentHeader().setDocumentDescription(OLEConstants.COPY_ALERT_DESCRIPTION);
40      }
41  
42      /**
43       * This method will set the description for edit operation
44       *
45       * @param document
46       * @param requestParameters
47       */
48      @Override
49      public void processAfterEdit(MaintenanceDocument document, Map<String, String[]> requestParameters) {
50          super.processAfterEdit(document, requestParameters);
51          document.getDocumentHeader().setDocumentDescription(OLEConstants.EDIT_ALERT_DESCRIPTION);
52      }
53  }