Author: koen.aers(a)jboss.com
Date: 2011-10-05 12:35:04 -0400 (Wed, 05 Oct 2011)
New Revision: 35375
Modified:
trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/deployment/DeploymentForm.java
trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/deployment/ProcessArchiveDeployer.java
Log:
JBIDE-9750
Modified:
trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/deployment/DeploymentForm.java
===================================================================
---
trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/deployment/DeploymentForm.java 2011-10-05
14:16:11 UTC (rev 35374)
+++
trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/deployment/DeploymentForm.java 2011-10-05
16:35:04 UTC (rev 35375)
@@ -331,6 +331,9 @@
serverNameText.removeModifyListener(serverNameTextListener);
serverPortText.removeModifyListener(serverPortTextListener);
serverDeployerText.removeModifyListener(serverDeployerTextListener);
+ useCredentialsButton.removeSelectionListener(useCredentialsButtonSelectionListener);
+ userNameText.removeModifyListener(userNameTextListener);
+ passwordText.removeModifyListener(passwordTextListener);
}
private void updateControls() {
@@ -454,15 +457,30 @@
serverPortText.addModifyListener(serverPortTextListener);
serverDeployerText.addModifyListener(serverDeployerTextListener);
useCredentialsButton.addSelectionListener(useCredentialsButtonSelectionListener);
+ userNameText.addModifyListener(userNameTextListener);
+ passwordText.addModifyListener(passwordTextListener);
}
private SelectionListener useCredentialsButtonSelectionListener = new SelectionAdapter()
{
public void widgetSelected(SelectionEvent event) {
userNameText.setEnabled(useCredentialsButton.getSelection());
passwordText.setEnabled(useCredentialsButton.getSelection());
+ deploymentInfo.setUseCredentials(useCredentialsButton.getSelection());
}
};
+ private ModifyListener userNameTextListener = new ModifyListener() {
+ public void modifyText(ModifyEvent event) {
+ deploymentInfo.setUserName(userNameText.getText());
+ }
+ };
+
+ private ModifyListener passwordTextListener = new ModifyListener() {
+ public void modifyText(ModifyEvent event) {
+ deploymentInfo.setPassword(passwordText.getText());
+ }
+ };
+
private ModifyListener serverNameTextListener = new ModifyListener() {
public void modifyText(ModifyEvent event) {
deploymentInfo.setServerName(serverNameText.getText());
Modified:
trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/deployment/ProcessArchiveDeployer.java
===================================================================
---
trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/deployment/ProcessArchiveDeployer.java 2011-10-05
14:16:11 UTC (rev 35374)
+++
trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/deployment/ProcessArchiveDeployer.java 2011-10-05
16:35:04 UTC (rev 35375)
@@ -13,6 +13,7 @@
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.SWT;
import org.jbpm.gd.common.util.Base64Converter;
+import org.jbpm.gd.jpdl.Logger;
import org.jbpm.gd.jpdl.editor.JpdlEditor;
public class ProcessArchiveDeployer {
@@ -44,7 +45,7 @@
if (url == null) return false;
URLConnection connection = openConnection(url);
if (connection == null) return false;
- connection.setDoOutput(true);
+ prepareConnection(connection);
String response = receiveData(connection);
if (response == null) {
return false;
@@ -146,8 +147,14 @@
showFileNotFoundException();
return null;
} catch (IOException e) {
- showReceiveDataException();
- return null;
+ if (e.getMessage().contains("401")) {
+ showNotAuthorizedException();
+ return null;
+ } else {
+ Logger.logError("Unexpected IOException", e);
+ showReceiveDataException();
+ return null;
+ }
}
}
@@ -177,6 +184,18 @@
dialog.open();
}
+ private void showNotAuthorizedException() {
+ MessageDialog dialog = new MessageDialog(
+ jpdlEditor.getSite().getShell(),
+ "Authorization Failed",
+ null,
+ "The used credentials are not allowed to establish a connection to the
server.",
+ SWT.ICON_ERROR,
+ new String[] { "OK" },
+ 0);
+ dialog.open();
+ }
+
private void showFileNotFoundException() {
MessageDialog dialog = new MessageDialog(
jpdlEditor.getSite().getShell(),
Show replies by date