com.sap.portal.contenttagging

Interface IContentTaggingService

All Superinterfaces:
IService

public interface IContentTaggingService
extends IService

The interface that enables you to tag portal objects according to your own tagging method. Provides methods to add and remove tags and to search portal objects by specific tags.

It is possible to define attributes to PCD objects directly and use them to perform a PCD search. This interface provides a shortcut to the PCD APIs.

To use content tagging, define attributes that hold the tagging data. These attributes are referred here as domain attributes.

To tag your portal objects, use the addDomainValue() method to add a domain attribute with a value.


Field Summary
static String BUSINESSOBJECT_OBJECT_CLASS
          A constant that represents the name of the business object object class.
static String IVIEW_OBJECT_CLASS
          A constant that represents the name of the iView object class.
static String KEY
          The service key
static String PAGE_OBJECT_CLASS
          A constant that represents the name of the page object class.
static String ROLE_OBJECT_CLASS
          A constant that represents the name of the role object class.
static String WORKCENTER_OBJECT_CLASS
          A constant that represents the name of the work center object class.
static String WORKSET_OBJECT_CLASS
          A constant that represents the name of the workset object class.
 
Method Summary
 void addBinaryDomainValue(com.sap.security.api.IPrincipal user, String objectId, String domain, InputStream value)
          Adds a binary stream value to a domain attribute of a portal object.
 void addDomainValue(com.sap.security.api.IPrincipal user, String objectId, String domain, String value)
          Adds a value to a domain attribute of a portal object.
 Set getContent(com.sap.security.api.IPrincipal user, String[] contentType)
          Returns the PCD address (URL) of content of the specified type in all roles of a given user.
 Map getContent(com.sap.security.api.IPrincipal user, String domain, String expression, String[] contentType, ResultsFormat resultsFormat)
          Returns content of the specified types (portal objects) in all user-assigned roles if the value of the domain attribute matches the search criteria.
 Map getCorrespondingAncestors(com.sap.security.api.IPrincipal user, Set urls, String contentType, boolean directParentOnly)
          Returns the corresponding ancestors of portal objects.
 List getDirContextes(List pcdNodes, com.sap.security.api.IPrincipal user)
          Gets the set of DirContext objects that correspond to the specified PCD addresses.
 NamingEnumeration getDomainValues(com.sap.security.api.IPrincipal user, String objectId, String domain)
          Returns the values of the specified domain attribute of a portal object.
 Map getNodeContent(DirContext node, String domain, String expression, String[] contentType, ResultsFormat resultsFormat)
          Returns content of the specified types (portal objects) in a given node of the PCD.
 List<DirContext> getUserRoles(com.sap.security.api.IPrincipal user)
          Returns all of the user-assigned roles.
 List<String> getUserRolesURLs(com.sap.security.api.IPrincipal user)
          Returns the URLs of the user-assigned roles.
 void removeAllDomainValues(com.sap.security.api.IPrincipal user, String objectId, String domain)
          Removes a domain attribute and all its values from a given portal object.
 void removeDomainValue(com.sap.security.api.IPrincipal user, String objectId, String domain, String value)
          Removes a value from a domain attribute for a given portal object.
 
Methods inherited from interface com.sapportals.portal.prt.service.IService
afterInit, configure, destroy, getContext, getKey, init, release
 

Field Detail

KEY

static final String KEY
The service key

See Also:
Constant Field Values

IVIEW_OBJECT_CLASS

static final String IVIEW_OBJECT_CLASS
A constant that represents the name of the iView object class.

Used to specify content type to be searched.

See Also:
Constant Field Values

PAGE_OBJECT_CLASS

static final String PAGE_OBJECT_CLASS
A constant that represents the name of the page object class.

Used to specify content type to be searched.

See Also:
Constant Field Values

WORKSET_OBJECT_CLASS

static final String WORKSET_OBJECT_CLASS
A constant that represents the name of the workset object class.

Used to specify content type to be searched.

See Also:
Constant Field Values

BUSINESSOBJECT_OBJECT_CLASS

static final String BUSINESSOBJECT_OBJECT_CLASS
A constant that represents the name of the business object object class.

Used to specify content type to be searched.

See Also:
Constant Field Values

WORKCENTER_OBJECT_CLASS

static final String WORKCENTER_OBJECT_CLASS
A constant that represents the name of the work center object class.

