From 584d59cfbef16049d8ee589f9adc84a089659092 Mon Sep 17 00:00:00 2001 From: Ralph Soika Date: Mon, 12 May 2025 16:16:11 +0200 Subject: [PATCH] dataview --- .../office/dataview/DataViewController.java | 1 - .../DataViewDefinitionController.java | 27 ++++++++++++++----- .../DataViewDefinitionsController.java | 2 +- .../pages/admin/dataViewDefinition.xhtml | 20 ++++++++++++-- .../pages/admin/dataViewDefinitions.xhtml | 16 +++++------ 5 files changed, 45 insertions(+), 21 deletions(-) diff --git a/office-alexander-logistics-app/src/main/java/org/imixs/workflow/office/dataview/DataViewController.java b/office-alexander-logistics-app/src/main/java/org/imixs/workflow/office/dataview/DataViewController.java index 14df9d3..2e7916b 100644 --- a/office-alexander-logistics-app/src/main/java/org/imixs/workflow/office/dataview/DataViewController.java +++ b/office-alexander-logistics-app/src/main/java/org/imixs/workflow/office/dataview/DataViewController.java @@ -72,7 +72,6 @@ import jakarta.servlet.http.HttpServletRequest; * @version 1.0 */ @Named -// @SessionScoped @ConversationScoped public class DataViewController extends ViewController { diff --git a/office-alexander-logistics-app/src/main/java/org/imixs/workflow/office/dataview/DataViewDefinitionController.java b/office-alexander-logistics-app/src/main/java/org/imixs/workflow/office/dataview/DataViewDefinitionController.java index aa80d05..44a9477 100644 --- a/office-alexander-logistics-app/src/main/java/org/imixs/workflow/office/dataview/DataViewDefinitionController.java +++ b/office-alexander-logistics-app/src/main/java/org/imixs/workflow/office/dataview/DataViewDefinitionController.java @@ -164,6 +164,14 @@ public class DataViewDefinitionController extends AbstractDataController { return result; } + /** + * creates an empty new dataview definition + */ + public void create() { + data = new ItemCollection(); + data.setType("dataview"); + } + /** * This method saves the current document. * @@ -171,21 +179,23 @@ public class DataViewDefinitionController extends AbstractDataController { */ public void save() throws AccessDeniedException { // save definition ... + data.setType("dataview"); FacesContext context = FacesContext.getCurrentInstance(); ExternalContext externalContext = context .getExternalContext(); String sUser = externalContext.getRemoteUser(); data.replaceItemValue("$editor", sUser); - List mapItemList = new ArrayList(); - logger.fine("Convert attribute items into Map..."); // implode attributes - for (ItemCollection attrItem : attributeList) { - ItemCollection ding = (ItemCollection) attrItem.clone(); - mapItemList.add(ding.getAllItems()); + if (attributeList != null) { + List mapItemList = new ArrayList(); + logger.fine("Convert attribute items into Map..."); + for (ItemCollection attrItem : attributeList) { + ItemCollection ding = (ItemCollection) attrItem.clone(); + mapItemList.add(ding.getAllItems()); + } + data.replaceItemValue("dataview.items", mapItemList); } - data.replaceItemValue("dataview.items", mapItemList); - data = this.getDocumentService().save(data); } @@ -196,6 +206,9 @@ public class DataViewDefinitionController extends AbstractDataController { } public List getAttributeList() { + if (attributeList == null) { + attributeList = new ArrayList<>(); + } return attributeList; } diff --git a/office-alexander-logistics-app/src/main/java/org/imixs/workflow/office/dataview/DataViewDefinitionsController.java b/office-alexander-logistics-app/src/main/java/org/imixs/workflow/office/dataview/DataViewDefinitionsController.java index ba44786..6a2f8b4 100644 --- a/office-alexander-logistics-app/src/main/java/org/imixs/workflow/office/dataview/DataViewDefinitionsController.java +++ b/office-alexander-logistics-app/src/main/java/org/imixs/workflow/office/dataview/DataViewDefinitionsController.java @@ -23,7 +23,7 @@ public class DataViewDefinitionsController extends ViewController { public void init() { super.init(); this.setQuery("(type:\"dataview\")"); - this.setSortBy("txtname"); + this.setSortBy("name"); this.setSortReverse(false); this.setPageSize(adminViewPageSize); this.setLoadStubs(false); diff --git a/office-alexander-logistics-app/src/main/webapp/pages/admin/dataViewDefinition.xhtml b/office-alexander-logistics-app/src/main/webapp/pages/admin/dataViewDefinition.xhtml index 71c0333..6baaaea 100644 --- a/office-alexander-logistics-app/src/main/webapp/pages/admin/dataViewDefinition.xhtml +++ b/office-alexander-logistics-app/src/main/webapp/pages/admin/dataViewDefinition.xhtml @@ -64,6 +64,22 @@ value="#{dataViewDefinitionController.data.item['Name']}" /> +
+
+ Process: +
+
+ + + + + + + +
+
@@ -81,7 +97,7 @@
-
@@ -93,7 +109,7 @@ Sort By:
-
diff --git a/office-alexander-logistics-app/src/main/webapp/pages/admin/dataViewDefinitions.xhtml b/office-alexander-logistics-app/src/main/webapp/pages/admin/dataViewDefinitions.xhtml index 1864cf6..9a75653 100644 --- a/office-alexander-logistics-app/src/main/webapp/pages/admin/dataViewDefinitions.xhtml +++ b/office-alexander-logistics-app/src/main/webapp/pages/admin/dataViewDefinitions.xhtml @@ -32,6 +32,11 @@ + + Process + #{teamController.getProcessById(record.item['process.ref']).getItemValueString('name')} + + Description
#{record.item['description']}
@@ -76,19 +81,10 @@

- - -
- - + actionListener="#{dataViewDefinitionController.create}"> - - -