diff --git a/openbis/dist/server/web-client.properties b/openbis/dist/server/web-client.properties index 1e2e90140e850d767ea0956991b6d2c5b99b3c45..aca5dfc20c825bf0900d5fa28853b099f209ef3d 100644 --- a/openbis/dist/server/web-client.properties +++ b/openbis/dist/server/web-client.properties @@ -35,6 +35,7 @@ # data-set-data-section # data-set-parents-section # data-set-children-section +# data-set-contained-section # query-section # generic_experiment_viewer # data-sets-section diff --git a/openbis/etc/web-client.properties b/openbis/etc/web-client.properties index 5868bcd5cba4d66f58bd1463080f8084b49505b5..01573c504665a4c680f10deb5c7f3dcfdf148ea6 100644 --- a/openbis/etc/web-client.properties +++ b/openbis/etc/web-client.properties @@ -6,7 +6,7 @@ # Flag specifying whether default login mode is anonymous or not. # If true a user-for-anonymous-login has to be defined in service.properties # Default value: false -# default-anonymous-login = true +#default-anonymous-login = true # Maximal number of visible columns in tables. Default: 50. max-visible-columns = 25 @@ -29,6 +29,7 @@ data-set-types-with-image-overview = HCS_IMAGE, UNKNOWN # data-set-data-section # data-set-parents-section # data-set-children-section +# data-set-contained-section # query-section # generic_experiment_viewer # data-sets-section @@ -59,6 +60,6 @@ experiment-view.hide-sections = attachment-section data-view.view = generic_dataset_viewer data-view.types = HCS_IMAGE -data-view.hide-smart-view = true +data-view.hide-smart-view = false data-view.hide-file-view = false diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/DisplayTypeIDGenerator.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/DisplayTypeIDGenerator.java index ed88ab4984400105baf7685009aa417eeb259c2a..3b2075b08ac016e569506aab19ef79a6f826737a 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/DisplayTypeIDGenerator.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/DisplayTypeIDGenerator.java @@ -94,6 +94,8 @@ public enum DisplayTypeIDGenerator implements IDisplayTypeIDGenerator DATA_SET_CHILDREN_SECTION("data-set-children-section"), + DATA_SET_CONTAINED_SECTION("data-set-contained-section"), + DATA_SET_DATA_SECTION("data-set-data-section"), MODULE_SECTION("module-section"), 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 066e519f5acfe9971d1765a30588933faa987895..2d7f0783cd33a735fb6c98f6e29846f4ac4619ea 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 @@ -202,9 +202,9 @@ import ch.systemsx.cisd.openbis.generic.shared.managed_property.ManagedPropertyE import ch.systemsx.cisd.openbis.generic.shared.managed_property.ManagedPropertyEvaluatorFactory; import ch.systemsx.cisd.openbis.generic.shared.translator.AttachmentTranslator; import ch.systemsx.cisd.openbis.generic.shared.translator.AuthorizationGroupTranslator; +import ch.systemsx.cisd.openbis.generic.shared.translator.DataSetTranslator; import ch.systemsx.cisd.openbis.generic.shared.translator.DataSetTypeTranslator; import ch.systemsx.cisd.openbis.generic.shared.translator.DataStoreServiceTranslator; -import ch.systemsx.cisd.openbis.generic.shared.translator.DataSetTranslator; import ch.systemsx.cisd.openbis.generic.shared.translator.DataTypeTranslator; import ch.systemsx.cisd.openbis.generic.shared.translator.DtoConverters; import ch.systemsx.cisd.openbis.generic.shared.translator.ExperimentTranslator; @@ -523,6 +523,9 @@ public final class CommonServer extends AbstractCommonServer<ICommonServerForInt List<ExternalData> datasets = null; switch (role) { + case CONTAINER: + datasets = datasetLister.listByContainerTechId(datasetId); + break; case CHILD: datasets = datasetLister.listByChildTechId(datasetId); break; 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 467a80cb2c3ef7a1cb6334b34eb1a4b8f064b998..c9260ad785651f5406b578c0b65d3042fe3ab742 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 @@ -318,6 +318,11 @@ public class DatasetLister extends AbstractLister implements IDatasetLister return enrichDatasets(query.getParentDatasetsForChild(childDatasetId.getId())); } + public List<ExternalData> listByContainerTechId(TechId containerDatasetId) + { + return enrichDatasets(query.getContainedDatasetsForContainer(containerDatasetId.getId())); + } + public List<ExternalData> listByParentTechIds(Collection<Long> parentDatasetIds) { List<ExternalData> result = new ArrayList<ExternalData>(); @@ -581,7 +586,7 @@ public class DatasetLister extends AbstractLister implements IDatasetLister LongSet containerIDs = new LongOpenHashSet(); for (ExternalData dataSet : datasetMap.values()) { - if (dataSet.isContainerDataSet()) + if (dataSet.isContainer()) { containerIDs.add(dataSet.getId()); } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/datasetlister/IDatasetLister.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/datasetlister/IDatasetLister.java index 29d2d501884b23efa4741f3c2b6bd7ca16d66a65..3ef3183b414e095df800c94fedf0fea8bacd324e 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/datasetlister/IDatasetLister.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/datasetlister/IDatasetLister.java @@ -47,6 +47,9 @@ public interface IDatasetLister /** @return datasets that are parents of a dataset with the specified id */ List<ExternalData> listByChildTechId(TechId childDatasetId); + /** @return datasets that are components of a dataset with the specified id */ + List<ExternalData> listByContainerTechId(TechId containerDatasetId); + /** @return all datasets that are children of any specified dataset id */ List<ExternalData> listByParentTechIds(Collection<Long> parentDatasetIds); @@ -61,22 +64,22 @@ public interface IDatasetLister * IDs from the argument. A value of the map contains at least one element. */ Map<Long, Set<Long>> listChildrenIds(Collection<Long> dataSetIDs); - + /** - * Returns a map with all data sets of specified samples. The sample arguments are the - * key into the returned map. The returned data sets contains all derived data sets (children, - * grand children, etc.). + * Returns a map with all data sets of specified samples. The sample arguments are the key into + * the returned map. The returned data sets contains all derived data sets (children, grand + * children, etc.). */ Map<Sample, List<ExternalData>> listAllDataSetsFor(List<Sample> samples); - /** - * Lists all data sets with specified codes. Unenriched data sets will be returned. + /** + * Lists all data sets with specified codes. Unenriched data sets will be returned. */ List<ExternalData> listByDatasetCode(Collection<String> datasetCodes); /** @return datasets with given ids */ List<ExternalData> listByDatasetIds(Collection<Long> datasetIds); - + /** @return datasets specified by given criteria */ List<ExternalData> listByTrackingCriteria(TrackingDataSetCriteria criteria); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/datasetlister/IDatasetListingQuery.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/datasetlister/IDatasetListingQuery.java index 7ee36dac0d8211b5cbdbfac529326900b7859234..62319fb0fb67ac341ebe6a19db838e58dae62abb 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/datasetlister/IDatasetListingQuery.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/datasetlister/IDatasetListingQuery.java @@ -149,6 +149,12 @@ public interface IDatasetListingQuery extends TransactionQuery, IPropertyListing + " WHERE data.id IN (SELECT data_id_parent FROM data_set_relationships r WHERE r.data_id_child=?{1})", fetchSize = FETCH_SIZE) public DataIterator<DatasetRecord> getParentDatasetsForChild(long childDatasetId); + /** + * Returns the datasets that are contained in a dataset with given id. + */ + @Select(sql = SELECT_ALL + " WHERE data.ctnr_id=?{1}", fetchSize = FETCH_SIZE) + public DataIterator<DatasetRecord> getContainedDatasetsForContainer(long containerDatasetId); + /** * Returns the datasets for the given <var>datasetId</var>. */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/DataSetRelationshipRole.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/DataSetRelationshipRole.java index 261973aba06cbb6d0128a4936bf02c26313ea78f..f528453c79f04c39c957667f98d67ff0373ce82a 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/DataSetRelationshipRole.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/DataSetRelationshipRole.java @@ -23,5 +23,5 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.ISerializable; */ public enum DataSetRelationshipRole implements ISerializable { - PARENT, CHILD; + CONTAINER, PARENT, CHILD; } 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 8fd9a7449c56bf631d56bb65fb5f561d2bfd4822..923856f3647a50b110c6c7cec54924fad4ae8e23 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 @@ -88,7 +88,7 @@ public class ExternalData extends CodeWithRegistration<ExternalData> implements /** * @return true if this is a container data set. */ - public boolean isContainerDataSet() + public boolean isContainer() { return dataSetType != null && dataSetType.isContainerType(); } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/DataSetContainedSection.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/DataSetContainedSection.java new file mode 100644 index 0000000000000000000000000000000000000000..c24f229ce0f2f84c9e6e17b22ed6f082f2785d6a --- /dev/null +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/DataSetContainedSection.java @@ -0,0 +1,47 @@ +/* + * Copyright 2009 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.plugin.generic.client.web.client.application.dataset; + +import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DisplayTypeIDGenerator; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.IDisposableComponent; +import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataSetRelationshipRole; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ExternalData; + +/** + * @author Piotr Buczek + */ +class DataSetContainedSection extends AbstractDataSetsSection +{ + private final ExternalData dataset; + + DataSetContainedSection(IViewContext<?> viewContext, ExternalData dataset) + { + super("Contained (Data Sets)", viewContext, dataset); + this.dataset = dataset; + setIds(DisplayTypeIDGenerator.DATA_SET_CONTAINED_SECTION); + } + + @Override + protected IDisposableComponent createDatasetBrowserComponent() + { + return DataSetRelationshipBrowser.create(viewContext, TechId.create(dataset), + DataSetRelationshipRole.CONTAINER, dataset.getDataSetType()); + } + +} 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 fb34505fb5bd0d8c7888ec7d76983f7ca730ae46..0ed6252367cd28b5ea06f704f7de9e3955f77131 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 @@ -180,6 +180,12 @@ abstract public class GenericDataSetViewer extends AbstractViewerWithVerticalSpl final TabContent dataSection = new DataViewSection(viewContext, dataset); container.addSection(dataSection); + if (dataset.isContainer()) + { + final TabContent containedSection = new DataSetContainedSection(viewContext, dataset); + container.addSection(containedSection); + } + // parents final TabContent parentsSection = new DataSetParentsSection(viewContext, dataset); container.addSection(parentsSection);