Skip to content

Commit

Permalink
impl, improved chronical view
Browse files Browse the repository at this point in the history
issue #569
  • Loading branch information
rsoika committed Feb 5, 2024
1 parent ae00891 commit c699b3d
Show file tree
Hide file tree
Showing 3 changed files with 118 additions and 107 deletions.
Original file line number Diff line number Diff line change
@@ -1,55 +1,58 @@
<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">
<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">

<!-- Navigation panel - toggle buttons for each category -->
<h:panelGroup id="chronicle-nav" layout="block" styleClass="filter imixs-no-print">
<ul>
<li><h:commandLink
<li>
<h:commandLink
styleClass="#{'history' eq chronicleController.filter?'active':!empty chronicleController.filter?'inactive':''}"
actionListener="#{chronicleController.toggleFilter('history')}">
<span class="typcn typcn-th-menu-outline"
title="#{message.history}"></span>
<span class="typcn typcn-th-menu-outline" title="#{message.history}"></span>
<f:ajax render="chronicle-main chronicle-nav" />
</h:commandLink></li>
</h:commandLink>
</li>

<li><h:commandLink
<li>
<h:commandLink
styleClass="#{'comment' eq chronicleController.filter?'active':!empty chronicleController.filter?'inactive':''}"
actionListener="#{chronicleController.toggleFilter('comment')}">
<span class="typcn typcn-messages" title="#{message.comments}"></span>
<f:ajax render="chronicle-main chronicle-nav" />
</h:commandLink></li>
</h:commandLink>
</li>


<li><h:commandLink
<li>
<h:commandLink
styleClass="#{'dms' eq chronicleController.filter?'active':!empty chronicleController.filter?'inactive':''}"
actionListener="#{chronicleController.toggleFilter('dms')}">
<span class="typcn typcn-folder-open dms"
title="#{message['form.attachments.files']}"></span>
<span class="typcn typcn-folder-open dms" title="#{message['form.attachments.files']}"></span>
<f:ajax render="chronicle-main chronicle-nav" />
</h:commandLink></li>
</h:commandLink>
</li>


<li><h:commandLink
<li>
<h:commandLink
styleClass="#{'reference' eq chronicleController.filter?'active':!empty chronicleController.filter?'inactive':''}"
actionListener="#{chronicleController.toggleFilter('reference')}">
<span class="typcn typcn-export-outline"
title="#{message.references}"></span>
<span class="typcn typcn-export-outline" title="#{message.references}"></span>
<f:ajax render="chronicle-main chronicle-nav" />
</h:commandLink></li>
</h:commandLink>
</li>


<li><h:commandLink
<li>
<h:commandLink
styleClass="#{'version' eq chronicleController.filter?'active':!empty chronicleController.filter?'inactive':''}"
actionListener="#{chronicleController.toggleFilter('version')}">
<span class="typcn typcn-archive" title="#{message.versions}"></span>
<span class="typcn typcn-starburst-outline" title="#{message.versions}"></span>
<f:ajax render="chronicle-main chronicle-nav" />
</h:commandLink></li>
</h:commandLink>
</li>

</ul>

Expand All @@ -64,28 +67,30 @@
<h:panelGroup id="chronicle-main" layout="block" style="">

<ui:fragment rendered="#{! empty workflowController.workitem.item['$lasteventdate']}">
<table class="imixs-workitem-chronicle-small">
<tr>
<td style=""><strong>#{message.created}: </strong></td>
<td style="width:100%;"><h:outputText value="#{workflowController.workitem.item['$created']}"
style="font-weight: normal;">
<f:convertDateTime timeZone="#{message.timeZone}"
pattern="#{message.dateTimePattern}" />
</h:outputText> #{message.by} #{userController.getUserName(workflowController.workitem.item['$creator'])}
</td>
</tr>

<tr>
<td style="min-width:95px;"><strong>#{message.modified}: </strong></td>
<td style="width:100%;"><h:outputText value="#{workflowController.workitem.item['$lasteventdate']}"
style="font-weight: normal;">
<f:convertDateTime timeZone="#{message.timeZone}"
pattern="#{message.dateTimePattern}" />
</h:outputText> #{message.by} #{userController.getUserName(workflowController.workitem.item['$editor'])}
</td>
</tr>

</table>
<table class="imixs-workitem-chronicle-small">
<tr>
<td style=""><strong>#{message.created}: </strong></td>
<td style="width:100%;">
<h:outputText value="#{workflowController.workitem.item['$created']}"
style="font-weight: normal;">
<f:convertDateTime timeZone="#{message.timeZone}" pattern="#{message.dateTimePattern}" />
</h:outputText> #{message.by}
#{userController.getUserName(workflowController.workitem.item['$creator'])}
</td>
</tr>

