1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.kew.rule.bo; |
17 | |
|
18 | |
import java.util.List; |
19 | |
import java.util.Map; |
20 | |
|
21 | |
import org.kuali.rice.core.config.ConfigContext; |
22 | |
import org.kuali.rice.kew.rule.RuleBaseValues; |
23 | |
import org.kuali.rice.kew.rule.web.WebRuleUtils; |
24 | |
import org.kuali.rice.kew.util.KEWConstants; |
25 | |
import org.kuali.rice.kew.util.KEWPropertyConstants; |
26 | |
import org.kuali.rice.kns.bo.BusinessObject; |
27 | |
import org.kuali.rice.kns.inquiry.KualiInquirableImpl; |
28 | |
import org.kuali.rice.kns.lookup.HtmlData; |
29 | |
import org.kuali.rice.kns.lookup.HtmlData.AnchorHtmlData; |
30 | |
import org.kuali.rice.kns.web.ui.Section; |
31 | |
|
32 | |
|
33 | |
|
34 | |
|
35 | |
|
36 | |
|
37 | |
|
38 | 0 | public class RuleBaseValuesInquirableImpl extends KualiInquirableImpl { |
39 | |
|
40 | |
public static final String ROUTE_HEADER_ID = "routeHeaderId"; |
41 | |
|
42 | |
|
43 | |
|
44 | |
|
45 | |
|
46 | |
|
47 | |
|
48 | |
public BusinessObject getBusinessObject(Map fieldValues) { |
49 | 0 | RuleBaseValues rule = (RuleBaseValues)super.getBusinessObject(fieldValues); |
50 | 0 | WebRuleUtils.populateRuleMaintenanceFields(rule); |
51 | 0 | return rule; |
52 | |
} |
53 | |
|
54 | |
|
55 | |
|
56 | |
|
57 | |
|
58 | |
|
59 | |
public List getSections(BusinessObject bo) { |
60 | 0 | List<Section> sections = super.getSections(bo); |
61 | |
|
62 | 0 | return WebRuleUtils.customizeSections((RuleBaseValues)bo, sections, false); |
63 | |
|
64 | |
} |
65 | |
|
66 | |
|
67 | |
|
68 | |
|
69 | |
|
70 | |
|
71 | |
@Override |
72 | |
public HtmlData getInquiryUrl(BusinessObject businessObject, String attributeName, boolean forceInquiry) { |
73 | |
|
74 | 0 | if(ROUTE_HEADER_ID.equals(attributeName)) { |
75 | |
|
76 | 0 | AnchorHtmlData link = new AnchorHtmlData(); |
77 | 0 | RuleBaseValues rule = (RuleBaseValues)businessObject; |
78 | |
|
79 | 0 | Long routeHeaderId = rule.getRouteHeaderId(); |
80 | 0 | link.setDisplayText(routeHeaderId+""); |
81 | |
|
82 | 0 | String href = ConfigContext.getCurrentContextConfig().getKEWBaseURL() + "/" + |
83 | |
KEWConstants.DOC_HANDLER_REDIRECT_PAGE + "?" + KEWConstants.COMMAND_PARAMETER + "=" + |
84 | |
KEWConstants.DOCSEARCH_COMMAND + "&" + KEWConstants.ROUTEHEADER_ID_PARAMETER + "=" + routeHeaderId; |
85 | |
|
86 | 0 | link.setHref(href); |
87 | |
|
88 | 0 | return link; |
89 | |
} |
90 | 0 | return super.getInquiryUrl(businessObject, attributeName, forceInquiry); |
91 | |
} |
92 | |
|
93 | |
} |