Class ContentTypeServiceImpl
java.lang.Object
org.craftercms.studio.impl.v2.service.content.ContentTypeServiceImpl
- All Implemented Interfaces:
ContentTypeService
Default implementation for
ContentTypeService- Since:
- 4.0
- Author:
- joseross
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionContentTypeServiceImpl(ContentTypeServiceInternal contentTypeServiceInternal) -
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteContentType(String siteId, String contentType, boolean deleteDependencies) Deletes all files related to a given content-typegetAllModelDefinitions(String site) Get all content types for the given site.org.apache.commons.lang3.tuple.ImmutablePair<String, org.springframework.core.io.Resource> getContentTypePreviewImage(String siteId, String contentTypeId) Finds the preview image for a given content-typegetContentTypeUsage(String siteId, String contentType) Finds all items related to a given content-type
-
Field Details
-
contentTypeServiceInternal
-
-
Constructor Details
-
ContentTypeServiceImpl
@ConstructorProperties("contentTypeServiceInternal") public ContentTypeServiceImpl(ContentTypeServiceInternal contentTypeServiceInternal)
-
-
Method Details
-
getContentTypeUsage
public ContentTypeUsage getContentTypeUsage(String siteId, String contentType) throws ServiceLayerException Finds all items related to a given content-type- Specified by:
getContentTypeUsagein interfaceContentTypeService- Parameters:
siteId- the id of the sitecontentType- the id of the content-type- Returns:
- the usage
- Throws:
ServiceLayerException- if there is any error finding the items
-
getContentTypePreviewImage
public org.apache.commons.lang3.tuple.ImmutablePair<String,org.springframework.core.io.Resource> getContentTypePreviewImage(String siteId, String contentTypeId) throws ServiceLayerException Finds the preview image for a given content-type- Specified by:
getContentTypePreviewImagein interfaceContentTypeService- Parameters:
siteId- the id of the sitecontentTypeId- the id of the content-type- Returns:
- the preview image file as a pair of path and resource
- Throws:
ServiceLayerException- if there is any error finding the items
-
deleteContentType
public void deleteContentType(String siteId, String contentType, boolean deleteDependencies) throws ServiceLayerException, AuthenticationException, DeploymentException, UserNotFoundException Deletes all files related to a given content-type- Specified by:
deleteContentTypein interfaceContentTypeService- Parameters:
siteId- the id of the sitecontentType- the id of the content-typedeleteDependencies- indicates if all dependencies should be deleted- Throws:
ServiceLayerException- if there is any error deleting the filesAuthenticationException- if there is any error authenticating the userDeploymentException- if there is any error publishing the changesUserNotFoundException
-
getAllModelDefinitions
Description copied from interface:ContentTypeServiceGet all content types for the given site.- Specified by:
getAllModelDefinitionsin interfaceContentTypeService- Parameters:
site- the id of the site- Returns:
- a collection of content types including their config files (config.xml, form-definition.xml)
- Throws:
ServiceLayerException- if there is any error getting the content types
-