Search in sources :

Example 1 with SequenceAnalysisController

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;
}
Also used : SequenceAnalysisController(org.jbei.ice.lib.entry.sequence.SequenceAnalysisController) DAOException(org.jbei.ice.storage.DAOException) PermissionException(org.jbei.ice.lib.access.PermissionException)

Example 2 with SequenceAnalysisController

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();
}
Also used : TraceSequence(org.jbei.ice.storage.model.TraceSequence) SequenceAnalysisController(org.jbei.ice.lib.entry.sequence.SequenceAnalysisController)

Example 3 with SequenceAnalysisController

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;
}
Also used : SequenceAnalysisController(org.jbei.ice.lib.entry.sequence.SequenceAnalysisController) DAOException(org.jbei.ice.storage.DAOException) PermissionException(org.jbei.ice.lib.access.PermissionException)

Aggregations

SequenceAnalysisController (org.jbei.ice.lib.entry.sequence.SequenceAnalysisController)3 PermissionException (org.jbei.ice.lib.access.PermissionException)2 DAOException (org.jbei.ice.storage.DAOException)2 TraceSequence (org.jbei.ice.storage.model.TraceSequence)1