From 9ced87e3a7dd04a76a0ceb75677ecf2c9a19ecbb Mon Sep 17 00:00:00 2001 From: izabel <izabel> Date: Mon, 4 Jan 2010 11:03:14 +0000 Subject: [PATCH] [LMS-1326] delete materials - remove unused code SVN: 14128 --- .../web/client/ICommonClientService.java | 6 ++-- .../web/client/ICommonClientServiceAsync.java | 3 -- ...aterialListDeletionConfirmationDialog.java | 36 ++++--------------- .../web/server/CommonClientService.java | 9 ++--- .../openbis/generic/server/CommonServer.java | 4 ++- .../server/business/bo/IMaterialBO.java | 1 + .../openbis/generic/shared/ICommonServer.java | 1 + 7 files changed, 16 insertions(+), 44 deletions(-) diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/ICommonClientService.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/ICommonClientService.java index c7675bbfeae..f4f058da528 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/ICommonClientService.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/ICommonClientService.java @@ -831,9 +831,7 @@ public interface ICommonClientService extends IClientService public void updateColumn(IFilterOrColumnUpdates updates) throws UserFailureException; /** Deletes the specified materials. */ - public void deleteMaterials(DisplayedOrSelectedIdHolderCriteria<Sample> criteria, String reason) - throws UserFailureException; + public void deleteMaterials(DisplayedOrSelectedIdHolderCriteria<Material> criteria, + String reason) throws UserFailureException; - /** Deletes the specified material. */ - public void deleteMaterial(TechId sampleId, String reason) throws UserFailureException; } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/ICommonClientServiceAsync.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/ICommonClientServiceAsync.java index 505114e9b9c..5bcb07f555f 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/ICommonClientServiceAsync.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/ICommonClientServiceAsync.java @@ -734,9 +734,6 @@ public interface ICommonClientServiceAsync extends IClientServiceAsync public void updateColumn(IFilterOrColumnUpdates updates, AsyncCallback<Void> registrationCallback); - /** @see ICommonClientService#deleteMaterial(TechId, String) */ - public void deleteMaterial(TechId create, String value, AsyncCallback<Void> callback); - /** @see ICommonClientService#deleteMaterials(DisplayedOrSelectedIdHolderCriteria, String) */ public void deleteMaterials(DisplayedOrSelectedIdHolderCriteria<Material> uploadCriteria, String value, AsyncCallback<Void> callback); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/material/MaterialListDeletionConfirmationDialog.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/material/MaterialListDeletionConfirmationDialog.java index cfae488d0c4..47ae9d8ddeb 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/material/MaterialListDeletionConfirmationDialog.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/material/MaterialListDeletionConfirmationDialog.java @@ -28,7 +28,6 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.materia import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.AbstractDataListDeletionConfirmationDialog; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.WidgetUtils; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DisplayedOrSelectedIdHolderCriteria; -import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Material; @@ -40,9 +39,7 @@ public final class MaterialListDeletionConfirmationDialog extends private final AbstractAsyncCallback<Void> callback; - private final DisplayedAndSelectedMaterials selectedAndDisplayedItemsOrNull; - - private final Material singleDataOrNull; + private final DisplayedAndSelectedMaterials selectedAndDisplayedItems; public MaterialListDeletionConfirmationDialog( IViewContext<ICommonClientServiceAsync> viewContext, List<Material> data, @@ -52,35 +49,16 @@ public final class MaterialListDeletionConfirmationDialog extends super(viewContext, data, true); this.viewContext = viewContext; this.callback = callback; - this.singleDataOrNull = null; - this.selectedAndDisplayedItemsOrNull = selectedAndDisplayedItems; - } - - public MaterialListDeletionConfirmationDialog( - IViewContext<ICommonClientServiceAsync> viewContext, List<Material> data, - AbstractAsyncCallback<Void> callback, Material material) - { - super(viewContext, data, false); - this.viewContext = viewContext; - this.callback = callback; - this.singleDataOrNull = material; - this.selectedAndDisplayedItemsOrNull = null; + this.selectedAndDisplayedItems = selectedAndDisplayedItems; } @Override protected void executeConfirmedAction() { - if (selectedAndDisplayedItemsOrNull != null) - { - final DisplayedOrSelectedIdHolderCriteria<Material> uploadCriteria = - selectedAndDisplayedItemsOrNull.createCriteria(isOnlySelected()); - viewContext.getCommonService().deleteMaterials(uploadCriteria, reason.getValue(), - callback); - } else - { - viewContext.getCommonService().deleteMaterial(TechId.create(singleDataOrNull), - reason.getValue(), callback); - } + final DisplayedOrSelectedIdHolderCriteria<Material> uploadCriteria = + selectedAndDisplayedItems.createCriteria(isOnlySelected()); + viewContext.getCommonService().deleteMaterials(uploadCriteria, reason.getValue(), callback); + } @Override @@ -95,7 +73,7 @@ public final class MaterialListDeletionConfirmationDialog extends return WidgetUtils.createAllOrSelectedRadioGroup(onlySelectedRadioOrNull = WidgetUtils.createRadio(viewContext.getMessage(Dict.ONLY_SELECTED_RADIO, data .size())), WidgetUtils.createRadio(viewContext.getMessage(Dict.ALL_RADIO, - selectedAndDisplayedItemsOrNull.getDisplayedItemsCount())), viewContext + selectedAndDisplayedItems.getDisplayedItemsCount())), viewContext .getMessage(Dict.MATERIALS_RADIO_GROUP_LABEL), data.size(), createRefreshMessageAction()); } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/CommonClientService.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/CommonClientService.java index fbfaf1f1098..91a3a47386b 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/CommonClientService.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/CommonClientService.java @@ -2374,13 +2374,8 @@ public final class CommonClientService extends AbstractClientService implements } } - public void deleteMaterial(TechId sampleId, String reason) - throws ch.systemsx.cisd.openbis.generic.client.web.client.exception.UserFailureException - { - throw new UserFailureException("Functionality not implemented.");// FIXME: implement - } - - public void deleteMaterials(DisplayedOrSelectedIdHolderCriteria<Sample> criteria, String reason) + public void deleteMaterials(DisplayedOrSelectedIdHolderCriteria<Material> criteria, + String reason) throws ch.systemsx.cisd.openbis.generic.client.web.client.exception.UserFailureException { throw new UserFailureException("Functionality not implemented.");// FIXME: implement diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/CommonServer.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/CommonServer.java index 95a7a517ca5..d15069ef127 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/CommonServer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/CommonServer.java @@ -179,7 +179,8 @@ import ch.systemsx.cisd.openbis.generic.shared.translator.GridCustomExpressionTr import ch.systemsx.cisd.openbis.generic.shared.util.EntityHelper; import ch.systemsx.cisd.openbis.generic.shared.util.HibernateUtils; -public final class CommonServer extends AbstractCommonServer<ICommonServer> implements ICommonServer +public final class CommonServer extends AbstractCommonServer<ICommonServer> implements + ICommonServer { private final IAuthenticationService authenticationService; @@ -1840,4 +1841,5 @@ public final class CommonServer extends AbstractCommonServer<ICommonServer> impl bo.updateTerms(terms); bo.save(); } + } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/IMaterialBO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/IMaterialBO.java index 24d5116e1ec..9ab184bc64e 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/IMaterialBO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/IMaterialBO.java @@ -45,4 +45,5 @@ public interface IMaterialBO extends IEntityBusinessObject * Changes given material. Currently allowed changes: properties. */ public void update(TechId techId, List<IEntityProperty> properties, Date version); + } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/ICommonServer.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/ICommonServer.java index 6c3a7330d31..962eabd9606 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/ICommonServer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/ICommonServer.java @@ -1000,4 +1000,5 @@ public interface ICommonServer extends IServer @DatabaseUpdateModification(value = ObjectKind.VOCABULARY_TERM) public void updateVocabularyTerms(String sessionToken, TechId vocabularyId, List<VocabularyTerm> terms); + } -- GitLab