office-dynamixs-ai/dynamixs-ai-app/docker/deployments/dynamixs-ai.war/pages/workitems/dms_search.xhtml
2025-05-31 14:46:56 +02:00

196 lines
6.3 KiB
HTML

<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:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
xmlns:a="http://xmlns.jcp.org/jsf/passthrough"
template="/layout/template.xhtml">
<h:head>
<!-- init search controller -->
<f:metadata>
<f:viewAction action="#{searchController.init()}"
actionListener="#{searchController.setDMSMode(true)}" />
</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>
<script type="text/javascript"
src="#{facesContext.externalContext.requestContextPath}/js/imixs-office.worklist.custom.js?build=#{app.application_build_timestamp}"></script>
<script type="text/javascript">
/*<![CDATA[*/
document.cookie = "imixs.office.navigation=/pages/workitems/dms_search.jsf;path=#{facesContext.externalContext.requestContextPath}/";
/* reqlace special characters in attachemnt url */
$(document).ready(
function() {
// change search title...
$("#worklist-title").text(
"#{message['nav.search_documents']}");
});
/* Method to update document preview */
function updateIframe(uniqueid, filename) {
$("#imixs-dms-title").text(filename);
//console.log(docurl);
var iframe = document.getElementById('imixs_dms_iframe');
iframe.src = '#{facesContext.externalContext.requestContextPath}/api/snapshot/'
+ uniqueid + "/file/" + filename;
}
/*]]>*/
</script>
</ui:define>
<ui:define name="content">
<f:view>
<h:form>
<ui:param name="searchresult"
value="#{viewHandler.getData(searchController)}"></ui:param>
<!-- **** General info ***** -->
<div class="row imixs-view imixs-dms-search">
<div class="col-6" style="padding: 0;">
<div class="imixs-header">
<h2>#{message['nav.search_documents']}</h2>
<!-- *** DMS Search form *** -->
<div class="imixs-form-section">
<dl>
<dt>#{message['worklist.search_phrase']}:</dt>
<dd>
<h:inputText a:data-id="input_phrase"
value="#{searchController.searchFilter.item['phrase']}" />
</dd>
</dl>
</div>
<div class="imixs-form-section">
<dl>
<!-- date range -->
<dt>
<h:outputText title="#{message['worklist.date_range_help']}"
value="#{message['worklist.date_range']}: " />
</dt>
<dd>
<h:inputText
value="#{searchController.searchFilter.item['date.from']}"
title="#{message['worklist.date_range_help']}"
class="imixs-date">
<f:convertDateTime pattern="#{message.datePatternShort}"
timeZone="#{message.timeZone}" />
</h:inputText>
-
<h:inputText
value="#{searchController.searchFilter.item['date.to']}"
title="#{message['worklist.date_range_help']}"
class="imixs-date">
<f:convertDateTime pattern="#{message.datePatternShort}"
timeZone="#{message.timeZone}" />
</h:inputText>
</dd>
</dl>
<!-- archive -->
<dl>
<dt>#{message['worklist.archive']}:</dt>
<dd>
<h:selectManyCheckbox id="view_filter"
value="#{searchController.searchFilter.itemListArray['type']}">
<f:selectItem
itemLabel="#{message['worklist.archive_selection']}"
itemValue="workitemarchive" />
<f:ajax event="change" render="@form"
listener="#{searchController.refreshSearch}"
onevent="imixsOfficeMain.layoutAjaxEvent" />
</h:selectManyCheckbox>
</dd>
</dl>
</div>
<h:commandButton value="#{message.search}"
actionListener="#{searchController.setDMSMode(true)}"
style="float:left;margin-right:10px;">
<f:ajax render="@form" execute="@form"
onevent="updateSearchForm" />
</h:commandButton>
</div>
<!-- display search result -->
<ui:param name="noresult"
value="#{(empty searchresult) and (empty searchController.searchFilter.item['phrase'])}"></ui:param>
<ui:fragment rendered="#{!noresult}">
<h:panelGroup layout="block" class="imixs-body"
style="clear:left" id="worklist-body">
<ui:repeat var="workitem"
value="#{viewHandler.getData(searchController)}">
<ui:include src="dms_viewentry.xhtml">
<ui:param name="workitem" value="#{workitem}" />
</ui:include>
</ui:repeat>
<!-- display parsing error -->
<h:panelGroup rendered="#{! empty facesContext.maximumSeverity}"
styleClass="ui-widget">
<div class="ui-state-error"
style="padding: .7em; margin-bottom: .7em; border: none;">
<h3>
<span class="typcn typcn-warning-outline"></span>
#{message.search_error_title}
</h3>
<p>
<h:messages globalOnly="true" />
</p>
</div>
</h:panelGroup>
</h:panelGroup>
<div class="imixs-footer">
<h:commandButton
actionListener="#{viewHandler.back(searchController)}"
disabled="#{searchController.pageIndex==0}"
value="#{message.prev}">
</h:commandButton>
<h:commandButton
actionListener="#{viewHandler.forward(searchController)}"
disabled="#{searchController.endOfList}"
value="#{message.next}">
</h:commandButton>
</div>
</ui:fragment>
<!-- display empty search result -->
<ui:fragment rendered="#{noresult}">
<br />
<h:panelGroup style="clear:left"
rendered="#{(empty viewHandler.getData(searchController)) and (empty facesContext.maximumSeverity)}">
<h3>#{message.empty_worklist}</h3>
</h:panelGroup>
</ui:fragment>
</div>
<div class="col-6" style="padding: 0 0 0 10px;">
<h2 id="imixs-dms-title"></h2>
<!-- *** Document Viewer **** -->
<iframe id="imixs_dms_iframe" src="" width="100%" height="1200px"></iframe>
</div>
</div>
</h:form>
</f:view>
</ui:define>
</ui:composition>