Interface ContentServiceInternal
- All Known Implementing Classes:
ContentServiceInternalImpl
public interface ContentServiceInternal
-
Method Summary
Modifier and TypeMethodDescriptionboolean
contentExists
(String siteId, String path) Check the existent of a content pathgetChildrenByPath
(String siteId, String path, String locale, String keyword, List<String> systemTypes, List<String> excludes, String sortStrategy, String order, int offset, int limit) Get list of children for given pathgetChildrenByPaths
(String siteId, List<String> paths, Map<String, GetChildrenBulkRequest.PathParams> pathParams) Get children for paths bulk.Optional
<org.springframework.core.io.Resource> getContentByCommitId
(String siteId, String path, String commitId) Get content for commit idlong
getContentSize
(String siteId, String path) Get content sizegetContentVersionHistory
(String siteId, String path) Get the version history for a given content item.org.craftercms.core.service.Item
getItemByPath
(String siteId, String path, boolean preferContent) Get detailed for given pathgetItemsByStates
(String siteId, long statesBitMap, List<String> systemTypes, List<org.craftercms.commons.rest.parameters.SortField> sortFields, int offset, int limit) Get a list of items by state and system types.getSandboxItemsById
(String siteId, List<Long> ids, List<org.craftercms.commons.rest.parameters.SortField> sortFields, boolean preferContent) Get sandbox items for given list of pathsgetSandboxItemsByPath
(String siteId, Collection<String> paths, boolean preferContent) Get sandbox items for given list of pathsgetSubtreeItems
(String siteId, String path) Get subtree items for given path.getSubtreeItems
(String siteId, List<String> path) Get subtree items for given paths.boolean
isEditable
(String itemPath, String itemMimeType) Check if item is editablevoid
itemLockByPath
(String siteId, String path) Lock item by path for given sitevoid
itemUnlockByPath
(String siteId, String path) Unlock item by path for given siteboolean
shallowContentExists
(String site, String path) This is a faster, but less accurate, version of contentExists.
-
Method Details
-
contentExists
Check the existent of a content path- Parameters:
siteId
- site identifierpath
- content path- Returns:
- true if the content exists, false otherwise
-
shallowContentExists
This is a faster, but less accurate, version of contentExists. This prioritizes performance over checking the actual underlying repository if the content is actually in the store or we simply hold a reference to the object in the actual store.- Returns:
- true if site has content object at path
- Throws:
SiteNotFoundException
-
getSubtreeItems
Get subtree items for given path.- Parameters:
siteId
- site identifierpath
- path to get subtree items for- Returns:
- list of paths of subtree items
-
getSubtreeItems
Get subtree items for given paths.- Parameters:
siteId
- site identifierpath
- list of paths to get subtree items for- Returns:
- list of paths of subtree items
-
getChildrenByPath
GetChildrenResult getChildrenByPath(String siteId, String path, String locale, String keyword, List<String> systemTypes, List<String> excludes, String sortStrategy, String order, int offset, int limit) throws ServiceLayerException, UserNotFoundException Get list of children for given path- Parameters:
siteId
- site identifierpath
- item path to children forlocale
- filter children by localekeyword
- filter children by keywordsystemTypes
- filter children by typeexcludes
- exclude items by pathsortStrategy
- sort orderorder
- ascending or descendingoffset
- offset of the first child in the resultlimit
- number of children to return- Returns:
- list of children
- Throws:
ServiceLayerException
UserNotFoundException
-
getChildrenByPaths
GetChildrenByPathsBulkResult getChildrenByPaths(String siteId, List<String> paths, Map<String, GetChildrenBulkRequest.PathParams> pathParams) throws ServiceLayerException, UserNotFoundExceptionGet children for paths bulk. This method will return children for a list of paths. Result items will also include aSandboxItem
object for the item itself.- Parameters:
siteId
- the site idpaths
- paths to get children for. Notice that this parameter is redundant with the pathParams. This list of paths is used to validate permissions.pathParams
- Map of extra parameters for each path- Returns:
- object containing a list of
GetChildrenByPathsBulkResult.ChildrenByPathResult
- Throws:
ServiceLayerException
- general service errorUserNotFoundException
- user not found (when calculating available actions)
-
getItem
-
getContentSize
Get content size- Parameters:
siteId
- site identifierpath
- content path- Returns:
- size in bytes
-
getItemByPath
DetailedItem getItemByPath(String siteId, String path, boolean preferContent) throws ServiceLayerException, UserNotFoundException Get detailed for given path- Parameters:
siteId
- site identifierpath
- item for pathpreferContent
- if true return content item if available- Returns:
- detailed item
- Throws:
ServiceLayerException
UserNotFoundException
-
getSandboxItemsByPath
List<SandboxItem> getSandboxItemsByPath(String siteId, Collection<String> paths, boolean preferContent) throws ServiceLayerException, UserNotFoundException Get sandbox items for given list of paths- Parameters:
siteId
- site identifierpaths
- list of paths to get sandbox itemspreferContent
- if true return content items if available- Returns:
- list of sandbox items
- Throws:
ServiceLayerException
UserNotFoundException
-
getSandboxItemsById
List<SandboxItem> getSandboxItemsById(String siteId, List<Long> ids, List<org.craftercms.commons.rest.parameters.SortField> sortFields, boolean preferContent) throws ServiceLayerException, UserNotFoundException Get sandbox items for given list of paths- Parameters:
siteId
- site identifierids
- list of ids to get sandbox itemssortFields
-preferContent
- if true return content items if available- Returns:
- list of sandbox items
- Throws:
ServiceLayerException
UserNotFoundException
-
isEditable
Check if item is editable- Parameters:
itemPath
- item pathitemMimeType
- item mime type- Returns:
- true if item is editable
-
itemLockByPath
Lock item by path for given site- Parameters:
siteId
- site identifierpath
- item path to lock
-
itemUnlockByPath
Unlock item by path for given site- Parameters:
siteId
- site identifierpath
- item path
-
getContentByCommitId
Optional<org.springframework.core.io.Resource> getContentByCommitId(String siteId, String path, String commitId) throws ContentNotFoundException Get content for commit id- Parameters:
siteId
- site identifierpath
- path of the contentcommitId
- commit id of the content version- Returns:
- the resource if available
- Throws:
ContentNotFoundException
-
getItemsByStates
List<DetailedItem> getItemsByStates(String siteId, long statesBitMap, List<String> systemTypes, List<org.craftercms.commons.rest.parameters.SortField> sortFields, int offset, int limit) throws UserNotFoundException, ServiceLayerException Get a list of items by state and system types.- Parameters:
siteId
- site identifierstatesBitMap
- mask of the states to filter bysystemTypes
- list of system types to filter bysortFields
- list of sort fieldsoffset
- number of items to skiplimit
- number of items to return- Returns:
- list of items
- Throws:
UserNotFoundException
ServiceLayerException
-
getContentVersionHistory
Get the version history for a given content item.- Parameters:
siteId
- the site idpath
- the content path- Returns:
- the list of versions
- Throws:
ServiceLayerException
- if an error occurs while create the list ofItemVersion
s
-