diff --git a/office-alexander-logistics-app/src/main/java/org/imixs/workflow/office/reporting/ReportingController.java b/office-alexander-logistics-app/src/main/java/org/imixs/workflow/office/reporting/ReportingController.java new file mode 100644 index 0000000..5f91ee0 --- /dev/null +++ b/office-alexander-logistics-app/src/main/java/org/imixs/workflow/office/reporting/ReportingController.java @@ -0,0 +1,144 @@ +/******************************************************************************* + * Imixs Workflow Technology + * Copyright (C) 2003, 2008 Imixs Software Solutions GmbH, + * http://www.imixs.com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You can receive a copy of the GNU General Public + * License at http://www.gnu.org/licenses/gpl.html + * + * Contributors: + * Imixs Software Solutions GmbH - initial API and implementation + * Ralph Soika + * + *******************************************************************************/ +package org.imixs.workflow.office.reporting; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.logging.Logger; + +import org.imixs.workflow.ItemCollection; +import org.imixs.workflow.engine.DocumentEvent; +import org.imixs.workflow.engine.DocumentService; + +import jakarta.annotation.PostConstruct; +import jakarta.ejb.EJB; +import jakarta.enterprise.context.SessionScoped; +import jakarta.enterprise.event.Observes; +import jakarta.inject.Named; + +/** + * The ReportingConfigController is used to configure a reporting definition + * + * @author rsoika + * @version 1.0 + */ + +@Named +@SessionScoped +public class ReportingController implements Serializable { + + private static final long serialVersionUID = 1L; + + protected List attributeList = null; + + @EJB + DocumentService documentService; + + private static Logger logger = Logger.getLogger(ReportingController.class.getName()); + + /** + * + * + */ + @PostConstruct + public void init() { + + } + + public void setAttributeList(List attributeList) { + this.attributeList = attributeList; + } + + public List getAttributeList() { + return attributeList; + } + + /** + * Load/Update attribute list + * + * + */ + public void onEvent(@Observes DocumentEvent event) { + + if (event == null || event.getDocument() == null || !"reporting".equals(event.getDocument().getType())) { + return; + } + // update attribute list + if (event.getEventType() == DocumentEvent.ON_DOCUMENT_SAVE) { + // convert the option ItemCollection elements into a List of Map + if (attributeList != null) { + List mapItemList = new ArrayList(); + logger.fine("Convert option items into Map..."); + // iterate over all items.. + for (ItemCollection attrItem : attributeList) { + mapItemList.add(attrItem.getAllItems()); + } + event.getDocument().replaceItemValue("attributes", mapItemList); + } + } + + // update attribute list + if (event.getEventType() == DocumentEvent.ON_DOCUMENT_LOAD) { + attributeList = new ArrayList(); + List mapItems = event.getDocument().getItemValue("attributes"); + for (Object mapOderItem : mapItems) { + if (mapOderItem instanceof Map) { + ItemCollection itemCol = new ItemCollection((Map) mapOderItem); + attributeList.add(itemCol); + } + } + } + + } + + /** + * Adds a new attribute object. + */ + public void addAttribute() { + if (attributeList == null) { + attributeList = new ArrayList(); + } + ItemCollection source = new ItemCollection(); + attributeList.add(source); + } + + /** + * Removes an attribute item from the list + * + * @param name - name of attribute + */ + public void removeAttribute(String name) { + if (name != null && attributeList != null) { + for (ItemCollection dbtr : attributeList) { + if (name.equals(dbtr.getItemValueString("name"))) { + attributeList.remove(dbtr); + break; + } + } + } + } + +} diff --git a/office-alexander-logistics-app/src/main/java/org/imixs/workflow/office/views/ReportingViewController.java b/office-alexander-logistics-app/src/main/java/org/imixs/workflow/office/views/ReportingViewController.java new file mode 100644 index 0000000..012ecd9 --- /dev/null +++ b/office-alexander-logistics-app/src/main/java/org/imixs/workflow/office/views/ReportingViewController.java @@ -0,0 +1,36 @@ +package org.imixs.workflow.office.views; + +import org.eclipse.microprofile.config.inject.ConfigProperty; +import org.imixs.workflow.faces.data.ViewController; +import org.imixs.workflow.faces.util.LoginController; + +import jakarta.annotation.PostConstruct; +import jakarta.faces.view.ViewScoped; +import jakarta.inject.Inject; +import jakarta.inject.Named; + +@Named +@ViewScoped +public class ReportingViewController extends ViewController { + + private static final long serialVersionUID = 1L; + + @Inject + LoginController loginController; + + @Inject + @ConfigProperty(name = "admin.view.entries.max", defaultValue = "999") + transient int adminViewPageSize; + + @Override + @PostConstruct + public void init() { + super.init(); + this.setQuery("(type:\"reporting\")"); + this.setSortBy("txtname"); + this.setSortReverse(false); + this.setPageSize(adminViewPageSize); + this.setLoadStubs(false); + } + +} diff --git a/office-alexander-logistics-app/src/main/webapp/layout/commandbox_admin_custom.xhtml b/office-alexander-logistics-app/src/main/webapp/layout/commandbox_admin_custom.xhtml index de35d21..68a4fd0 100644 --- a/office-alexander-logistics-app/src/main/webapp/layout/commandbox_admin_custom.xhtml +++ b/office-alexander-logistics-app/src/main/webapp/layout/commandbox_admin_custom.xhtml @@ -14,6 +14,10 @@
  • Analyse Rechnungseingang
  • +
  • + Reportings +
  • +
  • Excel Export Rechnungsausgang
  • diff --git a/office-alexander-logistics-app/src/main/webapp/pages/admin/reportingDefinition.xhtml b/office-alexander-logistics-app/src/main/webapp/pages/admin/reportingDefinition.xhtml new file mode 100644 index 0000000..e23fddb --- /dev/null +++ b/office-alexander-logistics-app/src/main/webapp/pages/admin/reportingDefinition.xhtml @@ -0,0 +1,284 @@ + + + + + + + + + + + + + +
    +
    +

    + + +

    +
    + +
    +
    + + +
    + + + +
    + +
    +

    Query Definition

    +

    + A Query Defintion defines a custom data list based on the + Lucene Search Query syntax. +

    +
    +
    + Name: * + + +
    + +
    + +
    +
    +
    +
    + +
    +
    + Description: +
    + +
    + +
    +
    +
    +
    + Query: * +
    + +
    + +
    +
    +
    + + + + + + +

    Attributes

    +

    + + Optional attribute definition for the report result. A attributes reduces + the size of a report result and can adapt single item values. Each item of + the attribute list can define an optional label, converter, format and + aggregator. + +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    IDBank + *IBANBICReport (optional) + +
    + + + + + + + + + + + + + + +
    + + + + + +
    +
    + + + + +
    +
    + + +
    + +
    +

    Form Definition

    +

    + The Form Definition defines query and filter parameters. +

    +
    + +
    +
    + Form: * + + +
    + +
    + +
    +
    +
    +
    +
    + + +
    + + + +
    + +
    + +

    Template

    +
    +
    #{message['form.minutes.description']}:
    +
    + + + + + + + + + +
    + + + +
    + +
    +
    + +
    +
    +
    + + +
    + + + + +
    +
    +
    + + + + + + + +
    +
    + + + +
    \ No newline at end of file diff --git a/office-alexander-logistics-app/src/main/webapp/pages/admin/reportingDefinitions.xhtml b/office-alexander-logistics-app/src/main/webapp/pages/admin/reportingDefinitions.xhtml new file mode 100644 index 0000000..6860cd5 --- /dev/null +++ b/office-alexander-logistics-app/src/main/webapp/pages/admin/reportingDefinitions.xhtml @@ -0,0 +1,101 @@ + + + + + + + +
    + +
    +

    + +

    +
    + +
    + + + + #{message.name} + + + + + + + + + + + #{message.modified} + + + + + + + + #{message.action} + + + + + #{message.open} + + + + + + + #{message.delete} + + + + +
    + + + + + + + + + \ No newline at end of file