Touchstone 11.0 API Reference
CreateExposureView Method
Example 


Air.Services.Proxy Assembly > (Global) Namespace > ProjectManagementServiceClient Class : CreateExposureView Method
Contains a CreateExposureViewRequest that identifies the properties of the Exposure View that you want to create, along with the associated Touchstone-generated Project Sequential Identifier (SID), Business Unit SID, and SQL Instance SID.
Creates a new Touchstone® Exposure View.
Syntax
Public Function CreateExposureView( _
   ByVal request As CreateExposureViewRequest _
) As CreateExposureViewResponse
Dim instance As ProjectManagementServiceClient
Dim request As CreateExposureViewRequest
Dim value As CreateExposureViewResponse
 
value = instance.CreateExposureView(request)

Parameters

request
Contains a CreateExposureViewRequest that identifies the properties of the Exposure View that you want to create, along with the associated Touchstone-generated Project Sequential Identifier (SID), Business Unit SID, and SQL Instance SID.

Return Value

A CreateExposureViewResponse containing the Exposure View SID, which uniquely identifies the Exposure View that you have created.
Remarks
The name cannot include the following special characters: "[/:*?"<>\]”?

To find the Business Unit SID to pass into this method, call the GetBusinessUnits() method.

To find the SQL Instance SID to pass into this method, call the GetSqlInstances() method.

To find the Project SID to pass into this method, call the GetProjects() method.

Example
The following example shows how to create a Touchstone Exposure View using the CreateExposureView() method:
using System;
using System.Collections.Generic;
using AIR.Services.Common.Data;
using AIR.Services.Common.Exposure.Data;
using AIR.Services.Common.Filter.Data;
using AIR.Services.ProjectManagement.Api;
using AIR.Services.ProjectManagement.Data;
            
class SnippetCreateExposureViewRequest
{
    private static void CreateExposureView(int businessUnitSid, int sqlInstanceSid, int projectSid, int dataSourceSid, int exposureSetSid,
                        string exposureViewName, string exposureViewDesc, List<Filter> filters)
    {
        ProjectManagementServiceClient projectClient = new ProjectManagementServiceClient();
        CreateExposureViewRequest request = new CreateExposureViewRequest();
        request.BusinessUnitSid = businessUnitSid;
        request.SqlInstanceSid = sqlInstanceSid;
        ExposureViewDetail viewDetail = new ExposureViewDetail()
        {
            ExposureSet = new ExposureSet()
            {
                DataSourceSid = dataSourceSid,
                Sid = exposureSetSid
            }
        };
         request.ExposureView = new ExposureView()
        {
            Name = exposureViewName,
            Description = exposureViewDesc,
            Details = new List<ExposureViewDetail>() { viewDetail },
            Filters = filters
        };
        request.ProjectSid = projectSid;
        CreateExposureViewResponse response = projectClient.CreateExposureView(request);
        if (response.Status.Code == StatusCode.Success)
        {
            Console.WriteLine("Exposure View " + request.ExposureView.Name + " created with SID: " + response.ExposureViewSid);
        }
    }
}
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

ProjectManagementServiceClient Class
ProjectManagementServiceClient Members