1 package org.kuali.ole.select.lookup;
2
3 import org.apache.commons.lang.StringUtils;
4 import org.kuali.ole.OLEConstants;
5
6 import org.kuali.ole.select.bo.OLEAccessActivationConfiguration;
7 import org.kuali.ole.select.bo.OLEAccessActivationWorkFlow;
8 import org.kuali.ole.select.bo.OLERoleBo;
9 import org.kuali.rice.krad.lookup.LookupUtils;
10 import org.kuali.rice.krad.lookup.LookupableImpl;
11 import org.kuali.rice.krad.service.KRADServiceLocator;
12 import org.kuali.rice.krad.uif.UifConstants;
13 import org.kuali.rice.krad.uif.UifParameters;
14 import org.kuali.rice.krad.uif.view.LookupView;
15 import org.kuali.rice.krad.util.GlobalVariables;
16 import org.kuali.rice.krad.util.KRADConstants;
17 import org.kuali.rice.krad.util.KRADUtils;
18 import org.kuali.rice.krad.util.UrlFactory;
19 import org.kuali.rice.krad.web.form.LookupForm;
20
21 import java.util.*;
22
23
24
25
26 public class OLEAccessActivationConfigurationLookupableImpl extends LookupableImpl {
27 private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(OLEAccessActivationConfigurationLookupableImpl.class);
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67 @Override
68 protected String getActionUrlHref(LookupForm lookupForm, Object dataObject, String methodToCall,
69 List<String> pkNames) {
70 LOG.debug("Inside getActionUrlHref()");
71 LookupView lookupView = (LookupView) lookupForm.getView();
72
73 Properties props = new Properties();
74 props.put(KRADConstants.DISPATCH_REQUEST_PARAMETER, methodToCall);
75 Map<String, String> primaryKeyValues = KRADUtils.getPropertyKeyValuesFromDataObject(pkNames, dataObject);
76 for (String primaryKey : primaryKeyValues.keySet()) {
77 String primaryKeyValue = primaryKeyValues.get(primaryKey);
78
79 props.put(primaryKey, primaryKeyValue);
80 }
81
82 if (StringUtils.isNotBlank(lookupForm.getReturnLocation())) {
83 props.put(KRADConstants.RETURN_LOCATION_PARAMETER, lookupForm.getReturnLocation());
84 }
85
86 props.put(UifParameters.DATA_OBJECT_CLASS_NAME, OLEAccessActivationConfiguration.class.getName());
87 props.put(UifParameters.VIEW_TYPE_NAME, UifConstants.ViewType.MAINTENANCE.name());
88
89 String maintenanceMapping = OLEConstants.ACCESS_ACTIVATION_CONFIGURATION_CONTROLLER;
90
91 return UrlFactory.parameterizeUrl(maintenanceMapping, props);
92 }
93 }