com.sapportals.wcm.rendering.base

Class ResourceCommandAmalgamation

java.lang.Object
  extended by com.sapportals.wcm.rendering.base.ResourceCommandAmalgamation

public final class ResourceCommandAmalgamation
extends Object


Constructor Summary
ResourceCommandAmalgamation()
           
 
Method Summary
 IResource getParentCollection(IResource resource)
           
 RidSet getShoppingBasketList(IResourceContext context)
           
 boolean isAccessible(IResource resource, String permission)
          Checks is the resource is accessible.
 boolean isAccessibleNative(IResource resource, String permission)
          Checks is the resource is accessible - true, if the resource is accessible
- true, if an exception occurs while checking
- false, if the resource not accessible
 boolean isCheckedOut(IResource resource)
          Checks is the resource is checked out - true, if the resource is checked out by this user
- false, if an exception occurs while checking - resource is not checked out
- false, if the resource not checked out at all
 boolean isLocked(IResource res)
          Checks is the resource is locked without checking if the user is a lock breaker - true, if the resource is locked by me or another user
- false, if an exception occurs while checking - resource not locked
- false, if the resource is not locked by anyone
 boolean isLockedByMe(IResource res)
          Checks is the resource is locked by this user - true, if the resource is locked by this user
- false, if an exception occurs while checking - resource is not locked by me
- false, if the resource is locked by another or not locked at all
 boolean isLockedByMeAndSupported(IResource resource)
          checks if the resource is locked by me and if create resource, create collection and locking options are supported
 boolean isLockedForUser(IResource res)
          Checks if the resource is locked for this user without checking if the user is a lock breaker - true, if the resource is locked by another user
- false, if an exception occurs while checking - resource is not locked
- false, if the resource is locked by me or not locked at all
 boolean isLockedUnbreakable(IResource res)
          checks, if the resource is locked and cannot be unlocked by the current user.
 boolean isNotVersionedOrCheckedOutByMe(IResource resource)
           
 boolean isRevision(IResource resource)
          Checks is the resource is revisioned - true, if the resource has revisions
- false, if an exception occurs while checking
- false, if the resource does not have revisions
 boolean isSupported(IResource resource, SupportedOption option)
          Checks is the option is supported for this resource - true, if the option is supported or if the result could not be retrieved
- false, otherwise
 boolean isVersioned(IResource resource)
          Checks if the resource is versioned - true, if the resource is versioned and versioning is supported
- false, otherwise or if an exception occurs while checking
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceCommandAmalgamation

public ResourceCommandAmalgamation()
Method Detail

isAccessible

public final boolean isAccessible(IResource resource,
                                  String permission)
                           throws WcmException
Checks is the resource is accessible. In addition to the method isAccessibleNative, a mapping of requested permissions is done first. Mapping looks as follows and is subject to change
For collections: IPermission.PERMISSION_LIST => IPermission.PERMISSION_LIST; IPermission.PERMISSION_CREATE => IPermission.PERMISSION_CREATE; IPermission.PERMISSION_READ_NODE_PROPERTIES => IPermission.PERMISSION_LIST; IPermission.PERMISSION_WRITE_NODE_PROPERTIES => IPermission.PERMISSION_CREATE; IPermission.PERMISSION_DELETE_NODE => IPermission.PERMISSION_DELETE_NODE; For resources: IPermission.PERMISSION_READ_CONTENT => IPermission.PERMISSION_READ_CONTENT; IPermission.PERMISSION_READ_PROPERTIES => IPermission.PERMISSION_READ_CONTENT; IPermission.PERMISSION_WRITE_CONTENT => IPermission.PERMISSION_WRITE_CONTENT; IPermission.PERMISSION_WRITE_PROPERTIES => IPermission.PERMISSION_WRITE_CONTENT); IPermission.PERMISSION_DELETE => IPermission.PERMISSION_DELETE); If another kind of string is given as parameter, the original parameter will be passed on to the isAccessibleNative method
- true, if the resource is accessible
- true, if an exception occurs while checking
- false, if the resource not accessible

Parameters:
resource -
Returns:
true if the resource is accessible, false otherwise.
Throws:
WcmException

isAccessibleNative

