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
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 |
|
Root element |
|
|
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. |
|
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 ( |
|
Matches one instance number. |
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 |
|
|
integer |
|
Values are 64-bit whole numbers, negative numbers included. Empty input counts as 0. |
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
Statssegment) 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:
-
Skip empty and NULL values.
-
Decrypt encrypted values.
-
Replace the value
device_params_subby its extended value. -
Drop
00:00:00:00:00:00for names that end with.MACAddress. Drop0.0.0.0for names that end with.ExternalIPAddress. Other names keep these values. -
A parameter belongs to the first visible column (by visible index) that lists it.
-
Order the values by update time, newest first.
-
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:
canSortisfalse. A sort on a custom column is ignored, and no sort is stored for it.
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 ( |
|
|
Support portal ( |
|
|
-
The directories
mc/andsc/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_parameterdirectly). -
To see DEBUG messages, set
FT_UI_BACKEND_LOG_LEVEL=debugand 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 |
|---|---|
|
T1 |
|
U1 |
|
M1 |
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 |
The log shows |
|
FR-2 |
Start with the shipped file. |
|
|
FR-3 |
Start with no file in |
Start succeeds with no custom column. After the create, the four |
|
FR-4 |
Edit a path of |
The log shows |
|
FR-5 |
Delete the file while running. |
The portal has no custom column without a restart. The application keeps running. |
|
FR-6 |
Start with a file that is not well-formed XML. |
The application starts with no custom column. The ERROR message names |
|
FR-7 |
With the example loaded, save a broken file, then one with a |
Each time the ERROR message appears and the four columns stay. |
|
FR-8 |
Add an entry with |
The first three are skipped with a WARN message each. The 243-character entry is a column. The first |
|
FR-9 |
Add |
The column is listed, has no value on any device, and every filter on it, |
|
6.2. Portal Separation
| ID | Steps | Expected | API check |
|---|---|---|---|
PS-1 |
|
Each portal lists only its own column. |
|
PS-2 |
Edit the |
Only the Management portal changes. The Support portal does not. |
|
PS-3 |
Both files define |
Each portal returns the values of its own paths. |
|
6.3. Columns, Sorting and Values
| ID | Steps | Expected | API check |
|---|---|---|---|
CV-1 |
Save a Device view and a Search view with the columns |
Both columns are returned. |
|
CV-2 |
Request a device list with a sort on |
Both requests succeed and return the same order. |
|
CV-3 |
Device X has |
|
|
CV-4 |
|
The first two are dropped (no key). The third is shown as |
|
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. |
|
CV-6 |
A view shows |
Custom fields follow the file order: |
|
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 |
|||
FL-1 |
|
|
T1 |
FL-2 |
|
|
T2 |
FL-3 |
|
|
T1, T2, T3 |
FL-4 |
|
none |
T4, T7 |
FL-5 |
|
none |
T1, T2, T3, T8 |
FL-6 |
|
|
T1, T3 |
FL-7 |
|
|
T8 (the comma is part of the value) |
FL-8 |
|
|
none |
FL-9 |
|
` 1x2` (leading space) |
none |
FL-10 |
|
empty |
none |
FL-11 |
|
|
none, no error |
Integer column |
|||
FL-20 |
|
|
U3, U8 |
FL-21 |
|
|
U1, U3, U8 |
FL-22 |
|
|
U2, U4, U5, U6 |
FL-23 |
|
|
U2, U4, U5, U6 |
FL-24 |
|
|
U6 |
FL-25 |
|
|
U1, U2, U3, U4, U5, U6, U8 |
FL-26 |
|
|
U1 |
FL-27 |
|
|
U5 (text compare of |
FL-28 |
|
empty |
U4 (empty is 0) |
FL-29 |
|
|
U8 |
FL-30 |
any of the five comparisons |
|
none, no error |
FL-31 |
|
none |
U1, U2, U3, U4, U5, U6, U7, U8 |
FL-32 |
|
none |
none |
MAC column |
|||
FL-40 |
|
|
M1, M2 |
FL-41 |
|
|
M1, M2 (M3 is not selected) |
FL-42 |
|
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 |
|
The operator lists of the API reference. |
FL-51 |
Send two conditions with |
Only devices that match both. |
FL-52 |
Save a Device view with the stored condition |
T1 only. |
FL-53 |
Seed 300 matching parameter names for |
With 300 names the DEBUG message shows |
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 |
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 |
The view loads. The column keeps its place with the label |
|
VW-2 |
As VW-1, but the removed condition has logic |
The result equals the result of |
|
VW-3 |
As VW-1, but the removed condition has a nested condition on |
The nested condition is dropped with its parent. |
|
VW-4 |
Add |
The column values and the condition work again. |
|
VW-5 |
Save a Device view and a Search view with a condition on |
Both saves fail with HTTP 404 and error code 9094. Nothing is saved. |
|
VW-6 |
Save a Group Update view with a condition on |
The save succeeds. The group selects the devices that match, as in FL-1. |
|
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. |
|
VW-8 |
Save a Group Update view with a condition on |
The save fails with HTTP 404 and error code 9094. |
|
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
typeattribute 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.