1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.kew.lookupable;
17
18 import java.util.ArrayList;
19 import java.util.Collection;
20 import java.util.List;
21 import java.util.Properties;
22
23 import org.kuali.rice.core.config.ConfigContext;
24 import org.kuali.rice.kew.edl.UserAction;
25 import org.kuali.rice.kew.edl.bo.EDocLiteAssociation;
26 import org.kuali.rice.kns.bo.BusinessObject;
27 import org.kuali.rice.kns.lookup.HtmlData;
28 import org.kuali.rice.kns.lookup.KualiLookupableHelperServiceImpl;
29 import org.kuali.rice.kns.lookup.HtmlData.AnchorHtmlData;
30 import org.kuali.rice.kns.util.UrlFactory;
31 import org.kuali.rice.kns.web.struts.form.LookupForm;
32
33
34
35
36
37
38
39
40 public class EDocLiteLookupableHelperServiceImpl extends KualiLookupableHelperServiceImpl{
41
42 private static final long serialVersionUID = 3157354920258155881L;
43
44
45
46
47 @Override
48 public List<HtmlData> getCustomActionUrls(BusinessObject businessObject, List pkNames) {
49 List<HtmlData> anchorHtmlDataList = new ArrayList<HtmlData>();
50 anchorHtmlDataList.add(getCreateDocumentUrl((EDocLiteAssociation) businessObject));
51 return anchorHtmlDataList;
52 }
53
54 protected HtmlData getCreateDocumentUrl(EDocLiteAssociation edlAssociation) {
55 String href = "";
56
57 Properties parameters = new Properties();
58 parameters.put("userAction", UserAction.ACTION_CREATE);
59 parameters.put("edlName", edlAssociation.getEdlName());
60 href = UrlFactory.parameterizeUrl(
61 ConfigContext.getCurrentContextConfig().getKEWBaseURL()+"/EDocLite",
62 parameters);
63
64 AnchorHtmlData anchorHtmlData = new AnchorHtmlData(href, null, "Create Document");
65 return anchorHtmlData;
66 }
67
68
69
70
71
72
73 @Override
74 public Collection performLookup(LookupForm lookupForm,
75 Collection resultTable, boolean bounded) {
76 lookupForm.setShowMaintenanceLinks(true);
77 return super.performLookup(lookupForm, resultTable, bounded);
78 }
79
80 }