import eu.etaxonomy.cdm.api.application.CdmApplicationRemoteConfiguration;
import eu.etaxonomy.cdm.api.application.CdmApplicationState;
import eu.etaxonomy.cdm.api.service.IUserService;
+import eu.etaxonomy.cdm.common.CdmUtils;
+import eu.etaxonomy.cdm.config.CdmSourceException;
import eu.etaxonomy.cdm.model.metadata.CdmMetaData;
import eu.etaxonomy.cdm.persistence.permission.Role;
import eu.etaxonomy.taxeditor.l10n.Messages;
private final static String MESG_COMPATIBLE_EDITOR_OLD = Messages.RemotingLoginDialog_UPDATE_EDITOR;
private final static String MESG_COMPATIBLE_SERVER_OLD = Messages.RemotingLoginDialog_CHOOSE_COMPATIBLE_CDM_SERVER;
+ private final static String MESG_SCHEMA_MISSING = Messages.RemotingLoginDialog_SCHEMA_MISSING;
+ private final static String MESG_NO_SCHEMA = Messages.RemotingLoginDialog_NO_SCHEMA;
+
+ private final static String LABEL_CONNECT = Messages.RemotingLoginDialog_LABEL_CONNECT;
+ private final static String LABEL_CREATE_SCHEMA = Messages.RemotingLoginDialog_LABEL_CREATE_SCHEMA;
+ private final static String LABEL_UPDATE_SCHEMA_VERSION = Messages.RemotingLoginDialog_LABEL_UPDATE_SCHEMA_VERSION;
+ private final static String MESG_UPDATE_SCHEMA_VERSION = Messages.RemotingLoginDialog_MSG_UPDATE_SCHEMA_VERSION;
private final static String STORE_PREFERENCES_NODE = "eu.etaxonomy.taxeditor.store"; //$NON-NLS-1$
private final static String LAST_INSTANCE_KEY = "lastInstanceKey"; //$NON-NLS-1$
private Composite remotingComposite;
- private CdmServerInfo selectedCsii;
+ private CdmServerInfo selectedServerInfo;
private CdmInstanceInfo selectedCdmInstance;
private Button btnCdmServerRefresh;
private Button btnCdmInstanceRefresh;
private Text txtPort;
private Label lblServerVersion;
private Text txtServerVersion;
- private ExpandableComposite xpndblcmpstAdvanced;
+ private ExpandableComposite expandableCompositeAdvanced;
private StyledText styledTxtMessage;
// private final int MIN_WIDTH = 530;
private final int MESSAGE_HEIGHT = 50;
private Label lblEditorVersion;
private Text txtEditorVersion;
- private Label lblServerCDMVersion;
- private Text txtServerCDMVersion;
- private Label lblEditorCDMVersion;
- private Text txtEditorCDMVersion;
+ private Label lblServerCdmVersion;
+ private Text txtServerCdmVersion;
+ private Label lblEditorCdmVersion;
+ private Text txtEditorCdmVersion;
private String serverName, instanceName;
private boolean autoConnect = false;
return open(serverName, instanceName, loadLoginPrefs, autoConnect);
}
-
public Object open(String serverName, String instanceName, boolean loadLoginPrefs, boolean autoConnect) {
this.serverName = serverName;
this.instanceName = instanceName;
shlConnect.pack(true);
shlConnect.open();
- xpndblcmpstAdvanced.setExpanded(false);
+ expandableCompositeAdvanced.setExpanded(false);
Display display = getParent().getDisplay();
*/
private void createContents() {
shlConnect = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL | SWT.RESIZE);
- shlConnect.setText(Messages.RemotingLoginDialog_LABEL_CONNECT);
+ shlConnect.setText(LABEL_CONNECT);
shlConnect.setLayout(new FillLayout(SWT.HORIZONTAL));
remotingComposite = new Composite(shlConnect, SWT.NONE);
remotingComposite.setLayout(new GridLayout(1, false));
+ //server
Composite cdmServerComposite = new Composite(remotingComposite, SWT.NONE);
GridData gd_cdmServerComposite = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
cdmServerComposite.setLayoutData(gd_cdmServerComposite);
btnCdmServerRefresh.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
btnCdmServerRefresh.setText(Messages.RemotingLoginDialog_LABEL_REFRESH);
+ //instance
Label lblCdmInstance = new Label(cdmServerComposite, SWT.NONE);
GridData gd_lblCdmInstance = new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1);
//gd_lblCdmInstance.heightHint = 30;
btnCdmInstanceRefresh.setLayoutData(gd_btnCdmInstanceRefresh);
btnCdmInstanceRefresh.setText(Messages.RemotingLoginDialog_LABEL_REFRESH);
+ //login
loginComposite = new Composite(remotingComposite, SWT.NONE);
GridData gd_loginComposite = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
loginComposite.setLayoutData(gd_loginComposite);
GridData gd_txtPassword = new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1);
gd_txtPassword.minimumWidth = 80;
txtPassword.setLayoutData(gd_txtPassword);
- new Label(loginComposite, SWT.NONE);
+ @SuppressWarnings("unused")
+ Label nope = new Label(loginComposite, SWT.NONE);
txtPassword.addKeyListener(new KeyAdapter() {
@Override
public void keyPressed(KeyEvent e) {
connectButtonPressed();
}
});
- btnConnect.setText(Messages.RemotingLoginDialog_LABEL_CONNECT);
+ btnConnect.setText(LABEL_CONNECT);
btnRememberMe = new Button(loginComposite, SWT.CHECK);
btnRememberMe.setSelection(true);
styledTxtMessage.setLayoutData(gd_styledTxtMessage);
- xpndblcmpstAdvanced = new ExpandableComposite(remotingComposite, SWT.NONE, ExpandableComposite.TWISTIE);
+ //Advanced
+ expandableCompositeAdvanced = new ExpandableComposite(remotingComposite, SWT.NONE, ExpandableComposite.TWISTIE);
GridData gd_xpndblcmpstAdvanced = new GridData(SWT.FILL, SWT.FILL, false, true, 1, 1);
- xpndblcmpstAdvanced.setLayoutData(gd_xpndblcmpstAdvanced);
- xpndblcmpstAdvanced.addExpansionListener(new IExpansionListener() {
+ expandableCompositeAdvanced.setLayoutData(gd_xpndblcmpstAdvanced);
+ expandableCompositeAdvanced.addExpansionListener(new IExpansionListener() {
@Override
public void expansionStateChanged(ExpansionEvent e) {
shlConnect.pack(true);
public void expansionStateChanging(ExpansionEvent e) {
}
});
- xpndblcmpstAdvanced.setText(Messages.RemotingLoginDialog_LABEL_ADVANCED);
- xpndblcmpstAdvanced.setExpanded(true);
+ expandableCompositeAdvanced.setText(Messages.RemotingLoginDialog_LABEL_ADVANCED);
+ expandableCompositeAdvanced.setExpanded(true);
- compAdvanced = new Composite(xpndblcmpstAdvanced, SWT.NONE);
- xpndblcmpstAdvanced.setClient(compAdvanced);
+ compAdvanced = new Composite(expandableCompositeAdvanced, SWT.NONE);
+ expandableCompositeAdvanced.setClient(compAdvanced);
compAdvanced.setLayout(new GridLayout(4, false));
lblPort = new Label(compAdvanced, SWT.CENTER);
txtEditorVersion.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
addEmptyCells(2);
- lblServerCDMVersion = new Label(compAdvanced, SWT.CENTER);
- lblServerCDMVersion.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
- lblServerCDMVersion.setText(Messages.RemotingLoginDialog_LABEL_SERVER_CDM_VERSION);
- lblServerCDMVersion.setFont(SWTResourceManager.getFont(UBUNTU, 9, SWT.NORMAL));
+ lblServerCdmVersion = new Label(compAdvanced, SWT.CENTER);
+ lblServerCdmVersion.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
+ lblServerCdmVersion.setText(Messages.RemotingLoginDialog_LABEL_SERVER_CDM_VERSION);
+ lblServerCdmVersion.setFont(SWTResourceManager.getFont(UBUNTU, 9, SWT.NORMAL));
- txtServerCDMVersion = new Text(compAdvanced, SWT.BORDER);
- txtServerCDMVersion.setEditable(false);
- txtServerCDMVersion.setLayoutData(new GridData(SWT.FILL, SWT.CENTER , true, false, 1, 1));
+ txtServerCdmVersion = new Text(compAdvanced, SWT.BORDER);
+ txtServerCdmVersion.setEditable(false);
+ txtServerCdmVersion.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
addEmptyCells(2);
- lblEditorCDMVersion = new Label(compAdvanced, SWT.CENTER);
- lblEditorCDMVersion.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
- lblEditorCDMVersion.setText(Messages.RemotingLoginDialog_LABEL_EDITOR_CDM_VERSION);
- lblEditorCDMVersion.setFont(SWTResourceManager.getFont(UBUNTU, 9, SWT.NORMAL));
+ lblEditorCdmVersion = new Label(compAdvanced, SWT.CENTER);
+ lblEditorCdmVersion.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
+ lblEditorCdmVersion.setText(Messages.RemotingLoginDialog_LABEL_EDITOR_CDM_VERSION);
+ lblEditorCdmVersion.setFont(SWTResourceManager.getFont(UBUNTU, 9, SWT.NORMAL));
- txtEditorCDMVersion = new Text(compAdvanced, SWT.BORDER);
- txtEditorCDMVersion.setEditable(false);
- txtEditorCDMVersion.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
+ txtEditorCdmVersion = new Text(compAdvanced, SWT.BORDER);
+ txtEditorCdmVersion.setEditable(false);
+ txtEditorCdmVersion.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
}
@SuppressWarnings("unused")
}
private void connectButtonPressed() {
- if(selectedCsii.isLocalhostMgd() && !isSelectedCdmInstanceRunningInManagedServer()) {
+ if(selectedServerInfo.isLocalhostMgd() && !isSelectedCdmInstanceRunningInManagedServer()) {
startManagedServer();
} else {
connect();
private void updateSelectedCdmServer() {
int selIndex = comboCdmServer.getSelectionIndex();
if(selIndex != -1) {
- selectedCsii = csiiMap.get(comboCdmServer.getItem(selIndex));
+ selectedServerInfo = csiiMap.get(comboCdmServer.getItem(selIndex));
}
}
private void updatePort() {
txtPort.setText(""); //$NON-NLS-1$
- if(selectedCsii != null) {
- int port = selectedCsii.getPort();
+ if(selectedServerInfo != null) {
+ int port = selectedServerInfo.getPort();
if(port == CdmServerInfo.NULL_PORT) {
txtPort.setText(CdmServerInfo.NULL_PORT_STRING);
} else {
private void checkSelectedCdmServer() {
try{
- if(selectedCsii != null) {
- if(selectedCsii.isLocalhost()) {
+ if(selectedServerInfo != null) {
+ if(selectedServerInfo.isLocalhost()) {
txtPort.setEditable(true);
txtPort.setEnabled(true);
}
try {
- if(selectedCsii.pingServer()) {
+ if(selectedServerInfo.pingServer()) {
txtCdmServerStatus.setText(STATUS_AVAILABLE);
populateCdmInstanceCombo(true);
- String serverVersionTimestamp = generateLastModifiedTooltip(selectedCsii.getCdmlibLastModified());
- txtServerVersion.setText(selectedCsii.getCdmlibServicesVersion() + ":" + serverVersionTimestamp); //$NON-NLS-1$
+ String serverVersionTimestamp = generateLastModifiedTooltip(selectedServerInfo.getCdmlibLastModified());
+ txtServerVersion.setText(selectedServerInfo.getCdmlibServicesVersion() + ":" + serverVersionTimestamp); //$NON-NLS-1$
} else {
txtCdmServerStatus.setText(STATUS_NOT_AVAILABLE);
comboCdmInstance.removeAll();
@Override
protected IStatus run(IProgressMonitor monitor) {
try {
- if(selectedCsii != null) {
+ if(selectedServerInfo != null) {
if(forceRefresh) {
- selectedCsii.refreshInstances();
+ selectedServerInfo.refreshInstances();
}
- final List<CdmInstanceInfo> instances = selectedCsii.getInstances();
+ final List<CdmInstanceInfo> instances = selectedServerInfo.getInstances();
Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() {
private void updateSelectedCdmInstance() {
int selIndex = comboCdmInstance.getSelectionIndex();
if(selIndex != -1) {
- selectedCdmInstance = selectedCsii.getInstanceFromName(comboCdmInstance.getItem(selIndex));
-
+ selectedCdmInstance = selectedServerInfo.getInstanceFromName(comboCdmInstance.getItem(selIndex));
if(loadLoginPrefs) {
readPrefCredentials();
}
}
private void updateManagedServerControls() {
- if(selectedCsii.isLocalhostMgd()) {
+ if(selectedServerInfo.isLocalhostMgd()) {
if(isSelectedCdmInstanceRunningInManagedServer()) {
txtCdmInstanceStatus.setText(STATUS_STARTED);
} else {
txtCdmInstanceStatus.setText(STATUS_NOT_STARTED);
}
btnConnect.setEnabled(true);
- selectedCsii.setPort(getManagedServerPort());
+ selectedServerInfo.setPort(getManagedServerPort());
updatePort();
}
private boolean isSelectedCdmInstanceRunningInManagedServer() {
return CdmStore.getManagedServer() != null &&
CdmStore.getManagedServer().isAlive() &&
- selectedCsii.isLocalhostMgd() &&
+ selectedServerInfo.isLocalhostMgd() &&
CdmStore.getManagedServer().getDataSourceName().equals(selectedCdmInstance.getName());
}
}
}
+ boolean forceSchemaCreate = !schemaExists(selectedCdmInstance);
+ boolean forceSchemaUpdate = LABEL_UPDATE_SCHEMA_VERSION.equals(btnConnect.getText());
+
Job job = new Job(Messages.RemotingLoginDialog_JOB_SERVER_LAUNCH) {
@Override
monitor.subTask(String.format(Messages.RemotingLoginDialog_GENERATING_CONFIG_FILE, selectedCdmInstance.getName()));
File managedServerConfigFile = CdmServerUtils.writeManagedServerConfig(config, mgdServerConfigFileName);
monitor.worked(1);
- boolean forceSchemaCreate = CdmStore.getManagedServer() != null
- && CdmStore.getManagedServer().getDataSourceName().equals(selectedCdmInstance.getName())
- && CdmStore.getManagedServer().isForceSchemaCreate();
- CdmStore.setManagedServer(new CdmServer(selectedCdmInstance.getName(), managedServerConfigFile));
- CdmStore.getManagedServer().setForceSchemaCreate(forceSchemaCreate);
+ CdmServer cdmServer = new CdmServer(selectedCdmInstance.getName(), managedServerConfigFile);
+// boolean forceSchemaCreate = CdmStore.getManagedServer() != null
+// && CdmStore.getManagedServer().getDataSourceName().equals(selectedCdmInstance.getName())
+// && CdmStore.getManagedServer().isForceSchemaCreate();
+ cdmServer.setForceSchemaCreate(forceSchemaCreate);
+ cdmServer.setForceSchemaUpdate(forceSchemaUpdate);
+ CdmStore.setManagedServer(cdmServer);
monitor.subTask(Messages.RemotingLoginDialog_STARTING_MGD_SERVER);
- CdmStore.getManagedServer().start(false, RemotingLoginDialog.this);
+ cdmServer.start(false, RemotingLoginDialog.this);
int serverUnits = 0;
// the following loop is a 'fake' progress monitoring where the progress
return Status.OK_STATUS;
}
- };
+
+ };
// configure the job
job.setProperty(IProgressConstants.KEEP_PROPERTY, true);
job.schedule();
}
+ private boolean schemaExists(CdmInstanceInfo instanceInfo) {
+ if (instanceInfo.getDataSource() != null){
+ try {
+ //TODO we need a new method in cdmlib to check for existing schema
+ String schemaVersion = instanceInfo.getDataSource().getDbSchemaVersion();
+ return schemaVersion != null;
+ } catch (CdmSourceException e) {
+ return false;
+ }
+ }else{
+ return true;
+ }
+ }
+
+ private String managedSchemaVersion(CdmInstanceInfo instanceInfo) throws CdmSourceException{
+ if (instanceInfo.getDataSource() != null){
+ return instanceInfo.getDataSource().getDbSchemaVersion();
+ }else{
+ throw new RuntimeException("ManagedSchemaVersion only available for managed server instances.");
+ }
+ }
+ private int compareSchemaVersion(CdmInstanceInfo instanceInfo) throws CdmSourceException {
+ return CdmMetaData.compareVersion(managedSchemaVersion(instanceInfo), CdmMetaData.getDbSchemaVersion(), 3, null);
+ }
+
@Override
public void handleError(final Throwable t) {
if(CdmStore.getManagedServer().isFailed() && CdmStore.getManagedServer().isPotentiallyMissingSchema()) {
CdmStore.getManagedServer().setForceSchemaCreate(true);
// we are in a separate thread here, thus update the screen via
- Display.getDefault().asyncExec(new Runnable() {
- @Override
- public void run() {
- btnConnect.setEnabled(true);
- btnConnect.setText("Create Schema");
- btnConnect.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
- btnConnect.requestLayout();
- }
- });
+ checkManagedSelectedInstance();
} else {
Display.getDefault().syncExec(new Runnable() {
@Override
}
private void checkSelectedCdmInstance() {
- boolean available = false;
- String status = STATUS_NOT_AVAILABLE;
- String message = null;
- if(txtCdmServerStatus.getText().equals(STATUS_AVAILABLE)) {
+ if (selectedServerInfo.isLocalhostMgd()){
+ checkManagedSelectedInstance();
+ }else if (txtCdmServerStatus.getText().equals(STATUS_AVAILABLE)) {
+ boolean available = false;
+ String instanceStatus = STATUS_NOT_AVAILABLE;
+ String message = null;
try {
- if(selectedCsii.pingInstance(selectedCdmInstance, getPort())) {
- status = STATUS_AVAILABLE;
+ if(selectedServerInfo.pingInstance(selectedCdmInstance, getPort())) {
+ instanceStatus = STATUS_AVAILABLE;
available = true;
} else {
- status = STATUS_NOT_AVAILABLE;
+ instanceStatus = STATUS_NOT_AVAILABLE;
available = false;
}
if(available) {
- txtServerCDMVersion.setText(selectedCsii.getCdmRemoteSource(selectedCdmInstance, getPort()).getDbSchemaVersion());
- int compareDbSchemaVersion = selectedCsii.compareDbSchemaVersion(selectedCdmInstance, getPort());
+ txtServerCdmVersion.setText(selectedServerInfo.getCdmRemoteSource(selectedCdmInstance, getPort()).getDbSchemaVersion());
+
+ int compareDbSchemaVersion = selectedServerInfo.compareDbSchemaVersion(selectedCdmInstance, getPort());
+
int compareCdmlibServicesVersion = 0;
boolean disableServicesApiTimestampCheck =
PreferencesUtil.getBooleanValue((IPreferenceKeys.DISABLE_SERVICES_API_TIMESTAMP_CHECK));
if(!disableServicesApiTimestampCheck) {
- compareCdmlibServicesVersion = selectedCsii.compareCdmlibServicesVersion();
+ compareCdmlibServicesVersion = selectedServerInfo.compareCdmlibServicesVersion();
}
+
if(compareDbSchemaVersion > 0 || compareCdmlibServicesVersion > 0) {
- status = STATUS_NOT_COMPATIBLE;
+ instanceStatus = STATUS_NOT_COMPATIBLE;
available = false;
message = MESG_COMPATIBLE_EDITOR_OLD;
} else if(compareDbSchemaVersion < 0 || compareCdmlibServicesVersion < 0) {
- status = STATUS_NOT_COMPATIBLE;
+ instanceStatus = STATUS_NOT_COMPATIBLE;
available = false;
message = MESG_COMPATIBLE_SERVER_OLD;
} else {
- status = STATUS_AVAILABLE;
+ instanceStatus = STATUS_AVAILABLE;
available = true;
message = ""; //$NON-NLS-1$
}
txtCdmInstanceStatus.setToolTipText(e.getMessage());
} finally {
btnConnect.setEnabled(available);
- txtCdmInstanceStatus.setText(status);
+ txtCdmInstanceStatus.setText(instanceStatus);
if(!StringUtils.isBlank(message)) {
setMessage(message);
}
}
}
+ private void checkManagedSelectedInstance() {
+ boolean available = false;
+ String instanceStatus = STATUS_NOT_AVAILABLE;
+ String message = null;
+ String connect = LABEL_CONNECT;
+ int color = SWT.COLOR_BLACK;
+ String schemaVersion = CdmMetaData.getDbSchemaVersion();
+
+ if (!schemaExists(selectedCdmInstance)){
+ message = MESG_SCHEMA_MISSING;
+ connect = LABEL_CREATE_SCHEMA;
+ color = SWT.COLOR_RED;
+ schemaVersion = MESG_NO_SCHEMA;
+ } else {
+ int compare;
+ try {
+ schemaVersion = managedSchemaVersion(selectedCdmInstance);
+ compare = compareSchemaVersion(selectedCdmInstance);
+ if (compare > 0){
+ instanceStatus = STATUS_NOT_COMPATIBLE;
+ message = MESG_COMPATIBLE_EDITOR_OLD;
+ available = false;
+ }else if (compare < 0){
+ instanceStatus = STATUS_NOT_COMPATIBLE;
+ message = MESG_UPDATE_SCHEMA_VERSION;
+ available = true;
+ connect = LABEL_UPDATE_SCHEMA_VERSION;
+ color = SWT.COLOR_RED;
+ }else{
+ available = true;
+ }
+ } catch (CdmSourceException e) {
+ available = false;
+ }
+ }
+
+// Display.getDefault().asyncExec(()->{
+ btnConnect.setEnabled(available);
+ btnConnect.setText(connect);
+ btnConnect.setBackground(Display.getCurrent().getSystemColor(color));
+ btnConnect.requestLayout();
+ txtCdmInstanceStatus.setText(instanceStatus);
+ txtServerCdmVersion.setText(schemaVersion);
+
+// });
+
+// if(!StringUtils.isBlank(message)) {
+ setMessage(message);
+// }
+ }
+
private void connect() {
checkSelectedCdmInstance();
return;
}
- ICdmRemoteSource source = selectedCsii.getCdmRemoteSource(selectedCdmInstance, getPort());
+ ICdmRemoteSource source = selectedServerInfo.getCdmRemoteSource(selectedCdmInstance, getPort());
if(!validateLogin(source)) {
return;
IEclipsePreferences preferences = ConfigurationScope.INSTANCE.getNode(STORE_PREFERENCES_NODE);
Preferences lastServerInstancePrefs = preferences.node(LAST_SERVER_INSTANCE_NODE);
- lastServerInstancePrefs.put(LAST_SERVER_KEY, selectedCsii.getName());
+ lastServerInstancePrefs.put(LAST_SERVER_KEY, selectedServerInfo.getName());
lastServerInstancePrefs.put(LAST_INSTANCE_KEY, selectedCdmInstance.getName());
flushPreferences(lastServerInstancePrefs);
}
private String getUsernamePrefKey() {
- return selectedCsii.toString(selectedCdmInstance.getName(), isDevRemoteSource?getPort():-1) + USERNAME_SUFFIX;
+ return selectedServerInfo.toString(selectedCdmInstance.getName(), isDevRemoteSource?getPort():-1) + USERNAME_SUFFIX;
}
private String getPasswordPrefKey() {
- return selectedCsii.toString(selectedCdmInstance.getName(), isDevRemoteSource?getPort():-1) + PASSWORD_SUFFIX;
+ return selectedServerInfo.toString(selectedCdmInstance.getName(), isDevRemoteSource?getPort():-1) + PASSWORD_SUFFIX;
}
private boolean validateLogin(ICdmRemoteSource remoteSource) {
}
public void setMessage(String message) {
- if(message != null && !message.isEmpty()) {
+ if(CdmUtils.isNotBlank(message)) {
// if(message.length() > 50) {
// styledTxtMessage.setToolTipText(message);
// message = message.substring(0,50) + "..."; //$NON-NLS-1$
}
private void setEditorInfo() {
- txtEditorCDMVersion.setText(CdmMetaData.getDbSchemaVersion());
+ txtEditorCdmVersion.setText(CdmMetaData.getDbSchemaVersion());
String editorVersionTimestamp = generateLastModifiedTooltip(CdmApplicationState.getCdmlibLastModified());
txtEditorVersion.setText(CdmApplicationState.getCdmlibVersion() + ":" + editorVersionTimestamp); //$NON-NLS-1$
}
private void clearOnServerChange() {
setMessage(""); //$NON-NLS-1$
- txtServerCDMVersion.setText(""); //$NON-NLS-1$
+ txtServerCdmVersion.setText(""); //$NON-NLS-1$
txtServerVersion.setText(""); //$NON-NLS-1$
txtServerVersion.setToolTipText(""); //$NON-NLS-1$
- txtServerCDMVersion.setText(""); //$NON-NLS-1$
+ txtServerCdmVersion.setText(""); //$NON-NLS-1$
comboCdmInstance.removeAll();
txtCdmInstanceStatus.setText(""); //$NON-NLS-1$
txtPort.setEditable(false);
private void clearOnInstanceChange() {
setMessage(""); //$NON-NLS-1$
- txtServerCDMVersion.setText(""); //$NON-NLS-1$
+ txtServerCdmVersion.setText(""); //$NON-NLS-1$
}
}