|
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.Topics
This class represents a collection of topics. The topics collection may be used to iterate through all of the topics.
The topics collection may also be used for searching. The following code segment shows how to reduce the topics that are returned in the collection to ones with a particular subject:
Forum f = ...; DiscussionSession s = DiscussionSession.getSession(user); Topics topics = f.getTopics(); TopicFilter filter = new TopicFilter(); filter.setSubject("compile"); topics.setFilter(filter); topics.sort(SortOrder.ASCENDING, TopicProperty.SUBJECT); Iterator it = topics.topics().iterator(); while(it.hasNext()) { Topic t = (Topic) it.next(); ... }
Method Summary | |
Topic |
add(java.lang.String sSubject)
Adds a topic to the topics collection. |
Topic |
add(java.lang.String sSubject,
java.lang.String sDescription,
java.lang.String sKeywords,
java.util.Date expirationDate)
Adds a topic to the topics collection. |
Topic |
add(java.lang.String sSubject,
java.lang.String sContentType,
java.lang.String sDescription,
java.lang.String sKeywords,
java.util.Date expirationDate)
Adds a topic to the topics collection. |
void |
clearFilter()
Clears the topic filter for this collection of topics. |
void |
clearSort()
Clears the topic sorting for this collection of topics. |
int |
getCount()
Gets the number of topics in the collection. |
int |
getCurrentPageNumber()
Gets the number of the current page. |
TopicFilter |
getFilter()
Gets the topic filter. |
int |
getNextPageNumber()
Gets the number of the next page. |
int |
getPageCount()
Gets the total number of pages in the object for pagination. |
int |
getPageSize()
Gets the number of topics to appear on a single page. |
int |
getPreviousPageNumber()
Gets the number of the previous page. |
int |
getShowingFrom()
Gets the from index. |
int |
getShowingTo()
Gets the to index. |
SortOrder |
getSort()
Gets the sort order. |
boolean |
isFirstPage()
Checks if current page is the first page. |
boolean |
isLastPage()
Checks if current page is the last page. |
void |
setFilter(TopicFilter filter)
Sets the topic filter. |
void |
setPageSize(int iPageSize)
Sets the number of topics to appear on a single page. |
void |
sort(SortOrder order,
TopicProperty property)
Sorts the topics in the collection. |
java.util.List |
topics()
Gets the list of all topics the authenticated user has READ access to. |
java.util.List |
topics(int iPageNumber)
Gets the sublist of topics on the specified page number. |
java.util.List |
topics(int iFromIndex,
int iToIndex)
Gets a list of topics between the specified iFromIndex and iToIndex . |
java.lang.String |
toString()
Returns the string representation of this object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
public Topic add(java.lang.String sSubject) throws java.security.AccessControlException, ForumExpirationException, ForumTopicMaximumException
sSubject
- the subject of the topicnull
if the create failsthe user does not have permissions to add topics to this topics collection
,
the forum has expired and is not accepting new topics
,
the forum topic maximum has been reached and is not accepting new topics
,
DiscussionPermission.ADD_TOPIC
public Topic add(java.lang.String sSubject, java.lang.String sDescription, java.lang.String sKeywords, java.util.Date expirationDate) throws java.security.AccessControlException, ForumExpirationException, ForumTopicMaximumException
text/plain
(i.e. plain text).sSubject
- the subject of the topicsDescription
- the description of the topicsKeywords
- the keywords of the topicexpirationDate
- the expiration date (null
for no expiration)null
if the create failsthe user does not have permissions to add topics to this topics collection
,
the forum has expired and is not accepting new topics
,
the forum topic maximum has been reached and is not accepting new topics
,
DiscussionPermission.ADD_TOPIC
public Topic add(java.lang.String sSubject, java.lang.String sContentType, java.lang.String sDescription, java.lang.String sKeywords, java.util.Date expirationDate) throws java.security.AccessControlException, ForumExpirationException, ForumTopicMaximumException
sSubject
- the subject of the topicsContentType
- the content type of the descriptionsDescription
- the description of the topicsKeywords
- the keywords of the topicexpirationDate
- the expiration date (null
for no expiration)null
if the create failsthe user does not have permissions to add topics to this topics collection
,
the forum has expired and is not accepting new topics
,
the forum topic maximum has been reached and is not accepting new topics
,
DiscussionPermission.ADD_TOPIC
public void setFilter(TopicFilter filter)
clearFilter()
.null
)public TopicFilter getFilter()
null
if no filter is settopics()
public void clearFilter()
public int getPageSize()
getPageSize
in interface com.compoze.common.IPagination
public void setPageSize(int iPageSize)
setPageSize
in interface com.compoze.common.IPagination
iPageSize
- the number of topics on a single page or 0 for all topicspublic int getPageCount()
getPageCount
in interface com.compoze.common.IPagination
public int getCurrentPageNumber()
getCurrentPageNumber
in interface com.compoze.common.IPagination
public int getNextPageNumber()
getNextPageNumber
in interface com.compoze.common.IPagination
public int getPreviousPageNumber()
getPreviousPageNumber
in interface com.compoze.common.IPagination
public boolean isFirstPage()
isFirstPage
in interface com.compoze.common.IPagination
true
if this is the first page; false
otherwisepublic boolean isLastPage()
isLastPage
in interface com.compoze.common.IPagination
true
if this is the last page; false
otherwisepublic int getShowingFrom()
topics() methods, the from index is returned.
- Specified by:
getShowingFrom
in interface com.compoze.common.IPagination
- Returns:
- the from index or -1 if all topics were returned
- See Also:
topics()
,
topics(int)
,
topics(int, int)
public int getShowingTo()
topics() methods, the to index is returned.
- Specified by:
getShowingTo
in interface com.compoze.common.IPagination
- Returns:
- the from index or -1 if all topics were returned
- See Also:
topics()
,
topics(int)
,
topics(int, int)
public java.util.List topics(int iPageNumber)
getPageSize()
.iPageNumber
- the page number (must be greater than zero and less than the total page count)Topic
objectsgetPageCount()
public java.util.List topics()
READ
access to.Topic
objectspublic java.util.List topics(int iFromIndex, int iToIndex)
iFromIndex
and iToIndex
.iFromIndex
- the from index endpoint (inclusive) of the topic collectioniToIndex
- the to index highpoint (exclusive) of the topic collectionTopic
objectspublic int getCount()
public void sort(SortOrder order, TopicProperty property)
sortOrder
- the sort orderproperty
- the property to sort bypublic void clearSort()
public SortOrder getSort()
null
if not sorting is imposedpublic 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 |