public final boolean isAccessibleNative(IResource resource,
                                        String permission)
                                 throws WcmException
Checks is the resource is accessible - true, if the resource is accessible
- true, if an exception occurs while checking
- false, if the resource not accessible

Parameters:
resource -
Returns:
true if the resource is accessible, false otherwise.
Throws:
WcmException

isRevision

public final boolean isRevision(IResource resource)
                         throws WcmException
Checks is the resource is revisioned - true, if the resource has revisions
- false, if an exception occurs while checking
- false, if the resource does not have revisions

Parameters:
resource -
Returns:
true if the recourse has revisions, false otherwise.
Throws:
WcmException

isSupported

public final boolean isSupported(IResource resource,
                                 SupportedOption option)
                          throws WcmException
Checks is the option is supported for this resource - true, if the option is supported or if the result could not be retrieved
- false, otherwise

Parameters:
resource -
option -
Returns:
true if the option is supported or if the result could not be retrieved, false otherwise.
Throws:
WcmException

isVersioned

public final boolean isVersioned(IResource resource)
                          throws WcmException
Checks if the resource is versioned - true, if the resource is versioned and versioning is supported
- false, otherwise or if an exception occurs while checking

Parameters:
resource -
Returns:
true if the resource is versioned and versioning is supported, false otherwise.
Throws:
WcmException

isCheckedOut

public final boolean isCheckedOut(IResource resource)
                           throws WcmException
Checks is the resource is checked out - true, if the resource is checked out by this user
- false, if an exception occurs while checking - resource is not checked out
- false, if the resource not checked out at all

Parameters:
resource -
Returns:
true if the resource is checked out by this user, false otherwise.
Throws:
WcmException

isNotVersionedOrCheckedOutByMe

public final boolean isNotVersionedOrCheckedOutByMe(IResource resource)
                                             throws WcmException
Throws:
WcmException

isLockedByMe

public final boolean isLockedByMe(IResource res)
Checks is the resource is locked by this user - true, if the resource is locked by this user
- false, if an exception occurs while checking - resource is not locked by me
- false, if the resource is locked by another or not locked at all

Parameters:
res - the resource to be checked
Returns:
true if the resource is locked by this user, false otherwise.

isLocked

public final boolean isLocked(IResource res)
Checks is the resource is locked without checking if the user is a lock breaker - true, if the resource is locked by me or another user
- false, if an exception occurs while checking - resource not locked
- false, if the resource is not locked by anyone

Parameters:
res - the resource to be checked
Returns:
true if the resource is locked by me or another user, false otherwise.

getParentCollection

public final IResource getParentCollection(IResource resource)

isLockedForUser

public final boolean isLockedForUser(IResource res)
Checks if the resource is locked for this user without checking if the user is a lock breaker - true, if the resource is locked by another user
- false, if an exception occurs while checking - resource is not locked
- false, if the resource is locked by me or not locked at all

Parameters:
res - the resource to be checked
Returns:
true if the resource is locked by another user, false otherwise.

isLockedUnbreakable

public final boolean isLockedUnbreakable(IResource res)
checks, if the resource is locked and cannot be unlocked by the current user. It returns
- true, if the resource is locked by another user and the user is not a lock-breaker
- true, if an exception occurs while checking - this will be locked
- false otherwise

Parameters:
res - the resource to check the lock-state for, must not be null
Returns:
true if the resource is locked by another user and the current user is not a lock-breaker.

isLockedByMeAndSupported

public final boolean isLockedByMeAndSupported(IResource resource)
                                       throws WcmException
checks if the resource is locked by me and if create resource, create collection and locking options are supported

Parameters:
resource -
Returns:
true if the resource is locked by me and is supported, false otherwise.
Throws:
WcmException

getShoppingBasketList

public RidSet getShoppingBasketList(IResourceContext context)
Parameters:
context - - the context of the current request, must not be null
Returns:
a defensive copy of the current set of RIDs contained in the shopping basket If the service is unavailable or nothing is in the basket or an exception occured, an empty set will be returned. The RIDs are the RIDs of the actual resources that were added to the basket, not the RID of the links representing the entries of the basket This method is not threadsafe
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