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