Class ServicesConfigImpl
java.lang.Object
org.craftercms.studio.impl.v1.service.configuration.ServicesConfigImpl
- All Implemented Interfaces:
ServicesConfig
Implementation of ServicesConfigImpl. This class requires a configuration
file in the repository
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final String
protected static final String
xml attribute namesprotected static final String
protected static final String
protected com.google.common.cache.Cache<String,
SiteConfigTO> protected ConfigurationService
protected ContentRepository
protected ContentService
Content serviceprotected ContentTypesConfig
content types configurationprotected static final String
xml element namesprotected GeneralLockService
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
pattern keysprotected static final String
protected static final String
protected static final String
protected StudioConfiguration
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAdminEmailAddress
(String siteId) Get configured admin email address for notification emails for given sitegetAssetPatterns
(String site) get asset item URI patternsgetAuthoringUrl
(String siteId) Get configured authoring url for given sitegetComponentPatterns
(String site) get component item URI patterns@Valid ContentTypeConfigTO
getContentTypeConfig
(String site, String name) get DM content type configuration by the given site and name@Valid List<CopyDependencyConfigTO>
getCopyDependencyPatterns
(String site, String contentType) get the copy dependencies pattern for a content type@Valid String
getDefaultTimezone
(String site) get the default timezone value@Valid List<DeleteDependencyConfigTO>
getDeleteDependencyPatterns
(String site, String contentType) get the delete dependencies related to a content typeget a list of paths to display in widgetsgetDocumentPatterns
(String site) get document item URI patternsReturns the search facets configuration for the given site@Valid List<DmFolderConfigTO>
getFolders
(String site) get a list of folder configuration.@Valid String
getLevelDescriptorName
(String site) get the name of level descriptorget level descriptor item URI patternsgetLiveEnvironment
(String site) getLiveUrl
(String siteId) Get configured live url for given sitegetPagePatterns
(String site) get page item URI patterns@Valid String
getPluginFolderPattern
(String site) Get the pattern for the plugin folder in the given sitegetProtectedFolderPatterns
(String siteId) Get configured protected folder patterns for siteget rendering template item URI patterns@Valid String
getRootPrefix
(String site) get the root prefix of site.@Valid String
getSandboxBranchName
(String site) Get sandbox branch name for given sitegetScriptsPatterns
(String site) get scripts item URI patternsgetSearchFields
(String site) Returns the search field configuration for the given siteprotected SiteConfigTO
getSiteConfig
(String site) getStagingEnvironment
(String site) getStagingUrl
(String siteId) Get configure staging url for given sitegetStringList
(List<org.dom4j.Node> nodes) get a list of string values@Valid 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
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 Details
-
PATTERN_PAGE
pattern keys- See Also:
-
PATTERN_COMPONENT
- See Also:
-
PATTERN_ASSET
- See Also:
-
PATTERN_DOCUMENT
- See Also:
-
PATTERN_RENDERING_TEMPLATE
- See Also:
-
PATTERN_SCRIPTS
- See Also:
-
PATTERN_LEVEL_DESCRIPTOR
- See Also:
-
PATTERN_PREVIEWABLE_MIMETYPES
- See Also:
-
ELM_PATTERN
xml element names- See Also:
-
ATTR_NAME
xml attribute names- See Also:
-
ATTR_PATH
- See Also:
-
ATTR_READ_DIRECT_CHILDREN
- See Also:
-
ATTR_ATTACH_ROOT_PREFIX
- See Also:
-
contentTypesConfig
content types configuration -
contentService
Content service -
contentRepository
-
generalLockService
-
studioConfiguration
-
configurationService
-
configurationCache
-
-
Constructor Details
-
ServicesConfigImpl
public ServicesConfigImpl()
-
-
Method Details
-
getSiteConfig
-
getWemProject
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
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
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
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
Description copied from interface:ServicesConfig
get asset item URI patterns- Specified by:
getAssetPatterns
in interfaceServicesConfig
- Returns:
- asset item URI patterns
-
getDeleteDependencyPatterns
@Valid public @Valid 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
@Valid public @Valid 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
Description copied from interface:ServicesConfig
get component item URI patterns- Specified by:
getComponentPatterns
in interfaceServicesConfig
- Returns:
- component item URI patterns
-
getPagePatterns
Description copied from interface:ServicesConfig
get page item URI patterns- Specified by:
getPagePatterns
in interfaceServicesConfig
- Returns:
- page item URI patterns
-
getRenderingTemplatePatterns
Description copied from interface:ServicesConfig
get rendering template item URI patterns- Specified by:
getRenderingTemplatePatterns
in interfaceServicesConfig
- Returns:
- rendering template item URI patterns
-
getScriptsPatterns
Description copied from interface:ServicesConfig
get scripts item URI patterns- Specified by:
getScriptsPatterns
in interfaceServicesConfig
- Returns:
- scripts item URI patterns
-
getLevelDescriptorPatterns
Description copied from interface:ServicesConfig
get level descriptor item URI patterns- Specified by:
getLevelDescriptorPatterns
in interfaceServicesConfig
- Returns:
- level descriptor item URI patterns
-
getDocumentPatterns
Description copied from interface:ServicesConfig
get document item URI patterns- Specified by:
getDocumentPatterns
in interfaceServicesConfig
- Returns:
- document item URI patterns
-
getLevelDescriptorName
Description copied from interface:ServicesConfig
get the name of level descriptor- Specified by:
getLevelDescriptorName
in interfaceServicesConfig
- Returns:
- level descriptor name
-
getDisplayInWidgetPathPatterns
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
Description copied from interface:ServicesConfig
get the default timezone value- Specified by:
getDefaultTimezone
in interfaceServicesConfig
- Returns:
- default timezone
-
getPluginFolderPattern
Description copied from interface:ServicesConfig
Get the pattern for the plugin folder in the given site- Specified by:
getPluginFolderPattern
in interfaceServicesConfig
-
loadConfiguration
load services configuration -
loadSiteUrlsConfiguration
-
loadSearchFields
-
loadFacetConfiguration
Loads the search facets configurations- Parameters:
root
- configuration to readconfig
- configuration to update
-
loadSiteRepositoryConfiguration
load the web-project configuration- Parameters:
siteConfig
-node
-
-
getStringList
get a list of string values- Parameters:
nodes
-- Returns:
- a list of string values
-
loadPatterns
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
- Specified by:
getPreviewableMimetypesPaterns
in interfaceServicesConfig
-
getConfigFileName
-
getSandboxBranchName
Description copied from interface:ServicesConfig
Get sandbox branch name for given site- Specified by:
getSandboxBranchName
in interfaceServicesConfig
- Returns:
- Sandbox branch name
-
isStagingEnvironmentEnabled
- Specified by:
isStagingEnvironmentEnabled
in interfaceServicesConfig
-
getStagingEnvironment
- Specified by:
getStagingEnvironment
in interfaceServicesConfig
-
getLiveEnvironment
- Specified by:
getLiveEnvironment
in interfaceServicesConfig
-
getSearchFields
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
Returns the search facets configuration for the given site- Specified by:
getFacets
in interfaceServicesConfig
- Parameters:
site
- the site- Returns:
- the facets
-
getAuthoringUrl
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
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
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
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
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
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
-
getContentTypesConfig
-
setContentTypesConfig
-
getContentRepository
-
setContentRepository
-
getGeneralLockService
-
setGeneralLockService
-
getStudioConfiguration
-
setStudioConfiguration
-
getConfigurationService
-
setConfigurationService
-
setConfigurationCache
public void setConfigurationCache(com.google.common.cache.Cache<String, SiteConfigTO> configurationCache)
-