Search in sources :

Example 21 with Programmatic

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

the class DocumentTemplate method withFileSuffix.

// endregion
// region > withFileSuffix (programmatic)
@Programmatic
public String withFileSuffix(final String documentName) {
    final String suffix = getFileSuffix();
    final int lastPeriod = suffix.lastIndexOf(".");
    final String suffixNoDot = suffix.substring(lastPeriod + 1);
    final String suffixWithDot = "." + suffixNoDot;
    if (documentName.endsWith(suffixWithDot)) {
        return trim(documentName, NameType.Meta.MAX_LEN);
    } else {
        return StringUtils.stripEnd(trim(documentName, NameType.Meta.MAX_LEN - suffixWithDot.length()), ".") + suffixWithDot;
    }
}
Also used : TranslatableString(org.apache.isis.applib.services.i18n.TranslatableString) Programmatic(org.apache.isis.applib.annotation.Programmatic)

Example 22 with Programmatic

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

the class DocumentTemplate method newAttachmentAdvice.

@Programmatic
public List<AttachmentAdvisor.PaperclipSpec> newAttachmentAdvice(final Document document, final Object domainObject) {
    final AttachmentAdvisor attachmentAdvisor = newAttachmentAdvisor(domainObject);
    if (attachmentAdvisor == null) {
        throw new IllegalStateException(String.format("For domain template %s, could not locate Applicability for domain object: %s", getName(), domainObject.getClass().getName()));
    }
    final List<AttachmentAdvisor.PaperclipSpec> paperclipSpecs = attachmentAdvisor.advise(this, domainObject, document);
    return paperclipSpecs;
}
Also used : AttachmentAdvisor(org.incode.module.document.dom.impl.applicability.AttachmentAdvisor) Programmatic(org.apache.isis.applib.annotation.Programmatic)

Example 23 with Programmatic

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

the class DocumentTemplate method createDocumentUsingRendererModel.

// endregion
// region > createDocument (programmatic)
@Programmatic
public Document createDocumentUsingRendererModel(final Object domainObject) {
    final Object rendererModel = newRendererModel(domainObject);
    final String documentName = determineDocumentName(rendererModel);
    return createDocument(documentName);
}
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 24 with Programmatic

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

the class RenderingStrategy method newRenderer.

// endregion
// region > newRenderer (programmatic)
@Programmatic
public Renderer newRenderer() {
    final Renderer renderer = (Renderer) classService.instantiate(getRendererClassName());
    serviceRegistry2.injectServicesInto(renderer);
    return renderer;
}
Also used : Renderer(org.incode.module.document.dom.impl.renderers.Renderer) Programmatic(org.apache.isis.applib.annotation.Programmatic)

Example 25 with Programmatic

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

the class RenderingStrategyRepository method create.

@Programmatic
public RenderingStrategy create(final String reference, final String name, final DocumentNature inputNature, final DocumentNature outputNature, final Class<? extends Renderer> rendererClass) {
    final RenderingStrategy renderingStrategy = new RenderingStrategy(reference, name, inputNature, outputNature, rendererClass);
    repositoryService.persist(renderingStrategy);
    return renderingStrategy;
}
Also used : QRenderingStrategy(org.incode.module.document.dom.impl.rendering.QRenderingStrategy) 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