...
3. If this application contains its own action handler, it must also be configured. The creation of Action Handlers is considered more closely in a section below: 64008621 Create / customize your own action handler .
```js
applicationManager.registerApplication({
// ...
rootActionHandler: demoAppRootHandler,
});
```
...
You can develop your own libraries in a separate project folder below the `lib` folder.
Mapping the Database fields
In case if the database fields have some special characters like - in the field name:
To get the result from the database, map the field names as-is in the database.
But if you want to use it locally create a separate type with the user-defined names for the database fields.
But in this case it should be remapped back to the original database names in the handler: something like below:
Code Block | ||
---|---|---|
| ||
const performanceDataSearchHandler = createSearchDataHandler<PerformanceResult, PerformanceDataType>( getFilter, null, (hit) => ({ _id: hit._id, radioSignalId: hit._source["radio-signal-id"], scannerId: hit._source["scanner-id"], utcTimeStamp: hit._source["time-stamp"], suspectIntervalFlag: hit._source["suspect-interval-flag"], es: hit._source["performance-data"]["es"], ses: hit._source["performance-data"]["ses"], unavailablitySeconds: hit._source["performance-data"]["unavailability"], }), (pmDataEntry: string) => { switch (pmDataEntry) { case "radioSignalId": return "radio-signal-id"; case "scannerId": return "scanner-id"; case "utcTimeStamp": return "time-stamp" case "suspectIntervalFlag": return "suspect-interval-flag"; } return pmDataEntry }); |