### Eclipse Workspace Patch 1.0 #P org.jbpm.gd.jpdl Index: src/org/jbpm/gd/jpdl/deployment/ProcessArchiveDeployer.java =================================================================== --- src/org/jbpm/gd/jpdl/deployment/ProcessArchiveDeployer.java (revision 35350) +++ src/org/jbpm/gd/jpdl/deployment/ProcessArchiveDeployer.java (working copy) @@ -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(), Index: src/org/jbpm/gd/jpdl/deployment/DeploymentForm.java =================================================================== --- src/org/jbpm/gd/jpdl/deployment/DeploymentForm.java (revision 35350) +++ src/org/jbpm/gd/jpdl/deployment/DeploymentForm.java (working copy) @@ -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());