View Javadoc
1   /*
2    * Copyright 2011 The Kuali Foundation.
3    *
4    * Licensed under the Educational Community License, Version 1.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/ecl1.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.ole.fp.document.authorization;
17  
18  import java.util.Set;
19  
20  import org.kuali.ole.sys.OLEConstants;
21  import org.kuali.ole.sys.document.AmountTotaling;
22  import org.kuali.ole.sys.document.FinancialSystemTransactionalDocument;
23  import org.kuali.ole.sys.document.authorization.FinancialSystemTransactionalDocumentPresentationControllerBase;
24  import org.kuali.rice.krad.document.Document;
25  
26  public class AdvanceDepositDocumentPresentationController extends FinancialSystemTransactionalDocumentPresentationControllerBase{
27  
28      @Override
29      public Set<String> getDocumentActions(Document document) {
30  
31          Set<String> documentActions = super.getDocumentActions(document);
32  
33          if (document instanceof FinancialSystemTransactionalDocument) {
34              if (canErrorCorrect((FinancialSystemTransactionalDocument) document)) {
35                  documentActions.add(OLEConstants.KFS_ACTION_CAN_ERROR_CORRECT);
36              }
37  
38              documentActions.add(OLEConstants.KFS_ACTION_CAN_EDIT_BANK);
39          }
40  
41          return documentActions;
42      }
43  
44      @Override
45      public Set<String> getEditModes(Document document) {
46  
47          Set<String> editModes = super.getEditModes(document);
48          if (document instanceof AmountTotaling) {
49              editModes.add(OLEConstants.AMOUNT_TOTALING_EDITING_MODE);
50          }
51  
52          editModes.add(OLEConstants.BANK_ENTRY_VIEWABLE_EDITING_MODE);
53  
54          return editModes;
55  
56      }
57  }