Class ContentServiceInternalImpl
- java.lang.Object
-
- org.craftercms.studio.impl.v2.service.content.internal.ContentServiceInternalImpl
-
- All Implemented Interfaces:
ContentServiceInternal
public class ContentServiceInternalImpl extends Object implements ContentServiceInternal
-
-
Constructor Summary
Constructors Constructor Description ContentServiceInternalImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GetChildrenResult
getChildrenByPath(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 pathOptional<org.springframework.core.io.Resource>
getContentByCommitId(String siteId, String path, String commitId)
Get content for commit idlong
getContentSize(String siteId, String path)
Get content sizeorg.craftercms.core.service.Item
getItem(String siteId, String path, boolean flatten)
DetailedItem
getItemByPath(String siteId, String path, boolean preferContent)
Get detailed for given pathList<SandboxItem>
getSandboxItemsById(String siteId, List<Long> ids, boolean preferContent)
Get sandbox items for given list of pathsList<SandboxItem>
getSandboxItemsByPath(String siteId, List<String> paths, boolean preferContent)
Get sandbox items for given list of pathsList<String>
getSubtreeItems(String siteId, String path)
Get subtree items for given path.List<String>
getSubtreeItems(String siteId, List<String> paths)
Get subtree items for given paths.boolean
isEditable(String itemPath, String mimeType)
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 sitevoid
setContentRepository(ContentRepository contentRepository)
void
setItemDao(ItemDAO itemDao)
void
setSecurityService(SecurityService securityService)
void
setSemanticsAvailableActionsResolver(SemanticsAvailableActionsResolver semanticsAvailableActionsResolver)
void
setServicesConfig(ServicesConfig servicesConfig)
void
setSiteFeedMapper(SiteFeedMapper siteFeedMapper)
void
setStudioConfiguration(StudioConfiguration studioConfiguration)
-
-
-
Method Detail
-
getSubtreeItems
public List<String> getSubtreeItems(String siteId, String path)
Description copied from interface:ContentServiceInternal
Get subtree items for given path.- Specified by:
getSubtreeItems
in interfaceContentServiceInternal
- Parameters:
siteId
- site identifierpath
- path to get subtree items for- Returns:
- list of paths of subtree items
-
getSubtreeItems
public List<String> getSubtreeItems(String siteId, List<String> paths)
Description copied from interface:ContentServiceInternal
Get subtree items for given paths.- Specified by:
getSubtreeItems
in interfaceContentServiceInternal
- Parameters:
siteId
- site identifierpaths
- list of paths to get subtree items for- Returns:
- list of paths of subtree items
-
getChildrenByPath
public 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
Description copied from interface:ContentServiceInternal
Get list of children for given path- Specified by:
getChildrenByPath
in interfaceContentServiceInternal
- 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
-
getItem
public org.craftercms.core.service.Item getItem(String siteId, String path, boolean flatten)
- Specified by:
getItem
in interfaceContentServiceInternal
-
getContentSize
public long getContentSize(String siteId, String path)
Description copied from interface:ContentServiceInternal
Get content size- Specified by:
getContentSize
in interfaceContentServiceInternal
- Parameters:
siteId
- site identifierpath
- content path- Returns:
- size in bytes
-
getItemByPath
public DetailedItem getItemByPath(String siteId, String path, boolean preferContent) throws ServiceLayerException, UserNotFoundException
Description copied from interface:ContentServiceInternal
Get detailed for given path- Specified by:
getItemByPath
in interfaceContentServiceInternal
- Parameters:
siteId
- site identifierpath
- item for pathpreferContent
- 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:ContentServiceInternal
Get sandbox items for given list of paths- Specified by:
getSandboxItemsByPath
in interfaceContentServiceInternal
- 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:ContentServiceInternal
Get sandbox items for given list of paths- Specified by:
getSandboxItemsById
in interfaceContentServiceInternal
- 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
-
isEditable
public boolean isEditable(String itemPath, String mimeType)
Description copied from interface:ContentServiceInternal
Check if item is editable- Specified by:
isEditable
in interfaceContentServiceInternal
- Parameters:
itemPath
- item pathmimeType
- item mime type- Returns:
- true if item is editable
-
itemLockByPath
public void itemLockByPath(String siteId, String path)
Description copied from interface:ContentServiceInternal
Lock item by path for given site- Specified by:
itemLockByPath
in interfaceContentServiceInternal
- Parameters:
siteId
- site identifierpath
- item path to lock
-
itemUnlockByPath
public void itemUnlockByPath(String siteId, String path)
Description copied from interface:ContentServiceInternal
Unlock item by path for given site- Specified by:
itemUnlockByPath
in interfaceContentServiceInternal
- Parameters:
siteId
- site identifierpath
- item path
-
getContentByCommitId
public Optional<org.springframework.core.io.Resource> getContentByCommitId(String siteId, String path, String commitId) throws ContentNotFoundException
Description copied from interface:ContentServiceInternal
Get content for commit id- Specified by:
getContentByCommitId
in interfaceContentServiceInternal
- Parameters:
siteId
- site identifierpath
- path of the contentcommitId
- commit id of the content version- Returns:
- the resource if available
- Throws:
ContentNotFoundException
-
setContentRepository
public void setContentRepository(ContentRepository contentRepository)
-
setItemDao
public void setItemDao(ItemDAO itemDao)
-
setServicesConfig
public void setServicesConfig(ServicesConfig servicesConfig)
-
setSiteFeedMapper
public void setSiteFeedMapper(SiteFeedMapper siteFeedMapper)
-
setSecurityService
public void setSecurityService(SecurityService securityService)
-
setStudioConfiguration
public void setStudioConfiguration(StudioConfiguration studioConfiguration)
-
setSemanticsAvailableActionsResolver
public void setSemanticsAvailableActionsResolver(SemanticsAvailableActionsResolver semanticsAvailableActionsResolver)
-
-