Table of Contents
Full name : org.jspresso.framework.view.descriptor.basic.BasicViewDescriptor
Super-type : DefaultIconDescriptor
Sub-types : AbstractCardViewDescriptor, BasicActionViewDescriptor, BasicCollectionViewDescriptor, BasicComponentViewDescriptor, BasicCompositeViewDescriptor, BasicPropertyViewDescriptor, BasicTreeViewDescriptor
This is the abstract base descriptor for all views. Its main purpose, since it cannot be used directly, is to factorize common properties.
Table III.1. BasicViewDescriptor properties
| Property | Description |
|---|---|
actionMap | Assigns the view action map. An action map is generally represented as a toolbar attached to the view. The toolbar follows the structure of the action map :
Depending on the UI channel, the view action map may also be replicated in a component contextual menu. In that case, the translated action name is used to label each menu item. The same grouping rules apply for the contextual menu than for the toolbar. |
background
| Sets the background color of the UI component. The color must be defined using its string hexadecimal representation (0xargb encoded).
Default value is |
borderType | Sets the border type of the view. This is either a value of the
Default value is |
font
| Allows to customize the font used by the UI component. The font must be string encoded using the pattern "[name];[style];[size]" :
Any of the above pattern section can be left empty, thus falling back to the component default.
Default value is |
foreground
| Sets the foreground color of the UI component. The color must be defined using its string hexadecimal representation (0xargb encoded).
Default value is |
grantedRoles
| Assigns the roles that are authorized to use this view. It supports
"!" prefix to negate the role(s). Whenever the user is not
granted sufficient privileges, the view is replaced by an empty section at
runtime. Setting the collection of granted roles to |
modelDescriptor | Assigns the model descriptor backing the view. The model descriptor serves several purposes :
Although it is the developer responsibility to make sure the correct model
descriptor is assigned to the view, there are cases where the framework
will infer it. For instance, a composite view will by default transmit its
model descriptor to its children that do not have their model descriptor
explicitely set. This allows for setting the model descriptor only on the
composite view and keep default |
permId
| Sets the permanent identifier to this application element. Permanent identifiers are used by different framework parts, like dynamic security or record/replay controllers to uniquely identify an application element. Permanent identifiers are generated by the SJS build based on the element id but must be explicitely set if Spring XML is used. |
preferredHeight
| Allows to set a preferred height (in pixels) for the created peer UI component. This will override default and give hints to the UI layouting system. |
preferredWidth
| Allows to set a preferred width (in pixels) for the created peer UI component. This will override default and give hints to the UI layouting system. |
readOnly
| Allows to set a view read-only, i.e. none of the view part will allow for updating the underlying model. This is mainly a shortcut to assigning an "always closed" writability gate. One difference though is that, since the framework knows that the view will never be updatable, it may take specific decisions to render properties in a slightly different way, e.g. instead of using a disabled textfied, use a label.
Default value is |
secondaryActionMap | Assigns the view secondary action map. Same rules as the primary action map apply except that actions in this map should be visually distinguished from the main action map, e.g. placed in another toolbar. |
writabilityGates
| Assigns a collection of gates to determine view writability. A view will be considered writable (updatable) if and only if all gates are open. This mecanism is mainly used for dynamic UI authorization based on model state, e.g. a validated invoice should not be editable anymore. View assigned gates will be cloned for each view instance created and backed by this descriptor. So basically, each view instance will have its own, unshared collection of writability gates. Jspresso provides a useful set of gate types, like the binary property gate that open/close based on the value of a boolean property of the view model. By default, view descriptors are not assigned any gates collection, i.e. there is no writability restriction. Note however that view actual writability is the combination of view and model writability. |
Full name : org.jspresso.framework.view.descriptor.basic.AbstractCardViewDescriptor
Super-type : BasicViewDescriptor
Sub-types : BasicCardViewDescriptor, EntityCardViewDescriptor
This descriptor serves as abstract base implementation for card view descriptor. A card view is a view stack made of children views (the cards) where only the view (card) at the top of the stack is visible. The actual child view to place on the top of the stack is dynamically determined based on the bound model. This card determination strategy depends on the concrete descriptor sub-types.
One might wonder why a card view is not considered as (and actually does not inherit from) a composite view. The difference is that composite views are used agregate views that displays - hopefully - different parts (the children views) of the same model. A card view descriptor is rather used to make the same UI region display different views depending on different models (or different model states). Once the model is fixed, the card view behaves exactly as its top card.
One of the most important usage of card views is when it is combine as the detail in a master-detail view. The detail view may then change dynamically based on the selected master.
Table III.2. AbstractCardViewDescriptor properties
| Property | Description |
|---|---|
| This class does not have any specific property. | |
Full name : org.jspresso.framework.view.descriptor.basic.BasicCardViewDescriptor
Super-type : AbstractCardViewDescriptor
Describes a multi-purpose card view that is configurable with a custom card determination strategy. Cards are registered with a name key that is used to retrieve the card to display based on the card selector selected name key.
Table III.3. BasicCardViewDescriptor properties
| Property | Description |
|---|---|
cardNameSelector | Configures the card determination strategy. This delegate is responsible for selecting the card name key based on the model bound to the view. Everytime the bound model changes, the card name selector is triggered to select a new card. The names returned by the card name selector must match the names under which the cards are registered. Whenever the card name selector returns an unknown name, the card view displays an empty view. |
cardViewDescriptors
| Registers the card views keyed by their name keys. The names used as key of
the |
This card view provides a simple card determination strategy that is based on the bound model type. This strategy pulls up the card whose model descriptor matches the type of the bound model.
Table III.4. EntityCardViewDescriptor properties
| Property | Description |
|---|---|
viewDescriptors
| Registers the list of card view descriptors. Every time the bound model changes, this list is iterated until a card with a matching model is found. The first matching card is displayed. Whenever no registered card matches, an empty view is displayed. |
Full name : org.jspresso.framework.view.descriptor.basic.BasicActionViewDescriptor
Super-type : BasicViewDescriptor
This type of view allows to make an action available as a view and thus participate in the UI composition as a visual component. An action view can then be embedded in surrounding a composite view. It litterally takes the action away from the toolbar/context menu it is located when registered in an action map and makes it a primary citizen of the UI.
Table III.5. BasicActionViewDescriptor properties
| Property | Description |
|---|---|
action | Assigns the action to display as a view. The action will typically be
rendered as a button in the UI. whenever you want to size the icon used to
display the action (and thus the button peer), you might use the
|
renderingOptions | Indicates how the action should be rendered. This is either a value of the
Default value is |
Full name : org.jspresso.framework.view.descriptor.basic.BasicCollectionViewDescriptor
Super-type : BasicViewDescriptor
Sub-types : BasicListViewDescriptor, BasicTableViewDescriptor
This is the abstract base descriptor of all views used to display a collection of elements. A collection view must be backed by a collection descriptor model. Most of the time, the model will be a collection property descriptor so that the collecion to display is directly inferred from the collection property value through the binding layer.
Table III.6. BasicCollectionViewDescriptor properties
| Property | Description |
|---|---|
autoSelectFirstRow
| Configures the default selection that gets applied when the content of the
collection view changes. Whenever set to
The default value depends on the selection mode of the collection view.
When a cumulative selection mode is used, |
itemSelectionAction | Registers an action that is implicitely triggered everytime the selection changes on the collection view UI peer. The context of the action execution is the same as if the action was registered in the view action map. |
modelDescriptor | {@inheritDoc} |
paginationViewDescriptor | Configures a view that will control the pagination (if any) on this collection view. When contructed, the collection view will be decorated with the pagination view. The pagination view will be bound to the same model as the one providing the collection of the collection view. |
rowAction | Registers an action that is implicitely triggered everytime a row is activated (e.g. double-clicked for current UI channels) on the collection view UI peer. The context of the action execution is the same as if the action was registered in the view action map. |
selectionMode | Sets the selection mode of the collection view. This is either a value of
the
Default value is |
This type of descriptor is used to implement a list view. A list view is a
single column, uneditable collection view used to display a collection of
components. Each item is displayed using a string representation that can be
customized using the renderedProperty property. List views are
rarely used since one might prefer its much more advanced cousin, i.e. the
table view.
Despite its low usage as an individual UI component, the list view is also
used by Jspresso to describe tree parts. A collection of sibling tree nodes
can actually be considered as being a list view and can be described as such.
In the latter case, the renderedProperty property will be used
to label the tree nodes.
Table III.7. BasicListViewDescriptor properties
| Property | Description |
|---|---|
iconImageURLProvider | The icon image URL provider is the delegate responsible for inferring a
tree node icon based on its underlying model. By default (i.e. when
|
renderedProperty
| Configures the model property to be rendered in the list. Whenever this
property is left to |
This descriptor is used to implement a table view. This is certainly the most commonly used collection descriptor in Jspresso. A table view displays a collection of components (one row per component in the collection) detailed by a set of properties (one column per displayed component property).
The table view will automatically adapt its columuns depending on the underlying property descriptors, e.g. :
columns for read-only properties won't be editable
columns that are assigned writability gates will compute the editability of their cells based on each cell's gates
columns will adapt their renderer/editor based on the underlying property type, e.g. a calendar component will be used for dates
column titles will be filled with property names translations based on the user locale
mandatory properties will be visually indicated
...
A table view provides sensible defaults regarding its configuration, but it
can be refined using either the simple renderedProperties or the
more advanced yet lot more powerful columnViewDescriptors
properties.
Table III.8. BasicTableViewDescriptor properties
| Property | Description |
|---|---|
columnViewDescriptors
| This property allows for configuring the columns of the table view in a very customizable manner, thus overriding the model descriptor defaults. Each property view descriptor copntained in the list describes a table column that will be rendered in the UI accordingly. For instance, a writable property can be made specifically read-only on this table view by specifying its column property view descriptor read-only. In that case, the model remains untouched and only the view is impacted. Following the same scheme, you can assign a list of writability gates on a column to introduce dynamic cell editability on the view without modifying the model. A last, yet important, example of column view descriptor usage is the role-based column set configuration. Whenever you want a column to be available only for certain user roles (profiles), you can configure a column property view descriptor with a list of granted roles. If the user doesn't have the column(s)required role, the forbidden columns simply won't be displayed. This allows for high authorization-based versatility. There are many other usages of defining column property view descriptors all of them being linked to customizing the table columns without impacting the model. |
horizontallyScrollable
| This property allows to define the table horizontal scrolling behaviour. Whenever it is set to false, the corresponding table UI component will adapt its columns to fit the available horizontal space.
Default value is |
renderedProperties
| This is somehow a shortcut to using the
Whenever the property value is |
sortable
| This property allows to define the table horizontal sorting behaviour. Whenever it is set to false, the corresponding table UI component will not allow manual sorting of its rows.
Default value is |
sortingAction | Configures the action to be activated when a sort is triggered by the user. It should be used with caution and rarely be overriden from the default. |
Full name : org.jspresso.framework.view.descriptor.basic.BasicComponentViewDescriptor
Super-type : BasicViewDescriptor
Component view descriptors are surely one of the most commonly used view
descriptors in Jspresso. It allows to implement advanced form-like views to
interact with a single component model. Component properties that are
displayed in the view are organized in an invisible grid. Each field
component is labelled with the property name it displays and labels can be
configured to be displayed aside or above their peer field. Property fields
can be configured to span multiple form columns. Component view offer various
straightforward customizations, but the most advanced and prowerful one is
definitely the propertyViewDescriptors property tat allows to
fine-tune each component UI field individually.
Table III.9. BasicComponentViewDescriptor properties
| Property | Description |
|---|---|
columnCount
| Configures the number of columns on this component view. Property fields that are to be displayed in the view are spread across columns and rows following their defined order. Whenever a row does not contain enough empty cells to recieve the next field (either because the last column has been reached or the next field has been configured to span multiple columns and there is not enough cells left in the current row to satisfty the span), a new row is created and the next field is added to the first column on the new row. Note that column count and span are defined in fields coordinates (the field including the property UI component + its label). The underlying grid is actually finer since it has to cope with the labels; but this is internal implementation details and Jspresso takes care of it, without the developer having to cope with labels placements. Default value is 1, meaning that all rendered fields will be stacked in a single column. |
labelsPosition | Instructs Jspresso where to place the fields label. This is either a value
of the
Default value is |
propertyViewDescriptors
| This property allows for configuring the fields of the component view in a very customizable manner, thus overriding the model descriptor defaults. Each property view descriptor copntained in the list describes a form field that will be rendered in the UI accordingly. For instance, a writable property can be made specifically read-only on this component view by specifying its property view descriptor read-only. In that case, the model remains untouched and only the view is impacted. Following the same scheme, you can assign a list of writability gates on a field to introduce dynamic field editability on the view without modifying the model. A last, yet important, example of column view descriptor usage is the role-based field set configuration. Whenever you want a field to be available only for certain user roles (profiles), you can configure a field property view descriptor with a list of granted roles. If the user doesn't have the field(s)required role, the forbidden field(s) simply won't be displayed. This allows for high authorization-based versatility. There are many other usages of defining field property view descriptors (like individual labels color and font), all of them being linked to customizing the form fields without impacting the model. |
propertyWidths
| This property allows to simply define property spans in the underlying grid
without having to extensively define the
The
Default value is |
renderedChildProperties
| Whenever a rendered property is not scalar, this property allows to override which of the referenced component fields should be displayed :
The property must be configured with a
A Please note that this is quite unusual to embed non-scalar properties directly in a component view. Although permitted, you won't have as much flexibility in the content layouting as you would have when using composite views; so the latter is by far recommended. |
renderedProperties
| This is somehow a shortcut to using the
Whenever the property value is |
This view descriptor serves 2 purposes :
configure complex, component based views : refine columns of table views and fields of component (form) views.
display a single property as an autonomous view, i.e. not as a table column or a form field.
The second usage might be a little bit unusual, but here is a use-case scenario : display a text area which maps a text property that contains XML content. This text area must be displayed in a split pane and provide actions to interact directly with the FS (save content to a file, load content from a file, ...). In that case, defining a property view alone on the text property of the owning component might be a good solution.
Table III.10. BasicPropertyViewDescriptor properties
| Property | Description |
|---|---|
action | Configures the action to be triggered when acting on this property. There are 2 cases :
|
horizontalAlignment | This property allows to control the property alignment in views that
support it. This is either a value of the
Default value is |
labelBackground
| When the property has to be labelled (e.g. in a component view), this property defines the background color of the corresponding label. It might differ from the field component one. The color must be defined using its string hexadecimal representation (0xargb encoded).
Default value is |
labelFont
| When the property has to be labelled (e.g. in a component view), this property defines the font of the corresponding label. It might differ from the field component one. The font must be string encoded using the pattern "[name];[style];[size]" :
Any of the above pattern section can be left empty, thus falling back to the component default.
Default value is |
labelForeground
| When the property has to be labelled (e.g. in a component view), this property defines the foregroud color of the corresponding label. It might differ from the field component one. The color must be defined using its string hexadecimal representation (0xargb encoded).
Default value is |
renderedChildProperties
| Whenever the property decriptor backing the view is not scalar, this property allows to override which of the referenced component fields should be displayed :
The property must be configured with a
A Please note that this is quite unusual to embed non-scalar properties directly in a property view. Although permitted, you won't have as much flexibility in the content layouting as you would have when using composite views; so the latter is by far recommended. |
sortable
| Configure the sortability of a property view when used to defines a table
column for instance. Whenever it is not explicitely set, it falls back to
the model property sortability. If no model descriptor is set, defaults to
|
width
| When the property has to be displayed in a grid-like layout (e.g. in a component view), this property defines the umber of grid columns the corresponding UI component will span.
Default value is |
This specialized property view descriptor is used in order to be able to refine the "values" that are taken from the model enumeration. You can configure a set of allowed values from which the user can choose.
Table III.11. BasicEnumerationPropertyViewDescriptor properties
| Property | Description |
|---|---|
allowedValues
| Returns an optional forbidden set of values to restrict the model ones. Only values belonging to the allowed ones should actually be made available as a choice. |
forbiddenValues
| Returns an optional forbidden set of values to restrict the model ones. Only values not belonging to the forbidden ones should actually be made available as a choice. |
orientation | Configures wether radio values be rendered horizontally or vertically.
|
radio
| Configures the rendering of the enumeration property as radio buttons if
supported instead of combobox. Default value is |
This type of view descriptor is used to display a binary property or a string property containing an URL as an image. By default, binary properties are rendered as button fields that allow to upload, download and query size of the binary content. This button field visually indicate whether the binary property is empty or not. Whenever you know that the underlying property is used to store image content, you can explicitely define an image view backed by the binary property descriptor and use it in your UI. Jspresso will then display the image whose content is stored in the binary property directly in the UI.
Table III.12. BasicImageViewDescriptor properties
| Property | Description |
|---|---|
scrollable
| Configures the image view to be either croped or scrollable when the
display area is too small to display it. A value of |
This specialized property view descriptor is used in order to be able to refine the "List of values" action that gets automatically installed by Jspresso when a reference property is displayed. You can then customize this action when defining the corresponding column in a table view or field in a component view.
Table III.13. BasicReferencePropertyViewDescriptor properties
| Property | Description |
|---|---|
lovAction | Allows to override the default "List of values" action attached to this reference property view.
A |
Full name : org.jspresso.framework.view.descriptor.basic.BasicTreeViewDescriptor
Super-type : BasicViewDescriptor
Sub-types :
This descriptor is use to design a tree view. The way to define a tree view
in Jspresso is a matter of assembling tree level descriptors
hierarchically. A tree level descriptor is a group of sibling nodes
that usually represent a component collection property. Each individual tree
node collection can be secured by using role-based authorization (i.e.
grantedRoles) on its descriptor.
Table III.14. BasicTreeViewDescriptor properties
| Property | Description |
|---|---|
childDescriptor | Configures the first tree level as being a single collection of sibling nodes. For instance, if the child tree level is mapped to a collection (collA) containing 5 elements (collA_Elt-1 to 5), the tree would look like : rootItem collA_Elt-1 collA_Elt-2 collA_Elt-3 collA_Elt-4 collA_Elt-5 In the example above, you should notice that there is no need for the tree to install an intermediary node to visually group the collection elements since the collection is alone on its level.
This property is only used if the |
childrenDescriptors
| Configures the first tree level as being a list of collections of sibling nodes (subtrees). For instance, if the children tree levels are mapped to 2 collection properties (collA, collB) each containing 3 elements (collA_Elt-1 to 3 and collB_Elt-1 to 3), the tree would look like : rootItem collA collA_Elt-1 collA_Elt-2 collA_Elt-3 collB collB_Elt-1 collB_Elt-2 collB_Elt-3 In the example above, you should notice intermediate collection property grouping nodes (collA and collB in italic). They automatically appeared to clearly group the tree nodes belonging to the different collections.
This property is only used if the |
expanded
| Setting this property to |
iconImageURLProvider | The icon image URL provider is the delegate responsible for inferring a
tree node icon based on its underlying model. By default (i.e. when
|
itemSelectionAction | This property alows to bind an action that gets triggered every time the selection changes on the tree view. The action context passed to the action when it is executed is the same as if it had been registered on the tree view. |
maxDepth
| This property is used only when the tree (or sub-tree) is declared recursively, i.e. a tree level belongs to its own children hierarchy. Default value is 10, meaning that a maximum number of 10 levels can be nested. |
renderedProperty
| This property allows to define the model property used to label the root node.
This property is only used if the |
rootSubtreeDescriptor | This property allows to explicitely define the tree root level as any other level. Most of the time, you will prefer using the following shortcut properties :
Whenever |
rowAction | Registers an action that is implicitely triggered everytime a row is activated (e.g. double-clicked for current UI channels) on the collection view UI peer. The context of the action execution is the same as if the action was registered in the view action map. |
This is the base descriptor for all tree levels. A tree level is a collection of sibling nodes that belong to the same formal collection (usually a component collection property). This base descriptor does not accept nested subtrees so it is only used to describe a collection of leaf nodes. If you need to describe intermediary tree levels, yous will use one of the 2 subtypes :
BasicSimpleTreeLevelDescriptor to define a collection of tree nodes that accept a single subtree
BasicCompositeTreeLevelDescriptor to define a collection of tree nodes that accept a list of subtrees
Defining a tree level is mainly a matter of defining its representation as an
individal list of components (i.e. the nodeGroupDescriptor
property).
Table III.15. BasicTreeLevelDescriptor properties
| Property | Description |
|---|---|
grantedRoles
| Assigns the roles that are authorized to use this subtree. It supports
"!" prefix to negate the role(s). Whenever the user is not
granted sufficient privileges, the subtree is simply hidden. Setting the
collection of granted roles to |
nodeGroupDescriptor | Describes the collection of sibling nodes (node group) as a if it were a list view. This is how you instruct Jspresso the type of the components that are used as model behind the tree nodes and which model property is used to compute the node labels. Most of the other properties defined on the node group descriptor itself are ignored (font, color, selection action, ...) since a tree group is not a "real" view but just a mean of defining a subtree. All these properties that are ignored on the tree group can be defined on the tree view itself. |
permId
| Sets the permanent identifier to this application element. Permanent identifiers are used by different framework parts, like dynamic security or record/replay controllers to uniquely identify an application element. Permanent identifiers are generated by the SJS build based on the element id but must be explicitely set if Spring XML is used. |
This descriptor is used to describe a collection of sibling nodes that each nest multiple subtrees. The children subtrees are each placed under an intermediary grouping node. For instance, given a composite tree level mapping a collection of As and whose children are 2 tree levels mapping respectively a collection Ys and Zs, the tree would look like :
parent A-1 collY Y-1.1 Y-1.2 collZ Z-1.1 Z-1.2 Z-1.3 A-2 collY Y-2.1 Y-2.2 Y-2.3 collZ Z-2.1 A-3 collY Y-3.1 Y-3.2 collZ Z-3.1 Z-3.2
You can notice the intermediary grouping nodes that are installed to visually separate the 2 collection families (Y and Z).
Table III.16. BasicCompositeTreeLevelDescriptor properties
| Property | Description |
|---|---|
childrenDescriptors
| Assigns the list children tree level descriptors. A |
Full name : org.jspresso.framework.view.descriptor.basic.BasicSimpleTreeLevelDescriptor
Super-type : BasicTreeLevelDescriptor
Sub-types :
This descriptor is used to describe a collection of sibling nodes that only nest a single subtree. The child subtree is directly placed under each node without any intermediary grouping node. For instance, given a simple tree level mapping a collection of As and whose child is a tree level maping a collection of Bs, the tree would look like :
parent A-1 B-1.1 B-1.2 B-1.3 A-2 B-2.1 A-3 B-3.1 B-3.2
Table III.17. BasicSimpleTreeLevelDescriptor properties
| Property | Description |
|---|---|
childDescriptor | Assigns the single child tree level descriptor. A |