Search in sources :

Example 21 with MemberOrder

use of org.apache.isis.applib.annotation.MemberOrder 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)

Example 22 with MemberOrder

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

the class KeyItemImportExportManager method importBlob.

// endregion
// region > import (action)
@Action(publishing = Publishing.DISABLED, semantics = SemanticsOf.IDEMPOTENT)
@ActionLayout(named = "Import", cssClassFa = "fa-upload")
@MemberOrder(name = "keyItems", sequence = "2")
public List<KeyItemImportExportLineItem> importBlob(@Parameter(fileAccept = ".xlsx") @ParameterLayout(named = "Excel spreadsheet") final Blob spreadsheet) {
    WorksheetSpec spec = new WorksheetSpec(KeyItemImportExportLineItem.class, "keyItems");
    List<KeyItemImportExportLineItem> lineItems = excelService.fromExcel(spreadsheet, spec);
    container.informUser(lineItems.size() + " items imported");
    List<KeyItemImportExportLineItem> newItems = new ArrayList<>();
    for (KeyItemImportExportLineItem item : lineItems) {
        item.validate();
        newItems.add(new KeyItemImportExportLineItem(item));
    }
    for (KeyItem keyItem : keyTable.getItems()) {
        Boolean keyItemFound = false;
        for (KeyItemImportExportLineItem lineItem : newItems) {
            if (lineItem.getUnitReference().equals(keyItem.getUnit().getReference())) {
                keyItemFound = true;
                break;
            }
        }
        if (!keyItemFound) {
            KeyItemImportExportLineItem deletedItem = new KeyItemImportExportLineItem(keyItem);
            deletedItem.setStatus(Status.DELETED);
            newItems.add(deletedItem);
        }
    }
    return newItems;
}
Also used : WorksheetSpec(org.isisaddons.module.excel.dom.WorksheetSpec) ArrayList(java.util.ArrayList) KeyItem(org.estatio.module.budget.dom.keyitem.KeyItem) Action(org.apache.isis.applib.annotation.Action) MemberOrder(org.apache.isis.applib.annotation.MemberOrder) ActionLayout(org.apache.isis.applib.annotation.ActionLayout)

Example 23 with MemberOrder

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

the class KeyItemImportExportManager method export.

// region > export (action)
@Action(semantics = SemanticsOf.SAFE)
@ActionLayout(cssClassFa = "fa-download")
@MemberOrder(name = "keyItems", sequence = "1")
public Blob export() {
    final String fileName = withExtension(getFileName(), ".xlsx");
    WorksheetSpec spec = new WorksheetSpec(KeyItemImportExportLineItem.class, "keyItems");
    WorksheetContent worksheetContent = new WorksheetContent(getKeyItems(), spec);
    return excelService.toExcel(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 24 with MemberOrder

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

the class DocumentMenu method upload.

@Action(domainEvent = IncomingDocumentRepository.UploadDomainEvent.class, commandDtoProcessor = DeriveBlobFromReturnedDocumentArg0.class)
@MemberOrder(sequence = "3")
public Document upload(final Blob blob) {
    final String name = blob.getName();
    final DocumentType type = DocumentTypeData.INCOMING.findUsing(documentTypeRepository);
    final ApplicationUser me = meService.me();
    String atPath = me != null ? me.getAtPath() : null;
    if (atPath == null) {
        atPath = "/";
    }
    return incomingDocumentRepository.upsertAndArchive(type, atPath, name, blob);
}
Also used : ApplicationUser(org.isisaddons.module.security.dom.user.ApplicationUser) DocumentType(org.incode.module.document.dom.impl.types.DocumentType) Action(org.apache.isis.applib.annotation.Action) MemberOrder(org.apache.isis.applib.annotation.MemberOrder)

Example 25 with MemberOrder

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

the class DirectDebitsMenu method directDebitManager.

@Action(semantics = SemanticsOf.SAFE)
@ActionLayout(cssClassFa = "fa-check-square-o")
@MemberOrder(sequence = "300.10")
public DirectDebitsManager directDebitManager() {
    final DirectDebitsManager directDebitsManager = new DirectDebitsManager();
    serviceRegistry2.injectServicesInto(directDebitsManager);
    return directDebitsManager;
}
Also used : DirectDebitsManager(org.estatio.module.capex.app.paydd.DirectDebitsManager) Action(org.apache.isis.applib.annotation.Action) MemberOrder(org.apache.isis.applib.annotation.MemberOrder) ActionLayout(org.apache.isis.applib.annotation.ActionLayout)

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