IProductionManagerGetProductionImagesAsync Method (String)

Relativity.Productions.API
Retrieves a list of FileResults on the specified pageUri.

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(
	string pageUri
)

Parameters

pageUri
Type: SystemString
URI of the requested page.

Return Value

Type: TaskPagedImageFilesResult
List of FileResults associated with the current page.
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