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