|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface WcmLibraryService
WcmLibraryService enables access to Web Content Library methods through Portal services.
com.ibm.workplace.wcm.api.WcmLibraryService = com.ibm.workplace.wcm.api.WcmLibraryServiceImpl
Here is an example of how to retrieve the WcmLibraryService
:
try { // Construct and inital Context InitialContext ctx = new InitialContext(); // Retrieve WcmLibraryService using JNDI name WcmLibraryService wcmLibraryService = (WcmLibraryService) ctx.lookup("portal:service/wcm/WcmLibraryService"); } catch (NamingException ne) { System.out.print("Naming Exception: " + ne); }
Field Summary | |
---|---|
static java.lang.String |
JNDI_NAME
JNDI name of this service |
Method Summary | |
---|---|
void |
addItemToFolder(Workspace workspace,
Folder destination,
Item item)
Deprecated. Use Folder.addDocument instead |
LibraryTaskResult |
copyLibraries(Workspace workspace,
DocumentLibrary[] documentLibraries)
Copies the supplied document libraries as new libraries. |
LibraryTaskResult |
copyLibraries(Workspace workspace,
DocumentLibrary[] documentLibraries,
java.util.Locale locale)
Copies the supplied document libraries as new libraries with the specified Locale . |
LibraryTaskResult |
copyLibrary(Workspace workspace,
DocumentLibrary documentLibrary,
java.util.Locale locale)
Copies the supplied document library as a new library. |
Folder |
createFolder(Workspace workspace,
Folder parentFolder)
Deprecated. Use Workspace.createFolder instead |
DocumentLibrary |
createLibrary(Workspace workspace,
java.util.Locale locale)
Creates a new Library . |
void |
deleteFolder(Workspace workspace,
Item folderId)
Deprecated. Use Workspace.purge instead |
LibraryTaskResult |
deleteLibrary(Workspace workspace,
DocumentLibrary documentLibrary)
Deletes the DocumentLibrary . |
LibraryTaskResult |
exportLibrariesToStream(Workspace workspace,
DocumentLibrary[] documentLibraries,
java.io.OutputStream outputStream)
Export a group of document libraries to the supplied output stream. |
LibraryTaskResult |
exportLibraryToStream(Workspace workspace,
DocumentLibrary documentLibrary,
java.io.OutputStream outputStream)
Export a document library to the supplied output stream. |
Folder |
getFolderById(Workspace workspace,
Identity folderId)
Deprecated. Use Workspace.getById instead |
Folder |
getFolderByPath(Workspace workspace,
java.lang.String folderPath)
Obtain a folder with the specified path. |
Folder |
getFolderByRelativePath(Workspace workspace,
java.lang.String folderPath,
PresetFolderType type)
Obtain a folder with the specified folderPath on the library currently set on the specified workspace, with a specific preset type of PresetFolderType type
For example, the following will return a nested folder named '32x32' within the "Intranet" library, of the Components view. DocumentLibrary library = workspace.getDocumentLibrary("Intranet"); workspace.setCurrentDocumentLibrary(library); Folder folder = WcmLibraryService.getFolderByRelativePath(workspace, "images/logo/32x32", PresetFolderType.COMPONENT) |
Folder |
getPresetFolder(Workspace workspace,
DocumentLibrary library,
PresetFolderType type)
Deprecated. Use DocumentLibrary.getPresetFolder instead |
LibraryTaskResult |
importLibraryFromStream(Workspace workspace,
java.io.InputStream inputStream,
java.util.Locale locale)
Import document library from the supplied input stream as a new library. |
void |
moveItemToFolder(Workspace workspace,
Folder destination,
Item item)
Deprecated. Use Workspace.move instead |
LibraryTaskResult |
outputDocumentListModifiedBetweenToStream(Workspace workspace,
java.lang.String libraryName,
java.util.Date startDate,
java.util.Date endDate,
DocumentListWriter out,
java.util.Locale locale)
Export a list of all items modified between the specified dates to the passed character stream. |
LibraryTaskResult |
outputDocumentListModifiedSinceToStream(Workspace workspace,
java.lang.String libraryName,
java.util.Date modifiedDate,
DocumentListWriter out,
java.util.Locale locale)
Export a list of all items modified since the specified date to the passed character stream. |
LibraryTaskResult |
outputDocumentListToStream(Workspace workspace,
java.lang.String libraryName,
DocumentListWriter out,
java.util.Locale locale)
Export a list of all items in a document library to the passed character stream. |
void |
saveFolder(Workspace workspace,
Folder folder)
Deprecated. Use Workspace.save instead |
void |
saveLibrary(Workspace workspace,
DocumentLibrary documentLibrary)
Save the DocumentLibrary . |
Field Detail |
---|
static final java.lang.String JNDI_NAME
Method Detail |
---|
DocumentLibrary createLibrary(Workspace workspace, java.util.Locale locale)
Library
.
DocumentLibrary
object returned by this method will have
a system defined title. This title can then be changed by calling DocumentLibrary.setTitle()
.
workspace
- The workspacelocale
- locale of the library to be created
DocumentLibrary
objectvoid saveLibrary(Workspace workspace, DocumentLibrary documentLibrary) throws LibraryCreationException
DocumentLibrary
. If the document library is new, a library will be created.
workspace
- The workspacedocumentLibrary
- document library object to be saved
LibraryCreationException
- If an error occurred creating the libraryLibraryTaskResult deleteLibrary(Workspace workspace, DocumentLibrary documentLibrary) throws AuthorizationException, OperationFailedException
DocumentLibrary
.
This task will be executed synchronously.
LibraryTaskResult.getDocumentLibraries()
will always return an empty array.
workspace
- The workspacedocumentLibrary
- the DocumentLibrary
to delete
LibraryTaskResult
object representing the result of this delete operation.
AuthorizationException
- If sufficient authority to delete the library is not present
OperationFailedException
- If the library could not be foundLibraryTaskResult copyLibrary(Workspace workspace, DocumentLibrary documentLibrary, java.util.Locale locale) throws OperationFailedException, LibraryCreationException
LibraryTaskResult
object returned by this method contains the newly created library. To retrieve
the DocumentLibrary
use the following code:
DocumentLibrary[] copiedDocumentLibraries = (DocumentLibrary[]) LibraryTaskResult.getDocumentLibraries();
LibraryTaskResult
does not indicate a successful copy, the unsuccessfully copied library
can be retrieved by calling (DocumentLibrary[]) LibraryTaskResult.getDocumentLibraries()
. The library can
then be deleted.
DocumentLibrary
is created with a system defined title. The title can then be changed by calling
DocumentLibrary.setTitle()
workspace
- The workspacedocumentLibrary
- Source document librarylocale
- Locale of the new library
LibraryTaskResult
object that representing the result of this copy operation.
OperationFailedException
- If a repository related exception occurred
LibraryCreationException
- If an error occurred creating the libraryLibraryTaskResult copyLibraries(Workspace workspace, DocumentLibrary[] documentLibraries) throws OperationFailedException
LibraryTaskResult
object returned by this method contains the libraries that were created during
this operation.
LibraryTaskResult
indicates a successful copy, the successfully copied libraries can be retrieved
by calling (DocumentLibrary[]) LibraryTaskResult.getDocumentLibraries()
.
LibraryTaskResult
does not indicate a successful copy, the libraries that were created during the
operation can be retrieved by calling (DocumentLibraries[]) LibraryTaskResult.getResult()
. All libraries
returned on an unsuccessful copy can then be deleted.
DocumentLibrary.setTitle()
for each DocumentLibrary
.
workspace
- The workspacedocumentLibraries
- Source document libraries.
LibraryTaskResult
object representing the result of this copy operation.
OperationFailedException
- If a repository related exception occurredLibraryTaskResult copyLibraries(Workspace workspace, DocumentLibrary[] documentLibraries, java.util.Locale locale) throws OperationFailedException
Locale
. Assigns unique
names to the new libraries.
LibraryTaskResult
object returned by this method contains the libraries that were created during
this operation.
LibraryTaskResult
indicates a successful copy, the successfully copied libraries can be retrieved
by calling (DocumentLibrary[]) LibraryTaskResult.getDocumentLibraries()
.
LibraryTaskResult
does not indicate a successful copy, the libraries that were created during the
operation can be retrieved by calling (DocumentLibrary[]) LibraryTaskResult.getDocumentLibraries()
. All libraries
returned on an unsuccessful copy can then be deleted.
DocumentLibrary.setTitle()
for each DocumentLibrary
.
workspace
- The workspacedocumentLibraries
- Source document libraries.locale
- Locale to use for all new libraries.
LibraryTaskResult
object representing the result of this copy operation.
OperationFailedException
- If a repository related exception occurredLibraryTaskResult exportLibraryToStream(Workspace workspace, DocumentLibrary documentLibrary, java.io.OutputStream outputStream) throws OperationFailedException
LibraryTaskResult.getDocumentLibraries()
will always return an empty array.
workspace
- The workspacedocumentLibrary
- Source document libraryoutputStream
- Output stream to export to
LibraryTaskResult
object representing the result of this export operation.
OperationFailedException
- if a repository related exception occurredLibraryTaskResult exportLibrariesToStream(Workspace workspace, DocumentLibrary[] documentLibraries, java.io.OutputStream outputStream) throws OperationFailedException
LibraryTaskResult.getDocumentLibraries()
will always return an empty array.
workspace
- The workspacedocumentLibraries
- Source document librariesoutputStream
- Output stream to export to
LibraryTaskResult
object representing the result of this export operation.
OperationFailedException
- if a repository related exception occurredLibraryTaskResult importLibraryFromStream(Workspace workspace, java.io.InputStream inputStream, java.util.Locale locale) throws OperationFailedException, LibraryCreationException
LibraryTaskResult
indicates a successful import, calling (DocumentLibrary[]) LibraryTaskResult.getDocumentLibraries()
returns the successfully imported library.
LibraryTaskResult
does not indicate a successful import, calling (DocumentLibrary[]) LibraryTaskResult.getDocumentLibraries();
will return the the newly created library. The library can then be deleted.
workspace
- The workspaceinputStream
- Input stream to read data fromlocale
- Locale of the new library
LibraryTaskResult
object representing the result of this import operation.
OperationFailedException
- If a repository related exception occurred
LibraryCreationException
- If an error occurred creating the libraryLibraryTaskResult outputDocumentListToStream(Workspace workspace, java.lang.String libraryName, DocumentListWriter out, java.util.Locale locale) throws OperationFailedException
DocumentListWriter
for
each document item in this order:
workspace
- The workspacelibraryName
- The title of the document library to export the list forout
- DocumentListWriter
object the list is written to and that handles the format of the written list.locale
- The locale used to localize
LibraryTaskResult
object representing the result of this operation.
OperationFailedException
- If a repository related exception occurredLibraryTaskResult outputDocumentListModifiedSinceToStream(Workspace workspace, java.lang.String libraryName, java.util.Date modifiedDate, DocumentListWriter out, java.util.Locale locale) throws OperationFailedException
DocumentListWriter
for
each document item in this order:
workspace
- The workspacelibraryName
- The title of the document library to export the list formodifiedDate
- limits the result to documents modified since the given date.out
- DocumentListWriter
object the list is written to and that handles the format of the written list.locale
- The locale used to localize
LibraryTaskResult
object representing the result of this operation.
OperationFailedException
- If a repository related exception occurredLibraryTaskResult outputDocumentListModifiedBetweenToStream(Workspace workspace, java.lang.String libraryName, java.util.Date startDate, java.util.Date endDate, DocumentListWriter out, java.util.Locale locale) throws OperationFailedException
DocumentListWriter
for
each document item in this order:
workspace
- The workspacelibraryName
- The title of the document library to export the list forstartDate
- the date at the beginning of the rangeendDate
- the data at the end of the rangeout
- DocumentListWriter
object the list is written to and that handles the format of the written list.locale
- The locale used to localize
LibraryTaskResult
object representing the result of this operation.
OperationFailedException
- If a repository related exception occurredFolder getPresetFolder(Workspace workspace, DocumentLibrary library, PresetFolderType type) throws AuthorizationException, DocumentRetrievalException
workspace
- workspacelibrary
- to get preset folder from.type
- class for the wanted preset folder.
AuthorizationException
DocumentRetrievalException
DocumentLibrary.getPresetFolder(PresetFolderType)
Folder createFolder(Workspace workspace, Folder parentFolder) throws AuthorizationException, DocumentCreationException
workspace
- workspace for this operation.parentFolder
- parent folder id
AuthorizationException
- if the user does not have access permission
DocumentCreationException
- if the folder cannot be createdWorkspace.createFolder(com.ibm.workplace.wcm.api.Folder)
void deleteFolder(Workspace workspace, Item folderId) throws AuthorizationException, DocumentDeleteReferentialIntegrityException, DocumentDeleteException, FolderException
workspace
- workspace for this operation.folderId
- id of the folder to be deleted.
AuthorizationException
- if the user does not have access permissions
DocumentDeleteReferentialIntegrityException
- if the folder has any child item or folder.
DocumentDeleteException
- if the folder could not be deleted
FolderException
- the folder could not be found or an internal error occuredWorkspace.purge(com.ibm.workplace.wcm.api.DocumentId extends com.ibm.workplace.wcm.api.Document>)
void saveFolder(Workspace workspace, Folder folder) throws AuthorizationException, DuplicateChildException, DocumentSaveException, FolderException
Folder
.getParent();
workspace
- workspace for this operation.folder
- folder to be saved
AuthorizationException
- if the user does not have enough access permission
DuplicateChildException
- if a object with the same name already exists at the same path
DocumentSaveException
- if the folder could not be saved
FolderException
- an internal error occuredWorkspace.save(com.ibm.workplace.wcm.api.Document)
Folder getFolderById(Workspace workspace, Identity folderId) throws AuthorizationException, DocumentNotFoundException, DocumentRetrievalException
workspace
- workspace for this operation.folderId
- folder id as Item
AuthorizationException
- if the user does not have the required access
DocumentNotFoundException
- if the document cannot be found
DocumentRetrievalException
- if the document cannot be retrievedWorkspace.getById(com.ibm.workplace.wcm.api.DocumentId)
Folder getFolderByPath(Workspace workspace, java.lang.String folderPath) throws AuthorizationException, DocumentNotFoundException, DocumentRetrievalException
workspace
- workspace for this operation.folderPath
- path to the wanted folder, including preset folders
AuthorizationException
- if the user does not have the required access
DocumentNotFoundException
- if the document cannot be found
DocumentRetrievalException
- if the document cannot be retrievedFolder getFolderByRelativePath(Workspace workspace, java.lang.String folderPath, PresetFolderType type) throws DocumentNotFoundException, DocumentRetrievalException, AuthorizationException
PresetFolderType
type
workspace
- - workspace which will be used to retrieve the library.folderPath
- - A relative path to a document.type
- the PresetFolderType
.
AuthorizationException
- if the user does not have the required access
DocumentNotFoundException
- if the document cannot be found
DocumentRetrievalException
- if the document cannot be retrievedvoid addItemToFolder(Workspace workspace, Folder destination, Item item) throws AuthorizationException, IllegalDocumentTypeException, FolderException
Item
into a specified destination Folder
.
The destination Folder
must be for the class of the Item
workspace
- workspace for this operationdestination
- destination folderitem
- item to be moved
AuthorizationException
- if the user does not have access to perform this operation on the item or parent.
IllegalDocumentTypeException
- if the given item is not of type valid for this Folder
FolderException
- if item or parent can not be found or an internal error occured.Folder.addDocument(com.ibm.workplace.wcm.api.Document, boolean)
void moveItemToFolder(Workspace workspace, Folder destination, Item item) throws AuthorizationException, IllegalDocumentTypeException, FolderException
Item
into a specified destination Folder
.
The destination Folder
must be for the class of the Item
workspace
- workspace for this operationdestination
- destination folderitem
- item to be moved
AuthorizationException
- if the user does not have access to perform this operation on the item or parent.
IllegalDocumentTypeException
- if the given item is not of type valid for the destination Folder
FolderException
- if item or destination can not be found or an internal error occured.Workspace.move(com.ibm.workplace.wcm.api.DocumentId extends com.ibm.workplace.wcm.api.Document>, com.ibm.workplace.wcm.api.DocumentId extends com.ibm.workplace.wcm.api.Document>)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |