How to expose 'Document Template' results to URL

Posted by on 28-May-2015 18:42

I want an external service to be able to make a call to a URL which gives XML that is the result of a merged 'Document Template'.  So if the template is... 

<?xml version="1.0" encoding="UTF-8"?><something>{!firstName}</something>

Calling a (hypothetical) REST service like http://<rollbase url>/rest/api/runTemplate?objName=Contact&objId=123&templateId=555 would return...

<?xml version="1.0" encoding="UTF-8"?><something>John</something>

An alternative to a new REST function would be to use Server API's rbv_api.runTemplate(objName, ObjId, templateId).  But I do not know a way to expose the results as a URL.  If Server APIs can be called from a custom Java app, I could simply relay the results in the app.  Can Server APIs be called from custom Java code?

Or could the Server API be used on a portal page (that had no other content, including header, frame, html, etc.) that exposes the result?

All Replies

Posted by pvorobie on 29-May-2015 11:06

Do you mean to generate template's content dynamically or fetch content stored in a field?

BTW, we don't have "runTemplate" REST API.

Posted by on 31-May-2015 22:54

Hi Pavel,

Not meaning to generate the template dynamically.  Just run the template with merged data, and make the output accessible by REST API.  Just like what is done when you preview a document template merged with a record.

The reason for this... I have a 3rd party service that makes requests for XML from an arbitrary URL.  I would like that XML to come from data stored in Rollbase.

A hypothetical 'runTemplate' REST API would be exactly what I'm looking for.  But open to other options, if it involves custom JSP, etc.

Posted by pvorobie on 01-Jun-2015 11:11

Please submit enhancement request for this new REST API.

This thread is closed