Custom Parameter Columns (custom_params.xml) SDD

1. Overview

An operator can add device columns and filters by listing device parameter paths in a file named custom_params.xml. Each entry becomes one column. The column shows the stored value of the listed parameters. The user can filter devices by the column.

The file format is the format of the .NET application. A custom_params.xml file of the .NET application works without a change.

Each portal has its own file: the Management portal (mc) and the Support portal (sc). A column in one file does not appear in the other portal.

2. Requirements

  • Custom columns are available in the column lists of the Device view and the Search view.

  • Custom filters are available in the Device view, the Search view and Group Update conditions.

  • The device list shows the value of each visible custom column.

  • A change of the file takes effect without a restart.

  • A missing, deleted or broken file never stops the application.

  • A custom column cannot be sorted.

  • A view that uses a column removed from the file keeps working and never returns more devices than before.

  • The feature needs no database change.

3. Architecture

custom-columns-architecture

Figure 1: Custom Parameter Columns — one column set per portal, read-only access to the parameter tables

4. Behaviour

4.1. File

Item Rule

Location

<customization path>/mc/custom_params.xml and <customization path>/sc/custom_params.xml.

Root element

<parameters>. Each child element is one column. XML comments are ignored.

name

Column label. It must not be blank and must be unique. A blank name is skipped. A second entry with the same name is skipped and the first one stays. A name longer than 243 characters is skipped.

type="integer"

Makes an integer column. Without it the column is a text column.

Path attributes

Every other attribute with a non-empty value is a parameter path (parameter, parameter2, and so on). A column can have any number of paths.

.i. in a path

Matches one instance number. A.i.B matches A.1.B and A.12.B. It does not match A.1.Stats.B.

DOCTYPE, external entities

Not allowed. The file counts as broken.

The column key is customParam:<name>. A skipped entry writes a WARN message that names custom_params.xml.

4.2. Load, Reload and Bad Files

  • The backend reads the file of each portal at start and watches it.

  • Create, edit and delete take effect without a restart.

  • A deleted or missing file gives the portal no custom columns.

  • A broken file at start gives no custom columns. The application starts and writes an ERROR message that names custom_params.xml.

  • A broken file on reload keeps the last good columns and writes the same ERROR message.

  • All file-related log messages name custom_params.xml.

4.3. Operators and Filter Rules

A device matches when at least one of its parameters of the column matches. This applies to IsNull and IsNotNull too. A device without any parameter of the column matches no operator.

Column type Operators (compare) Rules

text

Equal, StartsWith, InList, IsNull, IsNotNull

Equal compares the whole value. If a path ends with .MACAddress, Equal matches the input in lower case and in upper case. StartsWith treats _ as a plain character and % as a wildcard. InList separates the items by line breaks only. A comma is part of the value. Empty items are dropped and items are not trimmed. Empty input for Equal, StartsWith or InList matches no device.

integer

Equal, Greater, GreaterEqual, Less, LessEqual, IsNull, IsNotNull

Values are 64-bit whole numbers, negative numbers included. Empty input counts as 0. Equal compares the number as text (007 becomes 7). The four order operators compare numbers, also for negative values, on MySQL and on Oracle.

both

Any other operator, or input that is not valid for the type

Matches no device. The request succeeds without an error. A stored value that is not a number matches no integer comparison.

IsNull matches a NULL or empty stored value. IsNotNull matches any other stored value.

4.4. Matching Names

  • The system matches a path against the parameter names of the device.

  • If the matching names of the filtered column are more than 300, the system matches by name instead of by id.

  • When it reads the values of the visible custom columns, it adds up the matching names of all visible custom columns. If the total is more than 300, it matches by name.

  • The user sees the same result in both modes.

  • A row that the cell value rules exclude (for example an extra Stats segment) never matches a filter, in either mode.

  • A new parameter name is found after at most 5 minutes, or at once after the file changes.

4.5. Cell Values

The device list returns each visible custom column as a field of the device, named by the column key (customParam:<name>), next to the fixed columns. The system applies these rules to the matching parameters:

  1. Skip empty and NULL values.

  2. Decrypt encrypted values.

  3. Replace the value device_params_sub by its extended value.

  4. Drop 00:00:00:00:00:00 for names that end with .MACAddress. Drop 0.0.0.0 for names that end with .ExternalIPAddress. Other names keep these values.

  5. A parameter belongs to the first visible column (by visible index) that lists it.

  6. Order the values by update time, newest first.

  7. Remove duplicates and join the values with `, ` (comma and space).

The custom fields follow the order of the file. A column without a value has no field.