Used to specify content type to be searched.

See Also:
Constant Field Values

ROLE_OBJECT_CLASS

static final String ROLE_OBJECT_CLASS
A constant that represents the name of the role object class.

Used to specify content type to be searched.

See Also:
Constant Field Values
Method Detail

getContent

Map getContent(com.sap.security.api.IPrincipal user,
               String domain,
               String expression,
               String[] contentType,
               ResultsFormat resultsFormat)
               throws ContentTaggingException
Returns content of the specified types (portal objects) in all user-assigned roles if the value of the domain attribute matches the search criteria.

Parameters:
user - the user whose roles are searched
contentType - type of the content to be searched (for example iView, page or workset). Each item of the array represents a full object class name of one portal object.
For example, to search for iViews, use the constant IVIEW_OBJECT_CLASS.
To search all content types, pass null.
domain - the name of the portal object's attribute, which is used for tagging purposes.
expression - the search criteria that is checked against the value of the domain attribute.
The expression is a regular expression pattern. For example, "category*" searches for the objects with domain value that begins with "category".

If null, the result contains all the content with the specified domain.
The Content Tagging service uses the PCD, and therefore strings should be represented according to RFC 2254.
resultsFormat - the preferred format of the results, and can be either grouped by content or grouped by domain value.
Returns:
a map, formatted according to the resultsFormat parameter value. See ResultsFormat.
Throws:
ContentTaggingException - if an exception occurs

getNodeContent

Map getNodeContent(DirContext node,
                   String domain,
                   String expression,
                   String[] contentType,
                   ResultsFormat resultsFormat)
                   throws ContentTaggingException
Returns content of the specified types (portal objects) in a given node of the PCD. if the value of the domain attribute matches the search criteria.

Parameters:
node - a DirContext node (such as role or workset) to be searched. The DirContext can be either local or remote (remote contexts originate in a remote portal in a federated portal network).
contentType - type of the content to be searched (for example iView, page or workset). Each item of the array represents a full object class name of one portal object.
For example, to search for iViews, use the constant IVIEW_OBJECT_CLASS.
To search all content types, pass null.
domain - the name of the portal object's attribute, which is used for tagging purposes
expression - the search criteria that is checked against the value of the domain attribute.
The expression is a regular expression pattern. For example, "category*" searches for the objects with domain value that begins with "category".

If null, the result contains all the content with the specified domain.
The Content Tagging service uses the PCD, and therefore strings should be represented according to RFC 2254.
resultsFormat - the preferred format of the results, and can be either grouped by content or grouped by domain value.
Returns:
a map, formatted according to the resultsFormat parameter value. See ResultsFormat.
Throws:
ContentTaggingException - if an exception occurs

getContent

Set getContent(com.sap.security.api.IPrincipal user,
               String[] contentType)
               throws ContentTaggingException
Returns the PCD address (URL) of content of the specified type in all roles of a given user.

Parameters:
user - the user whose roles are searched
contentType - type of the content to be searched (for example iView, page or workset). Each item of the array represents a full object class name of one portal object.
For example, to search for iViews, use the constant IVIEW_OBJECT_CLASS.
To search all content types, pass null.
Returns:
a set of IDs of the found portal objects (iViews, pages).
Throws:
ContentTaggingException - if an exception occurs

getCorrespondingAncestors

Map getCorrespondingAncestors(com.sap.security.api.IPrincipal user,
                              Set urls,
                              String contentType,
                              boolean directParentOnly)
                              throws ContentTaggingException
Returns the corresponding ancestors of portal objects.

Parameters:
user - the user whose roles are searched
urls - a set of PCD addresses (URL), each representing a portal object for which we want to find the corresponding ancestors
contentType - the content type of the ancestors to be searched (for example iView, page or workset). For example, to search for iViews, use the constant IVIEW_OBJECT_CLASS.
To search all content types, pass null.
directParentOnly - if true, the search stops at the first ancestor of the specified content type; if false, the search stops at the unit level, and the tree is searched for the object ancestors with the specified content type. The search does not stop at the found ancestor and continues to search all it's ancestors as well. The default is true.
Returns:
a map where the keys are the specified PCD addresses (URLs) and the values are the PCD addresses (URLs) of the ancestors. If no ancestor is found, the value is null.
Throws:
ContentTaggingException - if an exception occurs

