Class ServicesConfigImpl
- java.lang.Object
-
- org.craftercms.studio.impl.v1.service.configuration.ServicesConfigImpl
-
- All Implemented Interfaces:
ServicesConfig
public class ServicesConfigImpl extends Object implements ServicesConfig
Implementation of ServicesConfigImpl. This class requires a configuration file in the repository
-
-
Field Summary
-
Constructor Summary
Constructors Constructor Description ServicesConfigImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getAdminEmailAddress(String siteId)
Get configured admin email address for notification emails for given siteList<String>
getAssetPatterns(String site)
get asset item URI patternsString
getAuthoringUrl(String siteId)
Get configured authoring url for given siteList<String>
getComponentPatterns(String site)
get component item URI patternsString
getConfigFileName()
ConfigurationService
getConfigurationService()
ContentRepository
getContentRepository()
ContentTypeConfigTO
getContentTypeConfig(String site, String name)
get DM content type configuration by the given site and nameContentTypesConfig
getContentTypesConfig()
List<CopyDependencyConfigTO>
getCopyDependencyPatterns(String site, String contentType)
get the copy dependencies pattern for a content typeString
getDefaultTimezone(String site)
get the default timezone valueList<DeleteDependencyConfigTO>
getDeleteDependencyPatterns(String site, String contentType)
get the delete dependencies related to a content typeList<String>
getDisplayInWidgetPathPatterns(String site)
get a list of paths to display in widgetsList<String>
getDocumentPatterns(String site)
get document item URI patternsMap<String,FacetTO>
getFacets(String site)
Returns the search facets configuration for the given siteList<DmFolderConfigTO>
getFolders(String site)
get a list of folder configuration.GeneralLockService
getGeneralLockService()
String
getLevelDescriptorName(String site)
get the name of level descriptorList<String>
getLevelDescriptorPatterns(String site)
get level descriptor item URI patternsString
getLiveEnvironment(String site)
String
getLiveUrl(String siteId)
Get configured live url for given siteList<String>
getPagePatterns(String site)
get page item URI patternsString
getPluginFolderPattern(String site)
Get the pattern for the plugin folder in the given siteList<String>
getPreviewableMimetypesPaterns(String site)
List<String>
getProtectedFolderPatterns(String siteId)
Get configured protected folder patterns for siteList<String>
getRenderingTemplatePatterns(String site)
get rendering template item URI patternsString
getRootPrefix(String site)
get the root prefix of site.String
getSandboxBranchName(String site)
Get sandbox branch name for given siteList<String>
getScriptsPatterns(String site)
get scripts item URI patternsMap<String,Float>
getSearchFields(String site)
Returns the search field configuration for the given siteprotected SiteConfigTO
getSiteConfig(String site)
String
getStagingEnvironment(String site)
String
getStagingUrl(String siteId)
Get configure staging url for given siteprotected List<String>
getStringList(List<org.dom4j.Node> nodes)
get a list of string valuesStudioConfiguration
getStudioConfiguration()
String
getWemProject(String site)
get the name of the web project for the given siteboolean
isRequirePeerReview(String siteId)
Check if it is configured to require peer reviewboolean
isStagingEnvironmentEnabled(String site)
protected SiteConfigTO
loadConfiguration(String site)
load services configurationprotected void
loadFacetConfiguration(org.dom4j.Node root, SiteConfigTO config)
Loads the search facets configurationsprotected void
loadFolderConfiguration(SiteConfigTO site, RepositoryConfigTO repo, List<org.dom4j.Node> folderNodes)
load top level folder configurationprotected void
loadPatterns(SiteConfigTO site, RepositoryConfigTO repo, List<org.dom4j.Node> nodes)
load page/component/assets patterns configurationprotected void
loadSearchFields(org.dom4j.Node root, SiteConfigTO config)
protected void
loadSiteRepositoryConfiguration(SiteConfigTO siteConfig, org.dom4j.Node node)
load the web-project configurationprotected void
loadSiteUrlsConfiguration(SiteConfigTO siteConfig, org.dom4j.Node configNode)
void
setConfigurationCache(com.google.common.cache.Cache<String,SiteConfigTO> configurationCache)
void
setConfigurationService(ConfigurationService configurationService)
void
setContentRepository(ContentRepository contentRepository)
void
setContentService(ContentService contentService)
void
setContentTypesConfig(ContentTypesConfig contentTypesConfig)
void
setGeneralLockService(GeneralLockService generalLockService)
void
setStudioConfiguration(StudioConfiguration studioConfiguration)
-
-
-
Field Detail
-
PATTERN_PAGE
protected static final String PATTERN_PAGE
pattern keys- See Also:
- Constant Field Values
-
PATTERN_COMPONENT
protected static final String PATTERN_COMPONENT
- See Also:
- Constant Field Values
-
PATTERN_ASSET
protected static final String PATTERN_ASSET
- See Also:
- Constant Field Values
-
PATTERN_DOCUMENT
protected static final String PATTERN_DOCUMENT
- See Also:
- Constant Field Values
-
PATTERN_RENDERING_TEMPLATE
protected static final String PATTERN_RENDERING_TEMPLATE
- See Also:
- Constant Field Values
-
PATTERN_SCRIPTS
protected static final String PATTERN_SCRIPTS
- See Also:
- Constant Field Values
-
PATTERN_LEVEL_DESCRIPTOR
protected static final String PATTERN_LEVEL_DESCRIPTOR
- See Also:
- Constant Field Values
-
PATTERN_PREVIEWABLE_MIMETYPES
protected static final String PATTERN_PREVIEWABLE_MIMETYPES
- See Also:
- Constant Field Values
-
ELM_PATTERN
protected static final String ELM_PATTERN
xml element names- See Also:
- Constant Field Values
-
ATTR_NAME
protected static final String ATTR_NAME
xml attribute names- See Also:
- Constant Field Values
-
ATTR_PATH
protected static final String ATTR_PATH
- See Also:
- Constant Field Values
-
ATTR_READ_DIRECT_CHILDREN
protected static final String ATTR_READ_DIRECT_CHILDREN
- See Also:
- Constant Field Values
-
ATTR_ATTACH_ROOT_PREFIX
protected static final String ATTR_ATTACH_ROOT_PREFIX
- See Also:
- Constant Field Values
-
contentTypesConfig
protected ContentTypesConfig contentTypesConfig
content types configuration
-
contentService
protected ContentService contentService
Content service
-
contentRepository
protected ContentRepository contentRepository
-
generalLockService
protected GeneralLockService generalLockService
-
studioConfiguration
protected StudioConfiguration studioConfiguration
-
configurationService
protected ConfigurationService configurationService
-
configurationCache
protected com.google.common.cache.Cache<String,SiteConfigTO> configurationCache
-
-
Method Detail
-
getSiteConfig
protected SiteConfigTO getSiteConfig(String site)
-
getWemProject
public String getWemProject(String site)
Description copied from interface:ServicesConfig
get the name of the web project for the given site- Specified by:
getWemProject
in interfaceServicesConfig
- Returns:
- web project name
-
getFolders
public List<DmFolderConfigTO> getFolders(String site)
Description copied from interface:ServicesConfig
get a list of folder configuration. The top folders are used to as the top categories when services return a collection of items such as get-go-live-items call- Specified by:
getFolders
in interfaceServicesConfig
- Returns:
- a list of folder configuration
-
getRootPrefix
public String getRootPrefix(String site)
Description copied from interface:ServicesConfig
get the root prefix of site. the root prefix represents the folder name pattern of the corporate and the geo site file locations e.g. if corporate files are under /site and the geo site files are under /site_geo then the root prefix should be "/site"- Specified by:
getRootPrefix
in interfaceServicesConfig
- Returns:
- root prefix
-
getContentTypeConfig
public ContentTypeConfigTO getContentTypeConfig(String site, String name)
Description copied from interface:ServicesConfig
get DM content type configuration by the given site and name- Specified by:
getContentTypeConfig
in interfaceServicesConfig
- Returns:
- content type
-
getAssetPatterns
public List<String> getAssetPatterns(String site)
Description copied from interface:ServicesConfig
get asset item URI patterns- Specified by:
getAssetPatterns
in interfaceServicesConfig
- Returns:
- asset item URI patterns
-
getDeleteDependencyPatterns
public List<DeleteDependencyConfigTO> getDeleteDependencyPatterns(String site, String contentType)
Description copied from interface:ServicesConfig
get the delete dependencies related to a content type- Specified by:
getDeleteDependencyPatterns
in interfaceServicesConfig
- Returns:
- delete dependencys patterns
-
getCopyDependencyPatterns
public List<CopyDependencyConfigTO> getCopyDependencyPatterns(String site, String contentType)
Description copied from interface:ServicesConfig
get the copy dependencies pattern for a content type- Specified by:
getCopyDependencyPatterns
in interfaceServicesConfig
- Returns:
- copy dependencies patterns
-
getComponentPatterns
public List<String> getComponentPatterns(String site)
Description copied from interface:ServicesConfig
get component item URI patterns- Specified by:
getComponentPatterns
in interfaceServicesConfig
- Returns:
- component item URI patterns
-
getPagePatterns
public List<String> getPagePatterns(String site)
Description copied from interface:ServicesConfig
get page item URI patterns- Specified by:
getPagePatterns
in interfaceServicesConfig
- Returns:
- page item URI patterns
-
getRenderingTemplatePatterns
public List<String> getRenderingTemplatePatterns(String site)
Description copied from interface:ServicesConfig
get rendering template item URI patterns- Specified by:
getRenderingTemplatePatterns
in interfaceServicesConfig
- Returns:
- rendering template item URI patterns
-
getScriptsPatterns
public List<String> getScriptsPatterns(String site)
Description copied from interface:ServicesConfig
get scripts item URI patterns- Specified by:
getScriptsPatterns
in interfaceServicesConfig
- Returns:
- scripts item URI patterns
-
getLevelDescriptorPatterns
public List<String> getLevelDescriptorPatterns(String site)
Description copied from interface:ServicesConfig
get level descriptor item URI patterns- Specified by:
getLevelDescriptorPatterns
in interfaceServicesConfig
- Returns:
- level descriptor item URI patterns
-
getDocumentPatterns
public List<String> getDocumentPatterns(String site)
Description copied from interface:ServicesConfig
get document item URI patterns- Specified by:
getDocumentPatterns
in interfaceServicesConfig
- Returns:
- document item URI patterns
-
getLevelDescriptorName
public String getLevelDescriptorName(String site)
Description copied from interface:ServicesConfig
get the name of level descriptor- Specified by:
getLevelDescriptorName
in interfaceServicesConfig
- Returns:
- level descriptor name
-
getDisplayInWidgetPathPatterns
public List<String> getDisplayInWidgetPathPatterns(String site)
Description copied from interface:ServicesConfig
get a list of paths to display in widgets- Specified by:
getDisplayInWidgetPathPatterns
in interfaceServicesConfig
- Returns:
- a list of paths to display in widgets
-
getDefaultTimezone
public String getDefaultTimezone(String site)
Description copied from interface:ServicesConfig
get the default timezone value- Specified by:
getDefaultTimezone
in interfaceServicesConfig
- Returns:
- default timezone
-
getPluginFolderPattern
public String getPluginFolderPattern(String site)
Description copied from interface:ServicesConfig
Get the pattern for the plugin folder in the given site- Specified by:
getPluginFolderPattern
in interfaceServicesConfig
-
loadConfiguration
protected SiteConfigTO loadConfiguration(String site)
load services configuration
-
loadSiteUrlsConfiguration
protected void loadSiteUrlsConfiguration(SiteConfigTO siteConfig, org.dom4j.Node configNode)
-
loadSearchFields
protected void loadSearchFields(org.dom4j.Node root, SiteConfigTO config)
-
loadFacetConfiguration
protected void loadFacetConfiguration(org.dom4j.Node root, SiteConfigTO config)
Loads the search facets configurations- Parameters:
root
- configuration to readconfig
- configuration to update
-
loadSiteRepositoryConfiguration
protected void loadSiteRepositoryConfiguration(SiteConfigTO siteConfig, org.dom4j.Node node)
load the web-project configuration- Parameters:
siteConfig
-node
-
-
getStringList
protected List<String> getStringList(List<org.dom4j.Node> nodes)
get a list of string values- Parameters:
nodes
-- Returns:
- a list of string values
-
loadPatterns
protected void loadPatterns(SiteConfigTO site, RepositoryConfigTO repo, List<org.dom4j.Node> nodes)
load page/component/assets patterns configuration- Parameters:
site
-nodes
-
-
loadFolderConfiguration
protected void loadFolderConfiguration(SiteConfigTO site, RepositoryConfigTO repo, List<org.dom4j.Node> folderNodes)
load top level folder configuration- Parameters:
site
-folderNodes
-
-
getPreviewableMimetypesPaterns
public List<String> getPreviewableMimetypesPaterns(String site)
- Specified by:
getPreviewableMimetypesPaterns
in interfaceServicesConfig
-
getConfigFileName
public String getConfigFileName()
-
getSandboxBranchName
public String getSandboxBranchName(String site)
Description copied from interface:ServicesConfig
Get sandbox branch name for given site- Specified by:
getSandboxBranchName
in interfaceServicesConfig
- Returns:
- Sandbox branch name
-
isStagingEnvironmentEnabled
public boolean isStagingEnvironmentEnabled(String site)
- Specified by:
isStagingEnvironmentEnabled
in interfaceServicesConfig
-
getStagingEnvironment
public String getStagingEnvironment(String site)
- Specified by:
getStagingEnvironment
in interfaceServicesConfig
-
getLiveEnvironment
public String getLiveEnvironment(String site)
- Specified by:
getLiveEnvironment
in interfaceServicesConfig
-
getSearchFields
public Map<String,Float> getSearchFields(String site)
Description copied from interface:ServicesConfig
Returns the search field configuration for the given site- Specified by:
getSearchFields
in interfaceServicesConfig
- Parameters:
site
- the site- Returns:
- the search fields
-
getFacets
public Map<String,FacetTO> getFacets(String site)
Returns the search facets configuration for the given site- Specified by:
getFacets
in interfaceServicesConfig
- Parameters:
site
- the site- Returns:
- the facets
-
getAuthoringUrl
public String getAuthoringUrl(String siteId)
Description copied from interface:ServicesConfig
Get configured authoring url for given site- Specified by:
getAuthoringUrl
in interfaceServicesConfig
- Parameters:
siteId
- site identifier- Returns:
- authoring url
-
getStagingUrl
public String getStagingUrl(String siteId)
Description copied from interface:ServicesConfig
Get configure staging url for given site- Specified by:
getStagingUrl
in interfaceServicesConfig
- Parameters:
siteId
- site identifier- Returns:
- staging url
-
getLiveUrl
public String getLiveUrl(String siteId)
Description copied from interface:ServicesConfig
Get configured live url for given site- Specified by:
getLiveUrl
in interfaceServicesConfig
- Parameters:
siteId
- site identifier- Returns:
- live url
-
getAdminEmailAddress
public String getAdminEmailAddress(String siteId)
Description copied from interface:ServicesConfig
Get configured admin email address for notification emails for given site- Specified by:
getAdminEmailAddress
in interfaceServicesConfig
- Parameters:
siteId
- site identifier- Returns:
- admin email address
-
isRequirePeerReview
public boolean isRequirePeerReview(String siteId)
Description copied from interface:ServicesConfig
Check if it is configured to require peer review- Specified by:
isRequirePeerReview
in interfaceServicesConfig
- Parameters:
siteId
- site identifier- Returns:
- true if require peer review is configured for site
-
getProtectedFolderPatterns
public List<String> getProtectedFolderPatterns(String siteId)
Description copied from interface:ServicesConfig
Get configured protected folder patterns for site- Specified by:
getProtectedFolderPatterns
in interfaceServicesConfig
- Parameters:
siteId
- site identifier- Returns:
- list of configured protected folders patterns
-
setContentService
public void setContentService(ContentService contentService)
-
getContentTypesConfig
public ContentTypesConfig getContentTypesConfig()
-
setContentTypesConfig
public void setContentTypesConfig(ContentTypesConfig contentTypesConfig)
-
getContentRepository
public ContentRepository getContentRepository()
-
setContentRepository
public void setContentRepository(ContentRepository contentRepository)
-
getGeneralLockService
public GeneralLockService getGeneralLockService()
-
setGeneralLockService
public void setGeneralLockService(GeneralLockService generalLockService)
-
getStudioConfiguration
public StudioConfiguration getStudioConfiguration()
-
setStudioConfiguration
public void setStudioConfiguration(StudioConfiguration studioConfiguration)
-
getConfigurationService
public ConfigurationService getConfigurationService()
-
setConfigurationService
public void setConfigurationService(ConfigurationService configurationService)
-
setConfigurationCache
public void setConfigurationCache(com.google.common.cache.Cache<String,SiteConfigTO> configurationCache)
-
-