4.6. Views

  • A Device view, a Search view and a Group Update view accept custom columns and custom conditions.

  • A custom key that is not in the file of the portal is rejected on save with error 9094 (HTTP 404).

  • An Automation view and a Monitoring view reject custom keys, in columns and in conditions, with error 9094 (HTTP 404).

  • A custom key removed from the file after the view was saved is dropped from that view when the list is computed, without an error. The condition and its nested conditions are not applied.

  • The saved column stays in the view. Its label is the name after the prefix customParam:.

  • A custom column is not sortable: canSort is false. A sort on a custom column is ignored, and no sort is stored for it.

4.7. Export

The Excel export of the device list includes the visible custom columns. The CSV export and the XML export have no custom columns.

5. Test Environment Setup

No setting is required. Use the default customization settings.

Portal Path in the container Host path (compose with a bind mount)

Management portal (mc)

/opt/app/conf/customization/mc/custom_params.xml

${DATA_FOLDER}/ui-backend/config/customization/mc/custom_params.xml

Support portal (sc)

/opt/app/conf/customization/sc/custom_params.xml

${DATA_FOLDER}/ui-backend/config/customization/sc/custom_params.xml

  • The directories mc/ and sc/ exist before the start.

  • The shipped files have every entry in an XML comment. The portals then have no custom column.

  • You also need: a user for each portal, a reachable ACS database, a reachable Hazelcast, and devices whose parameter values you can set (for NULL, empty and update-time values, change the table cpe_parameter directly).

  • To see DEBUG messages, set FT_UI_BACKEND_LOG_LEVEL=debug and restart.

Example file that enables four columns. CP Uptime is an integer column.

<?xml version="1.0" encoding="utf-8" ?>
<parameters>
<parameter name="CP Software"
	parameter="InternetGatewayDevice.DeviceInfo.SoftwareVersion"
	parameter2="Device.DeviceInfo.SoftwareVersion"
/>
<parameter name="CP Uptime" type="integer"
	parameter="InternetGatewayDevice.DeviceInfo.UpTime"
	parameter2="Device.DeviceInfo.UpTime"
/>
<parameter name="CP MAC"
	parameter="InternetGatewayDevice.WANDevice.i.WANConnectionDevice.i.WANIPConnection.i.MACAddress"
	parameter2="Device.LAN.MACAddress"
/>
<parameter name="CP IP"
	parameter="InternetGatewayDevice.WANDevice.i.WANConnectionDevice.i.WANIPConnection.i.ExternalIPAddress"
	parameter2="Device.IP.Interface.i.IPv4Address.i.IPAddress"
/>
</parameters>

After a start or a change, the log shows custom_params.xml loaded clientType=mc columns=4 (or sc).

5.1. Test Data

Column and parameter Devices and stored values

CP Software, Device.DeviceInfo.SoftwareVersion

T1 1.2.3; T2 1_2; T3 1x2; T4 empty string; T5 no row; T6 no row, but 1.2.3 under Device.DeviceInfo.HardwareVersion; T7 NULL; T8 a,b

CP Uptime, Device.DeviceInfo.UpTime

U1 100; U2 007; U3 250; U4 0; U5 7; U6 -67; U7 abc; U8 5000000000

CP MAC, Device.LAN.MACAddress

M1 aa:bb:cc:dd:ee:ff; M2 AA:BB:CC:DD:EE:FF; M3 Aa:bB:cc:dd:ee:ff

Use separate devices for each row. A device outside a data set has no row for the column and never matches a custom filter.

5.2. API Reference

Every call uses the header Authorization: <token of the portal session>. The base path is /iot-webservice/iotw.

POST /iot-webservice/iotw/View/columns
{}
-> {"items":[ ..., {"columnKey":"customParam:CP Uptime","columnName":"CP Uptime",
                    "canVisible":true,"canSort":false,"canFilter":true}, ... ]}

POST /iot-webservice/iotw/View/columns          (other lists)
{"viewType":"MonitoringView"}   or "AutomationView"  -> no customParam: entry
{"viewType":"GroupUpdateView"}                       -> includes the customParam: entries

POST /iot-webservice/iotw/View/filterConditions
{"columnKey":"customParam:CP Uptime"}
-> {"items":[{"compare":"Equal","inputType":"NUMBER"}, {"compare":"Greater",...},
             {"compare":"GreaterEqual","compareName":">="}, {"compare":"Less",...},
             {"compare":"LessEqual","compareName":"<="},
             {"compare":"IsNull","inputType":null}, {"compare":"IsNotNull","inputType":null}]}
   text column: Equal (TEXT), StartsWith (TEXT), InList (TEXT_ARRAY), IsNull, IsNotNull
   unknown key: {"items":[]}

PUT /iot-webservice/iotw/View/item
{"type":"DeviceView","name":"CP test",
 "columns":[{"columnKey":"customParam:CP Software","indexVisible":0},
            {"columnKey":"customParam:CP Uptime","indexVisible":1}],
 "conditions":[]}

