|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
|
+--org.mmbase.module.core.MMTable
|
+--org.mmbase.module.core.MMObjectBuilder
|
+--org.mmbase.module.builders.Message
This builder implements additional functionality and methods to handle community objects. Added functionality involve posting and removing a message, managing temporary messages, and retrieving message lists for a specific 'thread'.
| Field Summary | |
static java.lang.String |
F_BODY
Field : body |
static java.lang.String |
F_GET_INFO_VALUE
Formatting Function : getinfovalue |
static java.lang.String |
F_HAS_REPLIES
Virtual Field : hasreplies |
static java.lang.String |
F_INFO
Field : info |
static java.lang.String |
F_PARENT
Virtual Field : parent |
static java.lang.String |
F_RE_SUBJECT
Virtual Field : resubject |
static java.lang.String |
F_REPLY_COUNT
Virtual Field : replycount |
static java.lang.String |
F_SEQUENCE
Field : sequence |
static java.lang.String |
F_SUBJECT
Field : subject |
static java.lang.String |
F_THREAD
Field : thread |
static java.lang.String |
F_TIMESTAMP
Field : timestamp |
static java.lang.String |
F_TIMESTAMPSEC
Field : timestamp in seconds |
static java.lang.String |
LIST_HEAD_TAG
Default tag for the listhead message field |
static java.lang.String |
LIST_TAIL_TAG
Default tag for the listtail message field |
protected int |
maxBodySize
Maximum message body size in bytes. |
static int |
POST_ERROR_BODY_EXCEEDS_SIZE
|
static int |
POST_ERROR_NEED_LOGIN
|
static int |
POST_ERROR_NO_BODY_TEXT
|
static int |
POST_ERROR_NO_SUBJECT
|
static int |
POST_ERROR_NO_USER
|
static int |
POST_ERROR_RELATION_CHANNEL
|
static int |
POST_ERROR_RELATION_USER
|
static int |
POST_ERROR_UNKNOWN
|
static int |
POST_OK
|
TemporaryNodeManager |
tmpNodeManager
|
| Fields inherited from class org.mmbase.module.core.MMObjectBuilder |
broadcastChanges, database, DEFAULT_ALINEA, DEFAULT_EOL, description, descriptions, fields, nodeCache, obj2type, OBJ2TYPE_MAX_SIZE, oType, REPLACE_CACHE, searchAge, sortedDBLayout, TEMPNODE_DEFAULT_SIZE, TemporaryNodes, virtual |
| Fields inherited from class org.mmbase.module.core.MMTable |
mmb, tableName |
| Constructor Summary | |
Message()
Constructor |
|
| Method Summary | |
protected java.lang.Object |
executeFunction(MMObjectNode node,
java.lang.String function,
java.lang.String field)
Executes a function on the field of a node, and returns the result. |
java.util.Vector |
getListMessages(MMObjectNode thread,
java.util.Vector fields,
java.util.Comparator ci,
int maxCount,
int depth,
int maxDepth,
int startAfterNode,
java.lang.String nodeselectfield)
Retrieves a list of messages related to a thread. |
java.util.Vector |
getListMessages(StringTagger params)
Retrieves a list of messages related to a thread. |
java.lang.String |
getMessageError(int error)
Obtains the description of an error that occurred during a user-induced action on a message (such as a post). |
java.lang.String |
getNewTemporaryKey()
Generates a new temporary key for a temporary message. |
org.mmbase.module.builders.ThreadStats |
getNrMsgAndHighSeq(MMObjectNode node)
|
java.util.Vector |
getRelatedMessages(MMObjectNode node,
java.util.Comparator ci)
Retrieves a list of messages related to a thread. |
java.util.Enumeration |
getReplies(MMObjectNode node)
Get all relations for a node with other messages. |
java.util.Vector |
getTemporaryRelated(MMObjectNode node,
java.lang.String wtype)
Get temporary MMObjectNodes related to a specified MMObjectNode |
java.util.Vector |
getTemporaryRelated(MMObjectNode node,
java.lang.String wtype,
int offset,
int max)
Get temporary MMObjectNodes related to a specified MMObjectNode |
TimeStamp |
getTimeStamp(MMObjectNode node)
Get the nodes timestampl and timestamph and return them as a TimeStamp. |
java.lang.Object |
getValue(MMObjectNode node,
java.lang.String field)
Provides additional functionality when obtaining field values. |
boolean |
hasReplies(MMObjectNode node)
Returns whether a node has replies or not. |
boolean |
init()
Initializes this builder The property 'mmb' needs to be set for the builder before this method can be called. |
int |
insert(java.lang.String owner,
MMObjectNode node)
Inserts a message node to the database. |
MMObjectNode |
isPostedInChannel(MMObjectNode node)
Returns the channel in which the given message node is posted. |
int |
post(java.lang.String body,
int channel,
int chatter)
Posts a message as a temporary message node. |
int |
post(java.lang.String body,
int channel,
int chatter,
java.lang.String chatterName)
Posts a message as a temporary message node. |
int |
post(java.lang.String subject,
java.lang.String body,
int channel,
int thread,
int chatter,
java.lang.String chatterName)
Post a new message in the channel. |
void |
removeNode(MMObjectNode node)
Remove a node if it's not a parent message to another message. |
void |
removeNode(MMObjectNode node,
boolean recursive)
Remove a node and, optionally, it's child nodes. |
java.lang.String |
replace(scanpage sp,
java.util.StringTokenizer tok)
Handles the $MOD-MMBASE-BUILDER-message- commands. |
int |
update(java.lang.String chatterName,
int chatter,
java.lang.String subject,
java.lang.String body,
int number)
Changes the subject and body fields, and the name of the poster when stored in the info-field of an already existing message. |
int |
update(java.lang.String chatterName,
java.lang.String subject,
java.lang.String body,
int number)
Changes the subject and body fields, and the name of the poster when stored in the info-field of an already existing message. |
| Methods inherited from class org.mmbase.module.core.MMTable |
size |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int POST_OK
public static final int POST_ERROR_UNKNOWN
public static final int POST_ERROR_BODY_EXCEEDS_SIZE
public static final int POST_ERROR_NO_USER
public static final int POST_ERROR_NEED_LOGIN
public static final int POST_ERROR_RELATION_CHANNEL
public static final int POST_ERROR_RELATION_USER
public static final int POST_ERROR_NO_BODY_TEXT
public static final int POST_ERROR_NO_SUBJECT
public static final java.lang.String LIST_HEAD_TAG
listhead message fieldpublic static final java.lang.String LIST_TAIL_TAG
listtail message fieldpublic static final java.lang.String F_THREAD
public static final java.lang.String F_BODY
public static final java.lang.String F_SUBJECT
public static final java.lang.String F_SEQUENCE
public static final java.lang.String F_INFO
public static final java.lang.String F_TIMESTAMP
public static final java.lang.String F_TIMESTAMPSEC
public static final java.lang.String F_RE_SUBJECT
public static final java.lang.String F_REPLY_COUNT
public static final java.lang.String F_HAS_REPLIES
public static final java.lang.String F_PARENT
public static final java.lang.String F_GET_INFO_VALUE
protected int maxBodySize
public TemporaryNodeManager tmpNodeManager
| Constructor Detail |
public Message()
| Method Detail |
public boolean init()
MMObjectBuilderinit in class MMObjectBuilderorg.mmbase.module.core.MMObjectBuilderMMObjectBuilder.create()public java.lang.String getMessageError(int error)
the - error number
public int post(java.lang.String subject,
java.lang.String body,
int channel,
int thread,
int chatter,
java.lang.String chatterName)
subject - The subject of the message.body - The body of the message.channel - The channel in which the message has to get posted.thread - The number of the thread (a Message or Channel) in which the Message has to get listed.chatter - The usernumber of the user that has written the message.chatterName - The name of the person that has written the message when he hasn't a usernumber.
public int post(java.lang.String body,
int channel,
int chatter)
body - The body of the message.channel - The channel in which the message has to get posted.chatter - The usernumber of the user that has written the message.POST_OK on success, otherwise an error number.
The number can be used with getPostError() to get the errormessage.
public int post(java.lang.String body,
int channel,
int chatter,
java.lang.String chatterName)
body - The body of the message.channel - The channel in which the message has to get posted.chatter - The usernumber of the user that has written the message.POST_OK on success, otherwise an error number.
The number can be used with getPostError() to get the errormessage.
public int insert(java.lang.String owner,
MMObjectNode node)
insert in class MMObjectBuilderowner - The owner of the node.node - The node to insert.
public int update(java.lang.String chatterName,
java.lang.String subject,
java.lang.String body,
int number)
chatterName - The name of the person who has written the message.subject - The subject of the message.body - The body of the message.number - The message node's number.POST_OK on success, otherwise an error number.
The number can be used with getPostError() to get the errormessage.
public int update(java.lang.String chatterName,
int chatter,
java.lang.String subject,
java.lang.String body,
int number)
chatterName - The name of the person who has written the message.chatter - the number of the chatter objectsubject - The subject of the message.body - The body of the message.number - The message node's number.POST_OK on success, otherwise an error number.
The number can be used with getPostError() to get the errormessage.public java.util.Vector getListMessages(StringTagger params)
<ul> for the
listhead field. Should be tagname without the tag delimiters.</ul> for the
listtail field. Should be tagname without the tag delimiters.params - the attributes of the LIST tag.Vector containing the requested fields.
public java.util.Vector getListMessages(MMObjectNode thread,
java.util.Vector fields,
java.util.Comparator ci,
int maxCount,
int depth,
int maxDepth,
int startAfterNode,
java.lang.String nodeselectfield)
thread - the number of the message or channel that is the parent of
the messages requestedfields - a Vector with fieldnames to return. This may change as some
fields are mandatory in certain situationsci - A Comparator to use for sorting the messagesmaxCount - : Maximum number of messages to returndepth - the current depth at which emssages are searchedmaxDepth - the maximum depth at which to search for (replies to)
messagesstartAfterNode - starts messages after the message identified
with the specified valuenodeselectfield - field to which to compare the value of
startAfterNode (i.e. 'number' or 'sequence').Vector containing the requested fields.
public java.util.Vector getRelatedMessages(MMObjectNode node,
java.util.Comparator ci)
thread - the number of the message or channel that is the parent of
the messages requestedci - A Comparator to use for sorting the messagesVector containing the requested message nodes.
public java.util.Vector getTemporaryRelated(MMObjectNode node,
java.lang.String wtype)
sourceNode - this is the source MMObjectNodewtype - Specifies the type of the nodes you want to have e.g. wtype="pools"
public java.util.Vector getTemporaryRelated(MMObjectNode node,
java.lang.String wtype,
int offset,
int max)
sourceNode - this is the source MMObjectNodewtype - Specifies the type of the nodes you want to have e.g. wtype="pools"public void removeNode(MMObjectNode node)
removeNode in class MMObjectBuildernode - the node to remove
public void removeNode(MMObjectNode node,
boolean recursive)
node - the node to removerecursive - if true, the node will be removed along with
its childnodes if it has any. Otherwise, it will only be removed if the ndoe
hs no children.public org.mmbase.module.builders.ThreadStats getNrMsgAndHighSeq(MMObjectNode node)
public boolean hasReplies(MMObjectNode node)
node - the node to find the relations oftrue if the node has related messages.public java.util.Enumeration getReplies(MMObjectNode node)
node - the node to find the relations ofEnumeration containign the related messages.
public java.lang.Object getValue(MMObjectNode node,
java.lang.String field)
getValue in class MMObjectBuildernode - the node whose fields are queriedfield - the fieldname that is requestednull if no valid functions or virtual fields could be determined.
protected java.lang.Object executeFunction(MMObjectNode node,
java.lang.String function,
java.lang.String field)
getValue(org.mmbase.module.core.MMObjectNode, java.lang.String) method.
Functions implemented are hasreplies() and getinfovalue().executeFunction in class MMObjectBuildernode - the node whose fields are queriesfield - the fieldname that is requested
public java.lang.String replace(scanpage sp,
java.util.StringTokenizer tok)
replace in class MMObjectBuilderorg.mmbase.module.core.MMObjectBuildersp - The scanpage (containing http and user info) that calls the functiontok - a list of strings that describe the (sub)command to executeStringpublic TimeStamp getTimeStamp(MMObjectNode node)
public MMObjectNode isPostedInChannel(MMObjectNode node)
the - node to get the channel ofMMObjectNodepublic java.lang.String getNewTemporaryKey()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||