Click or drag to resize
IQMSGetServerObjectMetaDataForUser Method
Retrieves a list of all ServerObjectMetaData objects from a QlikView Server, accessible to a certain user.

Namespace: PIX.Services.V12
Assembly: 
Syntax
List<ServerObjectMetaData> GetServerObjectMetaDataForUser(
	Guid qvsID,
	string user
)

Parameters

qvsID
Type: SystemGuid
The ID of the QlikView Server managing the document.
user
Type: SystemString
The user id to retrieve server objects for.

Return Value

Type: ListServerObjectMetaData
A list of ServerObjectMetaData objects.
Remarks
Security note Security Note

Requires membership of local group QlikView Management API.

Examples
This example retrieves all ServerObjectMetaData's from a QVS, accessible by a certain user.

The service key injection is assumed to be handled behind the scenes. For an example of how to inject the service key, see Samples.

C#
using System;
using System.Collections.Generic;
using System.Linq;
using QMSAPI;

class Program
{
    static void Main(string[] args)
    {
        try
        {
            // create a QMS API client
            IQMS apiClient = new QMSClient();

            //retrieve a time limited service key
            ServiceKeyClientMessageInspector.ServiceKey = apiClient.GetTimeLimitedServiceKey();

            ServiceInfo qvsService = apiClient.GetServices(ServiceTypes.QlikViewServer).FirstOrDefault();
            if( qvsService != null)
            {
                List<ServerObjectMetaData> serverObjectMetaDatas = apiClient.GetServerObjectMetaDataForUser( qvsService.ID, "SomeDomain\\johndoe");
                serverObjectMetaDatas.ForEach(meta=>
                {
                    Console.WriteLine("Id: " + meta.Id);
                    Console.WriteLine("Type: " + meta.Type );                        
                    Console.WriteLine("Sub type: " + meta.SubType);
                    Console.WriteLine("Document: " + meta.DocumentName);
                });        
            }
        }
        catch (Exception ex)
        {
            Console.WriteLine("An exception occurred: " + ex.Message);
        }
        // wait for user to press any key
        Console.ReadLine();
    }
}
See Also