IProductionManagerGetProductionImagesAsync Method (Int32, Int32, Int32, Int32, Int32)

Relativity.Productions.API
Retrieves a list of FileResults of every produced file currently associated with the workspace and production in no particular order.

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

Task<PagedImageFilesResult> GetProductionImagesAsync(
	int workspaceArtifactID,
	int productionArtifactID,
	int start,
	int length,
	int pageSize
)

Parameters

workspaceArtifactID
Type: SystemInt32
Workspace artifact ID.
productionArtifactID
Type: SystemInt32
Production artifact ID.
start
Type: SystemInt32
The index (i.e. 1 is the first record) of the record you want from within the entire result set.
length
Type: SystemInt32
The number of results to return. Put value less than or equal to 0 to return the entire result set.
pageSize
Type: SystemInt32
The non-negative number of results returned in a single page.

Return Value

Type: TaskPagedImageFilesResult
List of FileResults of every produced file associated with the workspace and production.
Examples

GetProductionImagesWithPagination_Example
using Relativity.Services.ServiceProxy;
using Relativity.Productions.Services;
using Relativity.Services.Exceptions;

public partial class Example
{
    public async Task GetProductionImagesWithDocuments_Example()
    {
        int workspaceId = 12345;          // Workspace Production exists in
        int productionId = 11111;         // Production's ArtifactID
        int documentId1 = 22222;          // ArtifactID of a document in the Production
        int documentId2 = 33333;          // ArtifactID of another document in the Production

        var userEmail = "user@test.com";  // User's login
        var password = "abc123456!";      // User's password

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

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

        using (IProductionManager productionManager = serviceFactory.CreateProxy<IProductionManager>())
        {
            try
            {
                List<int> documents = new List<int>()
                {
                    documentId1,
                    documentId2
                };

                ImageFilesResult result = await productionManager.GetProductionImagesAsync(workspaceId, productionId, documents);

                foreach (ImageFile imageFile in result.ImageFiles)
                {
                    Console.WriteLine($"FileID: {imageFile.FileID}");
                    Console.WriteLine($"FileGuid: {imageFile.FileGuid}");
                    Console.WriteLine($"DocumentID: {imageFile.DocumentID}");
                    Console.WriteLine($"PageNumber: {imageFile.PageNumber}");
                    Console.WriteLine($"HasRedactions: {imageFile.HasRedactions}");
                }
            }
            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);
            }
        }
    }

    public async Task GetProductionImagesWithPagination_Example()
    {
        int workspaceId = 12345;          // Workspace Production exists in
        int productionId = 11111;         // Production's ArtifactID

        var userEmail = "user@test.com";  // User's login
        var password = "abc123456!";      // User's password

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

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

        using (IProductionManager productionManager = serviceFactory.CreateProxy<IProductionManager>())
        {
            try
            {
                int start = 1;      // StartIndex of the result set.
                int length = 1000;  // Number of total results to fetch.
                int pageSize = 100; // Number of results to fetch per page.

                PagedImageFilesResult result = await productionManager.GetProductionImagesAsync(workspaceId, productionId, start, length, pageSize);

                Console.WriteLine($"This is the start index of the current page: {result.StartIndex}.");
                Console.WriteLine($"This is the count of the entire result set: {result.TotalResultSet}.");
                Console.WriteLine($"This is the count of the result set on the current page: {result.ResultCount}.");

                foreach (ImageFile imageFile in result.ImageFiles)
                {
                    Console.WriteLine($"FileID: {imageFile.FileID}");
                    Console.WriteLine($"FileGuid: {imageFile.FileGuid}");
                    Console.WriteLine($"DocumentID: {imageFile.DocumentID}");
                    Console.WriteLine($"PageNumber: {imageFile.PageNumber}");
                    Console.WriteLine($"HasRedactions: {imageFile.HasRedactions}");
                }

                if (result.NextUri != null)
                {
                    PagedImageFilesResult nextResult = await productionManager.GetProductionImagesAsync(result.NextUri);
                }

                if (result.PreviousUri != null)
                {
                    PagedImageFilesResult previousResult = await productionManager.GetProductionImagesAsync(result.PreviousUri);
                }
            }
            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