com.arsdigita.forum
Class Forum

java.lang.Object
  extended bycom.arsdigita.domain.DomainObject
      extended bycom.arsdigita.domain.ObservableDomainObject
          extended bycom.arsdigita.kernel.ACSObject
              extended bycom.arsdigita.kernel.Resource
                  extended bycom.arsdigita.web.Application
                      extended bycom.arsdigita.forum.Forum

public class Forum
extends com.arsdigita.web.Application

The Forum class represents a discussion forum.

Version:
$Revision: #24 $ $Author: sskracic $ $DateTime: 2004/06/04 17:59:27 $
Author:
Kevin Scaldeferri (kevin@arsdigita.com)

Field Summary
static String BASE_DATA_OBJECT_TYPE
           
static String FORUM_MODERATION_PRIVILEGE
           
static String PACKAGE_TYPE
           
static String versionId
           
 
Fields inherited from class com.arsdigita.web.Application
PRIMARY_URL
 
Fields inherited from class com.arsdigita.kernel.Resource
CHILD_RESOURCE, DESCRIPTION, PARENT_RESOURCE, RESOURCE_TYPE, TIMESTAMP, TITLE
 
Fields inherited from class com.arsdigita.kernel.ACSObject
CONTAINER, DEFAULT_DOMAIN_CLASS, DISPLAY_NAME, ID, OBJECT_TYPE
 
Constructor Summary
Forum(BigDecimal id)
           
Forum(com.arsdigita.persistence.DataObject data)
           
Forum(com.arsdigita.persistence.OID oid)
           
 
Method Summary
protected  void afterSave()
           
protected  void beforeSave()
           
 boolean canAdminister(com.arsdigita.kernel.Party party)
           
 boolean canEdit(com.arsdigita.kernel.Party party)
          checks if the user can edit posts in this forum
 boolean canModerate(com.arsdigita.kernel.Party party)
           
static Forum create(String urlName, String title, com.arsdigita.web.Application parent)
           
static Forum create(String urlName, String title, com.arsdigita.web.Application parent, boolean moderated)
          This method should be used to create a new Forum object everywhere except in the constructor of a subclass of Forum.
protected  void createSubscriptions()
          Sets up instant and daily subscriptions for the forum.
 com.arsdigita.persistence.DataCollection getAllSubscriptions()
          Gets all the Subscriptions associated with this Forum.
protected  String getBaseDataObjectType()
           
 com.arsdigita.persistence.DataQuery getCategories()
          Gets categories and number of posts for the forum.
static ForumConfig getConfig()
           
 String getContextPath()
           
 com.arsdigita.persistence.DataQuery getEmptyCategories()
          Gets empty categories for the forum.
 com.arsdigita.persistence.DataAssociationCursor getFilledCategories()
           
 com.arsdigita.persistence.DataCollection getModerationAlerts()
           
 com.arsdigita.kernel.Group getModerationGroup()
          Returns the moderator group.
 com.arsdigita.persistence.DataAssociation getPosts()
          Experimental Gets all the messages which have been posted to this forum.
 com.arsdigita.categorization.Category getRootCategory()
           
 String getServletPath()
           
 com.arsdigita.persistence.DataCollection getSubscriptions()
           
 ThreadCollection getThreads()
          Gets a ThreadCollection of the threads in this forum.
 ThreadCollection getThreads(BigDecimal categoryID)
          Gets a ThreadCollection of the threads in a specific Category.
 ThreadCollection getThreads(BigDecimal categoryID, com.arsdigita.kernel.Party party)
          Gets a ThreadCollection of the threads in a specific Category.
 ThreadCollection getThreads(com.arsdigita.kernel.Party party)
          Gets a ThreadCollection of the threads in this forum.
 com.arsdigita.persistence.DataQuery getUnCategory()
          Gets Uncategory and number of posts for the forum.
 boolean hasCategorizedPosts(com.arsdigita.categorization.Category cat)
          Receives category and returns boolean of whether forum has posts in that category.
 void initialize()
           
 boolean isModerated()
           
 void setModerated(boolean moderate)
          Enables / disables moderation on the forum.
 
Methods inherited from class com.arsdigita.web.Application
afterDelete, createApplication, createApplication, createRootApplication, getAncestorApplications, getApplicationType, getCanonicalURL, getChildApplications, getChildApplicationsForType, getContainingApplication, getCurrentApplication, getPackageType, getParentApplication, getPath, getPrimaryURL, getRelevantPrivileges, getSiteNode, getStylesheetPath, isInstalled, retrieveAllApplications, retrieveApplication, retrieveApplication, retrieveApplication, retrieveApplicationForPath, retrieveApplicationForSiteNode, setApplicationType, setParentApplication, setPath
 
Methods inherited from class com.arsdigita.kernel.Resource
createResource, createResource, getChildResources, getContainer, getContainingResource, getDescription, getDisplayName, getParentResource, getResourceType, getTimestamp, getTitle, isContainerModified, retrieveAllResources, retrieveResource, retrieveResource, retrieveResource, setDescription, setParentResource, setResourceType, setTitle
 
Methods inherited from class com.arsdigita.kernel.ACSObject
assertPrivilege, checkPrivilege, doCreateCheck, doWriteCheck, getDefaultDomainClass, getID, getSpecificObjectType, getSpecificOID, gimmeContainer, setID, setID
 
