You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@shale.apache.org by Bernhard Slominski <be...@zooplus.com> on 2007/03/06 08:57:37 UTC

RE: Clay templating

> -----Ursprüngliche Nachricht-----
> Von: gvanmatre@comcast.net [mailto:gvanmatre@comcast.net]
> 
> I'll try to give you some more background.  There are three 
> types of clay templates.
> 
>  
> <!-- Clay HTML View Suffix (default .html) -->
>  <context-param>
>   <param-name>
>    org.apache.shale.clay.XML_TEMPLATE_SUFFIX
>   </param-name>
>   <param-value>.fhtml</param-value>
>  </context-param>
>  
> Html templates use and extend common elements.  This type of 
> template can be a fragment or the entire page.  If the 
> template is the entry point to the page, it must be a 
> physical resource meaning that it can't be a pseudo tiles 
> like resource that doesn't exist.
> 
> *  The next type of template are what we call full XML views. 
>  For this type of template, the page entry point is a clay 
> XML configuration definition.  The default suffix of a full 
> XML view is .xml but can be changed using a web.xml context param.
> 
> 
>  <!-- Clay XML View Suffix (default .xml) -->
>  <context-param>
>   <param-name>
>    org.apache.shale.clay.XML_TEMPLATE_SUFFIX
>   </param-name>
>   <param-value>.html</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>
>  
> This option is similar to Tiles.  The page entry point is not 
> a physical resource but a metadata definition.   
> 

Gary, thanks a lot for the answer.
This is nearly a full blonw tutorial you gave me here.
I was trying it out and it's working fine.
So I use one configuration file /WEB-INF/clay-config.xml for both my common
and
my full XML view resources.

	<!-- Clay Common Configuration Resources -->
	<context-param>
		<param-name>
			org.apache.shale.clay.COMMON_CONFIG_FILES
		</param-name>
		<param-value>
			/WEB-INF/clay-config.xml
		</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-config.xml
        </param-value>
    </context-param>

The former start.html is replaced by an entry in the jsfid in my component
defintion.

    <component jsfid="/start.xml" extends="basePage">
        <symbols>
            <set name="@title" value="Application Home" />
            <set name="@bodycontent" value="/startBody.html" />
        </symbols>
    </component>
                                 
One small thing, I guess it's a typing or copy and paste error.
You metioned the same context parameter for the HTML views and for
the full XML views, I guess the HTML view parameter is wrong.
But in the turtorial I couldn't find the name of the context parameter
of the HTML view suffix. What is it?

<!-- Clay HTML View Suffix (default .html) -->
 <context-param>
  <param-name>
   org.apache.shale.clay.XML_TEMPLATE_SUFFIX
  </param-name>
  <param-value>.fhtml</param-value>
 </context-param>

Bernhard