This DTO has been removed as part of the Relativity Services API (RSAPI) Deprecation and is no longer supported. For more information and alternative APIs, see RSAPI deprecation process.

MarkupSet

In Relativity, markup sets are securable highlights and redactions available to reviewers. For more information, see Markup sets on the RelativityOne Documentation site.

The Services API supports all CRUD and query operations on a MarkupSet DTO.

Note: You can also perform a full set of CRUD operations on markup sets using the single-artifact access methods common to all Relativity DTOs. For more information, see Single-artifact access.

This page contains the following information:

Create a MarkupSet

You can add a MarkupSet to Relativity by calling the Create() method on the MarkupSet repository as illustrated in this code sample.

public static bool Create_MarkupSet_Using_Repository(IRSAPIClient proxy)
{
     // STEP 1: Create a MarkupSet DTO and populate the fields.
     DTOs.MarkupSet markupSetDTO = new DTOs.MarkupSet();
     markupSetDTO.Name = "New Markup Set";
     markupSetDTO.Order = 10;
     markupSetDTO.RedactionText = 
          new List<String>(new string[] {"Each", "string", "here", "is", "on", "a", "new", "line."});
      
     // STEP 2: Call the Create() method on the repository and pass in the DTO.
     DTOs.WriteResultSet<DTOs.MarkupSet> createResults;
     try
     {
          createResults = proxy.Repositories.MarkupSet.Create(markupSetDTO);
     }
     catch (Exception ex)
     {
          Console.WriteLine("An error occurred creating the Markup Set: {0}", ex.Message);
          return false;
     }
      
     // STEP 3: Check for success.
            
     if (!createResults.Success)
     {
          Console.WriteLine("An error occurred creating the Markup Set: {0}", createResults.Results[0].Message);
          return false;
     }
     else
     {
          Console.WriteLine("Successfully created Markup Set '{0}'!", markupSetDTO.Name);
     }
      
     return true;
}
        

Read a MarkupSet

To read Field values, you can use the Read() method on the MarkupSet repository as illustrated in this code sample.

public static bool Read_MarkupSet_Using_Repository(IRSAPIClient proxy)
{
     // STEP 1: Create the MarkupSet DTO.
     kCura.Relativity.Client.DTOs.MarkupSet markupSet = new kCura.Relativity.Client.DTOs.MarkupSet(1039144);
     markupSet.Fields = kCura.Relativity.Client.DTOs.FieldValue.AllFields;
      
     // STEP 2: Read the MarkupSet DTO from the repository.
     kCura.Relativity.Client.DTOs.ResultSet<kCura.Relativity.Client.DTOs.MarkupSet> resultSet;
      
     try
     {
          resultSet = proxy.Repositories.MarkupSet.Read(markupSet);
     }
     catch (Exception ex)
     {
          Console.WriteLine("An error occurred reading the MarkupSet: {0}", ex.Message);
          return false;
     }
      
     // STEP 3: Check for success.
     if (!resultSet.Success)
     {
          Console.WriteLine("An error occurred reading the MarkupSet: {0}", resultSet.Message);
          return false;
     }
     kCura.Relativity.Client.DTOs.MarkupSet markupSetResult = resultSet.Results.FirstOrDefault().Artifact;
     Console.WriteLine("MarkupSet Name: {0}", markupSetResult.Name);
      
     return true;
}
        

Update a MarkupSet

You can use the Update() on the MarkupSet repository to modify its properties as illustrated in this code sample.

public static bool Update_MarkupSet_Using_Repository(IRSAPIClient proxy)
{
     // STEP 1: Create the MarkupSet DTO.
     kCura.Relativity.Client.DTOs.MarkupSet markupSet = new kCura.Relativity.Client.DTOs.MarkupSet(1039144);
     markupSet.Fields = kCura.Relativity.Client.DTOs.FieldValue.AllFields;
      
     // STEP 2: Read the MarkupSet DTO from the repository.
     kCura.Relativity.Client.DTOs.ResultSet<kCura.Relativity.Client.DTOs.MarkupSet> resultSet;
      
     try
     {
          resultSet = proxy.Repositories.MarkupSet.Read(markupSet);
     }
     catch (Exception ex)
     {
          Console.WriteLine("An error occurred reading the MarkupSet: {0}", ex.Message);
          return false;
     }
      
     // STEP 3: Check for success.
     if (!resultSet.Success)
     {
          Console.WriteLine("An error occurred reading the MarkupSet: {0}", resultSet.Message);
          return false;
     }
      
     kCura.Relativity.Client.DTOs.MarkupSet markupSetResult = resultSet.Results.FirstOrDefault().Artifact;
     Console.WriteLine("MarkupSet Name: {0}", markupSetResult.Name);
      
     // STEP 4: Update the DTO in the repository.
     markupSetResult.Name = "Updated Markup Set";
     markupSetResult.Order = 20;
     markupSetResult.RedactionText.Add("New Markup Text");
     kCura.Relativity.Client.DTOs.ResultSet<kCura.Relativity.Client.DTOs.MarkupSet> updatedResultSet;
      
     try
     {
          updatedResultSet = proxy.Repositories.MarkupSet.Update(markupSetResult);
     }
     catch (Exception ex)
     {
          Console.WriteLine("An error occurred Updating the MarkupSet: {0}", ex.Message);
          return false;
     }
      
     // STEP 5: Check for success.
     if (!updatedResultSet.Success)
     {
          Console.WriteLine("An error occurred Updating the MarkupSet: {0}", updatedResultSet.Message);
          return false;
     }
     return true;
}
        

