Class ContentTypeServiceImpl
- java.lang.Object
-
- org.craftercms.studio.impl.v1.service.content.ContentTypeServiceImpl
-
- All Implemented Interfaces:
ContentTypeService
public class ContentTypeServiceImpl extends Object implements ContentTypeService
- Author:
- Dejan Brkic
-
-
Field Summary
Fields Modifier and Type Field Description protected ContentRepository
contentRepository
protected ContentService
contentService
protected ContentTypesConfig
contentTypesConfig
protected SecurityService
securityService
protected ServicesConfig
servicesConfig
protected StudioConfiguration
studioConfiguration
-
Constructor Summary
Constructors Constructor Description ContentTypeServiceImpl()
-
Method Summary
-
-
-
Field Detail
-
contentService
protected ContentService contentService
-
servicesConfig
protected ServicesConfig servicesConfig
-
contentTypesConfig
protected ContentTypesConfig contentTypesConfig
-
securityService
protected SecurityService securityService
-
contentRepository
protected ContentRepository contentRepository
-
studioConfiguration
protected StudioConfiguration studioConfiguration
-
-
Method Detail
-
getContentTypeForContent
public ContentTypeConfigTO getContentTypeForContent(String site, String path) throws ServiceLayerException
Description copied from interface:ContentTypeService
get a content type by the given site and the content path- Specified by:
getContentTypeForContent
in interfaceContentTypeService
- Parameters:
site
- site identifierpath
- path of the content- Returns:
- content type
- Throws:
ServiceLayerException
- general service error
-
isUserAllowed
public boolean isUserAllowed(Set<String> userRoles, ContentTypeConfigTO item)
Description copied from interface:ContentTypeService
check if the user is allowed to access the content type with the given user roles- Specified by:
isUserAllowed
in interfaceContentTypeService
- Parameters:
userRoles
- user rolesitem
- content type- Returns:
- true if user has permissions to access the content type
-
getContentTypeByRelativePath
public ContentTypeConfigTO getContentTypeByRelativePath(String site, String relativePath) throws ServiceLayerException
- Specified by:
getContentTypeByRelativePath
in interfaceContentTypeService
- Throws:
ServiceLayerException
-
getContentType
public ContentTypeConfigTO getContentType(String site, String type)
Description copied from interface:ContentTypeService
get a content type by the given site and type name- Specified by:
getContentType
in interfaceContentTypeService
- Parameters:
site
- site identifiertype
- content type name- Returns:
- content type
-
getAllContentTypes
public List<ContentTypeConfigTO> getAllContentTypes(String site, boolean searchable)
- Specified by:
getAllContentTypes
in interfaceContentTypeService
-
getAllowedContentTypesForPath
public List<ContentTypeConfigTO> getAllowedContentTypesForPath(String site, String relativePath)
- Specified by:
getAllowedContentTypesForPath
in interfaceContentTypeService
-
addContentTypes
protected void addContentTypes(String site, Set<String> userRoles, ContentTypeConfigTO config, List<ContentTypeConfigTO> contentTypes)
-
changeContentType
public boolean changeContentType(String site, String path, String contentType) throws ServiceLayerException, UserNotFoundException
- Specified by:
changeContentType
in interfaceContentTypeService
- Throws:
ServiceLayerException
UserNotFoundException
-
getAllContentTypes
protected List<ContentTypeConfigTO> getAllContentTypes(String site)
-
reloadContentTypeConfigForChildren
protected void reloadContentTypeConfigForChildren(String site, RepositoryItem node, List<ContentTypeConfigTO> contentTypes)
-
getConfigPath
public String getConfigPath()
- Specified by:
getConfigPath
in interfaceContentTypeService
-
getConfigFileName
public String getConfigFileName()
-
getContentService
public ContentService getContentService()
-
setContentService
public void setContentService(ContentService contentService)
-
getServicesConfig
public ServicesConfig getServicesConfig()
-
setServicesConfig
public void setServicesConfig(ServicesConfig servicesConfig)
-
getContentTypesConfig
public ContentTypesConfig getContentTypesConfig()
-
setContentTypesConfig
public void setContentTypesConfig(ContentTypesConfig contentTypesConfig)
-
getSecurityService
public SecurityService getSecurityService()
-
setSecurityService
public void setSecurityService(SecurityService securityService)
-
getContentRepository
public ContentRepository getContentRepository()
-
setContentRepository
public void setContentRepository(ContentRepository contentRepository)
-
getStudioConfiguration
public StudioConfiguration getStudioConfiguration()
-
setStudioConfiguration
public void setStudioConfiguration(StudioConfiguration studioConfiguration)
-
-