09-25-2013 07:02 AM
Hi,
I want to save a property value getted by javascript (a facebook access token given by the facebook login process) to the current document viewed. The document is in VIEW mode for this login action so i can't use the regular process for saving the current document.
Technically, i'm on a Template widget of the property in VIEW mode and i have a javascript variable with my value. How can i put the javascript value into the property value of the document and how i save it after ? (ajax ?)
Thanks
09-30-2013 06:53 AM
Hi,
The best option is to use the Automation JS client to directly call an update operation on the server side. This is what is done in the new Select2 based widgets.
In your case, you should already have access to JS Automation Client inside the global context.
var options = {automationParams : {
params : {},
context : {},
input : { 'doc:' + window.ctx.currentDocument}
}}
var op = jQuery().automation("Document.SetProperty", options);
op.addParameter("xpath", propertyXPath);
op.addParameter("value", propertyValue);
op.execute();
This will update the Document inside the repository. If you want a better integration with JSF/Seam, you may want to define a Chain that will do the update + trigger a refresh in Seam.
Tiry
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.