public class ConfigurationServiceImpl extends Object implements ConfigurationService
| Modifier and Type | Field and Description |
|---|---|
static String |
PLACEHOLDER_NAME |
static String |
PLACEHOLDER_TYPE |
| Constructor and Description |
|---|
ConfigurationServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
Map<String,List<String>> |
geRoleMappings(String siteId)
Get role mappings configuration for given site
|
AuditServiceInternal |
getAuditServiceInternal() |
org.dom4j.Document |
getConfigurationAsDocument(String siteId,
String module,
String path,
String environment)
Get configuration as DOM document for given parameters
|
String |
getConfigurationAsString(String siteId,
String module,
String path,
String environment)
Get configuration as string for given parameters
|
ConfigurationHistory |
getConfigurationHistory(String siteId,
String module,
String path,
String environment)
Get configuration history for given parameters
|
String |
getGlobalConfiguration(String path)
Get configuration from global repository as String
|
ObjectMetadataManager |
getObjectMetadataManager() |
ObjectStateService |
getObjectStateService() |
org.springframework.core.io.Resource |
getPluginFile(String siteId,
String type,
String name,
String filename)
Get a a file from a plugin
|
SecurityService |
getSecurityService() |
SiteService |
getSiteService() |
org.apache.commons.configuration2.HierarchicalConfiguration<?> |
getXmlConfiguration(String siteId,
String path)
Reads a configuration file using Apache Commons Configuration
|
void |
setAuditServiceInternal(AuditServiceInternal auditServiceInternal) |
void |
setConfigurationCache(net.sf.ehcache.Cache configurationCache) |
void |
setConfigurationReader(org.craftercms.commons.config.EncryptionAwareConfigurationReader configurationReader) |
void |
setContentService(ContentService contentService) |
void |
setEventService(EventService eventService) |
void |
setObjectMetadataManager(ObjectMetadataManager objectMetadataManager) |
void |
setObjectStateService(ObjectStateService objectStateService) |
void |
setSecurityService(SecurityService securityService) |
void |
setServicesConfig(ServicesConfig servicesConfig) |
void |
setSiteService(SiteService siteService) |
void |
setStudioConfiguration(StudioConfiguration studioConfiguration) |
protected InputStream |
validate(InputStream content,
String filename) |
void |
writeConfiguration(String siteId,
String module,
String path,
String environment,
InputStream content)
Write configuration file for given parameters
|
void |
writeGlobalConfiguration(String path,
InputStream content)
Write configuration file within global repo
|
public static final String PLACEHOLDER_TYPE
public static final String PLACEHOLDER_NAME
public Map<String,List<String>> geRoleMappings(String siteId) throws ConfigurationException
ConfigurationServicegeRoleMappings in interface ConfigurationServicesiteId - Site id to useConfigurationExceptionpublic String getConfigurationAsString(String siteId, String module, String path, String environment)
ConfigurationServicegetConfigurationAsString in interface ConfigurationServicesiteId - site id to usemodule - crafter CMS modulepath - path of configuration fileenvironment - environment to use. if empty using defaultpublic org.dom4j.Document getConfigurationAsDocument(String siteId, String module, String path, String environment) throws org.dom4j.DocumentException, IOException
ConfigurationServicegetConfigurationAsDocument in interface ConfigurationServicesiteId - site id to usemodule - crafter CMS modulepath - path of configuration fileenvironment - environment to use. if empty using defaultorg.dom4j.DocumentExceptionIOExceptionpublic org.apache.commons.configuration2.HierarchicalConfiguration<?> getXmlConfiguration(String siteId, String path) throws ConfigurationException
ConfigurationServicegetXmlConfiguration in interface ConfigurationServicesiteId - the id of the sitepath - the path of the fileConfigurationException - if there is any error reading or parsing the filepublic String getGlobalConfiguration(String path)
ConfigurationServicegetGlobalConfiguration in interface ConfigurationServicepath - path of configuration filepublic void writeConfiguration(String siteId, String module, String path, String environment, InputStream content) throws ServiceLayerException
ConfigurationServicewriteConfiguration in interface ConfigurationServicesiteId - site id to usemodule - crafter CMS modulepath - path where to store configuration fileenvironment - environment to use. if empty using defaultcontent - content of configuration fileServiceLayerExceptionpublic org.springframework.core.io.Resource getPluginFile(String siteId, String type, String name, String filename) throws ContentNotFoundException
ConfigurationServicegetPluginFile in interface ConfigurationServicesiteId - the id of sitetype - the type of pluginname - the name of the pluginfilename - the path and name of the fileContentNotFoundException - if there is any issue reading the file from the repositoryprotected InputStream validate(InputStream content, String filename) throws ServiceLayerException
ServiceLayerExceptionpublic ConfigurationHistory getConfigurationHistory(String siteId, String module, String path, String environment)
ConfigurationServicegetConfigurationHistory in interface ConfigurationServicesiteId - site id to usemodule - crafter CMS modulepath - path of configuration fileenvironment - environment to use. if empty using defaultpublic void writeGlobalConfiguration(String path, InputStream content) throws ServiceLayerException
ConfigurationServicewriteGlobalConfiguration in interface ConfigurationServicepath - path of configuration filecontent - content of configuration fileServiceLayerExceptionpublic void setContentService(ContentService contentService)
public void setStudioConfiguration(StudioConfiguration studioConfiguration)
public void setServicesConfig(ServicesConfig servicesConfig)
public AuditServiceInternal getAuditServiceInternal()
public void setAuditServiceInternal(AuditServiceInternal auditServiceInternal)
public SiteService getSiteService()
public void setSiteService(SiteService siteService)
public SecurityService getSecurityService()
public void setSecurityService(SecurityService securityService)
public ObjectMetadataManager getObjectMetadataManager()
public void setObjectMetadataManager(ObjectMetadataManager objectMetadataManager)
public ObjectStateService getObjectStateService()
public void setObjectStateService(ObjectStateService objectStateService)
public void setEventService(EventService eventService)
public void setConfigurationCache(net.sf.ehcache.Cache configurationCache)
public void setConfigurationReader(org.craftercms.commons.config.EncryptionAwareConfigurationReader configurationReader)
Copyright © 2023 CrafterCMS. All rights reserved.