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;
}
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;
}
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;
}
Aggregations