IProductionDataSourceManagerReadSingleAsync Method

Relativity.Productions.API
Returns an instance of a ProductionDataSource.

Namespace:  Relativity.Productions.Services
Assembly:  Relativity.Productions.Services.Interfaces (in Relativity.Productions.Services.Interfaces.dll) Version: 11.1.0.1 9c084404c128f715df772c7792aa49f21535523c
Syntax

Task<ProductionDataSource> ReadSingleAsync(
	int workspaceArtifactID,
	int dataSourceArtifactID,
	bool withPlaceholderImage = false
)

Parameters

workspaceArtifactID
Type: SystemInt32
Workspace artifact ID.
dataSourceArtifactID
Type: SystemInt32
Data source artifact ID.
withPlaceholderImage (Optional)
Type: SystemBoolean
Indicates whether or not to return placeholder image contents. The placeholder image is only available for datasources belonging to produced productions.

Return Value

Type: TaskProductionDataSource
An instance of ProductionDataSource object read based on the artifact ID.
Examples

Read DataSource Example
using Relativity.Productions.Services;
using Relativity.Services.ServiceProxy;
using Relativity.Services.Exceptions;

public partial class Example
{
    public async Task ReadDataSource_Example()
    {
        int workspaceID   = 11111;            // ArtifactID of Workspace where Data source exists
        int dataSourceID  = 22222;            // ArtifactID of DataSource to read
        var userName      = "user@test.com";  // User's login
        var userPassword  = "abc123456!";     // User's password

        var relativityServicesUri = @"http://localhost/relativity.services";
        var relativityRestUri     = @"http://localhost/relativity.rest/api";

        var usernamePasswordCredentials = new UsernamePasswordCredentials(userName, userPassword);
        ServiceFactorySettings settings = new ServiceFactorySettings(new Uri(relativityServicesUri), new Uri(relativityRestUri), usernamePasswordCredentials);
        ServiceFactory serviceFactory   = new ServiceFactory(settings);

        using (IProductionDataSourceManager productionDataSourceManager = serviceFactory.CreateProxy<IProductionDataSourceManager>())
        {
            try
            {
                ProductionDataSource productionDataSource = await productionDataSourceManager.ReadSingleAsync(workspaceID, dataSourceID);

                if (productionDataSource.UseImagePlaceholder == UseImagePlaceholderOption.WhenNoImageExists)
                {
                    // Read the placeholder, etc
                    var placeholderObj = productionDataSource.Placeholder;
                    Console.WriteLine(placeholderObj.Name);
                }
            }
            catch (ValidationException e)
            {
                // Log validation exception details
                Console.WriteLine("There were validation errors: {0}", e.Message);
            }
            catch (ServiceException es)
            {
                // Log service exception details
                Console.WriteLine("There were errors: {0}", es.Message);
            }
        }
    }
}
See Also

Reference