>From: "Gregg Bolinger" <[EMAIL PROTECTED]> 
>
> Ok, great so far. I got soemthing working. The problem was not having that 
> welcome.html file that pulled everything together. And that leads me to my 
> next question(s). 
> 
> Tell me if this is a correct statement. 
> 
> So for every page I have I'll need a page that is the glue (welcome.html) as 
> well as an html page that is the body for said page (welcomeBody.html). 
> Assuming of course I am using the same header/footer/sidebar, etc and the 
> only thing changing is the body. So I might also have 
> 
> login.html - loginBody.html 
> register.html - registerBody.html 
> 

That's correct if you are using full clay html views.  Another common, similar 
example of needing a file for the entry point would be JSP.


> If that is a true statement, is there any way to get rid of that glue page? 
> Is there anyway to tell Clay/Shale to just use the layout.html and plug in 
> the "components" I need somehow dependent on the URL or navigation? 
> 
> So rather than having loginBody.html maybe I just have login.html which just 
> contains the body I need. In the above scenerio it would be loginBody. And 
> the system knows that when I request login.html go grab layout.html and plug 
> login.html into the correct spot? Am I making any since? 
> 
> Basically, I don't understand the reason, beyond the glue aspect, of having 
> a page whose contents don't get rendered at all. 
> 

I think you would be more happy with using the clay full XML views.  For xml 
views, the entry 
point is a component declaration.  These declarations can be centrally located 
in a single XML 
config file or a file for each page.  Since there is not a way to combine 
multiple HTML files 
into one file, an entry point page is required for full HTML views.

An example of registering full XML config files taken for the usecases:

   <!-- Clay Configuration Full XML view Resources -->
   <context-param>
      <param-name>org.apache.shale.clay.FULLXML_CONFIG_FILES</param-name>
      
<param-value>classpath*:org/apache/shale/usecases/symbols/clay-tiles-config.xml</param-value>
   </context-param>

In this file you will find definitions for two pages that don't have files as 
page entry points.

     <component jsfid="/symbols/page2.xml" extends="basePage">
       <symbols>
           <set name="@title" value="Page 2"/>
           <set name="@bodycontent" value="/symbols/fullperson.html"/>
           <set name="@logo" 
value="http://jsfcentral.com/images/jsf-logo-new.gif"/>  
           <set name="@leftContent" value="page2LeftPanel"/>                   
       </symbols>
    </component>

The suffix of the jsfid must be ".xml".  There are three types of handlers that 
digest 
different sources of component definitions.  This suffix or lack of  is the 
association 
to the handler.    

The "basePage" is defined in the commons config file.

    <!-- Base layout defintion  -->
    <component jsfid="basePage" extends="clay">
       <attributes>
           <set name="clayJsfid" value="/symbols/layout.html" />
       </attributes>
       <symbols>
           <set name="@title" value="Default Title"/>
           <set name="@leftContent" value="page3LeftPanel"/>
           <set name="@headercontent" value="/symbols/header.html"/>
           <set name="@logo" 
value="http://struts.apache.org/images/struts.gif"/>
           <set name="@bodycontent" value="space"/>
           <set name="@footercontent" value="footerPanel"/>   
       </symbols>
    </component>


> Thanks. 
> 
> Gregg 

Gary

> 
> On 4/10/06, Gary VanMatre wrote: 
> > 
> > >Gary, I appreciate the information. Ok, here is what I have and it is 
> > not 
> > >working. Bear with me, I am going to post the bulk of my files, though 
> > the= 
> > >y 
> > >are quite short. 
> > > 
> > > 
> > >[web.xml] 
> > 
> > I didn't seen anything that didn't look correct in the web.xml snippet you 
> > provided. 
> > One thing to check is the chains-config.xml. If you are using 
> > the ContextRelativePathFilter 
> > to prevent direct access to resources, make sure that "/S*\.html" is added 
> > to the includes 
> > attribute list. 
> > 
> > >[clay-config.xml] 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > >[clay-symbols-config.xml] 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > > > id=3D"password"> 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > >[layout.html] 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > >

> > > 
> > > 
> > > > > >allowBody=3D"false">Body ContentBody Content 
> > > 
> > > 

> > >

> > > 
> > > 
> > > 
> > >[welcome.html] 
> > >

> > > 
> > > Username
> > > 
> > > 

> > > 
> > > Password
> > > 
> > > 

> > >

> > > 
> > 
> > When you are using clay full html views exclusively, the entry point to 
> > the page 
> > needs to be a html file. This means that you don't have a pseudo page 
> > definition 
> > like in tiles. You can do this sort of thing with clay's full XML views 
> > as the page 
> > entry point – usecase symbols example (page1 & page2). 
> > 
> > What you need in your example is for the welcome.html page to be a generic 
> > entry 
> > point that pulls a layout in and overrides the body using a symbol (the 
> > page3.html 
> > symbols use cases example). 
> > 
> > So in your example you might want to call the welcome.html template 
> > welcomeBody.html. 
> > And, then add a welcome.html entry point template that pulls it all 
> > togather. 
> > 
> > welcome.html example: 
> > > > bodyContent="/welcomeBody.html" 
> > allowBody="false"> 
> > 
> > 
> > The entire document is replaced by the layout. 
> > 
> > 
> > The bodyContent attribute in the html node becomes a symbol that overrides 
> > the @bodyContent in the layout. 
> > 
> > 
> > >And when I go to http//localhost:8080/test/welcome.html I get a 500, page 
> > >cannot be found [welcome.html]. I have it under the web root pages dir 
> > and 
> > >I have layout.html under templates. Looking for suggestions one what I 
> > have 
> > >done wrong. 
> > 
> > The 500 response code indicates that there was a server error. Check the 
> > server logs for more information on the exception. 
> > 
> > 
> > > 
> > >Thanks. 
> > > 
> > >Gregg 
> > 
> > Gary 
> > 
> 

Reply via email to