1   
2   
3   
4   
5   
6   
7   
8   
9   
10  
11  
12  
13  
14  
15  
16  package org.kuali.ole.fp.document.authorization;
17  
18  import java.util.Map;
19  
20  import org.kuali.ole.sys.OLEConstants;
21  import org.kuali.ole.sys.OLEKeyConstants;
22  import org.kuali.ole.sys.businessobject.AccountingLine;
23  import org.kuali.ole.sys.document.authorization.AccountingLineAuthorizerBase;
24  import org.kuali.ole.sys.document.web.AccountingLineRenderingContext;
25  import org.kuali.ole.sys.document.web.AccountingLineViewAction;
26  
27  
28  
29  
30  public class FinancialTransactionalDocumentAccountingLineAuthorizerBase extends AccountingLineAuthorizerBase {
31      
32      
33  
34  
35  
36      @Override
37      protected Map<String, AccountingLineViewAction> getActionMap(AccountingLineRenderingContext accountingLineRenderingContext, String accountingLinePropertyName, Integer accountingLineIndex, String groupTitle) {
38      
39          Map<String, AccountingLineViewAction> actionMap = super.getActionMap(accountingLineRenderingContext, accountingLinePropertyName, accountingLineIndex, groupTitle);
40  
41          if (accountingLineIndex != null) {
42              AccountingLineViewAction refreshAction = this.getRefreshAction(accountingLineRenderingContext.getAccountingLine(), accountingLinePropertyName, accountingLineIndex, groupTitle);
43              actionMap.put(OLEConstants.RETURN_METHOD_TO_CALL, refreshAction);
44          }
45          
46          return actionMap;
47      }
48      
49      
50  
51  
52  
53  
54  
55  
56  
57  
58      protected AccountingLineViewAction getRefreshAction(AccountingLine accountingLine, String accountingLinePropertyName, Integer accountingLineIndex, String groupTitle) {
59          String actionMethod = this.getRefreshLineMethod(accountingLine, accountingLinePropertyName, accountingLineIndex);
60          String actionLabel = getActionLabel(OLEKeyConstants.AccountingLineViewRendering.ACCOUNTING_LINE_REFRESH_ACTION_LABEL, groupTitle, accountingLineIndex + 1);
61  
62          String actionImageName = getRiceImagePath() + "tinybutton-refresh.gif";
63  
64          return new AccountingLineViewAction(actionMethod, actionLabel, actionImageName);
65      }
66      
67      
68  
69  
70  
71  
72  
73  
74  
75      protected String getRefreshLineMethod(AccountingLine accountingLine, String accountingLineProperty, Integer accountingLineIndex) {
76          final String infix = getActionInfixForExtantAccountingLine(accountingLine, accountingLineProperty);
77          return "refresh.line" + accountingLineIndex + ".anchoraccounting" + infix + "Anchor";
78      }
79  }