com.ibm.workplace.wcm.api
Interface Folder

All Superinterfaces:
Document, Editable, EditableItem, Hierarchical, Item, Localized, WCMApiObject, WorkflowedDocument

public interface Folder
extends Editable, WorkflowedDocument, Hierarchical

Defining a folder object which can hold various items including child folders.

Since:
7.0

Method Summary
 boolean accept(DocumentId id)
          Tests the DocumentType of the given document id against this folder's one.
 boolean accept(Item item)
          Tests the DocumentType of the given document against this folder's one.
 void addDocument(Document document, boolean refreshDoc)
          Add a document into this folder.
 ResultIterator<Folder> getChildFolders()
          Obtain only child folders under this folder.
 ResultIterator<Item> getChildren()
          Obtain items and folders under this folder.
 com.ibm.workplace.wcm.api.FolderDocumentType[] getDocumentTypes()
          Document type of this folder.
 Item getParent()
          Get the parent folder.
 boolean isEmpty()
          Indicates if this folder contains any children
 boolean isPresetFolder()
          Returns true if this folder is a preset folder
 void setDocumentTypes(com.ibm.workplace.wcm.api.FolderDocumentType[] types)
          Set the DocumentType of this folder.
 
Methods inherited from interface com.ibm.workplace.wcm.api.Editable
addAuthors, addCategoryIds, addContributorAccessMembers, addDeleteAccessMembers, addEditAccessMembers, addEditorAccessMembers, addHistoryLogEntry, addLiveAccessMembers, addManagerAccessMembers, addMembersForAccess, addOwners, addReadAccessMembers, addUserAccessMembers, isChanged, removeAuthors, removeCategoryIds, removeContributorAccessMembers, removeDeleteAccessMembers, removeEditAccessMembers, removeEditorAccessMembers, removeLiveAccessMembers, removeManagerAccessMembers, removeMembersForAccess, removeOwners, removeReadAccessMembers, removeUserAccessMembers, setContributorAccessInheritance, setDescriptionTextProviderKey, setDescriptionTextProviderName, setEditorAccessInheritance, setInheritance, setKeywords, setManagerAccessInheritance, setPropagation, setTitleTextProviderKey, setTitleTextProviderName, setUserAccessInheritance
 
Methods inherited from interface com.ibm.workplace.wcm.api.Document
getAuthors, getCategoryIds, getContributorAccessMembers, getCreator, getDeleteAccessMembers, getDescription, getDescriptionTextProviderKey, getDescriptionTextProviderName, getEditAccessMembers, getEditorAccessMembers, getHistoryLog, getId, getInheritedContributorAccessMembers, getInheritedEditorAccessMembers, getInheritedManagerAccessMembers, getInheritedUserAccessMembers, getKeywords, getLastModifier, getLiveAccessMembers, getManagerAccessMembers, getMembersForAccess, getMembersForInheritedAccess, getOwnerLibrary, getOwners, getProject, getReadAccessMembers, getSourceWorkspace, getTitle, getTitleTextProviderKey, getTitleTextProviderName, getUserAccessMembers, getVersionCatalog, getVersionStrategy, hasDeleteAccess, hasDeleteAccess, hasEditAccess, hasEditAccess, hasLiveAccess, hasLiveAccess, hasProfile, hasProject, hasReadAccess, hasReadAccess, isContributorAccessInherited, isEditorAccessInherited, isInherited, isManagerAccessInherited, isNew, isPropagated, isUserAccessInherited, isWorkflowed
 
Methods inherited from interface com.ibm.workplace.wcm.api.Item
getCreationDate, getDescription, getIdentity, getModifiedDate, getName, getTitle
 
Methods inherited from interface com.ibm.portal.Localized
getLocales
 
Methods inherited from interface com.ibm.workplace.wcm.api.EditableItem
setDescription, setName, setTitle
 
Methods inherited from interface com.ibm.workplace.wcm.api.WorkflowedDocument
addAdditionalViewers, addApprovers, approve, cancelDraftDocument, clearApprovers, createDraftDocument, decline, decline, getAdditionalViewers, getCurrentApprovers, getDateEnteredStage, getEffectiveDate, getExpiryDate, getGeneralDateOne, getGeneralDateTwo, getPendingWorkflowStatus, getPublishedDate, getPublishedId, getWorkflowId, getWorkflowStageId, getWorkflowStatus, hasApproverAccess, hasApproverAccess, hasDraft, isDraft, isDraftOfPublishedDocument, isExpired, isPublished, isWorkflowMovingBackward, nextWorkflowStage, nextWorkflowStage, nextWorkflowStage, previousWorkflowStage, previousWorkflowStage, removeAdditionalViewers, removeApprovers, restartWorkflow, setEffectiveDate, setExpiryDate, setGeneralDateOne, setGeneralDateTwo, setWorkflowId, setWorkflowId
 
