[opencms-dev] How to get a XML content preview via API

Christoph Schönfeld cschoenfeld at sylphen.com
Tue Jan 16 21:25:29 CET 2007


Dear fellow list members,

consider a resource type with a custom XML schema and a custom JSP 
template. The template contains a contentload tag:

<cms:contentload collector="singleFile" param="${opencms.uri}"
  editable="true">

...
</cms:contentload>

When a file of this type is clicked in the Explorer the template is 
applied and the file is shown as HTML. Is there an API to retrieve this 
HTML as a String? I would like to embed the HTML as a preview within a 
custom admin dialog.

So far I have tried without success:
- CmsJspActionElement.include(filepath)
- CmsJspActionElement.include(templatepath, null, params) with params 
containing the filepath of opencms.uri, opencms.file
- CmsJspActionElement.getContent(filepath) - it dumps content without 
applying the template

My intermediate solution until I find out the right one is an iframe 
with a src of <cms:link>filepath</cms:link>.

Do your have any other ideas?

Best regards,
Christoph



More information about the opencms-dev mailing list