Delete a MarkupSet

You can remove a MarkupSet from Relativity by calling the Delete() method on the MarkupSet repository as illustrated in this code sample.

public static bool Delete_MarkupSet_Using_Repository(IRSAPIClient proxy)
{
     // STEP 1: Create the MarkupSet DTO.
     kCura.Relativity.Client.DTOs.MarkupSet markupSet = new kCura.Relativity.Client.DTOs.MarkupSet(1039144);
      
     // STEP 2: Delete the MarkupSet from the repository.
     kCura.Relativity.Client.DTOs.ResultSet<kCura.Relativity.Client.DTOs.MarkupSet> resultSet;
      
     try
     {
          resultSet = proxy.Repositories.MarkupSet.Delete(markupSet);
     }
     catch (Exception ex)
     {
          Console.WriteLine("An error occurred deleting the MarkupSet: {0}", ex.Message);
          return false;
     }
      
     // STEP 3: Check for success.
     if (!resultSet.Success)
     {
          Console.WriteLine("An error occurred deleting the MarkupSet: {0}", resultSet.Message);
          return false;
     }
     return true;
}
        

Query for a MarkupSet

To query for a MarkupSet, you can use the fields listed in the following table. For more information, see Search Relativity.

Fields for MarkupSet queries:

  • Artifact ID
  • Last Modified On
  • Created By
  • Notes
  • Created On
  • Order
  • Name
    Keywords
  • Redaction Text – returned as List<string> to accommodate multiple values.
  • Last Modified By
  • Security

This code sample illustrates how to set query conditions, call the Query() method on the MarkupSet repository, and iterate through the result set.

public static bool Query_MarkupSet_Using_Repository(IRSAPIClient proxy)
{
     // STEP 1: Create the query criteria.
     DTOs.Query<DTOs.MarkupSet> markupSetQuery = new DTOs.Query<DTOs.MarkupSet>();
      
     List<String> desiredRedactionText = 
          new List<string>(new string[] { "Each", "string", "here", "is", "on", "a", "new", "line." });
      
     markupSetQuery.Condition = new MultiLineStringCondition(DTOs.MarkupSetFieldNames.RedactionText, TextConditionEnum.EqualTo, desiredRedactionText);
     markupSetQuery.Fields = DTOs.FieldValue.AllFields;
      
     // STEP 2: Call the Query() method on the repository.
     DTOs.QueryResultSet<DTOs.MarkupSet> queryResults;
     try
     {
          queryResults = proxy.Repositories.MarkupSet.Query(markupSetQuery);
     }
     catch (Exception ex)
     {
          Console.WriteLine("An error occurred querying for the MarkupSet: {0}", ex.Message);
          return false;
     }
      
     // STEP 3: Check for success.
     if (!queryResults.Success)
     {
          Console.WriteLine("An error occurred querying for the MarkupSet: {0}", queryResults.Message);
          return false;
     }
     else
     {
          Console.WriteLine("Query returned {0} MarkupSets!", queryResults.Results.Count);
           
          foreach (DTOs.Result<DTOs.MarkupSet> markupSetResult in queryResults.Results)
          {
               Console.WriteLine("MarkupSet Name: {0}", markupSetResult.Artifact.Name);
          }
     }
      
     return true;
}
        

Additional Resources

DevHelp Community GitHub Release Notes NuGet

Share knowledge with the Relativity developer community.

Access tools and resources to build an application.

Review the most recent product release notes.

Create .NET Apps faster with NuGet.