Skip to content
Snippets Groups Projects
Commit efc4162e authored by jakubs's avatar jakubs
Browse files

BIS-190 SP-295 add objectId to api objects of metaproject contents

SVN: 27514
parent 91d7959f
No related branches found
No related tags found
No related merge requests found
Showing
with 73 additions and 4 deletions
......@@ -32,6 +32,8 @@ import ch.systemsx.cisd.openbis.dss.generic.shared.api.internal.v1.IExternalData
import ch.systemsx.cisd.openbis.dss.generic.shared.api.internal.v1.ISampleImmutable;
import ch.systemsx.cisd.openbis.dss.generic.shared.dto.DataSetInformation;
import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.DataSetType;
import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.id.IObjectId;
import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.id.dataset.DataSetCodeId;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Experiment;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.FileFormatType;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Sample;
......@@ -114,6 +116,12 @@ public class DataSet<T extends DataSetInformation> extends AbstractDataSetImmuta
return registrationDetails.getDataSetInformation().getDataSetCode();
}
@Override
public IObjectId getEntityId()
{
return new DataSetCodeId(getDataSetCode());
}
@Override
public IExperimentImmutable getExperiment()
{
......
......@@ -26,6 +26,8 @@ import ch.systemsx.cisd.openbis.dss.generic.shared.api.internal.v1.IExperimentIm
import ch.systemsx.cisd.openbis.dss.generic.shared.api.internal.v1.IExternalDataManagementSystemImmutable;
import ch.systemsx.cisd.openbis.dss.generic.shared.api.internal.v1.ISampleImmutable;
import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.DataSetType;
import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.id.IObjectId;
import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.id.dataset.DataSetCodeId;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Code;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ContainerDataSet;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ExternalData;
......@@ -54,6 +56,12 @@ public class DataSetImmutable extends AbstractDataSetImmutable
return dataSet.getCode();
}
@Override
public IObjectId getEntityId()
{
return new DataSetCodeId(getDataSetCode());
}
@Override
public IExperimentImmutable getExperiment()
{
......
......@@ -18,6 +18,8 @@ package ch.systemsx.cisd.etlserver.registrator.api.v1.impl;
import ch.systemsx.cisd.common.exceptions.UserFailureException;
import ch.systemsx.cisd.openbis.dss.generic.shared.api.internal.v1.IExperimentImmutable;
import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.id.IObjectId;
import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.id.experiment.ExperimentIdentifierId;
import ch.systemsx.cisd.openbis.generic.shared.util.EntityHelper;
/**
......@@ -40,6 +42,12 @@ public class ExperimentImmutable implements IExperimentImmutable
return identifier == null ? null : identifier.toUpperCase();
}
@Override
public IObjectId getEntityId()
{
return new ExperimentIdentifierId(getExperimentIdentifier());
}
@Override
public boolean isExistingExperiment()
{
......
......@@ -18,6 +18,8 @@ package ch.systemsx.cisd.etlserver.registrator.api.v1.impl;
import ch.systemsx.cisd.common.exceptions.UserFailureException;
import ch.systemsx.cisd.openbis.dss.generic.shared.api.internal.v1.IMaterialImmutable;
import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.id.IObjectId;
import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.id.material.MaterialCodeAndTypeCodeId;
import ch.systemsx.cisd.openbis.generic.shared.util.EntityHelper;
/**
......@@ -63,6 +65,12 @@ public class MaterialImmutable implements IMaterialImmutable
return null;
}
@Override
public IObjectId getEntityId()
{
return new MaterialCodeAndTypeCodeId(getCode(), getMaterialType());
}
@Override
public boolean isExistingMaterial()
{
......
......@@ -25,6 +25,8 @@ import ch.systemsx.cisd.common.exceptions.UserFailureException;
import ch.systemsx.cisd.openbis.dss.generic.shared.api.internal.v1.IExperimentImmutable;
import ch.systemsx.cisd.openbis.dss.generic.shared.api.internal.v1.ISampleImmutable;
import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.SampleFetchOption;
import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.id.IObjectId;
import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.id.sample.SampleIdentifierId;
import ch.systemsx.cisd.openbis.generic.shared.util.EntityHelper;
/**
......@@ -97,6 +99,12 @@ public class SampleImmutable implements ISampleImmutable
return identifier == null ? null : identifier.toUpperCase();
}
@Override
public IObjectId getEntityId()
{
return new SampleIdentifierId(getSampleIdentifier());
}
public ch.systemsx.cisd.openbis.generic.shared.basic.dto.Sample getSample()
{
return sample;
......
......@@ -27,7 +27,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.FileFormatType;
*
* @author Chandrasekhar Ramakrishnan
*/
public interface IDataSetImmutable
public interface IDataSetImmutable extends IMetaprojectContent
{
/**
* Get the data set code of the data set
......
......@@ -21,7 +21,7 @@ package ch.systemsx.cisd.openbis.dss.generic.shared.api.internal.v1;
*
* @author Chandrasekhar Ramakrishnan
*/
public interface IExperimentImmutable
public interface IExperimentImmutable extends IMetaprojectContent
{
/**
* Return the experiment identifier of this experiment.
......
......@@ -19,7 +19,7 @@ package ch.systemsx.cisd.openbis.dss.generic.shared.api.internal.v1;
/**
* @author Kaloyan Enimanev
*/
public interface IMaterialImmutable
public interface IMaterialImmutable extends IMetaprojectContent
{
/**
......
/*
* Copyright 2012 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.dss.generic.shared.api.internal.v1;
import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.id.IObjectId;
/**
* Interface grouping all entities that can belong in metaproject.
*
* @author Jakub Straszewski
*/
public interface IMetaprojectContent
{
IObjectId getEntityId();
}
......@@ -23,7 +23,7 @@ import java.util.List;
*
* @author Chandrasekhar Ramakrishnan
*/
public interface ISampleImmutable
public interface ISampleImmutable extends IMetaprojectContent
{
/**
* Return the identifier for this sample.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment