Class ContentServiceImpl
- java.lang.Object
-
- org.craftercms.studio.impl.v2.service.content.ContentServiceImpl
-
- All Implemented Interfaces:
ContentService
public class ContentServiceImpl extends Object implements ContentService
-
-
Constructor Summary
Constructors Constructor Description ContentServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete 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.AuditServiceInternal
getAuditServiceInternal()
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 idContentServiceInternal
getContentServiceInternal()
ContentTypeServiceInternal
getContentTypeServiceInternal()
DependencyServiceInternal
getDependencyServiceInternal()
DeploymentService
getDeploymentService()
GeneralLockService
getGeneralLockService()
org.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 pathItemServiceInternal
getItemServiceInternal()
List<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 pathsSecurityService
getSecurityService()
SiteService
getSiteService()
UserService
getUserService()
void
lockContent(String siteId, String path)
Lock item by path for given sitevoid
setAuditServiceInternal(AuditServiceInternal auditServiceInternal)
void
setContentServiceInternal(ContentServiceInternal contentServiceInternal)
void
setContentTypeServiceInternal(ContentTypeServiceInternal contentTypeServiceInternal)
void
setDependencyServiceInternal(DependencyServiceInternal dependencyServiceInternal)
void
setDeploymentService(DeploymentService deploymentService)
void
setGeneralLockService(GeneralLockService generalLockService)
void
setItemServiceInternal(ItemServiceInternal itemServiceInternal)
void
setSecurityService(SecurityService securityService)
void
setSiteService(SiteService siteService)
void
setUserService(UserService userService)
void
unlockContent(String siteId, String path)
Unlock item by path for given site
-
-
-
Method Detail
-
getQuickCreatableContentTypes
public List<QuickCreateItem> getQuickCreatableContentTypes(String siteId)
Description copied from interface:ContentService
Get list of content types marked as quick creatable for given site- Specified by:
getQuickCreatableContentTypes
in interfaceContentService
- Parameters:
siteId
- site id to use- Returns:
- list of content types
-
getChildItems
public List<String> getChildItems(String siteId, String path)
Description copied from interface:ContentService
Get child items for given path. Child item is - belongs to item subtree - is item specific dependency- Specified by:
getChildItems
in interfaceContentService
- Parameters:
siteId
- site identifierpath
- path to get child items for- Returns:
- list of paths of child items
-
getChildItems
public List<String> getChildItems(String siteId, List<String> paths)
Description copied from interface:ContentService
Get child items for given paths. Child item is - belongs to item subtree - is item specific dependency- Specified by:
getChildItems
in interfaceContentService
- Parameters:
siteId
- site identifierpaths
- list of paths to get child items for- Returns:
- list of paths of child items
-
deleteContent
public boolean deleteContent(String siteId, String path, String submissionComment) throws ServiceLayerException, AuthenticationException, DeploymentException
Description copied from interface:ContentService
Delete content for given path. Following content will be deleted: - given path - child items for given path- Specified by:
deleteContent
in interfaceContentService
- 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
public boolean deleteContent(String siteId, List<String> paths, String submissionComment) throws ServiceLayerException, AuthenticationException, DeploymentException
Description copied from interface:ContentService
Delete content for given paths. Following content will be deleted: - given paths - child items for given paths- Specified by:
deleteContent
in interfaceContentService
- 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
public 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
Description copied from interface:ContentService
Get list of children for given path- Specified by:
getChildrenByPath
in interfaceContentService
- 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
public GetChildrenResult getChildrenById(String siteId, String id, String locale, String keyword, List<String> excludes, String sortStrategy, String order, int offset, int limit) throws ServiceLayerException, UserNotFoundException
Description copied from interface:ContentService
Get list of children for given item id- Specified by:
getChildrenById
in interfaceContentService
- 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
-
getItem
public org.craftercms.core.service.Item getItem(String siteId, String path, boolean flatten)
- Specified by:
getItem
in interfaceContentService
-
getItemByPath
public DetailedItem getItemByPath(String siteId, String path, boolean preferContent) throws ServiceLayerException, UserNotFoundException
Description copied from interface:ContentService
Get detailed item for given path- Specified by:
getItemByPath
in interfaceContentService
- Parameters:
siteId
- site identifierpath
- item pathpreferContent
- if true return content item if available- Returns:
- detailed item
- Throws:
ServiceLayerException
UserNotFoundException
-
getItemById
public DetailedItem getItemById(String siteId, long id, boolean preferContent) throws ServiceLayerException, UserNotFoundException
Description copied from interface:ContentService
Get detailed item for given id- Specified by:
getItemById
in interfaceContentService
- Parameters:
siteId
- site identifierid
- item idpreferContent
- if true return content item if available- Returns:
- detailed item
- Throws:
ServiceLayerException
UserNotFoundException
-
getSandboxItemsByPath
public List<SandboxItem> getSandboxItemsByPath(String siteId, List<String> paths, boolean preferContent) throws ServiceLayerException, UserNotFoundException
Description copied from interface:ContentService
Get sandbox items for given list of paths- Specified by:
getSandboxItemsByPath
in interfaceContentService
- 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
public List<SandboxItem> getSandboxItemsById(String siteId, List<Long> ids, boolean preferContent) throws ServiceLayerException, UserNotFoundException
Description copied from interface:ContentService
Get sandbox items for given list of ids- Specified by:
getSandboxItemsById
in interfaceContentService
- 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
public void lockContent(String siteId, String path) throws UserNotFoundException, ServiceLayerException
Description copied from interface:ContentService
Lock item by path for given site- Specified by:
lockContent
in interfaceContentService
- Parameters:
siteId
- site identifierpath
- path to lock- Throws:
UserNotFoundException
ServiceLayerException
-
unlockContent
public void unlockContent(String siteId, String path) throws ContentNotFoundException, ContentAlreadyUnlockedException
Description copied from interface:ContentService
Unlock item by path for given site- Specified by:
unlockContent
in interfaceContentService
- Parameters:
siteId
- site identifierpath
- item path- Throws:
ContentNotFoundException
ContentAlreadyUnlockedException
-
getContentByCommitId
public InputStream getContentByCommitId(String siteId, String path, String commitId) throws ContentNotFoundException, IOException
Description copied from interface:ContentService
Get content for commit id- Specified by:
getContentByCommitId
in interfaceContentService
- Parameters:
siteId
- site identifierpath
- path of the contentcommitId
- commit id of the content version- Returns:
- Throws:
ContentNotFoundException
IOException
-
getContentServiceInternal
public ContentServiceInternal getContentServiceInternal()
-
setContentServiceInternal
public void setContentServiceInternal(ContentServiceInternal contentServiceInternal)
-
getContentTypeServiceInternal
public ContentTypeServiceInternal getContentTypeServiceInternal()
-
setContentTypeServiceInternal
public void setContentTypeServiceInternal(ContentTypeServiceInternal contentTypeServiceInternal)
-
getDependencyServiceInternal
public DependencyServiceInternal getDependencyServiceInternal()
-
setDependencyServiceInternal
public void setDependencyServiceInternal(DependencyServiceInternal dependencyServiceInternal)
-
getDeploymentService
public DeploymentService getDeploymentService()
-
setDeploymentService
public void setDeploymentService(DeploymentService deploymentService)
-
getUserService
public UserService getUserService()
-
setUserService
public void setUserService(UserService userService)
-
getSiteService
public SiteService getSiteService()
-
setSiteService
public void setSiteService(SiteService siteService)
-
getAuditServiceInternal
public AuditServiceInternal getAuditServiceInternal()
-
setAuditServiceInternal
public void setAuditServiceInternal(AuditServiceInternal auditServiceInternal)
-
getItemServiceInternal
public ItemServiceInternal getItemServiceInternal()
-
setItemServiceInternal
public void setItemServiceInternal(ItemServiceInternal itemServiceInternal)
-
getSecurityService
public SecurityService getSecurityService()
-
setSecurityService
public void setSecurityService(SecurityService securityService)
-
getGeneralLockService
public GeneralLockService getGeneralLockService()
-
setGeneralLockService
public void setGeneralLockService(GeneralLockService generalLockService)
-
-