Take a survey

Developing Applications Using APIs > Working with LiveCycle ES Repository > Writing Resources > Writing resources using the web service API

Writing resources using the web service API
To programmatically retrieve a resource using the Repository service web service API, perform the following tasks:
1.
2.
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 target folder for the resource. In this case, because the resource named testResource will be stored in the folder named testFolder, the folder’s URI is "/testFolder". When using a language compliant with the Microsoft .NET Framework (for example, C#), store the URI in a System.String object.
4.
To create a resource, invoke the default constructor for the Resource class. In this example, the following information is stored in the Resource object:
A com.adobe.repository.infomodel.Id object, which is created by invoking the default constructor for the Id class and assigned to the Resource object’s id field.
A com.adobe.repository.infomodel.Lid object, which is created by invoking the default constructor for the Lid class and assigned to the Resource object’s lid field.
A string containing the file name of the resource, which is assigned to the Resource object’s name field. The name used in this example is "testResource".
A string containing the description of the resource, which is assigned to the Resource object’s description field. The description used in this example is "test resource".
5.
To create content for the resource, invoke the default constructor for the ResourceContent class. Then add content to the ResourceContent object. In this example, this is accomplished by doing the following tasks:
Assigning a BLOB object containing a document to the ResourceContent object’s dataDocument field.
Assigning the size in bytes of the BLOB object to the ResourceContent object’s size field.
Add the content to the resource by assigning the ResourceContent object to the Resource object’s content field.
6.
Invoke the RepositoryServiceService object’s writeResource method and pass in the URI of the folder, as well as the Resource object. Pass null for the other two parameters.
View Quick Start
 

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/livecycle/es/sdkHelp/programmer/sdkHelp/repositoryWritingFiles.121.4.html