Class ContentTypeServiceImpl
- java.lang.Object
-
- org.craftercms.studio.impl.v2.service.content.ContentTypeServiceImpl
-
- All Implemented Interfaces:
ContentTypeService
public class ContentTypeServiceImpl extends Object implements ContentTypeService
Default implementation forContentTypeService
- Since:
- 4.0
- Author:
- joseross
-
-
Field Summary
Fields Modifier and Type Field Description protected ContentTypeServiceInternal
contentTypeServiceInternal
-
Constructor Summary
Constructors Constructor Description ContentTypeServiceImpl(ContentTypeServiceInternal contentTypeServiceInternal)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
deleteContentType(String siteId, String contentType, boolean deleteDependencies)
Deletes all files related to a given content-typeorg.apache.commons.lang3.tuple.ImmutablePair<String,org.springframework.core.io.Resource>
getContentTypePreviewImage(String siteId, String contentTypeId)
Finds the preview image for a given content-typeContentTypeUsage
getContentTypeUsage(String siteId, String contentType)
Finds all items related to a given content-type
-
-
-
Field Detail
-
contentTypeServiceInternal
protected final ContentTypeServiceInternal contentTypeServiceInternal
-
-
Constructor Detail
-
ContentTypeServiceImpl
@ConstructorProperties("contentTypeServiceInternal") public ContentTypeServiceImpl(ContentTypeServiceInternal contentTypeServiceInternal)
-
-
Method Detail
-
getContentTypeUsage
public ContentTypeUsage getContentTypeUsage(String siteId, String contentType) throws ServiceLayerException
Finds all items related to a given content-type- Specified by:
getContentTypeUsage
in 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:
getContentTypePreviewImage
in 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:
deleteContentType
in 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
-
-