Search in sources :

Example 36 with ActionLayout

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

the class Task_reprioritizeAbsolute method act.

@Action(semantics = SemanticsOf.SAFE)
@ActionLayout(contributed = Contributed.AS_ACTION, cssClassFa = "fa-bell-o")
public Task act(final LocalDate newDate) {
    final LocalDateTime newDateTime = newDate.toLocalDateTime(task.getCreatedOn().toLocalTime());
    task.setCreatedOn(newDateTime);
    return task;
}
Also used : LocalDateTime(org.joda.time.LocalDateTime) Action(org.apache.isis.applib.annotation.Action) ActionLayout(org.apache.isis.applib.annotation.ActionLayout)

Example 37 with ActionLayout

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

the class IncomingInvoice_outstandingOrderItemsForSeller method $$.

@Action(semantics = SemanticsOf.SAFE)
@ActionLayout(contributed = Contributed.AS_ASSOCIATION)
public List<OrderItemPresentationViewmodel> $$() {
    List<OrderItemPresentationViewmodel> result = new ArrayList<>();
    if (invoice.getSeller() == null && invoice.getProperty() == null) {
        return result;
    }
    List<OrderItem> itemsFound = orderItemRepository.findBySeller(invoice.getSeller()).stream().filter(linkedToInvoiceOrOutstanding).collect(Collectors.toList());
    for (OrderItem item : itemsFound) {
        result.add(new OrderItemPresentationViewmodel(item));
    }
    return result;
}
Also used : OrderItem(org.estatio.module.capex.dom.order.OrderItem) ArrayList(java.util.ArrayList) Action(org.apache.isis.applib.annotation.Action) ActionLayout(org.apache.isis.applib.annotation.ActionLayout)

Example 38 with ActionLayout

use of org.apache.isis.applib.annotation.ActionLayout 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 39 with ActionLayout

use of org.apache.isis.applib.annotation.ActionLayout 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 40 with ActionLayout

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

ActionLayout (org.apache.isis.applib.annotation.ActionLayout)62 Action (org.apache.isis.applib.annotation.Action)61 Document (org.incode.module.document.dom.impl.docs.Document)22 MemberOrder (org.apache.isis.applib.annotation.MemberOrder)14 IncomingInvoice (org.estatio.module.capex.dom.invoice.IncomingInvoice)9 WorksheetSpec (org.isisaddons.module.excel.dom.WorksheetSpec)7 Blob (org.apache.isis.applib.value.Blob)6 ArrayList (java.util.ArrayList)5 WorksheetContent (org.isisaddons.module.excel.dom.WorksheetContent)5 DocumentTemplate (org.incode.module.document.dom.impl.docs.DocumentTemplate)3 DomainObject (org.apache.isis.applib.annotation.DomainObject)2 BudgetItem (org.estatio.module.budget.dom.budgetitem.BudgetItem)2 PartitionItem (org.estatio.module.budget.dom.partioning.PartitionItem)2 IncomingDocViewModel (org.estatio.module.capex.app.document.IncomingDocViewModel)2 Invoice (org.estatio.module.invoice.dom.Invoice)2 Lease (org.estatio.module.lease.dom.Lease)2 Organisation (org.estatio.module.party.dom.Organisation)2 DocumentType (org.incode.module.document.dom.impl.types.DocumentType)2 LocalDate (org.joda.time.LocalDate)2 LocalDateTime (org.joda.time.LocalDateTime)2