Skip to content
Snippets Groups Projects
Commit f0c0ea20 authored by gpawel's avatar gpawel
Browse files

bugfix: adding a way of deleting entities from metaproject by tech ids

SVN: 27097
parent 8096f68e
No related branches found
No related tags found
No related merge requests found
...@@ -224,6 +224,19 @@ public class GeneralInformationChangingService extends ...@@ -224,6 +224,19 @@ public class GeneralInformationChangingService extends
extractTechIds(materials)); extractTechIds(materials));
} }
@Override
@Transactional(readOnly = false)
@RolesAllowed(RoleWithHierarchy.SPACE_USER)
public void removeFromMetaprojectByEntityIds(String sessionToken,
@AuthorizationGuard(guardClass = MetaprojectIdPredicate.class)
Long metaprojectId, List<Long> experiments, List<Long> samples, List<Long> dataSets,
List<Long> materials)
{
server.removeFromMetaproject(sessionToken, new TechId(metaprojectId),
TechId.createList(experiments), TechId.createList(samples),
TechId.createList(dataSets), TechId.createList(materials));
}
private List<TechId> extractTechIds(Collection<? extends IIdHolder> entitiesOrNull) private List<TechId> extractTechIds(Collection<? extends IIdHolder> entitiesOrNull)
{ {
if (entitiesOrNull == null) if (entitiesOrNull == null)
......
...@@ -125,7 +125,7 @@ class GeneralInformationChangingServiceLogger extends AbstractServerLogger imple ...@@ -125,7 +125,7 @@ class GeneralInformationChangingServiceLogger extends AbstractServerLogger imple
{ {
logAccess( logAccess(
sessionToken, sessionToken,
"addToMetaproject METAPROJECT_ID(%s), EXPERIMENTS(%s), SAMPLES(%s), DATA_SETS(%s), MATERIALS(%s)", "addToMetaprojectByEntityIds METAPROJECT_ID(%s), EXPERIMENTS(%s), SAMPLES(%s), DATA_SETS(%s), MATERIALS(%s)",
metaprojectId.toString(), abbreviate(experiments), abbreviate(samples), metaprojectId.toString(), abbreviate(experiments), abbreviate(samples),
abbreviate(dataSets), abbreviate(materials)); abbreviate(dataSets), abbreviate(materials));
} }
...@@ -142,6 +142,17 @@ class GeneralInformationChangingServiceLogger extends AbstractServerLogger imple ...@@ -142,6 +142,17 @@ class GeneralInformationChangingServiceLogger extends AbstractServerLogger imple
abbreviate(dataSets), abbreviate(materials)); abbreviate(dataSets), abbreviate(materials));
} }
@Override
public void removeFromMetaprojectByEntityIds(String sessionToken, Long metaprojectId,
List<Long> experiments, List<Long> samples, List<Long> dataSets, List<Long> materials)
{
logAccess(
sessionToken,
"removeFromMetaprojectByEntityIds METAPROJECT_ID(%s), EXPERIMENTS(%s), SAMPLES(%s), DATA_SETS(%s), MATERIALS(%s)",
metaprojectId.toString(), abbreviate(experiments), abbreviate(samples),
abbreviate(dataSets), abbreviate(materials));
}
@Override @Override
public int getMajorVersion() public int getMajorVersion()
{ {
......
...@@ -165,4 +165,21 @@ public interface IGeneralInformationChangingService extends IRpcService ...@@ -165,4 +165,21 @@ public interface IGeneralInformationChangingService extends IRpcService
public void removeFromMetaproject(String sessionToken, Long metaprojectId, public void removeFromMetaproject(String sessionToken, Long metaprojectId,
Collection<Experiment> experiments, Collection<Sample> samples, Collection<Experiment> experiments, Collection<Sample> samples,
Collection<DataSet> dataSets, Collection<Material> materials); Collection<DataSet> dataSets, Collection<Material> materials);
/**
* Removes given entities to existing metaproject.
*
* @param metaprojectId Tech Id of metaproject
* @param experiments List of experiment ids that should be removed from the metaproject or
* <code>null</code>
* @param samples List of sample ids that should be removed from the metaproject or
* <code>null</code>
* @param dataSets List of data set ids that should be removed from the metaproject or
* <code>null</code>
* @param materials List of material ids that should be removed from the metaproject or
* <code>null</code>
* @since 1.3
*/
public void removeFromMetaprojectByEntityIds(String sessionToken, Long metaprojectId,
List<Long> experiments, List<Long> samples, List<Long> dataSets, List<Long> materials);
} }
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