Plugins are reusable implementations of standard functionality. Plugins can be used in Portlets that need to provide the plugin’s functionality. The Gentics portlet has to register every plugin under a unique name (unique for the specific portlet). This pluginname is used as prefix for plugin parameters when they are defined in the portlet’s pnode.
The ViewPlugin is the core of the portal's visualisation engine. It is capable of rendering userinterfaces based on a XML userinterface definition, and small templates. Userinteraction is handled by an action layer.
View - is the definition of a dialog of an application. Technically it's a XML file based on a View-Schema, containing Components and PluggableActions.
Component - A Component is a visualisation element, either used for user input, presentation or interaction (e.g. a textfield, a list or a button). Technically Components are Java objects and nodes of the View XML Schema.
PluggableAction - A PluggableAction is used to execute any businesslogic in the userinterface and dynamicly interact with the user. Technically PluggableActions are Java objects and nodes of the View XML Schema.
The following Properties are provided by the ViewPlugin - usually accessible by portal.modules.<module id>.plugins.viewplugin. See “Portal Property Paths” (Section 8) for more information.
ViewPlugin parameters are used to configure the source for the XML View.
Table 4.12. ViewPlugin Parameters
Parameter | Type | Description |
---|---|---|
{pluginname}.views | Node | structure defining the views |
{pluginname}.viewbasedir | String | relative path to the base directory, where the views are defined in files - If it couldn't be found relative it is search absolute. - Can contain system properties. (See Section 2, “System properties”) |
The ViewPlugin supports two different modes of view configuration: inline (in the pnode) or external (every view is defined in a separate file). When the parameter {pluginname}.viewbasedir is given, views are defined externally and inline views are ignored, otherwise the views have to be defined with the parameter {pluginname}.views.
When a {pluginname}.viewbasedir is given, the directory is searched for view definitions. The given path is interpreted relative to the web-application’s home directory (e.g. …/webapps/Portal.Node/). Every .xml file in the directory is supposed to contain the definition of a single view. Additional parameters can be given in a single file views.properties.
The views.properties file has the following properties:
defaultview=myviewname
Example 4.5. View Parameters
This example shows how the viewplugin is configured for a portlet in the Section 4.4, “Gentics Portletdescriptor” .
<portlet> <portlet-name>DatasourceListExample</portlet-name> <parameter-description> <parameter-definition type="string" name="viewplugin.viewbasedir"> path of the view definitions </parameter-definition> </parameter-description> <start-parameters> <parameter name="viewplugin.viewbasedir">WEB-INF/views/list</parameter> </start-parameters> ... </portlet>
The ViewPlugin Templates are used to render the Views and their Components.
The plugin comes with a set of example templates. They come with the
Portal.Node webapp and are updated during productupdates. The
templatefiles can be found in the folders
${com.gentics.portalnode.home}/WEB-INF/templates/FormPlugin2
and ${com.gentics.portalnode.home}/WEB-INF/templates/ViewPlugin
respectively. They are referenced in the Gentics Portlet Descriptor
in ${com.gentics.portalnode.home}/WEB-INF/gentics-portlet.xml
.
If you want to customize any of those templates, transfer the template file to your portletapplication or portalserver configurationpath, add a templateloader in your Portal Configuration pointing to your template location. In case you want to customize the template for your whole portal, add a reference to your template in your Portal Configuration's template-section. If you want to customize the template only for one portlet, add it to the templates section of your Gentics Portlet Descriptor. See Section 8, “Portal Configuration File” for details on the Portal Configuration and Section 4.4, “Gentics Portletdescriptor” for details on the Gentics Portlet Descriptor. Please note, that it is currently not possible to define custom templates Portletapplication-wide.
The variables provided in every template are provided by the portal. See the Section Section 8, “Portal Property Paths” for details.
In addition component provides specific variables, see the Section Section 2.2.7, “Components” for further details.
Example 4.6. ViewPlugin Template Customisation Example
<portlet> ... <templates> <template loader="portalloader"> <classes> <class id="plugin">formplugin2</class> <class id="component">TextComponent</class> </classes> <parameters> <parameter id="filename">plugins/FormPlugin2/TextComponent.vm</parameter> </parameters> </template> ... </templates> </portlet>
View Templates are identifed via the classes section.
Example 4.7. Syntax of View Template Classes
<classes> <class id="plugin">ViewPlugin</class> <class id="windowstate">...</class> </classes>
Table 4.13. View Template Classes
Class | Required | Description |
---|---|---|
plugin | x | Must be set to "ViewPlugin". |
windowstate | x | Windowstate for which the template is used.
Must be one of normal ,
maximized . |
Customizing templates for specific windowstates can for
example be used to show one specific view in the windowstate
normal
and other views in the windowstate
maximized
.
The form template is classified by the following classes section and renders the <form> tag.
Example 4.8. Syntax of Form Template Classes
<classes> <class id="plugin">formplugin2</class> <class id="form">...</class> <class id="class">...</class> </classes>
Table 4.14. Form Template Classes
Class | Required | Description |
---|---|---|
plugin | x | Must be set to "formplugin2". |
form | Id of the rendered form (view). Templates with a form set will never be used for forms that have other ids. | |
class | Class of the form (view). Templates with a
class set will only
be used for forms that have the same
class
setting. |
When a form is rendered, the "best matching" template is used for rendering. A template is matching for a specific form, when it’s classes definition is exactly one of the following combinations (order defines priority):
plugin + form + class
for all forms with the given id and class.
plugin + form
for all forms with the given id.
plugin + class
for all forms with the given class.
plugin
for all forms. this is the most general form template
Table 4.15. Template Variables for Form Templates
Name | Type | Description |
---|---|---|
$portal | Object | Main portal object. See Section 8, “Portal Property Paths” . |
$form | Object | The form object. |
$form.name | String | The current form name, as used in the output. |
$form.enctype | String | The encoding type of the form (should be used for <form enctype="">). |
$form.error | Boolean | True when one of the form components contains an input error, false if not. |
$form.components | Collection of objects | Collection of all components in the form. |
$form.properties | Map of objects | Map of all custom view properties. |
$component in $form.components | Objects | Information object for a component in the form. Note that this object cannot be used to get input data from the component. |
$component.id | String | The id of the component. |
$component.type | String | The type like "tabcollection". |
$component.optional | Boolean | Whether this component must contain a value. |
$component.visible | Boolean | Whether this component is visible. Invisible components are automaticaly not rendered. |
$component.enabled | Boolean | Whether this component is enabled, and may be interacted with. |
$component.label | String | Readable label. |
$component.help | String | Help content for the current component. |
$component.error | Boolean | True if the current component has invalid content. |
$component.errortext | String | Errortext for the current component if error. |
$component.focusedfield | String | Name of the focused component field or null if the component is not focused. |
$component.focused | Boolean | True when the component is focused, false if not. Only one component per form can be focused. |
$component.focus | Boolean | Alias for $component.focused |
$component.properties | Map | List of custom component properties. |
$content | String | Rendered content of the form. |
$actionurl | String | Action url of the form. Posting data to this url will submit the form. |
Component Templates are identified via the classes section. Each component template may be specialized by adding specific class restrictions. Following classes are available for all templates, some of them are required within some special templates.
Example 4.9. Syntax of Component Template Classes
<classes> <class id="plugin">formplugin2</class> <class id="component">...</class> <class id="form">...</class> <class id="class">...</class> <class id="id">...</class> </classes>
![]() | Note |
---|---|
Please note that "plugin" is always set to "formplugin2", even though templates are defined for the ViewPlugin since the ViewPlugin internally utilizes the FormPlugin2 to render components. |
Table 4.16. Component Template Classes
Class | Required | Description |
---|---|---|
plugin | x | Must be set to "formplugin2". |
component | x | Must be set to the type of the component. Identifies the template to belong to a specific component type (e.g. "TextComponent", ...). |
form | Id of the form (view) this component shall be used. Templates with a form set will never be used for forms that have other ids. | |
class | Components class. Template with a
class set will only
be used for components that have the same
class
setting. | |
id | Id of the component. Templates with a component id set will only be used for components (typically only one) with that id. |
When a component is rendered, the "best matching" template is used for rendering. A template is matching for a specific component, when it’s classes definition is exactly one of the following combinations (order defines priority):
plugin + component + form + id
for the one component of the given type in the form and the given id. This is the most special template for a specific component.
plugin + component + form + class
for all components of the given type and class in the given form.
plugin + component + form
for all components of the given type in the form.
plugin + component + id
for all components of the given type and the id (in all forms).
plugin + component + class
for all components of the given type and class (in all forms).
plugin + component
for all components of the given type. This is the most general template.
It is possible to create an action URL within every Plugin template which triggers an event which can be used together with a reaction. (See Section 11.1, “Portaltemplate”)
Example 4.10. Custom Action URL in Template
#set( $url = $javax.portlet.response.createActionURL() ) $url.setParameter( "action", "myEvent" ) $url.setParameter( "myParameter", "some value" ) <a href="$url">Some URL</a><br/>
If this code is in a component template, e.g. of a TextComponent in a pnode with 'TestPortlet' the path for the reaction would be: portal.modules.TestPortlet.plugins.formplugin2.onMyEvent. Custom parameters may also be accessed via event.properties.*
The View XML file is based on the XML Schema pn4doc_views.xsd and can currently be found in the Gentics .Node® Infoportal.
When defining a View XML it already has an embedded 'ListComponent' which is used to define the initial layout of the view. All components within a view are layed out using the template for a ListComponent.
By default the view files are checked for modifications on each access in Gentics Portal.Node SDK installations. To improve performance you can disable this behaviour with the portal.viewplugin.checkviewchanges parameter. See “ViewPlugin Configuration” (Section 8.2.11) for more information.
Example 4.11. Syntax Views
<view id="" class="" label="" doubleclickprotection="" xmlns="http://www.gentics.com/xml/ns/portal/view"> <onload> <actions> ... </actions> </onload> <onview> <actions> ... </actions> </onview> <callableactions> <callableaction id=""> <actions> ... </actions> </callableaction> </callableactions> <properties> <property id="..">...</property> ... </properties> ... </view>
Table 4.17. Settings Views
Name | Type | Default | Description |
---|---|---|---|
id | String | (required) | Identifier for the view, must be unique in this viewbasedir. |
class | String | NULL | Identifier for class used for the embedded ListComponent (This allows you to use different templates depending on the views class). |
label | String | NULL | Label of the view |
doubleclickprotection | Boolean | NULL |
With this flag, the portal-wide or
ViewPortlet-wide setting for the
double-click protection can be
overwritten for a specific view. The
default is to not overwrite the setting
(which would default to
|
xmlns | String | NULL | can be set to http://www.gentics.com/xml/ns/portal/view to enable autocompletion and syntax checking when the view is edited in Gentics Portal.Node SDK |
onload | Node | NULL | Container for Pluggable Actions that shall be done once for every user session. The actions will be performed when the view is rendered the first time. For details on Pluggable Actions see Section 2.2.8, “Pluggable Actions” |
onview | Node | NULL | Container for Pluggable Actions that shall be done whenever the view is rendered. When a view is shown more than once in the same portal page, the actions are only performed once. For details on Pluggable Actions see Section 2.2.8, “Pluggable Actions” |
callableactions | Node | NULL | Container for Callable Actions that can be executed using AJAX requests by the browser. |
callableaction | Node | NULL | A Callable Action which can be called by the browser using an AJAX request. |
callableaction.id | String | (required) | The identifier of the Callable Action. |
callableaction.actions | Node | NULL | Container for Pluggable Actions that are executed whenever the Callable Action is called. For details on Pluggable Actions see Section 2.2.8, “Pluggable Actions”. Special Pluggable Actions are used to define the return value that is sent to the client, see Section 2.2.8.19, “PlainCallableActionResponseAction”, Section 2.2.8.16, “JsonCallableActionResponseAction” and Section 2.2.8.3, “BinaryCallableActionResponseAction” |
properties | Node | NULL | Container for all custom view properties to be initially set to this view. |
Table 4.18. Template Variables for Views
Name | Type | Description |
---|---|---|
$views | List | All defined views. See Section 8.2, “Views” |
$activeview | Object | Currently active view object. See Section 8.2, “Views” |
$form | String | The rendered content of the currently active view. |
All components have some basic properties to define their templates and settings. Id and class are available for every component, and are not listed within each component description.
Example 4.12. Syntax All Components
<{component} id="" class=""> <label></label> <optional>[<prule></prule>]</optional> <visible>[<prule></prule>]</visible> <enabled>[<prule></prule>]</enabled> <help></help> <properties> <property id="[key]">[value]</property> <property id="[key]">[value]</property> ... </properties> </{component}>
Table 4.19. Settings All Components
Name | Type | Default | Description |
---|---|---|---|
id | String | NULL | Id of this component. Can be used in template properties to define a template for a specific component. |
class | String | NULL | Class of this component. The class can be used to group components of the same type to use the same template. |
label | String | {required} | Readable label. The label should be the i18n key of the real labels in the dictionaries for multilanguage support. |
optional | Boolean or prule | TRUE | Whether this component is optional or not. Components that are not optional must be filled in order to successfully submit the whole form and will produce an error if not filled. |
visible | Boolean or prule | TRUE | Whether this component is visible or not. |
enabled | Boolean or prule | TRUE | Whether this component is enabled or disabled. Disabled components show their values but cannot be modified by the user. |
help | String | NULL | Help content for the current component (i18n key). |
clearErrors | String | NULL | Set to "true" to clear previous errors. |
properties | List | NULL | List of custom properties of the component. The properties can be read in the components template. |
Optional, visible and enabled may contain <prule>s, that can resolve the base objects "portal.*", "view.*", "views.*" and "module.*". See Section 8, “Portal Property Paths” for details on property paths.
Table 4.20. Template Variables for All Components
Name | Type | Description |
---|---|---|
$portal | Object | Main portal object. See Section 8, “Portal Property Paths” . |
$module | Object | The current portlet in which the component is rendered. See Section 8.3, “Modules”. |
$form | Object | Main form object. |
$form.name | String | The current form name, as used in the output. |
$component | Object | The current component. |
$component.id | String | The id of the component. |
$component.type | String | The type like "tabcollection". |
$component.optional | Boolean | Whether this component must contain a value. |
$component.visible | Boolean | Whether this component is visible. Invisible components are automaticaly not rendered. |
$component.enabled | Boolean | Whether this component is enabled, and may be interacted with. |
$component.label | String | Readable label. |
$component.help | String | Help content for the current component. |
$component.error | Boolean | True if the current component has invalid content. |
$component.errortext | String | Errortext for the current component if error. |
$component.focusedfield | String | Name of the focused component field or null if the component is not focused. |
$component.focused | Boolean | True when the component is focused, false if not. Only one component per form can be focused. |
$component.focus | Boolean | Alias for $component.focused |
$component.properties | Map | List of custom component properties. |
These components are used to enter data of any kind (e.g. text, files, options).
Buttons used to handle forms or fields.
Example 4.13. Syntax ButtonComponent
<buttoncomponent> <errorcheck component=""></errorcheck> <actions>...</actions> </buttoncomponent>
Table 4.21. Settings ButtonComponent
Name | Type | Default | Description |
---|---|---|---|
errorcheck | Boolean | false | Whether the button shall check components for errors upon submit. |
errorcheck.component | String | root component of the form | Id of the component were errorchecking shall be started |
actions | Node | NULL | Container for pluggable actions that shall be triggered by the buttoncomponent. See Section 2.2.8, “Pluggable Actions” |
A ButtonComponent renders a button. For the button is stored in a list, but only one button exists.
![]() | Note |
---|---|
When errorchecking is used for a ButtonComponent, there are some things the implementor has to care about:
|
Table 4.22. Template Variables for ButtonComponent
Name | Type | Description |
---|---|---|
$component.buttons | List | List containing the button. |
$button IN $component.buttons | Object | The button. |
$button.label | String | Readable label of the button |
$button.enabled | Boolean | If button is enabled and clickable or not. |
$button.name | String | Unique identifier of this button. |
$button | String | Placeholder for rendering the button (deprecated). |
ButtonComponent Example:
The example illustrates the usage of this component.Component which can be used to verify that the current user is no robot. (Currently displays a simple text captcha.)
Table 4.24. Template Variables for CaptchaComponent
Name | Type | Description |
---|---|---|
$component.captchaurl | Resource URL | The resource URL under which the captcha can be retrieved. |
$component.captchawidth | Integer | Width of the captcha image in px. |
$component.captchaheight | Integer | Height of the captcha image in px. |
$component.name | String | Internal name of the component, used as html property. |
Component used to display a checkbox.
Example 4.15. Syntax CheckboxComponent
<checkboxcomponent> <truevalue></truevalue> <falsevalue></falsevalue> </checkboxcomponent>
Table 4.26. Settings CheckboxComponent
Name | Type | Default | Description |
---|---|---|---|
truevalue | String | true | Value that will be assigned if checkbox is checked |
falsevalue | String | false | Value that will be assigned if checkbox is unchecked |
Table 4.27. Template Variables for CheckboxComponent
Name | Type | Description |
---|---|---|
$component.selected | Boolean | True if checkbox is selected. |
CheckboxComponent Example:
The example illustrates the usage of this component.A single or multi selectcomponent with Resolvables matching the given rule.
![]() | Note |
---|---|
Altough this component can be used with every datasource, you should make sure that all requirements for the used datasource are provided. For example “Datasources of type |
Example 4.16. Syntax DatasourceSelectComponent
<datasourceselectcomponent> <datasource></datasource> <rule></rule> <nameattribute></nameattribute> <valueattribute></valueattribute> <multivalue></multivalue> <sortby></sortby> <sortorder></sortorder> </datasourceselectcomponent>
Table 4.28. Settings DatasourceSelectComponent
Name | Type | Default | Description |
---|---|---|---|
datasource | String | default datasource of the portlet | Datasource to use for the objects |
rule | String | NULL | Rule to filter the shown objects. The currend object can be accessed via the "object" keyword when assembling rules. |
nameattribute | String | (required) | Attribute to be shown in the select box |
valueattribute | String | NULL | Attribute to be used as values of the selected objects. When this setting is used, the component will return the referenced attribute values of the selected objects. Otherwise the component will return the selected objects themselves. |
multivalue | Boolean | false | Whether multiple values can be selected. |
sortby | String | NULL | Attributes by which the objects are sorted |
sortorder | String | ASC | sortorder ASC for ascending, DESC for descending |
Table 4.29. Template Variables for DatasourceSelectComponent
Name | Type | Description |
---|---|---|
$component.multivalue | Boolean | Whether the component allows selection of multiple values |
$component.name | String | Internal name of the component, used as html property. |
$component.items | List | All options. |
$item IN $component.items | Object | Item object. |
$item.object | Object | Resolvable object of this item. |
$item.object(.*) | Object | Properties of the Resolvable object. |
$item.selected | Boolean | True if current item is selected. |
$item.name | String | Displayname of the item. Note: when the name is found in a dictionary, the translated String is rendered here. If this behaviour is not desired, implementations may use $item.nameKey instead. |
$item.nameKey | String | |
$item.value | String | Value of the select item. |
Table 4.30. Error Keys for DatasourceSelectComponent
Key | Description |
---|---|
Error required field must not be empty | Key of the error message when a mandatory field was not filled |
DatasourceSelectComponent Example:
The example illustrates the usage of this component.Component used to input Date/Time/Datetime.
Example 4.17. Syntax DateComponent
<datecomponent> <mindate></mindate> <maxdate></maxdate> <dateformatterid></dateformatterid> <dateformat></dateformat> <format-description></format-description> <help></help> </datecomponent>
Table 4.31. Settings DateComponent
Name | Type | Default | Description |
---|---|---|---|
mindate | Date | NULL | Earliest allowed date. Must be given in the form yyyy-MM-dd |
maxdate | Date | NULL | Latest allowed date. Must be given in the form yyyy-MM-dd |
dateformatterid | String | date | Id of the dateformatter imp. |
dateformat | String | NULL | Format of the date. Must be a format definition that can be interpreted by the dateformatter imp. |
format-description | String | NULL | Error message shown when the input could not be interpreted as date. Supports variable $date to show a correctly formatted date. If mindate and/or maxdate are set, additional variables $mindate and/or $maxdate are available. |
help | String | NULL | Help message. Supports variable $date to show a correctly formatted date. If mindate and/or maxdate are set, additional variables $mindate and/or $maxdate are available. |
Table 4.32. Template Variables for DateComponent
Name | Type | Description |
---|---|---|
$component.calendarbuttoncomponent | Object | Buttoncomponent to open and close the calendar. The Calendari s initially closed. $textcomponent is readonly while $calendar.open is true. |
$component.calendar | Object | Calendar Object. |
$component.calendar.open | Boolean | True if calendar is open, false if closed. Is set, after $calendarbuttoncomponent click is processed. |
$component.textcomponent | Object | Textcomponent for display and text input of date. |
$component.monthselectcomponent | Object | Selectbox for months. |
$component.yearselectcomponent | Object | Selectbox for months. |
$component.applybuttoncomponent | Object | Apply button for the year and month selectbox, used for users who have no javascript. |
$component.weekdays | List | List of Weekdays (in correct order, startin with the first weekday in a week.) |
$weekday IN $component.weekdays | Object | Day of week. |
$weekday.date | Date | Date object of weekday (the first fitting weekday of this month, 0:00) |
$component.weeks | List | List of weeks to be shown in the calendar. |
$week IN $weeks | Object | A single week of the calendar. |
$week.date | Date | First day in the week. (Can be used to show the # of the week.) |
$week.days | List | List of days of the week. |
$day IN $week.days | Object | Day object. |
$day.date | Date | Date object of day (0:00) |
$day.selected | Boolean | True if this is the currently selected day. |
$day.today | Boolean | True if this is the current day. (today) |
$day.url | String | URL to select the day and close the calendar again. |
$day.selectable | Boolean | Wether the day can be selected, because of min/max date. |
$component.calendar.today | Object | Today object. |
$component.calendar.today.url | String | URL to store the day and close the calendar again. |
$component.calendar.today.date | Date | Date object of today (0:00) |
$component.calendar.mindate | Date | Earliest day allowed. |
$component.calendar.maxdate | Date | Latest date allowed. |
$component.calendar.dateformat | String | Dateformat configured for the datecomponent. |
Table 4.33. Error Keys for DateComponent
Key | Description |
---|---|
Error no empty text allowed | Key of the error message when a mandatory field was not filled |
Table 4.34. Error Keys for DateComponent
Key | Description |
---|---|
Invalid date syntax | Key of the error message when the date component was filled with an invalid format. |
DateComponent Example:
The example illustrates the usage of this component.Component used to handle binary data (upload and download files). When the components data is stored into a Resolvable with a Form2ObjectAction, the binary data is stored in the attribute [id] and additional data (contenttype, filesize, uploaddate, filename) is stored in the configured attributes.
Example 4.18. Syntax FileUploadComponent
<fileuploadcomponent> <contenttypeattribute></contenttypeattribute> <filesizeattribute></filesizeattribute> <uploaddateattribute></uploaddateattribute> <filenameattribute></filenameattribute> <keepcontent></keepcontent> <downloadactions>...</downloadactions> </fileuploadcomponent>
Table 4.35. Settings FileUploadComponent
Name | Type | Default | Description |
---|---|---|---|
contenttypeattribute | String | (required) | name of the attribute where the contenttype is stored |
filesizeattribute | String | NULL | name of the attribute where the filesize is stored |
uploaddateattribute | String | NULL | name of the attribute where the uploaddate is stored |
filenameattribute | String | (required) | name of the attribute where the filename is stored |
keepcontent | Boolean | true | Whether to keep the uploaded file in the session after the upload. |
downloadactions | Node | false | Container for pluggable actions that shall be triggered when the binary data is downloaded. See Section 2.2.8, “Pluggable Actions” |
![]() | Note |
---|---|
Some Browsers (e.g. Microsoft® Internet Explorer or Opera) are sending the full path to a file, instead of just the filename. This is circumvented by stripping everything from the beginning to the last / or \ from the filename. The full path can still be retrieved by the component property originalFilename, or just the path with filepath right after the upload. |
Table 4.36. Component Properties for FileUploadComponent
Name | Type | Description |
---|---|---|
data | InputStream | Alias for filestream. |
filestream | InputStream | The content of the uploaded file. |
filename | String | The filename. |
filesize | Long | The filesize in bytes. |
contenttype | String | The delivered contenttype of the file. |
filepath | String | The locale path the file was uploaded from, if available. |
viewurl | String | The viewurl that was created during the last rendering process. This url can be used to download the current binary data with Content-Disposition: inline. |
downloadurl | String | The downloadurl that was created during the last rendering process. This url can be used to download the current binary data with Content-Disposition: attachment. |
Table 4.37. Template Variables for FileUploadComponent
Name | Type | Description |
---|---|---|
$component.filesize | Integer | Size of the uploaded file (if available) in bytes. |
$component.contenttype | String | Contenttype of the uploaded file (if available). |
$component.filename | String | name of the uploaded file (if available). |
$component.viewurl | String | URL to view the uploaded file in a new window (disposition:inline). |
$component.downloadurl | String | URL to download the uploaded file (disposition:attachment). |
Table 4.38. Error Keys for FileUploadComponent
Key | Description |
---|---|
file doesn't match current pattern | The uploaded file did not match the given filename pattern |
file too big | The uploaded file exceeded the file upload limit |
No file uploaded | No file was uploaded for a mandatory component |
file upload error | Another file upload error occurred. |
FileUploadComponent Example:
The example illustrates the usage of this component.Component used to input integer or floating point (double) numbers.
Example 4.19. Syntax NumberComponent
<numbercomponent> <min></min> <max></max> <type></type> <fractiondigits failifmore=""></fractiondigits> </numbercomponent>
Table 4.39. Settings NumberComponent
Name | Type | Default | Description |
---|---|---|---|
min | Number | NULL | Minimum number allowed to be entered. Must be entered in
the "internal" format for numbers, like:
-1003.14159 . When not entered, there is no lower
limit for the entered number. |
max | Number | NULL | Maximum number allowed to be entered. Must be entered in
the "internal" format for numbers, like:
-1003.14159 . When not entered, there is no upper
limit for the entered number. |
type | "integer"|"double" | double | Type of the entered number. |
fractiondigits | Integer | 0 | Number of allowed fraction digits, when the type
is set to Double . When more fraction digits are
entered, the number will be rounded or an error
thrown, depending on the setting of
failifmore . |
fractiondigits.failifmore | Boolean | FALSE | Behaviour when more than
fractiondigits are
entered for Double
numbers. When set to true ,
an error will be thrown, when set to
false , the number will be
rounded. |
Table 4.40. Template Variables for NumberComponent
Name | Type | Description |
---|---|---|
$component.value | String | Current value. |
$component.name | String | Internal name of the component, used as html property. |
Table 4.41. Error Keys for NumberComponent
Key | Description |
---|---|
Error no number entered | No number entered for a mandatory component. |
Error Not a valid number | The entered text was not a number |
Error Number not in range | The entered number was not in the valid range |
Error Too many fraction digits given | The entered number had too many fraction digits. |
NumberComponent Example:
The example illustrates the usage of this component.Singleline textfield with error checking by regexes. The component can render a second input field for verification of the input.
Example 4.20. Syntax PasswordComponent
<passwordcomponent> <encrypted></encrypted> <labelverify></labelverify> <syntax></syntax> <syntax-description></syntax-description> </passwordcomponent>
Table 4.42. Settings PasswordComponent
Name | Type | Default | Description |
---|---|---|---|
encrypted | Boolean | true | Whether to provide the password cleartext or encrypted. |
labelverify | String | Verify | Label for the verify field. |
syntax | String | NULL | Regular expression the value is matched against. Creates an error in case of mismatch. |
syntax-description | String | Invalid Syntax | Readable description of the syntax. Will be displayed as error message. |
Table 4.43. Component Properties for PasswordComponent
Name | Type | Description |
---|---|---|
data | String | The given password, either cleartext or encrypted depending on the component's settings |
encrypted | String | The given password, encrypted. The algorithm used is MD5 in a 32 characters (0-9A-F) representation independent of the component's settings. |
cleartext | String | The given password, cleartext. If encryption is enabled this will be NULL as long as the user has not entered a new password. |
Table 4.44. Template Variables for PasswordComponent
Name | Type | Description |
---|---|---|
$component.namepassword | String | Internal name of the component, used as html property. |
$component.namepasswordverify | String | Internal name of the verify component, used as html property. |
$component.labelverify | String | Label for the verify-password input field. |
Table 4.45. Error Keys for PasswordComponent
Key | Description |
---|---|
Error: Please enter a password! | No password was entered for a mandatory component. |
Error: Passwords do not match! | The password was not entered identically in both fields. |
PasswordComponent Example:
The example illustrates the usage of this component.Component used to select static options.
Example 4.21. Syntax SelectComponent
<selectcomponent> <multivalue></multivalue> <options> <option id=""></option> ... </options> <optionsproperty type="" sortorder=""></optionsproperty> <nameattribute></nameattribute> <valueattribute></valueattribute> </selectcomponent>
Table 4.46. Settings SelectComponent
Name | Type | Default | Description |
---|---|---|---|
multivalue | Boolean | false | Whether more than one value can be selected |
options | Node | NULL | list of static options |
options.option | String | NULL | The shown option value |
options.option.id | String | NULL | The stored option id |
optionsproperty | String | NULL | Path to a portal property holding an encoded map of selectable values |
optionsproperty.type | String | keyfirst | Either keyfirst or
valuefirst . Whether the
key comes first in the encoded map or the
value |
optionsproperty.sortorder | String (asc|desc) | NULL | Sortorder for the options defined in the optionsproperty. |
nameattribute | String | NULL | If the options are set as a collection, use this attribute to read the name. |
valueattribute | String | NULL | If the options are set as a collection, use this attribute to read the value. |
Table 4.47. Template Variables for SelectComponent
Name | Type | Description |
---|---|---|
$component.items | List | All options. |
$item IN $component.items | Object | Item object. |
$item.name | String | Display name of option. |
$item.value | String | Internal value of option. May be null (see $component.hasvalue) |
$item.selected | String | Displayname of item. |
$item.object | Object | Object representation of the item. |
$component.hasvalues | Boolean | True if $component.items have values and names, false if $component.items have only names. |
$component.name | String | Internal name of the component, used as html property. |
$component.multiple | Boolean | True if multiple selections are allowed. |
$component.hassize | Boolean | True if a specific size has been set for this component. |
$component.size | Integer | Size of the selection. May be null (see $component.hassize) |
Table 4.48. Component Properties for SelectComponent
Name | Type | Description |
---|---|---|
singlevalue | String | Selected value as a single String (not as collection) |
options | Node | list of static options |
nameattribute | String | If the options are set as a collection, use this attribute to read the name. |
valueattribute | String | If the options are set as a collection, use this attribute to read the value. |
Table 4.49. Error Keys for SelectComponent
Key | Description |
---|---|
Error required field must not be empty | No value selected in a mandatory select component. |
SelectComponent Example:
The example illustrates the usage of this component.Multiline textfield with error checking by regexes.
Example 4.22. Syntax TextAreaComponent
<textareacomponent> <syntax></syntax> <syntax-description></syntax-description> </textareacomponent>
Table 4.50. Settings TextAreaComponent
Name | Type | Default | Description |
---|---|---|---|
syntax | String | NULL | Regular expression the value is matched against. Creates an error in case of mismatch. |
syntax-description | String | NULL | Readable description of the syntax. Will be displayed as error message. |
Table 4.51. Template Variables for TextAreaComponent
Name | Type | Description |
---|---|---|
$component.value | Text | Current value. |
$component.name | String | Internal name of the component, used as html property. |
$component.length | Integer | Length of the textfield. |
Table 4.52. Error Keys for TextAreaComponent
Key | Description |
---|---|
Error no empty text allowed | No text entered into a mandatory text field. |
TextAreaComponent Example
The example illustrates the usage of this component.Singleline textfield with error checking by regexes.
Example 4.23. Syntax TextComponent
<textcomponent> <syntax></syntax> <syntax-description></syntax-description> </textcomponent>
Table 4.53. Settings TextComponent
Name | Type | Default | Description |
---|---|---|---|
syntax | String | NULL | Regular expression the value is matched against. Creates an error in case of mismatch. This can also be the key of entries in the dictionaries, to support language specific syntax checking. |
syntax-description | String | NULL | Readable description of the syntax. Will be displayed as error message. |
Table 4.54. Template Variables for TextComponent
Name | Type | Description |
---|---|---|
$component.value | String | Current value. |
$component.name | String | Internal name of the component, used as html property. |
Table 4.55. Error Keys for TextComponent
Key | Description |
---|---|
Error no empty text allowed | No text entered into a mandatory text field. |
TextComponent Example:
The example illustrates the usage of this component.Lists Resolvables Objects in ViewPlugin according to Objectstructure, with sorting, formatting and quicksearch.
![]() | Note |
---|---|
Altough this component can be used with every datasource, you should make sure that all requirements for the used datasource are provided. For example “Datasources of type |
Example 4.24. Syntax DatasourceListComponent
<datasourcelistcomponent> <columns> <column id=""> <visible>[<prule></prule>]</visible> <label></label> <property></property> <foreignproperty></foreignproperty> <sortable></sortable> <actions>...</actions> <properties> <property id="...">...</property> ... </properties> </column> ... </columns> <sortorder></sortorder> <sortby></sortby> <sortable></sortable> <quicksearch></quicksearch> <rule></rule> <filterrule></filterrule> <filterlabel></filterlabel> <paging> <size></size> <current></current> <customsizes></customsizes> </paging> <datasource></datasource> <idattribute></idattribute> <stickyselection>[<prule></prule>]</stickyselection> </datasourcelistcomponent>
Table 4.56. Settings DatasourceListComponent
Name | Type | Default | Description |
---|---|---|---|
columns | List | NULL | All columns to be listed |
column in columns | Object | NULL | A single column and its properties |
column.id | String | (required) | Id of the column. For columns showing object attributes this must be the attribute’s id. |
column.visible | Boolean or prule | TRUE | Whether this column is visible or not. |
column.label | String | (required) | Label of the column |
column.property | String | id | Object property to show in this column |
column.foreignproperty | String | NULL | When the show property is another Resolvable object, the foreignproperty is the attribute of the Resolvable to be shown in the column (otherwise, the string representation of the Resolvable would be shown). This may also be a property path, if the foreignproperty of the linked object is again an object link (thus it is e.g. possible to show the name of the manager of the company of a listed person). |
column.actions | Node | NULL | Configured pluggable actions for the column.
The actions will resolve the clicked object (row) as
data.object.* in their
contexts.Section 2.2.8, “Pluggable Actions”
|
column.properties | Node | NULL | Custom properties set for this column. Can be used to set properties that are interpreted in the template of the DatasourceListComponent. |
property | Node | NULL | Single property setting. |
property.id | String | (required) | Id of the property set. |
column.sortable | Boolean | NULL | Whether this column is sortable or not.
(Sortable means that the user may sort the list by
this column). This setting overwrites the general
setting sortable
. |
sortorder | String | ASC | sort order, ASC for ascending or DESC for descending |
sortby | String | NULL | defines the name of the attribute by which the elements in the list are sorted |
sortable | Boolean | false | Whether the list shall be sortable or not. This
setting applies to all columns but can be
overwritten with
column.sortable
. |
quicksearch | Node | NULL | Node containing the quicksearch settings |
quicksearch.filterlabel | String | (required) | Filterlabel to be set when the list is filtered by a quicksearch |
rule | String | NULL | Base rule that filters the objects shown in the list. (The current item is accessible through 'object.' in the rule) |
filterrule | String | NULL | Additional filterrule that further limits the objects shown in the list (combined with AND to an eventually existing rule). The filterrule is changed by a quicksearch or by other search mechanisms (e.g. RuleSearchAction). (The current item is accessible through 'object.' in the rule) |
filterlabel | String | NULL | Filterlabel shown when a filterrule is applied |
paging | Node | NULL | Paging settings. This column is optional. If no paging settings are provided no paging is applied. |
paging.size | Integer | (required) | Number of objects shown on a single page. When this is set to 0, no paging is used. |
paging.current | Integer | 1 | Initial value for the currently shown page. |
paging.customsizes | List of Integers | NULL | Space delimited list of Custom page sizes the user may select for the list. 0 would be shown as "all" in the pagesize selectbox. |
datasource | String | NULL | Id of the datasource to be used. When left empty,
the portlet's default datasource is used (when
configured). Set the datasource to
false when the component
shall not fetch the objects itself, but shall be
filled by modification of the property
items or by filling
objects into a view using the
Object2FormAction. |
idattribute | String | contentid | Attribute of the listed objects that identifies the objects uniquely. It is necessary to set this correctly so that list items can be identified. |
stickyselection | Boolean or Prule | FALSE |
Whether the selection of rows in the list will
remain longer than until the next click. With
|
![]() | Note |
---|---|
When a column is defined to represent binary data (e.g. the contents of a file), the rendered data is not the binary data itself, but is a link that can be used to download the binary data. Additionally, the template of the DatasourceListComponent has to take care about this fact and generate the html link for such columns! Another solution for providing download links in a DatasourceListComponent would be to use a DownloadAction in combination with a DownloadComponent. See Section 2.2.7.3.3, “DownloadComponent” and Section 2.2.8.10, “DownloadAction” for details. |
Table 4.57. Template Variables for DatasourceListComponent
Name | Type | Description |
---|---|---|
$component.quicksearch | String | The quicksearch content. |
$component.quicksearch.enabled | Boolean | True when the list is filtered by a quicksearch. |
$component.headers | List | All column headers |
$header IN $component.headers | Object | A single column header |
$header.label | String | Label of this column header |
$header.sortlink | String | The URL to sort this list by this property ASC or, if already ASC, URL to order DESC |
$header.sortlinkAsc | String | Returns an URL to sort this list by this property ascending. |
$header.sortlinkDesc | String | Returns an URL to sort this list by this property descending. |
$header.sortorder | String | Current sortorder of this property. Either "ASC" or "DESC" |
$header.properties | Map | Map of the set custom properties for the column. |
$component.filterobject | Object | Object for the currently used filter. May be used to display properties of the filter together with the filterlabel. |
$component.filterlabel | String | Label of the sued filter. |
$component.items | List | All items (rows) of the current page. |
$item in $component.items | Object | Item object. |
$item.props | List | All listed properties of the item (columns) |
$item.content | Object | The resolvable object of this item. This variable is DEPRECATED, use $item.object instead. |
$item.content{.*} | Object | Properties of the object. |
$item.object | Object | The resolvable object of this item. |
$item.object{.*} | Object | Properties of the object. |
$prop IN $item.props | Object | Property (column) of an item. |
$prop.columnid | String | Id of the column. |
$prop.value | String | Value of the itemproperty if the column shows a property of the item. |
$prop.link | String | Link to trigger the action defined for the column. Is empty if no action was defined or if all defined actions are inactive due to their rules. |
$prop.properties | Map | Map of the set custom properties for the column. |
$prop.properties.[propertyid] | String | Value of the property [propertyid] . |
$component.paging.size | Integer | Maximum number of items to be shown on one page. |
$component.paging.current | Integer | Current page number, starting with 1. |
$component.paging.pages | List | List of all available pages. |
$page IN $component.paging.pages | Object | Page object. |
$page.link | String | Link to activate this page. |
$page.number | Integer | Page number. |
$component.count | Integer | Total number of items within all pages. |
$component.advancedsearchlink | String | Link to the advanced search (or null if no advancedsearch was configured) |
$component.toggleselection | ButtonComponent | Button Container for Checkbox toggle actions, or null if not available. |
$component.toggleselection.buttons.none | Button | Button to deselect all items. |
$component.toggleselection.buttons.all | Button | Button to select all items. |
$component.toggleselection.buttons.toggle | Button | Button to deselect all items if any is selected or to select all if there is currently no item selected. |
$component.pagingsizeselect | SelectComponent | Component to select paging size, or null if not available. |
Table 4.58. Component Properties for DatasourceListComponent
Name | Type | Description |
---|---|---|
items | Collection | Objects shown in the DatasourceListComponent. The returned items are dependent on set rule or filterrule and also on the currently set sorting, but not on the paging or the attributes shown in the list (the returned objects will not have any attributes prefilled, see below on more useful information about using this property). When the DatasourceListComponent has a datasource configured, this property is not changeable (since the DatasourceListComponent fetches the items itself). When the DatasourceListComponent is used to display data stored in a multivalue attribute, this property can be modified. |
selection | Collection |
Currently selected objects. Remove the selection by setting
this property to
""
|
filterrule | String | Rule that filters the shown items in the list. Can be set/unset to implement search functionality in the list. |
pagingsize | Integer | Allows setting and retrieving of the paging size (Items displayed per page). |
currentpage | Integer | Will switch paging to the page number provided. Settings lower than 1 will result in displaying the first page, while settings which are higher than the actual number of pages will lead to the last page. |
sortby | String | Name of the sorted column. |
sortorder | String |
Sort order (asc for ascending, desc for descending).
|
count | Integer | Total number of entries in the list (independent of paging). This property is readonly. |
![]() | Note |
---|---|
When items are fetched from a DatasourceListComponent by reading the property items , it has to be taken into consideration that really all objects are fetched from the configured datasource that match the currently set rule and/or filterrule regardless of their total number (paging of the component is not used here). For very large datasets this will consume both cpu and memory ressources on the server and could even lead to OutOfMemoryExceptions. Also it has to be noted that the fetched objects will have no attributes prefilled. Accessing attributes for many (or all) of the objects without having them prefilled first could possibly create a high server load by accessing the underlying storage (database) for every single attribute. |
DatasourceListComponent Example:
The example illustrates the usage of this component.Component used to display object relations in a tree. The objects are selected by a rootrule (for filtering the objects shown in the first hierarchy level) and noderelations (attributes that link to other objects).
Example 4.25. Syntax DatasourceTreeComponent
<datasourcetreecomponent> <datasource></datasource> <idattribute></idattribute> <rootrule></rootrule> <noderule></noderule> <disableflapping></disableflapping> <hideclosednodes></hideclosednodes> <maxlevel></maxlevel> <nodeactions defaultaction=""> <nodeaction id=""> <label></label> <visible></visible> <enabled></enabled> <actions> ... </actions> <properties> <property id="...">...</property> ... </properties> </nodeaction> ... </nodeactions> <sortby></sortby> <sortorder></sortorder> <paging> <size></size> <current></current> <customsizes></customsizes> </paging> <relations> <relation attribute="" sortby="" sortorder="" reverseattribute=""> <rule></rule> </relation> ... </relations> <idattribute></idattribute> <maxlevel></maxlevel> <hideclosednodes>[<prule></prule>]</hideclosednodes> <prefillattributes></prefillattributes> </datasourcetreecomponent>
Table 4.59. Settings DatasourceTreeComponent
Name | Type | Default | Description |
---|---|---|---|
datasource | String | default portlet datasource | Id of the datasource to use. When not configured, the default datasource of the portlet is used. |
idattribute | String | contentid | Name of the attribute of the resolvables loaded from the datasource, that uniquely identify the objects. This needs to be set correctly, otherwise the tree will not work like expected. |
rootrule | String | true | Rule to restrict the objects shown in the first hierarchy level of the tree. Resolves portal., views., view. and form. See Property Path. |
noderule | String | true | Rule to further restrict all objects shown in the tree. Resolves portal., views., view. and form. See Property Path. |
disableflapping | Boolean or prule | false | Whether flapping is enabled or disabled. If true then $child.flappable will be false and $child.flappedOpen will be true for all children. |
nodeactions | Node | NULL | List of nodeactions defined for the tree. |
nodeactions.defaultaction | String | NULL | The id of the default action (will be supported by a direct link) |
nodeaction.id | String | (required) | Id of the nodeaction. Must be unique in the scope of the component. |
nodeaction.label | String | NULL | Label of the nodeaction. |
nodeaction.visible | Boolean or prule | true | Whether the action is visible. The rule may contain "object" as base object to match the currently shown treeobject. |
nodeaction.enabled | Boolean or prule | true | Whether the action is enabled. The rule may contain "object" as base object to match the currently shown treeobject. |
nodeaction.actions | Node | NULL | Actions container holding pluggable action definitions. The treeobject will be available in the actions’ contexts as "data.object". |
nodeaction.properties | Node | NULL | Custom properties of the nodeaction. |
property | Node | NULL | A single custom property. |
property.id | String | (required) | Id of the custom property. |
sortby | String | NULL | Name of the attribute by which the root objects are sorted. |
sortorder | String | ASC | One of ASC or DESC. Sort order for the root objects. |
paging | Node | NULL | Paging settings |
paging.size | Integer | (required) | Number of objects shown on a single page. When this is set to 0, no paging is used. |
paging.current | Integer | 1 | Initial value for the currently shown page. |
paging.customsizes | List of Integers | NULL | Space delimited list of Custom page sizes the user may select for the list. 0 would be shown as "all" in the pagesize selectbox. |
relations | Node | NULL | list of relations to build the tree. |
relation.attribute | String | (required) | Name of the attribute defining the relation. The attribute should link to other objects. |
relation.sortby | String | NULL | name of the attribute by which objects linked to by this relation are sorted. NULL means no sorting. |
relation.sortorder | String | ASC | One of ASC or DESC. Sort order (ascending or descending) |
relation.rule | String | true | Determines whether the children of an object, related with this relation, should be shown. The mother object is matched against the rule. |
relation.reverseattribute | String | NULL | Name of the attribute that is the reverse of the
relation attribute .
This attribute must lead from any node to its parent
node. When this property is set and a node is opened
via setting the property
openpath , all parent nodes of
the opened node are also opened to ensure that the
opened node is really visible. |
idattribute | String | contentid | Name of the attribute that uniquely identify the
Resolvables shown in the tree. Note that is is
necessary to set this correctly, otherwise the
component will fail to work. The default
contentid works with
datasources of type
contentrepository
. |
maxlevel | Integer | -1 | Maximum number of levels to be shown in the tree.
Set this to 0 to show only the
root nodes or -1 for no level
limit. |
hideclosednodes | Boolean or prule | false | Whether closed nodes shall be hidden from view. When this is true, only the open nodes (including all parent nodes) are rendered. Otherwise also closed nodes will be rendered. |
prefillattributes | String | NULL | A comma-separated list of attributes that should be prefilled when loading the objects from the database (increases performance). |
Table 4.60. Template Variables for DatasourceTreeComponent
Name | Type | Description |
---|---|---|
$component.tree | Object | Contains the root node of the Tree. |
$component.tree.children | List | Children of the root node. |
$child IN $tree.children | Object | Contains one tree node. |
$child.children | List | Contains the list of children of the tree node |
$child.nodeCount | Integer | Calculates number of all direct children (non-recursive) |
$child.allNodeCount | Integer | Calculates number of all subnodes (recursive) |
$child.getAllNodeCount( "rule" ) | Integer | Calculates number of all subnodes applying to the defined rule (recursive) - e.g.: "object.obj_type == 2" |
$child.visible | Boolean | Whether the child is visible or not. |
$child.flappable | Boolean | Whether the node is flappable (has children). |
$child.flappedOpen | Boolean | Whether the node is flapped open. |
$child.flapLinkOpen | String | URL to open this node. |
$child.flapLinkClose | String | URL to close this node. |
$child.flapLinkAllOpen | String | URL to open this node and all nodes below. |
$child.flapLinkClose | String | URL to close this node and all nodes below. |
$child.userObject | Object | The Data Object from the datasource. This variable is DEPRECATED, use $child.object instead. |
$child.userObject(.*) | Object | Properties of the object. |
$child.level | Integer | Hierarchy level of the current node.
Will be 0 for root
nodes. |
$child.object | Object | The resolvable object of this item. |
$child.object{.*} | Object | Properties of the object. |
$child.defaultActionLink | String | URL to activate the default action on this node, when such an action exists and is enabled. |
$child.first | Boolean | True when the child is the first child of its parent |
$child.last | Boolean | True when the child is the last child of its parent. |
$child.number | Integer | Number of the child within all children of its parent, starting with 1. |
$action in $child.nodeActions | Object | A configured nodeAction. |
$action.id | String | The ID of the action if it was specified. |
$action.enabled | Boolean | Whether the action is enabled. |
$action.visible | Boolean | Whether the action is visible. |
$action.label | String | Label of the action. |
$action.url | String | URL to activate this action. |
$action.properties | Map | Custom properties of the nodeaction. |
$action.properties.[propertyid] | String | Value of the custom property [propertyid] . |
Table 4.61. Component Properties for DatasourceTreeComponent
Name | Type | Description |
---|---|---|
open | Collection of Strings | Collection of the id's of the currently opened nodes. This property can also be modified to open/close nodes. |
openpath | Collection of Strings | This "property" is not readable but can be
set to open a specific node (or some specific nodes) with
all their respective parent nodes. Setting this
property will not change other open nodes. For this
property to work correctly, it is necessary to set
relation.reverseattribute
. |
reload | Boolean | This "property" is not readable, you can use it to force the component to reload it's data. (E.g. when something referenced in the rule was modified which is unrelated to the component itself.) |
sortby | String | Allows to set the 'sortby' setting of this component. Expects the name of the attribute. |
sortorder | String | Allows to set the 'sortorder' setting of this component. This is either "asc" or "desc" |
DatasourceTreeComponent Example:
The example illustrates the usage of this component.The download component can be used to provide binary data (files) for downloading to the user client. When placed inside a view, this component normally does not render any output (and therefore does not need a template). When a DownloadAction is processed that refers to this component, it will provide the binary data as download to the client. See Section 2.2.8.10, “DownloadAction” for details.
Table 4.63. Component Properties for DownloadComponent
Name | Type | Description |
---|---|---|
content | various | The content the component shall provide as download. May be binary data, a string or stream |
filename | String | Filename of the download. |
disposition | [attachment]|[inline] | "Type" of the download. "Attachment" should be used for normal downloads (browser will ask whether to save or open the file). When set to "inline", the browser should try to open the file automatically. |
contenttype | String | Mimetype of the content to download. |
DownloadComponent Example:
The example illustrates the usage of this component.Component used to display one-time messages (message will automatically be reset when rendered once). The messages are defined or set by actions.
![]() | Note |
---|---|
When using a FeedbackComponent to display one-time messages, you should avoid to render the same view more than once on the same portal page, because the feedback would only be visible in one of the view occurances (the one which is rendered first) and this behaviour might be unexpected. |
Table 4.65. Template Variables for FeedbackComponent
Name | Type | Description |
---|---|---|
$component.text | String | Feedback message. |
FeedbackComponent Example:
The example illustrates the usage of this component.Component used to display data coming from other components in the same form.
Example 4.28. Syntax InformationComponent
<informationcomponent> <reference></reference> </informationcomponent>
Table 4.68. Settings LabelComponent
Name | Type | Default | Description |
---|---|---|---|
text | String | NULL | Text to be shown in the label component. This should be an i18n key to an entry in the dictionaries. |
Table 4.69. Template Variables for LabelComponent
Name | Type | Description |
---|---|---|
$component.text | String | The text to output. |
LabelComponent Example
The example illustrates the usage of this component.A container component for other components. Used to list components.
Table 4.71. Settings ListComponent
Name | Type | Default | Description |
---|---|---|---|
content | Node | NULL | Node holding the subcomponents. |
Table 4.72. Template Variables for ListComponent
Name | Type | Description |
---|---|---|
$component.items | List | All list items. |
$item IN $component.items | Collection | One of the items in $component.items |
$item | String | The content of the subitem itself. |
$item.* | Object | Main object of subcomponent for component properties. |
ListComponent Example:
The example illustrates the usage of this component.Component used to implement a nested form inside another form. A NestedFormComponent can hold any combination of components as children, even other NestedFormComponents (so it is possible to generate a form in form in form in ... All inner components are prefixed with the id of the nestedformcomponent (prefix and component id separated by underscore _). Nested forms can be treated analogously to views, in the sense that the Form2ObjectAction, Object2FormAction and GeneralViewAction may refer to NestedFormComponents instead of a whole view.
See Section 2.2.8.13, “Form2ObjectAction” , Section 2.2.8.17, “Object2FormAction” and Section 2.2.8.14, “GeneralViewAction” for details.
Example 4.31. Syntax NestedFormComponent
<nestedformcomponent> <content>...</content> <exclusive></exclusive> <visibility></visibility> <openbuttonlabel></openbuttonlabel> <closebuttonlabel></closebuttonlabel> <closeon></closeon> </nestedformcomponent>
Table 4.73. Settings NestedFormComponent
Name | Type | Default | Description |
---|---|---|---|
content | Node | NULL | Container for inner components of the nested form |
exclusive | Boolean or Rule | false | whether the inner form shall be exclusive (when the visibility mode is "ondemand") when an exclusive nested form is opened, all surrounding components are disabled. |
visibility | String | always | visibility mode of the form in form: "always" to
have the inner form always open, "ondemand" to have
the inner form being opened and closed using default
buttons (which will be autogenerated), "custom"
when the opening and closing of the inner form is done
through setting the open
property or via PluggableActions. |
openbuttonlabel | String | Open | label of the open button (when the visibility mode is "ondemand") |
closebuttonlabel | String | Close | label of the close button (when the visibility mode is "ondemand") |
closeon | List of Strings | NULL | space delimited list of buttoncomponent id’s; defines the inner buttoncomponents, which will automatically close the form, when all actions defined for the button were successfully processed. |
Table 4.74. Template Variables for NestedFormComponent
Name | Type | Description |
---|---|---|
$component.items | List | List of inner components |
$component.buttons | Component | Button component holding the default buttons (for opening/closing the inner form when the visibility mode is "ondemand") |
Table 4.75. Component Properties for NestedFormComponent
Name | Type | Description |
---|---|---|
open | Boolean | Whether the form is open or closed. Can be
used to open/close the inner form, when
visibility is set to
custom . |
NestedFormComponent Example:
The example illustrates the usage of this component.Example 4.32. Syntax TabComponent
<tabcomponent> <content> <tab> <label></label> <visible></visible> <enabled></enabled> <optional></optional> <properties></properties> <content>...</content> </tab> ... </content> <activetab></activetab> </tabcomponent>
Table 4.76. Settings TabComponent
Name | Type | Default | Description |
---|---|---|---|
content | Node | NULL | Node holding the tabs |
content.tab | Node | NULL | Node holding a tab. Many tabs may be defined. |
tab.label | String | required | Readable label. The label should be the i18n key of the real labels in the dictionaries for multilanguage support. |
tab.visible | Boolean or prule | true | Whether this tab is visible or not. |
tab.enabled | Boolean or prule | true | Whether this tab is enabled or not. Disabled tabs can not be activated or clicked. |
activetab | String | first tab defined | Id the the initial active tab. |
Table 4.77. Template Variables for TabComponent
Name | Type | Description |
---|---|---|
$component.items | List | All tabs |
$item in $component.items | Object | One of the tabs in $component.items |
$item.visible | Boolean | Visibility of a tab. |
$item.enabled | Boolean | False, if the tab is not available to the user. |
$item.component | Object | General variables of the component of the tab. Cannot render the tab-component |
$item.active | Boolean | True for the currently selected tab by the user. |
$item.id | String | The id of a tab. |
$item.name | String | The name of a tab. |
$item.taburl | String | The url to activate a tab. |
$component.activetab | String | Id of the active tab. |
$component.content | String | The content of the active tab. |
TabComponent Example:
The example illustrates the usage of this component.Component used to display information about the version that is currently displayed or edited in a view. This component should be used together with the VersioningComponent (see Section 2.2.7.3.11, “VersioningComponent” ).
Example 4.33. Syntax VersionInformationComponent
<versioninformationcomponent> </versioninformationcomponent>
Table 4.79. Template Variables for VersionInformationComponent
Name | Type | Description |
---|---|---|
$component.versiontimestamp | Integer | Timestamp of the currently displayed or edited version. Will be set to -1 for the current version. |
$component.current | Boolean | Whether the version is the current version. |
$component.past | Boolean | Whether the version is the past version. |
$component.future | Boolean | Whether the version is the future version. |
Table 4.80. Component Properties for VersionInformationComponent
Name | Type | Description |
---|---|---|
versiontimestamp | Integer | Timestamp of the currently displayed or edited version. Will be set to -1 for the current version. |
current | Boolean | Whether the version is the current version. |
past | Boolean | Whether the version is the past version. |
future | Boolean | Whether the version is the future version. |
VersionInformationComponent Example:
The example illustrates the usage of this component.Component used to display and manage versions of the contentobject edited in the current form. This component can only be used when the datasource supports versioning. The VersioningComponent shows a list of all existing versions of an object. Since this list may be long and space consuming, it is recommended to place this component in an own tab of the TabComponent. To ensure that a user is aware of which version of an object is currently shown in a view, it is recommended to use a VersionInformationComponent (not as part of the TabComponent, but always visible). See Section 2.2.7.3.11, “VersioningComponent” and Section 2.2.7.3.9, “TabComponent” for detailed information.
Example 4.34. Syntax VersioningComponent
<versioningcomponent> <currentversionlabel></currentversionlabel> <versiondatelabel></versiondatelabel> <createversionlabel></createversionlabel> <viewpastobjects></viewpastobjects> <viewfutureobjects></viewfutureobjects> <editpastobjects></editpastobjects> <editfutureobjects></editfutureobjects> </versioningcomponent>
Table 4.81. Settings VersioningComponent
Name | Type | Default | Description |
---|---|---|---|
currentversionlabel | String | current version | Label for the button to switch to the current version of an object |
versiondatelabel | String | new version date | Label for the DateComponent to enter the date for a new version |
createversionlabel | String | create version | Label for the button to create a new version at the given date |
viewpastobjects | Boolean | false | Whether viewing of past versions is allowed or not |
viewfutureobjects | Boolean | false | Whether viewing of future versions is allowed or not |
editpastobjects | Boolean | false | Whether editing of past versions is allowed or not |
editfutureobjects | Boolean | false | Whether editing of future versions is allowed or not |
Table 4.82. Template Variables for VersioningComponent
Name | Type | Description |
---|---|---|
$component.versions | List | List of versions of the edited object. |
$version IN $component.versions | Object | One version of the edited object. |
$version.date | Date | Date of the version (when version was created.) |
$version.diffcount | Integer | # of changed records in this version. |
$version.restoreurl | String | URL to restore the version (may be null if restoring is not allowed.) |
$version.displayurl | String | URL to display the version. |
$version.new | Boolean | True if this version is new. |
$version.shownVersion | Boolean | True if this version is currently shown. |
$comopnent.date | DateComponent | Date component for creation of new versions. (can be null) |
$component.create | ButtonComponent | Button component used to create new versions. (can be null) |
$component.current | ButtonComponent | Button component used to switch to the current version. |
VersioningComponent Example:
The example illustrates the usage of this component.Pluggable Actions are small pieces of Java-Code that can be plugged into views. Pluggable actions can be triggered by button components (the code is executed when the button is clicked by the user) or some other components.
Some pluggable actions can be invoked "manually" by using the PluggableActionInvoker. See the CsvImportExample in the SDK Guide for an example.
Example 4.35. Structure of pluggable action definitions.
<actions> <action id="" class="" feedback=""> <prule>...</prule> <parameters> <parameter id="" mapped="" required="">[static value]</parameter> ... </parameters> <onsuccess message="..." proceedsequence="..."> <actions/> </onsuccess> <onfailure message="..." proceedsequence="..."> <actions/> </onfailure> </action> ... </actions>
Table 4.83. General Action Attributes
Name | Type | Default | Description |
---|---|---|---|
actions | Container | NULL | Container of defined actions. May hold one or more actions (an action sequence), which are invoked in the given order. Normally all actions in the sequence are processed, but this can be controlled by setting proceedsequence to FALSE in any of the actions. |
action | Object | (required) | Definition of one particular action |
action.id | String | NULL | Id of the action. The id of actions is used for referencing the generated response objects of particular actions (e.g. in subsequent pluggable actions). Note that the id of the action does not necessarily need to be unique within the actions context. When multiple actions with the same id are invoked, the responses will be merged. When multiple actions with the same id generate response values with the same id, only the response value from the last action will be available. |
action.class | String | (required) | Java-class of the implementation of the action. For Pluggable Actions that are part of Portal.Node, the package name com.gentics.portalnode.genericmodules.object.actions may be omitted. Custom pluggable actions have to be defined with the full class name. |
action.feedback | String | NULL | Id of the feedback component, the action may write messages to. When configured, there must be a feedback component in the view that holds this action. |
action.prule | String | NULL | Rule to decide whether the pluggable action has to be invoked or not. When no rule is configured the action is always processed. If this rule does not match onsuccess/onfailure and the *.proceedsequence parameters are ignored and the next action in the sequence will always be executed. |
action.parameters | Container | NULL | Container for action parameters. Every specific implementation of a pluggable action will required or support a specific set of parameters that can or have to be defined. |
action.parameters. parameter | Object | NULL | Particular parameter setting for the pluggable action. Parameters may be mapped from portal or view properties or may be defined static. |
action.parameters. parameter.id | String | (required) | Id (key) of the action-parameter |
action.parameters. parameter.mapped | String | NULL |
Path to the value of the defined parameter. The path must be resolvable in the context of this pluggable action. This may also contain results of previous actions (via .actions.[actionid].*). This may also be an expression with functions, operations, literals and resolvables. See “ExpressionParser” (Section 10) for further details. |
action.parameters. parameter.required | Boolean | FALSE | Whether the parameter is required for the action (value may not be empty) |
action.onsuccess | Object | NULL | Definition of what is to be done in case the action succeeds |
action.onsuccess. message | String | NULL | Message to be writted into the feedback component when the action succeeds |
action.onsuccess. proceedsequence | Boolean | TRUE | Whether actions in this sequence shall be proceeded when this action succeeds. When set to FALSE and this action succeeds, no other actions of this sequence are processed. This does NOT affect an eventually configured container in this onsuccess part. |
action.onsuccess. actions | Container | NULL | Action Container holding an action sequence that shall be processed when this action succeeds. |
action.onfailure | Object | NULL | Definition of what is to be done in case the action fails. |
action.onfailure. message | String | NULL | Message to be writted into the feedback component when the action fails. |
action.onfailure. proceedsequence | Boolean | TRUE | Whether actions in this sequence shall be proceeded when this action fails. When set to FALSE an this action fails, no other actions of this sequence are processed. |
action.onfailure. actions | Container | NULL | Action Container holding an action sequence that shall be processed when this action fails. This does NOT affect an eventually configured container in this onfailure part. |
Each action has an ActionContext which is used in the following elements, and some specific actions:
action.prule
action.parameters.parameter.mapped
The ActionContext provides the following Portal Property Paths, see Section 8, “Portal Property Paths” for details.
views.*
view.*
portal.*
actions.*
data.* base object of context specific additional data, mostly provided by the enclosing component.
javax.request.*
Returns binary data from a Callable Action.
Table 4.84. Parameters: BinaryCallableActionResponseAction
Name | Type | Default | Description |
---|---|---|---|
data | ByteArray or InputStream | The data to return in the response | |
mimetype | String | binary/octet-stream | Mimetype of the response. |
This action transforms a binary input stream, like the filestream from a fileuploadcomponent, into a reader, using a given character encoding.
If the input data is not set, the output content parameter will also not be set. If the input is already text or a reader, the content is not modified. If an error occurs, an error message is set as feedback message.
Table 4.87. Parameters: BinaryToTextAction
Name | Type | Default | Description |
---|---|---|---|
data | ByteArray or InputStream | The data to transform | |
encoding | String | ISO-8859-1 | The encoding used to transform the binary content into text. The is equal to the java character encoding names, like UTF-8 or UTF-16. |
Allows you to start errorchecking on a form starting from the component provided via the component-parameter. As errorchecking won't involve nested forms by default you can use the CheckErrorsAction to accomplish this task. The action will return true if everything was fine or false if errors where encountered.
Table 4.90. Parameters: CheckErrorsAction
Name | Type | Default | Description |
---|---|---|---|
component | String | (required) | This is the id of the component where errorchecking
will be started. All subsequent components will be
checked for errors. Note that ids of components which
reside inside of nested form components have to be
prefixed with the nested form component's id and an
underscore. It is possible to use multiple parameters with id |
errors2feedback | Boolean | false | When this is set to |
errors2feedbackseparator | String | (emptry String) | This parameter defines the separator between multiple component errors, when the errors are set as feedback (if the parameter |
No Response Objects.
Given an object this action follows the relationattribute of this object until it reaches all the leaves. If it did so it will create a collection of all the objects and return this collection.
Table 4.92. Parameters: CollectObjectsByRelationAction
Name | Type | Default | Description |
---|---|---|---|
baseobject | Object | (required) | Starting Object. |
relationattribute | String | (required) | The attribute that describes the relation. This parameter may be given multiple times if more than one relation has to be followed. |
includebase | Boolean | True | If base object needs to be included in the collection as well. |
failifempty | Boolean | False | Wheter the action fails when the collection is empty. |
rule | String | NULL | An additional rule to restrict the returned objects. |
The CreateResolvablesAction can be used to create Resolvable objects from a given XML source. This XML source has to conform to a specific XML schema. If a WriteableDatasource is given it can be used to create and load objects from this datasource. (E.g. With a CNDatasource given an attribute 'contentid' would load this resolvable from the datasource.)
This can be very handy in combination with a “XSLTRenderAction” (Section 2.2.8.31) so you can transform e.g. a RSS feed into resolvables which are then displayed in a “DatasourceListComponent” (Section 2.2.7.3.1).
Example 4.36. Example XML input.
<?xml version="1.0" encoding="UTF-8"?> <objects xmlns="http://www.gentics.com/create-resolvables"> <object> <attribute name="title">My Title</attribute> <attribute name="description">Some description</attribute> </object> <object> ... </object> </objects>
Table 4.95. Parameters: CreateResolvablesAction
Name | Type | Default | Description |
---|---|---|---|
xml | String | (required) | XML source describing the Resolvable objects which should be created. |
datasource | String | NULL | This has to be the name for a WriteableDatasource which is used to create the resolvable objects. |
This action reads data from a CSV (comma separated values) content and imports it into a contentrepository. A status message is returned as feedback message.
The first non-skipped line in the csv content is interpreted as header, which defines into which attributes the fields are imported. A new import always creates new objects and does not check for duplicate entries.
The import creates a log during the import. It also generates a list of all contentids which are created during the import, including newly created referenced objects. If a line contains invalid data, an error is created and the line is ignored. Even if an error occurs, successfully imported lines are NOT deleted.
Each column which should be imported must have a header in the following form:
<attributename>[:<foreignObjectNr>][.<referenceAttribute>][|<options>]
Each header starts with the attributename of the attribute of the object matching the field.
There are three types of attributes:
Simple attributes like text or numbers do not require additional attributes.
For binary attributes the option binary
can be used.
The field value is then interpreted as the filename of the file to import into
the attribute. If the input parameter fileprefix
is set,
each filename is prefixed with the fileprefix.
If the attribute is a date, the field must contain a timestamp in seconds since January 1, 1970 00:00:00 GMT.
References require an additional, dot-separated reference attribute name.
This is the attribute name of the referenced object type, by which the referenced
object is searched. If the option create
is given, a new
referenced object is created, if it is not found.
For example, using the following header
company.name|create
the import action will search for companies by name using the values of the column fields
and store the reference in the attribute company
. If the company is
not found, a new company by the given name is created.
If the attribute is a foreign link, a reference attribute name and a foreign object number must be given. The object number can be any number and is used to group columns.
For each distinct object number, a new foreign object is created, if any of the columns in a row contains a value. Each attribute of the foreign object can itself be a simple attribute or a reference.
For example, the following header
job:1.name; job:1.category.name; job:2.name; job:2.category.name
will create up to two foreign objects per row, each with an attribute name and category, which
is itself a reference to a category object which is searched by the field name
.
One or more ranges of lines can be specified which should be skipped when reading the content. There are three possible ranges:
A single line number <nr>
A range of lines with lower and upper bound <min>-<max>
An upper limit, <max>+
Ranges can be separated by semicolons.
For example, the following line
1;3-5;50+
skips the first line, lines 3 to 5, and all lines after the 50th line, including line 50. Therefore, the second line is interpreted as header, and lines 6 to 49 are imported.
Table 4.98. Parameters: CSVDataImportAction
Name | Type | Default | Description |
---|---|---|---|
csv | String or Reader | (required) | The CSV content to be imported. |
objecttype | Integer | (required) | The object type id of the main objects to import. |
delimiter | String, 1 character | " | The text delimiter character. |
separator | String, 1 character | ; | The field separator character. |
skiplines | String | A list of ranges of lines to skip. | |
fileprefix | String | A path which is used to prefix binary file names. | |
loglevel | String | info | The maximum log message level to include in the response. Possible values are 'error', 'warn' and 'info'. |
datasource | String/WriteableDatasource | The datasource to use to store objects, either the datasource itself or the id of the datasource. The datasource must be a WriteableDatasource on the contentrepository. If the parameter is not set, the default datasource for the current module is used. |
Table 4.99. Response Objects: CSVDataImportAction
Name | Type | Description |
---|---|---|
createdids | Array of String | An array of all contentids as Strings which were created during the import, including reference objects. |
logmessages | String | The detailed logmessages of the import as String. |
The Datasource Action allows storage of objects to a WriteableDatasource and loading from a Datasource. It performs either "insert", "update", "save", "delete", "load" or "create". Where save is a method that will figure out if to insert or update itself, if possible.
Table 4.101. Parameters: DatasourceAction
Name | Type | Default | Description |
---|---|---|---|
operation | String | (required) |
Operation to be performed. One of:
|
datasource | String | datasource of the portlet | Id of the datasource to use for the action. |
object | Object | NULL | Object which has to be modified. Can also be a collection of objects. Required for operation "update", "insert", "save" and "delete". |
rule | String | NULL |
Rule to load objects, may be empty to
load objects by primary key (
contentid
for datasources of type
ContentRepository
).
|
sortby | String | NULL | Name of the sorted attribute when loading objects by rule. When not set, the objects are not sorted. |
sortorder | asc or desc | asc | Sortorder, when objects are loaded by rule and sortby is set as well. |
prefill | String | NULL | Name of an attribute that will be prefilled for objects loaded by rule. Prefilling attributes increases the performance when accessing them later. This parameter can be used multiple times for prefilling more than one attribute. Please note that prefilling attributes will only increase performance when handling large amounts of data. For example: when using prefill to retrieve 10 of the latest news items, you may experience performance drawbacks. On the other hand fetching the whole load of news items from the last two years will be a lot faster. |
channel | Integer (or List of Integers) | NULL |
When the datasource is a Multichannelling ContentRepository (MCCR),
this parameter will set the channel(s) to be used in the action. Using
this parameter will not change the user session setting for the
selected channels, which can be modified with the portal property path portal.datasources.[id].channel . |
* | * | NULL | Any other request parameters are set to created objects as attributes. |
Table 4.102. Response Objects: DatasourceAction
Name | Type | Description |
---|---|---|
objects | Collection | loaded/created objects always as collection (even if no or only one object is returned). Empty collection when no object is returned. |
object | Object | First (or only) loaded/created object as single Resolvable, NULL when no object is returned |
The download action can be used to initiate a file download via a DownloadComponent. See Section 2.2.7.3.3, “DownloadComponent” for details.
Table 4.104. Parameters: DownloadAction
Name | Type | Default | Description |
---|---|---|---|
content | String, binary data or Stream | {required} | The content to download. |
contenttype | String | NULL | The contenttype (mimetype) of the content to download. |
component | String | {required} | Id of the DownloadComponent to use |
disposition | "attachment"|"inline" | attachment | Type of the download. |
filename | String | NULL | Filename to use for the download. |
No Response Objects.
No Return values.
The EchoAction simply prints all its parameters into the
logfiles. This can be used during development of pluggable
actions for debugging purposes. The log messages are generated
with the log-level INFO
, but there is no
need to reconfigure the logging since the log-level is
temporarily set to INFO
in the EchoAction
which will enforce the output, no matter what loglevel is
configured otherwise. The output consists of the name of the
parameter, the String representation of its value and the java
classname.
Table 4.105. Parameters: EchoAction
Name | Type | Default | Description |
---|---|---|---|
* | * | NULL | All parameters are just printed into the logfiles. |
No Response Objects.
![]() | Note |
---|---|
This action is deprecated. The more general Form2ObjecAction ( Section 2.2.8.13, “Form2ObjectAction” ) should be used instead. Remember to correct the parameter from objecttype to obj_type when you upgrade to the new action. |
This Action maps the content of a given form to a contentrepository object. the id's of the components must equal the objects attributenames. The form must have a contentid component (usually hidden) to recognize an existing contentobject. Otherwise a new ContentObject will be created.
Table 4.107. Parameters: Form2CNObjectAction
Name | Type | Default | Description |
---|---|---|---|
objecttype | Integer | (required) | the contentrepository objecttype used for creating the object |
datasource | String | portlet's default datasource | the datasource where the given objecttype is located |
Action to transform the content of a view into an object for further processing like saving.
It takes a form and maps it to an object according to the given set
of instructions. The created object will either be instanciated
from the given objectclass
or will be
created from the given datasource
,
which must be a WriteableDatasource. One of them is
required.
Depending on the type of created object, some additional
parameters might be needed. When the object shall be created for a
datasource of type contentrepository
,
the obj_type
must be given to specify
the object type, otherwise the creation would fail. Additionally
if the object is created for an existing object in the repository,
the contentid
has to be provided, which
is typically be done with a hidden component in the form.
Table 4.110. Parameters: Form2ObjectAction
Name | Type | Default | Description |
---|---|---|---|
objectclass | String | NULL | Class the new object is instanciated from. The class has to implement Changeable and has to have a default Constructor. |
datasource | String | Datasource of the portlet. | Datasource for which the object shall be created (if
no objectclass is
given). |
view | String | the current view | Id of the view which shall be filled into the object.
This may also be the id of a NestedFormComponent in the
form
[viewid].[nestedformcomponentid]
|
* | * | NULL | Any other request object is set to the created object as attribute. |
obj_type | String | required (ContentRepository objects only) | The TypeId of the object to create. |
The GeneralViewAction can be used to perform several tasks on views or on the portal itself: It can clear a view, switch to another view and set view or portal properties.
Table 4.113. Parameters: GeneralViewAction
Name | Type | Default | Description |
---|---|---|---|
clearview (multiple) | String | NULL |
Id of the view to be cleared. This may also be the id of a NestedFormComponent in the form. The full path notation provides the parameter module to specify a ViewPortlet. This is useful if you want to clear Views in other portlets. Wildcards are also possible. The calling ViewPortlet is that ViewPortlet that contains the View with the GeneralViewAction that invokes clearview. The short notation will only invoke clearview on the Views of the calling ViewPortlet Syntax for the notation. The round brackets include an optional extension of the notation: (portal.modules.[moduleid].plugins.viewplugin.views.)[viewid][*].[nestedformcomponentid][*]
. |
showview | String | NULL | Id of the view to be shown next. This may also be the id of
a NestedFormComponent in the form
[viewid].[nestedformcomponentid]
. |
hideview (multiple) | String | NULL | Id of the NestedFormComponent to hide. Must be of the
form
[viewid].[nestedformcomponentid]
. |
set (multiple) | String | NULL |
Set command for modification of a property. See Section 7, “Property Setters”
for details. If you want to modify eg. a text component's
contents you can use it's data property to add your custom
text:
It is possible to resolve variables before the set is actually executed by using the syntax ${resolvable.path}. See Example 4.38, “GeneralViewAction Usage Example”. Using this syntax it is possible to resolve all properties from within the “ActionContext” (Section 2.2.8.2.1). |
No Response Objects.
No Return values.
![]() | Note |
---|---|
Please pay special attention to the fact that action parameters are not bound to be processed as listed. In fact if you use two "set" parameters where the second depends on the first you have to use two General View Actions to maintain correct execution sequence. |
Example 4.38. GeneralViewAction Usage Example
<action class="GeneralViewAction"> <parameters> <parameter id="clearview">editview</parameter> <parameter id="showview">editview</parameter> <!-- Setting a static value --> <parameter id="set">views.editview.components.textfield.data = "Some static value"</parameter> <!-- Setting a variable value --> <parameter id="set">views.editview.components.textfield.data = portal.vars.now</parameter> <!-- Use some crazy way to set portal.vars.now (containing the current date) --> <parameter id="set">views.editview.components.textfield.data = "now"</parameter> <!-- the textfield now contains the string 'now' so use this to resolve portal.vars.now --> <parameter id="set">views.editview.components.textfield.data = portal.vars.${views.editview.components.textfield.data} </parameter> <!-- The above example is of course only for demonstration, in reality it is 1.) completely useless and 2.) not guaranteed to work because the order in which 'set' commands are executed is undefined. --> </parameters> </action>
This action can be used to call Imp methods as action. See Section 1, “Imps” for information about IMPs.
Table 4.114. Parameters: ImpEncapsulateAction
Name | Type | Default | Description |
---|---|---|---|
imp | String | (required) | Id of the IMP to be used. - Can also be a direct reference to an Imp you've obtained through #getImp or #returnImp |
method | String | (required) | Name of the method to call from the Imp. See the Documentation of the Imp you are calling for a description of methods.
There are two special methods #getImp and #returnImp - If you want to use an Imp which is not stateless and you need to call several methods on the same Imp instance you can use #getImp to get an imp (returned in the response object as 'imp') and #returnImp to return it (you always need to call #returnImp when you are done using an imp you obtained with #getImp). |
param1 (param2,param3,..) | Object (depending on imp method) | NULL | Depending on the imp method you want to invoke the number of param1 (param2,param3) and the type may differ. |
paramCount | Integer | (optional) | If you want to pass null values as parameters, you can set this to the number of parameters the method you want to call has. Otherwise all param1,2,3,.. values will be taken until the first null value. |
Table 4.115. Response Objects: ImpEncapsulateAction
Name | Type | Description |
---|---|---|
result | Object | The result returned by the invoked method. |
Table 4.116. Action: ImpEncapsulateAction - Return Values
TRUE | If the method was invoked successfully |
FALSE | If an error occured (e.g. an exception when invoking the method, or if the parameters couldn't be converted. |
Example 4.39. Example Usage of ImpEncapsulateAction
<action class="ImpEncapsulateAction" id="regexpexample"> <parameters> <parameter id="imp">string</parameter> <parameter id="method">regexp</parameter> <parameter id="param1">Hello Regexp</parameter> <parameter id="param2">Reg.*</parameter> <parameter id="param3">World</parameter> </parameters> </action>
The above example uses the Section 1.5, “String Formatter” to rewrite the input 'Hello Regexp'. You can afterwards access the value of the action through actions.regexpexample.result within following action.
Returns JSON code from a Callable Action.
Table 4.117. Parameters: JsonCallableActionResponseAction
Name | Type | Default | Description |
---|---|---|---|
* | Object | NULL | The content that should be returned to the client. The data is encoded as JSON. |
This Action will take a Resolvable Object and transfer it to the fiels of a form according to given set of instructions.
Table 4.120. Parameters: Object2FormAction
Name | Type | Default | Description |
---|---|---|---|
object | Object | (required) | Object that will be displayed in the Form. |
view | String | (required) | Id of the view that will be filled with data of the
object. This may also be the id of a NestedFormComponent
in the form
[viewid].[nestedformcomponentid]
. |
activateview | Boolean | false | If set to true the view will be activated after values have been successfully set. |
clearview | Boolean | false | If set to true the view will be cleared before values are filled. |
No Response Objects.
Extracts the text content from PDF documents.
Table 4.122. Parameters: PDF2TextAction
Name | Type | Default | Description |
---|---|---|---|
InputStream or String | (required) | PDF document to be converted into a String. | |
maxpdffilesize | Integer | 10 MB | Maximum allowed filesize of the PDF document in bytes. Note that this limit is not effective if it is larger than the overall upload limit for the portal. |
Returns plain text from a Callable Action.
Table 4.125. Parameters: PlainCallableActionResponseAction
Name | Type | Default | Description |
---|---|---|---|
* | String | NULL | The content that should be returned to the client. If more that one parameter is specified, the contents of all parameters are simply concatenated. |
Renders the given template source. Returns the render result and all objects in the template context after the template was rendered. This provides the possibility to generate objects in the template that can be used later. You can also use the RenderTemplateAction for scripting which may come in handy.
Table 4.128. Parameters: RenderTemplateAction
Name | Type | Default | Description |
---|---|---|---|
template | String | (required) | Source of the template to be rendered. See Section 11.4, “TemplateEngine2” . |
scriptEngine | String | (optional) | Scriptengine to use. Options are "Velocity" or "JavaScript". Defaults to Velocity when undefined. The JSR-233 compliant JavaScript Engine requires Sun JDK 1.6 or higher. There is a Programmer's Guide as well. |
* | * | NULL | Any other request object is provided in the template/script context under its name. |
Resolves all specified paths for the given object into a map.
Returns the generated map as result
.
Table 4.131. Parameters: Resolvable2MapAction
Name | Type | Default | Description |
---|---|---|---|
object | Object | (required) | The object from which the attributes shall be resolved. |
attribute | String | The name of the attribute that should be resolved from the object. |
The RuleSearchAction restricts the objects shown in a DatasourceListComponent by setting the configured rule. When called the action will set the given searchrule for the DatasourceListComponent of the searchview. The searchrule will resolve the baseobject "data." to all additional request parameters given to the action. The values can be included directly (data.[name]) or converted into a search pattern for comparisons with LIKE (data.[name]_pattern). Finally the searchview is activated.
Table 4.134. Parameters: RuleSearchAction
Name | Type | Default | Description |
---|---|---|---|
searchview | String | (required) | Id of the view holding a datasourcelistcomponent |
component | String | NULL | Id of the datasourcelistcomponent in the searchview that will show the search results. |
searchrule | String | (required) | Rule that will be set as filterrule for the datasourcelistcomponent of the searchview. |
* | * | NULL | any other request object can be used inside the
searchrule as
data.[parameterid] or
data.[parameterid]_pattern
|
No Response Objects.
This Action is an alias for the Section 2.2.8.20, “RenderTemplateAction” . It can be used to execute scripting code and return created variables as well.
The SendMailAction is used to send emails.
![]() | Note |
---|---|
All e-Mail adresses have to be formatted following the specification RFC 822 (see http://www.ietf.org/rfc/rfc822.txt). |
Table 4.136. Parameters: SendMailAction
Name | Type | Default | Description |
---|---|---|---|
mailhost | String | (required) | Mail Host to be used to send mails. |
mailport | Integer | 25 | Port of the mail server |
username | String | NULL | Optional username for authentication against the mail server |
password | String | NULL | Optional password for authentication against the mail server |
starttls | Boolean | false | Flag to use STARTTLS |
to | String, Object or List of Objects | (required) | Recipients of the mail. |
toemail | String | NULL | Name of the attribute holding the email address, when
to is given as
Object(s). |
cc | String | NULL | CC of the mail. |
from | String | (required) | Sender of the mail |
envelopefrom | String | NULL | Sender of the mail |
subject | String | (required) | Subject of the mail. This may be a template and may contain all given action parameters under their respective names. See Section 11.4, “TemplateEngine2” |
body | String | (required) | Mail body. This may be a template and may contain all given action parameters under their respective names. See Section 11.4, “TemplateEngine2” |
* | * | NULL | Any additional parameters are provided to the
template contexts for
subject and
body . |
No Response Objects.
![]() | Tip |
---|---|
You can use Portal Properties (see Section 8.2.21, “Portal Properties”
) to configure properties like
|
Sends a HTTP Redirect response to the client. (Can only be used for absolute URLs). Make sure you execute this action before the rendering starts, e.g. putting this action in the onview-section of a view will cause an error.
Table 4.138. Parameters: SendRedirectAction
Name | Type | Default | Description |
---|---|---|---|
url | String | (required) | Absolute URL to redirect to. |
No Response Objects.
Stores binary or String data into a file.
Table 4.140. Parameters: StoreFileAction
Name | Type | Default | Description |
---|---|---|---|
content | Stream, byte array or String | (required) | Content to store into the file. |
filename | String | (required) | Name of the created file. |
temporary | Boolean | false | Whether the file shall be a temporary file or not. Temporary files will internally get new filenames and will never overwrite existing files. |
directory | String | Session temporary path (or ${java.io.tmpdir} if not called within a portal session). | Absolute path of the directory where to store the file. |
Table 4.141. Response Objects: StoreFileAction
Name | Type | Description |
---|---|---|
filepath | String | Absolute path of the stored file. |
fileinformation | Object |
FileInformation object holding additional data of the stored file. This object can be passed to a “FileUploadComponent” (Section 2.2.7.2.6) to provide download links for the stored file. The FileInformation object has the following properties
|
Generates a word-based diff between two strings. All templates for rendering modifications support the following template variables:
$add
: added content
$addsource
: source code of the added content (special characters are html encoded)
$remove
: removed content
$removesource
: source code of the removed content (special characters are html encoded)
$before
: content before the modification
$after
: content after the modification
Table 4.143. Parameters: TextDiffAction
Name | Type | Default | Description |
---|---|---|---|
text1 | String | (required) | Original version of the string. |
text2 | String | (required) | Modified version of the string. |
addtemplate | String | <ins class="diff">$add</ins> | Template for rendering add text parts. |
removetemplate | String | <del class="diff">$remove</del> | Template for rendering removed text parts. |
changetemplate | String | <del class="diff modified">$remove</del><ins class="diff modified">$add</ins> | Template for rendering modified text parts. |
showhtml | Boolean | FALSE | Whether to show html tags in the diff. When set to TRUE , the rendered output will show the html source code. |
ignoreregex | String | NULL | Regular expression of text parts that shall be ignored when diffing (e.g. timestamps, ...). |
wordsbefore | Integer | 10 | Number of words before a modified text part to be contained in the template variable $before . |
wordsafter | Integer | 10 | Number of words after a modified text part to be contained in the template variable $before . |
The TriggerEventAction triggers an event that can be caught in the module using the views. All configured parameters are set as event properties and can be used in the module.
Table 4.146. Parameters: TriggerEventAction
Name | Type | Default | Description |
---|---|---|---|
event | String | (required) | command of the event to be triggered. This will trigger the event |
* | * | NULL | Any additional parameters are set as event properties. |
No Response Objects.
No Return values.
The TriggerPortalEventAction is an alternative of the TriggerEventAction, which allows full control of the event path.
Table 4.147. Parameters: TriggerPortalEventAction
Name | Type | Default | Description |
---|---|---|---|
path | String | (required) | Full path of the triggered event. |
* | * | NULL | Any additional parameters are set as event properties. |
No Response Objects.
No Return values.
The URLLoaderAction loads a file from the given url. URL can be a file:///, http://, https:// or anything else supported by java. See the javadoc for the class URLConnection for more information.
Table 4.148. Parameters: URLLoaderAction
Name | Type | Default | Description |
---|---|---|---|
url | String | (required) | The URL to be used to download the file. |
method | String | GET | (Only for HTTP URLs) Method to be used in the request (GET,POST,HEADER,etc.) |
timeout | Integer | 10 | After how many seconds the action should give up trying to connect to the given URL. |
readTimeout | Integer | 10 | After how many seconds the action should give up on downloading from the given URL. |
postparameters | String | (not set) | (Only for HTTP URLs) The POST parameters sent in the body of an HTTP request. (e.g.: key1=value1&key2=value2) |
encoding | String | Default System Encoding or Content-Type when loading from HTTP | Can be either any encoding supported by Java (e.g. UTF-8) or "binary" - if it is "binary" the response object "content" will contain a byte array instead of a String |
headers | Collection (String) or Map (String, String) | (not set) | Additional headers that will be sent with the request. Unless a Map (String, String) is specified, each entry must contain the name and value of the header, delimited by a colon (e.g. "x-device-type: Blackberry 9000"). |
Table 4.149. Response Objects: URLLoaderAction
Name | Type | Description |
---|---|---|
content | String or byte[] | The content fetched from the URL - depending on 'encoding' either String or byte[] (for binary) |
size | Integer | Size of the content in characters |
headers | Map (String, Collection (String)) | (Only for HTTP URLs) The header properties of the response. |
filename | String | Name of the loaded file (either from the response header Content-Disposition or guessed from the URL). |
contenttype | String | Content type (mime-type) of the loader file (either from the response or guessed from the file name). |
Transforms a given XML source string using a given XSLT.
Table 4.151. Parameters: XSLTRenderAction
Name | Type | Default | Description |
---|---|---|---|
xmlsource | String | (required) | The XML source to be transformed using XSLT. |
xslt | String | (required) | XSLT used to transform the XML source string. |
Callable Actions are actions that can be triggered
by client AJAX requests. Each Callable Action can contain
multiple Pluggable Actions (see Section 2.2.8, “Pluggable Actions”),
which are used to perform the desired actions. By using
specialized Pluggable Actions, namely the
PlainCallableActionResponseAction
(see Section 2.2.8.19, “PlainCallableActionResponseAction”)
and the JsonCallableActionResponseAction
(see
Section 2.2.8.16, “JsonCallableActionResponseAction”),
the response to the client is constructed.
<callableactions> <callableaction id=""> <actions> ... </actions> </callableaction> </callableactions>
Callable Actions are accessible in view
and component templates using
$form.callableactions.[actionid]
.
The URL string of the Callable Action is provided as
$form.callableactions.[actionid].url
.
You may prefer using a ResourceURL as object, which can be
generated by using
$form.callableactions.[actionid].resourceUrl
. With the resourceurl object, it is possible to add additional parameters to the URL.