Search in sources :

Example 21 with ActionLayout

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

the class Classification method remove.

@Action(domainEvent = RemoveDomainEvent.class, semantics = SemanticsOf.IDEMPOTENT_ARE_YOU_SURE)
@ActionLayout(cssClass = "btn-warning", cssClassFa = "trash")
public Object remove() {
    final Object aliased = getClassified();
    classificationRepository.remove(this);
    return aliased;
}
Also used : DomainObject(org.apache.isis.applib.annotation.DomainObject) Action(org.apache.isis.applib.annotation.Action) ActionLayout(org.apache.isis.applib.annotation.ActionLayout)

Example 22 with ActionLayout

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

the class Alias method remove.

@Action(domainEvent = RemoveDomainEvent.class, semantics = SemanticsOf.IDEMPOTENT_ARE_YOU_SURE)
@ActionLayout(cssClass = "btn-warning", cssClassFa = "trash")
public Object remove() {
    final Object aliased = getAliased();
    aliasRepository.remove(this);
    return aliased;
}
Also used : DomainObject(org.apache.isis.applib.annotation.DomainObject) Action(org.apache.isis.applib.annotation.Action) ActionLayout(org.apache.isis.applib.annotation.ActionLayout)

Example 23 with ActionLayout

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

the class Taxonomy method applicable.

@Action(domainEvent = ApplicableToDomainEvent.class)
@ActionLayout(cssClassFa = "fa-plus")
@MemberOrder(name = "appliesTo", sequence = "1")
public Category applicable(@ParameterLayout(named = "Application tenancy") final String atPath, @ParameterLayout(named = "Domain type") final String domainTypeName) {
    Applicability applicability = new Applicability(this, atPath, domainTypeName);
    repositoryService.persistAndFlush(applicability);
    return this;
}
Also used : Applicability(org.incode.module.classification.dom.impl.applicability.Applicability) Action(org.apache.isis.applib.annotation.Action) MemberOrder(org.apache.isis.applib.annotation.MemberOrder) ActionLayout(org.apache.isis.applib.annotation.ActionLayout)

Example 24 with ActionLayout

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

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

the class BudgetImportExportManager method importBudget.

@Action(publishing = Publishing.DISABLED, semantics = SemanticsOf.IDEMPOTENT)
@ActionLayout()
@CollectionLayout()
public Budget importBudget(@Parameter(fileAccept = ".xlsx") @ParameterLayout(named = "Excel spreadsheet") final Blob spreadsheet) {
    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");
    List<List<?>> objects = excelService.fromExcel(spreadsheet, Arrays.asList(spec1, spec2, spec3, spec4));
    // first upsert charges
    List<ChargeImport> chargeImportLines = (List<ChargeImport>) objects.get(3);
    for (ChargeImport lineItem : chargeImportLines) {
        lineItem.importData(null);
    }
    // import budget en items
    List<BudgetImportExport> budgetItemLines = importBudgetAndItems(objects);
    // import keyTables
    importKeyTables(budgetItemLines, objects);
    // import overrides
    importOverrides(objects);
    return getBudget();
}
Also used : WorksheetSpec(org.isisaddons.module.excel.dom.WorksheetSpec) ChargeImport(org.estatio.module.charge.imports.ChargeImport) ArrayList(java.util.ArrayList) List(java.util.List) Action(org.apache.isis.applib.annotation.Action) ActionLayout(org.apache.isis.applib.annotation.ActionLayout) CollectionLayout(org.apache.isis.applib.annotation.CollectionLayout)

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