getDomainValues

NamingEnumeration getDomainValues(com.sap.security.api.IPrincipal user,
                                  String objectId,
                                  String domain)
                                  throws ContentTaggingException
Returns the values of the specified domain attribute of a portal object.

Parameters:
user - the user for retrieving the domain values
objectId - the PCD address (URL) of a portal object whose domain attribute is checked
domain - the name of the domain attribute
Returns:
a NamingEnumeration containing all the values of the given domain attribute of the portal object, or null if the domain attribute does not exist for the specified object.
Throws:
ContentTaggingException - if an exception occurs

addDomainValue

void addDomainValue(com.sap.security.api.IPrincipal user,
                    String objectId,
                    String domain,
                    String value)
                    throws ContentTaggingException
Adds a value to a domain attribute of a portal object. If the specified domain attribute does not exist, it first creates it and then adds a value.

Parameters:
user - the user for modifying the domain values (usually an administrator)
objectId - the PCD address (URL) of a portal object whose domain attribute is modified
domain - the name of the domain attribute
value - the value to be added to the domain attribute
Throws:
ContentTaggingException - if an exception occurs

addBinaryDomainValue

void addBinaryDomainValue(com.sap.security.api.IPrincipal user,
                          String objectId,
                          String domain,
                          InputStream value)
                          throws ContentTaggingException
Adds a binary stream value to a domain attribute of a portal object. If the specified domain attribute does not exist, it first creates it and then adds a value.
When invoking the getContent or the getNodeContent methods, all values of the domain attribute will be returned in case the domain attribute is binary, regardless of the specified expression. If filtering by expression is required, please use string domain attributes.

Parameters:
user - the user for modifying the domain values (usually an administrator)
objectId - the PCD address (URL) of a portal object whose domain attribute is modified
domain - the name of the domain attribute
value - the value to be added to the domain attribute
Throws:
ContentTaggingException - if an exception occurs

removeDomainValue

void removeDomainValue(com.sap.security.api.IPrincipal user,
                       String objectId,
                       String domain,
                       String value)
                       throws ContentTaggingException
Removes a value from a domain attribute for a given portal object. If this value is the last value of the domain attribute, the domain attribute is removed.

Parameters:
user - the user for removing the domain values (usually an administrator)
objectId - the PCD address (URL) of a portal object whose domain attribute is modified
domain - the name of the domain attribute
value - the value to be removed from the domain attribute
Throws:
ContentTaggingException - if an exception occurs

removeAllDomainValues

void removeAllDomainValues(com.sap.security.api.IPrincipal user,
                           String objectId,
                           String domain)
                           throws ContentTaggingException
Removes a domain attribute and all its values from a given portal object.

Parameters:
user - the user for removing the domain values (usually an administrator)
objectId - the PCD address (URL) of a portal object whose domain attribute is removed
domain - the name of the domain attribute
Throws:
ContentTaggingException - if an exception occurs

getUserRoles

List<DirContext> getUserRoles(com.sap.security.api.IPrincipal user)
                              throws ContentTaggingException
Returns all of the user-assigned roles.

Parameters:
user - the user whose roles are returned
Returns:
a List of DirContext objects, each a role of the user
Throws:
ContentTaggingException - if an exception occurs

getUserRolesURLs

List<String> getUserRolesURLs(com.sap.security.api.IPrincipal user)
                              throws ContentTaggingException
Returns the URLs of the user-assigned roles.

Parameters:
user - the user whose roles are returned
Returns:
a List of the user assigned roles
Throws:
ContentTaggingException - if an exception occurs

getDirContextes

List getDirContextes(List pcdNodes,
                     com.sap.security.api.IPrincipal user)
                     throws ContentTaggingException
Gets the set of DirContext objects that correspond to the specified PCD addresses.

Parameters:
pcdNodes - a List of strings, each representing the PCD address of a portal object in the PCD. Provide the PCD address without the "pcd:" prefix.
user - the user for accessing the PCD
Returns:
a List of DirContext objects, each representing one of the specified portal objects
Throws:
ContentTaggingException - if an exception occurs
Access Rights

This class can be accessed from:


SC DC Public Part ACH
[sap.com] EP-RUNTIME [sap.com] tc/ep/navigation/api api EP-PIN


Copyright 2011 SAP AG Complete Copyright Notice