01: /*
02: * Copyright 2006-2007 The Kuali Foundation.
03: *
04: * Licensed under the Educational Community License, Version 1.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.opensource.org/licenses/ecl1.php
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package org.kuali.module.chart.maintenance;
17:
18: import java.util.ArrayList;
19: import java.util.List;
20:
21: import org.kuali.core.bo.BusinessObject;
22: import org.kuali.core.web.ui.Field;
23: import org.kuali.core.web.ui.Row;
24: import org.kuali.core.web.ui.Section;
25: import org.kuali.kfs.inquiry.KfsInquirableImpl;
26: import org.kuali.module.chart.bo.Org;
27:
28: /**
29: * This class adds in some new sections for {@link Org} inquiries, specifically Org Hierarchy Org Review Hierarchy
30: */
31: public class OrgInquirable extends KfsInquirableImpl {
32:
33: public void addAdditionalSections(List sections, BusinessObject bo) {
34: if (bo instanceof Org) {
35: Org org = (Org) bo;
36:
37: List rows = new ArrayList();
38:
39: Field f = new Field();
40: f.setPropertyName("Organization Hierarchy");
41: f.setFieldLabel("Organization Hierarchy");
42: f.setPropertyValue(org.getOrganizationHierarchy());
43: f.setFieldType(Field.HIDDEN);
44: rows.add(new Row(f));
45:
46: f = new Field();
47: f.setPropertyName("Organization Review Hierarchy");
48: f.setFieldLabel("Organization Review Hierarchy");
49: f.setPropertyValue("run search");
50: f.setFieldType(Field.HIDDEN);
51: f.setInquiryURL(org.getOrganizationReviewHierarchy());
52: rows.add(new Row(f));
53:
54: Section section = new Section();
55: section.setRows(rows);
56: section.setSectionTitle("Organization Hierarchy");
57: sections.add(section);
58: }
59: }
60:
61: }
|