001: /*
002: * Copyright 2006-2007 The Kuali Foundation.
003: *
004: * Licensed under the Educational Community License, Version 1.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/ecl1.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: */
016:
017: package org.kuali.module.chart.bo;
018:
019: import java.util.ArrayList;
020: import java.util.LinkedHashMap;
021: import java.util.List;
022:
023: import org.apache.log4j.Logger;
024: import org.kuali.core.bo.PersistableBusinessObjectBase;
025: import org.kuali.core.service.BusinessObjectService;
026: import org.kuali.core.util.TypedArrayList;
027: import org.kuali.kfs.context.SpringContext;
028:
029: /**
030: *
031: */
032: public class OrganizationRoutingModelName extends
033: PersistableBusinessObjectBase {
034: private static final Logger LOG = Logger
035: .getLogger(OrganizationRoutingModelName.class);
036:
037: private String chartOfAccountsCode;
038: private String organizationCode;
039: private String organizationRoutingModelName;
040: private List<OrganizationRoutingModel> organizationRoutingModel;
041:
042: private Org organization;
043: private Chart chartOfAccounts;
044:
045: /**
046: * Default constructor.
047: */
048: public OrganizationRoutingModelName() {
049: organizationRoutingModel = new TypedArrayList(
050: OrganizationRoutingModel.class);
051: }
052:
053: /**
054: * Gets the chartOfAccountsCode attribute.
055: *
056: * @return Returns the chartOfAccountsCode
057: */
058: public String getChartOfAccountsCode() {
059: return chartOfAccountsCode;
060: }
061:
062: /**
063: * Sets the chartOfAccountsCode attribute.
064: *
065: * @param chartOfAccountsCode The chartOfAccountsCode to set.
066: */
067: public void setChartOfAccountsCode(String chartOfAccountsCode) {
068: this .chartOfAccountsCode = chartOfAccountsCode;
069: }
070:
071: /**
072: * Gets the organizationCode attribute.
073: *
074: * @return Returns the organizationCode
075: */
076: public String getOrganizationCode() {
077: return organizationCode;
078: }
079:
080: /**
081: * Sets the organizationCode attribute.
082: *
083: * @param organizationCode The organizationCode to set.
084: */
085: public void setOrganizationCode(String organizationCode) {
086: this .organizationCode = organizationCode;
087: }
088:
089: /**
090: * Gets the organizationRoutingModelName attribute.
091: *
092: * @return Returns the organizationRoutingModelName
093: */
094: public String getOrganizationRoutingModelName() {
095: return organizationRoutingModelName;
096: }
097:
098: /**
099: * Sets the organizationRoutingModelName attribute.
100: *
101: * @param organizationRoutingModelName The organizationRoutingModelName to set.
102: */
103: public void setOrganizationRoutingModelName(
104: String organizationRoutingModelName) {
105: this .organizationRoutingModelName = organizationRoutingModelName;
106: }
107:
108: /**
109: * Gets the organization attribute.
110: *
111: * @return Returns the organization
112: */
113: public Org getOrganization() {
114: return organization;
115: }
116:
117: /**
118: * Sets the organization attribute.
119: *
120: * @param organization The organization to set.
121: * @deprecated
122: */
123: public void setOrganization(Org organization) {
124: this .organization = organization;
125: }
126:
127: /**
128: * Gets the chartOfAccounts attribute.
129: *
130: * @return Returns the chartOfAccounts
131: */
132: public Chart getChartOfAccounts() {
133: return chartOfAccounts;
134: }
135:
136: /**
137: * Sets the chartOfAccounts attribute.
138: *
139: * @param chartOfAccounts The chartOfAccounts to set.
140: * @deprecated
141: */
142: public void setChartOfAccounts(Chart chartOfAccounts) {
143: this .chartOfAccounts = chartOfAccounts;
144: }
145:
146: /**
147: * Gets the organizationRoutingModel attribute.
148: *
149: * @return Returns the organizationRoutingModel.
150: */
151: public List<OrganizationRoutingModel> getOrganizationRoutingModel() {
152: return organizationRoutingModel;
153: }
154:
155: /**
156: * Sets the organizationRoutingModel attribute value.
157: *
158: * @param organizationRoutingModel The organizationRoutingModel to set.
159: */
160: public void setOrganizationRoutingModel(
161: List<OrganizationRoutingModel> organizationRoutingModel) {
162: this .organizationRoutingModel = organizationRoutingModel;
163: }
164:
165: /**
166: * @see org.kuali.core.bo.BusinessObjectBase#toStringMapper()
167: */
168: protected LinkedHashMap toStringMapper() {
169: LinkedHashMap m = new LinkedHashMap();
170: m.put("chartOfAccountsCode", this .chartOfAccountsCode);
171: m.put("organizationCode", this .organizationCode);
172: m.put("organizationRoutingModelName",
173: this .organizationRoutingModelName);
174: return m;
175: }
176:
177: /**
178: * @see org.kuali.core.bo.PersistableBusinessObjectBase#linkEditableUserFields()
179: */
180: @Override
181: public void linkEditableUserFields() {
182: super .linkEditableUserFields();
183: if (this == null) {
184: throw new IllegalArgumentException(
185: "parameter passed in was null");
186: }
187: List bos = new ArrayList();
188: bos.addAll(getOrganizationRoutingModel());
189: SpringContext.getBean(BusinessObjectService.class)
190: .linkUserFields(bos);
191: }
192: }
|