com.sapportals.wcm.service.template

Interface ITemplateService


public interface ITemplateService


Method Summary
 boolean assignTemplates(ICollection collection, ITemplateList templateList, ITemplate template, IProfileList profileList, IProfile profile, boolean asSubmenu)
          Assigns Single Templates and Template Groups to a collection.
 boolean canAssignGlobalTemplates(ICollection collection)
          Returns whether the current user has the permission to assign templates to the given collection or not
 boolean canAssignTemplates(ICollection collection)
          This method is not supported yet and will be forwarded to the method canAssignGlobalTemplates
 IResource createFromTemplate(ICollection collection, ITemplate template)
          Creates a new item out of the ITemplate and stores it in the given collection.
 IProfileList getAssignedProfiles(ICollection collection)
          Returns the assigned groups for the given collection
 ITemplateList getAssignedSingleTemplates(ICollection collection)
          Returns the assigned templates for the given collection
 IProfileList getEmptyProfileList()
          Returns an empty template group list
 ITemplateList getEmptyTemplateList()
          Returns an empty template list
 IProfile getProfile(String id, IResourceContext resourceContext)
          Returns the group for the given id and resource context
 IProfileList getProfiles(ICollection collection)
          Returns all template groups which could be assigned to the given collection.
 RID getProfilesStoragePath()
          Returns the RID of the collection where all available groups are stored
 ITemplateList getSingleTemplates(ICollection collection)
          Returns all templates which could be assigned to the given collection.
 ITemplate getTemplate(String id, IResourceContext resourceContext)
          Returns the single template for the given id and resource context
 RID getTemplatesStoragePath()
          Returns the RID of the collection where all available single templates are stored
 boolean isAssignedAsSubmenu(ICollection collection)
          Returns whether the groups should be rendered as sub menus or not
 boolean isAvailable(ICollection collection)
          Returns whether the template service is available for the given collection or not
 ITemplateList resolveProfiles(IProfileList profileList, IProfile profile, IResourceContext context)
          Resolves the given and all included template groups to its single templates
 

Method Detail

assignTemplates

boolean assignTemplates(ICollection collection,
                        ITemplateList templateList,
                        ITemplate template,
                        IProfileList profileList,
                        IProfile profile,
                        boolean asSubmenu)
                        throws NotAuthorizedException
Assigns Single Templates and Template Groups to a collection. Once a template has been assigned to a collection, it can be found in the section of the collections menu. If the parameter template and templateList is , the already assigned single templates will be removed. The same is for template groups.

Parameters:
collection - The collection for which the templates should be assigned
templateList - ITemplateList that should be assigned
template - ITemplate that should be assigned
profileList - IProfileList that should be assigned
profile - IProfile that should be assigned
asSubmenu - If this parameter is set, the assigned template groups opens in a own menu
Returns:
true if the assignment works, else false
Throws:
NotAuthorizedException

getSingleTemplates

ITemplateList getSingleTemplates(ICollection collection)
Returns all templates which could be assigned to the given collection. The templates the current user will not have read access, will be filtered out.

Parameters:
collection - Collection for which all possible single templates should be returned
Returns:
ITemplateList that contains a list of single templates

getProfiles

IProfileList getProfiles(ICollection collection)
Returns all template groups which could be assigned to the given collection. The groups the current user will not have read access, will be filtered out.

Parameters:
collection - Collection for which all possible template groups should be returned
Returns:
IProfileList that contains a list of all possible groups

getAssignedSingleTemplates

ITemplateList getAssignedSingleTemplates(ICollection collection)
Returns the assigned templates for the given collection

Parameters:
collection - Collection for which the assigned templates should be returned
Returns:
ITemplateList that contains a list of single templates

getAssignedProfiles

IProfileList getAssignedProfiles(ICollection collection)
Returns the assigned groups for the given collection

Parameters:
collection - Collection for which the assigned template groups should be returned
Returns:
IProfileList that contains a list of template groups

isAssignedAsSubmenu

boolean isAssignedAsSubmenu(ICollection collection)
Returns whether the groups should be rendered as sub menus or not

Parameters:
collection - Collection for which the flag should be returned
Returns:
true if assigned as sub menu, else false

isAvailable

boolean isAvailable(ICollection collection)
Returns whether the template service is available for the given collection or not

Parameters:
collection - Collection to check
Returns:
true if available

resolveProfiles

ITemplateList resolveProfiles(IProfileList profileList,
                              IProfile profile,
                              IResourceContext context)
Resolves the given and all included template groups to its single templates

Parameters:
profileList - IProfileList that should be resolved
profile - IProfile that should be resolved
context - Resource Context Current resource context
Returns:
ITemplateList that contains a list of all single templates which are contained in the given template groups

canAssignTemplates

boolean canAssignTemplates(ICollection collection)
This method is not supported yet and will be forwarded to the method canAssignGlobalTemplates


canAssignGlobalTemplates

boolean canAssignGlobalTemplates(ICollection collection)
Returns whether the current user has the permission to assign templates to the given collection or not

Parameters:
collection - Collection to check
Returns:
true if the user has permissions to assign templates, else false

createFromTemplate

IResource createFromTemplate(ICollection collection,
                             ITemplate template)
                             throws WcmException,
                                    NotAuthorizedException
Creates a new item out of the ITemplate and stores it in the given collection. The new item is a copy of the given template.

Parameters:
collection - Collection underneath the new item will be stored
template - ITemplate from which a new item should be created
Returns:
The newly created item
Throws:
WcmException
NotAuthorizedException

getEmptyTemplateList

ITemplateList getEmptyTemplateList()
Returns an empty template list

Returns:
ITemplateList

getEmptyProfileList

IProfileList getEmptyProfileList()
Returns an empty template group list

Returns:
IProfileList

getProfile

IProfile getProfile(String id,
                    IResourceContext resourceContext)
                    throws ProfileNotFoundException,
                           NotAuthorizedException
Returns the group for the given id and resource context

Parameters:
id - ID of the group
resourceContext - resource context
Returns:
IProfile for the given id and context
Throws:
ProfileNotFoundException
NotAuthorizedException

getTemplate

ITemplate getTemplate(String id,
                      IResourceContext resourceContext)
                      throws TemplateNotFoundException,
                             NotAuthorizedException
Returns the single template for the given id and resource context

Parameters:
id - ID of the single template
resourceContext - resource context
Returns:
ITemplate for the given id and context
Throws:
TemplateNotFoundException
NotAuthorizedException

getProfilesStoragePath

RID getProfilesStoragePath()
Returns the RID of the collection where all available groups are stored

Returns:
Path to the storage path of the template groups

getTemplatesStoragePath

RID getTemplatesStoragePath()
Returns the RID of the collection where all available single templates are stored

Returns:
Path to the storage path of the single templates
Access Rights

This class can be accessed from:


SC DC Public Part ACH
[sap.com] KMC-CM [sap.com] tc/km/frwk 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