1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.coa.businessobject.lookup;
17
18 import java.util.List;
19 import java.util.Map;
20 import java.util.Properties;
21
22 import org.kuali.ole.coa.businessobject.AccountDelegateGlobal;
23 import org.kuali.ole.sys.OLEConstants;
24 import org.kuali.rice.kns.document.authorization.BusinessObjectRestrictions;
25 import org.kuali.rice.kns.lookup.HtmlData;
26 import org.kuali.rice.kns.lookup.KualiLookupableHelperServiceImpl;
27 import org.kuali.rice.kns.lookup.HtmlData.AnchorHtmlData;
28 import org.kuali.rice.kns.web.struts.form.LookupForm;
29 import org.kuali.rice.krad.bo.BusinessObject;
30
31
32
33
34
35 public class OrganizationRoutingModelNameLookupableHelperServiceImpl extends KualiLookupableHelperServiceImpl {
36 private boolean initializingDelegate = true;
37
38
39
40
41
42
43 @Override
44 public String getBackLocation() {
45
46
47 return OLEConstants.MAINTENANCE_ACTION;
48 }
49
50
51
52
53
54
55
56
57
58
59
60
61
62 @Override
63 public HtmlData getReturnUrl(BusinessObject businessObject, LookupForm lookupForm, List returnKeys, BusinessObjectRestrictions businessObjectRestrictions) {
64 String originalBackLocation = this.backLocation;
65 Properties parameters = getParameters(businessObject, lookupForm.getFieldConversions(), lookupForm.getLookupableImplServiceName(), returnKeys);
66 parameters.put(OLEConstants.DISPATCH_REQUEST_PARAMETER, OLEConstants.MAINTENANCE_NEWWITHEXISTING_ACTION);
67 parameters.put(OLEConstants.BUSINESS_OBJECT_CLASS_ATTRIBUTE, AccountDelegateGlobal.class.getName());
68 parameters.put(OLEConstants.OVERRIDE_KEYS, "modelName" + OLEConstants.FIELD_CONVERSIONS_SEPERATOR + "modelChartOfAccountsCode" + OLEConstants.FIELD_CONVERSIONS_SEPERATOR + "modelOrganizationCode");
69 setBackLocation(OLEConstants.MAINTENANCE_ACTION);
70 AnchorHtmlData htmlData = (AnchorHtmlData)getReturnAnchorHtmlData(businessObject, parameters, lookupForm, returnKeys, businessObjectRestrictions);
71 setBackLocation(originalBackLocation);
72 return htmlData;
73 }
74
75
76
77
78
79
80 @Override
81 public void setFieldConversions(Map fieldConversions) {
82 super.setFieldConversions(fieldConversions);
83 if (fieldConversions == null || fieldConversions.size() == 0) {
84
85
86
87
88
89 initializingDelegate = false;
90 }
91 }
92
93
94
95
96
97
98 @Override
99 public List<HtmlData> getCustomActionUrls(BusinessObject businessObject, List pkNames) {
100 if (!initializingDelegate) {
101 return super.getCustomActionUrls(businessObject, pkNames);
102 }
103 else {
104 return super.getEmptyActionUrls();
105 }
106 }
107 }