Configuration Files - Table Definition

The example table below illustrates how to define an XML based table.

<?xml version="1.0" encoding="UTF-8"?>
<Table>
    <Column>
        <Expression>name</Expression>
        <Name>name</Name>
    </Column>
    <Column>
        <Expression>${to[relationship_PurchaseOrder].from.name}</Expression>
        <Name>customer</Name>
    </Column>
    <Column>
        <Expression>originated</Expression>
        <Name>created</Name>
    </Column>
    <Column usesBusinessObject="false">
        <Expression>${attribute[attribute_NumberOfUsers]}</Expression>
        <Name>count</Name>
    </Column>
    <Column>
        <Expression>${attribute[attribute_Notes]}</Expression>
        <Name>notes</Name>
    </Column>
    <Column>
        <Expression>current</Expression>
        <Name>status</Name>
        <Setting name="name of custom setting">value</Setting>
    </Column>
</Table>

Column Definition in a separate file

Table column definitions could be defined in separate files and referenced from the table definition. The separate column definitions enable you to have a single definition for a column used throughout the application.

<Column ref="tvc:tablecolumn/MyColumn.xml" />

Parts of a referenced column could be overridden in the context of a table definition simply by defining the parts to change within the referenced column element.

The example below will change the label of the referenced column in the context of the xml table definition:

<Column ref="tvc:tablecolumn/MyColumn.xml">
    <Label>Overridden label</Label>
</Column>

Apply on Relationships

By default, a column expression applies to the business object. If you want it to apply on the relationship, use the attribute usesBusinessObject on the <Column> element.

<Column usesBusinessObject="false">
    <Expression>${attribute[attribute_NumberOfUsers]}</Expression>
</Column>

Escaping Characters

When entering certain characters that is sensitive in XML documents, like "<", ">", "&" etc., these must be escaped. There are two ways to do this:

<Expression>$&lt;attribute[attribute_Test]&gt;</Expression>

Or using the CDATA:

<Expression><![CDATA[$<attribute[attribute_Test]>]]></Expression>

You can choose either of these approaches.

Child Elements for Table

The table below shows the sub elements that are supported for a Table element.

Name Description Example

Column

Container element for the column definition

-

Child Elements for Column

The table below shows the sub elements that are supported within the column element.

A large amount of available child elements / settings has been omitted here since they only apply to usage in the scope of a user-interface with input fields etc.

Only the relevant child elements / settings for TIF is mentioned here. If you are reusing tables / columns from your TVC based ENOVIA/3DEXPERIENCE application, you may have used other child elements / settings not documented here.

Element Name Description Example

AccessExpression

Defines the setting "Access Expression"

<AccessExpression>policy == �Test�</AccessExpression>

AccessFunction

Defines the setting "Access Function"

<AccessFunction>checkAccess</AccessFunction>

AccessMask

Defines the setting "Access Mask"

<AccessMask>read</AccessMask>

AccessProgram

Defines the setting "Access Program"

<AccessProgram>MyAccessProgram</AccessProgram>

AdminType

Defines the setting "Admin Type"

<AdminType>Type</AdminType>

Alt

Defines the alternate message. The alternate message can be defined in multiple languages.

<Alt>Add</Alt> <Alt locale="sv">L�gg till</Label> <Alt localt="de">Addieren</Label>

AlternateOIDExpression

Defines the setting "Alternate OID Expression"

<AlternateOIDExpression>from[EBOM].to.id</AlternateOIDExpression>

AlternateTypeExpression

Defines the setting "Alternate Type Expression"

<AlternateTypeExpression>from[EBOM].to.type</AlternateTypeExpression>

AlwaysVisible

This setting is used to disallow hiding the column.

True or False (Default)

CalculateAverage CalculateMaximum CalculateMedian CalculateMinimum CalculateStandardDeviation CalculateSum CalculationDecimalPrecision

These settings can be used to apply table calculations of the cells within the column.

True or False (Default)

CellShowableExpression

Defines the setting "Cell Showable Expression"

<CellShowableExpression>current != �Release�</CellShowableExpression>

CheckFromAccess

Defines the setting "Check From Access"

<CheckFromAccess>true</CheckFromAccess>

CheckToAccess

Defines the setting "Check To Access"

<CheckToAccess>false</CheckToAccess>

ColumnType

Defines the setting "Column Type"

<ColumnType>program</ColumnType>

DataHandlerClass

Defines the setting "Data Handler Class"

<DataHandlerClass>my.package.MyDataHandler</DataHandlerClass>

Description

Defines the description of the column. The description can be defined in multiple languages.

<Description>The description</Description> <Description locale="de">�</Description>

Expression

Defines the expression for the column

<Expression><![CDATA[$<attribute[attribute_Currency]></Expression> <Expression>name</Expression>

Format

Defines the setting "Format"

<Format>integer</Format>

Function

Defines the setting "Function"

<Function>myFunction</Function>

GroupHeader

Defines the group header for a column.

<GroupHeader>The group header</GroupHeader> <GroupHeader locale="sv">Swedish value</GroupHeader>

Hidden

Defines the setting "Hidden"

<Hidden>false</Hidden>

Label

Defines the label for column. The label can be defined in multiple languages.

<Label>Add</Label> <Label locale="sv">L�gg till</Label> <Label locale="de">Addieren</Label>

PreserveOutput

Defines the setting "Preserve Output"

<PreserveOutput>false</PreserveOutput>

Program

Defines the setting "Program"

<Program>MyProgram</Program>

RegisteredSuite

Defines the setting "Registered Suite"

<RegisteredSuite>Framework</RegisteredSuite>

Setting

Defines a custom setting

<Setting name="Name of Setting">Value</Setting>

Sortable

Defines the setting "Sortable"

<Sortable>true</Sortable>

SortComparator

Defines the setting "Sort Comparator"

<SortComparator>my.package.MyComparator</SortComparator>

SortDirection

Defines the setting "Sort Direction"

<SortDirection>ascending</SortDirection>

SortOrder

Defines the setting "Sort Order"

<SortOrder>1</SortOrder>

SortType

Defines the setting "Sort Type"

<SortType>numeric</SortType>

Translate

Defines the setting "Translate"

<Translate>true</Translate>

User

Adds a user (person, role or group) that has access to the command or menu.

<User name="Test Everything"/> <User name="role_GlobalUser"/>

UseRule

Defines the setting "Use Rule"

<UseRule>true</UseRule>

Visible

Defines the setting "Visible"

<Visible>true</Visible>

VisibleInEditMode

Defines the setting "Visible In Edit Mode"

<VisibleInEditMode>false</VisibleInEditMode>

VisibleInFlatMode

Defines the setting "Visible In Flat Mode"

<VisibleInFlatMode>true</VisibleInFlatMode>

VisibleInReadMode

Defines the setting "Visible In Read Mode"

<VisibleInReadMode>true</VisibleInReadMode>

VisibleInStructureMode

Defines the setting "Visible In Structure Mode"

<VisibleInStructureMode>false</VisibleInStructureMode>

Job Parameters in Data Handler Class

In data handler class, job parameters are accessible from environment request map. For example:

import java.util.Map;

import com.technia.tvc.core.db.table.evaluator.DefaultDataHandler;
import com.technia.tvc.core.db.table.evaluator.EvaluatedData;
import com.technia.tvc.core.gui.table.Cell;

public class MyDataHandler extends DefaultDataHandler {

    @Override
    public void populateCell(Cell cell, EvaluatedData data) {
        Map<String, String[]> requestMap =  data.getEnv().getRequestMap();
        if(requestMap.containsKey("myParam")) {
            // Read value
        }
    }

}