use of org.jbei.ice.lib.entry.sequence.SequenceAnalysisController in project ice by JBEI.
the class EntryController method deleteTraceSequence.
public boolean deleteTraceSequence(String userId, long entryId, long traceId) {
Entry entry = dao.get(entryId);
if (entry == null)
return false;
TraceSequenceDAO traceSequenceDAO = DAOFactory.getTraceSequenceDAO();
TraceSequence traceSequence = traceSequenceDAO.get(traceId);
if (traceSequence == null || !canEdit(userId, traceSequence.getDepositor(), entry))
return false;
try {
new SequenceAnalysisController().removeTraceSequence(traceSequence);
} catch (Exception e) {
Logger.error(e);
return false;
}
return true;
}
use of org.jbei.ice.lib.entry.sequence.SequenceAnalysisController in project ice by JBEI.
the class FileResource method getTraceSequenceFile.
@GET
@Path("trace/{fileId}")
public Response getTraceSequenceFile(@PathParam("fileId") String fileId, @QueryParam("sid") String sid) {
final SequenceAnalysisController sequenceAnalysisController = new SequenceAnalysisController();
final TraceSequence traceSequence = sequenceAnalysisController.getTraceSequenceByFileId(fileId);
if (traceSequence != null) {
final File file = sequenceAnalysisController.getFile(traceSequence);
return addHeaders(Response.ok(file), traceSequence.getFilename());
}
return Response.serverError().build();
}
use of org.jbei.ice.lib.entry.sequence.SequenceAnalysisController in project ice by JBEI.
the class EntryController method deleteShotgunSequence.
public boolean deleteShotgunSequence(String userId, long entryId, long shotgunId) {
Entry entry = dao.get(entryId);
if (entry == null)
return false;
ShotgunSequenceDAO shotgunSequenceDAO = DAOFactory.getShotgunSequenceDAO();
ShotgunSequence shotgunSequence = shotgunSequenceDAO.get(shotgunId);
if (shotgunSequence == null || !canEdit(userId, shotgunSequence.getDepositor(), entry))
return false;
try {
new SequenceAnalysisController().removeShotgunSequence(shotgunSequence);
} catch (Exception e) {
Logger.error(e);
return false;
}
return true;
}
Aggregations