001: /**
002: * Copyright (C) 2001 Yasna.com. All rights reserved.
003: *
004: * ===================================================================
005: * The Apache Software License, Version 1.1
006: *
007: * Redistribution and use in source and binary forms, with or without
008: * modification, are permitted provided that the following conditions
009: * are met:
010: *
011: * 1. Redistributions of source code must retain the above copyright
012: * notice, this list of conditions and the following disclaimer.
013: *
014: * 2. Redistributions in binary form must reproduce the above copyright
015: * notice, this list of conditions and the following disclaimer in
016: * the documentation and/or other materials provided with the
017: * distribution.
018: *
019: * 3. The end-user documentation included with the redistribution,
020: * if any, must include the following acknowledgment:
021: * "This product includes software developed by
022: * Yasna.com (http://www.yasna.com)."
023: * Alternately, this acknowledgment may appear in the software itself,
024: * if and wherever such third-party acknowledgments normally appear.
025: *
026: * 4. The names "Yazd" and "Yasna.com" must not be used to
027: * endorse or promote products derived from this software without
028: * prior written permission. For written permission, please
029: * contact yazd@yasna.com.
030: *
031: * 5. Products derived from this software may not be called "Yazd",
032: * nor may "Yazd" appear in their name, without prior written
033: * permission of Yasna.com.
034: *
035: * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
036: * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
037: * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
038: * DISCLAIMED. IN NO EVENT SHALL YASNA.COM OR
039: * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
040: * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
041: * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
042: * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
043: * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
044: * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
045: * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
046: * SUCH DAMAGE.
047: * ====================================================================
048: *
049: * This software consists of voluntary contributions made by many
050: * individuals on behalf of Yasna.com. For more information
051: * on Yasna.com, please see <http://www.yasna.com>.
052: */package com.Yasna.forum;
053:
054: import java.util.Iterator;
055: import java.util.Date;
056:
057: public interface Category {
058:
059: /**
060: * Returns the unique id of the Category.
061: *
062: * @return the unique id of the Category.
063: */
064: public int getID();
065:
066: /**
067: * Returns the name of the Category. Every category name in the system must be
068: * unique. However, this restriction allows one to lookup a category by name
069: * as well as by ID.
070: *
071: * @return the name of the category.
072: */
073: public String getName();
074:
075: /**
076: * Sets the name of the Category. Every category name in the system must be
077: * unique.
078: *
079: * An exception will be thrown if a category with the same name as the new
080: * name already exists.
081: *
082: * @param name the name of the category.
083: * @throws UnauthorizedException if does not have ADMIN permissions.
084: * @throws CategoryAlreadyExistsException if a category with the specified name
085: * already exists.
086: */
087: public void setName(String name) throws UnauthorizedException,
088: CategoryAlreadyExistsException;
089:
090: /**
091: * this returns the value of the order of Category. This value is used to sort the categories.
092: * @return category order
093: */
094: public int getOrder();
095:
096: /**
097: * you can use this method to set the value of the category order. This value is used to sort the categories.
098: * @param param
099: * @throws UnauthorizedException
100: */
101: public void setOrder(int param) throws UnauthorizedException;
102:
103: /**
104: * Returns the description of the Category.
105: *
106: * @return the description of the Category.
107: */
108: public String getDescription();
109:
110: /**
111: * Sets the description of the Category.
112: *
113: * @param description the description of the Category.
114: * @throws UnauthorizedException if does not have ADMIN permissions.
115: */
116: public void setDescription(String description)
117: throws UnauthorizedException;
118:
119: /**
120: * Returns the Date that the Category was created.
121: *
122: * @return the Date the Category was created.
123: */
124: public Date getCreationDate();
125:
126: /**
127: * Sets the creation date of the Category.
128: *
129: * @param creationDate the date the Category was created.
130: * @throws UnauthorizedException if does not have ADMIN permissions.
131: */
132: public void setCreationDate(Date creationDate)
133: throws UnauthorizedException;
134:
135: /**
136: * Returns the Date that the Category was last modified.
137: *
138: * @return the Date the Category was last modified.
139: */
140: public Date getModifiedDate();
141:
142: /**
143: * Sets the date the Category was last modified.
144: *
145: * @param modifiedDate the date the Category was modified.
146: * @throws UnauthorizedException if does not have ADMIN permissions.
147: */
148: public void setModifiedDate(Date modifiedDate)
149: throws UnauthorizedException;
150:
151: /**
152: * Returns the forumGroup specified by id. The method will return null
153: * if the forumGroup is not in the Category.
154: */
155: public ForumGroup getForumGroup(int forumGroupID)
156: throws ForumGroupNotFoundException;
157:
158: /**
159: * Deletes a forumGroup and all forums that belongs to it.
160: *
161: * @param forumGroup the forumGroup to delete.
162: * @throws UnauthorizedException if does not have ADMIN permissions.
163: */
164: public void deleteForumGroup(ForumGroup forumGroup)
165: throws UnauthorizedException;
166:
167: /**
168: * Creates a new Forum Group.
169: *
170: * @param name the name of the ForumGroup.
171: * @param description the description of the ForumGroup.
172: * @throws UnauthorizedException if not allowed to create a ForumGroup.
173: */
174: public abstract ForumGroup createForumGroup(String name,
175: String description) throws UnauthorizedException;
176:
177: /**
178: * Returns a Iterator for the Category to move through the forumGroups.
179: */
180: public Iterator forumGroups();
181:
182: }
|