Methods inherited from interface com.ibm.workplace.wcm.api.Hierarchical
getParentId
 

Method Detail

getDocumentTypes

com.ibm.workplace.wcm.api.FolderDocumentType[] getDocumentTypes()
Document type of this folder. Only documents of the same type, or folders with the same DocumentType can be added to this folder. If no type is assigned yet, returns null.

Returns:
folder document types for this folder. null if no type is assigned.

setDocumentTypes

void setDocumentTypes(com.ibm.workplace.wcm.api.FolderDocumentType[] types)
                      throws com.ibm.workplace.wcm.api.exceptions.IllegalDocumentTypeException
Set the DocumentType of this folder. Once set, folders can only be modified if the folder is empty, or cleared (via a null or empty type list). If cleared, the folder will have its DocumentTypes reset to its parent folders DocumentTypes on save

Parameters:
types - folder document types for this folder
Throws:
com.ibm.workplace.wcm.api.exceptions.IllegalDocumentTypeException - if an attempt is made to alter the type (other than clear) and the folder isn't empty.

accept

boolean accept(Item item)
Tests the DocumentType of the given document against this folder's one.

Parameters:
item - to check if acceptable
Returns:
true if this folder accepts the given document.

accept

boolean accept(DocumentId id)
               throws com.ibm.workplace.wcm.api.exceptions.AuthorizationException,
                      com.ibm.workplace.wcm.api.exceptions.DocumentRetrievalException
Tests the DocumentType of the given document id against this folder's one.

Parameters:
id - to check if acceptable
Returns:
true if this folder accepts the given document id.
Throws:
com.ibm.workplace.wcm.api.exceptions.AuthorizationException
com.ibm.workplace.wcm.api.exceptions.DocumentRetrievalException

getChildren

ResultIterator<Item> getChildren()
                                 throws com.ibm.workplace.wcm.api.exceptions.QueryServiceException
Obtain items and folders under this folder.

Returns:
child items and folders as a ResultIterator.
Throws:
com.ibm.workplace.wcm.api.exceptions.QueryServiceException

getChildFolders

ResultIterator<Folder> getChildFolders()
                                       throws com.ibm.workplace.wcm.api.exceptions.QueryServiceException
Obtain only child folders under this folder.

Returns:
folders under this folder as a ResultIterator.
Throws:
com.ibm.workplace.wcm.api.exceptions.QueryServiceException

isEmpty

boolean isEmpty()
Indicates if this folder contains any children

Returns:
true if this folder contains any children, false otherwise

isPresetFolder

boolean isPresetFolder()
Returns true if this folder is a preset folder

Returns:
true if this folder is a preset folder, false otherwise

getParent

Item getParent()
Get the parent folder. For top level folders that are directly under a preset folder, this will return the preset folder. If this folder is itself a preset folder null will be returned.

Returns:
parent folder as Item.

addDocument

void addDocument(Document document,
                 boolean refreshDoc)
                 throws com.ibm.workplace.wcm.api.exceptions.IllegalDocumentTypeException,
                        com.ibm.workplace.wcm.api.exceptions.AuthorizationException,
                        com.ibm.workplace.wcm.api.exceptions.FolderException
Add a document into this folder. The document type must be the correct type for this folder, that is, folders, authoring templates, presentation templates, or library components. This method can be called for both unsaved (i.e. new) and saved documents. In the case of unsaved documents, this method saves the new document under this folder. In the case of saved documents, this method moves the document into this folder and saves it in that location.

Parameters:
document - The document to add to this folder.
refreshDoc - Indicates whether to refresh the properties of the added document. If not done, the properties of the document will not be correct.
Throws:
com.ibm.workplace.wcm.api.exceptions.IllegalDocumentTypeException - The document type is not allowed
com.ibm.workplace.wcm.api.exceptions.AuthorizationException - The user is not authorized
com.ibm.workplace.wcm.api.exceptions.FolderException - An exception occurred executing the action