POST /iot-webservice/iotw/View/item             {"id":<view id>}   reads a view back

POST /iot-webservice/iotw/Device/items
{"viewId":<view id>,"pageNumbers":[1],"pageSize":50,
 "conditions":[{"columnKey":"customParam:CP Software","compare":"Equal","conditionString":"1.2.3"}]}
-> {"items":[{"id":..,"serial":"..","customParam:CP Software":"1.2.3"}],"pageDetails":{...}}

The conditions of a request are combined with the stored conditions of the view. Use a view without stored conditions for the filter scenarios. A sort is sent as "sorts":[{"field":"customParam:CP Uptime","direction":"ASC"}]. The page numbers start at 1.

6. Test Scenarios

6.1. File and Reload

ID Steps Expected API check

FR-1

Put the .NET sample file of the portal in mc/ and start. Repeat for sc/.

The log shows columns=5 for each portal. The columns are Software version, Hardware version, Uptime, MAC address, IP address.

View/columns lists them.

FR-2

Start with the shipped file.

columns=0. No custom column.

View/columns has no customParam: entry.

FR-3

Start with no file in mc/, then create the example file while running.

Start succeeds with no custom column. After the create, the four CP columns appear without a restart.

View/columns before and after.

FR-4

Edit a path of CP Software while running.

The log shows loaded …​ columns=4. The next request uses the new path.

Device/items shows the value of the new path.

FR-5

Delete the file while running.

The portal has no custom column without a restart. The application keeps running.

View/columns has no customParam: entry.

FR-6

Start with a file that is not well-formed XML.

The application starts with no custom column. The ERROR message names custom_params.xml.

View/columns has no customParam: entry.

FR-7

With the example loaded, save a broken file, then one with a <!DOCTYPE …​> line.

Each time the ERROR message appears and the four columns stay.

View/columns still lists the four columns.

FR-8

Add an entry with name="", a second CP Software, a 244-character name, and a 243-character name.

The first three are skipped with a WARN message each. The 243-character entry is a column. The first CP Software keeps its paths.

View/columns.

FR-9

Add <parameter name="CP Empty"/>.

The column is listed, has no value on any device, and every filter on it, IsNull included, matches no device.

View/columns, Device/items.

6.2. Portal Separation

ID Steps Expected API check

PS-1

mc file has only CP Software. sc file has only CP Uptime. Log in to each portal.

Each portal lists only its own column. filterConditions for the other portal key returns {"items":[]}.

View/columns, View/filterConditions.

PS-2

Edit the mc file only.

Only the Management portal changes. The Support portal does not.

View/columns in both portals.

PS-3

Both files define Shared with different paths.

Each portal returns the values of its own paths.

Device/items in each portal.

6.3. Columns, Sorting and Values

ID Steps Expected API check

CV-1

Save a Device view and a Search view with the columns CP Software (visible index 0) and CP Uptime (visible index 1, sort index 0, direction ASC). Read each back.

Both columns are returned. canSort is false. Sort index and direction of both are null.

View/item (PUT, then POST).

CV-2

Request a device list with a sort on customParam:CP Uptime, and again without a sort.

Both requests succeed and return the same order.

Device/items with sorts.

CV-3

Device X has Device.IP.Interface.1.IPv4Address.1.IPAddress = 10.0.0.1 (newer) and Device.IP.Interface.2.IPv4Address.1.IPAddress = 10.0.0.2 (older). Add a third row with 10.0.0.1, and a row Device.IP.Interface.1.IPv4Address.1.Stats.IPAddress = 9.9.9.9.

"customParam:CP IP":"10.0.0.1, 10.0.0.2". Newest first, no duplicate, no 9.9.9.9.

Device/items.

CV-4

Device.LAN.MACAddress = 00:00:00:00:00:00. …​WANIPConnection.1.ExternalIPAddress = 0.0.0.0. Device.IP.Interface.1.IPv4Address.1.IPAddress = 0.0.0.0.

The first two are dropped (no key). The third is shown as 0.0.0.0.

Device/items.

CV-5

Two columns list the same parameter. The view shows column A with visible index 0 and B with index 1. Then swap the indexes.

Only the first visible column has the key.

Device/items.

CV-6

A view shows CP Uptime (index 0) and CP Software (index 1). A hidden column and a column outside the view exist.

Custom fields follow the file order: CP Software, then CP Uptime. Hidden columns and columns outside the view have no field. T4 and T7 have no field.

Device/items.

CV-7

Export the device list to Excel, to CSV and to XML with this view.

Excel has a header and a value for each visible custom column, and an empty cell where there is no value. CSV and XML have no custom column.

Export of the device list.

6.4. Filters

Preconditions for all rows: a Device view without stored conditions, and the condition sent in conditions of Device/items. The result lists the devices of the data set only.

