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