org.springframework.extensions.config.xml.XMLConfigService Java Examples

The following examples show how to use org.springframework.extensions.config.xml.XMLConfigService. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MimetypeMapTest.java    From alfresco-data-model with GNU Lesser General Public License v3.0 6 votes vote down vote up
private void setConfigService(final String mimetypes)
{
    ConfigSource configSource = new ConfigSource()
    {
        @Override
        public List<ConfigDeployment> getConfigDeployments()
        {
            String xml =
                "<alfresco-config area=\"mimetype-map\">" +
                "  <config evaluator=\"string-compare\" condition=\"Mimetype Map\">" +
                "    <mimetypes>" +
                       mimetypes +
                "    </mimetypes>" +
                "  </config>" +
                "</alfresco-config>";
            List<ConfigDeployment> configs = new ArrayList<ConfigDeployment>();
            configs.add(new ConfigDeployment("name", new ByteArrayInputStream(xml.getBytes())));
            return configs;
        }
    };

    ConfigService configService = new XMLConfigService(configSource);
    ((XMLConfigService) configService).initConfig();
    ((MimetypeMap)mimetypeService).setConfigService(configService);
}
 
Example #2
Source File: BaseTest.java    From alfresco-core with GNU Lesser General Public License v3.0 5 votes vote down vote up
protected XMLConfigService initXMLConfigService(String xmlConfigFile, String overridingXmlConfigFile)
{
    List<String> files = new ArrayList<String>(2);
    files.add(xmlConfigFile);
    files.add(overridingXmlConfigFile);
    return initXMLConfigService(files);
}
 
Example #3
Source File: BaseTest.java    From alfresco-core with GNU Lesser General Public License v3.0 5 votes vote down vote up
protected XMLConfigService initXMLConfigService(List<String> xmlConfigFilenames)
{
    List<String> configFiles = new ArrayList<String>();
    for (String filename : xmlConfigFilenames)
    {
        // if we load from classpath then no need to prepend the resources dir (which will be .equals("classpath:")
        String path = ((loadFromClasspath) ? "" : getResourcesDir()) + filename;
        assertFileIsValid(path);
        configFiles.add(path);
    }
    ConfigSource configSource = (loadFromClasspath) ? new ClassPathConfigSource(configFiles) : new FileConfigSource(configFiles);
    XMLConfigService svc = new XMLConfigService(configSource);
    svc.initConfig();
    return svc;
}