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