ref #7794: adapt label
authorKatja Luther <k.luther@bgbm.org>
Tue, 29 Jan 2019 11:33:30 +0000 (12:33 +0100)
committerKatja Luther <k.luther@bgbm.org>
Tue, 29 Jan 2019 11:33:30 +0000 (12:33 +0100)
eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/ApplicationWorkbenchAdvisor.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/TaxonNodeWizardPage.java

index 633b92e8f5a4b0276ac31d4dfbb1433ff5ee282c..d87748aa890304d6003817468bf49d2c52dae9b3 100644 (file)
@@ -1,6 +1,7 @@
 package eu.etaxonomy.taxeditor;
 
 
+import org.apache.http.NoHttpResponseException;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.ui.application.IWorkbenchConfigurer;
 import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
@@ -13,6 +14,7 @@ import org.springframework.remoting.RemoteConnectFailureException;
 
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
+import eu.etaxonomy.taxeditor.store.CdmAuthenticationException;
 
 
 
@@ -118,7 +120,15 @@ public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {
                    }
                        previousT = t;
 
+                if (t != null && (t.getCause() instanceof RemoteAccessException || t instanceof NoHttpResponseException || t.getCause() instanceof CdmAuthenticationException || t.getMessage().contains("status code = 403"))){
+                    MessagingUtils.errorDialog("Access denied",
+                            null,
+                            MessagingUtils.ACCESS_DENIED,
+                            statusAdapter.getStatus().getPlugin(),
+                            t.getCause(),
+                            false);
 
+                }else
 
                        // NOTE : Currently we only allow RuntimeExceptions since
                        //        allowing all kinds of exceptions would also include
@@ -166,7 +176,7 @@ public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {
                        return true;
                    }
                    if(t instanceof RemoteAccessException ||
-                           t.getCause() instanceof RemoteAccessException) {
+                           t.getCause() instanceof RemoteAccessException ) {
                        MessagingUtils.errorDialog("Remote Access Error",
                                null,
                                MessagingUtils.REMOTE_ACCESS_FAILURE_MESSAGE + System.getProperty("line.separator"),
@@ -176,6 +186,9 @@ public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {
                                true);
                        return true;
                    }
+                   if (t instanceof CdmAuthenticationException){
+                       MessagingUtils.info("You are logged in now but you are not permitted to use the TaxEditor with the selected data source");
+                   }
                    return false;
                }
        }
index 07e8ff2ff1f0af27af77982627b7665098839349..b82c232b769fa8f19a45aee5c5e52b432b1ee7cd 100644 (file)
@@ -63,7 +63,11 @@ public class TaxonNodeWizardPage extends AbstractCdmEntityWizardPage<TaxonNode>
                        ConversationHolder conversation, TaxonNode entity, IWizardPageListener closeOnEnterListener, boolean isCreateNew) {
                super(formFactory, conversation, entity);
                this.wizardPageListener = closeOnEnterListener;
-               setTitle("Edit taxon node");
+               if (isCreateNew){
+                   setTitle("New Taxon");
+               }else{
+                   setTitle("Edit Taxon Node");
+               }
                this.isCreateNew = isCreateNew;