use of uk.ac.bbsrc.tgac.miso.core.data.impl.workset.WorksetCategory in project miso-lims by miso-lims.
the class Dtos method toWorksetCategory.
public static WorksetCategory toWorksetCategory(SimpleAliasableDto from) {
WorksetCategory to = new WorksetCategory();
setLong(to::setId, from.getId(), false);
setString(to::setAlias, from.getAlias());
return to;
}
use of uk.ac.bbsrc.tgac.miso.core.data.impl.workset.WorksetCategory in project miso-lims by miso-lims.
the class Dtos method to.
public static Workset to(@Nonnull WorksetDto from) {
Workset workset = new Workset();
setLong(workset::setId, from.getId(), false);
setString(workset::setAlias, from.getAlias());
setString(workset::setDescription, from.getDescription());
setObject(workset::setCategory, WorksetCategory::new, from.getCategoryId());
setObject(workset::setStage, WorksetStage::new, from.getStageId());
setWorksetItems(workset::setWorksetSamples, from.getSampleIds(), WorksetSample::new, SampleImpl::new);
setWorksetItems(workset::setWorksetLibraries, from.getLibraryIds(), WorksetLibrary::new, LibraryImpl::new);
setWorksetItems(workset::setWorksetLibraryAliquots, from.getLibraryAliquotIds(), WorksetLibraryAliquot::new, LibraryAliquot::new);
return workset;
}
use of uk.ac.bbsrc.tgac.miso.core.data.impl.workset.WorksetCategory in project miso-lims by miso-lims.
the class HibernateWorksetCategoryDaoIT method getCreateItem.
@Override
public WorksetCategory getCreateItem() {
WorksetCategory category = new WorksetCategory();
category.setAlias("Category C");
return category;
}
use of uk.ac.bbsrc.tgac.miso.core.data.impl.workset.WorksetCategory in project miso-lims by miso-lims.
the class ListWorksetsController method listWorksets.
@RequestMapping("/worksets")
public ModelAndView listWorksets(ModelMap model) throws IOException {
Stream<String> tabs = Stream.of(Workset.ReservedWord.MINE.getText(), Workset.ReservedWord.ALL.getText());
List<WorksetCategory> categories = worksetCategoryService.list();
if (!categories.isEmpty()) {
tabs = Stream.concat(tabs, categories.stream().map(WorksetCategory::getAlias).sorted());
tabs = Stream.concat(tabs, Stream.of(Workset.ReservedWord.UNCATEGORIZED.getText()));
}
return new TabbedListItemsPage("workset", "category", tabs, (t1, t2) -> 1, Function.identity(), String::toLowerCase).list(model);
}
Aggregations