Search in sources :

Example 1 with WorksheetContent

use of org.isisaddons.module.excel.dom.WorksheetContent in project estatio by estatio.

the class PaymentLineDownloadManager method downloadToExcel.

@Action(semantics = SemanticsOf.SAFE)
public Blob downloadToExcel(final String fileName) {
    final List<PaymentLineExportV1> exportV1s = getPayments().stream().map(x -> new PaymentLineExportV1(x)).collect(Collectors.toList());
    WorksheetSpec spec = new WorksheetSpec(exportClass, "invoiceExport");
    WorksheetContent worksheetContent = new WorksheetContent(exportV1s, spec);
    return excelService.toExcel(worksheetContent, fileName);
}
Also used : Action(org.apache.isis.applib.annotation.Action) Nature(org.apache.isis.applib.annotation.Nature) Setter(lombok.Setter) Getter(lombok.Getter) PaymentLineRepository(org.estatio.module.capex.dom.payment.PaymentLineRepository) PromptStyle(org.apache.isis.applib.annotation.PromptStyle) Collectors(java.util.stream.Collectors) MemberOrder(org.apache.isis.applib.annotation.MemberOrder) Programmatic(org.apache.isis.applib.annotation.Programmatic) PropertyLayout(org.apache.isis.applib.annotation.PropertyLayout) LocalDate(org.joda.time.LocalDate) ActionLayout(org.apache.isis.applib.annotation.ActionLayout) CollectionLayout(org.apache.isis.applib.annotation.CollectionLayout) SemanticsOf(org.apache.isis.applib.annotation.SemanticsOf) PaymentLine(org.estatio.module.capex.dom.payment.PaymentLine) List(java.util.List) WorksheetContent(org.isisaddons.module.excel.dom.WorksheetContent) DomainObject(org.apache.isis.applib.annotation.DomainObject) WorksheetSpec(org.isisaddons.module.excel.dom.WorksheetSpec) Contributed(org.apache.isis.applib.annotation.Contributed) ExcelService(org.isisaddons.module.excel.dom.ExcelService) Blob(org.apache.isis.applib.value.Blob) NoArgsConstructor(lombok.NoArgsConstructor) WorksheetSpec(org.isisaddons.module.excel.dom.WorksheetSpec) WorksheetContent(org.isisaddons.module.excel.dom.WorksheetContent) Action(org.apache.isis.applib.annotation.Action)

Example 2 with WorksheetContent

use of org.isisaddons.module.excel.dom.WorksheetContent in project estatio by estatio.

the class Lease_DownloadBudgetCalculationsForLease method downloadBudgetCalculationsForLease.

@Action(semantics = SemanticsOf.SAFE)
@ActionLayout(cssClassFa = "fa-download")
@MemberOrder(name = "budgetCalculationRuns", sequence = "1")
public Blob downloadBudgetCalculationsForLease(Budget budget, BudgetCalculationType type) {
    final String fileName = lease.getReference() + " - budget details" + ".xlsx";
    WorksheetSpec spec = new WorksheetSpec(DetailedCalculationResultViewmodel.class, "values for lease");
    WorksheetContent worksheetContent = new WorksheetContent(budgetAssignmentService.getDetailedCalculationResults(lease, budget, type), spec);
    return excelService.toExcelPivot(worksheetContent, fileName);
}
Also used : WorksheetSpec(org.isisaddons.module.excel.dom.WorksheetSpec) WorksheetContent(org.isisaddons.module.excel.dom.WorksheetContent) Action(org.apache.isis.applib.annotation.Action) MemberOrder(org.apache.isis.applib.annotation.MemberOrder) ActionLayout(org.apache.isis.applib.annotation.ActionLayout)

Example 3 with WorksheetContent

use of org.isisaddons.module.excel.dom.WorksheetContent in project estatio by estatio.

the class BudgetImportExportManager method exportBudget.

@Action(semantics = SemanticsOf.SAFE)
@ActionLayout(cssClassFa = "fa-download")
public Blob exportBudget() {
    final String fileName = withExtension(getFileName(), ".xlsx");
    WorksheetSpec spec1 = new WorksheetSpec(BudgetImportExport.class, "budget");
    WorksheetSpec spec2 = new WorksheetSpec(KeyItemImportExportLineItem.class, "keyItems");
    WorksheetSpec spec3 = new WorksheetSpec(BudgetOverrideImportExport.class, "overrides");
    WorksheetSpec spec4 = new WorksheetSpec(ChargeImport.class, "charges");
    WorksheetContent worksheetContent = new WorksheetContent(getLines(), spec1);
    WorksheetContent keyItemsContent = new WorksheetContent(getKeyItemLines(), spec2);
    WorksheetContent overridesContent = new WorksheetContent(getOverrides(), spec3);
    WorksheetContent chargesContent = new WorksheetContent(getCharges(), spec4);
    return excelService.toExcel(Arrays.asList(worksheetContent, keyItemsContent, overridesContent, chargesContent), fileName);
}
Also used : WorksheetSpec(org.isisaddons.module.excel.dom.WorksheetSpec) WorksheetContent(org.isisaddons.module.excel.dom.WorksheetContent) Action(org.apache.isis.applib.annotation.Action) ActionLayout(org.apache.isis.applib.annotation.ActionLayout)

