com.ibm.portal.app.service
Interface TemplateCatalogService

All Superinterfaces:
Disposable

public interface TemplateCatalogService
extends Disposable

The TemplateCatalogService provides methods for searching and managing application templates. Furthermore it provides methods for managing application folders and favorites.

Since:
6.1.0.1

Nested Class Summary
static class TemplateCatalogService.SearchPattern
          This enumeration defines the search pattern that will be used for title-based finder methods.
COMPLETE_TITLE searches for all templates with the exactly the specified title string. TITLE_STARTSWITH searches for all templates that have a title that starts with the specified title prefix. TITLE_CONTAINS searches for all templates that have a title that contains the specified title substring at any location.
 
Field Summary
static java.lang.String COPYRIGHT
           
 
Method Summary
 ObjectID addFolder(Folder folder, ObjectID parentFolderID)
          Create a subfolder in the given parent folder.
 ObjectID copyIntoNewTemplate(ObjectID templateOID, Localized templateInfo, ObjectID folderID)
          Create a new template in the specified template folder with the specified localized information based on the specfied template.
 void deleteFolder(ObjectID folderID, boolean deleteContent)
          Delete the specified folder.
 void deleteTemplate(ObjectID templateID)
          Delete the specified template.
 void deleteTemplates(java.util.List<ObjectID> templateIDs)
          Delete a several template at once.
 boolean doesTemplateExist(ObjectID templateID)
          Check wether a template with the specified ObjectID is existing.
 void exportTemplate(ObjectID templateOID, java.io.OutputStream out)
          /** Store the template in the given stream.
 java.util.List<ObjectID> findChildFolders(ObjectID parentID)
          Returns the child folders for the given folderOID the user is allowed to see.
 java.util.List<ObjectID> findTemplates()
          Find all templates in all folders the executing user is allowed to see.
 java.util.List<ObjectID> findTemplatesByOwnerID(ObjectID ownerID)
          Find all templates in all folders that are owned by the specified user.
 java.util.List<ObjectID> findTemplatesByOwnerIDInFolder(ObjectID ownerID, ObjectID folderID)
          Find all templates in the specified folder that are owned by the executing user.
 java.util.List<ObjectID> findTemplatesByTitle(java.lang.String title, java.util.Locale locale, TemplateCatalogService.SearchPattern searchPattern)
          Find all templates that have the specified title or title fragment in the specified locale regarding to the search pattern.
 java.util.List<ObjectID> findTemplatesByTitleInFolder(java.lang.String title, java.util.Locale locale, ObjectID folderID, TemplateCatalogService.SearchPattern searchPattern)
          Find all templates in the specified folder (subfolders not included) that have the specified title or title fragment in the specified locale regarding to the search pattern.
 java.util.List<ObjectID> findTemplatesInFolder(ObjectID folderID)
          Find all templates in the specified folder the executing user is allowed to see.
 Folder getFolder(ObjectID folderID)
          Returns the folder with the given ObjectID.
 java.util.List<Folder> getFolders(java.util.List<ObjectID> folderIDs)
          Returns a list the folder objects with the given ObjectIDs.
 ObjectID getParentFolder(ObjectID folderID)
          Get the parent folder of the given folder.
 Folder getRootFolder()
          Get the root template folder.
 ObjectID getRootFolderID()
          Get the ObjectID of the root template folder.
 ObjectID importTemplate(java.lang.String filename, java.io.InputStream data, ObjectID folderID)
          Import a template into a given folder.
 ObjectID importTemplate(java.lang.String filename, java.io.InputStream data, ObjectID folderID, Localized templateInfo)
          Import a template into a given folder and assign it the given name and description.
 void modifyFolder(Folder folder)
          Modifies the data of the folder.
 void updateTemplate(ObjectID templateID, java.io.InputStream data)
          Update an existing template.
 void validateTemplate(java.io.InputStream data, ObjectID folderID)
          Validate a given template.
 
Methods inherited from interface com.ibm.portal.Disposable
dispose
 

Field Detail

COPYRIGHT

static final java.lang.String COPYRIGHT
Method Detail

addFolder

ObjectID addFolder(Folder folder,
                   ObjectID parentFolderID)
                   throws TemplateCatalogServiceException,
                          UnknownFolderException,
                          AccessControlException
Create a subfolder in the given parent folder. If parent is null a top level folder is created.

Parameters:
parentFolderID - the folder the new folder will be child of. Must NOT be null.
folder - the new folder (title, description, ..)
Returns:
the ObjectID of the new folder
Throws:
TemplateCatalogServiceException - if a general exception occured in the template catalog service
UnknownFolderException - if the given parent folder does not exist
AccessControlException - if the user has not enough rights to execute the action

modifyFolder

void modifyFolder(Folder folder)
                  throws TemplateCatalogServiceException,
                         UnknownFolderException,
                         AccessControlException
Modifies the data of the folder.

Parameters:
folder - the folder object with modified data.
Throws:
TemplateCatalogServiceException - if a general exception occured in the template catalog service
UnknownFolderException - if the specified folder does not exist
AccessControlException - if the user has not enough rights to execute the action

deleteFolder

void deleteFolder(ObjectID folderID,
                  boolean deleteContent)
                  throws TemplateCatalogServiceException,
                         UnknownFolderException,
                         FolderNotEmptyException,
                         AccessControlException
Delete the specified folder. If deleteContents is set to false and the folder is not empty then a FolderNotEmptyException is thrown.

Parameters:
folderID - the ObjectID of the folder to delete
deleteContent - specify wether the content of the deleted folder should be deleted as well.
Throws:
TemplateCatalogServiceException - if a general exception occured in the template catalog service
UnknownFolderException - if the folder with the given ObjectId does not exist
AccessControlException - if the user has not enough rights to execute the action
FolderNotEmptyException - if deleteContent is false, but the folder is not empty

getParentFolder

ObjectID getParentFolder(ObjectID folderID)
                         throws TemplateCatalogServiceException,
                                UnknownFolderException,
                                AccessControlException
Get the parent folder of the given folder.

Parameters:
folderID - the ObjectID of the folder to find the parent folder for
Returns:
the ObjectID of the parent folder or null if the specified folder is the root template folder
Throws:
TemplateCatalogServiceException - if a general exception occured in the template catalog service
UnknownFolderException - if the folder with the given ObjectID does not exist
AccessControlException - if the user has not enough rights to execute the action

getRootFolder

Folder getRootFolder()
                     throws TemplateCatalogServiceException,
                            AccessControlException
Get the root template folder.

Returns:
the root template folder.
Throws:
TemplateCatalogServiceException - if a general exception occured in the template catalog service
AccessControlException - if the user has not enough rights to execute the action

getRootFolderID

ObjectID getRootFolderID()
                         throws TemplateCatalogServiceException,
                                AccessControlException
Get the ObjectID of the root template folder.

Returns:
the ObjectID of the root template folder.
Throws:
TemplateCatalogServiceException - if a general exception occured in the template catalog service
AccessControlException - if the user has not enough rights to execute the action

getFolder

Folder getFolder(ObjectID folderID)
                 throws TemplateCatalogServiceException,
                        UnknownFolderException,
                        AccessControlException
Returns the folder with the given ObjectID.

Parameters:
folderOID - the ObjectID of the requested folder
Returns:
the folder for the given folderOID
Throws:
TemplateCatalogServiceException - if a general exception occured in the template catalog service
AccessControlException - if the user has not enough rights to execute the action
UnknownFolderException

getFolders

java.util.List<Folder> getFolders(java.util.List<ObjectID> folderIDs)
                                  throws TemplateCatalogServiceException,
                                         UnknownFolderException,
                                         AccessControlException
Returns a list the folder objects with the given ObjectIDs.

Parameters:
folderIDs - list of folder ObjectIDs
Returns:
list of folder objects matching to the specified list of folder ObjectIDs
Throws:
TemplateCatalogServiceException - if a general exception occured in the template catalog service
UnknownFolderException - if one of the specified folders does not exist
AccessControlException - if the user has not enough rights to view one of the specified folders

findChildFolders

java.util.List<ObjectID> findChildFolders(ObjectID parentID)
                                          throws TemplateCatalogServiceException,
                                                 UnknownFolderException
Returns the child folders for the given folderOID the user is allowed to see. Folders that the user is not allowed to see may exist but will not be returned as of access permission restrictions for the calling user.

Parameters:
folderOID - - of parent folder ObjectID
Returns:
a list of child folder ObjectIDs the user is allowed to see
Throws:
UnknownFolderException - if the folder with the given ObjectId does not exist
TemplateCatalogServiceException - if a general exception occured in the template catalog service

importTemplate

ObjectID importTemplate(java.lang.String filename,
                        java.io.InputStream data,
                        ObjectID folderID)
                        throws TemplateCatalogServiceException,
                               UnknownFolderException,
                               AccessControlException
Import a template into a given folder.

Parameters:
filename - the name of the template file
data - a stream containing the template itself
folderID - the folder to store the template into, must not be null
Returns:
the ObjectID that identifies the imported template
Throws:
AccessControlException - if the user has not enough rights to execute the action
UnknownFolderException - if the folder with the given ObjectId does not exist
TemplateCatalogServiceException - if a general exception occured in the template catalog service

importTemplate

ObjectID importTemplate(java.lang.String filename,
                        java.io.InputStream data,
                        ObjectID folderID,
                        Localized templateInfo)
                        throws TemplateCatalogServiceException,
                               UnknownFolderException,
                               AccessControlException
Import a template into a given folder and assign it the given name and description.

Parameters:
filename - the name of the template file
data - a stream containing the template itself
folderID - the folder to store the template into, must not be null
templateInfo - the name and description to be used for the imported template
Returns:
the ObjectID that identifies the imported template
Throws:
AccessControlException - if the user has not enough rights to execute the action
UnknownFolderException - if the folder with the given ObjectId does not exist
TemplateCatalogServiceException - if a general exception occured in the template catalog service

validateTemplate

void validateTemplate(java.io.InputStream data,
                      ObjectID folderID)
                      throws TemplateCatalogServiceException,
                             TemplateValidationException,
                             DuplicateTemplateTitleValidationException
Validate a given template. This includes things like checking the template title so that there will not be multiple templates with the same title in the same folder.

Parameters:
folderID - the folder to use for template title checks
data - the template data
Throws:
TemplateCatalogServiceException - if a general exception occured in the template catalog service
TemplateValidationException - thrown if the template is not well-formed
DuplicateTemplateTitleValidationException - thrown if there is already a template existing in the specified folder that has the same title as the validated template

findTemplates

java.util.List<ObjectID> findTemplates()
                                       throws TemplateCatalogServiceException
Find all templates in all folders the executing user is allowed to see.

Returns:
a list of ObjectIDs of all templates in all folders the executing user is allowed to see.
Throws:
TemplateCatalogServiceException - if a general exception occured in the template catalog service

findTemplatesInFolder

java.util.List<ObjectID> findTemplatesInFolder(ObjectID folderID)
                                               throws TemplateCatalogServiceException
Find all templates in the specified folder the executing user is allowed to see. Templates in subfolders are not retrieved by this call.

Returns:
a list of ObjectIDs of all templates in the specified folder the executing user is allowed to see.
Throws:
TemplateCatalogServiceException - if a general exception occured in the template catalog service

findTemplatesByOwnerID

java.util.List<ObjectID> findTemplatesByOwnerID(ObjectID ownerID)
                                                throws TemplateCatalogServiceException
Find all templates in all folders that are owned by the specified user.

Returns:
a list of ObjectIDs of all templates in all folders that are owned by the specified user.
Throws:
TemplateCatalogServiceException - if a general exception occured in the template catalog service

findTemplatesByOwnerIDInFolder

java.util.List<ObjectID> findTemplatesByOwnerIDInFolder(ObjectID ownerID,
                                                        ObjectID folderID)
                                                        throws TemplateCatalogServiceException
Find all templates in the specified folder that are owned by the executing user. Templates in subfolders are not retrieved by this call.

Returns:
a list of ObjectIDs of all templates in the specified folder the executing user is allowed to see.
Throws:
TemplateCatalogServiceException - if a general exception occured in the template catalog service

findTemplatesByTitle

java.util.List<ObjectID> findTemplatesByTitle(java.lang.String title,
                                              java.util.Locale locale,
                                              TemplateCatalogService.SearchPattern searchPattern)
                                              throws TemplateCatalogServiceException
Find all templates that have the specified title or title fragment in the specified locale regarding to the search pattern.

Parameters:
title - either the complete title or a fragment of the template title
locale - the locale the title is searched for
searchPattern - specifies what type of search is done (Please see TemplateCatalogService.SearchPattern)
Returns:
a list of ObjectIDs of all templates that match to the specified search conditions
Throws:
TemplateCatalogServiceException - if a general exception occured in the template catalog service

findTemplatesByTitleInFolder

java.util.List<ObjectID> findTemplatesByTitleInFolder(java.lang.String title,
                                                      java.util.Locale locale,
                                                      ObjectID folderID,
                                                      TemplateCatalogService.SearchPattern searchPattern)
                                                      throws TemplateCatalogServiceException
Find all templates in the specified folder (subfolders not included) that have the specified title or title fragment in the specified locale regarding to the search pattern.

Parameters:
title - either the complete title or a fragment of the template title
locale - the locale the title is searched for
searchPattern - specifies what type of search is done (Please see TemplateCatalogService.SearchPattern)
Returns:
a list of ObjectIDs of all templates in the secified folder (subfolders not included) that match to the specified search conditions
Throws:
TemplateCatalogServiceException - if a general exception occured in the template catalog service

doesTemplateExist

boolean doesTemplateExist(ObjectID templateID)
                          throws TemplateCatalogServiceException
Check wether a template with the specified ObjectID is existing.

Parameters:
templateID - the template ID to check for
Returns:
true, if the template exists otherwise false
Throws:
TemplateCatalogServiceException - if a general exception occured in the template catalog service

copyIntoNewTemplate

ObjectID copyIntoNewTemplate(ObjectID templateOID,
                             Localized templateInfo,
                             ObjectID folderID)
                             throws TemplateCatalogServiceException,
                                    UnknownFolderException,
                                    AccessControlException
Create a new template in the specified template folder with the specified localized information based on the specfied template.

Parameters:
templateOID - the ObjectID of the template the new template should be based on
templateInfo - the localized information to use in the new template
folderID - the target template folder
Returns:
the ObjectID of the created template
Throws:
AccessControlException - if the user has not enough rights to execute the action
UnknownFolderException - if the folder with the given ObjectID does not exist
TemplateCatalogServiceException - if a general exception occured in the template catalog service

exportTemplate

void exportTemplate(ObjectID templateOID,
                    java.io.OutputStream out)
                    throws TemplateCatalogServiceException,
                           UnknownTemplateException,
                           AccessControlException
/** Store the template in the given stream.

Parameters:
tempalteOID - the template that should be exported
out - the stream to write to
Throws:
AccessControlException - if the user has not enough rights to execute the action
TemplateCatalogServiceException - if a general exception occured in the template catalog service
UnknownTemplateException - thrown if the specified template ID is unknown to the system

deleteTemplate

void deleteTemplate(ObjectID templateID)
                    throws TemplateCatalogServiceException,
                           AccessControlException
Delete the specified template.

Parameters:
templateID - the ObjectID of the template to delete
Throws:
AccessControlException - if the user has not enough rights to execute the action
TemplateCatalogServiceException - if a general exception occured in the template catalog service

deleteTemplates

void deleteTemplates(java.util.List<ObjectID> templateIDs)
                     throws TemplateCatalogServiceException,
                            AccessControlException
Delete a several template at once.

Parameters:
templateIDs - the list of ObjectIDs of the templates to delete
Throws:
AccessControlException - if the user has not enough rights to execute the action
TemplateCatalogServiceException - if a general exception occured in the template catalog service

updateTemplate

void updateTemplate(ObjectID templateID,
                    java.io.InputStream data)
                    throws TemplateCatalogServiceException,
                           UnknownTemplateException,
                           AccessControlException
Update an existing template.

Parameters:
templateID - the ObjectID of the template to be updated, must not be null
data - a stream containing the template itself, must not be null
Throws:
AccessControlException - if the user has not enough rights to execute the action
TemplateCatalogServiceException - if a general exception occured in the template catalog service
UnknownTemplateException - thrown if the specified template ID is unknown to the system
Since:
6.1.0.3