Skip to content

Commit

Permalink
impl, updated docu
Browse files Browse the repository at this point in the history
Issue #584
  • Loading branch information
rsoika committed Jun 5, 2024
1 parent bc3b59e commit fdb739a
Show file tree
Hide file tree
Showing 5 changed files with 98 additions and 23 deletions.
Original file line number Diff line number Diff line change
@@ -1,27 +1,43 @@
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:f="http://xmlns.jcp.org/jsf/core" xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
xmlns:h="http://xmlns.jcp.org/jsf/html">

<ui:fragment rendered="#{!readonly}">
<h:selectOneMenu style="width:20em;"
required="#{empty required?false:required}"
value="#{workflowController.workitem.item['space.ref']}">
<f:selectItem itemLabel=""></f:selectItem>
<c:forEach
items="#{byprocess?teamController.getSpacesByProcessId(workflowController.workitem.item['process.ref']):teamController.spaces}"
var="space">
<f:selectItem itemLabel="#{space.item['name']}"
itemValue="#{space.item['$UniqueID']}">
</f:selectItem>
</c:forEach>
</h:selectOneMenu>
</ui:fragment>
<ui:fragment rendered="#{readonly}">
<h:outputText value="#{workitem.item['space.name']}"></h:outputText>
</ui:fragment>
<ui:remove>
<!-- Selection by space
USAGE: options=default-selection;
pre select the current users default section (first section the user is member of)
</ui:composition>
options=byprocess;
only sections assigned to the current process are displayed.
-->
</ui:remove>

<f:subview id="spacerefinput-view">
<ui:param name="byprocess" value="#{options.indexOf('byprocess') ge 0}"></ui:param>
<ui:param name="default_selection" value="#{options.indexOf('default-selection') ge 0}"></ui:param>
<ui:param name="space_ref"
value="#{default_selection ? teamController.setDefaultSpace(workflowController.workitem):''}" />
<!-- (DO NOT REMOVE) default selection = #{space_ref} -->
<ui:fragment rendered="#{!readonly}">
<h:selectOneMenu style="width:20em;" required="#{empty required?false:required}"
value="#{workflowController.workitem.item['space.ref']}">
<f:selectItem itemLabel=""></f:selectItem>
<c:forEach
items="#{byprocess?teamController.getSpacesByProcessId(workflowController.workitem.item['process.ref']):teamController.spaces}"
var="space">
<f:selectItem itemLabel="#{space.item['name']}" itemValue="#{space.item['$UniqueID']}">
</f:selectItem>
</c:forEach>
</h:selectOneMenu>
</ui:fragment>
<ui:fragment rendered="#{readonly}">

<h:outputText rendered="#{! empty workitem.item['space.parent.name']}"
value="#{workitem.item['space.parent.name']} ⇒ "></h:outputText>
<h:outputText value="#{workitem.item['space.name']}"></h:outputText>
</ui:fragment>
</f:subview>

</ui:composition>
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
<org.imixs.workflow.version>6.0.6-SNAPSHOT</org.imixs.workflow.version>
<org.imixs.archive.version>3.0.1</org.imixs.archive.version>
<org.imixs.office.version />
<org.imixs.marty.version>5.0.0</org.imixs.marty.version>
<org.imixs.marty.version>5.0.1-SNAPSHOT</org.imixs.marty.version>
<org.imixs.mock.version>6.0.0</org.imixs.mock.version>
<!-- 2.2 -->
<microprofile.version>6.0</microprofile.version>
Expand Down
59 changes: 59 additions & 0 deletions src/site/markdown/forms/spaces.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Sections

Imixs-Office-Workflow provides a set of custom input parts to assign a workitem to a section (space).


## The spacreref Input

The item part `spaceref` can be used to select a section from the organization matrix.

```xml
<item type="custom"
path="spaceref"
label="Department:" />
```

<img class="screenshot" src="teams/spaceref-01.png" />

No `name` is required here as a section is always assigned to the item `space.ref`. This is an internal data item to be resolved by the
[Team Controller](../teams/teams.html)

## Read Mode

The component can also be displayed in read mode:

```xml
<item type="custom"
path="spaceref"
label="Department:"
readonly="true" />
```

<img class="screenshot" src="teams/spaceref-02.png" />

### Selection by Process

To allow only the selection of a subset of section assigned to the current process the option "byprocess' can be set:

```xml
<item type="custom"
path="spaceref"
options="byprocess;"
label="Department:" />
```

### Default Selection

It is also possible to pre-select a default value for this component. In this case the first section where the current user is member of will be assigned.

Example:


```xml
<item type="custom"
path="spaceref"
options="default-selection;"
label="Department:" />
```

**Note:** If the workitem is assigned to a process (`process.ref`) than sections assigned to this process will be fetched first!
Binary file added src/site/resources/teams/spaceref-01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/site/resources/teams/spaceref-02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit fdb739a

Please sign in to comment.