use of com.centurylink.mdw.plugin.project.model.ServerSettings in project mdw-designer by CenturyLinkCloud.
the class WorkflowElementActionHandler method debug.
public void debug(Object element) {
if (element instanceof WorkflowProcess) {
WorkflowProcess processVersion = (WorkflowProcess) element;
IEditorPart editorPart = findOpenEditor(processVersion);
if (editorPart != null && editorPart.isDirty()) {
if (MessageDialog.openQuestion(getShell(), "Process Launch", "Save process '" + processVersion.getLabel() + "' before launching?"))
editorPart.doSave(new NullProgressMonitor());
}
if (editorPart == null) {
// process must be open
open(processVersion);
}
ProcessLaunchShortcut launchShortcut = new ProcessLaunchShortcut();
launchShortcut.launch(new StructuredSelection(processVersion), ILaunchManager.DEBUG_MODE);
} else if (element instanceof Activity) {
Activity activity = (Activity) element;
WorkflowProcess processVersion = activity.getProcess();
IEditorPart editorPart = findOpenEditor(processVersion);
if (editorPart != null && editorPart.isDirty()) {
if (MessageDialog.openQuestion(getShell(), "Activity Launch", "Save process '" + processVersion.getLabel() + "' before launching?"))
editorPart.doSave(new NullProgressMonitor());
}
ActivityLaunchShortcut launchShortcut = new ActivityLaunchShortcut();
launchShortcut.launch(new StructuredSelection(activity), ILaunchManager.DEBUG_MODE);
} else if (element instanceof ExternalEvent) {
ExternalEvent externalEvent = (ExternalEvent) element;
ExternalEventLaunchShortcut launchShortcut = new ExternalEventLaunchShortcut();
launchShortcut.launch(new StructuredSelection(externalEvent), ILaunchManager.DEBUG_MODE);
} else if (element instanceof WorkflowProject || element instanceof ServerSettings) {
ServerSettings serverSettings;
if (element instanceof WorkflowProject) {
WorkflowProject workflowProject = (WorkflowProject) element;
serverSettings = workflowProject.getServerSettings();
} else {
serverSettings = (ServerSettings) element;
}
serverSettings.setDebug(true);
if (serverSettings.getDebugPort() == 0)
serverSettings.setDebugPort(8500);
run(serverSettings);
}
}
use of com.centurylink.mdw.plugin.project.model.ServerSettings in project mdw-designer by CenturyLinkCloud.
the class ProjectPersist method saveProjectPrefs.
/**
* Preferences may be local to a particular user, so save with workspace
* prefs
*/
public void saveProjectPrefs(IProject project) {
ServerSettings serverSettings = workflowProject.getServerSettings();
try {
setPersistentProperty(project, MDW_SERVER_HOME, serverSettings.getHome());
setPersistentProperty(project, MDW_SERVER_JDK_HOME, serverSettings.getJdkHome());
setPersistentProperty(project, MDW_SERVER_LOCATION, serverSettings.getServerLoc());
int cmdPort = serverSettings.getCommandPort();
if (cmdPort != 0)
setPersistentProperty(project, MDW_SERVER_CMD_PORT, String.valueOf(cmdPort));
String user = serverSettings.getUser();
setPersistentProperty(project, MDW_SERVER_USER, user);
if (user != null) {
String password = serverSettings.getPassword();
if (password != null) {
try {
setPersistentProperty(project, MDW_SERVER_PASSWORD, CryptUtil.encrypt(password));
} catch (GeneralSecurityException ex) {
PluginMessages.log(ex);
}
}
}
if (!workflowProject.isRemote()) {
// default prefs for server type
setPersistentProperty(MDW_SERVER_TYPE, serverSettings.getContainerType().toString());
setPersistentProperty(serverSettings.getContainerType() + "-" + MDW_SERVER_HOME, serverSettings.getHome());
setPersistentProperty(serverSettings.getContainerType() + "-" + MDW_SERVER_JDK_HOME, serverSettings.getJdkHome());
setPersistentProperty(serverSettings.getContainerType() + "-" + MDW_SERVER_HOST, serverSettings.getHost());
setPersistentProperty(serverSettings.getContainerType() + "-" + MDW_SERVER_PORT, String.valueOf(serverSettings.getPort() == 0 ? "" : serverSettings.getPort()));
setPersistentProperty(serverSettings.getContainerType() + "-" + MDW_SERVER_CMD_PORT, String.valueOf(serverSettings.getCommandPort() == 0 ? "" : serverSettings.getCommandPort()));
setPersistentProperty(serverSettings.getContainerType() + "-" + MDW_SERVER_USER, serverSettings.getUser());
setPersistentProperty(serverSettings.getContainerType() + "-" + MDW_SERVER_VERSION, serverSettings.getContainerVersion());
if (workflowProject.getPersistType() == PersistType.Git) {
VcsRepository vcsRepo = workflowProject.getMdwVcsRepository();
setPersistentProperty("MDW" + workflowProject.getMdwVersion() + "-" + MDW_VCS_GIT, vcsRepo.getProvider());
setPersistentProperty("MDW" + workflowProject.getMdwVersion() + "-" + MDW_VCS_REPO_URL, vcsRepo.getRepositoryUrl());
setPersistentProperty("MDW" + workflowProject.getMdwVersion() + "-" + MDW_VCS_USER, vcsRepo.getUser());
}
JdbcDataSource dataSource = workflowProject.getMdwDataSource();
setPersistentProperty("MDW" + workflowProject.getMdwVersion() + "-" + MDW_DB_DRIVER, dataSource.getDriver());
setPersistentProperty("MDW" + workflowProject.getMdwVersion() + "-" + MDW_DB_URL, dataSource.getJdbcUrl());
setPersistentProperty("MDW" + workflowProject.getMdwVersion() + "-" + MDW_DB_USER, dataSource.getDbUser());
setPersistentProperty(serverSettings.getContainerType() + "-" + MDW_SERVER_JAVA_OPTS, serverSettings.getJavaOptions());
}
if (serverSettings.isDebug()) {
setPersistentProperty(project, MDW_SERVER_DEBUG, "true");
setPersistentProperty(project, MDW_SERVER_DEBUG_PORT, String.valueOf(serverSettings.getDebugPort()));
setPersistentProperty(project, MDW_SERVER_SUSPEND, String.valueOf(serverSettings.isSuspend()));
} else {
setPersistentProperty(project, MDW_SERVER_DEBUG, null);
}
setPersistentProperty(project, LOG_WATCHER_PORT, String.valueOf(serverSettings.getLogWatcherPort()));
setPersistentProperty(project, LOG_WATCHER_TIMEOUT, String.valueOf(serverSettings.getLogWatcherTimeout()));
setPersistentProperty(project, STUB_SERVER_PORT, String.valueOf(serverSettings.getStubServerPort()));
setPersistentProperty(project, STUB_SERVER_TIMEOUT, String.valueOf(serverSettings.getStubServerTimeout()));
if (workflowProject.getPersistType() == PersistType.Git) {
setPersistentProperty(project, MDW_VCS_SYNC_ARCHIVE, String.valueOf(workflowProject.getMdwVcsRepository().isSyncAssetArchive()));
}
setPersistentProperty(project, MDW_UPDATE_SERVER_CACHE, String.valueOf(workflowProject.isUpdateServerCache()));
} catch (CoreException ex) {
PluginMessages.log(ex);
}
}
use of com.centurylink.mdw.plugin.project.model.ServerSettings in project mdw-designer by CenturyLinkCloud.
the class ServerPropertyPage method createContents.
@Override
protected Control createContents(Composite parent) {
noDefaultAndApplyButton();
initializeWorkflowProject();
workingCopy = new ServerSettings(getProject().getServerSettings());
Composite composite = createComposite(parent);
if (!workingCopy.isOsgi()) {
createServerRunnerControls(composite);
addSeparator(composite);
}
createLogWatcherControls(composite);
addSeparator(composite);
createStubServerControls(composite);
return composite;
}
use of com.centurylink.mdw.plugin.project.model.ServerSettings in project mdw-designer by CenturyLinkCloud.
the class TomcatSettingsPage method serverLocSpecializedCheck.
protected String serverLocSpecializedCheck(String serverLoc) {
ServerSettings serverSettings = getProject().getServerSettings();
serverSettings.setServerLoc(serverSettings.getHome());
return null;
}
Aggregations