001/**
002 * Copyright 2005-2013 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.kuali.rice.krms.dto;
017
018import org.apache.commons.lang.StringUtils;
019import org.kuali.rice.core.api.util.tree.Tree;
020import org.kuali.rice.krad.web.form.UifFormBase;
021import org.kuali.rice.krms.tree.node.CompareTreeNode;
022import org.kuali.rice.krms.tree.node.RuleEditorTreeNode;
023import org.kuali.rice.krms.tree.node.TreeNode;
024
025import java.util.ArrayList;
026import java.util.List;
027
028/**
029 * @author Kuali Student Team
030 */
031public class RuleManagementWrapper extends UifFormBase {
032
033    private String refObjectId;
034    private String namespace;
035    private String refDiscriminatorType;
036
037    private List<AgendaEditor> agendas;
038    private RuleEditor ruleEditor;
039    private AgendaEditor agendaEditor;
040
041    private Tree<CompareTreeNode, String> compareTree;
042
043    private String compareLightBoxHeader;
044
045    public String getRefObjectId() {
046        return refObjectId;
047    }
048
049    public void setRefObjectId(String refObjectId) {
050        this.refObjectId = refObjectId;
051    }
052
053    public List<AgendaEditor> getAgendas() {
054        return agendas;
055    }
056
057    public void setAgendas(List<AgendaEditor> agendas) {
058        this.agendas = agendas;
059    }
060
061    public Tree<CompareTreeNode, String> getCompareTree() {
062        return compareTree;
063    }
064
065    public void setCompareTree(Tree<CompareTreeNode, String> compareTree) {
066        this.compareTree = compareTree;
067    }
068
069    public RuleEditor getRuleEditor() {
070        return ruleEditor;
071    }
072
073    public void setRuleEditor(RuleEditor ruleEditor) {
074        this.ruleEditor = ruleEditor;
075    }
076
077    public AgendaEditor getAgendaEditor() {
078        return agendaEditor;
079    }
080
081    public void setAgendaEditor(AgendaEditor agendaEditor) {
082        this.agendaEditor = agendaEditor;
083    }
084
085    public Tree<RuleEditorTreeNode, String> getEditTree() {
086        return this.getRuleEditor().getEditTree();
087    }
088
089    public Tree<TreeNode, String> getPreviewTree() {
090        return this.getRuleEditor().getPreviewTree();
091    }
092
093    public Tree<TreeNode, String> getViewTree() {
094       return this.getRuleEditor().getViewTree();
095    }
096
097    public void setActiveSelections(List<String> activeSelections) {
098        this.getRuleEditor().setActiveSelections(activeSelections);
099    }
100
101    public List<String> getActiveSelections(){
102        return this.getRuleEditor().getActiveSelections();
103    }
104
105    public String getSelectedKey() {
106        if(this.getRuleEditor() == null) {
107            return StringUtils.EMPTY;
108        }
109        return this.getRuleEditor().getSelectedKey();
110    }
111
112    public void setSelectedKey(String selectedKey) {
113        this.getRuleEditor().setSelectedKey(selectedKey);
114    }
115
116    public String getCutKey() {
117        if(this.getRuleEditor() == null) {
118            return StringUtils.EMPTY;
119        }
120        return this.getRuleEditor().getCutKey();
121    }
122
123    public void setCutKey(String cutKey) {
124        this.getRuleEditor().setCutKey(cutKey);
125    }
126
127    public String getCopyKey() {
128        if(this.getRuleEditor() == null) {
129            return StringUtils.EMPTY;
130        }
131        return this.getRuleEditor().getCopyKey();
132    }
133
134    public void setCopyKey(String copyKey) {
135        this.getRuleEditor().setCopyKey(copyKey);
136    }
137
138    public String getLogicArea() {
139        if(this.getRuleEditor() == null) {
140            return StringUtils.EMPTY;
141        }
142        return this.getRuleEditor().getLogicArea();
143    }
144
145    public void setLogicArea(String logicArea) {
146        this.getRuleEditor().setLogicArea(logicArea);
147    }
148
149    public String getNamespace() {
150        return namespace;
151    }
152
153    public void setNamespace(String namespace) {
154        this.namespace = namespace;
155    }
156
157    public String getRefDiscriminatorType() {
158        return refDiscriminatorType;
159    }
160
161    public void setRefDiscriminatorType(String refDiscriminatorType) {
162        this.refDiscriminatorType = refDiscriminatorType;
163    }
164
165    public String getCompareLightBoxHeader(){
166        return compareLightBoxHeader;
167    }
168
169    public void setCompareLightBoxHeader( String compareLightBoxHeader){
170        this.compareLightBoxHeader = compareLightBoxHeader;
171    }
172}