Layout Manager (.NET)

In Relativity, a layout is a web-based coding form that you can use to view and edit document and other fields. For general information, see Layouts on the Relativity Documentation site.

The Layout Manager API exposes CRUD operations that you can use to programmatically manipulate layouts in your Relativity environment. In addition to the CRUD operations, this API includes a helper function used to retrieve a list of users with permissions necessary to own layouts.

Sample use cases for the Layout Manager API include:

  • Developing an application that supports specific operations, which users can perform on the layouts included in it.
  • Programmatically updating properties of layouts in Relativity.

You can also use the Layout Manager API through REST. For more information, see Layout Manager (REST).

The Relativity.DataVisualization.SDK contains this API. For compatibility and package installation instructions, see Download the SDKs and NuGet packages.

Fundamentals for the Layout Manager API

The Layout Manager API contains the following methods.

Create a layout

Use the CreateAsync() method to create a single layout. This method takes two arguments:

  • A workspace ID
  • A layoutRequest object specifying the properties of the layout to create

It returns a LayoutResponse object that represents the newly created layout.

Read a layout

Use the ReadAsync() method to retrieve metadata for a layout. This method takes two arguments:

  • A workspace ID
  • A layout ID

It returns a LayoutResponse object that represents a layout.

You can use the overloaded ReadAsync() method to retrieve additional metadata and actions by passing the includeMetadata and includeActions arguments:

Copy
return await layoutManagerProxy.ReadAsync(workspaceID, layoutID, includeMetadata, includeActions);

Update a layout

Use the UpdateAsync() method to modify the properties of a layout. This method takes three arguments:

  • A workspace ID
  • A layout ID
  • A LayoutRequest object that contains properties for the modified layout.

It returns a LayoutResponse object that represents the modified layout.

You can use the overloaded UpdateAsync() method to restrict the update of a layout to the date when it was last modified. Pass the lastModifiedOn property as an argument to the method.

Copy
await layoutManagerProxy.UpdateAsync(workspaceID, layoutID, layoutRequest, lastModifiedOn);

Delete a layout

Use the DeleteAsync() method to remove a layout from Relativity. This method takes two arguments:

  • A workspace ID
  • A layout ID

This method doesn't return a value.

Retrieve users for layout ownership

Use the GetEligibleOwnersAsync() method to retrieve a list of users eligible to be layout owners. This method takes only a workspace ID as an argument. It returns a list of DisplayableObjectIdentifier objects that represent eligible users.

When calling the CreateAsync() or the UpdateAsync() method, you can assign each of the returned users to a layout as an owner on the LayoutRequest object.