Search in sources :

Example 66 with Programmatic

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

the class CommunicationRepository method createPostal.

@Programmatic
public Communication createPostal(final String subject, final String atPath, final PostalAddress to) {
    final DateTime createdAt = clockService.nowAsDateTime();
    final Communication communication = Communication.newPostal(atPath, subject, createdAt);
    serviceRegistry2.injectServicesInto(communication);
    communication.addCorrespondent(CommChannelRoleType.TO, to);
    repositoryService.persist(communication);
    return communication;
}
Also used : DateTime(org.joda.time.DateTime) Programmatic(org.apache.isis.applib.annotation.Programmatic)

Example 67 with Programmatic

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

the class DocumentService method createAndAttachDocumentForBlob.

/**
 * @param documentName - override the name of the blob (if null, then uses the blob's name)
 */
@Programmatic
public Document createAndAttachDocumentForBlob(final DocumentType documentType, final String documentAtPath, String documentName, final Blob blob, final String paperclipRoleName, final Object paperclipAttachTo) {
    final Document document = createForBlob(documentType, documentAtPath, documentName, blob);
    paperclipRepository.attach(document, paperclipRoleName, paperclipAttachTo);
    return document;
}
Also used : Document(org.incode.module.document.dom.impl.docs.Document) Programmatic(org.apache.isis.applib.annotation.Programmatic)

Example 68 with Programmatic

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

the class DocFragmentService method render.

/**
 * Overload of {@link #render(Object, String)}, but allowing the atPath to be specified explicitly rather than inferred from the supplied domain object.
 *
 * @param domainObject provides the state for the interpolation into the fragment's {@link DocFragment#getTemplateText() template text}
 * @param name corresponds to the {@link DocFragment#getName() name} of the {@link DocFragment} to use to render.
 * @param atPath corrsponds to the {@link ApplicationTenancyService#atPathFor(Object) atPath} of the {@link DocFragment} to use to render
 *
 * @throws IOException
 * @throws TemplateException
 * @throws RenderException - if could not locate any {@link DocFragment}.
 */
@Programmatic
public String render(final Object domainObject, final String name, final String atPath) throws IOException, TemplateException, RenderException {
    final String objectType = objectTypeFor(domainObject);
    final DocFragment fragment = repo.findByObjectTypeAndNameAndApplicableToAtPath(objectType, name, atPath);
    if (fragment != null)
        return fragment.render(domainObject);
    else
        throw new RenderException("No fragment found for objectType: %s, name: %s, atPath: %s", objectType, name, atPath);
}
Also used : DocFragment(org.incode.module.docfragment.dom.impl.DocFragment) Programmatic(org.apache.isis.applib.annotation.Programmatic)

Example 69 with Programmatic

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

the class CommChannelRole method getId.

// endregion
// region > id (programmatic, for comparison)
@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) TranslatableString(org.apache.isis.applib.services.i18n.TranslatableString) Programmatic(org.apache.isis.applib.annotation.Programmatic)

Example 70 with Programmatic

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

the class BudgetItem method createCopyFor.

@Programmatic
public BudgetItem createCopyFor(final Budget budget) {
    // only copies of budgeted values are made
    BudgetItem newBudgetItemCopy = budget.newBudgetItem(getBudgetedValue(), getCharge());
    for (PartitionItem partitionItem : partitionItemRepository.findByBudgetItem(this)) {
        // only copies of budgeted items are made
        if (partitionItem.getPartitioning().getType() == BudgetCalculationType.BUDGETED) {
            String keyTableName = partitionItem.getKeyTable().getName();
            KeyTable correspondingTableOnbudget = keyTableRepository.findByBudgetAndName(budget, keyTableName);
            newBudgetItemCopy.createPartitionItemForBudgeting(partitionItem.getCharge(), correspondingTableOnbudget, partitionItem.getPercentage());
        }
    }
    return newBudgetItemCopy;
}
Also used : KeyTable(org.estatio.module.budget.dom.keytable.KeyTable) PartitionItem(org.estatio.module.budget.dom.partioning.PartitionItem) 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