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
getChildrenById(String siteId, String parentId, String locale, String keyword, List<String> excludes, String sortStrategy, String order, int offset, int limit)
Get list of children for given item idint
getChildrenByIdTotal(String siteId, String parentId, String ldName, String locale, String keyword, List<String> excludes)
Get total number of children for given pathGetChildrenResult
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 pathint
getChildrenByPathTotal(String siteId, String path, String locale, String keyword, List<String> excludes)
Get total number of children for given pathInputStream
getContentByCommitId(String siteId, String path, String commitId)
Get content for commit idContentRepository
getContentRepository()
long
getContentSize(String siteId, String path)
Get content sizeorg.craftercms.core.service.Item
getItem(String siteId, String path, boolean flatten)
DetailedItem
getItemById(String siteId, long id, boolean preferContent)
Get detailed for given idDetailedItem
getItemByPath(String siteId, String path, boolean preferContent)
Get detailed for given pathItemDAO
getItemDao()
List<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 pathsSecurityService
getSecurityService()
SecurityService
getSecurityServiceV2()
SemanticsAvailableActionsResolver
getSemanticsAvailableActionsResolver()
ServicesConfig
getServicesConfig()
SiteFeedMapper
getSiteFeedMapper()
StudioConfiguration
getStudioConfiguration()
List<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(Item item)
Check if item is editableboolean
isEditable(DetailedItem detailedItem)
Check if item is editablevoid
itemLockById(String siteId, Long itemId)
Lock item by id for given sitevoid
itemLockByPath(String siteId, String path)
Lock item by path for given sitevoid
itemUnlockById(String siteId, long itemId)
Unlock 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
setSecurityServiceV2(SecurityService securityServiceV2)
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> excludes, String sortStrategy, String order, int offset, int limit) throws ServiceLayerException, UserNotFoundException, ContentNotFoundException
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 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
-
getChildrenByPathTotal
public int getChildrenByPathTotal(String siteId, String path, String locale, String keyword, List<String> excludes)
Description copied from interface:ContentServiceInternal
Get total number of children for given path- Specified by:
getChildrenByPathTotal
in interfaceContentServiceInternal
- Parameters:
siteId
- site identifierpath
- item path to children forlocale
- filter children by localekeyword
- filter children by keywordexcludes
- exclude items by regular expression patterns- Returns:
- total number of children
-
getChildrenById
public GetChildrenResult getChildrenById(String siteId, String parentId, String locale, String keyword, 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 item id- Specified by:
getChildrenById
in interfaceContentServiceInternal
- Parameters:
siteId
- site identifierparentId
- 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
-
getChildrenByIdTotal
public int getChildrenByIdTotal(String siteId, String parentId, String ldName, String locale, String keyword, List<String> excludes)
Description copied from interface:ContentServiceInternal
Get total number of children for given path- Specified by:
getChildrenByIdTotal
in interfaceContentServiceInternal
- Parameters:
siteId
- site identifierparentId
- item id to children forldName
- level descriptor namelocale
- filter children by localekeyword
- filter children by keywordexcludes
- exclude items by regular expression patterns- Returns:
- total number of children
-
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
-
getItemById
public DetailedItem getItemById(String siteId, long id, boolean preferContent) throws ServiceLayerException, UserNotFoundException
Description copied from interface:ContentServiceInternal
Get detailed for given id- Specified by:
getItemById
in interfaceContentServiceInternal
- 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: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(Item item)
Description copied from interface:ContentServiceInternal
Check if item is editable- Specified by:
isEditable
in interfaceContentServiceInternal
- Parameters:
item
- item object- Returns:
- true if item is editable
-
isEditable
public boolean isEditable(DetailedItem detailedItem)
Description copied from interface:ContentServiceInternal
Check if item is editable- Specified by:
isEditable
in interfaceContentServiceInternal
- Parameters:
detailedItem
- item object- 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
-
itemLockById
public void itemLockById(String siteId, Long itemId)
Description copied from interface:ContentServiceInternal
Lock item by id for given site- Specified by:
itemLockById
in interfaceContentServiceInternal
- Parameters:
siteId
- site identifieritemId
- item identifier 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
-
itemUnlockById
public void itemUnlockById(String siteId, long itemId)
Description copied from interface:ContentServiceInternal
Unlock item by path for given site- Specified by:
itemUnlockById
in interfaceContentServiceInternal
- Parameters:
siteId
- site identifieritemId
- item identifier
-
getContentByCommitId
public InputStream getContentByCommitId(String siteId, String path, String commitId) throws ContentNotFoundException, IOException
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:
- Throws:
ContentNotFoundException
IOException
-
getContentRepository
public ContentRepository getContentRepository()
-
setContentRepository
public void setContentRepository(ContentRepository contentRepository)
-
getItemDao
public ItemDAO getItemDao()
-
setItemDao
public void setItemDao(ItemDAO itemDao)
-
getServicesConfig
public ServicesConfig getServicesConfig()
-
setServicesConfig
public void setServicesConfig(ServicesConfig servicesConfig)
-
getSiteFeedMapper
public SiteFeedMapper getSiteFeedMapper()
-
setSiteFeedMapper
public void setSiteFeedMapper(SiteFeedMapper siteFeedMapper)
-
getSecurityService
public SecurityService getSecurityService()
-
setSecurityService
public void setSecurityService(SecurityService securityService)
-
getStudioConfiguration
public StudioConfiguration getStudioConfiguration()
-
setStudioConfiguration
public void setStudioConfiguration(StudioConfiguration studioConfiguration)
-
getSecurityServiceV2
public SecurityService getSecurityServiceV2()
-
setSecurityServiceV2
public void setSecurityServiceV2(SecurityService securityServiceV2)
-
getSemanticsAvailableActionsResolver
public SemanticsAvailableActionsResolver getSemanticsAvailableActionsResolver()
-
setSemanticsAvailableActionsResolver
public void setSemanticsAvailableActionsResolver(SemanticsAvailableActionsResolver semanticsAvailableActionsResolver)
-
-