001: /**********************************************************************************
002: * $URL: https://source.sakaiproject.org/svn/sam/trunk/component/src/java/org/sakaiproject/tool/assessment/facade/QuestionPoolFacade.java $
003: * $Id: QuestionPoolFacade.java 9273 2006-05-10 22:34:28Z daisyf@stanford.edu $
004: ***********************************************************************************
005: *
006: * Copyright (c) 2004, 2005, 2006 The Sakai Foundation.
007: *
008: * Licensed under the Educational Community License, Version 1.0 (the"License");
009: * you may not use this file except in compliance with the License.
010: * You may obtain a copy of the License at
011: *
012: * http://www.opensource.org/licenses/ecl1.php
013: *
014: * Unless required by applicable law or agreed to in writing, software
015: * distributed under the License is distributed on an "AS IS" BASIS,
016: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017: * See the License for the specific language governing permissions and
018: * limitations under the License.
019: *
020: **********************************************************************************/package org.sakaiproject.tool.assessment.facade;
021:
022: import java.util.ArrayList;
023: import java.util.Collection;
024: import java.util.Date;
025: import java.util.Set;
026:
027: import org.osid.shared.Id;
028: import org.osid.shared.SharedException;
029:
030: import org.apache.commons.logging.Log;
031: import org.apache.commons.logging.LogFactory;
032:
033: import org.sakaiproject.tool.assessment.business.questionpool.QuestionPool;
034: import org.sakaiproject.tool.assessment.business.questionpool.QuestionPoolException;
035: import org.sakaiproject.tool.assessment.data.dao.questionpool.QuestionPoolData;
036: import org.sakaiproject.tool.assessment.data.ifc.questionpool.QuestionPoolDataIfc;
037: import org.sakaiproject.tool.assessment.data.ifc.questionpool.QuestionPoolItemIfc;
038: import org.sakaiproject.tool.assessment.data.ifc.shared.AgentDataIfc;
039: import org.sakaiproject.tool.assessment.data.ifc.shared.TypeIfc;
040: import org.sakaiproject.tool.assessment.osid.questionpool.impl.QuestionPoolImpl;
041: import org.sakaiproject.tool.assessment.services.PersistenceService;
042:
043: /**
044: * @author Ed Smiley <esmiley@stanford.edu>
045: */
046: public class QuestionPoolFacade implements java.io.Serializable,
047: QuestionPoolDataIfc, Cloneable {
048: private static Log log = LogFactory
049: .getLog(QuestionPoolFacade.class);
050: private static final long serialVersionUID = 7526471155622776147L;
051:
052: public static final Long ACCESS_DENIED = new Long(30);
053: public static final Long READ_ONLY = new Long(31);
054: public static final Long READ_COPY = new Long(32);
055: public static final Long READ_WRITE = new Long(33);
056: public static final Long ADMIN = new Long(34);
057: public static final Long DEFAULT_TYPEID = new Long(0);
058: public static final Long DEFAULT_INTELLECTUAL_PROPERTYID = new Long(
059: 0);
060: public static final Long ROOT_POOL = new Long(0);
061:
062: private QuestionPool questionPool;
063: // We have 2 sets of properties:
064: // #1) properties according to
065: // org.sakaiproject.tool.assessment.business.entity.questionpool.QuestionPool.
066: private String displayName;
067: private String description;
068: private QuestionPoolDataIfc data;
069: private Id id;
070: private TypeIfc questionPoolType;
071: private Id parentId;
072: private QuestionPoolFacade parentPool;
073: // #2) set of properties of QuestionPoolDataIfc
074: private Long questionPoolId;
075: private Long parentPoolId;
076: private String ownerId;
077: private AgentDataIfc owner;
078: private String title; // same as displayName
079: private Date dateCreated;
080: private Date lastModified;
081: private String lastModifiedById;
082: private AgentDataIfc lastModifiedBy;
083: private Long accessTypeId;
084: private TypeIfc accessType;
085: private String objectives;
086: private String keywords;
087: private String rubric;
088: private Long typeId;
089: private TypeIfc type;
090: private Long intellectualPropertyId;
091: private String organizationName;
092: private Set questionPoolItems;
093: private Collection items = new ArrayList();
094: private Integer subPoolSize;
095:
096: /**
097: * Creates a new QuestionPoolFacade object.
098: */
099: public QuestionPoolFacade() {
100: // need to hook QuestionPoolFacade.data to QuestionPoolData,
101: // our POJO for Hibernate persistence
102: this .data = new QuestionPoolData();
103: QuestionPoolImpl questionPoolImpl = new QuestionPoolImpl(); //<-- place holder
104: questionPool = (QuestionPool) questionPoolImpl;
105: try {
106: questionPool.updateData(this .data);
107: } catch (QuestionPoolException ex) {
108: throw new DataFacadeException(ex.getMessage());
109: }
110: }
111:
112: /**
113: * Constructor.
114: * Each question pool has a unique Id object and owns the Id of
115: * its parent. See getId(), getParentId()
116: *
117: * @param newId the id
118: * @param newParentId the id of its parent
119: */
120: public QuestionPoolFacade(Id id, Id parentId) {
121: this .id = id;
122: this .parentId = parentId;
123: this .data = new QuestionPoolData();
124: QuestionPoolImpl questionPoolImpl = new QuestionPoolImpl(); //<-- place holder
125: questionPool = (QuestionPool) questionPoolImpl;
126: try {
127: questionPool.updateData(this .data);
128: setQuestionPoolId(new Long(id.getIdString()));
129: setParentPoolId(new Long(parentId.getIdString()));
130: } catch (QuestionPoolException ex) {
131: throw new DataFacadeException(ex.getMessage());
132: } catch (SharedException ex) {
133: throw new DataFacadeException(ex.getMessage());
134: } catch (NumberFormatException ex) {
135: throw new DataFacadeException(ex.getMessage());
136: }
137: }
138:
139: /**
140: * Constructor.
141: * Each question pool has a unique Id object and owns the Id of
142: * its parent. See getId(), getParentId()
143: *
144: * @param newId the id
145: * @param newParentId the id of its parent
146: */
147: public QuestionPoolFacade(Long id, Long parentId) {
148: QuestionPoolFacadeQueriesAPI questionPoolFacadeQueries = PersistenceService
149: .getInstance().getQuestionPoolFacadeQueries();
150: this .id = questionPoolFacadeQueries.getQuestionPoolId(id);
151: this .parentId = questionPoolFacadeQueries
152: .getQuestionPoolId(parentId);
153: this .data = new QuestionPoolData();
154: QuestionPoolImpl questionPoolImpl = new QuestionPoolImpl(); //<-- place holder
155: questionPool = (QuestionPool) questionPoolImpl;
156: try {
157: questionPool.updateData(this .data);
158: } catch (QuestionPoolException ex) {
159: throw new DataFacadeException(ex.getMessage());
160: }
161: setQuestionPoolId(id);
162: setParentPoolId(parentId);
163: }
164:
165: public QuestionPoolFacade(QuestionPoolDataIfc data) {
166: this .data = data;
167: QuestionPoolImpl questionPoolImpl = new QuestionPoolImpl(); // place holder
168: questionPool = (QuestionPool) questionPoolImpl;
169: try {
170: questionPool.updateData(this .data);
171: } catch (QuestionPoolException ex) {
172: throw new DataFacadeException(ex.getMessage());
173: }
174: this .id = getId();
175: this .displayName = getTitle();
176: this .description = getDescription();
177: this .questionPoolType = getType();
178: this .ownerId = getOwnerId();
179: this .owner = getOwner();
180: this .dateCreated = getDateCreated();
181: this .lastModified = getLastModified();
182: this .lastModifiedBy = getLastModifiedBy();
183: this .lastModifiedById = getLastModifiedById();
184: this .accessTypeId = getAccessTypeId();
185: this .accessType = getAccessType();
186: this .objectives = getObjectives();
187: this .keywords = getKeywords();
188: this .rubric = getRubric();
189: this .typeId = getTypeId();
190: this .type = getType();
191: this .intellectualPropertyId = getIntellectualPropertyId();
192: this .organizationName = getOrganizationName();
193: this .questionPoolItems = getQuestionPoolItems();
194: this .items = getQuestions();
195: try {
196: this .parentPool = getParentPool();
197: if (this .parentPool != null) // => ROOT POOL
198: this .parentId = getParentId();
199: } catch (Exception ex1) {
200: throw new DataFacadeException(ex1.getMessage());
201: }
202: }
203:
204: /**
205: * IMPORTANT: this constructor do not have "data", this constructor is
206: * merely used for holding questionPoolId, Title
207: * for displaying purpose (used by the pulldown list in authoring).
208: * This constructor does not persist data (which it has none) to DB
209: * @param id
210: * @param title
211: */
212: public QuestionPoolFacade(Long id, String title) {
213: this .questionPoolId = id;
214: this .title = title;
215: this .data = new QuestionPoolData();
216: QuestionPoolImpl questionPoolImpl = new QuestionPoolImpl(); //<-- place holder
217: questionPool = (QuestionPool) questionPoolImpl;
218: try {
219: questionPool.updateData(this .data);
220: setQuestionPoolId(id);
221: setTitle(title);
222: } catch (QuestionPoolException ex) {
223: throw new DataFacadeException(ex.getMessage());
224: }
225:
226: }
227:
228: /**
229: * IMPORTANT: this constructor do not have "data", this constructor is
230: * merely used for holding questionPoolId, Title, parentId
231: * for validation question pool
232: * This constructor does not persist data (which it has none) to DB
233: * @param id
234: * @param title
235: * @param parentid
236: */
237: public QuestionPoolFacade(Long id, String title, Long parentId) {
238: this .questionPoolId = id;
239: this .title = title;
240: this .parentPoolId = parentId;
241: this .data = new QuestionPoolData();
242: QuestionPoolImpl questionPoolImpl = new QuestionPoolImpl(); //<-- place holder
243: questionPool = (QuestionPool) questionPoolImpl;
244: try {
245: questionPool.updateData(this .data);
246: setParentPoolId(parentId);
247: setQuestionPoolId(id);
248: setTitle(title);
249: } catch (QuestionPoolException ex) {
250: throw new DataFacadeException(ex.getMessage());
251: }
252:
253: }
254:
255: /**
256: * Get the Id for this QuestionPoolFacade.
257: * @return org.osid.shared.Id
258: */
259: org.osid.shared.Id getId() {
260: try {
261: this .data = (QuestionPoolDataIfc) questionPool.getData();
262: } catch (QuestionPoolException ex) {
263: throw new DataFacadeException(ex.getMessage());
264: }
265: QuestionPoolFacadeQueriesAPI questionPoolFacadeQueries = PersistenceService
266: .getInstance().getQuestionPoolFacadeQueries();
267: return questionPoolFacadeQueries.getQuestionPoolId(this .data
268: .getQuestionPoolId());
269: }
270:
271: /**
272: *
273: * @return the display name for the question pool
274: * @throws DataFacadeException
275: */
276: public String getDisplayName() throws DataFacadeException {
277: return getTitle();
278: }
279:
280: /**
281: *
282: * @param pdisplayName the display name for the question pool
283: * @throws DataFacadeException
284: */
285: public void updateDisplayName(String displayName)
286: throws DataFacadeException {
287: setDisplayName(displayName);
288: }
289:
290: private void setDisplayName(String displayName)
291: throws DataFacadeException {
292: this .displayName = displayName;
293: this .data.setTitle(displayName);
294: }
295:
296: public String getDescription() {
297: try {
298: this .data = (QuestionPoolDataIfc) questionPool.getData();
299: } catch (QuestionPoolException ex) {
300: throw new DataFacadeException(ex.getMessage());
301: }
302: return this .data.getDescription();
303: }
304:
305: /**
306: *
307: * @param pdescription the description for the question pool
308: * @throws DataFacadeException
309: */
310: public void updateDescription(String description)
311: throws DataFacadeException {
312: setDescription(description);
313: }
314:
315: public void setDescription(String description) {
316: this .description = description;
317: this .data.setDescription(description);
318: }
319:
320: /**
321: * Get the data for this QuestionPoolFacade.
322: * @return QuestionPoolDataIfc
323: */
324: public QuestionPoolDataIfc getData() {
325: return this .data;
326: }
327:
328: /**
329: * Call setDate() to update data in ItemFacade
330: * @param data
331: */
332: public void updateData(QuestionPoolDataIfc data) {
333: setData(data);
334: }
335:
336: /**
337: * Set data for ItemFacade
338: * @param data
339: */
340: public void setData(QuestionPoolDataIfc data) {
341: this .data = data;
342: }
343:
344: /**
345: *
346: * @return the type of pool for the question pool
347: * @throws DataFacadeException
348: */
349: public TypeIfc getQuestionPoolType() throws DataFacadeException {
350: return getType();
351: }
352:
353: public void updateQuestionPoolType(TypeIfc questionPoolType)
354: throws DataFacadeException {
355: setQuestionPoolType(questionPoolType);
356: }
357:
358: private void setQuestionPoolType(TypeIfc questionPoolType)
359: throws DataFacadeException {
360: this .questionPoolType = questionPoolType;
361: setType(questionPoolType);
362: }
363:
364: /**
365: *
366: * @return the id object for the question pool
367: * @throws QuestionPoolException
368: */
369: public Id getParentId() throws DataFacadeException {
370: try {
371: this .data = (QuestionPoolDataIfc) questionPool.getData();
372: if (this .data != null) {
373: QuestionPoolFacadeQueriesAPI questionPoolFacadeQueries = PersistenceService
374: .getInstance().getQuestionPoolFacadeQueries();
375: return questionPoolFacadeQueries
376: .getQuestionPoolId(this .data.getParentPoolId());
377: } else
378: // implies ROOT_POOL
379: return null;
380: } catch (QuestionPoolException ex) {
381: throw new DataFacadeException(ex.getMessage());
382: }
383: }
384:
385: /**
386: *
387: * Sets the parent id object for the question pool
388: * @throws DataFacadeException
389: */
390: public void setParentId(Id parentId) throws DataFacadeException {
391: this .parentId = parentId;
392: try {
393: setParentPoolId(new Long(parentId.getIdString()));
394: } catch (SharedException ex) {
395: log.warn(ex.getMessage());
396: } catch (NumberFormatException ex) {
397: log.warn(ex.getMessage());
398: }
399: }
400:
401: /**
402: *
403: * @return the parent pool for the question pool
404: * @throws DataFacadeException
405: */
406: public QuestionPoolFacade getParentPool()
407: throws DataFacadeException {
408: try {
409: this .data = (QuestionPoolDataIfc) questionPool.getData();
410: if (this .data != null) {
411: QuestionPoolFacadeQueriesAPI questionPoolFacadeQueries = PersistenceService
412: .getInstance().getQuestionPoolFacadeQueries();
413: return questionPoolFacadeQueries.getPoolById(this .data
414: .getParentPoolId());
415: } else
416: // implies ROOT_ROOL
417: return null;
418: } catch (QuestionPoolException ex) {
419: throw new DataFacadeException(ex.getMessage());
420: }
421: }
422:
423: // the following methods implements
424: // org.sakaiproject.tool.assessment.ifc.questionpool.QuestionPoolDataIfc
425: public Long getQuestionPoolId() throws DataFacadeException {
426: try {
427: this .data = (QuestionPoolDataIfc) questionPool.getData();
428: } catch (QuestionPoolException ex) {
429: throw new DataFacadeException(ex.getMessage());
430: }
431: return this .data.getQuestionPoolId();
432: }
433:
434: /**
435: * Set itemId for ItemFacade
436: * @param itemId
437: */
438: public void setQuestionPoolId(Long questionPoolId) {
439: this .questionPoolId = questionPoolId;
440: this .data.setQuestionPoolId(questionPoolId);
441: }
442:
443: public String getTitle() {
444: try {
445: this .data = (QuestionPoolDataIfc) questionPool.getData();
446: } catch (QuestionPoolException ex) {
447: throw new DataFacadeException(ex.getMessage());
448: }
449: return this .data.getTitle();
450: }
451:
452: public void setTitle(String title) {
453: this .title = title;
454: this .data.setTitle(title);
455: }
456:
457: public Long getParentPoolId() {
458: try {
459: this .data = (QuestionPoolDataIfc) questionPool.getData();
460: } catch (QuestionPoolException ex) {
461: throw new DataFacadeException(ex.getMessage());
462: }
463: if (this .data != null)
464: return this .data.getParentPoolId();
465: else
466: // implies ROOT_POOL
467: return null;
468: }
469:
470: public void setParentPoolId(Long parentPoolId) {
471: this .parentPoolId = parentPoolId;
472: this .data.setParentPoolId(parentPoolId);
473: }
474:
475: public String getOwnerId() {
476: try {
477: this .data = (QuestionPoolDataIfc) questionPool.getData();
478: } catch (QuestionPoolException ex) {
479: throw new DataFacadeException(ex.getMessage());
480: }
481: return this .data.getOwnerId();
482: }
483:
484: public void setOwnerId(String ownerId) {
485: this .ownerId = ownerId;
486: this .data.setOwnerId(ownerId);
487: }
488:
489: public AgentDataIfc getOwner() {
490: try {
491: this .data = (QuestionPoolDataIfc) questionPool.getData();
492: } catch (QuestionPoolException ex) {
493: throw new DataFacadeException(ex.getMessage());
494: }
495: return this .data.getOwner();
496: }
497:
498: public void setOwner(AgentDataIfc owner) {
499: this .owner = owner;
500: this .data.setOwner(owner);
501: }
502:
503: public Date getDateCreated() {
504: try {
505: this .data = (QuestionPoolDataIfc) questionPool.getData();
506: } catch (QuestionPoolException ex) {
507: throw new DataFacadeException(ex.getMessage());
508: }
509: return this .data.getDateCreated();
510: }
511:
512: public void setDateCreated(Date dateCreated) {
513: this .dateCreated = dateCreated;
514: this .data.setDateCreated(dateCreated);
515: }
516:
517: public Date getLastModified() {
518: //this.lastModified = lastModified;
519: try {
520: this .data = (QuestionPoolDataIfc) questionPool.getData();
521: } catch (QuestionPoolException ex) {
522: throw new DataFacadeException(ex.getMessage());
523: }
524: return this .data.getLastModified();
525: }
526:
527: public void setLastModified(Date lastModified) {
528: this .lastModified = lastModified;
529: this .data.setLastModified(lastModified);
530: }
531:
532: public String getLastModifiedById() {
533: try {
534: this .data = (QuestionPoolDataIfc) questionPool.getData();
535: } catch (QuestionPoolException ex) {
536: throw new DataFacadeException(ex.getMessage());
537: }
538: return this .data.getLastModifiedById();
539: }
540:
541: public void setLastModifiedById(String lastModifiedById) {
542: this .lastModifiedById = lastModifiedById;
543: this .data.setLastModifiedById(lastModifiedById);
544: }
545:
546: public AgentDataIfc getLastModifiedBy() {
547: try {
548: this .data = (QuestionPoolDataIfc) questionPool.getData();
549: } catch (QuestionPoolException ex) {
550: throw new DataFacadeException(ex.getMessage());
551: }
552: return this .data.getLastModifiedBy();
553: }
554:
555: public void setLastModifiedBy(AgentDataIfc lastModifiedBy) {
556: this .lastModifiedBy = lastModifiedBy;
557: this .data.setLastModifiedBy(lastModifiedBy);
558: }
559:
560: public Long getAccessTypeId() {
561: try {
562: this .data = (QuestionPoolDataIfc) questionPool.getData();
563: } catch (QuestionPoolException ex) {
564: throw new DataFacadeException(ex.getMessage());
565: }
566: return this .data.getAccessTypeId();
567: }
568:
569: public void setAccessTypeId(Long accessTypeId) {
570: this .accessTypeId = accessTypeId;
571: this .data.setAccessTypeId(accessTypeId);
572: }
573:
574: public TypeIfc getAccessType() {
575: try {
576: this .data = (QuestionPoolDataIfc) questionPool.getData();
577: } catch (QuestionPoolException ex) {
578: throw new DataFacadeException(ex.getMessage());
579: }
580: return this .data.getAccessType();
581: }
582:
583: public void setAccessType(TypeIfc accessType) {
584: this .accessType = accessType;
585: this .data.setAccessType(accessType);
586: }
587:
588: public String getObjectives() {
589: try {
590: this .data = (QuestionPoolDataIfc) questionPool.getData();
591: } catch (QuestionPoolException ex) {
592: throw new DataFacadeException(ex.getMessage());
593: }
594: return this .data.getObjectives();
595: }
596:
597: public void setObjectives(String objectives) {
598: this .objectives = objectives;
599: this .data.setObjectives(objectives);
600: }
601:
602: public String getKeywords() {
603: try {
604: this .data = (QuestionPoolDataIfc) questionPool.getData();
605: } catch (QuestionPoolException ex) {
606: throw new DataFacadeException(ex.getMessage());
607: }
608: return this .data.getKeywords();
609: }
610:
611: public void setKeywords(String keywords) {
612: this .keywords = keywords;
613: this .data.setKeywords(keywords);
614: }
615:
616: public String getRubric() {
617: try {
618: this .data = (QuestionPoolDataIfc) questionPool.getData();
619: } catch (QuestionPoolException ex) {
620: throw new DataFacadeException(ex.getMessage());
621: }
622: return this .data.getRubric();
623: }
624:
625: public void setRubric(String rubric) {
626: this .rubric = rubric;
627: this .data.setRubric(rubric);
628: }
629:
630: public Long getTypeId() {
631: try {
632: this .data = (QuestionPoolDataIfc) questionPool.getData();
633: } catch (QuestionPoolException ex) {
634: throw new DataFacadeException(ex.getMessage());
635: }
636: return this .data.getTypeId();
637: }
638:
639: public void setTypeId(Long typeId) {
640: this .typeId = typeId;
641: this .data.setTypeId(typeId);
642: }
643:
644: public TypeIfc getType() {
645: try {
646: this .data = (QuestionPoolDataIfc) questionPool.getData();
647: } catch (QuestionPoolException ex) {
648: throw new DataFacadeException(ex.getMessage());
649: }
650: return this .data.getType();
651: }
652:
653: public void setType(TypeIfc type) {
654: this .type = type;
655: this .data.setType(type);
656: }
657:
658: public Long getIntellectualPropertyId() {
659: try {
660: this .data = (QuestionPoolDataIfc) questionPool.getData();
661: } catch (QuestionPoolException ex) {
662: throw new DataFacadeException(ex.getMessage());
663: }
664: return this .data.getIntellectualPropertyId();
665: }
666:
667: public void setIntellectualPropertyId(Long intellectualPropertyId) {
668: this .intellectualPropertyId = intellectualPropertyId;
669: this .data.setIntellectualPropertyId(intellectualPropertyId);
670: }
671:
672: public String getOrganizationName() {
673: try {
674: this .data = (QuestionPoolDataIfc) questionPool.getData();
675: } catch (QuestionPoolException ex) {
676: throw new DataFacadeException(ex.getMessage());
677: }
678: return this .data.getOrganizationName();
679: }
680:
681: public void setOrganizationName(String organizationName) {
682: this .organizationName = organizationName;
683: this .data.setOrganizationName(organizationName);
684: }
685:
686: /**
687: * This is a list of association between an item (question) and a pool.
688: * This does not represent a list of items. use getQuestions()
689: * to get a list of items
690: */
691: public Set getQuestionPoolItems() {
692: try {
693: this .data = (QuestionPoolDataIfc) questionPool.getData();
694: } catch (QuestionPoolException ex) {
695: throw new DataFacadeException(ex.getMessage());
696: }
697: return this .data.getQuestionPoolItems();
698: }
699:
700: /*
701: public void setQuestionPoolItems(Set questionPoolItems) {
702: this.questionPoolItems = questionPoolItems;
703: this.data.setQuestions(questionPoolItems);
704: this.data.setQuestionPoolItems(questionPoolItems);
705: }
706: */
707:
708: public void setQuestionPoolItems(Set questionPoolItems) {
709: this .questionPoolItems = questionPoolItems;
710: this .data.setQuestionPoolItems(questionPoolItems);
711: }
712:
713: public void addQuestionPoolItem(
714: QuestionPoolItemIfc queestionPoolItem) {
715: Set questionPoolItemSet = getQuestionPoolItems();
716: questionPoolItemSet.add(queestionPoolItem);
717: setQuestionPoolItems(questionPoolItemSet);
718: }
719:
720: public Collection getQuestions() {
721: try {
722: this .data = (QuestionPoolDataIfc) questionPool.getData();
723: } catch (QuestionPoolException ex) {
724: throw new DataFacadeException(ex.getMessage());
725: }
726: return this .data.getQuestions();
727: }
728:
729: public void setQuestions(Collection items) {
730: this .items = items;
731: this .data.setQuestions(items);
732: }
733:
734: public Integer getQuestionSize() {
735: return new Integer(items.size());
736: }
737:
738: public void setSubPoolSize(Integer subPoolSize) {
739: this .subPoolSize = subPoolSize;
740: this .data.setSubPoolSize(subPoolSize);
741: }
742:
743: public Integer getSubPoolSize() {
744: try {
745: this .data = (QuestionPoolDataIfc) questionPool.getData();
746: } catch (QuestionPoolException ex) {
747: throw new DataFacadeException(ex.getMessage());
748: }
749: return this .data.getSubPoolSize();
750: }
751:
752: /* this was not used.
753: private ItemIteratorFacade getItemIterator() {
754: return new ItemIteratorFacade(items);
755: }
756: */
757:
758: public Object clone() {
759: QuestionPoolFacade newPool = new QuestionPoolFacade(
760: (QuestionPoolData) data.clone());
761: return newPool;
762: }
763:
764: public String getOwnerDisplayName() {
765: String ownerIdString = this .getOwnerId();
766: String ownerDisplayName = AgentFacade
767: .getDisplayName(ownerIdString);
768: return ownerDisplayName;
769: }
770:
771: }
|