I think I've done something similar. I hit URLs like
http://localhost:8080/mysite/content/help_page.tru by using Clay full-xml
views.
You have to re-map the .xml extention to use your own extention.
In web.xml, map .tru to be the new .xml, and set clay-tiles-config.xml to be
the full-xml config file:
<!-- make full xml view apply to .tru -->
<context-param>
<param-name>org.apache.shale.clay.XML_TEMPLATE_SUFFIX</param-name>
<param-value>.tru</param-value>
</context-param>
<!-- Clay Configuration Full XML view Resources -->
<context-param>
<param-name>
org.apache.shale.clay.FULLXML_CONFIG_FILES
</param-name>
<param-value>
/WEB-INF/clay-tiles-config.xml
</param-value>
</context-param>
In clay-config.xml set up your layouts
<!-- base layout defintion -->
<component jsfid="basePage" extends="clay">
<attributes>
<set name="clayJsfid" value="/layouts/shale.layout.html" />
</attributes>
<symbols>
<set name="@title" value="Default Title" />
<set name="@bodycontent" value="space" />
<set name="@footercontent" value="footerPanel" />
</symbols>
</component>
Then in full-xml clay config, (clay-tiles-config.xml) I define the page to be
hit:
<!-- page composition definition -->
<component jsfid="/pageCompositionId.tru" extends="basePage">
<symbols>
<set name="@title" value="Test page for page composition" />
<set name="@bodycontent" value="/tiles/shale.body.test.html" />
</symbols>
</component>
And just provide the content in /tiles/shale.body.test.html
You should then be able to hit http://whatever/pageCompositionId.tru without
having that file exist on disk.
Cheers,
Ian.
> -----Original Message-----
> From: René Zanner [mailto:[EMAIL PROTECTED]
> Sent: 27 July 2006 13:35
> To: [email protected]
> Subject: Clay: "virtual" jsfid values (similar to Tiles)
>
> Hi folks,
>
> I'm missing something in Clay's full HTML views which is
> known from the Tiles integration.
>
> In a JSF/Tiles integration, when specifying a view id, this
> id is looked up in the tiles-defs.xml first (maybe after some
> processing of the view id, e.g. replacing the extension and
> so on). Only when there's no tiles definition found by that
> name, the request is dispatched to the default view handler
> (that is, to the file system to search for a corresponding JSP file).
>
> When specifying a view id with Clay, the suffix is checked
> first. When it's *.html or *.xml, it's supposed to be a file
> template and Clay tries to load that file.
>
> So, when specifying a view id like /clay.html, I MUST have a
> corresponding clay.html file in the document root of my web
> application, even if it has only the meaningless content:
>
> <html jsfid="pageCompositionId" allowBody="false"> </html>
>
> Is there a way to avoid this?
>
> I want to use Tiles like page composition. My Clay config
> file contains a base layout definition and a page composition
> definition.
>
>
> <!-- base layout defintion -->
> <component jsfid="basePage" extends="clay">
> <attributes>
> <set name="clayJsfid" value="/layouts/shale.layout.html" />
> </attributes>
> <symbols>
> <set name="@title" value="Default Title" />
> <set name="@bodycontent" value="space" />
> <set name="@footercontent" value="footerPanel" />
> </symbols>
> </component>
>
> <!-- page composition definition -->
> <component jsfid="pageCompositionId" extends="basePage">
> <symbols>
> <set name="@title" value="Test page for page composition" />
> <set name="@bodycontent" value="/tiles/shale.body.test.html" />
> </symbols>
> </component>
>
>
> I just want to request the page composition id
> (/pageCompositionId.html) and receive the corresponding
> composite from the Clay config - without that superfluous
> HTML template.
>
> Thank you very much!
>
> Cheers,
>
> René
>
>