SAP NetWeaver '04

com.sapportals.wcm.repository.service.discussion
Interface IDiscussionManager

[contained in: com.sap.km.cm.repository.service.par - km.shared.repository.service.app.discussion_api.jar]
All Superinterfaces:
IRepositoryService

public interface IDiscussionManager
extends IRepositoryService

The IDiscussionManager defines the central methods of the discussion repository service.
It is responsible for creating, deleting and keeping track of discussions. Several instances of the IDiscussionManager can co-exist. This enables the configuration of different storage locations for IDiscussionItems. A discussion must always be linked to an IResource. This resource is called the primary resource. All data belonging to the discussion is secondary data and is stored in a folder of a special collaboration repository. The location of the repository can be configured in the configuration framework.


Field Summary
static java.lang.String PROP_DISCUSSION_NAMESPACE
           
static java.lang.String PROP_DISCUSSION_NUMBER_OF_POSTS
           
static java.lang.String PROP_DISCUSSION_NUMBER_OF_THREADS
           
 
Method Summary
 boolean canCreateDiscussion(IResource resource)
          returns true if Security Management is available and if the current user has 'read' and 'write' Permission for the resource.
 IDiscussion createDiscussion(IResource resource)
          Creates a new discussion for a given primary resource.
 void createSubscription(IDiscussion discussion, IResourceContext context, IResource resource)
          Creates a subscription for an entire discussion or for a specific discussion item.
 void deleteDiscussion(IDiscussion discussion)
          Deletes an IDiscussion instance and all discussion data related to the primary resource.
 void deleteDiscussion(IResource resource)
          Deletes an IDiscussion instance and all discussion data related to the specified primary resource.
 void deleteDiscussion(RID resourceRid, IResourceContext context)
          Deletes an IDiscussion instance and all discussion data for an attached primary resource.
 IDiscussion getDiscussion(IResource resource)
          Gets the IDiscussion instance for the specified primary resource.
 IDiscussionEvent getDiscussionEventTemplate(int type)
          Get a IDiscussionEvent-template for the given IDiscussionEvent-type.
 ICollection getDiscussionsCollection()
          Gets ICollection, the root folder where all discussions of this service are stored.
 ISubscription getSubscription(IDiscussion discussion, IResourceContext context, IResource resource)
          Gets the subscription for a specified secondary resource (discussion or discussion item).
 IDiscussionItem getTopDiscussionItem(RID itemRid, IResourceContext resourceContext)
          Gets the discussion topic for a discussion item.
 IDiscussionItem getTopic(RID itemRid, IResourceContext resourceContext)
          Gets the discussion topic for a discussion item.
 boolean isOnlyCollectionsEnabled()
          Checks if discussion service is only enabled for collections.
 boolean isSecureDiscussion()
          Checks if discussion service is set to be a secure discussion.
 boolean isWithoutTopicLevel()
          Checks if discussion service works with topics or directly on post level.
 
Methods inherited from interface com.sapportals.wcm.repository.service.IRepositoryService
acceptServletCall, getDescription, getDescription, getID, getServiceType
 

Field Detail

PROP_DISCUSSION_NUMBER_OF_THREADS

public static final java.lang.String PROP_DISCUSSION_NUMBER_OF_THREADS

PROP_DISCUSSION_NUMBER_OF_POSTS

public static final java.lang.String PROP_DISCUSSION_NUMBER_OF_POSTS

PROP_DISCUSSION_NAMESPACE

public static final java.lang.String PROP_DISCUSSION_NAMESPACE
Method Detail

isOnlyCollectionsEnabled

public boolean isOnlyCollectionsEnabled()
Checks if discussion service is only enabled for collections. It is possible to configure the discussion service so that only discussions for collections and not for resources are allowed.
Returns:
true, if the discussion service is enabled only for collections, otherwise false

isSecureDiscussion

public boolean isSecureDiscussion()
Checks if discussion service is set to be a secure discussion. It is possible to configure the discussion service so that no htmlb editor is used.
Returns:
true, if the discussion service is set to be secure, otherwise false

isWithoutTopicLevel

public boolean isWithoutTopicLevel()
Checks if discussion service works with topics or directly on post level. It is possible to configure the discussion service so that only discussions working with posts, not with topics, are allowed.
Returns:
true, if the discussion service is enabled only for working with posts

createDiscussion

public IDiscussion createDiscussion(IResource resource)
                             throws WcmException
Creates a new discussion for a given primary resource. Passing null as an argument for resource causes an exception.
Parameters:
resource - an IResource that specifies the primary resource to which the discussion is attached
Returns:
an IDiscussion instance that holds all information on the discussion
Throws:
WcmException - if it is not possible to initialize all necessary services

createSubscription

public void createSubscription(IDiscussion discussion,
                               IResourceContext context,
                               IResource resource)
                        throws WcmException
Creates a subscription for an entire discussion or for a specific discussion item. If the subscription service for the secondary repository is not enabled, the method does nothing. If a subscription for a specific discussion item has to be created, the reply collection for that item is used for the subscription to get all hierarchical information. Passing null as an argument for discussion or resource causes an exception. If context is null, the service context is used.
Parameters:
discussion - is the IDiscussion instance for a discussion containing the resource
context - is the context of the service
resource - an IResource instance that specifies the secondary resource
Throws:
WcmException - if the creation of a subscription fails

getSubscription

public ISubscription getSubscription(IDiscussion discussion,
                                     IResourceContext context,
                                     IResource resource)
                              throws WcmException
Gets the subscription for a specified secondary resource (discussion or discussion item). If the subscription service for the secondary repository is not enabled, the method returns null. Passing null as an argument for discussion or resource causes an exception. If context is null, the service context is used.
Parameters:
discussion - is the IDiscussion instance for a discussion containing the resource
context - is the context of the service
resource - an IResource instance that specifies a secondary resource (discussion or discussion item)
Returns:
an ISubscription instance with the specified attributes
Throws:
WcmException - if the request for subscription to the resource fails

getDiscussion

public IDiscussion getDiscussion(IResource resource)
                          throws WcmException
Gets the IDiscussion instance for the specified primary resource. A discussion can exist even if no discussion threads exist. Passing null as an argument for resource causes an exception.
Parameters:
resource - an IResource that specifies the primary resource to which the discussion is attached
Returns:
an IDiscussion instance that holds all information on the discussion
Throws:
WcmException - if it is not possible to initialize all necessary services

getDiscussionsCollection

public ICollection getDiscussionsCollection()
Gets ICollection, the root folder where all discussions of this service are stored.
Returns:
an ICollection instance for the discussion root folder

canCreateDiscussion

public boolean canCreateDiscussion(IResource resource)
returns true if Security Management is available and if the current user has 'read' and 'write' Permission for the resource. 'read' permission for a resource given if user has permissions for content and properties 'read' permission. 'write' permission for a resource given if user has permissions for content and properties 'write' permission.

getTopic

public IDiscussionItem getTopic(RID itemRid,
                                IResourceContext resourceContext)
                         throws WcmException
Gets the discussion topic for a discussion item. Each discussion thread starts with a topic with a tree of discussion items. This topic is found. Passing null as an argument for itemRid causes an exception. If resourceContext is null, the service context is used.
Parameters:
itemRid - is the RID of an IDiscussionItem instance
resourceContext - is the context of the service
Returns:
first discussion item of a thread
Throws:
WcmException - if it is not possible to identify the discussion item specified by itemRid or if the topic item could not be found

getTopDiscussionItem

public IDiscussionItem getTopDiscussionItem(RID itemRid,
                                            IResourceContext resourceContext)
                                     throws WcmException
Gets the discussion topic for a discussion item. Each discussion thread starts with a topic with a tree of discussion items. This topic is found. Passing null as an argument for itemRid causes an exception. If resourceContext is null, the service context is used.
Parameters:
itemRid - is the RID of an IDiscussionItem instance
resourceContext - is the context of the service
Returns:
first discussion item of a thread
Throws:
WcmException - if it is not possible to identify the discussion item specified by itemRid or if the topic item could not be found

deleteDiscussion

public void deleteDiscussion(IDiscussion discussion)
                      throws WcmException
Deletes an IDiscussion instance and all discussion data related to the primary resource. After deletion of the discussion, a DELETE_DISCUSSION event is sent for the subscription service. If no discussion exists, nothing happens. Passing null as an argument for discussion causes an exception.
Parameters:
discussion - the instance that has to be deleted
Throws:
WcmException - if the deletion of the secondary discussion folder has failed

deleteDiscussion

public void deleteDiscussion(IResource resource)
                      throws WcmException
Deletes an IDiscussion instance and all discussion data related to the specified primary resource. After deletion of the discussion, a DELETE_DISCUSSION event is sent for the subscription service. If no discussion exists, nothing happens. Passing null as an argument for resource causes an exception.
Parameters:
resource - the resource for discussion data
Throws:
WcmException - if the deletion of the secondary discussion folder has failed

deleteDiscussion

public void deleteDiscussion(RID resourceRid,
                             IResourceContext context)
                      throws WcmException
Deletes an IDiscussion instance and all discussion data for an attached primary resource. After deletion of the discussion, a DELETE_DISCUSSION event is sent for the subscription service. If no discussion exists, nothing happens. Passing null as an argument for resourceRid causes an exception. If context is null, the service context is used.
Parameters:
resourceRid - is the RID of the secondary discussion resource
context - is the context of the service
Throws:
WcmException - if the deletion of the secondary discussion folder has failed

getDiscussionEventTemplate

public IDiscussionEvent getDiscussionEventTemplate(int type)
Get a IDiscussionEvent-template for the given IDiscussionEvent-type.
Parameters:
type - the IDiscussionEvent-type to get the template for.
Returns:
an IDiscussionEvent-template for the given type or null if the given type is not valid.

SAP NetWeaver '04

Copyright © 2004 by SAP AG. All Rights Reserved.
SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary.

These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.