1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.sys.businessobject.lookup;
17
18 import java.util.Properties;
19
20 import org.kuali.ole.sys.businessobject.TaxRegion;
21 import org.kuali.ole.sys.businessobject.TaxRegionType;
22 import org.kuali.ole.sys.context.SpringContext;
23 import org.kuali.rice.core.api.config.property.ConfigurationService;
24 import org.kuali.rice.kns.lookup.KualiLookupableImpl;
25 import org.kuali.rice.krad.util.KRADConstants;
26 import org.kuali.rice.krad.util.UrlFactory;
27
28 public class TaxRegionLookupableImpl extends KualiLookupableImpl {
29
30
31
32
33
34
35
36
37
38 @Override
39 public String getCreateNewUrl() {
40 String url = "";
41
42 if (getLookupableHelperService().allowsMaintenanceNewOrCopyAction()) {
43 Properties parameters = new Properties();
44 parameters.put(KRADConstants.BUSINESS_OBJECT_CLASS_ATTRIBUTE, TaxRegionType.class.getName());
45 parameters.put(KRADConstants.RETURN_LOCATION_PARAMETER, SpringContext.getBean(ConfigurationService.class).getPropertyValueAsString(KRADConstants.APPLICATION_URL_KEY) + "/" + KRADConstants.MAPPING_PORTAL);
46 parameters.put(KRADConstants.DOC_FORM_KEY, getTaxRegionDocumentTypeName());
47 parameters.put(KRADConstants.CONVERSION_FIELDS_PARAMETER, "taxRegionTypeCode:taxRegionTypeCode");
48 url = getCreateNewUrl(UrlFactory.parameterizeUrl(KRADConstants.LOOKUP_ACTION, parameters));
49 }
50
51 return url;
52 }
53
54 private String getTaxRegionDocumentTypeName() {
55 return getDataDictionaryService().getDataDictionary().getMaintenanceDocumentEntryForBusinessObjectClass(TaxRegion.class).getDocumentTypeName();
56 }
57
58 }