use of org.jbei.ice.storage.model.ManuscriptModel in project ice by JBEI.
the class Manuscripts method add.
public Manuscript add(Manuscript manuscript) {
// todo : validation
ManuscriptModel model = new ManuscriptModel();
model.setCreationTime(new Date());
model.setStatus(manuscript.getStatus());
model.setParagonUrl(manuscript.getParagonUrl());
model.setTitle(manuscript.getTitle());
model.setAuthorFirstName(manuscript.getAuthorFirstName());
model.setAuthorLastName(manuscript.getAuthorLastName());
FolderDetails details = manuscript.getFolder();
Folder folder = DAOFactory.getFolderDAO().get(details.getId());
model.setFolder(folder);
return dao.create(model).toDataTransferObject();
}
use of org.jbei.ice.storage.model.ManuscriptModel in project ice by JBEI.
the class Manuscripts method generateZip.
public Manuscript generateZip(long id) {
ManuscriptModel model = dao.get(id);
if (model == null)
return null;
// get folder
List<Long> entryIds = this.folderDAO.getFolderContentIds(model.getFolder().getId(), null, true);
EntriesAsCSV entriesAsCSV = new EntriesAsCSV("GENBANK", "SBOL2");
entriesAsCSV.setEntries(this.userId, entryIds);
Manuscript manuscript = model.toDataTransferObject();
manuscript.setZipFileName(entriesAsCSV.getFilePath().getFileName().toString());
return manuscript;
}
Aggregations