<tr>
<td style="min-width:95px;"><strong>#{message.modified}: </strong></td>
<td style="width:100%;">
<h:outputText value="#{workflowController.workitem.item['$lasteventdate']}"
style="font-weight: normal;">
<f:convertDateTime timeZone="#{message.timeZone}" pattern="#{message.dateTimePattern}" />
</h:outputText> #{message.by}
#{userController.getUserName(workflowController.workitem.item['$editor'])}
</td>
</tr>

</table>
</ui:fragment>

<table>
Expand All @@ -94,32 +99,32 @@

<!-- print YEAR -->
<tr class="year">
<td colspan="3" ><h2
style="text-align: center; border-bottom: 1px solid #ddd; margin-top:20px;">#{year}</h2></td>
<td colspan="3">
<h2 style="text-align: center; border-bottom: 1px solid #ddd; margin-top:20px;">#{year}</h2>
</td>
</tr>

<!-- print all MONTHs -->
<ui:repeat var="month"
value="#{chronicleController.getMonths(year)}">
<ui:repeat var="month" value="#{chronicleController.getMonths(year)}">
<ui:param name="message_month" value="month_#{month}"></ui:param>
<tr class="month">
<td colspan="3"><h3 style="text-align: center;">#{message[message_month]}</h3></td>
<td colspan="3">
<h3 style="text-align: center;">#{message[message_month]}</h3>
</td>

</tr>

<!-- show chronic by month -->
<ui:repeat var="chronicle"
value="#{chronicleController.getChroniclePerMonth(year,month)}">

<ui:repeat var="chronicle" value="#{chronicleController.getChroniclePerMonth(year,month)}">

<ui:include src="workitem_chronicle_entry.xhtml">
<ui:param name="chronicle" value="#{chronicle}" />
</ui:include>
</ui:repeat>
</ui:repeat>
</ui:repeat>
</table>

</h:panelGroup>

</ui:composition>
</h:panelGroup>

</ui:composition>
Original file line number Diff line number Diff line change
@@ -1,34 +1,27 @@
<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">
<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">


<ui:param name="profile"
value="#{userController.getProfile(chronicle.user)}"></ui:param>
<ui:param name="profile" value="#{userController.getProfile(chronicle.user)}"></ui:param>


<!-- 1) User Icon and Time -->
<tr class="header">
<td style="vertical-align: top;"><h:graphicImage
styleClass="imixs-workitem-chronicle-usericon imixs-no-print"
title="#{profile.item['txtusername']}"
rendered="#{! empty profile.item['txtusericon']}"
<td style="vertical-align: top;">
<h:graphicImage styleClass="imixs-workitem-chronicle-usericon imixs-no-print"
title="#{profile.item['txtusername']}" rendered="#{! empty profile.item['txtusericon']}"
value="/api/snapshot/#{profile.item['$uniqueid']}/file/#{profile.item['txtusericon']}">
</h:graphicImage> <!-- optional - user initials --> <h:panelGroup layout="block"
rendered="#{empty profile.item['txtusericon']}">
<h:outputText styleClass="imixs-workitem-chronicle-usericon"
title="#{profile.item['txtusername']}"
</h:graphicImage> <!-- optional - user initials -->
<h:panelGroup layout="block" rendered="#{empty profile.item['txtusericon']}">
<h:outputText styleClass="imixs-workitem-chronicle-usericon" title="#{profile.item['txtusername']}"
value="#{profile.item['txtinitials']}" />
</h:panelGroup> <h:outputText value="#{chronicle.date}" title="#{chronicle.date}"
class="date">
<f:convertDateTime timeZone="#{message.timeZone}" type="both"
pattern="#{message.dateTimePattern}" />
</h:outputText> - #{profile.item['txtusername']}</td>
</h:panelGroup>
<h:outputText value="#{chronicle.date}" title="#{chronicle.date}" class="date">
<f:convertDateTime timeZone="#{message.timeZone}" type="both" pattern="#{message.dateTimePattern}" />
</h:outputText> - #{profile.item['txtusername']}
</td>
</tr>


Expand Down Expand Up @@ -80,9 +73,11 @@
<!-- dms -->
<ui:fragment rendered="#{'dms' eq entry.item['type']}">
<tr class="entry files">
<td><ui:include src="workitem_chronicle_entry_dms.xhtml">
<td>
<ui:include src="workitem_chronicle_entry_dms.xhtml">
<ui:param name="attachment" value="#{entry}" />
</ui:include></td>
</ui:include>
</td>
</tr>
</ui:fragment>

