1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.pdp.document.authorization;
17
18 import java.util.Set;
19
20 import org.apache.commons.lang.StringUtils;
21 import org.kuali.ole.pdp.PdpPropertyConstants;
22 import org.kuali.ole.pdp.PdpConstants.PayeeIdTypeCodes;
23 import org.kuali.ole.pdp.businessobject.PayeeACHAccount;
24 import org.kuali.ole.sys.document.authorization.FinancialSystemMaintenanceDocumentPresentationControllerBase;
25 import org.kuali.rice.kns.document.MaintenanceDocument;
26
27 public class PayeeACHAccountMaintenanceDocumentPresentationController extends FinancialSystemMaintenanceDocumentPresentationControllerBase {
28
29
30
31
32 @Override
33 public Set<String> getConditionallyReadOnlyPropertyNames(MaintenanceDocument document) {
34 Set<String> readOnlyPropertyNames = super.getConditionallyReadOnlyPropertyNames(document);
35
36 PayeeACHAccount payeeAccount = (PayeeACHAccount)document.getNewMaintainableObject().getBusinessObject();
37 String payeeIdTypeCode = payeeAccount.getPayeeIdentifierTypeCode();
38
39
40 if (StringUtils.equalsIgnoreCase(payeeIdTypeCode, PayeeIdTypeCodes.EMPLOYEE) ||
41 StringUtils.equalsIgnoreCase(payeeIdTypeCode, PayeeIdTypeCodes.ENTITY)) {
42 readOnlyPropertyNames.add(PdpPropertyConstants.PAYEE_NAME);
43 readOnlyPropertyNames.add(PdpPropertyConstants.PAYEE_EMAIL_ADDRESS);
44 }
45
46 else if (StringUtils.equalsIgnoreCase(payeeIdTypeCode, PayeeIdTypeCodes.VENDOR_ID)) {
47 readOnlyPropertyNames.add(PdpPropertyConstants.PAYEE_NAME);
48 }
49
50 return readOnlyPropertyNames;
51 }
52
53 }