Interface ContentService
-
- All Known Implementing Classes:
ContentServiceImpl
public interface ContentService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
deleteContent(String siteId, String path, String submissionComment)
Delete content for given path.boolean
deleteContent(String siteId, List<String> paths, String submissionComment)
Delete content for given paths.List<String>
getChildItems(String siteId, String path)
Get child items for given path.List<String>
getChildItems(String siteId, List<String> paths)
Get child items for given paths.GetChildrenResult
getChildrenById(String siteId, String id, String locale, String keyword, List<String> excludes, String sortStrategy, String order, int offset, int limit)
Get list of children for given item idGetChildrenResult
getChildrenByPath(String siteId, String path, String locale, String keyword, List<String> excludes, String sortStrategy, String order, int offset, int limit)
Get list of children for given pathInputStream
getContentByCommitId(String siteId, String path, String commitId)
Get content for commit idorg.craftercms.core.service.Item
getItem(String siteId, String path, boolean flatten)
DetailedItem
getItemById(String siteId, long id, boolean preferContent)
Get detailed item for given idDetailedItem
getItemByPath(String siteId, String path, boolean preferContent)
Get detailed item for given pathList<QuickCreateItem>
getQuickCreatableContentTypes(String siteId)
Get list of content types marked as quick creatable for given siteList<SandboxItem>
getSandboxItemsById(String siteId, List<Long> ids, boolean preferContent)
Get sandbox items for given list of idsList<SandboxItem>
getSandboxItemsByPath(String siteId, List<String> paths, boolean preferContent)
Get sandbox items for given list of pathsvoid
lockContent(String siteId, String path)
Lock item by path for given sitevoid
unlockContent(String siteId, String path)
Unlock item by path for given site
-
-
-
Method Detail
-
getQuickCreatableContentTypes
List<QuickCreateItem> getQuickCreatableContentTypes(String siteId)
Get list of content types marked as quick creatable for given site- Parameters:
siteId
- site id to use- Returns:
- list of content types
-
getChildItems
List<String> getChildItems(String siteId, String path)
Get child items for given path. Child item is - belongs to item subtree - is item specific dependency- Parameters:
siteId
- site identifierpath
- path to get child items for- Returns:
- list of paths of child items
-
getChildItems
List<String> getChildItems(String siteId, List<String> paths)
Get child items for given paths. Child item is - belongs to item subtree - is item specific dependency- Parameters:
siteId
- site identifierpaths
- list of paths to get child items for- Returns:
- list of paths of child items
-
deleteContent
boolean deleteContent(String siteId, String path, String submissionComment) throws ServiceLayerException, AuthenticationException, DeploymentException
Delete content for given path. Following content will be deleted: - given path - child items for given path- Parameters:
siteId
- site identifierpath
- content to be deletedsubmissionComment
- submission comment- Returns:
- true if success, otherwise false
- Throws:
ServiceLayerException
- general service errorAuthenticationException
- authentication errorDeploymentException
- deployment error caused by delete
-
deleteContent
boolean deleteContent(String siteId, List<String> paths, String submissionComment) throws ServiceLayerException, AuthenticationException, DeploymentException
Delete content for given paths. Following content will be deleted: - given paths - child items for given paths- Parameters:
siteId
- site identifierpaths
- content to be deletedsubmissionComment
- submission comment- Returns:
- true if success, otherwise false
- Throws:
ServiceLayerException
- general service errorAuthenticationException
- authentication errorDeploymentException
- deployment error caused by delete
-
getChildrenByPath
GetChildrenResult getChildrenByPath(String siteId, String path, String locale, String keyword, List<String> excludes, String sortStrategy, String order, int offset, int limit) throws ServiceLayerException, UserNotFoundException, ContentNotFoundException
Get list of children for given path- Parameters:
siteId
- site identifierpath
- item path to children forlocale
- filter children by localekeyword
- filter children by keywordexcludes
- exclude items by regular expression patternssortStrategy
- 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
ContentNotFoundException
-
getChildrenById
GetChildrenResult getChildrenById(String siteId, String id, String locale, String keyword, List<String> excludes, String sortStrategy, String order, int offset, int limit) throws ServiceLayerException, UserNotFoundException
Get list of children for given item id- Parameters:
siteId
- site identifierid
- item id to get children forlocale
- filter children by localekeyword
- filter children by keywordexcludes
- exclude items by regular expression patternssortStrategy
- 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
-
getItemByPath
DetailedItem getItemByPath(String siteId, String path, boolean preferContent) throws ServiceLayerException, UserNotFoundException
Get detailed item for given path- Parameters:
siteId
- site identifierpath
- item pathpreferContent
- if true return content item if available- Returns:
- detailed item
- Throws:
ServiceLayerException
UserNotFoundException
-
getItemById
DetailedItem getItemById(String siteId, long id, boolean preferContent) throws ServiceLayerException, UserNotFoundException
Get detailed item for given id- Parameters:
siteId
- site identifierid
- item idpreferContent
- if true return content item if available- Returns:
- detailed item
- Throws:
ServiceLayerException
UserNotFoundException
-
getSandboxItemsByPath
List<SandboxItem> getSandboxItemsByPath(String siteId, List<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, boolean preferContent) throws ServiceLayerException, UserNotFoundException
Get sandbox items for given list of ids- Parameters:
siteId
- site identifierids
- list of ids to get sandbox itemspreferContent
- if true return content items if available- Returns:
- list of sandbox items
- Throws:
ServiceLayerException
UserNotFoundException
-
lockContent
void lockContent(String siteId, String path) throws UserNotFoundException, ServiceLayerException
Lock item by path for given site- Parameters:
siteId
- site identifierpath
- path to lock- Throws:
UserNotFoundException
ServiceLayerException
-
unlockContent
void unlockContent(String siteId, String path) throws ContentNotFoundException, ContentAlreadyUnlockedException
Unlock item by path for given site- Parameters:
siteId
- site identifierpath
- item path- Throws:
ContentNotFoundException
ContentAlreadyUnlockedException
-
getContentByCommitId
InputStream getContentByCommitId(String siteId, String path, String commitId) throws ContentNotFoundException, IOException
Get content for commit id- Parameters:
siteId
- site identifierpath
- path of the contentcommitId
- commit id of the content version- Returns:
- Throws:
ContentNotFoundException
IOException
-
-