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;
}
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;
}
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;
}
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;
}
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;
}
Aggregations