use of com.centurylink.mdw.plugin.project.assembly.ProjectConfigurator in project mdw-designer by CenturyLinkCloud.
the class JavaSource method beforeFileOpened.
@Override
public void beforeFileOpened() {
ProjectConfigurator projConf = new ProjectConfigurator(getProject(), MdwPlugin.getSettings());
IProgressMonitor monitor = new NullProgressMonitor();
projConf.setJava(monitor);
try {
if (getProject().isRemote() && projConf.isJavaCapable() && !projConf.hasFrameworkJars()) {
FrameworkUpdateDialog updateDlg = new FrameworkUpdateDialog(MdwPlugin.getShell(), MdwPlugin.getSettings(), getProject());
if (updateDlg.open() == Dialog.OK) {
// as
String origVer = getProject().getMdwVersion();
// reported
// by server
// or db
// for
getProject().setMdwVersion(updateDlg.getMdwVersion());
// downloading
projConf.initializeFrameworkJars();
projConf.initializeWebAppJars();
getProject().setMdwVersion(origVer);
}
} else if (!getProject().isCustomTaskManager() && !projConf.hasWebAppJars()) {
projConf.initializeWebAppJars();
}
} catch (CoreException ex) {
PluginMessages.uiError(ex, "Framework Jars", getProject());
}
}
use of com.centurylink.mdw.plugin.project.assembly.ProjectConfigurator in project mdw-designer by CenturyLinkCloud.
the class WebUpdateAction method run.
/**
* @see IActionDelegate#run(IAction)
*/
public void run(final IAction action) {
IProject webProject = null;
WorkflowProject workflowProject = null;
try {
if (selection instanceof IStructuredSelection && ((IStructuredSelection) selection).getFirstElement() instanceof IProject) {
webProject = (IProject) ((IStructuredSelection) selection).getFirstElement();
workflowProject = WorkflowProjectManager.getInstance().getWorkflowProject(webProject);
}
if (workflowProject == null) {
MessageDialog.openError(shell, "MDW Update", "Selection must be a Workflow Web project.\n(Try refreshing Process Explorer view.)");
return;
}
ProjectUpdater updater = new ProjectUpdater(workflowProject, MdwPlugin.getSettings());
if (action.getId().equals("mdw.workflow.updateFrameworkWebJars")) {
updater.updateWebProjectJars(null);
} else if (action.getId().equals("mdw.workflow.associateWebAppSourceCode")) {
ProgressMonitorDialog pmDialog = new MdwProgressMonitorDialog(shell);
final WorkflowProject wfProject = workflowProject;
pmDialog.run(true, false, new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
monitor.beginTask("Setting Java source attachment locations", 100);
monitor.worked(20);
ProjectConfigurator configurator = new ProjectConfigurator(wfProject, MdwPlugin.getSettings());
try {
configurator.createWebProjectSourceCodeAssociations(shell, monitor);
} catch (CoreException ex) {
PluginMessages.log(ex);
}
}
});
}
} catch (Exception ex) {
PluginMessages.log(ex);
}
}
use of com.centurylink.mdw.plugin.project.assembly.ProjectConfigurator in project mdw-designer by CenturyLinkCloud.
the class CustomTaskManager method addTo.
@Override
public boolean addTo(WorkflowProject project, IProgressMonitor monitor) throws ExtensionModuleException {
monitor.worked(5);
try {
updateApplicationXml(project, project.getWebProjectName() + ".war", project.getWebProjectName(), new SubProgressMonitor(monitor, 5));
MdwSettings mdwSettings = MdwPlugin.getSettings();
ProjectInflator inflator = new ProjectInflator(project, mdwSettings);
inflator.generateWebArtifacts(new SubProgressMonitor(monitor, 5));
ProjectUpdater updater = new ProjectUpdater(project, mdwSettings);
ProjectConfigurator configurator = new ProjectConfigurator(project, mdwSettings);
updater.updateWebProjectJars(new SubProgressMonitor(monitor, 30));
configurator.createWebProjectSourceCodeAssociations(null, monitor);
monitor.worked(5);
} catch (Exception ex) {
throw new ExtensionModuleException(ex.getMessage(), ex);
}
return true;
}
use of com.centurylink.mdw.plugin.project.assembly.ProjectConfigurator in project mdw-designer by CenturyLinkCloud.
the class LocalCloudProjectWizard method performFinish.
@Override
public boolean performFinish() {
// can depend on
project.setDefaultFilesToIgnoreDuringUpdate();
// container selected
ProjectInflator projectInflator = new ProjectInflator(project, MdwPlugin.getSettings());
if (project.checkRequiredVersion(6, 0, 3))
projectInflator.inflateCliCloudProject();
else
projectInflator.inflateCloudProject(getContainer());
WorkflowProjectManager.addProject(project);
// take care of any extension modules
ExtensionModulesUpdater changer = new ExtensionModulesUpdater(getProject());
changer.setAdds(project.getExtensionModules());
changer.doChanges(getShell());
if (!project.isRemote() && !project.isWar()) {
BusyIndicator.showWhile(getShell().getDisplay(), new Runnable() {
public void run() {
// deployment assembly, and add the resources folder
try {
ProjectConfigurator projConf = new ProjectConfigurator(getProject(), MdwPlugin.getSettings());
getProject().getSourceProject().refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
if (getProject().isFilePersist())
projConf.removeDeploymentAssemblyResourceMappings(project.getAssetFolder());
else
projConf.removeDeploymentAssemblyResourceMappings(project.getTempFolder());
projConf.addDeploymentAssemblyResourceMappings(project.getSourceProject().getFolder("/src/main/resources"));
} catch (CoreException ex) {
PluginMessages.uiError(ex, "Inflate Project", getProject());
}
}
});
}
DesignerPerspective.promptForShowPerspective(activeWindow, project);
return true;
}
use of com.centurylink.mdw.plugin.project.assembly.ProjectConfigurator in project mdw-designer by CenturyLinkCloud.
the class Script method beforeFileOpened.
@Override
public void beforeFileOpened() {
if (isGroovy()) {
ProjectConfigurator projConf = new ProjectConfigurator(getProject(), MdwPlugin.getSettings());
projConf.setGroovy(new NullProgressMonitor());
try {
if (getProject().isRemote() && projConf.isJavaCapable() && !projConf.hasFrameworkJars()) {
FrameworkUpdateDialog updateDlg = new FrameworkUpdateDialog(MdwPlugin.getShell(), MdwPlugin.getSettings(), getProject());
if (updateDlg.open() == Dialog.OK) {
// as
String origVer = getProject().getMdwVersion();
// reported
// by
// server
// or db
// for
getProject().setMdwVersion(updateDlg.getMdwVersion());
// downloading
projConf.initializeFrameworkJars();
getProject().setMdwVersion(origVer);
}
}
} catch (CoreException ex) {
PluginMessages.uiError(ex, "Framework Jars", getProject());
}
}
}
Aggregations