Portlet Factory, Version 6.1.2
Data definition properties
In using the Rich Data Definition builder, you can include various data definition properties in data definition XML files. These properties are not exposed in the builder call editor, however. To use these properties, add them directly to the XML file. A sample model that incorporates data definitions and illustrates these techniques can be found at the following location.
WEB-INF/models/samples/datapage/RichDataDefinition.modelA corresponding XML file is located in the project to which you add the Tutorials and Samples - Applications feature set. This file is in the following directory:.../workspace_name/project_name/samples/datapage/orders.XMLThe following data definition properties are found in data definition XML files.
- <Attributes>
- Attributes takes an XML value which is the same as the Data Field Modifier builder takes. A typical Attribute property looks as follows:
<Attributes> <Attribute> <Name>color</Name> <Value>black</Value> </Attribute> <Attribute> <Name>size</Name> <Value>${Variables/CurSize}</Value> </Attribute> </Attributes>- <ColumnAlignment>
- Takes one of the following values:
- left
- right
- center
- <ColumnSorting>
- Takes one of the following values:
- Case Insensitive String
- Case Sensitive String
- Number
- Date
- Not Sortable
A typical data definition element using some of the above properties to set column width, alignment, sorting status and style might look as follows:
<DataDefinitionElement name="DATE_SHIPPED" base="base_SAPDate"> <Label>Date Shipped</Label> <Required>false</Required> <ColumnWidth>400</ColumnWidth> <ColumnAlignment>right</ColumnAlignment> <ColumnSorting>Case Sensitive String</ColumnSorting> <Attributes> <Attribute> <Name>style</Name> <Value>color:red</Value> </Attribute> </Attributes> </DataDefinitionElement>- <ColumnWidth>
- Takes a number that represents the width of the column in characters.
- <ControlElementModifiers>
- This property lets you associate modification builders (for example, Attribute Setter or Visibility Setter) to an element. Similar to the DataEntryControl and DisplayControl properties, it can be used to invoke any builder that uses a Page Location input. You can include multiple builders for a single element. And you can control whether the builder is used for display fields using the usemodifierdisplay attribute or for data entry fields using the use_modifier_dataentry attribute. The following is an example of invoking the Attribute Setter builder in both display mode and data entry mode:
<ControlElementModifiers> <BuilderCall use_modifier_dataentry="true" use_modifier_display="true"> <BuilderDefID>com.bowstreet.builders.webapp.AttributeSetterBuilderBuilderDefID>com.bowstreet.builders.webapp.AttributeSetterBuilder></BuilderDefID> <Inputs> <Input name = "BuilderCallEnabled">true</Input> <Input name = "HandleExisting">Skip</Input> <Input name = "HandleMissingValue">Ignore</Input> <Input name = "Separator">;</Input> <Input name = "Attributes"> <top> <Attribute> <Name>style</Name> <Value>color:red</Value> </Attribute> </top> </Input> </Inputs> </BuilderCall> </ControlElementModifiers>- <DataEntryControl>
- This property associates a builder ID with a field, when the field is on a data entry page (see Display Control for view-only pages). You can specify both the builder ID and any builder inputs that are needed. To create XML for the builder inputs, you can use the builder you want in a model, then go to the Model XML view, then copy/paste from the "Inputs" section of the XML.
Note: The builder must support an indirect reference input, Value, in order to be used. For example:
<DataEntryControl>com.bowstreet.builders.webapp.TextAreaBuilder</DataEntryControl> <DataEntryInputs> <Inputs> <Input name = "Wrap">off</Input> <Input name = "Cols">80</Input> <Input name = "Rows">5</Input> </Inputs> </DataEntryInputs>- <DisplayControl>
- This property is similar to Data Entry Control, but for view-only pages. The corresponding element name for builder inputs is called <DisplayInputs>.
- <DisplayMode>
- Allowable values are:
- 0 - DISPLAY_NONE
- 1 - DISPLAY_AUTO
Additional values for container fields include:
- 2 - DISPLAY_VERTICAL
- 3 - DISPLAY_HORIZONTAL
- <EnumerationValues>
- You can use this property to set the choices for a field that has a set of possible values. This property does not provide for separate text/values such as lookup table does.
See note below regarding localization of enumeration values.
A typical use this property might look as follows:
<EnumerationValues> <Value>Shipped</Value> <Value>Out of Stock</Value> <Value>Returned</Value> <Value>In Process</Value> </EnumerationValues>- <FormatterClass>
- You can use this property to specify a custom formatter class in a Rich Data Definition file. The formatter class uses the same mechanism and interface as is Data Field Modifier builder.
The name of the formatter class is specified with a FormatterClass element as shown below.
<DataDefinition name="AMOUNT" base="base_Currency"> <Label>Amount</Label> <ColumnSorting>Case Sensitive String</ColumnSorting> <ColumnWidth>100</ColumnWidth> <ColumnAlignment>right</ColumnAlignment> <FormatterClass>com.bowstreet.builders.webapp.pageautomation.StandardFormatter</FormatterClass> <FormatExpr resource_key="BaseDate_FormatExpr">Format(yyyy-MM-dd$MM/dd/yyyy)</FormatExpr> <TranslateExpr resource_key="BaseDate_TranslateExpr">Translate(yyyy-MM-dd$MM/dd/yyyy)</TranslateExpr> <ValidateExpr>Date(yyyy-MM-dd)</ValidateExpr> </DataDefinition>Substitute the specification of your class for the StandardFormatter. If you omit a FormatterClass element, the StandardFormatter class is used.Substitute the FormatExpr, TranslateExpr, and ValidateExpr elements appropriate for your data definition.
- <InitialValue>
- This can be used to define a default initial value for a field. It is equivalent to setting the Initial Value input of the Data Field Modifier builder.
- <LookupTable>
- You can use this property to create a lookup table and associate it with a field. To create a new lookup table, specify the builder's ID, and the builder must be one that creates a lookup table in the WebApp (Lookup Table, Domino Keyword Lookup, or SAP Help Values). Specify all the required builder inputs in the Inputs element as shown below.
This example code creates a lookup from XML data using the Lookup Table builder. This functionality has also been used to automatically create and apply an SAP Help Values lookup.
<DataDefinitionElement name="BILLING"> <Label>Billing</Label> <LookupTable> <BuilderID>com.bowstreet.builders.webapp.LookupTableBuilder</BuilderID> <Name>billing</Name> <Inputs> <Input name = "DataType">NewXmlData</Input> <Input name = "GetDataFrom">BuilderInput</Input> <Input name = "TablePosition">InFront</Input> <Input name = "Name">billing</Input> <Input name = "NewXmlData"> <lookup> <entry> <name>Purchase Order</name> <value>1</value> </entry> <entry> <name>Credit Card</name> <value>0</value> </entry> </lookup> </Input> <Input name = "ValueElementName">value</Input> <Input name = "LabelElementName">name</Input> </Inputs> </LookupTable> </DataDefinitionElement>- <Properties>
- Use this property to set any named property on a DataDefinitionElement. This tag is designed primarily for people making their own builders, when they want to add new properties to the data definition and to access those properties from builder code. The Properties element looks as follows:
<DataDefinition name="AMOUNT"> <Label>Amount</Label> <Properties> <Property name="ColumnWidth">100</Property> <Property name="ColumnAlignment">right</Property> </Properties> </DataDefinition>In this example the name= attribute specifies the property name and the element text contains the property value.Note: The technique illustrated in this example has the identical effect as using the ColumnWidth and ColumnAlignment property tags directly.
- <ReadOnly>
- Forces a field to be treated as read-only, even when field is displayed with a Data Page that is marked Data Entry.
Note: Effect is equivalent to setting the Field Behavior to View Only with the Data Field Modifier builder.
- <Remove>
- Specify a value of true to remove a field. The field is not visible, nor is it displayed in other builders, such as the Data Column Modifier or Data Field Modifier.
Parent topic: Rich Data Definition builder
Library | Support |