use of com.centurylink.mdw.plugin.project.assembly.ProjectUpdater 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.ProjectUpdater in project mdw-designer by CenturyLinkCloud.
the class CustomTaskManager method update.
@Override
public boolean update(WorkflowProject project, IProgressMonitor monitor) throws ExtensionModuleException {
monitor.worked(5);
try {
ProjectUpdater updater = new ProjectUpdater(project, MdwPlugin.getSettings());
updater.updateWebProjectJars(new SubProgressMonitor(monitor, 90));
monitor.worked(5);
} 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 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.ProjectUpdater in project mdw-designer by CenturyLinkCloud.
the class WebExtension 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.removeWebLibs(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 ProjectSettingsPropertyPage method performOk.
public boolean performOk() {
IProject project = (IProject) getElement();
try {
WorkflowProjectManager.getInstance().save(getProject(), project);
} catch (CoreException ex) {
PluginMessages.uiError(getShell(), ex, "Project Settings", getProject());
return false;
}
if (getProject().getPersistType() == PersistType.Git && (!gitRepositoryUrlTextField.getText().trim().equals(originalGitRepositoryUrl) || !gitBranchTextField.getText().trim().equals(originalGitBranch) || !assetLocalPathTextField.getText().trim().equals(originalAssetLocalPath) || (includeArchiveCheckbox != null && includeArchiveCheckbox.getSelection() != originalIncludeArchive))) {
getProject().getMdwVcsRepository().setEntrySource("projectSettingsPropertyPage");
getProject().fireElementChangeEvent(ChangeType.SETTINGS_CHANGE, getProject().getMdwVcsRepository());
}
if (databaseJdbcUrlTextField != null && !databaseJdbcUrlTextField.getText().trim().equals(originalJdbcUrl)) {
getProject().getMdwDataSource().setEntrySource("projectSettingsPropertyPage");
getProject().fireElementChangeEvent(ChangeType.SETTINGS_CHANGE, getProject().getMdwDataSource());
}
if (mdwVersionComboBox != null && !mdwVersionComboBox.getText().equals(originalMdwVersion)) {
getProject().fireElementChangeEvent(ChangeType.VERSION_CHANGE, getProject().getMdwVersion());
if (MessageDialog.openQuestion(getShell(), "Update Framework Libraries", "The MDW version has changed. Would you like to download updated framework libraries to match the new selection?")) {
ProjectUpdater updater = new ProjectUpdater(getProject(), MdwPlugin.getSettings());
try {
updater.updateFrameworkJars(null);
ExtensionModulesUpdater modulesUpdater = new ExtensionModulesUpdater(getProject());
modulesUpdater.doUpdate(getShell());
} catch (Exception ex) {
PluginMessages.uiError(getShell(), ex, "Update Framework Libraries", getProject());
return false;
}
}
if (getProject().isOsgi())
MessageDialog.openInformation(getShell(), "MDW Version Changed", "The MDW version has been updated in the plug-in settings file. Please update any MDW dependencies in your pom.xml build file.");
}
if (getProject().isRemote()) {
if (!hostTextField.getText().trim().equals(originalHost) || !portTextField.getText().trim().equals(String.valueOf(originalPort))) {
getProject().fireElementChangeEvent(ChangeType.SETTINGS_CHANGE, getProject().getServerSettings());
}
if (!contextRootTextField.getText().trim().equals(originalContextRoot)) {
getProject().fireElementChangeEvent(ChangeType.SETTINGS_CHANGE, getProject().getWebContextRoot());
}
if (syncSwitch != null && syncSwitch.getSelection() != originalSync) {
WorkflowProjectManager.getInstance().makeLocal(getProject());
getProject().fireElementChangeEvent(ChangeType.SETTINGS_CHANGE, getProject().getMdwVcsRepository());
MessageDialog.openInformation(getShell(), "Remote Project Unlocked", getProject().getName() + " has been unlocked. Please close any open assets and refresh.");
}
}
if (updateServerCacheCheckbox.getSelection() != originalRefreshServerCache)
getProject().fireElementChangeEvent(ChangeType.SETTINGS_CHANGE, getProject().isUpdateServerCache());
return true;
}
Aggregations