Search in sources :

Example 6 with MemberOrder

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

the class T_createAndAttachDocumentAndScheduleRender method $$.

/**
 * Create a {@link Document} and attach using a {@link Paperclip}.
 */
@Action(domainEvent = ActionDomainEvent.class, semantics = SemanticsOf.NON_IDEMPOTENT)
@ActionLayout(contributed = Contributed.AS_ACTION)
@MemberOrder(name = "documents", sequence = "3.2")
public Object $$(final DocumentTemplate template) throws IOException {
    final Document document = documentCreatorService.createDocumentAndAttachPaperclips(domainObject, template);
    render(template, document);
    return document;
}
Also used : Document(org.incode.module.document.dom.impl.docs.Document) Action(org.apache.isis.applib.annotation.Action) MemberOrder(org.apache.isis.applib.annotation.MemberOrder) ActionLayout(org.apache.isis.applib.annotation.ActionLayout)

Example 7 with MemberOrder

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

the class DemoInvoice_simulateRenderAsDoc method $$.

@Action(semantics = SemanticsOf.NON_IDEMPOTENT)
@ActionLayout(contributed = Contributed.AS_ACTION)
@MemberOrder(name = "documents", sequence = "1")
public Document $$(@Parameter(fileAccept = "application/pdf") final Blob document, @Parameter(optionality = Optionality.OPTIONAL) @ParameterLayout(named = "File name") final String fileName) throws IOException {
    String name = determineName(document, fileName);
    final DocumentType documentType = findDocumentType(DocumentType_and_DocumentTemplates_createSome.DOC_TYPE_REF_INVOICE);
    final Document receiptDoc = documentRepository.create(documentType, AT_PATH, name, document.getMimeType().getBaseType());
    // unlike documents that are generated from a template (where we call documentTemplate#render), in this case
    // we have the actual bytes; so we just set up the remaining state of the document manually.
    receiptDoc.setRenderedAt(clockService.nowAsDateTime());
    receiptDoc.setState(DocumentState.RENDERED);
    receiptDoc.setSort(DocumentSort.BLOB);
    receiptDoc.setBlobBytes(document.getBytes());
    paperclipRepository.attach(receiptDoc, ROLE_NAME, invoice);
    return receiptDoc;
}
Also used : DocumentType(org.incode.module.document.dom.impl.types.DocumentType) Document(org.incode.module.document.dom.impl.docs.Document) Action(org.apache.isis.applib.annotation.Action) MemberOrder(org.apache.isis.applib.annotation.MemberOrder) ActionLayout(org.apache.isis.applib.annotation.ActionLayout)

Example 8 with MemberOrder

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

the class OrganisationMenu method newOrganisation.

@Action(semantics = SemanticsOf.NON_IDEMPOTENT)
@MemberOrder(sequence = "1")
public Organisation newOrganisation(@Parameter(regexPattern = ReferenceType.Meta.REGEX, regexPatternReplacement = ReferenceType.Meta.REGEX_DESCRIPTION, optionality = Optionality.OPTIONAL) final String reference, final String name, final Country country, final List<IPartyRoleType> partyRoleTypes) {
    boolean useNumerator = Strings.isNullOrEmpty(reference);
    final Organisation organisation = organisationRepository.newOrganisation(reference, useNumerator, name, country);
    for (IPartyRoleType partyRoleType : partyRoleTypes) {
        partyRoleRepository.findOrCreate(organisation, partyRoleType);
    }
    return organisation;
}
Also used : IPartyRoleType(org.estatio.module.party.dom.role.IPartyRoleType) Organisation(org.estatio.module.party.dom.Organisation) Action(org.apache.isis.applib.annotation.Action) MemberOrder(org.apache.isis.applib.annotation.MemberOrder)

Example 9 with MemberOrder

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

the class Taxonomy method applicable.

@Action(domainEvent = ApplicableToDomainEvent.class)
@ActionLayout(cssClassFa = "fa-plus")
@MemberOrder(name = "appliesTo", sequence = "1")
public Category applicable(@ParameterLayout(named = "Application tenancy") final String atPath, @ParameterLayout(named = "Domain type") final String domainTypeName) {
    Applicability applicability = new Applicability(this, atPath, domainTypeName);
    repositoryService.persistAndFlush(applicability);
    return this;
}
Also used : Applicability(org.incode.module.classification.dom.impl.applicability.Applicability) Action(org.apache.isis.applib.annotation.Action) MemberOrder(org.apache.isis.applib.annotation.MemberOrder) ActionLayout(org.apache.isis.applib.annotation.ActionLayout)

Example 10 with MemberOrder

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

the class FixedAsset method addOwner.

@MemberOrder(name = "owners", sequence = "1")
public FixedAsset addOwner(final Party newOwner, final OwnershipType type) {
    FixedAssetOwnership fixedAssetOwnership = fixedAssetOwnershipRepository.newOwnership(newOwner, type, this);
    getOwners().add(fixedAssetOwnership);
    return this;
}
Also used : FixedAssetOwnership(org.estatio.module.asset.dom.ownership.FixedAssetOwnership) MemberOrder(org.apache.isis.applib.annotation.MemberOrder)

Aggregations

MemberOrder (org.apache.isis.applib.annotation.MemberOrder)34 Action (org.apache.isis.applib.annotation.Action)29 ActionLayout (org.apache.isis.applib.annotation.ActionLayout)15 Document (org.incode.module.document.dom.impl.docs.Document)5 WorksheetSpec (org.isisaddons.module.excel.dom.WorksheetSpec)4 ArrayList (java.util.ArrayList)3 WorksheetContent (org.isisaddons.module.excel.dom.WorksheetContent)3 ApplicationTenancy (org.isisaddons.module.security.dom.tenancy.ApplicationTenancy)3 Period (org.joda.time.Period)3 FixtureScript (org.apache.isis.applib.fixturescripts.FixtureScript)2 Order (org.estatio.module.capex.dom.order.Order)2 OrderItem (org.estatio.module.capex.dom.order.OrderItem)2 Lease (org.estatio.module.lease.dom.Lease)2 CreateRetroInvoices (org.estatio.module.lease.migrations.CreateRetroInvoices)2 LocalDateInterval (org.incode.module.base.dom.valuetypes.LocalDateInterval)2 DocumentType (org.incode.module.document.dom.impl.types.DocumentType)2 DateTime (org.joda.time.DateTime)2 LocalDate (org.joda.time.LocalDate)2 BigDecimal (java.math.BigDecimal)1 List (java.util.List)1