Methods inherited from class com.arsdigita.domain.ObservableDomainObject
addObserver, getObservers
 
Methods inherited from class com.arsdigita.domain.DomainObject
add, add, addToAssociation, beforeDelete, clear, delete, disconnect, equals, get, getObjectType, getOID, getSession, hashCode, isDeleted, isDisconnected, isModified, isNew, isPropertyModified, isValid, remove, remove, remove, removeFromAssociation, save, set, setAssociation, setAssociation, specializeDataObject, specializeDataObject, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

versionId

public static final String versionId
See Also:
Constant Field Values

BASE_DATA_OBJECT_TYPE

public static final String BASE_DATA_OBJECT_TYPE
See Also:
Constant Field Values

PACKAGE_TYPE

public static final String PACKAGE_TYPE
See Also:
Constant Field Values

FORUM_MODERATION_PRIVILEGE

public static final String FORUM_MODERATION_PRIVILEGE
See Also:
Constant Field Values
Constructor Detail

Forum

public Forum(com.arsdigita.persistence.DataObject data)

Forum

public Forum(com.arsdigita.persistence.OID oid)
      throws com.arsdigita.domain.DataObjectNotFoundException

Forum

public Forum(BigDecimal id)
      throws com.arsdigita.domain.DataObjectNotFoundException
Method Detail

getConfig

public static ForumConfig getConfig()

create

public static Forum create(String urlName,
                           String title,
                           com.arsdigita.web.Application parent)

create

public static Forum create(String urlName,
                           String title,
                           com.arsdigita.web.Application parent,
                           boolean moderated)
This method should be used to create a new Forum object everywhere except in the constructor of a subclass of Forum. This will by default create a new Category which will be the root category for the Forum in the event that the Forum should be categorized. This also sets up instant and daily subscriptions on the Forum. The default for moderation is false


getRootCategory

public com.arsdigita.categorization.Category getRootCategory()
Returns:
the Root Category for this forum, or creates a new one does not have a root category, and returns it.

initialize

public void initialize()

beforeSave

protected void beforeSave()

afterSave

protected void afterSave()

getBaseDataObjectType

protected String getBaseDataObjectType()

getAllSubscriptions

public com.arsdigita.persistence.DataCollection getAllSubscriptions()
Gets all the Subscriptions associated with this Forum.


getSubscriptions

public com.arsdigita.persistence.DataCollection getSubscriptions()

getModerationAlerts

public com.arsdigita.persistence.DataCollection getModerationAlerts()

getPosts

public com.arsdigita.persistence.DataAssociation getPosts()
Experimental Gets all the messages which have been posted to this forum. We never actually use this method and it may disappear in the near future. (This method is not actually as useful as it might appear because you don't get important information like the depth of the message in the thread. OTOH, maybe it should be modified to use a custom DataQuery which does this.)


getThreads

public ThreadCollection getThreads()
Gets a ThreadCollection of the threads in this forum. I.e. the top-level posts which are not replies to any other post.


getThreads

public ThreadCollection getThreads(com.arsdigita.kernel.Party party)
Gets a ThreadCollection of the threads in this forum. I.e. the top-level posts which are not replies to any other post. It is filtered to only show approved messages, or those posted by the user


getThreads

public ThreadCollection getThreads(BigDecimal categoryID)
Gets a ThreadCollection of the threads in a specific Category.


getThreads

public ThreadCollection getThreads(BigDecimal categoryID,
                                   com.arsdigita.kernel.Party party)
Gets a ThreadCollection of the threads in a specific Category. It is filtered to only show approved messages, or those posted by the user


createSubscriptions

protected void createSubscriptions()
Sets up instant and daily subscriptions for the forum. Daily digests will appear to come from the specified user. The subscriptions are save()d by this method.


getCategories

public com.arsdigita.persistence.DataQuery getCategories()
Gets categories and number of posts for the forum.

Returns:
DataQuery with category_id, name, number of threads, and last post date

getEmptyCategories

public com.arsdigita.persistence.DataQuery getEmptyCategories()
Gets empty categories for the forum.

Returns:
DataQuery with category_id and name

getUnCategory

public com.arsdigita.persistence.DataQuery getUnCategory()
Gets Uncategory and number of posts for the forum.

Returns:
DataQuery with number of threads

getFilledCategories

public com.arsdigita.persistence.DataAssociationCursor getFilledCategories()

hasCategorizedPosts

public boolean hasCategorizedPosts(com.arsdigita.categorization.Category cat)
Receives category and returns boolean of whether forum has posts in that category.

Returns:
boolean

canEdit

public boolean canEdit(com.arsdigita.kernel.Party party)
checks if the user can edit posts in this forum


canAdminister

public boolean canAdminister(com.arsdigita.kernel.Party party)

canModerate

public boolean canModerate(com.arsdigita.kernel.Party party)

setModerated

public void setModerated(boolean moderate)
Enables / disables moderation on the forum. When disabling moderation, all pending posts will be automatically marked as approved.


isModerated

public boolean isModerated()

getModerationGroup

public com.arsdigita.kernel.Group getModerationGroup()
Returns the moderator group. Null if it doesn't exist


getContextPath

public String getContextPath()

getServletPath

public String getServletPath()


Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 21 2004:2348 UTC