Get all views in system and cameras attached to them.

Hi. I need to get all view that defined in system and also all cameras that attached to them.

I notice that in XProtect client code uses GetAllViewsAndCameras method from MobileServer or server SDK https://doc.developer.milestonesys.com/mipsdkmobile/reference/DotNetSDKdoc/class_video_o_s_1_1_mobile_1_1_s_d_k_1_1_portable_1_1_server_1_1_view_groups_1_1_view_groups_helper.html#a5593ba73c725659348a1e5a8e2cbbf3a

And it return this data :

i tried calling GetViewGroups on service command service, but it return to me different list of groups(where those groups come from and why different from Xprotect response?)

I also tried to use from rom VideoOS.ConfigurationAPI.IConfigurationService Interface this methods :

  • GetChildItems cannot get what i need, although i receive some info
  • GetItems - method not supported?
  • GetItem - return some information, but not the one i need.

But still cant find API call to get groups and cameras similar to GetAllViewsAndCameras from XProtect client call

Maybe i’m missing something?

Or it’s not possible?

Or just try to replicate the SDK examples server side?

Thank you.

Hi Mykola,

Generally speaking this is the right command (GetAllViewsAndCameras ) for achieving your needs (Get all views in system and cameras attached to them).

What is made additionally in the mobile server (compared to MIP SDK):

  • All the public view group folders are aggregated under “Public Views” folder.

This is special item with ID=Guid.Empty and exist only in mobile server view group structure.

Fore example if you have created two View groups in the Management client (“Group 1” and “Group 2”) you will receive from Mobile server something like:

Root (Folder)

All Cameras (Folder)

All Cameras (View)

Public Views (Folder)

Group 1 (Folder)

<All nested Folders, Views & Cameras into “Group 1”>

Group 2 (Folder)

<All nested Folders, Views & Cameras into “Group 2”>

  • All the empty items are removed from the hierarchy.

In this process first are removed all the cameras from the views, for which user doesn’t have access rights. After that are removed all the empty views from the folders. After that all the empty folders. In this process whole view groups could be removed.

From your example I can assume that user that has been used to login with Mobile SDK doesn’t have access rights to all the cameras in the described views in particular view groups.

Here is example from one test system how this xml should look like in general: