From: Katja Luther Date: Thu, 16 Jul 2015 11:50:46 +0000 (+0200) Subject: changes for #4908 X-Git-Tag: 3.8.0^2~43^2~31 X-Git-Url: https://dev.e-taxonomy.eu/gitweb/taxeditor.git/commitdiff_plain/e984ad30adf923b8ad5b8b8e991d7d5aea1305ee changes for #4908 --- diff --git a/eu.etaxonomy.taxeditor.bulkeditor/OSGI-INF/l10n/bundle.properties b/eu.etaxonomy.taxeditor.bulkeditor/OSGI-INF/l10n/bundle.properties index 8858bb121..f77e70cbb 100644 --- a/eu.etaxonomy.taxeditor.bulkeditor/OSGI-INF/l10n/bundle.properties +++ b/eu.etaxonomy.taxeditor.bulkeditor/OSGI-INF/l10n/bundle.properties @@ -15,7 +15,7 @@ command.label.1 = Set as Candidate(s) for Duplicate Removal command.label.2 = Remove as Candidate(s) for Duplicate Removal command.label.3 = De-Duplicate Group command.label.4 = Delete -command.label.5 = Convert Team to Person +command.label.5 = Convert to Person command.name = Merge Group command.name.0 = Set as Target for Group Merge command.name.1 = Dynamic Open Bulk Editor @@ -26,9 +26,9 @@ command.name.4 = Set as Candidate for Group Merge command.name.5 = Remove as Candidate for Group Merge command.name.6 = Set Marker Flag command.name.7 = delete -command.name.8 = convert Team to Person -command.name.9 = convert Person to Team +command.name.8 = convert to Person +command.name.9 = convert to Team specification.label = Merge Candidate Annotation specification.label.0 = Merge Target Annotation -command.label.6 = Convert Person to Team +command.label.6 = Convert to Team command.name.10 = convert Person to Team \ No newline at end of file diff --git a/eu.etaxonomy.taxeditor.bulkeditor/OSGI-INF/l10n/bundle_de.properties b/eu.etaxonomy.taxeditor.bulkeditor/OSGI-INF/l10n/bundle_de.properties index c05c77c3c..1365dd139 100644 --- a/eu.etaxonomy.taxeditor.bulkeditor/OSGI-INF/l10n/bundle_de.properties +++ b/eu.etaxonomy.taxeditor.bulkeditor/OSGI-INF/l10n/bundle_de.properties @@ -14,4 +14,6 @@ command.label.0 = Markiere Zeile als Ziel f\u00fcr Duplikatenentfernung command.label.1 = Markiere als Kandidat(en) f\u00fcr Duplikatenentfernung command.label.2 = Entferne Kandidat f\u00fcr Duplikatenentfernung command.label.3 = Dedupliziere Gruppe -command.label.4 = L\u00f6schen \ No newline at end of file +command.label.4 = L\u00f6schen +command.label.5 = Umwandeln in Person +command.label.6 = Umwandeln in Team \ No newline at end of file diff --git a/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/ConvertPerson2TeamHandler.java b/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/ConvertPerson2TeamHandler.java index cb3a610ed..ee587aaa6 100644 --- a/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/ConvertPerson2TeamHandler.java +++ b/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/ConvertPerson2TeamHandler.java @@ -29,6 +29,7 @@ import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityPersistenceService; import eu.etaxonomy.taxeditor.annotatedlineeditor.LineAnnotation; import eu.etaxonomy.taxeditor.annotatedlineeditor.LineAnnotationModel; import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor; +import eu.etaxonomy.taxeditor.bulkeditor.internal.TaxeditorBulkeditorPlugin; import eu.etaxonomy.taxeditor.model.MessagingUtils; import eu.etaxonomy.taxeditor.store.CdmStore; @@ -79,12 +80,12 @@ public class ConvertPerson2TeamHandler extends AbstractHandler { try { team = CdmStore.getService(IAgentService.class).convertPerson2Team(person); } catch (IllegalArgumentException e) { - MessagingUtils.errorDialog("Can not convert Team to Person", null, e.getMessage(), null,e, true); + MessagingUtils.errorDialog("Can not convert Person into a Team", null, e.getLocalizedMessage(), TaxeditorBulkeditorPlugin.PLUGIN_ID,e, true); } catch (MergeException e) { - MessagingUtils.errorDialog("Can not convert Team to Person", null, e.getMessage(), null,e, true); + MessagingUtils.errorDialog("Can not convert Person into a Team", null, e.getMessage(), TaxeditorBulkeditorPlugin.PLUGIN_ID,e, true); } }else{ - MessagingUtils.informationDialog("Can not convert Team to Person", "convertTeam2Person can only be called on a team."); + MessagingUtils.informationDialog("Can not convert Person into a Team", "convert Person to Team can only be called on a person."); } if (team != null){ diff --git a/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/DeleteHandler.java b/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/DeleteHandler.java index a34d7c5d1..041359836 100644 --- a/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/DeleteHandler.java +++ b/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/DeleteHandler.java @@ -44,7 +44,6 @@ import eu.etaxonomy.cdm.model.common.CdmBase; import eu.etaxonomy.cdm.model.common.Group; import eu.etaxonomy.cdm.model.common.IdentifiableEntity; import eu.etaxonomy.cdm.model.common.User; - import eu.etaxonomy.cdm.model.name.TaxonNameBase; import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase; import eu.etaxonomy.cdm.model.reference.Reference; @@ -57,9 +56,8 @@ import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityPersistenceService; import eu.etaxonomy.taxeditor.annotatedlineeditor.LineAnnotation; import eu.etaxonomy.taxeditor.annotatedlineeditor.LineAnnotationModel; import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor; +import eu.etaxonomy.taxeditor.bulkeditor.internal.TaxeditorBulkeditorPlugin; import eu.etaxonomy.taxeditor.bulkeditor.referencingobjects.ReferencingObjectsView; - - import eu.etaxonomy.taxeditor.model.MessagingUtils; import eu.etaxonomy.taxeditor.preference.IPreferenceKeys; import eu.etaxonomy.taxeditor.preference.PreferencesUtil; @@ -158,19 +156,30 @@ public class DeleteHandler extends AbstractHandler { result = service.delete((TeamOrPersonBase)object); } } catch (Exception e){ - MessagingUtils.messageDialog("Exception occured. Could not delete", getClass(), e.getMessage(), null); + MessagingUtils.errorDialog("Exception occured. Delete not possible", getClass(), e.getMessage(), TaxeditorBulkeditorPlugin.PLUGIN_ID, null, true); } if (result.isError() || result.isAbort()){ if (!result.getExceptions().isEmpty()) { - MessagingUtils.messageDialog("Could not delete", getClass(), result.getExceptions().toString(), null); + String message = null; + int i = result.getExceptions().size(); + for (Exception e:result.getExceptions()){ + i--; + message+= e.getMessage(); + if (i>0){ + message+= ", "; + } + } + + + MessagingUtils.messageDialog("Delete not possible", getClass(), result.getExceptions().toString(), null); }else{ - MessagingUtils.messageDialog("Could not delete", getClass(), "The object could not be deleted. An exception occured.", null); + MessagingUtils.messageDialog("Delete not possible", getClass(), "The object could not be deleted. An exception occured.", null); } } if (result.isOk() ){ ((BulkEditor) editor).removeAnnotatedLine(annotation); - if(result.getUpdatedObjects().size() != 0 && !result.getExceptions().isEmpty()){ + if(result.getUpdatedObjects().size() != 0 || !result.getExceptions().isEmpty()){ MessagingUtils.informationDialog("Delete successfull", "The object is deleted but there are updated objects: " + result.toString()); } diff --git a/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/operation/ChangeAcceptedTaxonToSynonymOperation.java b/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/operation/ChangeAcceptedTaxonToSynonymOperation.java index 1f1704702..b9c5e9dd3 100644 --- a/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/operation/ChangeAcceptedTaxonToSynonymOperation.java +++ b/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/operation/ChangeAcceptedTaxonToSynonymOperation.java @@ -86,7 +86,7 @@ public class ChangeAcceptedTaxonToSynonymOperation extends MessagingUtils.informationDialog("Synonym created but taxon is not deleted.", exceptionString); } else if (result.isAbort() || result.isError()){ - MessagingUtils.errorDialog("Synonym could not created", null, result.toString(), null, null, true); + MessagingUtils.errorDialog("Synonym could not created", null, result.toString(), TaxeditorNavigationPlugin.PLUGIN_ID, null, true); } } catch (IllegalArgumentException e) { MessagingUtils.errorDialog("Operation failed", this, e.getMessage(), TaxeditorNavigationPlugin.PLUGIN_ID, e, false);