org.mmbase.module.community
Class CommunityPrc

java.lang.Object
  |
  +--org.mmbase.module.Module
        |
        +--org.mmbase.module.ProcessorModule
              |
              +--org.mmbase.module.community.CommunityPrc
All Implemented Interfaces:
ProcessorInterface

public class CommunityPrc
extends ProcessorModule

This module is the general manager for the community objects (chat and forums). It processes message posts, retrieves info, and generates lists of messages and users. In this manner, it is more an application than a module. The community 'application' consists of the Community, Channel, and Message builder.
The Community builder is a pool of channels of a similar type (chatbox, forum, or guestbook).
The Channel builder defines a channel - a 'location' which manages a forum discussion or chat.
The Message builder defines a single message - a persistent message in case of a forum or guestbook, a temporary message in the case of a chat.
Optional builders that provide additional information are a Moods builder (associated with a channel, it may provide backgrounds, colors, or other dressing), a Chatter builder (which hold the users of a chat or forum), or a Maps builder (used for generating links).

Version:
31 Jan 2001
Author:
Dirk-Jan Hoekstra, Pierre van Rooden

Constructor Summary
CommunityPrc()
          Create a Community module instance.
 
Method Summary
 java.util.Vector getList(scanpage sp, StringTagger params, java.lang.String command)
          Generates a list of values from a command to the processor.
 MMObjectBuilder getListBuilder(java.lang.String command, java.util.Map params)
          Returns a virtual builder used to create node lists from the results returned by getList().
 java.util.Vector getListTemporaryRelations(StringTagger params)
          This function returns a vector, like LIST RELATED does, with the values of the specified fields of the related nodes to a specified node.
 java.util.Vector getNodeList(java.lang.Object context, java.lang.String command, java.util.Map params)
          Generates a list of values from a command to the processor.
 java.util.Vector getNodeListTemporaryRelations(java.util.Map params)
          This function returns a vector, like LIST RELATED does, with the values of the specified fields of the related nodes to a specified node.
 void init()
          Initailize the communit.
 boolean process(scanpage sp, java.util.Hashtable cmds, java.util.Hashtable vars)
          Execute the commands provided in the form values.
 java.lang.String replace(scanpage sp, java.lang.String cmds)
          Handle a $MOD command.
 
Methods inherited from class org.mmbase.module.ProcessorModule
cacheCheck, onload, reload, replace, shutdown, unload
 
Methods inherited from class org.mmbase.module.Module
getClassName, getInitParameter, getInitParameters, getMaintainer, getMimeType, getMimeTypeFile, getModule, getModule, getModuleInfo, getModules, getName, getProperties, getProperty, getVersion, hasStarted, loadModulesFromDisk, maintainance, setClassName, setInitParameter, setMaintainer, setName, setVersion, startModule, startModules, state
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommunityPrc

public CommunityPrc()
Create a Community module instance.
Method Detail

init

public void init()
Initailize the communit. Makes sure MMBase starts first (as it needs a refernce to its builders).
Overrides:
init in class ProcessorModule

replace

public java.lang.String replace(scanpage sp,
                                java.lang.String cmds)
Handle a $MOD command. The actual commands are directed to the Message, Channel, and Community builders.
Overrides:
replace in class ProcessorModule
Parameters:
sp - The scanpage (containing http and user info) that calls the function
cmds - the command to execute
Returns:
the result value as a String

process

public boolean process(scanpage sp,
                       java.util.Hashtable cmds,
                       java.util.Hashtable vars)
Execute the commands provided in the form values. This method returns values which allow the page to check whether the operation was succesful (MESSAGE-NUMBER or MESSAGE-ERROR). If the page has a session object, the data is stored in the session object. This means that SCAN can retrieve the data using the $SESSION command. If session is not present, the data is stored (added) in the vars parameter. This allows a system that uses the MMCI (such as jsp) to retrieve the value.
XXX: This is a bit of a sloppy way to pass results, and the actual mechanics may get changed (formalized) in the future.
Overrides:
process in class ProcessorModule
Parameters:
sp - The scanpage (containing http and user info) that calls the function
cmds - the commands to process
vars - variables that were set to be used during processing.
Returns:
the result value as a String

getListBuilder

public MMObjectBuilder getListBuilder(java.lang.String command,
                                      java.util.Map params)
Returns a virtual builder used to create node lists from the results returned by getList(). The default method does not associate the builder with a cloud (mmbase module), so processormodules that need this association need to override this method. Note that different lists may return different builders.
Overrides:
getListBuilder in class ProcessorModule
Parameters:
command - the LIST command for which to retrieve the builder
params - contains the attributes for the list

getNodeList

public java.util.Vector getNodeList(java.lang.Object context,
                                    java.lang.String command,
                                    java.util.Map params)
                             throws ParseException
Generates a list of values from a command to the processor. Recognized commands are TREE, WHO, and TEMPORARYRELATIONS.
Overrides:
getNodeList in class ProcessorModule
Parameters:
context - the context of the page or calling application (currently, this should be a scanpage object)
command - the list command to execute.
params - contains the attributes for the list
Returns:
a Vector that contains the list values as MMObjectNodes

getList

public java.util.Vector getList(scanpage sp,
                                StringTagger params,
                                java.lang.String command)
                         throws ParseException
Generates a list of values from a command to the processor. Recognized commands are TREE, WHO, and TEMPORARYRELATIONS. If the command is not one of these, it returns null;
Overrides:
getList in class ProcessorModule
Parameters:
sp - the page context
params - contains the attributes for the list
command - the list command to execute.
Returns:
a Vector that contains the list values

getListTemporaryRelations

public java.util.Vector getListTemporaryRelations(StringTagger params)
This function returns a vector, like LIST RELATED does, with the values of the specified fields of the related nodes to a specified node. Only the field values of nodes that are related via a temporary insrel object are returned. Both real and temporary nodes are returned.
  • <LIST TEMPORARYRELATED NODE="..." TYPE="..." FIELDS="...">
  • NODE - The node to get the related nodes from.
  • TYPE - The wanted type of nodes to return.
  • FIELDS - The values of the fields to return.

getNodeListTemporaryRelations

public java.util.Vector getNodeListTemporaryRelations(java.util.Map params)
This function returns a vector, like LIST RELATED does, with the values of the specified fields of the related nodes to a specified node. Only the field values of nodes that are related via a temporary insrel object are returned. Both real and temporary nodes are returned.
  • <LIST TEMPORARYRELATED NODE="..." TYPE="..." FIELDS="...">
  • NODE - The node to get the related nodes from.
  • TYPE - The wanted type of nodes to return.
  • FIELDS - The values of the fields to return.


MMBase 2001