use of org.apache.isis.applib.annotation.Action in project estatio by estatio.
the class FixedAssetRole method delete.
@Action(semantics = SemanticsOf.NON_IDEMPOTENT_ARE_YOU_SURE)
public FixedAsset delete() {
FixedAsset fa = getAsset();
remove(this);
return fa;
}
use of org.apache.isis.applib.annotation.Action in project estatio by estatio.
the class EstatioFixtureScripts method createRetroInvoicesForProperty.
@Action(restrictTo = RestrictTo.PROTOTYPING)
@MemberOrder(sequence = "2")
public List<FixtureResult> createRetroInvoicesForProperty(final Property property, @ParameterLayout(named = "Start due date") final LocalDate startDueDate, @Parameter(optionality = Optionality.OPTIONAL) @ParameterLayout(named = "Nextdue date") final LocalDate nextDueDate) {
final CreateRetroInvoices creator = container.newTransientInstance(CreateRetroInvoices.class);
final FixtureScript.ExecutionContext executionContext = fixtureScripts.newExecutionContext(null);
creator.createProperty(property, startDueDate, nextDueDate, executionContext);
return executionContext.getResults();
}
use of org.apache.isis.applib.annotation.Action in project estatio by estatio.
the class IndexValuesMaintenanceMenu method uploadIndexValues.
// //////////////////////////////////////
@Action(publishing = Publishing.DISABLED, semantics = SemanticsOf.IDEMPOTENT)
@MemberOrder(sequence = "2")
public List<IndexValueMaintLineItem> uploadIndexValues(@Parameter(fileAccept = ".xlsx") @ParameterLayout(named = "Excel spreadsheet") final Blob spreadsheet, final Country country) {
final ApplicationTenancy applicationTenancy = estatioApplicationTenancyRepository.findOrCreateTenancyFor(country);
List<IndexValueMaintLineItem> lineItems = excelService.fromExcel(spreadsheet, IndexValueMaintLineItem.class, IndexValueMaintLineItem.class.getSimpleName());
for (IndexValueMaintLineItem lineItem : lineItems) {
lineItem.setAtPath(applicationTenancy.getPath());
}
return lineItems;
}
use of org.apache.isis.applib.annotation.Action in project estatio by estatio.
the class Guarantee method remove.
@Action(semantics = SemanticsOf.NON_IDEMPOTENT_ARE_YOU_SURE)
public void remove(final String reason) {
remove(this);
final FinancialAccount financialAccount = getFinancialAccount();
this.setFinancialAccount(null);
if (financialAccount != null) {
financialAccount.remove(reason);
}
}
use of org.apache.isis.applib.annotation.Action in project estatio by estatio.
the class Communication method sendByEmail.
// so can invoke via BackgroundService
@Action(hidden = Where.EVERYWHERE)
public Communication sendByEmail() {
// body...
final Document coverNoteDoc = findDocument(DocumentConstants.PAPERCLIP_ROLE_COVER);
final String emailBody = coverNoteDoc.asChars();
// (email) attachments..
// this corresponds to the primary document and any attachments
final List<DataSource> attachments = Lists.newArrayList();
final Document primaryDocument = getPrimaryDocument();
if (primaryDocument != null) {
// should be the case
attachments.add(primaryDocument.asDataSource());
}
attachments.addAll(findDocumentsInRoleAsStream(DocumentConstants.PAPERCLIP_ROLE_ATTACHMENT).map(DocumentAbstract::asDataSource).collect(Collectors.toList()));
// cc..
final List<String> toList = findCorrespondents(CommChannelRoleType.TO);
final List<String> ccList = findCorrespondents(CommChannelRoleType.CC);
final List<String> bccList = findCorrespondents(CommChannelRoleType.BCC);
// subject ...
final String subject = getSubject();
// finally, we send
final boolean send = emailService.send(toList, ccList, bccList, subject, emailBody, attachments.toArray(new DataSource[] {}));
if (!send) {
throw new ApplicationException("Failed to send email; see system logs for details.");
}
// mark this comm as having been sent.
sent();
return this;
}
Aggregations