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


hello,

 

i'm trying update xdp resources on adobe livecycle server es8.2, references 2 links below:

 

http://livedocs.adobe.com/livecycle/8.2/programlc/programmer/help/wwhe lp/wwhimpl/common/html/wwhelp.htm?context=sdkhelp&file=000178.html

 

http://livedocs.adobe.com/livecycle/8.2/programlc/programmer/javadoc/c om/adobe/repository/bindings/resourcerepository.html#updateresource%28 %29

 

 

and code snap below

 

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

resourcerepositoryclient repositoryclient = new resourcerepositoryclient(
                    serviceclientfactory);

string resourceuri = "/forms/test.xdp";
document doc = repositoryclient.readresourcecontent(resourceuri);

 

string xmlstring = readdocument(doc).tostring();

 

//locate text content variable name "content_test"

int fromindex = xmlstring.indexof("content_test");
fromindex = xmlstring.indexof("</draw>", fromindex);

 

//insert value content "hello adobe livecycle"
stringbuffer sbf = new stringbuffer(512);
sbf.append("<value>");
sbf.append("hello adobe livecycle");
sbf.append("</value>");


sbf.append(xmlstring.substring(fromindex));


document datadocument = new document(sbf.tostring().getbytes());
resource resource = repositoryclient.readresource(resourceuri);
resourcecontent resourcecontent = resource.getcontent();

 

//set updated document resource
resourcecontent.setdatadocument(datadocument);
resource.setcontent(resourcecontent);

 

//update resource
repositoryclient.updateresource(resourceuri, resource, true);

 

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

 

the code above tries load xdp form template livecycle repository, there empty text area named "content_test" on xdp form template. want insert value content xdp , update resource on livecycle server. result version of xdp on server increaced, xdp form seems cleard totally, of objects on xdp form lost, sounds created new xdp. tried "writeresource" api , got empty xdp form well. there parameters or properties or preconditions ignored in implementation? please me sort out things. of suggetions appreciated!

hey dazhi,

 

 

where able resolve issue?
because here's thing, when saw query , details, looks similar situation had encountered earlier. java api lc used "writing resource in repositry , see able achieve sucessfully.    reckon without updateproperties method, won't updating content of resource of xdp.
hence, related update on xdp content, there might possibility using updateproperties () method in java api, (string resourceuri, properties), because adds , updates properties of resource. resource update, and, such, method subjected rules laid out in updateresource(). find multiple resource methods () depending upon implementation require.

the important of pre-conditions include properties , elements must not null. not sure looking @ api code excerpt, looks should include updateproperties () method.

also, wanted know whether, while executing api, getting particular alc-rep-030-000 exception either on eclipse console or on server, or related alc-rep?

 

 

 

cheers!!
pushkar



More discussions in LiveCycle Foundation


adobe

Comments

Popular posts from this blog

How to decompile jsxbin to jsx

Gavik Photoslide GK2: Not able to upload photos - Joomla! Forum - community, help and support

Phoca Guestbook logger registret bruger af - Joomla! Forum - community, help and support