Reference Manual for OpenSAGA Version 1.0.0

QuinScape GmbH

Dortmund Wittekindstr. 30 D-44139 Germany

http://www.quinscape.de <contrib>Contributing authors: Sebastian Bereda, Dr.-Ing. Thomas Biskup, Sven Helmberger, Jochen Terstiege</contrib>

Contributing authors: Sebastian Bereda, Dr.-Ing. Thomas Biskup, Sven Helmberger, Jochen Terstiege 

BALVI GmbH

Dortmund Wittekindstr. 30 D-44139 Germany

http://www.balvi.de

Neither this document nor any part or extract of it may be

  • redistributed in a modified form,

  • sold as part of slides, manuals or other forms of documentation or support material,

  • printed by any print-on-demand service,

  • reused as part of commercial trainings, presentations, workshops or coachings

without the explicit and written permission of QuinScape GmbH.


Table of Contents

I. Introduction
1. Overview
Mission Statement
Design Values
Values
Principles
Methods
Basic Principles of OpenSAGA Portals and Web Applications
OpenSAGA Applications Are Web Applications
OpenSAGA Applications Are Accessible
OpenSAGA Applications Favour Structured Content
OpenSAGA Applications Are Workflow Oriented
OpenSAGA Applications Are Strictly Model Driven
OpenSAGA Applications Support Complex Configurations
2. First Steps
Getting acquainted with OpenSAGA
Debugging OpenSAGA Applications
Downloading OpenSAGA
OpenSAGA Maven Integration
Downloading & Installing Maven
Maven Repositories
Resolving OpenSAGA Dependencies with Maven
Supported Runtime Systems
Choosing Your Infrastructure
IDEs
Application Servers
Creating a Project
External Dependencies
Running an OpenSAGA Portal
Configuring the underlying database
Configuring the server
Configuring the context path
Configuring the server deployment
Develop your application
Known Problems and Workarounds
3. Basic Concepts
Model based design
Everything is a model
Everything is XML
Model IDs
Universally Unique IDs
Global IDs
Local IDs
Modeling with XML
Objects and views
Target domain objects
Top down modeling
Working with data
Contexts
II. Programming
4. Top Down Design and Development
Design Process for OpenSAGA Applications
5. Programming with references
Property references
Searching in System Domain Object, Working Set and Target Domain Object
Referencing properties of cached objects and lists via virtual properties
Object references
Object reference to a list
Object reference to a view model
List references
6. Programming Tutorial: Developing a Web Based FAQ Application
The Use Case: FAQ Management
Modeling the FAQ Use Case
Modeling the Navigation
Modeling the Process
Modeling the Domain
Setting Up the Project
Implementing the Model
Implementing the Infrastructure
Implementing the Domain Type Model
Implementing the Process
Implementing the Views
Implementing the Navigation
7. Defining Logical Values For Properties
8. Property Value Providers
CurrentDatePropertyValueProvider
CurrentUserPropertyValueProvider
DateTemplateBasedPropertyValueProvider
Operation List
Date Provider Map
Unit Modifier Map
DefaultLocalePropertyValueProvider
FalsePropertyValueProvider
TruePropertyValueProvider
GuidPropertyValueProvider
ScriptingServiceBasedPropertyValueProvider
III. Architecture
9. Detailed Model Hierarchy
The Portal Model
The Navigation Reference Set
The Process Reference Set
The Domain Type Reference Set
Staging
Layouts and Skins
The Navigation Model
The Process Model
Process States
Transitions
The Domain Model
The Relation Model
The Domain Type Model
Property Models
Property Type Models
The Translations Model (Internationalization, I18N)
Translations
Translation Definitions
Formatters and Converters
Scoped Data Contexts
The Session Context
The Conversation Context
The Process Context
The View Context
The Request Context
The Domain Context
Accessing Properties, Objects and Lists
Referencing Properties, Objects and Lists
Creating and Defining Properties, Objects and Lists
10. Naming Conventions
Model IDs
Model File Names
Schema
11. Project Layout
Directory structure
Base directory structure
Extension directory structure
12. Base Support
The Implicit 'base' extension
Extending the Base Portal
Defining a Simple Navigation
13. System Configuration
Logging
14. Predefined Services
IV. Model Reference
15. Defining agents
Domain type based agent
Event based agent
Time based agent
Trigger based agent
16. The Container Models
The Portal Model
The Meta Model
The Navigation Reference Set
Supported Locales
The Domain Type Reference Set
The Process Reference Set
Using ID Mappings to Copy Processes
The Web Service Reference Set
The REST Services Reference Set
Paging
Filter Specification Set
UI Component Setting Set
Action List Set
Start Action List
Stages Model
The Stage Model
The Data Source Model
The Proxy Configuration Model
Development Mode
17. The View State
Layouting a View
Part Tags
Validating a View
Interrupting the Business Logic Flow of a View
18. Error Handling
Global Errors
Local Errors
19. Data Sources
Data Source Types
Configuring a new data source
Data Source Naming Strategies
VFS Data Source Type
20. Actions
Action Lists
Action Types
Simple Actions
Multi Actions
Action Results
21. The Filter Models
Filter Types
IsDefinedFilter
IsUndefinedFilter
IncludeFilter
HasElementsFilter
Values
constant
22. Content Elements
Part Tags
Attachment
Checkbox
Error-Message-List
External Link
Label
Multi Connect
Password
Rich Text Field
Select Field
Textarea
Textfield
23. Web Services
Validation rules
Transformation
Groovy Web Services
Using a groovy script
Using the default web service endpoint script
24. Web Service Clients
DefaultWebServiceClient
Calling a 'ZIP' web service
Response with a list of objects
GroovyScriptBasedWebServiceClient
Building the request message
WebServiceGateway
WebServiceXmlHandler
Defining GroovyScriptBasedWebServiceClient as action
Examples of groovy script clients
25. REST Services
Configure REST Services
REST Url
REST Service Script
The input object
The output object
26. Transformation
Transformer list
Transformer
Defining a transformation
Defining conditional transformer
Stop condition
Dynamical transformer order
Next-transformer
Conditional next-transformers
27. Encryption
Encryptor/Decryptor Definition
28. Mail Services
Mail service configuration set
Mail service configuration
How to setup a new mail service
How to setup a new type
How to setup a new strategy
The mail services config generator
V. Extension Points
29. OpenSAGA Extensions
Overview
Model Overloading
Model Extension
Model Overlays
Model Overloading
Model Overlays
30. Implementing New Actions
31. Implementing New Filters
32. Scripting
When to Script?
Where to Script?
What to use?
Supported Scripting Dialects
BeanShell Scripting Service
Groovy Scripting Service
Python Scripting Service
Ruby Scripting Service
JavaScript Scripting Service
Scripting Contexts
Adding More Scripting Languages
33. WikiText
Supported WikiDialects
How to use WikiText?
Implementing new WikiDialects
Implementing a WikiDialects with the WikiDecodingService
Implementing a WikiDialect by a set of WikiTags
34. Strategy Interfaces
35. Implementing New Data Sources
36. Building Your Own Extensions
Extension Packaging
Extension Projects
Extension Modules
Extension Directory Layout
Spring Configuration Extensions
37. Creating new models
OpenSAGA XML Compiler
Model Interfaces
Annotations
XML Compiler Configuration
Creating new UI Elements
38. Working with layouts in OpenSAGA
Overview
OpenSAGA Web Technologies
OpenSAGA View Layouts
Part/SubView Layout
Component Layouts
VI. Internals
39. Caching
Resetting caches
Internal caches
Accessing Caches
Implementing cached objects
40. Implementing Named Repositories
Configuring Named Bean Extensions
Configuring Named Type Extensions
Implementing New Named Bean Repositories
41. The Process State References
42. File Path Syntax
Relative file paths
Absolute file paths
URLs
43. Writing Model Documentation
OpenSAGA Tag documentation format
XML Schema output
Docbook output
Configuring and generating the documentation
44. Testing OpenSAGA
Test with the Selenium IDE
Test with an ANT task
45. Security
Login Process
Content Streaming
VII. Quick Start Guide
46. How-Tos
47. FAQ
VIII. Reference
48. Actions
<action-list />
<action-list-set />
<action-script />
<actions />
<add-to-list />
<aggregate />
<audit-trail />
<bind />
<call />
<case />
<catch-exception />
Catching all exceptions
Catching one specific exception
Catching one specific exception (simplified)
Catching a category of exceptions
Catching exception combinations
<catch-validation-error />
<condition />
<connect />
<create-message />
<default />
<define-password />
<delete />
<delete-by />
<dequeue-report />
<disconnect />
<else />
<email />
<enqueue-report />
<execute />
<execute-if />
<finally />
<for-each />
<if />
<ignore-validation-results />
<import />
Import Mode
Domain type import
XML import
GroovyXmlNode
<iterate-list />
<load-list />
<logout />
<map-values />
<message-parameter />
<new />
<new-object />
<next-element />
<publish-message />
<remove />
<remove-list />
<reset-cache />
<reset-list-iterator-index />
<reset-translations />
<reset-validation-status />
<script />
<send-outgoing-emails />
<set-active-navigation />
<set-list />
<set-object />
<set-property-value />
<store />
<switch />
<system-log />
<tag />
<then />
<transform />
<try />
<tweet />
<validate />
<validation-error />
<webservice />
<with-filter />
49. Agent Models
<agent-action />
<agent-action-list />
<agent-reference />
<agents />
<domaintype-based-agent />
<event-based-agent />
<time-based-agent />
<trigger-based-agent />
50. Content Element Models
<a />
<attachment />
<attachment-column />
<auto-complete-filter />
<available-export />
<available-export-list />
<b />
<boolean-column />
<boolean-element />
<br />
<button />
<button-column />
<cell-format />
<cell-format-set />
<checkbox />
<clear-filter-button />
<cms-content />
<col />
<collapse-button />
<collapse-link />
<column />
<content />
<content-group />
<datagrid />
<datagrid-column-list />
<dd />
<debug-console />
<disabled-if />
<div />
<dl />
<dt />
<em />
<error-message />
<error-message-list />
<exception />
<external-link />
<file-upload />
<filter-row />
<footer-row-list />
<grid />
<h1 />
<h2 />
<h3 />
<h4 />
<h5 />
<h6 />
<header-row-list />
<heading />
<help-button />
<hgroup />
<hr />
<image />
<info-header />
<info-header-row />
<info-header-row-list />
<label />
<li />
<link />
<list-iterator />
<locale-select />
<location-field />
<login-button />
<map />
<message />
<message-based-refresh />
<message-list />
<multi-connect />
<ol />
<on-update-refresh />
<p />
<paging />
<paging-button />
<paging-size-select />
<part />
<part-reference />
<part-set />
<password />
<plain-text />
<plain-text-property />
<pre />
<property-column />
<radio-buttons />
<read-only-if />
<remember-me-checkbox />
<rich-text />
<rich-text-field />
<rich-text-property />
<row />
<select-field />
<select-popup />
<single-connect />
<sitemap />
<span />
<state />
<stereotype />
<strong />
<style />
<style-set />
<subview />
<subview-hgroup />
<subview-list />
<subview-vgroup />
<tab />
<tab-set />
<text-field />
<textarea />
<toolbar />
<tree-connect />
<ul />
<url-column />
<verbatim />
<vgroup />
<view />
<visible-if />
<wiki-text-property />
51. Domain Type Models
<domain-type />
<property-type-parameter />
<property-type-parameter-set />
<reference-property />
<reference-property-set />
<wfs-domain-type />
52. Defining Domain Type Model Properties
<domain-type-property />
<domain-type-property-set />
<enum-property />
<enum-property-set />
<formula-property />
<formula-property-set />
<property-set />
<property-type />
<type-converter-reference />
<type-converter-reference-set />
53. Primary Keys for Domain Type Models
<key />
<primary-key />
54. Primary Keys for Complex Domain Type Models
<contained-key />
<contained-primary-key />
<contained-primary-key-set />
55. Domain Type Model Actions
<on-create />
<on-delete />
<on-insert />
<on-update />
56. Initializing Domain Type Models
<data-set />
<initialization-data />
<insert-object />
<insert-test />
<insert-value />
<property-check />
57. Constant Domain Type Models
<constant-data />
<constant-data-list />
<constant-domain-type />
<property-reference />
<property-reference-list />
58. Excel Based Domain Type Models
<excel-configuration />
<external-excel-domain-type />
59. External Domain Type Models
<create-statement />
<database-statement-set />
<delete-statement />
<external-relational-domain-type />
<find-statement />
<insert-statement />
<select-statement />
<update-statement />
60. Joined Domain Type Models
<joined-domain-type />
<joined-property />
<joined-property-set />
61. Relations between Domain Type Models
<relation />
<relation-chain />
<relation-chain-list />
<relation-reference />
<relation-set />
62. Miscellaneous Domain Type Model Features
<comment />
63. Filtering
<and />
<can-access />
<complies-to />
<contains />
<contains-comparator />
<criterion />
<dynamic-condition />
<ends-with />
<equals />
<false />
<filter-pattern />
<filter-pattern-set />
<filter-specification />
<filter-specification-set />
<filtered-list />
<geo-contains />
<geo-within />
<greater-than />
<greater-than-or-equal-to />
<has-changed />
<has-current-element />
<has-elements />
<has-permission />
<has-type />
<in />
<in-transition />
<include />
<is-connected-to />
<is-defined />
<is-new />
<is-property-modified />
<is-super-user />
<is-undefined />
<join-definition />
<join-definition-set />
<less-than />
<less-than-or-equal-to />
<matches />
<not />
<or />
<sort-order />
<sort-order-list />
<starts-with />
<true />
<user-logged-in />
<validation-failed />
64. GIS
<defaults />
<domain-type-based-wfs />
<gis />
<layer />
<layer-list />
<registry />
<service-registry />
<service-registry />
<srs />
<style />
<style-reference />
<styles />
<url />
<wfs />
<wfs-based-wms />
<wms />
65. Internationalization
<translation-definition />
<translation-definitions />
<translation-definitions />
<translations />
66. Layout Models
<layout />
<setting />
<skin />
67. Navigation Models
<cms-navigation-item />
<item />
<item-list />
<navigation />
68. Portal Meta Models
<anonymous-model-permissions />
<available-process />
<available-processes-set />
<configuration />
<conversation-context />
<default-property />
<default-property-set />
<definition />
<domain-context />
<domain-type-reference />
<domain-type-reference-set />
Default Property Set
<gis />
<id-mapping />
<id-mapping-set />
<locale />
<meta />
<model-permission />
<navigation-reference />
<navigation-reference-set />
<portal />
The MetaModel
The Conversation Context
The Session Context
The Gis Model
The Navigation Reference Set
Supported Locales
The Domain Type Reference Set
The Process Reference Set
The Web Service Reference Set
The REST Services Reference Set
Paging
Filter Specification Set
UI Component Setting Set
Action List Set
Start Action List
<process-reference />
<process-reference-set />
Using ID Mappings to Copy Processes
<property-type-reference />
<property-type-reference-set />
<public-processes />
<session-context />
<start-action-list />
<supported-locales />
<user-model-permissions />
69. Process Models
<after-postprocessing />
<after-preprocessing />
<back-state />
<before-postprocessing />
<before-preprocessing />
<confirmation />
<confirmation-property />
<confirmation-property-list />
<decision-state />
<end-state />
<input />
<input-interface />
<interface />
<mapping />
<object-mapping />
<object-mappings />
<output />
<output-interface />
<parameter />
<parameter-set />
<process />
<process-context />
<process-state-set />
<property-mapping />
<property-mappings />
<request-context />
<start-state />
<subprocess-start-state />
<transition />
<transition-list />
<view-state />
<virtual-properties />
<virtual-property />
70. Restrictions
<error-message-mapping />
<error-message-mapping-set />
<filter-restriction />
<restriction />
<restriction-set />
<validate-if />
71. Scoped Object and List Models
<scoped-domain-object />
<scoped-domain-object-list />
<scoped-domain-object-list-ref />
<scoped-domain-object-ref />
72. Rest Service Models
<rest-service />
<rest-services />
<rest-services-reference />
<rest-services-reference-set />
73. Staging Models
<attachment-configuration />
<attachment-configuration-set />
<content-source />
<content-source-set />
<data-source />
Choosing the correct database schema export mode
<data-source-set />
<logging-configuration />
<mail-service-configuration />
<mail-service-configuration-set />
<proxy-configuration />
<security-configuration />
<stage />
The Data Source Model
The Proxy Configuration Model
<stages />
74. Value Models
<constant />
<count />
<current-property-value />
<geo-point />
<geo-polygon />
<parameters />
<property />
<property-value />
<relation-count />
<size-of />
75. Web Service Models
76. XML Transformation Models
<next-transformer />
<transformer />
<transformer-list />
77. Miscellaneous Models
<setting />
<settings />
<ui-component-setting />
<ui-component-setting-set />

List of Tables

2.1. Repositories
2.2. Properties of Minimal POM
8.1. Operation List
8.2. Date Provider Map
8.3. Unit Modifier Map
11.1. Directory structure
11.2. Directory structure
14.1. Predefined Services
15.1. Agent Trigger IDs
15.2. Attributes of DomainTypeBaseAgent
15.3. Attributes of EventBasedAgent
15.4. Attributes of TimeBasedAgent
16.1. Portal model attributes
16.2. Meta model attributes
16.3. Data source configuration parameter
16.4. Proxy configuration parameters
19.1. Data Source Types
20.1. Attributes of AddToListAction
20.2. Children of AddToListAction
20.3. Attributes of CallAction
20.4. Attributes of ConnectAction
20.5. Attributes of DeleteAction
20.6. Children of DeleteAction
20.7. Attributes of DeleteByAction
20.8. Children of DeleteByAction
20.9. Attributes of DisconnectAction
20.10. Children of DisconnectAction
20.11. Attributes of ExecuteAction
20.12. Attributes of ImportAction
20.13. Predefined objects in import scripts
20.14. Attributes of NewAction
20.15. Attributes of RemoveAction
20.16. Attributes of RemoveListAction
20.17. Attributes of ResetCacheAction
20.18. Attributes of SendOutgoingEmailsAction
20.19. Attributes of SetActiveNavigationAction
20.20. Attributes of SetPropertyValueAction
20.21. Children of SetPropertyValueAction
20.22. Attributes of TransformAction
20.23. Attributes of ValidateAction
20.24. Attributes of ValidateErrorAction
20.25. Attributes of all multi actions
20.26. Attributes of filtered-list
21.1. Attributes of is-defined-filter
21.2. Attributes of is-undefined-filter
21.3. Attributes of the IncludeFilter
21.4. Attributes of HasElementsFilter
21.5. Children of HasElementsFilter
21.6. Attributes of Constant Filter
22.1. Attributes of Attachment Content Element
22.2. Attributes of CheckBox Content Element
22.3. Attributes of ErrorMessageList Content Element
22.4. Attributes of ExternalLink Content Element
22.5. Attributes of Label Content Element
22.6. Attributes of MultiConnect Content Element
22.7. Sub Elements
22.8. Attributes of Password Content Element
22.9. Attributes of RichTextField Content Element
22.10. Attributes of SelectField Content Element
22.11. Attributes of Textarea Content Element
22.12. Attributes of Textfield Content Element
23.1. Attributes of Web Service Definition
23.2. Predefined Objects for Groovy Web Service Endpoint Scripts
24.1. Web service client action attributes
24.2. Predefined objects in Groovy web service client scripts
24.3. Methods of WebServiceGateWay
24.4. Methods of WebServiceXmlHandler
25.1. Attributes of RestService
25.2. Bindings of REST Service Scripts
25.3. Methods of InputObject
26.1. Transformer List attributes
26.2. Transformer attributes
26.3. Predefined objects in transformation scripts
26.4. Predefined objects in transformation scripts
26.5. Attributes of the next-transformer tag
28.1. Attributes of Mail Service Configuration Set
28.2. Attributes of Mail Service Configuration
28.3. default settings
28.4. RetryMailServiceSendStrategy settings
28.5. FileBasedMailService type settings
28.6. Properties
32.1. Predefined Objects for Groovy Scripts
33.1. Properties of MultiTagWikiDecodingService
37.1. OpenSAGA Model Interfaces for extension
39.1. Internal OpenSAGA Caches

List of Examples

2.1. Context path configuration in the web.xml
2.2. Extension configuration by environment variable
2.3. Extension configuration by file
2.4. Stage configuration by environment variable
2.5. Stage configuration by file
3.1. How a domain context path evolves
5.1. Defining a virtual property
5.2. Exposing properties of a cached object with prefix
9.1. Navigation Example
13.1. Logging configuration within a stage
16.1. Portal Definition
16.2. Meta Definition
16.3. Anonymous Model Permissions Definition
16.4. User Model Permissions Definition
16.5. Navigation Reference Set Definition
16.6. Supported Locales Definition
16.7. Domain Type Reference Set Definition
16.8. Default Property Set Definition
16.9. Process Set Definition
16.10. Duplicating a Process
16.11. Web Service Reference Set Definition
16.12. REST Service Reference Set Definition
16.13. Paging Definition
16.14. Filter Specification Set
16.15. UI Component Setting Set
16.16. Action List Set
16.17. Start Action List
16.18. A single stage definition
16.19. Configure a proxy for OpenSAGA
17.1. View Restrictions
17.2. Interrupting the Preprocessor and the Postprocessor
20.1. Filter Specifications Used By Action
20.2. AddToListAction: Adding a scoped domain object
20.3. AddToListAction: Adding new objects to a list
20.4. CallAction: Execute a action list
20.5. Deletes the current domain object
20.6. Deletes related domain objects
20.7. Deletes domain objects cascaded
20.8. DeleteByAction: Delete all domain objects of a given type
20.9. DeleteByAction: Delete domain objects with a given filter specification
20.10. Disconnects the current domain object from a specified object
20.11. Disconnects a cached domain object from a another one
20.12. Disconnect the current domain object from a set of related domain objects
20.13. ImportAction: import from a domain type
20.14. ImportAction: import from a XML resource
20.15. ImportAction: example import script with GPathResult
20.16. ImportAction: example import script with GroovyXmlNode
20.17. GroovyXmlNode: Accessing nodes
20.18. GroovyXmlNode: Accessing child node value
20.19. GroovyXmlNode: Accessing attribute value
20.20. GroovyXmlNode: Accessing current node value
20.21. NewAction: Creating a new target domain object
20.22. NewAction: Creating a cached domain object
20.23. NewAction: Creating a cached domain object list
20.24. RemoveAction: Remove a cached object from its scope
20.25. RemoveListAction: Remove a cached list from its scope
20.26. ResetCacheAction: Reseting all caches
20.27. ResetCacheAction: Reseting one cache
20.28. ResetTranslationsAction: Reseting translation
20.29. SendOutgoingEmailsAction: Sending the outgoing emails
20.30. SetActiveNavigationAction: Sets programmatically the active navigation item
20.31. SetActiveNavigationAction: Active a navigation item programmatically
20.32. SetPropertyValueAction: Setting a constant constant value in the current domain object
20.33. SetPropertyValueAction: Setting a value of another property in a set of domain objects
20.34. SetPropertyValueAction: Setting a value with a property value provider bean
20.35. SetPropertyValueAction: Setting a value with a property value provider bean
20.36. TransformAction
20.37. ValidateAction: Validating the target domain object
20.38. ValidateAction: Validating a scoped domain object
20.39. ValidationErrorAction
21.1. IsDefinedFilter: Checking a value
21.2. IsDefinedFilter: Checking a cached domain object
21.3. IsDefinedFilter: Checking a cached domain object list
21.4. IsUndefinedFilter: Checking a value
21.5. IsUndefinedFilter: Checking a cached domain object
21.6. IsUndefinedFilter: Checking a cached domain object list
21.7. Defining a filter within a filter specification set
21.8. Including a filter from a filter specification set
21.9. Including and extending a filter specification
21.10. HasElementsFilter: Checking a scoped list
21.11. HasElementsFilter: Checking a scoped list
21.12. HasElementsFilter: Checking a scoped list
22.1. Attachment Element
22.2. Checkbox Element
22.3. Error-Message-List Element
22.4. External Link Element
22.5. Label Element
22.6. Multi Connect Element
22.7. Password Element
22.8. Rich Text Field Element
22.9. Select Field Element (Using an Enumeration Type)
22.10. Textarea Element
22.11. Textfield Element
23.1. Web service definition
23.2. Web service with multiple operations
23.3. Validation rules
23.4. Web service endpoint with transformers
23.5. "all users" web service definition
23.6. "all users" web service schema
23.7. "all users" Groovy script
23.8. Example output of the "all users" Groovy script
23.9. Enhanced "all users" Groovy script
23.10. Web service definition without script and endpoint bean
23.11. holiday-web-service.xsd
23.12. Holiday request domain type
24.1. Abstract Web Service Client Action Definition
24.2. Domain type for web service request
24.3. Domain type for web service response
24.4. Web service client action for 'ZIP' Web Service
24.5. Domain type for 'Bing' response
24.6. Web service action definition for a list of data sets
24.7. Defining GroovyScriptBasedWebServiceClient as action
24.8. Groovy web service client for 'ZIP' web service (with GPathResult)
24.9. Groovy web service client for 'ZIP' web service (with WebServiceXmlHandler)
24.10. Calling the 'Bing' web service via groovy client
25.1. REST Service definition
25.2. Making RestService in OpenSAGA available
25.3. Example rest services implementation
25.4. Output Object Example
25.5. RestServiceScriptingOutputObject: noChanges()
25.6. RestServiceScriptingOutputObject: send(int code)
25.7. RestServiceScriptingOutputObject: Setting the etag
25.8. RestServiceScriptingOutputObject: XML response
25.9. RestServiceScriptingOutputObject: XML response
25.10. RestServiceScriptingOutputObject: binary(stream, mimeType)
26.1. Defining a list of transformers for xml data
26.2. Defining a transformer with xslt transformation
26.3. An example XSLT transformation
26.4. Example implementation of StringTransformation
26.5. Definition of a transformation bean
26.6. Defining a transformer with a transformation bean
26.7. Transformation script in groovy
26.8. Defining a transformer with a transformation script
26.9. Defining a conditional transformer with XPath condition
26.10. Example implementation of StringCondition
26.11. Definition of a condition bean
26.12. Defining a conditional transformer with a condition bean
26.13. Condition script in groovy
26.14. Defining a conditional transformer with a script condition
26.15. Defining a transformer with XPath stop condition
26.16. Defining a transformer with a stop condition bean
26.17. Defining a transformer with a script stop condition
26.18. Transformer list with static execution order
26.19. Transformer list with a simple next-transformer
26.20. Transformer list with multiple next-transformers
26.21. Transformer list with multiple conditional next-transformers
27.1. Encryptor and decryptor bean definitions
27.2. Encrypt a password with OpenSSL (on Windows)
27.3. Encrypt a password with OpenSSL (on Linux)
28.1. Mail service definition
28.2. new mail service definition
28.3. new strategy definition
28.4. mail services config generator definition
29.1. Example: Overloading a Model
32.1. HelloWorld.groovy
32.2. CallHello.groovy
33.1. Defining a WikiText property with a special WikiDialect
33.2. Implementing a WikiDecodingService (Markdown WikiDialect)
33.3. Making a WikiDialect available in OpenSAGA by defining a Spring Bean
33.4. Configure a MultiTagWikiDialect
43.1. Marking additional XML Schema paragraphs
43.2. Example
43.3. Example
46.1. A numeric salary attribute
46.2. A numeric salary attribute
46.3. Enumeration type
46.4. Enumeration using domain type
48.1. Action List Set
48.2. AddToListAction: Adding a scoped domain object
48.3. AddToListAction: Adding new objects to a list
48.4. Deletes the current domain object
48.5. Deletes
48.6. Deletes domain objects cascaded
48.7. DeleteByAction: Delete all domain objects of a given type
48.8. DeleteByAction: Delete domain objects with a given filter specification
48.9. Disconnects the current domain object from a specified object
48.10. Disconnects a cached domain object from a another one
48.11. Disconnect the current domain object from a set of related domain objects
48.12. ImportAction: import from a domain type
48.13. ImportAction: import from a XML resource
48.14. ImportAction: example import script with GPathResult
48.15. ImportAction: example import script with GroovyXmlNode
48.16. GroovyXmlNode: Accessing nodes
48.17. GroovyXmlNode: Accessing child node value
48.18. GroovyXmlNode: Accessing attribute value
48.19. GroovyXmlNode: Accessing current node value
48.20. NewAction: Creating a new target domain object
48.21. NewAction: Creating a cached domain object
48.22. NewAction: Creating a cached domain object list
48.23. RemoveAction: Remove a cached object from its scope
48.24. RemoveListAction: Remove a cached list from its scope
48.25. ResetCacheAction: Reseting all caches
48.26. ResetCacheAction: Reseting one cache
48.27. ResetTranslationsAction: Reseting translation
48.28. SendOutgoingEmailsAction: Sending the outgoing emails
48.29. SetActiveNavigationAction: Sets programmatically the active navigation item
48.30. SetActiveNavigationAction: Active a navigation item programmatically
48.31. SetPropertyValueAction: Setting a constant constant value in the current domain object
48.32. SetPropertyValueAction: Setting a value of another property in a set of domain objects
48.33. SetPropertyValueAction: Setting a value with a property value provider bean
48.34. SetPropertyValueAction: Setting a value with a property value provider bean
48.35. TransformAction
48.36. ValidateAction: Validating the target domain object
48.37. ValidateAction: Validating a scoped domain object
48.38. ValidationErrorAction
50.1. Attachment Element
50.2. Checkbox Element
50.3. Simple data grid with user filter
50.4. Object relative data grid
50.5. Data grid showing a scoped domain object list
50.6. Error Message Element
50.7. Error-Message-List Element
50.8. External Link Element
50.9. Label Element
50.10. Multi Connect Element
50.11. Paging Definition
50.12. Password Element
50.13. Rich Text Field Element
50.14. Select Field Element (Using an Enumeration Type)
50.15. Textfield Element
50.16. Textarea Element
63.1. Filter Specification Set
63.2. HasElementsFilter: Checking a scoped list
63.3. HasElementsFilter: Checking a scoped list
63.4. HasElementsFilter: Checking a scoped list
63.5. Defining a filter within a filter specification set
63.6. Including a filter from a filter specification set
63.7. Including and extending a filter specification
63.8. IsDefinedFilter: Checking a value
63.9. IsDefinedFilter: Checking a cached domain object
63.10. IsDefinedFilter: Checking a cached domain object list
63.11. IsUndefinedFilter: Checking a value
63.12. IsUndefinedFilter: Checking a cached domain object
63.13. IsUndefinedFilter: Checking a cached domain object list
68.1. Default Property Set Definition
68.2. Domain Type Reference Set Definition
68.3. Meta Definition
68.4. Anonymous Model Permissions Definition
68.5. User Model Permissions Definition
68.6. Navigation Reference Set Definition
68.7. Portal Definition
68.8. Process Set Definition
68.9. Duplicating a Process
68.10. Start Action List
68.11. Supported Locales Definition
72.1. REST Service Reference Set Definition
73.1. Configure a proxy for OpenSAGA
73.2. A single stage definition
77.1. UI Component Setting Set

Part I. Introduction

Chapter 1. Overview

Mission Statement

OpenSAGA focuses on developing applications for eGovernment contexts. OpenSAGA is a platform for developing Java-based web applications in a manner that allows the modeling of web applications by intention and declaration instead of imperative coding. It hides technological details in an abstraction layer in order to allow for a continuous and transparent evolution of projects and simplify the learning process required to become an expert web developer.

OpenSAGA places a major focus on complying with the requirements laid down in SAGA (the german standard architecture for e-government applications). Its main target is to be as compatible as possible with those standards while at the same time advocating a new style of development. In order to achieve the second goal OpenSAGA introduces a domain specific language (DSL) for specifying web applications on a highly abstract level. By doing so it provides three major benefits:

  • The domain specific language requires far less knowledge about the vast amount of modern web technologies usually required by various frameworks to build highly interactive applications. It uses a combination of model-driven, generator-based and generative approaches to automatically build the appropriate technology mix from your declared intentions. Thus new developers can learn to "run" much faster and become productive much quicker than is typical for classical approaches.

  • The domain specific languages hides most of the technical details behind the scenes. You can get there if you want but usually you will not want to venture into those dark and dangerous recesses. Rather OpenSAGA allows you to concentrate on developing actual business logic. Even better evolving an application becomes a breeze. No longer you will need to fight with web applications that - after running for two to four years - consist of technologies long out of date. No longer will you have to dig for knowledge about ancient frameworks. Application evolution with OpenSAGA is as easy as exchanging the underlying generator and runtime and most of the time you will not have to change a single line of code to be able to use the latest web technologies.

  • Developers will no longer get stuck on a certain technology level. As OpenSAGA simplifies both the start of development as well as the technological evolution, your value as a developer increases over time, as you can concentrate on business aspects of your job, grow your understanding and indepth knowledge of the business processes you work on and thus can rise to much higher efficiency by really getting into the processes.

OpenSAGA targets portals and process centric web applications. We consider portal applications to be all web applications that aggregate information, content and processes under a coherent interface, e.g. in the OpenSAGA view of reality portals are a lot more than just portlet collections. Specifically we do not limit the generated portal implementation to a subset of web technologies but prefer to use the best available tool in any given situation.

Design Values

In analogy to Extreme Programming and the Agile Manifesto a set of values, principles and methods form the base of the OpenSAGA design. We will explain them briefly in the following section in order to help you to get an understanding for underlying design decisions. Values define the map upon which our design and implementations are located, principles describe the roads we prefer to take and methods help us in making individual steps.

Values

Profitability

Development shall not be bogged down by details. Development must be fast and efficient. Development support must free up time to concentrate on the requirements the customer issues. This does not necessarily mean a focus on brevity and especially not on convention over configuration but rather a focus on modeling the important things precisely. And in such a manner that technological evolution becomes a commodity and not a problem.

Accessibility

We strive for a platform that is accessible to developers (and also for users of the platform - but that is another major focus not tackled under this specific). Projects shall be easy to set up, technical details shall not interfere with your work and the constant technology flux shall be abstracted for you. Applications shall look beautiful right away. The platform design shall be consistent and easy to pick up.

Flexibility

We do not want to prevent you from doing your work. 80% of all tasks shall be achievable in a simple, standardized and straight forward way. The remaining 20% shall be easily addable in the way you prefer. All points important for individualized extensions shall be easily accessible and easily extendible.

Principles

Customer Focus

We want to focus on the conceptual and domain specific needs of our customers. Technology is only in so far of interest as that it allows us to implement solutions in a manner appropriate for the customer. The programmer should be freed from the need to understand ever changing technological contexts.

Domain Driven

We focus on developing rich portal solutions and web applications. State of the art technology in this area is the baseline of our work and user comfort of high importance. Models must be as expressive as possible when modeling aspects in this domain.

Model Driven

We use a strict model driven approach. All parts of the runtime system are generated from the models. The models explicitly describe the complete system. We always use the most appropriate model at hand. If XML is not the best way to go, we will follow other paths (e.g. Groovy or SQL). Nonetheless the models must describe the domain completely, only specialties should be expressed in more appropriate ways.

Agile

We support an agile development approach that allows for rapid prototyping, simple changes and evolutionary development of solutions.

Methods

Being based on the SAGA standard OpenSAGA is fully compliant with the V-Model XT (the standard project management method for e-government applications in Germany). We are currently working on providing templates for jump starting V-Model XT based projects in connection with OpenSAGA.

Additionally OpenSAGA supports a highly agile, interactive and rapid prototyping based approach to application development. This approach is based on a top down view of the system to be build and starts from a high level perspective then chiseling out the details of your project. The whole approach is strictly model driven, so you first build the models and then refine them with more and more detailed submodels until finally getting to the code level where you actually implement the business logic either in Java code or one of the many scripting languages supported by OpenSAGA.

The examples in the reference manual will give you a brief overview about how we ideally start to approach projects with top down agility. Workshops and trainings are available to train you in this highly effective method that has been in use for many projects over the past eight years. Additionally the QuinScape GmbH provides courses on how to use V-Model XT in conjunction with OpenSAGA to the utmost effect - but never forget: You just need to start.

More details about the "OpenSAGA approach" are available in Chapter 4, Top Down Design and Development and more specifically in Chapter 6, Programming Tutorial: Developing a Web Based FAQ Application.

Basic Principles of OpenSAGA Portals and Web Applications

We quite often use the names "portals" and "web applications" synonymously. Currently OpenSAGA only produces web applications in the strict sense as currently there is no portlet support available (expect that for a later version, probably before 2.0.0). Nonetheless all OpenSAGA applications share a set of common features and assumptions we briefly would like to explain in the next sections.

OpenSAGA Applications Are Web Applications

Although OpenSAGA models are abstract enough to also describe Swing or SWT applications we focus our development efforts on a single runtime platform - the web. We do this in order to increase our chances of providing a truly great platform as the support for a variety of platforms inevitably would lead to a lot of compromises and we do not want to compromise.

OpenSAGA Applications Are Accessible

Accessibility is a complex technical topic and few web frameworks regard accessibility as a strategic topic. We are different in that we believe in supporting strong accessibility (e.g. even working completely without JavaScript support) as this is a common requirement in eGovernment applications. Nonetheless OpenSAGA includes strong support for modern web technologies including AJAX the major difference being that all OpenSAGA components take great care to include the full functionality for both JavaScript-enabled and -disabled environments.

OpenSAGA Applications Favour Structured Content

OpenSAGA web applications are not very well suited to represent the functionality of classic content management systems (although there is some support for CMS functionality). OpenSAGA applications are better suited to presenting structured content, form based processes and complex workflow and work better with integrated CMS functionality (e.g. by retrieving content from the CMS and displaying it).

OpenSAGA Applications Are Workflow Oriented

One of the major models of the OpenSAGA modeling ecosphere are the process models. Process models describe complex workflows made up from start states, view states, decision states, etc. and model the UI workflow for users. Additionally they offer various connection points to background processes.

OpenSAGA Applications Are Strictly Model Driven

Models are the core artifacts of OpenSAGA applications. As we believe in flexibility OpenSAGA offers a wide range of extension points which you can use to inject scripts or Java code into the models in order to exchange or enhance standard runtime behaviour. With this one exception models are the core unit of work and you will alter models in order to change behaviour.

OpenSAGA Applications Support Complex Configurations

OpenSAGA applications support both stages and extensions in order to compose complex application scenarios from simpler building blocks. Stages provide a means to separate infrastructure configuration details from the core functionality of a application and allow to define arbitrary sets of configuration data that e.g. differentiate between the settings of development, quality assurance (QA) and production settings. Additionally applications can be modularized in any way you like.

OpenSAGA additionally includes a composition feature that takes extensions with horizontal or vertical feature slices and combines them into powerful applications. As the developer is responsible for defining the boundaries of those extensions the mechanism is very powerful (and requires responsible behaviour) but can ultimately be used for various efficient architectures. For example it is possible to define a core layout for a global company in one extension and then specialize this core layout for subgroups and specialize them further down in extensions that inherit some behaviour of their parents, add new behaviours and modify existing behaviours. As the core extension mechanism is not limited to layouts but can be used for anything from single views to complex workflows highly complex and powerful configuration scenarios thus are easily supported.

Chapter 2. First Steps

Getting acquainted with OpenSAGA

OpenSAGA currently exists in a strange duality: Since it stresses German eGovernment requirements the project website currently only is available in German. Additionally the issue tracker (JIRA) and the discussion forums for now also are only available in German. We will add support for English speakers over time (or as soon as someone asks ;-) ). This documentation is English since we from the start intended to be prepared for an international focus as the German SAGA standard (our guideline for what we try to achieve) also will be formulated in English starting with version 5.0. Thus currently all technical documentation is only available in English, the community and the official website are only available in German. Better approaches and help realizing them are welcome ;-)

The following addresses will help you to get started:

  • http://www.opensaga.org: The project website (german only right now). Contains an introduction, some overview documentation and links to all other important places (e.g. the forum and the issue tracker).

  • http://www.opensaga.org/forum: The discussion forum for various aspects of OpenSAGA. This should be your first stop if you encounter questions, problems, etc.

  • http://www.opensaga.org/jira: The issue tracker for the OpenSAGA project. This should be your second stop if you couldn't find sufficient help in the forums above or come to the conclusion that some enhancement should be added to the project.

  • http://www.opensaga.org/blog/team-blog: The team blog of the OpenSAGA project. Here we blog about new features, interesting tricks and everything else of interest to the OpenSAGA project.

  • http://twitter.com/OpenSAGA: Our team twitter account. Occasionally we use it :-)

Debugging OpenSAGA Applications

OpenSAGA is a very powerful and highly configurable platform. Flexibility always comes with the price that there are many things to do wrong. This section gives some brief advice on how to cope with problems while working with the OpenSAGA platform:

  • If there is some kind of problem while starting an OpenSAGA based application always scan your log files or your console for the first exception that occurred. As the whole startup process is pretty involved an early problem can initiate a series of subsequent problems. Don't let yourself be fooled by later exceptions (which we try to avoid as much as we can) but rather look at the origin. The first exception that occurred and is logged usually will give the best hints about the actual problem.

  • Ask in the OpenSAGA forum for support. You can find the official forums at http://www.opensaga.org/forum.

Downloading OpenSAGA

You can download the latest version of OpenSAGA from http://www.opensaga.org/downloads. If you feel particularly adventureous you can also download the nightly builds of OpenSAGA from http://www.opensaga.de/downloads/nightly-builds but be warned. They consist of the latest checkins of our project team and times we even check in broken code. So there are no guarantees attached with the nightly builds.

OpenSAGA Maven Integration

OpenSAGA relies on the Maven dependency management. The maven integration is independent of the IDE and addtional plugins. OpenSAGA supports a maven repository where final builds and snapshots are located. Also some third-party libraries required for a sucessful build are provided.

Projects which use OpenSAGA aren't forced to support a maven build. You could download the OpenSAGA dependencies manually or use Maven only once for dependency resolving (This would be the more convenient way). The dependencies have to be located (according to the default web-application structure) in WEB-INF/lib.

Downloading & Installing Maven

OpenSAGA supports the latest stable version of Maven 2. We highly recommend the use of Maven 2.2.1 for OpenSAGA builds. Maven is distributed in several formats, you can download the recommended version from http://maven.apache.org/download. The use of Maven 3.0 is not completely tested so its use is inadvisable although Maven 3.0 supports a great backward compatibility.

The installation instructions can be found on http://maven.apache.org/download.html#Installation.

Maven Repositories

OpenSAGA offers its own Maven2 Repository. OpenSAGA M2 Repository doesn't proxy other repositories. So additional Dependencies can't be resolved by OpenSAGA M2 Repository.

OpenSAGA Maven Repository

The Repository Manager is located on http://opensaga.org/maven/. It supports the repository types listed below.

  • Releases (OpenSAGA Final Builds)
  • Snapshots (OpenSAGA Development Builds)
  • Third Party

Third Party Repositories

OpenSAGA uses several third-party repositories to resolve artifacts.

Table 2.1. Repositories

IdNameURL
opensagaOpenSAGA Repositoryhttp://www.opensaga.org/maven/content/groups/public
jansiJansi Fusesourcehttp://jansi.fusesource.org/repo/release
javaparserJavaParser Repositoryhttp://javaparser.googlecode.com/svn/maven2
jbossJBoss Repositoryhttp://repository.jboss.com/maven2
java.net-m2java.net - Maven 2http://download.java.net/maven/2
scalaScala Tools Repositoryhttp://scala-tools.org/repo-releases
geotoolsOSGEO GeoToolshttp://download.osgeo.org/webdav/geotools
hibernate-spatialHibernate Spatial Repositoryhttp://www.hibernatespatial.org/repository

Resolving OpenSAGA Dependencies with Maven

This chapter describes the steps to achieve satisfied dependencies for OpenSAGA.

Preparing the Minimal POM

To resolve dependencies with Maven you have to create a minimal POM (Project Object Model). For further informations you should consider reading the POM Reference (http://maven.apache.org/pom.html). The minimal POM consists of the GAV Parameters, the OpenSAGA M2 Repository Definition and the OpenSAGA-Core dependency.

This minimal POM assumes that your projects consists of the Maven Standard Directory Layout for Web-Applications defined by convention. An introduction to this convention can be found here http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html.

For easy Maven support you could use m2eclipse for the Eclipse IDE http://m2eclipse.sonatype.org/. To handle maven without m2eclipse you may use the maven-eclipse-plugin to generate files for WTP and Eclipse (e.g. .classpath, .project, etc.). For an IDE independent build you may have look into the OpenSAGA POM for inspiration.

Table 2.2. Properties of Minimal POM

PropertyDescription
${project.groupId} The group id of your project its often homogenous to your root package (e.g. org.opensaga)
${project.artifactId} The artifact id of your project.
${project.initialVersion} Your initial version of your project (Maven default: 0.0.1-SNAPSHOT)
${opensaga.version} The desired version of OpenSAGA (e.g. 1.0.0).

    <project xmlns="http://maven.apache.org/POM/4.0.0" 
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
                                 http://maven.apache.org/maven-v4_0_0.xsd">
      <modelVersion>4.0.0</modelVersion>
      
      <groupId>${project.groupId}</groupId>
      <artifactId>${project.artifactId}</artifactId>
      <version>${project.initialVersion}</version>
      <packaging>war</packaging>
      
      <repositories>
        <repository>
            <id>opensaga</id>
            <url>http://www.opensaga.org/maven/content/groups/public</url>      
         </repository>
      </repositories>
      
      <dependencies>
        <dependency>
          <groupId>org.opensaga</groupId>
          <artifactId>core</artifactId>
          <version>${opensaga.version}</version>
        </dependency>
      </dependencies>
    </project>                
                    

The properties of the minimal POM have to be replaced with your desired values. The minimal pom must be located in your project root with the adequate filename pom.xml.

Invoking Maven Dependency Management

To run the maven dependency resolving, you have to run a maven goal with the upcoming command.

mvn dependency:resolve
Please be patient this can take a few minutes, dependent on your bandwith and integrity of you local maven repository.

Supported Runtime Systems

OpenSAGA currently supports the following runtime environment. Take care to use the required minimum versions of other products and libraries since subtle behaviour differences in older releases might otherwise be the cause for all kinds of bugs.

  • Java 5+ (tested with Java 1.5.0_15)

  • Tomcat 6.0.20+ (tested with 6.0.20)

  • Servlet API 2.5+ (tested with 2.5)

Choosing Your Infrastructure

OpenSAGA can be used on a wide variety of systems. And if you find some kind of infrastructure we do not yet supported you can open a JIRA issue at http://www.opensaga.org/jira to ask for support for your preferred infrastructure software, be it an IDE, a server or a specific database.

Below you can find hints for installing and using some common systems. If your preferred piece of software is not yet officially supported and you run into problems you might look at the hints for similar products to see if you receive support. Additionally we welcome any hints on finetuning specific IDEs, etc.

IDEs

Our preferred IDE is Eclipse, especially since we provide a powerful plugin with OSclipse, which provides additional functionality while working with OpenSAGA in Eclipse (see http://www.opensaga.org/confluence/display/website/download-eclipse-plugin).

Configuring Eclipse for OpenSAGA Projects

We highly recommend that you download the OpenSAGA-Eclipse-Plugin since it provides extensive support for working with OpenSAGA (see http://www.opensaga.org/confluence/display/website/download-eclipse-plugin for details and documentation).

[Warning]Warning

Be careful to correct configure Eclipse by defining the following specific settings:

  • Disable auto reloading for your server. Usually this will cause endless loops and out of memory problems. Do so by double-clicking on the server, thus opening the server

    Next change to the modules tab and edit the OpenSAGA web module.

    Deactivate the auto-reload setting and press "OK".

Application Servers

OpenSAGA should work with any Java Application servers but often there are difficult problems with specific configuration settings. Below we summarize some of the most important configurations.

Tomcat

To run a OpenSAGA Portal without problems you should set the following parameters.

  • -Dorg.apache.el.parser.COERCE_TO_ZERO=false

  • -Xms64m

  • -Xmx256m

  • -XX:MaxPermSize=256m

Creating a Project

Create a new dynamic web project in Eclipse. Create a new folder under /WEB-INF/resources/extensions that equals your module name (e.g. your extension). That's it.

External Dependencies

OpenSAGA requires a number of dependencies in order to work. The various libraries are listed in ???, include them in your project. Additionally you need one JAR file for the OpenSAGA base installation and the JARs that are required for the extensions you might want to use. Include them under /WEB-INF/lib.

Running an OpenSAGA Portal

In order to run OpenSAGA you will need to configure a number of settings, specifically:

  • the underlying database,

  • the configuration for the deployed system,

  • the staging configuration.

Configuring the underlying database

You have to specify a data source (the section called “The Data Source Model”) with the name portaldb. This is the default database used for all domain types, but you can define exceptions (see the attribute data-source-name in ???). If you don't specify your own database, a default HSQLDB database is used.

Configuring the server

To run a OpenSAGA Portal without problems you should set the following parameters.

  • -Dorg.apache.el.parser.COERCE_TO_ZERO=false

  • -Xms64m

  • -Xmx256m

  • -XX:MaxPermSize=256m

Configuring the context path

OpenSAGA offers two ways to configure the context path - either by defining the context parameter opensaga.CONTEXT_PATH in the web.xml or by setting the parameter context-path in the opensaga-project.cfg configuration file.

Example 2.1. Context path configuration in the web.xml

<context-param>
    <param-name>opensaga.CONTEXT_PATH</param-name>
    <param-value>/opensaga-core</param-value>
</context-param>

Configuring the server deployment

OpenSAGA installations use two variables to configure a project deployment. These can be either defined globally for all installations on the server or locally for each deployed project. Configuration settings are searched in the following order for each variable described below:

  • A system property (e.g. defined with the -D JVM) option is queried. If a definition is found, that definition is used.

  • An environment variable with the given name is queried alternatively.

Configuring the project extensions for the server

OpenSAGA offers two ways to configure the extensions of a project - either by defining an environment variable or by using a configuration file. Both are explained in the next sections. The environment variable always has precedence over the configuration file.

Extension configuration by environment variable

OpenSAGA uses the configuration variable OPENSAGA_RESOURCE_EXTENSIONS to define the list of extensions to be used in a specific project (besides the base package which is always included). If the project is deployed under the context path FOO, OpenSAGA first will query the configuration variable OPENSAGA_RESOURCE_EXTENSIONS_FOO and only if no definition is found the global variable OPENSAGA_RESOURCE_EXTENSIONS will be queried.

Extensions are merged in the order given in the variable value. Individual values can be separated by a semicolon ";", a space " ", or a comma ",". If the underlying operation system uses the colon ":" as a separator for path definitions, the colon can also be used.

Example 2.2. Extension configuration by environment variable

OPENSAGA_RESOURCE_EXTENSIONS=gis;sandbox;qs-dev
OPENSAGA_RESOURCE_EXTENSIONS_FOO=gis;sandbox;qs-dev

Extension configuration by file

Extensions can be specified by using the configuration file /WEB-INF/cfg/opensaga-project.cfg. This property file has to declare the property extensions with a list of extensions in the format defined above.

Example 2.3. Extension configuration by file

extensions=gis;sandbox;qs-dev

Specifiying external extensions

In order to comply with highly specialized data center requirements and configuration setups OpenSAGA also allows to externalize parts of the current configuration. The extension loader recognizes specialized extension types (identified by a prefix separated with a colon from the extension ID) and resolves those extension IDs to special extensions. org.opensaga.runtime.controller.servlet.ExtensionIdLoaderServiceImpl.java contains some information of the approach and various implementations of org.opensaga.runtime.controller.servlet.ExtensionIdResolver come prepackaged with OpenSAGA. Additionally you can just dump your own implementations of ExtensionIdResolver ine some 00-psb-*.xml bean context of your OpenSAGA application and those beans will be autodiscovered and used by the extension resolver.

Configuring the deployment stage for the server

OpenSAGA offers two ways to configure the list of stages to be used in a project - either by defining an environment variable or by using a configuration file. Both are explained in the next sections. The environment variable always has precedence over the configuration file.

Stage configuration by environment variable

OpenSAGA uses the configuration variable OPENSAGA_STAGES to define the list of stages to be used in a specific project (besides the base package which is always included). If the project is deployed under the context path FOO, OpenSAGA first will query the configuration variable OPENSAGA_STAGES_FOO and only if no definition is found the global variable OPENSAGA_STAGES will be queried.

Stages are queried in the order in which they are defined. Individual stages must be separated by a colon ",", a semi colon ";" or a space " ".

Example 2.4. Stage configuration by environment variable

OPENSAGA_STAGES=global,dev-barney
OPENSAGA_STAGES_FOO=global,dev-homer

Stage configuration by file

Stages can be specified by using the configuration file /WEB-INF/cfg/opensaga-project.cfg. This property file has to declare the property stages with a list of stages in the format defined above.

Example 2.5. Stage configuration by file

stages=global,dev-barney

Naming conventions for deployment specific configuration variables

In the sections above we explained the usage of context path dependent configuration variables. The full variable name is created according to the following rules:

  • Any character that is not a character from the 26-letter ASCII alphabet is replaced by an underscore (case is ignored).

  • The resulting ID is appended to the global variable name by a separating underscore.

Example: A web application is deployed under the name "foo-123-bar". The resulting deployment specific variable name for stages will be OPENSAGA_STAGES_FOO_____BAR. Hint: Don't use special characters and numbers in your context path or live with the results ;-)

Getting constant HTML IDs for UI testing

For UI testing (e.g. with Selenium) it is very important to have somewhat stable IDs to refer to in the test scripts. This prevents having to adapt the test script whenever something in the tested views changes. OpenSAGA offers a mode that preprocesses the XML model to ensure that every XML element has its ID. It is enabled by setting the system property OPENSAGA_CONSTANT_IDS to true.

Develop your application

Start programming. More details in Chapter 4, Top Down Design and Development.

Known Problems and Workarounds

The following problems are known with OpenSAGA. Until they are fixed we provide recommended workarounds:

  • When using Tomcat, Tomcat requires at least one source file in a web project that you want to deploy in order to examine /WEB-INF/classes. Since OpenSAGA uses that directory for dynamically generated classes make sure that you create an initial source file in your own web project. This can be any kind of text file or whatever, just give Tomcat something to deploy.

Chapter 3. Basic Concepts

Model based design

One of the main benefits using the OpenSAGA platform is the concept of model based design. The OpenSAGA models define a conceptional abstract view of the domain being modeled, agnostic of the any specific technology. This approach combines documentation with prototyping since the models themselves can be verified and executed.

Using this design approach it is possible to speed up both the development process and communication with the customer by creating documentation from the model at any stage of development. Due to the chosen abstraction form any technology you are able to generate code for more than one platform or to switch to another platform with only small impact on the model (at least in theory). In practice the OpenSAGA platform tries to stay very focussed and is for now only concerned with web applications. Thus OpenSAGA users might notice occasional technological advancements under the hood but new presentation platforms currently are not planned.

Internally OpenSAGA uses a number of basic principles and technologies to describe its domain.

Everything is a model

Everything in OpenSAGA is a model. No exception. Except for implementations for various strategy interfaces used to extend the model. Clear about that :-) ?

We'll try again: The basic idea of OpenSAGA is that everything about your application is described by a model. Models are built in such a way that you can use them in an intentional declarative way. There are some exceptions - sometimes it makes no sense to describe a complex technological context with a model abstraction. An example for this are complex SQL statements. If you want to utilize the full power of an advanced database there is no better way than directly writing down tuned SQL statements. And those are the exceptions mentioned above: If it is necessary to write code directly OpenSAGA allows that - because for many cases code is the most appropriate form of modeling (at least it does not seem reasonable - except for syntactic sugar - that there might be a better DSL than SQL for retrieving data from relational databases). Thus everything in OpenSAGA is a model - only the syntax might differ at times.

Everything is XML

All models in OpenSAGA for now are described by XML. XML was chosen for pragmatic reasons:

  • XML Schema is easy to write and validate and commonly available.

  • XML is trivial to parse.

  • XPath and XSLT can be very helpful for working on XML data.

  • XML is a good intermediate data format for more convenient and specialized DSLs.

To simplify XML based modeling OpenSAGA provides an Eclipse plugin to support developers while creating models: OpenSAGE. OpenSAGE provides templates, advanced auto-completion, intelligent ID resolving and completion and more.

Model IDs

Each model must have an unique Id. If you do not provide an ID the platform will generate a random ID, with the impact that this model cannot be referenced in any other model. Additionally random IDs will change after server restarts, therefore you must not persist the generated IDs.

It is highly recommended to explicitly provide an ID for every defined model.

Model IDs can either be the section called “Global IDs” or the section called “Local IDs”.

Universally Unique IDs

Each and every ID defined must be globally unique.

While every ID definition must be unique it is possible to reference one and the same ID in different contexts and receive different results. If e.g. a part model ID is referenced in a domain object reference the domain object governing the part will be retrieved. If the part model ID is referenced by some UI update mechanism it actually refers to the part (or rather: its HTML representation) causing it to update under specific conditions. There are many such examples explained in the specific contexts.

Global IDs

Global IDs consist of segments and usually will look very similar to Java package names (at least in the default implementation provided by the OpenSAGA base package). If a model ID contains either a dot '.' or a dash '-' it is a global ID and can be used unchanged. Additionally the IDs of top level tags always are global IDs.

Local IDs

All IDs that are not regarded as global are local IDs. Local IDs can be referenced with their local name within the current model file. Internally various strategies are used to convert local IDs to global IDs (usually by processing the DOM tree containing the XML model and prefixing the local ID with IDs from parent tags). Therefor local IDs can't be referenced from outside the current model file but are nonetheless a great way to reduce the amount of writing required when e.g. creating view models and linking content element models in those view models (e.g. linking labels to input models).

Modeling with XML

Each model is defined using XML version 1.0. By default the encoding should be UTF-8, at least you should use the same encoding for all models. It is recommend to use the XML prolog element to provide the version and the encoding information to the parser.

A XML Schema Definition is available for each model, so that XSD-aware editors are able to assist you by providing code completion, hints on the structure or validating your model against the schema.

Objects and views

Each view (see the section called “<view />”) in OpenSAGA is associated with one primary domain object. All properties of said object are available for the content elements of the view. Additionally it is possible to list both connected objects (via some relation) and unconnected objects on a view. For more fine-grained control it is possible to divide a view into subviews and parts (see the section called “<subview />” and the section called “<part />”). Each part in turn has its own primary domain object which either equals the primary domain object of the view or must be defined via a relation chain as a related object of the primary view domain object.

Target domain objects

OpenSAGA utilizes the notion of a target domain object. Whenever a transition is initiated from a view OpenSAGA requests carry information about the target domain object which is adressed by the transition. The target domain object equals the most likely object to which a button can be related, e.g.

  • if the button exists in a datagrid row, the target domain object will be the object represented by the row,

  • if the button exists in a view, the target domain object will be the primary domain object of the view.

It is possible to annotate transition models with relation chains in order to change the target domain object to something else, see the section called “<transition />” for details.

Top down modeling

As explained in Chapter 4, Top Down Design and Development OpenSAGA utilizes a topdown approach to developing applications. Modelers start with a high level and abstract view of the final system and start to drill down to the details of various aspects of the target system in a layered process that slowly adds details. This is also represented in the way the major model subsystems are structured:

Additionally there are lots of sub models for various details of the system. Understanding the models mentioned above will provide a decent overview of the overall structure of OpenSAGA.

Working with data

OpenSAGA tries to abstract a lot of detail information from programmers. OpenSAGA can automatically discover the context of the current execution and thus "knows" about objects that are available, properties that can be referenced, etc. The following sections explain the basic assumptions OpenSAGA applies in order to structure accessible data.

Contexts

OpenSAGA differentiates a number of contexts with different scopes and lifetimes. Each scope can contain data in the form of atomic properties (of any property type defined in the system), objects (of a specific domain type) or lists of objects (of a single type).

The sections below explain the various scoped data contexts available in OpenSAGA applications. All share the following properties:

Chapter 5, Programming with references explains the internal search algorithms being used to retrieve data identified by a reference ID.

The following sections explains the layered scoped data context approach and their lifetimes.

Session context

The session context is the most persistent and long-lived data contexts of all OpenSAGA contexts. It is created as soon as a user logs in and exists until the user either the user logs our or closes his browser. The session context can be defined with the session-context tag (see the section called “<session-context />”) which is used in the portal model in the portal.xml (see the section called “<portal />”).

Conversation context

The conversation context is closely related to the session context in that it emulates a "per browser window" kind of session. It is created as soon as a user logs in and exists until the user either the user logs our or closes his browser window. The conversation context can be defined with the conversation-context tag (see the section called “<conversation-context />”) which is used in the portal model in the portal.xml (see the section called “<portal />”).

Process context

The process context exists for the duration of a single process execution. A process execution is bounded by the definitions of a single process model (see the section called “<process />”). The process context is defined with the process-context tag (see the section called “<process-context />”) in the process model mentioned above.

View context

The view context exists as long as the current process stays in one and the same view state. It currently cannot be extended due to model definitions. Instead it automatically picks up all data from the current view and mirrors that data as properties, objects and lists. The view context allows access to the following data:

  • Each property writing content element model mirrors its submission value in the view context.

Domain Context

The domain context is a supplementary context to the process context and shares its lifetime. The domain context is used to remember the object navigational path the user follows through the application.

Example 3.1. How a domain context path evolves

Example: The user starts on a view V-1 listing all employees of his company. He selects employee E-1 and examines the information about E-1 on view V-2. Then he clicks on the skill list of E-1 and examines the ratings ESR-1 on view S-3. The domain context path at this points contains a list of tuples containing (V-1, null), (V-2, E-1), (V-3, ESR-1).

The domain context contains all those objects in the so called domain context path. The individual objects can be accessed by referencing the ID of the corresponding view. Search starts with the last domain context path entry and proceeds to the first.

[Tip]Tip

Actually the domain context path contains triplets consisting of the view passed, the primary domain object of that view (if one was defined) and the transition that was used to arrive at the given view. Since the transition is only used for internal purposes you usually do not need to know that.


See also the section called “The Domain Context Path” for more details about the domain context path.

Part II. Programming

Chapter 4. Top Down Design and Development

OpenSAGA supports a top down approach for designing and developing applications. The basic idea is that you usually should start with a general picture of what kind of application you desire and then work out the details in an evolutinary approach. This seems to be a most natural way of designing applications since it allows business experts to gradually evolve their requirements and test them with evolving prototypes.

Design Process for OpenSAGA Applications

The following design process should be taken into account when creating a OpenSAGA application:

  1. Define the scope of your application (e.g. "B2B order portal", "intranet", "innovation management").

  2. Create a new project for your planned solution as explained in Chapter 2, First Steps.

  3. Design the general navigation structure of your application. Mind maps usually work best for this step. Create an initial mind map and refine it as new or changing requirements come up. Design the mind map in such a way that its nodes will represent processes of the final solution. If you feel the need to add more detail to nodes explaining the processes, mark those nodes with some symbol representing its specification value (e.g. a light bulb).

    Turn each unmarked mindmap node into a navigation item in the navigation model. You do not need to model the processes yet - just provide placeholder IDs for the processes that will be required. OpenSAGA replaces your process reference with an empty default process (just one view with no content at all) if no process model exists for the given ID. This again allows you to rapidly prototype a navigation structure.

  4. Design the most important process by sketching out the required states (especially the required views) and connecting them with transitions. Label both states and transitions with short but meaningful labels.

  5. Create a process model and derive the internal IDs from the labels created in the previous steps by applying the OpenSAGA naming conventions, see Chapter 10, Naming Conventions.

    You do not need to create any state models at this point. OpenSAGA will derive default state models for any states you leave undefined. Specifically default views will include a title with the ID of the view and buttons enabling the use of all transitions defined for the view.

  6. Design the individual states. You only need to design view states, all other states are fully described by the process model definitions.

  7. Create domain type models as needed, e.g. when designing a view.

  8. Continue with the next view and required submodels, then with the next process and so on until the portal has been completed.

Chapter 5. Programming with references

OpenSAGA makes heavy use of references. Nearly every model can be referenced by its ID and via the ModelInformationService these references can be resolved. But also properties (of objects) as well as cached domain objects and cached lists can be referenced. Resolving these references is a little bit more complicated. The objects, lists and properties can be stored in different scoped containers e.g. in the ProcessContext or ViewContext.

For resolving the references the internal ScopedDataContextSearchService is used. The search engine applies the following search order:

  1. Search the conversation context (see the section called “Conversation context”). If it is defined search in the following order:

    1. Inspect the contained view context (if defined, see the section called “View context”).

    2. Inspect the contained process context (if defined, see the section called “Process context”).

    3. Inspect the contained domain context (if defined, see the section called “Domain Context”).

    4. Inspect the conversation context itself (see the section called “Conversation context”).

    5. Repeat this step for the parent conversation (if defined).

  2. Inspect the session context (if defined, see the section called “Session context”).
The first match is returned.

Property references

Using property reference is a little bit more complicated than using the other kinds of references. The property can belong to different objects or data contexts. So it is important to know in which order the property references are resolved, so that you can reference the property you want. The following list shows the search order of the property reference resolving algorithm:

  1. System Domain Object

    For more information see the section called “Searching in System Domain Object, Working Set and Target Domain Object”.

  2. Working Set Objects

    For more information see the section called “Searching in System Domain Object, Working Set and Target Domain Object”.

  3. Target Domain Object

    For more information see the section called “Searching in System Domain Object, Working Set and Target Domain Object”.

  4. Domain Objects of View Parts

    The domain objects of the parts of the current source view are searched for the property.

  5. Scoped data contexts and their domain object

    All scoped data contexts are searched in the order as described in Chapter 5, Programming with references. First the data contexts are checked if there is a property with the given id. When the context does not contains such a property, all domain objects of the context are searched for the property.

    [Important]Important

    To reference properties of cached objects, it is necessary to define virtual properties. For more information see the section called “Referencing properties of cached objects and lists via virtual properties”

  6. Scoped lists

    All scoped data contexts are searched in the order as described in Chapter 5, Programming with references. The current objects of all cached lists of the contexts are searched for the property.

    [Important]Important

    To reference properties of cached lists, it is necessary to define virtual properties. For more information see the section called “Referencing properties of cached objects and lists via virtual properties”

Searching in System Domain Object, Working Set and Target Domain Object

The property reference resolving algorithm starts searching the property in the system domain object, then in the objects of the working set and finally in the target domain object. If the target domain object has been persisted at least once, the property is searched in objects that are related to the target domain object by to-one relations (assuming there are relation models defined for the domain type). If the target domain objecthas not yet been persisted the algorithm queries the domain context path for the property.

Referencing properties of cached objects and lists via virtual properties

In OpenSAGA it is not possible to reference properties of cached objects or lists directly. It is necessary to define virtual properties. Virtual properties maps the real properties of an objects to a unique ID. So it is possible to reference the property of a special object. You can either specify virtual properties for the properties you want or expose all properties of the object with or without a prefix for the IDs.

The following example shows how to define a virtual property for a cached object.

Example 5.1. Defining a virtual property

<process-context>
    <scoped-domain-object id="cached.obj" domain-type-ref="type.a" name="dummy">
        <virtual-properties>
            <virtual-property id="cached.obj.name" property-ref="type.a.name"/>
        </virtual-properties>
    </scoped-domain-object>
</process-context>
    				

The example defines a cached object of the type type.a. The domain type type.a has a property type.a.name. The virtual property maps this property to the id cached.obj.name. To reference the type.a.name property of the cached.obj, you have to use the id cached.obj.name.

The following example shows how to expose properties of a cached object with a prefix

Example 5.2. Exposing properties of a cached object with prefix

<process-context>
    <scoped-domain-object id="cached.obj" domain-type-ref="type.a" name="dummy">
        <virtual-properties expose-original-ids-of-domain-type-ref="type.a" 
                            exposed-id-prefix="foo"/>
    </scoped-domain-object>
</process-context>
    				

When you expose the properties as shown above, you can reference them using the specified prefix. Assuming the domain type type.a has a property type.a.name you have to use the id foo.type.a.name when you want to reference the property type.a.name of the cached object cached.obj.

Object references

Object references in OpenSAGA are resolved by the ScopedDomainObjectResolver (see the java doc) that works internally with the ScopedDataContextSearchService. The contexts are searched in the described order (see Chapter 5, Programming with references) for the referenced object. The scoped object can be referenced by the id of its ScopedDomainObjectModel.

Object reference to a list

OpenSAGA provides object references that point to a list. For this case the contexts are not only searched for objects with the given id, but also for a list with this id. When a list with the id exists either in the context or is defined in the corresponding ContextModel, the list is used. When the list is not null and it has a current element, the resolver returns this current element, otherwise null is returned.

Object reference to a view model

OpenSAGA provides object references that point to a view model (not a view state model!). If such a reference is to be resolved the corresponding view model will be searched in the current domain context path. If an entry for the given view model (via the view state model in the domain context path) is found, the corresponding root object for that view is returned. This allows to reference all view root objects of the current context.

List references

List references are resolved similar like object references. The ScopedDomainObjectListReferenceResolver (see the java doc) that works internally with the ScopedDataContextSearchService is used for resolving list references. The contexts are searched in the described order (see Chapter 5, Programming with references) for the referenced list. The scoped object list can be referenced by the id of its ScopedDomainObjectListModel.

Chapter 6. Programming Tutorial: Developing a Web Based FAQ Application

In this chapter we show an extended example to illustrate how web application development with OpenSAGA is done. We illustrate both the design process and the development process for a small example.

The Use Case: FAQ Management

FAQs (Frequently Asked Questions) are a pervasive and simple type of application: One or more authors collect questions and answers for a specific topic, all others can query the FAQ database and read the Q&A pairs. Our goal for this short tutorial is to develop a web portal that allows the management of an FAQ.

[Note]Note

We will define the portal in such a way that the portal actually contains one application - the FAQ manager. This will be done by implementing a process model, adding view models and letting them refer domain type models for the data. OpenSAGA allows to duplicate processes with ID mappings (see the section called “Using ID Mappings to Copy Processes” for explanations) in order to duplicate the FAQ process so that each section of a company might use a separate FAQ process, etc.

Modeling the FAQ Use Case

Before we start to implement the given use case we will illustrate how to model it using the OpenSAGA modeling approach. To do yo we use a top down approach enhancing the level of detail with every step.

Modeling the Navigation

We start with a bird's eye view of the application - the navigation model. The navigation model can be represented by a mind map that shows in a structured manner how the hierarchical organization of the web application should appear later on. When used in a moderated workshop it allows you to structure the requirements of the customer on a very high level and slowly form it into a master-detail-hierarchy that equals typical hierarchical navigation structures commonly used in web applications.

This kind of mind map then can be transformed directly into a navigation model as we will show.

The following mind map represents the rather trivial navigation for our FAQ web application:

Each node in a mind map can reference a process model indicating the process to be initiated when the navigation representation of the node is activated.

Modeling the Process

The process model for the FAQ application is a bit more involved, although not overly so. It contains the following elements:

  • A start state. This state is used to initiate the overall process from a navigation entry or via a transition model from some other process. The reason for introducing arbitrary start states instead of directly connecting to some other state (e.g. a view state or a decision state) is that this allows us to execute actions before the first real business state is reached in the process model (because the start state and the next state are connected by a transition that can hold actions).

    This allows features like logging users who click on a specific navigation entry, initializing the process before it is started, etc.

    [Note]Note

    Naturally such things also could be done in the preprocessing phase of a view (see the section called “Interrupting the Business Logic Flow of a View” for details) but this can cause problems in some siutuations when many transitions enter one specific view and you want to execute this special initialization logic only for some of the incoming transitions. Therefor we decided that it is easier to use a mandatory start state.

  • An FAQ overview. The overview will list all FAQ items (only the questions to prevent it from becoming too long) and additionally will allow to search through the questions for specific keywords.

    From the FAQ overview it will be possible to either view the answer of a specific FAQ entry, edit it or delete it (if the user in question has the appropriate permissions).

  • An edit view that will be used for both editing existing FAQ entries and entering new FAQ entries. The edit view can be either cancelled (nothing happens and the user returns to the overview) or confirmed (which results in the data being stored).

  • A detail view that simply displays both the question and the answer and can be left with a button returning to the overview.

The following process model represents these requirements:

Note that we do not say anything about permissions, etc. The roles allowed to execute certain transitions or able to access a state could be annotated at the respective transtions and states. For the sake of simplicity we omit this in this example, especially since the roles usually will be configured at runtime and only rarely belong to the static model.

Modeling the Domain

Now that the overall scope and the main workflows have been specified we next define the domain. Domain modeling usually is a very complex and involved affair and a good domain model in the end probably is the most important factor in creating an application of lasting value. Usually we recommend reading Domain Driven Design by Eric Evans to get a better idea about how to model domains. Luckily this example is so trivial that the domain can be modelled trivially: We have one domain type (the FAQ entry) with two business properties (question and answer) as well as some kind of technical key.

Due to the trivial nature of the domain we omit an equally trivial UML class diagram.

Setting Up the Project

Before we can start to implement our system we need to setup a project. The following example uses Eclipse since our OpenSAGA plugin also supports Eclipse but you naturally can also use other IDEs (except for the plugin support).

The following steps are required to setup a new OpenSAGA based project:

  1. Install the latest version of the SpringSource Tool Suite (recommended since OpenSAGA heavily used Spring) or Eclipse (a good second choice if you intend to mainly work on the XML level). See http://www.springframework.com for download opportunities.

  2. Install the OpenSAGA plugin. See http://www.opensaga.org for download opportunities.

  3. Install a database of your choice to be used by the portal database. Create a database schema and note down all the connection data required to configure a JDBC connection.

    [Tip]Tip

    For testing purposes you can omit this step. If an OpenSAGA application is started without any database being configured it defaults to using an internal HSQLDB which should be sufficient to test OpenSAGA in general.

  4. Install the latest version of Tomcat with Java 5 support and enable it in Eclipse.

  5. Create an OpenSAGA project (if using the OpenSAGA Eclipse plugin) or a dynamic web project (otherwise). If you do not use the OpenSAGA plugin execute the following additional steps:

    • Copy all required support libraries to WEB-INF/lib. See ??? for an exhaustive list.

    • Overwrite WEB-INF/web.xml with the following content:

      <?xml version="1.0" encoding="UTF-8"?>
      <web-app id="opensaga" version="2.4"
        xmlns="http://java.sun.com/xml/ns/j2ee"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="
          http://java.sun.com/xml/ns/j2ee
          http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
              
        <context-param>
          <param-name>facelets.LIBRARIES</param-name>
          <param-value>/WEB-INF/facelets-taglibs/opensaga.taglib.xml</param-value>
        </context-param>
          
        <!-- Use JSF view templates saved as *.xhtml, for use with Facelets -->
        <context-param>
          <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
          <param-value>.xml</param-value>
        </context-param>
      
        <!-- Enables special Facelets debug output during development -->
        <context-param>
          <param-name>facelets.DEVELOPMENT</param-name>
          <param-value>true</param-value>
        </context-param>
      
        <!-- Causes Facelets to refresh templates during development -->
        <context-param>
          <param-name>facelets.REFRESH_PERIOD</param-name>
          <param-value>1</param-value>
        </context-param>
      
        <!-- Disable client side javascript -->
        <context-param>
          <param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
          <param-value>true</param-value>
        </context-param>
      
        <filter>
          <filter-name>OpenSAGARequestContextThreadCleaningFilter</filter-name>
          <filter-class>org.opensaga.runtime.controller.servlet.
            OpenSAGARequestContextThreadCleaningFilter</filter-class>
        </filter>
      
        <filter-mapping>
          <filter-name>OpenSAGARequestContextThreadCleaningFilter</filter-name>
          <url-pattern>/app/process/*</url-pattern>
        </filter-mapping>
      
        <filter>
          <filter-name>MultipartRequestFilter</filter-name>
          <filter-class>org.opensaga.runtime.controller.servlet.
              MultipartRequestFilter</filter-class>
          <init-param>
            <param-name>uploadMaxFileSize</param-name>
            <param-value>100m</param-value>
          </init-param>
        </filter>
          
        <!-- extension mapping for adding <script/>, <link/>, and other
             resource tags to JSF-pages  -->
        <filter-mapping>
          <filter-name>MultipartRequestFilter</filter-name>
          <servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
        </filter-mapping>
      
        <!-- OpenSessionInViewFilter for Hibernate -->
        <filter>
          <filter-name>OpenSessionInViewFilter</filter-name>
          <filter-class>org.opensaga.runtime.persistence.hibernate.
            HibernateOpenGeneratedSessionInViewFilter</filter-class>
          <init-param>
            <param-name>singleSession</param-name>
            <param-value>true</param-value>
          </init-param>
        </filter>
      
        <filter-mapping>
          <filter-name>OpenSessionInViewFilter</filter-name>
          <url-pattern>/app/process/*</url-pattern>
        </filter-mapping>
      
        <!-- Enables Spring Security -->
        <filter>
          <filter-name>springSecurityFilterChain</filter-name>
          <filter-class>
            org.springframework.web.filter.DelegatingFilterProxy
          </filter-class>
        </filter>
      
        <filter-mapping>
            <filter-name>springSecurityFilterChain</filter-name>
            <url-pattern>/*</url-pattern>
        </filter-mapping>
       
        <!-- Serves static resource content from .jar files such as
      	   spring-faces.jar -->
        <servlet>
          <servlet-name>Resources Servlet</servlet-name>
            <servlet-class>
              org.springframework.js.resource.ResourceServlet
            </servlet-class>
            <load-on-startup>0</load-on-startup>
        </servlet>
      
        <!-- Map all /resources requests to the Resource Servlet for handling -->
        <servlet-mapping>
          <servlet-name>Resources Servlet</servlet-name>
          <url-pattern>/resources/*</url-pattern>
        </servlet-mapping>
      
        <!-- The front controller of this Spring Web application, responsible
             for handling all application requests -->
        <servlet>
          <servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
            <servlet-class>
              org.springframework.web.servlet.DispatcherServlet
            </servlet-class>
            <init-param>
              <param-name>contextConfigLocation</param-name>
              <param-value></param-value>
            </init-param>
          <load-on-startup>2</load-on-startup>
        </servlet>
      
        <!-- Map all "/app/*" requests to the Dispatcher Servlet -->
        <servlet-mapping>
          <servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
          <url-pattern>/app/*</url-pattern>
        </servlet-mapping>
      
        <!-- Map all "*.html" requests to the Dispatcher Servlet -->
        <servlet-mapping>
          <servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
          <url-pattern>*.html</url-pattern>
        </servlet-mapping>
      
        <servlet>
          <servlet-name>Faces Servlet</servlet-name>
          <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
          <load-on-startup>1</load-on-startup>
        </servlet>
      
        <servlet-mapping>
          <servlet-name>Faces Servlet</servlet-name>
          <url-pattern>*.faces</url-pattern>
        </servlet-mapping>
      
        <!-- Servlet for Web Services -->
        <servlet>
          <servlet-name>opensaga-webservices</servlet-name>
          <servlet-class>org.springframework.ws.transport.http.
              MessageDispatcherServlet</servlet-class>
          <init-param>
            <param-name>transformWsdlLocations</param-name>
            <param-value>true</param-value>
          </init-param>
        </servlet>
      
        <servlet-mapping>
          <servlet-name>opensaga-webservices</servlet-name>
          <url-pattern>/ws/*</url-pattern>
        </servlet-mapping>
      
        <welcome-file-list>
          <welcome-file>index.jsp</welcome-file>
        </welcome-file-list>
      
        <listener>
          <listener-class>
            org.opensaga.startup.BootStrapListener
          </listener-class>
        </listener>
          
        <context-param>
          <param-name>log4jConfigLocation</param-name>
          <param-value>WEB-INF/cfg/log4j/log4j.properties</param-value>
        </context-param>
      
        <context-param>
          <param-name>log4jRefreshInterval</param-name>
          <param-value>60000</param-value>
        </context-param>
      
      </web-app>
      									

  6. Create a Tomcat instance in the Eclipse server view and connect it to your FAQ project. Modify Tomcat:

    • Configure the Tomcat instance to use -Xms64m -Xmx256m -Dorg.apache.el.parser.COERCE_TO_ZERO=false as runtime arguments (less memory will slow the runtime system to a crawl, more is almost always good).

    • Set the startup timeout to 1000 milliseconds.

    • Disable the auto reload feature in Tomcat (it conflicts with the runtime generator used by the OpenSAGA runtime).

  7. [Note]Note

    The following step is optional. You can run the demo application without having to define any staging configuration as OpenSAGA will use sensibel default settings. Specifically this means that instead of an external database a HSQLDB will be used for test purposes and that all mail services will be deactivated. As we just want to test a small application this nonetheless should be sufficient. If you want more this item explains the additional options for a more involved setup.

    Optional step (see note above): Create a stages.xml file under the path /WEB-INF/resources/extensions/EXTENSIONNAME/models/stages.xml in order to mirror your local configuration. A sample stages.xml might look like this (heed the capitalized places in which you need to insert your specific definitions):

    <?xml version="1.0" encoding="utf-8"?>
    <stages id="system.stages"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:noNamespaceSchemaLocation="http://www.pik.as/schema/model/stages-1.0.xsd">
    
      <stage name="YOUR-LOGICAL-STAGE-NAME">
        <data-source-set>
          <data-source name="portaldb" type="opensaga-hibernate">
            <settings>
              <!-- Sample configuration for Postgres -->
              <setting name="driverClassName" value="org.postgresql.Driver"/>
              <setting name="url" value="jdbc:postgresql://YOUR-LOCAL-DATABASE-URL"/>
              <setting name="username" value="YOUR-LOCAL-USERNAME"/>
              <setting name="password" value="YOUR-LOCAL-PASSWORD"/>
              <setting name="hibernate.hbm2ddl.auto" value="update"/>
              <setting name="hibernate.dialect"
                  value="org.hibernate.dialect.PostgreSQLDialect"/>
              <setting name="hibernate.generate_statistics" value="true"/>
              <setting name="hibernate.cache.use_query_cache" value="false"/>
              <setting name="hibernate.cache.use_second_level_cache" value="false"/>
              <setting name="hibernate.cache.provider_class"
                  value="as.pik.runtime.ExternalEhCacheProvider"/>
    
              <setting name="c3p0.initialPoolSize" value="3"/>
              <setting name="c3p0.minPoolSize" value="3"/>
              <setting name="c3p0.maxPoolSize" value="15"/>
    
              <setting name="bean.dataBaseNamingStrategy" value="postgres"/>
            </settings>
          </data-source>
        </data-source-set>
    
        <mail-service-configuration-set default-mail-service="mail.service.default">
          <mail-service-configuration id="mail.service.default" type="fileBased"
              strategy-bean-ref="standardRetryStrategy">
            <settings>
              <setting name="server" value="YOUR-MAIL-SERVER"/>
              <setting name="username" value="YOUR-MAIL-SERVER-USER-NAME"/>
              <setting name="password" value="YOUR-MAIL-SERVER-PASSWORD"/>
              <setting name="maxBatchSize" value="2"/>
              <setting name="retries" value="3"/>
              <setting name="directory" value="WEB-INF/mailservice/"/>
            </settings>
          </mail-service-configuration>
        </mail-service-configuration-set>
      </stage>
    </stages>
                        
  8. Create a project configuration for your project by adding a file WEB-INF/cfg/opensaga-project.cfg with the following content:

    extensions=YOUR-EXTENSION-NAME
    stages=global,YOUR-LOGICAL-STAGE-NAME
    context-path=/YOUR-CONTEXT-PATH
    
  9. Create an empty extension directory under the path WEB-INF/resources/extensions/EXTENSIONNAME.

    [Note]Note

    While this step might seem superfluous we have decided to not make it optional. The reasoning is that in more complex configurations (where an application might be made up from a larger number of extensions) you easily might overlook a misspelled extension name if OpenSAGA were not to throw a fatal error at you. Thus we decided to play it safe and force you to at least create an empty extension directory as the minimum requirement for each and every extension you are going to use in your setup.

  10. Start the Tomcat server and check the console output for errors. There should be none and after some time the server should be running.

  11. Call http://localhost:8080/YOUR-CONTEXT-PATH/app/process to start the application. Later on you might want to write an appropriate index.jsp that redirects to this special URL.

That's it. You should be up and running. The default login works for user admin and password admin and allows you to access the system and the whole administration interface. From there onwards you can (and should) change your password, add more users, define roles, etc.

Implementing the Model

Now that we have modelled the use case in the section called “Modeling the FAQ Use Case” and installed a basic OpenSAGA portal in the section called “Setting Up the Project” we can proceed to implement the actual portal. We will do this by directly translating our visual models into OpenSAGA XML models.

Implementing the Infrastructure

First of all your new portal should know which new major elements (e.g. navigation models, domain type models and process models) will be an important part of the system. To achieve this we have to link the models (that we still need to write) from the portal meta model. The portal meta model always is contained in WEB-INF/resources/extensions/YOUR-EXTENSION-NAME/models/portal.xml. The meta model must contain references to the process model and the domain type model we are going to create in the next step. A correct declaration looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<portal id="portal.portal"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://www.pik.as/schema/model/portal-1.0.xsd">

	<domain-type-reference-set>
		<domain-type-reference domain-type-ref="faq.d_faq"/>
	</domain-type-reference-set>

	<process-reference-set>
		<process-reference process-ref="faq.p_faq"/>
	</process-reference-set>

</portal>

Since each model requires a unique ID we have identified our new domain type model specified in the section called “Modeling the Domain” with the ID faq.d_faq (according to the naming conventions explained in the section called “Model IDs”). In the same we we decided our single new process as specified in the section called “Modeling the Process” as faq.p_faq (obviously we named our extension as faq as you can derive from the prefixing rules explained under naming conventions).

[Note]Why references?

As we regard the XML representation of OpenSAGA models as but one representation (and e.g. serializing the data in database tables might be another viable and interesting option) you should regard these references as foreign keys and get accustomed to them. The OpenSAGA Eclipse plugin currently will warn you if you forget them and in a future version will automatically add them. So for now it's just a minor inconvenience.

Implementing the Domain Type Model

In the section called “Modeling the Domain” we defined a single domain type we are going to use to store our FAQ question and answer pairs. The model for the domain type is straightforward. We need to define the model in a file called WEB-INF/resources/extensions/YOUR-EXTENSION-NAME/models/domain/types/d_faq.xml (again abiding by the naming extensions mentioned above and using the standard directory layout specified in the section called “Extension directory structure”).

A valid domain type model for our type might look like this:

<?xml version="1.0" encoding="UTF-8"?>
<domain-type xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:noNamespaceSchemaLocation="http://www.pik.as/schema/model/domain-type-1.0.xsd"
  id="faq.d_faq"
  name="faq">

  <property-set>
    <domain-type-property-set>
      <domain-type-property id="faq.d_faq.guid" name="guid" type="PlainText" 
                    insert-property-value-provider="guidPropertyValueProvider" />
      <domain-type-property id="faq.d_faq.question" name="question"
                    type="PlainText"/>
      <domain-type-property id="faq.d_faq.answer" name="answer" type="RichText"/>
    </domain-type-property-set>
  </property-set>

  <primary-key>	
    <key property-ref="faq.d_faq.guid"/>
  </primary-key>
</domain-type>

The meaning again should be pretty obvious:

  • First of all we define a domain-type-model with the already introduced ID faq.d_faq. We also name it using the name faq. The name is reused in several places (e.g. when the underlying Hibernate engine generates a table name or when you refer to the domain type in scripts - in Groovy you e.g. can refer to domaintype.faq in order to access the underlying object of type org.opensaga.runtime.model.domain.service.ScriptingDomainType).

  • Then we define a property-set containing only so-called domain-type-property declarations. Each domain-type-property is mapped to a physical table in the underlying database table. We define three such properties: a GUID as the primary key, the question property and the answer property. Again we define IDs according to the already well-known naming conventions and add easily readable names to e.g. reference them in scripts. Finally we define the type of the properties. For the question we just want to be able to enter an unformatted text, the answers should hold a complex rich text allowing formatting, etc. Accordingly we define the property types.

    The GUID property (the primary key) requires some special mentioning. We define it as PlainText and define a special insert-property-value-provider that generates a real GUID before objects are inserted into the database. The guidPropertyValueProvider is a default value provider available in the underlying OpenSAGA runtime.

  • Finally we indicate the actuao primary key by defining a primary-key block. Note that OpenSAGA naturally also allows for complex primary keys made up from several properties.

Implementing the Process

Next we are going to model the process depicted in the section called “Modeling the Process”. Again this is pretty straightforward. The appropriate file according to the standard directory infrastructure and the naming conventions is WEB-INF/resources/extensions/YOUR-EXTENSION-NAME/models/processes/p_faq/p_faq.xml.

The content is the most extensive so far:

<?xml version="1.0" encoding="UTF-8"?>
<process id="faq.p_faq"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://www.pik.as/schema/model/process-1.0.xsd">

	<process-state-set>
	
		<!-- 
			============================================================ 
			===   Starts the FAQ application.                        ===
			============================================================
		-->

		<start-state state-ref="faq.p_faq.ss_start">
			<transition-list>
				<transition target-state-ref="faq.p_faq.vs_faq_list"/>
			</transition-list>
		</start-state>
	
		<!-- 
			============================================================
			===   Starts the FAQ application.                        ===
			============================================================ 
		-->

		<view-state id="faq.p_faq.vs_faq_list">
			<transition-list>
				
				<!-- Creates a new FAQ entry. -->
				<transition id="faq.p_faq.vs_faq_list.t_new"
				    target-state-ref="faq.p_faq.vs_edit_faq">
					<action-list>
						<new/>
					</action-list>
				</transition>
				
				<!-- Edits a new FAQ entry. -->
				<transition id="faq.p_faq.vs_faq_list.t_edit"
				    target-state-ref="faq.p_faq.vs_edit_faq"/>
				
			</transition-list>
		</view-state>
		
		
		<!-- 
			============================================================ 
			===   Edits a new or existing FAQ entry.                 ===
			============================================================ 
		-->

		<view-state id="faq.p_faq.vs_edit_faq"  state-ref="faq.p_faq.v_edit_faq">
			<transition-list>
				
				<!-- Stores an FAQ entry. -->
				<transition id="faq.p_faq.vs_edit_faq.t_save"
				    target-state-ref="faq.p_faq.bs_faq_list">
					<action-list>
						<store/>
					</action-list>
				</transition>
				
				<!-- Returns without saving. -->
				<transition id="faq.p_faq.vs_edit_faq.t_cancel"
				    target-state-ref="faq.p_faq.bs_faq_list"/>
				
			</transition-list>
		</view-state>
		
		<!-- 
			============================================================ 
			===   Returns to the FAQ overview.                       ===
			============================================================ 
		-->

		<back-state id="faq.p_faq.bs_faq_list"
		    back-to-view-model-in-domain-context-path-ref="faq.p_faq.vs_faq_list"/>
	
	</process-state-set>

</process>

Let us examine each submodel of this process step by step:

  • The start state faq.p_faq.ss_start does nothing special and simply delegates to the first view state faq.p_faq.vs_faq_list.

  • The view state faq.p_faq.vs_faq_list defines two transitions:

    1. The faq.p_faq.vs_faq_list.t_new transition creates a new object and contains one simple action <new/> which creates a new object for the target view.

    2. The faq.p_faq.vs_faq_list.t_edit transition contains no action and thus assumes that an object will be selected for further processing in the next view.

  • The view state faq.p_faq.vs_edit_faq again defines two transitions:

    1. The faq.p_faq.vs_edit_faq.t_save transition contains one simple action <store/> which stores the default view object if specified without further parameters.

    2. The faq.p_faq.vs_faq_list.t_cancel transition does nothing and thus also no objects are stored. This effectively loses all changes and therefore cancels as expected.

    There is one special feature to note: Both of these transitions do not directly return to the list overview but indirectly address a so-called back-state. Why that?

    OpenSAGA uses a simple rule for navigation: Transitions to view states always extend the domain context path and add to it. Always. Back states always drop parts from the domain context path thus effectively shortening it. Since we do not want to see the faq.p_faq.vs_faq_list overview we thus have to add a back state.

  • The back-state uses the most direct of the available back modes and just returns to a specific view model.

    [Note]Back State Modes

    Back states allow for various absolute and relative adressing modes. These can be of great use when some kind of detail view can be accessed through several paths. Take a look at the Javadoc of org.opensaga.core.model.process.back.BackStateModel if you are interested in other modes.

And that is it. The nice thing of using OpenSAGA is that it will automatically take care of GET-AFTER-POST, browser back buttons and many other standard issues of web development without requiring the developer to even spend one second thinking about it.

Implementing the Views

We need to implement two views, the FAQ list and the edit page. We do this quickly, implementing the overview first:

<?xml version="1.0" encoding="UTF-8"?>
<view id="faq.p_faq.v_faq_list" 
    title="FaqList"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://www.pik.as/schema/model/view-1.0.xsd">

    <part-set>
        <part>
            <content>
				
				<heading value="AvailableQuestionsAndAnswers"/>		
				
				<datagrid domain-type-ref="faq.d_faq" filter="opened">
					<datagrid-column-list>
						<property-column property-ref="faq.d_faq.question" filter-mode="contains"/>
						<button-column text="Edit" transition-ref="faq.p_faq.v_faq_list.t_edit"/>
					</datagrid-column-list>
				</datagrid>		
				
				<button transition-ref="faq.p_faq.v_faq_list.t_new" text="New"/>
				
            </content>
        </part>
    </part-set>
</view>

The view contains but one part and the single part contains a simple data grid. The data grid has two columns, one containing the question, the other a button activating the edit transition faq.p_faq.v_faq_list.t_edit mentioned when we created our process model. Additionally we add a new button below the grid.

Note how trivial the implementation of the search filter is. We define a filter mode for the single property column and specify it as contains. Additionally we tell the data grid to show the filter row at the top of the grid in an initially opened state. That's all.

We don't need to tell the system how or where to load the data, when and how to apply the filter, how to do paging or sorting. All that is pretty standard and therefor automatically provided by OpenSAGA.

Next we create the edit view under WEB-INF/resources/extensions/faq/models/processes/p_faq/views/v_edit_faq.xml. It's as trivial:

<?xml version="1.0" encoding="UTF-8"?>
<view id="faq.p_faq.v_edit_faq" 
    title="EditFaq"
    domain-type-ref="faq.d_faq"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://www.pik.as/schema/model/view-1.0.xsd">

    <part-set>
        <part>
            <content>
				<heading value="EditFaq"/>		
				
				<label value="Question" target-ref="question"/>
				<text-field id="question" property-ref="faq.d_faq.question"/>
				
				<label value="Answer" target-ref="answer"/><br/>
				<rich-text-field id="answer" property-ref="faq.d_faq.answer"/>

				<button text="Save" transition-ref="faq.p_faq.v_edit_faq.t_save"/>
				<button text="Cancel" transition-ref="faq.p_faq.v_edit_faq.t_cancel"/>

            </content>
        </part>
    </part-set>
</view>

It contains a heading (which will be translated automatically), two labels connected to two input fields (which e.g. causes mouse clicks on the label to activate the input field automatically) and the buttons for saving or canceling the view.

Now for the final step...

Implementing the Navigation

Before we can test our application one final model is required: We need to add the process model to the portal navigation. There are several ways to do this (we e.g. could create a navigation model from scratch) but for the sake of the example we opt for the most simple approach: OpenSAGA already contains an extension point for simple scenarios out of the box. You can overload the navigation model identified by base.n_applications. Overloading is explained in the section called “Model Overloading” and for our use case simply means that we create a new navigation model with an already existing ID. We create the following model:

<?xml version="1.0" encoding="UTF-8"?>
<navigation id="base.n_applications"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation=
        "http://www.pik.as/schema/model/navigation-1.0.xsd">

	<item-list>
		<item label="FAQ" description="FaqApplication"
		    process-start-state-ref="faq.p_faq.ss_start"/>
	</item-list>

</navigation>

The navigation model again is trivial - a single item list contains one navigation item and that item points to the process we defined in the section called “Implementing the Process” via the process model ID faq.p_faq.s_start.

That is it. Now you can restart the portal as explained in the section called “Setting Up the Project” and you should be able to access the working FAQ application. It is also provided on the OpenSAGA website as a sample download for you in order to check the complete application.

Chapter 7. Defining Logical Values For Properties

OpenSAGA allows for so called logical values in order to initialize properties in a variety of ways. Among them are the following places:

  • The content of the default-value attribute of domain type property models, see ???.

  • The content of the is attribute of insert-value models (see ???) in the initialization-data section (see ???) of domain-type definitions.

  • The content of the value attribute of insert-value models (see ???) in the initialization-data section (see ???) of domain-type definitions.

  • The constant value attribute of the constant-value model being available in comparison filters, see the section called “constant”.

  • The property-valuecode> attribute of the set-property-value action.

Logical values can be prefixed in order to address a specific provider to create a value from a template description or they can be value repesentatives in a specific format which are directly converted to an actual value. The Javadoc documentation for the class org.opensaga.runtime.util.service.values.LogicalValueService provides all the details about how logical values can be defined and will be interpreted. Additionally you will find information in the Javadoc for org.opensaga.runtime.util.service.values.ValueSpecificationEvaluationService and org.opensaga.runtime.util.service.values.ValueSpecificationEvaluationServiceImpl on how to use value specifications to define values. Additionally you can provide your own instances of org.opensaga.runtime.util.service.values.ValueSpecificationHandler in a bean context in order to dynamically add new value specification types to the runtime system.

Chapter 8. Property Value Providers

OpenSAGA provides instances of org.opensaga.runtime.model.domain.properties.PropertyValueProvider in order to provide logical property values (see Chapter 7, Defining Logical Values For Properties) to properties. These can be used when initializing domain type objects, to define constant values and to initialize domain types. The following default implementations are provided and will be explained below:

  • org.opensaga.runtime.model.domain.properties.CurrentDatePropertyValueProvider

  • org.opensaga.runtime.model.domain.properties.CurrentUserPropertyValueProvider

  • org.opensaga.runtime.model.domain.properties.DateTemplateBasedPropertyValueProvider

  • org.opensaga.runtime.model.domain.properties.DefaultLocalePropertyValueProvider

  • org.opensaga.runtime.model.domain.properties.FalsePropertyValueProvider

  • org.opensaga.runtime.model.domain.properties.TruePropertyValueProvider

  • org.opensaga.runtime.model.domain.properties.GuidPropertyValueProvider

  • org.opensaga.runtime.scripting.ScriptingServiceBasedPropertyValueProvider

CurrentDatePropertyValueProvider

This provider can be used to provide the current date and time. It may be useful for ... properties (e.g. "created on" or "changed on").

CurrentUserPropertyValueProvider

This provider can be used to provide the current user. It may be useful for ... properties (e.g. "created by" or "changed by").

DateTemplateBasedPropertyValueProvider

The following section describes the DateTemplateBasedPropertyValueProvider that delivers dates based on a textual template. This provider is very flexible and can be easily configured. The examples shown here are based on the default OpenSAGA installation.

The date template uses two different maps (explained in the sections below) and a hardcoded operation set. To specify a date you can use one of the date providers to get a starting date. After that you alter the date with a combination of operations, numbers and unit modifiers. If you don't specify a date provider, the current date and time is used.

[Important]Important

Please note that by default all provided dates contain the current hour, minute and second. If you want a date where all these are set to zero you have to use the "reset" operation (:). For example "+1D:h:m:s" would return the date of tomorrow with hour, minute and second values of zero.

The next list shows some examples date template definitions:

Date Template Examples

  • If you want to specify the date "current time plus two hours", the textual description would be "now+2h". "now" is the date provider, "+" is the operation, "2" is the number of hours and "h" is the unit modifier for hours.

  • You want to specify the date "today minus fourteen days". The textual description would be "today-14D". "today" is the date provider, "-" is the operation, "14" is the number of days and "D" is the unit modifer for days. As explained above, "-14D" would return the same date.

  • You want to specify the date "29th Juli 2010". The textual description would be "=29D=7M=2010Y". This example uses the "set" operation (=) to set the exact day, month and year values.

  • This is an example of a more advanced definition. It may not make much sense, but it shows the flexibility of the date template provider: "last_day_of_month+4M-2m+3s:last_hour_of_day=2009Y". In detail: we use the last day of the current month as a starting date, then add four months, subtract two minutes and add three seconds. After that we reset the hour to the last hour of the day and set the year to 2009.

Operation List

Table 8.1. Operation List

OperationDescription
+The add operation.
-The subtract operation.
:The reset operation.
=The set operation.

Date Provider Map

Table 8.2. Date Provider Map

NameDescription
nowThe current date and time.
todayAn alias for now.
first_day_of_weekThe first day of the current week.
last_day_of_weekThe last day of the current week.
first_day_of_monthThe first day of the current month.
last_day_of_monthThe last day of the current month.
first_day_of_yearThe first day of the current year.
last_day_of_yearThe last day of the current year.
first_month_of_yearThe first month of the current year.
last_month_of_yearThe last month of the current year.
first_hour_of_dayThe first hour of the current day.
last_hour_of_dayThe last hour of the current day.
first_minute_of_hourThe first minute of the current hour.
last_minute_of_hourThe last minute of the current hour.
first_second_of_minuteThe first second of the current minute.
last_second_of_minuteThe last second of the current minute.

Unit Modifier Map

Table 8.3. Unit Modifier Map

NameDescription
WThe week modifier.
YThe year modifier.
MThe month modifier.
DThe day modifier.
hThe hour modifier.
mThe minute modifier.
sThe second modifier.
QThe quarter modifier.

DefaultLocalePropertyValueProvider

This provider can be used to provide the default locale of the portal. See the section called “Supported Locales” for more information.

FalsePropertyValueProvider

This provider can be used to provide the value false.

TruePropertyValueProvider

This provider can be used to provide the value true.

GuidPropertyValueProvider

This provider can be used to provide a GUID.

ScriptingServiceBasedPropertyValueProvider

This provider can be used to provide the result of a script. The script is executed by the ScriptingService, see Chapter 32, Scripting. In the script you can use the self variable to access the current domain object.

Part III. Architecture

Chapter 9. Detailed Model Hierarchy

This chapter gives a brief overview for each model type a programmer usually will encounter when developing portals with OpenSAGA. Each model is represented by XML markup and carries a specific semantic meaning. The models are structured in a hierarchical relation and can refer to each other for advanced effects.

[Important]Important

Read this section closely at least once if you want to start developing with OpenSAGA as it explains some very important concepts (e.g. back state handling and the domain context path, the section called “The Domain Context Path”).

The next sections briefly outlines the idea and meaning for each model and referenced other contained models. The model reference (Part IV, “Model Reference”) provides a detailed explanation for each model type and describes all attributes and contained models with a long list of practical samples.

The Portal Model

The portal model serves as the root node for a portal model set. It is the base container for all the submodels that detail a portal installation. Usually you will need to refer to the portal model whenever you execute one of the following actions:

  • You want to change the locales supported by your portal. You need to define a new supported-locales model to do that. See the section called “Supported Locales” for more details.

  • You want to change the session context structure by adding new cached domain objects, new properties or new lists of cached domain objects. You need to modify the session-context model to do that. See ??? for more details.

  • You define a new navigation model. A reference to the navigation model must be added to the portal model. Otherwise the navigation model will not be available at runtime and various errors might happen. Adding this reference is done by adding a new navigation-reference to the navigation-reference-set of the portal model. See the section called “The Navigation Reference Set” and the section called “The Navigation Reference Set” for more information.

  • You define a new process model. A reference to the process model must be added to the portal model. Otherwise the process will not be available at runtime and various errors might happen. Adding this reference is done by adding a new process-reference to the process-reference-set of the portal model. See the section called “The Process Reference Set” and the section called “The Process Reference Set” for more details.

  • You define a new domain type model. A reference to the domain type model must be added to the portal model. Otherwise the domain type will not be available at runtime and various errors might happen. Adding this reference is done by adding a new domain-type-reference to the domain-type-reference-set of the portal model. See the section called “The Domain Type Reference Set” and the section called “The Domain Type Reference Set” for more details.

  • You want to change the default paging behaviour. You need to define a new paging model to the portal model. See the section called “Paging” for more details.

  • You define a new web service. A reference to the web service model must be added to the portal model. Otherwise the web service will not be available at runtime and various errors might happen. Adding this reference is done by adding a new web-service-reference to the web-service-reference-set of the portal model. See Chapter 23, Web Services for more information.

  • You define a new REST service. A reference to the REST service model must be added to the portal model. Otherwise the REST service will not be available at runtime and various errors might happen. Adding this reference is done by adding a new rest-services-reference to the rest-services-reference-set of the portal model. See Chapter 25, REST Services for more information.

See the section called “The Portal Model” for a more comprehensive reference on the capabilities of the portal model.

The Navigation Reference Set

Describes the navigation of the portal. The navigation-reference-set describes a set of navigation-reference elements that each reference a navigation model (see the section called “The Navigation Model”). By defining a complete navigation set you are able to divide your view navigation areas into distinct navigation models, e.g. a left hand navigation, a support navigation, a link list for all pages and maybe some bottom navigation for the page footer. You are free in the number of distinct navigation models you define the only restriction being that the layout template being used for the actual view layout must be able to handle all navigation sets. If the template does not care for a specific navigation model, the navigation never will show up. If a navigation model expected by the layout template (due to a predefined navigation model ID) is undefined, an error might occur.

The Process Reference Set

The process-reference-set element contains all processes that are used in the portal. For each process a process-reference element with the attribute process-ref has to be defined. This attribute refers to a process model. See the section called “The Process Model” for reference.

The Domain Type Reference Set

The domain type set contains all user defined domain types that are used in the portal. Each domain type has to be defined by an domain-type-reference element. The domain-type-ref attribute refers to a domain type model. See the section called “The Domain Type Model” for reference.

Staging

During enterprise development your development progress usually will be deployed in a staged manner, e.g. first you test your latest implementation on the development stage (or dev stage) in a closed circle of persons (e.g. just the development team), then you deploy your latest implementation artifacts to the quality assurance (or QA) stage for closer examination by a larger set of people (e.g. early adopters from the customer side or the quality management team) and then finally the latest changes are rolled out to production (or prod) stage.

OpenSAGA supports this layered rollout approach by defining staging models that hold particular settings for a given stage. The stages for a particular installation can be configured in various ways (see the section called “Configuring the deployment stage for the server” for more details).

The staging model describes all stage-dependent settings of your portal (see the section called “<stages />”). Usually each stage will include database connections and drivers, access settings and more (see the section called “<stage />”). Please note that stages are purely virtual - one physical stage (e.g. QA) can be made up of several logical stages (e.g. qa-server-1, qa-db, qa-eai and global). Each logical stage is represented by a staging model, the set of logical stages (when configured as explained in the previous paragraph) makes up the phyiscal stage definition.

Layouts and Skins

Layout and skin models customize the appearance of a portal on an abstract level. Internally layout templates are used to implement a specific layout. These templates contain placeholders for layout-instance-specific data (e.g. the width of the left hand navigation or the logo to use). The layout and skin model connect the theoretical layout with specific layout settings in order to define a concrete layout.

The Layout Model

Layout models instantiate a specific layout template by binding all variables in the layout template to specific values.

The Skin Model

Skin models define the extension points of a specific layout. Currently skin models are not yet used but will be added as soon as there is a need for that.

The Navigation Model

A navigation model describes the structure of a single navigation. A navigation structure is composed in a hierarchical manner, e.g. it starts with a list of navigation items and each item in turn can include yet another list of (sub)items. Items themselves link to process start states, the meaning being that a click on a navigation item will initiate a process via the given start state. For now, if you want to define an access right for the navigation item, you have to specify a constant ID for the navigation model.

The navigation model (see the section called “<navigation />”), the navigation item model (see the section called “<item />”) and the navigation item list model (see the section called “<item-list />”) form the base of all navigation definitions. The following example shows a small navigation model:

Example 9.1. Navigation Example

<?xml version="1.0" encoding="utf-8"?>
<navigation id="base.n_support"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://www.opensaga.org/schema/model/
        navigation-1.0.xsd">

    <item-list>
        <item id="base.n_support.help" label="mHelp"
              process-start-state-ref="base.p_help.ss_start"/>
        <item id="base.n_support.profile" label="mProfile"
              process-start-state-ref="base.p_user_profile.ss_start"/>
        <item id="base.n_support.imprint" label="mImprint"
              process-start-state-ref="base.p_imprint.ss_start" />
        <item id="base.n_support.sitemap" label="Sitemap"
              process-start-state-ref="base.p_sitemap.ss_start"/>
        <item id="base.n_support.logout" label="mLogout"
              process-start-state-ref="base.p_logout.ss_start">
            <visible-if>
                <user-logged-in/>
            </visible-if>
        </item>
    </item-list>
</navigation>

The Process Model

A process model represents both workflows and background processes. Process models are always modeled from the view of an active user of the system, e.g. they contain the individual steps the user will be able to take, they describe the available actions, etc. Process models have a context of their own, the so-called process context which holds data for as long as the current user is executing that specific process (see the section called “Scoped Data Contexts” and ??? for more details).

Additionally process models contain states and transition between states.

Process States

The following process states can be used in a process model. Process states must be linked by transitions.

Start States

A start state indicates an entry point for a process. It depends on your need what you model with start states. If the process e.g. is newsletter management, one start state might initiate the read new newsletters subprocess, another might initiate write new newsletter. Alternatively you could model two separate processes to impement this - it's ultimately up to you. OpenSAGA provides support for both approaches.

One impportant feature of a start state (besides being the entry point into a process for navigation items) is the transition that leads from the start state to the next state. Since the transition can contain actions this allows you to e.g. take actions directly after a navigation item has been clicked and before any real business state is activated.

See the section called “<start-state />” for more details.

Decision States

Decision states contain a list of outgoing transitions. Each transition (except for the last) must include a filter model the semantics being that the first transition for which the filter model is true in the current request context will fire and execute. It's good practice to not include a filter model in the last transition since this will cause the transition to fire in all cases (remember: an empty filter model is representing the true value if it is queried during filtering).

Decision states therefor allow you to diverge the process control flow based on the current execution context.

See the section called “<decision-state />” for more details.

View States

View states represent UI elements. The user will be presented with some kind of view (a list view, an input view, a mix of those or something else) and the process will stop until the user (or some client process) initiates a transition.

See the section called “<view-state />” for more details.

End States

End states cause a process to stop. Usually they only will be required in conjunction with sub processes.

See the section called “<end-state />” for more details.

Back States

Returns to some parent state in the domain context path.

[Important]Important

Back states provide one of the most important navigational concepts in OpenSAGA. They allow transitions (which are always defined as having a start and an end state) to return to variable states by defining the semantic meaning interpretation of the back operation. the section called “<back-state />” contains explanations of the various modes supported by back states.

See the section called “<end-state />” for more details.

Transitions

Transitions model state changes. Transitions always connect two states. Transitions additionally can contain action lists with an arbitrary number of actions that in turn allow to execute business logic when changing state.

The Domain Context Path

Internally OpenSAGA manages a data structure called the domain context path. The domain context path collects a list of tuples storing the views, which the user passed while working with the application, together with the associated domain object of the view.

[Important]Important

The domain context paths is automatically modified by OpenSAGA while the user steps through a process. Two simple rules are applied:

  1. If the transition connects to a back state the domain context path is shortened according to the rules defined by the specific back state. See the section called “Back States” for more details.

  2. In all other cases the next view (together with the associated domain object if any) is added to the domain context path.

To repeat this: The domain context path grows all the time until the current process flow hits a back state. Back states are the only states that are able to shorten the domain context path.

See also the section called “Domain Context” for more details about the domain context.

Action Lists

Action lists are a collection of individual actions. Each action of an action list is executed in turn until either all actions have finished or an action halts action execution (see the section called “Action Results” for more details on this). Action list behaviour is described in more detail in the section called “Action Lists”.

Actions

Actions represent small pieces of busines logic. There exist a variety of predefined actions (see ???) but you also can include customized business logic by executing the execute action which allows you to execute beans, scripts and instantiate and run classes (see the section called “Execute Action” for more detail on how to do this.

The Domain Model

The domain model consists of specific domain types and the relations between those domain types. In this respect OpenSAGA implements a relational database model. Domain type models describe domain objects (we call them objects instead of entities since this seems to be easier wording for non technical customers we address - it's just more tangible), relations connect two domain types (or connect a domain type to itself). Domain types define properties and restrictions on concrete objects.

The Relation Model

The relation model defines the relation between domain types. All relations are directed and include the usual cardinalities (0..*, 1..*, 0..1, 1..1). Relation models are described in more detail in the section called “<relation />”). All relation models are defined in one relation set model (see the section called “<relation-set />”). The relation set model is located at /resources/models/domain/relations.xml (do not change the filename!) and identified by the ID portal.domain.relations. Extensions must include a file of this name at the same location containing a relations set model with this ID in order to add new relations to the domain model.

Relations can be programmatically added to objects either by using the connect action (see the section called “<connect />”) or by using appropriate content element models, e.g. the single connect (see the section called “<single-connect />”) or multi connect (see the section called “<multi-connect />”) content element models.

The Domain Type Model

Domain types represent all data known in a OpenSAGA installation. The following domain type model types are available:

Each domain type contains a number of property models, see the section called “Property Models”.

Property Models

A domain type has a set of property sets. We differentiate properties in several types (dependent on the domain type model only a subset of these are available):

Each property has a property type that defines the type of data stored in the property, see the section called “Property Type Models”.

Property Type Models

OpenSAGA supports a number of built-in property types and additionally provides an extension mechanism in order to be able to define extension-specific new property types. These two features are explained in the next two sections.

Built-in Property Types

The following property types currently are built into OpenSAGA. We plan to add more property types in the future and welcome your proposals. All available property type models defining these types can be found under the path /base/models/domain/property-types:

  • Attachment: A type describing an arbitrary binary attachment to some data (usually created by means of a file upload, sometimes programmatically).

  • Boolean: Either true or false.

  • Date: Just a date in history.

  • DateTime: A date in history including a specific point in time (e.g. hour, minute).

  • Double: A floating point number mapping to java.lang.Double.

  • Email: A valid email address.

  • Float: A floating point number mapping to java.lang.Float.

  • Locale: A locale consisting of a language code and an optional country code (according to java.util.Locale).

  • Long: An integer value mapping to java.lang.Long.

  • Number: A floating point number mapping to java.math.BigDecimal.

  • PlainText: Plain UTF-8-encoded text (make sure that your database supports it if you use it).

  • Point: A GIS datatype describing a spatial point.

  • Polygon: A GIS datatype describing a spatial area.

  • RichText: Rich text content using HTML formatting.

  • Time: Just a point in time using hours, minutes, etc.

  • Timezone: A timezone info.

  • Wikitext: Wiki-formatted text (currently by default the markdown engine is being used).

Creating New Property Types

OpenSAGA allows extension-specific new property types. They are defined in a property type model (see the section called “<property-type />”). Property type models are located under the path /extensionid/models/domain/property-types (for a specific extension ID). The base models included in your OpenSAGA JAR file contain a variety of examples for property type models (as the supported core types also are defined using this model type).

Changing the Input and Output Format of Property Types

To change the input or output date format of a property type model you need to redefine it. Overwrite the property type model using the same property type model ID (look it up in base, e.g. base.pt_date to overwrite the Date property type) and define a new type converter reference set (see the section called “<type-converter-reference-set />” and the section called “<type-converter-reference />”). Type converter reference sets map locales to type converters. Here you can thus define new type converters. The merge strategy for type converter reference sets uses the "latest" definition for a specific locale (as defined by the order in which extensions are included).

The Translations Model (Internationalization, I18N)

OpenSAGA provides extensive means to translate texts of a portal and to define language and country dependent formats for all input and output. The following section explains the basic features and references the specific models.

Translations

Translations are made up from a series of translation definitions (see the section called “Translation Definitions”). The available translations of a portal are defined by the merged set of all available definitions (in the order the stages are defined - it is possible to overwrite definitions).

The separation into translation definitions allows to collect tightly related definitions in one place. You can divide or collect your translations in any way that seems appropriate but we recommend using a logical structure.

All translation definitions are enumerated in the translations model (see the section called “<translations />”). The base translations for all portals are defined under the ID portal.domain.translations. Create a new model file under models/i18n/translations/translations.xml

Translation Definitions

A single set of translation definitions can be defined in a file under the path models/i18n/translations/definitions/some-name.xml. Each such file contains a translations definitions model (see the section called “<translation-definitions />”) and must be referenced from the set of translations (see the section called “Translations”). A set of definitions contains individual definitions that are resolved according to an algorithm defined in the section called “<translation-definition />”).

Formatters and Converters

For all property types used in an OpenSAGA based portal it is possible to define individual formatters and converters in order to represent locale specific settings (see the section called “<type-converter-reference-set />” and the section called “<type-converter-reference />”). This can be done by defining your own property type models (see the section called “<property-type />”, for which the files are defined under /models/domain/property-types, definitions referenced in the property type reference set (see the section called “<property-type-reference-set />” and the section called “<property-type-reference />”) of the portal model (see the section called “<portal />”). Additionally you can overwrite existing definitions and thus provide new converters and formatters.

Scoped Data Contexts

OpenSAGA uses a variety of runtime data contexts to store execution specific data over the session lifetime of the current user. The lifecycle for each data context is managed by OpenSAGA and as longas a lifecycle is active all data in the respective scope is directly available for the current request. Scoped data contexts can contain properties (with all the variance allowed for domain type properties in domain type models), cached domain objects (that is references to a single object of a specific domain type) and lists of such cached domain objects.

The Session Context

The session context exists for one user session, e.g. from login to logout.

The Conversation Context

The conversation context exists for the duration of one oncversation which means either a browser window lifecycle or a portlet instance lifecycle.

The Process Context

The process context exists for the execution of one specific process. As long as the user works in this process, all data in the process context is available. As soon as the process is switched or ends a new process context will be created.

The View Context

The view context exists while the user is working with one view. It is special in so far as that it also contains all the data properties implicitly defined by input fields in the current view (property reading models in OpenSAGA lingo).

The Request Context

The request context is the most complex data context in OpenSAGA because it stores all information and data relevant for the current request. It is used throughout the framework in order to manage the request state.

The Domain Context

The domain context is yet another special context that holds the data path navigated by the user (e.g. the data objects the user visited in order to get to the current state).

Accessing Properties, Objects and Lists

OpenSAGA provides extensive data manipulation functions. All those functions share the fact the all data (e.g. properties, objects and lists) are referenced by their given IDs.

Referencing Properties, Objects and Lists

Creating and Defining Properties, Objects and Lists

OpenSAGA provides a number of manipulative actions in order to create data. The following list gives a quick overview about the most important means:

Chapter 10. Naming Conventions

Model IDs

Model IDs use the following naming conventions for handwritten models:

  • Names are built from a sequence of IDs separated by dots. The separated parts form a logical hierarchy.

  • Names use a prefix notation that describes the specialized part of the ID. The following prefixes are used:

    • d_ for domain types

    • p_ for processes

    • v_ for views

    • vs_ for view states

    • ss_ for start states

    • bs_ for back states

    • es_ for end states

    • ds_ for decision states

    • t_ for transitions

    • r_ for relations

    • n_ for navigations

    • a_ for agents

    All IDs of the relevant models will start with the given prefix.

  • ID name sequences depend on the specific model type. All of them belong to one model (e.g. either the OpenSAGA base infrastructure, a specific extension or a specific project). For all IDs thus the modul name is the first part of any ID. Since the module name is thus used in every ID we recommend using a very short an unique module name. If you are unsure about the uniqeness of your module name and intend to use your module in a global context, please contact QuinScape at info@quinscape.de in order to receive information about the uniqueness of your module name. The module name base is reserved by QuinScape for the base module that is a part of every OpenSAGA installation. Otherwise IDs use the following guidelines:

    • portal.module for portal models.

    • module.d_domain-type-name for domain types.

    • module.d_domain-type-name.property-name for domain type properties.

    • module.p_process-name for processes.

    • module.p_process-name.v_view-name for views.

    • module.p_process-name.s_start-state-name for start states.

    • module.p_process-name.e_end-state-name for end states.

    • module.p_process-name.dc_decision-state-name for decision states.

    • module.a_agent-name for agents.

    • module.r_relation-name for relations. Preferrably the relation name will include both domain type names and the relation between them. Note that this naming rule applies to both the actual relation ID and the inverse relation ID defined in the same model.

    • module.n_navigation-name for navigations.

Model File Names

Models are contained in separate XML files. For XMl files we use the following naming conventions (and in some cases requirements):

  • d_domain-type-name for domain type model files.

  • p_process-name for process models.

  • v_view-name for view models.

  • a_agent-name for agent models.

  • relations.xml for the relation container.

  • portal.xml for the portal root model.

Schema

Schema files have to follow the naming convention: schema_name-x.y.xsd where x represents the major version number and y represents the minor version number (e.g. domain-type-1.0.xsd).

Chapter 11. Project Layout

Directory structure

The following directory structure is used by the OpenSAGA project itself.

Table 11.1. Directory structure

PathContent
/srcOpenSAGA source directory
/src/de/quinscapeQuinScape Java packages that might be used by other projects
/src/org/opensagaOpenSAGA Java packages
/src/META-INFConfiguration files used by the Spring Framework
/src/ehcache.xmlEhcache configuration file
/testOpenSAGA Java packages for tests
/dbDatabase files
/db/dataDatabase script files that contain initialization data
/docOpenSAGA documentation
/doc/developerDeveloper documentation
/doc/referenceReference documentation
/doc/reference/docbookDocBook reference documentation
/libJava libraries that are used by the ant build task
/miscMiscellaneous script files
/testingTest files that are not implemented in Java
/WebContentFiles that are deployed to the application server
/WebContent/WEB-INFMetadata of the OpenSAGA application
/WebContent/WEB-INF/cfgConfiguration files
/WebContent/WEB-INF/cfg/log4jConfiguration files for log4j
/WebContent/WEB-INF/cfg/log4j/log4j.propertiesConfiguration file for log4j
/WebContent/WEB-INF/cfg/opensagaConfiguration files for OpenSAGA
/WebContent/WEB-INF/facelets-taglibsOpenSAGA taglib definitions
/WebContent/WEB-INF/prepared-flowsWebflow definitions that are not generated
/WebContent/WEB-INF/resourcesOpenSAGA resources
/WebContent/WEB-INF/resources/baseOpenSAGA base resources, see the section called “Base directory structure”
/WebContent/WEB-INF/resources/extensionsOpenSAGA extension resources, see the section called “Base directory structure”
/WebContent/WEB-INF/xsdOpenSAGA schema definitions
/WebContent/WEB-INF/faces-config.xmlSpring Faces configuration file
/WebContent/WEB-INF/jsSnoop.jspxFile used for JavaScript snooping
/WebContent/WEB-INF/mime.typesMime type definitions

Base directory structure

The base project uses the following directory structure.

Table 11.2. Directory structure

PathContent
/actionscriptsAction script files
/actionscripts/bshBeanShell action script files
/actionscripts/groovyGroovy action script files
/java/cfgAdditional Spring Framework configuration files
/mediaMedia files
/media/icon-experienceIcon library for OpenSAGA. The files from this directory are NOT directly accessed by OpenSAGA.
/media/iconsOpenSAGA uses this directory to access icons
/media/icons/srcFiles that have been used to create icons
/modelsOpenSAGA model definitions
/models/agentsOpenSAGA agents
/models/agents/domaintype-basedDomain-type based agents
/models/agents/event-basedEvent based agents
/models/agents/time-basedTime based agents
/models/agents/trigger-basedTrigger based agents
/models/agents/agents.xmlAgent configuration file
/models/domainOpenSAGA domain type definitions
/models/domain/constant-typesConstant domain type definitions
/models/domain/externalExternal domain type definitions
/models/domain/external/excelExcel domain type definitions
/models/domain/external/relationalRelational domain type definitions
/models/domain/joinedJoined domain type definitions
/models/domain/typesDomain type definitions
/models/domain/relations.xmlRelation definition file
/models/i18nInternationalization for OpenSAGA
/models/i18n/definitionsInternationalization definitions
/models/gisGeographic information system (GIS) definitions
/models/layoutLayout definitions
/models/navigationNavigation definitions
/models/processesProcess definitions
/models/servicesService definitions
/models/services/web-servicesWeb Service definitions
/models/portal.xmlPortal configuration file
/models/stages.xmlStages configuration file
/reportsReport files
/scriptsJavaScript files
/stylesCSS files
/templatesTemplate files
/templates/emailEmail template files

Extension directory structure

Extension projects use the same directory structure as the base directory, see the section called “Base directory structure”. If you want to extend some aspect of the base system (e.g. a Spring application context of your own) add the directory responsible for holding the extension (as described above) to your extension project and add the extension files to that directory. OpenSAGA will auto-discover the content and use it.

Chapter 12. Base Support

The Implicit 'base' extension

OpenSAGA always comes with a "base extension" that provides enough infrastructure to jump start a portal or web application right out of the box. In this respect OpenSAGA works similar to a Portal Server that comes with all the infrastructure required to run portlets (e.g. user management, basic configuration management and more).

In contrast to Portal Servers the implicit OpenSAGA infrastructure is more flexible and more useful due to a number of reasons:

  • There are no black boxes. The whole infrastructure is specified via standard OpenSAGA models. To repeat: There is no magic being used. You can touch and modify each part of the system by extending, overloading or overlaying the base models as described in Chapter 29, OpenSAGA Extensions.

  • The model based infrastructure implementation for all OpenSAGA portals is publicly available. You can find it in the OpenSAGA sources under WEB-INF/resources/base and it uses the directory infrastructure described in Chapter 11, Project Layout. Have a look at the models and learn how we use them to implement the OpenSAGA infrastructure. We are trying to improve the documentation all the time and advise you to file issues under http://www.opensaga.org/issues if you find problems with the documentation. We know there is a lot left to be done but we strive to cope with the challenge.

  • There is enough infrastructure available to start an empty portal right away without loads of configuration. You can log in right away, work on user management, start with text translations and so on by following the steps explained in Chapter 2, First Steps and Chapter 6, Programming Tutorial: Developing a Web Based FAQ Application.

We try to provide comments for all the XML models defined in base. Please let us know where you want to see more documentation and what kind of documentation would be of interest to you.

Extending the Base Portal

The implicit base portal is provided by OpenSAGA in order to allow to jumpstart projects. Even without defining any models a new project thus is equipped with a login process, a registration process, user management, translation management, various monitoring functions and administrative support and so on.

Usually such support is known only from Portal Server technologies. But in contrast to portal servers OpenSAGA is even more convenient and streamlined: All the base functionalities are defined by OpenSAGA models - thus there is no black box and it is very easy to customize, alter or drop any part of the base suppport. The next sections will explain various means to customize 'base' - the starting point for all your projects.

Defining a Simple Navigation

The 'base' portal comes with a predefined navigation. All navigation models are located at /models/navigation. The navigation is structured like this:

  • n_main.xml (ID base.n_main) contains the overall navigation. It is built from the sub navigation models defined in the next items of this list and also contains a number of hard-coded menu items (e.g. the separation in "Home", "Administration" and so on). Overwrite this model if you want to create your own navigation structure from scratch.

  • n_applications.xml (ID base.n_applications) contains an extension point for your own navigation. By default it contains nothing and thus no "Applications" menu item will show up ever. If you want to insert your own applications into a portal without having to change anything about the remaining default structure you should overwrite this model and provide your application menu structure. As soon as you do this a top level menu item "Applications" will show up in your portal while the remaining default navigation remains unchanged. Remember that you can easily customize the defaults by simply configuring appropriate permissions for your specific portal (and thus e.g. removing certain menu items for specific user groups).

  • n_admin-applications.xml (ID base.n_admin-applications) works like n_applications.xml but is used as an extension point for administrative additions that will show up in the "Administration" menu. Your extensions will show up at the end of the administration menu. See the item above for more customization hints.

  • n_support.xml (ID base.n_support) implements the support navigation shown at the top right of the default layout. It contains the "Help", "Profile", "Imprint", "Sitemap" and "Logout" standard menu items (with corresponding base processes linked to them). Overwrite this model if you want to provide a custom support navigation.

To get a detailed impression about how the navigation works you should examine the model files in 'base'.

Chapter 13. System Configuration

Table of Contents

Logging

Logging

You have to differenciate between the two logging mechanisms that are provided by OpenSAGA. The first mechanism (described here) is used to log events created by the OpenSAGA framework while the second mechanism (described in chapter the section called “<system-log />”) is used to log events created by the business logic.

The initial logging configuration is provided by the file log4j.properties. This configuration is used in the OpenSAGA startup phase. If no other configuration is provided by one of the stages, it is also used in the runtime phase. If you need a different logging configuration in the runtime phase, you can add the configuration to one of the stages that you use. The order of the stages is important, since the logging configuration defined in a stage overwrites the logging configuration that is defined in a previous stage. The initial logging configuration is an exception to this rule (i.e. it is never overwritten).

Example 13.1. Logging configuration within a stage

<stage ...>
    ...
    <logging-configuration><![CDATA[
        log4j.rootLogger=...
        ]]>
    </logging-configuration>
</stage>

Technical information (should be moved to the developer docs):

The initial logging configuration (startup phase) is loaded by the Log4jConfigListener defined in the contextListenerTypes of the BootStrapListener. The configuration parameters for the Log4jConfigListener are located in the file web.xml:

<context-param>
    <param-name>log4jConfigLocation</param-name>
    <param-value>/WEB-INF/cfg/log4j/log4j.properties</param-value>
</context-param>

<context-param>
    <param-name>log4jRefreshInterval</param-name>
    <param-value>60000</param-value>
</context-param>

The logging configuration for the runtime phase is loaded by the LoggingConfigurationServiceListener that is also defined in the contextListenerTypes. The LoggingConfigurationServiceListener calls the LoggingConfigurationService to activate the current logging configuration after the startup phase is finished.

The LoggingConfigurationService searches the logging configuration in the following order:

  1. the stage models (in reversed order)

  2. the log4j.properties file

Chapter 14. Predefined Services

OpenSAGA defines a multitude of services that are used during runtime. This chapter indicates the services and the interfaces they implement.

Table 14.1. Predefined Services

NameImplemented Interface
cacheRepositoryorg.opensaga.runtime.cache.CachedRepository
Scripting Services
BeanShellScriptingServiceorg.opensaga.runtime.scripting.beanshell.BeanShellScriptingService
GroovyScriptingServiceorg.opensaga.runtime.scripting.groovy.GroovyScriptingService
PythonScriptingServiceorg.opensaga.runtime.scripting.python.PythonScriptingService
RubyScriptingServiceorg.opensaga.runtime.scripting.ruby.RubyScriptingService

Part IV. Model Reference

Table of Contents

15. Defining agents
Domain type based agent
Event based agent
Time based agent
Trigger based agent
16. The Container Models
The Portal Model
The Meta Model
The Navigation Reference Set
Supported Locales
The Domain Type Reference Set
The Process Reference Set
Using ID Mappings to Copy Processes
The Web Service Reference Set
The REST Services Reference Set
Paging
Filter Specification Set
UI Component Setting Set
Action List Set
Start Action List
Stages Model
The Stage Model
The Data Source Model
The Proxy Configuration Model
Development Mode
17. The View State
Layouting a View
Part Tags
Validating a View
Interrupting the Business Logic Flow of a View
18. Error Handling
Global Errors
Local Errors
19. Data Sources
Data Source Types
Configuring a new data source
Data Source Naming Strategies
VFS Data Source Type
20. Actions
Action Lists
Action Types
Simple Actions
Multi Actions
Action Results
21. The Filter Models
Filter Types
IsDefinedFilter
IsUndefinedFilter
IncludeFilter
HasElementsFilter
Values
constant
22. Content Elements
Part Tags
Attachment
Checkbox
Error-Message-List
External Link
Label
Multi Connect
Password
Rich Text Field
Select Field
Textarea
Textfield
23. Web Services
Validation rules
Transformation
Groovy Web Services
Using a groovy script
Using the default web service endpoint script
24. Web Service Clients
DefaultWebServiceClient
Calling a 'ZIP' web service
Response with a list of objects
GroovyScriptBasedWebServiceClient
Building the request message
WebServiceGateway
WebServiceXmlHandler
Defining GroovyScriptBasedWebServiceClient as action
Examples of groovy script clients
25. REST Services
Configure REST Services
REST Url
REST Service Script
The input object
The output object
26. Transformation
Transformer list
Transformer
Defining a transformation
Defining conditional transformer
Stop condition
Dynamical transformer order
Next-transformer
Conditional next-transformers
27. Encryption
Encryptor/Decryptor Definition
28. Mail Services
Mail service configuration set
Mail service configuration
How to setup a new mail service
How to setup a new type
How to setup a new strategy
The mail services config generator

Chapter 15.  Defining agents

Using an agent you can model a task that is run when a defined event occurs. This enables you to create an event based behavior to ensure data integrity or aggregate and transfer data. The following sections describe the currently provided types of agents.

For event based agents the system provides trigger IDs to identify the event. Currently the following trigger IDs are supported:

Table 15.1. Agent Trigger IDs

Trigger IDDescription
__opensaga:insertingDomainObject Posted before a domain object is inserted into a persistence layer.
__opensaga:insertedDomainObject Posted after a domain object is inserted into a persistence layer.
__opensaga:deletingDomainObject Posted before a domain object is deleted from a persistence layer.
__opensaga:deletedDomainObject Posted after a domain object is deleted from a persistence layer.
__opensaga:updatingDomainObject Posted before a domain object is updated to a persistence layer.
__opensaga:updatedDomainObject Posted after a domain object is updated to a persistence layer.
__opensaga:readingDomainObject Posted before a domain object is read from a persistence layer.
__opensaga:readDomainObject Posted after a domain object is read from a persistence layer
__opensaga:userLoggedIn Posted after a user is logged in.
__opensaga:userLoggedOut Posted after a user is logged out.

Beside the action attributes that configure the execution behaviour of the action, an action includes a list of actions that are executed, when the agent is run.

Domain type based agent

The action defined by the domaintyp-based-agent tag, that can handle writing access events on domain types. The action is configured by the following attributes:

Table 15.2. Attributes of DomainTypeBaseAgent

AttributeDescription
id Unique identifier of the acion.
name Descriptive name of the agent.
domain-type-ref Reference to the domain type model that is handled by this client.
trigger-event-id Id of the trigger event.

Event based agent

An event based agents handles events that are provided by the platform.

Table 15.3. Attributes of EventBasedAgent

AttributeDescription
id Unique identifier of the acion.
name Descriptive name of the agent.
domain-type-ref Reference to the domain type model that is handled by this client.
trigger-event-id Id of the trigger event.

Time based agent

A time based agent executes an action list at a point of time defined by an repeat intervall. For more complex execution scenarios you may define a cron expression.

Table 15.4. Attributes of TimeBasedAgent

AttributeDescription
cron-expression When defining a cron expression the scheduler ignores the repeat-count and the repeat-intervall, since the cron expression defines in its own format.
repeat-count Times to repeat the agent.
repeat-interval Time span between to executions.
start-time A DateTime that defines the start of the timer.
end-time A DateTime that defines the end of the timer.

Trigger based agent

Chapter 16. The Container Models

The Portal Model

The portal model is the main model wherefrom all other model sets are referenced and initialized. It is subdivided in relevant parts as described in the following sections. The table below contains a list of all attributes that can be set on the portal model.

[Warning]Warning

Take care while changing these settings.

Table 16.1. Portal model attributes

AttributeDescriptionDefault value
idThe ID of the portal.portal.base
home-process-start-state-refThe start state ID of the home process.p_home.s_start
login-process-start-state-refThe start state ID of the login process.p_login.s_start
logout-process-start-state-refThe start state ID of the logout process.p_logout.s_start
error-process-start-state-refThe start state ID of the error process.p_error.s_start
access-denied-process-start-state-refThe start state ID of the access denied process.p_access_denied.s_start
relation-set-refThe ID of the relation set model.portal.domain.relations
translations-refThe ID of the translations model.portal.domain.translations
layout-refThe ID of the layout model. portal.layout
title-tagThe title tag of the portal.PortalTitle
agents-refThe ID of the agents model.agents.list
stages-refThe ID of the stages model.system.stages
deletion-modeThe default deletion mode, see the section called “<portal />”.logical
system-domain-type-refThe domain type model ID of the domain type used for system settings.system.domain.virtual.info

Example 16.1. Portal Definition

<portal id="portal.base"
    home-process-start-state-ref="p_home.s_start"
    login-process-start-state-ref="p_login.s_start"
    logout-process-start-state-ref="p_logout.s_start"
    error-process-start-state-ref="p_error.s_start"
    access-denied-process-start-state-ref="p_access_denied.s_start"
    relation-set-ref="portal.domain.relations"
    translations-ref="portal.domain.translations"
    layout-ref="portal.layout"
    title-tag="PortalTitle"
    agents-ref="agents.list"
    stages-ref="system.stages"
    deletion-mode="logical"
    system-domain-type-ref="system.domain.virtual.info">

The Meta Model

The meta model contains meta information for vitally functionality of the portal, such as user authentication, permission management or logging.

Table 16.2. Meta model attributes

AttributeDescriptionDefault value
scoped-current-user-object-refThe cached object for the current user. See scoped-domain-object in the SessionContext model (the section called “The Session Context”).portal.user.current
user-domain-type-refThe domain type that describes a user.system.domain.user
user-login-property-refThe login property of the user domain type.system.domain.user.login
user-password-property-refThe password property of the user domain type.system.domain.user.password
user-active-property-refThe active property of the user domain type.system.domain.user.active
user-native-locale-property-refThe native locale property of the user domain type.system.domain.user.nativeLocale
user-profile-locale-property-refThe profile locale property of the user domain type.system.domain.user.profileLocale
user-profile-timezone-property-refThe timezone property of the user domain type.system.domain.user.profileTimeZone
user-last-login-property-refThe last login property of the user domain type.system.domain.user.lastLogin
user-role-relation-refThe relation between the user domain type and the role domain type.system.domain.user.relation.role
user-web-service-relation-refThe relation between the user domain type and the portal web service domain type.system.domain.user.relation.portal_web_service
user-superuser-property-refThe super user property of the user domain type.system.domain.user.superUser
user-portaluser-property-refThe portal user property of the user domain type.system.domain.user.portalUser
role-domain-type-refThe domain type that describes a role.system.domain.role
role-permission-relation-refThe relation between role domain types and permission domain types.system.domain.role.relation.permission
role-name-property-refThe name property of the role domain type.system.domain.role.name
permission-type-property-refThe type property of the permission domain type.system.domain.permission.type
system-logging-domain-type-refThe domain type that describes a system logging entry.system.domain.logging
system-logging-timestamp-property-refThe timestamp property of the system logging domain type.system.domain.logging.timestamp
system-logging-component-property-refThe component property of the system logging domain type.system.domain.logging.component
system-logging-level-property-refThe level property of the system logging domain type.system.domain.logging.level
system-logging-message-property-refThe message property of the system logging domain type.system.domain.logging.message
system-logging-login-property-refThe login property of the system logging domain type.system.domain.logging.login
translation-domain-type-refThe domain type that descibes a translation.system.domain.translation
translation-code-property-refThe code property of the translation domain type.system.domain.translation.code
translation-language-property-refThe language property of the translation domain type.system.domain.translation.language
translation-country-property-refThe country property of the translation domain type.system.domain.translation.country
translation-process-id-property-refThe process property of the translation domain type.system.domain.translation.processId
translation-view-id-property-refThe view property of the translation domain type.system.domain.translation.viewId
translation-translation-property-refThe translation property of the translation domain type.system.domain.translation.translation
web-service-name-property-refThe name property of the portal web service domain type.system.domain.portal_web_service.name
default-email-addressThe default email address used by OpenSAGA to sent emails.info@quinscape.de
session-locale-refThe cached domain object for the session locale.session.locale
use-join-tableSpecifies if join tables should be used for relations.true

Example 16.2. Meta Definition

<meta scoped-current-user-object-ref="portal.user.current"
      ...
      session-locale-ref="session.locale"
>
    <anonymous-model-permissions>
    ...
    </anonymous-model-permissions>
    <user-model-permissions>
    ...
    </user-model-permissions>
</meta>

In addition to the above attributes the model permissions for anonymous and logged on users are defined in the meta model. The anonymous-model-permissions and user-model-permissions each contain a list of model-permissions.

Example 16.3. Anonymous Model Permissions Definition

<anonymous-model-permissions>
    <model-permission model-id-property-ref="system.domain.portal_view.guid">
        <relation-chain>
            <relation-reference
                relation-ref="system.domain.role.relation.portal_view"/>
        </relation-chain>
    </model-permission>
    ...
</anonymous-model-permissions>

Each model-permission contains a relation-chain that describes the relations that are necessary to reach the permission model by starting at the role domain type. For example the following code block

Example 16.4. User Model Permissions Definition

<user-model-permissions>
    <model-permission model-id-property-ref="system.domain.portal_view.guid">
        <relation-chain>
            <relation-reference
                relation-ref="system.domain.role.relation.portal_view"/>
        </relation-chain>
    </model-permission>
    ...
</user-model-permissions>

describes that the view permissions (defined by the portal view domain type) can be reached by starting at the role domain type and then following the relation system.domain.role.relation.portal_view to the portal view domain type model. The model-id-property-ref defines the domain type of the permission.

The Navigation Reference Set

The navigation reference set contains a set of references to navigation models. Check out ??? for more details.

Example 16.5. Navigation Reference Set Definition

<navigation-reference-set>
    <navigation-reference navigation-ref="base.n_main"/>
    <navigation-reference navigation-ref="base.n_support"/>
    <navigation-reference navigation-ref="base.n_applications"/>
    <navigation-reference navigation-ref="base.n_admin-applications"/>
</navigation-reference-set>

Supported Locales

The set of locales that are supported by the portal can be specified here. For each locale a locale element with the attributes language-code and country-code has to be defined. The values of these attributes correspond to the language and country properties of the java.util.Locale Java class. The default locale can be configured by the attribute default-locale-ref.

Example 16.6. Supported Locales Definition

<supported-locales default-locale-ref="balvi.locale.de_DE">
    <locale id="balvi.locale.en_US" language-code="en" country-code="US"/>
    <locale id="balvi.locale.de_DE" language-code="de" country-code="DE"/>
</supported-locales>

The Domain Type Reference Set

The domain type reference set contains all domain types of the portal. For each domain type a domain-type-reference element with the attribute domain-type-ref has to be defined. This attribute refers to a domain type model, see Chapter 51, Domain Type Models.

Example 16.7. Domain Type Reference Set Definition

<domain-type-reference-set>
    <domain-type-reference domain-type-ref="system.domain.user"/>
    ...
    <domain-type-reference domain-type-ref="system.domain.role"/>
</domain-type-reference-set>

Default Property Set

You can specify a default property set that contains a set of properties that are added to all domain type models.

Example 16.8. Default Property Set Definition

<domain-type-reference-set>
    <default-property-set>
        <default-property id-suffix="createdBy" name="createdBy"
            type="PlainText"
            insert-property-value-provider="currentUserPropertyValueProvider"/>
        ...
    </default-property-set>
    <domain-type-reference .../>
    ...
</domain-type-reference-set>

The example shows the definition of a createdBy property. You have to specify the name and type just like you do for a normal domain type property. Here we use the currentUserPropertyValueProvider, so that the property is initialized if a new domain object is inserted into the database.

The attribute id-suffix is used for the ID of the generated property model. The ID is generated by using the ID of the domain type, then adding a dot and the ID suffix. E.g. if you assume a domain type with the ID example.company and the ID suffix createdBy, the resulting ID would be example.company.createdBy. You can use this generated ID like any other property model ID.

The Process Reference Set

The process reference set contains all processes that can be used in the portal. For each process a process-reference element with the attribute process-ref has to be defined. This attribute refers to a process model.

Example 16.9. Process Set Definition

<process-reference-set>
    <process-reference process-ref="portal.p_login"/>
    ...
    <process-reference process-ref="portal.p_monitoring"/>
</process-reference-set>

Using ID Mappings to Copy Processes

OpenSAGA can also duplicate processes by copying them and replacing a selected set of IDs with new IDs.

[Note]Note

Internally all old IDs are replaced with new IDs. Random IDs are created to do that. But usually you need a set of IDs with known IDs in order to integrate the copy into your overall system (by e.g. referencing a new start state ID). Therefor you usually will need to define a limited set of IDs manually.

To do so you can use the process-reference tag already explained in the section called “The Process Reference Set” but need to enhance it with the specific ID mappings that you need to control. The following example shows how to do this.

Example 16.10. Duplicating a Process

Let us assume that a process with the ID test.p_foo exists in your project. For some reason you want to copy the process (probably to modify it with some other means). Your goal is to create a new process test.p_bar that can be started via the navigation by adressing a start state with the new ID p_bar.s_bar (which overwrites the old start state ID p_foo.s_foo). This can be done easily by the following code:

    <process-reference process-ref="test.p_bar" template-process-ref="test.p_foo">
        <id-mapping-set>
            <id-mapping original-id="p_foo.s_foo" new-id="p_bar.s_bar"/>
        </id-mapping-set>
    </process-reference>
                

The Web Service Reference Set

The web service reference set contains references to all web services that can be used in the portal. For each web service a web-service-reference element with the attribute web-service-ref has to be defined. This attribute refers to a web service model, see Chapter 23, Web Services.

Example 16.11. Web Service Reference Set Definition

<web-service-reference-set>
    <web-service-reference web-service-ref="portal.w_example_web_service"/>
    ...
</web-service-reference-set>

The REST Services Reference Set

The REST service reference set contains references to all REST services that can be used in the portal. For each REST service a rest-services-reference element with the attribute rest-service-ref has to be defined. This attribute refers to a REST service model, see Chapter 25, REST Services.

Example 16.12. REST Service Reference Set Definition

<rest-services-reference-set>
    <rest-services-reference rest-services-ref="portal.r_test"/>
    ...
</rest-services-reference-set>

Paging

The paging element contains the default paging definition for all data grids in the portal. With the default-page-size attribute you can specify the default page size. You can override this setting by adding a paging element with a different paging size to a data grid. Each paging-button definition has the attributes offset, label and event. The offset attribute defines the offset to the current page, i.e. an offset of 1 jumps to the next page while an offset of -2 jumps two pages back. The label attribute describes the button label that is displayed; if no label is specified, the target page number is used instead. The event attribute describes the event that the button fires. The value of the event attribute is only used to identify the button that fired it, i.e. you can specifiy any event name that you like. If no event attribute is specified, the button is inactive.

Example 16.13. Paging Definition

<paging default-page-size="10">
    <paging-button offset="first" label="|&lt;" event="first"/>
    <paging-button offset="-1" label="&lt;" event="prev"/>
    <paging-button offset="-3" event="prev3"/>
    <paging-button offset="-2" event="prev2"/>
    <paging-button offset="-1" event="prev"/>
    <paging-button offset="0"/>
    <paging-button offset="1" event="next"/>
    <paging-button offset="2" event="next2"/>
    <paging-button offset="3" event="next3"/>
    <paging-button offset="1" label="&gt;" event="next"/>
    <paging-button offset="last" label="&gt;|" event="last"/>
</paging>

Filter Specification Set

If you have frequently used filter specifications, you should define them in a filter specification set. You can define such a set within view, process and portal models. To reference a filter defined in such a set, you have to use the include command, see the section called “IncludeFilter” for more information.

[Important]Important
The search order for filter specifications is: view, process and portal.

Example 16.14. Filter Specification Set

<filter-specification-set>
    <filter-specification id="filter1">
        ...
    </filter-specification>
    ...
</filter-specification-set>

UI Component Setting Set

This set contains settings for UI components. Each setting consists of a name and value.

Example 16.15. UI Component Setting Set

<ui-component-setting-set>
    <ui-component-setting name="domaincontextpath.display" value="true"/>
    <ui-component-setting name="domaincontextpath.length" value="5"/>
    ...
</ui-component-setting-set>

Action List Set

If you have frequently used action lists, you should define them in an action list set. You can define such a set within process and portal models. To reference an action list defined in such a set, you have to use the call action, see the section called “CallAction” for more information.

[Important]Important
The search order for filter specifications is: process and portal.

Example 16.16. Action List Set

<action-list-set>
    <action-list id="example.action1">
        ...
    </action-list>
    <action-list id="example.action2">
        ...
    </action-list>
    ...
</action-list-set>

Start Action List

You can specify a list of actions that is executed right after the portal startup is complete.

Example 16.17. Start Action List

<start-action-list>
    <system-log message="Executed Start-Action" />        
</start-action-list>

Stages Model

The stages model contains a set of stage definitions. The stages that are used by the portal can either be defined by the startup parameter OPENSAGA_STAGES or by using the configuration file opensaga-project.cfg. See the section called “Configuring the deployment stage for the server” for more information.

The Stage Model

Example 16.18. A single stage definition

<stage name="dev-example">
  <data-source-set>
    <data-source name="portaldb" type="opensaga-hibernate">
      <settings>
        <setting name="driverClassName" value="org.postgresql.Driver"/>
        ...
        <setting name="password" value="iGro1tWHHIXupoiW57hsIg=="
                                 decryption-bean-name="aesDecrypter"/>
        <setting name="bean.dataBaseNamingStrategy" value="postgres"/>
        ...
        <setting name="hibernate.dialect"
                 value="org.hibernatespatial.postgis.PostgisDialect"/>
        ...
        <setting name="c3p0.initialPoolSize" value="3"/>
        ...
      </settings>
    </data-source>
  </data-source-set>
</stage>

The stage name (in this example dev-example) is defined by the attribute name.

[Note]Note

Some technical details: the stage models of all selected stages are merged in the usual way. To get a list of all specified stage models you can use the findStageSetModel method in the ModelInformationService or retrieve it from the PortalModel. To make it easier for you to find a specific setting in the list of stage models, you can use the StagingService. This service internally merges all stages models (again, using the same algorithm!) into a single merged stage model. In most cases you will probably use the StagingService. If you need more details about each stage, you can use the methods discussed above.

The Data Source Model

Each stage definition contains a set of data sources. For example the portaldb data source that is the default one for all domain types. Above you can find an example of a data source definition (Example 16.18, “A single stage definition”). Each data source has a name and a type. The name is referenced by the domain type that uses the data source. The type attribute specifies the data source type. See the section called “Data Source Types” for a list of supported types.

The data source configuration is specified by using a settings set that contains setting definitions. Each setting consists of a parameter name (name attribute) and a parameter value (value attribute). If you want to use encrypted values, you have to specify a decryption-bean-name that refers to a configured decryption bean. See Chapter 27, Encryption for more information.

Table 16.3. Data source configuration parameter

ParameterDescription
Database configuration parameter
driverClassName Java classname of the database driver. Example: org.postgresql.Driver
url URL of the database. Example: jdbc://postgresql://db-server/database
username Name of the database user.
password Password of the database user.
bean.dataBaseNamingStrategy

The set of naming strategies used for table- and column-names in the database. Valid values are postgres, sqlServer and oracle.

Technically this value is a prefix used to identify the correct beans from the application context. See 03-pdg-dao-configuration-template.xml for reference.

Hibernate configuration parameter
hibernate.dialect Java classname of the Hibernate dialect. Example: org.hibernatespatial.postgis.PostgisDialect used for a PostgreSQL database with GIS support.
hibernate.hbm2ddl.auto Database schema export mode. See the section called “Choosing the correct database schema export mode” for a detailed description.
hibernate.generate_statistics Flag indicating if Hibernate statistic should be generated. Default: true
hibernate.cache.use_query_cache Flag indicating if the query cache should be used. Default: false
hibernate.cache.use_second_level_cache Flag indicating if the second level cache should be used. Default: false
hibernate.cache.provider_class Java classname of the cache provider. Default: org.opensaga.runtime.ExternalEhCacheProvider
... Refer to the Hibernate documentation for additional configuration parameters.
Connection pool configuration parameter
c3p0.initialPoolSizeInitial pool size of the c3p0 connection pool.
c3p0.minPoolSizeMinimum pool size of the c3p0 connection pool.
c3p0.maxPoolSizeMaximum pool size of the c3p0 connection pool.
... Refer to the c3p0 documentation for additional configuration parameters.

Choosing the correct database schema export mode

This section describes how to choose the correct database schema export mode for Hibernate. The mode is set by the configuration parameter hibernate.hbm2ddl.auto. The valid values are: create, create-drop, update and validate. If this parameter is not set, Hibernate does not export the schema, i.e. no database tables are created or validated. Missing tables and/or missing/mismatching column types are only detected at runtime.

create

Hibernate creates a new database schema. All tables included in this schema are dropped (if they existed before) and created again. On every OpenSAGA startup you start with a new database. Tables not included in the Hibernate schema are ignored.

[Caution]Caution

Never use this mode in a production environment. You will probably loose all your data. He who laughs last has a backup.

create-drop

In addition to the create mode, all tables that were created by Hibernate are dropped if the SessionFactory is closed.

[Caution]Caution

This mode is even more critical than the create mode but may be useful in some testing scenarios.

update

This is the preferred mode for development. If you add new domain types or domain type properties, the database is updated accordingly. If you delete domain types or domain type properties, the corresponding tables/columns are not deleted from the database.

[Important]Important

If you change the type of domain type properties, the corresponding database column is not changed. This can lead to strange errors or confusion. To prevent this from happening, you have to make sure that the database table is changed in the same way that you have changed the property (either by modifying/deleting the database columns or by deleting the whole table).

validate

This is the preferred mode for deployment. The database schema is validated in the OpenSAGA startup phase. If there are any mismatches (e.g. missing columns or wrong column types) the startup is stopped and an appropriate error message is logged.

The Proxy Configuration Model

It is possible to use a proxy for all outgoing http connections of OpenSAGA. Therefore you have just to define a proxy configuration model with the data of the proxy. The following example shows how to configure a proxy.

Example 16.19. Configure a proxy for OpenSAGA

<stage name="dev-example">
    ...
    <proxy-configuration>
        <settings>
            <setting name="host" value="proxy.myserver.de" />
            <setting name="port" value="8000" />
            <setting name="user" value="Foo" />
            <setting name="password" value="Bar" />
        </settings>
    </proxy-configuration>
    ...
</stage>

Internally the values are set in the following way:
System.setProperty("http.proxyHost", proxyConfigurationModel.getHost());
System.setProperty("http.proxyPort", proxyConfigurationModel.getPort());
System.setProperty("http.proxyUser", proxyConfigurationModel.getUser());
System.setProperty("http.proxyPassword", proxyConfigurationModel.getPassword());

Table 16.4. Proxy configuration parameters

ParameterDescription
hostDefines the host of the proxy
portDefines the port of the proxy
userDefines the username that is used to login at the proxy
passwordDefines the password that is used to login at the proxy

Development Mode

By setting the development-mode attribute on stage to true, you can enable the development mode which changes some of the behaviour of the OpenSAGA platform to be less efficient but supporting convient development methods. In development mode

  • Hot reloading of more and more resources is enabled. You can already edit views, layout models and processes and to some degree without even restarting the context. The models get recompiled and reenhanced on-the-fly and you can just continue working. New models in general still require a restart.

  • The bundling mechanisms that merge CSS and JavaScript resources into large compressed resource bundles is deactivated in parts. Scripts are still resolved via dependencies but are included as single files to aid script development. This is not possible on Internet Explorer which puts arbritrary limits on the number of resources being included. Since many widgets have one or more resource dependencies this leads to quite a number of resource inclusions on the average OpenSAGA view.

  • The view id is displayed after the view title to aid working on OpenSAGA applications you have not designed yourself.

  • Exceptions are only displayed on the client side in production mode.

Chapter 17. The View State

Layouting a View

Views offer very flexible means of layout. Chapter 38, Working with layouts in OpenSAGA provides a detailed introduction about how to create such layouts.

Part Tags

Parts contain the actual content of a view. A variety of content elements is available to build individual views, Chapter 22, Content Elements introduces all available content elements.

Validating a View

Views can specify special validation rules to which the input of a view must comply. If any such restrictions fail the view cannot transition to the next state in the process model and will be redisplayed with appropriate error messages provided by the validation rules. To display these error messages, an error-message-list must be provided on at least one visible part of the view, see Chapter 18, Error Handling for more about this.

Validation rules for a specific view are defined following the part-set. The rules are defined by using the restriction-set model element also available for domain types. Chapter 70, Restrictions provides detailed information about how to define such a restriction set. Note that no implicit objects are available when defining view restrictions. Instead all the implicit scripting objects described in the section called “What to use?” can be used to access objects, lists and properties defined on the source view. Then the scripting language can be used as usual in order to define specific restrictions.

The following example shows a trivial view with two restrictions:

Example 17.1. View Restrictions

<?xml version="1.0" encoding="UTF-8"?>
<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:noNamespaceSchemaLocation="http://www.opensaga.org/schema/model/view-1.0.xsd"
      id="sandbox.p_view_validation.view" 
      process-ref="sandbox.p_view_validation"
      title="CheckFormValidation">

	<part-set>
        <part>
        	<content>
               <label value="Input" target-ref="p_attachment.attachment"/><br/>
               <plain-text value="EnterNonEmptyWordsStartingWithTheLetterAThenPressCheck"/><br/>
               <error-message-list title-tag="Error List"/><br/>
               <text-field id="sandbox.p_view_validation.view.input" type="PlainText" property-ref="sandbox.p_view_validation.view.input"/><br/>
               <button
                   transition-ref="sandbox.p_view_validation.t_validate"
                   icon="load" 
                   text="Check" />
            </content>
        </part>
    </part-set>
    
    <restriction-set>
    	<restriction error-tag="MustNotBeEmpty">
			property["sandbox.p_view_validation.view.input"] != null
			</restriction>
                <restriction error-tag="DoesNotStartWithA">
			property["sandbox.p_view_validation.view.input"] != null &&
			property["sandbox.p_view_validation.view.input"].startsWith("A")
                </restriction>
                </restriction-set>
                </view>

[Note]Note

View restrictions will be ignored under two circumstances:

  1. The action list of the transition to be executed contains no actions that require data binding. In such a case the transition will be rated as canceling the view and thus all restrictions defined for the view will be ignored.

  2. The transition itself is annotated as ignoring view restrictions. This can be achieved by setting the transition attribute ignores-view-restrictions to true.

In all other cases view restrictions will be checked and might prevent a user from leaving the view.

Interrupting the Business Logic Flow of a View

Views are very special states in a process because they result in an interrupt until the client responds. They are surrounded by server side business logic:

  • A preprocessing phase that loads all the data required for displaying the view.

  • A postprocessing phase in which a transition moves to a new (or the same old) state and optionally executes business logic by processing the actions of a transition model (see ??? for details about how processes are defined).

Now there are some cases in which you might want to interupt the following: standard sequence:
  1. Preprocess the next view (e.g. load its data).

  2. Display the view and wait for the client.

  3. Postprocess the client response.

In total there usually are four points where you might want to inject additional logic:
  1. Before data for the view is preprocessed (to e.g. manipulate the overall data to display).

  2. After the data for the view is preprocessed (to e.g. manipulate individual values of the overall data or add some more data).

  3. Before the client response is processed (to always execute some logic when leaving a view).

  4. After the client response is processed (to always execute some final clean-up oerations).

OpenSAGA provides special models to describe these four intersections. The special models are displayed below and you can define none, some or all of them in each individual view model. Each of these special models takes an action list which in turn can execute special business logic:

Example 17.2. Interrupting the Preprocessor and the Postprocessor

<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:noNamespaceSchemaLocation="http://www.opensaga.org/schema/model/view-1.0.xsd"
      id="..." 
      process-ref="..."
      domain-type-ref="..."
      title="...">

    <before-preprocessing>
        <action-list>
        ...
        </action-list>
    </after-preprocessing>

    <after-preprocessing>
        <action-list>
        ...
        </action-list>
    </after-preprocessing>

    <before-postprocessing>
        <action-list>
        ...
        </action-list>
    </before-postprocessing>

    <after-postprocessing>
        <action-list>
        ...
        </action-list>
    </after-postprocessing>
    
    ...
            

Chapter 18. Error Handling

Table of Contents

Global Errors
Local Errors

OpenSAGA provides two ways of communicating errors to the user:

  • Errors can be global.

  • Errors can be bound to a specific content element.

Below we explain the content element models responsible for displaying global and local errors.

Global Errors

Global errors are not connected with a specific input element but rather with the overall content of the source view or the application state. Global errors are visualized in a list like this:

<error-message-list title-tag="ErrorList"/>
OpenSAGA will display a list of all error messages created during the validation lifecycle step. OpenSAGA will not display errors that will be displayed in a more local place due to a local error tag (see below). Those errors will automatically be filtered from the global list. If you want to see all errors in the global error list although they also are shown in another place you can use the global-only attribute of the error-message-list tag and set it to false.

Local Errors

Local errors are connected to a specific content element model. They can be displayed like this:

<textarea id="content" property-ref="..."/>
<error-message target-ref="content"/>
The error-message tag will show the validation message for the referenced content element model if there was a validation error. Otherwise no output will be produced. Since the tag displays an actual message you must take care to insert it into the layout in such a way that the optional message will not destroy your layout.

Chapter 19. Data Sources

Data Source Types

Data source types provide the meta information required to configure a data source. OpenSAGA supports the following data source types:

Table 19.1. Data Source Types

TypeDescription
opensaga-cache-repositoryProvides a data source type to connect a virtual domain type with all cached items.
opensaga-constantProvides access to constant data that is defined by a list of constant-data-list elements.
opensaga-hibernateProvides access to a database by using Hibernate.
opensaga-external-relationalProvides access to an external relational database by using JDBC.
opensaga-external-excelProvides access to an external Excel file.
opensaga-native-localesProvides access to all locales that are defined by java.util.Locale.
opensaga-supported-localesProvides access to all locales that are supported by the current portal.
opensaga-portal-viewsProvides access to all views that are defined in the current portal.
opensaga-portal-processesProvides access to all processes that are defined in the current portal.
opensaga-portal-transitionsProvides access to all transitions that are defined in the current portal.
opensaga-portal-navigation-itemsProvides access to all navigation items that are defined in the current portal.
opensaga-vfsProvides a data source type to connect a virtual file system type.

Configuring a new data source

To configure a new data source you have to complete the following steps:

  • (1) Add a new data source to stages.xml.

  • (2) Add an element for the data source to the file model-based-data-sources-1.0.xsd.

  • (3) Create a new domain type for the data source content.

  • (4) Add the new domain type to the correct portal.xml.

Data Source Naming Strategies

The opensaga-hibernate data source uses a set of predefined naming strategies (for table names, column names, etc.). The specific set that is used is determined by the data source setting bean.dataBaseNamingStrategy. The following values can be used: postgres and oracle. The value oracle defines a set of strategies that work with an Oracle data base, the value postgres does the same for a PostgreSQL data base.

It is possible that the naming strategies can not automatically create names that are unique. In this case you get a NotUniqueException on system startup. To resolve this conflict you have to set one of the conflicting table names to a unique value (the table name can be manually defined for domain type models and relation models). If you use different data bases (e.g. for development and deployment) you might get different naming conflicts. Therefore we recommend to use the same type of data base for all systems.

VFS Data Source Type

OpenSAGA-vfs implements an API for accessing file systems. You are able to generate an uniform view of different files from different sources (e.g. local disk) or search/list files inside of a zip or jar archive sources.

Getting started: We will start by following the upper steps of section the section called “Configuring a new data source”. First Step (1) is to add a new datasource to stages.xml. Here is an example how can it look like:

<data-source name="sample-file-data-source" type="opensaga-vfs">
    <settings>
        <setting name="baseDirectory" value="c:/"/>
        <setting name="0.directory" value="test/"/> 
        <setting name="0.files" value="**/*gv*.html"/>
    </settings>
</data-source>

This example will show files with *gv*.html-ending in C:/Test/. To declare a base directory is always necessary - it is the parent node of all following settings. More settings are not essential, unless you want to establish more criteria.

The next step (2) is to add an element to model-based-data-sources-1.0.xsd for our vfs-datasource:

<xsd:element name="virtual-file-system-data-source">
    <xsd:complexType>
        <xsd:complexContent>
            <xsd:extension base="beans:identifiedType">
                <xsd:attribute name="domain-type-ref"
                               type="DomainTypeRefType"
                               use="required"/>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>
</xsd:element>

In step (3) we have only to create a new domain type and add it correct to portal.xml (4): Therefore create a file samplefiles.xml in your-extension/models/domain/types with the content:

<?xml version="1.0" encoding="UTF-8"?>
<domain-type xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation=
        "http://www.opensaga.org/schema/model/domain-type-1.0.xsd"
    id="your-extension.samplefiles"
    name="SampleFiles"
    extends="system.domain.file"
    data-source-name="sample-file-data-source">
</domain-type>
<!-- Take care: The id here is an example extension -->

If that is done lets close up the last step (4) in portal.xml

<domain-type-reference-set>
    ..
    <domain-type-reference domain-type-ref="system.domain.file"/>
    ..
</domain-type-reference-set>

Last but not least you can make your work viewable by creating a new suitable view - and that's it! Now there will follow some examples, how to handle with the datasource-settings:

<!-- 
Example 1:
-->
<data-source name="sample-file-data-source" type="opensaga-vfs">
    <settings>
        <setting name="baseDirectory" value="c:/folder1"/>
    </settings>
</data-source>
<!--
To specify only the base directory - without any other settings - will result in
a wildcard (*.*) search in your given basedir: C:/folder1
-->
<!--
Example 2:
-->                
<data-source name="sample-file-data-source" type="opensaga-vfs">
    <settings>
        <setting name="baseDirectory" value="c:/"/>
        <setting name="0.directory" value="test/"/> 
        <setting name="0.files" value="**/*.html"/>
        <setting name="0.files" value="**/*.xhtml"/>
        <setting name="0.files" value="**/New*.txt"/> <!-- filename: beginning with -->
        <setting name="0.files" value="**/*test*.txt"/><!-- filename: containing test -->
    </settings>
</data-source>

<!--
This example shows in C:/test all *.html, *.xhtml, *.txt with begining filename 'new'
and all *.txt containing in filename 'test'.
-->
<!--
Example 3:
-->                  
<data-source name="sample-file-data-source" type="opensaga-vfs">
    <settings>
        <setting name="baseDirectory" value="c:/"/>
        <setting name="0.directory" value="test/"/> 
        <setting name="0.files" value="**/*.html"/>
        <setting name="0.files" value="**/*.xhtml"/>
        <setting name="0.files" value="**/*.txt"/>
        <setting name="1.directory" value="bars/"/> 
        <setting name="1.files" value="**/*.wav"/>
        <setting name="1.files" value="**/*.rtf"/> 
        <setting name="2.directory" value="foos/"/> 
    </settings>
</data-source>
<!--
This example shows in C:/test all *.html, *.xhtml, *.txt
and in C:/bars all *.wav, *.rtf.
The last directory setting will make a wildcard search to C:/foos.
-->

How to search in archives?

<!--
Example 4:
To search in an zip-archive according to different files.
-->                
<setting name="baseDirectory" value="zip:c://"/>
<setting name="0.directory" value="test/test.zip"/>
<setting name="0.files" value="**/*.html"/>
<setting name="1.directory" value="foo/java.zip"/>
<setting name="1.files" value="**/*.js"/>
<setting name="1.files" value="**/*.java"/>
<!-- 
Example 5:
To search in more than one archive with different compressesion kinds is possible, too.
Let the baseDirectory empty, set the directory-values to your wished
compression like zip: and specify the right path like in the example (with two slashes). 
The following files will be searched.
-->
<setting name="baseDirectory" value=""/>
<setting name="0.directory" value="zip:c://test/test.zip"/>
<setting name="0.files" value="**/*.html"/>
<setting name="1.directory" value="jar:c://test/java.jar"/>
<setting name="1.files" value="**/*.js"/> 
<!-- Indeed it is possible to search additionally in a normal directory -->
<setting name="2.directory" value="c:/test/"/>
<setting name="2.files" value="**/*.zip"/>

For more information and documentation check out the Commons Virtual File System website or the Commons VFS API website.

Chapter 20. Actions

OpenSAGA has an extensive set of actions that provide high level functionality hiding the complexity for the most common use cases in web application modeling. An action executes on defined input parameters, which are, depending on the type of action, constant values, references to other models or context values. It returns an action result that indicates a success or a failure.

Action Lists

Actions are always contained within an action list. The list has to contain at least one action. You can specify a filter-specification that determines if the action list should be executed. See Chapter 21, The Filter Models for more information.

Action Types

There are two different kinds of actions. The simple actions (see the section called “Simple Actions”) that provide literally simple functionality and multi actions (see the section called “Multi Actions”) that handle more complex functionality even on lists of objects.

Simple Actions

You can specify a filter-specification that determines if the action should be executed. If the action uses a filter itself, it can be specified by using with-filter (that contains another filter-specification).

Example 20.1. Filter Specifications Used By Action

<action-list>
    <delete-by domain-type-ref="...">
        <filter-specification ... />
        <with-filter>
            <filter-specification ... />
        </with-filter>
    </delete-by>
</action-list>

The following simple actions are predefined:

AddToListAction

Adds domain objects to a scoped domain object list defined by the list-ref attribute. Either a scoped domain object or a list of new objects that can be configured in the action will be added to the list. It is possible to specify where to insert the object into the list by the index attribute. If no index is specified, the object will be added to the end of the list.

Table 20.1. Attributes of AddToListAction

AttributeDescription
list-ref Defines the scoped domain object list to that the domain object is added (see the section called “List references”).
scoped-domain-object-ref Defines the scoped domain object that is added to the list (see the section called “Object references”).
index Specifies the index where to add the object.

Table 20.2. Children of AddToListAction

ChildDescription
new-object Defines a new domain object that is added to the list.

The following example shows how to add a scoped domain object to a list at a given index.

Example 20.2. AddToListAction: Adding a scoped domain object

<add-to-list list-ref="scoped.list" 
    scoped-domain-object-ref="scoped.object" index="1" />

The AddToListAction supports also the possibility to add objects that are created inside the action. Therefore you have to define new-object children. Each child represents a single object. The domain type of the object is specified by domain-type-ref. It is possible to set properties of these objects. For that a property-mappings is necessary. Each property-mapping sets one property. The target-ref specifies which property is set and the value attribute defines the value that is set. Following example shows how to add three new objects to a list.

Example 20.3. AddToListAction: Adding new objects to a list

<add-to-list list-ref="p_reference_to_scoped_list_element.list">
    <new-object domain-type-ref="domain.a">
        <property-mappings>
            <property-mapping target-ref="domain.a.name" value="First Object" />
        </property-mappings>
    </new-object>
    <new-object domain-type-ref="domain.a">
        <property-mappings>
            <property-mapping target-ref="domain.a.name" value="Second Object" />
        </property-mappings>
    </new-object>
    <new-object domain-type-ref="domain.a">
        <property-mappings>
            <property-mapping target-ref="domain.a.name" value="Third Object" />
        </property-mappings>
    </new-object>
</add-to-list>

CallAction

This action executes a predefined action list that are defined in the portal model or a process model (for more information see the section called “Action List Set”).

Table 20.3. Attributes of CallAction

AttributeDescription
action-list-ref References the action list that is executed by this action.

To execute a predefined action list you have just to reference it by its id as shown in the following example (assuming a action list with the id 'portal.p_script.python.action' is defined).

Example 20.4. CallAction: Execute a action list

<call action-list-ref="portal.p_script.python.action" />         

ConnectAction

The connect action connects two domain objects with each other. To connect two domain objects a relation model between the two domain type models must exists. For more information about relation models see the section called “The Relation Model”.

Table 20.4. Attributes of ConnectAction

AttributeDescription
source-ref References the source domain object. The type of the object must be the start domain type of the using relation model.
target-ref References the target domain object. The type of the object must be the end domain type of the using relation model.
relation-ref Specify which relation model is used for connecting the domain objects.
mode The following modes are available:
  • ADD(default)

    Adds the connection to the existing ones.

  • REPLACE

    The new connection replaces all existing ones.


The connect action can work in one of the following ways:

  • Connect one object to another:

    <connect source-ref="..." target-ref="..." relation-ref="..."/>

  • Connect one source object to each of the listed objects (connecting source to the list elements via the given relation):

    <connect source-ref="..." relation-ref="...">
      <filtered-list>
        ...
      </filtered-list>
    </connect>	

  • Connecting each list element to the target object via the given relation:

    <connect target-ref="..." relation-ref="...">
      <filtered-list>
        ...
      </filtered-list>
    </connect>	

    Current special case: If neither source nor target reference are defined, this case is executed and the target object is RequestContext.getTargetDomainObject

DeleteAction

Deletes either the current domain object (either logically or physically depending on the deletion mode) or domain objects related with the current domain object, when a relation-chain-list is specified. The delete action provides also cascading deletion. When the cascade attribute is set to true, all domain objects of the relation chain inclusive the current domain object are deleted

Table 20.5. Attributes of DeleteAction

AttributeDescription
cascade Defines whether the objects of the relation chain are deleted cascaded (true) or only the last objects of the relation chain are deleted (false). The default value is false.

Table 20.6. Children of DeleteAction

ChildDescription
relation-chain-list Defines a relation chain list. All objects that are related with the current domain object via this relation chain list will be deleted.

Following example shows how to delete the current domain object.

Example 20.5. Deletes the current domain object

<action-list>
    <delete/>
</action-list>

Following example shows how to delete related domain object. In the process only the domain objects of the last relation of each specified relation chain will be deleted. For the example it means that all domain object of type c that are related to a b domain object which is again related to the current domain object (of type a) will be deleted.

Example 20.6. Deletes related domain objects

<action-list>
    <delete>
        <relation-chain-list>
            <relation-chain>
                <relation-reference relation-ref="portal.domain.a.relation.b" />
                <relation-reference relation-ref="portal.domain.b.relation.c" />
            </relation-chain>
        </relation-chain-list>
        ...
    </delete>
</action-list>

To delete all objects of the relation chain described in the example above, you have to set the cascade attribute to true. In this way all connected domain objects of domain type c and b and the root domain object are deleted.

Example 20.7. Deletes domain objects cascaded

<action-list>
    <delete cascade="true">
        <relation-chain-list>
            <relation-chain>
                <relation-reference relation-ref="portal.domain.a.relation.b" />
                <relation-reference relation-ref="portal.domain.b.relation.c" />
            </relation-chain>
        </relation-chain-list>
        ...
    </delete>
</action-list>

DeleteByAction

Deletes domain objects of a given type (either logically or physically depending on the deletion mode). If a filter specification is provided to the action only the objects that match the filter are deleted, otherwise all objects are deleted.

Table 20.7. Attributes of DeleteByAction

AttributeDescription
domain-type-ref Defines the domain type of the domain objects that are deleted by this action.

Table 20.8. Children of DeleteByAction

ChildDescription
with-filter Defines a filter. Only the objects that match the filter are deleted.

The following example shows how to delete all objects of a given domain type.

Example 20.8. DeleteByAction: Delete all domain objects of a given type

<delete-by domain-type-ref="domain.location"/>

Instead of deleting all domain objects of a given type you can also define a filter specification so that the delete by action only deletes the objects which match the filter.

Example 20.9. DeleteByAction: Delete domain objects with a given filter specification

<delete-by domain-type-ref="domain.location">
    <with-filter>
        <filter-specification>
            <starts-with>
                <property-value property-ref="domain.location.zip"/>
                <constant value="4" />
            </starts-with>
        </filter-specification>
    </with-filter>
</delete-by>

DisconnectAction

Disconnects a source domain object (either the current domain object or a referenced domain object) from another domain objects. Thereby you can disconnect the source domain object either from a specified domain object or from a set of directly or indirectly related domain objects.

Table 20.9. Attributes of DisconnectAction

AttributeDescription
source-object-ref Defines the source object. References a cached domain object (see the section called “Object references”). If no source object is defined the current domain object is used as source object.
target-object-ref Defines the target object that is disconnect from the source object. References a cached domain object (see the section called “Object references”). This attribute will be ignored when a relation-chain-list is specified.
relation-ref Defines the relation between the source and target object. This attribute will be ignored when a relation-chain-list is specified.

Table 20.10. Children of DisconnectAction

ChildDescription
relation-chain-list Defines a list of relation chains. The action disconnects the domain objects related to the source object through the relation chains from the source object. Only the objects of the last relation of every chain will be disconnected.

Following example shows how to disconnect the current domain object from a specified domain object.

Example 20.10. Disconnects the current domain object from a specified object

<action-list>    
    <disconnect target-object-ref="object.ref.b" 
                relation-ref="portal.domain.a.relation.b" />
</action-list>

Following example shows how to disconnect a cached domain object from a another one.

Example 20.11. Disconnects a cached domain object from a another one

<action-list>    
    <disconnect source-object-ref="object.ref.a"
                target-object-ref="object.ref.b" 
                relation-ref="portal.domain.a.relation.b" />
</action-list>

To disconnect the current domain object from a set of related domain objects, you have to specify a relation-chain-list with containing relation-chains. Only the last domain objects of each relation chain (so the domain objects that are related by the last relation model) are disconnected.

Example 20.12. Disconnect the current domain object from a set of related domain objects

<action-list>
    <disconnect>
        <relation-chain-list>
            <relation-chain>
                <relation-reference relation-ref="portal.domain.a.relation.b" />
                <relation-reference relation-ref="portal.domain.b.relation.c" />
            </relation-chain>
        </relation-chain-list>
        ...
    </disconnect>
</action-list>

Execute Action

Custom business logic preferrably will be embedded into a OpenSAGA project by using the execute action. The following example shows two different ways of executing scripts, other means also are available - see the full attribute reference below.

<action-list>
    <execute action-script="System.out.println('HelloG')"/>
    <execute action-script="System.out.println(new StringBuilder()
                            .append('H').append('e').append('l')
                            .append('l').append('o')
                            .append('B').toString());"
             scripting-dialect="bsh"/>
</action-list>

Table 20.11. Attributes of ExecuteAction

AttributeDescription
action-bean Defines the name of a Spring configured bean implementing the org.opensaga.runtime.model.action.Action interface. This class is permitted to implement arbitrary business logic. Database operations run within the enclosing transaction of the action list.
action-class

Defines the fully qualified class name of a class implementing the org.opensaga.runtime.model.action.Action interface. This class is permitted to implement arbitrary business logic. Database operations run within the enclosing transaction of the action list. Note that classes are instantiated every time this action executes - this might create serious performance issues for classes that are expensive to create.

Additionally the class will be initialized by executing the autowire method of Springs AutowireCapableBeanFactory implementation for the web environment using the AutowireCapableBeanFactory.AUTOWIRE_AUTODETECT parameter. While this allows for some autowiring to happen it again is a somewhat expensive operation.

In summary you usually will be better of using the action-bean parameter of the execute tag.

action-script Contains an inline script implemented in the given scripting-dialect (see that attribute). This script is permitted to implement arbitrary business logic. Database operations run within the enclosing transaction of the action list.
scripting-dialect Defines a valid scripting dialect (the section called “Supported Scripting Dialects”) to use for executing the action-script defined for this action. May only be used in conjunction with the action-script attribute. If no specific dialect is specified by this dialect, by default the Groovy scripting language will be used.

ImportAction

The ImportAction provides importing data to a domain type from either another domain type (the section called “Domain type import”) or a xml resource (the section called “XML import”). Following sections describe the different options and modes of importing.

Table 20.12. Attributes of ImportAction

AttributeDescription
from-domain-type-ref Defines the domain type from that the data are imported. If this attribute is specified, the domain type importing is used (see the section called “Domain type import”).
to-domain-type-ref Defines the domain type that is used for storing the data.
import-mode Defines if the import shall either 'replace' or 'update' the data in the to-domain-type. (see the section called “Import Mode”).
from-resource Defines the xml resource from that the data are imported via the script defined in the script attribute. This attribute is only used, when no from-domain-type-ref is specified (see the section called “XML import”).
script Defines the path to the script that implements the importing of the xml data that are defined in from-resource.
scripting-dialect Defines the dialect of the importing script.

Import Mode

The ImportAction provides two import modes 'replace' and 'update'. The default mode is 'update'.

The 'replace' mode deletes all domain objects of the domain type defined in to-domain-type-ref and then imports the data.

The 'update' mode checks first if the importing data set already exists by searching a domain object with the same primary key. If a domain object exists, the domain object will be updated, otherwise a new one will be created.

[Important]Important

When the import mode is 'update' the primary key of the to-domain-type must not be auto generated.

Domain type import

For importing data from another domain type, you have to specify the domain type of the importing domain objects in the from-domain-type-ref. Furthermore a property mapping is required that defines which property value of the from-domain-type is stored in which property of the to-domain-type. The PropertyMappingsModel is defined within a MappingModel. Following an example import is shown:

Example 20.13. ImportAction: import from a domain type

<import import-mode="replace" 
        from-domain-type-ref="domain.location" 
        to-domain-type-ref="domain.import_target" >
    <mapping>
        <property-mappings>
            <property-mapping source-ref="domain.location.guid" 
                              target-ref="domain.import_target.guid"/>
            <property-mapping source-ref="domain.location.code_uni" 
                              target-ref="domain.import_target.code_uni"/>
            <property-mapping source-ref="domain.location.longitude" 
                              target-ref="domain.import_target.longitude"/>
            <property-mapping source-ref="domain.location.latitude" 
                              target-ref="domain.import_target.latitude"/>
            <property-mapping source-ref="domain.location.location" 
                              target-ref="domain.import_target.location"/>
            <property-mapping source-ref="domain.location.zip" 
                              target-ref="domain.import_target.zip"/>
            <property-mapping source-ref="domain.location.country_fk" 
                              target-ref="domain.import_target.country"/>
        </property-mappings>
    </mapping>
</import>

XML import

For importing data from a XML resource, you need to write a script that creates the object from the data. The script attribute defines the path to the import script. In the from-resource you define the XML resource that should be imported. The definition of the ImportAction may look like this:

Example 20.14. ImportAction: import from a XML resource

<import import-mode="replace" 
        from-resource="/actionscripts/groovy/importsearch.xml" 
        script="/actionscripts/groovy/importsearch.groovy" 
        scripting-dialect="groovy" 
        to-domain-type-ref="domain.search"/>

[Note]Note

In OpenSAGA 'groovy' is the default scripting dialect. So when using groovy scripts, it is not necessary to specify the scripting dialect separately.

The import script is necessary for creating and filling the DomainObjects. Therefore the script has access to the XML resource and some other objects. All created DomainObjects have to be stored in the 'result' list, otherwise the objects will not be imported. The table below shows the predefined objects for import scripts. Additionally you have access to all beans that are provided by the ScriptContextInitializationService, see the section called “What to use?”.

Table 20.13. Predefined objects in import scripts

ObjectDescription
dom The XML from-resource as a org.opensaga.runtime.scripting.groovy.GroovyXmlNode object (see the section called “GroovyXmlNode”).
source The XML from-resource as a groovy.util.slurpersupport.GPathResult object.
result An empty list of DomainObjects. The script has to add all DomainObjects to this list that shall be imported. After script execution all objects in this list are stored.

The following scripts shows two different ways how to import data from a xml file like this one:
<?xml version="1.0" encoding="utf-8"?>
<searches>
	<search>
		<query>Test</query>
		<offset>0</offset>
		<count>10</count>
	</search>
	<search>
		<query>Foo</query>
		<offset>100</offset>
		<count>10</count>
	</search>
	<search>
		<query>blub</query>
		<offset>23</offset>
		<count>7</count>
	</search>
	<search>
		<query>Bar</query>
		<offset>50</offset>
		<count>78</count>
	</search>
	<search>
		<query>QWERTZ</query>
		<offset>987</offset>
		<count>123</count>
	</search>
</searches>

Example 20.15. ImportAction: example import script with GPathResult

source.search.each() {
    def search = domaintype.Search.create()
    search.query = it.query
    search.count = Integer.parseInt(it.count.text())
    search.offset1 = Integer.parseInt(it.offset.text())
    result.add(search)
}			

Example 20.16. ImportAction: example import script with GroovyXmlNode

def searchNodes = dom.xpath("searches/search");
for(searchNode in searchNodes) 
{
    def search = domaintype.Search.create()
    search.query = searchNode.query
    search.count = Integer.parseInt(searchNode.count)
    search.offset1 = Integer.parseInt(searchNode.offset)
    result.add(search)
}			

GroovyXmlNode

The org.opensaga.runtime.scripting.groovy.GroovyXmlNode enables easy accessing XML content in groovy scripts. Accessing nodes is enabled via XPath expressions and node context accessing is enabled via property accessing.

Accessing nodes

To access nodes, you have to use the xpath method, which returns a list of GroovyXmlNodes.

Example 20.17. GroovyXmlNode: Accessing nodes

def nodes = groovyXmlNode.xpath("/rootnode/childnode")

Accessing values

To access the text content of child nodes, you treat them like properties:

Example 20.18. GroovyXmlNode: Accessing child node value

groovyXmlNode.childTagName

If there is no child with the given name, the value of the attribute with this name is returned, when it exists. When there is a child element and an attribute with the same name and you want to access the attribute value, you have to write an '@' before the attribute name.

Example 20.19. GroovyXmlNode: Accessing attribute value

groovyXmlNode.@attributeName

To access the node value (org.w3c.dom.Node.getNodeValue()) or text content (org.w3c.dom.Node.getTextContent()) of the current node, you have to use the methods getValue() and getText().

Example 20.20. GroovyXmlNode: Accessing current node value

groovyXmlNode.getValue()
groovyXmlNode.getText()

NewAction

Creates a new cached/target domain object or cached domain object list. If a reference to a cached domain object or list is specified, then the new domain object will be put into the specified scope, otherwise the new domain object is used as target domain object.

Table 20.14. Attributes of NewAction

AttributeDescription
scoped-domain-object-ref Creates a new cached domain object for the given reference (see the section called “Object references”).
scoped-domain-object-list-ref Creates a new cached domain object list for the given reference (see the section called “List references”).

Example 20.21. NewAction: Creating a new target domain object

<new/>

Example 20.22. NewAction: Creating a cached domain object

<new scoped-domain-object-ref="scoped.object"/>

Example 20.23. NewAction: Creating a cached domain object list

<new scoped-domain-object-list-ref="scoped.list" />

RemoveAction

Removes a cached domain object from its scope. The domain object is not deleted in the database.

Table 20.15. Attributes of RemoveAction

AttributeDescription
scoped-domain-object-ref Defines the object that is removed from its scope.

The example shows how to remove a cached domain object from its scope (assuming p_temporary_scoped.bar_temp is a scoped domain object).

Example 20.24. RemoveAction: Remove a cached object from its scope

<remove scoped-domain-object-ref="p_temporary_scoped.bar_temp"/>

RemoveListAction

Removes a cached domain object list from its scope. The domain objects of the list are not deleted in the database.

Table 20.16. Attributes of RemoveListAction

AttributeDescription
scoped-domain-object-list-ref Defines the cached list that is removed from its scope.

The example shows how to remove a cached domain object list from its scope (assuming p_temporary_scoped.bar_temp_list is a scoped domain object list).

Example 20.25. RemoveListAction: Remove a cached list from its scope

<remove-list scoped-domain-object-list-ref="p_temporary_scoped.bar_temp_list"/>

ResetCacheAction

Resets either the cache with the given name or all caches when no name is specified.

Table 20.17. Attributes of ResetCacheAction

AttributeDescription
name Defines the name of the cache that is reseted.
name-ref Defines the reference to a property that contains the name of the cache that is reseted.

The following example shows how to reset all caches.

Example 20.26. ResetCacheAction: Reseting all caches

<reset-cache/>

Sometimes you only want to reset one cache. By defining a name you can specify which cache is reseted. The next example shows how to reset the system.cache.permissions cache.

Example 20.27. ResetCacheAction: Reseting one cache

<reset-cache name="system.cache.permissions" />

ResetTranslationsAction

The action resets all translations. That is necessary when you specify new translations. The new translation are not active until the translations are reseted.

Example 20.28. ResetTranslationsAction: Reseting translation

<reset-translations/>

SendOutgoingEmailsAction

This action sends the outgoing e-mails that are enqueued by the email action (see ???). The action sends the mails either of from a specified mail service or from all mail services.

Table 20.18. Attributes of SendOutgoingEmailsAction

AttributeDescription
mail-service-ref Defines the mail service that is used.

The following example shows how to send the outgoing mails of the mail.service.default mail service.

Example 20.29. SendOutgoingEmailsAction: Sending the outgoing emails

<send-outgoing-emails mail-service-ref="mail.service.default" />

SetActiveNavigationAction

Sets programmatically the active navigation item that is referenced by the navigation-item-ref attribute.

Example 20.30. SetActiveNavigationAction: Sets programmatically the active navigation item

<set-active-navigation navigation-item-ref="navigation.sandbox.a" />

Table 20.19. Attributes of SetActiveNavigationAction

AttributeDescription
navigation-item-ref Defines the navigation item that is highlighted by this action. The navigation item needs a id for referencing it.

The following example shows how to active a special navigation item.

Example 20.31. SetActiveNavigationAction: Active a navigation item programmatically

<set-active-navigation navigation-item-ref="navigation.qs_test.p_navigation_highlight.item.a" />

SetPropertyValueAction

Sets a given property to a new value. Either the property is set in the current domain object or in a set of domain objects related with the current domain object. The following values can be set:

  • Constant value

  • Value from a property

  • Computed value by a property value provider bean

  • Computed value by a script

Table 20.20. Attributes of SetPropertyValueAction

AttributeDescription
property-ref The reference to the property that is set by this action.
property-value A constant value that is set by this action. Only if no source-property-ref is specified, this value will be used.
source-property-ref The reference to a property of the current domain object. The value of this property is set in the property defined by property-ref.
value-property-ref Synonym for source-property-ref
property-value-provider-bean Define a property value provider bean that is used for setting the value.
value-script Defines a script that computes the value to set.
value-script-resource Defines a resource that contains a script that computes the value to set.
value-scripting-dialect Defines the scripting dialect for the script of the value-script or value-script-resource attribute.

Table 20.21. Children of SetPropertyValueAction

ChildDescription
relation-chain-list Defines a list of relation-chains. The value is set in the domain objects of the last relation of every specified relation-chain. If no relation-chain-list is defined, the value is set in the current domain object.

The set property value action can works in the following ways:

  • Setting a constant value

    Example 20.32. SetPropertyValueAction: Setting a constant constant value in the current domain object

    <set-property-value property-ref="domain.a.name" property-value="Test" />

  • Setting the value of a property of the current domain object in a set of related domain objects.

    Example 20.33. SetPropertyValueAction: Setting a value of another property in a set of domain objects

    <set-property-value property-ref="domain.c.name" 
                        source-property-ref="domain.a.name">
        <relation-chain-list>
            <relation-chain>
                <relation-reference relation-ref="portal.domain.a.relation.b" />
                <relation-reference relation-ref="portal.domain.b.relation.c" />
            </relation-chain>
        </relation-chain-list>
    </set-property-value>

  • Setting a value that is computed by a property value provider bean

    Example 20.34. SetPropertyValueAction: Setting a value with a property value provider bean

    <set-property-value property-ref="domain.a.guid" 
                        property-value-provider-bean="guidPropertyValueProvider" />

  • Setting a value that is computed by a script resource. The script file must be in the /extensions/[extensions-name]/actionscripts/[dialect-name]/ folder.

    Example 20.35. SetPropertyValueAction: Setting a value with a property value provider bean

    <set-property-value property-ref="domain.a.guid" 
                        value-script-resource="test.js" 
                        scripting-dialect="javascript" />

    [Note]Note

    Alternative you can define the script directly in the xml file by using the value-script attribute.

TransformAction

Transforms data of the current domain object. The action needs two property references. One for reading the input data and the other for writing the transformed data. The transformation that is performed on the data is defined in a transformer-list (see chapter 'Chapter 26, Transformation' ).

[Warning]Warning

At the moment, there is a problem, when none xml data are transformed. For script and bean condition the data is provided as an org.w3c.dom.Document object. The creation of this object throws an exception, when none xml data is used.

Table 20.22. Attributes of TransformAction

AttributeDescription
source-property-ref Defines the property to read the data from for the transformation.
target-property-ref Defines the property to write the transformed data into.

Example 20.36. TransformAction

<transform source-property-ref="sandbox.transform.attachment" 
           target-property-ref="sandbox.transform.transformed">
  <transformer-list>
      <transformer id="replace.zahl" 
        condition-script="/models/services/web-services/exampleCondition.groovy" 
        transformation-bean="exampleTransformation" />
  </transformer-list>
</transform>

[Note]Note

There is a special behavior when the property type is 'Attachment'. If the source is an attachment, the content of the file will be read from the attachement for transforming. If the target is an attachment, the transformed data will be written into the attachment.

ValidateAction

Validates a given domain object (either the target domain object or a given scoped domain object). The action checks all restrictions that are defined in the domain type of the domain object.

Table 20.23. Attributes of ValidateAction

AttributeDescription
scoped-domain-object-ref Defines the scoped domain object that is validated by this action. If no scoped-domain-object-ref is specified the target domain object will be used. See also the section called “Object references”.

Example 20.37. ValidateAction: Validating the target domain object

<validate/>

Example 20.38. ValidateAction: Validating a scoped domain object

<validate scoped-domain-object-ref="validate.object" />

ValidationErrorAction

Allows to programmatically define validation errors.

[Warning]Warning

Currently this action does not correctly adjust the domain context path if the following state is a back state.

Table 20.24. Attributes of ValidateErrorAction

AttributeDescription
content-element-ref The optional ID of a content element to which the error is attributed. See Chapter 22, Content Elements for details about possible content elements.
text The text tag which represents the translated error text.

Example 20.39. ValidationErrorAction

<validation-error text="GenericError"/>
<validation-error content-element-ref="sandbox.p_view_validation.view.input" text="SpecificError"/>

WebServiceAction

This action calls a web service and stores the result. Because this action is more complicated it is described in a separated chapter. So for more information see Chapter 24, Web Service Clients.

Multi Actions

A multi action provides performing actions on a list of DomainObjects. For each domain object in the list the action will be performed. The list can be either a scoped list or a filtered-list. To reference a scoped list you specify the scoped list id in the attribute list-ref. To use a filtered list the list has to be specified as child tag. If no list is specified the action is only executed one time (as a single action). The domain object that is used by the action is either a scoped domain object that is specified by the object-ref attribute or the target domain object, if none scoped domain object is specified.

Table 20.25. Attributes of all multi actions

AttributeDescription
list-ref References the scoped list for this multi action (see the section called “List references”).
object-ref References the scoped object for this multi action (see the section called “Object references”).

A filtered list is a list of domain object either from the domain object repository or from a scoped list. The list can be manipulated e.g. filtered by a filter-specification or sorted by a sort-order-model. Following tables show the attributes and children of the filtered-list.

Table 20.26. Attributes of filtered-list

AttributeDescription
domain-type-ref The filtered list uses all domain objects of the domain type defined by this attribute that are in the domain object repository, when no scoped-domain-object-list-ref is specified.
scoped-domain-object-list-ref References the scoped list that is used by the filtered list (see the section called “List references”).
max-size Specifies the maximum size of this list. When there are more than max-size domain objects, only the first max-size elements are used. If no max size is specified or max-size is -1, then all elements are used.

Action Results

The following results can be returned by an inidividual action: CONTINUE, HALT, ABORT.

Chapter 21. The Filter Models

Filter Types

The following sections describe some filters available in OpenSAGA:

IsDefinedFilter

The IsDefinedFilter checks if a given value (see the section called “Values”), a cached domain object or a cached domain object list is defined (that it is not null). Therefore either a value (as child) or a scoped domain object reference or a scoped domain object list reference (as attribute) must be defined.

Table 21.1. Attributes of is-defined-filter

Child/AttributeDescription
value (child) A value that is checked if it is defined. Possible values are documented in the section called “Values”.
scoped-domain-object-ref Defines a reference to a scoped object. The filter checks if the referenced object is defined. That means that the reference points to a object and not to null.
scoped-domain-object-list-ref Defines a reference to a scoped object list. The filter checks if the referenced list is defined. That means that the reference points to a list and not to null.

The following example shows how to check that a value of a property is not null. The example check if the property with the id local.name of the current object is not null.

Example 21.1. IsDefinedFilter: Checking a value

<is-defined>
    <property-value property-ref="local.name"/>
</is-defined>		

The next example shows how to check that a cached domain object is not null. The example checks that the cached domain object with the id p_example.obj is not null.

Example 21.2. IsDefinedFilter: Checking a cached domain object

<is-defined scoped-domain-object-ref="p_example.obj"/>

The following example shows how to check that a cached domain object list is not null. The example checks that the cached domain object list with the id p_example.list is not null.

Example 21.3. IsDefinedFilter: Checking a cached domain object list

<is-defined scoped-domain-object-list-ref="p_example.list"/>

IsUndefinedFilter

The IsUndefinedFilter checks if a given value (see the section called “Values”), a cached domain object or a cached domain object list is undefined (that it is null). Therefore either a value (as child) or a scoped domain object reference or a scoped domain object list reference (as attribute) must be defined.

Table 21.2. Attributes of is-undefined-filter

Child/AttributeDescription
value (child) A value that is checked if it is undefined. Possible values are documented in the section called “Values”.
scoped-domain-object-ref Defines a reference to a scoped object. The filter checks if the referenced object is undefined. That means that the reference points to null.
scoped-domain-object-list-ref Defines a reference to a scoped object list. The filter checks if the referenced list is undefined. That means that the reference points to null.

The following example shows how to check that a value of a property is null. The example check if the property with the id local.name of the current object is null.

Example 21.4. IsUndefinedFilter: Checking a value

<is-undefined>
    <property-value property-ref="local.name"/>
</is-undefined>		

The next example shows how to check that a cached domain object is null. The example checks that the cached domain object with the id p_example.obj points to null.

Example 21.5. IsUndefinedFilter: Checking a cached domain object

<is-undefined scoped-domain-object-ref="p_example.obj"/>

The following example shows how to check that a cached domain object list is null. The example checks that the cached domain object list with the id p_example.list points to null.

Example 21.6. IsUndefinedFilter: Checking a cached domain object list

<is-undefined scoped-domain-object-list-ref="p_example.list"/>

IncludeFilter

The IncludeFilter provides the possibility to include a FilterSpecification within another. The resulting filter will be executed in the same way as if you would write the filter directly into the FilterSpecification. This can be very useful, if you use one and the same filter several times or you want to have a common filter that you can extend with some more filter rules.

A FilterSpecification that should be included by other filters has to be defined either in the PortalModel (see the section called “Filter Specification Set”), in a ProcessModel or in a ViewModel within a filter-specification-set.

[Important]Important

The search order for filter specifications is: view, process and portal.

Example 21.7. Defining a filter within a filter specification set

<filter-specification-set>
    <filter-specification id="filter1">
        ...
    </filter-specification>
</filter-specification-set>

The example below shows how you can include the FilterSpecification that is defined above.

Example 21.8. Including a filter from a filter specification set

<filter-specification>
    <include filter-specification-ref="filter1"/>
</filter-specification>

Because the IncludeFilter is like any other Filter, you can use it within other filters like and, or and so on. So you can extend the filter easily.

Example 21.9. Including and extending a filter specification

<filter-specification>
    <and>
        <include filter-specification-ref="filter1"/>
        ...
    </and>
</filter-specification>

Table 21.3. Attributes of the IncludeFilter

AttributeDescription
filter-specification-ref Defines the FilterSpecification that is included by this filter.

HasElementsFilter

The HasElementsFilter checks whether a list has elements. The list can be either a scoped domain object or a loaded list from the database.

Table 21.4. Attributes of HasElementsFilter

AttributeDescription
scoped-domain-object-list-ref Defines a scoped list that is checked by this filter.
domain-type-ref Loads a list of domain objects from the database with the defined domain type. This loaded list is checked by this filter.

Table 21.5. Children of HasElementsFilter

ChildDescription
filter-specification Defines a filter specification that filters the loaded domain objects from the database. Important: This filter specification is only used in combination with the domain-type-ref attribute.

The HasElementsFilter can be used in following ways:

  • To check whether a scoped list has elements.

    Example 21.10. HasElementsFilter: Checking a scoped list

    <has-elements scoped-domain-object-list-ref="my.list" />

  • To check whether a list of loaded domain objects of the given domain type has elements.

    Example 21.11. HasElementsFilter: Checking a scoped list

    <has-elements domain-type-ref="domain.type.model" />

  • To check whether a list of loaded domain objects of the given domain model that satisfy the given filter specification has elements.

    Example 21.12. HasElementsFilter: Checking a scoped list

    <has-elements domain-type-ref="system.domain.user">
      <filter-specification>
        <equals>
          <property-value property-ref="system.domain.user.login" />
          <property-value property-ref="system.domain.proposed_user.login" />
        </equals>
      </filter-specification>
    </has-elements>
    

Values

constant

The following expression defines a constant value:

<constant value="true"/>
Values are logical values (Chapter 7, Defining Logical Values For Properties). The following attributes are supported for constant:

Table 21.6. Attributes of Constant Filter

AttributeDescription
value Defines a logical value.
value-provider-bean Defines a Spring configured bean ID for a bean of Type org.opensaga.runtime.model.domain.properties.PropertyValueProvider which then is reponsible for converting the default-value attribute value to a real value. OpenSAGA also provides some default implementations for specific template based value providers (Chapter 8, Property Value Providers).

Chapter 22. Content Elements

OpenSAGA provides a wide range of content elements that can be used within view definitions. The elements are used as tags. This chapter will deal with the various elements.

Part Tags

The following tags can be used within a part section. There can be declared an ID for each tag. Some tags relate on each other, communicating using these IDs.

Attachment

This tag defines an attachment related content element. E.g. for uploading some binary document.

Example 22.1. Attachment Element

<attachment id="attachment"
            property-ref="domain.test.attachment"
            display-mode="upload"/>

Table 22.1. Attributes of Attachment Content Element

AttributeDescription
id Defines the view related ID. Relation to other content elements is based on this one. This attribute is optional - if not specified an automatic ID will be calculated.
property-ref Specifies the property this element shall be linked to. It must be a valid domain property UID. The property's type must be 'Attachment'.
display-mode Defines the mode of the attachment element. Valid modes are embed, link, edit and upload (see AttachmentDisplayMode for reference).

Checkbox

This tag provides a checkbox ('selected' vs. 'unselected') element.

Example 22.2. Checkbox Element

<checkbox id="positionOrdered" property-ref="domain.position.ordered"/>

Table 22.2. Attributes of CheckBox Content Element

AttributeDescription
id Defines the view related ID. Relation to other content elements is based on this one. This attribute is optional - if not specified an automatic ID will be calculated.
property-ref Specifies the property this element shall be linked to. It must be a valid domain property UID. The property's type must be 'Boolean'. If no value is set, this will be interpreted as 'false'.

Error-Message-List

This tag produces a list of all registered error messages that are not bound to a tag. Only will be rendered if one relevant message is present at least.

Example 22.3. Error-Message-List Element

<error-message-list title-tag="ErrorList"/>

Table 22.3. Attributes of ErrorMessageList Content Element

AttributeDescription
title-tag If rendering (at least one relevant message is present) an additional title tag with the given text key will be produced.

External Link

This tag provides an external link.

Example 22.4. External Link Element

<external-link target="_blank"
               text="An External Link"
               url="http://www.google.com"/>

Table 22.4. Attributes of ExternalLink Content Element

AttributeDescription
id Defines the view related ID. Relation to other content elements is based on this one.
targett Specifies the HTML target attribute.
text Specifies the text key to specify the displayed link text.
url Specifies the link URL.

Label

This tag defines a label for another content element.

Example 22.5. Label Element

<label value="Name" target-ref="personName"/>
<text-field id="personName" property-ref="domain.person.name"/>

Table 22.5. Attributes of Label Content Element

AttributeDescription
id Defines the view related ID. Optional - if not given a default one will be calculated.
value Defines the label text key.
target-ref The related content element's ID.

Multi Connect

This tag defines 'multi-connect' selection UI element. The component contains to lists (selected, not selected) and buttons to move one or more items from one list to the other one. It can be used for assignments. The assignment relation is be defined via a relation chain.

Example 22.6. Multi Connect Element

<multi-connect
    id="users" 
    display-property-ref="system.domain.user.login"
    size="10"
    selected-heading="Assigned Users"
    unselected-heading="Unassigned Users"
    >
    <relation-chain>
        <relation-reference
            relation-ref="domain.project.relation.system.domain.user"/>
    </relation-chain>
</multi-connect>

Table 22.6. Attributes of MultiConnect Content Element

AttributeDescription
id Defines the view related ID. Relation to other content elements is based on this one. This attribute is optional - if not specified an automatic ID will be calculated.
object-relative Decides if this assignment shall be relative to the current domain object that will be used as parent. Valid values are 'true' and 'false'.
display-property-ref Specifies the assignable domain type's property to be used for representation.
size Specifies the number of visible rows (vertical size of the lists).
selected-heading Specifies the title key for the list of selected items.
unselected-heading Specifies the title key for the list of unselected items.

Table 22.7. Sub Elements

ElementDescription
relation-chain Defines the relation related to the realizing assignment.

Password

This tag provides an element for hidden password typing.

Example 22.7. Password Element

<password id="userPassword" property-ref="domain.user.password"/>

Table 22.8. Attributes of Password Content Element

AttributeDescription
id Defines the view related ID. Relation to other content elements is based on this one. This attribute is optional - if not specified an automatic ID will be calculated.
property-ref Specifies the property this element shall be linked to. It must be a valid domain property UID. The property's type must be 'Password' or 'PlainText'.

Rich Text Field

This tag defines an HTML-editor.

Example 22.8. Rich Text Field Element

<rich-text-field id="itemDescription"
                 property-ref="domain.item.description"/>

Table 22.9. Attributes of RichTextField Content Element

AttributeDescription
id Defines the view related ID. Relation to other content elements is based on this one. This attribute is optional - if not specified an automatic ID will be calculated.
property-ref Specifies the property this element shall be linked to. It must be a valid domain property UID. The property's type must be 'RichText'.
rich-text-configuration Specifies the configuration to use. Optional. The requested configuration must have been registered in the richtextConfigurationRepository-bean.

Select Field

This tag defines a drop down list. It can either be based on constant enumeration types or on domain relations.

Example 22.9. Select Field Element (Using an Enumeration Type)

<select-field id="select"
    property-ref="domain.workingstep.timeUnit_id" 
    select-domain-type-ref="domain.enum_timeunit" 
    value-property-ref="domain.enum_timeunit.id"
    display-property-ref="domain.enum_timeunit.unit"
    empty-selection-allowed="false"/>

Table 22.10. Attributes of SelectField Content Element

AttributeDescription
id Defines the view related ID. Relation to other content elements is based on this one. This attribute is optional - if not specified an automatic ID will be calculated.
property-ref Specifies the property this element shall be linked to. It must be a valid domain property UID.
select-domain-type-ref Specifies the domain type of the selectable items.
value-property-ref Specifies the domain type property to be used as logical representation.
display-property-ref Specifies the domain type property to display (textual representation).
empty-selection-allowed Specifies if the user is allowed to select nothing or - otherwise - he is forced to select an entry. Legal values are 'true' and 'false'.

Textarea

This tag defines a multi-line text input element.

Example 22.10. Textarea Element

<textarea id="itemDescription" property-ref="domain.item.description"/>

Table 22.11. Attributes of Textarea Content Element

AttributeDescription
id Defines the view related ID. Relation to other content elements is based on this one. This attribute is optional - if not specified an automatic ID will be calculated.
property-ref Specifies the property this element shall be linked to. It must be a valid domain property UID. The property's type must be 'PlainText'.

Textfield

This tag defines a single line text input element.

Example 22.11. Textfield Element

<text-field id="personName" property-ref="domain.person.name"/>

Table 22.12. Attributes of Textfield Content Element

AttributeDescription
id Defines the view related ID. Relation to other content elements is based on this one.
property-ref Specifies the property this text field shall be linked to. It must be a valid domain property UID. The property's type must be 'PlainText'.

Chapter 23. Web Services

OpenSAGA allows the definition of Web Services to provide access to business processes and data. This chapter decribes how to use the existing Web Services and how to create new ones.

Each web service is configured by a XML file in the directory /models/services/web-services/. Below you can find an example:

Example 23.1. Web service definition

<web-service
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation=
        "http://www.opensaga.org/schema/model/web-service-1.0.xsd"
    id="portal.w_test">

    <web-service-endpoint-reference
        name="Test Web Service"
        endpoint-bean-ref="testWebService"
        url-suffix="holidayService/"
        schema="test-web-service.xsd"
        port-type-name="Holiday"
        wsdl-name="holiday"
        request-document-type="HolidayRequest"
        authentication-type="digest-password"
        />
</web-service>

The web service definition can contain one or more web-service-endpoint-references. A description of all endpoint reference attributes can be found in the table below:

Table 23.1. Attributes of Web Service Definition

AttributeDescription
name The logical web service name.
endpoint-bean-ref Defines a reference to a Spring configured bean ID for a bean of type org.springframework.ws.server.endpoint.PayloadEndpoint.
url-suffix

Defines the URL suffix of the URL that the Web service can be accessed at: http://server/ws/[url-suffix]/

If no URL suffix is specified, the following value is used: [name]service/ where [name] is the normalized web service name [1] converted to lower case.

schema Defines the XML schema file that describes the message format that is accepted by the Web service.
port-type-name Defines the port type name.
wsdl-name

Defines the name of the WSDL file that can be accessed at the URL: http://server/ws/WebService/[wsdl-name].wsdl

If no WSDL name is specified, the normalized web service name is used for [wsdl-name] [1].

request-document-type Defines the request document type (the root element of the accepted document format).
authentication-type Defines the authentication type that the web service requires. The following types are allowed: none, plaintext-password and digest-password.
script Path to script file that implements the web service endpoint class.
validate-request A flag indicating if the request should be validated.
validate-response A flag indicating if the response should be validated.
request-domain-type-ref Domain type that is mapped to the input document.

[1] All illegal characters (i.e. not contained in a-zA-Z0-9) are replaced with an underscore character.


Each web service definition can contain a comment element to describe the web service function. If you want to specify more than one operation for a web service, you can use a web-service-operation-set.

Example 23.2. Web service with multiple operations

<web-service-endpoint-reference
  name="MultiTest"
  schema="multi.xsd"
  <web-service-operation-set>
    <web-service-operation request-document-type="FirstRequest"
                           script="first.groovy"/>
    <web-service-operation request-document-type="SecondRequest"
                           endpoint-bean-ref="secondEndpoint"/>
    <web-service-operation request-document-type="ThirdRequest"
                           request-domain-type-ref="holiday_request"/>
  </web-service-operation-set>
</web-service-endpoint-reference>

Validation rules

Each web-service-endpoint-reference and each web-service-operation-set can contain a validation-rule-set with a set of validation-rules:

Example 23.3. Validation rules

<web-service-endpoint-reference ...>
  <validation-rule-set>
    <validation-rule
      expression="string-length(/HolidayRequest/Employee/lastName) &lt;= 10"
      fault-message="lastName maximum length is 10 characters"/>
    <validation-rule validation-bean="exampleWebServiceValidationBean"/>
  </validation-rule-set>
</web-service-endpoint-reference>

Each validation-rule can either contain a XPath expression and a fault-message or a validation-bean reference. The validation bean has to be declared in the application context and it has to implement the interface org.opensaga.runtime.model.service.webservice.WebServiceValidationBean. If at least one of the validation rules fails, the request is rejected and a corresponding error message is returned.

Transformation

Each web-service-operation-set can contain a transformer-list with a list of transformers. The transformation that are defined in the transformers are performed on the incoming request. The request is transformed after validating the validation rules and before executing the groovy script.

For defining simple and complex transformer-lists see chapter 'Chapter 26, Transformation'.

Example 23.4. Web service endpoint with transformers

<web-service-endpoint-reference
  name="Test"
  schema="test-web-service.xsd">
 
  <web-service-operation-set>
    <web-service-operation request-document-type="" 
                           request-domain-type-ref="sandbox.holiday_request">
      <transformer-list>
        <transformer id="change.name"
            condition="/HolidayRequest/Employee/lastName = 'Mustermann'"
            transformation="/models/services/web-services/testtransformation.xslt"/>
        <transformer id="change.start.date"
            condition="/HolidayRequest/Holiday/endDate = '30.8.2009'"
            transformation="/models/services/web-services/ChangeStartDate.xslt"
            stop-condition-bean="exampleCondition"/>
        <transformer id="change.end.date"
            transformation="/models/services/web-services/ChangeEndDate.xslt">
          <next-transformer transformer-ref="change.start.date"
                            condition="/HolidayRequest/Employee/number = '2'"/>
          <next-transformer transformer-ref="change.name" />
        </transformer>
      </transformer-list>
    </web-service-operation>
  </web-service-operation-set>
</web-service-endpoint-reference>

Groovy Web Services

This section describes the definition of Web Services based on Groovy.

In the web service Groovy scripts you have access to some predefined objects listed in the following table. Additionally you have access to all beans that are provided by the ScriptContextInitializationService, see the section called “What to use?”.

Table 23.2. Predefined Objects for Groovy Web Service Endpoint Scripts

ObjectDescription
input XmlSlurper that provides access to the input XML document
dom GroovyXmlNode that provides access to the DOM of the input XML document.
inputDomainObject If a request-domain-type-ref was specified, the inputDomainObject is an instance of this domain type. All properties are set to the values provided by the input document. If no request-domain-type-ref is specified, the inputDomainObject is not available.
output MarkupBuilder that can be used to return a XML document to the caller of the web service.

Using a groovy script

The following example shows the usage of the web service infrastructure with a Groovy script. All you have to do is to provide a schema file (for input/output document type definitions) and a Groovy script. The purpose of this example web service is to provide a list of all users that are defined in the system. It uses the existing system domain type User (system.domain.user).

Example 23.5. "all users" web service definition

<web-service-endpoint-reference
    name="All Users"
    schema="all-users-web-service.xsd"
    script="AllUsersGroovyWebServiceEndpoint.groovy">
    <comment>
        This web service provides a list of all portal users.
    </comment>
</web-service-endpoint-reference>

Example 23.6. "all users" web service schema

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns:hr="http://www.opensaga.org/schema"
  elementFormDefault="qualified"
  targetNamespace="http://www.opensaga.org/schema">

  <!--  request -->

  <xs:element name="AllUsersRequest"/>

  <!--  response -->

  <xs:element name="AllUsersResponse">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="user" type="hr:UserType"
                    minOccurs="0" maxOccurs="unbounded"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <xs:complexType name="UserType">
    <xs:attribute name="active" type="xs:string" use="required" />
    <xs:attribute name="lastLogin" type="xs:string" use="required" />
    <xs:attribute name="login" type="xs:string" use="required" />
    <xs:attribute name="portalUser" type="xs:boolean" use="required" />
    <xs:attribute name="superUser" type="xs:boolean" use="required" />
  </xs:complexType>

</xs:schema>

Example 23.7. "all users" Groovy script

output.AllUsersResponse(xmlns:'http://www.opensaga.org/schema')
{
    domaintype.User.all().each 
    {
        user(
            login:it.login,
            lastLogin:it.lastLogin,
            active:it.active,
            superUser:it.superUser,
            portalUser:it.portalUser
        )
    }
}

Example 23.8. Example output of the "all users" Groovy script

<AllUsersResponse xmlns="http://www.opensaga.org/schema">
    <user active="true" lastLogin="2009-06-22 11:10:59.281" login="admin"
          portalUser="true" superUser="true"/>
    <user active="true" lastLogin="2009-06-05 16:20:36.203" login="system"
          portalUser="false" superUser="false"/>
</AllUsersResponse>

The next example shows an enhanced version of the "all users" Groovy script. It uses a filter to restrict the result to "portal" users only and sorts them before the output is returned.

Example 23.9. Enhanced "all users" Groovy script

def filter = filterBuilder.specification()
{
  eq()
  {
    propertyref("system.domain.user.portalUser")
    constant("true")
  }
}

def sortOrder = sortOrderBuilder.sortOrder()
{
  propertyref("system.domain.user.lastLogin", desc:"true")
}

output.AllUsersResponse(xmlns:'http://www.opensaga.org/schema')
{
  domaintype.User.findBy(filter, sortOrder).each 
  {
    user(
      login:it.login,
      lastLogin:it.lastLogin,
      active:it.active,
      superUser:it.superUser,
      portalUser:it.portalUser
    )
  }
}

Using the default web service endpoint script

The default web service endpoint script (DefaultWebServiceEndpoint.groovy) stores the input domain object (if it is declared). The default script is used if a request-domain-type-ref is declared, but no script or endpoint-bean-ref are specified. The schema file holiday-web-service.xsd has to contain a "Request" element definition for the input document. Each property of the domain type is automatically mapped to the corresponding tag or attribute by using the property name. E.g. the property with the name firstName is mapped to the tag firstName in the input document.

Example 23.10. Web service definition without script and endpoint bean

<web-service-endpoint-reference
    name="HolidayWebService"
    schema="holiday-web-service.xsd"
    request-domain-type-ref="holiday_request"
    />

Example 23.11. holiday-web-service.xsd

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:hr="http://www.opensaga.org/schema"
    elementFormDefault="qualified"
    targetNamespace="http://www.opensaga.org/schema">

    <xs:element name="HolidayRequest">
        <xs:complexType>
            <xs:all>
                <xs:element name="Holiday" type="hr:HolidayType"/>
                <xs:element name="Employee" type="hr:EmployeeType"/>
            </xs:all>
        </xs:complexType>
    </xs:element>

    <xs:complexType name="HolidayType">
        <xs:sequence>
            <xs:element name="startDate" type="xs:string"/>
            <xs:element name="endDate" type="xs:string"/>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="EmployeeType">
        <xs:sequence>
            <xs:element name="number" type="xs:integer"/>
            <xs:element name="firstName" type="xs:string"/>
            <xs:element name="lastName" type="xs:string"/>
        </xs:sequence>
    </xs:complexType>
</xs:schema>

Example 23.12. Holiday request domain type

<?xml version="1.0" encoding="UTF-8"?>
<domain-type xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:noNamespaceSchemaLocation="http://www.opensaga.org/schema/model/domain-type-1.0.xsd"
  id="holiday_request"
  name="HolidayRequest">

  <property-set>
    <domain-type-property-set>
      <domain-type-property id="holiday_request.id" name="id" type="Long"/>
      <domain-type-property id="holiday_request.startDate" name="startDate"
                            type="Date"/>
      <domain-type-property id="holiday_request.endDate" name="endDate"
                            type="Date"/>
      <domain-type-property id="holiday_request.number" name="number"
                            type="Integer"/>
      <domain-type-property id="holiday_request.firstName" name="firstName"
                            type="PlainText"/>
      <domain-type-property id="holiday_request.lastName" name="lastName"
                            type="PlainText"/>
    </domain-type-property-set>
  </property-set>
  <primary-key>
    <key property-ref="sandbox.holiday_request.id" generated="true"/>
  </primary-key>
</domain-type>

Chapter 24. Web Service Clients

OpenSAGA provides the access to external web services. This chapter describes how to create a client in OpenSAGA for calling such a web service.

There are two different kinds of clients you can create with OpenSAGA. At first a client (DefaultWebServiceClient) that is very easy and does the web service call almost automatically. The second client type (GroovyScriptBasedWebServiceClient) is more flexible and dynamically, but not so simple as the first one.

At the moment the web service clients can only be used as action.

Table 24.1. Web service client action attributes

AttributeDescription
domain-type-ref Domain Type for storing the response data.
wsdl-path Defines the path to the wsdl file.
operation-name Defines the operation that the client executes.
target-tag Defines the tag name that contains the data for one domain object. When the response message contains a list of domain objects, this attribute is required or otherwise no data will be stored.
script-path Path to a groovy script that implements a web service client.

Example 24.1. Abstract Web Service Client Action Definition

<view-state state-ref="...">
    <transition-list>
        <transition id="..." target-state-ref="..." description="...">
            <action-list>
                <webservice domain-type-ref="{domain.type}"
                            wsdl-path="{wsdl.path}" 
                            operation-name="{operation.name}"/> 
            </action-list>
        </transition>
    </transition-list>
</view-state>

DefaultWebServiceClient

The DefaultWebServiceClient provides calling a web service via the wsdl file. It takes the data for the request from a domain type and store the response data in another domain type. Following the use of the DefaultWebServiceClient is explained by an example web service.

Calling a 'ZIP' web service

In the following the use of the DefaultWebServiceClient is described with a web service for looking up locations by the ZIP code. The web service is reachable under http://wetter.t-online.de:80/soap.php. The example shows how to call the 'searchLocationByZIP' Operation.

To create the web service client 4 steps are required:

  1. Making a local copy of the wsdl file

  2. Defining a domain type for the request

  3. Defining a domain type for the response

  4. Configure the web service client as action

The WSDL File

The client needs the wsdl file for generating and sending the request message. At the moment the wsdl is stored local under models/services/web-services/, so that the file does not need to be reload again for each call.

Defining a domain type for the request

For sending the request a domain type is required. How this have to be built depends on the request. So you have to look on the xsl definition in the wsdl file for the request.

<message name="searchLocationByZIPRequest">
    <part name="searchstring" type="xsd:string" />
</message>
As you see, the operation needs only one parameter. A 'searchstring' which contains the zip code. The corresponding domain type looks like this:

Example 24.2. Domain type for web service request

<?xml version="1.0" encoding="UTF-8"?>
<domain-type xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://www.opensaga.org/schema/model/domain-type-1.0.xsd"
    id="domain.zip"
    name="ZIP">
    
    <property-set>
        <domain-type-property-set>
            <domain-type-property id="domain.zip.guid" name="guid" type="Long" />
            <domain-type-property id="domain.zip.searchstring" 
                                  name="searchstring" 
                                  type="PlainText" />
        </domain-type-property-set>
    </property-set>
    <primary-key>
        <key property-ref="domain.zip.guid" generated="true" />
    </primary-key>
</domain-type>

It is important that the property names of the domain type matches the tag names, otherwise the value will not be set in the request. When a case sensitive match does not exist, a property name with the lower case tag name is used when available.

[Important]Important

If the request contains a tag name multiple times, the value is set in all tags with this name.

If the request contains optional parameters, the optional tags will not be written in the request when no value exists for it. When for a required parameter no value exists, an empty tag will be written in the request.

Defining a domain type for the response

To store the response data a domain type is required. Again you have to look at the schema definition in the wsdl file to decide how the domain type is built.

<message name="searchLocationByZIPResponse">
    <part name="result" type="tns:ArrayOfLocation" />
</message>
...
<xsd:complexType name="ArrayOfLocation">
    <xsd:complexContent>
	    <xsd:restriction base="SOAP-ENC:Array">
		    <xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="Location[]" />
        </xsd:restriction>
    </xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="Location">
    <xsd:all>
        <xsd:element name="code_uni" type="xsd:string" />
        <xsd:element name="longitude" type="xsd:float" />
        <xsd:element name="latitude" type="xsd:float" />
        <xsd:element name="location" type="xsd:string" />
        <xsd:element name="location_roman" type="xsd:string" />
        <xsd:element name="zip" type="xsd:string" />
        <xsd:element name="country_fk" type="xsd:string" />
    </xsd:all>
</xsd:complexType>

Expecting that you get only one location for a given zip code, the content of the location tag have to be stored in a domain type. For each property in this domain type the response message is searched for a tag with an equivalent name (first case sensitive, then lower case). The property value will be set to the content of the found tag. When no tag was found, no value is set.

[Caution]Caution

The property tag name matching must be unique, otherwise the value will not be set. So when a tag name appears more than one time, no value is set in the domain object for this property.

Example 24.3. Domain type for web service response

<?xml version="1.0" encoding="UTF-8"?>
<domain-type xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:noNamespaceSchemaLocation="http://www.opensaga.org/schema/model/domain-type-1.0.xsd"
  id="domain.location"
  name="Location"
  deletion-mode="physical">
    
  <property-set>
    <domain-type-property-set>
      <domain-type-property id="domain.location.guid" name="guid" type="Long" />
      <domain-type-property id="domain.location.code_uni" 
                            name="code_uni" type="PlainText" />
      <domain-type-property id="domain.location.longitude" 
                            name="longitude" type="PlainText" />
      <domain-type-property id="domain.location.latitude" 
                            name="latitude" type="PlainText" />
      <domain-type-property id="domain.location.location" 
                            name="location" type="PlainText" />
      <domain-type-property id="domain.location.zip" 
                            name="zip" type="PlainText" />
      <domain-type-property id="domain.location.country_fk" 
                            name="country_fk" type="PlainText" />
    </domain-type-property-set>
  </property-set>
  <primary-key>
    <key property-ref="domain.location.guid" generated="true" />
  </primary-key>
</domain-type>

Defining the web service client as an action

After defining the domain types and storing the wsdl file, you have to define the web service client as action. For this example only the attributes domain-type-ref, wsdl-path and operation-name are necessary. It is important that a domain object of the specified domain type for the request is the current target domain object, when the action is executed. The attribute domain-type-ref specifies the domain type for the response message.

Example 24.4. Web service client action for 'ZIP' Web Service

<transition id="..." target-state-ref="..." description="...">
    <action-list>    		    	
        <webservice domain-type-ref="domain.location" 
                    wsdl-path="/models/services/web-services/wetter.wsdl" 
                    operation-name="searchLocationByZIP"/> 
    </action-list>
</transition>

Response with a list of objects

Often a web service does not only return a single data set, but also a list of data sets. To store these data sets in a list of domain objects the attribute target-tag exists. Following the way of storing such response data is explained by the web service for the search engine 'Bing'. Only the difference to storing a single data set is described here. For creating a complete DefaultWebServiceClient see the section called “Calling a 'ZIP' web service”

The response of the 'Bing' web service may look like this:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<SearchResponse xmlns="http://schemas.microsoft.com/LiveSearch/2008/03/Search">
	<parameters>
		<Version>2.2</Version>
		<Query>
			<SearchTerms>Test</SearchTerms>
		</Query>
		<Web>
			<Total>515000000</Total>
			<Offset>0</Offset>
			<Results>
				<WebResult>
					<Title>Testberichte und Verbraucherinformationen -
						Stiftung Warentest - test ...</Title>
					<Description>Stiftung Warentest Test Themen Shop Abonnement
						Hilfe Wir über uns</Description>
					<Url>http://www.test.de/</Url>
					<DisplayUrl>www.test.de</DisplayUrl>
					<DateTime>2009-08-18T10:31:09Z</DateTime>
				</WebResult>
				<WebResult>
					<Title>Schulranzen - Testbericht - Stiftung Warentest - test.de</Title>
					<Description>Stiftung Warentest Test Themen Shop Abonnement
						Hilfe Wir über uns</Description>
					<Url>
						http://www.test.de/themen/kinder-familie/test/-Schulranzen/1359904/1359904/1359557/
					</Url>
					<DisplayUrl>
						www.test.de/themen/kinder-familie/test/-Schulranzen/1359904/1359904/1359557
					</DisplayUrl>
					<DateTime>2009-08-10T14:58:20Z</DateTime>
				</WebResult>
			</Results>
		</Web>
	</parameters>
</SearchResponse>
The data that should be stored are the search results, the other data are ignored in this example. Each search result is enclosed by a WebResult tag. To store the data it is required to define a domain type for this tag. The domain type may look like this:

Example 24.5. Domain type for 'Bing' response

<?xml version="1.0" encoding="UTF-8"?>
<domain-type xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://www.opensaga.org/schema/model/domain-type-1.0.xsd"
    id="domain.result"
    name="result" deletion-mode="physical">
    
    <property-set>
        <domain-type-property-set>
            <domain-type-property id="domain.result.guid" 
                                  name="guid" type="Long" />
            <domain-type-property id="domain.result.title" 
                                  name="title" type="PlainText" />
            <domain-type-property id="domain.result.description" 
                                  name="description" type="PlainText" />
            <domain-type-property id="domain.result.url" 
                                  name="url" type="PlainText" />
            <domain-type-property id="domain.result.displayurl" 
                                  name="displayurl" type="PlainText" />
            <domain-type-property id="domain.result.datetime" 
                                  name="datetime" type="PlainText" />
        </domain-type-property-set>
    </property-set>
    <primary-key>
        <key property-ref="domain.result.guid" generated="true" />
    </primary-key>
</domain-type>

Defining the web service action is similiar to the action definition of the 'ZIP' web service with the difference that you have to specify the tag name that contains data for one domain object.

Example 24.6. Web service action definition for a list of data sets

<transition-list>
    <transition id="..." target-state-ref="..." description="...">
        <action-list>
            <webservice domain-type-ref="domain.result" 
                        wsdl-path="/models/services/web-services/search.wsdl" 
                        operation-name="Search" 
                        target-tag="WebResult"/> 	
        </action-list>
    </transition>
</transition-list>

The DefaultWebServiceClient creates and stores a new domain object for each tag with the specified name in the target-tag attribute. Even when the tag has no content, a new (empty) domain object is created.

[Caution]Caution

Within the target-tag the property tag name matching must be unique, otherwise the value will not be set. So when a tag name appears more than one time within the target-tag, no value is set in the current domain object for this property.

GroovyScriptBasedWebServiceClient

Sometimes the DefaultWebServiceClient is not flexible enough for some web service calls because the data are only mapped automatically by name. For example you have already a domain type for storing the data and it is not possible to modify the column names, so that the matching works fine or when you want to modify the data before storing. In this cases the GroovyScriptBasedWebServiceClient is used. This client executes a given Groovy script that implements a web service client.

In the web service client Groovy scripts you have access to some predefined objects. Additionally you have access to all beans that are provided by the ScriptContextInitializationService, see the section called “What to use?”.

Table 24.2. Predefined objects in Groovy web service client scripts

ObjectDescription
inputDomainObject Target DomainObject of the current request.
request BufferedMarkupBuilder (a subclass of groovy.xml.MarkupBuilder) for building the xml request.
gateway WebServiceGateway provides sending a request to a web service and receiving the response.
domaintype Provides access to all domain types of the portal by using the name of the domain type. E.g. domaintype.User delivers a GroovyDomainType for the domain type that has the name "User".

Building the request message

To build the XML request OpenSAGA provides the BufferedMarkupBuilder a subclass of groovy.xml.MarkupBuilder. BufferedMarkupBuilder adds a functionality that returns the content of the built XML document as String, which is necessary to send it via the WebServiceGateway. The MarkupBuilder provides building XML document easily. For its description see the groovy documentation.

You can also build the XML request with any library/class you want. It is only important that the request can be cast to one of the following classes, otherwise sending the request via the WebServiceGateway is not possible.

  • org.opensaga.runtime.model.service.webservice.BufferedMarkupBuilder

  • java.lang.String

  • javax.xml.transform.Source

WebServiceGateway

The WebServiceGateWay provides methods to send a web service request message to a given URL and returns the response message as a WebServiceXmlHandler.

Table 24.3. Methods of WebServiceGateWay

Method
send(RequestContext context, BufferedMarkupBuilder request, String url)
send(RequestContext context, BufferedMarkupBuilder request, String url, String soapAction)
send(RequestContext context, String request, String url)
send(RequestContext context, String request, String url, String soapAction)
send(RequestContext context, Source request, String url)
send(RequestContext context, Source request, String url, String soapAction)

All methods delegate the call to send(RequestContext context, Source request, String url, String soapAction). This method sends the request via Spring´s WebServiceGatewaySupport to the specified URL with the soap action (when given). The method returns the response as an instance of WebServiceXmlHandler.

WebServiceXmlHandler

The WebServiceXmlHandler provides functions for easy handling the response message. It provides the following methods.

Table 24.4. Methods of WebServiceXmlHandler

MethodDescription
getXmlDocument() Returns the response message as org.w3c.dom.Node.
getXml() Returns the response message as groovy.util.slurpersupport.GPathResult.
getXmlString() Returns the response message as java.lang.String.
getDomainObject(String domainTypeReference) Creates a DomainObject of the given DomainType and tries to fill the object with data of the response message, if property name and tag name match. A property will only be set if the matching is unique! So when there a two or more tags that match with the same property, it will not be set. The behavior of the method is the same as the behavior of the DefaultWebServiceClient (see the section called “Defining a domain type for the response”).
getDomainObjectList(String domainTypeReference, String tag) Searches for the specified tag in the response and creates for each found tag a new DomainObject of the given DomainType. Then the method tries to fill each object with the data enclosed by the tag. Within the tag the property tag name matching matching is unique or the property will not be set. The method returns a list of the created domain objects. The behavior of the method is the same as the behavior of the DefaultWebServiceClient (see the section called “Response with a list of objects”).

Defining GroovyScriptBasedWebServiceClient as action

For defining the GroovyScriptBasedWebServiceClient only the script-path attribute is necessary.

Example 24.7. Defining GroovyScriptBasedWebServiceClient as action

<transition id="..." target-state-ref="..." description="...">
  <action-list>
    <webservice 
     script-path="/models/services/web-services/SearchGroovyWebServiceClient.groovy"/>
  </action-list>
</transition>

Examples of groovy script clients

The following example shows how to call the 'ZIP' web service with a groovy client instead of the DefaultWebServiceClient (see the section called “Calling a 'ZIP' web service”). The example uses the GPathResult to get the data from the response.

Example 24.8. Groovy web service client for 'ZIP' web service (with GPathResult)

request.searchLocationByZIP() 
{
    searchstring(inputDomainObject.searchstring)
}

def result = gateway.send(requestContext, request, 
                          "http://wetter.t-online.de:80/soap.php");

def xml = result.getXml()
def locationTag = xml.result.item

def location = domaintype.Location.create()
location.code_uni = locationTag.code_uni
location.longitude = locationTag.longitude
location.latitude = locationTag.latitude
location.location = locationTag.location
location.zip = locationTag.zip
location.country_fk = locationTag.country_fk

domaintype.Location.update(location)

How to use the same property tag name matching for the response message as the DefaultWebServiceClient shows the next example.

Example 24.9. Groovy web service client for 'ZIP' web service (with WebServiceXmlHandler)

request.searchLocationByZIP() 
{
    searchstring(inputDomainObject.searchstring)
}

def result = gateway.send(requestContext, request, 
                          "http://wetter.t-online.de:80/soap.php");

def location = result.getDomainObject("domain.location")

domaintype.Location.update(location)

The following example shows how to create a list of DomainObjects from the response message like the DefaultWebService (see the section called “Response with a list of objects”).

Example 24.10. Calling the 'Bing' web service via groovy client

request.SearchRequest
{
	parameters 
	{
		Query(inputDomainObject.query)
		AppId(inputDomainObject.appid)
		
		Sources 
		{
			SourceType(inputDomainObject.sourcetype)
		}
		Web
		{
			Offset(inputDomainObject.offset1)
			Count(inputDomainObject.count)
		}
	}
}

def result = gateway.send(requestContext, request, "http://api.bing.com:80/soap.asmx")

def webResults = result.getDomainObjectList("domain.result", "WebResult")

webResults.each 
{
	it.store(requestContext)
}

The example shows one of the advantages of groovy clients. The DefaultWebServiceClient needs always property tag name matchings. The request of the 'Bing' web service has a 'offset' tag, but it is not possible to create a property with this name because 'offset' is a key word. This is the reason why the DefaultWebServiceClient is not able to set this data in the request. But the groovy client provides setting any data. So it is possible to set the 'offset' data with a groovy client.

Chapter 25. REST Services

OpenSAGA allows the definition of Representational State Transfer (REST) services to provide access to business processes and data. This chapter describes how to create REST services.

Configure REST Services

REST services are configured by XML files in the directory /models/services/rest-services/. Each file represents a RestServicesModel which can contains a set of RestService definitions. See the example below:

Example 25.1. REST Service definition

<?xml version="1.0" encoding="UTF-8"?>
<rest-services
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation=
        "http://www.opensaga.org/schema/model/rest-services-1.0.xsd"
    id="portal.r_test">
    
    <rest-service url="/json" 
                  script="/models/services/rest-services/jsontest.groovy" 
                  scripting-dialect="groovy" />
                  
    <rest-service url="/user/{id}/xml"
                  script="/models/services/rest-services/userxml.groovy"
                  scripting-dialect="groovy" />
                  
    <rest-service url="/user/{id}/json"
                  script="/models/services/rest-services/userjson.groovy"
                  scripting-dialect="groovy" />
    
    <rest-service url="/user/{id}/stream"
                  script="/models/services/rest-services/userstream.groovy"
                  scripting-dialect="groovy" />      
</rest-services>
    			

As you can see, in a rest-services tag all RestServices are defined. Each RestService have 3 attributes. A description of them can be found in the table below.

Table 25.1. Attributes of RestService

AttributeDescription
url Defines the url suffix for this RestService. For more information see the section called “REST Url”.
script Defines the path to the script that implements this RestService. For more information see the section called “REST Service Script”.
scripting-dialect Defines the scripting dialect of the rest service script, e.g. 'groovy'.

To make the rest services available in OpenSAGA, it is necessary to define for each XML file a reference to that RestServices definition in the PortalModel, otherwise it is not possible to call these RestServices.

Example 25.2. Making RestService in OpenSAGA available

<?xml version="1.0" encoding="utf-8"?>
<portal id="portal.sandbox"
    title-tag="Sandbox Title"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://www.opensaga.org/schema/model/portal-1.0.xsd">

    ...
    <rest-services-reference-set>
        <rest-services-reference rest-services-ref="portal.r_test"/>
    </rest-services-reference-set>
    ...
</portal>
    			
    			

As you can see in the example above, you have to define a rest-services-reference-set in the portal model. Within this tag you have to define a rest-services-reference for each XML file, that shall be available. The only attribute of the rest-services-reference tag is rest-services-ref that contains the id of the RestServicesModel.

REST Url

The url suffix of the rest service is defined by the RestServiceModel. The complete url of a rest service in OpenSAGA is http://[server]/app/rest/[url-suffix]. E.g. the server runs on localhost and the defined url suffix is /json, then the url to call this rest service is http://localhost:8080/opensaga-core/app/rest/json.

The REST Url pattern starts with a leading '/' and can have any number of parts (parts a divided by '/'). A possible pattern is e.g. /my/first/rest/service. The parts of this url are 'my', 'first', 'rest' and 'service'.

REST Service Urls can also contain parameters in any part. A parameter starts with a '{' and ends with a '}'. Between the brackets the name of the parameter is specified. A parameter must be always a complete part, e.g. /product/{id}/amount/{amount}. But the following example is not possible: /product{id}/ware{amount}.

When an rest service request is incoming only the rest service with the most specific url that matches the request url is executed. So for example you have following rest urls defined.

  1. /rest/{id}/bar/{bar}
  2. /rest/{foo}/bar/test
  3. /rest/new/bar/{test}
And now these are the incoming request urls:
  • /rest/param1/bar/param2

    The matching is clear, the url matches only the first url pattern.

  • /rest/param1/bar/test

    The url matches the first and the second pattern, but the second pattern is more specific.

  • /rest/new/bar/test

    The url matches all pattern. Again the most specific one is chosen. In this case it is the third url, because the url resolving algorithms matches part after part. As soon as one matching part is not a parameter, all url patterns that have matched until this part must not have a parameter in this part, otherwise they will be ignored. So in this example the first part of every pattern matches. The second part of every pattern matches too, but the third pattern has no parameter in the second part, so every other pattern does not have to have a parameter there. Because the first and the second pattern have a parameter in this part, they will be ignored for the further matching. So only the third pattern matches.

When two or more rest services define the equal url, OpenSAGA throws an exception in the start up process.

[Caution]Caution
Two REST urls are also equal, when only the pattern is the same. So for example /foo/{foo}/bar and /foo/{test}/bar are the same because both have the pattern /foo/[variable]/bar.

REST Service Script

REST Services are implemented by scripts. In the RestServiceModel the path to the script is defined. The script has the following bindings. Additionally you have access to all beans that are provided by the ScriptContextInitializationService, see the section called “What to use?”.

Table 25.2. Bindings of REST Service Scripts

NameDescription
input The input object contains data from the incoming request. For more information see the section called “The input object”.
output With the output object the responses are built. There are different kinds of responses possible for example xml and streams. For more information see the section called “The output object”.
[parameter-name] Every parameter defined in the url can be accessed with its name. So for instance the url pattern is /product/{id}, you can use the paramter like in the following code:
  									log.debug("/product/{id} = /product/" + id)
  								

The follwing script shows an example rest service that returns an xml document.

Example 25.3. Example rest services implementation

def user = [
    "1" : ["Name":"Foo", "Nachname":"Bar"],
    "2" : ["Name":"Blub", "Nachname":"Blubber"],
    "3" : ["Name":"Max", "Nachname":"Moritz"],
]

log.debug("users = " + user);
log.debug("ID = " + id);
log.debug("user[ID] = " + user[id]);


if(id == input.etag) {
    output.noChanges()
    return;
}

if(!user.containsKey(id)) {
    output.send(404)
    return;
}

output.etag = id;
output.xml.user{
    Name(user[id]['Name'])
    Nachname(user[id]['Nachname'])
}

The input object

The input object contains data from the incoming request. It has the following properties.

Table 25.3. Methods of InputObject

NameDescription
method The HTTP method of the incoming request. For example GET or POST.
etag The ETag that is defined in the "If-None-Match" header field.
body The body of the http request.
header A map that contains all header fields of the incoming http request.

The output object

The output object generates the response. There a different kinds of responses possible. Following all properties and methods of the output object are described.

[Important]Important

None of the output object methods terminates the script early. So the script is always executed completely (unless there is a return or something similiar that terminates the execution). The last access to a property or method decides the kind of response. Following example will send the HTTP Code 404 - Not found.

Example 25.4. Output Object Example

output.noChanges()
output.send(404)		

  • output.noChanges()

    This method sends to the client, that there are no changes (HTTP 403 - Not Modified). It should be called when the incoming etag is equal to the etag of the requesting data. The call is equal to output.send(403).

    Following example shows how noChanges() is normally used.

    Example 25.5. RestServiceScriptingOutputObject: noChanges()

    // id is here the etag of the requested data
    if(id == input.etag) {
        output.noChanges()
        return;  // terminates the execution
    } 							

  • output.send(int code)

    This method expects a HTTP Code as parameter and sends this code to the client. Following example sends the HTTP Code 404 - Not found to the client.

    Example 25.6. RestServiceScriptingOutputObject: send(int code)

    output.send(404)

  • output.etag

    The etag property sets the value for the ETag header field. The ETag will be set in the header when the response is either XML, JSON or binary data (send with the binary(stream, mimeType) method).

    Example 25.7. RestServiceScriptingOutputObject: Setting the etag

    output.etag = "MyETagString"

  • output.xml

    The xml property is a org.opensaga.runtime.model.xml.BufferedMarkupBuilder (OpenSAGA own subclass of groovy.xml.MarkupBuilder). For using the MarkupBuilder see the groovy documentation. The REST Service will send the built XML to the client.

    Example 25.8. RestServiceScriptingOutputObject: XML response

    output.xml.Person
    {
        Name("Mustermann")
        Vorname("Max")
        Adresse{
            Strasse("MusterStrasse 2")
            Ort("MusterStadt")
        }
    }							

  • output.json

    The json property is a org.opensaga.runtime.model.service.rest.JSONGroovyBuilder. It is a JSON builder for groovy. For using the JSONGroovyBuilder see the section called “JSONGroovyBuilder”. The REST Service will send the built JSON to the client.

    Example 25.9. RestServiceScriptingOutputObject: XML response

    output.json.Person
    {
        Name("Mustermann")
        Vorname("Max")
        Adresse{
            Strasse("MusterStrasse 2")
            Ort("MusterStadt")
        }
    }							

  • output.binary(stream, mimeType)

    This expected two parameters, the first one is a InputStream and the second parameter is a string that defines the mime type of the InputStream data. This method will send the data of the InputStream to the client and set the mime type as ContentType in the HTTP header. For example you can send content of a file to the client with this method.

    Example 25.10. RestServiceScriptingOutputObject: binary(stream, mimeType)

    def bytes = "<test>StreamContent</test>".getBytes("UTF-8");
    def stream = new ByteArrayInputStream(bytes);
    output.binary(stream, "text/xml")

JSONGroovyBuilder

The org.opensaga.runtime.model.service.rest.JSONGroovyBuilder is a JSON builder for groovy. It makes building JSONs very easy. The syntax is similar to the syntax of the MarkupBuilder.

For creating a single string:string key-value pair you just have to write:

jsonbuilder.Person("Max")
The builder will produce following json output.
{
    "Person":"Max"
}					

For creating a string:object key-value pair with containing string:string pairs you can write the inner key-value pairs into the brackets.

jsonbuilder.Person(firstname:"Max", name:"Testname")
The builder will produce following json output.
{
    "Person":{
        "name":"Testname",
        "firstname":"Max"
    }
}					
With this syntax it is not possible to create inner string:object pairs.

Another way to get the same result is to use curly brackets instead of round brackets. Within curly brackets you can define "string:string" pairs in the syntax you already know: key("value").

jsonbuilder.Person{
    firstname("Max") 
    name("Testname")
}					
With this syntax it is also possible to define inner "string:object" pairs.
jsonbuilder.Person{
    firstname("Max") 
    name("Testname")
    address{
        city("London")
        street("Victoria Street")
    }
}					
This code will produce this json output.
{
    "Person":{
        "address":{
            "street":"Victoria Street",
            "city":"London"
        },
        "name":"Testname",
        "firstname":"Max"
    }
}					

It is also possible to combine both syntax. This is not always recommended, but to complete the documentation the following example shows the use of the combined syntax to produce the same json as above.

jsonbuilder.Person(firstname:"Max", name:"Testname"){
    address{
        city("London")
        street("Victoria Street")
    }
}					

Chapter 26. Transformation

OpenSAGA provides transforming different (input) data for example incoming web service requests. In OpenSAGA there is transformation support for two different data types: xml and string. This chapter describes how to create lists of the different transformers (e.g. for XSLT transformation) that OpenSAGA provides.

Transformers are supported by/can be used as:

Transformer list

Transformers are always defined in a list of transformers. The list have to contain one up to any number of transformers. Each transformer list can contains only transformers for either string data or xml data, but not for both types. So that the transformers get the input data in the right format, it is necessary to define the type as an attribute in the transformer-list.

Example 26.1. Defining a list of transformers for xml data

<transformer-list type="xml">
    <transformer .../>
    <transformer ...>
        ...
    </transformer>
    ...
</transformer-list>

The transformers are executed in the order they are defined.

Table 26.1. Transformer List attributes

AttributeDescription
type Defines the type of the input data. All transformers in this list must support this type otherwise an exception is thrown.

Transformer

A transformer defines a transformation that will be executed on the input data. A transformer can be conditional, this means that the input data must satisfy a condition to perform the transformation on it. A transformer can also have a stop condition that terminates the execution of the current transformation list.

Table 26.2. Transformer attributes

AttributeDescription for xml typeDescription for string type
condition Defines a xpath condition that must be satisfied by the input data to perform the transformation. (For more information see the section called “XPath condition”) The attribute behaves like the condition-script attribute.
condition-bean Defines a bean condition that must be satisfied by the input data to perform the transformation. (For more information see the section called “Bean condition”)
condition-script Defines a script condition that must be satisfied by the input data to perform the transformation. (For more information see the section called “Script condition”)
condition-scripting-dialect Defines the scripting dialect of the condition script. E. g. 'groovy' or 'bsh'.
transformation Defines a XSLT transformation that transforms the input data (For more information see the section called “XSLT transformation”). The attribute behaves like the transformation-script attribute.
transformation-bean Defines a Bean transformation that transforms the input data (For more information see the section called “Bean transformation”).
transformation-script Defines a script transformation that transforms the input data (For more information see the section called “Script transformation”).
transformation-scripting-dialect Defines the scripting dialect of the transformation script. E. g. 'groovy' or 'bsh'.
stop-condition Defines a xpath condition that terminates the execution of the current transformer list, when the condition is satisfied by the input data after transformation (For more information see the section called “XPath stop condition”). The attribute behaves like the stop-condition-script attribute.
stop-condition-bean Defines a bean condition that terminates the execution of the current transformer list, when the condition is satisfied by the input data after transformation (For more information see the section called “Bean stop condition”).
stop-condition-script Defines a script condition that terminates the execution of the current transformer list, when the condition is satisfied by the input data after transformation (For more information see the section called “Script stop condition”).
stop-condition-scripting-dialect Defines the scripting dialect of the stop condition script. E. g. 'groovy' or 'bsh'.

Defining a transformation

A transformer can execute different types of transformation. The following sections describe each of them. Provided transformation are:

  • XSLT transformation (only for the xml type)

  • Bean transformation

  • Scripting transformation

A transformer needs always a transformation definition, otherwise an exception is thrown when executing it.

XSLT transformation

A transformer can perform any XSLT file on the input data for transforming it. The transformer definition for an XSLT transformation looks like this.

Example 26.2. Defining a transformer with xslt transformation

<transformer transformation="/models/services/web-services/ChangeNumber.xslt">

[Important]Important

XSLT transformations are only supported when the type of the transformer list is xml. When it is string you can specify a path to a script like in the transformation-script attribute that will be executed.

Following an example XSLT transformation is shown.

Example 26.3. An example XSLT transformation

<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sch="http://www.opensaga.org/schema">
    
    <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" />
    
    <xsl:template match="node() | @*">
        <xsl:copy>
            <xsl:apply-templates select="node() | @*" />
        </xsl:copy>
    </xsl:template>
	
    <xsl:template match="sch:number">
        <xsl:copy>2</xsl:copy>
    </xsl:template> 
</xsl:stylesheet>

Bean transformation

A transformer can perform a Spring Bean for transforming the input data. The only requirement is that this Bean implements a special interface. For a bean-transformation with xml data it is necessary to implement org.opensaga.runtime.model.xml.transformation.XmlTransformation

package org.opensaga.runtime.model.xml.transformation;

import org.w3c.dom.Document;

public interface XmlTransformation
{
    Document getTransformed(Document orginal);
}
and with string data the org.opensaga.runtime.model.xml.transformation.StringTransformation
package org.opensaga.runtime.model.xml.transformation;

public interface StringTransformation
{
    String getTransformed(String orginal);
}
must be implemented.

The following examples shows an Transformation implementation for replacing all '1' with '9'. The transformation in the example is only for the string type because it only implements the StringTransformation interface.

Example 26.4. Example implementation of StringTransformation

package org.opensaga.runtime.model.xml.transformation;

public class ExampleTransformation
    implements StringTransformation
{

    public String getTransformed(String document)
    {
        return document.replace('1', '9');
    }
}

To use this transformation in a transformer definition it is required to define a Spring Bean for this class.

Example 26.5. Definition of a transformation bean

<bean id="exampleTransformation" 
      class="org.opensaga.runtime.model.xml.transformation.ExampleTransformation" />

The corresponding transformer definition for this transformation bean looks like this:

Example 26.6. Defining a transformer with a transformation bean

<transformer transformation-bean="exampleTransformation" />

Script transformation

A transformer can perform a script for transforming the input data. Provided script dialects (and their attribute value) are

  • Groovy ('groovy')

  • BeanShell ('bsh')

There are some predefined objects available in the scripts.

Table 26.3. Predefined objects in transformation scripts

ObjectDescription for xml typeDescription for string type
input The input data as an org.w3c.dom.Document object. A string that contains the input data to transform.
log A org.apache.log4j.Logger for logging debug messages.

The script gets the input data either as a string or as an org.w3c.dom.Document object as seen above in the table. The script can transform the input data or even replace it complete. The result of the transformation must be returned by the script. When the type is xml the script must return an org.w3c.dom.Document object and when the type is string it must return a String. Following example shows a very easy groovy script for replacing all '0' with '1'.

Example 26.7. Transformation script in groovy

return input.replace('0', '1')

The corresponding transformer definition for this transformation script looks like this:

Example 26.8. Defining a transformer with a transformation script

<transformer id="change.zahl" 
   transformation-script="/models/services/web-services/transformationscript.groovy" 
   transformation-scripting-dialect="groovy" />

[Note]Note

In OpenSAGA 'groovy' is the default scripting dialect. So when using groovy scripts, it is not necessary to specify the scripting dialect separately.

Defining conditional transformer

OpenSAGA provides conditional transformers, this means that the input data must satisfy a condition to perform the transformation on it. There are different types of conditions. Provided condition types are:

  • XPath condition

  • Bean condition

  • Script condition

If a transformer has no condition, it will be always executed.
[Caution]Caution

If the condition is not satisfied, the stop condition will not be executed either.

[Important]Important

If more than one condition type is defined in a transformer, only one condition will be executed. The following list shows the priority of the condition attributes:

  1. condition

  2. condition-bean

  3. condition-script

The following sections describe the different types of condition.

XPath condition

A transformer provides XPath conditions. Any XPath expression can be used for the condition. Only if the expression returns true for the input data, the transformation will be executed.

[Important]Important

XPath conditions are only supported when the type of the transformer list is xml. When it is string you can specify a path to a script like in the condition-script attribute that will be executed.

The XPath expression is directly written into the transformer definition. ('[transformation]' can be any transformation that is described in the previous section)

Example 26.9. Defining a conditional transformer with XPath condition

<transformer condition="/HolidayRequest/Employee/lastName = 'Mustermann'"
             [transformation] />

Bean condition

A transformer can use a Spring Bean as condition. The only requirement is that this Bean implements a special interface. For a condition-bean with xml data it is necessary to implement org.opensaga.runtime.model.xml.transformation.XmlCondition

package org.opensaga.runtime.model.xml.transformation;

import org.w3c.dom.Document;

public interface XmlCondition
{
    boolean isSatisfiedBy(Document object);
}
and with string data the org.opensaga.runtime.model.xml.transformation.StringCondition
package org.opensaga.runtime.model.xml.transformation;

public interface StringCondition
{
    boolean isSatisfiedBy(String object);
}
must be implemented.

The following example shows an Condition that requires a '1' in the input data to be satisfied. The condition in the example is only for the string type because it only implements the StringCondition interface.

Example 26.10. Example implementation of StringCondition

package org.opensaga.runtime.model.xml.transformation;

public class ExampleCondition implements StringCondition
{
    public boolean isSatisfiedBy(String document)
    {
        return document.indexOf("1") != -1;
    }
}

To use this condition in a transformer definition it is required to define a Spring Bean for this class.

Example 26.11. Definition of a condition bean

<bean id="exampleCondition" 
      class="org.opensaga.runtime.model.xml.transformation.ExampleCondition" />

The corresponding transformer definition for this condition bean looks like this:

Example 26.12. Defining a conditional transformer with a condition bean

<transformer condition-bean="exampleCondition"
             [transformation] />

Script condition

A transformer can use a script as condition. Provided script dialects (and their attribute value) are

  • Groovy ('groovy')

  • BeanShell ('bsh')

There are some predefined objects available in the scripts.

Table 26.4. Predefined objects in transformation scripts

ObjectDescription for xml typeDescription for string type
input The input data as an org.w3c.dom.Document object. A string that contains the input data to transform.
log A org.apache.log4j.Logger for logging debug messages.

The script gets the input data either as a string or as an org.w3c.dom.Document object as seen above in the table. It must return whether true when the implemented condition is satisfied or otherwise false. Following example shows a groovy condition which proofs if the input data contains a '2'.

Example 26.13. Condition script in groovy

return input.contains("2")

The corresponding transformer definition for this condition script looks like this:

Example 26.14. Defining a conditional transformer with a script condition

<transformer condition-script="/models/services/web-services/exampleCondition.groovy"
             [transformation] />

[Note]Note

In OpenSAGA 'groovy' is the default scripting dialect. So when using groovy scripts, it is not necessary to specify the scripting dialect separately.

Stop condition

Transformers are always defined in a transformer list. Sometimes the execution of the list should be terminated early. For this cases a stop condition can be used. After performing the current transformation, the stop condition is proofed. If this condition is satisfied, the execution of the current transformer list will be terminated. There are the same stop condition types as there are for the conditional transformers.

  • XPath condition

  • Bean condition

  • Script condition

[Caution]Caution

The stop condition will only be executed, if the transformation of the transformer is also executed. So when it is a conditional transformer the condition must be satisfied, otherwise the stop condition is ignored.

[Important]Important

If more than one stop condition type is defined in a transformer, only one stop condition will be executed. The following list shows the priority of the condition attributes:

  1. condition

  2. condition-bean

  3. condition-script

XPath stop condition

A transformer provides XPath stop conditions that are similar to the XPath condition of conditional transformers. Following only an example is shown. For more information see the section called “XPath condition”.

[Important]Important

XPath stop conditions are only supported when the type of the transformer list is xml. When it is string you can specify a path to a script like in the stop-condition-script attribute that will be executed.

Example 26.15. Defining a transformer with XPath stop condition

<transformer-list>
    <transformer [transformation]
        stop-condition="/HolidayRequest/Employee/lastName = 'Mustermann'" />
    <transformer [transformation] />
    ...
</transformer-list>

Bean stop condition

A transformer can use a Spring Bean as stop condition similar to the bean conditions of conditional transformers. The implementation and bean definition is exactly the same. So only an example for defining the transformer is shown. For more information see the section called “Bean condition”.

Example 26.16. Defining a transformer with a stop condition bean

<transformer-list>
    <transformer [transformation]
        stop-condition-bean="exampleCondition" />
    <transformer [transformation] />
    ...
</transformer-list>

Script stop condition

A transformer can use a script as stop condition similar to the script condition of conditional transformers. The scripts behave exactly the same (same predefined objects, same required return...). Following only an example is shown. For more information see the section called “Script condition”.

Example 26.17. Defining a transformer with a script stop condition

<transformer-list>
    <transformer [transformation]
        stop-condition-script="/models/services/web-services/exampleCondition.groovy" />
    <transformer [transformation] />
    ...
</transformer-list>

Dynamical transformer order

When you have a transformer list like the following one, all transformers are processed in the definition order.

Example 26.18. Transformer list with static execution order

<transformer-list>
    <transformer [transformation] />
    <transformer [condition] [transformation] />
    <transformer [condition] [transformation] [stop-condition] />
    <transformer [transformation] />
    <transformer [transformation] />
</transformer-list>

But often is a linear execution of the transformer list not flexible enough. Sometimes something like a loop or a conditional order is required. Hence it is possible to define a transformer that is executed next, a so-called next-transformer. The following sections describe the use of next-transformer tag.
[Caution]Caution

A next-transformer will only be used, if the transformation is executed. So when a conditional transformer defines next-transformers, the condition must be satisfied.

Following table shows an overview of attributes of the next-transformer tag.

Table 26.5. Attributes of the next-transformer tag

AttributeDescription for xml typeDescription for string type
transformer-ref References the transformer that shall be executed next (see the section called “Next-transformer”).
condition Defines a XPath condition that must be satisfied to use this next-transformer. (see the section called “Conditional next-transformers”). The attribute behaves like the condition-script attribute.
condition-bean Defines a bean condition that must be satisfied to use this next-transformer. (see the section called “Conditional next-transformers”).
condition-script Defines a script condition that must be satisfied to use this next-transformer. (see the section called “Conditional next-transformers”).
condition-scripting-dialect Defines the scripting dialect of the condition script.

Next-transformer

A next-transformer is defined as a child tag of a transformer. The next-transformer point at the transformer that will be executed next. Hence it is necessary to specify ids for transformers to reference them. These ids are used in the transformer-ref attribute to specify a next transformer.

Example 26.19. Transformer list with a simple next-transformer

<transformer-list>
    <transformer [transformation] />
    <transformer [condition] [transformation] />
    <transformer id="foo" [condition] [transformation] [stop-condition] />
    <transformer id="bar" [transformation]>
        <next-transformer transformer-ref="foo"/>
    </transformer>
    <transformer [transformation] />
 </transformer-list>

In the above example the transformers are processed in the order they are defined until 'bar'. After the transformation OpenSAGA jumps to the transformer that is specified in the attribute transformer-ref of the next-transformer tag. So in this example the last transformer in the list will never be executed, because there is an endless loop between 'foo' and 'bar'. The only exit of this loop is the stop-condition of 'foo'.

[Caution]Caution

Be careful using the next-transformer. Endless loops can be created easily without noticing it!

A transformer can have any number of next-transformers, but only one next-transformer will be executed. Then the execution of the transformer-list is continued with the specified transformer. All other next-transformers are ignored. So using more than one next-transformer is only useful with conditional next-transformers.

Example 26.20. Transformer list with multiple next-transformers

<transformer-list>
    <transformer [transformation] />
    <transformer id="foobar" [condition] [transformation] />
    <transformer id="foo" [condition] [transformation] [stop-condition] />
    <transformer id="bar" [transformation]>
        <next-transformer transformer-ref="foo"/>
        <!-- following next-transformers are ignored, see description above -->
        <next-transformer transformer-ref="bar"/> 
        <next-transformer transformer-ref="foobar"/>
    </transformer>
    <transformer [transformation] />
 </transformer-list>

Conditional next-transformers

Sometimes the next transformation depends on the input data. For this case OpenSAGA provides conditional next-transformers. The conditions of all defined next-transformers are proofed in the given order. Once a condition is satisfied, the transformer will be used and the others are ignored. A conditional next-transformer is like a conditional transformer, so for defining conditions see section 'the section called “Defining conditional transformer”'.

Example 26.21. Transformer list with multiple conditional next-transformers

<transformer-list>
   <transformer [transformation] />
   <transformer id="foobar" [condition] [transformation] />
   <transformer id="foo" [condition] [transformation] [stop-condition] />
   <transformer id="bar" [transformation]>
      <next-transformer transformer-ref="foo" 
                        condition-bean="exampleCondition" />
      <next-transformer transformer-ref="bar" 
                        condition="/HolidayRequest/Employee/number = '2'"/> 
      <next-transformer transformer-ref="foobar" [condition] />
   </transformer>
   <transformer [transformation] />
 </transformer-list>

[Note]Note

If no condition is satisfied, the execution of the transformer-list will be continued with the following transformer in the transformer-list

Chapter 27. Encryption

Encryption and decryption of data within OpenSAGA is easy. All you have to do is to define an encryptor (and/or decryptor) bean and use it at the appropriate place.

[Caution]Caution

The following section describes a symmetric encryption. We are absolutely aware that this is only useful for obfuscation of data. You should NOT use this mechanism to encrypt sensitive/important data.

Encryptor/Decryptor Definition

The following encrytor and decryptor beans are defined in the base configuration of OpenSAGA:

Example 27.1. Encryptor and decryptor bean definitions

<bean id="aesEncryptor" class="org.opensaga.runtime.security.AesEncryptor">
    <property name="keyFile" value="WEB-INF/cfg/aes_key.bin"/>
    <property name="algorithm" value="AES"/>
    <property name="transformation" value="AES/CBC/PKCS5Padding"/>
</bean>

<bean id="aesDecryptor" class="org.opensaga.runtime.security.AesDecryptor">
    <property name="keyFile" value="WEB-INF/cfg/aes_key.bin"/>
    <property name="algorithm" value="AES"/>
    <property name="transformation" value="AES/CBC/PKCS5Padding"/>
</bean>

In this configuration, both use the same keyFile, algorithm and transformation. The key file contains a binary key that is used for the en-/decryption. The algorithm parameters specifies the algorithm to use and the transformation specifies the transformation (with more details, e.g. the padding information).

For now OpenSAGA only supports the AES (Advanced Encryption Standard) encryption. If you want to implement your own en-/decryption beans you should take a look at the interfaces org.opensaga.runtime.security.Encryptor and org.opensaga.runtime.security.Decryptor.

To create an encoded password (e.g. for a data-source configuration setting), you can use OpenSSL. The following command encodes the password from the file in.txt. If the password is quincy the result is the string iGro1tWHHIXupoiW57hsIg==.

Example 27.2. Encrypt a password with OpenSSL (on Windows)

openssl aes-128-cbc -base64 -K E8A2EB85CAB3029EA600ACFC9FF58322
 -iv 23F47781194D48E7BA08700910327354 -in in.txt

Example 27.3. Encrypt a password with OpenSSL (on Linux)

echo -n "quincy" | openssl aes-128-cbc -base64 -K E8A2EB85CAB3029EA600ACFC9FF58322
 -iv 23F47781194D48E7BA08700910327354

The first parameter value is the binary data contained in the file "aes_key.bin" and the second parameter value can be found in the org.opensaga.runtime.security.AbstractKeyFileBasedCryptor.

Chapter 28. Mail Services

OpenSAGA allows the definition of mail services to send mail. This chapter decribes how to set them up. The system needs at least one default mail service.

Each mail service is configured in the stages.xml. Below you can find an example:

Example 28.1. Mail service definition

<mail-service-configuration-set
        default-mail-service="mail.service.default">
    <mail-service-configuration
                    id="mail.service.default"
                    type="fileBased" 
                    strategy-bean-ref="standardRetryStrategy">
        <settings>
            <!-- default settings -->
            <setting name="server" value="host.name"/>
            <setting name="username" value="ruth"/>
            <setting name="password" value="secret"/>
            <setting name="maxBatchSize" value="42"/>
            
            <!-- used by standardRetryStrategy -->
            <setting name="retries" value="23"/>
            
            <!-- used by type fileBased -->
            <setting name="directory" value="~/WEB-INF/mailservice/"/>
        </settings>
    </mail-service-configuration>
</mail-service-configuration-set>

Mail service configuration set

A description of the mail service configuration set attributes can be found in the table below:

Table 28.1. Attributes of Mail Service Configuration Set

AttributeDescription
default-mail-service The ID of the default mail service. This service will be used if the email action does not define an other one.

The mail service configuration set definition can contain one or more mail-service-configurations.

Mail service configuration

A description of all mail service configuration attributes can be found in the table below:

Table 28.2. Attributes of Mail Service Configuration

AttributeDescription
id The ID of the mail service.
typeThe type of the mail service. See the section called “How to setup a new type” for a more comprehensive explanation.
strategy-bean-ref Defines a reference to a Spring configured bean ID for a bean of type org.opensaga.runtime.model.service.mailservice.RetryMailServiceSendStrategy. See the section called “How to setup a new strategy” for a more comprehensive explanation.

Each mail service cofiguration definition contains a settings element with setting elements to configure service specific settings. Futher type specific, strategy specific and other can be set here. See the section called “How to setup a new mail service” for a more comprehensive explanation.

Table 28.3. default settings

namevalueDescription
serverip or host (e.g. "host.name")Sets the ip or host name for the mail server. [required]
usernamestring (e.g. ruth)Sets the user name for the mail server. [optional]
passwordstring (e.g. secret)Sets the password for the mail server. [optional]
maxBatchSizeinteger (e.g. 42)Sets the number of maximal mails per send()-call. [required]

Table 28.4. RetryMailServiceSendStrategy settings

namevalueDescription
retriesinteger (e.g. 23)Sets the number of maximal tries to send a mail. If the this count is reached the strategy methode "isLastTry" will return true. [required]

Table 28.5. FileBasedMailService type settings

namevalueDescription
directory~/WEB-INF/mailservice/Sets the path to the directory to store the mail. See Chapter 42, File Path Syntax for a more comprehensive explanation. [required]

How to setup a new mail service

At first you need to define a new mail-service-configuration in the stages.xml.

Example 28.2. new mail service definition

<mail-service-configuration-set
        default-mail-service="newID">
    <mail-service-configuration
                    id="newID"
                    type="someType" 
                    strategy-bean-ref="someStrategy">
        <settings>
            <!-- default settings -->
            <setting name="server" value="host.name"/>
            <setting name="username" value="ruth"/>
            <setting name="password" value="secret"/>
            <setting name="maxBatchSize" value="42"/>
            
            <!-- settings for the strategy -->
            <setting name="someName" value="23"/>
            
            <!-- settings for the type -->
            <setting name="someOtherName" value="~/WEB-INF/someDir/"/>
        </settings>
    </mail-service-configuration>
</mail-service-configuration-set>
                

For more information to the type or strategy attribute see the section called “How to setup a new type” or the section called “How to setup a new strategy” and the section called “Mail service configuration”.

How to setup a new type

A type has to be a Java class implementing org.opensaga.runtime.model.service.mailservice.AbstractMailService. It is defined in 03-pdg-model-configuration-template.xml. See the section called “The mail services config generator” for further information.

How to setup a new strategy

A strategy has to be a Java class implementing org.opensaga.runtime.model.service.mailservice.MailServiceSendStrategy. It is defined in 03-pdg-model-configuration-template.xml as an Spring configured bean.

Example 28.3. new strategy definition

<bean
        id="someStrategy"
        class="fully.qualified.path.to.Class" />
                

The mail services config generator

The mail services config generator is a bean definition to generate the bean definitions for all defined mail services. It is defined in 03-pdg-model-configuration-template.xml.

Example 28.4. mail services config generator definition

<bean id="mailServicesConfigGenerator"
        class="org.opensaga.runtime.model.process.startup.
                                   MailServicesConfigGenerator">
    <property name="mailServicesConfigTemplateName"
        value="templates/cfg/generated-mail-services.ftl"/>
    <property name="generatedMailServicesConfigName"
        value="05-psr-mail-services.xml"/>
    <property name="outputDirectory"
        value="WEB-INF/cfg/generated/"/>
    <property name="resourceManager" ref="resourceManager"/>
    <property name="modelRepository" ref="modelRepository"/>
    <property name="stagingService" ref="stagingService"/>
    <property name="mailServiceClassesMap">
        <map>
            <entry key="someType"
                value="fully.qualified.path.to.Class"/>
        </map>
    </property>
</bean>
                

A description of all properties can be found in the table below:

Table 28.6. Properties

PropertyDescription
mailServicesConfig TemplateNameRelative path to the Free Marker template. Starting from the resource folder. [required]
generatedMail ServicesConfigNameName of the file to generate. [required]
outputDirectoryRelative path to the output directory. Strarting from the WebContent folder. [required]
resourceManagerDefines a reference to a Spring configured bean ID for a bean of type org.opensaga.runtime.OpenSAGAResourceManager.
modelRepositoryDefines a reference to a Spring configured bean ID for a bean of type org.opensaga.core.model.ModelRepository [required]
stagingServiceDefines a reference to a Spring configured bean ID for a bean of type org.opensaga.runtime.model.service.StagingService [required]
mailServiceClassesMapDefines a map of all available mail service types. The key have to be unique. The value is a full qualified Java class name. [required]

Part V. Extension Points

Chapter 29. OpenSAGA Extensions

OpenSAGA can be extended without directly altering the source code of the OpenSAGA base system or its components. This is done by combining so-called extensions into a complete OpenSAGA application. An extension is a set of models and other files in a standardized directory layout. The relative extension trees are then combined by stacking them on top of each other in the defined extension order. (See the section called “Configuring the project extensions for the server” for details).

All extensions are merged into the final resource tree by relative path inside the extension. This can be thought of as a three-dimensional operation like shown in the illustration below. The "base" extension is a special extension that contains all OpenSAGA components, graphics and templates. For more details see Chapter 12, Base Support.

Models and other files that have a unique relative path are just added to the final resource tree. Only when two or more resources exist for the same relative path they are merged according to local merge rules. This can simply mean that the top-most is taken as final resource (grey box / "some.png"). Models are usually merged into one final model based on its type. (green box / "portal.xml"). In the case illustrated above for example, the final portal.xml would include all process and domain type definitions from the "base" extension as well as from "extension 2".

Overview

OpenSAGA provides three essential means of extending or modifying existing application components:

  1. You can overload existing models. See the section called “Model Overloading” for more details.

  2. You can extend existing models. See the section called “Model Extension” for more details.

  3. You can overlay existing models. See the section called “Model Overlays” for more details.

The first two ways are recommended, the third approach should be used sparingly for chirugic modifications to the very inner workings of the system in order to prevent unstable and unreadable code, models and architectures.

Model Overloading

Model overloading means that you define a new model instance with an existing model ID and place it in the directory where models of its type belong. For all models supporting overloading the new model instance will completely replace the existing model instance thus allowing you to provide a new implementation of some fact.

View models are a good example for overloading existing models. For a specific view it is usually very hard to imagine a way by which part of the view can be modified in a safe manner (except by using overlays as indicated in the section called “Model Overlays” to e.g. replace a single button or button behaviour of a complex existing view). Thus the default mechanism for view models (see Chapter 17, The View State) is to be overloaded by more recent view model instances completely relacing the original definition.

the section called “Model Overloading” explains how to use overloading in more detail, the overloading order being the most important detail.

Model Extension

For some models its pretty clear how extensions work, e.g. for domain types. Domain types can be extended by defining new model instances for an existing domain type model ID with new property definitions being contained in the new model instance. The resulting domain type model is a merge of all domain type instances with the same ID resulting in an aggregate with all properties ever defined.

??? explains how to use overloading in more detail.

Model Overlays

Model overlays are the most powerful and the least recommended mechanism to modify existing models. Being a mechanism inspired by the overlay techniques offered by XUL we provide a means to modify existing XML models by grafting XML fragments onto them with various alteration operations being supported.

[Warning]Warning

The overlay feature is quite dangerous in that it can easily compromise a clean architecture and introduce all kind of side effects and hard to discover error sources in the your models. Use them only if all other means have been exhausted.

Model Overloading

Model overloading is used to completely replace existing models (identified by their ID) with a new model definition. Model overloading only works with models that are defined as root elements in XML model files (e.g. processes and views). Model overloading works by first gathering all model instances defined with the same model ID and then using the "latest" instance definition. The "latest" in this context is defined as the model instance defined in the latest (e.g. last) extension configured for your application (see the section called “Configuring the project extensions for the server” for details on how extensions are configured - basically the instance defined in the right-most extension of your configuration wins and overwrites all others).

Model overloading can be done by the following steps:

  1. Identify a model either in base (see Chapter 12, Base Support or one of the extensions configured for your application (see the section called “Configuring the project extensions for the server”).

  2. Note both ID and location of the model in question.

  3. Create a new model instance in the same relative location as noted in the previous step, use the same model type and provide the new instance with the ID you noted in the previous step.

  4. Implement the new model and declare the behaviour you need. That's it. You are done. All the rest of the work will be handled by the OpenSAGA model compiler.

Example 29.1. Example: Overloading a Model

Let us illustrate model overloading with a tiny but relevant example: A typical use case for model overloading is the home view of a new portal. The default home view provided by the base infrastructure is somewhat boring, being defined like this:

                    
<?xml version="1.0" encoding="UTF-8"?>
<view id="p_home.v_home"
    process-ref="portal.p_home"
    title = "Logged In View"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://www.opensaga.org/schema/model/view-1.0.xsd">

    <part-set>
        <part>
            <content>
                <plain-text value="WelcomeYouAreLoggedIn"/>
            </content>
        </part>
    </part-set>
</view>
                    
                
>

The model above defines a model instance with the given ID p_home.v_home and provides a trivial part set for the view that outputs a plain text identified by the value WelcomeYouAreLoggedIn. Once this text has been translated the home page thus will consist of nothing but a bland welcome message - probably not the right way to win over enthusiastic users for your portal.

Instead of damning the OpenSAGA core team for their lack of imagination and premonition regarding your particular project needs you decide to overload this bland home view model instance with a more brilliant implementation of a home view. You note the two important facts you require in order to provide a new implementation:

  1. The model ID is p_home.v_home.

  2. The model is located at the relative path /models/processes/p_home/views/v_home.xml (the absolute path being /WebContent/WEB-INF/resources/base/models/processes/p_home/views/v_home.xml).

In order to implement a new home view you create a new home model under the corresponding location for your particular application extension of the base infrastructure. Let us assume that your extension project is called wonder-project and your extension is therefore also named wonder-project. The new model instance thus needs to be located under /resources/extensions/wonder-project/models/processes/p_home/views/v_home.xml (the file name is arbitrary but we recommend being consistent) and looks like this:

                    
<?xml version="1.0" encoding="UTF-8"?>
<view id="p_home.v_home"
    process-ref="portal.p_home"
    title = "WonderProjectHomeView"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://www.opensaga.org/schema/model/view-1.0.xsd">

    <part-set>
        <part>
            <content>
                <!-- Here goes your wondrous home content... -->
            </content>
        </part>
    </part-set>
</view>
                    
                

And that's it. The OpenSAGA model compiler will correctly overwrite the bland default implementation with your improved home view.


The most common places where overloading is being used are:

Model Overlays

The workings of overlays are explained in the Javadoc documentation for the org.opensaga.core.compiler.overlay.OverlayManager interface. Heed the warnings given in the section called “Model Overlays”

Chapter 30. Implementing New Actions

Implementing new actions is very simple. Just follow these steps:

  • Define an interface extending org.opensaga.core.model.action.ActionModel. By convention the interface should be named after the XML representation of the action. For example if you do want to implement a do-foo action, the interface should be named DoFooActionModel.

    Hint: Technically you must not write an interface of your own. Since you want to be a good programmer, you want to test. In order to test you often want to mock. In order to be able to mock you need an interface. Thus: Write the interface first.

  • Provide an implementation of the model interface. Again by convention the name of the implementation should equal the name of the interface with the additional suffix Impl. Use one of the following base classes for your implementation:

    • org.opensaga.core.model.action.AbstractActionModel if you want to implement the most basic type of action model without extra bells and whistles.

    • org.opensaga.core.model.action.AbstractMultiActionModel if you want to implement an action that can process both single objects and lists of objects (e.g. delete-object).

    • org.opensaga.core.model.action.AbstractScopedDomainObjectListReferencingActionModel if you want to implement an action that works on some kind of cached domain object list.

    The action model requires you to define the name of the action bean that during runtime will process the model. Internal implementations always use the name of the action in camel case spelling, suffixed with Action. For example if you define the action bean name for the do-foo action, it would be doFooAction.

  • Code a class that implements either the org.opensaga.runtime.model.action.Action or base your class on one of the following abstract implementations:

    • org.opensaga.runtime.model.action.AbstractAction if you want to have a basic action that usually will do one thing or

    • org.opensaga.runtime.model.action.AbstractMultiAction if you want to implement an action that can process a list of objects in some way.

    Additionally you can implement BindingAction interface for classes and beans that are meant to be used in conjunction with classes or beans that are called by the execute action. By doing so you can leave out the requires-binding attribute otherwise required and simplify life your users of your action bean.

    Remember to inject any services, repositories or whatever else you need to implement your action. If you extend org.opensaga.runtime.model.action.AbstractAction for your action you can use the following Spring bean definition (OpenSAGA provides an abstract bean definition named abstractActionBean that already resolves all required properties):

    <bean id="doFooAction" class="de.quinscape.samples.opensaga.actions.foo.FooAction" parent="abstractActionBean"/>
    If you extend org.opensaga.runtime.model.action.AbstractMultiAction for your action you can use the following Spring bean definition (OpenSAGA provides an abstract bean definition named abstractMultiActionBean that already resolves all required properties):
    <bean id="doFooMultiAction" class="de.quinscape.samples.opensaga.actions.foo.FooMultiAction" parent="abstractMultiActionBean"/>

  • Configure the action bean in a Spring context of your extension under the name that was used when implementing the model interface.

Chapter 31. Implementing New Filters

To implement a new filter (e.g. the FooFilter) you have to complete the following steps:

  • Implement org.opensaga.core.model.filter.FilterModel to create a FooFilterModel. You can specify filter attributes with the @Attribute annotation (e.g. @Attribute("new-attribute"). If your filter works on one or more child filter models, you have to add the @Child annotation to the appropriate method. Dependent on the type of filter, the abstract base classes org.opensaga.core.model.filter.AbstractFilterModel, org.opensaga.core.model.filter.AbstractComparatorFilterModel and org.opensaga.core.model.filter.AbstractFilterModelListModel are a good base for your own filter.

  • Implement org.opensaga.runtime.model.filter.request.RequestContextFilter to create a FooRequestContextFilter. The abstract base class org.opensaga.runtime.model.filter.request.AbstractFilterModelAwareRequestContextFilter might be helpful.

  • Implement org.opensaga.runtime.model.filter.dao.hibernate.CriterionFilterModelTransformer to create a FilterModelTransformer for the Hibernate Criteria API. The result is a FooCriterionFilterModelTransformer. The abstract base class org.opensaga.runtime.model.filter.dao.hibernate.AbstractComparatorCriterionFilterModelTransformer provides a lot of useful methods and infrastructure objects.

    [Tip]Runtime evaluated filters

    When the FooFilter is only evaluated in the runtime context without information of the persistence layer, it is recommend to use the org.opensaga.runtime.model.filter.dao.hibernate.AbstractRuntimeCriterionFilterModelTransformer. This abstract FilterModelTransformer needs only an instance of the implemented RequesContextFilter (in this case the FooRequestContextFilter).

  • Implement org.opensaga.runtime.model.filter.dao.sql.SQLFilterModelTransformer to create a FilterModelTransformer for SQL. The result is a FooSQLFilterModelTransformer. The abstract base class org.opensaga.runtime.model.filter.dao.sql.AbstractComparatorSQLFilterModelTransformer provides a lot of useful methods and infrastructure objects.

    [Tip]Runtime evaluated filters

    When the FooFilter is only evaluated in the runtime context without information of the persistence layer, it is recommend to use the org.opensaga.runtime.model.filter.dao.sql.AbstractRuntimeSQLFilterModelTransformer. This abstract FilterModelTransformer needs only an instance of the implemented RequesContextFilter (in this case the FooRequestContextFilter).

  • Add the FooFilterModel to the filterModelClasses definition in 02-psm-model-configuration.xml.

  • Add the FooRequestContextFilter to the transformerMap property of the requestTypeMappingFilterModelTransformerRepository definition in 04-pdr-services-configuration-template.xml.

  • Add the FooCriterionFilterModelTransformer to the transformerMap property of the criterionTypeMappingFilterModelTransformerRepository definition in 04-pdr-dao-configuration-template.xml.

  • Add the FooSQLFilterModelTransformer to the transformerMap property of the sqlTypeMappingFilterModelTransformerRepository definition in 04-pdr-dao-configuration-template.xml.

  • Update the XSD schema file filter-specification-1.0.xsd to include a type definition for the FooFilterModel.

Chapter 32. Scripting

When to Script?

Where to Script?

What to use?

OpenSAGA provides a number of predefined objects in each scripting environment. They can be referenced with the following logical names:

  • requestContext holds the request context object for the current request. The request context itself grants access to a vast number of additional services and information sets. Refer to the Javadoc of the RequestContext class for all the details.

  • user holds the current user object.

  • The modelInformationService provides access to a variety of model query functions that allow static model analysis during runtime situations. Refer to the Javadoc of the ModelInformationService class for all the details.

  • The runtimeService provides access to variety of methods and objects that are useful during runtime. Refer to the Javadoc of the RuntimeService class for all the details.

  • The value and property map provides access to all properties referenceable in the current context.

  • The object map provides access to all cached domain objects referenceable in the current context.

  • The list map provides access to all cached domain object lists referenceable in the current context.

  • The domaintype map contains a ScriptingDomainType for each available domain type. Use the name of the domain type (case-sensitive) as a key to access the map.

  • The log object is a org.slf4j.Logger for logging messages. The name of the logger is org.opensaga.runtime.scripting.[file-name-without-extension] when the file is known or otherwise org.opensaga.runtime.scripting.Script.

Supported Scripting Dialects

OpenSAGA supports many different scripting languages. Each language is handled by a specific scripting service. The following sections describe all scripting services that are currently available. You can add your own scripting service, see the section called “Adding More Scripting Languages”.

All scripting services are managed by the ScriptingManager that calls the scripting service for the specified scripting language.

BeanShell Scripting Service

This scripting service is used for BeanShell scripts. Check the BeanShell website for more information.

Groovy Scripting Service

This scripting service is used for Groovy scripts. Check the Groovy website for more information.

The Groovy scripting service provides some special predefined objects. They can be referenced with the following logical names:

Table 32.1. Predefined Objects for Groovy Scripts

ObjectDescription
filterBuilder Builder that provides a FilterSpecificationModel
sortOrderBuilder Builder that provides a SortOrderInfoList

Using function libraries

The groovy scripting service allows the definition of function libraries. I.e. all scripts that are contained in one of the specified directories can call or reference each other, see Example 32.1, “HelloWorld.groovy”. The default directories are: [base/extension]/actionscripts/groovy/, [base/extension]/models/services/rest-services/ and [base/extension]/models/services/web-services/. You can specify additional directories by setting the attribute additionalRootDirectories on the GroovyScriptingService bean definition.

Example 32.1. HelloWorld.groovy

class HelloWorld
{
    void hello()
    {
        println "hello, world"
    }
}

You can create objects of the class HelloWorld by using the following script:

Example 32.2. CallHello.groovy

hw = new HelloWorld()
hw.hello()

Python Scripting Service

This scripting service is used for Python scripts. Check the Python website for more information.

Ruby Scripting Service

This scripting service is used for Ruby scripts. Check the Ruby website for more information.

JavaScript Scripting Service

This scripting service is used for JavaScript scripts.

Scripting Contexts

Adding More Scripting Languages

Just in case you are missing your favoured scripting language, you need to take the following steps to add a new scripting language for your extension:

  1. Implement org.opensaga.runtime.scripting.ScriptingService with a new class of your choice (e.g. FooScriptingService). You will need to provide implementations for a couple of abstract methods explained in the corresponding javadoc. Basically you will be coding four things:

    1. How to identify a given scripting language by a given dialect identifier (e.g. bsh for BeanShell).

    2. How to create a new binding.

    3. How to insert a named object into the binding object.

    4. How to execute a specific script for a given binding and return the result.

    You might want to extend AbstractScriptingervice in order to save some time.

    The following sample code shows the (rather trivial) implementation for BeanShell:

    public class BeanShellScriptingService
        extends AbstractScriptingService<Map<String, Object>>
    {
        private static final Logger log = Logger.getLogger(BeanShellScriptingService.class);
    
        public BeanShellScriptingService()
        {
            super("bsh");
        }
    
        @Override
        protected void bind(Map<String, Object> binding, String name, Object value)
        {
            binding.put(name, value);
        }
    
        @Override
        protected Map<String, Object> createDialectSpecificBinding()
        {
            return new HashMap<String, Object>();
        }
    
        @Override
        protected Object executeInSpecificDialect(RequestContext requestContext, String script, Map<String, Object> binding)
        {
            Interpreter bsh = new Interpreter();
            Object result = null;
            try
            {
                for (Entry<String, Object> entry : binding.entrySet())
                {
                    bsh.set(entry.getKey(), entry.getValue());
                }
                result = bsh.eval(script);
            }
            catch (EvalError e)
            {
                throw ExceptionConverter.runtimeException(e);
            }
            return result;
        }
    }
    Note that we simply decided to use a Map<String, Object> instance to collect all bound values since BeanShell does not provide an extra binding object.

  2. Configure your scripting service instance in a Spring application context of your extension (see the section called “Spring Configuration Extensions”), e.g.

    <bean id="groovyScriptingService" class="org.opensaga.runtime.scripting.groovy.GroovyScriptingService"/>

  3. Optionally you can also make logical value expressions (see Chapter 7, Defining Logical Values For Properties) definable in your new scripting language. To configure this is also very simple. Just define a new bean of type org.opensaga.runtime.scripting.ScriptingServiceBasedPropertyValueProvider in a Spring application context of your extension (see the section called “Spring Configuration Extensions”), e.g.

    <bean id="groovyPropertyValueProvider" class="org.opensaga.runtime.scripting.ScriptingServiceBasedPropertyValueProvider">
    		<property name="scriptingService" ref="groovyScriptingService"/>
    	</bean>
    and you are done. OpenSAGA will auto discover your logical value provider and use it in all places where it is referenced by name (e.g. value-provider-bean="groovyPropertyValueProvider").

  4. That's it. You are done.

Chapter 33. WikiText

OpenSAGA supports using syntaxes (WikiDialects) for formatting text. There are already WikiDialects in OpenSAGA, but also own WikiDialects can be implemented. The following sections describe how to use WikiText and how to implement new WikiDialects.

Supported WikiDialects

The following dialects are supported by the base extensions:

  1. markdown

    OpenSAGA supports the 'Markdown' WikiDialect. For more information about Markdown visit Markdown website.

  2. opensaga-markdown

    The dialect 'opensaga-markdown' is a OpenSAGA own WikiDialect based on 'markdown'. All WikiTags of 'markdown' are available. Furthermore following WikiTags are supported:

    • ImageAttachmentTag

      [alt](attachment:labelid "optionalTitle")

      This WikiTag embeds an image that is stored as attachment into the text. Therefore it is necessary to specify first a domain type in that the image is stored (see the section called “How to use WikiText?”). Then the labelid is used for getting the domain object. The associated image with that domain object will be embedded into the text. The parameters alt and optionalTitle are used for the alt and title attribute of the img HTML tag.

How to use WikiText?

In OpenSAGA there is a special data type (WikiText) for properties containing WikiText. Which dialect is used for formatting the text depends on a property parameter. The WikiDialect can be specified by the parameter with the name "wikiDialect". The following example shows how to define a domain type with a WikiText property.

Example 33.1. Defining a WikiText property with a special WikiDialect

<?xml version="1.0" encoding="UTF-8"?>
<domain-type xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:noNamespaceSchemaLocation="http://www.opensaga.org/schema/model/domain-type-1.0.xsd"
  id="domain.wiki_text"
  name="WikiText">
   
  <property-set>
    <domain-type-property-set>
      <domain-type-property id="domain.wiki_text.guid" 
                            name="guid" type="Long" />
      <domain-type-property id="domain.wiki_text.title" 
                            name="title" type="PlainText" />
      <domain-type-property id="domain.wiki_text.text" 
                            name="text" type="WikiText" length="5000">
        <property-type-parameter-set>
          <property-type-parameter name="wikiDialect" value="opensaga-markdown"/>
       	</property-type-parameter-set>
      </domain-type-property>
    </domain-type-property-set>
  </property-set>
  <primary-key>
    <key property-ref="domain.wiki_text.guid" generated="true" />
  </primary-key>
</domain-type>	        	
				

[Note]Note

If no WikiDialect is specified by a property type parameter, the default WikiDialect (opensaga-markdown, see 2) is used.

To edit WikiText properties normal textfields are used (see the section called “Textfield”). To display the formatted WikiText the wiki-text-property must be used. In the wiki-text-property tag, you can specify additional information for the opensaga-markdown dialect. In the attribute attachment-domain-type-ref you specify which domain type is used by ImageAttachmentTag. The attachment-label-property-ref defines the property which is used for the comparison with the labelid specified by the ImageAttachmentTag. When a domain object with corresponding labelid is found, the attachment in the property specified by attachment-image-property-ref is used.

Implementing new WikiDialects

In OpenSAGA you can implement your own WikiDialects. There are two different ways to define WikiDialect. Either you declare the whole WikiDialect in one class by implementing the WikiDecodingService (see the section called “Implementing a WikiDialects with the WikiDecodingService”) or you define each WikiTag in a WikiTagDecoder and define the WikiDialect by a set of WikiTags in a MultiTagWikiDecodingService (see the section called “Implementing a WikiDialect by a set of WikiTags”).

Implementing a WikiDialects with the WikiDecodingService

A simple way of implementing a WikiDialect is to create a new WikiDecodingService. Therefore you have implement the org.opensaga.runtime.decoding.wiki.WikiDecodingService interface which has two methodes: One specifiy the name of the dialect and the other one convert the WikiText to the formatted text (normally to HTML).

public interface WikiDecodingService
{
    /**
     * Returns the dialect that is used by this service.
     * 
     * @return                          the wiki dialect
     */
    
    String getDialect();

    /**
     * Decodes the given wiki text to html.
     * 
     * @param requestContext            request context
     * @param wikiText                  wiki text to decode
     * @param wikiTextPropertyModel     wiki text property model
     * 
     * @return                          html text
     */
     
    String decode(RequestContext requestContext, 
                  String wikiText, 
                  WikiTextPropertyModel wikiTextPropertyModel);
}    			

Following example shows the implementation of the Markdown WikiDialect.

Example 33.2. Implementing a WikiDecodingService (Markdown WikiDialect)

public class MarkdownWikiDecodingService
    implements WikiDecodingService
{
    /** the markdown processor */
    private MarkdownProcessor markdownProcessor = new MarkdownProcessor();

    public String getDialect()
    {
        return "markdown";
    }
    
    public String decode(RequestContext requestContext, 
                         String wikiText, 
                         WikiTextPropertyModel wikiTextPropertyModel)
    {
        if(StringUtils.hasText(wikiText))
        {
            return markdownProcessor.markdown(wikiText);
        }
        return null;
    }
}					

Now it is necessary to make the new WikiDialect available in OpenSAGA, otherwise you cannot use it. For that you have to define the WikiDialect as Spring Bean.

Example 33.3. Making a WikiDialect available in OpenSAGA by defining a Spring Bean

<bean id="markdownDecodingService" 
      class="org.opensaga.runtime.decoding.wiki.MarkdownWikiDecodingService" />
                    

Implementing a WikiDialect by a set of WikiTags

OpenSAGA supports also a more comfortable and more flexible way of defining WikiDialects. Instead of declaring the whole WikiDialect at once in a single file, it is also possible to declare each WikiTag in his own class and then building a WikiDialect with a set of these WikiTags. This 'MultiTagWikiDialect' way has two advantages:

  • You can easily extend already created MultiTagWikiDialects (but also any other WikiDialect) without changing the existing source code.
  • You can reuse existing WikiTags. For example when you want to create a second WikDialect similar to the first one but with the difference that not all WikiTags shall be available. Then it is not necessary to implement a new WikiDialect, instead you just have to use other configuration for the MultiTagWikiDialect.
Furthermore a MultiTagWikiDialect can be used as Decorater, so you can extend any other WikiDialect in OpenSAGA and make a new WikiDialect based on another. How to do this you can read in the section called “Configure a MultiTagWikiDialect”.

Defining a WikiTag

For defining a WikiTag you have to implement the org.opensaga.runtime.decoding.wiki.WikiTagDecoder interface. It is similar to the WikiDecodingService, but has only one method which shall replace all occurring WikiTags and returns the formatted text.

public interface WikiTagDecoder
{
    /**
     * Decodes the tag defined by this class. Gets the wiki text 
     * and returns the decoded wiki text.
     * 
     * @param requestContext                    the request context
     * @param wikiText                          the wiki text to decode
     * @param wikiTextPropertyModel             the wiki text property model 
     *                                          (containing additional information) 
     * @return                                  the decoded wiki text
     */
    String decodeTag(RequestContext requestContext, 
                     String wikiText, 
                     WikiTextPropertyModel wikiTextPropertyModel);
}					

Often you can easy find the syntax of your WikiTags in the WikiText by regular expression. For that there are an abstract implementation (org.opensaga.runtime.decoding.wiki.AbstractRegexWikiTagDecoder) of the WikiTagDecoder that needs a regular expression and calls a method for each match. This method has to return only the formatted WikiTag. Then the WikiTag will be automatically replaced by the formatted WikiTag.

public abstract class AbstractRegexWikiTagDecoder
    implements WikiTagDecoder
{
    /**
     * Returns the regex pattern.
     * 
     * @return              the regex pattern
     */
    
    protected abstract String getPattern();
    
    
    /**
     * Decodes the tag. This method is called for each match with the pattern 
     * specified by getPattern(). The method gets an array of the matching groups. 
     * The groups are equivalent to the groups of {@link Matcher}.
     * 
     * @param requestContext                    the request context
     * @param groups                            the matched groups
     * @param wikiTextPropertyModel             wiki text property model 
     *                                          (with additional information)
     * 
     * @return                                  the replacement for the match
     */
    
    protected abstract String decodeTag(RequestContext requestContext, 
                                        String[] groups, 
                                        WikiTextPropertyModel wikiTextPropertyModel);
    
    [...]
}					
As seen above you only have to implement the getPattern() method that specify the regular expression and the decodeTag-method. The groups array corresponds to the groups of the java.util.regex.Matcher. So the first group is the whole match and the other groups are parts of the match.

Furthermore there is a special abstract class for linking a resource of OpenSAGA, for example an Attachment or a process. The following pattern is a good syntax for such a tag and is used in this abstract class:

  • [label](prefix:id "optionalTitle")
While prefix is a parameter with have to specified by a subclass, label, id and optionalTitle (which is optional) are variables which can be used for generating the formatted text. For instance the ImageAttachmentTag of the opensaga-markdown dialect uses this class.
public abstract class AbstractLinkingWikiTag
    extends AbstractRegexWikiTagDecoder
{
	[...]
	
    @Override
    protected String getPattern()
    {
        return "\\[(.*?)\\]\\s*?\\(\\s*?"+getPrefix()+":(.*?)\\s*?(?:\"(.*?)\")?\\)";
    }
    
    /**
     * Returns the "prefix" in the regular expression pattern.
     * 
     * @return                  the "prefix" in the regular expression pattern
     */
    protected abstract String getPrefix();
    
    
    /**
     * Decodes the tag. This method is called for each match with the pattern 
     * specified by getPattern(). The method gets the 3 parameters of the 
     * pattern <code>[[label]](prefix:[id] "[optionalTitle]")</code>, but the 
     * last parameter is optional, so it can be <code>null</code>. 
     * 
     * @param requestContext                    the request context
     * @param label                             the label (first parameter)
     * @param id                                the id (second parameter)
     * @param optionalTitle                     the title (the optional third 
     *                                          parameter)
     * @param wikiTextPropertyModel             wiki text property model (with 
     *                                          additional information)
     * 
     * @return                                  the replacement for the match
     */
    
    protected abstract String decodeTag(RequestContext requestContext, 
                                   String label, String id, 
                                   String optionalTitle, 
                                   WikiTextPropertyModel wikiTextPropertyModel);
}					

Configure a MultiTagWikiDialect

To create a WikiDialect with WikiTags a new Spring Bean of org.opensaga.runtime.decoding.wiki.MultiTagWikiDecodingService has to be configured.

Example 33.4. Configure a MultiTagWikiDialect

<bean id="openSAGAMarkdownDecodingService" 
  class="org.opensaga.runtime.decoding.wiki.MultiTagWikiDecodingService">
  <property name="wikiTagDecoders">
    <list>
      <bean class="org.opensaga.runtime.decoding.wiki.ImageAttachmentWikiTagDecoder">
        <property name="attachmentRepository" ref="attachmentRepository" />
      </bean>
    </list>
  </property>
  <property name="dialectName" value="opensaga" />
  <property name="dialectNameAsPrefix" value="true" />
  <property name="decoratedWikiDecodingService" ref="markdownDecodingService" />
</bean>					

Table 33.1. Properties of MultiTagWikiDecodingService

NameDescription
wikiTagDecoders A list of all WikiTags that will be used for this WikiDialect.
dialectName Defines the dialect name of this WikiDialect.
dialectNameAsPrefix Defines whether the dialect name specified by the dialectName property is only a prefix (true) or the whole name(false). If it is a prefix, the dialect name will be "[dialectName]-[name of the decorated WikiDialect]". So this property have only influence, when decoratedWikiDecodingService is set. The default value is true.
decoratedWikiDecodingService Defines a WikiDialect that shall be decorated by this WikiDialect. After decoding all defined WikiTags by wikiTagDecoders the WikiDecodingService delegates to the defined decorated WikiDecodingService.

Chapter 34. Strategy Interfaces

Chapter 35. Implementing New Data Sources

Internal data source types for OpenSAGA always lie beneath the package org.opensaga.runtime.model.domain.datasources.extensions. Just introduce a new appropriate sub package. External data source types can be defined according to your own project guidelines and simply need to be configured as described below.

To implement a new data source (e.g. the FooDataSource) you have to complete the following steps:

  • Implement org.opensaga.runtime.model.domain.datasources.DataSourceType to create a FooDataSourceType. The abstract base class org.opensaga.runtime.model.domain.datasources.AbstractDataSourceType might be useful. To important things need be remembered when extending the abstract base class:

    1. The root ID necessary must be globally unique and it must be a legal XML ID.

    2. Your data source type must be virtual if it is not represented by physical database tables in the local portal database (e.g. whenever you bypass the standard Hibernate based ORM).

  • Create a new FooDataSourceBeanDefinitionParser based on one of the abstract base classes: org.opensaga.runtime.model.domain.datasources.AbstractDomainObjectFactoryBeanDefinitionParser (if you want to provude your own domain object factory), org.opensaga.runtime.model.domain.datasources.AbstractMapBasedDomainObjectFactoryBeanDefinitionParser (if you only want to provide a data handler and otherwise are willing to rely on a MapBasedDomainObjectFactory) or org.opensaga.runtime.model.domain.datasourcees.AbstractDataHandlerBasedDataSourceBeanDefinitionParser (if you want to do everything yourself).

  • Implement a new org.opensaga.runtime.model.domain.service.DataHandler to create the FooDataHandler. The abstract base classes org.opensaga.runtime.model.domain.virtual.AbstractBeanBasedDomainObjectDataHandler or org.opensaga.runtime.model.domain.virtual.AbstractMapBasedDomainObjectDataHandler can be used.

  • Register the FooDataSourceBeanDefinitionParser in the org.opensaga.runtime.model.domain.datasources.extensions.modelbased.ModelBasedDataSourcesNamespaceHandler.

See the section called “Data Source Types” for a description on how to use the new FooDataSource.

Chapter 36. Building Your Own Extensions

Extension Packaging

OpenSAGA supports two kinds of extensions:

  • Extension projects implement some kind of solution by extending the OpenSAGA base, adding one or more supporting extensions according to the merge rules as specified in ??? and providing solution specific models in the web project itself.

    Extension projects must be deployed as normal WAR archives to any servlet container supported by OpenSAGA.

  • Extension modules that usually will not stand on its own but rather can be used as packaged extensions in action projects like the one described above. Such extension modules also should be developed like a normal web projects according to the rules specified above but then require a different packaging.

These two extension types are described in more detail in the next sections.

Extension Projects

Extensions must be packaged as a WAR archive.

Extension Modules

Extensions must be packaged as a JAR archive if you want to include them in another web project.

Naming Conventions

Extension Directory Layout

Extensions can contain models, spring configurations and JAR archives which all are added to the runtime system. This section explains where to place these individual artifacts in the extension directory layout.

Spring Configuration Extensions

Spring configurations can be placed in any directory directly beneath the extension root. Configurations can either be extensions to a specific startup phase or be handled like interceptors in that they are loaded before or after a given phase.

The following file patterns are valid for Spring configurations (the patterns use the Ant wildcard syntax) and will be instantiated in the phases alluded to by the names:

  1. **/01-psk-*.xml

  2. **/01-after-psk-*.xml

  3. **/02-before-psm-*.xml

  4. **/02-psm-*.xml

  5. **/02-after-psm-*.xml

  6. **/03-before-pdg-*.xml

  7. **/03-pdg-*.xml

  8. **/03-after-pdg-*.xml

  9. **/04-before-pdr-*.xml

  10. **/04-pdr-*.xml

  11. **/04-after-pdr-*.xml

  12. **/05-before-psr-*.xml

  13. **/05-psr-*.xml

  14. **/05-after-psr-*.xml

Each pattern applies to a separate and distinct initialization phase. OpenSAGA itself does not use any of the *-before-* or *-after-* phase configurations.

Chapter 37. Creating new models

OpenSAGA XML Compiler

So far we've seen the model mostly as XML files in extensions. But of course there is a runtime aspect to the model, too. The OpenSAGA XML Compiler reads all the model XML files and transforms them into a graph of java object instances.

This process is controlled by some basic interfaces and annotations.

Model Interfaces

Table 37.1. OpenSAGA Model Interfaces for extension

Class NameDescription
org.opensaga.core.model.Model

Interface implemented by all OpenSAGA models. Each model has an id, can take abritrary attributes (beyond those defined in the XML schema) and a textual description.

org.opensaga.core.model.view.content.ContentElementModel

Interface implemented by all UI elements within a view. Extends model to

Extension authors can also extend org.opensaga.core.model.view.content.AbstractContentElementModel or org.opensaga.core.model.view.content.AbstractContentElementWithChildrenModel.

org.opensaga.core.model.action.ActionModel

Interface implemented by all action models.


Annotations

The process of turning XML elements into Java classes is controlled by annotations defined in the org.opensaga.core.compiler.annotation

@Tag

Marks the class as tag class.

Annotation elements

value

Name or pipe ( |) separated list of tag names to use for this class.

specialization

If set to true, the tag cannot be used as a general substitute for its super classes unless explicitly requested in a reference.

@Attribute

Marks a setter method or a method of the format void methodName(String name, String value) as attribute method. If the method has 2 parameters, the method can receive any kind of attribute with the name being the first parameter and the value being the second parameter.

Annotation elements

value

Name of the attribute. If not set, the name will be taken from the property name of the setter method.

required

If set to true, the the attribute is required.

@Child

Marks a setter method or adder method as child method. Child methods enable specification of possible tags nested inside the tag class. The parameter type of the method must be either another tag class or String

Annotation elements

minOccurs

Minimum number of times the child must occur (default: no minimum).

maxOccurs

Maximum number of times the child must occur (default: no maximum).

@Parent

Marks a setter method as parent method. The parameter type of the setter method will be the parent type. For each parent method declared, the method will be fed the next parent of that type.

@Name

String setter marked with this annotation will be called with the actual name of the tag instance for tags with multiple possible names.

@IdReference

Can be used to mark an attribute method as id reference method. By convention, the name of such an attribute method should end in "-ref"

Annotation elements

value

Target type of this id reference.

required

if set to true, the configured org.opensaga.core.compiler.IdReferenceResolvingStrategy configured for the tag factory will be used to resolve local unqualified id references (Ids that do not contain . or -). See XML Compiler Configuration

@GenerateId

Can be used to mark an attribute method as id generation method. This method is called with an value generated by the configured org.opensaga.core.compiler.IdGenerationStrategy.

@Trait

Marks a getter method as trait method delivering a tag trait. Traits can be used to group common sets of attributes, behaviour and state into their own class. The attributes, childs and parent method of a trait are added to the parent tag class as if they belong to that class. The trait method must return an instance of the trait, it is an error for it to return null.

@AttributeDocs

Can be used to document dynamic/abritrary attributes on a tag class.

Annotation elements

value

An array of @AttributeDoc annotations for that class.

@AttributeDoc

Documents one dynamic attribute.

Annotation elements

name

Name of the attribute.

description

Description of the attribute.

required

If set to true, this attribute is required.

type

Java type of the attribute.

@FormBeanNamingContainer

Marks a container content element model as creating a new entry on the stack of formbean variable names. Only the top name is accessible by the child content element models.

Annotation elements

value

Name of the variable for this content element model

XML Compiler Configuration

The XML compilers (one for every type of model XML) are registered in the modelCompilerRepository bean in the 02-psm-model-configuration.xml.

<bean id="modelCompilerRepository" class="org.opensaga.core.compiler.model.MappedModelCompilerRepository">
  <property name="compilers">
    <map><entry key="org.opensaga.core.model.view.ViewModel">
        <bean parent="abstractCompiler">
          <property name="tagFactory">
            <bean parent="abstractTagFactory">
              <property name="tagPackages">
                <set>
                  <value>org.opensaga.core.model.view</value>
                  <value>org.opensaga.core.model.view.content.*</value>
                  <value>org.opensaga.core.model.view.paging</value>                              
                  <value>org.opensaga.core.model.value</value>
                  <value>org.opensaga.core.model.filter</value>
                  <value>org.opensaga.core.model.domain.relation.reference</value>
                  <value>org.opensaga.core.model.process.phase</value>
                  <value>org.opensaga.core.model.action</value>
                  <value>org.opensaga.core.model.xml.transformation</value>
                  <value>org.opensaga.core.model.restrictions</value>
                  <value>org.opensaga.core.model.uicomponent</value>
                </set>
              </property>
            </bean>
          </property>
        </bean>
      </entry></map>
  </property>
</bean>

For every document type, such an tag factory entry extending the abstract spring bean defintion abstractTagFactory is defined. The entry maps the Java document root type to a list of packages that is scanned for tag classes.

If the package specification ends with a * , the package and all its sub-packages are scanned for tag classes, otherwise only the package itself is scanned.

To avoid conflicts it is generally wise to create your own sub package for the company and/or project you are working on.

Creating new UI Elements

Creating new UI Elements (ContentElementModels in OpenSAGA lingo) requires you to create an annotated Model class that defines the tag of the element and its attributes and children et cetera inside the model XML files. You also have to create a model template which is a freemarker template that renders the JSF code for the element.

Creating a new Model class

First you have to create a new class implementing org.opensaga.core.model.view.content.ContentElementModel. This is most easily done by extending one of the abstract base classes available -- which you need to extend depends on the type of UI element you need.

Abstract types in org.opensaga.core.model.view.content

AbstractContentElementModel

Content element model without any data-binding or children.

AbstractContentElementWithChildrenModel

Content element model without any data-binding but with children.

AbstractPropertyReadingModel

Content element model with read-only property access.

AbstractPropertyReadingModel

Content element model that reads data from and writes data to a property

Your tag class needs to be in one of the packages scanned by the view model tag factory, which is most easily done by adding it to project and/or company specific packages below org.opensaga.core.model.view.content.

Creating the model template

In addition to your model class you need to create a component template. This is a freemarker template that creates the JSF code for your component.

The component template must be added to an extension. The resource name of this component template is built by adding the simple name of your class (full class name without package) without the Model suffix to the template base path /templates/view-faces/. For example if you have the class org.opensaga.core.model.view.content.TextFieldModel, the corresponding component template is at /templates/view-faces/TextField.ftl, for the class org.opensaga.core.model.view.content.mycompany.myproject.MyFooModel, the corresponding component template is at /templates/view-faces/MyFoo.ftl, etc.

The templates transform the models and their sub models into JSF code that fits into the special OpenSAGA JSF Component world. OpenSAGA defines a set of template macros and functions that can help you with this.

Component Template Example

Let's take a look at Grid.ftl to see how a simple component template looks like:

<@meta.style name="widget/grid.css,widget/grid-ext.css"/>
<@meta.component>
<table ${p.id()}${p.classes("grid")}${p.dynAttrs()}>
@@BODY@@
</table>
</@meta.component>

This component template creates a layout table out of a org.opensaga.core.model.view.content.GridModel

OpenSAGA Template Macros and functions

The macros and templates listed here are defined in the resources /templates/view-faces/opensaga-common.ftl and /templates/view-faces/opensaga-meta.ftl. These two files are configured as freemarker auto imports in the bean viewRenderer in 05-psr-view-configuration.xml.

p.id()

Returns an id attribute with the properly escaped id of the current model.

[Caution]Caution

While this is the correct way to create a model attribute in most cases, i.e. where the id of a JSF tag is generated, in case you are generating an id of an HTML tag that is supposed to be in the OpenSAGA id space for script related reasons, you need to use the following construct

 id="${p.clientId(model.id)}"
because a normal HTML tag will not be subject to extension of its (escaped) model id through a JSF naming container.

p.classes(value="",attribute="class")

Returns a class attribute containing the combined classes of the value parameter and the classes given in the current model. The name of the attribute is "class" by default and can be changed to "styleClass" where it should generate a JSF class attribute.

p.attribute(name,value)

Returns the attribute with the given name and the given value if the value is not null, nothing otherwise.

p.i18n(key)

Returns JSF expression evaluating to the internationalized value for the given key. The key must not be null.

p.i18nNullSafe(key)

Returns JSF expression evaluating to the internationalized value for the given key, but only if the key is not null.

p.jsfExpr(expr)

renders the given JSF expression in a properly escaped way to avoid it being evaluated as freemarker expression.

p.jsfId(id)

escapes the given model id to be a valid JSF id. All invalid characters are transformed into an underline followed by 4 hex characters defining the unicode character. Underlines themselves are converted into two underlines.

p.client(id)

Returns the JSF client id for the given model id.

[Caution]Caution

So far, these method only works correctly for models that are a first level child of the form.

p.url(url)

Converts the given servlet context relative URL into a server relative URL.

p.resourceUrl(resource)

Returns the resource controller URL for the given resource.

p.classes(classes, attr = "class" )

Returns a class attribute declaration that is a mix of the classes being given as first argument and the classes set on the model. The name of the class attribute being generated can be given as second argument. you need to use "class" for HTML tags and "styleClass" for JSF tags.

p.attribute(name, value )

Returns a attribute declaration for the first argument if the second argument is not null.

p.i18n(key)

Returns a JSF expression returning the translated key. the key cannot be null.

p.i18nNullSafe(key)

Returns a JSF expression returning the translated key. the key might be null in which case an empty string is returned.

p.propertyValue()

Returns a JSF expression returning the domain object property value referenced by the current model. Only works for instances of org.opensaga.core.​model.view.content.​PropertyReadingModel and org.opensaga.core.​model.view.content.​PropertyWritingModel

p.referenceList()

Returns a JSF expression returning the value stored for the current list reading model in the form list bean.

p.propertyValueBeanName()

Returns a JSF expression returning bean name of the current form bean.

p.referenceListBeanName()

Returns a JSF expression returning bean name of the current form list bean.

p.dynAttrs()

Returns attribute declarations for all dynamic attributes of the model.

p.disabledOnWriteMode()

Returns a "disabled" attribute declaration whose value is based on the current writing model's filter-specifications.

p.deco(o)

Returns a JSON representation of the given value as escaped class-based decoration. This method hides JSON meta data as element class starting with "deco:", directly followed by a JSON string whose spaces have been replaced by underlines and whose underlines have been replaced by two underlines.

p.style(id,style)

Returns the CSS style given as optional second argument with the styles registered for the model with the given id in the org.opensaga.runtime.model.view.style.ContentElementStyleService>.

<@p.command /> Macro

Macro to generate a OpenSAGA command which is a button or a "link" (button converted into a link by script) that supports all features such as AJAX reloading etc.

@p.command Attribute

id

the unescaped model id to use for this button

cls

classes to set on the command

button

true if it's a button, false if its a "link".

button

true if it's a button, false if its a "link".

transition

OpenSAGA transition to invoke from this command.

txt

Internationalized text on the button / link.

icon

Icon for the button / link

action

Webflow transition id to execute. Normally this will be the id corresponding to the transition model given with the transition parameter. For component events this can be a declared component event name and the id of the component event source model, separated by a ":". In that case no transition attribute should be given.

description

Internationalized desription set as title for this button.

disabled

Directly defines the disabled attribute of this command for component event buttons that are not bound to a transition and are therefore not bound to the disabling policy.

disablingPolicy

Defines the rights based disabling policy used for this button. Must be a valid enum name of org.opensaga.core.model.view.content.CommandDisablingPolicy.

OpenSAGA JSF Components

In addition to normal JSF components, OpenSAGA defines a set of components and functions that bridge the component world of JSF and the model world of OpenSAGA. They are defined in facelets taglibrary /WEB-INF/facelets-taglibs/opensaga.taglib.xml and consist of components in the package org.opensaga.runtime.controller.faces.component and functions in org.opensaga.util.OpenSAGAFacesELFunctions und are included in OpenSAGA JSF documents with the namespace "opensaga"

os:commandLink

OpenSAGA command link component. Offers all the special OpenSAGA integration including AJAX reloads etc. Should be used instead of <h:commandLink>, except for links to external URLs.

os:commandButton

OpenSAGA command button component. Offers all the special OpenSAGA integration including AJAX reloads etc. Should be used instead of <h:commandButton>.

os:ieConditionalComment

Renders a conditional comment for Internet Explorer.

os:includeJavascript

Include script dependencies. The dependencies are usually not included on their own but merged into bundles, which is done automatically. The resource paths to include are given as body of this component, separated by white-space.

os:includeCSS

Include CSS dependencies. The dependencies are usually not included on their own but merged into bundles, which is done automatically. The resource paths to include are given as body of this component, separated by white-space.

os:navigation

Renders a navigation tree based on a nested structure of org.opensaga.runtime.model.navigation.NavigationNode created by the navigation service based on the navigation models and the user's rights.

Attribute

styleClass

classes for this component

navigationId

Id of the root navigation model for this navigation

maxDepth

Limits the depth of the displayed navigation.

startAtSelectedDepth

Starts rendering at a selected, greater than zero depth. In combination with maxDepth this can be used to split navigation into multiple parts depthwise, i.e. to only render the top navigation items at one location and only render the sub navigation points of the navigation node selected in the first navigation at the location of the second navigation.

reverse

if true, display navigation child nodes in opposite order

os:domainContextPath

Renders the current domain context path.

os:pagin

Renders a row of paging buttons.

Attribute

modelId

Id of the paging model to render.

os:sortArrow

Renders the little up or down arrow icon for a data grid header

Attribute

propertyId

Id of the property this component is representing. only if the datagrid is really sorted by this property, an icon will be displayed..

dataGridModelId

data grid model id

upIcon

Icon for descending sort order

downIcon

Icon for ascending sort order.

os:attachment

Renders an attachment.

Attribute

attachmentId

Id of the attachment.

maxWidth

Maximum width for the embedded attachment.

maxHeight

Maximum height for the embedded attachment.

embed

If true, try to embed the attachment (if the media type allows that), otherwise just link to it..

os:iterator

Renders an iterator.

Attribute

var

Sets the variable name to receive the value for each repitition.

value

Sets the SerializableListDataModel wrapped list of domain objects to display in this iterator.

styleClass

HTML classes

os:facet

OpenSAGA specific facet component meant to be used with the OpenSAGA datagrid. In contrast to normal facet component can contain other components as child. This however is only supported in combination of the OpenSAGA data grid.

Attribute

name

Facet name.

styleClass

HTML classes for this facet.

os:datagrid

OpenSAGA specific data grid compontent. Attributes are the same as for <h:dataTable>.

os:messages

Renders a message list.

Attribute

preventMessageDuplicates

If set to true ( the default) , render only those messages that are not displayed by a <os:message> tag in the same view.

heading

Internationalized headline for this message list.

os:message

Renders a single message.

Attribute

for

Id of the component to display the message for.

os:connectSelect

Renders a single select field for a multi connect element.

Attribute

multiConnectModelId

Id of the multi connect model.

disabled

disabled attribute.

style

CSS styles.

selected

true if the select field for the connected items is to be rendered, false for the unconncted items.

os:ajaxButtonDecoration

Renders the decoration for a surrounding ajax button component.

Attribute

processIds

Comma separated lists of ids to proccess for the ajax request for this command.

os:iconText

Renders an component consisting of an icon and a text.

Attribute

styleClass

HTML classes

icon

Icon for this icon text component.

text

Internationlized text of this icon text component

title

Internationalized title to set for this icon text component. for this command.

os:booleanElement

Renders an boolean element.

Attribute

value

Runtime value.

boolElementId

Id of the boolean element model to render.

os:ifWriteMode

A container component that only renders its children if a certain write mode is matched.

Attribute

writingModelId

Id of the writing model whose write mode is obeyed.

modes

Comma separated list of modes of which one must be matched. Valid values are ENABLED, DISABLED and READ_ONLY. (see org.opensaga.core.model.view.content.WriteMode)

os:readOnlySelect

A readonly select component that is basically a complicated plaintext.

Attribute

items

List of javax.faces.model.SelectItem containing all values.

value

Current value of the read only select component.

styleClass

HTML classes

os:editAttachment

Component to edit a OpenSAGA attachment.

Attribute

attachmentModelId

Id of the attachment model.

value

Current value of the attachment model.

os:messages

Renders a list of info messages for the current view

os:message

Renders a single info message.

Attribute

messageId

messageId of the info message

os:resetFields

Clears all UIValues in the view to enforce refetching from the form bean.

os:tree

OpenSAGA Tree component used to connect a domain type to a hierarchical domain type.

Attribute

treeConnectModelId

Id of the tree connect model

minSelectableDepth

The minimal depth that can be selected in the tree

styleClass

HTML classes

OpenSAGA JSF Functions

The following JSF functions are defined in the OpenSAGA facelets tag library.

os:htmlEncode(String s)

HTML encodes the given String

os:wikiDecode(String text,String propertyRef)

Run a wiki decode operation on the given text for the wiki dialect given as "wikiDialect" property type parameter in the property model being referenced by the given property ref.

os:attachmentContentId(String attachmentId)

Returns the content id for the given attachment id

os:json(java.lang.Object)

Encodes the given object as JSON

os:i18nMap(String tags)

Returns a JSON representation of the given pipe separated list of i18n tags.

os:supportedLocaleNames()

Returns a list of SelectItems with the locale names supported by the portal.

os:modelDecoration(String viewModelId,String contentElementModelId)

Returns an encoded model decoration for the given view model id and content element model id

os:isCommandRendered(String policyName,String transitionId, String viewModel, String buttonId)

Returns true if the command with the given transition id and the given policy name is rendered. The visibile function also checks the disabled visible according to a nested visible-if filter specification model if a button with the given buttonId exists for the given View.

os:isCommandDisabled(String policyName,String transitionId, String viewModel, String buttonId)

Returns true if the command with the given transition id, and the given policy name is disabled. The disabled function also checks the disabled status according to a sub command filter specification model if a button with the given buttonId exists for the given View.

os:writeMode(String viewModelId, String writingModelId)

Returns the write mode for the given view model Id and the given writing model id.

os:visible(String viewModelId,String visibilityGroupId)

Returns true if the visibility group for the given visibility group model id and the given view model id is visible.

os:setting(String name)

Returns the UI component setting with the given name

os:style(String viewModelId, String contentElementId, String styles)

Returns the optional styles given as third param with the styles being registered for the given view model id and the given content element model id in the content element style service

Chapter 38. Working with layouts in OpenSAGA

Overview

In this chapter we are going to discuss the way OpenSAGA integrates CSS and Javascript into the HTML output created by JSF and how to create or change component layouts and portal layouts.

OpenSAGA Web Technologies

OpenSAGA puts an emphasis on using standard web technologies in the most compatible and accessible way possible and goes much further in this regard than JSF does. Although it implements a sophisticated declarative component model, it continues to employ state of the art cross-browser technologies like progressive enhancement or (via jQuery integration) feature simulation.

This makes OpenSAGA practically a Standards-oriented Web-Developer-in-a-box because it does things automatically that are bothersome and tiring work when done in an environment that is not model based.

The diagram above shows the theoretically available views on a portal or web site, depending on the technological abilities of the browser. OpenSAGA primarily supports the Views 2 and 3, which means you can use a OpenSAGA portal with or without javascript. Of course there are drastic differences when not using Javascript. For example instead of being presented a nice map widget where you can click on to select a point on the map, you just have to enter a coordinate pair of longitude and latitude. This is achieved with a technology called progressive enhancement. OpenSAGA' JSF components and templates generate pure semantic HTML output that is styled by externally included stylesheets, which together form a usable portal in View 2. Then external widget scripts transform this into a View 3 portal with all bells and whistles.

CSS and Javascript Dependencies

To aid the component or portal developer in his task

OpenSAGA View Layouts

View layouts in OpenSAGA are based on a dynamically rendered Blueprint CSS grid. The grid is usually 24 columns wide. These are columns like you would have them in a e.g. newspaper. They have a certain width that is usually a part of the whole newspaper page. These columns can be ordered in horizontal and vertical groups. If you're not sure which is which, remember thelittle mnemonic visualized in the image below: Items in a horizonal group form a horizon.

Grouping content in columns

The following diagram shows an example of a view layout:

It consists of a top column that spans the complete size of the view and three columns below it that divide the full width into three equal parts. A view definition for that would look like this.

<?xml version="1.0" encoding="UTF-8"?>
<view 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:noNamespaceSchemaLocation="http://www.opensaga.org/schema/model/view-1.0.xsd"
    id="example.p_example.v_example" process-ref="example.p_example"
    title="Example Layout" >
    
    <part-set>
        <part>
            <vgroup>
                <col width="24"></col>
                <hgroup>
                    <col width="8"></col>
                    <col width="8"></col>
                    <col width="8"></col>
                </hgroup>
            </vgroup>
        </part>
    </part-set>
</view>      

To create such a view it often helps to make a sketch of the layout you want to have and then take a look at the grouping to determine the nescessary tags.

Everything starts with the outer view frame, which is marked with a 1 in the diagram above. Then that square is subdivided horizontally and vertically and maybe once again on the smaller parts. So in this case the outer frame 1 is cut horizontally into two pieces by the line 2 forming two full-width parts in vertical order thus forming a vgroup, which is our outmost group. The lines of which one is marked with 3 cut the lower part into three equal peaces, forming a hgroup.

Above is another example starting with a outmost hgroup. Following the above way of seeing which lines cut with areas in what order, we arrive at the view model for the example:

<?xml version="1.0" encoding="UTF-8"?>
<view 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:noNamespaceSchemaLocation="http://www.opensaga.org/schema/model/view-1.0.xsd"
    id="example.p_example.v_example" process-ref="example.p_example"
    title="Example Layout" >
    
    <part-set>
        <part>
            <hgroup>
                <col width="8"></col>
                <vgroup>
                    <col width="16"></col>
                    <hgroup>
                        <col width="8"></col>
                        <col width="8"></col>
                    </hgroup>
                </vgroup>
            </hgroup>
        </part>
    </part-set>
    </view>      

Part/SubView Layout

The layouts formed by hgroups and vgroups are what we call the "inner" layout structures. Their purpose is mostly visual except for a grouping function they can have on their content.

Parts are layouted the same way but also reference domain types or objects. In the example above there is you already see the elements <part-set /> and <part />. If you have only one part that's all you need to define and the ModelAutoCompleter will autocomplete this into the full structure needed internally by OpenSAGA

<?xml version="1.0" encoding="UTF-8"?>
<view 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:noNamespaceSchemaLocation="http://www.opensaga.org/schema/model/view-1.0.xsd"
    id="example.p_example.v_example" 
    process-ref="example.p_example"
    title="Example Layout" >
    
    <subview-vgroup>
        <subview >
            <part-reference part-ref="id.hgz"/>
        </subview>
    </subview-vgroup>
    <part-set>
        <part id="id.hgz"></part>
    </part-set>
    </view>  

Referencing multiple domain types in a view

If you need to have more than one domain type in your view, you need to setup a <subview-vgroup /> or <subview-hgroup /> structure analog to the way described for the inner layout structures and declare references to all parts in the part set. <hgroup /> and <vgroup /> are analog to <subview-hgroup /> and <subview-vgroup />, <col /> is analog to <subview />.

<?xml version="1.0" encoding="UTF-8"?>
<view 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:noNamespaceSchemaLocation="http://www.opensaga.org/schema/model/view-1.0.xsd"
    id="example.p_example.v_example"
    domain-type-ref="example.d_something"
    process-ref="example.p_example"
    title="Example Layout" >
    
    <subview-hgroup>
        <subview width="16">
            <part-reference part-ref="example.p_example.v_example.main_part"/>
        </subview>
        <subview width="8">
            <part-reference part-ref="example.p_example.v_example.detail_part"/>
        </subview>
    </subview-hgroup>
    <part-set>
        <part id="example.p_example.v_example.main_part"></part>
        <part id="example.p_example.v_example.detail_part">
            <relation-chain>
                <relation-reference relation-ref="example.r_relation_to_something"/>
            </relation-chain>
            <content></content>
        </part>
        
    </part-set>
</view>      

The example above shows a simple two part view that references two domain types. One is referenced directly by the view, the other is implicitly referenced by a relation-chain that has to start at the view's domain type and go to the part's domain type. For this to actually work in a view that relation-chain must use relations that lead to a non-ambiguous domain object, i.e. it must be a "to-1" relation or a filtered relation.

Component Layouts

Part VI. Internals

Chapter 39. Caching

OpenSAGA uses a variety of caches in order to optimize internal processes. Usually this will be transparent for the user but for some process modifications and process additions it is important to know about existing caches in order to reset them at relevant points in time. Most often this will concern permission based caches, but there might be other use cases.

Resetting caches

To reset a cache simply use the reset-cache action and parametrize it with the name of the cache you want to reset. That's it.

If you want to reset all caches at once, you simply need to address the system.cache.all cache name with the reset action.

Internal caches

The following internal caches are used by OpenSAGA:

Table 39.1. Internal OpenSAGA Caches

Cache NameDescription
system.cache.all Reset this special cache (which does not exist physically) if you want to reset all system caches at once.
system.cache.permissions Identifies the internal permission cache. Since OpenSAGA checks permissions in many places it also caches all permissions granted by a set of roles in order to prevent costly recalculations. Changing roles, permissions, etc. thus creates a difference between the cached permissions and the persistently defined permissions in the system tables. Whenever some definition changes the way users, rules and roles are connected, the permission cache must be immediately reset. Failing to do so will delay permissions from taking effect until the server is restarted or some other action flushes the cache.
system.cache.repository.cached Identifies the cache repository itself. If you want to enforce a reload of all cached beans (not a reset!) you can address this cache name.
system.cache.repository.actions Identifies the cache holding all action beans that provide actual implementations for underlying action models.
system.cache.repository.attachmentContentRepositories Identifies the cache for all attachment content repositories. See the chapter describing OpenSAGA attachment handling for more information.
system.cache.repository.propertyValueProviders Identifies the cache of all PropertyValueProvider instances configured in the system (see Chapter 8, Property Value Providers).
system.cache.repository.scriptingServices Identifies the cache of all ScriptingService instances configured in the system (see Chapter 32, Scripting).
system.cache.groovyScriptingService Identifies the cache of all compiled Groovy scripts transformed by the the section called “Groovy Scripting Service”.
system.cache.modelDecorationService Identifies the cache of all model decorator beans.

Additionally there are a number of caches used in the system in order to store internal beans for optimization purposes. Usually you will not want to reset them and usually you also can't reset them. By resetting system.cache.all or by using the appropriate administration interface provided by the base implementation.

Accessing Caches

OpenSAGA defines a cacheRepository as an instance of org.opensaga.runtime.cache.CachedRepository. This repository knows all cached objects and provides access to them by the names defined above.

Implementing cached objects

In order to implement a bean conforming to the OpenSAGA caching protocol (e.g. being visible in the relevant administration views and being resettable by action models) you simply need to implement the interface org.opensaga.runtime.cache.Cached. The javadoc for this interface provides detailed information about the rather trivial methods you need to implement.

As a consequence OpenSAGA will automatically pick up any bean defined in a Spering context of an extension and consider it for all caching relevant actions.

Chapter 40. Implementing Named Repositories

OpenSAGA contains a variety of repositories providing access to runtime resources. Usually these resources are represented by named beans and will be configured in the Spring application contexts provided with extensions.

Configuring Named Bean Extensions

A bean based extension is implemented by implementing a strategy interface for the extension in question. Currently the following strategy interfaces can be extended and will be auto-discovered by OpenSAGA:

  • org.opensaga.runtime.attachment.content.AttachmentContentRepository

  • org.opensaga.runtime.model.action.Action

To export such an extension to the system, the following steps need to be taken:

  1. Implement a class with the given interface.

  2. Configure this class in a Spring configuration in your extension, see the section called “Spring Configuration Extensions”.

  3. package your special implementation in a JAR archive and drop that into your extension, see ???.

Configuring Named Type Extensions

Some extensions do not rely on named bean types but rather on named types which are found in the class path of an application and instantiated from there. Extensions of the DataSourceType interface are one such example. The ClassPathBasedDataSourceTypeRepository (which is the OpenSAGA default implementation) scans all files in the classpath and tries to instantiate each class implementing the interface DataSourceType. All you need to do is to implement this interface for your extension and abide by the given contract. Then just package your special implementation in a JAR archive and drop that into your extension, see ???.

Implementing New Named Bean Repositories

If you want to implement a named repository of your own making, simply extend org.opensaga.runtime.NamedBeanTypeRepository in your repository interface and base your implementation on the abstract base class which will be doing all the complex work for you. It simply needs to be configured with the specific type of bean that you want to auto discover and will find all beans of the given type in all Spring configurations of the current project.

Chapter 41. The Process State References

In the Process Model (see the section called “The Process Model”) you work with Process States. These states are declared in the process-state-set of the ProcessModel. But these declarations are only references and not the states themselves . So the [name]-state is a state reference model and the correspond state model is [name].

This behavior allows you to define states in other files and reuse them instead of declaring it again and again in the process models. This is especial useful for the view states. But there are states like the decision-state that references a decision model which contains no additional information. So it would be circuitous to define a decision model in separate file. Therefore the ModelAutoCompleter completes these missing states and you do not need to define a separate decision.

Some kinds of states has only a few attributes e.g. the back-state. Instead of declaring a back model it is possible to define these attributes in the back-state (back-state extends the back model). But notice: The AutoModelCompleter creates the state if it not exists and copies the attributes manually from the state reference model to the state model. When you add more attributes to such state models, you have to copy the new attribute manually.

Chapter 42. File Path Syntax

If you have to specify file paths for you portal, you have to differentiate between absolute and relative paths.

Relative file paths

Relative file paths (e.g. "WEB-INF/resources") start from the "WebContent" directory.

Absolute file paths

Absolute file paths have to be prefixed with file: (e.g. "file:/E:/Data/Attachments").

URLs

URLs can be used like normal (e.g. "smb://remote", "http://host.name", "class://abc").

Chapter 43. Writing Model Documentation

In order to keep documentation for OpenSAGA models centralized, the reference part of the documentation is auto-generated. The model classes contain OpenSAGA compiler annotations as well as javadoc comments that are transformed into:

  • The reference part of this documentation.

  • The XML schema for OpenSAGA.

  • Javadoc HTML output.

In order to do this, OpenSAGA uses a somewhat restricted subset of javadoc that can be converted to XSD and docbook.

OpenSAGA Tag documentation format

The basic format for the documentation is javadoc. Internally we use the tag soup library to turn HTML soup into valid XHTML, auto-closing your tags and automatically adding parent tags you forgot. So unless you go totally wild with your javadoc, you will be ok.

XML Schema output

The first paragraph of your Javadoc will be turned into the description being put into the XML schema description. If you need more than one paragraph, you can additionally mark the paragraph with the intro class.

Example 43.1. Marking additional XML Schema paragraphs

/**
First paragraph that is always converted to XML schema, 
whether it is enclosed in a paragraph or not.
<p class="intro">
Additional paragraph.
*/
@Tag("example-tag")
public class ExampleTagModel extends AbstractModel
{
    …
}
                    

This extends the idea of only the first sentence of in a Javadoc being included in the overview. All tags will just be stripped from the XML schema as there is just no way to include them.

Docbook output

The docbook output is of course much richer than the XML schema output and supports the following transformations of Javadoc or HTML tags to Docbook.

Text decorations

These simple text decorations (<b />, <strong />, <i />, <em /> ) are transformed into their corresponding docbook equivalent.

Ordered and unordered list

<ul />, <ol />, <li /> are converted to the corresponding docbook list equivalent.

headings

Headings ( <h1 /> to <h6 /> ) are converted into nested docbook sections and titles.

Examples

Examples come in two flavors for Docbook output: example and informal example.

Example 43.2. Example

/**
<p>First paragraph</p>.

<pre title="Title of example"><code>
&lt;example-code attribute="foo" /&gt;
</code></pre>
*/
@Tag("example-tag")
public class ExampleTagModel extends AbstractModel
{
    …
}
                    

Both informal example and example are signaled by using the pre and code tag combination shown above. If you specify a title attribute on the pre tag, the output will be an example, without title it will be an informal example. You can either escape tags in the example as shown above or you can use a CDATA block.

@see and @link

@link tags that are embedded into the javadoc are converted to docbook cross references if the class they are pointing to has a reference entry. This means you need to link the tag implementation, not the tag interface!

@see tags are turned into a list of cross references at the end of the current javadoc. In addition to classes you can also reference docbook ids in @see. In this case you need to prefix the id with id:.

Example 43.3. Example

/**
<p>First paragraph</p>.

@see id:file-path-syntax
@Tag("example-tag")
public class ExampleTagModel extends AbstractModel
{
    …
}
                    

Configuring and generating the documentation

Both XML schema generation and Docbook reference documentation generation is started by executing ant scripts build-schema.xml or build-reference-doc.xml in the OpenSAGA project root.

You can configure new reference sections or schemata by editing the spring context files schema-config.xml or reference-doc-config.xml. Both contexts are hopefully self-documenting.

Chapter 44. Testing OpenSAGA

OpenSAGA relies on integration tests in order to check is functionality. Unit tests are only sparingly used for more specific or complicated pieces of the code where we felt that they added real value. Many other code parts require (in our opinion) highly complicated setups due to the complexity of the underlying OpenSAGA models and we so far failed to come up with a viable unit testing approach for this situation. Good ideas are welcome.

For the time being we thus decided to test the core functionalities with Selenium based tests that work on the generated base infrastructure of OpenSAGA. Additionally we internally add each and every project we finish to the test suites used in order to ensure the overall stability of the platform. The following sections describe how you can use the Selenium test subset provided with the OpenSAGA distribution for your own tests.

There are two ways to start selenium tests:

  • with the Selenium IDE

  • by running one of the ant scripts in the test section

Test with the Selenium IDE

The tests expect a running clean instance of opensaga-core under http://localhost:8080/opensaga-core. Clean in this case means:

  • an empty database (only the data provided by OpenSAGA should be present)

  • the log4j configuration from /testing/bamboo/opensaga-core/stuff/log4j.properties is used (copy it's content to the configuration in /WebContent/WEB-INF/cfg/log4j/log4j.properties).

The tests are located in /testing/bamboo/opensaga-runtime/selenium.

Test with an ANT task

The "startBaseTest*" tasks from the ant file located in /testing/bamboo/opensaga-core/database/postgres/build.xml will start automatic tests. The tests expect the following infrastructure:

  • a PostgreSQL database server with a super user role 'bamboo' and the password 'bamboo'

  • the ant task is started by an operating system user that is allowed to open TCP ports

A task named 'createDatabases' will help to create the bunch of databases needed. The Ant tasks will 'mess around' a bit while building the war and deploy it.

Chapter 45. Security

Login Process

The login process defines a property set consisting of two domain type properties (request.login.username and request.login.password) in the process scope. These are used to hold the values entered by the user in the login view (see v_login.xml for reference). The view state p_login.v_login contains two transitions (that are of interest here): p_login.t_login_ok and p_login.t_login_failed. The first transition is executed if the login was successful, the second is executed if the login failed.

Content Streaming

OpenSAGA differentiates between two kinds of content streaming - both must be secured by different means as explained below:

  1. It is possible to download resources while being logged into a OpenSAGA based portal. In this case OpenSAGA ensures that a user can only download resources to which he is eligible by appropriate internal security checks.

  2. It is possible to download resources through the general streaming service. This service does not require a valid login and as a consequence is not able to check OpenSAGA based security rules. Therefore installations utilizing the external streaming service need to provide appropriate additional security measures if access to such streamed resources is to be restricted.

Part VII. Quick Start Guide

Table of Contents

46. How-Tos
47. FAQ

Chapter 46. How-Tos

Q: How do I add a confirmation dialog to a transition?
Q: How to add an attribute to the user type?
Q: How do I specify a field's default value?
Q: How to translate enumerations to OpenSAGA?
Q: Is domain type inheritance supported? (Like merging, but the original type co-exists besides the merged one)
Q: How do I create a details page containing a list of children datasets?
Q: How do I define business logic in Java?
Q: How do I build a new portal with the Eclipse OpenSAGA feature?
46.2. Open questions
Q: How do I fire an 'reload part' event by using a selection tag?
Q: How do I realize a dataset assignment (a one-to-many loosy relation)?
Q: Where do I find information about domain object life cycles?
Q: Can I use reusable sub processes (like web flow's helpy sub flow concept)?
Q: What about view-reusing? Example: An overview used as selection for administration and for parent data set selection in two processes.
Q: Feature request: What about field related right management (visible, read-only depending on role and data set state)?
Q: Feature request: What about button related right management (visible, read-only depending on role and data set state)?
Q: Feature request: What about generic data set representation (field type by attribute type, fields automaticly extracted from domain type definition)?
Q: Is it possible to secure transactions?
Q: How do I add a confirmation dialog to a transition?
Q: How to add an attribute to the user type?
Q: How do I specify a field's default value?
Q: How to translate enumerations to OpenSAGA?
Q: Is domain type inheritance supported? (Like merging, but the original type co-exists besides the merged one)
Q: How do I create a details page containing a list of children datasets?
Q: How do I define business logic in Java?
Q: How do I build a new portal with the Eclipse OpenSAGA feature?

Q:

How do I add a confirmation dialog to a transition?

A:

Add a confirmation model to the transition definition (see the section called “<confirmation />”).

Q:

How to add an attribute to the user type?

A:

Extend the base domain type. Create a file <extension folder>/models/domain/types/user.xml and define the additional attribute (deletion of existing attributes is not supported).

Example 46.1. A numeric salary attribute

<?xml version="1.0" encoding="UTF-8"?>
<domain-type id="system.domain.user" name="User"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://www.opensaga.org/schema/
                 model/domain-type-1.0.xsd">

    <property-set>
        <domain-type-property-set>
            <domain-type-property id="system.domain.user.
                   salary" name="salary" type="Integer" 
                   default-value="2000" required="true"/>
        </domain-type-property-set>
    </property-set>  
</domain-type>

Q:

How do I specify a field's default value?

A:

If this is a globally default value (process-independent), you should specify it within your domain type definition. The old and the new attributes will be merged into a new type that will replace the old type and its extension.

Example 46.2. A numeric salary attribute

<domain-type-property id="domain.type.attr" name="attr" 
                      type="Integer" default-value="2000" />

Q:

How to translate enumerations to OpenSAGA?

A:

Let's use the following example: We have a domain type attribute domain.job.timeunit and want it to be typed to the enumeration 'hours' and 'days' (localized).

First we will have to define a constant type file. E.g. <extension folder>/models/domain/constant-types/timeunit.xml. It might have the following content:

Example 46.3. Enumeration type

<?xml version="1.0" encoding="UTF-8"?>
<constant-domain-type id="domain.enum_timeunit" name="Time Unit"
    data-source-name="enum_timeunit-data-source"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://www.opensaga.org/schema/
                   model/constant-domain-type-1.0.xsd">

    <property-set>
        <domain-type-property-set>
            <domain-type-property id="domain.enum_timeunit.
                                      unit" 
                 name="unit" type="PlainText"
                 translation-required="true"/>
            <domain-type-property id="domain.enum_timeunit.
                                      id"
                 name="id" type="Long"/>          
        </domain-type-property-set>
    </property-set>
    <primary-key>
        <key property-ref="domain.enum_timeunit.id" />
    </primary-key>
    <constant-data-list>
        <constant-data>
            <constant value="Hours"/>
            <constant value="0"/>
        </constant-data>
        <constant-data>
            <constant value="Days"/>
            <constant value="1"/>
        </constant-data>
    </constant-data-list>
</constant-domain-type>

The actual property is unit. But because we want it to be localized we also must have a non-localizable id. (This is a technical requirement. A higher level of abstraction - especially in conjunction with selection elements (see below) - would be great here, but for extensibility reasons this was not realized.)

You will notice the used data source. This one does not exist yet. You will have to define it within your <extension folder>/models/stages.xml. If only needed for this purpose it will have the following content:

<?xml version="1.0" encoding="utf-8"?>
<stages id="system.stages"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://www.opensaga.org/schema/
                                   model/stages-1.0.xsd">

    <stage name="global">
        <data-source-set>
            <data-source name="enum_timeunit-data-source"
                         type="opensaga-constant"/>
        </data-source-set>
    </stage>

</stages>
Actually this one extends the base system stages definition.

Now we want to define a domain type that uses or enumeration type. We must reference each property we want to use within processes. The notation is quiet confusing, but just follow this procedure:
Add an enum-property-set block for each enumeration type you like to use.
Add an enum-property for each enumeration type property you want to reference.

Keep in mind that the properties per set are accessed individually but the set defines a logical unit.

The following example illustrates the enumeration's usage:

Example 46.4. Enumeration using domain type

<?xml version="1.0" encoding="UTF-8"?>
<domain-type id="domain.job" name="Job"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://www.opensaga.org/schema/
                                   model/domain-type-1.0.xsd">

    <property-set>
        <domain-type-property-set>
            <domain-type-property id="domain.job.id"
                                  name="id" type="Long" />
            <domain-type-property id="domain.job.name" 
                                  name="name" type="PlainText"
                                  />
        </domain-type-property-set>
        <enum-property-set domain-type-ref="domain.enum_timeunit">
            <enum-property id="domain.job.timeunit_id"
                           name="enum_id"
                           property-ref="domain.enum_timeunit.id"/>
            <enum-property id="domain.job.timeunit_unit"
                           name="enum_unit"
                           property-ref="domain.enum_timeunit.unit"/>
        </enum-property-set>
    </property-set>  
    <primary-key>
    	<key property-ref="domain.job.id" generated="true"/>
    </primary-key>
</domain-type>

You will notice that we did not map the enumeration to one attribute domain.job.timeunit (instead we are binding all enumeration element's sub-attributes explicitly). OpenSAGA lacks a wrapping mechanism featuring such abstaction yet.

Now we want to use our enumeration attribute within a view. Let's use the following selection tag:

<select-field id="timeunit"
              property-ref="domain.serviceItem.timeunit_id" 
              select-domain-type-ref="domain.enum_timeunit" 
              value-property-ref="domain.enum_timeunit.id"
              display-property-ref="domain.enum_timeunit.unit"
              empty-selection-allowed="false"/>
By using the related child elements, you may specify sorting (sort-order-list) and filtering (filter-specification. But attention:
[Warning]Warning

Sorting and filtering will use the key value or ID of items, not the localized text.

You will notice the usage of the constant and the actual type. This really is kind of confusing, but after the attributes have been explained, it will seam much more simple:
The property-ref defines the property to store the result into.
The select-domain-type-ref defines the enumeration (the constant type).
The value-property-ref defines the enumeration property to use as selection ID.
The display-property-ref defines the enumeration property to display.

As mentionewd above, a higher level of abstraction would be great here but was not realized for extensibility reasons.

Q:

Is domain type inheritance supported? (Like merging, but the original type co-exists besides the merged one)

A:

Yes. Just use the extends attribute in the domain-type definition. But be careful:

[Warning]Warning

IDs will be shared and this leads to numerous problems by now.

So you should better duplicate the related attributes and do without hierarchical data structures.

Q:

How do I create a details page containing a list of children datasets?

A:

You set the view's domain-type-ref attribute to the parent domain type and produce your usual details part. Now you add a part containing an overview table. This part's domain-type-ref attribute must be set to the child domain type.

The overview table needs the object-relative attribute set to 'true' and an inner relation-chain element with a relation-reference element that will specify the type relations via its relation-ref attribute (use the related ID here). You must use the back tag and the relation-ref attribibute during transitions.

Q:

How do I define business logic in Java?

A:

There are two general ways of handling this:

  1. Use the execute action (the section called “Execute Action”) to directly execute Java business logic (or business logic implemented in some other scripting language).

  2. Extend a specific strategy interface (Chapter 34, Strategy Interfaces) providing an extension point for your particular task.

Q:

How do I build a new portal with the Eclipse OpenSAGA feature?

A:

Follow these steps:

  1. Execute the tasks "opensaga-core-jar" and "opensaga-all-extensions-jar" from the OpenSAGA project's build-script: For all OpenSAGA classes (except libraries) and for each extension a JAR will be created. In the first version there was a bug: You manually had to create a sub directory "dist/jars".

  2. Start a new "dynamic web project" of type "OpenSAGA". Select the created base-JAR and the extension JARs you need (maybe none) if asked to do so.

  3. Create a new extension with the OpenSAGA feature (New => OpenSAGA => Extension).

  4. Copy the "lib"-folder from the OpenSAGA project to the new one and add the contained JARs to the build path.

  5. Copy JARs from the OpenSAGA project folder "WebContent/WEB-INF/lib" to the similar named folder in the extension project (you will find the JARs selected during project set-up being here already).

  6. Create the file "opensaga-project.cfg" in your extension project folder "WebContent/WEB-INF/cfg". Specify the extensions to use (including the one you build the new project for) within that file via "extensions=...". If you want to use an extension shipped in a JAR remove the prefix "opensaga-extension-" and the file suffix.

46.2. Open questions

Q: How do I fire an 'reload part' event by using a selection tag?
Q: How do I realize a dataset assignment (a one-to-many loosy relation)?
Q: Where do I find information about domain object life cycles?
Q: Can I use reusable sub processes (like web flow's helpy sub flow concept)?
Q: What about view-reusing? Example: An overview used as selection for administration and for parent data set selection in two processes.
Q: Feature request: What about field related right management (visible, read-only depending on role and data set state)?
Q: Feature request: What about button related right management (visible, read-only depending on role and data set state)?
Q: Feature request: What about generic data set representation (field type by attribute type, fields automaticly extracted from domain type definition)?
Q: Is it possible to secure transactions?

Q:

How do I fire an 'reload part' event by using a selection tag?

Q:

How do I realize a dataset assignment (a one-to-many loosy relation)?

Q:

Where do I find information about domain object life cycles?

Q:

Can I use reusable sub processes (like web flow's helpy sub flow concept)?

Q:

What about view-reusing? Example: An overview used as selection for administration and for parent data set selection in two processes.

Q:

Feature request: What about field related right management (visible, read-only depending on role and data set state)?

Q:

Feature request: What about button related right management (visible, read-only depending on role and data set state)?

Q:

Feature request: What about generic data set representation (field type by attribute type, fields automaticly extracted from domain type definition)?

Q:

Is it possible to secure transactions?

Chapter 47. FAQ

Q: I get the exception ClassNotFoundException while loading persisted sessions on portal startup.
Q: How do I use the interface ContainedModel correctly?
Q: I get the exception ClassNotFoundException while loading persisted sessions on portal startup.
Q: How do I use the interface ContainedModel correctly?

Q:

I get the exception ClassNotFoundException while loading persisted sessions on portal startup.

A:

To prevent this message add the following line between the Context tags of the server.xml:

<Context...>
...
<Manager className="org.apache.catalina.session.PersistentManager"
    saveOnRestart="false"/>
...
</Context>

Q:

How do I use the interface ContainedModel correctly?

A:

The interface ContainedModel<ParentClass> defines that the current class is contained in the ParentClass. I.e. you can retrieve the parent object by using the method getParent() on the current object.

Part VIII. Reference

Table of Contents

48. Actions
<action-list />
<action-list-set />
<action-script />
<actions />
<add-to-list />
<aggregate />
<audit-trail />
<bind />
<call />
<case />
<catch-exception />
Catching all exceptions
Catching one specific exception
Catching one specific exception (simplified)
Catching a category of exceptions
Catching exception combinations
<catch-validation-error />
<condition />
<connect />
<create-message />
<default />
<define-password />
<delete />
<delete-by />
<dequeue-report />
<disconnect />
<else />
<email />
<enqueue-report />
<execute />
<execute-if />
<finally />
<for-each />
<if />
<ignore-validation-results />
<import />
Import Mode
Domain type import
XML import
GroovyXmlNode
<iterate-list />
<load-list />
<logout />
<map-values />
<message-parameter />
<new />
<new-object />
<next-element />
<publish-message />
<remove />
<remove-list />
<reset-cache />
<reset-list-iterator-index />
<reset-translations />
<reset-validation-status />
<script />
<send-outgoing-emails />
<set-active-navigation />
<set-list />
<set-object />
<set-property-value />
<store />
<switch />
<system-log />
<tag />
<then />
<transform />
<try />
<tweet />
<validate />
<validation-error />
<webservice />
<with-filter />
49. Agent Models
<agent-action />
<agent-action-list />
<agent-reference />
<agents />
<domaintype-based-agent />
<event-based-agent />
<time-based-agent />
<trigger-based-agent />
50. Content Element Models
<a />
<attachment />
<attachment-column />
<auto-complete-filter />
<available-export />
<available-export-list />
<b />
<boolean-column />
<boolean-element />
<br />
<button />
<button-column />
<cell-format />
<cell-format-set />
<checkbox />
<clear-filter-button />
<cms-content />
<col />
<collapse-button />
<collapse-link />
<column />
<content />
<content-group />
<datagrid />
<datagrid-column-list />
<dd />
<debug-console />
<disabled-if />
<div />
<dl />
<dt />
<em />
<error-message />
<error-message-list />
<exception />
<external-link />
<file-upload />
<filter-row />
<footer-row-list />
<grid />
<h1 />
<h2 />
<h3 />
<h4 />
<h5 />
<h6 />
<header-row-list />
<heading />
<help-button />
<hgroup />
<hr />
<image />
<info-header />
<info-header-row />
<info-header-row-list />
<label />
<li />
<link />
<list-iterator />
<locale-select />
<location-field />
<login-button />
<map />
<message />
<message-based-refresh />
<message-list />
<multi-connect />
<ol />
<on-update-refresh />
<p />
<paging />
<paging-button />
<paging-size-select />
<part />
<part-reference />
<part-set />
<password />
<plain-text />
<plain-text-property />
<pre />
<property-column />
<radio-buttons />
<read-only-if />
<remember-me-checkbox />
<rich-text />
<rich-text-field />
<rich-text-property />
<row />
<select-field />
<select-popup />
<single-connect />
<sitemap />
<span />
<state />
<stereotype />
<strong />
<style />
<style-set />
<subview />
<subview-hgroup />
<subview-list />
<subview-vgroup />
<tab />
<tab-set />
<text-field />
<textarea />
<toolbar />
<tree-connect />
<ul />
<url-column />
<verbatim />
<vgroup />
<view />
<visible-if />
<wiki-text-property />
51. Domain Type Models
<domain-type />
<property-type-parameter />
<property-type-parameter-set />
<reference-property />
<reference-property-set />
<wfs-domain-type />
52. Defining Domain Type Model Properties
<domain-type-property />
<domain-type-property-set />
<enum-property />
<enum-property-set />
<formula-property />
<formula-property-set />
<property-set />
<property-type />
<type-converter-reference />
<type-converter-reference-set />
53. Primary Keys for Domain Type Models
<key />
<primary-key />
54. Primary Keys for Complex Domain Type Models
<contained-key />
<contained-primary-key />
<contained-primary-key-set />
55. Domain Type Model Actions
<on-create />
<on-delete />
<on-insert />
<on-update />
56. Initializing Domain Type Models
<data-set />
<initialization-data />
<insert-object />
<insert-test />
<insert-value />
<property-check />
57. Constant Domain Type Models
<constant-data />
<constant-data-list />
<constant-domain-type />
<property-reference />
<property-reference-list />
58. Excel Based Domain Type Models
<excel-configuration />
<external-excel-domain-type />
59. External Domain Type Models
<create-statement />
<database-statement-set />
<delete-statement />
<external-relational-domain-type />
<find-statement />
<insert-statement />
<select-statement />
<update-statement />
60. Joined Domain Type Models
<joined-domain-type />
<joined-property />
<joined-property-set />
61. Relations between Domain Type Models
<relation />
<relation-chain />
<relation-chain-list />
<relation-reference />
<relation-set />
62. Miscellaneous Domain Type Model Features
<comment />
63. Filtering
<and />
<can-access />
<complies-to />
<contains />
<contains-comparator />
<criterion />
<dynamic-condition />
<ends-with />
<equals />
<false />
<filter-pattern />
<filter-pattern-set />
<filter-specification />
<filter-specification-set />
<filtered-list />
<geo-contains />
<geo-within />
<greater-than />
<greater-than-or-equal-to />
<has-changed />
<has-current-element />
<has-elements />
<has-permission />
<has-type />
<in />
<in-transition />
<include />
<is-connected-to />
<is-defined />
<is-new />
<is-property-modified />
<is-super-user />
<is-undefined />
<join-definition />
<join-definition-set />
<less-than />
<less-than-or-equal-to />
<matches />
<not />
<or />
<sort-order />
<sort-order-list />
<starts-with />
<true />
<user-logged-in />
<validation-failed />
64. GIS
<defaults />
<domain-type-based-wfs />
<gis />
<layer />
<layer-list />
<registry />
<service-registry />
<service-registry />
<srs />
<style />
<style-reference />
<styles />
<url />
<wfs />
<wfs-based-wms />
<wms />
65. Internationalization
<translation-definition />
<translation-definitions />
<translation-definitions />
<translations />
66. Layout Models
<layout />
<setting />
<skin />
67. Navigation Models
<cms-navigation-item />
<item />
<item-list />
<navigation />
68. Portal Meta Models
<anonymous-model-permissions />
<available-process />
<available-processes-set />
<configuration />
<conversation-context />
<default-property />
<default-property-set />
<definition />
<domain-context />
<domain-type-reference />
<domain-type-reference-set />
Default Property Set
<gis />
<id-mapping />
<id-mapping-set />
<locale />
<meta />
<model-permission />
<navigation-reference />
<navigation-reference-set />
<portal />
The MetaModel
The Conversation Context
The Session Context
The Gis Model
The Navigation Reference Set
Supported Locales
The Domain Type Reference Set
The Process Reference Set
The Web Service Reference Set
The REST Services Reference Set
Paging
Filter Specification Set
UI Component Setting Set
Action List Set
Start Action List
<process-reference />
<process-reference-set />
Using ID Mappings to Copy Processes
<property-type-reference />
<property-type-reference-set />
<public-processes />
<session-context />
<start-action-list />
<supported-locales />
<user-model-permissions />
69. Process Models
<after-postprocessing />
<after-preprocessing />
<back-state />
<before-postprocessing />
<before-preprocessing />
<confirmation />
<confirmation-property />
<confirmation-property-list />
<decision-state />
<end-state />
<input />
<input-interface />
<interface />
<mapping />
<object-mapping />
<object-mappings />
<output />
<output-interface />
<parameter />
<parameter-set />
<process />
<process-context />
<process-state-set />
<property-mapping />
<property-mappings />
<request-context />
<start-state />
<subprocess-start-state />
<transition />
<transition-list />
<view-state />
<virtual-properties />
<virtual-property />
70. Restrictions
<error-message-mapping />
<error-message-mapping-set />
<filter-restriction />
<restriction />
<restriction-set />
<validate-if />
71. Scoped Object and List Models
<scoped-domain-object />
<scoped-domain-object-list />
<scoped-domain-object-list-ref />
<scoped-domain-object-ref />
72. Rest Service Models
<rest-service />
<rest-services />
<rest-services-reference />
<rest-services-reference-set />
73. Staging Models
<attachment-configuration />
<attachment-configuration-set />
<content-source />
<content-source-set />
<data-source />
Choosing the correct database schema export mode
<data-source-set />
<logging-configuration />
<mail-service-configuration />
<mail-service-configuration-set />
<proxy-configuration />
<security-configuration />
<stage />
The Data Source Model
The Proxy Configuration Model
<stages />
74. Value Models
<constant />
<count />
<current-property-value />
<geo-point />
<geo-polygon />
<parameters />
<property />
<property-value />
<relation-count />
<size-of />
75. Web Service Models
76. XML Transformation Models
<next-transformer />
<transformer />
<transformer-list />
77. Miscellaneous Models
<setting />
<settings />
<ui-component-setting />
<ui-component-setting-set />

Chapter 48. Actions

<action-list />

Describes a sequential lists of actions. All actions together are executed in one transaction (with configurable parameters). Validation errors abort the execution of the action, rollback the transaction and return to the previous view displaying any errors that occurred.

Attributes of <action-list />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

isolation

Defines the isolation level for transaction isolation. Uses the names defined in Springs DefaultTransactionDefinition class to identify the specific isolation levels.

propagation

Defines the transaction propagation mode for the action block. Uses the names defined in Springs DefaultTransactionDefinition class to identify the specific propagation levels.

Valid inside <action-list /> are: <execute-if />, <auto-complete-filter />, <read-only-if />, <with-filter />, <filter-restriction />, <filter-specification />, <visible-if />, <disabled-if />, <condition />, <validate-if />, <set-property-value />, <dequeue-report />, <webservice />, <transform />, <publish-message />, <iterate-list />, <try />, <aggregate />, <set-active-navigation />, <map-values />, <reset-validation-status />, <reset-cache />, <new />, <system-log />, <audit-trail />, <validation-error />, <execute />, <tag />, <if />, <enqueue-report />, <create-message />, <delete />, <for-each />, <reset-translations />, <set-object />, <send-outgoing-emails />, <connect />, <remove-list />, <email />, <load-list />, <bind />, <disconnect />, <delete-by />, <store />, <call />, <tweet />, <logout />, <next-element />, <validate />, <ignore-validation-results />, <import />, <add-to-list />, <remove />, <switch />, <define-password />

<action-list /> is valid inside: <session-context />, <after-preprocessing />, <try />, <before-preprocessing />, <for-each />, <on-update-refresh />, <transition />, <conversation-context />, <action-list-set />, <case />, <domain-context />, <agent-action />, <before-postprocessing />, <after-postprocessing />, <process-context />

<action-list-set />

If you have frequently used action lists, you should define them in an action list set. You can define such a set within process and portal models. To reference an action list defined in such a set, you have to use the call action, see the section called “<call />” for more information.

[Important]Important

The search order for filter specifications is: process and portal.

Example 48.1. Action List Set

 
 <action-list-set>
     <action-list id="example.action1">
         ...
     </action-list>
     <action-list id="example.action2">
         ...
     </action-list>
     ...
 </action-list-set>

Attributes of <action-list-set />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <action-list-set /> are: <start-action-list />, <action-list />

<action-list-set /> is valid inside: <process />, <portal />

<action-script />

( Additional names: script )

Contains an action script. Can be referenced by the the section called “<execute />” and other scriptable models. Usually you want to surround the action script by a CDATA block in order to keep a sane syntax in the script.

Attributes of <action-script />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <action-script /> is: text content

<actions />

Encapsulates a sequential list of actions. See the section called “<action-list />” for general information about such action lists.

Attributes of <actions />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

isolation

Defines the isolation level for transaction isolation. Uses the names defined in Springs DefaultTransactionDefinition class to identify the specific isolation levels.

propagation

Defines the transaction propagation mode for the action block. Uses the names defined in Springs DefaultTransactionDefinition class to identify the specific propagation levels.

Valid inside <actions /> are: <set-property-value />, <dequeue-report />, <webservice />, <transform />, <publish-message />, <iterate-list />, <try />, <aggregate />, <set-active-navigation />, <map-values />, <reset-validation-status />, <reset-cache />, <new />, <system-log />, <audit-trail />, <validation-error />, <execute />, <tag />, <if />, <enqueue-report />, <create-message />, <delete />, <for-each />, <reset-translations />, <set-object />, <send-outgoing-emails />, <connect />, <remove-list />, <email />, <load-list />, <bind />, <disconnect />, <delete-by />, <store />, <call />, <tweet />, <logout />, <next-element />, <validate />, <ignore-validation-results />, <import />, <add-to-list />, <remove />, <switch />, <define-password />

<actions /> is valid inside: <case />

<add-to-list />

Adds domain objects to a scoped domain object list defined by the list-ref attribute. Either a scoped domain object or a list of new objects that can be configured in the action will be added to the list. It is possible to specify where to insert the object into the list by the index attribute. If no index is specified, the object will be added to the end of the list.

The following example shows how to add a scoped domain object to a list at a given index.

Example 48.2. AddToListAction: Adding a scoped domain object

          
 
 <add-to-list list-ref="scoped.list" 
              scoped-domain-object-ref="scoped.object" 
              index="1" />
  
           
       

The AddToListAction supports also the possibility to add objects that are created inside the action. Therefore you have to define new-object children. Each child represents a single object. The domain type of the object is specified by domain-type-ref. It is possible to set properties of these objects. For that a property-mappings is necessary. Each property-mapping sets one property. The target-ref specifies which property is set and the value attribute defines the value that is set. Following example shows how to add three new objects to a list.

Example 48.3. AddToListAction: Adding new objects to a list

           
 
 <add-to-list list-ref="p_reference_to_scoped_list_element.list">
     <new-object domain-type-ref="domain.a">
         <property-mappings>
             <property-mapping target-ref="domain.a.name" value="First Object" />
         </property-mappings>
     </new-object>
     <new-object domain-type-ref="domain.a">
         <property-mappings>
             <property-mapping target-ref="domain.a.name" value="Second Object" />
         </property-mappings>
     </new-object>
     <new-object domain-type-ref="domain.a">
         <property-mappings>
             <property-mapping target-ref="domain.a.name" value="Third Object" />
         </property-mappings>
     </new-object>
 </add-to-list>
 
               
      

Attention: This action initiates data binding and validation before it is executed.

See also:

Attributes of <add-to-list />
AttributeDescription
action-bean

Defines the action bean to execute. The action bean must implement Action.

action-class

Defines the fully qualified class name for the actual action. The action class must implement Action.

action-script

Defines the action script to execute.

action-script-resource

Defines a action script resource to execute.

description

Defines the description.

id

Defines the GUID of the model.

index

Defines the index where to add the object into the list.

list-ref

Defines the scoped domain object list to that the domain object is added (see the section called “List references”).

requires-binding

Defines whether any parameters send by the client should be bound (and validated).

scoped-domain-object-ref

Defines the reference to the scoped domain object that is added to the list (see the section called “Object references”).

scripting-dialect

Defines the scripting dialect for scripts to be executed. Defaults to groovy.

Valid inside <add-to-list /> are: <new-object />, <execute-if />, <with-filter />

<add-to-list /> is valid inside: <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <actions />, <on-insert />, <catch-validation-error />, <action-list />, <finally />, <on-insert />, <catch-validation-error />, <ignore-validation-results />, <start-action-list />, <action-list />, <finally />

<aggregate />

Aggregates all values related to the target domain object by a given relation into one string value. The source property values of each such object is connected by the given separator to build the result string. The string ist written to the target property of the action.

Attention: This action initiates data binding and validation before it is executed.

Attributes of <aggregate />
AttributeDescription
action-bean

Defines the action bean to execute. The action bean must implement Action.

action-class

Defines the fully qualified class name for the actual action. The action class must implement Action.

action-script

Defines the action script to execute.

action-script-resource

Defines a action script resource to execute.

description

Defines the description.

id

Defines the GUID of the model.

property-ref

Defines the property model ID of the property to be modified.

relation-ref (required)

Defines the relation reference.

requires-binding

Defines whether any parameters send by the client should be bound (and validated).

scripting-dialect

Defines the scripting dialect for scripts to be executed. Defaults to groovy.

separator

Defines the separator.

source-property-ref (required)

Defines the source property reference.

Valid inside <aggregate /> are: <execute-if />, <with-filter />

<aggregate /> is valid inside: <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <actions />, <on-insert />, <catch-validation-error />, <action-list />, <finally />, <on-insert />, <catch-validation-error />, <ignore-validation-results />, <start-action-list />, <action-list />, <finally />

<audit-trail />

Audits either the source domain object or the referenced scoped domain object. Auditing according to the given audit mode will write data to the audit log if either the given object was changed or the audit mode requires a write operation in any case. Again depending on the mode either only the object or the object and all referenced (dependent) objects will be logged in the audit log table. Use the administration processes to examine the content of the audit logs and refer to the OpenSAGA base models in order to add specialized behaviour.

Attention: This action initiates data binding and validation before it is executed.

Attributes of <audit-trail />
AttributeDescription
action-bean

Defines the action bean to execute. The action bean must implement Action.

action-class

Defines the fully qualified class name for the actual action. The action class must implement Action.

action-script

Defines the action script to execute.

action-script-resource

Defines a action script resource to execute.

audit-trail-mode

Defines the audit trail mode.

audit-trail-relation-ref

Defines the audit trail relation reference.

description

Defines the description.

id

Defines the GUID of the model.

operation-name

Defines the operation name.

requires-binding

Defines whether any parameters send by the client should be bound (and validated).

scoped-domain-object-ref

Defines the scoped domain object reference.

scripting-dialect

Defines the scripting dialect for scripts to be executed. Defaults to groovy.

Valid inside <audit-trail /> are: <relation-chain-list />, <execute-if />, <with-filter />

<audit-trail /> is valid inside: <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <actions />, <on-insert />, <catch-validation-error />, <action-list />, <finally />, <on-insert />, <catch-validation-error />, <ignore-validation-results />, <start-action-list />, <action-list />, <finally />

<bind />

Implements the bind action. This is not an actual action, but just a marker to indicate that binding has to take place. Validation also occurs.

Attributes of <bind />
AttributeDescription
action-bean

Defines the action bean to execute. The action bean must implement Action.

action-class

Defines the fully qualified class name for the actual action. The action class must implement Action.

action-script

Defines the action script to execute.

action-script-resource

Defines a action script resource to execute.

description

Defines the description.

id

Defines the GUID of the model.

requires-binding

Defines whether any parameters send by the client should be bound (and validated).

scripting-dialect

Defines the scripting dialect for scripts to be executed. Defaults to groovy.

Valid inside <bind /> are: <execute-if />, <with-filter />

<bind /> is valid inside: <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <actions />, <on-insert />, <catch-validation-error />, <action-list />, <finally />, <on-insert />, <catch-validation-error />, <ignore-validation-results />, <start-action-list />, <action-list />, <finally />

<call />

This action executes a predefined action list that are defined in the portal model or in a process model (for more information see the section called “<action-list-set />”).

Attributes of <call />
AttributeDescription
action-bean

Defines the action bean to execute. The action bean must implement Action.

action-class

Defines the fully qualified class name for the actual action. The action class must implement Action.

action-list-ref

Defines the reference to the action list that is executed by this action

action-script

Defines the action script to execute.

action-script-resource

Defines a action script resource to execute.

description

Defines the description.

id

Defines the GUID of the model.

requires-binding

Defines whether any parameters send by the client should be bound (and validated).

scripting-dialect

Defines the scripting dialect for scripts to be executed. Defaults to groovy.

Valid inside <call /> are: <execute-if />, <with-filter />

<call /> is valid inside: <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <actions />, <on-insert />, <catch-validation-error />, <action-list />, <finally />, <on-insert />, <catch-validation-error />, <ignore-validation-results />, <start-action-list />, <action-list />, <finally />

<catch-exception />

Implements CatchExceptionModel as the optional third part of a try...catch...finally action. The code in this block will be executed when an exception was thrown during the action list being tried.

The catch-exception tag contains a list of actions and is itself an the section called “<actions />” allowing various options for finetuning the actions.

The following example shows how to use this tag.

 <try>
   ...
   <catch-exception ...>
        <some-action .../>
        ...
   </catch-exception>
   ...
 </try>
 

The catch-exception tag allows various parameters which are explained below.

Catching all exceptions

If you want to catch any kind of exception the following code is sufficient:

   <catch-exception>
        ...
   </catch-exception>
 

All exceptions will be caught by this block and the contained action list will execute.

Catching one specific exception

If you want to catch one specific exception the following code should be used:

   <catch-exception exception-type="foo.bar.BazException">
        ...
   </catch-exception>
 

The specific foo.bar.BazException will be caught and execute the contained action list.

Catching one specific exception (simplified)

If you want to catch one specific exception class (identified by name) the following code should be used:

   <catch-exception exception-type="BazException">
        ...
   </catch-exception>
 

The specific BazException will be caught and execute the contained action list. This variant ignores the package of the exception - so it either should only be used if you are sure that but one exception of the given type exists or that all types are valid for your concern.

Catching a category of exceptions

If you want to catch all exceptions defined in a specific package the following code should be used:

   <catch-exception exception-type="foo.bar.*">
        ...
   </catch-exception>
 

All exceptions contained in the package foo.bar (or one of its subpackages) will be caught and execute the contained action list. Make sure that you know which exceptions are contained in those packages!

Catching exception combinations

If you want to catch all exceptions defined in a specific package the following code should be used:

   <catch-exception exception-type="foo.bar.*,Baz,bar.foo.FrozzException">
        ...
   </catch-exception>
 

Combines the various exception patterns explained above and executes the contained action list if at least one of them executes.

Attributes of <catch-exception />
AttributeDescription
description

Defines the description.

exception-type

Defines the pattern describing the exceptions to be caught.

id

Defines the GUID of the model.

isolation

Defines the isolation level for transaction isolation. Uses the names defined in Springs DefaultTransactionDefinition class to identify the specific isolation levels.

propagation

Defines the transaction propagation mode for the action block. Uses the names defined in Springs DefaultTransactionDefinition class to identify the specific propagation levels.

Valid inside <catch-exception /> are: <set-property-value />, <dequeue-report />, <webservice />, <transform />, <publish-message />, <iterate-list />, <try />, <aggregate />, <set-active-navigation />, <map-values />, <reset-validation-status />, <reset-cache />, <new />, <system-log />, <audit-trail />, <validation-error />, <execute />, <tag />, <if />, <enqueue-report />, <create-message />, <delete />, <for-each />, <reset-translations />, <set-object />, <send-outgoing-emails />, <connect />, <remove-list />, <email />, <load-list />, <bind />, <disconnect />, <delete-by />, <store />, <call />, <tweet />, <logout />, <next-element />, <validate />, <ignore-validation-results />, <import />, <add-to-list />, <remove />, <switch />, <define-password />

<catch-exception /> is valid inside: <try />, <case />

<catch-validation-error />

Implements CatchValidationErrorModel as the optional second part of a try...catch...finally action. The code in this block will be executed when a validation error occurred during the action list being tried.

The catch-validation-error tag contains a list of actions and is itself an the section called “<actions />” allowing various options for finetuning the actions.

The following example shows how to use this tag.

 <try>
   ...
   <catch-validation-error>
        <some-action .../>
        ...
   </catch-validation-error>
   ...
 </try>
 

Attributes of <catch-validation-error />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

isolation

Defines the isolation level for transaction isolation. Uses the names defined in Springs DefaultTransactionDefinition class to identify the specific isolation levels.

propagation

Defines the transaction propagation mode for the action block. Uses the names defined in Springs DefaultTransactionDefinition class to identify the specific propagation levels.

Valid inside <catch-validation-error /> are: <set-property-value />, <dequeue-report />, <webservice />, <transform />, <publish-message />, <iterate-list />, <try />, <aggregate />, <set-active-navigation />, <map-values />, <reset-validation-status />, <reset-cache />, <new />, <system-log />, <audit-trail />, <validation-error />, <execute />, <tag />, <if />, <enqueue-report />, <create-message />, <delete />, <for-each />, <reset-translations />, <set-object />, <send-outgoing-emails />, <connect />, <remove-list />, <email />, <load-list />, <bind />, <disconnect />, <delete-by />, <store />, <call />, <tweet />, <logout />, <next-element />, <validate />, <ignore-validation-results />, <import />, <add-to-list />, <remove />, <switch />, <define-password />

<catch-validation-error /> is valid inside: <try />, <case />

<condition />

Defines the "condition" block of an the section called “<if />”. It works like filter-specification.

See also:

  • FilterSpecificationModelImp

Attributes of <condition />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <condition /> are: <greater-than />, <is-property-modified />, <and />, <geo-within />, <matches />, <user-logged-in />, <validation-failed />, <complies-to />, <criterion />, <less-than-or-equal-to />, <has-current-element />, <is-undefined />, <has-changed />, <or />, <is-connected-to />, <can-access />, <ends-with />, <geo-contains />, <has-permission />, <contains-comparator />, <starts-with />, <not />, <equals />, <is-new />, <has-elements />, <dynamic-condition />, <true />, <less-than />, <in />, <include />, <in-transition />, <filter-pattern />, <has-type />, <greater-than-or-equal-to />, <is-super-user />, <false />, <is-defined />, <filter-pattern-set />

<condition /> is valid inside: <external-excel-domain-type />, <external-relational-domain-type />, <count />, <filter-specification-set />, <joined-domain-type />, <if />, <constant-domain-type />, <start-action-list />, <external-excel-domain-type />, <external-relational-domain-type />, <joined-domain-type />, <constant-domain-type />, <domain-type />, <wfs-domain-type />, <request-context />, <radio-buttons />, <multi-connect />, <tree-connect />, <transition />, <list-iterator />, <case />, <wfs-domain-type />, <multi-connect />, <single-connect />, <relation-reference />, <has-elements />, <filtered-list />, <agent-action />, <datagrid />, <start-action-list />, <action-list />, <radio-buttons />, <select-field />, <request-context />, <cell-format />

<connect />

Implements the connect action. Creates a relational dependency between two or more objects. Note that all objects need to be stored if you want to persistently create the connection by using the the section called “<store />”.

connect can work in one of the following ways:

  1. Connect one object to another:

    <connect source-ref="..." target-ref="..." relation-ref="..."/>

  2. Connect one source object to each of the listed objects (connecting source to the list elements via the given relation):

        
          <connect source-ref="..." relation-ref="...">
              <filtered-list>
                  ...
              </filtered-list>
          </connect>
        
      

  3. Connecting each list element to the target object via the given relation:

        
          <connect target-ref="..." relation-ref="...">
              <filtered-list>
                  ...
              </filtered-list>
          </connect>
        
      
    Current special case: If neither source nor target reference are defined, this case is executed and the target object is RequestContext#getTargetDomainObject().

  4. Alternatively the filtered-list in each of the previous examples can be replaced by the attribute list-ref, e.g.

        
          <connect target-ref="..." relation-ref="..." list-ref="..."/>
        
      

  5. Finally the mode for the connection process can be configured via the attribute mode and one of the following values:

    • replace: Removes all existing relational connections for the source object and adds the new connections.

    • add: Adds the missing connections between source and target.

    The default mode is "add".

Attention: This action initiates data binding and validation before it is executed.

See the the section called “<disconnect />” for details on how to remove relational dependencies between objects.

Attributes of <connect />
AttributeDescription
action-bean

Defines the action bean to execute. The action bean must implement Action.

action-class

Defines the fully qualified class name for the actual action. The action class must implement Action.

action-script

Defines the action script to execute.

action-script-resource

Defines a action script resource to execute.

description

Defines the description.

id

Defines the GUID of the model.

list-ref

Defines a reference to a scoped list.

mode

Defines the connection mode.

object-ref

Defines a reference to a scoped object.

relation-ref

Defines the relation reference.

requires-binding

Defines whether any parameters send by the client should be bound (and validated).

scripting-dialect

Defines the scripting dialect for scripts to be executed. Defaults to groovy.

source-ref

Defines the source object reference.

target-ref

Defines the target object reference.

Valid inside <connect /> are: <filtered-list />, <execute-if />, <with-filter />

<connect /> is valid inside: <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <actions />, <on-insert />, <catch-validation-error />, <action-list />, <finally />, <on-insert />, <catch-validation-error />, <ignore-validation-results />, <start-action-list />, <action-list />, <finally />

<create-message />

Attributes of <create-message />
AttributeDescription
action-bean

Defines the action bean to execute. The action bean must implement Action.

action-class

Defines the fully qualified class name for the actual action. The action class must implement Action.

action-script

Defines the action script to execute.

action-script-resource

Defines a action script resource to execute.

description

Defines the description.

icon
id

Defines the GUID of the model.

message-id
requires-binding

Defines whether any parameters send by the client should be bound (and validated).

resource
scripting-dialect

Defines the scripting dialect for scripts to be executed. Defaults to groovy.

text
type

Valid inside <create-message /> are: <message-parameter />, <execute-if />, <with-filter />

<create-message /> is valid inside: <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <actions />, <on-insert />, <catch-validation-error />, <action-list />, <finally />, <on-insert />, <catch-validation-error />, <ignore-validation-results />, <start-action-list />, <action-list />, <finally />

<default />

Implements the "default" part of a switch statement, see the section called “<switch />” and

Attributes of <default />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

isolation

Defines the isolation level for transaction isolation. Uses the names defined in Springs DefaultTransactionDefinition class to identify the specific isolation levels.

propagation

Defines the transaction propagation mode for the action block. Uses the names defined in Springs DefaultTransactionDefinition class to identify the specific propagation levels.

Valid inside <default /> are: <set-property-value />, <dequeue-report />, <webservice />, <transform />, <publish-message />, <iterate-list />, <try />, <aggregate />, <set-active-navigation />, <map-values />, <reset-validation-status />, <reset-cache />, <new />, <system-log />, <audit-trail />, <validation-error />, <execute />, <tag />, <if />, <enqueue-report />, <create-message />, <delete />, <for-each />, <reset-translations />, <set-object />, <send-outgoing-emails />, <connect />, <remove-list />, <email />, <load-list />, <bind />, <disconnect />, <delete-by />, <store />, <call />, <tweet />, <logout />, <next-element />, <validate />, <ignore-validation-results />, <import />, <add-to-list />, <remove />, <switch />, <define-password />

<default /> is valid inside: <case />, <switch />

<define-password />

Creates a new password value for a given property.^The salt source

Attention: This action initiates data binding and validation before it is executed.

Attributes of <define-password />
AttributeDescription
action-bean

Defines the action bean to execute. The action bean must implement Action.

action-class

Defines the fully qualified class name for the actual action. The action class must implement Action.

action-script

Defines the action script to execute.

action-script-resource

Defines a action script resource to execute.

description

Defines the description.

id

Defines the GUID of the model.

property-ref

Defines the property model ID of the property to be modified.

requires-binding

Defines whether any parameters send by the client should be bound (and validated).

salt-source-ref

Sets the salt-source reference.

scripting-dialect

Defines the scripting dialect for scripts to be executed. Defaults to groovy.

Valid inside <define-password /> are: <execute-if />, <with-filter />

<define-password /> is valid inside: <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <actions />, <on-insert />, <catch-validation-error />, <action-list />, <finally />, <on-insert />, <catch-validation-error />, <ignore-validation-results />, <start-action-list />, <action-list />, <finally />

<delete />

Deletes either the current domain object (either logically or physically depending on the deletion mode) or domain objects related with the current domain object, when a relation-chain-list is specified. The delete action provides also cascading deletion. When the cascade attribute is set to true, all domain objects of the relation chain inclusive the current domain object are deleted.

Following example shows how to delete the current domain object.

Example 48.4. Deletes the current domain object

 <action-list>
     <delete/>
 </action-list>
 
      

Following example shows how to delete related domain object. In the process only the domain objects of the last relation of each specified relation chain will be deleted. For the example it means that all domain object of type c that are related to a b domain object which is again related to the current domain object (of type a) will be deleted.

Example 48.5. Deletes

 <action-list>
     <delete>
         <relation-chain-list>
             <relation-chain>
                 <relation-reference relation-ref="portal.domain.a.relation.b" />
                 <relation-reference relation-ref="portal.domain.b.relation.c" />
             </relation-chain>
         </relation-chain-list>
         ...
     </delete>
 </action-list>
      

To delete all objects of the relation chain described in the example above, you have to set the cascade attribute to true. In this way all connected domain objects of domain type c and b and the root domain object are deleted.

Example 48.6. Deletes domain objects cascaded

 <action-list>
     <delete cascade="true">
         <relation-chain-list>
             <relation-chain>
                 <relation-reference relation-ref="portal.domain.a.relation.b" />
                 <relation-reference relation-ref="portal.domain.b.relation.c" />
             </relation-chain>
         </relation-chain-list>
         ...
     </delete>
 </action-list>
      

Attention: This action initiates data binding and validation before it is executed.

See also{@linkRelationReferenceChainListModelImpl} and{@linkDeleteByActionModel}.

Attributes of <delete />
AttributeDescription
action-bean

Defines the action bean to execute. The action bean must implement Action.

action-class

Defines the fully qualified class name for the actual action. The action class must implement Action.

action-script

Defines the action script to execute.

action-script-resource

Defines a action script resource to execute.

cascade

Defines whether the objects of the relation chain are deleted cascaded (true) or only the last objects of the relation chain are deleted (false). The default value is false.

description

Defines the description.

disconnect-before-deletion

Defines a flag indicating if all connections of the domain object should be disconnected before deletion.

id

Defines the GUID of the model.

list-ref

Defines a reference to a scoped list.

object-ref

Defines a reference to a scoped object.

requires-binding

Defines whether any parameters send by the client should be bound (and validated).

scripting-dialect

Defines the scripting dialect for scripts to be executed. Defaults to groovy.

Valid inside <delete /> are: <relation-chain-list />, <filtered-list />, <execute-if />, <with-filter />

<delete /> is valid inside: <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <actions />, <on-insert />, <catch-validation-error />, <action-list />, <finally />, <on-insert />, <catch-validation-error />, <ignore-validation-results />, <start-action-list />, <action-list />, <finally />

<delete-by />

Deletes domain objects of a given type (either logically or physically depending on the deletion mode). If a filter specification is provided to the action only the objects that match the filter are deleted, otherwise all objects are deleted.

The following example shows how to delete all objects of a given domain type.

Example 48.7. DeleteByAction: Delete all domain objects of a given type

          <delete-by domain-type-ref="domain.location"/>
      

Instead of deleting all domain objects of a given type you can also define a filter specification so that the delete by action only deletes the objects which match the filter.

Example 48.8. DeleteByAction: Delete domain objects with a given filter specification

 <delete-by domain-type-ref="domain.location">
      <with-filter>
          <filter-specification>
              <starts-with>
                  <property-value property-ref="domain.location.zip"/>
                  <constant value="4" />
               </starts-with>
          </filter-specification>
      </with-filter>
 </delete-by>
      

Attention: This action initiates data binding and validation before it is executed.

See also:

Attributes of <delete-by />
AttributeDescription
action-bean

Defines the action bean to execute. The action bean must implement Action.

action-class

Defines the fully qualified class name for the actual action. The action class must implement Action.

action-script

Defines the action script to execute.

action-script-resource

Defines a action script resource to execute.

description

Defines the description.

domain-type-ref (required)

Defines the domain type of the domain objects that are deleted by this action.

id

Defines the GUID of the model.

requires-binding

Defines whether any parameters send by the client should be bound (and validated).

scripting-dialect

Defines the scripting dialect for scripts to be executed. Defaults to groovy.

Valid inside <delete-by /> are: <execute-if />, <with-filter />

<delete-by /> is valid inside: <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <actions />, <on-insert />, <catch-validation-error />, <action-list />, <finally />, <on-insert />, <catch-validation-error />, <ignore-validation-results />, <start-action-list />, <action-list />, <finally />

<dequeue-report />

Currently under construction. Do no yet use!

Attributes of <dequeue-report />
AttributeDescription
action-bean

Defines the action bean to execute. The action bean must implement Action.

action-class

Defines the fully qualified class name for the actual action. The action class must implement Action.

action-script

Defines the action script to execute.

action-script-resource

Defines a action script resource to execute.

description

Defines the description.

id

Defines the GUID of the model.

requires-binding

Defines whether any parameters send by the client should be bound (and validated).

scripting-dialect

Defines the scripting dialect for scripts to be executed. Defaults to groovy.

Valid inside <dequeue-report /> are: <execute-if />, <with-filter />

<dequeue-report /> is valid inside: <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <actions />, <on-insert />, <catch-validation-error />, <action-list />, <finally />, <on-insert />, <catch-validation-error />, <ignore-validation-results />, <start-action-list />, <action-list />, <finally />

<disconnect />

Disconnects a source domain object (either the current domain object or a referenced domain object) from another domain objects. Thereby you can disconnect the source domain object either from a specified domain object or from a set of directly or indirectly related domain objects.

Following example shows how to disconnect the current domain object from a specified domain object.

Example 48.9. Disconnects the current domain object from a specified object

 <action-list>    
     <disconnect target-object-ref="object.ref.b" 
                 relation-ref="portal.domain.a.relation.b" />
 </action-list>
      

Following example shows how to disconnect a cached domain object from a another one.

Example 48.10. Disconnects a cached domain object from a another one

 <action-list>    
     <disconnect source-object-ref="object.ref.a"
                 target-object-ref="object.ref.b" 
                 relation-ref="portal.domain.a.relation.b" />
 </action-list>
      

To disconnect the current domain object from a set of related domain objects, you have to specify a relation-chain-list with containing relation-chains. Only the last domain objects of each relation chain (so the domain objects that are related by the last relation model) are disconnected.

Example 48.11. Disconnect the current domain object from a set of related domain objects

 <action-list>
     <disconnect>
         <relation-chain-list>
             <relation-chain>
                 <relation-reference relation-ref="portal.domain.a.relation.b" />
                 <relation-reference relation-ref="portal.domain.b.relation.c" />
             </relation-chain>
         </relation-chain-list>
         ...
     </disconnect>
 </action-list>
      

Attention: This action initiates data binding and validation before it is executed.

See also the section called “<relation-chain-list />” and{@linkRelationReferenceChainModelImpl} for more details.

Attributes of <disconnect />
AttributeDescription
action-bean

Defines the action bean to execute. The action bean must implement Action.

action-class

Defines the fully qualified class name for the actual action. The action class must implement Action.

action-script

Defines the action script to execute.

action-script-resource

Defines a action script resource to execute.

description

Defines the description.

id

Defines the GUID of the model.

relation-ref

Defines the relation between the source and target object. This attribute will be ignored when a relation-chain-list is specified.

requires-binding

Defines whether any parameters send by the client should be bound (and validated).

scripting-dialect

Defines the scripting dialect for scripts to be executed. Defaults to groovy.

source-object-ref

Defines the source object. References a cached domain object (see the section called “Object references”). If no source object is defined, the current domain object is used as source object.

target-object-ref

Defines the target object that is disconnect from the source object. References a cached domain object (see the section called “Object references”). This attribute will be ignored when a relation-chain-list is specified.

Valid inside <disconnect /> are: <relation-chain-list />, <execute-if />, <with-filter />

<disconnect /> is valid inside: <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <actions />, <on-insert />, <catch-validation-error />, <action-list />, <finally />, <on-insert />, <catch-validation-error />, <ignore-validation-results />, <start-action-list />, <action-list />, <finally />

<else />

Implements the "else" block of an the section called “<if />”.

Attributes of <else />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

isolation

Defines the isolation level for transaction isolation. Uses the names defined in Springs DefaultTransactionDefinition class to identify the specific isolation levels.

propagation

Defines the transaction propagation mode for the action block. Uses the names defined in Springs DefaultTransactionDefinition class to identify the specific propagation levels.

Valid inside <else /> are: <set-property-value />, <dequeue-report />, <webservice />, <transform />, <publish-message />, <iterate-list />, <try />, <aggregate />, <set-active-navigation />, <map-values />, <reset-validation-status />, <reset-cache />, <new />, <system-log />, <audit-trail />, <validation-error />, <execute />, <tag />, <if />, <enqueue-report />, <create-message />, <delete />, <for-each />, <reset-translations />, <set-object />, <send-outgoing-emails />, <connect />, <remove-list />, <email />, <load-list />, <bind />, <disconnect />, <delete-by />, <store />, <call />, <tweet />, <logout />, <next-element />, <validate />, <ignore-validation-results />, <import />, <add-to-list />, <remove />, <switch />, <define-password />

<else /> is valid inside: <if />, <case />

<email />

Implements the email action. Emails are sent from someone to someone (as defined by the referenced properties), contain a subject and a mail body. The mail body is generated from a given template using Freemarker markup. The email action provides access to the context of the action by adding several maps to the template evaluation context:

  • v is a map mapping all property IDs to the actual property values for all properties of domain objects contained in the source view, as well as all request paramater (name, value) pairs

  • fv is a map mapping all property IDs to the formatted property values (according to the current runtime locale) for all properties of domain objects contained in the source view

Attention: This action initiates data binding and validation before it is executed.

Attributes of <email />
AttributeDescription
action-bean

Defines the action bean to execute. The action bean must implement Action.

action-class

Defines the fully qualified class name for the actual action. The action class must implement Action.

action-script

Defines the action script to execute.

action-script-resource

Defines a action script resource to execute.

description

Defines the description.

from

Sets the email-from parameter.

from-ref

Sets the from-reference.

id

Defines the GUID of the model.

list-ref

Defines a reference to a scoped list.

mail-service-ref

Sets the mail service reference

object-ref

Defines a reference to a scoped object.

requires-binding

Defines whether any parameters send by the client should be bound (and validated).

scripting-dialect

Defines the scripting dialect for scripts to be executed. Defaults to groovy.

subject

Sets the subject.

template

Sets the template.

to

Sets the email-to parameter.

to-ref

Sets the to-reference.

Valid inside <email /> are: <parameter-set />, <filtered-list />, <execute-if />, <with-filter />

<email /> is valid inside: <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <actions />, <on-insert />, <catch-validation-error />, <action-list />, <finally />, <on-insert />, <catch-validation-error />, <ignore-validation-results />, <start-action-list />, <action-list />, <finally />

<enqueue-report />

currently under construction ... Action model for a report registration within the queue of reports to deal with later. An embedded report generation specification or a reference to a global one has to be defined.

Attributes of <enqueue-report />
AttributeDescription
action-bean

Defines the action bean to execute. The action bean must implement Action.

action-class

Defines the fully qualified class name for the actual action. The action class must implement Action.

action-script

Defines the action script to execute.

action-script-resource

Defines a action script resource to execute.

description

Defines the description.

id

Defines the GUID of the model.

report-generation-specification-ref

Sets the reference to a globally used report generation specification.

requires-binding

Defines whether any parameters send by the client should be bound (and validated).

scripting-dialect

Defines the scripting dialect for scripts to be executed. Defaults to groovy.

Valid inside <enqueue-report /> are: <execute-if />, <with-filter />

<enqueue-report /> is valid inside: <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <actions />, <on-insert />, <catch-validation-error />, <action-list />, <finally />, <on-insert />, <catch-validation-error />, <ignore-validation-results />, <start-action-list />, <action-list />, <finally />

<execute />

Custom business logic preferrably will be embedded into a OpenSAGA project by using the execute action. The following example shows two different ways of executing scripts, other means also are available - see the full attribute reference below.

 <action-list>
      <execute action-script="System.out.println('HelloG')"/>
      <execute action-script="System.out.println(new StringBuilder()
                               .append('H').append('e').append('l')
                               .append('l').append('o')
                               .append('B').toString());"
               scripting-dialect="bsh"/>
 </action-list>
 

Additionally custom logic can be executed by either executing an action bean defined in some Spring context of your extension the only requirement being that the action bean implements the Action interface. Finally you can provide just a class name and the class also needs to implement the Action interface. The latter way is the least preferred as it denies you any means to have services, etc. injected into the class instance. Additionally it is the most costly way of executing business logic since class instances will be created for every call.

Attention: This action initiates data binding and validation before it is executed.

See also:

Attributes of <execute />
AttributeDescription
action-bean

Defines the action bean to execute. The action bean must implement Action.

action-class

Defines the fully qualified class name for the actual action. The action class must implement Action.

action-script

Defines the action script to execute.

action-script-resource

Defines a action script resource to execute.

description

Defines the description.

id

Defines the GUID of the model.

requires-binding

Defines whether any parameters send by the client should be bound (and validated).

scripting-dialect

Defines the scripting dialect for scripts to be executed. Defaults to groovy.

Valid inside <execute /> are: <script />, <parameter-set />, <execute-if />, <with-filter />

<execute /> is valid inside: <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <actions />, <on-insert />, <catch-validation-error />, <action-list />, <finally />, <on-insert />, <catch-validation-error />, <ignore-validation-results />, <start-action-list />, <action-list />, <finally />

<execute-if />

Can be added as a modifier to all other actions to decide if the specific action should be executed given the current runtime context. See the section called “<filter-specification />” for more generic information about how to use filters.

Attributes of <execute-if />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <execute-if /> are: <greater-than />, <is-property-modified />, <and />, <geo-within />, <matches />, <user-logged-in />, <validation-failed />, <complies-to />, <criterion />, <less-than-or-equal-to />, <has-current-element />, <is-undefined />, <has-changed />, <or />, <is-connected-to />, <can-access />, <ends-with />, <geo-contains />, <has-permission />, <contains-comparator />, <starts-with />, <not />, <equals />, <is-new />, <has-elements />, <dynamic-condition />, <true />, <less-than />, <in />, <include />, <in-transition />, <filter-pattern />, <has-type />, <greater-than-or-equal-to />, <is-super-user />, <false />, <is-defined />, <filter-pattern-set />

<execute-if /> is valid inside: <set-property-value />, <external-excel-domain-type />, <dequeue-report />, <webservice />, <transform />, <external-relational-domain-type />, <count />, <filter-specification-set />, <publish-message />, <iterate-list />, <try />, <aggregate />, <set-active-navigation />, <map-values />, <reset-validation-status />, <reset-cache />, <new />, <joined-domain-type />, <system-log />, <audit-trail />, <validation-error />, <execute />, <tag />, <if />, <enqueue-report />, <create-message />, <delete />, <constant-domain-type />, <start-action-list />, <external-excel-domain-type />, <external-relational-domain-type />, <joined-domain-type />, <constant-domain-type />, <domain-type />, <wfs-domain-type />, <request-context />, <for-each />, <reset-translations />, <radio-buttons />, <multi-connect />, <tree-connect />, <transition />, <list-iterator />, <set-object />, <case />, <wfs-domain-type />, <send-outgoing-emails />, <connect />, <multi-connect />, <single-connect />, <remove-list />, <relation-reference />, <email />, <load-list />, <bind />, <disconnect />, <has-elements />, <filtered-list />, <delete-by />, <store />, <call />, <tweet />, <logout />, <next-element />, <validate />, <ignore-validation-results />, <agent-action />, <datagrid />, <start-action-list />, <action-list />, <radio-buttons />, <select-field />, <request-context />, <import />, <cell-format />, <add-to-list />, <remove />, <switch />, <define-password />

<finally />

Implements FinallyModel as the optional third part of a try...catch...finally action. The code in the finally block will be executed in any case not caring for whether a validation error or some kind of exception occurred. It is guaranteed to be executed last.

The finally tag contains a list of actions and is itself an the section called “<actions />” allowing various options for finetuning the actions.

The following example shows how to use this tag.

 <try>
   ...
   <finally>
        <some-action .../>
        ...
   </finally>
 </try>
 

Attributes of <finally />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

isolation

Defines the isolation level for transaction isolation. Uses the names defined in Springs DefaultTransactionDefinition class to identify the specific isolation levels.

propagation

Defines the transaction propagation mode for the action block. Uses the names defined in Springs DefaultTransactionDefinition class to identify the specific propagation levels.

Valid inside <finally /> are: <set-property-value />, <dequeue-report />, <webservice />, <transform />, <publish-message />, <iterate-list />, <try />, <aggregate />, <set-active-navigation />, <map-values />, <reset-validation-status />, <reset-cache />, <new />, <system-log />, <audit-trail />, <validation-error />, <execute />, <tag />, <if />, <enqueue-report />, <create-message />, <delete />, <for-each />, <reset-translations />, <set-object />, <send-outgoing-emails />, <connect />, <remove-list />, <email />, <load-list />, <bind />, <disconnect />, <delete-by />, <store />, <call />, <tweet />, <logout />, <next-element />, <validate />, <ignore-validation-results />, <import />, <add-to-list />, <remove />, <switch />, <define-password />

<finally /> is valid inside: <try />, <case />

<for-each />

Implements the for-each action. Each object identified by the contained the section called “<filtered-list />” will be used as the target domain object for the action list specified as the content of this model. See the section called “<action-list />” for more details about executing action lists.

Attention: This action initiates data binding and validation before it is executed.

Attributes of <for-each />
AttributeDescription
action-bean

Defines the action bean to execute. The action bean must implement Action.

action-class

Defines the fully qualified class name for the actual action. The action class must implement Action.

action-script

Defines the action script to execute.

action-script-resource

Defines a action script resource to execute.

description

Defines the description.

id

Defines the GUID of the model.

list-ref

Defines a reference to a scoped list.

object-ref

Defines a reference to a scoped object.

requires-binding

Defines whether any parameters send by the client should be bound (and validated).

scripting-dialect

Defines the scripting dialect for scripts to be executed. Defaults to groovy.

Valid inside <for-each /> are: <start-action-list />, <action-list />, <filtered-list />, <execute-if />, <with-filter />

<for-each /> is valid inside: <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <actions />, <on-insert />, <catch-validation-error />, <action-list />, <finally />, <on-insert />, <catch-validation-error />, <ignore-validation-results />, <start-action-list />, <action-list />, <finally />

<if />

Defines the classical "if-then-else" sequence. See the section called “<condition />”, the section called “<then />” and the section called “<else />” for details about the contained submodels.

Attention: This action initiates data binding and validation before it is executed.

Attributes of <if />
AttributeDescription
action-bean

Defines the action bean to execute. The action bean must implement Action.

action-class

Defines the fully qualified class name for the actual action. The action class must implement Action.

action-script

Defines the action script to execute.

action-script-resource

Defines a action script resource to execute.

description

Defines the description.

id

Defines the GUID of the model.

requires-binding

Defines whether any parameters send by the client should be bound (and validated).

scripting-dialect

Defines the scripting dialect for scripts to be executed. Defaults to groovy.

Valid inside <if /> are: <condition />, <then />, <else />, <execute-if />, <with-filter />

<if /> is valid inside: <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <actions />, <on-insert />, <catch-validation-error />, <action-list />, <finally />, <on-insert />, <catch-validation-error />, <ignore-validation-results />, <start-action-list />, <action-list />, <finally />

<ignore-validation-results />

Implements an action that wraps another action list and executes all contained actions without interrupting execution when validation errors occur. This allows to gather a series of validation errors when e.g. doing view validation instead of being interrupted as soon as the first error is discovered.

The following example illustrates the usage of this action:

 <ignore-validation-results>
     <some-action ... />
     <some-other-action .../>
     ...
 </ignore-validation-results>

All wrapped actions will be executed and only after the ignore-validation-results action block will the current validation status of the request be taken into consideration.

Attributes of <ignore-validation-results />
AttributeDescription
action-bean

Defines the action bean to execute. The action bean must implement Action.

action-class

Defines the fully qualified class name for the actual action. The action class must implement Action.

action-script

Defines the action script to execute.

action-script-resource

Defines a action script resource to execute.

description

Defines the description.

id

Defines the GUID of the model.

isolation

Defines the isolation level for transaction isolation. Uses the names defined in Springs DefaultTransactionDefinition class to identify the specific isolation levels.

propagation

Defines the transaction propagation mode for the action block. Uses the names defined in Springs DefaultTransactionDefinition class to identify the specific propagation levels.

requires-binding

Defines whether any parameters send by the client should be bound (and validated).

scripting-dialect

Defines the scripting dialect for scripts to be executed. Defaults to groovy.

Valid inside <ignore-validation-results /> are: <set-property-value />, <dequeue-report />, <webservice />, <transform />, <publish-message />, <iterate-list />, <try />, <aggregate />, <set-active-navigation />, <map-values />, <reset-validation-status />, <reset-cache />, <new />, <system-log />, <audit-trail />, <validation-error />, <execute />, <tag />, <if />, <enqueue-report />, <create-message />, <delete />, <for-each />, <reset-translations />, <set-object />, <send-outgoing-emails />, <connect />, <remove-list />, <email />, <load-list />, <bind />, <disconnect />, <delete-by />, <store />, <call />, <tweet />, <logout />, <next-element />, <validate />, <ignore-validation-results />, <import />, <add-to-list />, <remove />, <switch />, <define-password />, <execute-if />, <with-filter />

<ignore-validation-results /> is valid inside: <else />, <default />, <then />, <start-action-list />, <on-update />, <case />, <catch-exception />, <on-delete />, <on-create />, <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <actions />, <on-insert />, <catch-validation-error />, <action-list />, <finally />, <on-insert />, <catch-validation-error />, <ignore-validation-results />, <start-action-list />, <action-list />, <finally />

<import />

The ImportAction provides importing data to a domain type from either another domain type (the section called “Domain type import”) or a xml resource (the section called “XML import”). Following sections describe the different options and modes of importing.

Import Mode

The ImportAction provides two import modes 'replace' and 'update'. The default mode is 'update'.

The 'replace' mode deletes all domain objects of the domain type defined in to-domain-type-ref and then imports the data.

The 'update' mode checks first if the importing data set already exists by searching a domain object with the same primary key. If a domain object exists, the domain object will be updated, otherwise a new one will be created.

[Important]Important

When the import mode is 'update' the primary key of the to-domain-type must not be auto generated.

Domain type import

For importing data from another domain type, you have to specify the domain type of the importing domain objects in the from-domain-type-ref. Furthermore a property mapping is required that defines which property value of the from-domain-type is stored in which property of the to-domain-type. The PropertyMappingsModel is defined within a MappingModel. Following an example import is shown:

Example 48.12. ImportAction: import from a domain type

 <import import-mode="replace" 
         from-domain-type-ref="domain.location" 
         to-domain-type-ref="domain.import_target" >
     <mapping>
         <property-mappings>
             <property-mapping source-ref="domain.location.guid" 
                               target-ref="domain.import_target.guid"/>
             <property-mapping source-ref="domain.location.code_uni" 
                               target-ref="domain.import_target.code_uni"/>
             <property-mapping source-ref="domain.location.longitude" 
                               target-ref="domain.import_target.longitude"/>
             <property-mapping source-ref="domain.location.latitude" 
                               target-ref="domain.import_target.latitude"/>
             <property-mapping source-ref="domain.location.location" 
                               target-ref="domain.import_target.location"/>
             <property-mapping source-ref="domain.location.zip" 
                               target-ref="domain.import_target.zip"/>
             <property-mapping source-ref="domain.location.country_fk" 
                               target-ref="domain.import_target.country"/>
         </property-mappings>
     </mapping>
 </import>
 

XML import

For importing data from a XML resource, you need to write a script that creates the object from the data. The script attribute defines the path to the import script. In the from-resource you define the XML resource that should be imported. The definition of the ImportAction may look like this:

Example 48.13. ImportAction: import from a XML resource

 <import import-mode="replace" 
         from-resource="/actionscripts/groovy/importsearch.xml" 
         script="/actionscripts/groovy/importsearch.groovy" 
         scripting-dialect="groovy" 
         to-domain-type-ref="domain.search"/>
 

[Note]Note

In OpenSAGA 'groovy' is the default scripting dialect. So when using groovy scripts, it is not necessary to specify the scripting dialect separately.

The import script is necessary for creating and filling the DomainObjects. Therefore the script has access to the XML resource and some other objects. All created DomainObjects have to be stored in the 'result' list, otherwise the objects will not be imported. The table below shows the predefined objects for import scripts. Additionally you have access to all beans that are provided by the ScriptContextInitializationService, see the section called “What to use?”.

Predefined objects in import scripts Object Description dom The XML from-resource as a org.opensaga.runtime.scripting.groovy.GroovyXmlNode object (see the section called “GroovyXmlNode”). source The XML from-resource as a groovy.util.slurpersupport.GPathResult object. result An empty list of DomainObjects. The script has to add all DomainObjects to this list that shall be imported. After script execution all objects in this list are stored. The following scripts shows two different ways how to import data from a xml file like this one:

 <?xml version="1.0" encoding="utf-8"?>
 <searches>
     <search>
         <query>Test</query>
         <offset>0</offset>
         <count>10</count>
     </search>
     <search>
         <query>Foo</query>
         <offset>100</offset>
         <count>10</count>
     </search>
     <search>
         <query>blub</query>
         <offset>23</offset>
         <count>7</count>
     </search>
     <search>
         <query>Bar</query>
         <offset>50</offset>
         <count>78</count>
     </search>
     <search>
         <query>QWERTZ</query>
         <offset>987</offset>
         <count>123</count>
     </search>
 </searches>
      

Example 48.14. ImportAction: example import script with GPathResult

 source.search.each() {
     def search = domaintype.Search.create()
     search.query = it.query
     search.count = Integer.parseInt(it.count.text())
     search.offset1 = Integer.parseInt(it.offset.text())
     result.add(search)
     
      

Example 48.15. ImportAction: example import script with GroovyXmlNode

 def searchNodes = dom.xpath("searches/search");
 for(searchNode in searchNodes) 
 {
     def search = domaintype.Search.create()
     search.query = searchNode.query
     search.count = Integer.parseInt(searchNode.count)
     search.offset1 = Integer.parseInt(searchNode.offset)
     result.add(search)
 }         
      

GroovyXmlNode

The org.opensaga.runtime.scripting.groovy.GroovyXmlNode enables easy accessing XML content in groovy scripts. Accessing nodes is enabled via XPath expressions and node context accessing is enabled via property accessing.

Accessing nodes

To access nodes, you have to use the xpath method, which returns a list of GroovyXmlNodes.

Example 48.16. GroovyXmlNode: Accessing nodes

          def nodes = groovyXmlNode.xpath("/rootnode/childnode")
      

Accessing values

To access the text content of child nodes, you treat them like properties:

Example 48.17. GroovyXmlNode: Accessing child node value

          groovyXmlNode.childTagName
      

If there is no child with the given name, the value of the attribute with this name is returned, when it exists. When there is a child element and an attribute with the same name and you want to access the attribute value, you have to write an '@' before the attribute name.

Example 48.18. GroovyXmlNode: Accessing attribute value

          groovyXmlNode.@attributeName
      

To access the node value (org.w3c.dom.Node.getNodeValue()) or text content (org.w3c.dom.Node.getTextContent()) of the current node, you have to use the methods getValue() and getText().

Example 48.19. GroovyXmlNode: Accessing current node value

 groovyXmlNode.getValue()
 groovyXmlNode.getText()]]>
      

Attributes of <import />
AttributeDescription
action-bean

Defines the action bean to execute. The action bean must implement Action.

action-class

Defines the fully qualified class name for the actual action. The action class must implement Action.

action-script

Defines the action script to execute.

action-script-resource

Defines a action script resource to execute.

description

Defines the description.

from-domain-type-ref

Defines the domain type from that the data are imported. If this attribute is specified, the domain type importing is used (see the section called “Domain type import”).

from-resource

Defines the xml resource from that the data are imported via the script defined in the script attribute. This attribute is only used, when no from-domain-type-ref is specified (see the section called “XML import”).

id

Defines the GUID of the model.

import-mode (required)

Defines if the import shall either 'replace' or 'update' the data in the to-domain-type. (see the section called “Import Mode”).

import-script

Defines the script to execute

import-script-resource

Defines the path to the script to execute.

import-scripting-dialect

Defines the dialect of the script.

import-using-script-dialect-dir

Defines whether the script resource path is relative to the script dialect directory or not.

requires-binding

Defines whether any parameters send by the client should be bound (and validated).

scripting-dialect

Defines the scripting dialect for scripts to be executed. Defaults to groovy.

to-domain-type-ref (required)

Defines the domain type that is used for storing the data.

Valid inside <import /> are: <output />, <mapping />, <input />, <execute-if />, <with-filter />

<import /> is valid inside: <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <actions />, <on-insert />, <catch-validation-error />, <action-list />, <finally />, <on-insert />, <catch-validation-error />, <ignore-validation-results />, <start-action-list />, <action-list />, <finally />

<iterate-list />

( Additional names: reset-list-iterator-index )

Resets a list for iteration. Each existing scoped domain object list contains an internal index that initially points to the first element of the list (if non empty). The current iteration element can be accessed by defining a scoped domain object reference using the ID of the scoped domain object list in the relevant place. The iteration index can be incremented using the the section called “<next-element />”.

Attributes of <iterate-list />
AttributeDescription
action-bean

Defines the action bean to execute. The action bean must implement Action.

action-class

Defines the fully qualified class name for the actual action. The action class must implement Action.

action-script

Defines the action script to execute.

action-script-resource

Defines a action script resource to execute.

description

Defines the description.

id

Defines the GUID of the model.

requires-binding

Defines whether any parameters send by the client should be bound (and validated).

scoped-domain-object-list-ref

Defines the cached domain object list.

scripting-dialect

Defines the scripting dialect for scripts to be executed. Defaults to groovy.

Valid inside <iterate-list /> are: <execute-if />, <with-filter />

<load-list />

( Additional names: set-list )

Loads data for a scoped list. Data can be retrieved by using a the section called “<filtered-list />” or by referencing another scoped list.

Attention: This action initiates data binding and validation before it is executed.

Attributes of <load-list />
AttributeDescription
action-bean

Defines the action bean to execute. The action bean must implement Action.

action-class

Defines the fully qualified class name for the actual action. The action class must implement Action.

action-script

Defines the action script to execute.

action-script-resource

Defines a action script resource to execute.

description

Defines the description.

id

Defines the GUID of the model.

requires-binding

Defines whether any parameters send by the client should be bound (and validated).

scripting-dialect

Defines the scripting dialect for scripts to be executed. Defaults to groovy.

source-scoped-domain-object-list-ref

Defines the source cached domain object list.

target-scoped-domain-object-list-ref

Defines the target cached domain object list.

Valid inside <load-list /> are: <filtered-list />, <execute-if />, <with-filter />

<logout />

Logs out current user. It has no effect when no user is logged in.

Attributes of <logout />
AttributeDescription
action-bean

Defines the action bean to execute. The action bean must implement Action.

action-class

Defines the fully qualified class name for the actual action. The action class must implement Action.

action-script

Defines the action script to execute.

action-script-resource

Defines a action script resource to execute.

description

Defines the description.

id

Defines the GUID of the model.

requires-binding

Defines whether any parameters send by the client should be bound (and validated).

scripting-dialect

Defines the scripting dialect for scripts to be executed. Defaults to groovy.

Valid inside <logout /> are: <execute-if />, <with-filter />

<logout /> is valid inside: <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <actions />, <on-insert />, <catch-validation-error />, <action-list />, <finally />, <on-insert />, <catch-validation-error />, <ignore-validation-results />, <start-action-list />, <action-list />, <finally />

<map-values />

Implements MapValuesActionModel.

Attention: This action initiates data binding and validation before it is executed.

Attributes of <map-values />
AttributeDescription
action-bean

Defines the action bean to execute. The action bean must implement Action.

action-class

Defines the fully qualified class name for the actual action. The action class must implement Action.

action-script

Defines the action script to execute.

action-script-resource

Defines a action script resource to execute.

description

Defines the description.

id

Defines the GUID of the model.

list-ref

Defines a reference to a scoped list.

object-ref

Defines a reference to a scoped object.

requires-binding

Defines whether any parameters send by the client should be bound (and validated).

scripting-dialect

Defines the scripting dialect for scripts to be executed. Defaults to groovy.

Valid inside <map-values /> are: <output />, <mapping />, <input />, <filtered-list />, <execute-if />, <with-filter />

<map-values /> is valid inside: <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <actions />, <on-insert />, <catch-validation-error />, <action-list />, <finally />, <on-insert />, <catch-validation-error />, <ignore-validation-results />, <start-action-list />, <action-list />, <finally />

<message-parameter />

Attributes of <message-parameter />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

property-ref
value

<message-parameter /> is valid inside: <create-message />

<new />

Creates a new cached/target domain object or cached domain object list. If a reference to a cached domain object or list is specified, then the new domain object will be put into the specified scope, otherwise the new domain object is used as target domain object.

Example 48.20. NewAction: Creating a new target domain object

          <new/>
      

Example 48.21. NewAction: Creating a cached domain object

          <new scoped-domain-object-ref="scoped.object"/>
      

Example 48.22. NewAction: Creating a cached domain object list

          <new scoped-domain-object-list-ref="scoped.list" />
      

Attributes of <new />
AttributeDescription
action-bean

Defines the action bean to execute. The action bean must implement Action.

action-class

Defines the fully qualified class name for the actual action. The action class must implement Action.

action-script

Defines the action script to execute.

action-script-resource

Defines a action script resource to execute.

description

Defines the description.

id

Defines the GUID of the model.

requires-binding

Defines whether any parameters send by the client should be bound (and validated).

scoped-domain-object-list-ref

Defines the reference of the cached domain object list to fill with a new list (see the section called “List references”).

scoped-domain-object-ref

Defines the reference of the cached domain object to fill with a new object (see the section called “Object references”).

scripting-dialect

Defines the scripting dialect for scripts to be executed. Defaults to groovy.

Valid inside <new /> are: <execute-if />, <with-filter />

<new /> is valid inside: <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <actions />, <on-insert />, <catch-validation-error />, <action-list />, <finally />, <on-insert />, <catch-validation-error />, <ignore-validation-results />, <start-action-list />, <action-list />, <finally />

<new-object />

Implements NewObjectModel.

Attributes of <new-object />
AttributeDescription
description

Defines the description.

domain-type-ref

Defines the domain type reference.

id

Defines the GUID of the model.

Valid inside <new-object /> is: <property-mappings />

<new-object /> is valid inside: <add-to-list />

<next-element />

Defines a "next" iterator for scoped domain object lists incrementing the internal iteration index by one. See the section called “<iterate-list />” for details about list iteration works as a concept. The referenced list must exist. If the iteration index eceeds the number of contained objects nothing special will happen ({@linkHasCurrentElementFilterModel} will return false as soon as the current iteration run exceeds the number of contained elements).

Attributes of <next-element />
AttributeDescription
action-bean

Defines the action bean to execute. The action bean must implement Action.

action-class

Defines the fully qualified class name for the actual action. The action class must implement Action.

action-script

Defines the action script to execute.

action-script-resource

Defines a action script resource to execute.

description

Defines the description.

id

Defines the GUID of the model.

requires-binding

Defines whether any parameters send by the client should be bound (and validated).

scoped-domain-object-list-ref

Defines the cached domain object list.

scripting-dialect

Defines the scripting dialect for scripts to be executed. Defaults to groovy.

Valid inside <next-element /> are: <execute-if />, <with-filter />

<next-element /> is valid inside: <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <actions />, <on-insert />, <catch-validation-error />, <action-list />, <finally />, <on-insert />, <catch-validation-error />, <ignore-validation-results />, <start-action-list />, <action-list />, <finally />

<publish-message />

Attributes of <publish-message />
AttributeDescription
action-bean

Defines the action bean to execute. The action bean must implement Action.

action-class

Defines the fully qualified class name for the actual action. The action class must implement Action.

action-script

Defines the action script to execute.

action-script-resource

Defines a action script resource to execute.

channel
constant-value
description

Defines the description.

id

Defines the GUID of the model.

object-reference
property-reference
requires-binding

Defines whether any parameters send by the client should be bound (and validated).

scripting-dialect

Defines the scripting dialect for scripts to be executed. Defaults to groovy.

Valid inside <publish-message /> are: <execute-if />, <with-filter />

<publish-message /> is valid inside: <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <actions />, <on-insert />, <catch-validation-error />, <action-list />, <finally />, <on-insert />, <catch-validation-error />, <ignore-validation-results />, <start-action-list />, <action-list />, <finally />

<remove />

Removes a scoped domain object from its scope. The domain object is not deleted in the database!

The example shows how to remove a cached domain object from its scope (assuming p_temporary_scoped.bar_temp is a scoped domain object).

Example 48.23. RemoveAction: Remove a cached object from its scope

          <remove scoped-domain-object-ref="p_temporary_scoped.bar_temp"/>
      

Attributes of <remove />
AttributeDescription
action-bean

Defines the action bean to execute. The action bean must implement Action.

action-class

Defines the fully qualified class name for the actual action. The action class must implement Action.

action-script

Defines the action script to execute.

action-script-resource

Defines a action script resource to execute.

description

Defines the description.

id

Defines the GUID of the model.

requires-binding

Defines whether any parameters send by the client should be bound (and validated).

scoped-domain-object-ref

Defines the reference of the cached domain object to remove from its scope.

scripting-dialect

Defines the scripting dialect for scripts to be executed. Defaults to groovy.

Valid inside <remove /> are: <execute-if />, <with-filter />

<remove /> is valid inside: <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <actions />, <on-insert />, <catch-validation-error />, <action-list />, <finally />, <on-insert />, <catch-validation-error />, <ignore-validation-results />, <start-action-list />, <action-list />, <finally />

<remove-list />

Removes a scoped domain object list from its scope. The domain objects of the list are not deleted in the database!

The example shows how to remove a cached domain object list from its scope (assuming p_temporary_scoped.bar_temp_list is a scoped domain object list).

Example 48.24. RemoveListAction: Remove a cached list from its scope

          <remove-list scoped-domain-object-list-ref="p_temporary_scoped.bar_temp_list"/>
      

Attributes of <remove-list />
AttributeDescription
action-bean

Defines the action bean to execute. The action bean must implement Action.

action-class

Defines the fully qualified class name for the actual action. The action class must implement Action.

action-script

Defines the action script to execute.

action-script-resource

Defines a action script resource to execute.

description

Defines the description.

id

Defines the GUID of the model.

requires-binding

Defines whether any parameters send by the client should be bound (and validated).

scoped-domain-object-list-ref

Defines the cached domain object list.

scripting-dialect

Defines the scripting dialect for scripts to be executed. Defaults to groovy.

Valid inside <remove-list /> are: <execute-if />, <with-filter />

<remove-list /> is valid inside: <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <actions />, <on-insert />, <catch-validation-error />, <action-list />, <finally />, <on-insert />, <catch-validation-error />, <ignore-validation-results />, <start-action-list />, <action-list />, <finally />

<reset-cache />

Resets either the cache with the given name or all caches when no name is specified.

The following example shows how to reset all caches.

Example 48.25. ResetCacheAction: Reseting all caches

          <reset-cache/>
      

Sometimes you only want to reset one cache. By defining a name you can specify which cache is reseted. The next example shows how to reset the system.cache.permissions cache.

Example 48.26. ResetCacheAction: Reseting one cache

          <reset-cache name="system.cache.permissions" />
      

Attributes of <reset-cache />
AttributeDescription
action-bean

Defines the action bean to execute. The action bean must implement Action.

action-class

Defines the fully qualified class name for the actual action. The action class must implement Action.

action-script

Defines the action script to execute.

action-script-resource

Defines a action script resource to execute.

description

Defines the description.

id

Defines the GUID of the model.

name

Defines the name of the cache that is reseted.

name-ref

Defines the reference to a property that contains the name of the cache that is reseted.

requires-binding

Defines whether any parameters send by the client should be bound (and validated).

scripting-dialect

Defines the scripting dialect for scripts to be executed. Defaults to groovy.

Valid inside <reset-cache /> are: <execute-if />, <with-filter />

<reset-cache /> is valid inside: <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <actions />, <on-insert />, <catch-validation-error />, <action-list />, <finally />, <on-insert />, <catch-validation-error />, <ignore-validation-results />, <start-action-list />, <action-list />, <finally />

<reset-list-iterator-index />

( Additional names: iterate-list )

Resets a list for iteration. Each existing scoped domain object list contains an internal index that initially points to the first element of the list (if non empty). The current iteration element can be accessed by defining a scoped domain object reference using the ID of the scoped domain object list in the relevant place. The iteration index can be incremented using the the section called “<next-element />”.

Attributes of <reset-list-iterator-index />
AttributeDescription
action-bean

Defines the action bean to execute. The action bean must implement Action.

action-class

Defines the fully qualified class name for the actual action. The action class must implement Action.

action-script

Defines the action script to execute.

action-script-resource

Defines a action script resource to execute.

description

Defines the description.

id

Defines the GUID of the model.

requires-binding

Defines whether any parameters send by the client should be bound (and validated).

scoped-domain-object-list-ref

Defines the cached domain object list.

scripting-dialect

Defines the scripting dialect for scripts to be executed. Defaults to groovy.

Valid inside <reset-list-iterator-index /> are: <execute-if />, <with-filter />

<reset-list-iterator-index /> is valid inside: <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <actions />, <on-insert />, <catch-validation-error />, <action-list />, <finally />, <on-insert />, <catch-validation-error />, <ignore-validation-results />, <start-action-list />, <action-list />, <finally />

<reset-translations />

The action resets all translations. That is necessary when you specify new translations. The new translation are not active until the translations are reseted.

Example 48.27. ResetTranslationsAction: Reseting translation

          <reset-translations/>
      

Attributes of <reset-translations />
AttributeDescription
action-bean

Defines the action bean to execute. The action bean must implement Action.

action-class

Defines the fully qualified class name for the actual action. The action class must implement Action.

action-script

Defines the action script to execute.

action-script-resource

Defines a action script resource to execute.

description

Defines the description.

id

Defines the GUID of the model.

requires-binding

Defines whether any parameters send by the client should be bound (and validated).

scripting-dialect

Defines the scripting dialect for scripts to be executed. Defaults to groovy.

Valid inside <reset-translations /> are: <execute-if />, <with-filter />

<reset-translations /> is valid inside: <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <actions />, <on-insert />, <catch-validation-error />, <action-list />, <finally />, <on-insert />, <catch-validation-error />, <ignore-validation-results />, <start-action-list />, <action-list />, <finally />

<reset-validation-status />

Resets the current validation status. Will be most commonly used in conjunction with the section called “<catch-validation-error />” in order to prevent a transition from aborting due to validation errors.

Just call it without arguments in order to clear all possible validation errors that have occurred so far:

 <reset-validation-status/>
 

Attributes of <reset-validation-status />
AttributeDescription
action-bean

Defines the action bean to execute. The action bean must implement Action.

action-class

Defines the fully qualified class name for the actual action. The action class must implement Action.

action-script

Defines the action script to execute.

action-script-resource

Defines a action script resource to execute.

description

Defines the description.

id

Defines the GUID of the model.

requires-binding

Defines whether any parameters send by the client should be bound (and validated).

scripting-dialect

Defines the scripting dialect for scripts to be executed. Defaults to groovy.

Valid inside <reset-validation-status /> are: <execute-if />, <with-filter />

<reset-validation-status /> is valid inside: <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <actions />, <on-insert />, <catch-validation-error />, <action-list />, <finally />, <on-insert />, <catch-validation-error />, <ignore-validation-results />, <start-action-list />, <action-list />, <finally />

<script />

( Additional names: action-script )

Contains an action script. Can be referenced by the the section called “<execute />” and other scriptable models. Usually you want to surround the action script by a CDATA block in order to keep a sane syntax in the script.

Attributes of <script />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <script /> is: text content

<script /> is valid inside: <execute />

<send-outgoing-emails />

This action sends the outgoing e-mails that are enqueued by the email action (see the section called “<email />”). The action sends the mails either of from a specified mail service or from all mail services.

The following example shows how to send the outgoing mails of the mail.service.default mail service.

Example 48.28. SendOutgoingEmailsAction: Sending the outgoing emails

          <send-outgoing-emails mail-service-ref="mail.service.default" />
      

Attention: This action initiates data binding and validation before it is executed.

See also:

Attributes of <send-outgoing-emails />
AttributeDescription
action-bean

Defines the action bean to execute. The action bean must implement Action.

action-class

Defines the fully qualified class name for the actual action. The action class must implement Action.

action-script

Defines the action script to execute.

action-script-resource

Defines a action script resource to execute.

description

Defines the description.

id

Defines the GUID of the model.

mail-service-ref

Defines the reference to the mail service that is used.

requires-binding

Defines whether any parameters send by the client should be bound (and validated).

scripting-dialect

Defines the scripting dialect for scripts to be executed. Defaults to groovy.

Valid inside <send-outgoing-emails /> are: <execute-if />, <with-filter />

<send-outgoing-emails /> is valid inside: <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <actions />, <on-insert />, <catch-validation-error />, <action-list />, <finally />, <on-insert />, <catch-validation-error />, <ignore-validation-results />, <start-action-list />, <action-list />, <finally />

<set-active-navigation />

Sets programmatically the active navigation item that is referenced by the navigation-item-ref attribute.

Example 48.29. SetActiveNavigationAction: Sets programmatically the active navigation item

      <set-active-navigation navigation-item-ref="navigation.sandbox.a" />
 

The following example shows how to active a special navigation item.

Example 48.30. SetActiveNavigationAction: Active a navigation item programmatically

          <set-active-navigation navigation-item-ref="navigation.qs_test.p_navigation_highlight.item.a" />
      

Usually you want to use this action to ensure that the correct navigation item entry is highlighted when a process transition switches from the current process to some other process. In that case you should call this action with an appropriate parameter as the final action of the transition to ensure that the UI will display the correctly highlighted navigation.

Attributes of <set-active-navigation />
AttributeDescription
action-bean

Defines the action bean to execute. The action bean must implement Action.

action-class

Defines the fully qualified class name for the actual action. The action class must implement Action.

action-script

Defines the action script to execute.

action-script-resource

Defines a action script resource to execute.

description

Defines the description.

id

Defines the GUID of the model.

navigation-item-ref

Defines the navigation item reference to the navigation item that is highlighted by the action. The navigation item needs a id for referencing it.

requires-binding

Defines whether any parameters send by the client should be bound (and validated).

scripting-dialect

Defines the scripting dialect for scripts to be executed. Defaults to groovy.

Valid inside <set-active-navigation /> are: <execute-if />, <with-filter />

<set-active-navigation /> is valid inside: <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <actions />, <on-insert />, <catch-validation-error />, <action-list />, <finally />, <on-insert />, <catch-validation-error />, <ignore-validation-results />, <start-action-list />, <action-list />, <finally />

<set-list />

( Additional names: load-list )

Loads data for a scoped list. Data can be retrieved by using a the section called “<filtered-list />” or by referencing another scoped list.

Attention: This action initiates data binding and validation before it is executed.

Attributes of <set-list />
AttributeDescription
action-bean

Defines the action bean to execute. The action bean must implement Action.

action-class

Defines the fully qualified class name for the actual action. The action class must implement Action.

action-script

Defines the action script to execute.

action-script-resource

Defines a action script resource to execute.

description

Defines the description.

id

Defines the GUID of the model.

requires-binding

Defines whether any parameters send by the client should be bound (and validated).

scripting-dialect

Defines the scripting dialect for scripts to be executed. Defaults to groovy.

source-scoped-domain-object-list-ref

Defines the source cached domain object list.

target-scoped-domain-object-list-ref

Defines the target cached domain object list.

Valid inside <set-list /> are: <filtered-list />, <execute-if />, <with-filter />

<set-list /> is valid inside: <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <actions />, <on-insert />, <catch-validation-error />, <action-list />, <finally />, <on-insert />, <catch-validation-error />, <ignore-validation-results />, <start-action-list />, <action-list />, <finally />

<set-object />

Implements the set-object action, which sets a target domain object reference to a source domain object reference.

Attributes of <set-object />
AttributeDescription
action-bean

Defines the action bean to execute. The action bean must implement Action.

action-class

Defines the fully qualified class name for the actual action. The action class must implement Action.

action-script

Defines the action script to execute.

action-script-resource

Defines a action script resource to execute.

description

Defines the description.

id

Defines the GUID of the model.

requires-binding

Defines whether any parameters send by the client should be bound (and validated).

scripting-dialect

Defines the scripting dialect for scripts to be executed. Defaults to groovy.

source-list-current-object-ref

Defines the list from which the current iteration object should be used.

source-object-ref

Defines the source object reference.

target-object-ref

Defines the target object reference.

Valid inside <set-object /> are: <execute-if />, <with-filter />

<set-object /> is valid inside: <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <actions />, <on-insert />, <catch-validation-error />, <action-list />, <finally />, <on-insert />, <catch-validation-error />, <ignore-validation-results />, <start-action-list />, <action-list />, <finally />

<set-property-value />

Sets a given property to a new value. Either the property is set in the current domain object or in a set of domain objects related with the current domain object. The following values can be set:

  • Constant value

  • Value from a property

  • Computed value by a property value provider bean

  • Computed value by a script

  • The value null

The set property value action can work in the following ways:

  • Setting a constant value

    Example 48.31. SetPropertyValueAction: Setting a constant constant value in the current domain object

     <set-property-value property-ref="domain.a.name" property-value="Test" />
                      

  • Setting the value of a property of the current domain object in a set of related domain objects.

    Example 48.32. SetPropertyValueAction: Setting a value of another property in a set of domain objects

     <set-property-value property-ref="domain.c.name" 
                         source-property-ref="domain.a.name">
         <relation-chain-list>
             <relation-chain>
                 <relation-reference relation-ref="portal.domain.a.relation.b" />
                 <relation-reference relation-ref="portal.domain.b.relation.c" />
             </relation-chain>
         </relation-chain-list>
     </set-property-value>
                      

  • Setting a value that is computed by a property value provider bean

    Example 48.33. SetPropertyValueAction: Setting a value with a property value provider bean

     <set-property-value property-ref="domain.a.guid" 
                         property-value-provider-bean="guidPropertyValueProvider" />
                      

  • Setting a value that is computed by a script resource. The script file must be in the /extensions/[extensions-name]/actionscripts/[dialect-name]/ folder.

    Example 48.34. SetPropertyValueAction: Setting a value with a property value provider bean

     <set-property-value property-ref="domain.a.guid" 
                         value-script-resource="test.js" 
                         scripting-dialect="javascript" />
                      

    Alternative you can define the script directly in the xml file by using the value-script attribute.

  • Setting a property value to null

    You can null property values by specifying no value at all, e.g.:

         <set-property-value property-ref="some.property.ref"/>
        				

Attention: This action initiates data binding and validation before it is executed.

Attributes of <set-property-value />
AttributeDescription
action-bean

Defines the action bean to execute. The action bean must implement Action.

action-class

Defines the fully qualified class name for the actual action. The action class must implement Action.

action-script

Defines the action script to execute.

action-script-resource

Defines a action script resource to execute.

description

Defines the description.

id

Defines the GUID of the model.

property-ref

Defines the property model ID of the property to be modified.

property-value

Defines a constant value that is set by this action. Only if no source-property-ref is specified, this value will be used.

property-value-provider-bean

Define the property value provider bean that is used for setting the value.

requires-binding

Defines whether any parameters send by the client should be bound (and validated).

scripting-dialect

Defines the scripting dialect for scripts to be executed. Defaults to groovy.

source-property-ref

Defines the reference to a property. The value of this property is set in the property defined by property-ref.

value-property-ref

Defines the source property reference. Delegates to #setSourcePropertyReference(String).

See also:

  • #setSourcePropertyReference(String)

value-script

Defines the script to execute

value-script-resource

Defines the path to the script to execute.

value-scripting-dialect

Defines the dialect of the script.

value-using-script-dialect-dir

Defines whether the script resource path is relative to the script dialect directory or not.

Valid inside <set-property-value /> are: <relation-chain-list />, <execute-if />, <with-filter />

<set-property-value /> is valid inside: <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <actions />, <on-insert />, <catch-validation-error />, <action-list />, <finally />, <on-insert />, <catch-validation-error />, <ignore-validation-results />, <start-action-list />, <action-list />, <finally />

<store />

Implements the store action. If a cached domain object is referenced only that object will be stored. Otherwise all objects contained in the source view (e.g. the main object and the objects referenced by parts of the the section called “<view />”) will be stored.

Additionally it is possible to store the target domain object which only is required when you alter it during the current transition by e.g. connecting or disconnecting it to other objects (see the section called “<connect />” and the section called “<disconnect />”).

Attention: This action initiates data binding and validation before it is executed.

Attributes of <store />
AttributeDescription
action-bean

Defines the action bean to execute. The action bean must implement Action.

action-class

Defines the fully qualified class name for the actual action. The action class must implement Action.

action-script

Defines the action script to execute.

action-script-resource

Defines a action script resource to execute.

description

Defines the description.

id

Defines the GUID of the model.

object-identified-by-property-ref

Defines the property reference used to identify the object that should be stored.

requires-binding

Defines whether any parameters send by the client should be bound (and validated).

scoped-domain-object-list-ref

Defines the reference of the cached domain object list to sore.

scoped-domain-object-ref

Defines the reference of the cached domain object to store.

scripting-dialect

Defines the scripting dialect for scripts to be executed. Defaults to groovy.

target-domain-object

Indicates if the target domain object should be stored. Usually you only will set this attribute to true if the target domain object was connected to something else.

Valid inside <store /> are: <execute-if />, <with-filter />

<store /> is valid inside: <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <actions />, <on-insert />, <catch-validation-error />, <action-list />, <finally />, <on-insert />, <catch-validation-error />, <ignore-validation-results />, <start-action-list />, <action-list />, <finally />

<switch />

Defines an action model for a classical switch statement.

An example for the switch sequence is:

   
      <switch property-ref="...">
          <case>
              <constant value="..." | property-value property-ref="..." .../>
              <action-list>...</action-list>
              <action-list>...</action-list>
              <action-list>...</action-list>
          </case>
          <case>...</case>
          <default>
              <action-list>...</action-list>
          </default>
      </switch>
   
 

Attention: This action initiates data binding and validation before it is executed.

Attributes of <switch />
AttributeDescription
action-bean

Defines the action bean to execute. The action bean must implement Action.

action-class

Defines the fully qualified class name for the actual action. The action class must implement Action.

action-script

Defines the action script to execute.

action-script-resource

Defines a action script resource to execute.

description

Defines the description.

id

Defines the GUID of the model.

property-ref

Defines the reference to a property in the current runtime context.

requires-binding

Defines whether any parameters send by the client should be bound (and validated).

scripting-dialect

Defines the scripting dialect for scripts to be executed. Defaults to groovy.

Valid inside <switch /> are: <case />, <default />, <execute-if />, <with-filter />

<switch /> is valid inside: <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <actions />, <on-insert />, <catch-validation-error />, <action-list />, <finally />, <on-insert />, <catch-validation-error />, <ignore-validation-results />, <start-action-list />, <action-list />, <finally />

<system-log />

Implements system logging. A message for an arbitrary component and an arbitrary logging level will be written to the system log which can be accessed from the administration processes and which is defined via specific models in the OpenSAGA base. The component is an arbitrary string that you can use to segment application-defined logging messages. The logging level also is an arbitrary string that can be used for application specific logging levels and types.

Attention: This action initiates data binding and validation before it is executed.

Attributes of <system-log />
AttributeDescription
action-bean

Defines the action bean to execute. The action bean must implement Action.

action-class

Defines the fully qualified class name for the actual action. The action class must implement Action.

action-script

Defines the action script to execute.

action-script-resource

Defines a action script resource to execute.

component

Defines the component of the message.

description

Defines the description.

id

Defines the GUID of the model.

level

Defines the level of the message.

list-ref

Defines a reference to a scoped list.

message

Defines a literal message.

object-ref

Defines a reference to a scoped object.

requires-binding

Defines whether any parameters send by the client should be bound (and validated).

scripting-dialect

Defines the scripting dialect for scripts to be executed. Defaults to groovy.

Valid inside <system-log /> are: <parameters />, <filtered-list />, <execute-if />, <with-filter />

<system-log /> is valid inside: <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <actions />, <on-insert />, <catch-validation-error />, <action-list />, <finally />, <on-insert />, <catch-validation-error />, <ignore-validation-results />, <start-action-list />, <action-list />, <finally />

<tag />

Implements tagging functionality as known from typical Web 2.0 applications.

The value contained in the source property will be split into a list of strings according to the given separator value and separation strategy (see below for custom separation strategies). For each string value the tag action will text if the tag already exists in the referenced domain type and under the referenced domain type property. If the tag does not yet exist a new entry will be created in the referenced domain type and connected to the target domain object via the given relation. Finally you can specific a connection mode that either replaces existing tags or adds to the set of existing tags. The default mode is to add new tags to the current set.

Note that it is possible to introduce custom tag separation logic by defining either a tag separator bean (which must exist in some Spring context of the current application) or a tag separator class. Either the bean or the class need to implement the TagSeparator interface.

Attention: This action initiates data binding and validation before it is executed.

Attributes of <tag />
AttributeDescription
action-bean

Defines the action bean to execute. The action bean must implement Action.

action-class

Defines the fully qualified class name for the actual action. The action class must implement Action.

action-script

Defines the action script to execute.

action-script-resource

Defines a action script resource to execute.

description

Defines the description.

id

Defines the GUID of the model.

list-ref

Defines a reference to a scoped list.

mode

Determines the way the tag action combines a new list of tags with an already existing tag list. "add" adds all elements of the new list to the old, "replace" replaces the old list with the new one.

name-property-ref (required)

Reference to the label property within the tag

object-ref

Defines a reference to a scoped object.

relation-ref (required)

Reference to the relation connecting the tagged type and the tag type.

requires-binding

Defines whether any parameters send by the client should be bound (and validated).

scripting-dialect

Defines the scripting dialect for scripts to be executed. Defaults to groovy.

separator-bean
separator-class
source-tag-property-ref (required)

The property reference containing the separated tag names

tag-domain-type-ref (required)

Reference to the tag type.

tagged-object-ref

ScopedDomainObject to tag. (default is the target domain object)

to-list-ref

Valid inside <tag /> are: <filtered-list />, <execute-if />, <with-filter />

<tag /> is valid inside: <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <actions />, <on-insert />, <catch-validation-error />, <action-list />, <finally />, <on-insert />, <catch-validation-error />, <ignore-validation-results />, <start-action-list />, <action-list />, <finally />

<then />

Implements the "then" part of an the section called “<if />”.

Attributes of <then />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

isolation

Defines the isolation level for transaction isolation. Uses the names defined in Springs DefaultTransactionDefinition class to identify the specific isolation levels.

propagation

Defines the transaction propagation mode for the action block. Uses the names defined in Springs DefaultTransactionDefinition class to identify the specific propagation levels.

Valid inside <then /> are: <set-property-value />, <dequeue-report />, <webservice />, <transform />, <publish-message />, <iterate-list />, <try />, <aggregate />, <set-active-navigation />, <map-values />, <reset-validation-status />, <reset-cache />, <new />, <system-log />, <audit-trail />, <validation-error />, <execute />, <tag />, <if />, <enqueue-report />, <create-message />, <delete />, <for-each />, <reset-translations />, <set-object />, <send-outgoing-emails />, <connect />, <remove-list />, <email />, <load-list />, <bind />, <disconnect />, <delete-by />, <store />, <call />, <tweet />, <logout />, <next-element />, <validate />, <ignore-validation-results />, <import />, <add-to-list />, <remove />, <switch />, <define-password />

<then /> is valid inside: <if />, <case />

<transform />

Transforms data of the current domain object. The action needs two property references. One for reading the input data and the other for writing the transformed data. The transformation that is performed on the data is defined in a transformer-list (see chapter Chapter 26, Transformation).

[Warning]Warning

At the moment, there is a problem, when none xml data are transformed. For script and bean condition the data is provided as an org.w3c.dom.Document object. The creation of this object throws an exception, when none xml data is used.

Example 48.35. TransformAction

 <transform source-property-ref="sandbox.transform.attachment" 
            target-property-ref="sandbox.transform.transformed">
   <transformer-list>
       <transformer id="replace.zahl" 
         condition-script="/models/services/web-services/exampleCondition.groovy" 
         transformation-bean="exampleTransformation" />
   </transformer-list>
 </transform>
      

There is a special behavior when the property type is 'Attachment'. If the source is an attachment, the content of the file will be read from the attachement for transforming. If the target is an attachment, the transformed data will be written into the attachment.

Attention: This action initiates data binding and validation before it is executed.

See also:

Attributes of <transform />
AttributeDescription
action-bean

Defines the action bean to execute. The action bean must implement Action.

action-class

Defines the fully qualified class name for the actual action. The action class must implement Action.

action-script

Defines the action script to execute.

action-script-resource

Defines a action script resource to execute.

description

Defines the description.

id

Defines the GUID of the model.

requires-binding

Defines whether any parameters send by the client should be bound (and validated).

scripting-dialect

Defines the scripting dialect for scripts to be executed. Defaults to groovy.

source-property-ref

Defines the source property to read the data from for the transformation.

target-property-ref

Defines the target property to write the transformed data into.

Valid inside <transform /> are: <transformer-list />, <execute-if />, <with-filter />

<transform /> is valid inside: <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <actions />, <on-insert />, <catch-validation-error />, <action-list />, <finally />, <on-insert />, <catch-validation-error />, <ignore-validation-results />, <start-action-list />, <action-list />, <finally />

<try />

Wraps the execution of a given action list and provides means to handle error results of said execution. The general form of tag usage is:

     <try>
         <action-list>
             ...
         </action-list>
         <catch-validation-error>
             ...
         </catch-validation-error>
         <catch-exception [exception-type="foo.*|foo.bar.Baz|Baz"]>
             ...
         </catch-exception>
         <finally>
             ...
         </finally>
     </try>
 

The semantics for this construct are defined as follows:

  • The try action list will execute. It aborts if either a validation error or an exception occurs during execution.

  • If a validation error occurs in the try block the (optional) catch-validation-error block (see the section called “<catch-validation-error />”) will execute.

  • If an exception occurs in the try the (optional) catch-exception block (see the section called “<catch-exception />”) will execute. All such blocks will be checked sequentially and the first match executes.

  • The finally block will start executing. It ignores initial validation errors (this it also will execute after validation errors and exceptions) but it will abort as soon as a new validation error or exception occurs. See the section called “<finally />” for details.

Attributes of <try />
AttributeDescription
action-bean

Defines the action bean to execute. The action bean must implement Action.

action-class

Defines the fully qualified class name for the actual action. The action class must implement Action.

action-script

Defines the action script to execute.

action-script-resource

Defines a action script resource to execute.

description

Defines the description.

id

Defines the GUID of the model.

requires-binding

Defines whether any parameters send by the client should be bound (and validated).

scripting-dialect

Defines the scripting dialect for scripts to be executed. Defaults to groovy.

Valid inside <try /> are: <start-action-list />, <action-list />, <catch-validation-error />, <catch-exception />, <finally />, <execute-if />, <with-filter />

<try /> is valid inside: <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <actions />, <on-insert />, <catch-validation-error />, <action-list />, <finally />, <on-insert />, <catch-validation-error />, <ignore-validation-results />, <start-action-list />, <action-list />, <finally />

<tweet />

Implements a tweet action in order to be able to tweet to Twitter. Due to unresolved licensing questions we failed to address before OpenSAGA 1.0.0 this action had to be disabled. We are working on this issue. Please contact us if this functionality is important for you to help steering us into the right direction.

Attention: This action initiates data binding and validation before it is executed.

Attributes of <tweet />
AttributeDescription
action-bean

Defines the action bean to execute. The action bean must implement Action.

action-class

Defines the fully qualified class name for the actual action. The action class must implement Action.

action-script

Defines the action script to execute.

action-script-resource

Defines a action script resource to execute.

description

Defines the description.

id

Defines the GUID of the model.

message-property-ref

Defines the message to tweet.

password-property-ref

Defines the Twitter password.

requires-binding

Defines whether any parameters send by the client should be bound (and validated).

scripting-dialect

Defines the scripting dialect for scripts to be executed. Defaults to groovy.

user-property-ref

Defines the Twitter user.

Valid inside <tweet /> are: <execute-if />, <with-filter />

<tweet /> is valid inside: <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <actions />, <on-insert />, <catch-validation-error />, <action-list />, <finally />, <on-insert />, <catch-validation-error />, <ignore-validation-results />, <start-action-list />, <action-list />, <finally />

<validate />

Validates a given domain object (either the target domain object or a given scoped domain object). The action checks all restrictions that are defined in the domain type of the domain object.

Example 48.36. ValidateAction: Validating the target domain object

          <validate/>
      

Example 48.37. ValidateAction: Validating a scoped domain object

          <validate scoped-domain-object-ref="validate.object" />
      

Attention: This action initiates data binding and validation before it is executed.

Attributes of <validate />
AttributeDescription
action-bean

Defines the action bean to execute. The action bean must implement Action.

action-class

Defines the fully qualified class name for the actual action. The action class must implement Action.

action-script

Defines the action script to execute.

action-script-resource

Defines a action script resource to execute.

continue-after-validation-failed

Defines the "continue after validation failed" flag.

description

Defines the description.

id

Defines the GUID of the model.

requires-binding

Defines whether any parameters send by the client should be bound (and validated).

scoped-domain-object-ref

Defines the reference to the scoped domain object that is validated by this action. If no scoped-domain-object-ref is specified the target domain object will be used.

See also:

scripting-dialect

Defines the scripting dialect for scripts to be executed. Defaults to groovy.

Valid inside <validate /> are: <restriction-set />, <execute-if />, <with-filter />

<validate /> is valid inside: <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <actions />, <on-insert />, <catch-validation-error />, <action-list />, <finally />, <on-insert />, <catch-validation-error />, <ignore-validation-results />, <start-action-list />, <action-list />, <finally />

<validation-error />

Allows to programmatically define validation errors.

[Warning]Warning

Currently this action does not correctly adjust the domain context path if the following state is a back state.

Example 48.38. ValidationErrorAction

 <validation-error text="GenericError"/>
 <validation-error content-element-ref="sandbox.p_view_validation.view.input"
     text="SpecificError"/>
      

Attention: This action initiates data binding and validation before it is executed.

Attributes of <validation-error />
AttributeDescription
action-bean

Defines the action bean to execute. The action bean must implement Action.

action-class

Defines the fully qualified class name for the actual action. The action class must implement Action.

action-script

Defines the action script to execute.

action-script-resource

Defines a action script resource to execute.

content-element-ref

Defines a field reference to which the validation error belongs. See Chapter 22, Content Elements for details about possible content elements.

description

Defines the description.

id

Defines the GUID of the model.

requires-binding

Defines whether any parameters send by the client should be bound (and validated).

scripting-dialect

Defines the scripting dialect for scripts to be executed. Defaults to groovy.

text

Defines the validation error message tag which represents the translated error text.

Valid inside <validation-error /> are: <execute-if />, <with-filter />

<validation-error /> is valid inside: <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <actions />, <on-insert />, <catch-validation-error />, <action-list />, <finally />, <on-insert />, <catch-validation-error />, <ignore-validation-results />, <start-action-list />, <action-list />, <finally />

<webservice />

This action calls a web service and stores the result. Because this action is more complicated it is described in a separated chapter. So for more information see Chapter 24, Web Service Clients.

Attention: This action initiates data binding and validation before it is executed.

Attributes of <webservice />
AttributeDescription
action-bean

Defines the action bean to execute. The action bean must implement Action.

action-class

Defines the fully qualified class name for the actual action. The action class must implement Action.

action-script

Defines the action script to execute.

action-script-resource

Defines a action script resource to execute.

description

Defines the description.

domain-type-ref

Defines the domain type reference.

id

Defines the GUID of the model.

operation-name

Defines the operation name.

requires-binding

Defines whether any parameters send by the client should be bound (and validated).

scripting-dialect

Defines the scripting dialect for scripts to be executed. Defaults to groovy.

target-tag

Defines the target tag.

webservice-script

Defines the script to execute

webservice-script-resource

Defines the path to the script to execute.

webservice-scripting-dialect

Defines the dialect of the script.

webservice-using-script-dialect-dir

Defines whether the script resource path is relative to the script dialect directory or not.

wsdl-path

Defines the WSDL path.

Valid inside <webservice /> are: <execute-if />, <with-filter />

<webservice /> is valid inside: <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <else />, <default />, <then />, <start-action-list />, <on-update />, <catch-exception />, <on-delete />, <on-create />, <actions />, <on-insert />, <catch-validation-error />, <action-list />, <finally />, <on-insert />, <catch-validation-error />, <ignore-validation-results />, <start-action-list />, <action-list />, <finally />

<with-filter />

This filter is used by some actions that require a local filter definition for their custom business logic. Currently only the the section called “<delete-by />” makes use of this feature.

Attributes of <with-filter />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <with-filter /> are: <greater-than />, <is-property-modified />, <and />, <geo-within />, <matches />, <user-logged-in />, <validation-failed />, <complies-to />, <criterion />, <less-than-or-equal-to />, <has-current-element />, <is-undefined />, <has-changed />, <or />, <is-connected-to />, <can-access />, <ends-with />, <geo-contains />, <has-permission />, <contains-comparator />, <starts-with />, <not />, <equals />, <is-new />, <has-elements />, <dynamic-condition />, <true />, <less-than />, <in />, <include />, <in-transition />, <filter-pattern />, <has-type />, <greater-than-or-equal-to />, <is-super-user />, <false />, <is-defined />, <filter-pattern-set />

<with-filter /> is valid inside: <set-property-value />, <external-excel-domain-type />, <dequeue-report />, <webservice />, <transform />, <external-relational-domain-type />, <count />, <filter-specification-set />, <publish-message />, <iterate-list />, <try />, <aggregate />, <set-active-navigation />, <map-values />, <reset-validation-status />, <reset-cache />, <new />, <joined-domain-type />, <system-log />, <audit-trail />, <validation-error />, <execute />, <tag />, <if />, <enqueue-report />, <create-message />, <delete />, <constant-domain-type />, <start-action-list />, <external-excel-domain-type />, <external-relational-domain-type />, <joined-domain-type />, <constant-domain-type />, <domain-type />, <wfs-domain-type />, <request-context />, <for-each />, <reset-translations />, <radio-buttons />, <multi-connect />, <tree-connect />, <transition />, <list-iterator />, <set-object />, <case />, <wfs-domain-type />, <send-outgoing-emails />, <connect />, <multi-connect />, <single-connect />, <remove-list />, <relation-reference />, <email />, <load-list />, <bind />, <disconnect />, <has-elements />, <filtered-list />, <delete-by />, <store />, <call />, <tweet />, <logout />, <next-element />, <validate />, <ignore-validation-results />, <agent-action />, <datagrid />, <start-action-list />, <action-list />, <radio-buttons />, <select-field />, <request-context />, <import />, <cell-format />, <add-to-list />, <remove />, <switch />, <define-password />

Chapter 49. Agent Models

<agent-action />

Provides the complex action behavior of an agent. The complex behavior is made up from a complex action list (as defined in the section called “<actions />”) and a condition (as defined by a the section called “<filter-specification />”) which specifies if the given list should be executed under the current runtime context.

Attributes of <agent-action />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <agent-action /> are: <execute-if />, <auto-complete-filter />, <read-only-if />, <with-filter />, <filter-restriction />, <filter-specification />, <visible-if />, <disabled-if />, <condition />, <validate-if />, <start-action-list />, <action-list />

<agent-action /> is valid inside: <agent-action-list />

<agent-action-list />

Contains a list of the section called “<agent-action />”s that define the behavior of the agent.

Attributes of <agent-action-list />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <agent-action-list /> is: <agent-action />

<agent-action-list /> is valid inside: <trigger-based-agent />, <event-based-agent />, <domaintype-based-agent />, <time-based-agent />, <domaintype-based-agent />

<agent-reference />

Defines a reference to a top level the section called “<agents />” when enumerating all available agents via the section called “<agents />”.

Attributes of <agent-reference />
AttributeDescription
agent-ref

Defines the agent reference.

description

Defines the description.

id

Defines the GUID of the model.

<agent-reference /> is valid inside: <agents />

<agents />

Enumerates all agents defined via top level the section called “<agents />” models that current exist in the application.

Attributes of <agents />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

name

Defines the model name.

Valid inside <agents /> is: <agent-reference />

<domaintype-based-agent />

Defines an agent with DB-like trigger functionality. The agent listens to event from a specific given domain type model and reacts to those events. Valid event trigger IDs are defined in AgentEventIds. The event source (the domain object being accessed) will be the target domain object when the agent actions are executed.

Attributes of <domaintype-based-agent />
AttributeDescription
description

Defines the description.

domain-type-ref

Defines the domain type model.

id

Defines the GUID of the model.

name

Defines the agent name.

trigger-event-id

Defines the trigger event ID. See AgentEventIds for valid event trigger IDs built into the system.

Valid inside <domaintype-based-agent /> is: <agent-action-list />

<event-based-agent />

Implements an agent that reacts to specific event triggers and executes actions based on the current runtime context.

Attributes of <event-based-agent />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

name

Defines the agent name.

trigger-event-id

Defines the trigger event ID. See AgentEventIds for valid event trigger IDs built into the system.

Valid inside <event-based-agent /> is: <agent-action-list />

<time-based-agent />

Defines a time base agent that can handle a simple repeat/interval trigger or a more complex cron expression.

Attributes of <time-based-agent />
AttributeDescription
cron-expression

Sets the cron expression string

description

Defines the description.

end-time

Defines the end time.

id

Defines the GUID of the model.

name

Defines the agent name.

repeat-count

Defines the repeat count.

repeat-interval

Defines the repeat interval in milliseconds.

start-time

Defines the start time.

Valid inside <time-based-agent /> is: <agent-action-list />

<trigger-based-agent />

Describes agents that must be explicitly triggered by external events. Such agents usually are directly addressed with their ID, e.g. by an action:

 
      <trigger agent-ref="foo"/>
 
 

Attributes of <trigger-based-agent />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

name

Defines the agent name.

Valid inside <trigger-based-agent /> is: <agent-action-list />

Chapter 50. Content Element Models

Table of Contents

<a />
<attachment />
<attachment-column />
<auto-complete-filter />
<available-export />
<available-export-list />
<b />
<boolean-column />
<boolean-element />
<br />
<button />
<button-column />
<cell-format />
<cell-format-set />
<checkbox />
<clear-filter-button />
<cms-content />
<col />
<collapse-button />
<collapse-link />
<column />
<content />
<content-group />
<datagrid />
<datagrid-column-list />
<dd />
<debug-console />
<disabled-if />
<div />
<dl />
<dt />
<em />
<error-message />
<error-message-list />
<exception />
<external-link />
<file-upload />
<filter-row />
<footer-row-list />
<grid />
<h1 />
<h2 />
<h3 />
<h4 />
<h5 />
<h6 />
<header-row-list />
<heading />
<help-button />
<hgroup />
<hr />
<image />
<info-header />
<info-header-row />
<info-header-row-list />
<label />
<li />
<link />
<list-iterator />
<locale-select />
<location-field />
<login-button />
<map />
<message />
<message-based-refresh />
<message-list />
<multi-connect />
<ol />
<on-update-refresh />
<p />
<paging />
<paging-button />
<paging-size-select />
<part />
<part-reference />
<part-set />
<password />
<plain-text />
<plain-text-property />
<pre />
<property-column />
<radio-buttons />
<read-only-if />
<remember-me-checkbox />
<rich-text />
<rich-text-field />
<rich-text-property />
<row />
<select-field />
<select-popup />
<single-connect />
<sitemap />
<span />
<state />
<stereotype />
<strong />
<style />
<style-set />
<subview />
<subview-hgroup />
<subview-list />
<subview-vgroup />
<tab />
<tab-set />
<text-field />
<textarea />
<toolbar />
<tree-connect />
<ul />
<url-column />
<verbatim />
<vgroup />
<view />
<visible-if />
<wiki-text-property />

<a />

( Additional names: h1, h2, h3, h4, h5, h6, b, em, p, ul, li, ol, dl, dt, dd, strong, hr, div, span, br, pre )

Creates a HTML element with the model name.

Attributes of <a />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

id

Defines the GUID of the model.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

Valid inside <a /> are: text content, <wiki-text-property />, <label />, <row />, <clear-filter-button />, <property-column />, <tab-set />, <remember-me-checkbox />, <login-button />, <button />, <content />, <exception />, <button-column />, <plain-text />, <verbatim />, <text-field />, <message-based-refresh />, <heading />, <rich-text-property />, <url-column />, <content-group />, <tab />, <select-popup />, <checkbox />, <error-message />, <debug-console />, <message />, <error-message-list />, <textarea />, <radio-buttons />, <rich-text-field />, <locale-select />, <external-link />, <multi-connect />, <tree-connect />, <image />, <plain-text-property />, <list-iterator />, <boolean-column />, <column />, <location-field />, <single-connect />, <collapse-link />, <toolbar />, <filter-row />, <hgroup />, <help-button />, <rich-text />, <a />, <sitemap />, <attachment />, <message-list />, <attachment-column />, <datagrid />, <select-field />, <boolean-element />, <map />, <file-upload />, <grid />, <cms-content />, <password />, <col />, <style-set />

<attachment />

This tag defines an attachment related content element. E.g. for uploading some binary document, but also to embed, edit or link attachments in a domain type.

Example 50.1. Attachment Element

 <attachment id="attachment"
             property-ref="domain.test.attachment"
             display-mode="upload"/>
 

Attributes of <attachment />
AttributeDescription
accept

Sets the accept value for the file upload that gets passed through to HTML.

class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

display-mode

Defines the mode of the attachment element. Valid modes are embed, link, edit and upload (see AttachmentDisplayMode for reference).

id

Defines the GUID of the model.

max-height

Sets the maximum image height for displaying the attachment

max-length

Sets the maximum attachment length in bytes.

max-width

Sets the maximum image width for displaying the attachment

mode

Sets a fixed write mode for this attachment model.

property-ref (required)

References the property read or written to by this widget.

required

If set to true, the widget requires a value to be entered by the user.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

type

Defines the data type for the given input field which only is necessary for self-referencing fields not containing text.

Valid inside <attachment /> are: <disabled-if />, <read-only-if />, <style-set />

<attachment /> is valid inside: <formula-property-set />, <content />, <joined-property-set />, <content-group />, <enum-property-set />, <tab />, <domain-type-property-set />, <reference-property-set />, <list-iterator />, <column />, <a />, <col />

<attachment-column />

A datagrid column displaying attachments.

Attributes of <attachment-column />
AttributeDescription
attachment-max-height

Sets the maximum attachment display height.

attachment-max-width

Sets the maximum attachment display width.

class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

display-mode

Sets the attachment display mode for this <attachment-column />

escape-data

If set to false, do not escape the datagrid content. Default is true

filter-mode

Defines the filter mode for the property. null means that there is no filter defined for the property.

heading

Defines the heading.

id

Defines the GUID of the model.

info

Sets the column info for this button-column. The text is split at | characters into multiple lines for javascript enabled clients.

The javascript widget/InfoPopupWidget.js can be added as a dependency to a web application to enable multi-line info output split at | for javascript-enabled clients. You can take a look at the script for inspiration to implement other schemes.

property-ref (required)

References the property read or written to by this widget.

required

If set to true, the widget requires a value to be entered by the user.

sortable

Set this to false if you don't want the table to be sortable.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

target-domain-type-ref

Defines the target domain type reference.

transition-ref

Sets the id of the transition invoked when clicking on this column.

type

Defines the data type for the given input field which only is necessary for self-referencing fields not containing text.

Valid inside <attachment-column /> are: <cell-format-set />, <style-set />

<attachment-column /> is valid inside: <formula-property-set />, <content />, <joined-property-set />, <content-group />, <enum-property-set />, <tab />, <datagrid-column-list />, <domain-type-property-set />, <reference-property-set />, <list-iterator />, <column />, <a />, <col />

<auto-complete-filter />

Specialization of a filter specification model that filters the data for a auto-completing the section called “<text-field />”.

Attributes of <auto-complete-filter />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <auto-complete-filter /> are: <greater-than />, <is-property-modified />, <and />, <geo-within />, <matches />, <user-logged-in />, <validation-failed />, <complies-to />, <criterion />, <less-than-or-equal-to />, <has-current-element />, <is-undefined />, <has-changed />, <or />, <is-connected-to />, <can-access />, <ends-with />, <geo-contains />, <has-permission />, <contains-comparator />, <starts-with />, <not />, <equals />, <is-new />, <has-elements />, <dynamic-condition />, <true />, <less-than />, <in />, <include />, <in-transition />, <filter-pattern />, <has-type />, <greater-than-or-equal-to />, <is-super-user />, <false />, <is-defined />, <filter-pattern-set />

<auto-complete-filter /> is valid inside: <external-excel-domain-type />, <external-relational-domain-type />, <count />, <filter-specification-set />, <text-field />, <password />, <joined-domain-type />, <constant-domain-type />, <start-action-list />, <external-excel-domain-type />, <external-relational-domain-type />, <joined-domain-type />, <constant-domain-type />, <domain-type />, <wfs-domain-type />, <request-context />, <radio-buttons />, <multi-connect />, <tree-connect />, <transition />, <list-iterator />, <case />, <wfs-domain-type />, <multi-connect />, <single-connect />, <relation-reference />, <has-elements />, <filtered-list />, <agent-action />, <datagrid />, <start-action-list />, <action-list />, <radio-buttons />, <select-field />, <request-context />, <cell-format />, <password />

<available-export />

Defines an data export options. Supported formats are (using JasperReports):

  • pdf

  • html

  • xls

  • csv

  • xml

  • xmlss

  • odt

  • rtf

  • txt

Attributes of <available-export />
AttributeDescription
action-script-resource

Defines a action script resource to execute.

description

Defines the description.

format

Sets the format of the available export.

generator

Sets the generator.

icon

Defines the icon.

id

Defines the GUID of the model.

rows

Returns the rows.

scripting-dialect

Defines the scripting dialect for scripts to be executed. Defaults to groovy.

template

Sets the template.

text (required)

Sets the tag of the available export.

title

Returns the title.

<available-export /> is valid inside: <available-export-list />

<available-export-list />

Defines the available data export types for a the section called “<datagrid />”.

Attributes of <available-export-list />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <available-export-list /> is: <available-export />

<available-export-list /> is valid inside: <list-iterator />, <datagrid />

<b />

( Additional names: a, h1, h2, h3, h4, h5, h6, em, p, ul, li, ol, dl, dt, dd, strong, hr, div, span, br, pre )

Creates a HTML element with the model name.

Attributes of <b />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

id

Defines the GUID of the model.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

Valid inside <b /> are: text content, <wiki-text-property />, <label />, <row />, <clear-filter-button />, <property-column />, <tab-set />, <remember-me-checkbox />, <login-button />, <button />, <content />, <exception />, <button-column />, <plain-text />, <verbatim />, <text-field />, <message-based-refresh />, <heading />, <rich-text-property />, <url-column />, <content-group />, <tab />, <select-popup />, <checkbox />, <error-message />, <debug-console />, <message />, <error-message-list />, <textarea />, <radio-buttons />, <rich-text-field />, <locale-select />, <external-link />, <multi-connect />, <tree-connect />, <image />, <plain-text-property />, <list-iterator />, <boolean-column />, <column />, <location-field />, <single-connect />, <collapse-link />, <toolbar />, <filter-row />, <hgroup />, <help-button />, <rich-text />, <a />, <sitemap />, <attachment />, <message-list />, <attachment-column />, <datagrid />, <select-field />, <boolean-element />, <map />, <file-upload />, <grid />, <cms-content />, <password />, <col />, <style-set />

<boolean-column />

A datagrid column displaying boolean values as optional icon and/or text.

Attributes of <boolean-column />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

escape-data

If set to false, do not escape the datagrid content. Default is true

false-icon

Sets the icon to be displayed if the value is false.

false-text

Sets the text to be displayed if the value is false.

filter-mode

Defines the filter mode for the property. null means that there is no filter defined for the property.

heading

Defines the heading.

id

Defines the GUID of the model.

info

Sets the column info for this button-column. The text is split at | characters into multiple lines for javascript enabled clients.

The javascript widget/InfoPopupWidget.js can be added as a dependency to a web application to enable multi-line info output split at | for javascript-enabled clients. You can take a look at the script for inspiration to implement other schemes.

property-ref (required)

References the property read or written to by this widget.

required

If set to true, the widget requires a value to be entered by the user.

sortable

Set this to false if you don't want the table to be sortable.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

target-domain-type-ref

Defines the target domain type reference.

transition-ref

Sets the id of the transition invoked when clicking on this column.

true-icon

Sets the icon to be displayed if the value is true.

true-text

Sets the text to be displayed if the value is true.

type

Defines the data type for the given input field which only is necessary for self-referencing fields not containing text.

Valid inside <boolean-column /> are: <cell-format-set />, <style-set />

<boolean-column /> is valid inside: <formula-property-set />, <content />, <joined-property-set />, <content-group />, <enum-property-set />, <tab />, <datagrid-column-list />, <domain-type-property-set />, <reference-property-set />, <list-iterator />, <column />, <a />, <col />

<boolean-element />

Displays a boolean-value in the form of icons or images with a variable String. Example:

Attributes of <boolean-element />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

false-icon

Icon to be displayed in the false case.

false-resource

Resource path of the image resource to be displayed for the false case.

false-text

Internationalized Text to be displayed in the false case.

id

Defines the GUID of the model.

property-ref (required)

References the property read or written to by this widget.

required

If set to true, the widget requires a value to be entered by the user.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

true-icon

Icon to be displayed in the true case.

true-resource

Resource path of the image resource to be displayed for the true case.

true-text

Internationalized Text to be displayed in the true case.

type

Defines the data type for the given input field which only is necessary for self-referencing fields not containing text.

Valid inside <boolean-element /> is: <style-set />

<boolean-element /> is valid inside: <formula-property-set />, <content />, <joined-property-set />, <content-group />, <enum-property-set />, <tab />, <domain-type-property-set />, <reference-property-set />, <list-iterator />, <column />, <a />, <col />

<br />

( Additional names: a, h1, h2, h3, h4, h5, h6, b, em, p, ul, li, ol, dl, dt, dd, strong, hr, div, span, pre )

Creates a HTML element with the model name.

Attributes of <br />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

id

Defines the GUID of the model.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

Valid inside <br /> are: text content, <wiki-text-property />, <label />, <row />, <clear-filter-button />, <property-column />, <tab-set />, <remember-me-checkbox />, <login-button />, <button />, <content />, <exception />, <button-column />, <plain-text />, <verbatim />, <text-field />, <message-based-refresh />, <heading />, <rich-text-property />, <url-column />, <content-group />, <tab />, <select-popup />, <checkbox />, <error-message />, <debug-console />, <message />, <error-message-list />, <textarea />, <radio-buttons />, <rich-text-field />, <locale-select />, <external-link />, <multi-connect />, <tree-connect />, <image />, <plain-text-property />, <list-iterator />, <boolean-column />, <column />, <location-field />, <single-connect />, <collapse-link />, <toolbar />, <filter-row />, <hgroup />, <help-button />, <rich-text />, <a />, <sitemap />, <attachment />, <message-list />, <attachment-column />, <datagrid />, <select-field />, <boolean-element />, <map />, <file-upload />, <grid />, <cms-content />, <password />, <col />, <style-set />

<button />

( Additional names: link )

Defines a command button that triggers a transition if the user clicks on it. The button can have an icon and a text.

Attributes of <button />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

disable
icon

Defines the icon used for this button.

id

Defines the GUID of the model.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

target

Sets the link target for the given command link. This will only work if

  • the command is actually a link.

  • the transition of the command does not require binding, i.e. there is no action that requires binding in that transition's action-list.

text

Defines the button text.

text-property-ref

References a property to receive the command button text from.

transition-ref (required)

Defines the transition ID.

Valid inside <button /> are: <disabled-if />, <visible-if />, <style-set />

<button-column />

Displays a column of buttons.

Attributes of <button-column />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

disable
heading

Sets the column heading for this button column.

icon

Defines the icon used for this button.

id

Defines the GUID of the model.

info
show-text

If set to false, the button of a button-column will be initially hidden and moved to the tooltip. This defaults to true which uses more screen space but is more accessible, too.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

target

Sets the link target for the given command link. This will only work if

  • the command is actually a link.

  • the transition of the command does not require binding, i.e. there is no action that requires binding in that transition's action-list.

target-domain-type-ref

Defines the target domain type reference. If you use the datagrid to display a joined domain type, you can use this attribute to specify that the column uses the primary key of the target domain type instead of the primary key of the joined domain type.

text

Defines the button text.

text-property-ref

References a property to receive the command button text from.

transition-ref (required)

Defines the transition ID.

Valid inside <button-column /> are: <cell-format-set />, <disabled-if />, <visible-if />, <style-set />

<button-column /> is valid inside: <content />, <content-group />, <tab />, <datagrid-column-list />, <list-iterator />, <column />, <toolbar />, <a />, <col />

<cell-format />

Defines the rules for providing a the section called “<datagrid />” row with additional HTML classes based on a filter specification. CSS rules can be defined for the classes added to highlight certain data grid rows or cells based on their content.

Attributes of <cell-format />
AttributeDescription
class (required)

Sets the class names to set when the filter specification model matches the current object in the data grid.

description

Defines the description.

id

Defines the GUID of the model.

Valid inside <cell-format /> are: <execute-if />, <auto-complete-filter />, <read-only-if />, <with-filter />, <filter-restriction />, <filter-specification />, <visible-if />, <disabled-if />, <condition />, <validate-if />

<cell-format /> is valid inside: <cell-format-set />

<cell-format-set />

Represents a set of formatting rules applied to data grid cells if a configured filter returns true for the object of the current data grid row. If the the section called “<cell-format-set />” is defined directly on the data grid, it sets its class to every cell of the complete row. If it's added to a column, it only sets its class on the cell in that column.

Attributes of <cell-format-set />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <cell-format-set /> is: <cell-format />

<cell-format-set /> is valid inside: <property-column />, <url-column />, <boolean-column />, <attachment-column />, <button-column />, <url-column />, <boolean-column />, <attachment-column />, <datagrid />

<checkbox />

This tag provides a checkbox ('selected' vs. 'unselected') element.

Example 50.2. Checkbox Element

 <checkbox id="positionOrdered" property-ref="domain.position.ordered"/>
 

Attributes of <checkbox />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

id

Defines the GUID of the model.

mode

Sets a constant write mode for this widget.

property-ref (required)

References the property read or written to by this widget.

required

If set to true, the widget requires a value to be entered by the user.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

type

Defines the data type for the given input field which only is necessary for self-referencing fields not containing text.

Valid inside <checkbox /> are: <on-update-refresh />, <disabled-if />, <read-only-if />, <style-set />

<checkbox /> is valid inside: <formula-property-set />, <content />, <joined-property-set />, <content-group />, <enum-property-set />, <tab />, <domain-type-property-set />, <reference-property-set />, <list-iterator />, <column />, <a />, <col />

<clear-filter-button />

Special button to clear the filter on filtered data grids. Normally only used by the ModelAutoCompleter.

Attributes of <clear-filter-button />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

disable
icon

Defines the icon used for this button.

id

Defines the GUID of the model.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

target

Sets the link target for the given command link. This will only work if

  • the command is actually a link.

  • the transition of the command does not require binding, i.e. there is no action that requires binding in that transition's action-list.

text

Defines the button text.

text-property-ref

References a property to receive the command button text from.

transition-ref (required)

Defines the transition ID.

Valid inside <clear-filter-button /> are: <disabled-if />, <visible-if />, <style-set />

<clear-filter-button /> is valid inside: <content />, <content-group />, <tab />, <list-iterator />, <column />, <toolbar />, <a />, <col />

<cms-content />

Displays CMS content.

Attributes of <cms-content />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

cms-content-source (required)

Defines the name of the used cms content source.

content-path (required)

Defines the content path of the content that is shown by this element.

description

Defines the description.

id

Defines the GUID of the model.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

Valid inside <cms-content /> is: <style-set />

<cms-content /> is valid inside: <content />, <content-group />, <tab />, <list-iterator />, <column />, <a />, <col />

<col />

Blueprint layout column inside a the section called “<hgroup />”.

Attributes of <col />
AttributeDescription
append

Sets the number of columns appended to the right of this column.

class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

id

Defines the GUID of the model.

prepend

Sets the number of column prepended to the left of this column.

pull

Sets the number of layout columns this column is pulled out.

push

Sets the number of layout columns this column is pushed in.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

width

Sets the width in layout columns.

Valid inside <col /> are: <wiki-text-property />, <label />, <row />, <clear-filter-button />, <property-column />, <tab-set />, <remember-me-checkbox />, <login-button />, <button />, <content />, <exception />, <button-column />, <plain-text />, <verbatim />, <text-field />, <message-based-refresh />, <heading />, <rich-text-property />, <url-column />, <content-group />, <tab />, <select-popup />, <checkbox />, <error-message />, <debug-console />, <message />, <error-message-list />, <textarea />, <radio-buttons />, <rich-text-field />, <locale-select />, <external-link />, <multi-connect />, <tree-connect />, <image />, <plain-text-property />, <list-iterator />, <boolean-column />, <column />, <location-field />, <single-connect />, <collapse-link />, <toolbar />, <filter-row />, <hgroup />, <help-button />, <rich-text />, <a />, <sitemap />, <attachment />, <message-list />, <attachment-column />, <datagrid />, <select-field />, <boolean-element />, <map />, <file-upload />, <grid />, <cms-content />, <password />, <col />, <disabled-if />, <read-only-if />, <visible-if />, <style-set />

<col /> is valid inside: <content />, <content-group />, <tab />, <list-iterator />, <column />, <hgroup />, <a />, <col />

<collapse-button />

( Additional names: collapse-link )

Widget that hides or shows its target reference.

Attributes of <collapse-button />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

disable
icon

Defines the icon used for this button.

id

Defines the GUID of the model.

open

If true the default mode for the target will be open or visible.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

target

Sets the link target for the given command link. This will only work if

  • the command is actually a link.

  • the transition of the command does not require binding, i.e. there is no action that requires binding in that transition's action-list.

target-ref

Id of the content element model that you want to hide or show.

text

Defines the button text.

text-property-ref

References a property to receive the command button text from.

transition-ref (required)

Defines the transition ID.

uncollapse-icon

Sets the icon used in the uncollapsed/open state.

Valid inside <collapse-button /> are: <disabled-if />, <visible-if />, <style-set />

<collapse-link />

( Additional names: collapse-button )

Widget that hides or shows its target reference.

Attributes of <collapse-link />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

disable
icon

Defines the icon used for this button.

id

Defines the GUID of the model.

open

If true the default mode for the target will be open or visible.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

target

Sets the link target for the given command link. This will only work if

  • the command is actually a link.

  • the transition of the command does not require binding, i.e. there is no action that requires binding in that transition's action-list.

target-ref

Id of the content element model that you want to hide or show.

text

Defines the button text.

text-property-ref

References a property to receive the command button text from.

transition-ref (required)

Defines the transition ID.

uncollapse-icon

Sets the icon used in the uncollapsed/open state.

Valid inside <collapse-link /> are: <disabled-if />, <visible-if />, <style-set />

<collapse-link /> is valid inside: <content />, <content-group />, <tab />, <list-iterator />, <column />, <toolbar />, <a />, <col />

<column />

Content element representing a column in an layout table.

Attributes of <column />
AttributeDescription
alignment

Defines the column alignment.

class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

id

Defines the GUID of the model.

span

Defines the column span.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

Valid inside <column /> are: <wiki-text-property />, <label />, <row />, <clear-filter-button />, <property-column />, <tab-set />, <remember-me-checkbox />, <login-button />, <button />, <content />, <exception />, <button-column />, <plain-text />, <verbatim />, <text-field />, <message-based-refresh />, <heading />, <rich-text-property />, <url-column />, <content-group />, <tab />, <select-popup />, <checkbox />, <error-message />, <debug-console />, <message />, <error-message-list />, <textarea />, <radio-buttons />, <rich-text-field />, <locale-select />, <external-link />, <multi-connect />, <tree-connect />, <image />, <plain-text-property />, <list-iterator />, <boolean-column />, <column />, <location-field />, <single-connect />, <collapse-link />, <toolbar />, <filter-row />, <hgroup />, <help-button />, <rich-text />, <a />, <sitemap />, <attachment />, <message-list />, <attachment-column />, <datagrid />, <select-field />, <boolean-element />, <map />, <file-upload />, <grid />, <cms-content />, <password />, <col />, <style-set />

<column /> is valid inside: <row />, <filter-row />, <content />, <content-group />, <tab />, <list-iterator />, <column />, <filter-row />, <a />, <col />

<content />

Contains all content / widgets of a part.

Attributes of <content />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

id

Defines the GUID of the model.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

Valid inside <content /> are: <wiki-text-property />, <label />, <row />, <clear-filter-button />, <property-column />, <tab-set />, <remember-me-checkbox />, <login-button />, <button />, <content />, <exception />, <button-column />, <plain-text />, <verbatim />, <text-field />, <message-based-refresh />, <heading />, <rich-text-property />, <url-column />, <content-group />, <tab />, <select-popup />, <checkbox />, <error-message />, <debug-console />, <message />, <error-message-list />, <textarea />, <radio-buttons />, <rich-text-field />, <locale-select />, <external-link />, <multi-connect />, <tree-connect />, <image />, <plain-text-property />, <list-iterator />, <boolean-column />, <column />, <location-field />, <single-connect />, <collapse-link />, <toolbar />, <filter-row />, <hgroup />, <help-button />, <rich-text />, <a />, <sitemap />, <attachment />, <message-list />, <attachment-column />, <datagrid />, <select-field />, <boolean-element />, <map />, <file-upload />, <grid />, <cms-content />, <password />, <col />, <style-set />

<content /> is valid inside: <part />, <content />, <content-group />, <tab />, <list-iterator />, <column />, <a />, <col />

<content-group />

Defines a group of content elements that may be refreshed by a the section called “<on-update-refresh />”. The content grouph has an optional border and optional heading.

Attributes of <content-group />
AttributeDescription
anchor

Sets the HTML anchor name generated for this content group.

border

Set this to false, if you want no border on this content group. Default is true

class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

heading

Sets the internationalization key for the heading of this content group.

heading-property-ref

References a property from which the heading text is received.

id

Defines the GUID of the model.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

Valid inside <content-group /> are: <disabled-if />, <read-only-if />, <visible-if />, <wiki-text-property />, <label />, <row />, <clear-filter-button />, <property-column />, <tab-set />, <remember-me-checkbox />, <login-button />, <button />, <content />, <exception />, <button-column />, <plain-text />, <verbatim />, <text-field />, <message-based-refresh />, <heading />, <rich-text-property />, <url-column />, <content-group />, <tab />, <select-popup />, <checkbox />, <error-message />, <debug-console />, <message />, <error-message-list />, <textarea />, <radio-buttons />, <rich-text-field />, <locale-select />, <external-link />, <multi-connect />, <tree-connect />, <image />, <plain-text-property />, <list-iterator />, <boolean-column />, <column />, <location-field />, <single-connect />, <collapse-link />, <toolbar />, <filter-row />, <hgroup />, <help-button />, <rich-text />, <a />, <sitemap />, <attachment />, <message-list />, <attachment-column />, <datagrid />, <select-field />, <boolean-element />, <map />, <file-upload />, <grid />, <cms-content />, <password />, <col />, <style-set />

<content-group /> is valid inside: <content />, <content-group />, <tab />, <list-iterator />, <column />, <a />, <col />

<datagrid />

Data grid widget that can display domain types in a tabular fashion and also act as navigational helper for such data.

There are three basic data grid modes:

Example 50.3. Simple data grid with user filter

<datagrid domain-type-ref="faq.d_faq" filter="opened">
    <datagrid-column-list>
        <property-column property-ref="faq.d_faq.question" filter-mode="contains"/>
        <button-column text="Edit" transition-ref="faq.p_faq.v_faq_list.t_edit"/>
    </datagrid-column-list>
</datagrid>    

The example above shows a basic datagrid displaying the question property from the FAQ example and a button that invokes a transition to the edit page for that FAQ type. The filter and filter-mode attributes enable a user filter on this Datagrid. The nescessary filter fields etc are created automatically. The displayed domain type can the filtered with a child the section called “<filter-specification />”.

Example 50.4. Object relative data grid

<datagrid heading="Role List" domain-type-ref="base.d_role" object-relative="true">
    <relation-chain>
        <relation-reference relation-ref="base.r_base.d_user_base.d_role"/>
    </relation-chain>
    <datagrid-column-list>
        <property-column heading="Role Name" property-ref="base.d_role.name"/>
        <property-column heading="Comment" property-ref="base.d_role.comment"/>
    </datagrid-column-list>
    <sort-order-list>
        <sort-order property-ref="base.d_role.name"/>
    </sort-order-list>
</datagrid>

This example out the base processes shows the roles connected to the current user. The view's domain-type-reference is set to the user domain type and the relation-chain references the relation with which users are connected to roles. The data grid is sorted by the role name.

Example 50.5. Data grid showing a scoped domain object list

 <datagrid heading="Virtual Foo List" scoped-domain-object-list-ref="list.of.foo">
     <datagrid-column-list>
         <property-column heading="Name" property-ref="sandbox.foo.name" />
     </datagrid-column-list>
     <available-export-list>
         <available-export generator="jasper" format="pdf" 
             icon="export_pdf" text="PDF" title="Export to PDF" />
     </available-export-list>
 </datagrid>

This example shows the content of the scoped domain object list "list.of.foo" and allows exporting of the data grid to PDF.

Attributes of <datagrid />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

create-joined-domain-type

Defines the flag indicating if a joined domain type has to be created.

description

Defines the description.

domain-type-ref

Defines the top level domain type to be listed in this data grid.

escape-data

If set to false, do not escape the datagrid content. Default is true

filter

Defines the filter display mode. To enable user filtering you also have to define a filter-mode attribute on at least one data grid column.

heading

Defines the data grid heading internationalization key.

id

Defines the GUID of the model.

object-relative

Defines if the data grid as object relative. You also need to include a child RelationReferenceChainModel to define the relative type.

scoped-domain-object-list-ref

Defines a reference to a cached domain object list.

show-row-count

Disables display of the row count if set to false.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

transition-ref

References the object transition which is the transition that is executed when the user clicks on a the section called “<property-column />” in the data grid. To enable different transitions per column, you have to set the transition-ref on a the section called “<property-column />”.

Valid inside <datagrid /> are: <execute-if />, <auto-complete-filter />, <read-only-if />, <with-filter />, <filter-restriction />, <filter-specification />, <visible-if />, <disabled-if />, <condition />, <validate-if />, <sort-order-list />, <cell-format-set />, <info-header-row-list />, <relation-chain />, <paging />, <datagrid-column-list />, <toolbar />, <available-export-list />, <header-row-list />, <footer-row-list />, <on-update-refresh />, <filter-row />, <style-set />

<datagrid /> is valid inside: <content />, <content-group />, <tab />, <list-iterator />, <column />, <a />, <col />

<datagrid-column-list />

Contains and orders all columns inside a the section called “<datagrid />”.

Attributes of <datagrid-column-list />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <datagrid-column-list /> are: <property-column />, <button-column />, <url-column />, <boolean-column />, <attachment-column />

<datagrid-column-list /> is valid inside: <datagrid />

<dd />

( Additional names: a, h1, h2, h3, h4, h5, h6, b, em, p, ul, li, ol, dl, dt, strong, hr, div, span, br, pre )

Creates a HTML element with the model name.

Attributes of <dd />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

id

Defines the GUID of the model.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

Valid inside <dd /> are: text content, <wiki-text-property />, <label />, <row />, <clear-filter-button />, <property-column />, <tab-set />, <remember-me-checkbox />, <login-button />, <button />, <content />, <exception />, <button-column />, <plain-text />, <verbatim />, <text-field />, <message-based-refresh />, <heading />, <rich-text-property />, <url-column />, <content-group />, <tab />, <select-popup />, <checkbox />, <error-message />, <debug-console />, <message />, <error-message-list />, <textarea />, <radio-buttons />, <rich-text-field />, <locale-select />, <external-link />, <multi-connect />, <tree-connect />, <image />, <plain-text-property />, <list-iterator />, <boolean-column />, <column />, <location-field />, <single-connect />, <collapse-link />, <toolbar />, <filter-row />, <hgroup />, <help-button />, <rich-text />, <a />, <sitemap />, <attachment />, <message-list />, <attachment-column />, <datagrid />, <select-field />, <boolean-element />, <map />, <file-upload />, <grid />, <cms-content />, <password />, <col />, <style-set />

<debug-console />

Special button that enables the use of the debug console on a page. This widget is inserted automatically if your the section called “<stage />”'s debug-console attribute is set to true.

Attributes of <debug-console />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

disable
icon

Defines the icon used for this button.

id

Defines the GUID of the model.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

target

Sets the link target for the given command link. This will only work if

  • the command is actually a link.

  • the transition of the command does not require binding, i.e. there is no action that requires binding in that transition's action-list.

text

Defines the button text.

text-property-ref

References a property to receive the command button text from.

transition-ref (required)

Defines the transition ID.

Valid inside <debug-console /> are: <disabled-if />, <visible-if />, <style-set />

<debug-console /> is valid inside: <content />, <content-group />, <tab />, <list-iterator />, <column />, <toolbar />, <a />, <col />

<disabled-if />

Specialization of a filter specification model that sets writing models to disabled if it evaluates to true.

Attributes of <disabled-if />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <disabled-if /> are: <greater-than />, <is-property-modified />, <and />, <geo-within />, <matches />, <user-logged-in />, <validation-failed />, <complies-to />, <criterion />, <less-than-or-equal-to />, <has-current-element />, <is-undefined />, <has-changed />, <or />, <is-connected-to />, <can-access />, <ends-with />, <geo-contains />, <has-permission />, <contains-comparator />, <starts-with />, <not />, <equals />, <is-new />, <has-elements />, <dynamic-condition />, <true />, <less-than />, <in />, <include />, <in-transition />, <filter-pattern />, <has-type />, <greater-than-or-equal-to />, <is-super-user />, <false />, <is-defined />, <filter-pattern-set />

<disabled-if /> is valid inside: <external-excel-domain-type />, <row />, <filter-row />, <clear-filter-button />, <login-button />, <clear-filter-button />, <login-button />, <button />, <button-column />, <debug-console />, <collapse-link />, <help-button />, <external-relational-domain-type />, <count />, <button-column />, <filter-specification-set />, <text-field />, <password />, <joined-domain-type />, <content-group />, <constant-domain-type />, <select-popup />, <checkbox />, <start-action-list />, <debug-console />, <external-excel-domain-type />, <external-relational-domain-type />, <joined-domain-type />, <constant-domain-type />, <domain-type />, <wfs-domain-type />, <request-context />, <textarea />, <radio-buttons />, <radio-buttons />, <rich-text-field />, <locale-select />, <multi-connect />, <multi-connect />, <tree-connect />, <tree-connect />, <transition />, <list-iterator />, <case />, <wfs-domain-type />, <location-field />, <multi-connect />, <single-connect />, <multi-connect />, <single-connect />, <relation-reference />, <collapse-link />, <filter-row />, <hgroup />, <has-elements />, <help-button />, <filtered-list />, <attachment />, <agent-action />, <datagrid />, <start-action-list />, <action-list />, <radio-buttons />, <select-field />, <radio-buttons />, <select-field />, <request-context />, <cell-format />, <password />, <col />

<div />

( Additional names: a, h1, h2, h3, h4, h5, h6, b, em, p, ul, li, ol, dl, dt, dd, strong, hr, span, br, pre )

Creates a HTML element with the model name.

Attributes of <div />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

id

Defines the GUID of the model.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

Valid inside <div /> are: text content, <wiki-text-property />, <label />, <row />, <clear-filter-button />, <property-column />, <tab-set />, <remember-me-checkbox />, <login-button />, <button />, <content />, <exception />, <button-column />, <plain-text />, <verbatim />, <text-field />, <message-based-refresh />, <heading />, <rich-text-property />, <url-column />, <content-group />, <tab />, <select-popup />, <checkbox />, <error-message />, <debug-console />, <message />, <error-message-list />, <textarea />, <radio-buttons />, <rich-text-field />, <locale-select />, <external-link />, <multi-connect />, <tree-connect />, <image />, <plain-text-property />, <list-iterator />, <boolean-column />, <column />, <location-field />, <single-connect />, <collapse-link />, <toolbar />, <filter-row />, <hgroup />, <help-button />, <rich-text />, <a />, <sitemap />, <attachment />, <message-list />, <attachment-column />, <datagrid />, <select-field />, <boolean-element />, <map />, <file-upload />, <grid />, <cms-content />, <password />, <col />, <style-set />

<dl />

( Additional names: a, h1, h2, h3, h4, h5, h6, b, em, p, ul, li, ol, dt, dd, strong, hr, div, span, br, pre )

Creates a HTML element with the model name.

Attributes of <dl />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

id

Defines the GUID of the model.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

Valid inside <dl /> are: text content, <wiki-text-property />, <label />, <row />, <clear-filter-button />, <property-column />, <tab-set />, <remember-me-checkbox />, <login-button />, <button />, <content />, <exception />, <button-column />, <plain-text />, <verbatim />, <text-field />, <message-based-refresh />, <heading />, <rich-text-property />, <url-column />, <content-group />, <tab />, <select-popup />, <checkbox />, <error-message />, <debug-console />, <message />, <error-message-list />, <textarea />, <radio-buttons />, <rich-text-field />, <locale-select />, <external-link />, <multi-connect />, <tree-connect />, <image />, <plain-text-property />, <list-iterator />, <boolean-column />, <column />, <location-field />, <single-connect />, <collapse-link />, <toolbar />, <filter-row />, <hgroup />, <help-button />, <rich-text />, <a />, <sitemap />, <attachment />, <message-list />, <attachment-column />, <datagrid />, <select-field />, <boolean-element />, <map />, <file-upload />, <grid />, <cms-content />, <password />, <col />, <style-set />

<dt />

( Additional names: a, h1, h2, h3, h4, h5, h6, b, em, p, ul, li, ol, dl, dd, strong, hr, div, span, br, pre )

Creates a HTML element with the model name.

Attributes of <dt />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

id

Defines the GUID of the model.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

Valid inside <dt /> are: text content, <wiki-text-property />, <label />, <row />, <clear-filter-button />, <property-column />, <tab-set />, <remember-me-checkbox />, <login-button />, <button />, <content />, <exception />, <button-column />, <plain-text />, <verbatim />, <text-field />, <message-based-refresh />, <heading />, <rich-text-property />, <url-column />, <content-group />, <tab />, <select-popup />, <checkbox />, <error-message />, <debug-console />, <message />, <error-message-list />, <textarea />, <radio-buttons />, <rich-text-field />, <locale-select />, <external-link />, <multi-connect />, <tree-connect />, <image />, <plain-text-property />, <list-iterator />, <boolean-column />, <column />, <location-field />, <single-connect />, <collapse-link />, <toolbar />, <filter-row />, <hgroup />, <help-button />, <rich-text />, <a />, <sitemap />, <attachment />, <message-list />, <attachment-column />, <datagrid />, <select-field />, <boolean-element />, <map />, <file-upload />, <grid />, <cms-content />, <password />, <col />, <style-set />

<em />

( Additional names: a, h1, h2, h3, h4, h5, h6, b, p, ul, li, ol, dl, dt, dd, strong, hr, div, span, br, pre )

Creates a HTML element with the model name.

Attributes of <em />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

id

Defines the GUID of the model.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

Valid inside <em /> are: text content, <wiki-text-property />, <label />, <row />, <clear-filter-button />, <property-column />, <tab-set />, <remember-me-checkbox />, <login-button />, <button />, <content />, <exception />, <button-column />, <plain-text />, <verbatim />, <text-field />, <message-based-refresh />, <heading />, <rich-text-property />, <url-column />, <content-group />, <tab />, <select-popup />, <checkbox />, <error-message />, <debug-console />, <message />, <error-message-list />, <textarea />, <radio-buttons />, <rich-text-field />, <locale-select />, <external-link />, <multi-connect />, <tree-connect />, <image />, <plain-text-property />, <list-iterator />, <boolean-column />, <column />, <location-field />, <single-connect />, <collapse-link />, <toolbar />, <filter-row />, <hgroup />, <help-button />, <rich-text />, <a />, <sitemap />, <attachment />, <message-list />, <attachment-column />, <datagrid />, <select-field />, <boolean-element />, <map />, <file-upload />, <grid />, <cms-content />, <password />, <col />, <style-set />

<error-message />

This tag displays a validation error message for another tag. If no error is present, no content will be produced during rendering.

Example 50.6. Error Message Element

 <text-field id="personName" property-ref="domain.person.name"/>
 <error-message target-ref="personName"/>
 

Attributes of <error-message />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

id

Defines the GUID of the model.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

target-ref (required)

Specifies the related element. A valid element ID must be given.

Valid inside <error-message /> is: <style-set />

<error-message /> is valid inside: <content />, <content-group />, <tab />, <list-iterator />, <column />, <a />, <col />

<error-message-list />

This tag produces a list of all registered error messages that are not bound to a tag. Only will be rendered if one relevant message is present at least.

Example 50.7. Error-Message-List Element

 <error-message-list title-tag="ErrorList"/>
 

Attributes of <error-message-list />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

global-only

Sets this to true if only want to display global error messages. The default is to display global error messages and also error messages for which no the section called “<error-message />” is defined.

id

Defines the GUID of the model.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

title-tag

Title to use for the error list.

If rendering (at least one relevant message is present) an additional title tag with the given text key will be produced.

Valid inside <error-message-list /> is: <style-set />

<error-message-list /> is valid inside: <content />, <content-group />, <tab />, <list-iterator />, <column />, <a />, <col />

<exception />

Displays a java exception including stack trace if the stage is in development-mode.

See also:

Attributes of <exception />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

id

Defines the GUID of the model.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

Valid inside <exception /> is: <style-set />

<exception /> is valid inside: <content />, <content-group />, <tab />, <list-iterator />, <column />, <a />, <col />

<external-link />

This tag provides an external link.

Example 50.8. External Link Element

 <external-link target="_blank"
                text="An External Link"
                url="http://www.google.com"/>
 

Attributes of <external-link />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

id

Defines the GUID of the model.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

target

Specifies the HTML target attribute.

text

Specifies the text key to specify the displayed link text.

url

Specifies the link URL.

Valid inside <external-link /> is: <style-set />

<external-link /> is valid inside: <content />, <content-group />, <tab />, <list-iterator />, <column />, <a />, <col />

<file-upload />

Widget that can upload files to be processed by a script. If you just want to upload and store files, you might want to use an the section called “<attachment />”.

Attributes of <file-upload />
AttributeDescription
accept

Sets the accept value for the file upload that gets passed through to HTML.

class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

id

Defines the GUID of the model.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

Valid inside <file-upload /> is: <style-set />

<file-upload /> is valid inside: <content />, <content-group />, <tab />, <list-iterator />, <column />, <a />, <col />

<filter-row />

Data grid row containing filter fields ; normally created by model enhancement automatically.

Attributes of <filter-row />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

id

Defines the GUID of the model.

span

Defines the row span.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

Valid inside <filter-row /> are: <column />, <disabled-if />, <read-only-if />, <visible-if />, <style-set />

<filter-row /> is valid inside: <content />, <content-group />, <tab />, <list-iterator />, <column />, <footer-row-list />, <a />, <datagrid />, <header-row-list />, <grid />, <col />

<footer-row-list />

Contains a list of fixed data grid rows to be inserted after the data rows.

Attributes of <footer-row-list />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <footer-row-list /> are: <row />, <filter-row />

<footer-row-list /> is valid inside: <datagrid />

<grid />

A layout table grid that can be used with a layout manager.

Attributes of <grid />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

id

Defines the GUID of the model.

layout

Name of the layout used for this grid model. There is currently one predefined layout manager named "gridFormLayout" which will resize labels and input widgets in alternating columns to fill the enclosing layout column, restrained to a maximum width.

This attribute must correspond to a layout manager bean with the same name with or without "Manager" suffix. You can define other layout managers as spring beans.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

Valid inside <grid /> are: <row />, <filter-row />, <style-set />

<grid /> is valid inside: <content />, <content-group />, <tab />, <list-iterator />, <column />, <a />, <col />

<h1 />

( Additional names: a, h2, h3, h4, h5, h6, b, em, p, ul, li, ol, dl, dt, dd, strong, hr, div, span, br, pre )

Creates a HTML element with the model name.

Attributes of <h1 />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

id

Defines the GUID of the model.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

Valid inside <h1 /> are: text content, <wiki-text-property />, <label />, <row />, <clear-filter-button />, <property-column />, <tab-set />, <remember-me-checkbox />, <login-button />, <button />, <content />, <exception />, <button-column />, <plain-text />, <verbatim />, <text-field />, <message-based-refresh />, <heading />, <rich-text-property />, <url-column />, <content-group />, <tab />, <select-popup />, <checkbox />, <error-message />, <debug-console />, <message />, <error-message-list />, <textarea />, <radio-buttons />, <rich-text-field />, <locale-select />, <external-link />, <multi-connect />, <tree-connect />, <image />, <plain-text-property />, <list-iterator />, <boolean-column />, <column />, <location-field />, <single-connect />, <collapse-link />, <toolbar />, <filter-row />, <hgroup />, <help-button />, <rich-text />, <a />, <sitemap />, <attachment />, <message-list />, <attachment-column />, <datagrid />, <select-field />, <boolean-element />, <map />, <file-upload />, <grid />, <cms-content />, <password />, <col />, <style-set />

<h2 />

( Additional names: a, h1, h3, h4, h5, h6, b, em, p, ul, li, ol, dl, dt, dd, strong, hr, div, span, br, pre )

Creates a HTML element with the model name.

Attributes of <h2 />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

id

Defines the GUID of the model.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

Valid inside <h2 /> are: text content, <wiki-text-property />, <label />, <row />, <clear-filter-button />, <property-column />, <tab-set />, <remember-me-checkbox />, <login-button />, <button />, <content />, <exception />, <button-column />, <plain-text />, <verbatim />, <text-field />, <message-based-refresh />, <heading />, <rich-text-property />, <url-column />, <content-group />, <tab />, <select-popup />, <checkbox />, <error-message />, <debug-console />, <message />, <error-message-list />, <textarea />, <radio-buttons />, <rich-text-field />, <locale-select />, <external-link />, <multi-connect />, <tree-connect />, <image />, <plain-text-property />, <list-iterator />, <boolean-column />, <column />, <location-field />, <single-connect />, <collapse-link />, <toolbar />, <filter-row />, <hgroup />, <help-button />, <rich-text />, <a />, <sitemap />, <attachment />, <message-list />, <attachment-column />, <datagrid />, <select-field />, <boolean-element />, <map />, <file-upload />, <grid />, <cms-content />, <password />, <col />, <style-set />

<h3 />

( Additional names: a, h1, h2, h4, h5, h6, b, em, p, ul, li, ol, dl, dt, dd, strong, hr, div, span, br, pre )

Creates a HTML element with the model name.

Attributes of <h3 />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

id

Defines the GUID of the model.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

Valid inside <h3 /> are: text content, <wiki-text-property />, <label />, <row />, <clear-filter-button />, <property-column />, <tab-set />, <remember-me-checkbox />, <login-button />, <button />, <content />, <exception />, <button-column />, <plain-text />, <verbatim />, <text-field />, <message-based-refresh />, <heading />, <rich-text-property />, <url-column />, <content-group />, <tab />, <select-popup />, <checkbox />, <error-message />, <debug-console />, <message />, <error-message-list />, <textarea />, <radio-buttons />, <rich-text-field />, <locale-select />, <external-link />, <multi-connect />, <tree-connect />, <image />, <plain-text-property />, <list-iterator />, <boolean-column />, <column />, <location-field />, <single-connect />, <collapse-link />, <toolbar />, <filter-row />, <hgroup />, <help-button />, <rich-text />, <a />, <sitemap />, <attachment />, <message-list />, <attachment-column />, <datagrid />, <select-field />, <boolean-element />, <map />, <file-upload />, <grid />, <cms-content />, <password />, <col />, <style-set />

<h4 />

( Additional names: a, h1, h2, h3, h5, h6, b, em, p, ul, li, ol, dl, dt, dd, strong, hr, div, span, br, pre )

Creates a HTML element with the model name.

Attributes of <h4 />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

id

Defines the GUID of the model.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

Valid inside <h4 /> are: text content, <wiki-text-property />, <label />, <row />, <clear-filter-button />, <property-column />, <tab-set />, <remember-me-checkbox />, <login-button />, <button />, <content />, <exception />, <button-column />, <plain-text />, <verbatim />, <text-field />, <message-based-refresh />, <heading />, <rich-text-property />, <url-column />, <content-group />, <tab />, <select-popup />, <checkbox />, <error-message />, <debug-console />, <message />, <error-message-list />, <textarea />, <radio-buttons />, <rich-text-field />, <locale-select />, <external-link />, <multi-connect />, <tree-connect />, <image />, <plain-text-property />, <list-iterator />, <boolean-column />, <column />, <location-field />, <single-connect />, <collapse-link />, <toolbar />, <filter-row />, <hgroup />, <help-button />, <rich-text />, <a />, <sitemap />, <attachment />, <message-list />, <attachment-column />, <datagrid />, <select-field />, <boolean-element />, <map />, <file-upload />, <grid />, <cms-content />, <password />, <col />, <style-set />

<h5 />

( Additional names: a, h1, h2, h3, h4, h6, b, em, p, ul, li, ol, dl, dt, dd, strong, hr, div, span, br, pre )

Creates a HTML element with the model name.

Attributes of <h5 />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

id

Defines the GUID of the model.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

Valid inside <h5 /> are: text content, <wiki-text-property />, <label />, <row />, <clear-filter-button />, <property-column />, <tab-set />, <remember-me-checkbox />, <login-button />, <button />, <content />, <exception />, <button-column />, <plain-text />, <verbatim />, <text-field />, <message-based-refresh />, <heading />, <rich-text-property />, <url-column />, <content-group />, <tab />, <select-popup />, <checkbox />, <error-message />, <debug-console />, <message />, <error-message-list />, <textarea />, <radio-buttons />, <rich-text-field />, <locale-select />, <external-link />, <multi-connect />, <tree-connect />, <image />, <plain-text-property />, <list-iterator />, <boolean-column />, <column />, <location-field />, <single-connect />, <collapse-link />, <toolbar />, <filter-row />, <hgroup />, <help-button />, <rich-text />, <a />, <sitemap />, <attachment />, <message-list />, <attachment-column />, <datagrid />, <select-field />, <boolean-element />, <map />, <file-upload />, <grid />, <cms-content />, <password />, <col />, <style-set />

<h6 />

( Additional names: a, h1, h2, h3, h4, h5, b, em, p, ul, li, ol, dl, dt, dd, strong, hr, div, span, br, pre )

Creates a HTML element with the model name.

Attributes of <h6 />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

id

Defines the GUID of the model.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

Valid inside <h6 /> are: text content, <wiki-text-property />, <label />, <row />, <clear-filter-button />, <property-column />, <tab-set />, <remember-me-checkbox />, <login-button />, <button />, <content />, <exception />, <button-column />, <plain-text />, <verbatim />, <text-field />, <message-based-refresh />, <heading />, <rich-text-property />, <url-column />, <content-group />, <tab />, <select-popup />, <checkbox />, <error-message />, <debug-console />, <message />, <error-message-list />, <textarea />, <radio-buttons />, <rich-text-field />, <locale-select />, <external-link />, <multi-connect />, <tree-connect />, <image />, <plain-text-property />, <list-iterator />, <boolean-column />, <column />, <location-field />, <single-connect />, <collapse-link />, <toolbar />, <filter-row />, <hgroup />, <help-button />, <rich-text />, <a />, <sitemap />, <attachment />, <message-list />, <attachment-column />, <datagrid />, <select-field />, <boolean-element />, <map />, <file-upload />, <grid />, <cms-content />, <password />, <col />, <style-set />

<header-row-list />

Contains a list of fixed rows inserted in the data grid after all headers but before the data rows.

Attributes of <header-row-list />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <header-row-list /> are: <row />, <filter-row />

<header-row-list /> is valid inside: <datagrid />

<heading />

A heading label widgets. Either normal text sized or larger.

Attributes of <heading />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

id

Defines the GUID of the model.

size
style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

value

Defines the heading.

value-property-ref

Valid inside <heading /> is: <style-set />

<heading /> is valid inside: <content />, <content-group />, <tab />, <list-iterator />, <column />, <a />, <col />

<help-button />

Special help button implementation triggering a controller/AJAX based help system without any transitions.

Attributes of <help-button />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

disable
help-id

Help id for this help button. Default is the view id.

icon

Defines the icon used for this button.

id

Defines the GUID of the model.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

target

Sets the link target for the given command link. This will only work if

  • the command is actually a link.

  • the transition of the command does not require binding, i.e. there is no action that requires binding in that transition's action-list.

text

Defines the button text.

text-property-ref

References a property to receive the command button text from.

transition-ref (required)

Defines the transition ID.

Valid inside <help-button /> are: <disabled-if />, <visible-if />, <style-set />

<help-button /> is valid inside: <content />, <content-group />, <tab />, <list-iterator />, <column />, <toolbar />, <a />, <col />

<hgroup />

( Additional names: vgroup )

Is a vertical or horizontal blueprint column group inside a part.

Attributes of <hgroup />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

id

Defines the GUID of the model.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

width

Sets the width in layout columns.

Valid inside <hgroup /> are: <hgroup />, <col />, <disabled-if />, <read-only-if />, <visible-if />, <style-set />

<hr />

( Additional names: a, h1, h2, h3, h4, h5, h6, b, em, p, ul, li, ol, dl, dt, dd, strong, div, span, br, pre )

Creates a HTML element with the model name.

Attributes of <hr />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

id

Defines the GUID of the model.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

Valid inside <hr /> are: text content, <wiki-text-property />, <label />, <row />, <clear-filter-button />, <property-column />, <tab-set />, <remember-me-checkbox />, <login-button />, <button />, <content />, <exception />, <button-column />, <plain-text />, <verbatim />, <text-field />, <message-based-refresh />, <heading />, <rich-text-property />, <url-column />, <content-group />, <tab />, <select-popup />, <checkbox />, <error-message />, <debug-console />, <message />, <error-message-list />, <textarea />, <radio-buttons />, <rich-text-field />, <locale-select />, <external-link />, <multi-connect />, <tree-connect />, <image />, <plain-text-property />, <list-iterator />, <boolean-column />, <column />, <location-field />, <single-connect />, <collapse-link />, <toolbar />, <filter-row />, <hgroup />, <help-button />, <rich-text />, <a />, <sitemap />, <attachment />, <message-list />, <attachment-column />, <datagrid />, <select-field />, <boolean-element />, <map />, <file-upload />, <grid />, <cms-content />, <password />, <col />, <style-set />

<image />

Defines an image widget.

Attributes of <image />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

id

Defines the GUID of the model.

resource

Defines the image resource.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

Valid inside <image /> is: <style-set />

<image /> is valid inside: <content />, <content-group />, <tab />, <list-iterator />, <column />, <a />, <col />

<info-header />

Info Header row for the table, possibly spanning more than one column.

Attributes of <info-header />
AttributeDescription
class
description

Defines the description.

heading (required)
id

Defines the GUID of the model.

info

Sets the column info for this button-column. The text is split at | characters into multiple lines for javascript enabled clients.

The javascript widget/InfoPopupWidget.js can be added as a dependency to a web application to enable multi-line info output split at | for javascript-enabled clients. You can take a look at the script for inspiration to implement other schemes.

span

Sets the number of columns this info-header will span. Defaults to 1.

<info-header /> is valid inside: <info-header-row />

<info-header-row />

Contains a row with additional info headers.

Attributes of <info-header-row />
AttributeDescription
class
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <info-header-row /> is: <info-header />

<info-header-row /> is valid inside: <info-header-row-list />

<info-header-row-list />

Contains all additional info headers. Info headers are additional headers of datagrid columns for complex data sets or multilanguage headers.

Attributes of <info-header-row-list />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <info-header-row-list /> is: <info-header-row />

<info-header-row-list /> is valid inside: <datagrid />

<label />

This tag defines a label for another content element.

Example 50.9. Label Element

 <label value="Name" target-ref="personName"/>
 <text-field id="personName" property-ref="domain.person.name"/>
 

Attributes of <label />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

id

Defines the GUID of the model.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

target-ref

Defines the related content element's ID.

value

Defines the label text key.

value-property-ref

Defines the label property reference.

Valid inside <label /> is: <style-set />

<label /> is valid inside: <content />, <content-group />, <tab />, <list-iterator />, <column />, <a />, <col />

<li />

( Additional names: a, h1, h2, h3, h4, h5, h6, b, em, p, ul, ol, dl, dt, dd, strong, hr, div, span, br, pre )

Creates a HTML element with the model name.

Attributes of <li />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

id

Defines the GUID of the model.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

Valid inside <li /> are: text content, <wiki-text-property />, <label />, <row />, <clear-filter-button />, <property-column />, <tab-set />, <remember-me-checkbox />, <login-button />, <button />, <content />, <exception />, <button-column />, <plain-text />, <verbatim />, <text-field />, <message-based-refresh />, <heading />, <rich-text-property />, <url-column />, <content-group />, <tab />, <select-popup />, <checkbox />, <error-message />, <debug-console />, <message />, <error-message-list />, <textarea />, <radio-buttons />, <rich-text-field />, <locale-select />, <external-link />, <multi-connect />, <tree-connect />, <image />, <plain-text-property />, <list-iterator />, <boolean-column />, <column />, <location-field />, <single-connect />, <collapse-link />, <toolbar />, <filter-row />, <hgroup />, <help-button />, <rich-text />, <a />, <sitemap />, <attachment />, <message-list />, <attachment-column />, <datagrid />, <select-field />, <boolean-element />, <map />, <file-upload />, <grid />, <cms-content />, <password />, <col />, <style-set />

<link />

( Additional names: button )

Defines a command button that triggers a transition if the user clicks on it. The button can have an icon and a text.

Attributes of <link />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

disable
icon

Defines the icon used for this button.

id

Defines the GUID of the model.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

target

Sets the link target for the given command link. This will only work if

  • the command is actually a link.

  • the transition of the command does not require binding, i.e. there is no action that requires binding in that transition's action-list.

text

Defines the button text.

text-property-ref

References a property to receive the command button text from.

transition-ref (required)

Defines the transition ID.

Valid inside <link /> are: <disabled-if />, <visible-if />, <style-set />

<link /> is valid inside: <content />, <content-group />, <tab />, <list-iterator />, <column />, <toolbar />, <a />, <col />

<list-iterator />

A widget that displays a domain object list by repeating its body for every object in the list. Property references to properties of the listed type resolve to the current domain object. Options are somewhat similar to those of the the section called “<datagrid />”.

Attributes of <list-iterator />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

domain-type-ref
id

Defines the GUID of the model.

object-relative
scoped-domain-object-list-ref

Defines a reference to a cached domain object list.

show-row-count
style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

Valid inside <list-iterator /> are: <execute-if />, <auto-complete-filter />, <read-only-if />, <with-filter />, <filter-restriction />, <filter-specification />, <visible-if />, <disabled-if />, <condition />, <validate-if />, <on-update-refresh />, <sort-order-list />, <relation-chain />, <paging />, <available-export-list />, <wiki-text-property />, <label />, <row />, <clear-filter-button />, <property-column />, <tab-set />, <remember-me-checkbox />, <login-button />, <button />, <content />, <exception />, <button-column />, <plain-text />, <verbatim />, <text-field />, <message-based-refresh />, <heading />, <rich-text-property />, <url-column />, <content-group />, <tab />, <select-popup />, <checkbox />, <error-message />, <debug-console />, <message />, <error-message-list />, <textarea />, <radio-buttons />, <rich-text-field />, <locale-select />, <external-link />, <multi-connect />, <tree-connect />, <image />, <plain-text-property />, <list-iterator />, <boolean-column />, <column />, <location-field />, <single-connect />, <collapse-link />, <toolbar />, <filter-row />, <hgroup />, <help-button />, <rich-text />, <a />, <sitemap />, <attachment />, <message-list />, <attachment-column />, <datagrid />, <select-field />, <boolean-element />, <map />, <file-upload />, <grid />, <cms-content />, <password />, <col />, <style-set />

<list-iterator /> is valid inside: <content />, <content-group />, <tab />, <list-iterator />, <column />, <a />, <col />

<locale-select />

A widget for selecting a locale.

Attributes of <locale-select />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

id

Defines the GUID of the model.

instant

If this is set to true, this widget will refresh the view it's in when it is changed immediately.

mode

Sets a constant write mode for this widget.

property-ref (required)

References the property read or written to by this widget.

required

If set to true, the widget requires a value to be entered by the user.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

type

Defines the data type for the given input field which only is necessary for self-referencing fields not containing text.

Valid inside <locale-select /> are: <disabled-if />, <read-only-if />, <style-set />

<locale-select /> is valid inside: <formula-property-set />, <content />, <joined-property-set />, <content-group />, <enum-property-set />, <tab />, <domain-type-property-set />, <reference-property-set />, <list-iterator />, <column />, <a />, <col />

<location-field />

A widget to select a Point property from a map. Needs GIS support to work. Non-JavaScript fallback is a simple text field for lat/lon coordinates.

Attributes of <location-field />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

id

Defines the GUID of the model.

mode

Sets a constant write mode for this widget.

property-ref (required)

References the property read or written to by this widget.

required

If set to true, the widget requires a value to be entered by the user.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

type

Defines the data type for the given input field which only is necessary for self-referencing fields not containing text.

Valid inside <location-field /> are: <disabled-if />, <read-only-if />, <style-set />

<location-field /> is valid inside: <formula-property-set />, <content />, <joined-property-set />, <content-group />, <enum-property-set />, <tab />, <domain-type-property-set />, <reference-property-set />, <list-iterator />, <column />, <a />, <col />

<login-button />

Tag class for login button widgets.

Attributes of <login-button />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

disable
failure-transition-ref

Defines the failure transition ID.

icon

Defines the icon used for this button.

id

Defines the GUID of the model.

password-field-id

Defines the password field ID.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

success-transition-ref

Defines the success transition ID.

target

Sets the link target for the given command link. This will only work if

  • the command is actually a link.

  • the transition of the command does not require binding, i.e. there is no action that requires binding in that transition's action-list.

text

Defines the button text.

text-property-ref

References a property to receive the command button text from.

transition-ref (required)

Defines the transition ID.

username-field-id

Defines the username field ID.

Valid inside <login-button /> are: <disabled-if />, <visible-if />, <style-set />

<login-button /> is valid inside: <content />, <content-group />, <tab />, <list-iterator />, <column />, <toolbar />, <a />, <col />

<map />

Defines a map widget.

Attributes of <map />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

id

Defines the GUID of the model.

latitude

Defines the latitude.

longitude

Defines the longitude.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

zoom

Defines the zoom.

Valid inside <map /> is: <style-set />

<map /> is valid inside: <content />, <content-group />, <tab />, <list-iterator />, <column />, <a />, <col />

<message />

Display one message with a given message Id.

Attributes of <message />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

id

Defines the GUID of the model.

message-id (required)
style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

Valid inside <message /> is: <style-set />

<message /> is valid inside: <content />, <content-group />, <tab />, <list-iterator />, <column />, <a />, <col />

<message-based-refresh />

is an invisible component event that refreshes view parts, groups or rows upon receiving a DomainObjectMessage.

Attributes of <message-based-refresh />
AttributeDescription
channel

Configures the channel filtered by the channel. Must be configured in the spring context.

class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

domain-type-refs

Configures the domain type models which are led through by the filter for this content element model (comma separated list of ids).

id

Defines the GUID of the model.

object-refs

Configures the cached domain object references which are led through by the filter for this content element model (comma separated list of ids).

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

Valid inside <message-based-refresh /> are: <on-update-refresh />, <style-set />

<message-based-refresh /> is valid inside: <content />, <content-group />, <tab />, <list-iterator />, <column />, <a />, <col />

<message-list />

Displays all messages that are not displayed by a the section called “<message />”.

Attributes of <message-list />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

id

Defines the GUID of the model.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

Valid inside <message-list /> is: <style-set />

<message-list /> is valid inside: <content />, <content-group />, <tab />, <list-iterator />, <column />, <a />, <col />

<multi-connect />

Connects the current target domain object to one or more objects over a relation-chain. It is a complex widget that consists of two list of objects (connected and not-connected ones) and two buttons to change the connection status of the objects in the list.

Example 50.10. Multi Connect Element

 <multi-connect
     id="users" 
     display-property-ref="system.domain.user.login"
     size="10"
     selected-heading="Assigned Users"
     unselected-heading="Unassigned Users"
     >
     <relation-chain>
         <relation-reference
             relation-ref="domain.project.relation.system.domain.user"/>
     </relation-chain>
 </multi-connect>
 

Attributes of <multi-connect />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

display-property-ref

References the property model that is displayed as representation for the domain object instance to be connected. Must be a property model of the domain type model referenced by the connect model.

domain-type-ref

Defines the domain type to be used in this connect field.

icon

Sets the icon to be used for every entry.

id

Defines the GUID of the model.

mode

Sets a constant write mode for this widget.

required

If set to true, require that the user enters a value for this widget.

scoped-domain-object-list-ref

Defines a reference to a cached domain object list.

selected-class

Additional classes to set on the list containing the connected/selected objects.

selected-first

If set to true, show the selected/connectd objects first, otherwise show them last.

selected-heading

Specifies the title internationalization key for the list of selected items.

size

Specifies the number of visible rows (vertical size of the lists).

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

unselected-class

Additional classes to set on the list containing the connected/selected objects.

unselected-heading

Specifies the title internationalization key for the list of unselected items.

vertical

if set to true, arrange the connection lists vertically, otherwise horizontally.

Valid inside <multi-connect /> are: <sort-order-list />, <execute-if />, <auto-complete-filter />, <read-only-if />, <with-filter />, <filter-restriction />, <filter-specification />, <visible-if />, <disabled-if />, <condition />, <validate-if />, <on-update-refresh />, <relation-chain />, <disabled-if />, <read-only-if />, <style-set />

<multi-connect /> is valid inside: <content />, <content-group />, <tab />, <list-iterator />, <column />, <a />, <col />

<ol />

( Additional names: a, h1, h2, h3, h4, h5, h6, b, em, p, ul, li, dl, dt, dd, strong, hr, div, span, br, pre )

Creates a HTML element with the model name.

Attributes of <ol />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

id

Defines the GUID of the model.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

Valid inside <ol /> are: text content, <wiki-text-property />, <label />, <row />, <clear-filter-button />, <property-column />, <tab-set />, <remember-me-checkbox />, <login-button />, <button />, <content />, <exception />, <button-column />, <plain-text />, <verbatim />, <text-field />, <message-based-refresh />, <heading />, <rich-text-property />, <url-column />, <content-group />, <tab />, <select-popup />, <checkbox />, <error-message />, <debug-console />, <message />, <error-message-list />, <textarea />, <radio-buttons />, <rich-text-field />, <locale-select />, <external-link />, <multi-connect />, <tree-connect />, <image />, <plain-text-property />, <list-iterator />, <boolean-column />, <column />, <location-field />, <single-connect />, <collapse-link />, <toolbar />, <filter-row />, <hgroup />, <help-button />, <rich-text />, <a />, <sitemap />, <attachment />, <message-list />, <attachment-column />, <datagrid />, <select-field />, <boolean-element />, <map />, <file-upload />, <grid />, <cms-content />, <password />, <col />, <style-set />

<on-update-refresh />

Attributes of <on-update-refresh />
AttributeDescription
description

Defines the description.

elem-ref
group-ref
id

Defines the GUID of the model.

part-ref
refreshView

Valid inside <on-update-refresh /> are: <start-action-list />, <action-list />

<on-update-refresh /> is valid inside: <text-field />, <password />, <message-based-refresh />, <checkbox />, <radio-buttons />, <multi-connect />, <tree-connect />, <list-iterator />, <multi-connect />, <single-connect />, <datagrid />, <radio-buttons />, <select-field />, <password />

<p />

( Additional names: a, h1, h2, h3, h4, h5, h6, b, em, ul, li, ol, dl, dt, dd, strong, hr, div, span, br, pre )

Creates a HTML element with the model name.

Attributes of <p />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

id

Defines the GUID of the model.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

Valid inside <p /> are: text content, <wiki-text-property />, <label />, <row />, <clear-filter-button />, <property-column />, <tab-set />, <remember-me-checkbox />, <login-button />, <button />, <content />, <exception />, <button-column />, <plain-text />, <verbatim />, <text-field />, <message-based-refresh />, <heading />, <rich-text-property />, <url-column />, <content-group />, <tab />, <select-popup />, <checkbox />, <error-message />, <debug-console />, <message />, <error-message-list />, <textarea />, <radio-buttons />, <rich-text-field />, <locale-select />, <external-link />, <multi-connect />, <tree-connect />, <image />, <plain-text-property />, <list-iterator />, <boolean-column />, <column />, <location-field />, <single-connect />, <collapse-link />, <toolbar />, <filter-row />, <hgroup />, <help-button />, <rich-text />, <a />, <sitemap />, <attachment />, <message-list />, <attachment-column />, <datagrid />, <select-field />, <boolean-element />, <map />, <file-upload />, <grid />, <cms-content />, <password />, <col />, <style-set />

<paging />

The paging element contains the default paging definition for all data grids in the portal. With the default-page-size attribute you can specify the default page size. You can override this setting by adding a paging element with a different paging size to a data grid. Each paging-button definition has the attributes offset, label and event. The offset attribute defines the offset to the current page, i.e. an offset of 1 jumps to the next page while an offset of -2 jumps two pages back. The label attribute describes the button label that is displayed; if no label is specified, the target page number is used instead. The event attribute describes the event that the button fires. The value of the event attribute is only used to identify the button that fired it, i.e. you can specifiy any event name that you like. If no event attribute is specified, the button is inactive.

Example 50.11. Paging Definition

 <paging default-page-size="10">
     <paging-button offset="first" label="|&lt;" event="first"/>
     <paging-button offset="-1" label="&lt;" event="prev"/>
     <paging-button offset="-3" event="prev3"/>
     <paging-button offset="-2" event="prev2"/>
     <paging-button offset="-1" event="prev"/>
     <paging-button offset="0"/>
     <paging-button offset="1" event="next"/>
     <paging-button offset="2" event="next2"/>
     <paging-button offset="3" event="next3"/>
     <paging-button offset="1" label="&gt;" event="next"/>
     <paging-button offset="last" label="&gt;|" event="last"/>
 </paging>

Attributes of <paging />
AttributeDescription
default-page-size

Default page size as number or the keyword unlimited.

description

Defines the description.

id

Defines the GUID of the model.

page-sizes

A comma separated list of either numbers or the keyword unlimited.

Valid inside <paging /> are: <paging-size-select />, <paging-button />

<paging /> is valid inside: <list-iterator />, <portal />, <datagrid />

<paging-button />

Attributes of <paging-button />
AttributeDescription
description

Defines the description.

event
id

Defines the GUID of the model.

label
offset

<paging-button /> is valid inside: <paging />

<paging-size-select />

Attributes of <paging-size-select />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

label

<paging-size-select /> is valid inside: <paging />

<part />

A part of a view that can refer to another domain type as the containing view does. Parts need to be displayed in a the section called “<subview />”. For a view with only one part this happens automatically, for more than one part, you have to create a the section called “<subview-list />” inside the view.

See Chapter 38, Working with layouts in OpenSAGA for examples.

Attributes of <part />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <part /> are: <content />, <relation-chain />

<part /> is valid inside: <part-set />

<part-reference />

( Additional names: state )

Displays the referenced PartImpl inside a the section called “<subview />”.

Attributes of <part-reference />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

part-ref (required)

Defines the part ID.

<part-set />

Contains all PartImpl of a view.

Attributes of <part-set />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <part-set /> is: <part />

<part-set /> is valid inside: <view />

<password />

This tag provides an element for hidden password typing.

Example 50.12. Password Element

 <password id="userPassword" property-ref="domain.user.password"/>
 

Attributes of <password />
AttributeDescription
auto-change

If set to false, just use default browser change events for updating the update references, if set to true, also update when the user enters the field, types something and stops typing.

class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

id

Defines the GUID of the model.

mode

Sets a constant write mode for this widget.

on-enter-command-ref

Defines a return-key command reference, which will be addressed by pressing the return-key inside of a -tag.

property-ref (required)

References the property read or written to by this widget.

redisplay
required

If set to true, the widget requires a value to be entered by the user.

size

Defines the visible size

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

title
type

Defines the data type for the given input field which only is necessary for self-referencing fields not containing text.

update-min-chars

Sets the minimum amount of characters needed to trigger an AJAX autocomplete process. Defaults to 3.

Valid inside <password /> are: <on-update-refresh />, <sort-order-list />, <auto-complete-filter />, <disabled-if />, <read-only-if />, <style-set />

<password /> is valid inside: <formula-property-set />, <content />, <joined-property-set />, <content-group />, <enum-property-set />, <tab />, <domain-type-property-set />, <reference-property-set />, <list-iterator />, <column />, <a />, <col />

<plain-text />

A widget that outputs a constant plain-text value.

Attributes of <plain-text />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

id

Defines the GUID of the model.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

value

Defines the text content internationalization key.

Valid inside <plain-text /> is: <style-set />

<plain-text /> is valid inside: <content />, <content-group />, <tab />, <list-iterator />, <column />, <a />, <col />

<plain-text-property />

Model for RenderProperty-element. Renders the contents of a property to the output.

Attributes of <plain-text-property />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

id

Defines the GUID of the model.

property-ref (required)

References the property read or written to by this widget.

required

If set to true, the widget requires a value to be entered by the user.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

type

Defines the data type for the given input field which only is necessary for self-referencing fields not containing text.

Valid inside <plain-text-property /> is: <style-set />

<plain-text-property /> is valid inside: <formula-property-set />, <content />, <joined-property-set />, <content-group />, <enum-property-set />, <tab />, <domain-type-property-set />, <reference-property-set />, <list-iterator />, <column />, <a />, <col />

<pre />

( Additional names: a, h1, h2, h3, h4, h5, h6, b, em, p, ul, li, ol, dl, dt, dd, strong, hr, div, span, br )

Creates a HTML element with the model name.

Attributes of <pre />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

id

Defines the GUID of the model.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

Valid inside <pre /> are: text content, <wiki-text-property />, <label />, <row />, <clear-filter-button />, <property-column />, <tab-set />, <remember-me-checkbox />, <login-button />, <button />, <content />, <exception />, <button-column />, <plain-text />, <verbatim />, <text-field />, <message-based-refresh />, <heading />, <rich-text-property />, <url-column />, <content-group />, <tab />, <select-popup />, <checkbox />, <error-message />, <debug-console />, <message />, <error-message-list />, <textarea />, <radio-buttons />, <rich-text-field />, <locale-select />, <external-link />, <multi-connect />, <tree-connect />, <image />, <plain-text-property />, <list-iterator />, <boolean-column />, <column />, <location-field />, <single-connect />, <collapse-link />, <toolbar />, <filter-row />, <hgroup />, <help-button />, <rich-text />, <a />, <sitemap />, <attachment />, <message-list />, <attachment-column />, <datagrid />, <select-field />, <boolean-element />, <map />, <file-upload />, <grid />, <cms-content />, <password />, <col />, <style-set />

<property-column />

One column in a the section called “<datagrid />”.

Attributes of <property-column />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

escape-data

If set to false, do not escape the datagrid content. Default is true

filter-mode

Defines the filter mode for the property. null means that there is no filter defined for the property.

heading

Defines the heading.

id

Defines the GUID of the model.

info

Sets the column info for this button-column. The text is split at | characters into multiple lines for javascript enabled clients.

The javascript widget/InfoPopupWidget.js can be added as a dependency to a web application to enable multi-line info output split at | for javascript-enabled clients. You can take a look at the script for inspiration to implement other schemes.

property-ref (required)

References the property read or written to by this widget.

required

If set to true, the widget requires a value to be entered by the user.

sortable

Set this to false if you don't want the table to be sortable.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

target-domain-type-ref

Defines the target domain type reference.

transition-ref

Sets the id of the transition invoked when clicking on this column.

type

Defines the data type for the given input field which only is necessary for self-referencing fields not containing text.

Valid inside <property-column /> are: <cell-format-set />, <style-set />

<property-column /> is valid inside: <formula-property-set />, <content />, <joined-property-set />, <content-group />, <enum-property-set />, <tab />, <datagrid-column-list />, <domain-type-property-set />, <reference-property-set />, <list-iterator />, <column />, <a />, <col />

<radio-buttons />

A select widget that allows the editing of a property field of a domain type as radio buttons.

Attributes of <radio-buttons />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

display-property-ref

Specifies the domain type property to display (textual representation).

empty-selection-allowed

Specifies if the user is allowed to select nothing or - otherwise - he is forced to select an entry. Legal values are 'true' and 'false'.

horizontal
id

Defines the GUID of the model.

initialization-required

Defines the flag indicating if an initialization is required.

mode

Sets a constant write mode for this widget.

object-relative

Defines if the select field is object relative.

property-ref (required)

References the property read or written to by this widget.

required

If set to true, the widget requires a value to be entered by the user.

scoped-domain-object-list-ref

Defines a reference to a cached domain object list.

select-domain-type-ref

Specifies the domain type of the selectable items.

size

Sets the vertical size of the select field to render. If set to 1 (the default) a combo box is used, otherwise a list box is used.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

type

Defines the data type for the given input field which only is necessary for self-referencing fields not containing text.

value-property-ref

Specifies the domain type property to be used as logical representation.

Valid inside <radio-buttons /> are: <execute-if />, <auto-complete-filter />, <read-only-if />, <with-filter />, <filter-restriction />, <filter-specification />, <visible-if />, <disabled-if />, <condition />, <validate-if />, <on-update-refresh />, <relation-chain />, <sort-order-list />, <disabled-if />, <read-only-if />, <style-set />

<radio-buttons /> is valid inside: <formula-property-set />, <content />, <joined-property-set />, <content-group />, <enum-property-set />, <tab />, <domain-type-property-set />, <reference-property-set />, <list-iterator />, <column />, <a />, <col />

<read-only-if />

Specialization of a filter specification model that sets writing models to read only if true.

Attributes of <read-only-if />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <read-only-if /> are: <greater-than />, <is-property-modified />, <and />, <geo-within />, <matches />, <user-logged-in />, <validation-failed />, <complies-to />, <criterion />, <less-than-or-equal-to />, <has-current-element />, <is-undefined />, <has-changed />, <or />, <is-connected-to />, <can-access />, <ends-with />, <geo-contains />, <has-permission />, <contains-comparator />, <starts-with />, <not />, <equals />, <is-new />, <has-elements />, <dynamic-condition />, <true />, <less-than />, <in />, <include />, <in-transition />, <filter-pattern />, <has-type />, <greater-than-or-equal-to />, <is-super-user />, <false />, <is-defined />, <filter-pattern-set />

<read-only-if /> is valid inside: <external-excel-domain-type />, <row />, <filter-row />, <external-relational-domain-type />, <count />, <filter-specification-set />, <text-field />, <password />, <joined-domain-type />, <content-group />, <constant-domain-type />, <select-popup />, <checkbox />, <start-action-list />, <external-excel-domain-type />, <external-relational-domain-type />, <joined-domain-type />, <constant-domain-type />, <domain-type />, <wfs-domain-type />, <request-context />, <textarea />, <radio-buttons />, <radio-buttons />, <rich-text-field />, <locale-select />, <multi-connect />, <multi-connect />, <tree-connect />, <tree-connect />, <transition />, <list-iterator />, <case />, <wfs-domain-type />, <location-field />, <multi-connect />, <single-connect />, <multi-connect />, <single-connect />, <relation-reference />, <filter-row />, <hgroup />, <has-elements />, <filtered-list />, <attachment />, <agent-action />, <datagrid />, <start-action-list />, <action-list />, <radio-buttons />, <select-field />, <radio-buttons />, <select-field />, <request-context />, <cell-format />, <password />, <col />

<remember-me-checkbox />

The "remember me" checkbox for spring security.

Attributes of <remember-me-checkbox />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

id

Defines the GUID of the model.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

Valid inside <remember-me-checkbox /> is: <style-set />

<remember-me-checkbox /> is valid inside: <content />, <content-group />, <tab />, <list-iterator />, <column />, <a />, <col />

<rich-text />

A widget that outputs a constant richtext value.

Attributes of <rich-text />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

id

Defines the GUID of the model.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

value

Defines the text content internationalization key.

Valid inside <rich-text /> is: <style-set />

<rich-text /> is valid inside: <content />, <content-group />, <tab />, <list-iterator />, <column />, <a />, <col />

<rich-text-field />

This tag defines an HTML-editor.

Example 50.13. Rich Text Field Element

 <rich-text-field id="itemDescription"
                  property-ref="domain.item.description"/>
 

Attributes of <rich-text-field />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

id

Defines the GUID of the model.

mode

Sets a constant write mode for this widget.

property-ref (required)

References the property read or written to by this widget.

required

If set to true, the widget requires a value to be entered by the user.

rich-text-configuration

Specifies the configuration to use. Optional. The requested configuration must have been registered in the richtextConfigurationRepository-bean.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

title
type

Defines the data type for the given input field which only is necessary for self-referencing fields not containing text.

Valid inside <rich-text-field /> are: <disabled-if />, <read-only-if />, <style-set />

<rich-text-field /> is valid inside: <formula-property-set />, <content />, <joined-property-set />, <content-group />, <enum-property-set />, <tab />, <domain-type-property-set />, <reference-property-set />, <list-iterator />, <column />, <a />, <col />

<rich-text-property />

Model for rich-text property element. Renders the contents of a richtext property.

Attributes of <rich-text-property />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

id

Defines the GUID of the model.

property-ref (required)

References the property read or written to by this widget.

required

If set to true, the widget requires a value to be entered by the user.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

type

Defines the data type for the given input field which only is necessary for self-referencing fields not containing text.

Valid inside <rich-text-property /> is: <style-set />

<rich-text-property /> is valid inside: <formula-property-set />, <content />, <joined-property-set />, <content-group />, <enum-property-set />, <tab />, <domain-type-property-set />, <reference-property-set />, <list-iterator />, <column />, <a />, <col />

<row />

Layout table grid row.

Attributes of <row />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

id

Defines the GUID of the model.

span

Defines the row span.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

Valid inside <row /> are: <column />, <disabled-if />, <read-only-if />, <visible-if />, <style-set />

<row /> is valid inside: <content />, <content-group />, <tab />, <list-iterator />, <column />, <footer-row-list />, <a />, <header-row-list />, <grid />, <col />

<select-field />

This tag defines a drop down list. It can either be based on constant enumeration types or on domain relations.

Example 50.14. Select Field Element (Using an Enumeration Type)

 <select-field id="select"
     property-ref="domain.workingstep.timeUnit_id" 
     select-domain-type-ref="domain.enum_timeunit" 
     value-property-ref="domain.enum_timeunit.id"
     display-property-ref="domain.enum_timeunit.unit"
     empty-selection-allowed="false"/>
 

Attributes of <select-field />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

display-property-ref

Specifies the domain type property to display (textual representation).

empty-selection-allowed

Specifies if the user is allowed to select nothing or - otherwise - he is forced to select an entry. Legal values are 'true' and 'false'.

id

Defines the GUID of the model.

initialization-required

Defines the flag indicating if an initialization is required.

mode

Sets a constant write mode for this widget.

object-relative

Defines if the select field is object relative.

property-ref (required)

References the property read or written to by this widget.

required

If set to true, the widget requires a value to be entered by the user.

scoped-domain-object-list-ref

Defines a reference to a cached domain object list.

select-domain-type-ref

Specifies the domain type of the selectable items.

size

Sets the vertical size of the select field to render. If set to 1 (the default) a combo box is used, otherwise a list box is used.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

type

Defines the data type for the given input field which only is necessary for self-referencing fields not containing text.

value-property-ref

Specifies the domain type property to be used as logical representation.

Valid inside <select-field /> are: <execute-if />, <auto-complete-filter />, <read-only-if />, <with-filter />, <filter-restriction />, <filter-specification />, <visible-if />, <disabled-if />, <condition />, <validate-if />, <on-update-refresh />, <relation-chain />, <sort-order-list />, <disabled-if />, <read-only-if />, <style-set />

<select-field /> is valid inside: <formula-property-set />, <content />, <joined-property-set />, <content-group />, <enum-property-set />, <tab />, <domain-type-property-set />, <reference-property-set />, <list-iterator />, <column />, <a />, <col />

<select-popup />

A widget to select a property value from a popup.

Attributes of <select-popup />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

id

Defines the GUID of the model.

mode

Sets a constant write mode for this widget.

multi-select

Defines the flag indicating if multiple selection is allowed.

property-ref (required)

References the property read or written to by this widget.

required

If set to true, the widget requires a value to be entered by the user.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

transition-ref

Defines the transition ID.

type

Defines the data type for the given input field which only is necessary for self-referencing fields not containing text.

Valid inside <select-popup /> are: <disabled-if />, <read-only-if />, <style-set />

<select-popup /> is valid inside: <formula-property-set />, <content />, <joined-property-set />, <content-group />, <enum-property-set />, <tab />, <domain-type-property-set />, <reference-property-set />, <list-iterator />, <column />, <a />, <col />

<single-connect />

Connects the current target domain object to a single object of another domain type.

    <single-connect 
        display-property-ref="example.d_domain_type.property" >
        <relation-chain>
            <relation-reference 
                relation-ref="example.r_domain_type.to.other_domain_type"/>
        </relation-chain>
    </single-connect>
 

Attributes of <single-connect />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

display-property-ref

References the property model that is displayed as representation for the domain object instance to be connected. Must be a property model of the domain type model referenced by the connect model.

domain-type-ref

Defines the domain type to be used in this connect field.

icon

Sets the icon to be used for every entry.

id

Defines the GUID of the model.

mode

Sets a constant write mode for this widget.

required

If set to true, require that the user enters a value for this widget.

scoped-domain-object-list-ref

Defines a reference to a cached domain object list.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

Valid inside <single-connect /> are: <sort-order-list />, <execute-if />, <auto-complete-filter />, <read-only-if />, <with-filter />, <filter-restriction />, <filter-specification />, <visible-if />, <disabled-if />, <condition />, <validate-if />, <on-update-refresh />, <relation-chain />, <disabled-if />, <read-only-if />, <style-set />

<single-connect /> is valid inside: <content />, <content-group />, <tab />, <list-iterator />, <column />, <a />, <col />

<sitemap />

Defines a sitemap model for the portal. The sitemap shows the portal.navigation.main nodes from NavigationComponent. It has different styles (skins):

  • dotted, dot-lined and square bullets.

  • lined, normal lines and circular bullets.

  • listed, normal listing with arrows. The default sitemap has a dotted style. Four level are possible. With you are able to disabled the style.

Attributes of <sitemap />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

id

Defines the GUID of the model.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

Valid inside <sitemap /> is: <style-set />

<sitemap /> is valid inside: <content />, <content-group />, <tab />, <list-iterator />, <column />, <a />, <col />

<span />

( Additional names: a, h1, h2, h3, h4, h5, h6, b, em, p, ul, li, ol, dl, dt, dd, strong, hr, div, br, pre )

Creates a HTML element with the model name.

Attributes of <span />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

id

Defines the GUID of the model.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

Valid inside <span /> are: text content, <wiki-text-property />, <label />, <row />, <clear-filter-button />, <property-column />, <tab-set />, <remember-me-checkbox />, <login-button />, <button />, <content />, <exception />, <button-column />, <plain-text />, <verbatim />, <text-field />, <message-based-refresh />, <heading />, <rich-text-property />, <url-column />, <content-group />, <tab />, <select-popup />, <checkbox />, <error-message />, <debug-console />, <message />, <error-message-list />, <textarea />, <radio-buttons />, <rich-text-field />, <locale-select />, <external-link />, <multi-connect />, <tree-connect />, <image />, <plain-text-property />, <list-iterator />, <boolean-column />, <column />, <location-field />, <single-connect />, <collapse-link />, <toolbar />, <filter-row />, <hgroup />, <help-button />, <rich-text />, <a />, <sitemap />, <attachment />, <message-list />, <attachment-column />, <datagrid />, <select-field />, <boolean-element />, <map />, <file-upload />, <grid />, <cms-content />, <password />, <col />, <style-set />

<state />

( Additional names: part-reference )

Displays the referenced PartImpl inside a the section called “<subview />”.

Attributes of <state />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

part-ref (required)

Defines the part ID.

<state /> is valid inside: <subview />

<stereotype />

The stereotype Model. Creates a schematic view for editing or viewing a domain object.

Attributes of <stereotype />
AttributeDescription
cancel-transition-ref

Defines the cancel transition reference.

description

Defines the description.

domain-type-ref (required)

Defines the domain type reference.

id

Defines the GUID of the model.

save-transition-ref

Defines the save transition reference.

type

Sets the type of the stereotype.

<stereotype /> is valid inside: <view />

<strong />

( Additional names: a, h1, h2, h3, h4, h5, h6, b, em, p, ul, li, ol, dl, dt, dd, hr, div, span, br, pre )

Creates a HTML element with the model name.

Attributes of <strong />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

id

Defines the GUID of the model.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

Valid inside <strong /> are: text content, <wiki-text-property />, <label />, <row />, <clear-filter-button />, <property-column />, <tab-set />, <remember-me-checkbox />, <login-button />, <button />, <content />, <exception />, <button-column />, <plain-text />, <verbatim />, <text-field />, <message-based-refresh />, <heading />, <rich-text-property />, <url-column />, <content-group />, <tab />, <select-popup />, <checkbox />, <error-message />, <debug-console />, <message />, <error-message-list />, <textarea />, <radio-buttons />, <rich-text-field />, <locale-select />, <external-link />, <multi-connect />, <tree-connect />, <image />, <plain-text-property />, <list-iterator />, <boolean-column />, <column />, <location-field />, <single-connect />, <collapse-link />, <toolbar />, <filter-row />, <hgroup />, <help-button />, <rich-text />, <a />, <sitemap />, <attachment />, <message-list />, <attachment-column />, <datagrid />, <select-field />, <boolean-element />, <map />, <file-upload />, <grid />, <cms-content />, <password />, <col />, <style-set />

<style />

Represents one content element style hint.

Attributes of <style />
AttributeDescription
description

Defines the description.

element-id

Sets the element-sub-id for which the styles are applied. An empty element-id refers to the main element of the widget, other possible element-ids are widget-dependent.

id

Defines the GUID of the model.

value (required)

CSS Styles for this the section called “<style />”

Valid inside <style /> is: text content

<style /> is valid inside: <style-set />

<style-set />

A set of content element style hints.

Attributes of <style-set />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <style-set /> is: <style />

<style-set /> is valid inside: <wiki-text-property />, <label />, <row />, <filter-row />, <property-column />, <url-column />, <boolean-column />, <attachment-column />, <clear-filter-button />, <tab-set />, <remember-me-checkbox />, <login-button />, <clear-filter-button />, <login-button />, <button />, <button-column />, <debug-console />, <collapse-link />, <help-button />, <content />, <exception />, <button-column />, <plain-text />, <rich-text />, <verbatim />, <text-field />, <password />, <message-based-refresh />, <heading />, <rich-text-property />, <url-column />, <content-group />, <tab />, <select-popup />, <checkbox />, <error-message />, <debug-console />, <message />, <error-message-list />, <textarea />, <radio-buttons />, <rich-text-field />, <locale-select />, <external-link />, <multi-connect />, <tree-connect />, <image />, <rich-text-property />, <plain-text-property />, <list-iterator />, <boolean-column />, <column />, <location-field />, <multi-connect />, <single-connect />, <collapse-link />, <toolbar />, <filter-row />, <hgroup />, <help-button />, <rich-text />, <a />, <sitemap />, <attachment />, <message-list />, <attachment-column />, <datagrid />, <radio-buttons />, <select-field />, <boolean-element />, <map />, <file-upload />, <grid />, <cms-content />, <password />, <col />

<subview />

A subview of a view that should either contain a the section called “<state />” or a nested the section called “<subview-list />”.

Attributes of <subview />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

id

Defines the GUID of the model.

width

Defines the width in logic columns. See Chapter 38, Working with layouts in OpenSAGA for explanation.

Valid inside <subview /> are: <subview-list />, <state />

<subview /> is valid inside: <subview-list />

<subview-hgroup />

( Additional names: subview-list, subview-vgroup )

A list of subviews that are arranged either horizontally or vertically.

Attributes of <subview-hgroup />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

horizontal

Defines if this sub view model is horizontal.

id

Defines the GUID of the model.

Valid inside <subview-hgroup /> is: <subview />

<subview-list />

( Additional names: subview-hgroup, subview-vgroup )

A list of subviews that are arranged either horizontally or vertically.

Attributes of <subview-list />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

horizontal

Defines if this sub view model is horizontal.

id

Defines the GUID of the model.

Valid inside <subview-list /> is: <subview />

<subview-vgroup />

( Additional names: subview-list, subview-hgroup )

A list of subviews that are arranged either horizontally or vertically.

Attributes of <subview-vgroup />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

horizontal

Defines if this sub view model is horizontal.

id

Defines the GUID of the model.

Valid inside <subview-vgroup /> is: <subview />

<subview-vgroup /> is valid inside: <subview />, <view />

<tab />

Attributes of <tab />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

heading
id

Defines the GUID of the model.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

Valid inside <tab /> are: <wiki-text-property />, <label />, <row />, <clear-filter-button />, <property-column />, <tab-set />, <remember-me-checkbox />, <login-button />, <button />, <content />, <exception />, <button-column />, <plain-text />, <verbatim />, <text-field />, <message-based-refresh />, <heading />, <rich-text-property />, <url-column />, <content-group />, <tab />, <select-popup />, <checkbox />, <error-message />, <debug-console />, <message />, <error-message-list />, <textarea />, <radio-buttons />, <rich-text-field />, <locale-select />, <external-link />, <multi-connect />, <tree-connect />, <image />, <plain-text-property />, <list-iterator />, <boolean-column />, <column />, <location-field />, <single-connect />, <collapse-link />, <toolbar />, <filter-row />, <hgroup />, <help-button />, <rich-text />, <a />, <sitemap />, <attachment />, <message-list />, <attachment-column />, <datagrid />, <select-field />, <boolean-element />, <map />, <file-upload />, <grid />, <cms-content />, <password />, <col />, <style-set />

<tab /> is valid inside: <tab-set />, <content />, <content-group />, <tab />, <list-iterator />, <column />, <a />, <col />

<tab-set />

A tabset containing a number of tabs with tab-headers.

Attributes of <tab-set />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

id

Defines the GUID of the model.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

Valid inside <tab-set /> are: <tab />, <style-set />

<tab-set /> is valid inside: <content />, <content-group />, <tab />, <list-iterator />, <column />, <a />, <col />

<text-field />

This tag defines a single line text input element.

Example 50.15. Textfield Element

 <text-field id="personName" property-ref="domain.person.name"/>
 

Attributes of <text-field />
AttributeDescription
auto-change

If set to false, just use default browser change events for updating the update references, if set to true, also update when the user enters the field, types something and stops typing.

class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

id

Defines the GUID of the model.

mode

Sets a constant write mode for this widget.

on-enter-command-ref

Defines a return-key command reference, which will be addressed by pressing the return-key inside of a -tag.

property-ref (required)

References the property read or written to by this widget.

required

If set to true, the widget requires a value to be entered by the user.

size

Defines the visible size

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

title
type

Defines the data type for the given input field which only is necessary for self-referencing fields not containing text.

update-min-chars

Sets the minimum amount of characters needed to trigger an AJAX autocomplete process. Defaults to 3.

Valid inside <text-field /> are: <on-update-refresh />, <sort-order-list />, <auto-complete-filter />, <disabled-if />, <read-only-if />, <style-set />

<text-field /> is valid inside: <formula-property-set />, <content />, <joined-property-set />, <content-group />, <enum-property-set />, <tab />, <domain-type-property-set />, <reference-property-set />, <list-iterator />, <column />, <a />, <col />

<textarea />

This tag defines a multi-line text input element.

Example 50.16. Textarea Element

 <textarea id="itemDescription" property-ref="domain.item.description"/>
 

Attributes of <textarea />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

cols
description

Defines the description.

id

Defines the GUID of the model.

mode

Sets a constant write mode for this widget.

property-ref (required)

References the property read or written to by this widget.

required

If set to true, the widget requires a value to be entered by the user.

rows
style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

title
type

Defines the data type for the given input field which only is necessary for self-referencing fields not containing text.

Valid inside <textarea /> are: <disabled-if />, <read-only-if />, <style-set />

<textarea /> is valid inside: <formula-property-set />, <content />, <joined-property-set />, <content-group />, <enum-property-set />, <tab />, <domain-type-property-set />, <reference-property-set />, <list-iterator />, <column />, <a />, <col />

<toolbar />

A toolbar containing the section called “<button />”s.

Attributes of <toolbar />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

id

Defines the GUID of the model.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

Valid inside <toolbar /> are: <clear-filter-button />, <login-button />, <button />, <button-column />, <debug-console />, <collapse-link />, <help-button />, <style-set />

<toolbar /> is valid inside: <content />, <content-group />, <tab />, <list-iterator />, <column />, <a />, <datagrid />, <col />

<tree-connect />

A tree connect widget meant to connect a domain type to a tree domain type containing left and right columns filled following the preorder tree traversal algorithm.

Attributes of <tree-connect />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

connectable-property-ref
description

Defines the description.

display-property-ref

References the property model that is displayed as representation for the domain object instance to be connected. Must be a property model of the domain type model referenced by the connect model.

domain-type-ref

Defines the domain type to be used in this connect field.

id

Defines the GUID of the model.

left-property-ref
min-select-depth
mode

Sets a constant write mode for this widget.

required

If set to true, require that the user enters a value for this widget.

right-property-ref
scoped-domain-object-list-ref

Defines a reference to a cached domain object list.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

Valid inside <tree-connect /> are: <execute-if />, <auto-complete-filter />, <read-only-if />, <with-filter />, <filter-restriction />, <filter-specification />, <visible-if />, <disabled-if />, <condition />, <validate-if />, <on-update-refresh />, <relation-chain />, <disabled-if />, <read-only-if />, <style-set />

<tree-connect /> is valid inside: <content />, <content-group />, <tab />, <list-iterator />, <column />, <a />, <col />

<ul />

( Additional names: a, h1, h2, h3, h4, h5, h6, b, em, p, li, ol, dl, dt, dd, strong, hr, div, span, br, pre )

Creates a HTML element with the model name.

Attributes of <ul />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

id

Defines the GUID of the model.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

Valid inside <ul /> are: text content, <wiki-text-property />, <label />, <row />, <clear-filter-button />, <property-column />, <tab-set />, <remember-me-checkbox />, <login-button />, <button />, <content />, <exception />, <button-column />, <plain-text />, <verbatim />, <text-field />, <message-based-refresh />, <heading />, <rich-text-property />, <url-column />, <content-group />, <tab />, <select-popup />, <checkbox />, <error-message />, <debug-console />, <message />, <error-message-list />, <textarea />, <radio-buttons />, <rich-text-field />, <locale-select />, <external-link />, <multi-connect />, <tree-connect />, <image />, <plain-text-property />, <list-iterator />, <boolean-column />, <column />, <location-field />, <single-connect />, <collapse-link />, <toolbar />, <filter-row />, <hgroup />, <help-button />, <rich-text />, <a />, <sitemap />, <attachment />, <message-list />, <attachment-column />, <datagrid />, <select-field />, <boolean-element />, <map />, <file-upload />, <grid />, <cms-content />, <password />, <col />, <style-set />

<ul /> is valid inside: <content />, <content-group />, <tab />, <list-iterator />, <column />, <a />, <col />

<url-column />

Column that displays URLs.

Attributes of <url-column />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

escape-data

If set to false, do not escape the datagrid content. Default is true

filter-mode

Defines the filter mode for the property. null means that there is no filter defined for the property.

heading

Defines the heading.

id

Defines the GUID of the model.

info

Sets the column info for this button-column. The text is split at | characters into multiple lines for javascript enabled clients.

The javascript widget/InfoPopupWidget.js can be added as a dependency to a web application to enable multi-line info output split at | for javascript-enabled clients. You can take a look at the script for inspiration to implement other schemes.

property-ref (required)

References the property read or written to by this widget.

required

If set to true, the widget requires a value to be entered by the user.

sortable

Set this to false if you don't want the table to be sortable.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

target-domain-type-ref

Defines the target domain type reference.

transition-ref

Sets the id of the transition invoked when clicking on this column.

type

Defines the data type for the given input field which only is necessary for self-referencing fields not containing text.

Valid inside <url-column /> are: <cell-format-set />, <style-set />

<url-column /> is valid inside: <formula-property-set />, <content />, <joined-property-set />, <content-group />, <enum-property-set />, <tab />, <datagrid-column-list />, <domain-type-property-set />, <reference-property-set />, <list-iterator />, <column />, <a />, <col />

<verbatim />

Renders child content directly as HTML.

Attributes of <verbatim />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

id

Defines the GUID of the model.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

Valid inside <verbatim /> are: text content, <style-set />

<verbatim /> is valid inside: <content />, <content-group />, <tab />, <list-iterator />, <column />, <a />, <col />

<vgroup />

( Additional names: hgroup )

Is a vertical or horizontal blueprint column group inside a part.

Attributes of <vgroup />
AttributeDescription
class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

id

Defines the GUID of the model.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

width

Sets the width in layout columns.

Valid inside <vgroup /> are: <hgroup />, <col />, <disabled-if />, <read-only-if />, <visible-if />, <style-set />

<vgroup /> is valid inside: <content />, <content-group />, <tab />, <list-iterator />, <column />, <hgroup />, <a />, <col />

<view />

Defines a model for one view inside a web application. It must be referenced by a the section called “<view-state />” inside a process to be active.

Attributes of <view />
AttributeDescription
description

Defines the description.

domain-context-path-mode

Defines the ViewModelDomainContextPathMode to be used by this view. If no definition is given it defaults to ViewModelDomainContextPathMode#ALWAYS_VISIBLE.

domain-type-ref

Sets the domain type model referenced by this view.

id

Defines the GUID of the model.

on-enter-command-ref

Defines a return-key command reference, which will be addressed by pressing the return-key inside of a -tag.

target-scoped-domain-object-ref

Defines the scoped domain object that is to be used as the target domain object for this view.

template-resource

Defines the layout template resource.

title

Defines the title.

Valid inside <view /> are: <subview-list />, <part-set />, <stereotype />, <filter-specification-set />, <restriction-set />, <ui-component-setting-set />, <before-preprocessing />, <before-postprocessing />, <after-postprocessing />, <after-preprocessing />

<visible-if />

Specialization of a filter specification model that sets writing models and to visible if true.

Attributes of <visible-if />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <visible-if /> are: <greater-than />, <is-property-modified />, <and />, <geo-within />, <matches />, <user-logged-in />, <validation-failed />, <complies-to />, <criterion />, <less-than-or-equal-to />, <has-current-element />, <is-undefined />, <has-changed />, <or />, <is-connected-to />, <can-access />, <ends-with />, <geo-contains />, <has-permission />, <contains-comparator />, <starts-with />, <not />, <equals />, <is-new />, <has-elements />, <dynamic-condition />, <true />, <less-than />, <in />, <include />, <in-transition />, <filter-pattern />, <has-type />, <greater-than-or-equal-to />, <is-super-user />, <false />, <is-defined />, <filter-pattern-set />

<visible-if /> is valid inside: <external-excel-domain-type />, <row />, <filter-row />, <clear-filter-button />, <login-button />, <clear-filter-button />, <login-button />, <button />, <button-column />, <debug-console />, <collapse-link />, <help-button />, <external-relational-domain-type />, <count />, <button-column />, <filter-specification-set />, <joined-domain-type />, <content-group />, <item />, <cms-navigation-item />, <constant-domain-type />, <start-action-list />, <debug-console />, <external-excel-domain-type />, <external-relational-domain-type />, <joined-domain-type />, <constant-domain-type />, <domain-type />, <wfs-domain-type />, <request-context />, <radio-buttons />, <multi-connect />, <tree-connect />, <transition />, <list-iterator />, <case />, <wfs-domain-type />, <multi-connect />, <single-connect />, <relation-reference />, <collapse-link />, <cms-navigation-item />, <filter-row />, <hgroup />, <has-elements />, <help-button />, <filtered-list />, <agent-action />, <datagrid />, <start-action-list />, <action-list />, <radio-buttons />, <select-field />, <request-context />, <cell-format />, <col />

<wiki-text-property />

Renders a wiki-text typed property.

Attributes of <wiki-text-property />
AttributeDescription
attachment-domain-type-ref

Defines the attachment domain type reference.

attachment-image-property-ref

Defines the attachment image property reference.

attachment-label-property-ref

Defines the attachment label property reference.

class

Defines a space separated list of classes that are written through to HTML. These classes can both be used to apply custom CSS styles to elements and as target for custom javascript.

description

Defines the description.

id

Defines the GUID of the model.

property-ref (required)

References the property read or written to by this widget.

required

If set to true, the widget requires a value to be entered by the user.

style

Defines CSS styles directly on a the widget. Defining styles this way is equivalent to defining a the section called “<style-set />” with a single the section called “<style />” without elementId.

type

Defines the data type for the given input field which only is necessary for self-referencing fields not containing text.

Valid inside <wiki-text-property /> is: <style-set />

<wiki-text-property /> is valid inside: <formula-property-set />, <content />, <joined-property-set />, <content-group />, <enum-property-set />, <tab />, <domain-type-property-set />, <reference-property-set />, <list-iterator />, <column />, <a />, <col />

Chapter 51. Domain Type Models

<domain-type />

This is the domain type that you will probably use most of the time. It consists of a set of different property sets (e.g. the section called “<domain-type-property-set />”) and a primary key (the section called “<primary-key />”)/>). Additionally you can specify restrictions (the section called “<restriction-set />”) and initialization data (the section called “<initialization-data />”).

 <domain-type id="base.d_user" name="User" ...>
     <property-set>
         <domain-type-property-set>
             <domain-type-property id="base.d_user.guid"
                 name="guid" type="PlainText"
                 insert-property-value-provider="guidPropertyValueProvider" />
             <domain-type-property id="base.d_user.login"
                 name="login" type="PlainText" required="true"/>
             <domain-type-property id="base.d_user.password"
                 name="password" type="Password" required="true"/>
             <domain-type-property id="base.d_user.active"
                 name="active" type="Boolean"
                 value-provider-bean="falsePropertyValueProvider"/>
             ...
         </domain-type-property-set>
     </property-set>
     <primary-key>
         <key property-ref="base.d_user.guid" />
     </primary-key>
 </domain-type>
 
On event models are action blocks which are executed on special events. A overview of the actions that can be used are in . The following on event models are available:

  • on-create

The on-create model is executed when a new domain object of the current domain type is created.

  • on-insert

The on-insert model is executed when a new domain object of the current domain type is inserted into the database (so when the domain object is saved the first time).

  • on-update

The on-update model is executed when a domain object of the current domain type is updated. So when an existing domain object from the database is modified and saved.

  • on-delete

The on-delete model is executed when a domain object of the current domain type is deleted. Domain types inherits the on event models of its super type. When a domain type as well as its super type has a on event model, then first the on event model of the super type is executed and then the one of the current domain type. To overwrite the on event model of the super type, the overwrite-extended attribute must be set true. The on event models are also merged. Thereby the actions of the on-create, on-insert and on-update are executed in a chronological order. That means that the actions of the old versions of the domain type are executed before the actions of the new versions. The actions of the on-delete are executed in an inversely order. First the actions of the new versions of the domain type are executed and then the actions of the old ones.

[Important]Important

Merging of on event models When on event models are merged, the models must have the same overwrite-extended value, otherwise an exception is thrown.

Attributes of <domain-type />
AttributeDescription
audit-trail-mode

Defines the audit trail mode.

audit-trail-relation-ref

Defines the audit trail relation reference.

cardinality

Defines the domain object cardinality. You can use the domain type cardinality to restrict the number of domain objects that are created for a domain type. E.g. you may want to store a system specific setting or a setting that is stored on a per user basis. For now two cardinalities are possible: single and user. Using single specifies that at most one domain object of this domain type is created for the portal, user specifies that at most one domain object is created for each user.

 <domain-type id="system.domain.config"
     cardinality="user" ...>
     <property-set>
         <domain-type-property-set>
             <domain-type-property
                 id="system.domain.config.colorScheme"
                 name="colorScheme" type="PlainText"
                 default-value="blue"/>
             ...
         </domain-type-property-set>
     </property-set>
 </domain-type>
 
The above example shows the definition of a domain type using the user cardinality. To create such an object, you have to put it into a context, e.g. here we use the session context (defined in portal.xml):
 <portal ...>
     <session-context>
         <scoped-domain-object id="portal.config"
             name="portalConfig"
             domain-type-ref="system.domain.config"/>
     </session-context>
     ...
 </portal>
 
You can then access the properties of the domain object by using their ID (e.g. system.domain.config.colorScheme).
[Note]Note

Make sure that you use a context type that is suitable for the chosen cardinality. For example you should use the session context for system specific domain types (with single cardinality).

data-handler-bean

Defines the data handler bean reference.

data-handler-class

Defines the data handler class name.

data-source-name

Defines the name of the data source to be used by this domain type.

delegate-bean-name

Defines the name of the delegate bean of type Model.

deletion-mode

OpenSAGA supports different deletion modes for domain type models. Each deletion mode specifies how data entries are deleted. The physical deletion mode deletes the data entries physically, while the logical deletion mode deletes them logically (i.e. they are marked as deleted, but are still physically accessible through direct access to data base). You can switch between the deletion modes without problems. In case that you switch from logical to physical you have to manually delete the data entries that are marked as deleted (i.e. use SQL and access to the data base directly).

[Warning]Warning

You can't use the logical deletion mode when using primary keys that are not created automatically. This limitation is caused by the fact that each primary key has to be unique for each table.

description

Defines the description.

extends

Defines the the domain type name that this domain type extends.

id

Defines the GUID of the model.

immutable

Defines the immutable flag.

name

Defines the name of the domain type.

permission-filter-generator-bean

Defines the permission filter generator bean reference.

table-name

Defines the database table name.

Valid inside <domain-type /> are: <primary-key />, <restriction-set />, <initialization-data />, <execute-if />, <auto-complete-filter />, <read-only-if />, <with-filter />, <filter-restriction />, <filter-specification />, <visible-if />, <disabled-if />, <condition />, <validate-if />, <on-create />, <on-insert />, <on-update />, <on-delete />, <property-set />

<property-type-parameter />

Defines a name/value pair that can be used to parameterize property models. An example is the attachment repository name used for Attachment property types. See PropertyTypeParameterNames for more information.

Attributes of <property-type-parameter />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

name

Defines the name of the property type parameter.

value

Defines the value of the property type parameter.

<property-type-parameter /> is valid inside: <property-type-parameter-set />

<property-type-parameter-set />

Defines a set of the section called “<property-type-parameter />”s.

Attributes of <property-type-parameter-set />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <property-type-parameter-set /> is: <property-type-parameter />

<property-type-parameter-set /> is valid inside: <joined-property />, <domain-type-property />, <enum-property />, <formula-property />, <reference-property />

<reference-property />

Reference properties (reference-property) are one of many ways to model joins. You can describe the join to another domain type and "blend in" virtual properties that actually will be taken from a joined domain type. Since there are many other ways to on the spot join data we usually do no recommend to use these properties for joins since they always will be joined into any data selection.

Attributes of <reference-property />
AttributeDescription
audit-trail-relevance-mode

Defines the audit trail relevance mode.

description

Defines the description.

id

Defines the GUID of the model.

name

Defines the name of the property.

property-handling-bean-name

Defines a bean that handles the property value. The specified bean has to implement the interface org.opensaga.runtime.model.domain.virtual.properties.VirtualPropertyValueHandler for read only properties or org.opensaga.runtime.model.domain.virtual.properties.WritableVirtualPropertyValueHandler for writable properties.

property-ref

Defines the referenced property.

translation-required

Defines that the property value has to be translated before it is displayed. The default value is false.

Valid inside <reference-property /> is: <property-type-parameter-set />

<reference-property /> is valid inside: <formula-property-set />, <joined-property-set />, <enum-property-set />, <domain-type-property-set />, <reference-property-set />

<reference-property-set />

Defines a set of the section called “<reference-property />”s.

Attributes of <reference-property-set />
AttributeDescription
description

Defines the description.

domain-type-ref

Sets the domain type reference.

id

Defines the GUID of the model.

Valid inside <reference-property-set /> are: <relation-chain />, <wiki-text-property />, <property-column />, <text-field />, <rich-text-property />, <url-column />, <select-popup />, <checkbox />, <textarea />, <radio-buttons />, <rich-text-field />, <locale-select />, <joined-property />, <plain-text-property />, <boolean-column />, <location-field />, <domain-type-property />, <enum-property />, <attachment />, <attachment-column />, <select-field />, <boolean-element />, <formula-property />, <password />, <reference-property />

<reference-property-set /> is valid inside: <property-set />

<wfs-domain-type />

Defines WFS domain type that based on the section called “<domain-type />”.

Attributes of <wfs-domain-type />
AttributeDescription
audit-trail-mode

Defines the audit trail mode.

audit-trail-relation-ref

Defines the audit trail relation reference.

cardinality

Defines the domain object cardinality. You can use the domain type cardinality to restrict the number of domain objects that are created for a domain type. E.g. you may want to store a system specific setting or a setting that is stored on a per user basis. For now two cardinalities are possible: single and user. Using single specifies that at most one domain object of this domain type is created for the portal, user specifies that at most one domain object is created for each user.

 <domain-type id="system.domain.config"
     cardinality="user" ...>
     <property-set>
         <domain-type-property-set>
             <domain-type-property
                 id="system.domain.config.colorScheme"
                 name="colorScheme" type="PlainText"
                 default-value="blue"/>
             ...
         </domain-type-property-set>
     </property-set>
 </domain-type>
 
The above example shows the definition of a domain type using the user cardinality. To create such an object, you have to put it into a context, e.g. here we use the session context (defined in portal.xml):
 <portal ...>
     <session-context>
         <scoped-domain-object id="portal.config"
             name="portalConfig"
             domain-type-ref="system.domain.config"/>
     </session-context>
     ...
 </portal>
 
You can then access the properties of the domain object by using their ID (e.g. system.domain.config.colorScheme).
[Note]Note

Make sure that you use a context type that is suitable for the chosen cardinality. For example you should use the session context for system specific domain types (with single cardinality).

data-handler-bean

Defines the data handler bean reference.

data-handler-class

Defines the data handler class name.

data-source-name

Defines the name of the data source to be used by this domain type.

delegate-bean-name

Defines the name of the delegate bean of type Model.

deletion-mode

OpenSAGA supports different deletion modes for domain type models. Each deletion mode specifies how data entries are deleted. The physical deletion mode deletes the data entries physically, while the logical deletion mode deletes them logically (i.e. they are marked as deleted, but are still physically accessible through direct access to data base). You can switch between the deletion modes without problems. In case that you switch from logical to physical you have to manually delete the data entries that are marked as deleted (i.e. use SQL and access to the data base directly).

[Warning]Warning

You can't use the logical deletion mode when using primary keys that are not created automatically. This limitation is caused by the fact that each primary key has to be unique for each table.

description

Defines the description.

extends

Defines the the domain type name that this domain type extends.

id

Defines the GUID of the model.

immutable

Defines the immutable flag.

name

Defines the name of the domain type.

permission-filter-generator-bean

Defines the permission filter generator bean reference.

table-name

Defines the database table name.

Valid inside <wfs-domain-type /> are: <primary-key />, <restriction-set />, <initialization-data />, <execute-if />, <auto-complete-filter />, <read-only-if />, <with-filter />, <filter-restriction />, <filter-specification />, <visible-if />, <disabled-if />, <condition />, <validate-if />, <on-create />, <on-insert />, <on-update />, <on-delete />, <property-set />

Chapter 52. Defining Domain Type Model Properties

<domain-type-property />

Domain type properties (domain-type-property) are equivalent to physical columns in database tables. Each such property has a distinct logical type and holds a distinct value.

Attributes of <domain-type-property />
AttributeDescription
attachment-repository

Defines the attachment repository used for an Attachment property.

audit-trail-relevance-mode

Defines the audit trail relevance mode.

database-columnname

Defines the database column name.

default-value

Defines a logical value with which the property will be initialized when a new object is created. See LogicalValueServiceImpl for more information.

description

Defines the description.

id

Defines the GUID of the model.

insert-property-value-provider

Defines the property value provider that sets the property value when a new domain object is inserted into the database.

length

Defines the maximum length of the property.

name

Defines the name of the property.

precision

Defines the number of digits (including the decimal places) for a number property.

property-handling-bean-name

Defines a bean that handles the property value. The specified bean has to implement the interface org.opensaga.runtime.model.domain.virtual.properties.VirtualPropertyValueHandler for read only properties or org.opensaga.runtime.model.domain.virtual.properties.WritableVirtualPropertyValueHandler for writable properties.

required

Defines the required flag.

scale

Defines the number of decimal places for a number property.

translation-required

Defines that the property value has to be translated before it is displayed. The default value is false.

type

Defines the fixed logical type of the property, (e.g. PlainText, Number or DateTime).

unique

Defines the unique enabled flag.

update-property-value-provider

Defines the property value provider that sets the property value when a domain object is updated in the database.

value-provider-bean

Defines a Spring configured bean ID for a bean of type PropertyValueProvider. which then is responsible for converting the default-value attribute value to a real value. OpenSAGA also provides some default implementations for specific template based value providers PropertyValueProviders.

Valid inside <domain-type-property /> are: <restriction-set />, <property-type-parameter-set />

<domain-type-property /> is valid inside: <formula-property-set />, <joined-property-set />, <enum-property-set />, <domain-type-property-set />, <reference-property-set />

<enum-property />

Enumeration properties (enum properties for short, enum-property) are special properties for the very likely use case of foreign key state data connected to a data type. They provide performance hints to the generator (e.g. we will use the related data very often) and additionally provide some nice functionalities for users (e.g. in text input fields users can enter fragmentary data for such enum fields - if the data is sufficient to uniquely identify a given row the value will be set automatically). Enumeration properties don't have a restriction set.

Attributes of <enum-property />
AttributeDescription
audit-trail-relevance-mode

Defines the audit trail relevance mode.

description

Defines the description.

id

Defines the GUID of the model.

name

Defines the name of the property.

property-handling-bean-name

Defines a bean that handles the property value. The specified bean has to implement the interface org.opensaga.runtime.model.domain.virtual.properties.VirtualPropertyValueHandler for read only properties or org.opensaga.runtime.model.domain.virtual.properties.WritableVirtualPropertyValueHandler for writable properties.

property-ref

Defines the referenced property.

translation-required

Defines that the property value has to be translated before it is displayed. The default value is false.

Valid inside <enum-property /> are: <restriction-set />, <property-type-parameter-set />

<enum-property /> is valid inside: <formula-property-set />, <joined-property-set />, <enum-property-set />, <domain-type-property-set />, <reference-property-set />

<enum-property-set />

Defines a set of EnumPropertyModels.

Attributes of <enum-property-set />
AttributeDescription
description

Defines the description.

domain-type-ref

Sets the domain type reference.

id

Defines the GUID of the model.

required

Defines the required flag.

store-by-value

Defines the "store-by-value" mode.

strict

Defines the "strict" mode.

Valid inside <enum-property-set /> are: <wiki-text-property />, <property-column />, <text-field />, <rich-text-property />, <url-column />, <select-popup />, <checkbox />, <textarea />, <radio-buttons />, <rich-text-field />, <locale-select />, <joined-property />, <plain-text-property />, <boolean-column />, <location-field />, <domain-type-property />, <enum-property />, <attachment />, <attachment-column />, <select-field />, <boolean-element />, <formula-property />, <password />, <reference-property />

<enum-property-set /> is valid inside: <property-set />

<formula-property />

Formula properties (formula-property) are defined in a specific scripting language (the default is Groovy) and are calculated whenever they are accessed. Additionally formula properties are stored in the database to allow efficient searches. Please note that formula properties are persisted with the last value that was calculated before storing - in some cases the database content will therefor not be correct (e.g. time-dependent values like age will not always hold the correct age in the database).

Attributes of <formula-property />
AttributeDescription
audit-trail-relevance-mode

Defines the audit trail relevance mode.

database-columnname

Defines the database column name.

description

Defines the description.

formula

Defines the formula that calculates the property value. In the formula you can access the current domain object by using the self reference. See ScriptingService for more information.

id

Defines the GUID of the model.

language

Defines the language of the formula.

length

Defines the length of the property.

name

Defines the name of the property.

precision

Defines the precision of the property.

property-handling-bean-name

Defines a bean that handles the property value. The specified bean has to implement the interface org.opensaga.runtime.model.domain.virtual.properties.VirtualPropertyValueHandler for read only properties or org.opensaga.runtime.model.domain.virtual.properties.WritableVirtualPropertyValueHandler for writable properties.

scale

Defines the scale of the property.

translation-required

Defines that the property value has to be translated before it is displayed. The default value is false.

type

Defines the fixed logical type of the property, (e.g. PlainText, Number or DateTime).

Valid inside <formula-property /> are: <restriction-set />, <property-type-parameter-set />

<formula-property /> is valid inside: <formula-property-set />, <joined-property-set />, <enum-property-set />, <domain-type-property-set />, <reference-property-set />

<formula-property-set />

Defines a set of FormulaPropertyModels.

Attributes of <formula-property-set />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <formula-property-set /> are: <wiki-text-property />, <property-column />, <text-field />, <rich-text-property />, <url-column />, <select-popup />, <checkbox />, <textarea />, <radio-buttons />, <rich-text-field />, <locale-select />, <joined-property />, <plain-text-property />, <boolean-column />, <location-field />, <domain-type-property />, <enum-property />, <attachment />, <attachment-column />, <select-field />, <boolean-element />, <formula-property />, <password />, <reference-property />

<formula-property-set /> is valid inside: <property-set />

<property-type />

Implements a model describing a property type for a domain type property. The following example illustrates how to do this:

[
<?xml version="1.0" encoding="UTF-8"?>
<property-type id="quinscape.domain.integer-type" name="PositiveInteger" java-class="java.lang.Integer" sql-class="java.lang.Integer">
    <restriction-set>
        <restriction id="positive-restriction" errorTag="validation.integer_not_positive" language="groovy">
            value &lt;= 0
        </restriction>
    </restriction-set>
    <type-converter-set>
        <type-converter type-converter-bean-ref="integerTypeConverter" locale="en_US"/>
        <type-converter type-converter-bean-ref="integerTypeConverter" locale="de_DE"/>
    </type-converter-set>
</property-type>
 
 

Attributes of <property-type />
AttributeDescription
default-input-field

Defines the tag name of the default input field.

default-output-field

Defines the tag name of the default output field

description

Defines the description.

id

Defines the GUID of the model.

java-type

Defines the Java type.

maximum-length

Defines the maximum length.

name

Defines the model name.

sql-type

Defines the SQL type.

Valid inside <property-type /> are: <restriction-set />, <type-converter-reference-set />

<type-converter-reference />

Implements TypeConverterReferenceModel.

Attributes of <type-converter-reference />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

locale

Defines the locale.

type-converter-bean-ref

Defines the type converter bean reference.

<type-converter-reference /> is valid inside: <type-converter-reference-set />

<type-converter-reference-set />

Implements TypeConverterReferenceSetModel.

Attributes of <type-converter-reference-set />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <type-converter-reference-set /> is: <type-converter-reference />

<type-converter-reference-set /> is valid inside: <property-type />

Chapter 53. Primary Keys for Domain Type Models

Table of Contents

<key />
<primary-key />

<key />

Defines a reference to a key PropertyModel.

Attributes of <key />
AttributeDescription
description

Defines the description.

foreign-key-column-name

Defines the foreign key column name.

generation-mode

Defines the primary key generation mode.

id

Defines the GUID of the model.

property-ref

Defines the property reference.

<key /> is valid inside: <primary-key />

<primary-key />

The primary key of the domain type consists of a nonempty set of the section called “<key />”s that in combination result in a unique identifier.

Attributes of <primary-key />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <primary-key /> is: <key />

<primary-key /> is valid inside: <external-excel-domain-type />, <external-relational-domain-type />, <joined-domain-type />, <constant-domain-type />, <external-excel-domain-type />, <external-relational-domain-type />, <joined-domain-type />, <constant-domain-type />, <domain-type />, <wfs-domain-type />, <request-context />, <wfs-domain-type />, <request-context />

Chapter 54. Primary Keys for Complex Domain Type Models

<contained-key />

Implements ContainedKeyPropertyReferenceModel.

Attributes of <contained-key />
AttributeDescription
contained-property-ref

Defines the contained property reference.

description

Defines the description.

id

Defines the GUID of the model.

property-ref

Defines the property reference.

<contained-key /> is valid inside: <contained-primary-key />

<contained-primary-key />

Implements ContainedPrimaryKeyModel.

Attributes of <contained-primary-key />
AttributeDescription
contained-domain-type-ref

Defines the contained domain type model ID.

description

Defines the description.

id

Defines the GUID of the model.

Valid inside <contained-primary-key /> is: <contained-key />

<contained-primary-key /> is valid inside: <contained-primary-key-set />

<contained-primary-key-set />

Implements ContainedPrimaryKeySetModel.

Attributes of <contained-primary-key-set />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <contained-primary-key-set /> is: <contained-primary-key />

<contained-primary-key-set /> is valid inside: <external-relational-domain-type />

Chapter 55. Domain Type Model Actions

<on-create />

Implements OnCreateModel. See the section called “<domain-type />” for a more detailed explanation.

Attributes of <on-create />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

isolation

Defines the isolation level for transaction isolation. Uses the names defined in Springs DefaultTransactionDefinition class to identify the specific isolation levels.

overwrite-extended

Defines if the model overwrites the model of the super type. The default value is false.

propagation

Defines the transaction propagation mode for the action block. Uses the names defined in Springs DefaultTransactionDefinition class to identify the specific propagation levels.

Valid inside <on-create /> are: <set-property-value />, <dequeue-report />, <webservice />, <transform />, <publish-message />, <iterate-list />, <try />, <aggregate />, <set-active-navigation />, <map-values />, <reset-validation-status />, <reset-cache />, <new />, <system-log />, <audit-trail />, <validation-error />, <execute />, <tag />, <if />, <enqueue-report />, <create-message />, <delete />, <for-each />, <reset-translations />, <set-object />, <send-outgoing-emails />, <connect />, <remove-list />, <email />, <load-list />, <bind />, <disconnect />, <delete-by />, <store />, <call />, <tweet />, <logout />, <next-element />, <validate />, <ignore-validation-results />, <import />, <add-to-list />, <remove />, <switch />, <define-password />

<on-create /> is valid inside: <external-excel-domain-type />, <external-relational-domain-type />, <joined-domain-type />, <constant-domain-type />, <external-excel-domain-type />, <external-relational-domain-type />, <joined-domain-type />, <constant-domain-type />, <domain-type />, <wfs-domain-type />, <request-context />, <case />, <wfs-domain-type />, <request-context />

<on-delete />

Implements OnDeleteModel. See the section called “<domain-type />” for a more detailed explanation.

Attributes of <on-delete />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

isolation

Defines the isolation level for transaction isolation. Uses the names defined in Springs DefaultTransactionDefinition class to identify the specific isolation levels.

overwrite-extended

Defines if the model overwrites the model of the super type. The default value is false.

propagation

Defines the transaction propagation mode for the action block. Uses the names defined in Springs DefaultTransactionDefinition class to identify the specific propagation levels.

Valid inside <on-delete /> are: <set-property-value />, <dequeue-report />, <webservice />, <transform />, <publish-message />, <iterate-list />, <try />, <aggregate />, <set-active-navigation />, <map-values />, <reset-validation-status />, <reset-cache />, <new />, <system-log />, <audit-trail />, <validation-error />, <execute />, <tag />, <if />, <enqueue-report />, <create-message />, <delete />, <for-each />, <reset-translations />, <set-object />, <send-outgoing-emails />, <connect />, <remove-list />, <email />, <load-list />, <bind />, <disconnect />, <delete-by />, <store />, <call />, <tweet />, <logout />, <next-element />, <validate />, <ignore-validation-results />, <import />, <add-to-list />, <remove />, <switch />, <define-password />

<on-delete /> is valid inside: <external-excel-domain-type />, <external-relational-domain-type />, <joined-domain-type />, <constant-domain-type />, <external-excel-domain-type />, <external-relational-domain-type />, <joined-domain-type />, <constant-domain-type />, <domain-type />, <wfs-domain-type />, <request-context />, <case />, <wfs-domain-type />, <request-context />

<on-insert />

Implements OnInsertModel. See the section called “<domain-type />” for a more detailed explanation.

Attributes of <on-insert />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

isolation

Defines the isolation level for transaction isolation. Uses the names defined in Springs DefaultTransactionDefinition class to identify the specific isolation levels.

overwrite-extended

Defines if the model overwrites the model of the super type. The default value is false.

propagation

Defines the transaction propagation mode for the action block. Uses the names defined in Springs DefaultTransactionDefinition class to identify the specific propagation levels.

Valid inside <on-insert /> are: <set-property-value />, <dequeue-report />, <webservice />, <transform />, <publish-message />, <iterate-list />, <try />, <aggregate />, <set-active-navigation />, <map-values />, <reset-validation-status />, <reset-cache />, <new />, <system-log />, <audit-trail />, <validation-error />, <execute />, <tag />, <if />, <enqueue-report />, <create-message />, <delete />, <for-each />, <reset-translations />, <set-object />, <send-outgoing-emails />, <connect />, <remove-list />, <email />, <load-list />, <bind />, <disconnect />, <delete-by />, <store />, <call />, <tweet />, <logout />, <next-element />, <validate />, <ignore-validation-results />, <import />, <add-to-list />, <remove />, <switch />, <define-password />

<on-insert /> is valid inside: <external-excel-domain-type />, <external-relational-domain-type />, <joined-domain-type />, <constant-domain-type />, <external-excel-domain-type />, <external-relational-domain-type />, <joined-domain-type />, <constant-domain-type />, <domain-type />, <wfs-domain-type />, <request-context />, <case />, <wfs-domain-type />, <request-context />

<on-update />

Implements OnUpdateModel. See the section called “<domain-type />” for a more detailed explanation.

Attributes of <on-update />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

isolation

Defines the isolation level for transaction isolation. Uses the names defined in Springs DefaultTransactionDefinition class to identify the specific isolation levels.

overwrite-extended

Defines if the model overwrites the model of the super type. The default value is false.

propagation

Defines the transaction propagation mode for the action block. Uses the names defined in Springs DefaultTransactionDefinition class to identify the specific propagation levels.

Valid inside <on-update /> are: <set-property-value />, <dequeue-report />, <webservice />, <transform />, <publish-message />, <iterate-list />, <try />, <aggregate />, <set-active-navigation />, <map-values />, <reset-validation-status />, <reset-cache />, <new />, <system-log />, <audit-trail />, <validation-error />, <execute />, <tag />, <if />, <enqueue-report />, <create-message />, <delete />, <for-each />, <reset-translations />, <set-object />, <send-outgoing-emails />, <connect />, <remove-list />, <email />, <load-list />, <bind />, <disconnect />, <delete-by />, <store />, <call />, <tweet />, <logout />, <next-element />, <validate />, <ignore-validation-results />, <import />, <add-to-list />, <remove />, <switch />, <define-password />

<on-update /> is valid inside: <external-excel-domain-type />, <external-relational-domain-type />, <joined-domain-type />, <constant-domain-type />, <external-excel-domain-type />, <external-relational-domain-type />, <joined-domain-type />, <constant-domain-type />, <domain-type />, <wfs-domain-type />, <request-context />, <case />, <wfs-domain-type />, <request-context />

Chapter 56. Initializing Domain Type Models

<data-set />

Each data set contains the property values for a single domain object in combination with a set of conditions, that check if the domain object is already present in the database. You can specify a name for the data set and set the language and country attributes that will be used for data conversion. The following table describes all attributes of a data set.

Attributes of <data-set />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

name

Defines the name of the data set.

Valid inside <data-set /> are: <insert-object />, <property-check />

<data-set /> is valid inside: <initialization-data />

<initialization-data />

Initialization data within domain types can be used to create domain objects that are necessary for OpenSAGA to work (e.g. you always need an admin user). Each domain type the section called “<domain-type />” can have one set of initialization data. When the OpenSAGA server is started, the system will process all initialization data and check if the required domain object already exists in the underlying database. If not, it is created. The following example, taken from the User domain type model (base/models/domain/types/user.xml), illustrates how the initialization data can be used:

 <initialization-data>
   <data-set name="AtLeastOneSuperUser" language="en" country="US">
     <property-check>
       <insert-test property-ref="system.domain.user.superUser"/>
     </property-check>
     <insert-object>
       <insert-value for-property-ref="system.domain.user.login"
                     is="admin"/>
       <insert-value for-property-ref="system.domain.user.password"
                     is="a40546cc4fd6a12572828bb803380888ad1bfdab"/>
       <insert-value for-property-ref="system.domain.user.active"
                     is="true"/>
       <insert-value for-property-ref="system.domain.user.nativeLocale"
                     is="en_US"/>
       <insert-value for-property-ref="system.domain.user.profileLocale"
                     is="en_US"/>
       <insert-value for-property-ref="system.domain.user.profileTimeZone"
                     is="Europe/Berlin"/>
       <insert-value for-property-ref="system.domain.user.firstName"
                     is="Big"/>
       <insert-value for-property-ref="system.domain.user.lastName"
                     is="Boss"/>
       <insert-value for-property-ref="system.domain.user.superUser"
                     is="true"/>
     </insert-object>
   </data-set>
 </initialization-data>
 
The example checks for a User domain object where the property system.domain.user.superUser is true. If no such User exists, it is created (with the property values provided by the insert-object definition). Each initialization-data definition contains a set of the section called “<data-set />” definitions. This allows the creation of as many domain objects as needed. For example, it might be necessary to create a system user (used for system tasks) in addition to the admin user.

Attributes of <initialization-data />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <initialization-data /> is: <data-set />

<initialization-data /> is valid inside: <external-excel-domain-type />, <external-relational-domain-type />, <joined-domain-type />, <constant-domain-type />, <external-excel-domain-type />, <external-relational-domain-type />, <joined-domain-type />, <constant-domain-type />, <domain-type />, <wfs-domain-type />, <request-context />, <wfs-domain-type />, <request-context />

<insert-object />

The insert-object definition contains a set of insert-value definitions.

Attributes of <insert-object />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <insert-object /> is: <insert-value />

<insert-object /> is valid inside: <data-set />

<insert-test />

Each insert test contains a single condition that returns a boolean value.

Attributes of <insert-test />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

property-ref

Defines the ID of the property to test.

<insert-test /> is valid inside: <property-check />

<insert-value />

You have to specify an insert-value definition for each property that you want to set within the new domain object. If you don't specify an insert value for a property, the value of the property is null.

Attributes of <insert-value />
AttributeDescription
description

Defines the description.

for-property-ref

Defines the property ID of the property receiving the value.

id

Defines the GUID of the model.

is

Defines the formatted value to set.

value-provider-bean

Defines the bean name of the default value provider for this property.

<insert-value /> is valid inside: <insert-object />

<property-check />

The property-check definition contains a set of insert-test definitions. If all insert tests return the value true, a new domain object is created in the database.

Attributes of <property-check />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <property-check /> is: <insert-test />

<property-check /> is valid inside: <data-set />

Chapter 57. Constant Domain Type Models

<constant-data />

Defines a model that contains a list of ConstantValueModelImpls.

Attributes of <constant-data />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <constant-data /> are: <constant />, <geo-polygon />, <geo-point />

<constant-data /> is valid inside: <constant-data-list />

<constant-data-list />

Defines a list of the section called “<constant-data />”s that are used by the the section called “<constant-domain-type />”.

Attributes of <constant-data-list />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <constant-data-list /> are: <constant-data />, <property-reference-list />

<constant-data-list /> is valid inside: <constant-domain-type />

<constant-domain-type />

Constant domain types are an extension of normal domain types. They contain constant data that can not be changed in any way. Below you can find an example definition together with the data source definition. The constant-data-list contains a property-reference-list and a list of constant-data definitions. The property-reference-list specifies the order of the properties and each constant-data definition has to contain a constant definition that corresponds to the property defined in the property reference list (they are mapped in the same order).

 <constant-domain-type id="qs-issues.issue_state" name="IssueState"
     data-source-name="system-issue_state-data-source" ...>
     <property-set>
         <domain-type-property-set>
             <domain-type-property id="qs-issues.issue_state.nr"
                 name="state" type="Integer" />
             <domain-type-property id="qs-issues.issue_state.name"
                 name="name" type="PlainText" translation-required="true" />
             <domain-type-property id="qs-issues.issue_state.attachment"
                 name="attachment" type="Attachment"/>
         </domain-type-property-set>
     </property-set>
     <primary-key>
         <key property-ref="qs-issues.issue_state.nr" />
     </primary-key>
     <constant-data-list>
         <property-reference-list>
             <property-reference property-ref="qs-issues.issue_state.nr" />
             <property-reference property-ref="qs-issues.issue_state.name" />
             <property-reference property-ref="qs-issues.issue_state.attachment" />
         </property-reference-list>
         <constant-data>
             <constant value="1"/>
             <constant value="Draft"/>
             <constant value="resource:/app/res/media/icons/gear_edit.png"/>
         </constant-data>
         <constant-data>
             <constant value="2"/>
             <constant value="Open"/>
             <constant value="resource:/app/res/media/icons/gear_information.png"/>
         </constant-data>
         ...
     </constant-data-list>
 </constant-domain-type>
 
The attribute data-source-name points to the data source definition that you can see below. This data source doesn't have any additional configuration settings.
 <stage name="global">
     <data-source-set>
         <data-source name="system-issue_state-data-source" type="opensaga-constant"/>
         ...
     </data-source-set>
 </stage>
 

Attributes of <constant-domain-type />
AttributeDescription
audit-trail-mode

Defines the audit trail mode.

audit-trail-relation-ref

Defines the audit trail relation reference.

cardinality

Defines the domain object cardinality. You can use the domain type cardinality to restrict the number of domain objects that are created for a domain type. E.g. you may want to store a system specific setting or a setting that is stored on a per user basis. For now two cardinalities are possible: single and user. Using single specifies that at most one domain object of this domain type is created for the portal, user specifies that at most one domain object is created for each user.

 <domain-type id="system.domain.config"
     cardinality="user" ...>
     <property-set>
         <domain-type-property-set>
             <domain-type-property
                 id="system.domain.config.colorScheme"
                 name="colorScheme" type="PlainText"
                 default-value="blue"/>
             ...
         </domain-type-property-set>
     </property-set>
 </domain-type>
 
The above example shows the definition of a domain type using the user cardinality. To create such an object, you have to put it into a context, e.g. here we use the session context (defined in portal.xml):
 <portal ...>
     <session-context>
         <scoped-domain-object id="portal.config"
             name="portalConfig"
             domain-type-ref="system.domain.config"/>
     </session-context>
     ...
 </portal>
 
You can then access the properties of the domain object by using their ID (e.g. system.domain.config.colorScheme).
[Note]Note

Make sure that you use a context type that is suitable for the chosen cardinality. For example you should use the session context for system specific domain types (with single cardinality).

data-handler-bean

Defines the data handler bean reference.

data-handler-class

Defines the data handler class name.

data-source-name

Defines the name of the data source to be used by this domain type.

delegate-bean-name

Defines the name of the delegate bean of type Model.

deletion-mode

OpenSAGA supports different deletion modes for domain type models. Each deletion mode specifies how data entries are deleted. The physical deletion mode deletes the data entries physically, while the logical deletion mode deletes them logically (i.e. they are marked as deleted, but are still physically accessible through direct access to data base). You can switch between the deletion modes without problems. In case that you switch from logical to physical you have to manually delete the data entries that are marked as deleted (i.e. use SQL and access to the data base directly).

[Warning]Warning

You can't use the logical deletion mode when using primary keys that are not created automatically. This limitation is caused by the fact that each primary key has to be unique for each table.

description

Defines the description.

extends

Defines the the domain type name that this domain type extends.

id

Defines the GUID of the model.

immutable

Defines the immutable flag.

name

Defines the name of the domain type.

permission-filter-generator-bean

Defines the permission filter generator bean reference.

table-name

Defines the database table name.

Valid inside <constant-domain-type /> are: <constant-data-list />, <primary-key />, <restriction-set />, <initialization-data />, <execute-if />, <auto-complete-filter />, <read-only-if />, <with-filter />, <filter-restriction />, <filter-specification />, <visible-if />, <disabled-if />, <condition />, <validate-if />, <on-create />, <on-insert />, <on-update />, <on-delete />, <property-set />

<property-reference />

Defines a property reference that references another property. In case of the constant domain type model it describes the order in which the constant data values are read. See the section called “<constant-domain-type />” for more information.

Attributes of <property-reference />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

property-ref

Defines the property reference.

<property-reference /> is valid inside: <property-reference-list />

<property-reference-list />

Defines a list of the section called “<property-reference />”s.

Attributes of <property-reference-list />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <property-reference-list /> is: <property-reference />

<property-reference-list /> is valid inside: <constant-data-list />

Chapter 58. Excel Based Domain Type Models

<excel-configuration />

Defines an Excel configuration that provides parameters used by the Excel domain type model. See the section called “<external-excel-domain-type />” for more information.

Attributes of <excel-configuration />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

skip-lines

Defines the number of lines to skip.

Valid inside <excel-configuration /> are: <output />, <mapping />, <input />

<excel-configuration /> is valid inside: <external-excel-domain-type />

<external-excel-domain-type />

You can use the external Excel domain type if you want to access data from an Excel file. All you have to do is to provide a mapping between the Excel file columns and the domain type properties. To skip a specific number of lines at the top of the document, you can use the attribute skip-lines. If you only want to import some parts of the file, you can define a filter specification that checks each row for validity.

 <external-excel-domain-type id="pa.excel-import"
     name="ExcelImport" data-source-name="excel-import-data-source" ...>
     <property-set>
         <domain-type-property-set>
             <domain-type-property id="pa.excel-import.kunde"
                 name="status" type="PlainText" />
             <domain-type-property id="pa.excel-import.status"
                 name="status" type="PlainText" />
             ...
         </domain-type-property-set>
     </property-set>
     <primary-key ... />
     <excel-configuration skip-lines="2">
         <mapping>
             <property-mappings>
                 <property-mapping source-ref="A"
                     target-ref="pa.excel-import.kunde"/>
                 <property-mapping source-ref="AG"
                     target-ref="pa.excel-import.kommentar"/>
                 ...
             </property-mappings>
         </mapping>
     </excel-configuration>
     <filter-specification ... />
  </external-excel-domain-type>
  
The attribute data-source-name points to the data source definition that you can see below. This data source specifies the Excel file that is read.
 <stage name="global">
     <data-source-set>
         <data-source name="excel-import-data-source" type="opensaga-external-excel">
             <settings>
                 <setting name="fileName" value="c:\\Import\\ExampleData.xls"/>
             </settings>
         </data-source>
         ...
     </data-source-set>
 </stage>
 

Attributes of <external-excel-domain-type />
AttributeDescription
audit-trail-mode

Defines the audit trail mode.

audit-trail-relation-ref

Defines the audit trail relation reference.

cardinality

Defines the domain object cardinality. You can use the domain type cardinality to restrict the number of domain objects that are created for a domain type. E.g. you may want to store a system specific setting or a setting that is stored on a per user basis. For now two cardinalities are possible: single and user. Using single specifies that at most one domain object of this domain type is created for the portal, user specifies that at most one domain object is created for each user.

 <domain-type id="system.domain.config"
     cardinality="user" ...>
     <property-set>
         <domain-type-property-set>
             <domain-type-property
                 id="system.domain.config.colorScheme"
                 name="colorScheme" type="PlainText"
                 default-value="blue"/>
             ...
         </domain-type-property-set>
     </property-set>
 </domain-type>
 
The above example shows the definition of a domain type using the user cardinality. To create such an object, you have to put it into a context, e.g. here we use the session context (defined in portal.xml):
 <portal ...>
     <session-context>
         <scoped-domain-object id="portal.config"
             name="portalConfig"
             domain-type-ref="system.domain.config"/>
     </session-context>
     ...
 </portal>
 
You can then access the properties of the domain object by using their ID (e.g. system.domain.config.colorScheme).
[Note]Note

Make sure that you use a context type that is suitable for the chosen cardinality. For example you should use the session context for system specific domain types (with single cardinality).

data-handler-bean

Defines the data handler bean reference.

data-handler-class

Defines the data handler class name.

data-source-name

Defines the name of the data source to be used by this domain type.

delegate-bean-name

Defines the name of the delegate bean of type Model.

deletion-mode

OpenSAGA supports different deletion modes for domain type models. Each deletion mode specifies how data entries are deleted. The physical deletion mode deletes the data entries physically, while the logical deletion mode deletes them logically (i.e. they are marked as deleted, but are still physically accessible through direct access to data base). You can switch between the deletion modes without problems. In case that you switch from logical to physical you have to manually delete the data entries that are marked as deleted (i.e. use SQL and access to the data base directly).

[Warning]Warning

You can't use the logical deletion mode when using primary keys that are not created automatically. This limitation is caused by the fact that each primary key has to be unique for each table.

description

Defines the description.

extends

Defines the the domain type name that this domain type extends.

id

Defines the GUID of the model.

immutable

Defines the immutable flag.

name

Defines the name of the domain type.

permission-filter-generator-bean

Defines the permission filter generator bean reference.

table-name

Defines the database table name.

Valid inside <external-excel-domain-type /> are: <excel-configuration />, <primary-key />, <restriction-set />, <initialization-data />, <execute-if />, <auto-complete-filter />, <read-only-if />, <with-filter />, <filter-restriction />, <filter-specification />, <visible-if />, <disabled-if />, <condition />, <validate-if />, <on-create />, <on-insert />, <on-update />, <on-delete />, <property-set />

Chapter 59. External Domain Type Models

<create-statement />

( Additional names: insert-statement )

Defines a SQL create statement that is used by the the section called “<external-relational-domain-type />”.

Attributes of <create-statement />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <create-statement /> is: text content

<database-statement-set />

Defines a set of database statement models that consists of:

Attributes of <database-statement-set />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <database-statement-set /> are: <create-statement />, <update-statement />, <delete-statement />, <find-statement />

<database-statement-set /> is valid inside: <external-relational-domain-type />

<delete-statement />

Defines a SQL delete statement that is used by the the section called “<external-relational-domain-type />”.

Attributes of <delete-statement />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <delete-statement /> is: text content

<delete-statement /> is valid inside: <database-statement-set />

<external-relational-domain-type />

With the external relation domain type you can access data from data bases that are not directly used by OpenSAGA itself. For example, if you want to display a list of customers and their orders from the database of your sales system, you just define a SQL statement that provides the data. The mapping between the result values and the properties is done by using aliases. See below for an example. Important: Only read access is possible at the moment.

 <external-relational-domain-type id="pa.customer"
     name="Customer" data-source-name="customer-data-source" ... >
     <property-set>
         <domain-type-property-set>
             <domain-type-property id="pa.customer.id"
                 name="id" type="Integer" />
             <domain-type-property id="pa.customer.name"
                 name="name" type="PlainText" />
             <domain-type-property id="pa.customer.contact"
                 name="contact" type="PlainText" />
         </domain-type-property-set>
     </property-set>
     <primary-key>
         <key property-ref="pa.customer.id" />
     </primary-key>
     <database-statement-set>
         <create-statement></create-statement>
         <update-statement></update-statement>
         <delete-statement></delete-statement>
         <find-statement>select lid as id, str_customer as name,
             str_contactperson as contact from customers
         </find-statement>
     </database-statement-set>
 </external-relational-domain-type>
 
The aliases id, name and contact are mapped to the corresponding properties (Internal a org.springframework.jdbc.core.RowMapper is used). The attribute data-source-name points to the data source definition that you can see below. This data source specifies the database connection.
 <stage name="global">
     <data-source-set>
         <data-source name="customer-data-source" type="opensaga-external-relational">
             <settings>
                 <setting name="driverClassName" value="org.postgresql.Driver"/>
                 <setting name="url" value="jdbc:postgresql://server:5432/testdb"/>
                 <setting name="username" value="postgres"/>
                 <setting name="password" value="test"/>
             </settings>
         </data-source>
         ...
     </data-source-set>
 </stage>
 
If you want to parameterize the SQL statement, you can define placeholders, as shown in the example below.
 <find-statement>
     select lid as id, customer_name as name from customer_table
         where customer_nr >= ${nr}
 </find-statement>
 
To set the placeholder to a specific value, you have to use a filter-pattern, like shown in the example below. The attribute name defines the placeholder name and the attribute constant the placeholder value. You can use property-ref to set the placeholder to the value of the referenced property.
 <datagrid ...>
     <datagrid-column-list ... />
     <filter-specification>
         <filter-pattern-set>
             <filter-pattern name="nr" constant="1000"/>
         </filter-pattern-set>
     </filter-specification>
 </datagrid>
 

Attributes of <external-relational-domain-type />
AttributeDescription
audit-trail-mode

Defines the audit trail mode.

audit-trail-relation-ref

Defines the audit trail relation reference.

cardinality

Defines the domain object cardinality. You can use the domain type cardinality to restrict the number of domain objects that are created for a domain type. E.g. you may want to store a system specific setting or a setting that is stored on a per user basis. For now two cardinalities are possible: single and user. Using single specifies that at most one domain object of this domain type is created for the portal, user specifies that at most one domain object is created for each user.

 <domain-type id="system.domain.config"
     cardinality="user" ...>
     <property-set>
         <domain-type-property-set>
             <domain-type-property
                 id="system.domain.config.colorScheme"
                 name="colorScheme" type="PlainText"
                 default-value="blue"/>
             ...
         </domain-type-property-set>
     </property-set>
 </domain-type>
 
The above example shows the definition of a domain type using the user cardinality. To create such an object, you have to put it into a context, e.g. here we use the session context (defined in portal.xml):
 <portal ...>
     <session-context>
         <scoped-domain-object id="portal.config"
             name="portalConfig"
             domain-type-ref="system.domain.config"/>
     </session-context>
     ...
 </portal>
 
You can then access the properties of the domain object by using their ID (e.g. system.domain.config.colorScheme).
[Note]Note

Make sure that you use a context type that is suitable for the chosen cardinality. For example you should use the session context for system specific domain types (with single cardinality).

data-handler-bean

Defines the data handler bean reference.

data-handler-class

Defines the data handler class name.

data-source-name

Defines the name of the data source to be used by this domain type.

delegate-bean-name

Defines the name of the delegate bean of type Model.

deletion-mode

OpenSAGA supports different deletion modes for domain type models. Each deletion mode specifies how data entries are deleted. The physical deletion mode deletes the data entries physically, while the logical deletion mode deletes them logically (i.e. they are marked as deleted, but are still physically accessible through direct access to data base). You can switch between the deletion modes without problems. In case that you switch from logical to physical you have to manually delete the data entries that are marked as deleted (i.e. use SQL and access to the data base directly).

[Warning]Warning

You can't use the logical deletion mode when using primary keys that are not created automatically. This limitation is caused by the fact that each primary key has to be unique for each table.

description

Defines the description.

extends

Defines the the domain type name that this domain type extends.

id

Defines the GUID of the model.

immutable

Defines the immutable flag.

name

Defines the name of the domain type.

permission-filter-generator-bean

Defines the permission filter generator bean reference.

table-name

Defines the database table name.

Valid inside <external-relational-domain-type /> are: <database-statement-set />, <contained-primary-key-set />, <primary-key />, <restriction-set />, <initialization-data />, <execute-if />, <auto-complete-filter />, <read-only-if />, <with-filter />, <filter-restriction />, <filter-specification />, <visible-if />, <disabled-if />, <condition />, <validate-if />, <on-create />, <on-insert />, <on-update />, <on-delete />, <property-set />

<find-statement />

( Additional names: select-statement )

Defines a SQL find statement that is used by the the section called “<external-relational-domain-type />”.

Attributes of <find-statement />
AttributeDescription
description

Defines the description.

handles-paging

Defines the flag indicating if the statement handles paging.

handles-sorting

Defines the flag indicating if the statement handles sorting.

id

Defines the GUID of the model.

scripting-dialect

Defines the scripting dialect.

template-engine

Defines the template engine.

Valid inside <find-statement /> is: text content

<insert-statement />

( Additional names: create-statement )

Defines a SQL create statement that is used by the the section called “<external-relational-domain-type />”.

Attributes of <insert-statement />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <insert-statement /> is: text content

<insert-statement /> is valid inside: <database-statement-set />

<select-statement />

( Additional names: find-statement )

Defines a SQL find statement that is used by the the section called “<external-relational-domain-type />”.

Attributes of <select-statement />
AttributeDescription
description

Defines the description.

handles-paging

Defines the flag indicating if the statement handles paging.

handles-sorting

Defines the flag indicating if the statement handles sorting.

id

Defines the GUID of the model.

scripting-dialect

Defines the scripting dialect.

template-engine

Defines the template engine.

Valid inside <select-statement /> is: text content

<select-statement /> is valid inside: <database-statement-set />

<update-statement />

Defines a SQL update statement that is used by the the section called “<external-relational-domain-type />”.

Attributes of <update-statement />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <update-statement /> is: text content

<update-statement /> is valid inside: <database-statement-set />

Chapter 60. Joined Domain Type Models

<joined-domain-type />

Joined domain types are used to join (at least two) domain types together without the need of creating a database view.

 <joined-domain-type ... >
     <property-set>
         <joined-property-set domain-type-ref="qs-issues.issue" name="issue">
             <joined-property id="qs-issues.issue_cc_user.guid"
                 name="guid" property-ref="qs-issues.issue.guid" />
             <joined-property id="qs-issues.issue_cc_user.title"
                 name="title" property-ref="qs-issues.issue.title" />
             ...
         </joined-property-set>
         <joined-property-set domain-type-ref="qs-issues.cc" name="cc">
             <joined-property id="qs-issues.issue_cc_user.entryChanged"
                 name="entryChanged" property-ref="qs-issues.cc.entryChanged" />
             ...
         </joined-property-set>
         <joined-property-set domain-type-ref="system.domain.user" name="user">
             <joined-property id="qs-issues.issue_cc_user.login"
                 name="login" property-ref="system.domain.user.login" />
             ...
         </joined-property-set>
     </property-set>
  
     <relation-chain>
         <relation-reference relation-ref="qs-issues.issue.relation.cc"/>
         <relation-reference relation-ref="qs-issues.cc.relation.user"/>
     </relation-chain>

     <primary-key>
         <key property-ref="qs-issues.issue_cc_user.guid" />
     </primary-key>
 </joined-domain-type>

Attributes of <joined-domain-type />
AttributeDescription
audit-trail-mode

Defines the audit trail mode.

audit-trail-relation-ref

Defines the audit trail relation reference.

cardinality

Defines the domain object cardinality. You can use the domain type cardinality to restrict the number of domain objects that are created for a domain type. E.g. you may want to store a system specific setting or a setting that is stored on a per user basis. For now two cardinalities are possible: single and user. Using single specifies that at most one domain object of this domain type is created for the portal, user specifies that at most one domain object is created for each user.

 <domain-type id="system.domain.config"
     cardinality="user" ...>
     <property-set>
         <domain-type-property-set>
             <domain-type-property
                 id="system.domain.config.colorScheme"
                 name="colorScheme" type="PlainText"
                 default-value="blue"/>
             ...
         </domain-type-property-set>
     </property-set>
 </domain-type>
 
The above example shows the definition of a domain type using the user cardinality. To create such an object, you have to put it into a context, e.g. here we use the session context (defined in portal.xml):
 <portal ...>
     <session-context>
         <scoped-domain-object id="portal.config"
             name="portalConfig"
             domain-type-ref="system.domain.config"/>
     </session-context>
     ...
 </portal>
 
You can then access the properties of the domain object by using their ID (e.g. system.domain.config.colorScheme).
[Note]Note

Make sure that you use a context type that is suitable for the chosen cardinality. For example you should use the session context for system specific domain types (with single cardinality).

data-handler-bean

Defines the data handler bean reference.

data-handler-class

Defines the data handler class name.

data-source-name

Defines the name of the data source to be used by this domain type.

delegate-bean-name

Defines the name of the delegate bean of type Model.

deletion-mode

OpenSAGA supports different deletion modes for domain type models. Each deletion mode specifies how data entries are deleted. The physical deletion mode deletes the data entries physically, while the logical deletion mode deletes them logically (i.e. they are marked as deleted, but are still physically accessible through direct access to data base). You can switch between the deletion modes without problems. In case that you switch from logical to physical you have to manually delete the data entries that are marked as deleted (i.e. use SQL and access to the data base directly).

[Warning]Warning

You can't use the logical deletion mode when using primary keys that are not created automatically. This limitation is caused by the fact that each primary key has to be unique for each table.

description

Defines the description.

extends

Defines the the domain type name that this domain type extends.

id

Defines the GUID of the model.

immutable

Defines the immutable flag.

name

Defines the name of the domain type.

permission-filter-generator-bean

Defines the permission filter generator bean reference.

table-name

Defines the database table name.

Valid inside <joined-domain-type /> are: <relation-chain />, <primary-key />, <restriction-set />, <initialization-data />, <execute-if />, <auto-complete-filter />, <read-only-if />, <with-filter />, <filter-restriction />, <filter-specification />, <visible-if />, <disabled-if />, <condition />, <validate-if />, <on-create />, <on-insert />, <on-update />, <on-delete />, <property-set />

<joined-property />

Joined properties (joined-property) are special properties for joined domain types (see the section called “<joined-domain-type />”) for a more detailed description). A joined domain type is defined by a relation chain. Each domain type in this relation chain is part of the join.

Attributes of <joined-property />
AttributeDescription
audit-trail-relevance-mode

Defines the audit trail relevance mode.

description

Defines the description.

id

Defines the GUID of the model.

name

Defines the name of the property.

property-handling-bean-name

Defines a bean that handles the property value. The specified bean has to implement the interface org.opensaga.runtime.model.domain.virtual.properties.VirtualPropertyValueHandler for read only properties or org.opensaga.runtime.model.domain.virtual.properties.WritableVirtualPropertyValueHandler for writable properties.

property-ref

Defines the referenced property.

translation-required

Defines that the property value has to be translated before it is displayed. The default value is false.

Valid inside <joined-property /> is: <property-type-parameter-set />

<joined-property /> is valid inside: <formula-property-set />, <joined-property-set />, <enum-property-set />, <domain-type-property-set />, <reference-property-set />

<joined-property-set />

Implements JoinedPropertySetModel.

Attributes of <joined-property-set />
AttributeDescription
description

Defines the description.

domain-type-ref

Defines the domain type reference.

id

Defines the GUID of the model.

Valid inside <joined-property-set /> are: <wiki-text-property />, <property-column />, <text-field />, <rich-text-property />, <url-column />, <select-popup />, <checkbox />, <textarea />, <radio-buttons />, <rich-text-field />, <locale-select />, <joined-property />, <plain-text-property />, <boolean-column />, <location-field />, <domain-type-property />, <enum-property />, <attachment />, <attachment-column />, <select-field />, <boolean-element />, <formula-property />, <password />, <reference-property />

<joined-property-set /> is valid inside: <property-set />

Chapter 61. Relations between Domain Type Models

<relation />

Relations define a relationship between two domain types. All relations are specified in a single relations.xml file. If you specify an inverse relation ID, the relation is symmetric.

 <relation-set id="portal.domain.relations" ...>
     <relation id="system.domain.user.relation.role"
               inverse-relation-id="system.domain.role.relation.user"
               name="relation between user and role"
               start-type-ref="system.domain.user"
               end-type-ref="system.domain.role"
               start-cardinality="0..*" 
               end-cardinality="0..*"/>
     ...
 </relation-set>
 
This list shows the cardinalities that you can specify for each point of the relation.

  • 1

You can connect exactly one domain object.

  • 0..1

You can connect zero or one domain object.

  • 0..*

You can connect zero or more domain objects.

  • 1..*

You can connect one or more domain objects.

Attributes of <relation />
AttributeDescription
connection-handler-bean

The connection handler bean (implementing the interface ConnectionHandler). [optional]

connection-handler-class

The connection handler class (implementing the interface ConnectionHandler). [optional]

description

Defines the description.

end-cardinality

Defines the end cardinality.

end-type-ref

The domain type model ID of the end domain type.

id

Defines the GUID of the model.

inverse-relation-id

Defines the inverse ID of the relation. OpenSAGA creates a relation model with the inverse ID automatically, this cuts down the amount of XML you have to write. [optional]

join-table-name

The name of the join table. If you don't specify this value, the name is automatically generated. [optional]

name

Defines the relation name. Can be used for a more detailed description of the relation.

start-cardinality

Defines the start cardinality.

start-type-ref

The domain type model ID of the start domain type.

use-join-table

Defines that a join table should be used (this is the default). If you set this attribute to false, OpenSAGA uses foreign keys if possible. You can specify this setting for each relation separately or for all relations at once, see the section called “<meta />”>. [optional]

<relation /> is valid inside: <relation-set />

<relation-chain />

Implements RelationReferenceChainModel.

Attributes of <relation-chain />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <relation-chain /> is: <relation-reference />

<relation-chain /> is valid inside: <part />, <relation-count />, <joined-domain-type />, <radio-buttons />, <multi-connect />, <tree-connect />, <transition />, <reference-property-set />, <list-iterator />, <multi-connect />, <single-connect />, <relation-chain-list />, <filtered-list />, <model-permission />, <datagrid />, <radio-buttons />, <select-field />

<relation-chain-list />

Implements RelationReferenceChainListModel.

Attributes of <relation-chain-list />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <relation-chain-list /> is: <relation-chain />

<relation-chain-list /> is valid inside: <set-property-value />, <audit-trail />, <delete />, <disconnect />

<relation-reference />

Implements RelationReferenceModel.

Attributes of <relation-reference />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

relation-ref

Defines the relation id.

Valid inside <relation-reference /> are: <execute-if />, <auto-complete-filter />, <read-only-if />, <with-filter />, <filter-restriction />, <filter-specification />, <visible-if />, <disabled-if />, <condition />, <validate-if />

<relation-reference /> is valid inside: <relation-chain />

<relation-set />

Implements RelationSetModel.

Attributes of <relation-set />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <relation-set /> is: <relation />

Chapter 62. Miscellaneous Domain Type Model Features

Table of Contents

<comment />

<comment />

Allows the storage of a comment that can be used to provide a detailed description about the model.

Attributes of <comment />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <comment /> is: text content

Chapter 63. Filtering

<can-access />

Defines a "can access" filter for the current user. Only one of the access permissions can be checked at a time.

Attributes of <can-access />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

navigation-item-ref

Defines the reference to the navigation item to check for access permissions.

transition-ref

Defines the reference to the transition to check for access permissions.

view-state-ref

Defines the reference to the view state to check for access permissions.

<can-access /> is valid inside: <and />, <execute-if />, <auto-complete-filter />, <or />, <read-only-if />, <with-filter />, <not />, <not />, <filter-restriction />, <execute-if />, <auto-complete-filter />, <read-only-if />, <with-filter />, <filter-restriction />, <filter-specification />, <visible-if />, <disabled-if />, <condition />, <validate-if />, <visible-if />, <disabled-if />, <condition />, <validate-if />

<complies-to />

Implements CompliesToFilterModel

Attributes of <complies-to />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

property-ref

Defines the reference to the property that is checked by this filter

restriction-ref

Defines the reference to the restriction that is used by this filter.

scoped-domain-object-ref

Defines the reference to the cached domain object that is checked by this filter.

<complies-to /> is valid inside: <and />, <execute-if />, <auto-complete-filter />, <or />, <read-only-if />, <with-filter />, <not />, <not />, <filter-restriction />, <execute-if />, <auto-complete-filter />, <read-only-if />, <with-filter />, <filter-restriction />, <filter-specification />, <visible-if />, <disabled-if />, <condition />, <validate-if />, <visible-if />, <disabled-if />, <condition />, <validate-if />

<contains />

( Additional names: contains-comparator )

Defines an "contains" filter.

Attributes of <contains />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

ignore-case

If set to true, the comparator should ignore the case of the two compared value, otherwise it should compare the two values case-sensitive.

null-value-compare-mode

Valid inside <contains /> are: <count />, <constant />, <relation-count />, <size-of />, <current-property-value />, <geo-polygon />, <property />, <geo-point />

<contains-comparator />

( Additional names: contains )

Defines an "contains" filter.

Attributes of <contains-comparator />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

ignore-case

If set to true, the comparator should ignore the case of the two compared value, otherwise it should compare the two values case-sensitive.

null-value-compare-mode

Valid inside <contains-comparator /> are: <count />, <constant />, <relation-count />, <size-of />, <current-property-value />, <geo-polygon />, <property />, <geo-point />

<contains-comparator /> is valid inside: <and />, <execute-if />, <auto-complete-filter />, <or />, <read-only-if />, <with-filter />, <not />, <not />, <filter-restriction />, <execute-if />, <auto-complete-filter />, <read-only-if />, <with-filter />, <filter-restriction />, <filter-specification />, <visible-if />, <disabled-if />, <condition />, <validate-if />, <visible-if />, <disabled-if />, <condition />, <validate-if />

<criterion />

Implements CriterionFilterModel.

Attributes of <criterion />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <criterion /> is: text content

<criterion /> is valid inside: <and />, <execute-if />, <auto-complete-filter />, <or />, <read-only-if />, <with-filter />, <not />, <not />, <filter-restriction />, <execute-if />, <auto-complete-filter />, <read-only-if />, <with-filter />, <filter-restriction />, <filter-specification />, <visible-if />, <disabled-if />, <condition />, <validate-if />, <visible-if />, <disabled-if />, <condition />, <validate-if />

<dynamic-condition />

Implements DynamicConditionFilterModel.

Attributes of <dynamic-condition />
AttributeDescription
condition-bean

Defines the condition bean to execute. The condition bean must implement DynamicCondition.

condition-script

Defines the script to execute

condition-script-resource

Defines the path to the script to execute.

condition-scripting-dialect

Defines the dialect of the script.

condition-using-script-dialect-dir

Defines whether the script resource path is relative to the script dialect directory or not.

description

Defines the description.

id

Defines the GUID of the model.

<dynamic-condition /> is valid inside: <and />, <execute-if />, <auto-complete-filter />, <or />, <read-only-if />, <with-filter />, <not />, <not />, <filter-restriction />, <execute-if />, <auto-complete-filter />, <read-only-if />, <with-filter />, <filter-restriction />, <filter-specification />, <visible-if />, <disabled-if />, <condition />, <validate-if />, <visible-if />, <disabled-if />, <condition />, <validate-if />

<ends-with />

Defines a "ends with" filter.

Attributes of <ends-with />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

ignore-case

If set to true, the comparator should ignore the case of the two compared value, otherwise it should compare the two values case-sensitive.

null-value-compare-mode

Valid inside <ends-with /> are: <count />, <constant />, <relation-count />, <size-of />, <current-property-value />, <geo-polygon />, <property />, <geo-point />

<ends-with /> is valid inside: <and />, <execute-if />, <auto-complete-filter />, <or />, <read-only-if />, <with-filter />, <not />, <not />, <filter-restriction />, <execute-if />, <auto-complete-filter />, <read-only-if />, <with-filter />, <filter-restriction />, <filter-specification />, <visible-if />, <disabled-if />, <condition />, <validate-if />, <visible-if />, <disabled-if />, <condition />, <validate-if />

<equals />

Defines an equals filter.

Attributes of <equals />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

ignore-case

If set to true, the comparator should ignore the case of the two compared value, otherwise it should compare the two values case-sensitive.

null-value-compare-mode

Valid inside <equals /> are: <count />, <constant />, <relation-count />, <size-of />, <current-property-value />, <geo-polygon />, <property />, <geo-point />

<equals /> is valid inside: <and />, <execute-if />, <auto-complete-filter />, <or />, <read-only-if />, <with-filter />, <not />, <not />, <filter-restriction />, <execute-if />, <auto-complete-filter />, <read-only-if />, <with-filter />, <filter-restriction />, <filter-specification />, <visible-if />, <disabled-if />, <condition />, <validate-if />, <visible-if />, <disabled-if />, <condition />, <validate-if />

<filter-pattern />

Implements FilterPatternModel.

Attributes of <filter-pattern />
AttributeDescription
constant

Defines the constant value.

description

Defines the description.

id

Defines the GUID of the model.

name

Defines the pattern name.

property-ref

Defines the property reference.

<filter-pattern /> is valid inside: <and />, <execute-if />, <auto-complete-filter />, <or />, <read-only-if />, <with-filter />, <not />, <not />, <filter-restriction />, <execute-if />, <auto-complete-filter />, <read-only-if />, <with-filter />, <filter-restriction />, <filter-specification />, <visible-if />, <disabled-if />, <condition />, <validate-if />, <visible-if />, <filter-pattern-set />, <disabled-if />, <condition />, <validate-if />

<filter-pattern-set />

Implements FilterPatternSetModel.

Attributes of <filter-pattern-set />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <filter-pattern-set /> is: <filter-pattern />

<filter-pattern-set /> is valid inside: <execute-if />, <auto-complete-filter />, <read-only-if />, <with-filter />, <filter-restriction />, <execute-if />, <auto-complete-filter />, <read-only-if />, <with-filter />, <filter-restriction />, <filter-specification />, <visible-if />, <disabled-if />, <condition />, <validate-if />, <visible-if />, <disabled-if />, <condition />, <validate-if />

<filter-specification />

Implements FilterSpecificationModel.

Attributes of <filter-specification />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <filter-specification /> are: <greater-than />, <is-property-modified />, <and />, <geo-within />, <matches />, <user-logged-in />, <validation-failed />, <complies-to />, <criterion />, <less-than-or-equal-to />, <has-current-element />, <is-undefined />, <has-changed />, <or />, <is-connected-to />, <can-access />, <ends-with />, <geo-contains />, <has-permission />, <contains-comparator />, <starts-with />, <not />, <equals />, <is-new />, <has-elements />, <dynamic-condition />, <true />, <less-than />, <in />, <include />, <in-transition />, <filter-pattern />, <has-type />, <greater-than-or-equal-to />, <is-super-user />, <false />, <is-defined />, <filter-pattern-set />

<filter-specification /> is valid inside: <external-excel-domain-type />, <external-relational-domain-type />, <count />, <filter-specification-set />, <joined-domain-type />, <constant-domain-type />, <start-action-list />, <external-excel-domain-type />, <external-relational-domain-type />, <joined-domain-type />, <constant-domain-type />, <domain-type />, <wfs-domain-type />, <request-context />, <radio-buttons />, <multi-connect />, <tree-connect />, <transition />, <list-iterator />, <case />, <wfs-domain-type />, <multi-connect />, <single-connect />, <relation-reference />, <has-elements />, <filtered-list />, <agent-action />, <datagrid />, <start-action-list />, <action-list />, <radio-buttons />, <select-field />, <request-context />, <cell-format />

<filter-specification-set />

If you have frequently used filter specifications, you should define them in a filter specification set. You can define such a set within view, process and portal models. To reference a filter defined in such a set, you have to use the include command, see the section called “IncludeFilter” for more information.

[Important]Important

The search order for filter specifications is: view, process and portal.

Example 63.1. Filter Specification Set

 <filter-specification-set>
     <filter-specification id="filter1">
         ...
     </filter-specification>
     ...
 </filter-specification-set>

Attributes of <filter-specification-set />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <filter-specification-set /> are: <execute-if />, <auto-complete-filter />, <read-only-if />, <with-filter />, <filter-restriction />, <filter-specification />, <visible-if />, <disabled-if />, <condition />, <validate-if />

<filter-specification-set /> is valid inside: <process />, <portal />, <view />

<filtered-list />

Implements FilteredListModel.

Attributes of <filtered-list />
AttributeDescription
description

Defines the description.

domain-type-ref

Defines the referenced domain type model.

id

Defines the GUID of the model.

max-size

Defines the max size of this list.

scoped-domain-object-list-ref

Defines the referenced cached domain object list.

scoped-domain-object-ref

Defines the referenced cached domain object.

Valid inside <filtered-list /> are: <execute-if />, <auto-complete-filter />, <read-only-if />, <with-filter />, <filter-restriction />, <filter-specification />, <visible-if />, <disabled-if />, <condition />, <validate-if />, <sort-order-list />, <relation-chain />, <join-definition-set />, <virtual-properties />

<filtered-list /> is valid inside: <map-values />, <system-log />, <tag />, <delete />, <for-each />, <connect />, <email />, <load-list />

<geo-contains />

Defines a geometric "contains" filter.

Attributes of <geo-contains />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

ignore-case

If set to true, the comparator should ignore the case of the two compared value, otherwise it should compare the two values case-sensitive.

null-value-compare-mode

Valid inside <geo-contains /> are: <count />, <constant />, <relation-count />, <size-of />, <current-property-value />, <geo-polygon />, <property />, <geo-point />

<geo-contains /> is valid inside: <and />, <execute-if />, <auto-complete-filter />, <or />, <read-only-if />, <with-filter />, <not />, <not />, <filter-restriction />, <execute-if />, <auto-complete-filter />, <read-only-if />, <with-filter />, <filter-restriction />, <filter-specification />, <visible-if />, <disabled-if />, <condition />, <validate-if />, <visible-if />, <disabled-if />, <condition />, <validate-if />

<geo-within />

Defines a geometric "within" filter.

Attributes of <geo-within />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

ignore-case

If set to true, the comparator should ignore the case of the two compared value, otherwise it should compare the two values case-sensitive.

null-value-compare-mode

Valid inside <geo-within /> are: <count />, <constant />, <relation-count />, <size-of />, <current-property-value />, <geo-polygon />, <property />, <geo-point />

<geo-within /> is valid inside: <and />, <execute-if />, <auto-complete-filter />, <or />, <read-only-if />, <with-filter />, <not />, <not />, <filter-restriction />, <execute-if />, <auto-complete-filter />, <read-only-if />, <with-filter />, <filter-restriction />, <filter-specification />, <visible-if />, <disabled-if />, <condition />, <validate-if />, <visible-if />, <disabled-if />, <condition />, <validate-if />

<greater-than />

Defines a "greater than" filter.

Attributes of <greater-than />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

ignore-case

If set to true, the comparator should ignore the case of the two compared value, otherwise it should compare the two values case-sensitive.

null-value-compare-mode

Valid inside <greater-than /> are: <count />, <constant />, <relation-count />, <size-of />, <current-property-value />, <geo-polygon />, <property />, <geo-point />

<greater-than /> is valid inside: <and />, <execute-if />, <auto-complete-filter />, <or />, <read-only-if />, <with-filter />, <not />, <not />, <filter-restriction />, <execute-if />, <auto-complete-filter />, <read-only-if />, <with-filter />, <filter-restriction />, <filter-specification />, <visible-if />, <disabled-if />, <condition />, <validate-if />, <visible-if />, <disabled-if />, <condition />, <validate-if />

<greater-than-or-equal-to />

Defines a "greater than or equal to" filter.

Attributes of <greater-than-or-equal-to />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

ignore-case

If set to true, the comparator should ignore the case of the two compared value, otherwise it should compare the two values case-sensitive.

null-value-compare-mode

Valid inside <greater-than-or-equal-to /> are: <count />, <constant />, <relation-count />, <size-of />, <current-property-value />, <geo-polygon />, <property />, <geo-point />

<greater-than-or-equal-to /> is valid inside: <and />, <execute-if />, <auto-complete-filter />, <or />, <read-only-if />, <with-filter />, <not />, <not />, <filter-restriction />, <execute-if />, <auto-complete-filter />, <read-only-if />, <with-filter />, <filter-restriction />, <filter-specification />, <visible-if />, <disabled-if />, <condition />, <validate-if />, <visible-if />, <disabled-if />, <condition />, <validate-if />

<has-changed />

Attributes of <has-changed />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

scoped-domain-object-ref

Defines the reference to a cached domain object reference in the current runtime context.

<has-changed /> is valid inside: <and />, <execute-if />, <auto-complete-filter />, <or />, <read-only-if />, <with-filter />, <not />, <not />, <filter-restriction />, <execute-if />, <auto-complete-filter />, <read-only-if />, <with-filter />, <filter-restriction />, <filter-specification />, <visible-if />, <disabled-if />, <condition />, <validate-if />, <visible-if />, <disabled-if />, <condition />, <validate-if />

<has-current-element />

Defines a filter model that checks if a scoped domain object list exists and has one or more remaining elements in the current iteration run.

Attributes of <has-current-element />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

scoped-domain-object-list-ref

Defines the referenced list.

<has-current-element /> is valid inside: <and />, <execute-if />, <auto-complete-filter />, <or />, <read-only-if />, <with-filter />, <not />, <not />, <filter-restriction />, <execute-if />, <auto-complete-filter />, <read-only-if />, <with-filter />, <filter-restriction />, <filter-specification />, <visible-if />, <disabled-if />, <condition />, <validate-if />, <visible-if />, <disabled-if />, <condition />, <validate-if />

<has-elements />

The HasElementsFilter checks whether a list has elements. The list can be either a scoped domain object or a loaded list from the database.

The HasElementsFilter can be used in following ways:

  • To check whether a scoped list has elements.

    Example 63.2. HasElementsFilter: Checking a scoped list

         <has-elements scoped-domain-object-list-ref="my.list" />

  • To check whether a list of loaded domain objects of the given domain type has elements.

    Example 63.3. HasElementsFilter: Checking a scoped list

         <has-elements domain-type-ref="domain.type.model" />

  • To check whether a list of loaded domain objects of the given domain model that satisfy the given filter specification has elements.

    Example 63.4. HasElementsFilter: Checking a scoped list

     <has-elements domain-type-ref="system.domain.user">
       <filter-specification>
         <equals>
           <property-value property-ref="system.domain.user.login" />
           <property-value property-ref="system.domain.proposed_user.login" />
         </equals>
       </filter-specification>
     </has-elements>

Attributes of <has-elements />
AttributeDescription
description

Defines the description.

domain-type-ref

Defines the domain type reference.

Loads a list of domain objects from the database with the defined domain type. This loaded list is checked by this filter.

id

Defines the GUID of the model.

scoped-domain-object-list-ref

Defines a scoped list that is checked by this filter.

Valid inside <has-elements /> are: <execute-if />, <auto-complete-filter />, <read-only-if />, <with-filter />, <filter-restriction />, <filter-specification />, <visible-if />, <disabled-if />, <condition />, <validate-if />

<has-elements /> is valid inside: <and />, <execute-if />, <auto-complete-filter />, <or />, <read-only-if />, <with-filter />, <not />, <not />, <filter-restriction />, <execute-if />, <auto-complete-filter />, <read-only-if />, <with-filter />, <filter-restriction />, <filter-specification />, <visible-if />, <disabled-if />, <condition />, <validate-if />, <visible-if />, <disabled-if />, <condition />, <validate-if />

<has-permission />

Defines a "has permission" filter for the current user.

Attributes of <has-permission />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

<has-permission /> is valid inside: <and />, <execute-if />, <auto-complete-filter />, <or />, <read-only-if />, <with-filter />, <not />, <not />, <filter-restriction />, <execute-if />, <auto-complete-filter />, <read-only-if />, <with-filter />, <filter-restriction />, <filter-specification />, <visible-if />, <disabled-if />, <condition />, <validate-if />, <visible-if />, <disabled-if />, <condition />, <validate-if />

<has-type />

Defines a filter model that checks if the target domain type is the same as the mentioned. A ScopedDomainObjectListReferenceModel is variable. The syntax of this Filter is

Attributes of <has-type />
AttributeDescription
description

Defines the description.

domain-type-ref

Defines the domain object.

id

Defines the GUID of the model.

scoped-domain-object-ref

Defines the referenced list.

<has-type /> is valid inside: <and />, <execute-if />, <auto-complete-filter />, <or />, <read-only-if />, <with-filter />, <not />, <not />, <filter-restriction />, <execute-if />, <auto-complete-filter />, <read-only-if />, <with-filter />, <filter-restriction />, <filter-specification />, <visible-if />, <disabled-if />, <condition />, <validate-if />, <visible-if />, <disabled-if />, <condition />, <validate-if />

<in />

Implements the in filter model.

 <in property-ref="...">
     [<constant ...]
     [<property ...]
     [<property-value ...]
     [<scoped-domain-object-ref ...]
     [<scoped-domain-object-list-ref ...]
 </in>
 
Tests if the property referenced by the id given by the property-ref attribute exists in the amount of values. The values can be set in different ways:

Example:

 <in property-ref="user.home.country">
     <constant value="Australia"/>
     <constant value="Germany"/>
     <constant value="Melmac"/>
     <constant value="Cuba"/>
     <constant value="Moon"/>
 </in>
 
This filter will return true if the users home is located e.g. on Melmac.

Attributes of <in />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

property-ref

Defines the reference to a property reference in the current runtime context.

Valid inside <in /> are: <scoped-domain-object-list-ref />, <current-property-value />, <property />, <constant />, <geo-polygon />, <geo-point />, <scoped-domain-object-ref />

<in /> is valid inside: <and />, <execute-if />, <auto-complete-filter />, <or />, <read-only-if />, <with-filter />, <not />, <not />, <filter-restriction />, <execute-if />, <auto-complete-filter />, <read-only-if />, <with-filter />, <filter-restriction />, <filter-specification />, <visible-if />, <disabled-if />, <condition />, <validate-if />, <visible-if />, <disabled-if />, <condition />, <validate-if />

<in-transition />

Implements InTransitionFilterModel.

Attributes of <in-transition />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

transition-ref

Defines the reference to a property in the current runtime context.

<in-transition /> is valid inside: <and />, <execute-if />, <auto-complete-filter />, <or />, <read-only-if />, <with-filter />, <not />, <not />, <filter-restriction />, <execute-if />, <auto-complete-filter />, <read-only-if />, <with-filter />, <filter-restriction />, <filter-specification />, <visible-if />, <disabled-if />, <condition />, <validate-if />, <visible-if />, <disabled-if />, <condition />, <validate-if />

<include />

The IncludeFilter provides the possibility to include a FilterSpecification within another. The resulting filter will be executed in the same way as if you would write the filter directly into the FilterSpecification. This can be very useful, if you use one and the same filter several times or you want to have a common filter that you can extend with some more filter rules.

A FilterSpecification that should be included by other filters has to be defined either in the PortalModel (see the section called “Filter Specification Set”), in a ProcessModel or in a ViewModel within a filter-specification-set.

[Important]Important

The search order for filter specifications is: view, process and portal.

Example 63.5. Defining a filter within a filter specification set

 <filter-specification-set>
     <filter-specification id="filter1">
         ...
     </filter-specification>
 </filter-specification-set>

The example below shows how you can include the FilterSpecification that is defined above.

Example 63.6. Including a filter from a filter specification set

 <filter-specification>
     <include filter-specification-ref="filter1"/>
 </filter-specification>

Because the IncludeFilter is like any other Filter, you can use it within other filters like and, or and so on. So you can extend the filter easily.

Example 63.7. Including and extending a filter specification

 <filter-specification>
     <and>
         <include filter-specification-ref="filter1"/>
         ...
     </and>
 </filter-specification>

Attributes of <include />
AttributeDescription
description

Defines the description.

filter-specification-ref

Defines the reference to the FilterSpecification (see the section called “<filter-specification />”) that is included by this filter.

id

Defines the GUID of the model.

<include /> is valid inside: <and />, <execute-if />, <auto-complete-filter />, <or />, <read-only-if />, <with-filter />, <not />, <not />, <filter-restriction />, <execute-if />, <auto-complete-filter />, <read-only-if />, <with-filter />, <filter-restriction />, <filter-specification />, <visible-if />, <disabled-if />, <condition />, <validate-if />, <visible-if />, <disabled-if />, <condition />, <validate-if />

<is-connected-to />

Implements IsConnectedFilterModel.

Attributes of <is-connected-to />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

object-ref
relation-ref

<is-connected-to /> is valid inside: <and />, <execute-if />, <auto-complete-filter />, <or />, <read-only-if />, <with-filter />, <not />, <not />, <filter-restriction />, <execute-if />, <auto-complete-filter />, <read-only-if />, <with-filter />, <filter-restriction />, <filter-specification />, <visible-if />, <disabled-if />, <condition />, <validate-if />, <visible-if />, <disabled-if />, <condition />, <validate-if />

<is-defined />

The IsDefinedFilter checks if a given value (see the section called “Values”), a cached domain object or a cached domain object list is defined (that it is not null). Therefore either a value (as child) or a scoped domain object reference or a scoped domain object list reference (as attribute) must be defined.

The following example shows how to check that a value of a property is not null. The example check if the property with the id local.name of the current object is not null.

Example 63.8. IsDefinedFilter: Checking a value

 <is-defined>
     <property-value property-ref="local.name"/>
 </is-defined>

The next example shows how to check that a cached domain object is not null. The example checks that the cached domain object with the id p_example.obj is not null.

Example 63.9. IsDefinedFilter: Checking a cached domain object

 <is-defined scoped-domain-object-ref="p_example.obj"/>

The following example shows how to check that a cached domain object list is not null. The example checks that the cached domain object list with the id p_example.list is not null.

Example 63.10. IsDefinedFilter: Checking a cached domain object list

 <is-defined scoped-domain-object-list-ref="p_example.list"/>
 

Attributes of <is-defined />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

scoped-domain-object-list-ref

Defines the reference to the list that is checked.

scoped-domain-object-ref

Defines the reference to the object that is checked.

Valid inside <is-defined /> are: <count />, <constant />, <relation-count />, <size-of />, <current-property-value />, <geo-polygon />, <property />, <geo-point />

<is-defined /> is valid inside: <and />, <execute-if />, <auto-complete-filter />, <or />, <read-only-if />, <with-filter />, <not />, <not />, <filter-restriction />, <execute-if />, <auto-complete-filter />, <read-only-if />, <with-filter />, <filter-restriction />, <filter-specification />, <visible-if />, <disabled-if />, <condition />, <validate-if />, <visible-if />, <disabled-if />, <condition />, <validate-if />

<is-new />

Attributes of <is-new />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

scoped-domain-object-ref

Defines the reference to a cached domain object reference in the current runtime context.

<is-new /> is valid inside: <and />, <execute-if />, <auto-complete-filter />, <or />, <read-only-if />, <with-filter />, <not />, <not />, <filter-restriction />, <execute-if />, <auto-complete-filter />, <read-only-if />, <with-filter />, <filter-restriction />, <filter-specification />, <visible-if />, <disabled-if />, <condition />, <validate-if />, <visible-if />, <disabled-if />, <condition />, <validate-if />

<is-property-modified />

Implements IsPropertyModifiedFilterModel.

Attributes of <is-property-modified />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

property-ref

Defines the reference to a property in the current runtime context.

<is-property-modified /> is valid inside: <and />, <execute-if />, <auto-complete-filter />, <or />, <read-only-if />, <with-filter />, <not />, <not />, <filter-restriction />, <execute-if />, <auto-complete-filter />, <read-only-if />, <with-filter />, <filter-restriction />, <filter-specification />, <visible-if />, <disabled-if />, <condition />, <validate-if />, <visible-if />, <disabled-if />, <condition />, <validate-if />

<is-super-user />

Checks if the current user is a super user.

Attributes of <is-super-user />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

<is-super-user /> is valid inside: <and />, <execute-if />, <auto-complete-filter />, <or />, <read-only-if />, <with-filter />, <not />, <not />, <filter-restriction />, <execute-if />, <auto-complete-filter />, <read-only-if />, <with-filter />, <filter-restriction />, <filter-specification />, <visible-if />, <disabled-if />, <condition />, <validate-if />, <visible-if />, <disabled-if />, <condition />, <validate-if />

<is-undefined />

The IsUndefinedFilter checks if a given value (see the section called “Values”), a cached domain object or a cached domain object list is undefined (that it is null). Therefore either a value (as child) or a scoped domain object reference or a scoped domain object list reference (as attribute) must be defined.

The following example shows how to check that a value of a property is null. The example check if the property with the id local.name of the current object is null.

Example 63.11. IsUndefinedFilter: Checking a value

 <is-undefined>
     <property-value property-ref="local.name"/>
 </is-undefined>

The next example shows how to check that a cached domain object is null. The example checks that the cached domain object with the id p_example.obj points to null.

Example 63.12. IsUndefinedFilter: Checking a cached domain object

 <is-undefined scoped-domain-object-ref="p_example.obj"/>

The following example shows how to check that a cached domain object list is null. The example checks that the cached domain object list with the id p_example.list points to null.

Example 63.13. IsUndefinedFilter: Checking a cached domain object list

 <is-undefined scoped-domain-object-list-ref="p_example.list"/>

Attributes of <is-undefined />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

scoped-domain-object-list-ref

Defines the reference to the list that is checked.

scoped-domain-object-ref

Defines the reference to the object that is checked.

Valid inside <is-undefined /> are: <count />, <constant />, <relation-count />, <size-of />, <current-property-value />, <geo-polygon />, <property />, <geo-point />

<is-undefined /> is valid inside: <and />, <execute-if />, <auto-complete-filter />, <or />, <read-only-if />, <with-filter />, <not />, <not />, <filter-restriction />, <execute-if />, <auto-complete-filter />, <read-only-if />, <with-filter />, <filter-restriction />, <filter-specification />, <visible-if />, <disabled-if />, <condition />, <validate-if />, <visible-if />, <disabled-if />, <condition />, <validate-if />

<join-definition />

Implements JoinDefinitionModel.

Attributes of <join-definition />
AttributeDescription
description

Defines the description.

filtered-list-property-ref

Defines the filtered list property model reference.

id

Defines the GUID of the model.

property-ref

Defines the property model reference.

<join-definition /> is valid inside: <join-definition-set />

<join-definition-set />

Defines a set of join definition models.

Attributes of <join-definition-set />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <join-definition-set /> is: <join-definition />

<join-definition-set /> is valid inside: <filtered-list />

<less-than />

Defines a "less than" filter.

Attributes of <less-than />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

ignore-case

If set to true, the comparator should ignore the case of the two compared value, otherwise it should compare the two values case-sensitive.

null-value-compare-mode

Valid inside <less-than /> are: <count />, <constant />, <relation-count />, <size-of />, <current-property-value />, <geo-polygon />, <property />, <geo-point />

<less-than /> is valid inside: <and />, <execute-if />, <auto-complete-filter />, <or />, <read-only-if />, <with-filter />, <not />, <not />, <filter-restriction />, <execute-if />, <auto-complete-filter />, <read-only-if />, <with-filter />, <filter-restriction />, <filter-specification />, <visible-if />, <disabled-if />, <condition />, <validate-if />, <visible-if />, <disabled-if />, <condition />, <validate-if />

<less-than-or-equal-to />

Defines a "less than or equal to" filter.

Attributes of <less-than-or-equal-to />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

ignore-case

If set to true, the comparator should ignore the case of the two compared value, otherwise it should compare the two values case-sensitive.

null-value-compare-mode

Valid inside <less-than-or-equal-to /> are: <count />, <constant />, <relation-count />, <size-of />, <current-property-value />, <geo-polygon />, <property />, <geo-point />

<less-than-or-equal-to /> is valid inside: <and />, <execute-if />, <auto-complete-filter />, <or />, <read-only-if />, <with-filter />, <not />, <not />, <filter-restriction />, <execute-if />, <auto-complete-filter />, <read-only-if />, <with-filter />, <filter-restriction />, <filter-specification />, <visible-if />, <disabled-if />, <condition />, <validate-if />, <visible-if />, <disabled-if />, <condition />, <validate-if />

<matches />

Implements MatchesFilterModel.

Attributes of <matches />
AttributeDescription
description

Defines the description.

filter-expression-property-ref

Defines the filter expression property reference.

filter-expression-value

Defines the filter expression value.

id

Defines the GUID of the model.

ignore-case

Defines the ignore case flag.

property-ref

Defines the reference to a property in the current runtime context.

<matches /> is valid inside: <and />, <execute-if />, <auto-complete-filter />, <or />, <read-only-if />, <with-filter />, <not />, <not />, <filter-restriction />, <execute-if />, <auto-complete-filter />, <read-only-if />, <with-filter />, <filter-restriction />, <filter-specification />, <visible-if />, <disabled-if />, <condition />, <validate-if />, <visible-if />, <disabled-if />, <condition />, <validate-if />

<not />

Defines a logical NOT.

Attributes of <not />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <not /> are: <greater-than />, <is-property-modified />, <and />, <geo-within />, <matches />, <user-logged-in />, <validation-failed />, <complies-to />, <criterion />, <less-than-or-equal-to />, <has-current-element />, <is-undefined />, <has-changed />, <or />, <is-connected-to />, <can-access />, <ends-with />, <geo-contains />, <has-permission />, <contains-comparator />, <starts-with />, <not />, <equals />, <is-new />, <has-elements />, <dynamic-condition />, <true />, <less-than />, <in />, <include />, <in-transition />, <filter-pattern />, <has-type />, <greater-than-or-equal-to />, <is-super-user />, <false />, <is-defined />, <greater-than />, <is-property-modified />, <and />, <geo-within />, <matches />, <user-logged-in />, <validation-failed />, <complies-to />, <criterion />, <less-than-or-equal-to />, <has-current-element />, <is-undefined />, <has-changed />, <or />, <is-connected-to />, <can-access />, <ends-with />, <geo-contains />, <has-permission />, <contains-comparator />, <starts-with />, <not />, <equals />, <is-new />, <has-elements />, <dynamic-condition />, <true />, <less-than />, <in />, <include />, <in-transition />, <filter-pattern />, <has-type />, <greater-than-or-equal-to />, <is-super-user />, <false />, <is-defined />

<not /> is valid inside: <and />, <execute-if />, <auto-complete-filter />, <or />, <read-only-if />, <with-filter />, <not />, <not />, <filter-restriction />, <execute-if />, <auto-complete-filter />, <read-only-if />, <with-filter />, <filter-restriction />, <filter-specification />, <visible-if />, <disabled-if />, <condition />, <validate-if />, <visible-if />, <disabled-if />, <condition />, <validate-if />

<sort-order />

Defines the sort order of one column of a widget.

Attributes of <sort-order />
AttributeDescription
desc

Sets the sort order to "descending".

description

Defines the description.

id

Defines the GUID of the model.

property-ref

Sets the ID of the property this sort order refers to.

<sort-order /> is valid inside: <sort-order-list />

<sort-order-list />

Defines a list of fields and orders to sort that data output of several widget types.

Attributes of <sort-order-list />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <sort-order-list /> is: <sort-order />

<sort-order-list /> is valid inside: <text-field />, <password />, <radio-buttons />, <multi-connect />, <list-iterator />, <multi-connect />, <single-connect />, <filtered-list />, <datagrid />, <radio-buttons />, <select-field />, <password />

<starts-with />

Defines a "starts with" filter.

Attributes of <starts-with />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

ignore-case

If set to true, the comparator should ignore the case of the two compared value, otherwise it should compare the two values case-sensitive.

null-value-compare-mode

Valid inside <starts-with /> are: <count />, <constant />, <relation-count />, <size-of />, <current-property-value />, <geo-polygon />, <property />, <geo-point />

<starts-with /> is valid inside: <and />, <execute-if />, <auto-complete-filter />, <or />, <read-only-if />, <with-filter />, <not />, <not />, <filter-restriction />, <execute-if />, <auto-complete-filter />, <read-only-if />, <with-filter />, <filter-restriction />, <filter-specification />, <visible-if />, <disabled-if />, <condition />, <validate-if />, <visible-if />, <disabled-if />, <condition />, <validate-if />

<user-logged-in />

Checks if the user is logged in (e.g. not anonymous).

Attributes of <user-logged-in />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

<user-logged-in /> is valid inside: <and />, <execute-if />, <auto-complete-filter />, <or />, <read-only-if />, <with-filter />, <not />, <not />, <filter-restriction />, <execute-if />, <auto-complete-filter />, <read-only-if />, <with-filter />, <filter-restriction />, <filter-specification />, <visible-if />, <disabled-if />, <condition />, <validate-if />, <visible-if />, <disabled-if />, <condition />, <validate-if />

<validation-failed />

Defines a filter model that checks if the validation failed during the current request.

Attributes of <validation-failed />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

<validation-failed /> is valid inside: <and />, <execute-if />, <auto-complete-filter />, <or />, <read-only-if />, <with-filter />, <not />, <not />, <filter-restriction />, <execute-if />, <auto-complete-filter />, <read-only-if />, <with-filter />, <filter-restriction />, <filter-specification />, <visible-if />, <disabled-if />, <condition />, <validate-if />, <visible-if />, <disabled-if />, <condition />, <validate-if />

Chapter 64. GIS

<defaults />

Implements GisDefaultsModel

Attributes of <defaults />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <defaults /> is: <srs />

<defaults /> is valid inside: <gis />

<domain-type-based-wfs />

Implementation of DomainTypeBasedWFSModel.

Attributes of <domain-type-based-wfs />
AttributeDescription
description

Defines the description.

domain-type-ref
id

Defines the GUID of the model.

name

<domain-type-based-wfs /> is valid inside: <service-registry />

<gis />

Implements GisModel.

Attributes of <gis />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <gis /> are: <defaults />, <service-registry />, <styles />

<layer />

Implements LayerModel

Attributes of <layer />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <layer /> is: text content

<layer /> is valid inside: <layer-list />

<layer-list />

Implements LayerListModel.

Attributes of <layer-list />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <layer-list /> is: <layer />

<layer-list /> is valid inside: <wfs-based-wms />, <wms />

<registry />

Implementation of GisServiceRegistryReferenceModel.

Attributes of <registry />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

registry-ref

<registry /> is valid inside: <service-registry />

<service-registry />

Attributes of <service-registry />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <service-registry /> is: <registry />

<service-registry /> is valid inside: <gis />

<service-registry />

Implementation of GisServiceListModel.

Attributes of <service-registry />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <service-registry /> are: <wfs />, <wfs-based-wms />, <domain-type-based-wfs />, <wms />

<srs />

Implements SRSModel

Attributes of <srs />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <srs /> is: text content

<srs /> is valid inside: <defaults />

<style />

Implementation of StyleModel.

Attributes of <style />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

name
sld

<style /> is valid inside: <styles />

<style-reference />

Implements StyleRefenceModel.

Attributes of <style-reference />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

style-ref

<style-reference /> is valid inside: <wfs-based-wms />, <wms />

<styles />

Implementation of StyleListModel.

Attributes of <styles />
AttributeDescription
default-style-ref
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <styles /> is: <style />

<styles /> is valid inside: <gis />

<url />

Implementation of Url

Attributes of <url />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <url /> is: text content

<url /> is valid inside: <wfs-based-wms />, <wms />

<wfs />

Implements WFSModel.

Attributes of <wfs />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

name

<wfs /> is valid inside: <service-registry />

<wfs-based-wms />

Implements WFSbasedWMSModel.

Attributes of <wfs-based-wms />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

is-base-layer
is-transparent
name
srs
wfs-ref

Valid inside <wfs-based-wms /> are: <url />, <layer-list />, <style-reference />

<wfs-based-wms /> is valid inside: <service-registry />

<wms />

Implements ExternalWMSModel.

Attributes of <wms />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

is-base-layer
is-transparent
name
srs

Valid inside <wms /> are: <url />, <layer-list />, <style-reference />

<wms /> is valid inside: <service-registry />

Chapter 65. Internationalization

<translation-definition />

Defines a translation. Translations are structured according to the following criteria:

  • Tag (T)

  • Language (L)

  • Country (C)

  • Process (P)

  • View (V)

  • Translation

When a translation needs to be resolved by the Translator, the following search order is utilized:

   
       T L    C    P    V
       T L    C    P    null
       T L    C    null null
       T L    null P    V
       T L    null P    null
       T L    null null null
       T null null null null
  
 
The first match is used.

Attributes of <translation-definition />
AttributeDescription
code

Defines the code.

country

Defines the country.

description

Defines the description.

id

Defines the GUID of the model.

language

Defines the language.

process-id

Defines the process ID.

translation

Defines the translation.

view-id

Defines the view ID.

<translation-definition /> is valid inside: <translation-definitions />

<translation-definitions />

Implements TranslationDefinitionsModel.

Attributes of <translation-definitions />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <translation-definitions /> is: <translation-definition />

<translation-definitions />

Implements TranslationDefinitionsReferenceModel.

Attributes of <translation-definitions />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

translation-definitions-ref

Defines the translation definitions reference.

<translation-definitions /> is valid inside: <translations />

<translations />

Defines a set of translation definitions. Translation definitions are specified in separate models (see the section called “<translation-definitions />”). The following example illustrates the use:

        <translations id="...">
            <translation-definitions translation-definitions-ref="..."/>
        </translations>
   

Attributes of <translations />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <translations /> is: <translation-definitions />

Chapter 66. Layout Models

<layout />

Implements LayoutModel.

Attributes of <layout />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <layout /> is: <skin />

<setting />

Implements SkinSettingModel.

Attributes of <setting />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

value

Defines the variable value for the setting.

variable

Defines the variable name of the setting.

<setting /> is valid inside: <skin />

<skin />

Implements SkinModel.

Attributes of <skin />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <skin /> is: <setting />

<skin /> is valid inside: <layout />

Chapter 67. Navigation Models

<cms-navigation-item />

Implements CmsNavigationItemModel.

Attributes of <cms-navigation-item />
AttributeDescription
anchor
cms-content-source

Defines the name of the used content source.

content-path

Defines the content path.

description

Defines the description.

external-target

Defines the external target URL.

generator-replace-mode

Defines the flag indicating if the generator replace mode is set.

id

Defines the GUID of the model.

label

Defines the label for the navigation item.

navigation-generator-bean

Defines the navigation generator bean reference.

navigation-import-mode

Defines the import mode for a navigation model referenced by this item (see NavigationReferenceMode).

navigation-import-ref

References another navigation model that not necessarily must exist.

process-start-state-ref

Defines the reference to the process start state model initiating a new process.

verbatim-label

Defines the verbatim label for the navigation model item.

Valid inside <cms-navigation-item /> are: <visible-if />, <item-list />

<cms-navigation-item /> is valid inside: <item-list />

<item />

Implements NavigationItemModel.

Attributes of <item />
AttributeDescription
anchor
description

Defines the description.

external-target

Defines the external target URL.

generator-replace-mode

Defines the flag indicating if the generator replace mode is set.

id

Defines the GUID of the model.

label

Defines the label for the navigation item.

navigation-generator-bean

Defines the navigation generator bean reference.

navigation-import-mode

Defines the import mode for a navigation model referenced by this item (see NavigationReferenceMode).

navigation-import-ref

References another navigation model that not necessarily must exist.

process-start-state-ref

Defines the reference to the process start state model initiating a new process.

verbatim-label

Defines the verbatim label for the navigation model item.

Valid inside <item /> are: <visible-if />, <item-list />

<item /> is valid inside: <item-list />

<item-list />

Implements NavigationItemListModel.

Attributes of <item-list />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <item-list /> are: <item />, <cms-navigation-item />

<item-list /> is valid inside: <navigation />, <item />, <cms-navigation-item />, <cms-navigation-item />

<navigation />

Implements NavigationModel.

Attributes of <navigation />
AttributeDescription
default-item-ref

Sets the default item reference.

description

Defines the description.

id

Defines the GUID of the model.

Valid inside <navigation /> is: <item-list />

Chapter 68. Portal Meta Models

<anonymous-model-permissions />

Implements ModelPermissionsSetModel for anonymous users.

Attributes of <anonymous-model-permissions />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <anonymous-model-permissions /> is: <model-permission />

<anonymous-model-permissions /> is valid inside: <meta />

<available-process />

Implements AvailableProcessModel.

Attributes of <available-process />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

process-ref

Defines a reference to a ProcessModel.

<available-process /> is valid inside: <available-processes-set />

<available-processes-set />

Implements AvailableProcessesSetModel.

Attributes of <available-processes-set />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <available-processes-set /> is: <available-process />

<available-processes-set /> is valid inside: <public-processes />

<configuration />

Implements ConfigurationModel.

Attributes of <configuration />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <configuration /> is: <definition />

<configuration /> is valid inside: <process-reference />

<conversation-context />

Implements ConversationContextModel.

Attributes of <conversation-context />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <conversation-context /> are: <start-action-list />, <action-list />, <scoped-domain-object />, <scoped-domain-object-list />, <property-set />

<conversation-context /> is valid inside: <portal />

<default-property />

Implements DefaultPropertyModel.

Attributes of <default-property />
AttributeDescription
database-columnname

Defines the column name.

description

Defines the description.

id

Defines the GUID of the model.

id-suffix

Defines the ID suffix.

insert-property-value-provider

Defines the insert property value provider reference.

name

Defines the property name.

type

Defines the property type.

update-property-value-provider

Defines the update property value provider reference.

<default-property /> is valid inside: <default-property-set />

<default-property-set />

You can specify a default property set that contains a set of properties that are added to all domain type models.

Example 68.1. Default Property Set Definition

 <domain-type-reference-set>
     <default-property-set>
         <default-property id-suffix="createdBy" name="createdBy"
             type="PlainText"
             insert-property-value-provider="currentUserPropertyValueProvider"/>
         ...
     </default-property-set>
     <domain-type-reference .../>
     ...
 </domain-type-reference-set>

The example shows the definition of a createdBy property. You have to specify the name and type just like you do for a normal domain type property. Here we use the currentUserPropertyValueProvider, so that the property is initialized if a new domain object is inserted into the database.

The attribute id-suffix is used for the ID of the generated property model. The ID is generated by using the ID of the domain type, then adding a dot and the ID suffix. E.g. if you assume a domain type with the ID example.company and the ID suffix createdBy, the resulting ID would be example.company.createdBy. You can use this generated ID like any other property model ID.

Attributes of <default-property-set />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <default-property-set /> is: <default-property />

<default-property-set /> is valid inside: <domain-type-reference-set />

<definition />

Implements DefinitionModel.

Attributes of <definition />
AttributeDescription
attribute

Defines the attribute.

description

Defines the description.

for-ref

Defines the referenced model ID.

id

Defines the GUID of the model.

value

Defines the value.

<definition /> is valid inside: <configuration />

<domain-context />

The domain context stores a number of properties if requested to do so.

Attributes of <domain-context />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <domain-context /> are: <start-action-list />, <action-list />, <scoped-domain-object />, <scoped-domain-object-list />, <property-set />

<domain-context /> is valid inside: <portal />

<domain-type-reference />

Implements DomainTypeReferenceModel.

Attributes of <domain-type-reference />
AttributeDescription
description

Defines the description.

domain-type-ref

Defines the referenced domain type.

id

Defines the GUID of the model.

<domain-type-reference /> is valid inside: <domain-type-reference-set />

<domain-type-reference-set />

The domain type reference set contains all domain types of the portal. For each domain type a domain-type-reference element with the attribute domain-type-ref has to be defined. This attribute refers to a domain type model, see ???.

Example 68.2. Domain Type Reference Set Definition

 <domain-type-reference-set>
     <domain-type-reference domain-type-ref="system.domain.user"/>
     ...
     <domain-type-reference domain-type-ref="system.domain.role"/>
 </domain-type-reference-set>

Default Property Set

For information about the default property set see the section called “<default-property-set />”

Attributes of <domain-type-reference-set />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <domain-type-reference-set /> are: <domain-type-reference />, <default-property-set />

<domain-type-reference-set /> is valid inside: <portal />

<gis />

Implementation of the GisReferenceModel that handles the gis-Tag in the PortalModel.

Attributes of <gis />
AttributeDescription
description

Defines the description.

gis-ref
id

Defines the GUID of the model.

<gis /> is valid inside: <portal />

<id-mapping />

Implements IdMappingModel.

Attributes of <id-mapping />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

new-id

Defines the new ID.

original-id

Defines the original ID.

<id-mapping /> is valid inside: <id-mapping-set />

<id-mapping-set />

Implements IdMappingSetModel.

Attributes of <id-mapping-set />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <id-mapping-set /> is: <id-mapping />

<id-mapping-set /> is valid inside: <process-reference />

<locale />

Implements LocaleModel.

Attributes of <locale />
AttributeDescription
country-code

Defines the country code.

description

Defines the description.

id

Defines the GUID of the model.

language-code

Defines the language code.

<locale /> is valid inside: <supported-locales />

<meta />

The meta model contains meta information for vitally functionality of the portal, such as user authentication, permission management or logging.

Example 68.3. Meta Definition

 <meta scoped-current-user-object-ref="portal.user.current"
      ...
      session-locale-ref="session.locale"
 >
    <anonymous-model-permissions>
    ...
    </anonymous-model-permissions>
    <user-model-permissions>
    ...
    </user-model-permissions>
 </meta>
 

In addition to the above attributes the model permissions for anonymous and logged on users are defined in the meta model. The anonymous-model-permissions and user-model-permissions each contain a list of model-permissions.

Example 68.4. Anonymous Model Permissions Definition

 <anonymous-model-permissions>
     <model-permission model-id-property-ref="system.domain.portal_view.guid">
         <relation-chain>
             <relation-reference
                 relation-ref="system.domain.role.relation.portal_view"/>
         </relation-chain>
     </model-permission>
     ...
 </anonymous-model-permissions>
 

Each model-permission contains a relation-chain that describes the relations that are necessary to reach the permission model by starting at the role domain type. For example the following code block

Example 68.5. User Model Permissions Definition

 <user-model-permissions>
     <model-permission model-id-property-ref="system.domain.portal_view.guid">
         <relation-chain>
             <relation-reference
                 relation-ref="system.domain.role.relation.portal_view"/>
         </relation-chain>
     </model-permission>
     ...
 </user-model-permissions>
 

describes that the view permissions (defined by the portal view domain type) can be reached by starting at the role domain type and then following the relation system.domain.role.relation.portal_view to the portal view domain type model. The model-id-property-ref defines the domain type of the permission.

Attributes of <meta />
AttributeDescription
audit-trail-detail-domain-type-ref

Defines the audit trail detail domain type reference.

audit-trail-master-detail-relation-ref

Defines the audit trail master detail relation reference.

audit-trail-master-domain-type-ref

Defines the audit trail master domain type reference

default-email-address

Defines the default email address.

default-email-subject

Defines the default email subject.

default-process-start-state-ref

Sets the default start state for this portal which is the start state that will be used when the user accesses the portal base URL.

default-user-locale

Defines the default user locale.

default-user-timezone

Defines the default user timezone.

description

Defines the description.

id

Defines the GUID of the model.

matches-filter-place-holder

Defines the matches filter place holder

matches-filter-wildcard-mode
permission-type-property-ref

Defines the permission type property reference.

role-domain-type-ref

Defines the role domain type reference.

role-name-property-ref

Defines the property ID of the property representing the role name.

role-permission-relation-ref

Defines the role permission relation reference.

scoped-current-user-object-ref

Defines the domain object reference to use for the current user.

session-locale-ref
stored-mail-domain-type-ref

Defines the stored mail domain type reference.

stored-mail-entry-timestamp-property-ref

Defines the entry time stamp property reference of the stored mail domain type.

stored-mail-exit-timestamp-property-ref

Defines the exit time stamp property reference of the stored mail domain type.

stored-mail-from-property-ref

Defines the from property reference of the stored mail domain type.

stored-mail-id-property-ref

Defines the id property reference of the stored mail domain type.

stored-mail-last-update-timestamp-property-ref

Defines the last update time stamp property reference of the stored mail domain type.

stored-mail-mail-service-name-property-ref

Defines the mail service name property reference of the stored mail domain type.

stored-mail-retry-count-property-ref

Defines the retry count property reference of the stored mail domain type.

stored-mail-status-property-ref

Defines the status property reference of the stored mail domain type.

stored-mail-to-property-ref

Defines the to property reference of the stored mail domain type.

system-logging-component-property-ref

Defines the system logging component property reference.

system-logging-domain-type-ref

Defines the system logging domain type reference.

system-logging-level-property-ref

Defines the system logging level property reference.

system-logging-login-property-ref

Defines the system logging login property reference.

system-logging-message-property-ref

Defines the system logging message property reference.

system-logging-timestamp-property-ref

Defines the system logging timestamp property reference.

translation-code-property-ref

Defines the code property reference of the translation domain type.

translation-country-property-ref

Defines the country property reference of the translation domain type.

translation-domain-type-ref

Defines the translation domain type reference.

translation-language-property-ref

Defines the language property reference of the translation domain type.

translation-process-id-property-ref

Defines the process ID property reference of the translation domain type.

translation-translation-property-ref

Defines the translation property reference of the translation domain type.

translation-view-id-property-ref

Defines the view ID property reference of the translation domain type.

use-join-table

Whether a join table should be not (see RelationModel for reference).

user-active-property-ref

Defines the user active property reference.

user-domain-type-ref

Defines the user domain type reference.

user-inverted-development-mode-property-ref
user-last-login-property-ref

Defines the user last login property reference.

user-login-property-ref

Defines the user login property reference.

user-native-locale-property-ref

Defines the user native locale property reference.

user-password-property-ref

Defines the user password property reference.

user-portaluser-property-ref

Defines the property representing the system user portaluser property.

user-profile-locale-property-ref

Defines the user profile locale property reference.

user-profile-timezone-property-ref

Defines the user profile time zone property reference.

user-role-relation-ref

Defines the user role relation reference.

user-superuser-property-ref

Defines the property representing the system user superuser property.

user-web-service-relation-ref

Defines the user web service relation reference.

web-service-name-property-ref

Defines the web service name property reference.

Valid inside <meta /> are: <user-model-permissions />, <anonymous-model-permissions />

<meta /> is valid inside: <portal />

<model-permission />

Defines a model permission.

Attributes of <model-permission />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

model-id-property-ref

Valid inside <model-permission /> is: <relation-chain />

<model-permission /> is valid inside: <anonymous-model-permissions />, <user-model-permissions />

<navigation-reference />

Implements NavigationReferenceModel.

Attributes of <navigation-reference />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

navigation-ref

Defines a reference to a navigation model.

<navigation-reference /> is valid inside: <navigation-reference-set />

<navigation-reference-set />

The navigation reference set contains a set of references to navigation models. Check out ??? for more details.

Example 68.6. Navigation Reference Set Definition

 <navigation-reference-set>
     <navigation-reference navigation-ref="base.n_main"/>
     <navigation-reference navigation-ref="base.n_support"/>
     <navigation-reference navigation-ref="base.n_applications"/>
     <navigation-reference navigation-ref="base.n_admin-applications"/>
 </navigation-reference-set>

Attributes of <navigation-reference-set />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <navigation-reference-set /> is: <navigation-reference />

<navigation-reference-set /> is valid inside: <portal />

<portal />

The portal model is the main model wherefrom all other model sets are referenced and initialized. It is subdivided in relevant parts as described in the following sections. The table below contains a list of all attributes that can be set on the portal model.

[Warning]Warning

Take care while changing these settings.

Example 68.7. Portal Definition

 <portal id="portal.base"
    home-process-start-state-ref="p_home.s_start"
    login-process-start-state-ref="p_login.s_start"
    logout-process-start-state-ref="p_logout.s_start"
    error-process-start-state-ref="p_error.s_start"
    access-denied-process-start-state-ref="p_access_denied.s_start"
    relation-set-ref="portal.domain.relations"
    translations-ref="portal.domain.translations"
    layout-ref="portal.layout"
    title-tag="PortalTitle"
    agents-ref="agents.list" 
    stages-ref="system.stages" 
    deletion-mode="logical"
    system-domain-type-ref="system.domain.virtual.info">
 

The MetaModel

For information about the MetaModel see the section called “<meta />”.

The Conversation Context

For information about the Conversation Context Model see the section called “<conversation-context />”.

The Session Context

For information about the Session Context Model see the section called “<session-context />”.

The Gis Model

For information about the Gis Model see the section called “<gis />”.

The Navigation Reference Set

For information about the Navigation Reference Set see the section called “<navigation-reference-set />”.

Supported Locales

For information about the supported locales see the section called “<supported-locales />”.

The Domain Type Reference Set

For information about The Domain Type Reference Set see the section called “<domain-type-reference-set />”.

The Process Reference Set

For information about the process reference set see the section called “<process-reference-set />”.

The Web Service Reference Set

For information about the web service reference set see WebServiceReferenceSetModelImpl.

The REST Services Reference Set

For information about the REST services reference set see the section called “<rest-services-reference-set />”.

Paging

For information about paging see the section called “<paging />”

Filter Specification Set

For information about filter specification set see the section called “<filter-specification-set />”.

UI Component Setting Set

For information about the UI Component Setting Set see the section called “<ui-component-setting-set />”.

Action List Set

For information about the action list set see the section called “<action-list-set />”.

Start Action List

For information about the start action list see the section called “<start-action-list />”.

Attributes of <portal />
AttributeDescription
access-denied-process-start-state-ref

Defines the reference to the access denied process. The default value is "p_access_denied.s_start".

agents-ref

Defines the agents. The default value is "agents.list".

allow-runtime-process-generation

Defines the allow runtime process generation flag. Setting this to false will slightly improve performance as Webflow will no longer check for flow modifications.

deletion-mode

Defines the deletion mode for the current portal. The default value is "logical". You can specify a separate deletion mode for each the section called “<domain-type />” that overrides the deletion mode set for the portal.

description

Defines the description.

error-process-start-state-ref

Defines the error process start state to display if an error occurs. The default value is "p_error.s_start".

home-process-start-state-ref

Defines the home process start state to display if the first request is achieved. The default value is "p_home.s_start".

id

Defines the GUID of the model.

layout-ref

Defines the referenced layout model for the current portal. The default value is "portal.layout".

login-process-start-state-ref

Defines the login process start state to display if a login is required. The default value is "p_login.s_start".

logout-process-start-state-ref

Defines the logout process start state reference. The default value is "p_logout.s_start".

portal-data-source-name

Defines the portal data source name.

relation-set-ref

Defines a reference to the relation set. The default value is "portal.domain.relations".

stages-ref

Defines the stage set model. The default value is "system.stages".

system-domain-type-ref

Defines the ID of the system domain type model used for system settings. The default value is "system.domain.virtual.info".

title-tag

Defines the title tag. The default value is "PortalTitle".

transaction-isolation-level

Defines the transaction isolation level.

transaction-propagation-behavior

Defines the transaction propagation behavior.

translations-ref

Defines a reference to the translations. The default value is "portal.domain.translations".

Valid inside <portal /> are: <restriction-set />, <filter-specification-set />, <ui-component-setting-set />, <navigation-reference-set />, <domain-context />, <session-context />, <supported-locales />, <property-type-reference-set />, <domain-type-reference-set />, <process-reference-set />, <meta />, <gis />, <paging />, <conversation-context />, <rest-services-reference-set />, <start-action-list />, <action-list-set />, <public-processes />, <error-message-mapping-set />

<process-reference />

Implements a ProcessReferenceModel.

Attributes of <process-reference />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

process-ref

Defines the process model ID.

template-process-ref

Defines the template process model ID.

Valid inside <process-reference /> are: <id-mapping-set />, <configuration />

<process-reference /> is valid inside: <process-reference-set />

<process-reference-set />

The process reference set contains all processes that can be used in the portal. For each process a process-reference element with the attribute process-ref has to be defined. This attribute refers to a process model.

Example 68.8. Process Set Definition

 <process-reference-set>
     <process-reference process-ref="portal.p_login"/>
     ...
     <process-reference process-ref="portal.p_monitoring"/>
 </process-reference-set>

Using ID Mappings to Copy Processes

OpenSAGA can also duplicate processes by copying them and replacing a selected set of IDs with new IDs.

[Note]Note

Internally all old IDs are replaced with new IDs. Random IDs are created to do that. But usually you need a set of IDs with known IDs in order to integrate the copy into your overall system (by e.g. referencing a new start state ID). Therefor you usually will need to define a limited set of IDs manually.

To do so you can use the process-reference tag already explained in but need to enhance it with the specific ID mappings that you need to control. The following example shows how to do this.

Let us assume that a process with the ID test.p_foo exists in your project. For some reason you want to copy the process (probably to modify it with some other means). Your goal is to create a new process test.p_bar that can be started via the navigation by adressing a start state with the new ID p_bar.s_bar (which overwrites the old start state ID p_foo.s_foo). This can be done easily by the following code:

Example 68.9. Duplicating a Process

 <process-reference process-ref="test.p_bar" template-process-ref="test.p_foo">
     <id-mapping-set>
         <id-mapping original-id="p_foo.s_foo" new-id="p_bar.s_bar"/>
     </id-mapping-set>
 </process-reference>

Attributes of <process-reference-set />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <process-reference-set /> is: <process-reference />

<process-reference-set /> is valid inside: <portal />

<property-type-reference />

Implements PropertyTypeReferenceModel.

Attributes of <property-type-reference />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

property-type-ref

Defines the referenced property type.

<property-type-reference /> is valid inside: <property-type-reference-set />

<property-type-reference-set />

Implements PropertyTypeReferenceSetModel.

Attributes of <property-type-reference-set />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <property-type-reference-set /> is: <property-type-reference />

<property-type-reference-set /> is valid inside: <portal />

<public-processes />

Implements PublicPortalProcessSetModel.

Attributes of <public-processes />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <public-processes /> is: <available-processes-set />

<public-processes /> is valid inside: <portal />

<session-context />

Implements SessionContextModel.

Attributes of <session-context />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <session-context /> are: <start-action-list />, <action-list />, <scoped-domain-object />, <scoped-domain-object-list />, <property-set />

<session-context /> is valid inside: <portal />

<start-action-list />

You can specify a list of actions that is executed right after the portal startup is complete.

Example 68.10. Start Action List

 <start-action-list>
     <system-log message="Executed Start-Action" />        
 </start-action-list>

Attributes of <start-action-list />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

isolation

Defines the isolation level for transaction isolation. Uses the names defined in Springs DefaultTransactionDefinition class to identify the specific isolation levels.

propagation

Defines the transaction propagation mode for the action block. Uses the names defined in Springs DefaultTransactionDefinition class to identify the specific propagation levels.

Valid inside <start-action-list /> are: <execute-if />, <auto-complete-filter />, <read-only-if />, <with-filter />, <filter-restriction />, <filter-specification />, <visible-if />, <disabled-if />, <condition />, <validate-if />, <set-property-value />, <dequeue-report />, <webservice />, <transform />, <publish-message />, <iterate-list />, <try />, <aggregate />, <set-active-navigation />, <map-values />, <reset-validation-status />, <reset-cache />, <new />, <system-log />, <audit-trail />, <validation-error />, <execute />, <tag />, <if />, <enqueue-report />, <create-message />, <delete />, <for-each />, <reset-translations />, <set-object />, <send-outgoing-emails />, <connect />, <remove-list />, <email />, <load-list />, <bind />, <disconnect />, <delete-by />, <store />, <call />, <tweet />, <logout />, <next-element />, <validate />, <ignore-validation-results />, <import />, <add-to-list />, <remove />, <switch />, <define-password />

<start-action-list /> is valid inside: <session-context />, <after-preprocessing />, <try />, <before-preprocessing />, <for-each />, <on-update-refresh />, <transition />, <conversation-context />, <action-list-set />, <case />, <domain-context />, <portal />, <agent-action />, <before-postprocessing />, <after-postprocessing />, <process-context />

<supported-locales />

The set of locales that are supported by the portal can be specified here. For each locale a locale element with the attributes language-code and country-code has to be defined. The values of these attributes correspond to the language and country properties of the java.util.Locale Java class. The default locale can be configured by the attribute default-locale-ref.

Example 68.11. Supported Locales Definition

 <supported-locales default-locale-ref="balvi.locale.de_DE">
     <locale id="balvi.locale.en_US" language-code="en" country-code="US"/>
     <locale id="balvi.locale.de_DE" language-code="de" country-code="DE"/>
 </supported-locales>

Attributes of <supported-locales />
AttributeDescription
default-locale-ref

Defines a reference to the default locale.

description

Defines the description.

id

Defines the GUID of the model.

Valid inside <supported-locales /> is: <locale />

<supported-locales /> is valid inside: <portal />

<user-model-permissions />

Implements ModelPermissionsSetModel for authorized users.

Attributes of <user-model-permissions />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <user-model-permissions /> is: <model-permission />

<user-model-permissions /> is valid inside: <meta />

Chapter 69. Process Models

<after-postprocessing />

Implements AfterPostprocessingPhaseModel.

Attributes of <after-postprocessing />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <after-postprocessing /> are: <start-action-list />, <action-list />

<after-postprocessing /> is valid inside: <view />

<after-preprocessing />

Implements AfterPreprocessingPhaseModel.

Attributes of <after-preprocessing />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <after-preprocessing /> are: <start-action-list />, <action-list />

<after-preprocessing /> is valid inside: <view />

<back-state />

Implements a state that simulates a "back to some other state" functionality. These kinds of states should be used for navigation endpoints that return to a somewhat variable start point (because e.g. there are paths of different length to the current view state).

Each of the optional attributes causes the domain context path to be analyzed for a specific point. If that point if found, the process will return to that point. Otherwise defaulting rules might apply.

Attributes of <back-state />
AttributeDescription
auto-validating

Defines whether the current process state model is auto-validating. Auto-validating process state models will return to the source process state model if a validation error is discovered.

back-to-first-view-without-domain-type-ref

Defines if this back state returns to the first view without domain type model.

back-to-last-view-with-domain-type-ref

Defines the ID of a domain type model. The back state returns to the last view with the given domain type model. If none is found, the most recent view without any domain type model will be targeted.

back-to-last-view-without-domain-type-ref

Defines if this back state returns to the last view without a specific domain type model.

back-to-parent-of-first-view-with-domain-type-ref

Defines the ID of a domain type model. Returns to the first view with the given domain type model. If none is found, the oldest view without any domain type model will be targeted.

back-to-parent-of-last-view-with-domain-type-ref

Defines the ID of a domain type model. Returns to the parent of the last view with that domain type model. If no view with the given domain type model is found, the most recent view without any domain type model will be targeted.

back-to-view-state-in-domain-context-path-ref

Defines the ID of a view model. The back state returns to the last instance of the given view model contained in the domain context path.

description

Defines the description.

id

Defines the GUID of the model.

Valid inside <back-state /> are: <request-context />, <transition-list />

<back-state /> is valid inside: <process-state-set />

<before-postprocessing />

Implements BeforePostprocessingPhaseModel.

Attributes of <before-postprocessing />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <before-postprocessing /> are: <start-action-list />, <action-list />

<before-postprocessing /> is valid inside: <view />

<before-preprocessing />

Implements BeforePreprocessingPhaseModel.

Attributes of <before-preprocessing />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <before-preprocessing /> are: <start-action-list />, <action-list />

<before-preprocessing /> is valid inside: <view />

<confirmation />

Generates a confirmation dialog. The confirmation handling (i.e. if the confirmation is shown as a popup window or a normal view) can be configured in the file "opensaga-confirm.js" with the parameter "opensaga.jsConfirm". If you set this parameter to true you get a popup window, if you set it to false you get a normal view.

In order to model a confirmation you need to annotate a transition with this model. The following example illustrates this approach:

       <transition id="some.transition.id" name="transitionName" target-state-ref="some.target.state.id">
           <action-list>
               ...
           </action-list>
           <confirmation confirmation-text="someConfirmationText" ok-button-text="someButtonText" />
       </transition>
   

Whenever the transition is fired by some event source the confirmation dialog will intercept the transition execute. Only after confirming the confirmation dialog the transition really is executed. Otherwise it is aborted.

Attributes of <confirmation />
AttributeDescription
cancel-button-text
confirmation-text (required)
confirmation-title
description

Defines the description.

id

Defines the GUID of the model.

ok-button-text

Valid inside <confirmation /> is: <confirmation-property-list />

<confirmation /> is valid inside: <transition />

<confirmation-property />

A reference for a confirmation message including a label for it.

Attributes of <confirmation-property />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

label (required)
property-ref (required)

<confirmation-property /> is valid inside: <confirmation-property-list />

<confirmation-property-list />

Contains a list of ConfirmationPropertyReferenceModels.

Attributes of <confirmation-property-list />
AttributeDescription
description

Defines the description.

domain-type-ref (required)
id

Defines the GUID of the model.

Valid inside <confirmation-property-list /> is: <confirmation-property />

<confirmation-property-list /> is valid inside: <confirmation />

<decision-state />

Implements DecisionStateModel.

Attributes of <decision-state />
AttributeDescription
auto-validating

Defines whether the current process state model is auto-validating. Auto-validating process state models will return to the source process state model if a validation error is discovered.

description

Defines the description.

id

Defines the GUID of the model.

Valid inside <decision-state /> are: <request-context />, <transition-list />

<decision-state /> is valid inside: <process-state-set />

<end-state />

Implements ProcessEndStateModel.

Attributes of <end-state />
AttributeDescription
auto-validating

Defines whether the current process state model is auto-validating. Auto-validating process state models will return to the source process state model if a validation error is discovered.

close-window

Defines if the process window should be closed.

description

Defines the description.

id

Defines the GUID of the model.

reload-parent

Defines if the parent window should be reloaded when this process ends.

Valid inside <end-state /> is: <request-context />

<end-state /> is valid inside: <process-state-set />

<input />

Defines an input model.

Attributes of <input />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <input /> are: <property-mappings />, <object-mappings />

<input /> is valid inside: <interface />, <map-values />, <excel-configuration />, <import />

<input-interface />

Implements InputInterfaceContextModel.

Attributes of <input-interface />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <input-interface /> is: <property-set />

<input-interface /> is valid inside: <start-state />, <subprocess-start-state />

<interface />

Implements InterfaceModel.

Attributes of <interface />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <interface /> are: <input />, <output />

<interface /> is valid inside: <transition />

<mapping />

Defines property mappings via the section called “<property-mapping />” and objects via the section called “<object-mappings />”.

Attributes of <mapping />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <mapping /> are: <property-mappings />, <object-mappings />

<mapping /> is valid inside: <map-values />, <excel-configuration />, <import />

<object-mapping />

Implements ScopedDomainObjectMappingModel.

Attributes of <object-mapping />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

source-ref

Defines the source domain object ID.

target-ref

Defines the target domain object ID.

<object-mapping /> is valid inside: <object-mappings />

<object-mappings />

Implements ObjectMappingsModel.

Attributes of <object-mappings />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <object-mappings /> is: <object-mapping />

<object-mappings /> is valid inside: <output />, <output />, <mapping />, <input />, <input />

<output />

Defines an output model.

Attributes of <output />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <output /> are: <property-mappings />, <object-mappings />

<output /> is valid inside: <interface />, <map-values />, <excel-configuration />, <import />

<output-interface />

Implements OutputInterfaceContextModel.

Attributes of <output-interface />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <output-interface /> is: <property-set />

<output-interface /> is valid inside: <start-state />, <subprocess-start-state />

<parameter />

Implements ParameterModel.

Attributes of <parameter />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

name

Defines the model name.

property-ref

Defines the property reference.

scoped-domain-object-list-ref

Defines the scoped domain object list reference.

scoped-domain-object-ref

Defines the scoped domain object reference.

value

Defines the value.

value-type

Defines the value type.

<parameter /> is valid inside: <parameter-set />

<parameter-set />

Implements ParameterSetModel.

Attributes of <parameter-set />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <parameter-set /> is: <parameter />

<parameter-set /> is valid inside: <execute />, <email />

<process />

Implements ProcessModel.

Attributes of <process />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <process /> are: <restriction-set />, <filter-specification-set />, <ui-component-setting-set />, <action-list-set />, <process-state-set />, <process-context />

<process-context />

Implements ProcessContextModel.

Attributes of <process-context />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <process-context /> are: <start-action-list />, <action-list />, <scoped-domain-object />, <scoped-domain-object-list />, <property-set />

<process-context /> is valid inside: <process />

<process-state-set />

Implements ProcessStateSetModel.

Attributes of <process-state-set />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <process-state-set /> are: <start-state />, <back-state />, <end-state />, <subprocess-start-state />, <view-state />, <decision-state />

<process-state-set /> is valid inside: <process />

<property-mapping />

Implements PropertyMappingModel.

Attributes of <property-mapping />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

source-ref

Defines the source property model ID.

target-ref

Defines the target property model ID.

value

Defines the value for the target property.

<property-mapping /> is valid inside: <property-mappings />

<property-mappings />

Implements PropertyMappingsModel.

Attributes of <property-mappings />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <property-mappings /> is: <property-mapping />

<property-mappings /> is valid inside: <output />, <output />, <mapping />, <input />, <new-object />, <input />

<request-context />

Implements RequestContextModel.

Attributes of <request-context />
AttributeDescription
audit-trail-mode

Defines the audit trail mode.

audit-trail-relation-ref

Defines the audit trail relation reference.

cardinality

Defines the domain object cardinality. You can use the domain type cardinality to restrict the number of domain objects that are created for a domain type. E.g. you may want to store a system specific setting or a setting that is stored on a per user basis. For now two cardinalities are possible: single and user. Using single specifies that at most one domain object of this domain type is created for the portal, user specifies that at most one domain object is created for each user.

 <domain-type id="system.domain.config"
     cardinality="user" ...>
     <property-set>
         <domain-type-property-set>
             <domain-type-property
                 id="system.domain.config.colorScheme"
                 name="colorScheme" type="PlainText"
                 default-value="blue"/>
             ...
         </domain-type-property-set>
     </property-set>
 </domain-type>
 
The above example shows the definition of a domain type using the user cardinality. To create such an object, you have to put it into a context, e.g. here we use the session context (defined in portal.xml):
 <portal ...>
     <session-context>
         <scoped-domain-object id="portal.config"
             name="portalConfig"
             domain-type-ref="system.domain.config"/>
     </session-context>
     ...
 </portal>
 
You can then access the properties of the domain object by using their ID (e.g. system.domain.config.colorScheme).
[Note]Note

Make sure that you use a context type that is suitable for the chosen cardinality. For example you should use the session context for system specific domain types (with single cardinality).

data-handler-bean

Defines the data handler bean reference.

data-handler-class

Defines the data handler class name.

data-source-name

Defines the name of the data source to be used by this domain type.

delegate-bean-name

Defines the name of the delegate bean of type Model.

deletion-mode

OpenSAGA supports different deletion modes for domain type models. Each deletion mode specifies how data entries are deleted. The physical deletion mode deletes the data entries physically, while the logical deletion mode deletes them logically (i.e. they are marked as deleted, but are still physically accessible through direct access to data base). You can switch between the deletion modes without problems. In case that you switch from logical to physical you have to manually delete the data entries that are marked as deleted (i.e. use SQL and access to the data base directly).

[Warning]Warning

You can't use the logical deletion mode when using primary keys that are not created automatically. This limitation is caused by the fact that each primary key has to be unique for each table.

description

Defines the description.

extends

Defines the the domain type name that this domain type extends.

id

Defines the GUID of the model.

immutable

Defines the immutable flag.

name

Defines the name of the domain type.

permission-filter-generator-bean

Defines the permission filter generator bean reference.

table-name

Defines the database table name.

Valid inside <request-context /> are: <primary-key />, <restriction-set />, <initialization-data />, <execute-if />, <auto-complete-filter />, <read-only-if />, <with-filter />, <filter-restriction />, <filter-specification />, <visible-if />, <disabled-if />, <condition />, <validate-if />, <on-create />, <on-insert />, <on-update />, <on-delete />, <property-set />

<request-context /> is valid inside: <start-state />, <back-state />, <end-state />, <subprocess-start-state />, <view-state />, <decision-state />

<start-state />

Implements ProcessStartStateModel.

Attributes of <start-state />
AttributeDescription
auto-validating

Defines whether the current process state model is auto-validating. Auto-validating process state models will return to the source process state model if a validation error is discovered.

description

Defines the description.

id

Defines the GUID of the model.

Valid inside <start-state /> are: <input-interface />, <output-interface />, <request-context />, <transition-list />

<start-state /> is valid inside: <process-state-set />

<subprocess-start-state />

Implements ProcessStartStateModel.

Attributes of <subprocess-start-state />
AttributeDescription
auto-validating

Defines whether the current process state model is auto-validating. Auto-validating process state models will return to the source process state model if a validation error is discovered.

description

Defines the description.

id

Defines the GUID of the model.

Valid inside <subprocess-start-state /> are: <input-interface />, <output-interface />, <request-context />, <transition-list />

<subprocess-start-state /> is valid inside: <process-state-set />

<transition />

Implements TransitionModel.

Attributes of <transition />
AttributeDescription
auto-validating

Defines whether the current transition model is auto-validating. Auto-validating transitions will return to the source process state model if a validation error is discovered.

description

Defines the description.

id

Defines the GUID of the model.

ignore-view-restrictions

Allows to ignore view restrictions.

name
relation-ref
target-state-ref

Sets the target process state model reference of the transition.

Valid inside <transition /> are: <execute-if />, <auto-complete-filter />, <read-only-if />, <with-filter />, <filter-restriction />, <filter-specification />, <visible-if />, <disabled-if />, <condition />, <validate-if />, <start-action-list />, <action-list />, <relation-chain />, <interface />, <confirmation />

<transition /> is valid inside: <transition-list />

<transition-list />

Implements TransitionListModel.

Attributes of <transition-list />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <transition-list /> is: <transition />

<transition-list /> is valid inside: <start-state />, <back-state />, <subprocess-start-state />, <view-state />, <decision-state />

<view-state />

A view state inside a process. When the view state is entered, the user is presented the view built from the corresponding ViewModel to show data or receive data changes from the user.

Attributes of <view-state />
AttributeDescription
auto-validating

Defines whether the current process state model is auto-validating. Auto-validating process state models will return to the source process state model if a validation error is discovered.

description

Defines the description.

id

Defines the GUID of the model.

view-ref

Defines the referenced view model ID.

Valid inside <view-state /> are: <request-context />, <transition-list />

<view-state /> is valid inside: <process-state-set />

<virtual-properties />

Implements VirtualPropertiesModel.

Attributes of <virtual-properties />
AttributeDescription
description

Defines the description.

expose-original-ids-of-domain-type-ref

Defines whether all original IDs can be referenced from the given domain object.

exposed-id-prefix

Defines the prefix for exposed IDs.

id

Defines the GUID of the model.

Valid inside <virtual-properties /> is: <virtual-property />

<virtual-properties /> is valid inside: <scoped-domain-object-list />, <filtered-list />, <scoped-domain-object />

<virtual-property />

Implements VirtualPropertyModel.

Attributes of <virtual-property />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

property-ref

Defines the target property model ID.

<virtual-property /> is valid inside: <virtual-properties />

Chapter 70. Restrictions

<error-message-mapping />

Implements ErrorMessageMappingModel.

Attributes of <error-message-mapping />
AttributeDescription
content-element-ref
description

Defines the description.

id

Defines the GUID of the model.

source-tag
target-tag

<error-message-mapping /> is valid inside: <error-message-mapping-set />

<error-message-mapping-set />

Implements ErrorMessageMappingSetModel

See also:

  • ErrorMessageMappingModel

Attributes of <error-message-mapping-set />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <error-message-mapping-set /> is: <error-message-mapping />

<error-message-mapping-set /> is valid inside: <portal />

<filter-restriction />

Defines the "filter-restriction" FilterSpecificationModel that uses a filter to describe a restriction. It returns true if the restriction is satisfied.

Attributes of <filter-restriction />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <filter-restriction /> are: <greater-than />, <is-property-modified />, <and />, <geo-within />, <matches />, <user-logged-in />, <validation-failed />, <complies-to />, <criterion />, <less-than-or-equal-to />, <has-current-element />, <is-undefined />, <has-changed />, <or />, <is-connected-to />, <can-access />, <ends-with />, <geo-contains />, <has-permission />, <contains-comparator />, <starts-with />, <not />, <equals />, <is-new />, <has-elements />, <dynamic-condition />, <true />, <less-than />, <in />, <include />, <in-transition />, <filter-pattern />, <has-type />, <greater-than-or-equal-to />, <is-super-user />, <false />, <is-defined />, <filter-pattern-set />

<filter-restriction /> is valid inside: <external-excel-domain-type />, <external-relational-domain-type />, <count />, <filter-specification-set />, <joined-domain-type />, <constant-domain-type />, <start-action-list />, <external-excel-domain-type />, <external-relational-domain-type />, <joined-domain-type />, <constant-domain-type />, <domain-type />, <wfs-domain-type />, <request-context />, <radio-buttons />, <restriction />, <multi-connect />, <tree-connect />, <transition />, <list-iterator />, <case />, <wfs-domain-type />, <multi-connect />, <single-connect />, <relation-reference />, <has-elements />, <filtered-list />, <agent-action />, <datagrid />, <start-action-list />, <action-list />, <radio-buttons />, <select-field />, <request-context />, <cell-format />

<restriction />

Manages a restriction with error tag.

[Note]Note

Using self and valueself, see . If you define a restriction within a property definition, you can access the current value of this property by using the variable value, see . Additionally you can use the variable self to access the domain object.

You can specify restrictions for properties:
 <domain-type-property ...>
      <restriction-set>
          <restriction error-tag="validation.length_has_to_be_smaller_than_six">
              value == null || value.length() &lt; 6
          </restriction>
          ...
      </restriction-set>
 </domain-type-property>
 
Restrictions for domain types:
 <domain-type>
     <restriction-set>
         <restriction error-tag="validation.abc_is_not_null">
             self.abc == null
         </restriction>
         ...
     </restriction-set>
 </domain-type>
 
Using a restriction validator bean:
 <restriction-set>
     <restriction error-tag="validation.abc_is_not_null"
         restriction-bean-name="maximumTextLengthRestrictionValidator"/>
     ...
 </restriction-set>
 

Attributes of <restriction />
AttributeDescription
description

Defines the description.

error-tag

The error tag that is used if the restriction is invalid.

id

Defines the GUID of the model.

language

The scripting language that the restriction is written in. If you don't specify a language, the default scripting language Groovy is used.

required

Defines the required flag.

restriction-bean-name

The bean that validates the restriction. Has to implement the interface RestrictionValidator.

restriction-ref

Defines a restriction reference.

severity

Defines the restriction severity.

type

Defines the restriction type.

Valid inside <restriction /> are: text content, <validate-if />, <filter-restriction />

<restriction /> is valid inside: <restriction-set />

<restriction-set />

The restriction set contains a set of restrictions. Each restriction defines a Boolean expression that results in a Boolean value (which can either be true or false). The restriction is valid if the result is true. You can specify the restriction in any scripting language that is supported by OpenSAGA or you can implement your own restriction validator in JAVA. See the section called “<restriction />” for more information and some example restrictions.

Attributes of <restriction-set />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <restriction-set /> is: <restriction />

<restriction-set /> is valid inside: <external-excel-domain-type />, <process />, <external-relational-domain-type />, <joined-domain-type />, <constant-domain-type />, <external-excel-domain-type />, <external-relational-domain-type />, <joined-domain-type />, <constant-domain-type />, <domain-type />, <wfs-domain-type />, <request-context />, <property-type />, <wfs-domain-type />, <domain-type-property />, <enum-property />, <validate />, <portal />, <view />, <request-context />, <formula-property />

<validate-if />

Defines a "validate-if" FilterSpecificationModel that determines if a restriction should be validated.

Attributes of <validate-if />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <validate-if /> are: <greater-than />, <is-property-modified />, <and />, <geo-within />, <matches />, <user-logged-in />, <validation-failed />, <complies-to />, <criterion />, <less-than-or-equal-to />, <has-current-element />, <is-undefined />, <has-changed />, <or />, <is-connected-to />, <can-access />, <ends-with />, <geo-contains />, <has-permission />, <contains-comparator />, <starts-with />, <not />, <equals />, <is-new />, <has-elements />, <dynamic-condition />, <true />, <less-than />, <in />, <include />, <in-transition />, <filter-pattern />, <has-type />, <greater-than-or-equal-to />, <is-super-user />, <false />, <is-defined />, <filter-pattern-set />

<validate-if /> is valid inside: <external-excel-domain-type />, <external-relational-domain-type />, <count />, <filter-specification-set />, <joined-domain-type />, <constant-domain-type />, <start-action-list />, <external-excel-domain-type />, <external-relational-domain-type />, <joined-domain-type />, <constant-domain-type />, <domain-type />, <wfs-domain-type />, <request-context />, <radio-buttons />, <restriction />, <multi-connect />, <tree-connect />, <transition />, <list-iterator />, <case />, <wfs-domain-type />, <multi-connect />, <single-connect />, <relation-reference />, <has-elements />, <filtered-list />, <agent-action />, <datagrid />, <start-action-list />, <action-list />, <radio-buttons />, <select-field />, <request-context />, <cell-format />

Chapter 71. Scoped Object and List Models

<scoped-domain-object />

Implements ScopedDomainObjectModel.

Attributes of <scoped-domain-object />
AttributeDescription
description

Defines the description.

domain-type-ref

Defines a reference to a domain type model.

id

Defines the GUID of the model.

name

Defines the name for the cached object.

Valid inside <scoped-domain-object /> is: <virtual-properties />

<scoped-domain-object /> is valid inside: <session-context />, <conversation-context />, <domain-context />, <process-context />

<scoped-domain-object-list />

Implements ScopedDomainObjectListModel.

Attributes of <scoped-domain-object-list />
AttributeDescription
description

Defines the description.

domain-type-ref
id

Defines the GUID of the model.

Valid inside <scoped-domain-object-list /> is: <virtual-properties />

<scoped-domain-object-list /> is valid inside: <session-context />, <conversation-context />, <domain-context />, <process-context />

<scoped-domain-object-list-ref />

Implements ScopedDomainObjectListReferenceModel.

Attributes of <scoped-domain-object-list-ref />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

list-ref

Defines the list.

property-ref

Defines the property.

<scoped-domain-object-list-ref /> is valid inside: <in />

<scoped-domain-object-ref />

Attributes of <scoped-domain-object-ref />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

object-ref (required)

Defines the object.

property-ref (required)

Defines the property.

<scoped-domain-object-ref /> is valid inside: <in />

Chapter 72. Rest Service Models

<rest-service />

Implements the RestServiceModel.

Attributes of <rest-service />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

script

Defines the script to execute

script-resource

Defines the path to the script to execute.

scripting-dialect

Defines the dialect of the script.

url

Defines the url for this rest service.

using-script-dialect-dir

Defines whether the script resource path is relative to the script dialect directory or not.

<rest-service /> is valid inside: <rest-services />

<rest-services />

Implements the RestServicesModel.

Attributes of <rest-services />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <rest-services /> is: <rest-service />

<rest-services-reference />

Implements the RestServicesReferenceModel.

Attributes of <rest-services-reference />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

rest-services-ref

Defines the rest services model ID.

<rest-services-reference /> is valid inside: <rest-services-reference-set />

<rest-services-reference-set />

The REST service reference set contains references to all REST services that can be used in the portal. For each REST service a rest-services-reference element with the attribute rest-service-ref has to be defined. This attribute refers to a REST service model, see Chapter 25, REST Services.

Example 72.1. REST Service Reference Set Definition

 <rest-services-reference-set>
     <rest-services-reference rest-services-ref="portal.r_test"/>
     ...
 </rest-services-reference-set>

Attributes of <rest-services-reference-set />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <rest-services-reference-set /> is: <rest-services-reference />

<rest-services-reference-set /> is valid inside: <portal />

Chapter 73. Staging Models

<attachment-configuration />

Implements AttachmentConfigurationModel.

Attributes of <attachment-configuration />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

path

Returns path to the attachment base directory.

<attachment-configuration /> is valid inside: <attachment-configuration-set />

<attachment-configuration-set />

Implements AttachmentConfigurationSetModel.

Attributes of <attachment-configuration-set />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <attachment-configuration-set /> is: <attachment-configuration />

<attachment-configuration-set /> is valid inside: <stage />

<content-source />

Implements ContentSourceModel.

Attributes of <content-source />
AttributeDescription
base-content-url

Defines the base content url.

description

Defines the description.

id

Defines the GUID of the model.

name

Defines the name of this content source.

site-map-path

Defines the sitemap path.

type

Defines the type of this content source.

<content-source /> is valid inside: <content-source-set />

<content-source-set />

Implements ContentSourceSetModel.

Attributes of <content-source-set />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <content-source-set /> is: <content-source />

<content-source-set /> is valid inside: <stage />

<data-source />

Each data source has a name and a type. The name is referenced by the domain type that uses the data source. The type attribute specifies the data source type. See the section called “Data Source Types” for a list of supported types.

The data source configuration is specified by using a settings set that contains setting definitions. Each setting consists of a parameter name (name attribute) and a parameter value ( value attribute). If you want to use encrypted values, you have to specify a decryption-bean-name that refers to a configured decryption bean. See for more information.

Choosing the correct database schema export mode

This section describes how to choose the correct database schema export mode for Hibernate. The mode is set by the configuration parameter hibernate.hbm2ddl.auto. The valid values are: create, create-drop, update and validate. If this parameter is not set, Hibernate does not export the schema, i.e. no database tables are created or validated. Missing tables and/or missing/mismatching column types are only detected at runtime.

create

Hibernate creates a new database schema. All tables included in this schema are dropped (if they existed before) and created again. On every OpenSAGA startup you start with a new database. Tables not included in the Hibernate schema are ignored.

[Caution]Caution

Never use this mode in a production environment. You will probably loose all your data. He who laughs last has a backup.

create-drop

In addition to the create mode, all tables that were created by Hibernate are dropped if the SessionFactory is closed.

[Caution]Caution

This mode is even more critical than the create mode but may be useful in some testing scenarios.

update

This is the preferred mode for development. If you add new domain types or domain type properties, the database is updated accordingly. If you delete domain types or domain type properties, the corresponding tables/columns are not deleted from the database.

[Important]Important

If you change the type of domain type properties, the corresponding database column is not changed. This can lead to strange errors or confusion. To prevent this from happening, you have to make sure that the database table is changed in the same way that you have changed the property (either by modifying/deleting the database columns or by deleting the whole table).

validate

This is the preferred mode for deployment. The database schema is validated in the OpenSAGA startup phase. If there are any mismatches (e.g. missing columns or wrong column types) the startup is stopped and an appropriate error message is logged.

Attributes of <data-source />
AttributeDescription
data-source-bean-name

Defines the data source bean name.

database-type

Defines the database type.

description

Defines the description.

id

Defines the GUID of the model.

name

Defines the data source name.

time-zone

Defines the data source time zone.

type

Defines the data source type.

Valid inside <data-source /> is: <settings />

<data-source /> is valid inside: <data-source-set />

<data-source-set />

Implements DataSourceSetModel.

Attributes of <data-source-set />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <data-source-set /> is: <data-source />

<data-source-set /> is valid inside: <stage />

<logging-configuration />

Implements LoggingConfigurationModel.

Attributes of <logging-configuration />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

location

Valid inside <logging-configuration /> is: text content

<logging-configuration /> is valid inside: <stage />

<mail-service-configuration />

Implements MailServiceConfigurationModel.

Attributes of <mail-service-configuration />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

name

Defines the mail service configuration name.

strategy-bean-ref

Defines the strategy bean reference.

type

Defines the mail service configuration type.

Valid inside <mail-service-configuration /> is: <settings />

<mail-service-configuration /> is valid inside: <mail-service-configuration-set />

<mail-service-configuration-set />

Implements MailServiceConfigurationSetModel.

Attributes of <mail-service-configuration-set />
AttributeDescription
default-mail-service

Sets the default mail service.

description

Defines the description.

id

Defines the GUID of the model.

Valid inside <mail-service-configuration-set /> is: <mail-service-configuration />

<mail-service-configuration-set /> is valid inside: <stage />

<proxy-configuration />

It is possible to use a proxy for all outgoing http connections of OpenSAGA. Therefore you have just to define a proxy configuration model within the stage model (see the section called “<stage />”) with the data of the proxy. The following example shows how to configure a proxy.

Example 73.1. Configure a proxy for OpenSAGA

 <stage name="dev-example">
     ...
     <proxy-configuration>
         <settings>
             <setting name="host" value="proxy.myserver.de" />
             <setting name="port" value="8000" />
             <setting name="user" value="Foo" />
             <setting name="password" value="Bar" />
         </settings>
     </proxy-configuration>
     ...
 </stage>

Internally the values are set in the following way:
 System.setProperty("http.proxyHost", proxyConfigurationModel.getHost());
 System.setProperty("http.proxyPort", proxyConfigurationModel.getPort());
 System.setProperty("http.proxyUser", proxyConfigurationModel.getUser());
 System.setProperty("http.proxyPassword", proxyConfigurationModel.getPassword());
 
TODO: missing table

Attributes of <proxy-configuration />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <proxy-configuration /> is: <settings />

<proxy-configuration /> is valid inside: <stage />

<security-configuration />

Implements SecurityConfigurationModel.

Attributes of <security-configuration />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

user-details-service-bean-name

Defines the user details service bean name.

<security-configuration /> is valid inside: <stage />

<stage />

The stages model contains a set of stage definitions. The stages that are used by the portal can either be defined by the startup parameter OPENSAGA_STAGES or by using the configuration file opensaga-project.cfg. See the section called “Configuring the deployment stage for the server” for more information.

Example 73.2. A single stage definition

 <stage name="dev-example">
   <data-source-set>
     <data-source name="portaldb" type="opensaga-hibernate">
       <settings>
         <setting name="driverClassName" value="org.postgresql.Driver"/>
         ...
         <setting name="password" value="iGro1tWHHIXupoiW57hsIg=="
                                  decryption-bean-name="aesDecrypter"/>
         <setting name="bean.dataBaseNamingStrategy" value="postgres"/>
         ...
         <setting name="hibernate.dialect"
                  value="org.hibernatespatial.postgis.PostgisDialect"/>
         ...
         <setting name="c3p0.initialPoolSize" value="3"/>
         ...
       </settings>
     </data-source>
   </data-source-set>
 </stage>

The stage name (in this example dev-example) is defined by the attribute name.

[Note]Note

Some technical details: the stage models of all selected stages are merged in the usual way. To get a list of all specified stage models you can use the findStageSetModel method in the ModelInformationService or retrieve it from the PortalModel. To make it easier for you to find a specific setting in the list of stage models, you can use the StagingService. This service internally merges all stages models (again, using the same algorithm!) into a single merged stage model. In most cases you will probably use the StagingService. If you need more details about each stage, you can use the methods discussed above.

The Data Source Model

Each stage definition contains a set of data sources. For example the portaldb data source that is the default one for all domain types. Above you can find an example of a data source definition ( Example 16.18, “A single stage definition”). Each data source has a name and a type. The name is referenced by the domain type that uses the data source. The type attribute specifies the data source type. See the section called “Data Source Types” for a list of supported types.

For more information see the section called “<data-source />”.

The Proxy Configuration Model

For information see the section called “<proxy-configuration />”

Attributes of <stage />
AttributeDescription
debug-console
description

Defines the description.

development-mode

Defines the development mode.

disable-js-on-server-side
i18n-disabled

Defines the flag indicating if the translations (I18N) are disabled.

id

Defines the GUID of the model.

name

Defines the model name.

page-delay

Sets the page delay.

Valid inside <stage /> are: <data-source-set />, <mail-service-configuration-set />, <logging-configuration />, <attachment-configuration-set />, <content-source-set />, <proxy-configuration />, <security-configuration />

<stage /> is valid inside: <stages />

<stages />

The stages model contains a set of stage definitions. The stages that are used by the portal can either be defined by the startup parameter OPENSAGA_STAGES or by using the configuration file opensaga-project.cfg. See the section called “Configuring the deployment stage for the server” for more information.

Attributes of <stages />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <stages /> is: <stage />

Chapter 74. Value Models

<constant />

The following expression defines a constant value:

<constant value="true"/>

Values are logical values (Chapter 7, Defining Logical Values For Properties). The following attributes are supported for constant.

Attributes of <constant />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

value

Defines the constant value.

value-provider-bean

Defines a Spring configured bean ID for a bean of Type org.opensaga.runtime.model.domain.properties.PropertyValueProvider which then is responsible for converting the default-value attribute value to a real value. OpenSAGA also provides some default implementations for specific template based value providers (Chapter 8, Property Value Providers).

<constant /> is valid inside: <greater-than />, <geo-within />, <parameters />, <less-than-or-equal-to />, <is-undefined />, <ends-with />, <geo-contains />, <contains-comparator />, <case />, <starts-with />, <equals />, <constant-data />, <less-than />, <in />, <greater-than-or-equal-to />, <is-defined />

<count />

Implements CountValueModel.

Attributes of <count />
AttributeDescription
description

Defines the description.

domain-type-ref (required)

Defines the domain type model reference.

id

Defines the GUID of the model.

Valid inside <count /> are: <execute-if />, <auto-complete-filter />, <read-only-if />, <with-filter />, <filter-restriction />, <filter-specification />, <visible-if />, <disabled-if />, <condition />, <validate-if />

<count /> is valid inside: <greater-than />, <geo-within />, <parameters />, <less-than-or-equal-to />, <is-undefined />, <ends-with />, <geo-contains />, <contains-comparator />, <starts-with />, <equals />, <less-than />, <greater-than-or-equal-to />, <is-defined />

<current-property-value />

Implements CurrentPropertyReferenceValueModel.

Attributes of <current-property-value />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

property-ref

Defines the reference to a property in the current runtime context.

<current-property-value /> is valid inside: <greater-than />, <geo-within />, <parameters />, <less-than-or-equal-to />, <is-undefined />, <ends-with />, <geo-contains />, <contains-comparator />, <case />, <starts-with />, <equals />, <less-than />, <in />, <greater-than-or-equal-to />, <is-defined />

<geo-point />

Implements GeoPointValueModel.

Attributes of <geo-point />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

value-provider-bean

Defines a Spring configured bean ID for a bean of Type org.opensaga.runtime.model.domain.properties.PropertyValueProvider which then is responsible for converting the default-value attribute value to a real value. OpenSAGA also provides some default implementations for specific template based value providers (Chapter 8, Property Value Providers).

<geo-point /> is valid inside: <greater-than />, <geo-within />, <parameters />, <less-than-or-equal-to />, <is-undefined />, <ends-with />, <geo-contains />, <contains-comparator />, <case />, <starts-with />, <equals />, <constant-data />, <less-than />, <in />, <greater-than-or-equal-to />, <is-defined />

<geo-polygon />

Implements GeoPolygonValueModel.

Attributes of <geo-polygon />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

value-provider-bean

Defines a Spring configured bean ID for a bean of Type org.opensaga.runtime.model.domain.properties.PropertyValueProvider which then is responsible for converting the default-value attribute value to a real value. OpenSAGA also provides some default implementations for specific template based value providers (Chapter 8, Property Value Providers).

<geo-polygon /> is valid inside: <greater-than />, <geo-within />, <parameters />, <less-than-or-equal-to />, <is-undefined />, <ends-with />, <geo-contains />, <contains-comparator />, <case />, <starts-with />, <equals />, <constant-data />, <less-than />, <in />, <greater-than-or-equal-to />, <is-defined />

<parameters />

Implements ParameterListModel.

Attributes of <parameters />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <parameters /> are: <count />, <constant />, <relation-count />, <size-of />, <current-property-value />, <geo-polygon />, <property />, <geo-point />

<parameters /> is valid inside: <system-log />

<property />

( Additional names: property-value )

Implements PropertyReferenceValueModel.

Attributes of <property />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

property-ref

Defines the reference to a property in the current runtime context.

<property-value />

( Additional names: property )

Implements PropertyReferenceValueModel.

Attributes of <property-value />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

property-ref

Defines the reference to a property in the current runtime context.

<property-value /> is valid inside: <greater-than />, <geo-within />, <parameters />, <less-than-or-equal-to />, <is-undefined />, <ends-with />, <geo-contains />, <contains-comparator />, <case />, <starts-with />, <equals />, <less-than />, <in />, <greater-than-or-equal-to />, <is-defined />

<relation-count />

Implements RelationCountValueModel.

Attributes of <relation-count />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

relation-ref

Defines the reference to another relation

scoped-domain-object-ref

Defines the scoped domain object reference.

Valid inside <relation-count /> is: <relation-chain />

<relation-count /> is valid inside: <greater-than />, <geo-within />, <parameters />, <less-than-or-equal-to />, <is-undefined />, <ends-with />, <geo-contains />, <contains-comparator />, <starts-with />, <equals />, <less-than />, <greater-than-or-equal-to />, <is-defined />

<size-of />

Implements SizeOfValueModel.

Attributes of <size-of />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

scoped-domain-object-list-ref

Defines the ID of the referenced cached domain object list.

<size-of /> is valid inside: <greater-than />, <geo-within />, <parameters />, <less-than-or-equal-to />, <is-undefined />, <ends-with />, <geo-contains />, <contains-comparator />, <starts-with />, <equals />, <less-than />, <greater-than-or-equal-to />, <is-defined />

Chapter 75. Web Service Models

Chapter 76. XML Transformation Models

<next-transformer />

Implements NextTransformerModel.

Attributes of <next-transformer />
AttributeDescription
condition

Defines the condition.

condition-bean

Defines the condition bean.

condition-script

Defines the condition script.

condition-scripting-dialect

Defines the condition scripting dialect.

description

Defines the description.

id

Defines the GUID of the model.

transformer-ref

Defines the transformer reference

<next-transformer /> is valid inside: <transformer />

<transformer />

Implements TransformerModel.

Attributes of <transformer />
AttributeDescription
condition

Defines the condition.

condition-bean

Defines the condition bean.

condition-script

Defines the condition script.

condition-scripting-dialect

Defines the condition scripting dialect.

description

Defines the description.

id

Defines the GUID of the model.

stop-condition

Defines the stop condition.

stop-condition-bean

Defines the stop condition bean.

stop-condition-script

Defines the stop condition script.

stop-condition-scripting-dialect

Defines the condition scripting dialect.

transformation

Defines the transformation ressource

transformation-bean

Defines the transformation bean

transformation-script

Defines the transformation script

transformation-scripting-dialect

Defines the transformation scripting dialect.

Valid inside <transformer /> is: <next-transformer />

<transformer /> is valid inside: <transformer-list />

<transformer-list />

Implements TransformerListModel.

Attributes of <transformer-list />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

type

Defines the type of the transformations.

Valid inside <transformer-list /> is: <transformer />

<transformer-list /> is valid inside: <transform />

Chapter 77. Miscellaneous Models

<setting />

Implements SettingModel.

Attributes of <setting />
AttributeDescription
bean-ref

Defines the beanReference.

decryption-bean-name

Defines the decription bean name.

description

Defines the description.

id

Defines the GUID of the model.

name

Defines the model name.

value

Defines the value.

<setting /> is valid inside: <settings />

<settings />

Defines a set of setting models.

Attributes of <settings />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <settings /> is: <setting />

<settings /> is valid inside: <proxy-configuration />, <data-source />, <mail-service-configuration />

<ui-component-setting />

Implements UiComponentSettingModel.

Attributes of <ui-component-setting />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

name

Defines the name.

value

Defines the value.

<ui-component-setting /> is valid inside: <ui-component-setting-set />

<ui-component-setting-set />

This set contains settings for UI components. Each setting consists of a name and value.

Example 77.1. UI Component Setting Set

 <ui-component-setting-set>
     <ui-component-setting name="domaincontextpath.display" value="true"/>
     <ui-component-setting name="domaincontextpath.length" value="5"/>
     ...
 </ui-component-setting-set>

Attributes of <ui-component-setting-set />
AttributeDescription
description

Defines the description.

id

Defines the GUID of the model.

Valid inside <ui-component-setting-set /> is: <ui-component-setting />

<ui-component-setting-set /> is valid inside: <process />, <portal />, <view />