Expand All @@ -95,26 +90,25 @@
<h:panelGroup pt:title="#{message.reference} #{entry.item['date']}"
styleClass="typcn typcn-export-outline"></h:panelGroup>
</div>
<div class="content-block">
<div class="content-block">
<h:panelGroup styleClass="">
<h:link outcome="/pages/workitems/workitem">
<h:outputText escape="false" value="#{entry.item['message']}" />
<f:param name="id" value="#{entry.item['$uniqueid']}" />
</h:link>
<h:outputText escape="false" value="#{entry.item['message']}" />
<f:param name="id" value="#{entry.item['$uniqueid']}" />
</h:link>
<br />
<!-- Status -->
<h:outputText value="#{entry.item['$workflowgroup']} » " />
<h:outputText value="#{entry.item['$workflowstatus']}" />
<br />
<div class="">
<h:outputText value="#{entry.item['$lasteventdate']}"
style="font-weight: normal;">
<h:outputText value="#{entry.item['$lasteventdate']}" style="font-weight: normal;">
<f:convertDateTime timeZone="#{message.timeZone}"
pattern="#{message.dateTimePattern}" />
</h:outputText>
<h:outputLabel value=" - " />


<h:outputText value="#{userController.getUserName(entry.item['$lasteditor'])}" />


Expand All @@ -133,7 +127,7 @@
<td>
<div class="image-block">
<h:panelGroup pt:title="#{message.version} #{entry.item['date']}"
styleClass="typcn typcn-archive"></h:panelGroup>
styleClass="typcn #{entry.item['icon']}"></h:panelGroup>
</div>
<div class="content-block">
<h:panelGroup styleClass="imixs-comments-entry">
Expand All @@ -142,18 +136,16 @@
<f:param name="id" value="#{entry.item['$uniqueid']}" />
</h:link>
</h:panelGroup>

<br />
<!-- Status -->
<h:outputText value="#{entry.item['$workflowgroup']} » " />
<h:outputText value="#{entry.item['$workflowstatus']}" />
<div class="pull-right">
<h:outputText value="#{entry.item['$lasteventdate']}"
style="font-weight: normal;">
<f:convertDateTime timeZone="#{message.timeZone}"
pattern="dd. MMM (HH:mm)" />
</h:outputText>
</div>
<!-- Status -->
<h:outputText value="#{entry.item['$workflowgroup']} » " />
<h:outputText value="#{entry.item['$workflowstatus']}" />
<div class="pull-right">
<h:outputText value="#{entry.item['$lasteventdate']}" style="font-weight: normal;">
<f:convertDateTime timeZone="#{message.timeZone}" pattern="dd. MMM (HH:mm)" />
</h:outputText>
</div>
</div>
</td>
</tr>
Expand All @@ -171,5 +163,4 @@



</ui:composition>

</ui:composition>
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@

import org.imixs.workflow.ItemCollection;
import org.imixs.workflow.WorkflowKernel;
import org.imixs.workflow.engine.DocumentService;
import org.imixs.workflow.faces.data.WorkflowController;
import org.imixs.workflow.faces.data.WorkflowEvent;

Expand Down Expand Up @@ -102,6 +103,9 @@ public class ChronicleController implements Serializable {
@EJB
protected WorkitemService workitemService;

@EJB
protected DocumentService documentService;

private DateFormat dateFormat = null;

@SuppressWarnings("unchecked")
Expand Down Expand Up @@ -238,6 +242,7 @@ public void init() {
continue;
}

ItemCollection versionFull = documentService.load(version.getUniqueID());
// Date date = version.getItemValueDate(WorkflowKernel.LASTEVENTDATE);
Date date = version.getItemValueDate(WorkflowKernel.CREATED);
String message = version.getItemValueString("$WorkflowSummary");
Expand All @@ -247,9 +252,19 @@ public void init() {
entry.replaceItemValue("$WorkflowGroup", version.getItemValue("$WorkflowGroup"));
entry.replaceItemValue("$WorkflowStatus", version.getItemValue("$WorkflowStatus"));
entry.replaceItemValue(WorkflowKernel.LASTEVENTDATE, version.getItemValue(WorkflowKernel.LASTEVENTDATE));
entry.replaceItemValue("date", date);

entry.replaceItemValue("user", user);
entry.replaceItemValue("message", message);
if (!versionFull.getItemValueString("$uniqueIdSource").isEmpty()) {
entry.replaceItemValue("message", message);
entry.replaceItemValue("icon", "typcn-starburst-outline");
if (versionFull.hasItem(WorkflowKernel.CREATED + ".version")) {
date = versionFull.getItemValueDate(WorkflowKernel.CREATED + ".version");
}
} else {
entry.replaceItemValue("message", message);
entry.replaceItemValue("icon", "typcn-starburst");
}
entry.replaceItemValue("date", date);
entry.replaceItemValue("type", "version");
entry.replaceItemValue(WorkflowKernel.UNIQUEID, version.getUniqueID());

Expand Down

0 comments on commit c699b3d

Please sign in to comment.