Search in sources :

Example 1 with TraceSequenceAnalysis

use of org.jbei.ice.lib.dto.entry.TraceSequenceAnalysis in project ice by JBEI.

the class PartTraceSequences method getTraces.

public Results<TraceSequenceAnalysis> getTraces(int start, int limit) {
    entryAuthorization.expectRead(userId, entry);
    List<TraceSequence> sequences = dao.getByEntry(entry, start, limit);
    Results<TraceSequenceAnalysis> results = new Results<>();
    if (sequences == null)
        return results;
    for (TraceSequence traceSequence : sequences) {
        TraceSequenceAnalysis analysis = traceSequence.toDataTransferObject();
        AccountTransfer accountTransfer = new AccountTransfer();
        String depositor = traceSequence.getDepositor();
        boolean canEdit = canEdit(userId, depositor, entry);
        analysis.setCanEdit(canEdit);
        Account account = DAOFactory.getAccountDAO().getByEmail(traceSequence.getDepositor());
        if (account != null) {
            accountTransfer.setFirstName(account.getFirstName());
            accountTransfer.setLastName(account.getLastName());
            accountTransfer.setEmail(account.getEmail());
            accountTransfer.setId(account.getId());
        }
        analysis.setDepositor(accountTransfer);
        results.getData().add(analysis);
    }
    // get count
    int count = dao.getCountByEntry(entry);
    results.setResultCount(count);
    return results;
}
Also used : TraceSequenceAnalysis(org.jbei.ice.lib.dto.entry.TraceSequenceAnalysis) Results(org.jbei.ice.lib.dto.common.Results) AccountTransfer(org.jbei.ice.lib.account.AccountTransfer)

Example 2 with TraceSequenceAnalysis

use of org.jbei.ice.lib.dto.entry.TraceSequenceAnalysis in project ice by JBEI.

the class TraceSequences method getTraces.

public Results<TraceSequenceAnalysis> getTraces(int start, int limit) {
    entryAuthorization.expectRead(userId, entry);
    List<TraceSequence> sequences = dao.getByEntry(entry, start, limit);
    Results<TraceSequenceAnalysis> results = new Results<>();
    if (sequences == null)
        return results;
    for (TraceSequence traceSequence : sequences) {
        TraceSequenceAnalysis analysis = traceSequence.toDataTransferObject();
        AccountTransfer accountTransfer = new AccountTransfer();
        String depositor = traceSequence.getDepositor();
        boolean canEdit = canEdit(userId, depositor, entry);
        analysis.setCanEdit(canEdit);
        Account account = DAOFactory.getAccountDAO().getByEmail(traceSequence.getDepositor());
        if (account != null) {
            accountTransfer.setFirstName(account.getFirstName());
            accountTransfer.setLastName(account.getLastName());
            accountTransfer.setEmail(account.getEmail());
            accountTransfer.setId(account.getId());
        }
        analysis.setDepositor(accountTransfer);
        results.getData().add(analysis);
    }
    // get count
    int count = dao.getCountByEntry(entry);
    results.setResultCount(count);
    return results;
}
Also used : TraceSequenceAnalysis(org.jbei.ice.lib.dto.entry.TraceSequenceAnalysis) Results(org.jbei.ice.lib.dto.common.Results) AccountTransfer(org.jbei.ice.lib.account.AccountTransfer)

Example 3 with TraceSequenceAnalysis

use of org.jbei.ice.lib.dto.entry.TraceSequenceAnalysis in project ice by JBEI.

the class TraceSequence method toDataTransferObject.

@Override
public TraceSequenceAnalysis toDataTransferObject() {
    TraceSequenceAnalysis info = new TraceSequenceAnalysis();
    info.setId(this.getId());
    info.setCreated(this.getCreationTime());
    info.setFilename(this.getFilename());
    info.setSequence(this.getSequence());
    if (this.getTraceSequenceAlignment() != null) {
        info.setTraceSequenceAlignment(this.getTraceSequenceAlignment().toDataTransferObject());
    }
    info.setFileId(this.getFileId());
    return info;
}
Also used : TraceSequenceAnalysis(org.jbei.ice.lib.dto.entry.TraceSequenceAnalysis)

Aggregations

TraceSequenceAnalysis (org.jbei.ice.lib.dto.entry.TraceSequenceAnalysis)3 AccountTransfer (org.jbei.ice.lib.account.AccountTransfer)2 Results (org.jbei.ice.lib.dto.common.Results)2