![]() | Note |
---|---|
Rules are now deprecated and replaced by the new “ExpressionParser” (Section 10) and should not be used anymore where possible. |
Rules are readable logical rulestrings to control portal and modules functionality, as well as filter data from datasource queries, independent of the datasource type.
Example 4.46. Rule examples
Rule within a <visible> of a component: (The component will invisible if windowstate is not normal, but e.g. maximized) <visible><prule>javax.portlet.request.windowstate != "normal"</prule></visible> More complex rule for a DatasourceListComponent: <rule><![CDATA[( view.components.fromdate.unixtimestamp == "" || object.edittimestamp >= view.components.fromdate.unixtimestamp ) && ( view.components.untildate.unixtimestamp == "" || object.edittimestamp <= view.components.untildate.unixtimestamp ) ]]></rule> (This example assumes you have two DateComponents, fromdate and untildate which are used to filter the objects within a DatasourceListComponent)
Objects matched against a rule are usually provided through the variable named "object".