Example 4 with WorksheetContent

use of org.isisaddons.module.excel.dom.WorksheetContent in project estatio by estatio.

the class Budget_DownloadCalculations method downloadCalculations.

@Action(semantics = SemanticsOf.SAFE)
@ActionLayout(cssClassFa = "fa-download")
public Blob downloadCalculations() {
    final String fileName = budget.title() + ".xlsx";
    WorksheetSpec spec = new WorksheetSpec(CalculationResultViewModel.class, "values");
    WorksheetContent worksheetContent = new WorksheetContent(budgetAssignmentService.getCalculationResults(budget), spec);
    return excelService.toExcelPivot(worksheetContent, fileName);
}
Also used : WorksheetSpec(org.isisaddons.module.excel.dom.WorksheetSpec) WorksheetContent(org.isisaddons.module.excel.dom.WorksheetContent) Action(org.apache.isis.applib.annotation.Action) ActionLayout(org.apache.isis.applib.annotation.ActionLayout)

Example 5 with WorksheetContent

use of org.isisaddons.module.excel.dom.WorksheetContent in project estatio by estatio.

the class CodaMappingManager method downloadToExcel.

@Action(semantics = SemanticsOf.SAFE)
@MemberOrder(name = "mappings", sequence = "1")
public Blob downloadToExcel(final String fileName) {
    final List<CodaMappingImport> exports = getMappings().stream().map(x -> new CodaMappingImport(x)).collect(Collectors.toList());
    WorksheetSpec spec = new WorksheetSpec(CodaMappingImport.class, SHEET_NAME);
    WorksheetContent worksheetContent = new WorksheetContent(exports, spec);
    return excelService.toExcel(worksheetContent, fileName);
}
Also used : Action(org.apache.isis.applib.annotation.Action) Nature(org.apache.isis.applib.annotation.Nature) CodaMappingRepository(org.estatio.module.capex.dom.coda.CodaMappingRepository) Collectors(java.util.stream.Collectors) MemberOrder(org.apache.isis.applib.annotation.MemberOrder) Inject(javax.inject.Inject) ActionLayout(org.apache.isis.applib.annotation.ActionLayout) CollectionLayout(org.apache.isis.applib.annotation.CollectionLayout) SemanticsOf(org.apache.isis.applib.annotation.SemanticsOf) List(java.util.List) WorksheetContent(org.isisaddons.module.excel.dom.WorksheetContent) DomainObject(org.apache.isis.applib.annotation.DomainObject) CodaMapping(org.estatio.module.capex.dom.coda.CodaMapping) WorksheetSpec(org.isisaddons.module.excel.dom.WorksheetSpec) Contributed(org.apache.isis.applib.annotation.Contributed) Parameter(org.apache.isis.applib.annotation.Parameter) Publishing(org.apache.isis.applib.annotation.Publishing) ExcelService(org.isisaddons.module.excel.dom.ExcelService) Blob(org.apache.isis.applib.value.Blob) WorksheetSpec(org.isisaddons.module.excel.dom.WorksheetSpec) WorksheetContent(org.isisaddons.module.excel.dom.WorksheetContent) Action(org.apache.isis.applib.annotation.Action) MemberOrder(org.apache.isis.applib.annotation.MemberOrder)

Aggregations

Action (org.apache.isis.applib.annotation.Action)8 WorksheetContent (org.isisaddons.module.excel.dom.WorksheetContent)8 WorksheetSpec (org.isisaddons.module.excel.dom.WorksheetSpec)8 ActionLayout (org.apache.isis.applib.annotation.ActionLayout)7 MemberOrder (org.apache.isis.applib.annotation.MemberOrder)4 List (java.util.List)2 Collectors (java.util.stream.Collectors)2 CollectionLayout (org.apache.isis.applib.annotation.CollectionLayout)2 Contributed (org.apache.isis.applib.annotation.Contributed)2 DomainObject (org.apache.isis.applib.annotation.DomainObject)2 Nature (org.apache.isis.applib.annotation.Nature)2 SemanticsOf (org.apache.isis.applib.annotation.SemanticsOf)2 Blob (org.apache.isis.applib.value.Blob)2 ExcelService (org.isisaddons.module.excel.dom.ExcelService)2 Inject (javax.inject.Inject)1 Getter (lombok.Getter)1 NoArgsConstructor (lombok.NoArgsConstructor)1 Setter (lombok.Setter)1 Parameter (org.apache.isis.applib.annotation.Parameter)1 Programmatic (org.apache.isis.applib.annotation.Programmatic)1