Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

The Resources in LiveCycle Server can't be updated! How does the API work?


I'm trying to update XDP resources on Adobe LiveCycle Server ES8.2, my references are the 2 links below: lp/wwhimpl/common/html/wwhelp.htm?context=sdkHelp&file=000178.html om/adobe/repository/bindings/ResourceRepository.html#updateResource%28 %29

and my code snap is below

---------------------------------------------------------------------- -------------------------------------------------------

ResourceRepositoryClient repositoryClient = new ResourceRepositoryClient(

String resourceURI = "/Forms/test.xdp";
Document doc = repositoryClient.readResourceContent(resourceURI);

String xmlString = readDocument(doc).toString();

//locate the Text content by the variable name "content_test"

int fromIndex = xmlString.indexOf("content_test");
fromIndex = xmlString.indexOf("</draw>", fromIndex);

//insert the value content "Hello Adobe LiveCycle"
StringBuffer sbf = new StringBuffer(512);
sbf.append("Hello Adobe LiveCycle");


Document dataDocument = new Document(sbf.toString().getBytes());
Resource resource = repositoryClient.readResource(resourceURI);
ResourceContent resourceContent = resource.getContent();

//set the updated document into the resource

//update the resource
repositoryClient.updateResource(resourceURI, resource, true);

---------------------------------------------------------------------- -------------------------------------------------------

The code above tries to load a XDP form template from LiveCycle repository, there is an empty Text area named "content_test" on the XDP form template. What I want to do is to insert a value content into the XDP and then update the resource on LiveCycle server. The result is only the version of the XDP on server is increaced, but the XDP form seems to be cleard totally, all of the objects on the XDP form are lost, sounds like I created a new XDP. I tried the "writeResource" API and I only got a empty XDP form as well. Is there any parameters or properties or preconditions I ignored in the implementation? Please help me to sort out the things. Any of your suggetions will be very appreciated!

0 Replies


Level 2

Hey Dazhi,

Where you able to resolve the issue?
Because here's the thing, when I saw this query and the details, this looks similar to a situation that I had encountered earlier. This Java API for LC is used primarily for "Writing a resource in the repositry and I see that you are already able to achieve that sucessfully.    I reckon without the UpdateProperties method, it won't be updating the content of the resource of the XDP.
Hence, related to the update on the XDP content, there might be a possibility using the updateProperties () method in the Java API, (String resourceUri, properties), because this adds and updates the properties of a resource. This is effectively a resource update, and, as such, this method is subjected to the rules laid out in updateResource(). You will find multiple Resource methods () depending upon the implementation you require.

The Most important of the Pre-conditions include that the properties and its elements must not be null. I am not sure looking at your API Code Excerpt, but it looks like this should include the UpdateProperties () method.

Also, wanted to know whether, while executing the API, are you getting this particular ALC-REP-030-000 exception either on the eclipse console or on the Server, or anything related to ALC-REP?