Data Manager

In this documentation you will find the fundamentals on how the .NET DCP and WebMAP operate for the interactions between the front-end and back-end applications to handle the Data Managers data.

Data Manager back-end and front-end synchronization

In order to display to the client a Data Manager's content its data needs to be synchronized between the front-end and the back-end of the application. To accomplish this there are two key components that serve as communicators between the application's server and the client's browser. Those components are the following:

  • Data Manager and Data Manager Control Models

  • GetDataBundlePage API

Data Manager Models

The Data Manager Control Model is a data representation of the basic information that is needed to render its respective component in the front-end application. It mainly contains the visual structure of the control (such as visibility, position, etc), the control events and its associated Data Manager Model. The Data Manager Control does not contain any kind.

Data Manager Control Model JSON

{
    "Border": false,
    "BorderStyle": 2,
    "DirtyContent": true,
    "DragAuto": false,
    "Enabled": true,
    "EventChanges": {
        "dwnitemvalidationerror": true
    },
    "Position": {
        "Height": 84,
        "Width": 288,
        "X": 21,
        "Y": 123
    },
    "TabOrder": 10,
    "Title": "",
    "TitleBar": false,
    "Visible": true,
    "VisualControlType": "DataControl",
    "VScrollBar": false,
    "Id": "53067372-bd2b-42d4-9a20-d9db16487f56",
    "MapperId": "application+dm_sample",
    "References": {
        "DataManager": "6ca7995d-e7a0-4387-8720-643aa0c4cb5c",
        "Parent": "8c74a413-f58b-4924-b472-6ad587e20992"
    }
}

The Data Manager Model is used to represent the inner structure that compose the component. It's purpose it to holder references to its controls (computes, columns,text objects, lines, etc), handle its synchronization status such as whether or not the data should be reloaded, the selected rows, the text of the current control, among others. The model does not contains any kind of data for its inner controls, this data is handled by a different mechanism, the GetDataBundlePage API.

Data Manager Model JSON

{
    "Id": "6ca7995d-e7a0-4387-8720-643aa0c4cb5c",
    "MapperId": "applicationd_sample_dm",
    "References": {
        "column_control": "6d147182-6ffd-4a86-97fd-337082b3e425",
        "compute_control": "956edaa8-b0c0-4c40-8a18-afa6ab3f671e"
    },
    "CurrentControlName": "d_sample_dm",
    "CurrentRow": 1,
    "DisplayedRow": 1,
    "Dirty": true,
    "Processing": "0",
    "Enabled": true,
    "Visible": true,
    "IsDynamic": false,
    "SelectedRows": "[]",
    "TextBuffer": "sampletext",
    "Color": "ButtonFace",
    "ComputedInformation": {},
    "header": {
        "Height": 0,
        "BackColor": "transparent"
    },
    "detail": {
        "Height": 74,
        "BackColor": "transparent"
    },
    "summary": {
        "Height": 0,
        "BackColor": "transparent"
    },
    "footer": {
        "Height": 0,
        "BackColor": "transparent"
    }
}

Data Manager Get Data Bundle Page API

While the Data Manager Model holds the component structure the GetDataBundlePage API is the one that is in change of putting in place its data.

Each time a Data Manager Component is loaded for the first time in the front-end application or the Dirty property in the model is set to true a GetDataBundlePage API is invoked; which is used to get a view of the data contained in the sever for said Data Manager.

The information bundle object is composed by the following:

  • Total Items

  • Column Types

  • Computed Positions

  • Row Data

  • Column Names

  • Computed Information

Total Items

Contains the total amount of rows of the Data Manager.

{
    "totalItems": 1
},

Column Types

Contains the types associated to each Data Manager's Data Column.

{
    "0": "char(40)"
}

Compute Positions

Contains the positions and name of the compute controls contained in the Data Manager. This field is populated only when the compute contains a valid JavaScript expression.

{
    "1": "compute_control"
}

Rows Data

The data of this section is calculated individually for each Data Row, the sections are the following:

Deprecated fields

  • WM$%S (WebMAP Status Field): is deprecated for WebMAP 5 in WebMAP 4 it is used to hold the field type.

  • WM$%RW: deprecated in both WebMAP 5 and WebMAP 4, it was used to hold the original row index in case a filter is applied.

Visual

It contains the visual changes that should be applied to every control inside the row; it's applied individually for each one. The value is calculated in base of the property expression value associated to the property in the back-end, if no value is sent in here then the value in the Data Manager Model is used instead.

"visual": {
    "column_control": {
        "x": 67,
        "y": 53,
        "width": 217,
        "height": 17,
        "Visible": true,
        "Protect": null,
        "BackColor": "white"
    },
    "compute_control": {
        "x": 3,
        "y": 53,
        "width": 60,
        "height": 17,
        "Visible": true,
        "Protect": null,
        "BackColor": "transparent"
    }
}

Computed

It holds the evaluated expression for each computed control in the row.

"computed": {
    "compute_control": "Evaluated Value"
}

DDDW Display

Contains the Display text for each Drop Down Data Manager.

"dddwDisplay": {
    "3": "DDDW Selected Text"
}

Draggable

Indicated whether or not a row can be dragged.

"draggable": false

Column Names

This sections contains the name of each Data Column of the Data Manager.

[
    "column_control"
]

Computed Information

The computed information object contains the Name, expression and resulting value of each compute control contained in the Data Manager.

Complete GetDataBundlePage Object

This is the complete representation of the response sent to the back-end of the GetDataBundlePage

[
    {
        "totalItems": 1
    },
    {
        "0": "char(40)"
    },
    {
        "1" : "compute_control"
    },
    [
        [
            {
                "WM$%S": 0,
                "WM$%RW": 0,
                "visual": {
                    "column_control": {
                        "x": 67,
                        "y": 53,
                        "width": 217,
                        "height": 17,
                        "Visible": true,
                        "Protect": null,
                        "BackColor": "white"
                    },
                    "compute_control": {
                        "x": 3,
                        "y": 53,
                        "width": 60,
                        "height": 17,
                        "Visible": true,
                        "Protect": null,
                        "BackColor": "transparent"
                    }
                },
                "computed": {
                    "compute_control": "Evaluated Value"
                },
                "dddwDisplay": {
                    "3": "DDDW Selected Text"
                },
                "draggable": false
            },
            "Column Value"
        ]
    ],
    [
        "column_control"
    ],
    {
        "computedInformation": {
            "compute_control": {
                "expression": "(currentRow[1])",
                "resultingPbType": "varchar"
            }
        }
    }
]