ID compare conditionString Expected devices

Text column CP Software

FL-1

Equal

1.2.3

T1

FL-2

StartsWith

1_

T2

FL-3

StartsWith

1%2

T1, T2, T3

FL-4

IsNull

none

T4, T7

FL-5

IsNotNull

none

T1, T2, T3, T8

FL-6

InList

1.2.3 + line break + 1x2

T1, T3

FL-7

InList

a,b

T8 (the comma is part of the value)

FL-8

InList

1.2.3,1x2

none

FL-9

InList

` 1x2` (leading space)

none

FL-10

Equal, StartsWith or InList

empty

none

FL-11

NotEqual or Like

1

none, no error

Integer column CP Uptime

FL-20

Greater

100

U3, U8

FL-21

GreaterEqual

100

U1, U3, U8

FL-22

Less

100

U2, U4, U5, U6

FL-23

LessEqual

7

U2, U4, U5, U6

FL-24

Less

-50

U6

FL-25

Greater

-100

U1, U2, U3, U4, U5, U6, U8

FL-26

Equal

100

U1

FL-27

Equal

007

U5 (text compare of 7)

FL-28

Equal

empty

U4 (empty is 0)

FL-29

Greater

3000000000

U8

FL-30

any of the five comparisons

x1

none, no error

FL-31

IsNotNull

none

U1, U2, U3, U4, U5, U6, U7, U8

FL-32

IsNull

none

none

MAC column CP MAC

FL-40

Equal

aA:Bb:CC:dd:EE:ff

M1, M2

FL-41

Equal

Aa:bB:cc:dd:ee:ff

M1, M2 (M3 is not selected)

FL-42

Equal

empty

none

FL-22 to FL-25 give the same result on MySQL and on Oracle. U7 (abc) matches no order operator.

ID Steps Expected

FL-50

POST View/filterConditions for customParam:CP Software, customParam:CP Uptime, and an unknown key.

The operator lists of the API reference. {"items":[]} for the unknown key.

FL-51

Send two conditions with logic And (CP Software StartsWith 1, CP Uptime Greater 100) to a device that holds both values.

Only devices that match both.

FL-52

Save a Device view with the stored condition CP Software Equal 1.2.3, then request its list.

T1 only.

FL-53

Seed 300 matching parameter names for CP IP, then 301. A device has a value for one name. Also add a row with an extra Stats segment on a second device. Enable DEBUG.

With 300 names the DEBUG message shows useNames=false. With 301 it shows useNames=true. The device list shows the same value in both cases. A filter on that value selects the first device only, in both cases. The second device never matches.

FL-54

With two visible columns that have 200 matching names each, request the device list. Enable DEBUG.

The total (400) is above 300, so the system matches by name. The values are the same as with fewer names.

FL-55

Add a new matching parameter name to cpe_parameter_name, with a value on a device.

The value is shown after at most 5 minutes, or at once after an edit of the file.

6.5. Saved Views and View Types

ID Steps Expected API check

VW-1

A Device view has the visible column CP Software and the stored condition CP Software Equal 1.2.3 with And. Remove CP Software from the file.

The view loads. The column keeps its place with the label CP Software and canSort false. The list is not filtered by the removed condition and has no value for it.

View/item, Device/items.

VW-2

As VW-1, but the removed condition has logic Or next to a valid condition A.

The result equals the result of A alone.

Device/items.

VW-3

As VW-1, but the removed condition has a nested condition on serial.

The nested condition is dropped with its parent.

Device/items.

VW-4

Add CP Software to the file again.

The column values and the condition work again.

Device/items.

VW-5

Save a Device view and a Search view with a condition on customParam:Missing.

Both saves fail with HTTP 404 and error code 9094. Nothing is saved.

PUT View/item.

VW-6

Save a Group Update view with a condition on customParam:CP Software, then run its device selection.

The save succeeds. The group selects the devices that match, as in FL-1.

PUT View/item.

VW-7

Save an Automation view and a Monitoring view, each with a custom condition, then each with a custom column and no condition.

All four saves fail with HTTP 404 and error code 9094.

PUT View/item.

VW-8

Save a Group Update view with a condition on customParam:Missing, with the nested form also.

The save fails with HTTP 404 and error code 9094.

PUT View/item.

Check the error by its code 9094 and the HTTP status 404. The message text can differ by language.

7. Known Differences from the .NET Application

  • Location: the .NET application reads one ~/XML/custom_params.xml. This backend reads one file per portal.

  • The type attribute is never used as a path.

  • The shipped default files have every entry commented out, because the entries duplicate fixed columns.

  • A broken file on reload keeps the last good columns.

  • The .NET CSV export includes the custom columns. The CSV export of this backend does not.

  • Sorting by a custom column, the Find device search box and the URL link ?<name>=<value> are not supported.