View Javadoc
1   package org.kuali.ole.coa.lookup;
2   
3   import org.apache.commons.lang.StringUtils;
4   import org.kuali.ole.OLEConstants;
5   import org.kuali.ole.coa.businessobject.OleFundCode;
6   import org.kuali.ole.deliver.bo.OleDeliverRequestBo;
7   import org.kuali.ole.deliver.service.OleDeliverRequestDocumentHelperServiceImpl;
8   import org.kuali.ole.sys.context.SpringContext;
9   import org.kuali.ole.util.DocstoreUtil;
10  import org.kuali.rice.core.api.criteria.QueryByCriteria;
11  import org.kuali.rice.kim.impl.identity.name.EntityNameBo;
12  import org.kuali.rice.krad.lookup.LookupForm;
13  import org.kuali.rice.krad.lookup.LookupView;
14  import org.kuali.rice.krad.lookup.LookupableImpl;
15  import org.kuali.rice.krad.service.KRADServiceLocator;
16  import org.kuali.rice.krad.uif.UifConstants;
17  import org.kuali.rice.krad.uif.UifParameters;
18  import org.kuali.rice.krad.util.GlobalVariables;
19  import org.kuali.rice.krad.util.KRADConstants;
20  import org.kuali.rice.krad.util.KRADUtils;
21  import org.kuali.rice.krad.util.UrlFactory;
22  
23  import java.util.*;
24  
25  /**
26   * Created with IntelliJ IDEA.
27   * User: ?
28   * Date: 10/11/12
29   * Time: 4:01 PM
30   * To change this template use File | Settings | File Templates.
31   */
32  
33  public class OleFundCodeAccountingLineLookupableImpl extends LookupableImpl {
34      private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(OleFundCodeAccountingLineLookupableImpl.class);
35  
36      @Override
37      /*protected String getActionUrlHref(LookupForm lookupForm, Object dataObject, String methodToCall,
38                                        List<String> pkNames) {*/
39      protected  String getMaintenanceActionUrl(LookupForm lookupForm, Object dataObject, String methodToCall,
40                                              List<String> pkNames) {
41          LOG.debug("Inside getActionUrlHref()");
42          LookupView lookupView = (LookupView) lookupForm.getView();
43  
44          Properties props = new Properties();
45          props.put(KRADConstants.DISPATCH_REQUEST_PARAMETER, methodToCall);
46          Map<String, String> primaryKeyValues = KRADUtils.getPropertyKeyValuesFromDataObject(pkNames, dataObject);
47          for (String primaryKey : primaryKeyValues.keySet()) {
48              String primaryKeyValue = primaryKeyValues.get(primaryKey);
49  
50              props.put(primaryKey, primaryKeyValue);
51          }
52  
53          if (StringUtils.isNotBlank(lookupForm.getReturnLocation())) {
54              props.put(KRADConstants.RETURN_LOCATION_PARAMETER, lookupForm.getReturnLocation());
55          }
56  
57          props.put(UifParameters.DATA_OBJECT_CLASS_NAME, OleFundCode.class.getName());
58          props.put(UifParameters.VIEW_TYPE_NAME, UifConstants.ViewType.MAINTENANCE.name());
59  
60          String maintenanceMapping = OLEConstants.OLEEResourceRecord.FUND_ACCOUNTING_LINE_MAINTENANCE_ACTION_LINK;
61  
62          return UrlFactory.parameterizeUrl(maintenanceMapping, props);
63      }
64  
65  }
66  
67