Skip to content

Commit

Permalink
docu
Browse files Browse the repository at this point in the history
issue #458
  • Loading branch information
rsoika committed Dec 13, 2018
1 parent 6c85fc2 commit 48829ff
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 89 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,26 +46,15 @@
import org.imixs.workflow.exceptions.QueryException;

/**
* The ViewController can be used in JSF Applications to select a data result to
* be displayed by a view.
*
* The ViewController is a @ConversationScoped CDI bean to define a data query.
* This bean is used in combination with the ViewHandler to display a data
* result in a JSF page.
* <p>
* The query can be defined by the jsf tag, <f:viewAction>. The viewAction
* component must be declared as a child of the metadata facet (<f:metadata>).
*
* <pre>
* {@code
* <f:metadata>
* <f:viewAction action=" viewController.setQuery('...." />
* </f:metadata>
* }
* </pre>
*
*
*
* <p>
* The view property defines the view type returned by a method call of getData.
* The ViewController is ConversationScoped to support a paging navigation.
* The ViewController also provides a pagination mechanism to navigate through a
* big data set.
* <p>
* The query can be defined by the jsf tag, <f:viewAction>. The viewAction
* component must be declared as a child of the metadata facet (<f:metadata>).
Expand Down
94 changes: 29 additions & 65 deletions src/site/markdown/webtools/controller.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ To load a document the methods load(id) and onLoad() can be used. The method loa

<f:metadata>
<f:viewAction action="... documentController.onLoad()" />
</f:metadata> }
</f:metadata>

A bookmarkable URL looks like this:

Expand Down Expand Up @@ -46,7 +46,7 @@ To load a workitem the methods load(id) and onLoad() can be used. The method loa

<f:metadata>
<f:viewAction action="... workflowController.onLoad()" />
</f:metadata> }
</f:metadata>

A bookmarkable URL looks like this:

Expand All @@ -68,53 +68,29 @@ Within a JSF form, the items of a workitem can be accessed by the getter method


## The ViewController
The ViewController controls a collection of workItems. The result of the collection can be controlled by different properties of the ViewController. The property 'view' defines the view type returned by a method call of getWorkitems. The result of a collection is computed by a ViewAdapter. IViewAdapter can be adapted by any custom implementation. The ViewController can be be used in ViewScope. Long result lists can be paged using an internal paginator implementation. The length of a page result is defined by the property 'maxResult'


| Method | Type | Description |
|---------------|-----------------|-------------------------------------------|
|reset () | ActionListener | reset the cached result list and the paginator |
|refresh() | ActionListener | resets the cached result list and set the paginator to 0 |
|doLoadNext() | ActionListener | loads the next page |
|doLoadPrev() | ActionListener | loads the previous page |
|getWorkitems() | Getter | returns the list of workitems in the current page |

The ViewController is a @ConversationScoped CDI bean to define a data query.
This bean is used in combination with the ViewHandler to display a data result in a JSF page.

##The WorklistController
The WorklistController extends the ViewControler and provides a set of workflow specific sortable view types.

* worklist.owner = returns all workitems where the current user is owner from
* worklist.creator = returns all workitems created by the current user
* worklist.author = returns all workitems where the current user is author from
* worklist.writeaccess = returns all workitems where the current user has author access

Also the sort order of the result list can be configured by the property 'sortOder'

* 0 = order by creation date descending
* 1 = order by creation date ascending
* 2 = order by modified date descending
* 3 = order by modified date ascending

The general the worklistController can be controlled by a JSF page

<h:commandLink action="/pages/workitems/worklist" immediate="true"
actionListener="#{worklistController.doReset}">
<f:setPropertyActionListener
target="#{worklistController.view}" value="worklist.owner" />
<f:setPropertyActionListener
target="#{worklistController.sortOrder}" value="2" />
</h:commandLink>
The query can be defined by the jsf tag, <f:viewAction>. The viewAction component must be declared as a child of the metadata facet (<f:metadata>).

<f:metadata>
<f:viewAction action="#{viewController.setQuery('...)}" />
</f:metadata>

###Customizing the WorklistController
The following example shows how the WorklistController can be used in jsf application to display the users task list. The controller bean is declared and confgured in the faces-config.xml or beans.xml file.
The ViewController also provides a pagination mechanism to navigate through a big data set.



### Customizing the ViewController
The following example shows how the ViewController can be used in JSF application to display the users task list. The controller bean is declared and configured in the faces-config.xml or beans.xml file.

faces-config.xml:

...
<managed-bean>
<managed-bean-name>view</managed-bean-name>
<managed-bean-class>org.imixs.workflow.jee.faces.workitem.WorklistController</managed-bean-class>
<managed-bean-name>tasklist</managed-bean-name>
<managed-bean-class>org.imixs.workflow.jee.faces.data.ViewController</managed-bean-class>
<managed-bean-scope>view</managed-bean-scope>
<managed-property>
<property-name>maxResult</property-name>
Expand All @@ -128,37 +104,25 @@ faces-config.xml:
<value>2</value>
</managed-property>
<managed-property>
<property-name>view</property-name>
<property-name>query</property-name>
<property-class>java.lang.String</property-class>
<value>worklist.owner</value>
<value>type:workitem</value>
</managed-property>
</managed-bean>
...

The bean portletWorklistTasks can now be used in any JSF page:


<f:metadata>
<f:viewAction action="#{viewController.setQuery('type:team')}" />
<f:viewAction action="#{viewHandler.loadData(viewController)}" />
</f:metadata>


<!-- **** show Workitems ***** -->
<h:panelGroup id="portlet_worklist_body">
<ui:repeat var="workitem" value="#{view.workitems}">
<h:commandLink
action="#{workflowController.load(workitem.item['$uniqueid'],'/pages/workitems/workitem')}">
<h:outputText style="font-weight: bold;" escape="false"
value="#{workitem.item['txtWorkflowSummary']}" />
</h:commandLink>
</ui:repeat>
<!-- navigation -->
<h:panelGroup layout="block" id="portlet_worklist_nav"
style="float: right;">
<span style="margin-right: 10px;"> <h:commandLink
actionListener="#{view.doLoadPrev}" disabled="#{view.row == 0}"
value="#{message.prev}">
<f:ajax render="portlet_worklist_body" />
</h:commandLink>
</span>
<h:commandLink actionListener="#{view.doLoadNext}"
disabled="#{view.endOfList}" value="#{message.next}">
<f:ajax render="portlet_worklist_body"></f:ajax>
</h:commandLink>
</h:panelGroup>
</h:panelGroup>
<h:dataTable class="imixsdatatable" style="width:100%"
value="#{viewHandler.data}" var="workitem">
....
</h:dataTable>

5 changes: 3 additions & 2 deletions src/site/markdown/webtools/datepicker.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#Imixs DateTimePicker
# Imixs DateTimePicker

Imixs JFS provides a custom component for a date-time picker widget. The widget uses the jquery date picker component and provides an easy way to add a date/time widget into a jsf page.

<i:imixsDateInput value="#{workflowController.workitem.item['datDate']}"/>
Expand All @@ -12,7 +13,7 @@ The default intervall for the minute selection is '15'. You can override this wi
<i:imixsDateInput value="#{workflowController.workitem.item['datDate']}" showtime="true" minuteinterval="30"/>


##jQuery DatePicker
## jQuery DatePicker
When using the imixsHeader it is also possible to use the jQuery-UI Datepicker widget native. You just need to add the styleClass 'imixs-date' to a h:inputText. By adding a f:convertDateTime you can store the value as a java Date object. See the following example:

<h:inputText value="#{workflowController.workitem.item['_enddate']}"
Expand Down
9 changes: 8 additions & 1 deletion src/site/markdown/webtools/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@ Imixs-Faces includes some utility classes to support typical UI flows in a JSF a
This package contains a FileUploadController and a Servlet to handle multi-file uploads.


## Imixs-Faces UI


Imixs-Faces provides UI widgets to be used in a JSF Page.

* header - a header component to load scripts and layout resources
* datepicker - a date picker widget based on jQuery
* edit - a WYSIWYG editor based on tinymce
* tooltip - jQuery tooltip component
* workflow action - a action toolbar to show worklfow actions for a workitem controlled by the WorkflowController

2 changes: 1 addition & 1 deletion src/site/markdown/webtools/tinymce.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Imixs Editor
# Imixs-Faces Editor

The jQuery TinyMCE Editor will be automatically added to all textareas with the style class 'imixs-editor'

Expand Down
6 changes: 3 additions & 3 deletions src/site/markdown/webtools/tooltip.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Imixs Tooltips
# Imixs-Faces Tooltips
The Imixs-Faces jQuery UI integration provides a custom tooltip feature. This extends the tooltip feature provided by jQuery UI. The Imixs tooltip feature allows to display html based tooltip content. The tooltip can be added to any page element. The tooltip content need to be placed in a span tag with the class 'imixs-tooltip' which follows directly to the source element. See the following example.

<h:commandButton action="home" title=" "
Expand All @@ -16,7 +16,7 @@ This example displays a tooltip on a command button with html content. The next
The tooltip content tag must contain the class 'imixs-tooltip' and follow immediate to the source tag. The source tag must provide the attribute 'title' which can be empty or blank ' '.


##Customize default layout
## Customize default layout
If you like to customize the default layout of the tooltip generated by imixs-faces you can override the class 'imixs-tooltip-content' with is used for the content of a tooltip. In additon you can use your own jquery script to adjust the tooltip. This is usefull to change the size or the position of the tooltip itself. See the following example which changes the default position of the imixs tooltips:

$("span.imixs-tooltip" ).prev().tooltip({ position: { position: { my: "left+15 center", at: "right center" } });
Expand All @@ -34,7 +34,7 @@ Finally you can also disable the tooltips for specific elements:
$(".imixs-portlet span.imixs-tooltip" ).prev().tooltip({ disabled: true });


##Refresh Tooltip Layout after Ajax call
## Refresh Tooltip Layout after Ajax call
After a ajax call the tooltip layout need to be updated. For this the method 'layoutImixsTooltip' can be used. See the following example:

// This method layouts the some sections with the imixs layout
Expand Down
2 changes: 1 addition & 1 deletion src/site/markdown/webtools/workflowactions.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Imixs Workflow Actions
# Imixs-Faces Workflow Actions
The Imixs-Faces custom tag 'workflowactions' provides action toolbar based on the current workflow model. The tag can be used together with a workflowController component.

<i:imixsWorkflowActions workflowController="#{workflowController}"
Expand Down

0 comments on commit 48829ff

Please sign in to comment.