From 049bf8fea9607df7d005291c56e32e37a535f038 Mon Sep 17 00:00:00 2001 From: Ralph Soika Date: Mon, 8 Jun 2026 12:19:48 +0200 Subject: [PATCH] new dataview version --- .../forms/DataViewSectionController.java | 4 +- .../office/forms/DataViewSectionDataSet.java | 21 ++- .../pages/workitems/forms/dataview.xhtml | 170 +++++++++--------- .../pages/workitems/forms/dataview_old.xhtml | 118 ++++++++++++ 4 files changed, 225 insertions(+), 88 deletions(-) create mode 100644 office-alexander-logistics-app/src/main/webapp/pages/workitems/forms/dataview_old.xhtml diff --git a/office-alexander-logistics-app/src/main/java/org/imixs/workflow/office/forms/DataViewSectionController.java b/office-alexander-logistics-app/src/main/java/org/imixs/workflow/office/forms/DataViewSectionController.java index e1ccbb6..5e1e306 100644 --- a/office-alexander-logistics-app/src/main/java/org/imixs/workflow/office/forms/DataViewSectionController.java +++ b/office-alexander-logistics-app/src/main/java/org/imixs/workflow/office/forms/DataViewSectionController.java @@ -43,8 +43,7 @@ import jakarta.servlet.http.HttpServletRequest; /** * The DataViewFormSectionController provides methods to display a data view in - * as a - * custom form section + * a custom form section * * @see pages/workitems/sections/dataview.xhtml * @author rsoika @@ -147,6 +146,7 @@ public class DataViewSectionController implements Serializable { if (_dataViewName != null) { logger.info("...build new dataSet by options: " + options); dataSet = new DataViewSectionDataSet(_dataViewName, workflowController.getWorkitem(), dataViewService); + dataSets.put(options, dataSet); } } diff --git a/office-alexander-logistics-app/src/main/java/org/imixs/workflow/office/forms/DataViewSectionDataSet.java b/office-alexander-logistics-app/src/main/java/org/imixs/workflow/office/forms/DataViewSectionDataSet.java index 91defb9..5f7a00e 100644 --- a/office-alexander-logistics-app/src/main/java/org/imixs/workflow/office/forms/DataViewSectionDataSet.java +++ b/office-alexander-logistics-app/src/main/java/org/imixs/workflow/office/forms/DataViewSectionDataSet.java @@ -3,6 +3,7 @@ package org.imixs.workflow.office.forms; import java.io.IOException; import java.io.Serializable; import java.util.List; +import java.util.UUID; import java.util.logging.Logger; import org.imixs.workflow.FileData; @@ -34,6 +35,8 @@ public class DataViewSectionDataSet implements Serializable { private int pageSize = 10; private int pageIndex = 0; + private String viewId; + private DataViewService dataViewService; private ItemCollection workitem; @@ -43,8 +46,13 @@ public class DataViewSectionDataSet implements Serializable { this.workitem = workitem; this.dataViewService = dataViewService; - dataViewDefinition = dataViewService.loadDataViewDefinition(dataViewName); + // Generate a unique view ID for JSF component identification + this.viewId = "dv_" + UUID.randomUUID().toString().replace("-", ""); + dataViewDefinition = dataViewService.loadDataViewDefinition(dataViewName); + if (dataViewDefinition == null) { + return; + } boolean debug = dataViewDefinition.getItemValueBoolean("debug"); if (debug) { logger.info("resolve query by dataView '" + dataViewName + "'"); @@ -55,10 +63,21 @@ public class DataViewSectionDataSet implements Serializable { // resove query by dataView query = this.dataViewService.parseQuery(dataViewDefinition, this.workitem); + sortBy = dataViewDefinition.getItemValueString("sort.by"); + sortReverse = dataViewDefinition.getItemValueBoolean("sort.reverse"); loadData(); } + /** + * return unique data view id for jsf pages + * + * @return + */ + public String getViewId() { + return viewId; + } + public void forward() { if (!isEndOfList()) { pageIndex++; diff --git a/office-alexander-logistics-app/src/main/webapp/pages/workitems/forms/dataview.xhtml b/office-alexander-logistics-app/src/main/webapp/pages/workitems/forms/dataview.xhtml index 346958d..6f51c55 100644 --- a/office-alexander-logistics-app/src/main/webapp/pages/workitems/forms/dataview.xhtml +++ b/office-alexander-logistics-app/src/main/webapp/pages/workitems/forms/dataview.xhtml @@ -4,97 +4,97 @@ xmlns:marty="http://java.sun.com/jsf/composite/marty"> - - - - - + - - - - - - - - + + + +
#{columnDef.item['item.label']}
- + - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #{columnDef.item['item.label']} - - - - - #{columnDef.item['item.label']}
- -
- - - - - - - - - - - - - - - - - - - -
-
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #{columnDef.item['item.label']} + + + + + + + + + + +
+ + + + + + Excel + + + + + + + « + + + + » + + +
+ +
diff --git a/office-alexander-logistics-app/src/main/webapp/pages/workitems/forms/dataview_old.xhtml b/office-alexander-logistics-app/src/main/webapp/pages/workitems/forms/dataview_old.xhtml new file mode 100644 index 0000000..346958d --- /dev/null +++ b/office-alexander-logistics-app/src/main/webapp/pages/workitems/forms/dataview_old.xhtml @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + + + +
#{columnDef.item['item.label']}
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #{columnDef.item['item.label']} + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + +
+
+ + + +
+

Model + error in #{workitem.modelVersion}:

+ Data View not defined: #{options} +
+
+ + +
\ No newline at end of file