use of com.centurylink.mdw.workflow.ConfigManagerProjectsDocument in project mdw-designer by CenturyLinkCloud.
the class WorkflowProjectManager method discoverWorkflowApps.
public List<WorkflowApplication> discoverWorkflowApps() throws DiscoveryException {
String urlBase = MdwPlugin.getSettings().getProjectDiscoveryUrl();
if (!urlBase.endsWith("/"))
urlBase += "/";
String ctxRoot = urlBase.endsWith("Discovery/") ? "" : "MDWWeb/";
if (urlBase.indexOf("lxdnd696") >= 0)
// old discovery server
ctxRoot = "MDWExampleWeb/";
String path = urlBase.endsWith("Discovery/") ? "ConfigManagerProjects.xml" : "Services/GetConfigFile?name=ConfigManagerProjects.xml";
String cfgMgrUrl = urlBase + ctxRoot + path;
try {
URL url = new URL(cfgMgrUrl);
HttpHelper httpHelper = new HttpHelper(url);
httpHelper.setConnectTimeout(MdwPlugin.getSettings().getHttpConnectTimeout());
httpHelper.setReadTimeout(MdwPlugin.getSettings().getHttpReadTimeout());
String xml = httpHelper.get();
ConfigManagerProjectsDocument doc = ConfigManagerProjectsDocument.Factory.parse(xml, Compatibility.namespaceOptions());
return doc.getConfigManagerProjects().getWorkflowAppList();
} catch (XmlException ex) {
PluginMessages.log(ex);
throw new DiscoveryException("Unable to obtain/parse Config Manager info from " + cfgMgrUrl);
} catch (Exception ex) {
throw new DiscoveryException(ex.getMessage(), ex);
}
}
Aggregations