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;
}
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;
}
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;
}
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);
}
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;
}
Aggregations