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    private boolean hasOptimisticLockingError;
041
042    private Tree<CompareTreeNode, String> compareTree;
043
044    private String compareLightBoxHeader;
045
046    public String getRefObjectId() {
047        return refObjectId;
048    }
049
050    public void setRefObjectId(String refObjectId) {
051        this.refObjectId = refObjectId;
052    }
053
054    public List<AgendaEditor> getAgendas() {
055        if(agendas==null){
056            agendas = new ArrayList<AgendaEditor>();
057        }
058        return agendas;
059    }
060
061    public void setAgendas(List<AgendaEditor> agendas) {
062        this.agendas = agendas;
063    }
064
065    public Tree<CompareTreeNode, String> getCompareTree() {
066        return compareTree;
067    }
068
069    public void setCompareTree(Tree<CompareTreeNode, String> compareTree) {
070        this.compareTree = compareTree;
071    }
072
073    public RuleEditor getRuleEditor() {
074        return ruleEditor;
075    }
076
077    public void setRuleEditor(RuleEditor ruleEditor) {
078        this.ruleEditor = ruleEditor;
079    }
080
081    public AgendaEditor getAgendaEditor() {
082        return agendaEditor;
083    }
084
085    public void setAgendaEditor(AgendaEditor agendaEditor) {
086        this.agendaEditor = agendaEditor;
087    }
088
089    public Tree<RuleEditorTreeNode, String> getEditTree() {
090        return this.getRuleEditor().getEditTree();
091    }
092
093    public Tree<TreeNode, String> getPreviewTree() {
094        return this.getRuleEditor().getPreviewTree();
095    }
096
097    public Tree<TreeNode, String> getViewTree() {
098       return this.getRuleEditor().getViewTree();
099    }
100
101    public void setActiveSelections(List<String> activeSelections) {
102        this.getRuleEditor().setActiveSelections(activeSelections);
103    }
104
105    public List<String> getActiveSelections(){
106        return this.getRuleEditor().getActiveSelections();
107    }
108
109    public String getSelectedKey() {
110        if(this.getRuleEditor() == null) {
111            return StringUtils.EMPTY;
112        }
113        return this.getRuleEditor().getSelectedKey();
114    }
115
116    public void setSelectedKey(String selectedKey) {
117        this.getRuleEditor().setSelectedKey(selectedKey);
118    }
119
120    public String getCutKey() {
121        if(this.getRuleEditor() == null) {
122            return StringUtils.EMPTY;
123        }
124        return this.getRuleEditor().getCutKey();
125    }
126
127    public void setCutKey(String cutKey) {
128        this.getRuleEditor().setCutKey(cutKey);
129    }
130
131    public String getCopyKey() {
132        if(this.getRuleEditor() == null) {
133            return StringUtils.EMPTY;
134        }
135        return this.getRuleEditor().getCopyKey();
136    }
137
138    public void setCopyKey(String copyKey) {
139        this.getRuleEditor().setCopyKey(copyKey);
140    }
141
142    public String getLogicArea() {
143        if(this.getRuleEditor() == null) {
144            return StringUtils.EMPTY;
145        }
146        return this.getRuleEditor().getLogicArea();
147    }
148
149    public void setLogicArea(String logicArea) {
150        this.getRuleEditor().setLogicArea(logicArea);
151    }
152
153    public String getNamespace() {
154        return namespace;
155    }
156
157    public void setNamespace(String namespace) {
158        this.namespace = namespace;
159    }
160
161    public String getRefDiscriminatorType() {
162        return refDiscriminatorType;
163    }
164
165    public void setRefDiscriminatorType(String refDiscriminatorType) {
166        this.refDiscriminatorType = refDiscriminatorType;
167    }
168
169    public String getCompareLightBoxHeader(){
170        return compareLightBoxHeader;
171    }
172
173    public void setCompareLightBoxHeader( String compareLightBoxHeader){
174        this.compareLightBoxHeader = compareLightBoxHeader;
175    }
176
177    public boolean hasOptimisticLockingError() {
178        return hasOptimisticLockingError;
179    }
180
181    public void setHasOptimisticLockingError(boolean hasOptimisticLockingError) {
182        this.hasOptimisticLockingError = hasOptimisticLockingError;
183    }
184}