From 4f18c04e8770e47b7788e162d1cea861575ce179 Mon Sep 17 00:00:00 2001 From: Katja Luther Date: Tue, 29 Jan 2019 12:33:30 +0100 Subject: [PATCH] ref #7794: adapt label --- .../taxeditor/ApplicationWorkbenchAdvisor.java | 15 ++++++++++++++- .../classification/TaxonNodeWizardPage.java | 6 +++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/ApplicationWorkbenchAdvisor.java b/eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/ApplicationWorkbenchAdvisor.java index 633b92e8f..d87748aa8 100644 --- a/eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/ApplicationWorkbenchAdvisor.java +++ b/eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/ApplicationWorkbenchAdvisor.java @@ -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; } } diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/TaxonNodeWizardPage.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/TaxonNodeWizardPage.java index 07e8ff2ff..b82c232b7 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/TaxonNodeWizardPage.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/TaxonNodeWizardPage.java @@ -63,7 +63,11 @@ public class TaxonNodeWizardPage extends AbstractCdmEntityWizardPage 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; -- 2.34.1