Search in sources :

Example 51 with Programmatic

use of org.apache.isis.applib.annotation.Programmatic in project estatio by estatio.

the class NumeratorRepository method findNumerator.

@Programmatic
public Numerator findNumerator(final String numeratorName, final Object scopedToIfAny, final ApplicationTenancy applicationTenancy) {
    if (scopedToIfAny == null) {
        return firstMatch("findByNameAndApplicationTenancyPath", "name", numeratorName, "applicationTenancyPath", applicationTenancy == null ? "/" : applicationTenancy.getPath());
    } else {
        final Bookmark bookmark = getBookmarkService().bookmarkFor(scopedToIfAny);
        final String objectType = bookmark.getObjectType();
        final String objectIdentifier = bookmark.getIdentifier();
        return firstMatch("findByNameAndObjectTypeAndObjectIdentifierAndApplicationTenancyPath", "name", numeratorName, "objectType", objectType, "objectIdentifier", objectIdentifier, "applicationTenancyPath", applicationTenancy == null ? "/" : applicationTenancy.getPath());
    }
}
Also used : Bookmark(org.apache.isis.applib.services.bookmark.Bookmark) Programmatic(org.apache.isis.applib.annotation.Programmatic)

Example 52 with Programmatic

use of org.apache.isis.applib.annotation.Programmatic in project estatio by estatio.

the class CommunicationChannel method getId.

// //////////////////////////////////////
@Programmatic
public String getId() {
    Object objectId = JDOHelper.getObjectId(this);
    if (objectId == null) {
        return "";
    }
    String objectIdStr = objectId.toString();
    final String id = objectIdStr.split("\\[OID\\]")[0];
    return id;
}
Also used : DomainObject(org.apache.isis.applib.annotation.DomainObject) Programmatic(org.apache.isis.applib.annotation.Programmatic)

Example 53 with Programmatic

use of org.apache.isis.applib.annotation.Programmatic 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 54 with Programmatic

use of org.apache.isis.applib.annotation.Programmatic in project estatio by estatio.

the class CategoryRepository method createTaxonomy.

// endregion
// region > createTaxonomy (programmatic)
@Programmatic
public Taxonomy createTaxonomy(final String name) {
    final Taxonomy taxonomy = new Taxonomy(name);
    repositoryService.persistAndFlush(taxonomy);
    taxonomy.setTaxonomy(taxonomy);
    return taxonomy;
}
Also used : Taxonomy(org.incode.module.classification.dom.impl.category.taxonomy.Taxonomy) Programmatic(org.apache.isis.applib.annotation.Programmatic)

Example 55 with Programmatic

use of org.apache.isis.applib.annotation.Programmatic 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)

Aggregations

Programmatic (org.apache.isis.applib.annotation.Programmatic)162 Party (org.estatio.module.party.dom.Party)21 Lease (org.estatio.module.lease.dom.Lease)16 DomainObject (org.apache.isis.applib.annotation.DomainObject)11 BankAccount (org.estatio.module.financial.dom.BankAccount)11 Charge (org.estatio.module.charge.dom.Charge)10 ApplicationTenancy (org.isisaddons.module.security.dom.tenancy.ApplicationTenancy)10 LocalDate (org.joda.time.LocalDate)10 BigDecimal (java.math.BigDecimal)9 Bookmark (org.apache.isis.applib.services.bookmark.Bookmark)9 ApplicationException (org.apache.isis.applib.ApplicationException)8 Property (org.estatio.module.asset.dom.Property)8 CommunicationChannel (org.incode.module.communications.dom.impl.commchannel.CommunicationChannel)8 ArrayList (java.util.ArrayList)7 TranslatableString (org.apache.isis.applib.services.i18n.TranslatableString)7 InvoiceItem (org.estatio.module.invoice.dom.InvoiceItem)7 LeaseItem (org.estatio.module.lease.dom.LeaseItem)7 Inject (javax.inject.Inject)6 Unit (org.estatio.module.asset.dom.Unit)6 Document (org.incode.module.document.dom.impl.docs.Document)6