new dataview draft
This commit is contained in:
parent
c2e4df0379
commit
db478a5b4e
8 changed files with 522 additions and 77 deletions
5
.vscode/settings.json
vendored
5
.vscode/settings.json
vendored
|
|
@ -8,8 +8,5 @@
|
||||||
"editor.codeActionsOnSave": {
|
"editor.codeActionsOnSave": {
|
||||||
"source.organizeImports": "explicit"
|
"source.organizeImports": "explicit"
|
||||||
},
|
},
|
||||||
"java.checkstyle.version": "8.44",
|
"java.format.settings.url": "https://raw.githubusercontent.com/imixs/imixs-workflow/refs/heads/master/imixs-code-style.xml"
|
||||||
"java.checkstyle.autocheck": true,
|
|
||||||
"java.checkstyle.configuration": "https://raw.githubusercontent.com/imixs/imixs-workflow/master/imixs-checkstyle-8.44.xml",
|
|
||||||
"java.configuration.updateBuildConfiguration": "automatic"
|
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,194 @@
|
||||||
|
/*******************************************************************************
|
||||||
|
* 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.dataview;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
import org.imixs.workflow.ItemCollection;
|
||||||
|
import org.imixs.workflow.exceptions.AccessDeniedException;
|
||||||
|
import org.imixs.workflow.exceptions.ModelException;
|
||||||
|
import org.imixs.workflow.faces.data.AbstractDataController;
|
||||||
|
import org.imixs.workflow.office.forms.CustomFormController;
|
||||||
|
import org.imixs.workflow.office.forms.CustomFormSection;
|
||||||
|
|
||||||
|
import jakarta.annotation.PostConstruct;
|
||||||
|
import jakarta.enterprise.context.ConversationScoped;
|
||||||
|
import jakarta.inject.Inject;
|
||||||
|
import jakarta.inject.Named;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The DataViewController is used to display a data view
|
||||||
|
*
|
||||||
|
* @author rsoika
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
@Named
|
||||||
|
@ConversationScoped
|
||||||
|
public class DataViewController extends AbstractDataController {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
private List<CustomFormSection> sections;
|
||||||
|
private String errorMessage;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
CustomFormController customFormController;
|
||||||
|
|
||||||
|
private ItemCollection filter;
|
||||||
|
private String query;
|
||||||
|
|
||||||
|
private static Logger logger = Logger.getLogger(DataViewController.class.getName());
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@PostConstruct
|
||||||
|
public void init() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemCollection getDefinition() {
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<CustomFormSection> getSections() {
|
||||||
|
return sections;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method loads the custom form sections
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void onLoad() {
|
||||||
|
filter = new ItemCollection();
|
||||||
|
super.onLoad();
|
||||||
|
startConversation();
|
||||||
|
try {
|
||||||
|
// Init new Filter....
|
||||||
|
if (data != null) {
|
||||||
|
filter.setItemValue("txtWorkflowEditorCustomForm", data.getItemValue("form"));
|
||||||
|
customFormController.computeFieldDefinition(filter);
|
||||||
|
sections = customFormController.getSections();
|
||||||
|
}
|
||||||
|
} catch (ModelException e) {
|
||||||
|
logger.warning("Failed to load dataview definition: " + e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemCollection getFilter() {
|
||||||
|
return filter;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFilter(ItemCollection filter) {
|
||||||
|
this.filter = filter;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getErrorMessage() {
|
||||||
|
return errorMessage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setErrorMessage(String errorMessage) {
|
||||||
|
this.errorMessage = errorMessage;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This helper method builds a query from the query definition and the current
|
||||||
|
* filter criteria.
|
||||||
|
*
|
||||||
|
* The method loads the query form the definition and replaces all {<itemname>}
|
||||||
|
* elements with the values from the filter
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @throws AccessDeniedException - if user has insufficient access rights.
|
||||||
|
*/
|
||||||
|
public void run() throws AccessDeniedException {
|
||||||
|
|
||||||
|
Date date = filter.getItemValueDate("date.from");
|
||||||
|
logger.info(" date=" + date);
|
||||||
|
|
||||||
|
query = data.getItemValueString("query");
|
||||||
|
|
||||||
|
List<String> filterItems = filter.getItemNames();
|
||||||
|
for (String itemName : filterItems) {
|
||||||
|
String itemValue = filter.getItemValueString(itemName);
|
||||||
|
|
||||||
|
// is date?
|
||||||
|
if (filter.getItemValueDate(itemName) != null) {
|
||||||
|
String sDateFrom = "191401070000"; // because * did not work here
|
||||||
|
String sDateTo = "211401070000";
|
||||||
|
SimpleDateFormat dateformat = new SimpleDateFormat("yyyyMMddHHmm");
|
||||||
|
|
||||||
|
itemValue = dateformat.format(filter.getItemValueDate(itemName));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create regex pattern to match {itemName} (case-sensitive)
|
||||||
|
// The Pattern.quote is used to escape any special regex characters in the
|
||||||
|
// itemName
|
||||||
|
// Replace all occurrences in the query case-insensitive.
|
||||||
|
query = query.replaceAll("(?i)\\{" + Pattern.quote(itemName) + "\\}", itemValue);
|
||||||
|
}
|
||||||
|
logger.info("query=" + query);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the current query
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String getQuery() {
|
||||||
|
return query;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the current workItem. If no workitem is defined the method
|
||||||
|
* Instantiates a empty ItemCollection.
|
||||||
|
*
|
||||||
|
* @return - current workItem or null if not set
|
||||||
|
*/
|
||||||
|
public ItemCollection getData() {
|
||||||
|
// do initialize an empty workItem here if null
|
||||||
|
if (data == null) {
|
||||||
|
reset();
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the current worktItem
|
||||||
|
*
|
||||||
|
* @param workitem - new reference or null to clear the current workItem.
|
||||||
|
*/
|
||||||
|
public void setData(ItemCollection document) {
|
||||||
|
this.data = document;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -21,9 +21,8 @@
|
||||||
* Ralph Soika
|
* Ralph Soika
|
||||||
*
|
*
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.imixs.workflow.office.reporting;
|
package org.imixs.workflow.office.dataview;
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -32,39 +31,41 @@ import java.util.logging.Logger;
|
||||||
|
|
||||||
import org.imixs.workflow.ItemCollection;
|
import org.imixs.workflow.ItemCollection;
|
||||||
import org.imixs.workflow.engine.DocumentEvent;
|
import org.imixs.workflow.engine.DocumentEvent;
|
||||||
import org.imixs.workflow.engine.DocumentService;
|
import org.imixs.workflow.exceptions.AccessDeniedException;
|
||||||
|
import org.imixs.workflow.faces.data.AbstractDataController;
|
||||||
|
import org.imixs.workflow.faces.data.DocumentController;
|
||||||
import org.imixs.workflow.office.forms.ChildItemController;
|
import org.imixs.workflow.office.forms.ChildItemController;
|
||||||
|
|
||||||
import com.oracle.svm.core.annotate.Inject;
|
import com.oracle.svm.core.annotate.Inject;
|
||||||
|
|
||||||
import jakarta.annotation.PostConstruct;
|
import jakarta.annotation.PostConstruct;
|
||||||
import jakarta.ejb.EJB;
|
import jakarta.enterprise.context.ConversationScoped;
|
||||||
import jakarta.enterprise.context.SessionScoped;
|
|
||||||
import jakarta.enterprise.event.Observes;
|
import jakarta.enterprise.event.Observes;
|
||||||
|
import jakarta.faces.context.ExternalContext;
|
||||||
|
import jakarta.faces.context.FacesContext;
|
||||||
import jakarta.inject.Named;
|
import jakarta.inject.Named;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The ReportingConfigController is used to configure a reporting definition
|
* The DataViewDefinitionController is used to configure a dataview definition
|
||||||
*
|
*
|
||||||
* @author rsoika
|
* @author rsoika
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Named
|
@Named
|
||||||
@SessionScoped
|
@ConversationScoped
|
||||||
public class DataViewController implements Serializable {
|
public class DataViewDefinitionController extends AbstractDataController {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
protected List<ItemCollection> attributeList = null;
|
protected List<ItemCollection> attributeList = null;
|
||||||
|
|
||||||
@EJB
|
|
||||||
DocumentService documentService;
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
ChildItemController childItemController;
|
ChildItemController childItemController;
|
||||||
|
|
||||||
private static Logger logger = Logger.getLogger(DataViewController.class.getName());
|
@Inject
|
||||||
|
DocumentController documentController;
|
||||||
|
|
||||||
|
private static Logger logger = Logger.getLogger(DataViewDefinitionController.class.getName());
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
@ -75,9 +76,60 @@ public class DataViewController implements Serializable {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// public void setAttributeList(List<ItemCollection> attributeList) {
|
/**
|
||||||
// this.attributeList = attributeList;
|
* Returns the current workItem. If no workitem is defined the method
|
||||||
// }
|
* Instantiates a empty ItemCollection.
|
||||||
|
*
|
||||||
|
* @return - current workItem or null if not set
|
||||||
|
*/
|
||||||
|
public ItemCollection getData() {
|
||||||
|
// do initialize an empty workItem here if null
|
||||||
|
if (data == null) {
|
||||||
|
reset();
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the current worktItem
|
||||||
|
*
|
||||||
|
* @param workitem - new reference or null to clear the current workItem.
|
||||||
|
*/
|
||||||
|
public void setData(ItemCollection document) {
|
||||||
|
this.data = document;
|
||||||
|
|
||||||
|
attributeList = new ArrayList<ItemCollection>();
|
||||||
|
List<Object> mapItems = data.getItemValue("dataview.items");
|
||||||
|
for (Object mapOderItem : mapItems) {
|
||||||
|
if (mapOderItem instanceof Map) {
|
||||||
|
ItemCollection itemCol = new ItemCollection((Map) mapOderItem);
|
||||||
|
attributeList.add(itemCol);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method saves the current document.
|
||||||
|
*
|
||||||
|
* @throws AccessDeniedException - if user has insufficient access rights.
|
||||||
|
*/
|
||||||
|
public void save() throws AccessDeniedException {
|
||||||
|
// save definition ...
|
||||||
|
FacesContext context = FacesContext.getCurrentInstance();
|
||||||
|
ExternalContext externalContext = context
|
||||||
|
.getExternalContext();
|
||||||
|
String sUser = externalContext.getRemoteUser();
|
||||||
|
data.replaceItemValue("$editor", sUser);
|
||||||
|
data = this.getDocumentService().save(data);
|
||||||
|
|
||||||
|
logger.finest("......ItemCollection saved");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String openTestView() {
|
||||||
|
this.save();
|
||||||
|
return "/pages/dataviews/data.xhtml?id=" + data.getUniqueID() + "&faces-redirect=true";
|
||||||
|
}
|
||||||
|
|
||||||
public List<ItemCollection> getAttributeList() {
|
public List<ItemCollection> getAttributeList() {
|
||||||
return attributeList;
|
return attributeList;
|
||||||
|
|
@ -90,7 +142,7 @@ public class DataViewController implements Serializable {
|
||||||
*/
|
*/
|
||||||
public void onEvent(@Observes DocumentEvent event) {
|
public void onEvent(@Observes DocumentEvent event) {
|
||||||
|
|
||||||
if (event == null || event.getDocument() == null || !"reporting".equals(event.getDocument().getType())) {
|
if (event == null || event.getDocument() == null || !"dataview".equals(event.getDocument().getType())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// update attribute list
|
// update attribute list
|
||||||
|
|
@ -105,21 +157,14 @@ public class DataViewController implements Serializable {
|
||||||
ItemCollection ding = (ItemCollection) attrItem.clone();
|
ItemCollection ding = (ItemCollection) attrItem.clone();
|
||||||
mapItemList.add(ding.getAllItems());
|
mapItemList.add(ding.getAllItems());
|
||||||
}
|
}
|
||||||
event.getDocument().replaceItemValue("report.items", mapItemList);
|
event.getDocument().replaceItemValue("dataview.items", mapItemList);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// update attribute list
|
// update attribute list
|
||||||
if (event.getEventType() == DocumentEvent.ON_DOCUMENT_LOAD) {
|
if (event.getEventType() == DocumentEvent.ON_DOCUMENT_LOAD) {
|
||||||
attributeList = new ArrayList<ItemCollection>();
|
|
||||||
List<Object> mapItems = event.getDocument().getItemValue("report.items");
|
|
||||||
for (Object mapOderItem : mapItems) {
|
|
||||||
if (mapOderItem instanceof Map) {
|
|
||||||
ItemCollection itemCol = new ItemCollection((Map) mapOderItem);
|
|
||||||
attributeList.add(itemCol);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -187,7 +232,8 @@ public class DataViewController implements Serializable {
|
||||||
logger.info("move down: " + name);
|
logger.info("move down: " + name);
|
||||||
for (int i = 0; i < attributeList.size(); i++) {
|
for (int i = 0; i < attributeList.size(); i++) {
|
||||||
ItemCollection item = attributeList.get(i);
|
ItemCollection item = attributeList.get(i);
|
||||||
if (name.equals(item.getItemValueString("item.name"))) {
|
if (name.equals(item
|
||||||
|
.getItemValueString("item.name"))) {
|
||||||
// Check if it's not already at the bottom
|
// Check if it's not already at the bottom
|
||||||
if (i < attributeList.size() - 1) {
|
if (i < attributeList.size() - 1) {
|
||||||
// Swap with next element
|
// Swap with next element
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
package org.imixs.workflow.office.views;
|
package org.imixs.workflow.office.dataview;
|
||||||
|
|
||||||
import org.eclipse.microprofile.config.inject.ConfigProperty;
|
import org.eclipse.microprofile.config.inject.ConfigProperty;
|
||||||
import org.imixs.workflow.faces.data.ViewController;
|
import org.imixs.workflow.faces.data.ViewController;
|
||||||
import org.imixs.workflow.faces.util.LoginController;
|
|
||||||
|
|
||||||
import jakarta.annotation.PostConstruct;
|
import jakarta.annotation.PostConstruct;
|
||||||
import jakarta.faces.view.ViewScoped;
|
import jakarta.faces.view.ViewScoped;
|
||||||
|
|
@ -15,9 +14,6 @@ public class DataViewDefinitionsController extends ViewController {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@Inject
|
|
||||||
LoginController loginController;
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
@ConfigProperty(name = "admin.view.entries.max", defaultValue = "999")
|
@ConfigProperty(name = "admin.view.entries.max", defaultValue = "999")
|
||||||
transient int adminViewPageSize;
|
transient int adminViewPageSize;
|
||||||
|
|
@ -0,0 +1,39 @@
|
||||||
|
package org.imixs.workflow.office.dataview;
|
||||||
|
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
|
import org.imixs.workflow.faces.data.ViewController;
|
||||||
|
|
||||||
|
import jakarta.annotation.PostConstruct;
|
||||||
|
import jakarta.faces.view.ViewScoped;
|
||||||
|
import jakarta.inject.Inject;
|
||||||
|
import jakarta.inject.Named;
|
||||||
|
|
||||||
|
@Named
|
||||||
|
@ViewScoped
|
||||||
|
public class DataViewSearchController extends ViewController {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
private static Logger logger = Logger.getLogger(DataViewSearchController.class.getName());
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
DataViewController dataViewController;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@PostConstruct
|
||||||
|
public void init() {
|
||||||
|
super.init();
|
||||||
|
this.setQuery(dataViewController.getQuery());
|
||||||
|
this.setSortBy("$modified");
|
||||||
|
this.setSortReverse(false);
|
||||||
|
this.setPageSize(100);
|
||||||
|
this.setLoadStubs(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getQuery() {
|
||||||
|
logger.fine("query: " + dataViewController.getQuery());
|
||||||
|
return dataViewController.getQuery();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
|
|
||||||
<f:metadata>
|
<f:metadata>
|
||||||
<f:viewAction action="#{documentController.onLoad()}" />
|
<f:viewAction action="#{dataViewDefinitionController.onLoad()}" />
|
||||||
</f:metadata>
|
</f:metadata>
|
||||||
|
|
||||||
<ui:define name="content">
|
<ui:define name="content">
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
<div class="imixs-header">
|
<div class="imixs-header">
|
||||||
<h1>
|
<h1>
|
||||||
<h:outputText value="Data View Definition: " />
|
<h:outputText value="Data View Definition: " />
|
||||||
<h:outputText value="#{documentController.document.item['name']} " />
|
<h:outputText value="#{dataViewDefinitionController.data.item['name']} " />
|
||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -39,7 +39,15 @@
|
||||||
<div class="imixs-form-panel">
|
<div class="imixs-form-panel">
|
||||||
|
|
||||||
<div class="imixs-form-section-2">
|
<div class="imixs-form-section-2">
|
||||||
<h1><span class="typcn typcn-edit"></span> Query Definition</h1>
|
<h1><span class="typcn typcn-edit"></span> Query Definition
|
||||||
|
<span style="font-size: 1rem;margin-left:20px;">
|
||||||
|
<h:outputLink
|
||||||
|
value="#{facesContext.externalContext.requestContextPath}/pages/dataviews/data.xhtml?id=#{dataViewDefinitionController.data.uniqueID}&faces-redirect=true"
|
||||||
|
target="dataview"><span class="typcn typcn-camera-outline"
|
||||||
|
style="font-size: 1.2rem;"></span> Test View
|
||||||
|
</h:outputLink>
|
||||||
|
</span>
|
||||||
|
</h1>
|
||||||
<p>
|
<p>
|
||||||
A Query Defintion defines a custom data list based on the
|
A Query Defintion defines a custom data list based on the
|
||||||
<a href="https://www.imixs.org/doc/engine/queries.html"
|
<a href="https://www.imixs.org/doc/engine/queries.html"
|
||||||
|
|
@ -54,20 +62,18 @@
|
||||||
|
|
||||||
<dd>
|
<dd>
|
||||||
<h:inputText required="true" id="txtname_id"
|
<h:inputText required="true" id="txtname_id"
|
||||||
value="#{documentController.document.item['Name']}" />
|
value="#{dataViewDefinitionController.data.item['Name']}" />
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
<div class="imixs-form-section">
|
<div class="imixs-form-section">
|
||||||
|
|
||||||
<dl>
|
<dl>
|
||||||
<dt>
|
<dt>
|
||||||
Description:
|
Description:
|
||||||
</dt>
|
</dt>
|
||||||
|
|
||||||
<dd>
|
<dd>
|
||||||
<h:inputTextarea
|
<h:inputTextarea
|
||||||
value="#{documentController.document.item['description']}" />
|
value="#{dataViewDefinitionController.data.item['description']}" />
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
<dl>
|
<dl>
|
||||||
|
|
@ -76,7 +82,8 @@
|
||||||
</dt>
|
</dt>
|
||||||
|
|
||||||
<dd>
|
<dd>
|
||||||
<h:inputTextarea value="#{documentController.document.item['query']}"
|
<h:inputTextarea
|
||||||
|
value="#{dataViewDefinitionController.data.item['query']}"
|
||||||
style="height: 14em; font-family: 'Courier New', Courier, monospace; autocomplete: off;" />
|
style="height: 14em; font-family: 'Courier New', Courier, monospace; autocomplete: off;" />
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
@ -88,11 +95,11 @@
|
||||||
|
|
||||||
<h:panelGroup layout="block" styleClass="imixs-form-section" id="attributelist"
|
<h:panelGroup layout="block" styleClass="imixs-form-section" id="attributelist"
|
||||||
binding="#{attributelistContainer}">
|
binding="#{attributelistContainer}">
|
||||||
<h1>Attributes </h1>
|
<h1>View Items </h1>
|
||||||
<p>
|
<p>
|
||||||
<span class="typcn typcn-lightbulb"></span>
|
<span class="typcn typcn-lightbulb"></span>
|
||||||
Optional attribute definition for the report result. A attributes reduces
|
Attribute definitions for the vew result. An attribute can adapt single item
|
||||||
the size of a report result and can adapt single item values. Each item of
|
values. Each item of
|
||||||
the attribute list can define an optional label, converter, format and
|
the attribute list can define an optional label, converter, format and
|
||||||
aggregator.
|
aggregator.
|
||||||
|
|
||||||
|
|
@ -109,7 +116,8 @@
|
||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<ui:repeat var="attribute" value="#{dataViewController.attributeList}">
|
<ui:repeat var="attribute"
|
||||||
|
value="#{dataViewDefinitionController.attributeList}">
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<h:inputText value="#{attribute.item['item.name']}"
|
<h:inputText value="#{attribute.item['item.name']}"
|
||||||
|
|
@ -129,19 +137,19 @@
|
||||||
</td>
|
</td>
|
||||||
<td style="font-size: 1.25em;">
|
<td style="font-size: 1.25em;">
|
||||||
<h:commandLink
|
<h:commandLink
|
||||||
actionListener="#{dataViewController.moveAttributeDown(attribute.item['item.name'])}">
|
actionListener="#{dataViewDefinitionController.moveAttributeDown(attribute.item['item.name'])}">
|
||||||
<span class="typcn typcn-arrow-sorted-down"></span>
|
<span class="typcn typcn-arrow-sorted-down"></span>
|
||||||
<f:ajax render="#{attributelistContainer.clientId}"
|
<f:ajax render="#{attributelistContainer.clientId}"
|
||||||
onevent="updateAttributeList" />
|
onevent="updateAttributeList" />
|
||||||
</h:commandLink>
|
</h:commandLink>
|
||||||
<h:commandLink
|
<h:commandLink
|
||||||
actionListener="#{dataViewController.moveAttributeUp(attribute.item['item.name'])}">
|
actionListener="#{dataViewDefinitionController.moveAttributeUp(attribute.item['item.name'])}">
|
||||||
<span class="typcn typcn-arrow-sorted-up"></span>
|
<span class="typcn typcn-arrow-sorted-up"></span>
|
||||||
<f:ajax render="#{attributelistContainer.clientId}"
|
<f:ajax render="#{attributelistContainer.clientId}"
|
||||||
onevent="updateAttributeList" />
|
onevent="updateAttributeList" />
|
||||||
</h:commandLink>
|
</h:commandLink>
|
||||||
<h:commandLink
|
<h:commandLink
|
||||||
actionListener="#{dataViewController.removeAttribute(attribute.item['item.name'])}">
|
actionListener="#{dataViewDefinitionController.removeAttribute(attribute.item['item.name'])}">
|
||||||
<span class="typcn typcn-times imixs-state-info"></span>
|
<span class="typcn typcn-times imixs-state-info"></span>
|
||||||
<f:ajax render="#{attributelistContainer.clientId}"
|
<f:ajax render="#{attributelistContainer.clientId}"
|
||||||
onevent="updateAttributeList" />
|
onevent="updateAttributeList" />
|
||||||
|
|
@ -155,7 +163,7 @@
|
||||||
|
|
||||||
<!-- add button -->
|
<!-- add button -->
|
||||||
<h:commandButton value="#{message.add}" pt:data-id="addposbutton_id"
|
<h:commandButton value="#{message.add}" pt:data-id="addposbutton_id"
|
||||||
actionListener="#{dataViewController.addAttribute}">
|
actionListener="#{dataViewDefinitionController.addAttribute}">
|
||||||
</h:commandButton>
|
</h:commandButton>
|
||||||
</f:ajax>
|
</f:ajax>
|
||||||
</h:panelGroup>
|
</h:panelGroup>
|
||||||
|
|
@ -171,7 +179,14 @@
|
||||||
|
|
||||||
<div class="imixs-form-panel">
|
<div class="imixs-form-panel">
|
||||||
<div class="imixs-form-section-1">
|
<div class="imixs-form-section-1">
|
||||||
<h1><span class="typcn typcn-th-list-outline"></span> Form Definition</h1>
|
<h1><span class="typcn typcn-th-list-outline"></span> Form Definition<span
|
||||||
|
style="font-size: 1rem;margin-left:20px;">
|
||||||
|
<h:outputLink
|
||||||
|
value="#{facesContext.externalContext.requestContextPath}/pages/dataviews/data.xhtml?id=#{dataViewDefinitionController.data.uniqueID}&faces-redirect=true"
|
||||||
|
target="dataview"><span class="typcn typcn-camera-outline"
|
||||||
|
style="font-size: 1.2rem;"></span> Test View
|
||||||
|
</h:outputLink>
|
||||||
|
</span></h1>
|
||||||
<p>
|
<p>
|
||||||
The Form Definition defines query and filter parameters.
|
The Form Definition defines query and filter parameters.
|
||||||
</p>
|
</p>
|
||||||
|
|
@ -182,7 +197,8 @@
|
||||||
Form:
|
Form:
|
||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
<h:inputTextarea value="#{documentController.document.item['form']}"
|
<h:inputTextarea
|
||||||
|
value="#{dataViewDefinitionController.data.item['form']}"
|
||||||
style="height: 27em; font-family: 'Courier New', Courier, monospace; autocomplete: off;" />
|
style="height: 27em; font-family: 'Courier New', Courier, monospace; autocomplete: off;" />
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
@ -194,7 +210,14 @@
|
||||||
<div id="tab-3">
|
<div id="tab-3">
|
||||||
<div class="imixs-form-panel">
|
<div class="imixs-form-panel">
|
||||||
<div class="imixs-form-section-1">
|
<div class="imixs-form-section-1">
|
||||||
<h1><span class="typcn typcn-news"></span> Template</h1>
|
<h1><span class="typcn typcn-news"></span> Template<span
|
||||||
|
style="font-size: 1rem;margin-left:20px;">
|
||||||
|
<h:outputLink
|
||||||
|
value="#{facesContext.externalContext.requestContextPath}/pages/dataviews/data.xhtml?id=#{dataViewDefinitionController.data.uniqueID}&faces-redirect=true"
|
||||||
|
target="dataview"><span class="typcn typcn-camera-outline"
|
||||||
|
style="font-size: 1.2rem;"></span> Test View
|
||||||
|
</h:outputLink>
|
||||||
|
</span></h1>
|
||||||
<dl>
|
<dl>
|
||||||
<dl>
|
<dl>
|
||||||
<dt>
|
<dt>
|
||||||
|
|
@ -202,52 +225,39 @@
|
||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
<h:inputTextarea
|
<h:inputTextarea
|
||||||
value="#{documentController.document.item['poi.update']}"
|
value="#{dataViewDefinitionController.data.item['poi.update']}"
|
||||||
style="height: 27em; font-family: 'Courier New', Courier, monospace; autocomplete: off;" />
|
style="height: 27em; font-family: 'Courier New', Courier, monospace; autocomplete: off;" />
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
<div class="textblock-file-input" style="width: 50%;">
|
<div class="textblock-file-input" style="width: 50%;">
|
||||||
<i:imixsFileUpload showattachments="true"
|
<i:imixsFileUpload showattachments="true"
|
||||||
workitem="#{documentController.document}"
|
workitem="#{dataViewDefinitionController.data}"
|
||||||
context_url="#{facesContext.externalContext.requestContextPath}/api/snapshot/#{documentController.document.item['$uniqueid']}" />
|
context_url="#{facesContext.externalContext.requestContextPath}/api/snapshot/#{dataViewDefinitionController.data.item['$uniqueid']}" />
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="imixs-footer">
|
<div class="imixs-footer">
|
||||||
<h:commandButton action="/pages/admin/dataViewDefinitions?faces-redirect=true"
|
<h:commandButton action="/pages/admin/dataViewDefinitions?faces-redirect=true"
|
||||||
actionListener="#{documentController.save()}" value="#{message.save}" />
|
actionListener="#{dataViewDefinitionController.save()}" value="#{message.save}" />
|
||||||
|
|
||||||
<h:commandButton value="Open View"
|
<h:commandButton value="Open View"
|
||||||
action="/pages/admin/dataViewDefinitions?faces-redirect=true"
|
action="#{dataViewDefinitionController.openTestView()}" />
|
||||||
actionListener="#{documentController.close()}" />
|
|
||||||
|
|
||||||
<h:commandButton value="#{message.close}" immediate="true"
|
<h:commandButton value="#{message.close}" immediate="true"
|
||||||
action="/pages/admin/dataViewDefinitions?faces-redirect=true"
|
action="/pages/admin/dataViewDefinitions?faces-redirect=true" />
|
||||||
actionListener="#{documentController.close()}" />
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</h:form>
|
</h:form>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Init script -->
|
<!-- Init script -->
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
/*<![CDATA[*/
|
/*<![CDATA[*/
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,160 @@
|
||||||
|
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://xmlns.jcp.org/jsf/core"
|
||||||
|
xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
|
||||||
|
xmlns:ui="http://xmlns.jcp.org/jsf/facelets" xmlns:pt="http://xmlns.jcp.org/jsf/passthrough"
|
||||||
|
xmlns:marty="http://xmlns.jcp.org/jsf/composite/marty" xmlns:i="http://xmlns.jcp.org/jsf/composite/imixs"
|
||||||
|
template="/layout/template.xhtml">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<f:metadata>
|
||||||
|
<f:viewAction action="#{dataViewController.onLoad()}" />
|
||||||
|
</f:metadata>
|
||||||
|
|
||||||
|
<ui:define name="content">
|
||||||
|
|
||||||
|
<f:view>
|
||||||
|
<h:form id="textblock_form_id" pt:autocomplete="on">
|
||||||
|
|
||||||
|
<ui:param name="searchresult" value="#{viewHandler.getData(dataViewSearchController)}"></ui:param>
|
||||||
|
<ui:param name="searchresultCount" value="#{dataViewSearchController.getTotalCount()}"></ui:param>
|
||||||
|
<ui:param name="searchPage"
|
||||||
|
value="#{(dataViewSearchController.getPageIndex()+1)}/#{(dataViewSearchController.getTotalPages())}">
|
||||||
|
</ui:param>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="imixs-form">
|
||||||
|
<div class="imixs-header">
|
||||||
|
<h1>
|
||||||
|
<h:outputText value="Data View: " />
|
||||||
|
<h:outputText value="#{dataViewController.definition.item['name']} " />
|
||||||
|
</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="imixs-form-panel">
|
||||||
|
|
||||||
|
<div class="imixs-form-section">
|
||||||
|
|
||||||
|
<ui:include src="/pages/workitems/forms/custom_sections.xhtml">
|
||||||
|
<ui:param name="customFormSections" value="#{customFormController.sections}" />
|
||||||
|
<ui:param name="workitem" value="#{dataViewController.filter}" />
|
||||||
|
<ui:param name="readonly" value="#{section.readonly}" />
|
||||||
|
</ui:include>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<h:panelGroup styleClass="imixs-view imixs-search" layout="block" id="search_view">
|
||||||
|
<!-- Buttons -->
|
||||||
|
<div class="imixs-form-section">
|
||||||
|
<div style="float:left;">
|
||||||
|
<h:commandButton value="Anzeigen" action="#{dataViewController.run()}">
|
||||||
|
<f:ajax render="@form" execute="@form" onevent="updateSearchForm" />
|
||||||
|
</h:commandButton>
|
||||||
|
|
||||||
|
<h:commandButton value="Excel Export" action="#{dataViewController.run()}" />
|
||||||
|
<h:commandButton value="Close" action="/pages/notes?faces-redirect=true" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Sort Order -->
|
||||||
|
<div class="pull-right ">
|
||||||
|
<div class=" ui-button ui-widget ui-state-default ui-corner-all"
|
||||||
|
style="padding: 0 10px;">
|
||||||
|
<h:outputText title="#{message['worklist.sortorder_help']}"
|
||||||
|
value="#{message['worklist.sortorder']}: " />
|
||||||
|
<h:selectOneMenu style="background:#fff;"
|
||||||
|
value="#{dataViewController.filter.item['sortorder']}">
|
||||||
|
<f:selectItem itemValue="0"
|
||||||
|
itemLabel="#{message['worklist.sortorder_relevance']}" />
|
||||||
|
<f:selectItem itemValue="3"
|
||||||
|
itemLabel="#{message['worklist.sortorder_lastupdate']}" />
|
||||||
|
<f:selectItem itemValue="1"
|
||||||
|
itemLabel="#{message['worklist.sortorder_newest']}" />
|
||||||
|
<f:selectItem itemValue="2"
|
||||||
|
itemLabel="#{message['worklist.sortorder_oldest']}" />
|
||||||
|
|
||||||
|
<f:ajax event="change" render="@form" listener="#{viewHandler.init()}"
|
||||||
|
onevent="imixsOfficeMain.layoutAjaxEvent" />
|
||||||
|
</h:selectOneMenu>
|
||||||
|
<span>
|
||||||
|
<h:outputText style="margin-left:7px;" value="#{searchPage}" />
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h:commandButton actionListener="#{viewHandler.back(dataViewSearchController)}"
|
||||||
|
style="height: 31px;" disabled="#{dataViewSearchController.pageIndex==0}"
|
||||||
|
value="◀◀ #{message.prev}">
|
||||||
|
<f:ajax render="search_view"
|
||||||
|
onevent="function(data) { imixsOfficeMain.layoutAjaxEvent(data, '#{component.parent.parent.clientId}') }" />
|
||||||
|
</h:commandButton>
|
||||||
|
<h:commandButton actionListener="#{viewHandler.forward(dataViewSearchController)}"
|
||||||
|
style="height: 31px;" disabled="#{dataViewSearchController.endOfList}"
|
||||||
|
value="#{message.next} ▶▶">
|
||||||
|
<f:ajax render="search_view"
|
||||||
|
onevent="function(data) { imixsOfficeMain.layoutAjaxEvent(data, '#{component.parent.parent.clientId}') }" />
|
||||||
|
</h:commandButton>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="imixs-form-section">
|
||||||
|
|
||||||
|
|
||||||
|
<div class="search-result-summary">#{message.total_result} #{searchresultCount}
|
||||||
|
#{message.serach_hits}</div>
|
||||||
|
<h:dataTable id="view_body" styleClass="imixsdatatable" value="#{searchresult}"
|
||||||
|
var="record">
|
||||||
|
|
||||||
|
<h:column>
|
||||||
|
<f:facet name="header">#{message.name}</f:facet>
|
||||||
|
<h:link outcome="/pages/workitems/workitem.xhtml?faces-redirect=true"
|
||||||
|
styleClass="imixs-viewentry-main-link">
|
||||||
|
<h:outputText value="#{record.item['$workflowsummary']}" />
|
||||||
|
<f:param name="id" value="#{record.item['$uniqueid']}" />
|
||||||
|
</h:link>
|
||||||
|
</h:column>
|
||||||
|
|
||||||
|
|
||||||
|
<h:column>
|
||||||
|
<f:facet name="header">#{message.modified}</f:facet>
|
||||||
|
<h:outputText value="#{record.item['$modified']}">
|
||||||
|
<f:convertDateTime timeZone="#{message.timeZone}" type="both"
|
||||||
|
pattern="#{message.dateTimePattern}" />
|
||||||
|
</h:outputText>
|
||||||
|
|
||||||
|
</h:column>
|
||||||
|
|
||||||
|
|
||||||
|
</h:dataTable>
|
||||||
|
</div>
|
||||||
|
</h:panelGroup>
|
||||||
|
</div>
|
||||||
|
</h:form>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Init script -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
/*<![CDATA[*/
|
||||||
|
|
||||||
|
$(document).ready(function () {
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
/*]]>*/
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</f:view>
|
||||||
|
</ui:define>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</ui:composition>
|
||||||
9
pom.xml
9
pom.xml
|
|
@ -129,14 +129,14 @@
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
<!-- Imixs Code Formatter and Checkstyle -->
|
<!-- Imixs Code Formatter and Checkstyle
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>net.revelc.code.formatter</groupId>
|
<groupId>net.revelc.code.formatter</groupId>
|
||||||
<artifactId>formatter-maven-plugin</artifactId>
|
<artifactId>formatter-maven-plugin</artifactId>
|
||||||
<version>2.26.0</version>
|
<version>2.26.0</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<configFile>
|
<configFile>
|
||||||
https://raw.githubusercontent.com/imixs/imixs-workflow/refs/heads/master/imixs-code-style.xml</configFile>
|
https://raw.githubusercontent.com/imixs/imixs-workflow/refs/heads/master/imixs-code-style.xml</configFile>
|
||||||
<lineEnding>LF</lineEnding>
|
<lineEnding>LF</lineEnding>
|
||||||
</configuration>
|
</configuration>
|
||||||
<executions>
|
<executions>
|
||||||
|
|
@ -148,13 +148,14 @@
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-checkstyle-plugin</artifactId>
|
<artifactId>maven-checkstyle-plugin</artifactId>
|
||||||
<version>3.3.0</version>
|
<version>3.3.0</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<configLocation>
|
<configLocation>
|
||||||
https://raw.githubusercontent.com/imixs/imixs-workflow/master/imixs-checkstyle-8.44.xml</configLocation>
|
https://raw.githubusercontent.com/imixs/imixs-workflow/master/imixs-checkstyle-8.44.xml</configLocation>
|
||||||
<failOnViolation>true</failOnViolation>
|
<failOnViolation>true</failOnViolation>
|
||||||
</configuration>
|
</configuration>
|
||||||
<executions>
|
<executions>
|
||||||
|
|
@ -166,6 +167,8 @@
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
-->
|
||||||
|
|
||||||
</plugins>
|
</plugins>
|
||||||
<finalName>office-alexander-logistics</finalName>
|
<finalName>office-alexander-logistics</finalName>
|
||||||
</build>
|
</build>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue