Class ContentTypeServiceImpl
java.lang.Object
org.craftercms.studio.impl.v1.service.content.ContentTypeServiceImpl
- All Implemented Interfaces:
ContentTypeService
- Author:
- Dejan Brkic
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ContentRepositoryprotected ContentServiceprotected ContentTypesConfigprotected SecurityServiceprotected ServicesConfigprotected StudioConfiguration -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddContentTypes(String site, Set<String> userRoles, ContentTypeConfigTO config, List<ContentTypeConfigTO> contentTypes) @javax.validation.Valid booleanchangeContentType(String site, String path, String contentType) @Valid List<ContentTypeConfigTO> getAllContentTypes(String site, boolean searchable) protected List<ContentTypeConfigTO> getAllContentTypes(String site) @Valid List<ContentTypeConfigTO> getAllowedContentTypesForPath(String site, String relativePath) @Valid ContentTypeConfigTOgetContentType(String site, String type) get a content type by the given site and type name@Valid ContentTypeConfigTOgetContentTypeByRelativePath(String site, String relativePath) @Valid ContentTypeConfigTOgetContentTypeForContent(String site, String path) get a content type by the given site and the content pathbooleanisUserAllowed(Set<String> userRoles, ContentTypeConfigTO item) check if the user is allowed to access the content type with the given user rolesprotected voidreloadContentTypeConfigForChildren(String site, RepositoryItem node, List<ContentTypeConfigTO> contentTypes) voidsetContentRepository(ContentRepository contentRepository) voidsetContentService(ContentService contentService) voidsetContentTypesConfig(ContentTypesConfig contentTypesConfig) voidsetSecurityService(SecurityService securityService) voidsetServicesConfig(ServicesConfig servicesConfig) voidsetStudioConfiguration(StudioConfiguration studioConfiguration)
-
Field Details
-
contentService
-
servicesConfig
-
contentTypesConfig
-
securityService
-
contentRepository
-
studioConfiguration
-
-
Constructor Details
-
ContentTypeServiceImpl
public ContentTypeServiceImpl()
-
-
Method Details
-
getContentTypeForContent
@Valid public @Valid ContentTypeConfigTO getContentTypeForContent(String site, String path) throws ServiceLayerException Description copied from interface:ContentTypeServiceget a content type by the given site and the content path- Specified by:
getContentTypeForContentin interfaceContentTypeService- Parameters:
site- site identifierpath- path of the content- Returns:
- content type
- Throws:
ServiceLayerException- general service error
-
isUserAllowed
Description copied from interface:ContentTypeServicecheck if the user is allowed to access the content type with the given user roles- Specified by:
isUserAllowedin interfaceContentTypeService- Parameters:
userRoles- user rolesitem- content type- Returns:
- true if user has permissions to access the content type
-
getContentTypeByRelativePath
@Valid public @Valid ContentTypeConfigTO getContentTypeByRelativePath(String site, String relativePath) throws ServiceLayerException - Specified by:
getContentTypeByRelativePathin interfaceContentTypeService- Throws:
ServiceLayerException
-
getContentType
Description copied from interface:ContentTypeServiceget a content type by the given site and type name- Specified by:
getContentTypein interfaceContentTypeService- Parameters:
site- site identifiertype- content type name- Returns:
- content type
-
getAllContentTypes
- Specified by:
getAllContentTypesin interfaceContentTypeService
-
getAllowedContentTypesForPath
@Valid public @Valid List<ContentTypeConfigTO> getAllowedContentTypesForPath(String site, String relativePath) - Specified by:
getAllowedContentTypesForPathin interfaceContentTypeService
-
addContentTypes
protected void addContentTypes(String site, Set<String> userRoles, ContentTypeConfigTO config, List<ContentTypeConfigTO> contentTypes) -
changeContentType
@Valid public @javax.validation.Valid boolean changeContentType(String site, String path, String contentType) throws ServiceLayerException, UserNotFoundException - Specified by:
changeContentTypein interfaceContentTypeService- Throws:
ServiceLayerExceptionUserNotFoundException
-
getAllContentTypes
-
reloadContentTypeConfigForChildren
protected void reloadContentTypeConfigForChildren(String site, RepositoryItem node, List<ContentTypeConfigTO> contentTypes) -
getConfigPath
- Specified by:
getConfigPathin interfaceContentTypeService
-
getConfigFileName
-
getContentService
-
setContentService
-
getServicesConfig
-
setServicesConfig
-
getContentTypesConfig
-
setContentTypesConfig
-
getSecurityService
-
setSecurityService
-
getContentRepository
-
setContentRepository
-
getStudioConfiguration
-
setStudioConfiguration
-