1 package org.kuali.ole.patron.lookup;
2
3 import org.apache.commons.lang.StringUtils;
4 import org.kuali.ole.OLEConstants;
5 import org.kuali.ole.patron.bill.PatronBill;
6 import org.kuali.ole.service.OlePatronHelperService;
7 import org.kuali.ole.service.OlePatronHelperServiceImpl;
8 import org.kuali.rice.core.api.encryption.EncryptionService;
9 import org.kuali.rice.kim.api.identity.Person;
10 import org.kuali.rice.krad.bo.ExternalizableBusinessObject;
11 import org.kuali.rice.krad.lookup.LookupUtils;
12 import org.kuali.rice.krad.lookup.LookupableImpl;
13 import org.kuali.rice.krad.uif.UifConstants;
14 import org.kuali.rice.krad.uif.UifParameters;
15 import org.kuali.rice.krad.uif.control.HiddenControl;
16 import org.kuali.rice.krad.uif.field.InputField;
17 import org.kuali.rice.krad.uif.util.ComponentUtils;
18 import org.kuali.rice.krad.uif.view.LookupView;
19 import org.kuali.rice.krad.util.*;
20 import org.kuali.rice.krad.web.form.LookupForm;
21
22 import java.security.GeneralSecurityException;
23 import java.util.*;
24
25
26
27
28 public class OlePatronBillLookupableImpl extends LookupableImpl {
29 private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(OlePatronBillLookupableImpl.class);
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49 protected String getActionUrlHref(LookupForm lookupForm, Object dataObject, String methodToCall,
50 List<String> pkNames) {
51 LookupView lookupView = (LookupView) lookupForm.getView();
52 Properties props = new Properties();
53 props.put(KRADConstants.DISPATCH_REQUEST_PARAMETER, methodToCall);
54
55 Map<String, String> primaryKeyValues = KRADUtils.getPropertyKeyValuesFromDataObject(pkNames, dataObject);
56 for (String primaryKey : primaryKeyValues.keySet()) {
57 String primaryKeyValue = primaryKeyValues.get(primaryKey);
58
59 props.put(primaryKey, primaryKeyValue);
60 }
61
62 if (StringUtils.isNotBlank(lookupForm.getReturnLocation())) {
63 props.put(KRADConstants.RETURN_LOCATION_PARAMETER, lookupForm.getReturnLocation());
64 }
65
66 props.put(UifParameters.DATA_OBJECT_CLASS_NAME, lookupForm.getDataObjectClassName());
67 props.put(UifParameters.VIEW_TYPE_NAME, UifConstants.ViewType.MAINTENANCE.name());
68
69 String maintenanceMapping = "patronBillMaintenance";
70
71 return UrlFactory.parameterizeUrl(maintenanceMapping, props);
72 }
73
74 }