use of org.isisaddons.module.excel.dom.WorksheetSpec 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);
}
use of org.isisaddons.module.excel.dom.WorksheetSpec 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);
}
use of org.isisaddons.module.excel.dom.WorksheetSpec in project estatio by estatio.
the class OrderInvoiceImportForDemoXlsxFixture method execute.
@Override
protected void execute(final ExecutionContext executionContext) {
setExcelResource(Resources.getResource(getClass(), "OrderInvoiceImportForDemo.xlsx"));
setMatcher(sheetName -> {
if (sheetName.startsWith("OXFORD")) {
return new WorksheetSpec(rowFactoryFor(OrderInvoiceImportHandler.class, executionContext), sheetName, Mode.RELAXED);
} else {
return null;
}
});
super.execute(executionContext);
for (FixtureResult result : executionContext.getResults()) {
if (result.getClassName().equals(OrderInvoiceLine.class.getName())) {
OrderInvoiceLine line = (OrderInvoiceLine) result.getObject();
OrderInvoiceLine._apply applyMixin = factoryService.mixin(OrderInvoiceLine._apply.class, line);
if (applyMixin.disableAct() == null) {
applyMixin.act();
}
}
}
}
use of org.isisaddons.module.excel.dom.WorksheetSpec in project estatio by estatio.
the class CapexChargeHierarchyXlsxFixture method execute.
@Override
protected void execute(final ExecutionContext executionContext) {
Charge before = chargeRepository.findByReference("WORKS");
List<Charge> beforeAll = chargeRepository.listAll();
setExcelResource(Resources.getResource(getClass(), "CapexChargeHierarchy.xlsx"));
setMatcher(sheetName -> {
if (sheetName.startsWith("ChargeHierarchy")) {
return new WorksheetSpec(rowFactoryFor(IncomingChargeHandler.class, executionContext), sheetName, Mode.STRICT);
} else {
return null;
}
});
super.execute(executionContext);
Charge after = chargeRepository.findByReference("WORKS");
List<Charge> afterAll = chargeRepository.listAll();
}
use of org.isisaddons.module.excel.dom.WorksheetSpec 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);
}
Aggregations