1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.coa.businessobject.inquiry;
17
18 import java.util.ArrayList;
19 import java.util.List;
20 import java.util.Properties;
21
22 import org.kuali.ole.coa.businessobject.Organization;
23 import org.kuali.ole.coa.identity.OrgReviewRole;
24 import org.kuali.ole.sys.businessobject.inquiry.KfsInquirableImpl;
25 import org.kuali.ole.sys.identity.OleKimAttributes;
26 import org.kuali.rice.kim.api.KimConstants;
27 import org.kuali.rice.kns.lookup.HtmlData;
28 import org.kuali.rice.kns.lookup.HtmlData.AnchorHtmlData;
29 import org.kuali.rice.kns.web.ui.Field;
30 import org.kuali.rice.kns.web.ui.Row;
31 import org.kuali.rice.kns.web.ui.Section;
32 import org.kuali.rice.krad.bo.BusinessObject;
33 import org.kuali.rice.krad.util.KRADConstants;
34 import org.kuali.rice.krad.util.UrlFactory;
35
36
37
38
39 public class OrgInquirable extends KfsInquirableImpl {
40
41
42
43
44
45 public void addAdditionalSections(List sections, BusinessObject bo) {
46 if (bo instanceof Organization) {
47 Organization org = (Organization) bo;
48
49 List rows = new ArrayList();
50
51 Field f = new Field();
52 f.setPropertyName("Organization Hierarchy");
53 f.setFieldLabel("Organization Hierarchy");
54 f.setPropertyValue(org.getOrganizationHierarchy());
55 f.setFieldType(Field.TEXT);
56 rows.add(new Row(f));
57
58 f = new Field();
59 f.setPropertyName("Organization Review Hierarchy");
60 f.setFieldLabel("Organization Review Hierarchy");
61 f.setPropertyValue("run search");
62 f.setFieldType(Field.TEXT);
63 Properties parameters = new Properties();
64 parameters.put(OleKimAttributes.CHART_OF_ACCOUNTS_CODE, org.getChartOfAccountsCode());
65 parameters.put(OleKimAttributes.ORGANIZATION_CODE, org.getOrganizationCode());
66 parameters.put(KRADConstants.BUSINESS_OBJECT_CLASS_ATTRIBUTE, OrgReviewRole.class.getName());
67 parameters.put(KRADConstants.RETURN_LOCATION_PARAMETER, KRADConstants.PORTAL_ACTION);
68 parameters.put(KRADConstants.DOC_FORM_KEY, KimConstants.KimUIConstants.KIM_ROLE_DOCUMENT_SHORT_KEY);
69 String hrefStr = UrlFactory.parameterizeUrl(KRADConstants.LOOKUP_ACTION, parameters);
70 HtmlData hRef = new AnchorHtmlData(hrefStr, KRADConstants.EMPTY_STRING);
71 f.setInquiryURL(hRef);
72 rows.add(new Row(f));
73
74 Section section = new Section();
75 section.setRows(rows);
76 section.setSectionTitle("Organization Hierarchy");
77 sections.add(section);
78 }
79 }
80
81
82 }