mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Fix for WebClient config reload/reset - skip invalid config sources
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6868 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -28,7 +28,9 @@ import java.io.ByteArrayOutputStream;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.PrintStream;
|
import java.io.PrintStream;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.alfresco.config.ConfigDeployment;
|
||||||
import org.alfresco.i18n.I18NUtil;
|
import org.alfresco.i18n.I18NUtil;
|
||||||
import org.alfresco.repo.admin.BaseInterpreter;
|
import org.alfresco.repo.admin.BaseInterpreter;
|
||||||
import org.alfresco.repo.config.xml.RepoXMLConfigService;
|
import org.alfresco.repo.config.xml.RepoXMLConfigService;
|
||||||
@@ -134,9 +136,22 @@ public class ConfigAdminInterpreter extends BaseInterpreter
|
|||||||
}
|
}
|
||||||
|
|
||||||
// destroy and re-initialise config service
|
// destroy and re-initialise config service
|
||||||
webClientConfigService.reset();
|
webClientConfigService.destroy();
|
||||||
|
List <ConfigDeployment> configDeployments = webClientConfigService.initConfig();
|
||||||
out.println("Web Client config has been reloaded");
|
|
||||||
|
if (configDeployments != null)
|
||||||
|
{
|
||||||
|
out.println("Web Client config has been reloaded\n");
|
||||||
|
|
||||||
|
for (ConfigDeployment configDeployment : configDeployments)
|
||||||
|
{
|
||||||
|
out.println(configDeployment.getName() + " ---> " + configDeployment.getDeploymentStatus());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
out.println("No config reloaded");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
|
@@ -27,6 +27,7 @@ package org.alfresco.web.config;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.alfresco.config.ConfigDeployer;
|
import org.alfresco.config.ConfigDeployer;
|
||||||
|
import org.alfresco.config.ConfigDeployment;
|
||||||
import org.alfresco.config.ConfigService;
|
import org.alfresco.config.ConfigService;
|
||||||
import org.alfresco.config.source.UrlConfigSource;
|
import org.alfresco.config.source.UrlConfigSource;
|
||||||
import org.alfresco.error.AlfrescoRuntimeException;
|
import org.alfresco.error.AlfrescoRuntimeException;
|
||||||
@@ -104,12 +105,14 @@ public class WebClientConfigBootstrap implements ApplicationContextAware, Config
|
|||||||
/**
|
/**
|
||||||
* Initialisation method
|
* Initialisation method
|
||||||
*/
|
*/
|
||||||
public void initConfig()
|
public List<ConfigDeployment> initConfig()
|
||||||
{
|
{
|
||||||
if (configService != null && this.configs != null && this.configs.size() != 0)
|
if (configService != null && this.configs != null && this.configs.size() != 0)
|
||||||
{
|
{
|
||||||
UrlConfigSource configSource = new UrlConfigSource(this.configs);
|
UrlConfigSource configSource = new UrlConfigSource(this.configs);
|
||||||
configService.appendConfig(configSource);
|
return configService.appendConfig(configSource);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user