X-Git-Url: https://dev.e-taxonomy.eu/gitweb/taxeditor.git/blobdiff_plain/bafb4761d3c6ad8ee795e49b6d0b56a6dc63f9bf..7dce04a4ef06e30769a711c8b6aceb11b2137c31:/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/UserEditorInput.java diff --git a/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/UserEditorInput.java b/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/UserEditorInput.java index c80733b1e..06bd812f7 100644 --- a/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/UserEditorInput.java +++ b/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/UserEditorInput.java @@ -1,9 +1,9 @@ // $Id$ /** * Copyright (C) 2007 EDIT -* European Distributed Institute of Taxonomy +* European Distributed Institute of Taxonomy * http://www.e-taxonomy.eu -* +* * The contents of this file are subject to the Mozilla Public License Version 1.1 * See LICENSE.TXT at the top of this package for the full license terms. */ @@ -15,6 +15,7 @@ import java.util.List; import java.util.UUID; import eu.etaxonomy.cdm.api.service.IUserService; +import eu.etaxonomy.cdm.api.service.config.DeleteConfiguratorBase; import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator; import eu.etaxonomy.cdm.api.service.exception.ReferencedObjectUndeletableException; import eu.etaxonomy.cdm.model.common.User; @@ -30,9 +31,9 @@ import eu.etaxonomy.taxeditor.store.CdmStore; public class UserEditorInput extends AbstractBulkEditorInput { public static final String ID = "bulkeditor.input.user"; - + private static UserEditorInput instance; - + /** * @return the instance */ @@ -42,7 +43,7 @@ public class UserEditorInput extends AbstractBulkEditorInput { } return instance; } - + /* (non-Javadoc) * @see org.eclipse.ui.IEditorInput#getName() */ @@ -63,15 +64,15 @@ public class UserEditorInput extends AbstractBulkEditorInput { * @see eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityPersistenceService#save(java.lang.Object) */ @Override - public boolean save(User entity) { - return CdmStore.getService(IUserService.class).saveOrUpdate(entity) != null; + public User save(User entity) { + return CdmStore.getService(IUserService.class).merge(entity, true).getMergedEntity(); } /* (non-Javadoc) * @see eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityPersistenceService#delete(java.lang.Object) */ @Override - public boolean delete(User entity) throws ReferencedObjectUndeletableException { + public boolean delete(User entity, DeleteConfiguratorBase config) throws ReferencedObjectUndeletableException { return CdmStore.getService(IUserService.class).delete(entity) != null; } @@ -84,13 +85,13 @@ public class UserEditorInput extends AbstractBulkEditorInput { return CdmStore.getSearchManager().findUsers(configurator); } - + /* (non-Javadoc) * @see eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput#loadEntity(java.util.UUID) - + @Override protected User loadEntity(UUID entityUuid) { - List propertyPaths = Arrays.asList(new String[]{}); + List propertyPaths = Arrays.asList(new String[]{}); return CdmStore.getService(IUserService.class).load(entityUuid, propertyPaths); } */ @@ -101,7 +102,7 @@ public class UserEditorInput extends AbstractBulkEditorInput { protected IEntityCreator createEntityCreator() { return new UserCreator(); } - + /* (non-Javadoc) * @see eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput#getText(eu.etaxonomy.cdm.model.common.ICdmBase) */ @@ -110,5 +111,21 @@ public class UserEditorInput extends AbstractBulkEditorInput { return String.format("%s, %s", entity.getUsername(), entity.getPerson()); } + /* (non-Javadoc) + * @see eu.etaxonomy.taxeditor.editor.CdmEntitySessionInput#merge() + */ + @Override + public void merge() { + + } + + + @Override + protected User loadEntity(UUID entityUuid) { + List propertyPaths = Arrays.asList(new String[]{}); + return CdmStore.getService(IUserService.class).load(entityUuid, propertyPaths); + } + + }