>From: Hermod Opstvedt <[EMAIL PROTECTED]> 
>
> Hi 
> 
> So far I've been using named xml files to define the various pages, but I've 
> decided to define them in clay-config instead. I know this is doable, but 
> I'm missing something, either a setting in web.xml or elsewhere 
> 
> My simple clay-config.xml looks like this: 
>
        ><component jsfid="baseLayout" extends="clay" id="base">
                ><attributes>
                        ><set name="clayJsfid" value="/templates/standard.html" 
/>
                ></attributes>
                ><symbols>
                        ><set name="title" value="Hello World" />
                        ><set name="leftContent" 
value="/pages/defaultLeftNav.html" />
                        ><set name="headerContent" 
value="/pages/defaultHeader.html" />
                        ><set name="bodyContent" 
value="/pages/defaultBody.html" />
                        ><set name="footerContent" 
value="/pages/defaultFooter.html" />
                ></symbols>
        ></component>
>
>    <component jsfid="/page1.xml" extends="baseLayout">
>        <symbols>
>              <set name="title" value="Page 1"/>
>              <set name="bodyContent" value="/pages/page1Body.html"/>
>        </symbols>
>    </component>
>
>Earlier I had a page called page1.xml which contained the definition for
>this and all was well, however if I now try to access the same page I get:
>
>javax.servlet.ServletException: Unable to find file /page1.xml.  If this is
>a full HTML or XML view, check your navigation rules.
>
>What am I missing here?
>

The “full XML” views need to be defined in a separate set of configuration 
files - separate from the “commons”.  I can see how this is confusing.  

Both types use the same xml schema but have separate handlers.  
There are  three types of clay configuration beans (common – no suffix, 
full xml, full html) that are determined by the suffix of the jsfid.  
The suffix indicates what handler is used to parse and load the data.  
Handler also have their own cache and set of dependencies.

Beans that don't have a jsfid suffix are defined in the "commons" config 
file.  These define the core set of JSF components but can also define 
complex reusable compositions of components.  They are registered in 
the web.xml using the following context param:   

        <!-- Clay Common Configuration Resources -->
 <context-param>
  <param-name>
   org.apache.shale.clay.COMMON_CONFIG_FILES
  </param-name>
  <param-value>
   /WEB-INF/clay-config.xml,
   classpath*:META-INF/tomahawk-1_1_3-config.xml
  </param-value>
 </context-param>

The "full xml views" are defined in a separate set of configuration files.
These clay component config beans can reference and extend definitions
in the "commons" but are managed by a different handler.  The full xml
views define the viewid/view root.  They can be centrally defined in a
single config file loaded on application startup (like tiles) or a 
separate file per view loaded on demand (like jsp).   

 <!-- 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>

If you define the full xml views in the commons config files, they will be 
ignored since the handler uses a separate cache and is only interested 
in jsfid's that don't have a suffix.
There is an example in the sandbox of using the "full-xml" views.
http://svn.apache.org/viewvc/shale/sandbox/shale-clay-mailreader/


>
>Hermod
>
>


Gary 

Reply via email to