How can i create a view?

Questions regarding the use of the C++ SDK for Server or Client development or integration into customer products ...

Moderator: uasdkcpp

Post Reply
JtR
Full Member
Full Member
Posts: 7
Joined: 28 Jul 2011, 18:04

How can i create a view?

Post by JtR »

Looking at the documentation I don't understand how to create a view. Is it possible to create a view for each client i need, so each client can see only one view?
Last edited by JtR on 07 Feb 2013, 10:48, edited 1 time in total.

User avatar
Support Team
Hero Member
Hero Member
Posts: 3069
Joined: 18 Mar 2011, 15:09

Re:How can i create a view?

Post by Support Team »

Hello,

You can create a View node like any other node in the SDK by creating a View node instance e.g. by using the class UaGenericView. You can add this node to the NodeManager with addNodeAndReference. Then you can create references to the nodes in the address space with addUaReference. This is done in the sample code with other node classes.

But creating a view is only a part of the story. The view is normally used in Browse to filter the results. If you want to apply this filter you must influence the browse results.

But I am not sure if this is really what you want to do. If you want to filter the address space based on the client or user, you can simply detect client or user through the session and you can filter the browse based on this information.

For both cases you should have a look at NodeManagerUaNode::registerBrowseUaNodeCallback(). By implementing the interface BrowseUaNodeCallback you can either check if a View, Client, User should return anything from this node (browseNode) or you can decide for every single result node if it should be returned (returnBrowseResultNode).

The parameter browseContext contains the view information if it is provided by a client as filter.

The parameter pSession provides access to the session object identifying the client or the user.

Best regards,
Unified Automation Support Team
Best regards
Unified Automation Support Team

Post Reply