|
SAP NetWeaver '04 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
The class IDiscussion handles everything to do with a single discussion.
A discussion is comprised of IDiscussionItems in the tree structure. Each item is a contribution of a
user. A discussion item can be a topic, which is a main statement inside a discussion. It can also be a reply to a
topic which is called a post. Several levels of answers to posts are possible. The whole structure beneath a topic, a
tree, is called a thread.
Discussion items can be created and deleted. The relationships between different items can be determined (parent,
children, etc.). Every discussion item is saved in a text file.
| Field Summary | |
static java.lang.String |
DISCUSSION_ITEM_EXTENSION
|
static java.lang.String |
DISCUSSION_ITEM_SUFFIX
The content of each IDiscussionItem is saved in a file with the extension .txt |
static java.lang.String |
DISCUSSION_REPLY_EXTENSION
|
static java.lang.String |
DISCUSSION_REPLY_SUFFIX
The content of each post of an IDiscussionItem is saved in a file with the extension .replies |
| Method Summary | |
boolean |
canAccessDiscussion()
Checks is user has read permission on discussion primary resource to access discussion. |
boolean |
canAddFavorites()
Checks if user can add discussion to her favorites. |
boolean |
canCreateItem()
Checks is user has read permission on discussion primary resource to access discussion. |
boolean |
canDeleteItem(IDiscussionItem topic)
Checks if the deletion of a topic discussion item is possible. |
boolean |
canUseSubscription()
Checks if a subscription to the discussion is possible |
IDiscussionItem |
createItem(IDiscussionItem parent,
java.lang.String name,
java.lang.String content,
java.lang.String description)
Creates a discussion item within a thread. |
IDiscussionItem |
createItem(java.lang.String name,
java.lang.String content,
java.lang.String description)
Creates first topic of a discussion thread (root discussion item also called topic). |
IDiscussionItem |
createSingleTopic()
Creates first topic of a discussion thread (root discussion item also called topic). |
void |
deleteItem(IDiscussionItem item)
Deletes a discussion item. |
void |
deleteItemReplies(IDiscussionItem item)
Deletes a the replies folder of discussion item. |
void |
deleteItemReplies(IResource itemResource)
Deletes a the replies folder of discussion item. |
void |
editItem(IDiscussionItem item,
java.lang.String content,
java.lang.String description)
Edits a discussion item. |
IDiscussionItemList |
getChildren(IDiscussionItem item)
Deprecated. as of NW04. Replaced by method of IDiscussionItem |
IDiscussionItem |
getDiscussionItem(RID itemRid)
Gets the IDiscussionItem instance for the specified RID.
|
IDiscussionManager |
getDiscussionManager()
Gets DiscussionManager for interactions between discussion classes. |
int |
getNumberOfThreads()
Deprecated. as of NW04. Replaced by getNumberOfTopics() |
int |
getNumberOfTopics()
Gets the number of threads that belong to the discussion. |
IDiscussionItem |
getParent(IDiscussionItem item)
Deprecated. as of NW04. Replaced by getParent method at IDiscussionItem |
IResource |
getPrimaryResource()
Gets primary resource of the discussion. |
RID |
getReplyUri(RID itemRid)
Gets RID of the folder that contains the replies for the specified RID of an IDiscussionItem
. |
IResource |
getResource()
Gets primary resource of the discussion. |
IResourceContext |
getResourceContext()
Gets context of a discussion resource. |
RID |
getRid()
Gets the RID of a discussion. |
IDiscussionItemList |
getThreads()
Deprecated. as of NW04. Replaced by getTopics() |
IDiscussionItemList |
getTopics()
Gets all topics that belong to the discussion. |
IDiscussionItemList |
getTopics(java.lang.String sortCriterion,
java.lang.String sortDirection)
Gets all topics that belong to the discussion. |
IDiscussionItemList |
getTopics(java.lang.String sortCriterion,
java.lang.String sortDirection,
int startIndex,
int length)
Gets set of topics that belong to the discussion. |
RID |
getUri()
Deprecated. as of NW04. Replaced by getRid() method |
RID |
getUri(IDiscussionItem item)
Deprecated. as of NW04. Replaced by getRid() method |
boolean |
hasChildren(IDiscussionItem item)
Deprecated. as of NW04. Replaced by the hasChildren() of the IDiscussion interface |
boolean |
isSingleTopic(IDiscussionItem item)
Returns true if specified IDiscussionItem is a discussion topic and has the same
description as a single topic. |
boolean |
isSubscribed()
Checks if a subscription for this discussion exists. |
void |
setResource(IResource resource)
Sets primary resource of the discussion. |
void |
setResourceContext(IResourceContext context)
Sets the context for a discussion resource. |
boolean |
withTopics()
Gets a flag that indicates if the discussion is running with topics or without topic layer. |
| Field Detail |
public static final java.lang.String DISCUSSION_ITEM_SUFFIX
IDiscussionItem is saved in a file with the extension .txtpublic static final java.lang.String DISCUSSION_ITEM_EXTENSION
public static final java.lang.String DISCUSSION_REPLY_SUFFIX
IDiscussionItem is saved in a file with the extension .repliespublic static final java.lang.String DISCUSSION_REPLY_EXTENSION
| Method Detail |
public RID getUri()
getRid() method
RID of a discussion.public RID getRid()
RID of a discussion.public RID getUri(IDiscussionItem item)
getRid() method
RID of an IDiscussionItem.
Passing null as an argument for item
returns null.item - instance of an IDiscussionItemRID of the IDiscussionItem instance
public boolean withTopics()
throws ResourceException
true if service is configured to show topics
or if the discussion has more than one topic even if the service
is configured in the other way
false if the service is configured not to display a topic layer and the current
discussion has no or only a specific single topic- Throws:
ResourceException - if the discussion service for this discussion is not found
public IDiscussionItem getDiscussionItem(RID itemRid)
throws ResourceException
IDiscussionItem instance for the specified RID.
Passing null as an
argument for itemRid causes an exception.itemRid - a RID instance related to a discussion itemIDiscussionItem instance related to the RIDResourceException - if no discussion item is found
public IDiscussionItem createItem(java.lang.String name,
java.lang.String content,
java.lang.String description)
throws ResourceException,
WcmException
NEW_DISCUSSION_ITEM
event is sent. The application property for the number of threads is updated.
Passing null for the parameter name is best practise.
A GUID will then be automatically generated. If you pass a value for name, then
you have to take care, that each value you pass for a topic is unique.
Passing null as an argument for description
throws an exception, because the description is mandatory for topics.
If content is null, the content of the resource is empty.name - is the GUID of the root discussion item, generated by URIMappercontent - is the content of the root discussion itemdescription - is the title of the root discussion itemIDiscussionItem instanceWcmException - if an argument is set to null or if no event for subscription service
can be sentResourceException - if no resource for discussion item can be created
public void editItem(IDiscussionItem item,
java.lang.String content,
java.lang.String description)
throws WcmException
CHANGE_DISCUSSION_ITEM
event is sent.item - is the IDiscussionItem to be modifiedcontent - is the content of the root discussion itemdescription - is the title of the root discussion itemWcmException - if no event for subscription service can be sent
public IDiscussionItem createSingleTopic()
throws ResourceException,
WcmException
NEW_DISCUSSION_ITEM
event is sent. The application property for the number of threads is updated.IDiscussionItem instanceWcmException - if no event for subscription service can be sentResourceException - if no resource for discussion item can be created
public boolean isSingleTopic(IDiscussionItem item)
throws ResourceException
true if specified IDiscussionItem is a discussion topic and has the same
description as a single topic.item - is an IDiscussionItem instancetrue if the specified item is a single topicResourceException - if the specified item has no type or no description.
public IDiscussionItem createItem(IDiscussionItem parent,
java.lang.String name,
java.lang.String content,
java.lang.String description)
throws ResourceException,
WcmException
parent - is an IDiscussionItem instance that is the parent of the item createdname - is the GUID of the root discussion item, generated by URIMappercontent - is the content of the discussion itemdescription - is the title of the discussion itemIDiscussionItem instanceWcmException - if an argument is set to null or if no event for subscription service
can be sentResourceException - if no resource for discussion item can be created
public void deleteItem(IDiscussionItem item)
throws ResourceException,
AuthorizationRequiredException,
WcmException
item - IDiscussionItem to be deletedResourceException - if the IDiscussionItem cannot be locatedAuthorizationRequiredException - if the user is not authorized to delete the IDiscussionItemWcmException - Exception raised in failure situation
public void deleteItemReplies(IDiscussionItem item)
throws ResourceException,
AuthorizationRequiredException,
WcmException
item - IDiscussionItem to be deletedResourceException - if the IDiscussionItem cannot be locatedAuthorizationRequiredException - if the user is not authorized to delete the IDiscussionItemWcmException - Exception raised in failure situation
public void deleteItemReplies(IResource itemResource)
throws ResourceException,
AuthorizationRequiredException,
WcmException
itemResource - IResource to be deletedResourceException - if the IDiscussionItem cannot be locatedAuthorizationRequiredException - if the user is not authorized to delete the IDiscussionItemWcmException - Exception raised in failure situation
public IDiscussionItemList getThreads()
throws ResourceException
IDiscussionItemResourceException - if the IDiscussionItem cannot be located
public IDiscussionItemList getTopics()
throws ResourceException
IDiscussionItemResourceException - if the IDiscussionItem cannot be located
public IDiscussionItemList getTopics(java.lang.String sortCriterion,
java.lang.String sortDirection)
throws ResourceException
sortCriterion - Criterion for sorting, default is "Age", other is "Author"sortDirection - 1 for ascending (default), 0 for descendingResourceException - if the IDiscussionItem cannot be located
public IDiscussionItemList getTopics(java.lang.String sortCriterion,
java.lang.String sortDirection,
int startIndex,
int length)
throws ResourceException
sortCriterion - Criterion for sorting, default is "Age", other is "Author"sortDirection - 1 for ascending (default), 0 for descendingstartIndex - the first item of a pagelength - the page lengthResourceException - if the IDiscussionItem cannot be located
public int getNumberOfThreads()
throws ResourceException
ResourceException - if the IDiscussionItem cannot be located
public int getNumberOfTopics()
throws ResourceException
ResourceException - if the IDiscussionItem cannot be located
public IDiscussionItemList getChildren(IDiscussionItem item)
throws ResourceException
IDiscussionItem
IDiscussionItem.item - gets all replies for this IDiscussionItemIDiscussionItemList code> which contains the discussion items- Throws:
ResourceException - if the IDiscussionItem cannot be located
public boolean hasChildren(IDiscussionItem item)
throws ResourceException
hasChildren() of the IDiscussion interface
item - The IDiscussionItem for which the replies are returnedtrue if the IDiscussionItem
has replies, if not, returns falseResourceException - if the IDiscussionItem cannot be located
public IDiscussionItem getParent(IDiscussionItem item)
throws ResourceException
getParent method at IDiscussionItem
IDiscussionItem. It returns, for example, the topic
of a reply.item - IDiscussionItem that is a sub-item of another IDiscussionItemIDiscussionItem, the parent itemResourceException - if the IDiscussionItem cannot be locatedpublic RID getReplyUri(RID itemRid)
RID of an IDiscussionItem
.itemRid - RID of an IDiscussionItemRID to a folder that contains all replies for the related IDiscussionItempublic void setResourceContext(IResourceContext context)
context - Context of the IDiscussionItempublic IResourceContext getResourceContext()
IResourceContext Context of a discussion resourcepublic void setResource(IResource resource)
resource - the new resource valuepublic IResource getResource()
IResource the primary resource of the discussion
public IResource getPrimaryResource()
throws ResourceException
IResource the primary resource of the discussionpublic boolean canAccessDiscussion()
public boolean canCreateItem()
public boolean canDeleteItem(IDiscussionItem topic)
throws ResourceException
topic - a topic discussion item instanceResourceException - if item resource is not foundpublic boolean canUseSubscription()
public boolean isSubscribed()
throws WcmException
WcmException - Exception raised in failure situationpublic boolean canAddFavorites()
public IDiscussionManager getDiscussionManager()
throws ResourceException
|
SAP NetWeaver '04 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||