|
Compoze Software, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.compoze.discussion.Topic
This class represents a topic. Topics are grouped under a forum.
To add and search for topic, see the Topics
collection
class available from a Forum
. Once the topic is obtained, its
accessor methods may be called to
set and get properties. The update()
method
must be called to store any changes to the server.
The following table contains the mappings from Topic properties to their corresponding Java methods:
Field Summary | |
protected int |
m_iMessageCount
|
Constructor Summary | |
Topic()
Constructor. |
Method Summary | |
FileAttachment |
addFileAttachment(java.lang.String sFilename,
java.io.InputStream io)
Adds the file attachment to this topic. |
void |
clearExpiration()
Clears the expiration date for this topic. |
void |
delete()
Deletes the topic. |
boolean |
equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one. |
ApprovalStatus |
getApprovalStatus()
Gets the approval status of the topic. |
java.lang.String |
getAuthor()
Gets the name of the author. |
java.lang.String |
getContentType()
Gets the content type of the topic description. |
long |
getCustomNum1()
Gets the custom number1 field of the topic. |
long |
getCustomNum2()
Gets the custom number2 field of the topic. |
long |
getCustomNum3()
Gets the custom number3 field of the topic. |
long |
getCustomNum4()
Gets the custom number4 field of the topic. |
java.lang.String |
getCustomStr1()
Gets the custom string1 field of the topic. |
java.lang.String |
getCustomStr2()
Gets the custom string2 field of the topic. |
java.lang.String |
getCustomStr3()
Gets the custom string3 field of the topic. |
java.lang.String |
getCustomStr4()
Gets the custom string4 field of the topic. |
java.util.Date |
getDateCreated()
Gets the date the topic was created. |
java.util.Date |
getDateLastModified()
Gets the date the topic was last modified. |
java.lang.String |
getDescription()
Gets the description of the topic. |
java.lang.String |
getDescription(int iLength)
Gets the description of the topic. |
java.util.Date |
getExpiration()
Gets the expiration date of this topic, if on exists. |
FileAttachment |
getFileAttachment(long lAttachmentID)
Gets the file attachment by the specified id. |
int |
getFileAttachmentCount()
Gets the number of files associated with this topic. |
java.util.List |
getFileAttachments()
Gets a list of file attachments for this topic. |
Forum |
getForum()
Gets the forum this topic is associated with. |
long |
getForumID()
Gets the forum id this topic is associated with. |
long |
getID()
Gets the unique identifier (id) of the topic. |
java.lang.String |
getKeywords()
Gets the keywords associated with this topic. |
boolean |
getMaskAuthor()
Gets the mask author setting. |
int |
getMessageCount()
Gets the number of messages associated with the topics under this topic. |
Messages |
getMessages()
Gets the messages associated with this topic. |
java.lang.String |
getSubject()
Gets the subject of the topic. |
java.lang.String |
getSubject(int iLength)
Gets the subject of the topic. |
java.lang.String |
getUnmaskedAuthor()
Gets the name of the author without a mask. |
boolean |
hasExpiration()
Checks if this topic has an expiration. |
boolean |
hasFileAttachment()
Checks if the topic has any file attachments. |
boolean |
isAuthor()
Checks if this user is the author of the topic. |
boolean |
isExpired()
Checks if this topic is expired. |
boolean |
isModified()
Checks if this topic has been modified since the user's last login. |
boolean |
isSubscriber()
Checks if the authenticated user is a subscriber to the topic. |
boolean |
isSubscriber(User user)
Checks if the specified user is a subscriber to the topic. |
void |
removeFileAttachment(long lAttachmentID)
Removes the file attachment by the specified id. |
void |
setApprovalStatus(ApprovalStatus status)
Sets the approval status of the topic. |
void |
setContentType(java.lang.String sContentType)
Sets the content type of the topic description. |
void |
setCustomNum1(long lCustomNum1)
Sets the custom number1 field of the topic. |
void |
setCustomNum2(long lCustomNum2)
Sets the custom number2 field of the topic. |
void |
setCustomNum3(long lCustomNum3)
Sets the custom number3 field of the topic. |
void |
setCustomNum4(long lCustomNum4)
Sets the custom number4 field of the topic. |
void |
setCustomStr1(java.lang.String sCustomStr1)
Sets the custom string1 field of the topic. |
void |
setCustomStr2(java.lang.String sCustomStr2)
Sets the custom string2 field of the topic. |
void |
setCustomStr3(java.lang.String sCustomStr3)
Sets the custom string3 field of the topic. |
void |
setCustomStr4(java.lang.String sCustomStr4)
Sets the custom string4 field of the topic. |
void |
setDescription(java.lang.String sDescription)
Sets the description of the topic. |
void |
setExpiration(java.util.Date expirationDate)
Sets the expiration date for this topic. |
void |
setKeywords(java.lang.String sKeywords)
Sets the keywords associated with this topic. |
void |
setKeywords(java.lang.String[] keywords)
Sets the keywords associated with this topic. |
void |
setMaskAuthor(boolean bMaskAuthor)
Sets the mask author setting. |
void |
setSubject(java.lang.String sSubject)
Sets the subject of the topic. |
boolean |
subscribe()
Subscribes the user to this topic. |
java.util.List |
subscribers()
Gets a list subscribers for this topic. |
java.lang.String |
toString()
Returns a string representation of the object. |
boolean |
unsubscribe()
Unsubscribes the user to this topic. |
boolean |
update()
Updates the topic (saves the topic entry). |
boolean |
update(boolean bForce)
Updates the topic (saves the topic entry). |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected int m_iMessageCount
Constructor Detail |
public Topic()
Method Detail |
public long getID()
public long getForumID()
public Forum getForum()
public Messages getMessages()
public java.lang.String getAuthor()
true
, the author name
will be masked as '*' characters.getMaskAuthor()
public java.lang.String getUnmaskedAuthor() throws java.security.AccessControlException
java.security.AccessControlException
- occurs if the caller does not have MODERATOR
permissiongetMaskAuthor()
public boolean getMaskAuthor()
true
to mask the author; false
otherwisepublic void setMaskAuthor(boolean bMaskAuthor) throws java.security.AccessControlException
bMaskAuthor
- true
to mask the author; false
otherwisejava.security.AccessControlException
- occurs if an attempt is made to set the mask author by a user without MODERATOR
permissionpublic boolean isAuthor()
true
if this user is the author; false
otherwisepublic ApprovalStatus getApprovalStatus()
public void setApprovalStatus(ApprovalStatus status) throws java.security.AccessControlException
status
- the approval status (may not be null
)java.security.AccessControlException
- occurs if an attempt is made to set the approval status by a user without MODERATOR
permissionpublic java.lang.String getSubject()
null
if no subject is setpublic java.lang.String getSubject(int iLength)
iLength
- the maximum length of the result (string plus "...")public void setSubject(java.lang.String sSubject)
sSubject
- the subject of the topic or null
for no subjectpublic boolean hasExpiration()
true
if this topic has an expiration: false
otherwisepublic java.util.Date getExpiration()
null
for nonepublic void setExpiration(java.util.Date expirationDate)
expirationDate
- the date the topic expires or null
for no expiration datepublic void clearExpiration()
public boolean isExpired()
true
if the forum is expired; false
if forum has not expired or not expiration is sethasExpiration()
public java.util.Date getDateCreated()
public java.lang.String getContentType()
text/plain
can be displayed as plain text.getDescription()
public void setContentType(java.lang.String sContentType)
sContentType
- the MIME content type of the description (may not be null
or empty)getDescription()
public java.lang.String getDescription()
null
for no descriptionpublic java.lang.String getDescription(int iLength)
iLength
- the maximum length of the result (string plus "...")null
for no descriptionpublic void setDescription(java.lang.String sDescription)
sDescription
- the description of the topic or null
for no descriptionpublic int getMessageCount()
public java.lang.String getKeywords()
null
for nonesetKeywords(String)
public void setKeywords(java.lang.String[] keywords)
The specified array of keywords are converted into
a space delimited String
of keywords.
Existing keywords (if any) are over-written by the
specified keywords.
keywords
- an array of keywords to associate with this topic (may not be null
)setKeywords(String)
public void setKeywords(java.lang.String sKeywords)
Existing keywords (if any) are over-written by the specified keywords.
sKeywords
- the keywords to associate with this topic or null
for nonepublic java.util.Date getDateLastModified()
public boolean isModified()
true
if topic has been modified; false
otherwisepublic long getCustomNum1()
null
if the custom number1 field is not setpublic void setCustomNum1(long lCustomNum1)
lCustomNum1
- the custom number1 field of the topicpublic long getCustomNum2()
null
if the custom number2 field is not setpublic void setCustomNum2(long lCustomNum2)
lCustomNum2
- the custom number2 field of the topicpublic long getCustomNum3()
null
if the custom number3 field is not setpublic void setCustomNum3(long lCustomNum3)
lCustomNum3
- the custom number3 field of the topicpublic long getCustomNum4()
null
if the custom number4 field is not setpublic void setCustomNum4(long lCustomNum4)
lCustomNum4
- the custom number4 field of the topicpublic java.lang.String getCustomStr1()
null
if the custom string1 field is not setpublic void setCustomStr1(java.lang.String sCustomStr1)
sCustomStr1
- the custom string1 field of the topicpublic java.lang.String getCustomStr2()
null
if the custom string2 field is not setpublic void setCustomStr2(java.lang.String sCustomStr2)
sCustomStr2
- the custom string2 field of the topicpublic java.lang.String getCustomStr3()
null
if the custom string3 field is not setpublic void setCustomStr3(java.lang.String sCustomStr3)
sCustomStr3
- the custom string3 field of the topicpublic java.lang.String getCustomStr4()
null
if the custom string4 field is not setpublic void setCustomStr4(java.lang.String sCustomStr4)
sCustomStr4
- the custom string4 field of the topicpublic boolean subscribe()
This operation does not subscribe if the discussion authentication is anonymous or the email address of the user is not set.
true
if the subscribe is successful; false
is the user is already a subscriberpublic boolean unsubscribe()
update()
is not required.true
if the unsubscribe is successful; false
otherwisepublic boolean isSubscriber()
true
if the user is subscribed; false
otherwisepublic boolean isSubscriber(User user)
user
- the user to checktrue
if the user is subscriber; false
otherwisepublic java.util.List subscribers()
java.lang.String
)public boolean update() throws java.security.AccessControlException
java.security.AccessControlException
- occurs if the user does not have permission to edit the topicpublic boolean update(boolean bForce) throws java.security.AccessControlException
bForce
- true
to force the update; false
otherwise (currently ignored)true
if the update is successful; false
otherwisejava.security.AccessControlException
- occurs if the user does not have permission to edit the topicpublic void delete() throws java.security.AccessControlException
java.security.AccessControlException
- occurs if the user does not have permission to delete the topicpublic boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the object to compare for eqaulitytrue
if the objects are equals; false
otherwisepublic boolean hasFileAttachment()
true
if the topic has file attachments; false
otherwisepublic int getFileAttachmentCount()
public void removeFileAttachment(long lAttachmentID)
public FileAttachment getFileAttachment(long lAttachmentID)
public java.util.List getFileAttachments()
FileAttachment
objectspublic FileAttachment addFileAttachment(java.lang.String sFilename, java.io.InputStream io) throws java.io.IOException
update()
is not required.sFilename
- the file attachment name (may not be null
)io
- the input stream to the file attachment datapublic java.lang.String toString()
toString
in class java.lang.Object
|
Compoze Software, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |