com.sapportals.wcm.command

Class DiscussionCommand

java.lang.Object
  extended by com.sapportals.wcm.command.Command
      extended by com.sapportals.wcm.command.ResourceCommand
          extended by com.sapportals.wcm.command.DiscussionCommand
Direct Known Subclasses:
DiscussionItemDeleteCommand, DiscussionSubscriptionCommand

public class DiscussionCommand
extends ResourceCommand

Base class for discussion related commands.
Implements a default error handling for commands working on discussion resources.

Copyright 2004 SAP AG


Field Summary
 
Fields inherited from class com.sapportals.wcm.command.ResourceCommand
MSG_ACCESSDENIED, MSG_AUTHORIZATIONFAILED, MSG_AUTHORIZATIONREQUIRED, MSG_CHILDRESOURCELOCKED, MSG_DATEVALIDATIONERROR, MSG_DOUBLENAMEVALIDATIONERROR, MSG_INVALID_CHANGED_TARGET, MSG_INVALID_TARGET, MSG_INVALIDNAME, MSG_INVALIDRECIPIENT, MSG_IOERROR, MSG_IPN, MSG_IPN_2, MSG_NAMEALREADYEXISTS, MSG_NAMETOOLONG, MSG_NOACCESSFORRESOURCE, MSG_NORECIPIENTGIVEN, MSG_OPERATIONNOTSUPPORTED, MSG_PARENTFOLDERLOCKED, MSG_RESOURCECHECKEDOUT, MSG_RESOURCELOCKED, MSG_RESOURCENOTCHECKEDOUT, MSG_RESOURCEREADONLY, MSG_SYSTEMERROR, MSG_UNKNOWNERROR, MSG_VALIDATIONERROR
 
Constructor Summary
DiscussionCommand()
           
 
Method Summary
protected  boolean canExecuteImpl()
          Default implementation of precondition to execute a command.
protected  void executeResourceImpl()
          Re-Implementation of resource command execute method.
 IDiscussion getDiscussion()
          Get the discussion resource.
 IDiscussionManager getDiscussionService()
          First we suppose that res is a primary resource.
 IResource getPrimaryResource()
          A primary resource if corresponding repository has a discussion service available.
 boolean hasTopics()
          Check if discussion has topics.
protected  boolean isAccessibleImpl()
          Implementation to check access rights to execute a command.
 boolean isSubscribed()
          Check if the discussion has subscription.
protected  boolean isSupportedImpl()
          Implementation to check if a system configuration supports the execution of a command.
protected  void validateResourceImpl()
          Re-Implementation of resource command validate method.
 
Methods inherited from class com.sapportals.wcm.command.ResourceCommand
executeImpl, getDuplicateName, getResource, isLockedByMeAndSupported, isNotLockedByOtherUser, isNotVersionedOrCheckedOutByMe, isResourceLockedByOther, setResource, validateImpl
 
Methods inherited from class com.sapportals.wcm.command.Command
canExecute, canExecuteDefaultImpl, execute, failed, getMessage, getMessageKey, getRootCauseException, isAccessible, isSupported, isSystemError, setMessage, setMessageKey
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DiscussionCommand

public DiscussionCommand()
Method Detail

executeResourceImpl

protected void executeResourceImpl()
                            throws Exception
Description copied from class: ResourceCommand
Re-Implementation of resource command execute method.

Specified by:
executeResourceImpl in class ResourceCommand
Throws:
Exception

canExecuteImpl

protected boolean canExecuteImpl()
                          throws WcmException
Description copied from class: Command
Default implementation of precondition to execute a command. Usually this is a boolean combination of isAccessible() and isSupported() and others. For convenience the implementation can call canExecuteDefaultImpl().

Specified by:
canExecuteImpl in class Command
Throws:
WcmException - Must be handled by caller!

Review-reader Dirk Sabiwalsky

Review-date 2001/11/26


isAccessibleImpl

protected boolean isAccessibleImpl()
                            throws WcmException
Description copied from class: Command
Implementation to check access rights to execute a command.

Example: To rename a file at least read and write access permission have to be set.

Specified by:
isAccessibleImpl in class Command
Throws:
WcmException - Must be handled by caller!

Review-reader Dirk Sabiwalsky

Review-date 2001/11/26


isSupportedImpl

protected boolean isSupportedImpl()
                           throws WcmException
Description copied from class: Command
Implementation to check if a system configuration supports the execution of a command.

Specified by:
isSupportedImpl in class Command
Throws:
WcmException - Must be handled by caller!

Review-reader Dirk Sabiwalsky

Review-date 2001/11/26


validateResourceImpl

protected void validateResourceImpl()
                             throws ValidationException
Description copied from class: ResourceCommand
Re-Implementation of resource command validate method.

Specified by:
validateResourceImpl in class ResourceCommand
Throws:
ValidationException - Only this kind of exceptions are allowed

getDiscussionService

public IDiscussionManager getDiscussionService()
                                        throws WcmException,
                                               ResourceException
First we suppose that res is a primary resource. If no discussion service is available, get the primary resource and then the discussion service.

Returns:
discussion service
Throws:
WcmException
ResourceException

hasTopics

public boolean hasTopics()
Check if discussion has topics.

Returns:
true if discussion has topics

getPrimaryResource

public IResource getPrimaryResource()
                             throws WcmException
A primary resource if corresponding repository has a discussion service available. Check this first. Otherwise resource could be a collaboration resource. Get the primary resource by means of collaboration service.

Returns:
the primary resource the discussion is corresponding to
Throws:
WcmException

getDiscussion

public IDiscussion getDiscussion()
                          throws WcmException
Get the discussion resource.

Returns:
discussion resource
Throws:
WcmException

isSubscribed

public boolean isSubscribed()
Check if the discussion has subscription.

Returns:
true if the discussion has subscription
Access Rights

This class can be accessed from:


SC DC Public Part ACH
[sap.com] KMC-CM [sap.com] tc/km/nonwduideprecated api EP-KM-CM
[sap.com] KMC-WPC [sap.com] tc/kmc/wpc/wpcfacade api EP-PIN-WPC-WCM


Copyright 2014 SAP AG Complete Copyright Notice