View Javadoc

1   /*
2    * Copyright 2011 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 1.0 (the
5    * "License"); you may not use this file except in compliance with the
6    * License.  You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl1.php
9    *
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
13   * implied.  See the License for the specific language governing
14   * permissions and limitations under the License.
15   */
16  package org.kuali.student.enrollment.courseofferingset.dto;
17  
18  import java.util.ArrayList;
19  import java.util.Date;
20  import java.util.List;
21  
22  import javax.xml.bind.annotation.XmlAccessType;
23  import javax.xml.bind.annotation.XmlAccessorType;
24  import javax.xml.bind.annotation.XmlAnyElement;
25  import javax.xml.bind.annotation.XmlElement;
26  import javax.xml.bind.annotation.XmlType;
27  
28  import org.kuali.student.enrollment.courseofferingset.infc.SocRolloverResult;
29  import org.kuali.student.r2.common.assembler.HasDynamicAttributes;
30  import org.kuali.student.r2.common.dto.IdNamelessEntityInfo;
31  import org.kuali.student.r2.common.dto.RichTextInfo;
32  import org.w3c.dom.Element;
33  
34  @XmlAccessorType(XmlAccessType.FIELD)
35  @XmlType(name = "SocRolloverResultInfo", propOrder = {"id",
36      "typeKey",
37      "stateKey",
38      "sourceSocId",
39      "targetSocId",
40      "targetTermId",
41      "optionKeys",
42      "itemsProcessed",
43      "itemsExpected",
44      "courseOfferingsCreated",
45      "courseOfferingsSkipped",
46      "activityOfferingsCreated",
47      "activityOfferingsSkipped",
48      "sourceTermId",
49      "message",
50      "dateInitiated",
51      "dateCompleted",
52      "meta",
53      "attributes",
54      "_futureElements"})
55  public class SocRolloverResultInfo
56          extends IdNamelessEntityInfo
57          implements SocRolloverResult {
58  
59      private static final long serialVersionUID = 1L;
60      @XmlElement
61      private String sourceSocId;
62      @XmlElement
63      private String targetSocId;
64      @XmlElement
65      private String targetTermId;
66      @XmlElement
67      private List<String> optionKeys;
68      @XmlElement
69      private Integer itemsProcessed;
70      @XmlElement
71      private Integer itemsExpected;
72      @XmlElement
73      private Integer courseOfferingsCreated;
74      @XmlElement
75      private Integer courseOfferingsSkipped;
76      @XmlElement
77      private Integer activityOfferingsCreated;
78      @XmlElement
79      private Integer activityOfferingsSkipped;
80      @XmlElement
81      private String sourceTermId;
82      @XmlElement
83      private RichTextInfo message;
84      @XmlElement
85      private Date dateInitiated;
86      @XmlElement
87      private Date dateCompleted;
88      @XmlAnyElement
89      private List<Element> _futureElements;
90  
91      public SocRolloverResultInfo() {
92          // Might as well initialize this to something sensible
93          courseOfferingsCreated = 0;
94          courseOfferingsSkipped = 0;
95          activityOfferingsCreated = 0;
96          activityOfferingsSkipped = 0;
97      }
98  
99      /**
100      * Copies Soc rollover results
101      *
102      * @param
103      */
104     public SocRolloverResultInfo(SocRolloverResult orig) {
105 
106         super(orig);
107 
108         if (orig == null) {
109             return;
110         }
111 
112         this.sourceSocId = orig.getSourceSocId();
113         this.targetSocId = orig.getTargetSocId();
114         this.targetTermId = orig.getTargetTermId();
115         this.optionKeys = new ArrayList<String>(orig.getOptionKeys());
116         this.itemsProcessed = orig.getItemsProcessed();
117         this.itemsExpected = orig.getItemsExpected();
118         this.courseOfferingsCreated = orig.getCourseOfferingsCreated();
119         this.courseOfferingsSkipped = orig.getCourseOfferingsSkipped();
120         this.activityOfferingsCreated = orig.getActivityOfferingsCreated();
121         this.activityOfferingsSkipped = orig.getActivityOfferingsSkipped();
122         this.sourceTermId = orig.getSourceTermId();
123         if (orig.getMessage() != null) {
124             this.message = new RichTextInfo (orig.getMessage());
125         }
126         this.dateInitiated = orig.getDateInitiated();
127         this.dateCompleted = orig.getDateCompleted();
128     }
129 
130     @Override
131     public List<String> getOptionKeys() {
132         if (this.optionKeys == null) {
133             this.optionKeys = new ArrayList<String>();
134         }
135         return optionKeys;
136     }
137 
138     public void setOptionKeys(List<String> optionKeys) {
139         this.optionKeys = optionKeys;
140     }
141 
142     @Override
143     public String getSourceSocId() {
144         return sourceSocId;
145     }
146 
147     public void setSourceSocId(String sourceSocId) {
148         this.sourceSocId = sourceSocId;
149     }
150 
151     @Override
152     public String getTargetSocId() {
153         return targetSocId;
154     }
155 
156     public void setTargetSocId(String targetSocId) {
157         this.targetSocId = targetSocId;
158     }
159 
160     @Override
161     public String getTargetTermId() {
162         return targetTermId;
163     }
164 
165     public void setTargetTermId(String targetTermId) {
166         this.targetTermId = targetTermId;
167     }
168 
169     @Override
170     public Integer getItemsProcessed() {
171         return itemsProcessed;
172     }
173 
174     public void setItemsProcessed(Integer itemsProcessed) {
175         this.itemsProcessed = itemsProcessed;
176     }
177 
178     @Override
179     public Integer getItemsExpected() {
180         return itemsExpected;
181     }
182 
183     public void setItemsExpected(Integer itemsExpected) {
184         this.itemsExpected = itemsExpected;
185     }
186 
187     @Override
188     public RichTextInfo getMessage() {
189         return message;
190     }
191 
192     public void setMessage(RichTextInfo message) {
193         this.message = message;
194     }
195 
196     @Override
197     public Integer getActivityOfferingsCreated() {
198         return activityOfferingsCreated;
199     }
200 
201     public void setActivityOfferingsCreated(Integer activityOfferingsCreated) {
202         this.activityOfferingsCreated = activityOfferingsCreated;
203     }
204 
205     @Override
206     public Integer getActivityOfferingsSkipped() {
207         return activityOfferingsSkipped;
208     }
209 
210     public void setActivityOfferingsSkipped(Integer activityOfferingsSkipped) {
211         this.activityOfferingsSkipped = activityOfferingsSkipped;
212     }
213 
214     @Override
215     public Integer getCourseOfferingsCreated() {
216         return courseOfferingsCreated;
217     }
218 
219     public void setCourseOfferingsCreated(Integer courseOfferingsCreated) {
220         this.courseOfferingsCreated = courseOfferingsCreated;
221     }
222 
223     @Override
224     public Integer getCourseOfferingsSkipped() {
225         return courseOfferingsSkipped;
226     }
227 
228     public void setCourseOfferingsSkipped(Integer courseOfferingsSkipped) {
229         this.courseOfferingsSkipped = courseOfferingsSkipped;
230     }
231 
232     @Override
233     public String getSourceTermId() {
234         return sourceTermId;
235     }
236 
237     public void setSourceTermId(String sourceTermId) {
238         this.sourceTermId = sourceTermId;
239     }
240 
241     @Override
242     public Date getDateInitiated() {
243         return dateInitiated;
244     }
245 
246     public void setDateInitiated(Date dateInitiated) {
247         this.dateInitiated = dateInitiated;
248     }
249 
250     @Override
251     public Date getDateCompleted() {
252         return dateCompleted;
253     }
254 
255     public void setDateCompleted(Date dateCompleted) {
256         this.dateCompleted = dateCompleted;
257     }
258 }