Macro / free text (report component)

The Macro/Free text report component type allows you to output plain text or formatted content to the Portal. You can create the formatted contents of a macro using HTML elements.

Configuration:

Property

Description

Source

This shows which queries or attributes are configured as source. You also have the option here to reference or create queries and attributes via the text box or the buttons to the right of the text box, which determine the context objects for the macro.

Macro type

Select the macro type of the macro here:

  • Velocity Macro: The macro in the Macro property is executed.

  • Java class: the Java class in the Macro Java class property is executed.

Macro

Enter here the macro to be executed or the text to be displayed. The macro or text will be executed or displayed only if you have set the macro type Velocity Macro.

The macro is output in HTML format:

  • A velocity macro must generate HTML format.

  • Free text is converted to HTML format and output.

See also: For more on velocity macros, see Velocity macros.

Macro Java class

Enter the Java class to be executed here. The Java class must have the fully qualified name of a Java class that implements the de.aeneis.report.AeneisMacro interface and has a default public constructor. The Java class will be executed only if you have selected the macro type Java Class.

Parameters

Create and edit parameters for the macro here. In the parameter you can define a string, boolean value, date, number, object, category, attribute or text as parameter. Parameters are especially useful for use as variables.

Display

Categories can be referenced under this attribute. This can limit the visibility / execution.

Most application scenarios require category and access control related visibility.

The logic of the evaluation is as follows:

  1. If at least one category is specified, the object must be an instance of that category. Otherwise, no evaluation of the category are carried out

  2. If at least one user group is specified, the current user must be a member of at least one of these user groups

  3. If at least one Access Control List is specified, the user must have the View permission in the Access Control List

  4. If at least one condition component is specified, at least one condition must apply.

If this logic is not sufficient, a differentiated logic can be configured via the condition components.

Report objects separately If multiple context objects for the macro are returned via the Source property, this property executes the macro for each individual object. If the property is disabled, the macro will be executed for all objects together.

Note: The access to source and result lists and the parameters via a Java class is documented in the interfaces AeneisMacro and AeneisMacroContext. These are stored in the Aeneis installation directory under ..\doc\api\de\aeneis\report as html files.

The following additional variables are available for the Velocity macro:

Variable

Description

component

The macro component.

sources

The incoming context objects that are determined before the macro is executed.

parameters

All parameter objects of the macro component.

context

The macro context itself. It implements the interface de.aeneis.report.AeneisMacroContext and provides methods for accessing the parameter values.

Direct access to the parameter attributes:

$context.getString(paraname,defaultValue)

Returns the value of the parameter attribute string for the parameter named paraname.

If no parameter with this name is found, the passed string default value is returned.

$context.getBoolean(paraname,defaultValue)

Returns the value of the Boolean parameter attribute for the parameter named paraname.

If no parameter with this name is found, the passed boolean default value is returned.

$context.getDate(paraname,defaultValue)

Returns the value of the date parameter attribute for the parameter named paraname.

If no parameter with this name is found, the passed date default value is returned.

$context.getNumber(paraname,defaultValue)

Returns the value of the number parameter attribute for the parameter named paraname.

If no parameter with this name is found, the passed double default value is returned.

$context.getText(paraname,defaultValue)

Returns the value of the text parameter attribute for the parameter named paraname.

If no parameter with this name is found, the passed string default value is returned.

$context.getObjects(paraname)

Returns a set of AeneisObjects of the objects configured under the Objects parameter attribute.

If no parameter with this name is configured, an empty set is returned.

$context.getCategories(paraname)

Returns a set of AeneisCategories of the categories configured under the Categories parameter attribute.

If no parameter with this name is configured, an empty set is returned.

$context.getAttributes(paraname)

Returns a set of AeneisAttributes of the objects configured under the parameter attribute objects.

If no parameter with this name is configured, an empty set is returned.