use of org.apache.isis.applib.services.bookmark.Bookmark in project estatio by estatio.
the class AliasRepository method create.
// endregion
// region > create (programmatic)
@Programmatic
public Alias create(final Object aliased, final String atPath, final AliasType aliasType, final String aliasReference) {
Class<? extends Alias> aliasSubtype = subtypeClassFor(aliased);
final Alias alias = repositoryService.instantiate(aliasSubtype);
alias.setAtPath(atPath);
alias.setAliasTypeId(aliasType.getId());
alias.setReference(aliasReference);
final Bookmark bookmark = bookmarkService.bookmarkFor(aliased);
alias.setAliased(aliased);
alias.setAliasedStr(bookmark.toString());
repositoryService.persist(alias);
return alias;
}
use of org.apache.isis.applib.services.bookmark.Bookmark in project estatio by estatio.
the class ClassificationRepository method create.
// endregion
// region > create (programmatic)
@Programmatic
public Classification create(final Category category, final Object classified) {
final Taxonomy taxonomy = category.getTaxonomy();
final Class<? extends Classification> subtype = subtypeClassFor(classified, taxonomy);
final Classification classification = repositoryService.instantiate(subtype);
classification.setCategory(category);
classification.setTaxonomy(taxonomy);
final Bookmark bookmark = bookmarkService.bookmarkFor(classified);
classification.setClassified(classified);
classification.setClassifiedStr(bookmark.toString());
repositoryService.persist(classification);
return classification;
}
use of org.apache.isis.applib.services.bookmark.Bookmark in project estatio by estatio.
the class PropertyOrderingViewModel method viewModelInit.
@Override
public void viewModelInit(final String memento) {
final Bookmark bookmark = bookmarkService.bookmarkFor(Property.class, memento);
this.property = (Property) bookmarkService.lookup(bookmark);
}
use of org.apache.isis.applib.services.bookmark.Bookmark in project estatio by estatio.
the class DeriveBlobFromReturnedDocumentAbstract method process.
@Override
public CommandDto process(final Command command, final CommandDto commandDto) {
final Bookmark result = command.getResult();
if (result == null) {
return commandDto;
}
try {
final Document document = bookmarkService.lookup(result, Document.class);
if (document != null) {
ParamDto paramDto = getParamDto(commandDto, paramNum);
CommonDtoUtils.setValueOn(paramDto, ValueType.BLOB, document.getBlob(), bookmarkService);
}
} catch (Exception ex) {
return commandDto;
}
return commandDto;
}
use of org.apache.isis.applib.services.bookmark.Bookmark in project estatio by estatio.
the class ClassificationRepository method findByClassified.
// region > findByClassified (programmatic)
@Programmatic
public List<Classification> findByClassified(final Object classifiable) {
final Bookmark bookmark = bookmarkService.bookmarkFor(classifiable);
final String classifiedStr = bookmark.toString();
return repositoryService.allMatches(new QueryDefault<>(Classification.class, "findByClassified", "classifiedStr", classifiedStr));
}
Aggregations