Class ContentServiceInternalImpl
java.lang.Object
org.craftercms.studio.impl.v2.service.content.internal.ContentServiceInternalImpl
- All Implemented Interfaces:
ContentServiceInternal
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancontentExists(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 idlonggetContentSize(String siteId, String path) Get content sizegetContentVersionHistory(String siteId, String path) Get the version history for a given content item.org.craftercms.core.service.ItemgetItemByPath(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, List<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> paths) Get subtree items for given paths.booleanisEditable(String itemPath, String mimeType) Check if item is editablevoiditemLockByPath(String siteId, String path) Lock item by path for given sitevoiditemUnlockByPath(String siteId, String path) Unlock item by path for given sitevoidsetAuditServiceInternal(AuditServiceInternal auditServiceInternal) voidsetContentRepository(ContentRepository contentRepository) voidsetItemDao(ItemDAO itemDao) voidsetSecurityService(SecurityService securityService) voidsetSemanticsAvailableActionsResolver(SemanticsAvailableActionsResolver semanticsAvailableActionsResolver) voidsetServicesConfig(ServicesConfig servicesConfig) voidsetSiteFeedMapper(SiteFeedMapper siteFeedMapper) voidsetStudioConfiguration(StudioConfiguration studioConfiguration) booleanshallowContentExists(String siteId, String path) This is a faster, but less accurate, version of contentExists.
-
Constructor Details
-
ContentServiceInternalImpl
public ContentServiceInternalImpl()
-
-
Method Details
-
contentExists
Description copied from interface:ContentServiceInternalCheck the existent of a content path- Specified by:
contentExistsin interfaceContentServiceInternal- Parameters:
siteId- site identifierpath- content path- Returns:
- true if the content exists, false otherwise
-
shallowContentExists
Description copied from interface:ContentServiceInternalThis 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.- Specified by:
shallowContentExistsin interfaceContentServiceInternal- Returns:
- true if site has content object at path
-
getSubtreeItems
Description copied from interface:ContentServiceInternalGet subtree items for given path.- Specified by:
getSubtreeItemsin interfaceContentServiceInternal- Parameters:
siteId- site identifierpath- path to get subtree items for- Returns:
- list of paths of subtree items
-
getSubtreeItems
Description copied from interface:ContentServiceInternalGet subtree items for given paths.- Specified by:
getSubtreeItemsin 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:ContentServiceInternalGet list of children for given path- Specified by:
getChildrenByPathin 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:
ServiceLayerExceptionUserNotFoundException
-
getChildrenByPaths
public GetChildrenByPathsBulkResult getChildrenByPaths(String siteId, List<String> paths, Map<String, GetChildrenBulkRequest.PathParams> pathParams) throws UserNotFoundException, ServiceLayerExceptionDescription copied from interface:ContentServiceInternalGet children for paths bulk. This method will return children for a list of paths. Result items will also include aSandboxItemobject for the item itself.- Specified by:
getChildrenByPathsin interfaceContentServiceInternal- 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:
UserNotFoundException- user not found (when calculating available actions)ServiceLayerException- general service error
-
getItem
- Specified by:
getItemin interfaceContentServiceInternal
-
getContentSize
Description copied from interface:ContentServiceInternalGet content size- Specified by:
getContentSizein interfaceContentServiceInternal- Parameters:
siteId- site identifierpath- content path- Returns:
- size in bytes
-
getItemsByStates
public 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 Description copied from interface:ContentServiceInternalGet a list of items by state and system types.- Specified by:
getItemsByStatesin interfaceContentServiceInternal- 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:
UserNotFoundExceptionServiceLayerException
-
getItemByPath
public DetailedItem getItemByPath(String siteId, String path, boolean preferContent) throws ServiceLayerException, UserNotFoundException Description copied from interface:ContentServiceInternalGet detailed for given path- Specified by:
getItemByPathin interfaceContentServiceInternal- Parameters:
siteId- site identifierpath- item for pathpreferContent- if true return content item if available- Returns:
- detailed item
- Throws:
ServiceLayerExceptionUserNotFoundException
-
getSandboxItemsByPath
public List<SandboxItem> getSandboxItemsByPath(String siteId, List<String> paths, boolean preferContent) throws ServiceLayerException, UserNotFoundException Description copied from interface:ContentServiceInternalGet sandbox items for given list of paths- Specified by:
getSandboxItemsByPathin 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:
ServiceLayerExceptionUserNotFoundException
-
getSandboxItemsById
public List<SandboxItem> getSandboxItemsById(String siteId, List<Long> ids, List<org.craftercms.commons.rest.parameters.SortField> sortFields, boolean preferContent) throws ServiceLayerException, UserNotFoundException Description copied from interface:ContentServiceInternalGet sandbox items for given list of paths- Specified by:
getSandboxItemsByIdin interfaceContentServiceInternal- 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:
ServiceLayerExceptionUserNotFoundException
-
isEditable
Description copied from interface:ContentServiceInternalCheck if item is editable- Specified by:
isEditablein interfaceContentServiceInternal- Parameters:
itemPath- item pathmimeType- item mime type- Returns:
- true if item is editable
-
itemLockByPath
Description copied from interface:ContentServiceInternalLock item by path for given site- Specified by:
itemLockByPathin interfaceContentServiceInternal- Parameters:
siteId- site identifierpath- item path to lock
-
itemUnlockByPath
Description copied from interface:ContentServiceInternalUnlock item by path for given site- Specified by:
itemUnlockByPathin 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:ContentServiceInternalGet content for commit id- Specified by:
getContentByCommitIdin interfaceContentServiceInternal- Parameters:
siteId- site identifierpath- path of the contentcommitId- commit id of the content version- Returns:
- the resource if available
- Throws:
ContentNotFoundException
-
getContentVersionHistory
public List<ItemVersion> getContentVersionHistory(String siteId, String path) throws ServiceLayerException Description copied from interface:ContentServiceInternalGet the version history for a given content item.- Specified by:
getContentVersionHistoryin interfaceContentServiceInternal- Parameters:
siteId- the site idpath- the content path- Returns:
- the list of versions
- Throws:
ServiceLayerException- if an error occurs while create the list ofItemVersions
-
setContentRepository
-
setItemDao
-
setServicesConfig
-
setSiteFeedMapper
-
setSecurityService
-
setStudioConfiguration
-
setSemanticsAvailableActionsResolver
public void setSemanticsAvailableActionsResolver(SemanticsAvailableActionsResolver semanticsAvailableActionsResolver) -
setAuditServiceInternal
-