Package org.craftercms.core.service
Interface ContentStoreService
- All Known Implementing Classes:
AbstractCachedContentStoreService
,ContentStoreServiceImpl
public interface ContentStoreService
Main Crafter content access API. Besides providing an interface to a content store or repository, implementations
of this service also should provide the following facilities:
- Merging:By using a certain merge strategy, the service is able to merge a collection of XML descriptor documents into a single XML document for an item.
-
Processing:The service passes an item through one or multiple "processors" that can manipulate
and change the item as they need. For example, there is a processor implementation that includes other
descriptor documents into the item's descriptor document (see
.impl.IncludeDescriptorsProcessor
, an another one that processes element text of descriptor documents as templates (seeTemplateProcessor
).
- Author:
- Sumer Jabri, Alfonso Vásquez
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Constant used to indicate that the depth of the tree should be unlimited. -
Method Summary
Modifier and TypeMethodDescriptionboolean
destroyContext
(Context context) Destroys the specified context, login out of any remote repository (if a login was issued) and destroying the cache scope associated to the context.boolean
Returns true if the file or folder at the specified URL existsboolean
exists
(Context context, CachingOptions cachingOptions, String url) Returns true if the file or folder at the specified URL existsfindChildren
(Context context, String url) Returns the children of the folder at the given url, returning null if the folder can't be found.findChildren
(Context context, CachingOptions cachingOptions, String url, ItemFilter filter, ItemProcessor processor) Returns the children of the folder at the given url, returning null if the folder can't be found.findChildren
(Context context, CachingOptions cachingOptions, String url, ItemFilter filter, ItemProcessor processor, boolean flatten) Returns the children of the folder at the given url, returning null if the folder can't be found.default Content
findContent
(Context context, String url) Returns the content of the file for the given url, returning null if not found.findContent
(Context context, CachingOptions cachingOptions, String url) Returns the content of the file for the given url, returning null if not found.default Item
Returns the content store item for the given url, returning null if not found.default Item
findItem
(Context context, CachingOptions cachingOptions, String url, ItemProcessor processor) Returns the content store item for the given url, returning null if not found.findItem
(Context context, CachingOptions cachingOptions, String url, ItemProcessor processor, boolean flatten) Returns the content store item for the given url, returning null if not found.default Tree
Returns the folder at the given url as a tree, or null if the folder wasn't found.default Tree
Returns the folder at the given url as a tree, or null if the folder wasn't found.default Tree
findTree
(Context context, CachingOptions cachingOptions, String url, int depth, ItemFilter filter, ItemProcessor processor) Returns the folder at the given url as a tree, or null if the folder wasn't found.findTree
(Context context, CachingOptions cachingOptions, String url, int depth, ItemFilter filter, ItemProcessor processor, boolean flatten) Returns the folder at the given url as a tree, or null if the folder wasn't found.getChildren
(Context context, String url) Returns the children of the folder at the given url.getChildren
(Context context, CachingOptions cachingOptions, String url, ItemFilter filter, ItemProcessor processor) Returns the children of the folder at the given url.getChildren
(Context context, CachingOptions cachingOptions, String url, ItemFilter filter, ItemProcessor processor, boolean flatten) Returns the children of the folder at the given url.default Content
getContent
(Context context, String url) Returns the content of the file for the given url.getContent
(Context context, CachingOptions cachingOptions, String url) Returns the content of the file for the given url.getContext
(String contextId) Returns the openContext
for the given ID, or null if no context found for the ID.getContext
(String tag, String storeType, String rootFolderPath, boolean mergingOn, boolean cacheOn, int maxAllowedItemsInCache, boolean ignoreHiddenFiles) Returns a context with the specified parameters, if the context doesn't exist it will be created.default Item
Returns the content store item for the given url.default Item
getItem
(Context context, CachingOptions cachingOptions, String url, ItemProcessor processor) Returns the content store item for the given url.getItem
(Context context, CachingOptions cachingOptions, String url, ItemProcessor processor, boolean flatten) Returns the content store item for the given url.default Tree
Returns the folder at the given url as a tree.default Tree
Returns the folder at the given url as a tree.default Tree
getTree
(Context context, CachingOptions cachingOptions, String url, int depth, ItemFilter filter, ItemProcessor processor) Returns the folder at the given url as a tree.getTree
(Context context, CachingOptions cachingOptions, String url, int depth, ItemFilter filter, ItemProcessor processor, boolean flatten) Returns the folder at the given url as a tree.boolean
Returns true if the specified context is still valid and usable.
-
Field Details
-
UNLIMITED_TREE_DEPTH
static final int UNLIMITED_TREE_DEPTHConstant used to indicate that the depth of the tree should be unlimited. This means that the tree will be built until the bottom of the folder hierarchy.- See Also:
-
-
Method Details
-
getContext
Returns the openContext
for the given ID, or null if no context found for the ID. -
getContext
Context getContext(String tag, String storeType, String rootFolderPath, boolean mergingOn, boolean cacheOn, int maxAllowedItemsInCache, boolean ignoreHiddenFiles) throws InvalidStoreTypeException, RootFolderNotFoundException, StoreException, AuthenticationException Returns a context with the specified parameters, if the context doesn't exist it will be created.- Parameters:
tag
- a tag that's used when creating the ID to differentiate this contextstoreType
- the type of content store to userootFolderPath
- the root folder path for the contextmergingOn
- indicates if content merging should be enabledcacheOn
- indicates if content caching should be enabledmaxAllowedItemsInCache
- the maximum number of items to hold in the cacheignoreHiddenFiles
- indicates if hidden files should be ignored- Returns:
- the
Context
object - Throws:
InvalidStoreTypeException
- if the provided store type is invalidRootFolderNotFoundException
- if the provided root folder path doesn't existStoreException
- if there is any unexpected error during the creation the contextAuthenticationException
- if there is any authentication error during the creation of the context
-
validate
Returns true if the specified context is still valid and usable. -
destroyContext
Destroys the specified context, login out of any remote repository (if a login was issued) and destroying the cache scope associated to the context.- Returns:
- true if the context was successfully destroyed, false otherwise.
- Throws:
StoreException
AuthenticationException
-
exists
boolean exists(Context context, CachingOptions cachingOptions, String url) throws InvalidContextException, PathNotFoundException, StoreException Returns true if the file or folder at the specified URL exists- Parameters:
context
- the context with the store configuration (required)cachingOptions
- the caching options for any caching operation done inside this service call (optional)url
- the url of the file (required)- Returns:
- true if the file or folder exists, false otherwise
- Throws:
InvalidContextException
- if the context is invalidPathNotFoundException
- if the file the url points to can't be foundStoreException
- if an error occurred while accessing the content store
-
exists
boolean exists(Context context, String url) throws InvalidContextException, PathNotFoundException, StoreException Returns true if the file or folder at the specified URL exists- Parameters:
context
- the context with the store configuration (required)url
- the url of the file (required)- Returns:
- true if the file or folder exists, false otherwise
- Throws:
InvalidContextException
- if the context is invalidPathNotFoundException
- if the file the url points to can't be foundStoreException
- if an error occurred while accessing the content store
-
findContent
default Content findContent(Context context, String url) throws InvalidContextException, StoreException Returns the content of the file for the given url, returning null if not found.- Parameters:
context
- the context with the store configuration (required)url
- the url of the file (required)- Returns:
- the file content
- Throws:
InvalidContextException
- if the context is invalidStoreException
- if an error occurred while accessing the content store
-
findContent
Content findContent(Context context, CachingOptions cachingOptions, String url) throws InvalidContextException, StoreException Returns the content of the file for the given url, returning null if not found.- Parameters:
context
- the context with the store configuration (required)cachingOptions
- the caching options for any caching operation done inside this service call (optional)url
- the url of the file (required)- Returns:
- the file content
- Throws:
InvalidContextException
- if the context is invalidStoreException
- if an error occurred while accessing the content store
-
getContent
default Content getContent(Context context, String url) throws InvalidScopeException, PathNotFoundException, StoreException Returns the content of the file for the given url.- Parameters:
context
- the context with the store configuration (required)url
- the url of the file (required)- Returns:
- the file content
- Throws:
InvalidContextException
- if the context is invalidPathNotFoundException
- if the file the url points to can't be foundStoreException
- if an error occurred while accessing the content storeInvalidScopeException
-
getContent
Content getContent(Context context, CachingOptions cachingOptions, String url) throws InvalidContextException, PathNotFoundException, StoreException Returns the content of the file for the given url.- Parameters:
context
- the context with the store configuration (required)cachingOptions
- the caching options for any caching operation done inside this service call (optional)url
- the url of the file (required)- Returns:
- the file content
- Throws:
InvalidContextException
- if the context is invalidPathNotFoundException
- if the file the url points to can't be foundStoreException
- if an error occurred while accessing the content store
-
findItem
default Item findItem(Context context, String url) throws InvalidContextException, XmlFileParseException, XmlMergeException, ItemProcessingException, StoreException Returns the content store item for the given url, returning null if not found. SeeItem
for the types of files an item can be.- Parameters:
context
- the context with the store configuration (required)url
- the url of the item (required)- Returns:
- the item
- Throws:
InvalidContextException
- if the context is invalidXmlFileParseException
- if there was an error while parsing the item's XML descriptorXmlMergeException
- if there was an error while attempting to do a merge of XML descriptorsItemProcessingException
- if there was an error while processing the itemStoreException
- if an error occurred while accessing the content store
-
findItem
default Item findItem(Context context, CachingOptions cachingOptions, String url, ItemProcessor processor) throws InvalidContextException, XmlFileParseException, XmlMergeException, ItemProcessingException, StoreException Returns the content store item for the given url, returning null if not found. SeeItem
for the types of files an item can be.- Parameters:
context
- the context to the content store (required)cachingOptions
- the caching options for any caching operation done inside this service call (optional)url
- the url of the item (optional, can be null)processor
- additionalItemProcessor
(optional, can be null)- Returns:
- the item
- Throws:
InvalidContextException
- if the context is invalidXmlFileParseException
- if there was an error while parsing the item's XML descriptorXmlMergeException
- if there was an error while attempting to do a merge of XML descriptorsItemProcessingException
- if there was an error while processing the itemStoreException
- if an error occurred while accessing the content store
-
findItem
Item findItem(Context context, CachingOptions cachingOptions, String url, ItemProcessor processor, boolean flatten) throws InvalidContextException, XmlFileParseException, XmlMergeException, ItemProcessingException, StoreException Returns the content store item for the given url, returning null if not found. SeeItem
for the types of files an item can be.- Parameters:
context
- the context to the content store (required)cachingOptions
- the caching options for any caching operation done inside this service call (optional)url
- the url of the item (optional, can be null)processor
- additionalItemProcessor
(optional, can be null)flatten
- indicates if descriptors should be flattened- Returns:
- the item
- Throws:
InvalidContextException
- if the context is invalidXmlFileParseException
- if there was an error while parsing the item's XML descriptorXmlMergeException
- if there was an error while attempting to do a merge of XML descriptorsItemProcessingException
- if there was an error while processing the itemStoreException
- if an error occurred while accessing the content store
-
getItem
default Item getItem(Context context, String url) throws InvalidContextException, PathNotFoundException, XmlFileParseException, XmlMergeException, ItemProcessingException, StoreException Returns the content store item for the given url. SeeItem
for the types of files an item can be.- Parameters:
context
- the context with the store configuration (required)url
- the url of the item (required)- Returns:
- the item
- Throws:
InvalidContextException
- if the context is invalidPathNotFoundException
- if the file the url points to can't be foundXmlFileParseException
- if there was an error while parsing the item's XML descriptorXmlMergeException
- if there was an error while attempting to do a merge of XML descriptorsItemProcessingException
- if there was an error while processing the itemStoreException
- if an error occurred while accessing the content store
-
getItem
default Item getItem(Context context, CachingOptions cachingOptions, String url, ItemProcessor processor) throws InvalidContextException, PathNotFoundException, XmlFileParseException, XmlMergeException, ItemProcessingException, StoreException Returns the content store item for the given url. SeeItem
for the types of files an item can be.- Parameters:
context
- the context to the content store (required)cachingOptions
- the caching options for any caching operation done inside this service call (optional)url
- the url of the item (optional, can be null)processor
- additionalItemProcessor
(optional, can be null)- Returns:
- the item
- Throws:
InvalidContextException
- if the context is invalidPathNotFoundException
- if the file the url points to can't be foundXmlFileParseException
- if there was an error while parsing the item's XML descriptorXmlMergeException
- if there was an error while attempting to do a merge of XML descriptorsItemProcessingException
- if there was an error while processing the itemStoreException
- if an error occurred while accessing the content store
-
getItem
Item getItem(Context context, CachingOptions cachingOptions, String url, ItemProcessor processor, boolean flatten) throws InvalidContextException, PathNotFoundException, XmlFileParseException, XmlMergeException, ItemProcessingException, StoreException Returns the content store item for the given url. SeeItem
for the types of files an item can be.- Parameters:
context
- the context to the content store (required)cachingOptions
- the caching options for any caching operation done inside this service call (optional)url
- the url of the item (optional, can be null)processor
- additionalItemProcessor
(optional, can be null)flatten
- indicates if descriptors should be flattened- Returns:
- the item
- Throws:
InvalidContextException
- if the context is invalidPathNotFoundException
- if the file the url points to can't be foundXmlFileParseException
- if there was an error while parsing the item's XML descriptorXmlMergeException
- if there was an error while attempting to do a merge of XML descriptorsItemProcessingException
- if there was an error while processing the itemStoreException
- if an error occurred while accessing the content store
-
findChildren
default List<Item> findChildren(Context context, String url) throws InvalidContextException, XmlFileParseException, XmlMergeException, ItemProcessingException, StoreException Returns the children of the folder at the given url, returning null if the folder can't be found.- Parameters:
context
- the context to the content store (required)url
- the url of the folder (required)- Returns:
- the children of the folder
- Throws:
InvalidContextException
- if the context is invalidXmlFileParseException
- if there was an error while parsing a children's XML descriptorXmlMergeException
- if there was an error while attempting to do a merge of XML descriptorsItemProcessingException
- if there was an error while processing an itemStoreException
- if an error occurred while accessing the content store
-
findChildren
default List<Item> findChildren(Context context, CachingOptions cachingOptions, String url, ItemFilter filter, ItemProcessor processor) throws InvalidContextException, XmlFileParseException, XmlMergeException, ItemProcessingException, StoreException Returns the children of the folder at the given url, returning null if the folder can't be found.- Parameters:
context
- the context to the content store (required)cachingOptions
- the caching options for any caching operation done inside this service call (optional)url
- the url of the folder (required)filter
- anItemFilter
to filter out undesired children (optional, can be null)processor
- additionalItemProcessor
for the children (optional, can be null)- Returns:
- the children of the folder
- Throws:
InvalidContextException
- if the context is invalidXmlFileParseException
- if there was an error while parsing a children's XML descriptorXmlMergeException
- if there was an error while attempting to do a merge of XML descriptorsItemProcessingException
- if there was an error while processing an itemStoreException
- if an error occurred while accessing the content store
-
findChildren
List<Item> findChildren(Context context, CachingOptions cachingOptions, String url, ItemFilter filter, ItemProcessor processor, boolean flatten) throws InvalidContextException, XmlFileParseException, XmlMergeException, ItemProcessingException, StoreException Returns the children of the folder at the given url, returning null if the folder can't be found.- Parameters:
context
- the context to the content store (required)cachingOptions
- the caching options for any caching operation done inside this service call (optional)url
- the url of the folder (required)filter
- anItemFilter
to filter out undesired children (optional, can be null)processor
- additionalItemProcessor
for the children (optional, can be null)flatten
- indicates if descriptors should be flattened- Returns:
- the children of the folder
- Throws:
InvalidContextException
- if the context is invalidXmlFileParseException
- if there was an error while parsing a children's XML descriptorXmlMergeException
- if there was an error while attempting to do a merge of XML descriptorsItemProcessingException
- if there was an error while processing an itemStoreException
- if an error occurred while accessing the content store
-
getChildren
default List<Item> getChildren(Context context, String url) throws InvalidContextException, PathNotFoundException, XmlFileParseException, XmlMergeException, ItemProcessingException, StoreException Returns the children of the folder at the given url.- Parameters:
context
- the context to the content store (required)url
- the url of the folder (required)- Returns:
- the children of the folder
- Throws:
InvalidContextException
- if the context is invalidPathNotFoundException
- if the folder the url points to can't be foundXmlFileParseException
- if there was an error while parsing a children's XML descriptorXmlMergeException
- if there was an error while attempting to do a merge of XML descriptorsItemProcessingException
- if there was an error while processing an itemStoreException
- if an error occurred while accessing the content store
-
getChildren
default List<Item> getChildren(Context context, CachingOptions cachingOptions, String url, ItemFilter filter, ItemProcessor processor) throws InvalidContextException, PathNotFoundException, XmlFileParseException, XmlMergeException, ItemProcessingException, StoreException Returns the children of the folder at the given url.- Parameters:
context
- the context to the content store (required)cachingOptions
- the caching options for any caching operation done inside this service call (optional)url
- the url of the folder (required)filter
- anItemFilter
to filter out undesired children (optional, can be null)processor
- additionalItemProcessor
for the children (optional, can be null)- Returns:
- the children of the folder
- Throws:
InvalidContextException
- if the context is invalidPathNotFoundException
- if the folder the url points to can't be foundXmlFileParseException
- if there was an error while parsing a children's XML descriptorXmlMergeException
- if there was an error while attempting to do a merge of XML descriptorsItemProcessingException
- if there was an error while processing an itemStoreException
- if an error occurred while accessing the content store
-
getChildren
List<Item> getChildren(Context context, CachingOptions cachingOptions, String url, ItemFilter filter, ItemProcessor processor, boolean flatten) throws InvalidContextException, PathNotFoundException, XmlFileParseException, XmlMergeException, ItemProcessingException, StoreException Returns the children of the folder at the given url.- Parameters:
context
- the context to the content store (required)cachingOptions
- the caching options for any caching operation done inside this service call (optional)url
- the url of the folder (required)filter
- anItemFilter
to filter out undesired children (optional, can be null)processor
- additionalItemProcessor
for the children (optional, can be null)flatten
- indicates if descriptors should be flattened- Returns:
- the children of the folder
- Throws:
InvalidContextException
- if the context is invalidPathNotFoundException
- if the folder the url points to can't be foundXmlFileParseException
- if there was an error while parsing a children's XML descriptorXmlMergeException
- if there was an error while attempting to do a merge of XML descriptorsItemProcessingException
- if there was an error while processing an itemStoreException
- if an error occurred while accessing the content store
-
findTree
default Tree findTree(Context context, String url) throws InvalidContextException, XmlFileParseException, XmlMergeException, ItemProcessingException, StoreException Returns the folder at the given url as a tree, or null if the folder wasn't found. The tree children are returned asItem
s when they're files and asTree
s when they're folders. The tree depth isUNLIMITED_TREE_DEPTH
.- Parameters:
context
- the context to the content store (required)url
- the url of the folder (required)- Returns:
- the folder as a tree
- Throws:
InvalidContextException
- if the context is invalidXmlFileParseException
- if there was an error while parsing a children's XML descriptorXmlMergeException
- if there was an error while attempting to do a merge of XML descriptorsItemProcessingException
- if there was an error while processing an itemStoreException
- if an error occurred while accessing the content store
-
getTree
default Tree getTree(Context context, String url) throws InvalidContextException, PathNotFoundException, XmlFileParseException, XmlMergeException, ItemProcessingException, StoreException Returns the folder at the given url as a tree. The tree children are returned asItem
s when they're files and asTree
s when they're folders. The tree depth isUNLIMITED_TREE_DEPTH
.- Parameters:
context
- the context to the content store (required)url
- the url of the folder (required)- Returns:
- the folder as a tree
- Throws:
InvalidContextException
- if the context is invalidPathNotFoundException
- if the folder the url points to can't be foundXmlFileParseException
- if there was an error while parsing a children's XML descriptorXmlMergeException
- if there was an error while attempting to do a merge of XML descriptorsItemProcessingException
- if there was an error while processing an itemStoreException
- if an error occurred while accessing the content store
-
findTree
default Tree findTree(Context context, String url, int depth) throws InvalidContextException, XmlFileParseException, XmlMergeException, ItemProcessingException, StoreException Returns the folder at the given url as a tree, or null if the folder wasn't found. The tree children are returned asItem
s when they're files and asTree
s when they're folders.- Parameters:
context
- the context to the content store (required)url
- the url of the folder (required)depth
- the number of levels the tree should have. Use #UNLIMITED_TREE_DEPTH when you want the tree to include all files/folder until the bottom of the folder hierarchy (required)- Returns:
- the folder as a tree
- Throws:
InvalidContextException
- if the context is invalidXmlFileParseException
- if there was an error while parsing a children's XML descriptorXmlMergeException
- if there was an error while attempting to do a merge of XML descriptorsItemProcessingException
- if there was an error while processing an itemStoreException
- if an error occurred while accessing the content store
-
findTree
default Tree findTree(Context context, CachingOptions cachingOptions, String url, int depth, ItemFilter filter, ItemProcessor processor) throws InvalidContextException, XmlFileParseException, XmlMergeException, ItemProcessingException, StoreException Returns the folder at the given url as a tree, or null if the folder wasn't found. The tree children are returned asItem
s when they're files and asTree
s when they're folders.- Parameters:
context
- the context to the content store (required)cachingOptions
- the caching options for any caching operation done inside this service call (optional)url
- the url of the folder (required)depth
- the number of levels the tree should have. Use #UNLIMITED_TREE_DEPTH when you want the tree to include all files/folder until the bottom of the folder hierarchy (required)filter
- anItemFilter
to filter out undesired items in the tree (optional, can be null)processor
- additionalItemProcessor
for the tree's items (optional, can be null)- Returns:
- the folder as a tree
- Throws:
InvalidContextException
- if the context is invalidXmlFileParseException
- if there was an error while parsing a children's XML descriptorXmlMergeException
- if there was an error while attempting to do a merge of XML descriptorsItemProcessingException
- if there was an error while processing an itemStoreException
- if an error occurred while accessing the content store
-
findTree
Tree findTree(Context context, CachingOptions cachingOptions, String url, int depth, ItemFilter filter, ItemProcessor processor, boolean flatten) throws InvalidContextException, XmlFileParseException, XmlMergeException, ItemProcessingException, StoreException Returns the folder at the given url as a tree, or null if the folder wasn't found. The tree children are returned asItem
s when they're files and asTree
s when they're folders.- Parameters:
context
- the context to the content store (required)cachingOptions
- the caching options for any caching operation done inside this service call (optional)url
- the url of the folder (required)depth
- the number of levels the tree should have. Use #UNLIMITED_TREE_DEPTH when you want the tree to include all files/folder until the bottom of the folder hierarchy (required)filter
- anItemFilter
to filter out undesired items in the tree (optional, can be null)processor
- additionalItemProcessor
for the tree's items (optional, can be null)flatten
- indicates if descriptors should be flattened- Returns:
- the folder as a tree
- Throws:
InvalidContextException
- if the context is invalidXmlFileParseException
- if there was an error while parsing a children's XML descriptorXmlMergeException
- if there was an error while attempting to do a merge of XML descriptorsItemProcessingException
- if there was an error while processing an itemStoreException
- if an error occurred while accessing the content store
-
getTree
default Tree getTree(Context context, String url, int depth) throws InvalidContextException, PathNotFoundException, XmlFileParseException, XmlMergeException, ItemProcessingException, StoreException Returns the folder at the given url as a tree. The tree children are returned asItem
s when they're files and asTree
s when they're folders.- Parameters:
context
- the context to the content store (required)url
- the url of the folder (required)depth
- the number of levels the tree should have. Use #UNLIMITED_TREE_DEPTH when you want the tree to include all files/folder until the bottom of the folder hierarchy (required)- Returns:
- the folder as a tree
- Throws:
InvalidContextException
- if the context is invalidPathNotFoundException
- if the folder the url points to can't be foundXmlFileParseException
- if there was an error while parsing a children's XML descriptorXmlMergeException
- if there was an error while attempting to do a merge of XML descriptorsItemProcessingException
- if there was an error while processing an itemStoreException
- if an error occurred while accessing the content store
-
getTree
default Tree getTree(Context context, CachingOptions cachingOptions, String url, int depth, ItemFilter filter, ItemProcessor processor) throws InvalidContextException, PathNotFoundException, XmlFileParseException, XmlMergeException, ItemProcessingException, StoreException Returns the folder at the given url as a tree. The tree children are returned asItem
s when they're files and asTree
s when they're folders.- Parameters:
context
- the context to the content store (required)cachingOptions
- the caching options for any caching operation done inside this service call (optional)url
- the url of the folder (required)depth
- the number of levels the tree should have. Use #UNLIMITED_TREE_DEPTH when you want the tree to include all files/folder until the bottom of the folder hierarchy (required)filter
- anItemFilter
to filter out undesired items in the tree (optional, can be null)processor
- additionalItemProcessor
for the tree's items (optional, can be null)- Returns:
- the folder as a tree
- Throws:
InvalidContextException
- if the context is invalidPathNotFoundException
- if the folder the url points to can't be foundXmlFileParseException
- if there was an error while parsing a children's XML descriptorXmlMergeException
- if there was an error while attempting to do a merge of XML descriptorsItemProcessingException
- if there was an error while processing an itemStoreException
- if an error occurred while accessing the content store
-
getTree
Tree getTree(Context context, CachingOptions cachingOptions, String url, int depth, ItemFilter filter, ItemProcessor processor, boolean flatten) throws InvalidContextException, PathNotFoundException, XmlFileParseException, XmlMergeException, ItemProcessingException, StoreException Returns the folder at the given url as a tree. The tree children are returned asItem
s when they're files and asTree
s when they're folders.- Parameters:
context
- the context to the content store (required)cachingOptions
- the caching options for any caching operation done inside this service call (optional)url
- the url of the folder (required)depth
- the number of levels the tree should have. Use #UNLIMITED_TREE_DEPTH when you want the tree to include all files/folder until the bottom of the folder hierarchy (required)filter
- anItemFilter
to filter out undesired items in the tree (optional, can be null)processor
- additionalItemProcessor
for the tree's items (optional, can be null)flatten
- indicates if descriptors should be flattened- Returns:
- the folder as a tree
- Throws:
InvalidContextException
- if the context is invalidPathNotFoundException
- if the folder the url points to can't be foundXmlFileParseException
- if there was an error while parsing a children's XML descriptorXmlMergeException
- if there was an error while attempting to do a merge of XML descriptorsItemProcessingException
- if there was an error while processing an itemStoreException
- if an error occurred while accessing the content store
-