Search in sources :

Example 6 with Bookmark

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;
}
Also used : Bookmark(org.apache.isis.applib.services.bookmark.Bookmark) Programmatic(org.apache.isis.applib.annotation.Programmatic)

Example 7 with Bookmark

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;
}
Also used : Bookmark(org.apache.isis.applib.services.bookmark.Bookmark) Taxonomy(org.incode.module.classification.dom.impl.category.taxonomy.Taxonomy) Programmatic(org.apache.isis.applib.annotation.Programmatic)

Example 8 with Bookmark

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);
}
Also used : Bookmark(org.apache.isis.applib.services.bookmark.Bookmark)

Example 9 with 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;
}
Also used : Bookmark(org.apache.isis.applib.services.bookmark.Bookmark) Document(org.incode.module.document.dom.impl.docs.Document) ParamDto(org.apache.isis.schema.cmd.v1.ParamDto)

Example 10 with Bookmark

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));
}
Also used : Bookmark(org.apache.isis.applib.services.bookmark.Bookmark) Programmatic(org.apache.isis.applib.annotation.Programmatic)

Aggregations

Bookmark (org.apache.isis.applib.services.bookmark.Bookmark)16 Programmatic (org.apache.isis.applib.annotation.Programmatic)9 Document (org.incode.module.document.dom.impl.docs.Document)3 List (java.util.List)1 ParamDto (org.apache.isis.schema.cmd.v1.ParamDto)1 Property (org.estatio.module.asset.dom.Property)1 IncomingDocAsInvoiceViewModel (org.estatio.module.capex.app.invoice.IncomingDocAsInvoiceViewModel)1 IncomingDocAsOrderViewModel (org.estatio.module.capex.app.order.IncomingDocAsOrderViewModel)1 Taxonomy (org.incode.module.classification.dom.impl.category.taxonomy.Taxonomy)1 FinderInteraction (org.incode.module.unittestsupport.dom.repo.FinderInteraction)1 ApplicationTenancy (org.isisaddons.module.security.dom.tenancy.ApplicationTenancy)1 Expectations (org.jmock.Expectations)1 Before (org.junit.Before)1