Portlet instances in SiteVision can be rendered either separately or as part of a page. Websites and pages are constructed using the SiteVision editor, which is used to create and configure individual portlet instances that can be placed in templates and pages.
To render a portlet as a part of a page simply point your browser to the URL of the page. That will cause all portlets in the template and the specific page to be rendered in sequence, according to the Portlet API specification.
Portlet instances in a SiteVision page can be grouped into layouts, which specify the order and structure of the page. Sometimes it is useful to render a specific layout separately, usually in order to include it on another page or in a custom application as application content.
This can be accomplished by constructing the URL using the following rule:
Start with the URL of the page where the layout is located. Now insert "<name of layout>." before the extension of the page.
If you for example have a page with the following URL:
If you are interested only in the raw layout output, for direct inclusion in another webpage for example, then you can instead use the ".portlet" extension, like this:
This will render the layout and portlets as HTML and remove the tags so that only the text content remains. The mimetype of the returned content will be "text/plain". Some portlets have specific support for this mimetype, such as the text and table portlets.
Note that these rules can be used no matter what URL style you have chosen for your website.
If you want to render a single portlet you can use the same strategy as with layouts, but include the name or id of the portlet you want to render instead. For example, if you have the following page:
You can specify what content type to return by adding the request parameter "sv.contenttype". If you want to render the "Header" portlet as text you can therefore use either of these URL's:
The easiest way to create URL's to portlets is to use the createRenderURL() method in the RenderResponse of your portlet. Here's an example:
Last updated: