001: /**********************************************************************************
002: * $URL: https://source.sakaiproject.org/svn/msgcntr/trunk/messageforums-hbm/src/java/org/sakaiproject/component/app/messageforums/dao/hibernate/DiscussionTopicImpl.java $
003: * $Id: DiscussionTopicImpl.java 9227 2006-05-15 15:02:42Z cwen@iupui.edu $
004: ***********************************************************************************
005: *
006: * Copyright (c) 2003, 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.component.app.messageforums.dao.hibernate;
021:
022: import java.util.List;
023:
024: import org.apache.commons.logging.Log;
025: import org.apache.commons.logging.LogFactory;
026: import org.sakaiproject.api.app.messageforums.ActorPermissions;
027: import org.sakaiproject.api.app.messageforums.DateRestrictions;
028: import org.sakaiproject.api.app.messageforums.DiscussionTopic;
029: import org.sakaiproject.api.app.messageforums.Label;
030: import org.sakaiproject.api.app.messageforums.UniqueArrayList;
031:
032: public class DiscussionTopicImpl extends OpenTopicImpl implements
033: DiscussionTopic {
034:
035: private static final Log LOG = LogFactory
036: .getLog(DiscussionTopicImpl.class);
037:
038: private Boolean confidentialResponses;
039: private Boolean mustRespondBeforeReading;
040: private Integer hourBeforeResponsesVisible;
041: private DateRestrictions dateRestrictions;
042: private ActorPermissions actorPermissions;
043: private List labels = new UniqueArrayList();
044: private String gradebook;
045: private String gradebookAssignment;
046:
047: public ActorPermissions getActorPermissions() {
048: return actorPermissions;
049: }
050:
051: public void setActorPermissions(ActorPermissions actorPermissions) {
052: this .actorPermissions = actorPermissions;
053: }
054:
055: public Boolean getConfidentialResponses() {
056: return confidentialResponses;
057: }
058:
059: public void setConfidentialResponses(Boolean confidentialResponses) {
060: this .confidentialResponses = confidentialResponses;
061: }
062:
063: public DateRestrictions getDateRestrictions() {
064: return dateRestrictions;
065: }
066:
067: public void setDateRestrictions(DateRestrictions dateRestrictions) {
068: this .dateRestrictions = dateRestrictions;
069: }
070:
071: public String getGradebook() {
072: return gradebook;
073: }
074:
075: public void setGradebook(String gradebook) {
076: this .gradebook = gradebook;
077: }
078:
079: public String getGradebookAssignment() {
080: return gradebookAssignment;
081: }
082:
083: public void setGradebookAssignment(String gradebookAssignment) {
084: this .gradebookAssignment = gradebookAssignment;
085: }
086:
087: public Integer getHourBeforeResponsesVisible() {
088: return hourBeforeResponsesVisible;
089: }
090:
091: public void setHourBeforeResponsesVisible(
092: Integer hourBeforeResponsesVisible) {
093: this .hourBeforeResponsesVisible = hourBeforeResponsesVisible;
094: }
095:
096: public List getLabels() {
097: return labels;
098: }
099:
100: public void setLabels(List labels) {
101: this .labels = labels;
102: }
103:
104: public Boolean getMustRespondBeforeReading() {
105: return mustRespondBeforeReading;
106: }
107:
108: public void setMustRespondBeforeReading(
109: Boolean mustRespondBeforeReading) {
110: this .mustRespondBeforeReading = mustRespondBeforeReading;
111: }
112:
113: ////////////////////////////////////////////////////////////////////////
114: // helper methods for collections
115: ////////////////////////////////////////////////////////////////////////
116:
117: public void addLabel(Label label) {
118: if (LOG.isDebugEnabled()) {
119: LOG.debug("addLabel(label " + label + ")");
120: }
121:
122: if (label == null) {
123: throw new IllegalArgumentException("topic == null");
124: }
125:
126: label.setDiscussionTopic(this );
127: labels.add(label);
128: }
129:
130: public void removeLabel(Label label) {
131: if (LOG.isDebugEnabled()) {
132: LOG.debug("removeLabel(label " + label + ")");
133: }
134:
135: if (label == null) {
136: throw new IllegalArgumentException(
137: "Illegal topic argument passed!");
138: }
139:
140: label.setDiscussionTopic(null);
141: labels.remove(label);
142: }
143: }
|