You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@shale.apache.org by René Zanner <re...@accelsis.biz> on 2006/07/27 14:35:06 UTC

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é

Re: Clay: "virtual" jsfid values (similar to Tiles)

Posted by Ryan Wynn <bi...@gmail.com>.
On 7/27/06, René Zanner <re...@accelsis.biz> wrote:
> 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.
>

I think that sounds like a good idea.  How about a special view id
suffix like pageCompositionId.component or for brevity
pageCompositionId.clay which creates the base Clay component in the
tree with clayJsfid="pageCompositionId".

What do you think, Gary?



> Thank you very much!
>
> Cheers,
>
> René
>