Reading Resources

You can retrieve resources from a given location in the repository in order to read their content and metadata. The workflow is front-ended by an initialization form. The process has all the permissions it needs to read the form. The system retrieves the data form and reads the content from the repository. The repository grants access to the content and the metadata (the ability to even know the resource exists).

The repository has the following four permission types:

  • traverse : allows you to list resources; that is, to read resource metadata, but not resource content

  • read : allows you to read resource content

  • write : allows you to write resource content

  • managing access control lists (ACLs) : allows you to manipulate ACLs on resources

Users can only run processes when they have permission to run the process. IDE users need traverse and read permissions to synchronize with the repository. ACLs apply only at design time because runtime occurs within the system context.

You can programmatically read resources by using the Repository service Java API or web service API.

Note: For more information about the Repository service, see Services Reference for LiveCycle .

Summary of steps

To read a resource, follow these steps:

  1. Include project files.

  2. Create a Repository service client.

  3. Specify the URI of the resource to be read.

  4. Read the resource.

Include project files

Include the necessary files in your development project. If you are creating a client application using Java, include the necessary JAR files. If you are using web services, include the proxy files.

Create the service client

Before you can programmatically read a resource, you must establish a connection and provide credentials. This is accomplished by creating a service client.

Specify the URI of the resource to be read

Create a string containing the URI of the resource to be read. The syntax includes forward slashes, as in this example: "/ path / resource ".

Read the resource

Invoke the Repository service method to read the resource, specifying the URI.

Read resources using the Java API

Read a resource by using the Repository service API (Java):

  1. Include project files

    Include client JAR files in your Java project’s class path.

  2. Create the service client

    Create a ResourceRepositoryClient object by using its constructor and passing a ServiceClientFactory object that contains connection properties.

  3. Specify the URI of the resource to be read

    Specify a string value that represents the URI of the resource to retrieve. For example, assuming the resource is named testResource which is located in a folder named testFolder , specify /testFolder/testResource .

  4. Read the resource

    Invoke the ResourceRepositoryClient object’s readResource method and pass the URI of the resource as a parameter. This method returns a Resource instance that represents the resource.

Reading resources using the web service API

Read a resource by using the Repository service API (web service):

  1. Include project files

  2. Create the service client

    Using the Microsoft .NET client assembly, create a RepositoryServiceService object by invoking its default constructor. Set its Credentials property using a System.Net.NetworkCredential object containing the user name and password.

  3. Specify the URI of the resource to be read

    Specify a string containing the URI of the resource to be retrieved. In this case, because the resource named testResource is in the folder named testFolder , its URI is "/testFolder/testResource" . When using a language compliant with the Microsoft .NET Framework (for example, C#), store the URI in a System.String object.

  4. Read the resource

    Invoke the RepositoryServiceService object’s readResource method and pass the URI of the resource as the first parameter. Pass null for the other two parameters.

See also

Reading Resources

Quick Start (Base64): Reading a resource using the web service API

Invoking LiveCycle using Base64 encoding

// Ethnio survey code removed