diff --git a/datastore_server/source/java/ch/systemsx/cisd/etlserver/DataStrategyStore.java b/datastore_server/source/java/ch/systemsx/cisd/etlserver/DataStrategyStore.java index 5a3ebc9e67065eb25d21f6488e92fe0173056c92..568dd4ee6d82e989a47673c24846eac2987c851f 100644 --- a/datastore_server/source/java/ch/systemsx/cisd/etlserver/DataStrategyStore.java +++ b/datastore_server/source/java/ch/systemsx/cisd/etlserver/DataStrategyStore.java @@ -133,10 +133,9 @@ public final class DataStrategyStore implements IDataStrategyStore error(emailOrNull, "Unknown experiment identifier '" + experimentIdentifier + "'."); return dataStoreStrategies.get(DataStoreStrategyKey.UNIDENTIFIED); } - if (experiment.getInvalidation() != null) + if (experiment.getDeletion() != null) { - error(emailOrNull, "Experiment '" + experimentIdentifier - + "' has been invalidated."); + error(emailOrNull, "Experiment '" + experimentIdentifier + "' has been deleted."); return dataStoreStrategies.get(DataStoreStrategyKey.UNIDENTIFIED); } dataSetInfo.setExperiment(experiment); @@ -154,10 +153,10 @@ public final class DataStrategyStore implements IDataStrategyStore error(emailOrNull, String.format("Data set for sample '%s' can not be registered " + "because the sample is not attached to an experiment.", sampleIdentifier)); return dataStoreStrategies.get(DataStoreStrategyKey.UNIDENTIFIED); - } else if (experiment.getInvalidation() != null) + } else if (experiment.getDeletion() != null) { error(emailOrNull, String.format("Data set for sample '%s' can not be registered " - + "because experiment '%s' has been invalidated.", sampleIdentifier, + + "because experiment '%s' has been deleted.", sampleIdentifier, experiment.getCode())); return dataStoreStrategies.get(DataStoreStrategyKey.UNIDENTIFIED); } @@ -182,14 +181,12 @@ public final class DataStrategyStore implements IDataStrategyStore + "' has a blank email, sending the following email failed:\n" + message); } - operationLog - .error(String - .format("Incoming data set '%s' claims to " - + "belong to experiment '%s' and sample" - + " identifier '%s', but according to the openBIS server " - + "there is no such sample for this " - + "experiment (it has maybe been invalidated?). We thus consider it invalid.", - incomingDataSetPath, experimentIdentifier, sampleIdentifier)); + operationLog.error(String.format("Incoming data set '%s' claims to " + + "belong to experiment '%s' and sample" + + " identifier '%s', but according to the openBIS server " + + "there is no such sample for this " + + "experiment (maybe it has been deleted?). We thus consider it invalid.", + incomingDataSetPath, experimentIdentifier, sampleIdentifier)); return dataStoreStrategies.get(DataStoreStrategyKey.INVALID); } dataSetInfo.setProperties(properties); diff --git a/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/DataStrategyStoreTest.java b/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/DataStrategyStoreTest.java index cb604e1793adcb6991964488731c262cdf785c0c..a120b8ad465b7c24838df187dafc2846bf970f8d 100644 --- a/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/DataStrategyStoreTest.java +++ b/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/DataStrategyStoreTest.java @@ -35,7 +35,7 @@ import ch.systemsx.cisd.openbis.dss.generic.shared.IEncapsulatedOpenBISService; import ch.systemsx.cisd.openbis.dss.generic.shared.dto.DataSetInformation; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Experiment; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.IEntityProperty; -import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Invalidation; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Deletion; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Person; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Project; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Sample; @@ -247,7 +247,7 @@ public final class DataStrategyStoreTest extends AbstractFileSystemTestCase final File incomingDataSetPath = createIncomingDataSetPath(); final DataSetInformation dataSetInfo = IdentifiedDataStrategyTest.createDataSetInfo(); final Sample baseSample = createSampleWithExperiment(); - baseSample.getExperiment().setInvalidation(new Invalidation()); + baseSample.getExperiment().setDeletion(new Deletion()); context.checking(new Expectations() { { 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 60f907d62e200a95d9ed0b16972adc46159f759b..1581955c3a797312ab0de6628f6790f14a5b2711 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 @@ -638,36 +638,36 @@ public interface ICommonClientService extends IClientService */ public Date updateProject(ProjectUpdates updates) throws UserFailureException; - /** Deletes/Invalidates the specified data sets. */ + /** Deletes/Trashes the specified data sets. */ public void deleteDataSets( DisplayedOrSelectedDatasetCriteria displayedOrSelectedDatasetCriteria, String reason, DeletionType deletionType) throws UserFailureException; - /** Deletes/Invalidates the specified data set. */ + /** Deletes/Trashes the specified data set. */ public void deleteDataSet(String singleData, String reason, DeletionType deletionType) throws UserFailureException; /** - * Deletes/Invalidates the specified samples. NOTE: this is a stale version used only for - * samples with abundance. + * Deletes/Trashes the specified samples. NOTE: this is a stale version used only for samples + * with abundance. */ public void deleteSamples(List<TechId> sampleIds, String reason, DeletionType deletionType) throws UserFailureException; - /** Deletes/Invalidates the specified samples. */ + /** Deletes/Trashes the specified samples. */ public void deleteSamples(DisplayedOrSelectedIdHolderCriteria<? extends IIdHolder> criteria, String reason, DeletionType deletionType) throws UserFailureException; - /** Deletes/Invalidates the specified sample. */ + /** Deletes/Trashes the specified sample. */ public void deleteSample(TechId sampleId, String reason, DeletionType deletionType) throws UserFailureException; - /** Deletes/Invalidates the specified experiments. */ + /** Deletes/Trashes the specified experiments. */ public void deleteExperiments( DisplayedOrSelectedIdHolderCriteria<TableModelRowWithObject<Experiment>> criteria, String reason, DeletionType deletionType) throws UserFailureException; - /** Deletes/Invalidates the specified experiment. */ + /** Deletes/Trashes the specified experiment. */ public void deleteExperiment(TechId experimentId, String reason, DeletionType deletionType) throws UserFailureException; @@ -997,14 +997,16 @@ public interface ICommonClientService extends IClientService /** * Returns {@link GridCustomColumn}s for given grid and display criteria. */ - public TypedTableResultSet<GridCustomColumn> listGridCustomColumns(String gridId, + public TypedTableResultSet<GridCustomColumn> listGridCustomColumns( + String gridId, DefaultResultSetConfig<String, TableModelRowWithObject<GridCustomColumn>> resultSetConfig) throws UserFailureException; /** * Like {@link #prepareExportSamples(TableExportCriteria)}, but for custom grid filters. */ - public String prepareExportColumns(final TableExportCriteria<TableModelRowWithObject<GridCustomColumn>> criteria) + public String prepareExportColumns( + final TableExportCriteria<TableModelRowWithObject<GridCustomColumn>> criteria) throws UserFailureException; /** diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/Dict.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/Dict.java index 5e2354075fcb88313aac9e2da665264fba33de30..5fd727d1a8d6a03f266025f2c1b68ca1311f9fcf 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/Dict.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/Dict.java @@ -250,7 +250,7 @@ public abstract class Dict public static final String IS_INSTANCE_SAMPLE = "is_instance_sample"; - public static final String IS_INVALID = "is_invalid"; + public static final String IS_DELETED = "is_deleted"; public static final String GROUP = "group"; @@ -486,11 +486,11 @@ public abstract class Dict // Deletion // - public static final String INVALIDATE = "invalidate"; + public static final String DELETE = "delete"; - public static final String INVALIDATION = "invalidation"; + public static final String DELETION = "deletion"; - public static final String INVALIDATION_TEMPLATE = "invalidation_template"; + public static final String DELETION_TEMPLATE = "deletion_template"; public static final String PERMANENT = "permanent"; @@ -503,11 +503,12 @@ public abstract class Dict public static final String DELETING_PERMANENTLY = "deleting_permanently"; - public static final String INVALIDATING = "invalidating"; + public static final String DELETING = "deleting"; - public static final String DELETE_PROGRESS_MESSAGE = "delete_progress_message"; + public static final String DELETE_PERMANENTLY_PROGRESS_MESSAGE = + "delete_permanently_progress_message"; - public static final String INVALIDATE_PROGRESS_MESSAGE = "invalidate_progress_message"; + public static final String DELETE_PROGRESS_MESSAGE = "delete_progress_message"; // // Sample Viewer diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ProjectViewer.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ProjectViewer.java index 33a7a00567d19590ea1bbebb4ef86c4b75166e5c..7399b07b012e5b0020c8fb087100bca0d684bd82 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ProjectViewer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ProjectViewer.java @@ -87,7 +87,7 @@ public final class ProjectViewer extends AbstractViewer<IEntityInformationHolder public void execute() { new ProjectListDeletionConfirmationDialog(viewContext, originalProject, - createDeletionCallback()).show(); + createPermanentDeletionCallback()).show(); } })); } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/model/BaseEntityModel.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/model/BaseEntityModel.java index ea83a4182d769514b82a3d8c5f0a591dd71e4c65..71c76816a703ed116d013023369b7041925fb195 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/model/BaseEntityModel.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/model/BaseEntityModel.java @@ -34,8 +34,8 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.Co import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IMessageProvider; import ch.systemsx.cisd.openbis.generic.shared.basic.GridRowModel; import ch.systemsx.cisd.openbis.generic.shared.basic.IColumnDefinition; -import ch.systemsx.cisd.openbis.generic.shared.basic.IInvalidationProvider; -import ch.systemsx.cisd.openbis.generic.shared.basic.InvalidationUtils; +import ch.systemsx.cisd.openbis.generic.shared.basic.IDeletionProvider; +import ch.systemsx.cisd.openbis.generic.shared.basic.DeletionUtils; import ch.systemsx.cisd.openbis.generic.shared.basic.PrimitiveValue; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.AbstractRegistrationHolder; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Person; @@ -122,11 +122,11 @@ public class BaseEntityModel<T> extends SimplifiedBaseModelData value = PersonRenderer.createPersonAnchor(registrator, value); } } else if (headerMsgKey.equals(Dict.CODE) - && originalRecord instanceof IInvalidationProvider + && originalRecord instanceof IDeletionProvider && column instanceof AbstractColumnDefinition<?>) { String linkHref = ((AbstractColumnDefinition<T>) column).tryGetLink(originalRecord); - boolean invalidate = InvalidationUtils.isInvalid(originalRecord); + boolean invalidate = DeletionUtils.isDeleted(originalRecord); value = LinkRenderer.getLinkWidget(value, null, linkHref, invalidate).toString(); } } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/renderer/LinkRenderer.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/renderer/LinkRenderer.java index fb0293986101fb17cd8c53bf37f99c5777e46e4b..02251cff289bcd94da8ac542ffcc600bd520172b 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/renderer/LinkRenderer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/renderer/LinkRenderer.java @@ -55,7 +55,7 @@ public class LinkRenderer private static final String LINK_STYLE = "link-style"; /** - * @deprecated doesn't support invalidation; use {@link #createLinkRenderer(boolean, int)} + * @deprecated doesn't support deletion; use {@link #createLinkRenderer(boolean, int)} */ @Deprecated public static GridCellRenderer<BaseEntityModel<?>> createLinkRenderer() diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/AbstractViewer.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/AbstractViewer.java index 2064432ce27e7c02da4bdafbc64a5bc4a21879d1..117d58165e10a6c0543cd3c015ccc54170af26d3 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/AbstractViewer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/AbstractViewer.java @@ -55,12 +55,12 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget. import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.GWTUtils; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDelegatedAction; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IMessageProvider; +import ch.systemsx.cisd.openbis.generic.shared.basic.DeletionUtils; import ch.systemsx.cisd.openbis.generic.shared.basic.ICodeHolder; import ch.systemsx.cisd.openbis.generic.shared.basic.IEntityInformationHolder; import ch.systemsx.cisd.openbis.generic.shared.basic.IEntityInformationHolderWithIdentifier; import ch.systemsx.cisd.openbis.generic.shared.basic.IEntityInformationHolderWithPermId; import ch.systemsx.cisd.openbis.generic.shared.basic.IEntityInformationHolderWithProperties; -import ch.systemsx.cisd.openbis.generic.shared.basic.InvalidationUtils; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityVisit; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.IEntityProperty; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Project; @@ -261,12 +261,12 @@ public abstract class AbstractViewer<D extends IEntityInformationHolder> extends { return originalData.getEntityKind().getDescription() + " " + originalData.getCode() + " [" + originalData.getEntityType().getCode() + "]" - + (isInvalid() ? " <b>(invalid)</b>" : ""); + + (isDeleted() ? " <b>(moved to trash)</b>" : ""); } - protected final boolean isInvalid() + protected final boolean isDeleted() { - return InvalidationUtils.isInvalid(originalData); + return DeletionUtils.isDeleted(originalData); } protected final static BorderLayoutData createBorderLayoutData(LayoutRegion region) @@ -274,12 +274,12 @@ public abstract class AbstractViewer<D extends IEntityInformationHolder> extends return BorderLayoutDataFactory.create(region); } - protected final AbstractAsyncCallback<Void> createDeletionCallback() + protected final AbstractAsyncCallback<Void> createPermanentDeletionCallback() { return new CloseViewerCallback(viewContext); } - protected final AbstractAsyncCallback<Void> createInvalidationCallback() + protected final AbstractAsyncCallback<Void> createDeletionCallback() { return new RefreshViewerCallback(viewContext); } @@ -390,7 +390,7 @@ public abstract class AbstractViewer<D extends IEntityInformationHolder> extends ClickHandler listener = new OpenEntityDetailsTabClickListener(entity, viewContext); Widget link = LinkRenderer.getLinkWidget(entity.getCode(), listener, href, - InvalidationUtils.isInvalid(entity)); + DeletionUtils.isDeleted(entity)); link.setTitle(entity.getEntityKind().getDescription() + " " + entity.getCode()); return link; } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/PropertyValueRenderers.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/PropertyValueRenderers.java index 3c215066458d1f03d985aff689171688108a4b13..7921650f2e0089fa9c07934c8aac7289f7be3de5 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/PropertyValueRenderers.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/PropertyValueRenderers.java @@ -43,7 +43,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.lang. import ch.systemsx.cisd.openbis.generic.shared.basic.BasicConstant; import ch.systemsx.cisd.openbis.generic.shared.basic.IEntityInformationHolder; import ch.systemsx.cisd.openbis.generic.shared.basic.IEntityInformationHolderWithIdentifier; -import ch.systemsx.cisd.openbis.generic.shared.basic.InvalidationUtils; +import ch.systemsx.cisd.openbis.generic.shared.basic.DeletionUtils; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataSetType; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataStore; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataTypeCode; @@ -52,7 +52,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Experiment; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ExperimentType; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ExternalData; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.IEntityProperty; -import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Invalidation; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Deletion; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Material; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.MaterialType; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Person; @@ -130,12 +130,12 @@ public final class PropertyValueRenderers } /** - * Creates a {@link IPropertyValueRenderer} implementation for rendering {@link Invalidation}. + * Creates a {@link IPropertyValueRenderer} implementation for rendering {@link Deletion}. */ - public final static IPropertyValueRenderer<Invalidation> createInvalidationPropertyValueRenderer( + public final static IPropertyValueRenderer<Deletion> createDeletionPropertyValueRenderer( final IMessageProvider messageProvider) { - return new InvalidationPropertyValueRenderer(messageProvider); + return new DeletionPropertyValueRenderer(messageProvider); } /** @@ -211,15 +211,15 @@ public final class PropertyValueRenderers } /** - * Renderer for {@link Invalidation}. + * Renderer for {@link Deletion}. * * @author Christian Ribeaud */ - private final static class InvalidationPropertyValueRenderer extends - AbstractSimplePropertyValueRenderer<Invalidation> + private final static class DeletionPropertyValueRenderer extends + AbstractSimplePropertyValueRenderer<Deletion> { - InvalidationPropertyValueRenderer(final IMessageProvider messageProvider) + DeletionPropertyValueRenderer(final IMessageProvider messageProvider) { super(messageProvider); } @@ -238,13 +238,13 @@ public final class PropertyValueRenderers // @Override - public final String renderNotNull(final Invalidation invalidation) + public final String renderNotNull(final Deletion deletion) { return getMessageProvider().getMessage( - Dict.INVALIDATION_TEMPLATE, - rendererPerson(invalidation.getRegistrator()), - DateRenderer.renderDate(invalidation.getRegistrationDate(), - BasicConstant.DATE_WITHOUT_TIMEZONE_PATTERN), invalidation.getReason()); + Dict.DELETION_TEMPLATE, + rendererPerson(deletion.getRegistrator()), + DateRenderer.renderDate(deletion.getRegistrationDate(), + BasicConstant.DATE_WITHOUT_TIMEZONE_PATTERN), deletion.getReason()); } } @@ -428,7 +428,7 @@ public final class PropertyValueRenderers public FlowPanel getAsWidget(final T entity) { final String displayText = getDisplayText(entity); - final boolean invalidate = InvalidationUtils.isInvalid(entity); + final boolean invalidate = DeletionUtils.isDeleted(entity); final ClickHandler listener = new OpenEntityDetailsTabClickListener(entity, viewContext); String href = LinkExtractor.tryExtract(entity); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/columns/framework/AbstractColumnDefinitionKind.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/columns/framework/AbstractColumnDefinitionKind.java index 807c77aa6247769aa584564462004b09c43cb1e0..43fbad13c3e14dba9997aacea8727c4066225ee8 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/columns/framework/AbstractColumnDefinitionKind.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/columns/framework/AbstractColumnDefinitionKind.java @@ -17,8 +17,8 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.columns.framework; import ch.systemsx.cisd.openbis.generic.shared.basic.GridRowModel; -import ch.systemsx.cisd.openbis.generic.shared.basic.IInvalidationProvider; -import ch.systemsx.cisd.openbis.generic.shared.basic.InvalidationUtils; +import ch.systemsx.cisd.openbis.generic.shared.basic.IDeletionProvider; +import ch.systemsx.cisd.openbis.generic.shared.basic.DeletionUtils; import ch.systemsx.cisd.openbis.generic.shared.basic.SimpleDateRenderer; import ch.systemsx.cisd.openbis.generic.shared.basic.SimplePersonRenderer; import ch.systemsx.cisd.openbis.generic.shared.basic.SimpleYesNoRenderer; @@ -141,9 +141,9 @@ public abstract class AbstractColumnDefinitionKind<T> return SimplePersonRenderer.createPersonName(person).toString(); } - protected final String renderInvalidationFlag(final IInvalidationProvider invalidationProvider) + protected final String renderDeletionFlag(final IDeletionProvider deletionProvider) { - return SimpleYesNoRenderer.render(InvalidationUtils.isInvalid(invalidationProvider)); + return SimpleYesNoRenderer.render(DeletionUtils.isDeleted(deletionProvider)); } /** to be overriden by subclasses */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/columns/specific/data/CommonExternalDataColDefKind.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/columns/specific/data/CommonExternalDataColDefKind.java index 689ef70caf26ec2aa347ccbe1b1192be201bc57a..0022d43d079262251c4474e31d883d9e79a2fbe4 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/columns/specific/data/CommonExternalDataColDefKind.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/columns/specific/data/CommonExternalDataColDefKind.java @@ -209,12 +209,12 @@ public enum CommonExternalDataColDefKind implements IColumnDefinitionKind<Extern } }), - IS_INVALID(new AbstractColumnDefinitionKind<ExternalData>(Dict.IS_INVALID, true) + IS_DELETED(new AbstractColumnDefinitionKind<ExternalData>(Dict.IS_DELETED, true) { @Override public String tryGetValue(ExternalData entity) { - return renderInvalidationFlag(entity); + return renderDeletionFlag(entity); } }), diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/columns/specific/experiment/CommonExperimentColDefKind.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/columns/specific/experiment/CommonExperimentColDefKind.java index 3927a25c4ef5bfeb37ee3e17df1a3743a455cb4e..3157d173e196f928644c1f965c45867916578709 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/columns/specific/experiment/CommonExperimentColDefKind.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/columns/specific/experiment/CommonExperimentColDefKind.java @@ -121,12 +121,12 @@ public enum CommonExperimentColDefKind implements IColumnDefinitionKind<Experime } }), - IS_INVALID(new AbstractColumnDefinitionKind<Experiment>(Dict.IS_INVALID, true) + IS_DELETED(new AbstractColumnDefinitionKind<Experiment>(Dict.IS_DELETED, true) { @Override public String tryGetValue(Experiment entity) { - return renderInvalidationFlag(entity); + return renderDeletionFlag(entity); } }), diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/DataSetListDeletionConfirmationDialog.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/DataSetListDeletionConfirmationDialog.java index 59e09ffbd1d4a103c609bb4111d8cfc87971d0e2..de222e65b2f744a1624b062a9ddf7ba8aa1c2a3c 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/DataSetListDeletionConfirmationDialog.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/DataSetListDeletionConfirmationDialog.java @@ -29,7 +29,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.data.Ab 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.DisplayedOrSelectedDatasetCriteria; -import ch.systemsx.cisd.openbis.generic.shared.basic.InvalidationUtils; +import ch.systemsx.cisd.openbis.generic.shared.basic.DeletionUtils; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DeletionType; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ExternalData; @@ -50,7 +50,7 @@ public final class DataSetListDeletionConfirmationDialog extends SelectedAndDisplayedItems selectedAndDisplayedItems) { super(viewContext, selectedAndDisplayedItems.getSelectedItems(), callback); - this.withInvalidation(); + this.withDeletion(); this.withRadio(); this.viewContext = viewContext; this.singleData = null; @@ -59,13 +59,13 @@ public final class DataSetListDeletionConfirmationDialog extends public DataSetListDeletionConfirmationDialog( IViewContext<ICommonClientServiceAsync> viewContext, - AbstractAsyncCallback<Void> deletionCallback, - AbstractAsyncCallback<Void> invalidationCallback, ExternalData data) + AbstractAsyncCallback<Void> permanentDeletionCallback, + AbstractAsyncCallback<Void> deletionCallback, ExternalData data) { - super(viewContext, Collections.singletonList(data), deletionCallback); - if (InvalidationUtils.isInvalid(data) == false) + super(viewContext, Collections.singletonList(data), permanentDeletionCallback); + if (DeletionUtils.isDeleted(data) == false) { - this.withInvalidation(invalidationCallback); + this.withDeletion(deletionCallback); } this.viewContext = viewContext; this.singleData = data; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/ExperimentListDeletionConfirmationDialog.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/ExperimentListDeletionConfirmationDialog.java index f8ac9e658d3b703e821551ee6acb8ff3c9ed95b7..ecd4d69746d294abcf054916837393d222de1202 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/ExperimentListDeletionConfirmationDialog.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/ExperimentListDeletionConfirmationDialog.java @@ -29,7 +29,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.experim 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.InvalidationUtils; +import ch.systemsx.cisd.openbis.generic.shared.basic.DeletionUtils; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DeletionType; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; @@ -52,7 +52,7 @@ public final class ExperimentListDeletionConfirmationDialog extends DisplayedAndSelectedExperiments selectedAndDisplayedItems) { super(viewContext, selectedAndDisplayedItems.getExperiments(), callback); - this.withInvalidation(); + this.withDeletion(); this.withRadio(); this.viewContext = viewContext; this.singleDataOrNull = null; @@ -61,13 +61,13 @@ public final class ExperimentListDeletionConfirmationDialog extends public ExperimentListDeletionConfirmationDialog( IViewContext<ICommonClientServiceAsync> viewContext, - AbstractAsyncCallback<Void> deletionCallback, - AbstractAsyncCallback<Void> invalidationCallback, Experiment experiment) + AbstractAsyncCallback<Void> permanentDeletionCallback, + AbstractAsyncCallback<Void> deletionCallback, Experiment experiment) { - super(viewContext, Collections.singletonList(experiment), deletionCallback); - if (InvalidationUtils.isInvalid(experiment) == false) + super(viewContext, Collections.singletonList(experiment), permanentDeletionCallback); + if (DeletionUtils.isDeleted(experiment) == false) { - this.withInvalidation(invalidationCallback); + this.withDeletion(deletionCallback); } this.viewContext = viewContext; this.singleDataOrNull = experiment; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/AbstractBrowserGrid.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/AbstractBrowserGrid.java index a3e4ef22aff6c3e55cf411da0374532695f86c9d..80a54771a85d2eb3518e85a8c324d3a9dd2b0970 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/AbstractBrowserGrid.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/AbstractBrowserGrid.java @@ -1689,7 +1689,7 @@ public abstract class AbstractBrowserGrid<T/* Entity */, M extends BaseEntityMod @SuppressWarnings("deprecation") protected GridCellRenderer<BaseEntityModel<?>> createInternalLinkCellRenderer() { - // NOTE: this renderer doesn't support special rendering of invalidated entities + // NOTE: this renderer doesn't support special rendering of deleted entities return LinkRenderer.createLinkRenderer(); } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property/PropertyGrid.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property/PropertyGrid.java index f63c62069dcc15596a2350c17076bd2264f5cff8..281ccbd9fabe0ae90fb60eb04fdb5ad13207ec03 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property/PropertyGrid.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property/PropertyGrid.java @@ -34,7 +34,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityProperty; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Experiment; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.GenericEntityProperty; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.IEntityProperty; -import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Invalidation; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Deletion; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ManagedEntityProperty; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.MaterialEntityProperty; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Person; @@ -81,8 +81,8 @@ public final class PropertyGrid extends Grid PropertyValueRenderers.createPersonPropertyValueRenderer(messageProvider)); // Entities - registerPropertyValueRenderer(Invalidation.class, - PropertyValueRenderers.createInvalidationPropertyValueRenderer(messageProvider)); + registerPropertyValueRenderer(Deletion.class, + PropertyValueRenderers.createDeletionPropertyValueRenderer(messageProvider)); registerPropertyValueRenderer(ContainerDataSet.class, PropertyValueRenderers.createExternalDataPropertyValueRenderer(viewContext)); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/SampleListDeletionConfirmationDialog.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/SampleListDeletionConfirmationDialog.java index 3b2aac533eb86a2d6b781e29335158b8edcf5896..9d5aacb43577e660e32aa6d1e5901f0f4d37388c 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/SampleListDeletionConfirmationDialog.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/SampleListDeletionConfirmationDialog.java @@ -30,8 +30,8 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.Display 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.DeletionUtils; import ch.systemsx.cisd.openbis.generic.shared.basic.IIdHolder; -import ch.systemsx.cisd.openbis.generic.shared.basic.InvalidationUtils; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DeletionType; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; @@ -52,7 +52,7 @@ public final class SampleListDeletionConfirmationDialog<T extends IIdHolder> ext DisplayedAndSelectedEntities<T> selectedAndDisplayedItems) { super(viewContext, data, callback); - this.withInvalidation(); + this.withDeletion(); this.withRadio(); this.viewContext = viewContext; this.singleDataOrNull = null; @@ -61,13 +61,13 @@ public final class SampleListDeletionConfirmationDialog<T extends IIdHolder> ext public SampleListDeletionConfirmationDialog( IViewContext<ICommonClientServiceAsync> viewContext, List<T> data, - AbstractAsyncCallback<Void> deletionCallback, - AbstractAsyncCallback<Void> invalidationCallback, T sample) + AbstractAsyncCallback<Void> permanentDeletionCallback, + AbstractAsyncCallback<Void> deletionCallback, T sample) { - super(viewContext, data, deletionCallback); - if (InvalidationUtils.isInvalid(sample) == false) + super(viewContext, data, permanentDeletionCallback); + if (DeletionUtils.isDeleted(sample) == false) { - this.withInvalidation(invalidationCallback); + this.withDeletion(deletionCallback); } this.viewContext = viewContext; this.singleDataOrNull = sample; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/AbstractDataListDeletionConfirmationDialog.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/AbstractDataListDeletionConfirmationDialog.java index 3804f9ad41888e614dd4db452ef3925283de7b7d..e7cf6724ce740fa57cee59696051e0500697807c 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/AbstractDataListDeletionConfirmationDialog.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/AbstractDataListDeletionConfirmationDialog.java @@ -54,13 +54,13 @@ public abstract class AbstractDataListDeletionConfirmationDialog<T> extends private final IViewContext<?> viewContext; - private final AbstractAsyncCallback<Void> deletionCallback; + private final AbstractAsyncCallback<Void> permanentDeletionCallback; private boolean withRadio = false; - private boolean withInvalidationOption = false; + private boolean withDeletionOption = false; - private AbstractAsyncCallback<Void> invalidationCallbackOrNull; + private AbstractAsyncCallback<Void> deletionCallbackOrNull; protected Radio onlySelectedRadioOrNull; @@ -69,11 +69,11 @@ public abstract class AbstractDataListDeletionConfirmationDialog<T> extends protected ReasonField reason; public AbstractDataListDeletionConfirmationDialog(IViewContext<?> viewContext, List<T> data, - AbstractAsyncCallback<Void> deletionCallback) + AbstractAsyncCallback<Void> permanentDeletionCallback) { super(viewContext, data, viewContext.getMessage(Dict.DELETE_CONFIRMATION_TITLE)); this.viewContext = viewContext; - this.deletionCallback = deletionCallback; + this.permanentDeletionCallback = permanentDeletionCallback; } // optional initialization @@ -84,19 +84,22 @@ public abstract class AbstractDataListDeletionConfirmationDialog<T> extends this.withRadio = true; } - /** adds invalidation option to the dialog with the same callback as the one used for deletion */ - protected void withInvalidation() + /** + * adds deletion option to the dialog with the same callback as the one used for permanent + * deletion + */ + protected void withDeletion() { - withInvalidation(deletionCallback); + withDeletion(permanentDeletionCallback); } - /** adds invalidation option to the dialog with fiven callback */ - protected void withInvalidation(AbstractAsyncCallback<Void> invalidationCallback) + /** adds deletion option to the dialog with fiven callback */ + protected void withDeletion(AbstractAsyncCallback<Void> deletionCallback) { - if (getWebClientConfiguration().getEnableInvalidation()) + if (getWebClientConfiguration().getEnableTrash()) { - this.withInvalidationOption = true; - this.invalidationCallbackOrNull = invalidationCallback; + this.withDeletionOption = true; + this.deletionCallbackOrNull = deletionCallback; } } @@ -116,7 +119,7 @@ public abstract class AbstractDataListDeletionConfirmationDialog<T> extends reason = new ReasonField(messageProvider, true); reason.focus(); reason.addKeyListener(keyListener); - if (withInvalidationOption) + if (withDeletionOption) { formPanel.add(permanentCheckBoxOrNull = createDeletePermanentlyCheckBox()); } @@ -141,7 +144,7 @@ public abstract class AbstractDataListDeletionConfirmationDialog<T> extends } final String operationName = messageProvider.getMessage(isPermanentDeletion() ? Dict.DELETING_PERMANENTLY - : Dict.INVALIDATING); + : Dict.DELETING); return messageProvider.getMessage(Dict.DELETE_CONFIRMATION_MESSAGE_WITH_REASON_TEMPLATE, operationName, deletedObjects); } @@ -191,24 +194,24 @@ public abstract class AbstractDataListDeletionConfirmationDialog<T> extends protected final DeletionType getDeletionType() { - return isPermanentDeletion() ? DeletionType.PERMANENT : DeletionType.INVALIDATION; + return isPermanentDeletion() ? DeletionType.PERMANENT : DeletionType.TRASH; } /** - * Returns deletion/invalidation callback and shows a progress bar that will be hidden when the - * callback is finished. + * Returns deletion callback and shows a progress bar that will be hidden when the callback is + * finished. */ private AsyncCallback<Void> getCallbackWithProgressBar() { if (isPermanentDeletion()) { - return AsyncCallbackWithProgressBar.decorate(deletionCallback, - messageProvider.getMessage(Dict.DELETE_PROGRESS_MESSAGE, getEntityName())); + return AsyncCallbackWithProgressBar.decorate(permanentDeletionCallback, messageProvider + .getMessage(Dict.DELETE_PERMANENTLY_PROGRESS_MESSAGE, getEntityName())); } else { - assert invalidationCallbackOrNull != null; - return AsyncCallbackWithProgressBar.decorate(invalidationCallbackOrNull, - messageProvider.getMessage(Dict.INVALIDATE_PROGRESS_MESSAGE, getEntityName())); + assert deletionCallbackOrNull != null; + return AsyncCallbackWithProgressBar.decorate(deletionCallbackOrNull, + messageProvider.getMessage(Dict.DELETE_PROGRESS_MESSAGE, getEntityName())); } } } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/FieldUtil.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/FieldUtil.java index 2fc0108607508819b258b8cd34b5cac739981741..f93ed150e75ced69b38169ed14a4575d6786dd43 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/FieldUtil.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/FieldUtil.java @@ -95,7 +95,7 @@ public class FieldUtil field.syncSize(); if (visible == false) { - // invalidation mark is not removed automatically when we make field invisible + // deletion mark is not removed automatically when we make field invisible field.clearInvalid(); } else if (field.isDirty()) { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/HistoryWidget.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/HistoryWidget.java index c8430dd129e11b8409582e232163eae049a51c5a..722385d300fa34d1e1ee09fb02349cc0e469e2a6 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/HistoryWidget.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/HistoryWidget.java @@ -201,7 +201,7 @@ public class HistoryWidget extends ContentPanel WidgetUtils.ifSpecialKeyPressed(event.getNativeEvent())); } }; - // TODO 2011-06-17, Piotr Buczek: invalidation (requires request to server) + // TODO 2011-06-17, Piotr Buczek: deletion (requires request to server) final Widget link = LinkRenderer.getLinkWidget(displayText, listener, href); final String date = DateRenderer.renderDate(new Date(visit.getTimeStamp()), diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/ExperimentBrowserGridColumnIDs.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/ExperimentBrowserGridColumnIDs.java index f2a56c6d07a84fb56be8c463735763c75ae690a5..74e4bdba1aadf0fc2c48e7fa1569f97ea318ee95 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/ExperimentBrowserGridColumnIDs.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/ExperimentBrowserGridColumnIDs.java @@ -18,21 +18,31 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.dto; /** * Column IDs for experiment browser grid. - * + * * @author Franz-Josef Elmer */ public class ExperimentBrowserGridColumnIDs { - public static final String CODE = "CODE"; - public static final String EXPERIMENT_TYPE = "EXPERIMENT_TYPE"; - public static final String EXPERIMENT_IDENTIFIER = "EXPERIMENT_IDENTIFIER"; - public static final String DATABASE_INSTANCE = "DATABASE_INSTANCE"; - public static final String SPACE = "SPACE"; - public static final String PROJECT = "PROJECT"; - public static final String REGISTRATOR = "REGISTRATOR"; - public static final String REGISTRATION_DATE = "REGISTRATION_DATE"; - public static final String IS_INVALID = "IS_INVALID"; - public static final String PERM_ID = "PERM_ID"; + public static final String CODE = "CODE"; + + public static final String EXPERIMENT_TYPE = "EXPERIMENT_TYPE"; + + public static final String EXPERIMENT_IDENTIFIER = "EXPERIMENT_IDENTIFIER"; + + public static final String DATABASE_INSTANCE = "DATABASE_INSTANCE"; + + public static final String SPACE = "SPACE"; + + public static final String PROJECT = "PROJECT"; + + public static final String REGISTRATOR = "REGISTRATOR"; + + public static final String REGISTRATION_DATE = "REGISTRATION_DATE"; + + public static final String IS_DELETED = "IS_DELETED"; + + public static final String PERM_ID = "PERM_ID"; + public static final String SHOW_DETAILS_LINK = "SHOW_DETAILS_LINK"; public static final String PROPERTIES_PREFIX = "property-"; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/SampleGridColumnIDs.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/SampleGridColumnIDs.java index 959b93f50849b0ad420eecd2f7f5b3e1c2e0ebc6..83a763fa5a67d1d0cd42b20fc69c43d844d5a780 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/SampleGridColumnIDs.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/SampleGridColumnIDs.java @@ -18,20 +18,19 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.dto; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.sample.SampleBrowserGrid; - /** * IDs of static columns of {@link SampleBrowserGrid}. - * + * * @author Franz-Josef Elmer */ public class SampleGridColumnIDs { public static final String CODE = "CODE"; - + public static final String SUBCODE = "SUBCODE"; public static final String SPACE = "SPACE"; - + public static final String REGISTRATOR = "REGISTRATOR"; public static final String REGISTRATION_DATE = "REGISTRATION_DATE"; @@ -41,25 +40,24 @@ public class SampleGridColumnIDs public static final String DATABASE_INSTANCE = "DATABASE_INSTANCE"; public static final String SAMPLE_IDENTIFIER = "SAMPLE_IDENTIFIER"; - + public static final String IS_INSTANCE_SAMPLE = "IS_INSTANCE_SAMPLE"; - - public static final String IS_INVALID = "IS_INVALID"; - + + public static final String IS_DELETED = "IS_DELETED"; + public static final String EXPERIMENT = "EXPERIMENT"; - + public static final String EXPERIMENT_IDENTIFIER = "EXPERIMENT_IDENTIFIER"; - + public static final String PROJECT = "PROJECT"; - + public static final String PERM_ID = "PERM_ID"; - + public static final String SHOW_DETAILS_LINK_COLUMN_NAME = "SHOW_DETAILS_LINK"; - + public static final String PARENTS = "generatedFromParent"; - + public static final String CONTAINER_SAMPLE = "containerParent"; public static final String PROPERTIES_PREFIX = "property-"; } - diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/WebClientConfigurationProvider.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/WebClientConfigurationProvider.java index 4f48ff35be2df9abc4eb43bc6e998e3b5d440f6d..3ba3e55856cb865c9fe95153b36f47cd8f9c2cd3 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/WebClientConfigurationProvider.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/WebClientConfigurationProvider.java @@ -72,11 +72,11 @@ public class WebClientConfigurationProvider private static final String ALLOW_ADDING_UNOFFICIAL_TERMS = "allow-adding-unofficial-terms"; - private static final String ENABLE_INVALIDATION = "enable-invalidation"; + private static final String ENABLE_TRASH = "enable-trash"; private static final boolean DEFAULT_ALLOW_ADDING_UNOFFICIAL_TERMS = false; - private static final boolean DEFAULT_ENABLE_INVALIDATION = false; + private static final boolean DEFAULT_ENABLE_TRASH = false; static final String TECHNOLOGIES = "technologies"; @@ -105,7 +105,7 @@ public class WebClientConfigurationProvider webClientConfiguration.setMaxVisibleColumns(DEFAULT_MAX_VISIBLE_COLUMNS); webClientConfiguration.setMaxEntityVisits(DEFAULT_MAX_ENTITY_VISITS); webClientConfiguration.setAllowAddingUnofficialTerms(DEFAULT_ALLOW_ADDING_UNOFFICIAL_TERMS); - webClientConfiguration.setEnableInvalidation(DEFAULT_ENABLE_INVALIDATION); + webClientConfiguration.setEnableTrash(DEFAULT_ENABLE_TRASH); } private void init(Properties properties) @@ -115,7 +115,7 @@ public class WebClientConfigurationProvider webClientConfiguration.setMaxVisibleColumns(extractMaxVisibleColumns(properties)); webClientConfiguration .setAllowAddingUnofficialTerms(extractAllowAddingUnofficialTerms(properties)); - webClientConfiguration.setEnableInvalidation(extractEnableInvalidation(properties)); + webClientConfiguration.setEnableTrash(extractEnableTrash(properties)); webClientConfiguration.setMaxEntityVisits(PropertyUtils.getInt(properties, MAX_ENTITY_VISITS, DEFAULT_MAX_ENTITY_VISITS)); webClientConfiguration @@ -227,10 +227,9 @@ public class WebClientConfigurationProvider DEFAULT_ALLOW_ADDING_UNOFFICIAL_TERMS); } - private boolean extractEnableInvalidation(Properties properties) + private boolean extractEnableTrash(Properties properties) { - return PropertyUtils.getBoolean(properties, ENABLE_INVALIDATION, - DEFAULT_ENABLE_INVALIDATION); + return PropertyUtils.getBoolean(properties, ENABLE_TRASH, DEFAULT_ENABLE_TRASH); } public WebClientConfiguration getWebClientConfiguration() diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/ExperimentProvider.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/ExperimentProvider.java index db356b6d368d6469aab9ba59fcefddd40048f49e..735538589e818a84c1ba18eac6362789ad445ad0 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/ExperimentProvider.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/ExperimentProvider.java @@ -20,7 +20,7 @@ import static ch.systemsx.cisd.openbis.generic.client.web.client.dto.ExperimentB import static ch.systemsx.cisd.openbis.generic.client.web.client.dto.ExperimentBrowserGridColumnIDs.DATABASE_INSTANCE; import static ch.systemsx.cisd.openbis.generic.client.web.client.dto.ExperimentBrowserGridColumnIDs.EXPERIMENT_IDENTIFIER; import static ch.systemsx.cisd.openbis.generic.client.web.client.dto.ExperimentBrowserGridColumnIDs.EXPERIMENT_TYPE; -import static ch.systemsx.cisd.openbis.generic.client.web.client.dto.ExperimentBrowserGridColumnIDs.IS_INVALID; +import static ch.systemsx.cisd.openbis.generic.client.web.client.dto.ExperimentBrowserGridColumnIDs.IS_DELETED; import static ch.systemsx.cisd.openbis.generic.client.web.client.dto.ExperimentBrowserGridColumnIDs.PERM_ID; import static ch.systemsx.cisd.openbis.generic.client.web.client.dto.ExperimentBrowserGridColumnIDs.PROJECT; import static ch.systemsx.cisd.openbis.generic.client.web.client.dto.ExperimentBrowserGridColumnIDs.REGISTRATION_DATE; @@ -35,7 +35,7 @@ import ch.systemsx.cisd.common.collections.TableMap; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.ExperimentBrowserGridColumnIDs; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.ListExperimentsCriteria; import ch.systemsx.cisd.openbis.generic.shared.ICommonServer; -import ch.systemsx.cisd.openbis.generic.shared.basic.InvalidationUtils; +import ch.systemsx.cisd.openbis.generic.shared.basic.DeletionUtils; import ch.systemsx.cisd.openbis.generic.shared.basic.SimpleYesNoRenderer; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Experiment; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ExperimentType; @@ -87,7 +87,7 @@ public class ExperimentProvider extends AbstractCommonTableModelProvider<Experim builder.addColumn(PROJECT).hideByDefault(); builder.addColumn(REGISTRATOR); builder.addColumn(REGISTRATION_DATE).withDefaultWidth(200); - builder.addColumn(IS_INVALID).hideByDefault(); + builder.addColumn(IS_DELETED).hideByDefault(); builder.addColumn(PERM_ID).hideByDefault(); builder.addColumn(SHOW_DETAILS_LINK).hideByDefault(); TableMap<String, ExperimentType> experimentTypes = getExperimentTypes(); @@ -104,8 +104,8 @@ public class ExperimentProvider extends AbstractCommonTableModelProvider<Experim builder.column(PROJECT).addString(experiment.getProject().getCode()); builder.column(REGISTRATOR).addPerson(experiment.getRegistrator()); builder.column(REGISTRATION_DATE).addDate(experiment.getRegistrationDate()); - builder.column(IS_INVALID).addString( - SimpleYesNoRenderer.render(InvalidationUtils.isInvalid(experiment))); + builder.column(IS_DELETED).addString( + SimpleYesNoRenderer.render(DeletionUtils.isDeleted(experiment))); builder.column(PERM_ID).addString(experiment.getPermId()); builder.column(SHOW_DETAILS_LINK).addString(experiment.getPermlink()); ExperimentType experimentType = diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/SampleProvider.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/SampleProvider.java index a09bf9132eaebbc165f7eebd27c621510d712535..d94d1011679eebc8d58b361d249a878fe871148b 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/SampleProvider.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/SampleProvider.java @@ -21,8 +21,8 @@ import static ch.systemsx.cisd.openbis.generic.client.web.client.dto.SampleGridC import static ch.systemsx.cisd.openbis.generic.client.web.client.dto.SampleGridColumnIDs.DATABASE_INSTANCE; import static ch.systemsx.cisd.openbis.generic.client.web.client.dto.SampleGridColumnIDs.EXPERIMENT; import static ch.systemsx.cisd.openbis.generic.client.web.client.dto.SampleGridColumnIDs.EXPERIMENT_IDENTIFIER; +import static ch.systemsx.cisd.openbis.generic.client.web.client.dto.SampleGridColumnIDs.IS_DELETED; import static ch.systemsx.cisd.openbis.generic.client.web.client.dto.SampleGridColumnIDs.IS_INSTANCE_SAMPLE; -import static ch.systemsx.cisd.openbis.generic.client.web.client.dto.SampleGridColumnIDs.IS_INVALID; import static ch.systemsx.cisd.openbis.generic.client.web.client.dto.SampleGridColumnIDs.PARENTS; import static ch.systemsx.cisd.openbis.generic.client.web.client.dto.SampleGridColumnIDs.PERM_ID; import static ch.systemsx.cisd.openbis.generic.client.web.client.dto.SampleGridColumnIDs.PROJECT; @@ -42,7 +42,7 @@ import ch.systemsx.cisd.common.collections.IKeyExtractor; import ch.systemsx.cisd.common.collections.TableMap; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.ListSampleDisplayCriteria2; import ch.systemsx.cisd.openbis.generic.shared.ICommonServer; -import ch.systemsx.cisd.openbis.generic.shared.basic.InvalidationUtils; +import ch.systemsx.cisd.openbis.generic.shared.basic.DeletionUtils; import ch.systemsx.cisd.openbis.generic.shared.basic.SimpleYesNoRenderer; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseInstance; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; @@ -82,7 +82,7 @@ public class SampleProvider extends AbstractCommonTableModelProvider<Sample> builder.addColumn(SAMPLE_IDENTIFIER).withDefaultWidth(150).hideByDefault(); builder.addColumn(SAMPLE_TYPE).withDefaultWidth(150).hideByDefault(); builder.addColumn(IS_INSTANCE_SAMPLE).hideByDefault(); - builder.addColumn(IS_INVALID).hideByDefault(); + builder.addColumn(IS_DELETED).hideByDefault(); builder.addColumn(REGISTRATOR).withDefaultWidth(200); builder.addColumn(REGISTRATION_DATE).withDefaultWidth(300).hideByDefault(); builder.addColumn(EXPERIMENT); @@ -105,8 +105,8 @@ public class SampleProvider extends AbstractCommonTableModelProvider<Sample> builder.column(SAMPLE_TYPE).addString(sample.getSampleType().getCode()); builder.column(IS_INSTANCE_SAMPLE).addString( SimpleYesNoRenderer.render(sample.getDatabaseInstance() != null)); - builder.column(IS_INVALID).addString( - SimpleYesNoRenderer.render(InvalidationUtils.isInvalid(sample))); + builder.column(IS_DELETED).addString( + SimpleYesNoRenderer.render(DeletionUtils.isDeleted(sample))); builder.column(REGISTRATOR).addPerson(sample.getRegistrator()); builder.column(REGISTRATION_DATE).addDate(sample.getRegistrationDate()); final Experiment experimentOrNull = sample.getExperiment(); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/CommonBusinessObjectFactory.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/CommonBusinessObjectFactory.java index 7daab474649f64c51f9e934607641b10c7b55af9..517874a56a17ff9625b4e39658ef6eb351e70276 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/CommonBusinessObjectFactory.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/CommonBusinessObjectFactory.java @@ -40,7 +40,7 @@ import ch.systemsx.cisd.openbis.generic.server.business.bo.IExperimentBO; import ch.systemsx.cisd.openbis.generic.server.business.bo.IExperimentTable; import ch.systemsx.cisd.openbis.generic.server.business.bo.IGridCustomFilterOrColumnBO; import ch.systemsx.cisd.openbis.generic.server.business.bo.IGroupBO; -import ch.systemsx.cisd.openbis.generic.server.business.bo.IInvalidationBO; +import ch.systemsx.cisd.openbis.generic.server.business.bo.ITrashBO; import ch.systemsx.cisd.openbis.generic.server.business.bo.IMaterialBO; import ch.systemsx.cisd.openbis.generic.server.business.bo.IMaterialTable; import ch.systemsx.cisd.openbis.generic.server.business.bo.IProjectBO; @@ -52,7 +52,7 @@ import ch.systemsx.cisd.openbis.generic.server.business.bo.ISampleTable; import ch.systemsx.cisd.openbis.generic.server.business.bo.IScriptBO; import ch.systemsx.cisd.openbis.generic.server.business.bo.IVocabularyBO; import ch.systemsx.cisd.openbis.generic.server.business.bo.IVocabularyTermBO; -import ch.systemsx.cisd.openbis.generic.server.business.bo.InvalidationBO; +import ch.systemsx.cisd.openbis.generic.server.business.bo.TrashBO; import ch.systemsx.cisd.openbis.generic.server.business.bo.MaterialBO; import ch.systemsx.cisd.openbis.generic.server.business.bo.MaterialTable; import ch.systemsx.cisd.openbis.generic.server.business.bo.ProjectBO; @@ -214,8 +214,8 @@ public final class CommonBusinessObjectFactory extends AbstractBusinessObjectFac return new GridCustomColumnBO(getDaoFactory(), session); } - public IInvalidationBO createInvalidationBO(Session session) + public ITrashBO createTrashBO(Session session) { - return new InvalidationBO(getDaoFactory(), session, this); + return new TrashBO(getDaoFactory(), session, this); } } 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 b998c87e0402b6f8cb43bcf65eaf44e2e8fa2e61..91f8738751d62de2a134d9119e2feb6e518a5fac 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 @@ -50,7 +50,6 @@ import ch.systemsx.cisd.openbis.generic.server.business.bo.IExperimentBO; import ch.systemsx.cisd.openbis.generic.server.business.bo.IExperimentTable; import ch.systemsx.cisd.openbis.generic.server.business.bo.IGridCustomFilterOrColumnBO; import ch.systemsx.cisd.openbis.generic.server.business.bo.IGroupBO; -import ch.systemsx.cisd.openbis.generic.server.business.bo.IInvalidationBO; import ch.systemsx.cisd.openbis.generic.server.business.bo.IMaterialBO; import ch.systemsx.cisd.openbis.generic.server.business.bo.IMaterialTable; import ch.systemsx.cisd.openbis.generic.server.business.bo.IProjectBO; @@ -60,6 +59,7 @@ import ch.systemsx.cisd.openbis.generic.server.business.bo.IRoleAssignmentTable; import ch.systemsx.cisd.openbis.generic.server.business.bo.ISampleBO; import ch.systemsx.cisd.openbis.generic.server.business.bo.ISampleTable; import ch.systemsx.cisd.openbis.generic.server.business.bo.IScriptBO; +import ch.systemsx.cisd.openbis.generic.server.business.bo.ITrashBO; import ch.systemsx.cisd.openbis.generic.server.business.bo.IVocabularyBO; import ch.systemsx.cisd.openbis.generic.server.business.bo.IVocabularyTermBO; import ch.systemsx.cisd.openbis.generic.server.business.bo.MaterialUpdateDTO; @@ -1147,7 +1147,7 @@ public final class CommonServer extends AbstractCommonServer<ICommonServerForInt try { IDataSetTable dataSetTable = businessObjectFactory.createDataSetTable(session); - // TODO 2011-06-21, Piotr Buczek: loading less for invalidation would probably be faster + // TODO 2011-06-21, Piotr Buczek: loading less for deletion would probably be faster dataSetTable.loadByDataSetCodes(dataSetCodes, false, false); List<DataPE> dataSets = dataSetTable.getDataSets(); Map<DataSetTypePE, List<DataPE>> groupedDataSets = @@ -1187,11 +1187,10 @@ public final class CommonServer extends AbstractCommonServer<ICommonServerForInt ISampleTable sampleTableBO = businessObjectFactory.createSampleTable(session); sampleTableBO.deleteByTechIds(sampleIds, reason); break; - case INVALIDATION: - IInvalidationBO invalidationBO = - businessObjectFactory.createInvalidationBO(session); - invalidationBO.createInvalidation(reason); - invalidationBO.invalidateSamples(sampleIds); + case TRASH: + ITrashBO trashBO = businessObjectFactory.createTrashBO(session); + trashBO.createDeletion(reason); + trashBO.trashSamples(sampleIds); break; } } catch (final DataAccessException ex) @@ -1212,11 +1211,10 @@ public final class CommonServer extends AbstractCommonServer<ICommonServerForInt case PERMANENT: experimentBO.deleteByTechIds(experimentIds, reason); break; - case INVALIDATION: - IInvalidationBO invalidationBO = - businessObjectFactory.createInvalidationBO(session); - invalidationBO.createInvalidation(reason); - invalidationBO.invalidateExperiments(experimentIds); + case TRASH: + ITrashBO trashBO = businessObjectFactory.createTrashBO(session); + trashBO.createDeletion(reason); + trashBO.trashExperiments(experimentIds); break; } } catch (final DataAccessException ex) diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/ETLService.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/ETLService.java index 9fe5a4ea6f06bf1b71ec5eae18957c81519bb001..76781234873662ac3aa02d91ea5e38d4e668073c 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/ETLService.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/ETLService.java @@ -1044,10 +1044,10 @@ public class ETLService extends AbstractCommonServer<IETLLIMSService> implements { throw new UserFailureException("No experiment found for sample " + sampleIdentifier); } - if (experiment.getInvalidation() != null) + if (experiment.getDeletion() != null) { throw new UserFailureException("Data set can not be registered because experiment '" - + experiment.getIdentifier() + "' is invalid."); + + experiment.getIdentifier() + "' is in trash."); } final IDataBO dataBO = businessObjectFactory.createDataBO(session); @@ -1386,10 +1386,10 @@ public class ETLService extends AbstractCommonServer<IETLLIMSService> implements { throw new UserFailureException("No experiment found for sample " + sampleIdentifier); } - if (experiment.getInvalidation() != null) + if (experiment.getDeletion() != null) { throw new UserFailureException("Data set can not be registered because experiment '" - + experiment.getIdentifier() + "' is invalid."); + + experiment.getIdentifier() + "' is in trash."); } final ISampleBO sampleBO = businessObjectFactory.createSampleBO(session); sampleBO.loadBySampleIdentifier(sampleIdentifier); @@ -1416,10 +1416,10 @@ public class ETLService extends AbstractCommonServer<IETLLIMSService> implements ExperimentIdentifier experimentIdentifier, NewExternalData externalData) { ExperimentPE experiment = tryToLoadExperimentByIdentifier(session, experimentIdentifier); - if (experiment.getInvalidation() != null) + if (experiment.getDeletion() != null) { throw new UserFailureException("Data set can not be registered because experiment '" - + experiment.getIdentifier() + "' is invalid."); + + experiment.getIdentifier() + "' is in trash."); } final IDataBO externalDataBO = businessObjectFactory.createDataBO(session); SourceType sourceType = diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/AbstractBusinessObject.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/AbstractBusinessObject.java index 684cee07444843d018bd91a6bba09eb3bb739c2f..be43a67621b3adc82978fc68f6a1ae958655afca 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/AbstractBusinessObject.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/AbstractBusinessObject.java @@ -39,7 +39,7 @@ import ch.systemsx.cisd.openbis.generic.server.dataaccess.IFileFormatTypeDAO; import ch.systemsx.cisd.openbis.generic.server.dataaccess.IGridCustomColumnDAO; import ch.systemsx.cisd.openbis.generic.server.dataaccess.IGridCustomFilterDAO; import ch.systemsx.cisd.openbis.generic.server.dataaccess.IHibernateSearchDAO; -import ch.systemsx.cisd.openbis.generic.server.dataaccess.IInvalidationDAO; +import ch.systemsx.cisd.openbis.generic.server.dataaccess.IDeletionDAO; import ch.systemsx.cisd.openbis.generic.server.dataaccess.ILocatorTypeDAO; import ch.systemsx.cisd.openbis.generic.server.dataaccess.IMaterialDAO; import ch.systemsx.cisd.openbis.generic.server.dataaccess.IPersonDAO; @@ -333,9 +333,9 @@ abstract class AbstractBusinessObject implements IDAOFactory return daoFactory.getEventDAO(); } - public final IInvalidationDAO getInvalidationDAO() + public final IDeletionDAO getDeletionDAO() { - return daoFactory.getInvalidationDAO(); + return daoFactory.getDeletionDAO(); } public void setBatchUpdateMode(boolean batchMode) diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/AbstractSampleBusinessObject.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/AbstractSampleBusinessObject.java index 78597c513f3615c789370b878616e2e0bb8ff9ed..10a25de603ee055c7fe9006b832ed3c919d04680 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/AbstractSampleBusinessObject.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/AbstractSampleBusinessObject.java @@ -223,7 +223,7 @@ abstract class AbstractSampleBusinessObject extends AbstractSampleIdentifierBusi { for (SamplePE parent : newParents) { - checkParentInvalidation(parent, child.getSampleIdentifier()); + checkParentDeletion(parent, child.getSampleIdentifier()); } List<SampleRelationshipPE> oldParents = new ArrayList<SampleRelationshipPE>(); for (SampleRelationshipPE r : child.getParentRelationships()) @@ -276,16 +276,16 @@ abstract class AbstractSampleBusinessObject extends AbstractSampleIdentifierBusi } final SamplePE parentPE = getSampleByIdentifier(SampleIdentifierFactory.parse(parentIdentifierOrNull)); - checkParentInvalidation(parentPE, childIdentifier); + checkParentDeletion(parentPE, childIdentifier); return parentPE; } - private void checkParentInvalidation(final SamplePE parentPE, final SampleIdentifier child) + private void checkParentDeletion(final SamplePE parentPE, final SampleIdentifier child) { - if (parentPE.getInvalidation() != null) + if (parentPE.getDeletion() != null) { throw UserFailureException.fromTemplate( - "Sample '%s' has been invalidated and can't become a parent of sample '%s'.", + "Sample '%s' has been deleted and can't become a parent of sample '%s'.", parentPE.getIdentifier(), child); } } @@ -485,11 +485,11 @@ abstract class AbstractSampleBusinessObject extends AbstractSampleIdentifierBusi private void ensureExperimentIsValid(ExperimentIdentifier identOrNull, ExperimentPE experimentOrNull, SamplePE sample) { - if (experimentOrNull != null && experimentOrNull.getInvalidation() != null) + if (experimentOrNull != null && experimentOrNull.getDeletion() != null) { throw UserFailureException.fromTemplate( "The sample '%s' cannot be assigned to the experiment '%s' " - + "because the experiment has been invalidated.", + + "because the experiment has been deleted.", sample.getSampleIdentifier(), identOrNull); } } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/DataSetTable.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/DataSetTable.java index e8edecae5c3d2ec3d89feed99c20c450fb7f739f..caa7470515686168799e849e18dc40a3d5fa3505 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/DataSetTable.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/DataSetTable.java @@ -57,6 +57,7 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.DataSetTypePE; import ch.systemsx.cisd.openbis.generic.shared.dto.DataSetUploadContext; import ch.systemsx.cisd.openbis.generic.shared.dto.DataStorePE; import ch.systemsx.cisd.openbis.generic.shared.dto.DatasetDescription; +import ch.systemsx.cisd.openbis.generic.shared.dto.DeletionPE; import ch.systemsx.cisd.openbis.generic.shared.dto.EntityTypePE; import ch.systemsx.cisd.openbis.generic.shared.dto.EntityTypePropertyTypePE; import ch.systemsx.cisd.openbis.generic.shared.dto.EventPE; @@ -64,7 +65,6 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.EventPE.EntityType; import ch.systemsx.cisd.openbis.generic.shared.dto.EventType; import ch.systemsx.cisd.openbis.generic.shared.dto.ExperimentPE; import ch.systemsx.cisd.openbis.generic.shared.dto.ExternalDataPE; -import ch.systemsx.cisd.openbis.generic.shared.dto.InvalidationPE; import ch.systemsx.cisd.openbis.generic.shared.dto.PersonPE; import ch.systemsx.cisd.openbis.generic.shared.dto.ProjectPE; import ch.systemsx.cisd.openbis.generic.shared.dto.SamplePE; @@ -235,11 +235,11 @@ public final class DataSetTable extends AbstractDataSetBusinessObject implements dataSets.addAll(getDataDAO().listDataSets(experiment)); } - public void invalidateLoadedDataSets(InvalidationPE invalidation) + public void trashLoadedDataSets(DeletionPE deletion) { try { - getDataDAO().invalidate(dataSets, invalidation); + getDataDAO().trash(dataSets, deletion); } catch (final DataAccessException ex) { throwException(ex, "Data Set", EntityKind.DATA_SET); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/ExperimentBO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/ExperimentBO.java index 62705bebc7f6dff4c77710d7018cd5d741307a6b..3a4d955105c3596eace446586f098daec1bedd6e 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/ExperimentBO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/ExperimentBO.java @@ -47,7 +47,7 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.ExperimentPE; import ch.systemsx.cisd.openbis.generic.shared.dto.ExperimentPropertyPE; import ch.systemsx.cisd.openbis.generic.shared.dto.ExperimentTypePE; import ch.systemsx.cisd.openbis.generic.shared.dto.ExperimentUpdatesDTO; -import ch.systemsx.cisd.openbis.generic.shared.dto.InvalidationPE; +import ch.systemsx.cisd.openbis.generic.shared.dto.DeletionPE; import ch.systemsx.cisd.openbis.generic.shared.dto.PersonPE; import ch.systemsx.cisd.openbis.generic.shared.dto.ProjectPE; import ch.systemsx.cisd.openbis.generic.shared.dto.SamplePE; @@ -208,7 +208,7 @@ public final class ExperimentBO extends AbstractBusinessObject implements IExper + "') not found in experiment '" + experiment.getIdentifier() + "'."); } - public void invalidateByTechIds(List<TechId> experimentIds, InvalidationPE invalidation) + public void trashByTechIds(List<TechId> experimentIds, DeletionPE deletion) throws UserFailureException { try @@ -216,7 +216,7 @@ public final class ExperimentBO extends AbstractBusinessObject implements IExper getSessionFactory().getCurrentSession().flush(); getSessionFactory().getCurrentSession().clear(); - getExperimentDAO().invalidate(experimentIds, invalidation); + getExperimentDAO().trash(experimentIds, deletion); } catch (final DataAccessException ex) { throwException(ex, "Experiment", EntityKind.EXPERIMENT); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/ICommonBusinessObjectFactory.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/ICommonBusinessObjectFactory.java index a7478f32797ebb20de88230068ed7854c70835dc..aef46831b89ae91d4e0c815dcb1531756314b208 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/ICommonBusinessObjectFactory.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/ICommonBusinessObjectFactory.java @@ -70,7 +70,7 @@ public interface ICommonBusinessObjectFactory extends IAbstractBussinessObjectFa public IGridCustomFilterOrColumnBO createGridCustomColumnBO(final Session session); - public IInvalidationBO createInvalidationBO(final Session session); + public ITrashBO createTrashBO(final Session session); // Fast listing operations public ISampleLister createSampleLister(Session session); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/IDataSetTable.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/IDataSetTable.java index 75c52a49bfbd7c621dfb571c97f6876fa54f4865..270b74eb5b4454d862f8cd84f2a6dce453f5ebcc 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/IDataSetTable.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/IDataSetTable.java @@ -26,8 +26,8 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.TableModel; import ch.systemsx.cisd.openbis.generic.shared.dto.DataPE; import ch.systemsx.cisd.openbis.generic.shared.dto.DataSetUploadContext; import ch.systemsx.cisd.openbis.generic.shared.dto.DataStorePE; +import ch.systemsx.cisd.openbis.generic.shared.dto.DeletionPE; import ch.systemsx.cisd.openbis.generic.shared.dto.ExternalDataPE; -import ch.systemsx.cisd.openbis.generic.shared.dto.InvalidationPE; /** * A <i>Business Object</i> to load a list of {@link DataPE}-s. @@ -70,12 +70,12 @@ public interface IDataSetTable void setDataSets(List<DataPE> dataSets); /** - * Invalidates loaded data sets for specified reason. + * Moves loaded data sets to trash for specified reason. */ - void invalidateLoadedDataSets(InvalidationPE invalidation); + void trashLoadedDataSets(DeletionPE deletion); /** - * Deletes loaded data sets for specified reason. + * Permanently Deletes loaded data sets for specified reason. */ void deleteLoadedDataSets(String reason); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/IExperimentBO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/IExperimentBO.java index 8dbc2fbd3ab2b72d79f4e8bc9f616a5960ced9f5..668340e2f37c6a41d1d6433e42b6efd2e035bdf1 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/IExperimentBO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/IExperimentBO.java @@ -23,9 +23,9 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.NewExperiment; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.api.IManagedProperty; import ch.systemsx.cisd.openbis.generic.shared.dto.AttachmentPE; +import ch.systemsx.cisd.openbis.generic.shared.dto.DeletionPE; import ch.systemsx.cisd.openbis.generic.shared.dto.ExperimentPE; import ch.systemsx.cisd.openbis.generic.shared.dto.ExperimentUpdatesDTO; -import ch.systemsx.cisd.openbis.generic.shared.dto.InvalidationPE; import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.ExperimentIdentifier; /** @@ -84,12 +84,12 @@ public interface IExperimentBO extends IEntityBusinessObject void deleteByTechIds(List<TechId> experimentIds, String reason); /** - * Invalidates experiment with given invalidation. + * Moves experiment to trash with given deletion. * * @param experimentIds experiment technical identifiers - * @throws UserFailureException if one of the experiments can not be invalidated. + * @throws UserFailureException if one of the experiments can not be moved to trash. */ - void invalidateByTechIds(List<TechId> experimentIds, InvalidationPE invalidation); + void trashByTechIds(List<TechId> experimentIds, DeletionPE deletion); /** * Changes the value of a managed property. diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/ISampleTable.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/ISampleTable.java index 58b54b8ce7d4fb050ad85db2eb698f5bca9dfc3b..68a1b38f937e42961ef7112126130bd8a0493e3e 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/ISampleTable.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/ISampleTable.java @@ -21,7 +21,7 @@ import java.util.List; import ch.systemsx.cisd.common.exceptions.UserFailureException; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.NewSample; -import ch.systemsx.cisd.openbis.generic.shared.dto.InvalidationPE; +import ch.systemsx.cisd.openbis.generic.shared.dto.DeletionPE; import ch.systemsx.cisd.openbis.generic.shared.dto.ListSamplesByPropertyCriteria; import ch.systemsx.cisd.openbis.generic.shared.dto.PersonPE; import ch.systemsx.cisd.openbis.generic.shared.dto.SampleBatchUpdatesDTO; @@ -73,12 +73,12 @@ public interface ISampleTable public void deleteByTechIds(List<TechId> sampleIds, String reason) throws UserFailureException; /** - * Invalidates samples with given invalidation. + * Moves samples to trash with given deletion. * * @param sampleIds sample technical identifiers - * @throws UserFailureException if one of the samples can not be invalidated. + * @throws UserFailureException if one of the samples can not be moved to trash. */ - public void invalidateByTechIds(List<TechId> sampleIds, InvalidationPE invalidation) + public void trashByTechIds(List<TechId> sampleIds, DeletionPE deletion) throws UserFailureException; } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/IInvalidationBO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/ITrashBO.java similarity index 73% rename from openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/IInvalidationBO.java rename to openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/ITrashBO.java index 718cbbd94da6d2f8d2b7c1f4b4b5ab76a279bb72..70bc1384c5a6925d9ec5d6b11b0ba529394791b3 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/IInvalidationBO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/ITrashBO.java @@ -22,19 +22,19 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; import ch.systemsx.cisd.openbis.generic.shared.dto.DataPE; /** - * Handles cascade invalidation of entities. + * Handles the trash of entities. * * @author Piotr Buczek */ -public interface IInvalidationBO +public interface ITrashBO { - public void createInvalidation(String reason); + public void createDeletion(String reason); - public void invalidateSamples(List<TechId> sampleIds); + public void trashSamples(List<TechId> sampleIds); - public void invalidateExperiments(List<TechId> experimentIds); + public void trashExperiments(List<TechId> experimentIds); - public void invalidateDataSets(List<DataPE> dataSets); + public void trashDataSets(List<DataPE> dataSets); } \ No newline at end of file diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/SampleBO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/SampleBO.java index e04afbfda87cfe4bb3276ca9915b3079d4ae96b5..eb0f92fc91743a3fca2e3d70edcb760211c90b58 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/SampleBO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/SampleBO.java @@ -196,7 +196,7 @@ public final class SampleBO extends AbstractSampleBusinessObject implements ISam { assert sample != null : "Sample not loaded."; - checkValid(sample); + checkAvailable(sample); checkSampleInGroup(sample); checkSampleUnused(sample); checkSampleWithoutDatasets(); @@ -212,11 +212,11 @@ public final class SampleBO extends AbstractSampleBusinessObject implements ISam dataChanged = false; } - static private void checkValid(SamplePE sample) + static private void checkAvailable(SamplePE sample) { - if (sample.getInvalidation() != null) + if (sample.getDeletion() != null) { - throw UserFailureException.fromTemplate("Given sample '%s' is invalid.", + throw UserFailureException.fromTemplate("Given sample '%s' is in trash.", sample.getSampleIdentifier()); } } @@ -229,7 +229,7 @@ public final class SampleBO extends AbstractSampleBusinessObject implements ISam private final static void checkSampleUnused(final SamplePE sample) { ExperimentPE experiment = sample.getExperiment(); - if (experiment != null && experiment.getInvalidation() == null) + if (experiment != null && experiment.getDeletion() == null) { throw UserFailureException.fromTemplate( "Given sample code '%s' already registered for experiment '%s'.", diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/SampleTable.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/SampleTable.java index a3816ae4f00cc5f1d84f03b5095eeed3c7fae9e5..5c2f74eb54047a9a8a3ee3839d950c91b4ac53cb 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/SampleTable.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/SampleTable.java @@ -34,7 +34,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.SampleBatchUpdateDetail import ch.systemsx.cisd.openbis.generic.shared.dto.EntityTypePE; import ch.systemsx.cisd.openbis.generic.shared.dto.EntityTypePropertyTypePE; import ch.systemsx.cisd.openbis.generic.shared.dto.ExperimentPE; -import ch.systemsx.cisd.openbis.generic.shared.dto.InvalidationPE; +import ch.systemsx.cisd.openbis.generic.shared.dto.DeletionPE; import ch.systemsx.cisd.openbis.generic.shared.dto.ListSamplesByPropertyCriteria; import ch.systemsx.cisd.openbis.generic.shared.dto.PersonPE; import ch.systemsx.cisd.openbis.generic.shared.dto.ProjectPE; @@ -341,7 +341,7 @@ public final class SampleTable extends AbstractSampleBusinessObject implements I } } - public void invalidateByTechIds(List<TechId> sampleIds, InvalidationPE invalidation) + public void trashByTechIds(List<TechId> sampleIds, DeletionPE deletion) throws UserFailureException { try @@ -349,7 +349,7 @@ public final class SampleTable extends AbstractSampleBusinessObject implements I getSessionFactory().getCurrentSession().flush(); getSessionFactory().getCurrentSession().clear(); - getSampleDAO().invalidate(sampleIds, invalidation); + getSampleDAO().trash(sampleIds, deletion); } catch (final DataAccessException ex) { throwException(ex, "Sample", EntityKind.SAMPLE); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/InvalidationBO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/TrashBO.java similarity index 60% rename from openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/InvalidationBO.java rename to openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/TrashBO.java index 23c4d8dbac8baf7b43d491fde45d9a9bce41905b..c18f65406d6d85ea021f75c8bd4fd1e812405803 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/InvalidationBO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/TrashBO.java @@ -23,60 +23,60 @@ import org.springframework.dao.DataAccessException; import ch.systemsx.cisd.openbis.generic.server.dataaccess.IDAOFactory; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; import ch.systemsx.cisd.openbis.generic.shared.dto.DataPE; -import ch.systemsx.cisd.openbis.generic.shared.dto.InvalidationPE; +import ch.systemsx.cisd.openbis.generic.shared.dto.DeletionPE; import ch.systemsx.cisd.openbis.generic.shared.dto.Session; /** * @author Piotr Buczek */ -public class InvalidationBO extends AbstractBusinessObject implements IInvalidationBO +public class TrashBO extends AbstractBusinessObject implements ITrashBO { private final ICommonBusinessObjectFactory boFactory; - private InvalidationPE invalidation; + private DeletionPE deletion; - public InvalidationBO(IDAOFactory daoFactory, Session session, + public TrashBO(IDAOFactory daoFactory, Session session, ICommonBusinessObjectFactory boFactory) { super(daoFactory, session); this.boFactory = boFactory; } - public void createInvalidation(String reason) + public void createDeletion(String reason) { try { - invalidation = new InvalidationPE(); - invalidation.setReason(reason); - invalidation.setRegistrator(session.tryGetPerson()); - getInvalidationDAO().create(invalidation); + deletion = new DeletionPE(); + deletion.setReason(reason); + deletion.setRegistrator(session.tryGetPerson()); + getDeletionDAO().create(deletion); } catch (final DataAccessException ex) { - throwException(ex, "Invalidation"); + throwException(ex, "Deletion"); } } - public void invalidateSamples(List<TechId> sampleIds) + public void trashSamples(List<TechId> sampleIds) { - assert invalidation != null; + assert deletion != null; ISampleTable sampleTableBO = boFactory.createSampleTable(session); - sampleTableBO.invalidateByTechIds(sampleIds, invalidation); + sampleTableBO.trashByTechIds(sampleIds, deletion); } - public void invalidateExperiments(List<TechId> experimentIds) + public void trashExperiments(List<TechId> experimentIds) { - assert invalidation != null; + assert deletion != null; IExperimentBO experimentBO = boFactory.createExperimentBO(session); - experimentBO.invalidateByTechIds(experimentIds, invalidation); + experimentBO.trashByTechIds(experimentIds, deletion); } - public void invalidateDataSets(List<DataPE> dataSets) + public void trashDataSets(List<DataPE> dataSets) { - assert invalidation != null; + assert deletion != null; IDataSetTable dataSetTable = boFactory.createDataSetTable(session); dataSetTable.setDataSets(dataSets); - dataSetTable.invalidateLoadedDataSets(invalidation); + dataSetTable.trashLoadedDataSets(deletion); } } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/entity/ExperimentProjectSpaceCodeRecord.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/entity/ExperimentProjectSpaceCodeRecord.java index 9db965a96bb818321230d80ac943b9e296a3a945..b7cd5bf4895c24cdcf4fa18a52cde74b05d60c79 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/entity/ExperimentProjectSpaceCodeRecord.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/entity/ExperimentProjectSpaceCodeRecord.java @@ -3,7 +3,7 @@ package ch.systemsx.cisd.openbis.generic.server.business.bo.common.entity; import ch.rinn.restrictions.Private; /** - * A class representing an experiment, project and space code. It contains also invalidation id, + * A class representing an experiment, project and space code. It contains also deletion id, * code of experiment type and database instance id. */ @Private diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/entity/SampleReferenceRecord.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/entity/SampleReferenceRecord.java index a352b5a5fa998e41780febcefc9c59aa6d7c17a5..ce2d15260cb3398457087d16a9a5c905f454b56e 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/entity/SampleReferenceRecord.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/entity/SampleReferenceRecord.java @@ -33,7 +33,7 @@ public class SampleReferenceRecord /** sample code */ public String s_code; - /** invalidation id */ + /** deletion id */ public Long del_id; /** sample type code */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/entity/SecondaryEntityDAO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/entity/SecondaryEntityDAO.java index 243d2e06f415f1249cc7333e5fbbef3be648c5e0..7198187c6178678e918c350a4b88474de2543779 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/entity/SecondaryEntityDAO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/entity/SecondaryEntityDAO.java @@ -36,7 +36,7 @@ import ch.systemsx.cisd.openbis.generic.server.dataaccess.PersistencyResources; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseInstance; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Experiment; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ExperimentType; -import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Invalidation; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Deletion; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Person; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Project; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Sample; @@ -114,7 +114,7 @@ public class SecondaryEntityDAO experiment.setPermId(record.e_permid); experiment.setIdentifier(new ExperimentIdentifier(null, space.getCode(), record.p_code, record.e_code).toString()); - experiment.setInvalidation(createInvalidation(record.del_id)); + experiment.setDeletion(createDeletion(record.del_id)); final Project project = new Project(); project.setId(record.p_id); project.setCode(record.p_code); @@ -199,7 +199,7 @@ public class SecondaryEntityDAO sample.setId(record.id); sample.setCode(IdentifierHelper.convertCode(record.s_code, record.c_code)); sample.setSampleType(createSampleType(record.st_code, databaseInstance)); - sample.setInvalidation(createInvalidation(record.del_id)); + sample.setDeletion(createDeletion(record.del_id)); sample.setSpace(tryCreateGroup(record.spc_code, databaseInstance)); sample.setDatabaseInstance(tryGetDatabaseInstance(record.spc_code, databaseInstance)); sample.setPermId(record.perm_id); @@ -238,14 +238,14 @@ public class SecondaryEntityDAO } } - private static Invalidation createInvalidation(Long invalidationIdOrNull) + private static Deletion createDeletion(Long deletionIdOrNull) { - if (invalidationIdOrNull == null) + if (deletionIdOrNull == null) { return null; } else { - return new Invalidation(); + return new Deletion(); } } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/datasetlister/DatasetLister.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/datasetlister/DatasetLister.java index 03bdee18e9440e292c9de08dab75ac892cafce54..a5d32682dae2673434849f17a28ffd5c8b3c6565 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/datasetlister/DatasetLister.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/datasetlister/DatasetLister.java @@ -66,7 +66,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Experiment; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ExternalData; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.FileFormatType; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.IEntityProperty; -import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Invalidation; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Deletion; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.LocatorType; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Sample; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.TrackingDataSetCriteria; @@ -647,7 +647,7 @@ public class DatasetLister extends AbstractLister implements IDatasetLister if (dataSetOrNull != null) { - enrichWithInvalidation(dataSetOrNull, record); + enrichWithDeletion(dataSetOrNull, record); datasets.put(record.id, dataSetOrNull); } } @@ -655,12 +655,12 @@ public class DatasetLister extends AbstractLister implements IDatasetLister } // NOTE: this just marks the data set as invalid without loading any details - private void enrichWithInvalidation(final ExternalData dataSet, DatasetRecord row) + private void enrichWithDeletion(final ExternalData dataSet, DatasetRecord row) { if (row.del_id != null) { - final Invalidation invalidation = new Invalidation(); - dataSet.setInvalidation(invalidation); + final Deletion deletion = new Deletion(); + dataSet.setDeletion(deletion); } } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/samplelister/SampleListingWorker.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/samplelister/SampleListingWorker.java index d605201d3c40f492fed837ec267ec19321f4cb41..4f4ca17f54b698bc1fcf4583d7abcfe92995f5c5 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/samplelister/SampleListingWorker.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/samplelister/SampleListingWorker.java @@ -47,7 +47,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseInstance; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Experiment; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.IEntityProperty; -import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Invalidation; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Deletion; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ListOrSearchSampleCriteria; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ListSampleCriteria; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Sample; @@ -576,7 +576,7 @@ final class SampleListingWorker extends AbstractLister return null; } } - enrichWithInvalidation(sample, row); // this is cheap even for dependent samples + enrichWithDeletion(sample, row); // this is cheap even for dependent samples // set properties needed for primary samples // (dependent samples too if they need to be enriched e.g. for entity tracking) if (primarySample || enrichDependentSamples) @@ -617,12 +617,12 @@ final class SampleListingWorker extends AbstractLister } // NOTE: this just marks the sample as invalid without loading any details - private void enrichWithInvalidation(final Sample sample, SampleRecord row) + private void enrichWithDeletion(final Sample sample, SampleRecord row) { if (row.del_id != null) { - final Invalidation invalidation = new Invalidation(); - sample.setInvalidation(invalidation); + final Deletion deletion = new Deletion(); + sample.setDeletion(deletion); } } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IDAOFactory.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IDAOFactory.java index a4d88470eba0a46e752c040ccd61bfdd7e59b957..6bf82510840cdfa4a196a7c2c30fe1ec7add4be2 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IDAOFactory.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IDAOFactory.java @@ -98,7 +98,7 @@ public interface IDAOFactory extends IAuthorizationDAOFactory /** Returns an implementation of {@link IAuthorizationGroupDAO}. */ public IAuthorizationGroupDAO getAuthorizationGroupDAO(); - /** Returns an implementation of {@link IInvalidationDAO}. */ - public IInvalidationDAO getInvalidationDAO(); + /** Returns an implementation of {@link IDeletionDAO}. */ + public IDeletionDAO getDeletionDAO(); } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IDataDAO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IDataDAO.java index ed4ca2061778c75c680581beb35bdf166d4987ca..67fb17eb21e8355559a9645c9701feb5810a2f64 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IDataDAO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IDataDAO.java @@ -27,9 +27,9 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataSetArchivingStatus; import ch.systemsx.cisd.openbis.generic.shared.dto.DataPE; import ch.systemsx.cisd.openbis.generic.shared.dto.DataStorePE; +import ch.systemsx.cisd.openbis.generic.shared.dto.DeletionPE; import ch.systemsx.cisd.openbis.generic.shared.dto.ExperimentPE; import ch.systemsx.cisd.openbis.generic.shared.dto.ExternalDataPE; -import ch.systemsx.cisd.openbis.generic.shared.dto.InvalidationPE; import ch.systemsx.cisd.openbis.generic.shared.dto.SamplePE; /** @@ -121,9 +121,8 @@ public interface IDataDAO extends IGenericDAO<DataPE> public void updateDataSets(List<DataPE> externalData); /** - * Invalidate given data sets using specified invalidation. + * Move given data sets to trash using specified deletion. */ - public void invalidate(List<DataPE> dataSets, InvalidationPE invalidation) - throws DataAccessException; + public void trash(List<DataPE> dataSets, DeletionPE deletion) throws DataAccessException; } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IInvalidationDAO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IDeletionDAO.java similarity index 73% rename from openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IInvalidationDAO.java rename to openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IDeletionDAO.java index 1eee382d8db630256978553294ccf8196cbfad92..1e28237ff1e26016342f539361f8b8c70f4c9502 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IInvalidationDAO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IDeletionDAO.java @@ -18,18 +18,18 @@ package ch.systemsx.cisd.openbis.generic.server.dataaccess; import org.springframework.dao.DataAccessException; -import ch.systemsx.cisd.openbis.generic.shared.dto.InvalidationPE; +import ch.systemsx.cisd.openbis.generic.shared.dto.DeletionPE; /** - * An interface that contains all data access operations on {@link InvalidationPE}s. + * An interface that contains all data access operations on {@link DeletionPE}s. * * @author Piotr Buczek */ -public interface IInvalidationDAO extends IGenericDAO<InvalidationPE> +public interface IDeletionDAO extends IGenericDAO<DeletionPE> { /** - * Inserts given {@link InvalidationPE} into the database. + * Inserts given {@link DeletionPE} into the database. */ - void create(final InvalidationPE invalidation) throws DataAccessException; + void create(final DeletionPE deletion) throws DataAccessException; } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IExperimentDAO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IExperimentDAO.java index dea45408e3b8262c71df563e3a5b19c96f8e1057..8a52959b90e4255d20bf7fb37df99c1007f345b1 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IExperimentDAO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IExperimentDAO.java @@ -23,9 +23,9 @@ import java.util.Set; import org.springframework.dao.DataAccessException; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; +import ch.systemsx.cisd.openbis.generic.shared.dto.DeletionPE; import ch.systemsx.cisd.openbis.generic.shared.dto.ExperimentPE; import ch.systemsx.cisd.openbis.generic.shared.dto.ExperimentTypePE; -import ch.systemsx.cisd.openbis.generic.shared.dto.InvalidationPE; import ch.systemsx.cisd.openbis.generic.shared.dto.ProjectPE; import ch.systemsx.cisd.openbis.generic.shared.dto.SpacePE; @@ -107,6 +107,9 @@ public interface IExperimentDAO extends IGenericDAO<ExperimentPE> */ public void createOrUpdateExperiments(List<ExperimentPE> experiments); - public void invalidate(List<TechId> experimentIds, InvalidationPE invalidation); + /** + * Move experiments with given ids to trash using specified deletion. + */ + public void trash(List<TechId> experimentIds, DeletionPE deletion); } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/ISampleDAO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/ISampleDAO.java index 2df1d1e0c8d011410d74c398a8802d4d53002e86..b136bfeafa3c809a7084504f7fd22acc23c7ad7d 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/ISampleDAO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/ISampleDAO.java @@ -24,7 +24,7 @@ import org.springframework.dao.DataAccessException; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; import ch.systemsx.cisd.openbis.generic.shared.dto.DatabaseInstancePE; -import ch.systemsx.cisd.openbis.generic.shared.dto.InvalidationPE; +import ch.systemsx.cisd.openbis.generic.shared.dto.DeletionPE; import ch.systemsx.cisd.openbis.generic.shared.dto.PersonPE; import ch.systemsx.cisd.openbis.generic.shared.dto.SamplePE; import ch.systemsx.cisd.openbis.generic.shared.dto.SpacePE; @@ -124,7 +124,7 @@ public interface ISampleDAO extends IGenericDAO<SamplePE> throws DataAccessException; /** - * Invalidate samples with given ids using specified invalidation. + * Move samples with given ids to trash using specified deletion. */ - void invalidate(List<TechId> sampleIds, InvalidationPE invalidation) throws DataAccessException; + void trash(List<TechId> sampleIds, DeletionPE deletion) throws DataAccessException; } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/DAOFactory.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/DAOFactory.java index 41de9abe438814726353a3dc958fd411482cfe76..f32638c95ed4b28b27da3ee9534c79cf473efd2f 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/DAOFactory.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/DAOFactory.java @@ -34,7 +34,7 @@ import ch.systemsx.cisd.openbis.generic.server.dataaccess.IEntityTypeDAO; import ch.systemsx.cisd.openbis.generic.server.dataaccess.IEventDAO; import ch.systemsx.cisd.openbis.generic.server.dataaccess.IFileFormatTypeDAO; import ch.systemsx.cisd.openbis.generic.server.dataaccess.IHibernateSearchDAO; -import ch.systemsx.cisd.openbis.generic.server.dataaccess.IInvalidationDAO; +import ch.systemsx.cisd.openbis.generic.server.dataaccess.IDeletionDAO; import ch.systemsx.cisd.openbis.generic.server.dataaccess.ILocatorTypeDAO; import ch.systemsx.cisd.openbis.generic.server.dataaccess.IMaterialDAO; import ch.systemsx.cisd.openbis.generic.server.dataaccess.IPropertyTypeDAO; @@ -102,7 +102,7 @@ public final class DAOFactory extends AuthorizationDAOFactory implements IDAOFac private final IScriptDAO scriptDAO; - private final IInvalidationDAO invalidationDAO; + private final IDeletionDAO deletionDAO; public DAOFactory(final DatabaseConfigurationContext context, final SessionFactory sessionFactory, HibernateSearchContext hibernateSearchContext, @@ -130,7 +130,7 @@ public final class DAOFactory extends AuthorizationDAOFactory implements IDAOFac eventDAO = new EventDAO(sessionFactory, databaseInstance); authorizationGroupDAO = new AuthorizationGroupDAO(sessionFactory, databaseInstance); scriptDAO = new ScriptDAO(sessionFactory, databaseInstance); - invalidationDAO = new InvalidationDAO(sessionFactory, databaseInstance); + deletionDAO = new DeletionDAO(sessionFactory, databaseInstance); final EntityKind[] entityKinds = EntityKind.values(); for (final EntityKind entityKind : entityKinds) { @@ -236,9 +236,9 @@ public final class DAOFactory extends AuthorizationDAOFactory implements IDAOFac return scriptDAO; } - public IInvalidationDAO getInvalidationDAO() + public IDeletionDAO getDeletionDAO() { - return invalidationDAO; + return deletionDAO; } public IDynamicPropertyEvaluationScheduler getDynamicPropertyEvaluationScheduler() diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/DataDAO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/DataDAO.java index b11fe8767548f9b94996f84368288c4136e28c98..31b71a2b2db1c02e54b931f57b6b6593a54ca669 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/DataDAO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/DataDAO.java @@ -54,7 +54,7 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.DataStorePE; import ch.systemsx.cisd.openbis.generic.shared.dto.DatabaseInstancePE; import ch.systemsx.cisd.openbis.generic.shared.dto.ExperimentPE; import ch.systemsx.cisd.openbis.generic.shared.dto.ExternalDataPE; -import ch.systemsx.cisd.openbis.generic.shared.dto.InvalidationPE; +import ch.systemsx.cisd.openbis.generic.shared.dto.DeletionPE; import ch.systemsx.cisd.openbis.generic.shared.dto.SamplePE; import ch.systemsx.cisd.openbis.generic.shared.dto.TableNames; import ch.systemsx.cisd.openbis.generic.shared.util.HibernateUtils; @@ -466,15 +466,15 @@ final class DataDAO extends AbstractGenericEntityWithPropertiesDAO<DataPE> imple super.delete(entity); } - public void invalidate(List<DataPE> dataSets, InvalidationPE invalidation) + public void trash(List<DataPE> dataSets, DeletionPE deletion) throws DataAccessException { // TODO 2011-06-16, Piotr Buczek: could be done faster with bulk update for (DataPE dataSet : dataSets) { - if (dataSet.getInvalidation() == null) + if (dataSet.getDeletion() == null) { - dataSet.setInvalidation(invalidation); + dataSet.setDeletion(deletion); } } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/ExperimentDAO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/ExperimentDAO.java index a2f2ed52498c17cbffd9c7a656940e11ee583a89..98d6a1632c93460dc3b1db32d461d0a4f89e3592 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/ExperimentDAO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/ExperimentDAO.java @@ -41,7 +41,7 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.DatabaseInstancePE; import ch.systemsx.cisd.openbis.generic.shared.dto.ExperimentPE; import ch.systemsx.cisd.openbis.generic.shared.dto.ExperimentPropertyPE; import ch.systemsx.cisd.openbis.generic.shared.dto.ExperimentTypePE; -import ch.systemsx.cisd.openbis.generic.shared.dto.InvalidationPE; +import ch.systemsx.cisd.openbis.generic.shared.dto.DeletionPE; import ch.systemsx.cisd.openbis.generic.shared.dto.ProjectPE; import ch.systemsx.cisd.openbis.generic.shared.dto.SpacePE; @@ -300,16 +300,16 @@ public class ExperimentDAO extends AbstractGenericEntityWithPropertiesDAO<Experi } } - public void invalidate(final List<TechId> experimentIds, final InvalidationPE invalidation) + public void trash(final List<TechId> experimentIds, final DeletionPE deletion) throws DataAccessException { // TODO 2011-06-16, Piotr Buczek: could be done faster with bulk update for (TechId experimentId : experimentIds) { ExperimentPE experiment = loadByTechId(experimentId); - if (experiment.getInvalidation() == null) + if (experiment.getDeletion() == null) { - experiment.setInvalidation(invalidation); + experiment.setDeletion(deletion); } } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/InvalidationDAO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/InvalidationDAO.java index c227d12a4425a0a85542f1b481417c2bda1a840b..af281fe5d730d200eff866e6ab37cc4b4c83383e 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/InvalidationDAO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/InvalidationDAO.java @@ -24,17 +24,17 @@ import org.springframework.orm.hibernate3.HibernateTemplate; import ch.systemsx.cisd.common.logging.LogCategory; import ch.systemsx.cisd.common.logging.LogFactory; -import ch.systemsx.cisd.openbis.generic.server.dataaccess.IInvalidationDAO; +import ch.systemsx.cisd.openbis.generic.server.dataaccess.IDeletionDAO; import ch.systemsx.cisd.openbis.generic.shared.dto.DatabaseInstancePE; -import ch.systemsx.cisd.openbis.generic.shared.dto.InvalidationPE; +import ch.systemsx.cisd.openbis.generic.shared.dto.DeletionPE; /** - * <i>Data Access Object</i> implementation for {@link IInvalidationDAO}. + * <i>Data Access Object</i> implementation for {@link IDeletionDAO}. * * @author Christian Ribeaud */ -final class InvalidationDAO extends AbstractGenericEntityDAO<InvalidationPE> implements - IInvalidationDAO +final class DeletionDAO extends AbstractGenericEntityDAO<DeletionPE> implements + IDeletionDAO { /** @@ -42,28 +42,28 @@ final class InvalidationDAO extends AbstractGenericEntityDAO<InvalidationPE> imp * appropriate debugging level for class {@link JdbcAccessor}. </p> */ private static final Logger operationLog = LogFactory.getLogger(LogCategory.OPERATION, - InvalidationDAO.class); + DeletionDAO.class); - InvalidationDAO(final SessionFactory sessionFactory, final DatabaseInstancePE databaseInstance) + DeletionDAO(final SessionFactory sessionFactory, final DatabaseInstancePE databaseInstance) { - super(sessionFactory, databaseInstance, InvalidationPE.class); + super(sessionFactory, databaseInstance, DeletionPE.class); } // - // IInvalidationDAO + // IDeletionDAO // - public final void create(final InvalidationPE invalidation) throws DataAccessException + public final void create(final DeletionPE deletion) throws DataAccessException { - assert invalidation != null : "Unspecified invalidation"; - validatePE(invalidation); + assert deletion != null : "Unspecified deletion"; + validatePE(deletion); final HibernateTemplate template = getHibernateTemplate(); - template.save(invalidation); + template.save(deletion); template.flush(); if (operationLog.isInfoEnabled()) { - operationLog.info(String.format("ADD: invalidation '%s'.", invalidation)); + operationLog.info(String.format("ADD: deletion '%s'.", deletion)); } } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/SampleDAO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/SampleDAO.java index a25ec3bb15c4b27e7765f9f725421ba71783fd48..da3f85f4e801a6ba33d048f0ee8370adcf162f5f 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/SampleDAO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/SampleDAO.java @@ -45,7 +45,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; import ch.systemsx.cisd.openbis.generic.shared.dto.DatabaseInstancePE; import ch.systemsx.cisd.openbis.generic.shared.dto.EventPE.EntityType; import ch.systemsx.cisd.openbis.generic.shared.dto.EventType; -import ch.systemsx.cisd.openbis.generic.shared.dto.InvalidationPE; +import ch.systemsx.cisd.openbis.generic.shared.dto.DeletionPE; import ch.systemsx.cisd.openbis.generic.shared.dto.PersonPE; import ch.systemsx.cisd.openbis.generic.shared.dto.SamplePE; import ch.systemsx.cisd.openbis.generic.shared.dto.SamplePropertyPE; @@ -440,16 +440,16 @@ public class SampleDAO extends AbstractGenericEntityWithPropertiesDAO<SamplePE> scheduleRemoveFromFullTextIndex(ids); } - public void invalidate(final List<TechId> sampleIds, final InvalidationPE invalidation) + public void trash(final List<TechId> sampleIds, final DeletionPE deletion) throws DataAccessException { // TODO 2011-06-16, Piotr Buczek: could be done faster with bulk update for (TechId sampleId : sampleIds) { SamplePE sample = loadByTechId(sampleId); - if (sample.getInvalidation() == null) + if (sample.getDeletion() == null) { - sample.setInvalidation(invalidation); + sample.setDeletion(deletion); } } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/InvalidationUtils.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/DeletionUtils.java similarity index 66% rename from openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/InvalidationUtils.java rename to openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/DeletionUtils.java index 70e8d8c8388715797f9e5ee89db0ebe3c0e8583f..aa470182cb72bcb74a26d26697b8f0daad398aac 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/InvalidationUtils.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/DeletionUtils.java @@ -19,19 +19,19 @@ package ch.systemsx.cisd.openbis.generic.shared.basic; /** * @author Piotr Buczek */ -public class InvalidationUtils +public class DeletionUtils { - public static boolean isInvalid(IInvalidationProvider invalidableOrNull) + public static boolean isDeleted(IDeletionProvider deletableOrNull) { - return invalidableOrNull != null && invalidableOrNull.getInvalidation() != null; + return deletableOrNull != null && deletableOrNull.getDeletion() != null; } - public static boolean isInvalid(Object objectOrNull) + public static boolean isDeleted(Object objectOrNull) { - if (objectOrNull != null && objectOrNull instanceof IInvalidationProvider) + if (objectOrNull != null && objectOrNull instanceof IDeletionProvider) { - return isInvalid((IInvalidationProvider) objectOrNull); + return isDeleted((IDeletionProvider) objectOrNull); } else { return false; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/IInvalidationProvider.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/IDeletionProvider.java similarity index 82% rename from openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/IInvalidationProvider.java rename to openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/IDeletionProvider.java index 68d815bcd682e32b593ea4e68fc39b088e39d62a..f03c91ec2b53afe5b41a0424cf9970580f9c8a56 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/IInvalidationProvider.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/IDeletionProvider.java @@ -16,12 +16,12 @@ package ch.systemsx.cisd.openbis.generic.shared.basic; -import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Invalidation; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Deletion; /** * @author Franz-Josef Elmer */ -public interface IInvalidationProvider +public interface IDeletionProvider { - public Invalidation getInvalidation(); + public Deletion getDeletion(); } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/Invalidation.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/Deletion.java similarity index 88% rename from openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/Invalidation.java rename to openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/Deletion.java index bbb4c78f759fc75b5fbf1b5c074c41e547b23684..955d555887731e9be88fade7acfe091f8a743305 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/Invalidation.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/Deletion.java @@ -16,17 +16,16 @@ package ch.systemsx.cisd.openbis.generic.shared.basic.dto; - /** - * Information about invalidation. + * Information about deletion. * * @author Christian Ribeaud */ -public final class Invalidation extends AbstractRegistrationHolder +public final class Deletion extends AbstractRegistrationHolder { private static final long serialVersionUID = ServiceVersionHolder.VERSION; - /** Reason of invalidation. */ + /** Reason of deletion. */ private String reasonOrNull; public final String getReason() diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/DeletionType.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/DeletionType.java index 39c93cbbfc9c108053e2ce11a54e0bfdc9576fa8..28aab935fcbe9feb3f40bc542c601df98a5a32c7 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/DeletionType.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/DeletionType.java @@ -25,5 +25,5 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.ISerializable; */ public enum DeletionType implements ISerializable { - PERMANENT, INVALIDATION + PERMANENT, TRASH } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/Experiment.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/Experiment.java index 6a007476a445d50516621fe8a146b47f37b962c5..ea4b5161e2bed78be804590c245d6743b55e6aa3 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/Experiment.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/Experiment.java @@ -20,9 +20,9 @@ import java.util.Date; import java.util.List; import ch.systemsx.cisd.openbis.generic.shared.basic.IAttachmentHolder; +import ch.systemsx.cisd.openbis.generic.shared.basic.IDeletionProvider; import ch.systemsx.cisd.openbis.generic.shared.basic.IEntityInformationHolderWithProperties; import ch.systemsx.cisd.openbis.generic.shared.basic.IIdAndCodeHolder; -import ch.systemsx.cisd.openbis.generic.shared.basic.IInvalidationProvider; import ch.systemsx.cisd.openbis.generic.shared.basic.IPermIdHolder; /** @@ -30,7 +30,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.IPermIdHolder; * * @author Tomasz Pylak */ -public class Experiment extends CodeWithRegistration<Experiment> implements IInvalidationProvider, +public class Experiment extends CodeWithRegistration<Experiment> implements IDeletionProvider, IEntityInformationHolderWithProperties, IAttachmentHolder, IIdAndCodeHolder, IPermIdHolder { private static final long serialVersionUID = ServiceVersionHolder.VERSION; @@ -43,7 +43,7 @@ public class Experiment extends CodeWithRegistration<Experiment> implements IInv private List<IEntityProperty> properties; - private Invalidation invalidation; + private Deletion deletion; private List<Attachment> attachments; @@ -105,14 +105,14 @@ public class Experiment extends CodeWithRegistration<Experiment> implements IInv this.properties = properties; } - public Invalidation getInvalidation() + public Deletion getDeletion() { - return invalidation; + return deletion; } - public void setInvalidation(final Invalidation invalidation) + public void setDeletion(final Deletion deletion) { - this.invalidation = invalidation; + this.deletion = deletion; } public List<Attachment> getAttachments() @@ -142,10 +142,9 @@ public class Experiment extends CodeWithRegistration<Experiment> implements IInv public String toString() { return "Experiment [project=" + project + ", experimentType=" + experimentType - + ", identifier=" + identifier + ", properties=" + properties + ", invalidation=" - + invalidation + ", attachments=" + attachments + ", id=" + id - + ", modificationDate=" + modificationDate + ", permId=" + permId + ", permlink=" - + permlink + "]"; + + ", identifier=" + identifier + ", properties=" + properties + ", deletion=" + + deletion + ", attachments=" + attachments + ", id=" + id + ", modificationDate=" + + modificationDate + ", permId=" + permId + ", permlink=" + permlink + "]"; } // diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ExternalData.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ExternalData.java index 0a0acf8490c84acd188fc48f6ba6cfd13f705e8d..04fb69cd2a10e7ab1bd9b19fac9a1d66010de50b 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ExternalData.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ExternalData.java @@ -23,7 +23,7 @@ import java.util.List; import ch.systemsx.cisd.openbis.generic.shared.basic.IEntityInformationHolderWithProperties; import ch.systemsx.cisd.openbis.generic.shared.basic.IIdAndCodeHolder; -import ch.systemsx.cisd.openbis.generic.shared.basic.IInvalidationProvider; +import ch.systemsx.cisd.openbis.generic.shared.basic.IDeletionProvider; import ch.systemsx.cisd.openbis.generic.shared.basic.IPermIdHolder; /** @@ -32,7 +32,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.IPermIdHolder; * @author Christian Ribeaud */ public class ExternalData extends CodeWithRegistration<ExternalData> implements - IInvalidationProvider, IEntityInformationHolderWithProperties, IIdAndCodeHolder, + IDeletionProvider, IEntityInformationHolderWithProperties, IIdAndCodeHolder, IPermIdHolder { private static final long serialVersionUID = ServiceVersionHolder.VERSION; @@ -48,7 +48,7 @@ public class ExternalData extends CodeWithRegistration<ExternalData> implements private Long id; - private Invalidation invalidation; + private Deletion deletion; private Experiment experiment; @@ -322,14 +322,14 @@ public class ExternalData extends CodeWithRegistration<ExternalData> implements { } - public final Invalidation getInvalidation() + public final Deletion getDeletion() { - return invalidation; + return deletion; } - public final void setInvalidation(Invalidation invalidation) + public final void setDeletion(Deletion deletion) { - this.invalidation = invalidation; + this.deletion = deletion; } public final Experiment getExperiment() diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/Sample.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/Sample.java index d286cc1fadafce7e001ea1b07eeb55440b25c6a8..6963f57828d1e4489565eca5e1b386281df086b0 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/Sample.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/Sample.java @@ -26,7 +26,7 @@ import ch.systemsx.cisd.common.annotation.CollectionMapping; import ch.systemsx.cisd.openbis.generic.shared.basic.IAttachmentHolder; import ch.systemsx.cisd.openbis.generic.shared.basic.IEntityInformationHolderWithProperties; import ch.systemsx.cisd.openbis.generic.shared.basic.IIdAndCodeHolder; -import ch.systemsx.cisd.openbis.generic.shared.basic.IInvalidationProvider; +import ch.systemsx.cisd.openbis.generic.shared.basic.IDeletionProvider; import ch.systemsx.cisd.openbis.generic.shared.basic.IPermIdHolder; /** @@ -34,7 +34,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.IPermIdHolder; * * @author Izabela Adamczyk */ -public final class Sample extends CodeWithRegistration<Sample> implements IInvalidationProvider, +public final class Sample extends CodeWithRegistration<Sample> implements IDeletionProvider, Comparable<Sample>, IEntityInformationHolderWithProperties, IAttachmentHolder, IIdAndCodeHolder, IPermIdHolder { @@ -58,7 +58,7 @@ public final class Sample extends CodeWithRegistration<Sample> implements IInval private List<IEntityProperty> properties; - private Invalidation invalidation; + private Deletion deletion; private Experiment experiment; @@ -217,9 +217,9 @@ public final class Sample extends CodeWithRegistration<Sample> implements IInval this.properties = properties; } - public final void setInvalidation(final Invalidation invalidation) + public final void setDeletion(final Deletion deletion) { - this.invalidation = invalidation; + this.deletion = deletion; } public final Experiment getExperiment() @@ -242,12 +242,12 @@ public final class Sample extends CodeWithRegistration<Sample> implements IInval } // - // IInvalidationProvider + // IDeletionProvider // - public final Invalidation getInvalidation() + public final Deletion getDeletion() { - return invalidation; + return deletion; } // @@ -315,8 +315,8 @@ public final class Sample extends CodeWithRegistration<Sample> implements IInval { return "Sample [sampleType=" + sampleType + ", space=" + space + ", databaseInstance=" + databaseInstance + ", identifier=" + identifier + ", container=" + container - + ", parents=" + parents + ", properties=" + properties + ", invalidation=" - + invalidation + ", experiment=" + experiment + ", id=" + id + + ", parents=" + parents + ", properties=" + properties + ", deletion=" + + deletion + ", experiment=" + experiment + ", id=" + id + ", modificationDate=" + modificationDate + ", attachments=" + attachments + ", permId=" + permId + ", permlink=" + permlink + ", searchlink=" + searchlink + ", subCode=" + subCode + "]"; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/WebClientConfiguration.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/WebClientConfiguration.java index d0767334da4bb6146f1c9a167c2ddc5c5a9ac056..7705c3ac1e026726cf38b44c3cb1882fffd3a5c6 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/WebClientConfiguration.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/WebClientConfiguration.java @@ -53,7 +53,7 @@ public class WebClientConfiguration implements ISerializable private int maxEntityVisits; - private boolean enableInvalidation; + private boolean enableTrash; private boolean allowAddingUnofficielTerms; @@ -138,14 +138,14 @@ public class WebClientConfiguration implements ISerializable this.allowAddingUnofficielTerms = allowAddingUnofficialTerms; } - public boolean getEnableInvalidation() + public boolean getEnableTrash() { - return enableInvalidation; + return enableTrash; } - public void setEnableInvalidation(boolean enableInvalidation) + public void setEnableTrash(boolean enableTrash) { - this.enableInvalidation = enableInvalidation; + this.enableTrash = enableTrash; } public WebClientConfiguration() diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/ColumnNames.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/ColumnNames.java index 565159c282ff0d2e74266aae765535954ed6617d..f6f9aa026c0806eaab05c0f3be9415c6ba9ac81c 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/ColumnNames.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/ColumnNames.java @@ -120,7 +120,7 @@ public final class ColumnNames public static final String ID_COLUMN = "id"; - public static final String INVALIDATION_COLUMN = "del_id"; + public static final String DELETION_COLUMN = "del_id"; public static final String IS_COMPLETE_COLUMN = "is_complete"; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DataPE.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DataPE.java index 1ddc04fc5ba1692dae8068e57d7ebb256504897c..e50cd37f1ac910e49a8d338efaf1fc6edb015976 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DataPE.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DataPE.java @@ -123,12 +123,12 @@ public class DataPE extends AbstractIdAndCodeHolder<DataPE> implements private List<DataPE> containedDataSets = new ArrayList<DataPE>(); /** - * Invalidation information. + * Deletion information. * <p> - * If not <code>null</code>, then this data set is considered as <i>invalid</i>. + * If not <code>null</code>, then this data set is considered <i>deleted</i> (moved to trash). * </p> */ - private InvalidationPE invalidation; + private DeletionPE deletion; /** * the index of this {@link DataPE} within its virtual parent; null if there is virtual parent @@ -693,14 +693,14 @@ public class DataPE extends AbstractIdAndCodeHolder<DataPE> implements } @ManyToOne(fetch = FetchType.EAGER) - @JoinColumn(name = ColumnNames.INVALIDATION_COLUMN) - public InvalidationPE getInvalidation() + @JoinColumn(name = ColumnNames.DELETION_COLUMN) + public DeletionPE getDeletion() { - return invalidation; + return deletion; } - public void setInvalidation(final InvalidationPE invalidation) + public void setDeletion(final DeletionPE deletion) { - this.invalidation = invalidation; + this.deletion = deletion; } } \ No newline at end of file diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/InvalidationPE.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DeletionPE.java similarity index 85% rename from openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/InvalidationPE.java rename to openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DeletionPE.java index e2ee9d5f0d0e157745b73652d57d2037c460023e..acf01af7d9f0017cecf6021a0128a3f214cfe0fc 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/InvalidationPE.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DeletionPE.java @@ -36,13 +36,13 @@ import ch.systemsx.cisd.openbis.generic.shared.IServer; import ch.systemsx.cisd.openbis.generic.shared.basic.IIdHolder; /** - * Class representing invalidation. + * Class representing deletion. * * @author Franz-Josef Elmer */ @Entity -@Table(name = TableNames.INVALIDATIONS_TABLE) -public class InvalidationPE extends HibernateAbstractRegistrationHolder implements IIdHolder, +@Table(name = TableNames.DELETIONS_TABLE) +public class DeletionPE extends HibernateAbstractRegistrationHolder implements IIdHolder, Serializable { private static final long serialVersionUID = IServer.VERSION; @@ -57,8 +57,8 @@ public class InvalidationPE extends HibernateAbstractRegistrationHolder implemen } @Id - @SequenceGenerator(name = SequenceNames.INVALIDATION_SEQUENCE, sequenceName = SequenceNames.INVALIDATION_SEQUENCE, allocationSize = 1) - @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = SequenceNames.INVALIDATION_SEQUENCE) + @SequenceGenerator(name = SequenceNames.DELETION_SEQUENCE, sequenceName = SequenceNames.DELETION_SEQUENCE, allocationSize = 1) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = SequenceNames.DELETION_SEQUENCE) public final Long getId() { return id; @@ -82,11 +82,11 @@ public class InvalidationPE extends HibernateAbstractRegistrationHolder implemen { return true; } - if (obj instanceof InvalidationPE == false) + if (obj instanceof DeletionPE == false) { return false; } - final InvalidationPE that = (InvalidationPE) obj; + final DeletionPE that = (DeletionPE) obj; final EqualsBuilder builder = new EqualsBuilder(); builder.append(id, that.id); return builder.isEquals(); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/ExperimentPE.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/ExperimentPE.java index bafd1b71858497f4294357d7b51359bae7b26c21..c01ffa8a2f7ceee700e8346577d965ca8d545c9c 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/ExperimentPE.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/ExperimentPE.java @@ -103,7 +103,7 @@ public class ExperimentPE extends AttachmentHolderPE implements private ExperimentTypePE experimentType; - private InvalidationPE invalidation; + private DeletionPE deletion; private Set<ExperimentPropertyPE> properties = new HashSet<ExperimentPropertyPE>(); @@ -243,16 +243,15 @@ public class ExperimentPE extends AttachmentHolderPE implements } @ManyToOne(fetch = FetchType.EAGER) - @JoinColumn(name = ColumnNames.INVALIDATION_COLUMN) - public InvalidationPE getInvalidation() + @JoinColumn(name = ColumnNames.DELETION_COLUMN) + public DeletionPE getDeletion() { - return invalidation; + return deletion; } - public void setInvalidation(final InvalidationPE invalidation) + public void setDeletion(final DeletionPE deletion) { - - this.invalidation = invalidation; + this.deletion = deletion; } @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, mappedBy = "entity") @@ -470,7 +469,7 @@ public class ExperimentPE extends AttachmentHolderPE implements builder.append("code", getCode()); builder.append("project", getProject()); builder.append("experimentType", getExperimentType()); - builder.append("invalidation", getInvalidation()); + builder.append("deletion", getDeletion()); return builder.toString(); } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/ExperimentPlatesFilter.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/ExperimentPlatesFilter.java deleted file mode 100644 index 533e0038faad2b39c655ebca2bcc90755f220e3e..0000000000000000000000000000000000000000 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/ExperimentPlatesFilter.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright 2008 ETH Zuerich, CISD - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package ch.systemsx.cisd.openbis.generic.shared.dto; - -import java.io.Serializable; - -import org.apache.commons.lang.builder.ToStringBuilder; - -import ch.systemsx.cisd.common.utilities.ModifiedShortPrefixToStringStyle; -import ch.systemsx.cisd.openbis.generic.shared.IServer; - -/** - * A filter for all Plates which are assigned to a experiment. - * - * @author Basil Neff - */ -public final class ExperimentPlatesFilter implements Serializable -{ - private static final long serialVersionUID = IServer.VERSION; - - /** If <code>true</code> only experiment with valid samples are returned. */ - private boolean hideInvalidated; - - public ExperimentPlatesFilter(final boolean hideInvalidated) - { - setHideInvalidated(hideInvalidated); - } - - /** - * Returns, if the invalidated plates should filtered out. If <code>true</code> only experiment - * with valid samples are returned. - */ - public final boolean isHideInvalidated() - { - return hideInvalidated; - } - - public final void setHideInvalidated(final boolean hideInvalidated) - { - this.hideInvalidated = hideInvalidated; - } - - // - // Object - // - - @Override - public final String toString() - { - final ToStringBuilder builder = - new ToStringBuilder(this, - ModifiedShortPrefixToStringStyle.MODIFIED_SHORT_PREFIX_STYLE); - builder.append("hideInvalidated", isHideInvalidated()); - return builder.toString(); - } -} diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/SamplePE.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/SamplePE.java index db9a9fd42808111d6901ef2bc67e9791d4ba8e95..2b79379cb7c7c3c946a5fac2a5b0e022713cd8ed 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/SamplePE.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/SamplePE.java @@ -211,12 +211,12 @@ public class SamplePE extends AttachmentHolderPE implements IIdAndCodeHolder, Co } /** - * Invalidation information. + * Deletion information. * <p> - * If not <code>null</code>, then this sample is considered as <i>invalid</i>. + * If not <code>null</code>, then this sample is considered as <i>deleted</i> (moved to trash). * </p> */ - private InvalidationPE invalidation; + private DeletionPE deletion; private Set<SamplePropertyPE> properties = new HashSet<SamplePropertyPE>(); @@ -281,15 +281,15 @@ public class SamplePE extends AttachmentHolderPE implements IIdAndCodeHolder, Co // -------------------- @ManyToOne(fetch = FetchType.EAGER) - @JoinColumn(name = ColumnNames.INVALIDATION_COLUMN) - public InvalidationPE getInvalidation() + @JoinColumn(name = ColumnNames.DELETION_COLUMN) + public DeletionPE getDeletion() { - return invalidation; + return deletion; } - public void setInvalidation(final InvalidationPE invalidation) + public void setDeletion(final DeletionPE deletion) { - this.invalidation = invalidation; + this.deletion = deletion; } @Transient diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/SequenceNames.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/SequenceNames.java index ef19c43f757267bb33afb9cd3899d312c8ed829a..5902ef776d899d8910372c661036ea713994bfce 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/SequenceNames.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/SequenceNames.java @@ -74,7 +74,7 @@ public final class SequenceNames public static final String SCRIPT_SEQUENCE = "SCRIPT_ID_SEQ"; - public static final String INVALIDATION_SEQUENCE = "DELETION_ID_SEQ"; + public static final String DELETION_SEQUENCE = "DELETION_ID_SEQ"; public static final String LOCATOR_TYPE_SEQUENCE = "LOCATOR_TYPE_ID_SEQ"; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/TableNames.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/TableNames.java index 22856f4f5571926a19e3c14a16a3a408914c1551..d41e7e5301fbf39d75ff99d0fd716603f32bb16c 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/TableNames.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/TableNames.java @@ -72,7 +72,7 @@ public final class TableNames public static final String SPACES_TABLE = "spaces"; - public static final String INVALIDATIONS_TABLE = "deletions"; + public static final String DELETIONS_TABLE = "deletions"; public static final String LOCATOR_TYPES_TABLE = "locator_types"; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/translator/DataSetTranslator.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/translator/DataSetTranslator.java index a49c863032788656adf679b20096c4f4d97eac78..8c983621afb7cd0817128e30b9b65694ec690e1c 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/translator/DataSetTranslator.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/translator/DataSetTranslator.java @@ -178,7 +178,7 @@ public class DataSetTranslator setProperties(dataPE, externalData); externalData.setExperiment(ExperimentTranslator.translate(experiment, baseIndexURL, withExperimentFields)); - externalData.setInvalidation(InvalidationTranslator.translate(dataPE.getInvalidation())); + externalData.setDeletion(DeletionTranslator.translate(dataPE.getDeletion())); return externalData; } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/translator/InvalidationTranslator.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/translator/DeletionTranslator.java similarity index 51% rename from openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/translator/InvalidationTranslator.java rename to openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/translator/DeletionTranslator.java index 8ad4a38915185fb1e5b950bd2703a4cef5d6b456..aa5a8f8f16de396d1a2c234b51f0a1f3a9bd939d 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/translator/InvalidationTranslator.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/translator/DeletionTranslator.java @@ -16,32 +16,32 @@ package ch.systemsx.cisd.openbis.generic.shared.translator; -import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Invalidation; -import ch.systemsx.cisd.openbis.generic.shared.dto.InvalidationPE; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Deletion; +import ch.systemsx.cisd.openbis.generic.shared.dto.DeletionPE; /** - * A <i>static</i> class for translating {@link InvalidationPE} into {@link Invalidation}. + * A <i>static</i> class for translating {@link DeletionPE} into {@link Deletion}. * * @author Christian Ribeaud */ -public final class InvalidationTranslator +public final class DeletionTranslator { - private InvalidationTranslator() + private DeletionTranslator() { // Can not be instantiated. } - public final static Invalidation translate(final InvalidationPE invalidation) + public final static Deletion translate(final DeletionPE deletion) { - if (invalidation == null) + if (deletion == null) { return null; } - final Invalidation newInvalidation = new Invalidation(); - newInvalidation.setReason(invalidation.getReason()); - newInvalidation.setRegistrationDate(invalidation.getRegistrationDate()); - newInvalidation.setRegistrator(PersonTranslator.translate(invalidation.getRegistrator())); - return newInvalidation; + final Deletion newDeletion = new Deletion(); + newDeletion.setReason(deletion.getReason()); + newDeletion.setRegistrationDate(deletion.getRegistrationDate()); + newDeletion.setRegistrator(PersonTranslator.translate(deletion.getRegistrator())); + return newDeletion; } } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/translator/ExperimentTranslator.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/translator/ExperimentTranslator.java index 0b2d95e90c9f3fb666c01ffd4cba32d877a26ef4..ec41ba03f5f5faa6a31869388102b2466497ae94 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/translator/ExperimentTranslator.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/translator/ExperimentTranslator.java @@ -96,7 +96,7 @@ public final class ExperimentTranslator result.setProject(ProjectTranslator.translate(experiment.getProject())); result.setRegistrationDate(experiment.getRegistrationDate()); result.setRegistrator(PersonTranslator.translate(experiment.getRegistrator())); - result.setInvalidation(InvalidationTranslator.translate(experiment.getInvalidation())); + result.setDeletion(DeletionTranslator.translate(experiment.getDeletion())); for (final LoadableFields field : withFields) { switch (field) diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/translator/SampleTranslator.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/translator/SampleTranslator.java index 0606c304769a0368eab9acc17a0924f7d58af6dd..b3eca0dbc92c60eb23696b3217b3aaa78250e94a 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/translator/SampleTranslator.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/translator/SampleTranslator.java @@ -149,7 +149,7 @@ public final class SampleTranslator } result.setContainedSample(containedSamples); } - result.setInvalidation(InvalidationTranslator.translate(samplePE.getInvalidation())); + result.setDeletion(DeletionTranslator.translate(samplePE.getDeletion())); return result; } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/TypedTableModelBuilder.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/TypedTableModelBuilder.java index 28ea78786987eb74eb8932674d36c8acb3513f59..883440ed374f33b71de98995646d78654e9fa50e 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/TypedTableModelBuilder.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/TypedTableModelBuilder.java @@ -32,7 +32,7 @@ import org.apache.commons.lang.StringUtils; import ch.systemsx.cisd.openbis.generic.shared.basic.IEntityInformationHolderWithIdentifier; import ch.systemsx.cisd.openbis.generic.shared.basic.ISerializable; -import ch.systemsx.cisd.openbis.generic.shared.basic.InvalidationUtils; +import ch.systemsx.cisd.openbis.generic.shared.basic.DeletionUtils; import ch.systemsx.cisd.openbis.generic.shared.basic.SimplePersonRenderer; import ch.systemsx.cisd.openbis.generic.shared.basic.TableCellUtil; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataTypeCode; @@ -354,7 +354,7 @@ public class TypedTableModelBuilder<T extends ISerializable> final EntityTableCell cell = new EntityTableCell(entity.getEntityKind(), entity.getPermId(), entity.getIdentifier()); - cell.setInvalid(InvalidationUtils.isInvalid(entity)); + cell.setInvalid(DeletionUtils.isDeleted(entity)); cell.setLinkText(linkText); addValue(cell); } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/DataSetPropertiesPanel.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/DataSetPropertiesPanel.java index e2e7d8458ef9176a8fc716a33c9da91457d9083a..5d565984e369e5ff63e108abee954b8b02fc5239 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/DataSetPropertiesPanel.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/DataSetPropertiesPanel.java @@ -33,7 +33,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataSet; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataSetType; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataStore; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ExternalData; -import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Invalidation; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Deletion; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Sample; import ch.systemsx.cisd.openbis.plugin.generic.client.web.client.application.PropertiesPanelUtils; @@ -78,7 +78,7 @@ public class DataSetPropertiesPanel extends ContentPanel { final Map<String, Object> properties = new LinkedHashMap<String, Object>(); final DataSetType datasetType = dataset.getDataSetType(); - final Invalidation invalidation = dataset.getInvalidation(); + final Deletion deletion = dataset.getDeletion(); final Sample sample = dataset.getSample(); properties.put(messageProvider.getMessage(Dict.DATA_SET), @@ -126,9 +126,9 @@ public class DataSetPropertiesPanel extends ContentPanel { properties.put(messageProvider.getMessage(Dict.SAMPLE), sample); } - if (invalidation != null) + if (deletion != null) { - properties.put(messageProvider.getMessage(Dict.INVALIDATION), invalidation); + properties.put(messageProvider.getMessage(Dict.DELETION), deletion); } PropertiesPanelUtils.addEntityProperties(viewContext, properties, dataset.getProperties()); return properties; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/GenericDataSetViewer.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/GenericDataSetViewer.java index 17263caa679884a1a662668091923c32732063a0..b659daf35e28045eb730f829be0706430f5fe79d 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/GenericDataSetViewer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/GenericDataSetViewer.java @@ -146,7 +146,7 @@ abstract public class GenericDataSetViewer extends AbstractViewerWithVerticalSpl public void execute() { new DataSetListDeletionConfirmationDialog(viewContext.getCommonViewContext(), - createDeletionCallback(), createInvalidationCallback(), + createPermanentDeletionCallback(), createPermanentDeletionCallback(), getOriginalData()).show(); } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/ExperimentPropertiesPanel.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/ExperimentPropertiesPanel.java index ebea917100c029600f8d295343e29668fe5dd7dd..dd46a793acabe4ca36e03be5ff0ecabd25139422 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/ExperimentPropertiesPanel.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/ExperimentPropertiesPanel.java @@ -42,7 +42,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKin import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind.ObjectKind; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Experiment; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ExperimentType; -import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Invalidation; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Deletion; import ch.systemsx.cisd.openbis.plugin.generic.client.web.client.IGenericClientServiceAsync; import ch.systemsx.cisd.openbis.plugin.generic.client.web.client.application.PropertiesPanelUtils; @@ -108,7 +108,7 @@ public class ExperimentPropertiesPanel extends ContentPanel { final Map<String, Object> properties = new LinkedHashMap<String, Object>(); final ExperimentType experimentType = experiment.getExperimentType(); - final Invalidation invalidation = experiment.getInvalidation(); + final Deletion deletion = experiment.getDeletion(); properties.put(viewContext.getMessage(Dict.EXPERIMENT), experiment.getIdentifier()); properties.put(viewContext.getMessage(Dict.PERM_ID), new ExternalHyperlink(experiment.getPermId(), experiment.getPermlink())); @@ -116,9 +116,9 @@ public class ExperimentPropertiesPanel extends ContentPanel properties.put(viewContext.getMessage(Dict.REGISTRATOR), experiment.getRegistrator()); properties.put(viewContext.getMessage(Dict.REGISTRATION_DATE), experiment.getRegistrationDate()); - if (invalidation != null) + if (deletion != null) { - properties.put(viewContext.getMessage(Dict.INVALIDATION), invalidation); + properties.put(viewContext.getMessage(Dict.DELETION), deletion); } properties.put(viewContext.getMessage(Dict.PROJECT), experiment.getProject()); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/GenericExperimentViewer.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/GenericExperimentViewer.java index 44c0c3511d1b8039cacd699174505101bd09f166..7b838c5abba814950a1f77efe46dcf630a5d9175 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/GenericExperimentViewer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/GenericExperimentViewer.java @@ -128,8 +128,8 @@ public class GenericExperimentViewer extends AbstractViewerWithVerticalSplit<Exp public void execute() { new ExperimentListDeletionConfirmationDialog( - viewContext.getCommonViewContext(), createDeletionCallback(), - createInvalidationCallback(), getOriginalData()).show(); + viewContext.getCommonViewContext(), createPermanentDeletionCallback(), + createPermanentDeletionCallback(), getOriginalData()).show(); } })); } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleViewer.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleViewer.java index 9b944b747c87bce48f1d920a7d2ca284fece209d..e3f9a6d0b76e246a99f6ce34d47a72c9665ca24c 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleViewer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleViewer.java @@ -58,8 +58,8 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.IIdAndCodeHolder; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind.ObjectKind; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Deletion; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Experiment; -import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Invalidation; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Sample; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.SampleParentWithDerived; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.SampleType; @@ -162,8 +162,8 @@ abstract public class GenericSampleViewer extends AbstractViewerWithVerticalSpli public void execute() { new SampleListDeletionConfirmationDialog(viewContext.getCommonViewContext(), - getOriginalDataAsSingleton(), createDeletionCallback(), - createInvalidationCallback(), getOriginalData()).show(); + getOriginalDataAsSingleton(), createPermanentDeletionCallback(), + createDeletionCallback(), getOriginalData()).show(); } })); } @@ -252,10 +252,10 @@ abstract public class GenericSampleViewer extends AbstractViewerWithVerticalSpli properties.put(viewContext.getMessage(Dict.REGISTRATOR), sample.getRegistrator()); properties .put(viewContext.getMessage(Dict.REGISTRATION_DATE), sample.getRegistrationDate()); - final Invalidation invalidation = sample.getInvalidation(); - if (invalidation != null) + final Deletion deletion = sample.getDeletion(); + if (deletion != null) { - properties.put(viewContext.getMessage(Dict.INVALIDATION), invalidation); + properties.put(viewContext.getMessage(Dict.DELETION), deletion); } Experiment experiment = sample.getExperiment(); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/server/GenericBusinessObjectFactory.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/server/GenericBusinessObjectFactory.java index 9ecaefa2c610ef1560dd2e4d74eb61720240c00c..1a348ecb3612120a91689fef4b4cbc7ab5d55310 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/server/GenericBusinessObjectFactory.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/server/GenericBusinessObjectFactory.java @@ -22,7 +22,7 @@ import ch.systemsx.cisd.openbis.generic.server.business.bo.IDataBO; import ch.systemsx.cisd.openbis.generic.server.business.bo.IDataSetTable; import ch.systemsx.cisd.openbis.generic.server.business.bo.IExperimentBO; import ch.systemsx.cisd.openbis.generic.server.business.bo.IExperimentTable; -import ch.systemsx.cisd.openbis.generic.server.business.bo.IInvalidationBO; +import ch.systemsx.cisd.openbis.generic.server.business.bo.ITrashBO; import ch.systemsx.cisd.openbis.generic.server.business.bo.IMaterialBO; import ch.systemsx.cisd.openbis.generic.server.business.bo.IMaterialTable; import ch.systemsx.cisd.openbis.generic.server.business.bo.IProjectBO; @@ -95,9 +95,9 @@ public final class GenericBusinessObjectFactory extends AbstractPluginBusinessOb return getCommonBusinessObjectFactory().createProjectBO(session); } - public IInvalidationBO createInvalidationBO(Session session) + public ITrashBO createTrashBO(Session session) { - return getCommonBusinessObjectFactory().createInvalidationBO(session); + return getCommonBusinessObjectFactory().createTrashBO(session); } public ISampleLister createSampleLister(Session session) diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/server/GenericDataSetTypeSlaveServerPlugin.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/server/GenericDataSetTypeSlaveServerPlugin.java index 35f6aa954359069660cea2cc95cd427cba7b7a8b..ece3c1d0f9c516be8a828bbf09bbaad47825805b 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/server/GenericDataSetTypeSlaveServerPlugin.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/server/GenericDataSetTypeSlaveServerPlugin.java @@ -25,7 +25,7 @@ import org.springframework.stereotype.Component; import ch.systemsx.cisd.openbis.generic.server.batch.BatchOperationExecutor; import ch.systemsx.cisd.openbis.generic.server.batch.DataSetBatchUpdate; import ch.systemsx.cisd.openbis.generic.server.business.bo.IDataSetTable; -import ch.systemsx.cisd.openbis.generic.server.business.bo.IInvalidationBO; +import ch.systemsx.cisd.openbis.generic.server.business.bo.ITrashBO; import ch.systemsx.cisd.openbis.generic.server.plugin.IDataSetTypeSlaveServerPlugin; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DeletionType; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.NewDataSet; @@ -58,11 +58,10 @@ public class GenericDataSetTypeSlaveServerPlugin implements IDataSetTypeSlaveSer dataSetTable.setDataSets(dataSets); dataSetTable.deleteLoadedDataSets(reason); break; - case INVALIDATION: - IInvalidationBO invalidationBO = - businessObjectFactory.createInvalidationBO(session); - invalidationBO.createInvalidation(reason); - invalidationBO.invalidateDataSets(dataSets); + case TRASH: + ITrashBO trashBO = businessObjectFactory.createTrashBO(session); + trashBO.createDeletion(reason); + trashBO.trashDataSets(dataSets); break; } } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/server/IGenericBusinessObjectFactory.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/server/IGenericBusinessObjectFactory.java index eadeb1dd2ae45f898481effecef713a6f9550c4b..0c80b0e9cac06b8e7e6bb8f82f44ef79486a060c 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/server/IGenericBusinessObjectFactory.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/server/IGenericBusinessObjectFactory.java @@ -21,7 +21,7 @@ import ch.systemsx.cisd.openbis.generic.server.business.bo.IDataBO; import ch.systemsx.cisd.openbis.generic.server.business.bo.IDataSetTable; import ch.systemsx.cisd.openbis.generic.server.business.bo.IExperimentBO; import ch.systemsx.cisd.openbis.generic.server.business.bo.IExperimentTable; -import ch.systemsx.cisd.openbis.generic.server.business.bo.IInvalidationBO; +import ch.systemsx.cisd.openbis.generic.server.business.bo.ITrashBO; import ch.systemsx.cisd.openbis.generic.server.business.bo.IProjectBO; import ch.systemsx.cisd.openbis.generic.server.business.bo.ISampleBO; import ch.systemsx.cisd.openbis.generic.server.business.bo.ISampleTable; @@ -76,7 +76,7 @@ public interface IGenericBusinessObjectFactory extends IAbstractBussinessObjectF public ISampleLister createSampleLister(Session session); /** - * Creates a {@link IInvalidationBO} <i>Business Object</i>. + * Creates a {@link ITrashBO} <i>Business Object</i>. */ - public IInvalidationBO createInvalidationBO(final Session session); + public ITrashBO createTrashBO(final Session session); } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/public/common-dictionary.js b/openbis/source/java/ch/systemsx/cisd/openbis/public/common-dictionary.js index 330f569db16ea1f1895341c89f4a0de080b60d1f..733602f0774f2c225b6a0c9aab5c79503636b1a0 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/public/common-dictionary.js +++ b/openbis/source/java/ch/systemsx/cisd/openbis/public/common-dictionary.js @@ -61,18 +61,18 @@ var common = { // Deletion // - invalidate: "Invalidate", - invalidation: "Invalidation", - invalidation_template: "{0}; {1}<br><i>reason:</i> {2}", + delete: "Delete", + deletion: "Deletion", + deletion_template: "{0}; {1}<br><i>reason:</i> {2}", permanent: "Permanent", reason: "Reason", delete_confirmation_title: "Confirm Deletion", delete_confirmation_message: "Are you sure you want to delete [{0}]?", delete_confirmation_message_with_reason_template: "You are {0} {1}(s).<br><br>Please enter a reason or cancel the operation.", deleting_permanently: "<b>permanently</b> deleting", - invalidating: "invalidating", - delete_progress_message: "Deleting {0}(s)...", - invalidate_progress_message: "Invalidating {0}(s)...", + deleting: "Deleting", + delete_permanently_progress_message: "Deleting {0}(s)...", + delete_progress_message: "Moving to trash {0}(s)...", // // Table Modifications diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ExperimentBrowserTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ExperimentBrowserTest.java index 358c8fa72844a930037d76d83ccf42a7744363a1..edc18c850f5fb63f38aa295a938a85f234a67a63 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ExperimentBrowserTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ExperimentBrowserTest.java @@ -57,7 +57,7 @@ public class ExperimentBrowserTest extends AbstractGWTTestCase remoteConsole.prepare(new ListExperiments("DEFAULT (CISD)", "SIRNA_HCS")); CheckExperimentTable table = new CheckExperimentTable(); table.expectedRow(new ExperimentRow("EXP-REUSE").valid()); - table.expectedRow(new ExperimentRow("EXP-X").invalid()); + table.expectedRow(new ExperimentRow("EXP-X").deleted()); table.expectedColumnsNumber(14); remoteConsole.prepare(table.expectedSize(2)); diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/SampleBrowserTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/SampleBrowserTest.java index dd825d5ef7a44d8cfa02413a26cdc0b3249c6cbf..392c7b3e9c85f53c32b572e00897c8b84b5ec8b7 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/SampleBrowserTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/SampleBrowserTest.java @@ -75,7 +75,7 @@ public class SampleBrowserTest extends AbstractGWTTestCase CheckSampleTable table = new CheckSampleTable(); table.expectedColumnHidden(SampleGridColumnIDs.CODE, false); table.expectedColumnWidth(SampleGridColumnIDs.REGISTRATOR, DEFAULT_COLUMN_WIDTH); - table.expectedRow(new SampleRow("MP001-1").identifier("CISD", "CISD").invalid() + table.expectedRow(new SampleRow("MP001-1").identifier("CISD", "CISD").deleted() .noExperiment().withInternalPropertyCell("PLATE_GEOMETRY", DEFAULT_PLATE_GEOMETRY_VALUE)); table.expectedRow(new SampleRow("MP002-1").identifier("CISD", "CISD").valid() @@ -134,7 +134,7 @@ public class SampleBrowserTest extends AbstractGWTTestCase loginAndGotoListSamplesTab(); remoteConsole.prepare(new ListSamples("CISD", "CELL_PLATE")); CheckSampleTable table = new CheckSampleTable(); - table.expectedRow(new SampleRow("3VCP1").identifier("CISD", "CISD").invalid().experiment( + table.expectedRow(new SampleRow("3VCP1").identifier("CISD", "CISD").deleted().experiment( "CISD", "NEMO", "EXP1").derivedFromAncestors("CISD:/CISD/3V-123")); table.expectedColumnsNumber(21); remoteConsole.prepare(table.expectedSize(15)); diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/columns/DataSetRow.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/columns/DataSetRow.java index 3d7f312183e72933ff051f040764b7321910d374..5c98005b31ec9d1d452414ad51ed8b2c9cd70cf5 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/columns/DataSetRow.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/columns/DataSetRow.java @@ -35,21 +35,21 @@ public class DataSetRow extends Row withCell(CommonExternalDataColDefKind.CODE, code); } - public DataSetRow invalid() + public DataSetRow deleted() { - withInvalidation(true); + withDeletion(true); return this; } public DataSetRow valid() { - withInvalidation(false); + withDeletion(false); return this; } - private void withInvalidation(boolean isInvalid) + private void withDeletion(boolean isDeleted) { - withCell(CommonExternalDataColDefKind.IS_INVALID, SimpleYesNoRenderer.render(isInvalid)); + withCell(CommonExternalDataColDefKind.IS_DELETED, SimpleYesNoRenderer.render(isDeleted)); } public DataSetRow withIsComplete(Boolean complete) diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/columns/ExperimentRow.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/columns/ExperimentRow.java index b5fb96fc4615949537cee03d2b8f7f6a9c0227a1..e9a90fa54797bb1fa1e0bcbe4a5913306bcff59e 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/columns/ExperimentRow.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/columns/ExperimentRow.java @@ -39,21 +39,21 @@ public class ExperimentRow extends RowWithProperties withCell(CommonExperimentColDefKind.EXPERIMENT_TYPE.id(), typeCode); } - public ExperimentRow invalid() + public ExperimentRow deleted() { - withInvalidation(true); + withDeletion(true); return this; } public ExperimentRow valid() { - withInvalidation(false); + withDeletion(false); return this; } - private void withInvalidation(boolean isInvalid) + private void withDeletion(boolean isDeleted) { - withCell(CommonExperimentColDefKind.IS_INVALID.id(), SimpleYesNoRenderer.render(isInvalid)); + withCell(CommonExperimentColDefKind.IS_DELETED.id(), SimpleYesNoRenderer.render(isDeleted)); } } diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/columns/SampleRow.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/columns/SampleRow.java index 88106b96707ee0d4b4db9d1640b8cdae67337ee0..928a8ca7b602e40ea69f2177a12fc399f9266af5 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/columns/SampleRow.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/columns/SampleRow.java @@ -105,21 +105,21 @@ public class SampleRow extends RowWithProperties return identifier; } - public SampleRow invalid() + public SampleRow deleted() { - withInvalidation(true); + withDeletion(true); return this; } public SampleRow valid() { - withInvalidation(false); + withDeletion(false); return this; } - private void withInvalidation(boolean isInvalid) + private void withDeletion(boolean isDeleted) { - withCell(SampleGridColumnIDs.IS_INVALID, SimpleYesNoRenderer.render(isInvalid)); + withCell(SampleGridColumnIDs.IS_DELETED, SimpleYesNoRenderer.render(isDeleted)); } public SampleRow derivedFromAncestors(final String... ancestorCodes) diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/AbstractProperty.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/AbstractProperty.java index a27280521028bb27c2b33d62ea01f3cfb26bd76d..ef65fab0ecfc93118c940ef6066f9b5ff5f4a3cc 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/AbstractProperty.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/AbstractProperty.java @@ -19,10 +19,10 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.testframework; import junit.framework.Assert; import ch.systemsx.cisd.openbis.generic.shared.basic.ICodeHolder; -import ch.systemsx.cisd.openbis.generic.shared.basic.IInvalidationProvider; +import ch.systemsx.cisd.openbis.generic.shared.basic.IDeletionProvider; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Deletion; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityProperty; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.IEntityProperty; -import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Invalidation; /** * Abstract superclass of a generic {@link IProperty} which implements convenient property value @@ -102,8 +102,8 @@ public abstract class AbstractProperty<C extends IPropertyChecker<?>> implements } /** - * Sets assertion that the property value is of type {@link ICodeHolder} with a code equals - * the specified code. + * Sets assertion that the property value is of type {@link ICodeHolder} with a code equals the + * specified code. */ public C asCode(final String expectedCode) { @@ -117,34 +117,33 @@ public abstract class AbstractProperty<C extends IPropertyChecker<?>> implements } /** - * Sets assertion that the property value is of type {@link IInvalidationProvider} with no - * {@link Invalidation} object. + * Sets assertion that the property value is of type {@link IDeletionProvider} with no + * {@link Deletion} object. */ public C asValidEntity() { - return by(new IValueAssertion<IInvalidationProvider>() + return by(new IValueAssertion<IDeletionProvider>() { - public void assertValue(final IInvalidationProvider provider) + public void assertValue(final IDeletionProvider provider) { - final Invalidation invalidation = provider.getInvalidation(); - Assert.assertNull(message + " expected to be a valid entity.", invalidation); + final Deletion deletion = provider.getDeletion(); + Assert.assertNull(message + " expected to be a valid entity.", deletion); } }); } /** - * Sets assertion that the property value is of type {@link IInvalidationProvider} with an - * {@link Invalidation} object. + * Sets assertion that the property value is of type {@link IDeletionProvider} with an + * {@link Deletion} object. */ - public C asInvalidEntity() + public C asDeletedEntity() { - return by(new IValueAssertion<IInvalidationProvider>() + return by(new IValueAssertion<IDeletionProvider>() { - public void assertValue(final IInvalidationProvider provider) + public void assertValue(final IDeletionProvider provider) { - final Invalidation invalidation = provider.getInvalidation(); - Assert.assertNotNull(message + " expected to be an invalid entity.", - invalidation); + final Deletion deletion = provider.getDeletion(); + Assert.assertNotNull(message + " expected to be a deleted entity.", deletion); } }); } diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/ExperimentProviderTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/ExperimentProviderTest.java index 9e8e9f34d7999acd3c0cea1b4ee3be6e66a28d3f..7ce8fd58add0ed655e8351bd45325b62ba644e94 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/ExperimentProviderTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/ExperimentProviderTest.java @@ -58,7 +58,7 @@ public class ExperimentProviderTest extends AbstractProviderTest .code("E1") .identifier("DB:/A/B/E1") .date(new Date(1000123456)) - .invalidate() + .markDeleted() .permID("123-45") .type("1") .registrator( @@ -84,7 +84,7 @@ public class ExperimentProviderTest extends AbstractProviderTest TypedTableModel<Experiment> tableModel = new ExperimentProvider(server, SESSION_TOKEN, criteria).getTableModel(100); assertEquals("[CODE, EXPERIMENT_TYPE, EXPERIMENT_IDENTIFIER, DATABASE_INSTANCE, SPACE, " - + "PROJECT, REGISTRATOR, REGISTRATION_DATE, IS_INVALID, PERM_ID, " + + "PROJECT, REGISTRATOR, REGISTRATION_DATE, IS_DELETED, PERM_ID, " + "SHOW_DETAILS_LINK, property-USER-NUMBER, property-USER-TEXT]", getHeaderIDs(tableModel).toString()); assertEquals("[null, VARCHAR, null, VARCHAR, VARCHAR, VARCHAR, VARCHAR, TIMESTAMP, " diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/SampleProviderTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/SampleProviderTest.java index ba6175cc1b41d38b72ffa004a25cc22009e4d9d1..45748f3b40ff77370e9c3ac9c1db3206685f4ec2 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/SampleProviderTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/SampleProviderTest.java @@ -84,7 +84,7 @@ public class SampleProviderTest extends AbstractProviderTest assertEquals( "[CODE, SUBCODE, DATABASE_INSTANCE, SPACE, SAMPLE_IDENTIFIER, SAMPLE_TYPE, " - + "IS_INSTANCE_SAMPLE, IS_INVALID, REGISTRATOR, REGISTRATION_DATE, " + + "IS_INSTANCE_SAMPLE, IS_DELETED, REGISTRATOR, REGISTRATION_DATE, " + "EXPERIMENT, EXPERIMENT_IDENTIFIER, PROJECT, " + "PERM_ID, SHOW_DETAILS_LINK, generatedFromParent, containerParent, " + "property-USER-NUMBER, property-USER-TIMESTAMP, property-USER-NAME, property-USER-MY-MATERIAL, property-USER-TEXT]", @@ -119,7 +119,7 @@ public class SampleProviderTest extends AbstractProviderTest SampleProvider sampleProvider = new SampleProvider(server, SESSION_TOKEN, listCriteria); final SampleBuilder s1 = new SampleBuilder("DB:/S1").id(1).type("ALPHA").permID("123-45"); s1.registrator(new PersonBuilder().name("Albert", "Einstein").getPerson()); - s1.invalidate().date(new Date(4711)); + s1.markDeleted().date(new Date(4711)); Sample p1 = new SampleBuilder("/AB/CD").permID("p-123").getSample(); s1.property("NAME", "hello").permLink("http").childOf(p1); final SampleBuilder s2 = @@ -140,7 +140,7 @@ public class SampleProviderTest extends AbstractProviderTest assertEquals( "[CODE, SUBCODE, DATABASE_INSTANCE, SPACE, SAMPLE_IDENTIFIER, SAMPLE_TYPE, " - + "IS_INSTANCE_SAMPLE, IS_INVALID, REGISTRATOR, REGISTRATION_DATE, " + + "IS_INSTANCE_SAMPLE, IS_DELETED, REGISTRATOR, REGISTRATION_DATE, " + "EXPERIMENT, EXPERIMENT_IDENTIFIER, PROJECT, " + "PERM_ID, SHOW_DETAILS_LINK, generatedFromParent, containerParent, " + "property-USER-NAME, property-USER-TIMESTAMP, property-USER-NUMBER, property-USER-TEXT]", diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/CommonServerTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/CommonServerTest.java index f2bf7d76806bc19aef60ef087f04c0d176fccd03..e7723b0d5f4cada627e755445cb56aa35b8d39b9 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/CommonServerTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/CommonServerTest.java @@ -1347,7 +1347,7 @@ public final class CommonServerTest extends AbstractServerTestCase @Test public void testDeleteDataSets() { - // TODO write invalidation test + // TODO write deletion test final DeletionType deletionType = DeletionType.PERMANENT; prepareGetSession(); final List<String> dataSetCodes = Arrays.asList("ds1", "ds2", "ds3"); diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/ETLServiceTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/ETLServiceTest.java index f9d4cab2f45f58dea63a6f7c52940eca82b1a1b4..0d5d35322f658667b03e2de8e5730bd2ebde2e70 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/ETLServiceTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/ETLServiceTest.java @@ -81,9 +81,9 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.DataStorePE; import ch.systemsx.cisd.openbis.generic.shared.dto.DataStoreServerInfo; import ch.systemsx.cisd.openbis.generic.shared.dto.DataTypePE; import ch.systemsx.cisd.openbis.generic.shared.dto.DatastoreServiceDescriptions; +import ch.systemsx.cisd.openbis.generic.shared.dto.DeletionPE; import ch.systemsx.cisd.openbis.generic.shared.dto.ExperimentPE; import ch.systemsx.cisd.openbis.generic.shared.dto.ExternalDataPE; -import ch.systemsx.cisd.openbis.generic.shared.dto.InvalidationPE; import ch.systemsx.cisd.openbis.generic.shared.dto.MaterialPE; import ch.systemsx.cisd.openbis.generic.shared.dto.MaterialTypePE; import ch.systemsx.cisd.openbis.generic.shared.dto.NewExternalData; @@ -710,7 +710,7 @@ public class ETLServiceTest extends AbstractServerTestCase SampleIdentifier sampleIdentifier = new SampleIdentifier(new DatabaseInstanceIdentifier("db"), "s1"); ExperimentPE experiment = createExperiment("TYPE", "EXP1", "G1"); - experiment.setInvalidation(new InvalidationPE()); + experiment.setDeletion(new DeletionPE()); prepareTryToLoadSample(sampleIdentifier, createSampleWithExperiment(experiment)); try @@ -720,7 +720,7 @@ public class ETLServiceTest extends AbstractServerTestCase } catch (UserFailureException e) { assertEquals( - "Data set can not be registered because experiment 'DB:/G1/P/EXP1' is invalid.", + "Data set can not be registered because experiment 'DB:/G1/P/EXP1' is in trash.", e.getMessage()); } @@ -951,12 +951,11 @@ public class ETLServiceTest extends AbstractServerTestCase context.checking(new Expectations() { - { + { allowing(daoFactory).getEntityTypeDAO(EntityKind.MATERIAL); will(returnValue(entityTypeDAO)); - allowing(entityTypeDAO).tryToFindEntityTypeByCode( - materialType.getCode()); + allowing(entityTypeDAO).tryToFindEntityTypeByCode(materialType.getCode()); will(returnValue(materialType)); final List<NewMaterial> newMaterials = Arrays.asList(newMaterial); @@ -983,7 +982,7 @@ public class ETLServiceTest extends AbstractServerTestCase one(sampleTable).save(); one(sampleTable).getSamples(); will(returnValue(Arrays.asList(newSamplePE))); - + one(boFactory).createSampleBO(SESSION); will(returnValue(sampleBO)); diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/samplelister/SampleListingQueryTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/samplelister/SampleListingQueryTest.java index 48073f9072cd6c807ffd572de50f14a90333bc5e..c450cbc0867876137cb31860ed24b59d4b0f2ed4 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/samplelister/SampleListingQueryTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/samplelister/SampleListingQueryTest.java @@ -234,12 +234,12 @@ public class SampleListingQueryTest extends AbstractDAOTest { assertEquals(msg, samplePE.getExperiment().getId(), sample.expe_id); } - if (samplePE.getInvalidation() == null) + if (samplePE.getDeletion() == null) { assertNull(msg, sample.del_id); } else { - assertEquals(msg, samplePE.getInvalidation().getId(), sample.del_id); + assertEquals(msg, samplePE.getDeletion().getId(), sample.del_id); } if (samplePE.getContainer() == null) { diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/DataDAOTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/DataDAOTest.java index 1053e4c03e8e94b686b3d76966c37de5b1aa24a7..7355cf145b4768b2eed31626be365e8e9e2d581d 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/DataDAOTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/DataDAOTest.java @@ -461,7 +461,7 @@ public final class DataDAOTest extends AbstractDAOTest List<ExperimentPE> experiments = daoFactory.getExperimentDAO().listExperiments(); for (ExperimentPE experimentPE : experiments) { - if (experimentPE.getInvalidation() == null) + if (experimentPE.getDeletion() == null) { return experimentPE; } diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/builders/ExperimentBuilder.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/builders/ExperimentBuilder.java index 6681b0a6f03d3d94b148350ac45a00938221d449..4cc1d5ca84124c164b322aa989a5a48460f132b9 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/builders/ExperimentBuilder.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/builders/ExperimentBuilder.java @@ -24,7 +24,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseInstance; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Experiment; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ExperimentType; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.IEntityProperty; -import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Invalidation; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Deletion; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Person; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Project; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Space; @@ -89,9 +89,9 @@ public class ExperimentBuilder return this; } - public ExperimentBuilder invalidate() + public ExperimentBuilder markDeleted() { - experiment.setInvalidation(new Invalidation()); + experiment.setDeletion(new Deletion()); return this; } diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/builders/SampleBuilder.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/builders/SampleBuilder.java index 828cbeb1ddecaa1fc2bd03e866c22827aae256f3..f61d9131d0e0e9a2ac468f284b8c6ba2e2682167 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/builders/SampleBuilder.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/builders/SampleBuilder.java @@ -25,7 +25,7 @@ import java.util.List; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseInstance; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Experiment; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.IEntityProperty; -import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Invalidation; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Deletion; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Person; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Sample; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.SampleType; @@ -105,9 +105,9 @@ public class SampleBuilder return this; } - public SampleBuilder invalidate() + public SampleBuilder markDeleted() { - sample.setInvalidation(new Invalidation()); + sample.setDeletion(new Deletion()); return this; } diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/translator/DataSetTranslatorTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/translator/DataSetTranslatorTest.java index e150ed1a0cc4eebdc024c85bbb78cb7d19e146a7..d9208951b16a5c557be13af3187a803ec8369999 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/translator/DataSetTranslatorTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/translator/DataSetTranslatorTest.java @@ -36,7 +36,7 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.ExperimentPE; import ch.systemsx.cisd.openbis.generic.shared.dto.ExperimentTypePE; import ch.systemsx.cisd.openbis.generic.shared.dto.ExternalDataPE; import ch.systemsx.cisd.openbis.generic.shared.dto.FileFormatTypePE; -import ch.systemsx.cisd.openbis.generic.shared.dto.InvalidationPE; +import ch.systemsx.cisd.openbis.generic.shared.dto.DeletionPE; import ch.systemsx.cisd.openbis.generic.shared.dto.LocatorTypePE; import ch.systemsx.cisd.openbis.generic.shared.dto.PersonPE; import ch.systemsx.cisd.openbis.generic.shared.dto.ProjectPE; @@ -114,14 +114,14 @@ public class DataSetTranslatorTest extends AssertJUnit sampleTypePE.setCode("sampleTypeCode"); sampleTypePE.setDescription("sampleTypeDescription"); samplePE.setSampleType(sampleTypePE); - InvalidationPE invalidationPE = new InvalidationPE(); - invalidationPE.setReason("reason"); - invalidationPE.setRegistrationDate(new Date(3)); + DeletionPE deletionPE = new DeletionPE(); + deletionPE.setReason("reason"); + deletionPE.setRegistrationDate(new Date(3)); PersonPE personPE = new PersonPE(); personPE.setUserId("user"); personPE.setDatabaseInstance(databaseInstancePE); - invalidationPE.setRegistrator(personPE); - externalDataPE.setInvalidation(invalidationPE); + deletionPE.setRegistrator(personPE); + externalDataPE.setDeletion(deletionPE); externalDataPE.setSampleAcquiredFrom(samplePE); ExternalData data = DataSetTranslator.translate(externalDataPE, BASE_INDEX_URL); @@ -149,9 +149,9 @@ public class DataSetTranslatorTest extends AssertJUnit assertEquals("sampleTypeCode", translated.getSampleType().getCode()); assertEquals("sampleTypeDescription", translated.getSampleType().getDescription()); assertEquals(false, translated.isDerived()); - assertEquals("reason", translated.getInvalidation().getReason()); - assertEquals(3, translated.getInvalidation().getRegistrationDate().getTime()); - assertEquals("user", translated.getInvalidation().getRegistrator().getUserId()); + assertEquals("reason", translated.getDeletion().getReason()); + assertEquals(3, translated.getDeletion().getRegistrationDate().getTime()); + assertEquals("user", translated.getDeletion().getRegistrator().getUserId()); } @Test @@ -186,7 +186,7 @@ public class DataSetTranslatorTest extends AssertJUnit assertEquals(true, parentCodes.contains("parent-1")); assertEquals(true, parentCodes.contains("parent-2")); assertEquals(true, externalData.isDerived()); - assertEquals(null, externalData.getInvalidation()); + assertEquals(null, externalData.getDeletion()); } private Set<String> extractParentCodes(ExternalData externalData) diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/GenericExperimentViewerTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/GenericExperimentViewerTest.java index 47fe9da7fecf29085d6b10747bbaea71422859e1..1de48fde3d0c8fea9d67d832cfb4e8ab814e19a1 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/GenericExperimentViewerTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/GenericExperimentViewerTest.java @@ -44,7 +44,7 @@ import ch.systemsx.cisd.openbis.generic.shared.ICommonServer; import ch.systemsx.cisd.openbis.generic.shared.basic.Row; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Experiment; -import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Invalidation; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Deletion; /** * A {@link AbstractGWTTestCase} extension to test {@link GenericExperimentViewer}. @@ -174,7 +174,7 @@ public class GenericExperimentViewerTest extends AbstractGWTTestCase launchTest(); } - public final void testShowInvalidExperimentDetails() + public final void testShowDeletedExperimentDetails() { prepareShowExperiment(DEFAULT, SIRNA_HCS, EXP_X); final CheckExperiment checkExperiment = new CheckExperiment(); @@ -183,12 +183,12 @@ public class GenericExperimentViewerTest extends AbstractGWTTestCase ".*<a .* href=\".*permId=" + EXP_X_PERM_ID + ".*>" + EXP_X_PERM_ID + "</a>.*"); checkExperiment.property("Experiment Type").asCode(SIRNA_HCS); checkExperiment.property("Registrator").asPerson(DOE_JOHN); - checkExperiment.property("Invalidation").by(new IValueAssertion<Invalidation>() + checkExperiment.property("Deletion").by(new IValueAssertion<Deletion>() { - public void assertValue(final Invalidation invalidation) + public void assertValue(final Deletion deletion) { - assertEquals("Doe", invalidation.getRegistrator().getLastName()); - assertNull(invalidation.getReason()); + assertEquals("Doe", deletion.getRegistrator().getLastName()); + assertNull(deletion.getReason()); } }); checkExperiment.property("Description").asProperty(A_SIMPLE_EXPERIMENT); @@ -286,7 +286,7 @@ public class GenericExperimentViewerTest extends AbstractGWTTestCase final CheckTableCommand datasetTable = checkExperiment.createDataSetTableCheck().expectedSize(2); datasetTable.expectedRow(new DataSetRow("20081105092159188-3").valid().derived()); - datasetTable.expectedRow(new DataSetRow("20081105092158673-1").invalid() + datasetTable.expectedRow(new DataSetRow("20081105092158673-1").deleted() .withSample("CISD:/CISD/3VCP1").withSampleType("CELL_PLATE").notDerived() .withIsComplete(null)); datasetTable.expectedColumnsNumber(25); diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleViewerTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleViewerTest.java index 373f8310fd07d8a483361d98823e8948d76c4160..cf9de5b366c593aa959ada4468a9409d9eb7a917 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleViewerTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleViewerTest.java @@ -33,7 +33,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.CheckTab import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.GWTTestUtil; import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.IValueAssertion; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; -import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Invalidation; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Deletion; /** * A {@link AbstractGWTTestCase} extension to test {@link GenericSampleViewer}. @@ -128,16 +128,16 @@ public class GenericSampleViewerTest extends AbstractGWTTestCase ".*<a href=\".*permId=" + CELL_PLATE_EXAMPLE_PERM_ID + ".*>" + CELL_PLATE_EXAMPLE_PERM_ID + "</a>.*"); checkSample.property("Sample Type").asCode("CELL_PLATE"); - checkSample.property("Invalidation").by(new IValueAssertion<Invalidation>() + checkSample.property("Deletion").by(new IValueAssertion<Deletion>() { - public void assertValue(final Invalidation invalidation) + public void assertValue(final Deletion deletion) { - assertEquals("Doe", invalidation.getRegistrator().getLastName()); - assertEquals("wrong-code", invalidation.getReason()); + assertEquals("Doe", deletion.getRegistrator().getLastName()); + assertEquals("wrong-code", deletion.getReason()); } }); checkSample.property("Parent").asCode(parentCode1); - checkSample.property("Parent").asInvalidEntity(); + checkSample.property("Parent").asDeletedEntity(); remoteConsole.prepare(checkSample); activateTab(createSectionsTabPanelId(), @@ -153,7 +153,7 @@ public class GenericSampleViewerTest extends AbstractGWTTestCase activateTab(createSectionsTabPanelId(), createSectionId(DisplayTypeIDGenerator.DATA_SETS_SECTION)); final CheckTableCommand checkDataTable = checkSample.createDataTableCheck().expectedSize(1); - checkDataTable.expectedRow(new DataSetRow(DIRECTLY_CONNECTED_DATA_SET_CODE).invalid() + checkDataTable.expectedRow(new DataSetRow(DIRECTLY_CONNECTED_DATA_SET_CODE).deleted() .withFileFormatType("TIFF")); checkDataTable.expectedColumnsNumber(26); final String commentColIdent = GridTestUtils.getPropertyColumnIdentifier("COMMENT", false); @@ -184,7 +184,7 @@ public class GenericSampleViewerTest extends AbstractGWTTestCase new CheckTableCommand(SampleDataSetBrowser.createGridId(WILDCARD_ID)); checkDirectlyConnectedDataTable.expectedSize(1); checkDirectlyConnectedDataTable - .expectedRow(new DataSetRow(DIRECTLY_CONNECTED_DATA_SET_CODE).invalid() + .expectedRow(new DataSetRow(DIRECTLY_CONNECTED_DATA_SET_CODE).deleted() .withFileFormatType("TIFF").withSample(CELL_PLATE_EXAMPLE_ID) .withExperiment(CELL_PLATE_EXAMPLE_EXPERIMENT_ID)); remoteConsole.prepare(checkDirectlyConnectedDataTable); @@ -206,7 +206,7 @@ public class GenericSampleViewerTest extends AbstractGWTTestCase new CheckTableCommand(SampleDataSetBrowser.createGridId(WILDCARD_ID)); checkIndirectlyConnectedDataTable.expectedSize(6); checkIndirectlyConnectedDataTable - .expectedRow(new DataSetRow(DIRECTLY_CONNECTED_DATA_SET_CODE).invalid() + .expectedRow(new DataSetRow(DIRECTLY_CONNECTED_DATA_SET_CODE).deleted() .withFileFormatType("TIFF").withSample(CELL_PLATE_EXAMPLE_ID) .withExperiment(CELL_PLATE_EXAMPLE_EXPERIMENT_ID)); checkIndirectlyConnectedDataTable.expectedRow(new DataSetRow( diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/ExperimentBrowsingTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/ExperimentBrowsingTest.java index debf1c9353e1e9012ba74fc16958c96e66726a20..6a0f8e484e49473d7f4960aef33a8a4484196b23 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/ExperimentBrowsingTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/ExperimentBrowsingTest.java @@ -75,9 +75,9 @@ public class ExperimentBrowsingTest extends SystemTestCase criteria.setProject(project); TypedTableResultSet<Experiment> resultSet = commonClientService.listExperiments(criteria); Experiment e1 = getOriginalObjectByCode(resultSet, "EXP-REUSE"); - assertEquals(null, e1.getInvalidation()); + assertEquals(null, e1.getDeletion()); Experiment e2 = getOriginalObjectByCode(resultSet, "EXP-X"); - assertEquals(null, e2.getInvalidation().getReason()); + assertEquals(null, e2.getDeletion().getReason()); assertEquals(false, resultSet.getResultSet().isPartial()); assertEquals(3, resultSet.getResultSet().getTotalLength()); assertEquals(3, resultSet.getResultSet().getList().size()); diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/plugin/generic/SampleBrowsingTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/plugin/generic/SampleBrowsingTest.java index 590813f606d065c1081f1c3f061026d9c7fe618c..684ae547cc8561088a4bf780a5f4e1214d1a3672 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/plugin/generic/SampleBrowsingTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/plugin/generic/SampleBrowsingTest.java @@ -125,12 +125,12 @@ public class SampleBrowsingTest extends GenericSystemTestCase Sample s1 = getSample(list, createSampleIdentifier("MP001-1")); checkInternalProperty(s1.getProperties(), "PLATE_GEOMETRY", DEFAULT_PLATE_GEOMETRY_VALUE); - assertNotNull(s1.getInvalidation()); + assertNotNull(s1.getDeletion()); assertNull(s1.getExperiment()); Sample s2 = getSample(list, createSampleIdentifier("MP002-1")); checkInternalProperty(s2.getProperties(), "PLATE_GEOMETRY", DEFAULT_PLATE_GEOMETRY_VALUE); - assertNull(s2.getInvalidation()); + assertNull(s2.getDeletion()); assertNull(s2.getExperiment()); } @@ -152,7 +152,7 @@ public class SampleBrowsingTest extends GenericSystemTestCase Sample s = getSample(list, createSharedSampleIdentifier("MP")); checkInternalProperty(s.getProperties(), "PLATE_GEOMETRY", DEFAULT_PLATE_GEOMETRY_VALUE); - assertNull(s.getInvalidation()); + assertNull(s.getDeletion()); assertNull(s.getExperiment()); } @@ -174,7 +174,7 @@ public class SampleBrowsingTest extends GenericSystemTestCase GridRowModels<Sample> list = samples.getResultSet().getList(); Sample s = getSample(list, createSampleIdentifier("3VCP1")); - assertNotNull(s.getInvalidation()); + assertNotNull(s.getDeletion()); assertEquals("/CISD/NEMO/EXP1", s.getExperiment().getIdentifier()); assertEquals("/CISD/3V-123", s.getGeneratedFrom().getIdentifier()); assertNull(s.getGeneratedFrom().getGeneratedFrom()); diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/plugin/generic/SampleDetailsTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/plugin/generic/SampleDetailsTest.java index 8d2389e0cdd13349785b86c91ffd8c11c9b36413..5573ce832bcc099c69a1ec150c179542190e58d3 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/plugin/generic/SampleDetailsTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/plugin/generic/SampleDetailsTest.java @@ -154,13 +154,13 @@ public class SampleDetailsTest extends GenericSystemTestCase .getIdentifier()); assertEquals(CELL_PLATE_EXAMPLE_EXPERIMENT_ID, sDetails.getExperiment().getIdentifier()); - assertEquals("Doe", sDetails.getInvalidation().getRegistrator().getLastName()); - assertEquals("wrong-code", sDetails.getInvalidation().getReason()); + assertEquals("Doe", sDetails.getDeletion().getRegistrator().getLastName()); + assertEquals("wrong-code", sDetails.getDeletion().getReason()); assertEquals(1, sDetails.getParents().size()); final Sample parent = sDetails.getParents().iterator().next(); assertEquals("3V-123", parent.getCode()); - assertNotNull(parent.getInvalidation()); + assertNotNull(parent.getDeletion()); assertEquals(sListed.getProperties().size(), sDetails.getProperties().size());