001: /**********************************************************************************
002: * $URL: https://source.sakaiproject.org/svn/msgcntr/trunk/messageforums-api/src/java/org/sakaiproject/api/app/messageforums/MessageForumsForumManager.java $
003: * $Id: MessageForumsForumManager.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.api.app.messageforums;
021:
022: import java.util.List;
023:
024: public interface MessageForumsForumManager {
025:
026: public List searchTopicMessages(Long topicId, String searchText);
027:
028: public List getTopicsByIdWithMessages(final Long forumId);
029:
030: public List getTopicsByIdWithMessagesAndAttachments(
031: final Long forumId);
032:
033: public List getTopicsByIdWithMessagesMembershipAndAttachments(
034: final Long forumId);
035:
036: public Topic getTopicByIdWithMessages(final Long topicId);
037:
038: public Topic getTopicByIdWithMessagesAndAttachments(
039: final Long topicId);
040:
041: public BaseForum getForumByIdWithTopics(final Long forumId);
042:
043: public List getForumByTypeAndContext(final String typeUuid);
044:
045: public List getForumByTypeAndContextWithTopicsAllAttachments(
046: final String typeUuid);
047:
048: public List getForumByTypeAndContext(final String typeUuid,
049: final String contextId);
050:
051: public Topic getTopicByIdWithAttachments(final Long topicId);
052:
053: /**
054: * Retrieve a given forum for the current user
055: */
056: public BaseForum getForumById(boolean open, Long forumId);
057:
058: public BaseForum getForumByUuid(String forumId);
059:
060: /**
061: * Create and save an empty discussion forum
062: * @return discussion forum
063: */
064: public DiscussionForum createDiscussionForum();
065:
066: /**
067: * create private forum
068: * @param title of forum
069: * @return private forum
070: */
071: public PrivateForum createPrivateForum(String title);
072:
073: /**
074: * save private forum
075: * @param forum to save
076: */
077: public void savePrivateForum(PrivateForum forum);
078:
079: /**
080: * Save a discussion forum
081: */
082: public void saveDiscussionForum(DiscussionForum forum);
083:
084: public void saveDiscussionForum(DiscussionForum forum, boolean draft);
085:
086: /**
087: * Create and save an empty discussion forum topic
088: */
089: public DiscussionTopic createDiscussionForumTopic(
090: DiscussionForum forum);
091:
092: /**
093: * Save a discussion forum topic
094: */
095: public void saveDiscussionForumTopic(DiscussionTopic topic);
096:
097: public void saveDiscussionForumTopic(DiscussionTopic topic,
098: boolean parentForumDraftStatus);
099:
100: /**
101: * Create and save an empty private discussion forum topic
102: */
103: public PrivateTopic createPrivateForumTopic(String title,
104: boolean forumIsParent, boolean topicIsMutable,
105: String userId, Long parentId);
106:
107: /**
108: * Save a discussion forum topic
109: */
110: public void savePrivateForumTopic(PrivateTopic topic);
111:
112: /**
113: * Delete a private forum topic
114: */
115: public void deletePrivateForumTopic(PrivateTopic topic);
116:
117: /**
118: * Create and save an empty open discussion forum topic
119: */
120: public OpenTopic createOpenForumTopic(OpenForum forum);
121:
122: /**
123: * Save an open forum topic
124: */
125: public void saveOpenForumTopic(OpenTopic topic);
126:
127: /**
128: * Delete a discussion forum and all topics/messages
129: */
130: public void deleteDiscussionForum(DiscussionForum forum);
131:
132: /**
133: * Delete a discussion forum topic
134: */
135: public void deleteDiscussionForumTopic(DiscussionTopic topic);
136:
137: /**
138: * Delete an open forum topic
139: */
140: public void deleteOpenForumTopic(OpenTopic topic);
141:
142: /**
143: * Returns a given number of messages if available in the time
144: * provided
145: * @param numberMessages the number of messages to retrieve
146: * @param numberDaysInPast the number days to look back
147: */
148: public List getRecentPrivateMessages(int numberMessages,
149: int numberDaysInPast);
150:
151: /**
152: * Returns a given number of discussion forum messages if available in
153: * the time provided
154: * @param numberMessages the number of forum messages to retrieve
155: * @param numberDaysInPast the number days to look back
156: */
157: public List getRecentDiscussionForumMessages(int numberMessages,
158: int numberDaysInPast);
159:
160: /**
161: * Returns a given number of open forum messages if available in
162: * the time provided
163: * @param numberMessages the number of forum messages to retrieve
164: * @param numberDaysInPast the number days to look back
165: */
166: public List getRecentOpenForumMessages(int numberMessages,
167: int numberDaysInPast);
168:
169: public Topic getTopicById(boolean open, Long topicId);
170:
171: public Topic getTopicByUuid(String uuid);
172:
173: /**
174: * Returns all moderated topics in the site
175: * @param areaId
176: * @return
177: */
178: public List getModeratedTopicsInSite(String contextId);
179:
180: /**
181: * @return
182: */
183: public ActorPermissions createDefaultActorPermissions();
184:
185: public PrivateForum getPrivateForumByOwnerArea(final String owner,
186: final Area area);
187:
188: public PrivateForum getPrivateForumByOwnerAreaNull(
189: final String owner);
190:
191: public PrivateForum getPrivateForumByOwnerAreaWithAllTopics(
192: final String owner, final Area area);
193:
194: public PrivateForum getPrivateForumByOwnerAreaNullWithAllTopics(
195: final String owner);
196:
197: public List getForumByTypeAndContextWithTopicsMembership(
198: final String typeUuid, final String contextId);
199:
200: /**
201: * Returns # moderated topics that the current user has moderate
202: * perm for, given the user's memberships and contextid
203: * @param membershipItems
204: * @param contextId
205: * @return
206: */
207: public int getNumModTopicCurrentUserHasModPermFor(
208: final List membershipItems);
209: }
|