fix archive suche

This commit is contained in:
Ralph Soika 2024-12-04 17:28:07 +01:00
parent 7bdf108532
commit 2e61ef39e3
4 changed files with 104 additions and 63 deletions

View file

@ -24,8 +24,6 @@
package com.alexanderlogistics;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
@ -37,7 +35,7 @@ import org.imixs.workflow.ItemCollection;
import org.imixs.workflow.office.views.SearchController;
import org.imixs.workflow.office.views.SearchEvent;
import jakarta.enterprise.context.RequestScoped;
import jakarta.enterprise.context.SessionScoped;
import jakarta.enterprise.event.Observes;
import jakarta.inject.Inject;
import jakarta.inject.Named;
@ -51,8 +49,8 @@ import jakarta.inject.Named;
*/
@Named
// @SessionScoped
@RequestScoped
@SessionScoped
// @RequestScoped
public class CustomSearchController implements Serializable {
private static final long serialVersionUID = 1L;
@ -195,17 +193,25 @@ public class CustomSearchController implements Serializable {
*/
public String refreshAGLArchive() {
String phrase = searchController.getSearchFilter().getItemValueString("phrase");
searchController.getSearchFilter().setItemValue("Type", "workitemarchive");
try {
phrase = URLEncoder.encode(phrase, "UTF-8");
} catch (UnsupportedEncodingException e) {
logger.severe("unable to encode search phrase!");
e.printStackTrace();
}
searchController.refreshSearch();
searchController.getSearchFilter().setItemValue("type", "workitemarchive");
String action = "/pages/workitems/agl_archive.xhtml?faces-redirect=true&phrase=" + phrase;
searchController.setPageIndex(0);
return action;
// String phrase =
// searchController.getSearchFilter().getItemValueString("phrase");
// searchController.getSearchFilter().setItemValue("type", "workitemarchive");
// try {
// phrase = URLEncoder.encode(phrase, "UTF-8");
// } catch (UnsupportedEncodingException e) {
// logger.severe("unable to encode search phrase!");
// e.printStackTrace();
// }
// String action =
// "/pages/workitems/agl_archive.xhtml?faces-redirect=true&phrase=" + phrase;
// searchController.setPageIndex(0);
// return action;
}
/**

View file

@ -10,6 +10,7 @@
</f:metadata>
</h:head>
<ui:define name="scripts">
<script type="text/javascript"
src="#{facesContext.externalContext.requestContextPath}/js/imixs-office.worklist.js?build=#{app.application_build_timestamp}"></script>
@ -18,12 +19,21 @@
</ui:define>
<ui:define name="content">
<ui:include src="/error_message.xhtml" />
<f:view>
<h:form>
<ui:param name="searchresult" value="#{viewHandler.getData(searchController)}"></ui:param>
<ui:param name="searchresultCount" value="#{searchController.getTotalCount()}"></ui:param>
<h:panelGroup styleClass="imixs-view imixs-search" layout="block" id="serach_view">
<h:panelGroup styleClass="imixs-view imixs-search" layout="block" id="search_view">
<ui:param name="searchresult" value="#{viewHandler.getData(searchController)}"></ui:param>
<ui:param name="noresult"
value="#{(empty searchresult) and (empty searchController.searchFilter.item['phrase'])}">
</ui:param>
<ui:param name="searchresultCount" value="#{searchController.getTotalCount()}"></ui:param>
<ui:param name="searchPage"
value="#{(searchController.getPageIndex()+1)}/#{(searchController.getTotalPages())}">
</ui:param>
<h:panelGroup rendered="#{(!empty searchresult) }">
<!-- placeholder to ensure data is loaded immediately - do not remove -->
</h:panelGroup>
<div class="imixs-header">
@ -41,40 +51,72 @@
</div>
</ui:fragment>
<div class="imixs-view-submit-panel">
<!-- Search Button and Search Order -->
<h:commandButton value="#{message.search}"
action="#{customSearchController.refreshAGLArchive()}">
<f:ajax render="@form" execute="@form" onevent="updateSearchForm" />
</h:commandButton>
<h:commandButton value="#{message.reset}" action="#{customSearchController.resetSearch()}">
<f:ajax render="@form" execute="@form" onevent="updateSearchForm" />
</h:commandButton>
<!-- Sort Order -->
<div style="float: right; padding: 0 10px;"
class="pull-right ui-button ui-widget ui-state-default ui-corner-all">
<h:outputText title="#{message['worklist.sortorder_help']}"
value="#{message['worklist.sortorder']}: " />
<h:selectOneMenu style="background:#fff;"
value="#{searchController.searchFilter.item['sortorder']}">
<f:selectItem itemValue="" itemLabel="#{message['worklist.sortorder_relevance']}" />
<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="#{customSearchController.refreshAGLArchive}"
onevent="imixsOfficeMain.layoutAjaxEvent" />
</h:selectOneMenu>
<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="#{searchController.searchFilter.item['sortorder']}">
<f:selectItem itemValue=""
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="#{customSearchController.refreshAGLArchive}"
onevent="imixsOfficeMain.layoutAjaxEvent" />
</h:selectOneMenu>
<span>
<h:outputText style="margin-left:7px;" value="#{searchPage}" />
</span>
</div>
<h:commandButton actionListener="#{viewHandler.back(searchController)}"
style="height: 31px;" disabled="#{searchController.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(searchController)}"
style="height: 31px;" disabled="#{searchController.endOfList}"
value="#{message.next} ▶▶">
<f:ajax render="search_view"
onevent="function(data) { imixsOfficeMain.layoutAjaxEvent(data, '#{component.parent.parent.clientId}') }" />
</h:commandButton>
</div>
</div>
<ui:param name="noresult"
value="#{(empty searchresult) and (empty searchController.searchFilter.item['phrase'])}">
</ui:param>
<ui:fragment rendered="#{!noresult}">
<h:panelGroup layout="block" id="worklist-body">
<div class="search-result-summary">#{message.total_result} #{searchresultCount}
#{message.serach_hits}</div>
@ -85,6 +127,7 @@
</ui:include>
</ui:repeat>
<!-- display empty search result -->
<h:panelGroup
rendered="#{(empty searchresult) and (empty facesContext.maximumSeverity)}">
@ -109,18 +152,18 @@
<div class="imixs-footer">
<h:commandButton actionListener="#{viewHandler.back(searchController)}"
disabled="#{searchController.pageIndex==0}" value="#{message.prev}">
<f:ajax render="serach_view"
onevent="function(data) { imixsOfficeMain.layoutAjaxEvent(data, '#{component.parent.parent.clientId}') }" />
</h:commandButton>
<h:commandButton actionListener="#{viewHandler.forward(searchController)}"
disabled="#{searchController.endOfList}" value="#{message.next}">
<f:ajax render="serach_view"
onevent="function(data) { imixsOfficeMain.layoutAjaxEvent(data, '#{component.parent.parent.clientId}') }" />
</h:commandButton>
<div class="pull-right ">
<h:commandButton actionListener="#{viewHandler.back(searchController)}"
disabled="#{searchController.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(searchController)}"
disabled="#{searchController.endOfList}" value="#{message.next} ▶▶">
<f:ajax render="search_view"
onevent="function(data) { imixsOfficeMain.layoutAjaxEvent(data, '#{component.parent.parent.clientId}') }" />
</h:commandButton>
</div>
</div>
</ui:fragment>

View file

@ -4,7 +4,7 @@
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">
<!-- *** Krieger Custom Search form *** -->
<!-- *** AGL Custom Search form *** -->
<style>
.invioce-container {
display: flex;

View file

@ -3586,7 +3586,7 @@ if (workitem.getItemValueString('txtcomment') == '' ) {
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="Task_8" id="BPMNShape_Task_8">
<dc:Bounds height="50.0" width="110.0" x="1950.0" y="810.0"/>
<dc:Bounds height="50.0" width="110.0" x="1950.0" y="800.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="IntermediateCatchEvent_26" id="BPMNShape_IntermediateCatchEvent_26">
<dc:Bounds height="36.0" width="36.0" x="1677.0" y="807.0"/>
@ -3595,9 +3595,9 @@ if (workitem.getItemValueString('txtcomment') == '' ) {
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="ExclusiveGateway_4" id="BPMNShape_ExclusiveGateway_4" isMarkerVisible="true">
<dc:Bounds height="50.0" width="50.0" x="1800.0" y="810.0"/>
<dc:Bounds height="50.0" width="50.0" x="1800.0" y="800.0"/>
<bpmndi:BPMNLabel id="BPMNLabel_131">
<dc:Bounds height="20.0" width="100.0" x="1775.0" y="863.0"/>
<dc:Bounds height="20.0" width="100.0" x="1775.0" y="853.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="IntermediateCatchEvent_27" id="BPMNShape_IntermediateCatchEvent_27">
@ -3937,13 +3937,11 @@ if (workitem.getItemValueString('txtcomment') == '' ) {
<bpmndi:BPMNEdge bpmnElement="SequenceFlow_55" id="BPMNEdge_SequenceFlow_56" sourceElement="BPMNShape_IntermediateCatchEvent_26" targetElement="BPMNShape_ExclusiveGateway_4">
<bpmndi:BPMNLabel id="BPMNLabel_137"/>
<di:waypoint x="1713.0" y="825.0"/>
<di:waypoint x="1756.5" y="825.0"/>
<di:waypoint x="1756.5" y="835.0"/>
<di:waypoint x="1800.0" y="835.0"/>
<di:waypoint x="1800.0" y="825.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="SequenceFlow_56" id="BPMNEdge_SequenceFlow_57" sourceElement="BPMNShape_ExclusiveGateway_4" targetElement="BPMNShape_IntermediateCatchEvent_29">
<bpmndi:BPMNLabel id="BPMNLabel_138"/>
<di:waypoint x="1825.0" y="860.0"/>
<di:waypoint x="1825.0" y="850.0"/>
<di:waypoint x="1825.0" y="897.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="SequenceFlow_57" id="BPMNEdge_SequenceFlow_58" sourceElement="BPMNShape_IntermediateCatchEvent_29" targetElement="BPMNShape_Task_7">
@ -3955,23 +3953,17 @@ if (workitem.getItemValueString('txtcomment') == '' ) {
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="SequenceFlow_58" id="BPMNEdge_SequenceFlow_59" sourceElement="BPMNShape_ExclusiveGateway_4" targetElement="BPMNShape_IntermediateCatchEvent_27">
<bpmndi:BPMNLabel id="BPMNLabel_140"/>
<di:waypoint x="1850.0" y="835.0"/>
<di:waypoint x="1868.5" y="835.0"/>
<di:waypoint x="1868.5" y="825.0"/>
<di:waypoint x="1850.0" y="825.0"/>
<di:waypoint x="1887.0" y="825.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="SequenceFlow_60" id="BPMNEdge_SequenceFlow_61" sourceElement="BPMNShape_IntermediateCatchEvent_27" targetElement="BPMNShape_Task_8">
<bpmndi:BPMNLabel id="BPMNLabel_141"/>
<di:waypoint x="1923.0" y="825.0"/>
<di:waypoint x="1936.5" y="825.0"/>
<di:waypoint x="1936.5" y="835.0"/>
<di:waypoint x="1950.0" y="835.0"/>
<di:waypoint x="1950.0" y="825.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="SequenceFlow_61" id="BPMNEdge_SequenceFlow_62" sourceElement="BPMNShape_Task_8" targetElement="BPMNShape_EndEvent_1">
<bpmndi:BPMNLabel id="BPMNLabel_142"/>
<di:waypoint x="2060.0" y="835.0"/>
<di:waypoint x="2083.5" y="835.0"/>
<di:waypoint x="2083.5" y="825.0"/>
<di:waypoint x="2060.0" y="825.0"/>
<di:waypoint x="2107.0" y="825.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="SequenceFlow_40" id="BPMNEdge_SequenceFlow_41" sourceElement="BPMNShape_IntermediateCatchEvent_31" targetElement="BPMNShape_IntermediateCatchEvent_25">