use of com.centurylink.mdw.plugin.project.assembly.ProjectUpdater in project mdw-designer by CenturyLinkCloud.
the class TomcatServerBehavior method publishModules.
/**
* Only overridden to set the monitor ticks.
*/
@SuppressWarnings("rawtypes")
@Override
protected void publishModules(int kind, List modules, List deltaKind2, MultiStatus multi, IProgressMonitor monitor) {
if (modules == null)
return;
int size = modules.size();
if (size == 0)
return;
// publish modules
for (int i = 0; i < size; i++) {
if (monitor.isCanceled())
return;
// should skip this publish
IModule[] module = (IModule[]) modules.get(i);
IModule m = module[module.length - 1];
if (shouldIgnorePublishRequest(m))
continue;
int kind2 = kind;
if (getServer().getModulePublishState(module) == IServer.PUBLISH_STATE_UNKNOWN)
kind2 = IServer.PUBLISH_FULL;
// for workflow client apps, download if mdw.war not found
if (getWebProject() == null && module[0].getProject() != null) {
WorkflowProject clientWf = WorkflowProjectManager.getInstance().getWorkflowProject(module[0].getProject());
if (clientWf != null) {
String deployLoc = getServer().getAttribute(ITomcatServer.PROPERTY_INSTANCE_DIR, clientWf.getDeployFolder().getLocation().toPortableString());
File mdwWar = new File(deployLoc + "/webapps/mdw.war");
if (kind == IServer.PUBLISH_CLEAN && mdwWar.exists() && !mdwWar.delete())
showError("Publish Error", "Unable to delete " + mdwWar, clientWf);
if (!mdwWar.exists()) {
ProjectUpdater updater = new ProjectUpdater(getProject(), MdwPlugin.getSettings());
try {
updater.updateFrameworkJars(new SubProgressMonitor(monitor, 1));
} catch (Exception ex) {
showError(ex.getMessage(), "Update Framework Libraries", clientWf);
}
}
}
}
IStatus status;
if (getWebProject() != null && kind == IServer.PUBLISH_CLEAN || ((Integer) deltaKind2.get(i)).intValue() == ServerBehaviourDelegate.REMOVED)
status = publishModule(kind2, module, ((Integer) deltaKind2.get(i)).intValue(), ProgressUtil.getSubMonitorFor(monitor, size * 3000));
else
status = publishModule(kind2, module, ((Integer) deltaKind2.get(i)).intValue(), ProgressUtil.getSubMonitorFor(monitor, 3000));
if (status != null && !status.isOK())
multi.add(status);
}
}
use of com.centurylink.mdw.plugin.project.assembly.ProjectUpdater in project mdw-designer by CenturyLinkCloud.
the class AdminUi method addTo.
public boolean addTo(WorkflowProject project, IProgressMonitor monitor) throws ExtensionModuleException, InterruptedException {
monitor.worked(5);
try {
ProjectUpdater updater = new ProjectUpdater(project, MdwPlugin.getSettings()) {
protected URL getFileUrl() throws IOException {
return super.getRepositoryFileUrl("mdw-admin", getVersion());
}
};
updater.addWarLib("mdw-admin-" + getVersion() + ".war", "mdw-admin.war", new SubProgressMonitor(monitor, 90));
monitor.worked(5);
} catch (InterruptedException ex) {
throw ex;
} catch (Exception ex) {
throw new ExtensionModuleException(ex.getMessage(), ex);
}
return true;
}
use of com.centurylink.mdw.plugin.project.assembly.ProjectUpdater in project mdw-designer by CenturyLinkCloud.
the class AdminUi method update.
public boolean update(WorkflowProject project, IProgressMonitor monitor) throws ExtensionModuleException, InterruptedException {
monitor.worked(5);
try {
ProjectUpdater updater = new ProjectUpdater(project, MdwPlugin.getSettings()) {
protected URL getFileUrl() throws IOException {
return super.getRepositoryFileUrl("mdw-admin", getVersion());
}
};
updater.addWarLib("mdw-admin-" + getVersion() + ".war", "mdw-admin.war", new SubProgressMonitor(monitor, 90));
monitor.worked(5);
} catch (InterruptedException ex) {
throw ex;
} catch (Exception ex) {
throw new ExtensionModuleException(ex.getMessage(), ex);
}
return true;
}
use of com.centurylink.mdw.plugin.project.assembly.ProjectUpdater in project mdw-designer by CenturyLinkCloud.
the class LibExtension method addTo.
@Override
public boolean addTo(WorkflowProject project, IProgressMonitor monitor) throws ExtensionModuleException, InterruptedException {
monitor.worked(5);
try {
ProjectUpdater updater = new ProjectUpdater(project, MdwPlugin.getSettings());
updater.addAppLibs(getZipFile(project), new SubProgressMonitor(monitor, 90));
monitor.worked(5);
} catch (InterruptedException ex) {
throw ex;
} catch (Exception ex) {
throw new ExtensionModuleException(ex.getMessage(), ex);
}
return true;
}
use of com.centurylink.mdw.plugin.project.assembly.ProjectUpdater in project mdw-designer by CenturyLinkCloud.
the class LibExtension method removeFrom.
@Override
public boolean removeFrom(WorkflowProject project, IProgressMonitor monitor) throws ExtensionModuleException, InterruptedException {
monitor.worked(5);
try {
ProjectUpdater updater = new ProjectUpdater(project, MdwPlugin.getSettings());
updater.removeAppLibs(getZipFile(project), new SubProgressMonitor(monitor, 90));
monitor.worked(5);
} catch (InterruptedException ex) {
throw ex;
} catch (Exception ex) {
throw new ExtensionModuleException(ex.getMessage(), ex);
}
return true;
}
Aggregations