use of ubic.gemma.model.expression.experiment.SessionBoundExpressionExperimentSetValueObject in project Gemma by PavlidisLab.
the class ExpressionExperimentSetController method updateUserAndSessionGroups.
/**
* AJAX Updates the session group and user database groups.
*/
public Collection<ExpressionExperimentSetValueObject> updateUserAndSessionGroups(Collection<ExpressionExperimentSetValueObject> vos) {
Collection<ExpressionExperimentSetValueObject> updatedSets = new HashSet<>();
Collection<ExpressionExperimentSetValueObject> databaseCollection = new HashSet<>();
Collection<SessionBoundExpressionExperimentSetValueObject> sessionCollection = new HashSet<>();
for (ExpressionExperimentSetValueObject experimentSetValueObject : vos) {
if (experimentSetValueObject instanceof SessionBoundExpressionExperimentSetValueObject) {
sessionCollection.add((SessionBoundExpressionExperimentSetValueObject) experimentSetValueObject);
} else {
databaseCollection.add(experimentSetValueObject);
}
}
sessionCollection = this.updateSessionGroups(sessionCollection);
databaseCollection = this.update(databaseCollection);
updatedSets.addAll(sessionCollection);
updatedSets.addAll(databaseCollection);
return updatedSets;
}
use of ubic.gemma.model.expression.experiment.SessionBoundExpressionExperimentSetValueObject in project Gemma by PavlidisLab.
the class ExpressionExperimentSetController method removeUserAndSessionGroups.
/**
* AJAX Given valid experiment groups will remove them from the session or the database appropriately.
*/
public Collection<ExpressionExperimentSetValueObject> removeUserAndSessionGroups(Collection<ExpressionExperimentSetValueObject> vos) {
Collection<ExpressionExperimentSetValueObject> removedSets = new HashSet<>();
Collection<ExpressionExperimentSetValueObject> databaseCollection = new HashSet<>();
Collection<SessionBoundExpressionExperimentSetValueObject> sessionCollection = new HashSet<>();
for (ExpressionExperimentSetValueObject experimentSetValueObject : vos) {
if (experimentSetValueObject instanceof SessionBoundExpressionExperimentSetValueObject) {
sessionCollection.add((SessionBoundExpressionExperimentSetValueObject) experimentSetValueObject);
} else {
databaseCollection.add(experimentSetValueObject);
}
}
sessionCollection = this.removeSessionGroups(sessionCollection);
databaseCollection = this.remove(databaseCollection);
removedSets.addAll(sessionCollection);
removedSets.addAll(databaseCollection);
return removedSets;
}
use of ubic.gemma.model.expression.experiment.SessionBoundExpressionExperimentSetValueObject in project Gemma by PavlidisLab.
the class ExpressionExperimentSetController method canCurrentUserEditGroup.
/**
* AJAX returns a JSON string encoding whether the current user owns the group and whether the group is db-backed
*/
public String canCurrentUserEditGroup(ExpressionExperimentSetValueObject eesvo) {
boolean userCanEditGroup = false;
boolean groupIsDBBacked = false;
if (!(eesvo instanceof SessionBoundExpressionExperimentSetValueObject)) {
groupIsDBBacked = true;
try {
ExpressionExperimentSetValueObject set = expressionExperimentSetService.loadValueObject(expressionExperimentSetService.load(eesvo.getId()));
userCanEditGroup = (set.getUserCanWrite() && set.isModifiable());
} catch (org.springframework.security.access.AccessDeniedException ade) {
return "{groupIsDBBacked:" + true + ",userCanEditGroup:" + false + "}";
}
}
return "{groupIsDBBacked:" + groupIsDBBacked + ",userCanEditGroup:" + userCanEditGroup + "}";
}
use of ubic.gemma.model.expression.experiment.SessionBoundExpressionExperimentSetValueObject in project Gemma by PavlidisLab.
the class ExpressionExperimentSetController method addUserAndSessionGroups.
/**
* AJAX adds the experiment group to the session
*
* @return the new gene groups
*/
public Collection<ExpressionExperimentSetValueObject> addUserAndSessionGroups(Collection<ExpressionExperimentSetValueObject> sets) {
Collection<ExpressionExperimentSetValueObject> result = new HashSet<>();
Collection<SessionBoundExpressionExperimentSetValueObject> sessionResult = new HashSet<>();
for (ExpressionExperimentSetValueObject eesvo : sets) {
if (eesvo instanceof SessionBoundExpressionExperimentSetValueObject) {
sessionResult.add((SessionBoundExpressionExperimentSetValueObject) eesvo);
} else {
result.add(eesvo);
}
}
result = this.create(result);
result.addAll(this.addSessionGroups(sessionResult, true));
return result;
}
Aggregations