> Hi!
> I don't know is there proper place for discussing shale. If it's not can 
> you point me to correct mailing list
> 

This is the mailing list.  You've even prefixed your message subject with 
[Shale].   


> I'm using JSF and looking for good rendering/template framework. 
> Remembering that Shale is created by those people who have done Struts I 
> prefer using it instead of faceletes ;)
> 
> When I read "Clay's approach is unique. The granularity is targeted at 
> the declaration of JSF components versus composition of JSP fragments" I 
> thought that it's that I exactly want - if I have a tree of components I 
> want to change in templates components - not html fragments. But when I 
> build Shale from sources I can't find this very important feature for me 
> - ability to specify component tree templates  in clay-config.xml. For 
> example:
> I want to determine component profilePage
> 
> <component jsfid="layout.html">
>     <element renderid="0" jsfid="top.html">
>     <element renderid="1" jsfid="left.html">
>     <element renderid="2" jsfid="emptycontent.html">
> </component>
> 
> <compoent jsfid="profilePage" extends="layout.html">
>     <element renderid="2" jsfid="profile.html">
> </compoent>
> 
> and redirect to this component from my actions like any other views (e.g 
> jsps).
> 
>         <navigation-case>
>             <from-action>#{login.login}</from-action>
>             <from-outcome>success</from-outcome>
>             <to-view-id>/profilePage.clay</to-view-id>
>         </navigation-case>
> Did I miss something?

You are using full HTML view's in this example.  You must add "*.clay" to your 
faces servlet mapping.
<servlet-mapping>
    <servlet-name>faces</servlet-name>
    <url-pattern>*.clay</url-pattern>
</servlet-mapping>


> Thanks
> 


Clay gives you allot of flexibility for creating composition within a page but 
there are really only two options for identifying a page that translates into a 
JSF view id.  

1)  JSP views - A standard JSP page using Clay's custom JSP tag.
2)  HTML tapestry like views - HTML templating where a standard HTML document 
is used to bind a component to an HTML element using a jsfid attribute.

JSP views:
With the first option, you will use clay's XML configuration files to construct 
a page, just as you have shown above.  From the JSP page, you specify a 
top-level clay component using the clay JSP tag.

<clay:clay id="body" jsfid="layout.html"  />

Since this is a custom tag, you can interleave other JSF tags or even JSTL 
tags.  Another option using JSP views would be to define a page fragment using 
an HTML template.  You might use this option if you had a tricky html table 
layout that the standard panelGrid would not handle.  To do this, you have to 
specify the suffix that you are using to identify that a jsfid is a HTML 
template.  

This is done with an environment initialization parameter in your web 
deployment descriptor called "clay-template-suffix".   Another required 
environment setting if your using JSP view’s is “clay-config-files” which is a 
comma delimited list of your clay XML configuration files.

HTML views:
The html views are really starting to shape up.  The idea here is that you can 
use an html page as a template for defining the entire faces page.  There are 
two options here.  You can use the html mockup to bind to component definitions 
within the Clay XML configuration files. Or, you can define a page without 
using a configuration file.  And, you can mix and match these options.  You can 
even imbed JSF expressions within the text of the html page similar to JSP 2.0.


#{managed-bean-name.title}
<table>
       <tr>
             <td rowspan=2>
                   <span jsfid=top.html />   
       <tr>
             <td>
                   <span jsfid=left.html />   

       <tr>
             <td>
                   <span jsfid=content.html />
</table>

The key to full html view is that the page must be dispatched thru the faces 
servlet.  This means that you must have a servlet mapping to the suffix that 
you specify for the "clay-template-suffix".  

You can see an example of all of these techniques in the Rolodex usecase in the 
nightly build  
(http://svn.apache.org/builds/struts/nightly/struts-shale/shale-framework-20050919.zip).
  The war is located under the webapps folder.

Gary



> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to