You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by footh <fo...@yahoo.com> on 2005/07/19 21:42:26 UTC

Advice on site design - really close

I'm converting my site from pure JSP to Cocoon.

I've read lots of tutorials on Cocoon and I've come
really close to getting the site to work the way I
want but I've hit a few snags.

Basically, the site has a header, footer and two
sidebars with content in the middle.  In JSP, I would
just have includes on every page for the header,
footer, etc.  However, in Cocoon, I was hoping I could
have one "template" page that decided the layout.

I was able to create this model, mainly using this
tutorial:
http://www.cocooncenter.org/articles/navigation.html

I created an XSL stylesheet for the header, footer,
and two sidebars, along with associated XML content
files and imported those into a "main" stylesheet. 
Then, in the main stylesheet, I apply the templates
for the constant parts by using the document function
in XSL, for ex:

<xsl:apply-templates
select="document('..\menus\header.xml')/*"/>

For the main content on each page, I have separate XML
files that, for now, are simply a dump of static HTML
and I use the copy-of XSL tag to insert it into the
page.  Later, I'll make these XSP pages and
dynamically generate the content.

Here's where I've hit a couple issues.  The header,
footer and sidebars contain some dynamic content.  For
example, if a person is logged in, the header will
show something different.  I was able to get around
this by passing in the "remoteUser" parameter to the
stylesheet in the pipeline and then using stylesheet
logic.  But, there's also other logic I will need to
process that's a bit more complicated (ex.  depending
on the user's role, etc).  With my current layout, I
can't seem to find a way to add logic that can use
Java to these mostly static blocks.

I've tried aggregating, but that doesn't seem to work
well with XSP.  Also, I'd like to not use cinclude
since I'd like to avoid including the other elements
on every page like in JSP.

Might anyone have any suggestions for me out there?

Thanks a ton.

JF 




__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Advice on site design - really close

Posted by Florian Leinberger <le...@seitenbau.com>.
You might consider using the Cocoon-Portal-Framework that could help you
aggregate the dynamic parts of your site in different portals (see the block
examples).

Florian






---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Advice on site design - really close

Posted by footh <fo...@yahoo.com>.
Thanks for the advice.  I've been delving into the
documentation on Avalon to try to figure out how to
imitate an application-scope object.  This is the last
thing I need to figure out.

I'll give it a shot.  I do have one question though. 
Where do you suggest I initially set this variable? 
In JSP, you would put the reference to the app object
on whatever pages used it.  Then the JSP engine would
instantiate it if wasn't already created and just
leave it alone if it was.  Is there a similar way to
do this with the ServletContext?


--- Owen Tallman <ow...@gmail.com> wrote:

> If you use flowscript as part of your control, you
> have access to the
> application (servlet) context by way of the object
> cocoon.context:
> 
> see
>
http://cocoon.apache.org/2.1/userdocs/flow/api.html#context-N100C1
> 
> For example, from within flowscript you can do  gets
> and sets like
> 
> cocoon.context.getAttribute("attributeKey")
> 
> for your particular attribute, just as you would
> access the ServletContext. 
> 
> Hope that helps,
> 
> Owen
> 
> 
> On 7/20/05, footh <fo...@yahoo.com> wrote:
> > Thanks everyone for all your help.  Late last
> night
> > after reading more documentation, I discovered the
> > concept of the "internal" pipeline.  This seems to
> be
> > exactly what I need.  I can aggregrate all the
> pieces
> > after they've been generated and transformed in an
> > internal pipeline into one big xml file that can
> then
> > be transformed by my main XSL stylesheet.
> > 
> > Now, another question that I can't seem to find
> any
> > documentation on.  Is there an analogue for the
> > application-scope variable in cocoon?  Or perhaps
> > there's a better way to do what I need to do in
> > Cocoon.
> > 
> > In my JSP app, I would have, say 100 articles and
> on
> > each page click, I randomly displayed 5 articles. 
> I
> > did this by storing all the article info in an
> > application variable upon which I would randomly
> pick
> > 5 to display everytime the user clicked a new
> page.
> > The advantage of using the application-scope
> variable
> > was I did have to hit the database on every click
> and
> > it was data that every user shared.  The
> disadvantage
> > is, if a new article was added, I would have to
> > restart the Web service to get it added.
> > 
> > Anyway, can anyone provide advice as to how I
> might
> > accomplish this in cocoon?
> > 
> > --- Jan Hoskens <jh...@schaubroeck.be> wrote:
> > 
> > > footh wrote:
> > >
> > > >I read about flow before and in fact I intended
> ot
> > > use
> > > >it once I got this supposedly "basic" part of
> the
> > > site
> > > >resolved.
> > > >
> > > >Anyway, I re-read the documentation and I can't
> > > seem
> > > >to find out how it would help the situation
> > > described
> > > >below.  How can I use flow logic combine 5
> pages
> > > that
> > > >require dynamic processing into one page?
> > > >
> > > >
> > >
> > > There are several ways to do this. Take a look
> at
> > > the docs for:
> > > aggregating (sitemap element), cinclude or
> xinclude
> > > (transformers).
> > >
> > > I'll give a small example:
> > > - Let each request go through one sitemap
> matcher
> > > - This matcher has either an aggregate:
> > >     <map:aggregate ... maybe defining a new
> > > surrouning parent element
> > >        <map:part.... here your different parts
> > > (menu/content/sidebars...)
> > >
> > >    or read in a template page and use includes:
> > >     <map:generate src="template.xml"/> (template
> > > contains include tags
> > > for each different part)
> > >     <map:transform type="cinclude"/> (this step
> > > reads the include tags
> > > and calls the different pipes to include)
> > >
> > > - each part for menu/sidebars/... can be
> processed
> > > by separate matchers
> > > in an internal-only pipeline
> > >
> > > - each matcher can contain its own flowscript
> > > functions if needed(thus
> > > program/call anything you like), or you can
> produce
> > > general information
> > > in your template sitemap matcher (eg by action ,
> own
> > > component or again
> > > flowscript, doesn't matter) and set these in
> your
> > > session or context so
> > > it's available within the different parts.
> > >
> > > - the template matcher will then contain all the
> > > information and you can
> > > style this to any outputtype you want (probably
> just
> > > plain html). Just
> > > remember to leave your html styling and
> javascript
> > > in different files
> > > and include these.
> > >
> > > When creating your own generator/components
> remember
> > > to make these
> > > reusable and that there is already a lot of
> > > funcionality available.
> > >
> > > Kind regards,
> > > Jan
> > >
> > >
> > >
> > > >--- Ralph Goers <Ra...@dslextreme.com>
> wrote:
> > > >
> > > >
> > > >
> > > >>It sounds like you need to take a look at
> > > flowscript
> > > >>or javaflow.
> > > >>
> > > >>footh wrote:
> > > >>
> > > >>
> > > >>
> > > >>>I'm converting my site from pure JSP to
> Cocoon.
> > > >>>
> > > >>>I've read lots of tutorials on Cocoon and
> I've
> > > come
> > > >>>really close to getting the site to work the
> way
> > > I
> > > >>>want but I've hit a few snags.
> > > >>>
> > > >>>Basically, the site has a header, footer and
> two
> > > >>>sidebars with content in the middle.  In JSP,
> I
> > > >>>
> > > >>>
> > > >>would
> > > >>
> > > >>
> > > >>>just have includes on every page for the
> header,
> > > >>>footer, etc.  However, in Cocoon, I was
> hoping I
> > > >>>
> > > >>>
> > > >>could
> > > >>
> > > >>
> > > >>>have one "template" page that decided the
> layout.
> > > >>>
> > > >>>I was able to create this model, mainly using
> > > this
> > > >>>tutorial:
> > > >>>
> > > >>>
> > >
> >
>
>>http://www.cocooncenter.org/articles/navigation.html
> 
=== message truncated ===


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Advice on site design - really close

Posted by Owen Tallman <ow...@gmail.com>.
If you use flowscript as part of your control, you have access to the
application (servlet) context by way of the object cocoon.context:

see http://cocoon.apache.org/2.1/userdocs/flow/api.html#context-N100C1

For example, from within flowscript you can do  gets and sets like

cocoon.context.getAttribute("attributeKey")

for your particular attribute, just as you would access the ServletContext. 

Hope that helps,

Owen


On 7/20/05, footh <fo...@yahoo.com> wrote:
> Thanks everyone for all your help.  Late last night
> after reading more documentation, I discovered the
> concept of the "internal" pipeline.  This seems to be
> exactly what I need.  I can aggregrate all the pieces
> after they've been generated and transformed in an
> internal pipeline into one big xml file that can then
> be transformed by my main XSL stylesheet.
> 
> Now, another question that I can't seem to find any
> documentation on.  Is there an analogue for the
> application-scope variable in cocoon?  Or perhaps
> there's a better way to do what I need to do in
> Cocoon.
> 
> In my JSP app, I would have, say 100 articles and on
> each page click, I randomly displayed 5 articles.  I
> did this by storing all the article info in an
> application variable upon which I would randomly pick
> 5 to display everytime the user clicked a new page.
> The advantage of using the application-scope variable
> was I did have to hit the database on every click and
> it was data that every user shared.  The disadvantage
> is, if a new article was added, I would have to
> restart the Web service to get it added.
> 
> Anyway, can anyone provide advice as to how I might
> accomplish this in cocoon?
> 
> --- Jan Hoskens <jh...@schaubroeck.be> wrote:
> 
> > footh wrote:
> >
> > >I read about flow before and in fact I intended ot
> > use
> > >it once I got this supposedly "basic" part of the
> > site
> > >resolved.
> > >
> > >Anyway, I re-read the documentation and I can't
> > seem
> > >to find out how it would help the situation
> > described
> > >below.  How can I use flow logic combine 5 pages
> > that
> > >require dynamic processing into one page?
> > >
> > >
> >
> > There are several ways to do this. Take a look at
> > the docs for:
> > aggregating (sitemap element), cinclude or xinclude
> > (transformers).
> >
> > I'll give a small example:
> > - Let each request go through one sitemap matcher
> > - This matcher has either an aggregate:
> >     <map:aggregate ... maybe defining a new
> > surrouning parent element
> >        <map:part.... here your different parts
> > (menu/content/sidebars...)
> >
> >    or read in a template page and use includes:
> >     <map:generate src="template.xml"/> (template
> > contains include tags
> > for each different part)
> >     <map:transform type="cinclude"/> (this step
> > reads the include tags
> > and calls the different pipes to include)
> >
> > - each part for menu/sidebars/... can be processed
> > by separate matchers
> > in an internal-only pipeline
> >
> > - each matcher can contain its own flowscript
> > functions if needed(thus
> > program/call anything you like), or you can produce
> > general information
> > in your template sitemap matcher (eg by action , own
> > component or again
> > flowscript, doesn't matter) and set these in your
> > session or context so
> > it's available within the different parts.
> >
> > - the template matcher will then contain all the
> > information and you can
> > style this to any outputtype you want (probably just
> > plain html). Just
> > remember to leave your html styling and javascript
> > in different files
> > and include these.
> >
> > When creating your own generator/components remember
> > to make these
> > reusable and that there is already a lot of
> > funcionality available.
> >
> > Kind regards,
> > Jan
> >
> >
> >
> > >--- Ralph Goers <Ra...@dslextreme.com> wrote:
> > >
> > >
> > >
> > >>It sounds like you need to take a look at
> > flowscript
> > >>or javaflow.
> > >>
> > >>footh wrote:
> > >>
> > >>
> > >>
> > >>>I'm converting my site from pure JSP to Cocoon.
> > >>>
> > >>>I've read lots of tutorials on Cocoon and I've
> > come
> > >>>really close to getting the site to work the way
> > I
> > >>>want but I've hit a few snags.
> > >>>
> > >>>Basically, the site has a header, footer and two
> > >>>sidebars with content in the middle.  In JSP, I
> > >>>
> > >>>
> > >>would
> > >>
> > >>
> > >>>just have includes on every page for the header,
> > >>>footer, etc.  However, in Cocoon, I was hoping I
> > >>>
> > >>>
> > >>could
> > >>
> > >>
> > >>>have one "template" page that decided the layout.
> > >>>
> > >>>I was able to create this model, mainly using
> > this
> > >>>tutorial:
> > >>>
> > >>>
> >
> >>http://www.cocooncenter.org/articles/navigation.html
> > >>
> > >>
> > >>>I created an XSL stylesheet for the header,
> > footer,
> > >>>and two sidebars, along with associated XML
> > content
> > >>>files and imported those into a "main"
> > stylesheet.
> > >>>Then, in the main stylesheet, I apply the
> > templates
> > >>>for the constant parts by using the document
> > >>>
> > >>>
> > >>function
> > >>
> > >>
> > >>>in XSL, for ex:
> > >>>
> > >>><xsl:apply-templates
> > >>>select="document('..\menus\header.xml')/*"/>
> > >>>
> > >>>For the main content on each page, I have
> > separate
> > >>>
> > >>>
> > >>XML
> > >>
> > >>
> > >>>files that, for now, are simply a dump of static
> > >>>
> > >>>
> > >>HTML
> > >>
> > >>
> > >>>and I use the copy-of XSL tag to insert it into
> > the
> > >>>page.  Later, I'll make these XSP pages and
> > >>>dynamically generate the content.
> > >>>
> > >>>Here's where I've hit a couple issues.  The
> > header,
> > >>>footer and sidebars contain some dynamic content.
> >
> > >>>
> > >>>
> > >>For
> > >>
> > >>
> > >>>example, if a person is logged in, the header
> > will
> > >>>show something different.  I was able to get
> > around
> > >>>this by passing in the "remoteUser" parameter to
> > >>>
> > >>>
> > >>the
> > >>
> > >>
> > >>>stylesheet in the pipeline and then using
> > >>>
> > >>>
> > >>stylesheet
> > >>
> > >>
> > >>>logic.  But, there's also other logic I will need
> > >>>
> > >>>
> > >>to
> > >>
> > >>
> > >>>process that's a bit more complicated (ex.
> > >>>
> > >>>
> > >>depending
> > >>
> > >>
> > >>>on the user's role, etc).  With my current
> > layout,
> > >>>
> > >>>
> > >>I
> > >>
> > >>
> > >>>can't seem to find a way to add logic that can
> > use
> > >>>Java to these mostly static blocks.
> > >>>
> > >>>I've tried aggregating, but that doesn't seem to
> >
> === message truncated ===
> 
> 
> 
> 
> ____________________________________________________
> Start your day with Yahoo! - make it your home page
> http://www.yahoo.com/r/hs
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Advice on site design - really close

Posted by Peter van Hardenberg <pv...@uvic.ca>.
Hi Jan,

we recently had this same problem at the Internet Shakespeare Editions. Here's what I came up with.

First, I was disappointed to discover resources can't be inherited, so I created a match-rule like this in the root sitemap.

   <map:match pattern="add-template"> 
  <map:call resource="add-template"/>
   </map:match>

The resource that lives in my root sitemap looks like this:

  <map:resource name="add-template">
   <map:generate src="style/include-template.xslt">
   </map:generate>
   <map:transform type="xinclude"/>
   <map:serialize type="xml"/>
  </map:resource>

We're almost done now, all we need is to write the include-template XSLT. Include-template takes an XHTML file and builds it into a templated XHTML file. It does this by creating itself out of a source XSLT file and a few XIncluded XHTML snippets.
style/include-template.xslt is essentially a souped up identity transform. I have trimmed it down somewhat to make the email more legible, and to remove some obscuring logic for template selection and peer-review status watermarking.

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
                xmlns:xi="http://www.w3.org/2001/XInclude/"
          xmlns="http://www.w3.org/1999/xhtml"
                xmlns:xhtml="http://www.w3.org/1999/xhtml">
<xsl:output method="xhtml" indent="no"/>

<xsl:template match="/xhtml:html">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:xi="http://www.w3.org/2001/XInclude">

 <!-- construct the header of the file by prepending the default header stuff to the source -->
 <head>
  <!--- add these tags to the new document head -->
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <link href="template/css/base.css" rel="stylesheet" type="text/css" />

  <!-- copy in the source doc's head -->
  <xsl:apply-templates select="xhtml:head"/>
 </head>
 <body>
  
  <!-- add the template header -->
  <xi:include href="../template/normal-header.xml"/>
  <xi:include href="../template/normal-academic.xml"/>

  <div id="content">
    <!-- copy through the body of the source page into the content section -->
    <xsl:apply-templates select="xhtml:body"/>
  </div>
  
  <!-- add the footer. -->
  <xi:include href="../template/normal-footer.xml"/>
 </body>
</html>
</xsl:template> 

<!-- these make sure that when you hit a body tag, the contents make it through "unwrapped" -->
<xsl:template match="xhtml:body">
 <xsl:apply-templates/>
</xsl:template>

<xsl:template match="xhtml:head">
 <xsl:apply-templates/>
</xsl:template>

<!-- this is known as the identity transform. it passes everything else through untouched. -->
<xsl:template match="node( ) | @*">
 <xsl:copy>
  <xsl:apply-templates select="@* | node( )"/>
 </xsl:copy>
</xsl:template>

</xsl:stylesheet>

That's essentially the whole shebang. The only thing left is how to apply the template. This part is easy!

   <map:match pattern="someMatchRule">
    <map:generate src="content/yourContent.xml"/>
    <map:transform src="style/theUsual.xslt">
    <map:transform src="cocoon://yourSiteRoot/add-template"/> 
    <map:serialize type="xhtml"/>
   </map:match>

Hope that helps!

-pvh
 
> >>>Basically, the site has a header, footer and two
> >>>sidebars with content in the middle.  In JSP, I
> >>
> >>would
> >>
> >>>just have includes on every page for the header,
> >>>footer, etc.  However, in Cocoon, I was hoping I
> >>
> >>could
> >>
> >>>have one "template" page that decided the layout.
> >>>

Re: Advice on site design - really close

Posted by footh <fo...@yahoo.com>.
Thanks everyone for all your help.  Late last night
after reading more documentation, I discovered the
concept of the "internal" pipeline.  This seems to be
exactly what I need.  I can aggregrate all the pieces
after they've been generated and transformed in an
internal pipeline into one big xml file that can then
be transformed by my main XSL stylesheet.

Now, another question that I can't seem to find any
documentation on.  Is there an analogue for the
application-scope variable in cocoon?  Or perhaps
there's a better way to do what I need to do in
Cocoon.

In my JSP app, I would have, say 100 articles and on
each page click, I randomly displayed 5 articles.  I
did this by storing all the article info in an
application variable upon which I would randomly pick
5 to display everytime the user clicked a new page. 
The advantage of using the application-scope variable
was I did have to hit the database on every click and
it was data that every user shared.  The disadvantage
is, if a new article was added, I would have to
restart the Web service to get it added.

Anyway, can anyone provide advice as to how I might
accomplish this in cocoon?

--- Jan Hoskens <jh...@schaubroeck.be> wrote:

> footh wrote:
> 
> >I read about flow before and in fact I intended ot
> use
> >it once I got this supposedly "basic" part of the
> site
> >resolved.
> >
> >Anyway, I re-read the documentation and I can't
> seem
> >to find out how it would help the situation
> described
> >below.  How can I use flow logic combine 5 pages
> that
> >require dynamic processing into one page?
> >  
> >
> 
> There are several ways to do this. Take a look at
> the docs for: 
> aggregating (sitemap element), cinclude or xinclude
> (transformers).
> 
> I'll give a small example:
> - Let each request go through one sitemap matcher
> - This matcher has either an aggregate:
>     <map:aggregate ... maybe defining a new
> surrouning parent element
>        <map:part.... here your different parts
> (menu/content/sidebars...)
> 
>    or read in a template page and use includes:
>     <map:generate src="template.xml"/> (template
> contains include tags 
> for each different part)
>     <map:transform type="cinclude"/> (this step
> reads the include tags 
> and calls the different pipes to include)
> 
> - each part for menu/sidebars/... can be processed
> by separate matchers 
> in an internal-only pipeline
> 
> - each matcher can contain its own flowscript
> functions if needed(thus 
> program/call anything you like), or you can produce
> general information 
> in your template sitemap matcher (eg by action , own
> component or again 
> flowscript, doesn't matter) and set these in your
> session or context so 
> it's available within the different parts.
> 
> - the template matcher will then contain all the
> information and you can 
> style this to any outputtype you want (probably just
> plain html). Just 
> remember to leave your html styling and javascript
> in different files 
> and include these.
> 
> When creating your own generator/components remember
> to make these 
> reusable and that there is already a lot of
> funcionality available.
> 
> Kind regards,
> Jan
> 
> 
> 
> >--- Ralph Goers <Ra...@dslextreme.com> wrote:
> >
> >  
> >
> >>It sounds like you need to take a look at
> flowscript
> >>or javaflow.
> >>
> >>footh wrote:
> >>
> >>    
> >>
> >>>I'm converting my site from pure JSP to Cocoon.
> >>>
> >>>I've read lots of tutorials on Cocoon and I've
> come
> >>>really close to getting the site to work the way
> I
> >>>want but I've hit a few snags.
> >>>
> >>>Basically, the site has a header, footer and two
> >>>sidebars with content in the middle.  In JSP, I
> >>>      
> >>>
> >>would
> >>    
> >>
> >>>just have includes on every page for the header,
> >>>footer, etc.  However, in Cocoon, I was hoping I
> >>>      
> >>>
> >>could
> >>    
> >>
> >>>have one "template" page that decided the layout.
> >>>
> >>>I was able to create this model, mainly using
> this
> >>>tutorial:
> >>>      
> >>>
>
>>http://www.cocooncenter.org/articles/navigation.html
> >>    
> >>
> >>>I created an XSL stylesheet for the header,
> footer,
> >>>and two sidebars, along with associated XML
> content
> >>>files and imported those into a "main"
> stylesheet. 
> >>>Then, in the main stylesheet, I apply the
> templates
> >>>for the constant parts by using the document
> >>>      
> >>>
> >>function
> >>    
> >>
> >>>in XSL, for ex:
> >>>
> >>><xsl:apply-templates
> >>>select="document('..\menus\header.xml')/*"/>
> >>>
> >>>For the main content on each page, I have
> separate
> >>>      
> >>>
> >>XML
> >>    
> >>
> >>>files that, for now, are simply a dump of static
> >>>      
> >>>
> >>HTML
> >>    
> >>
> >>>and I use the copy-of XSL tag to insert it into
> the
> >>>page.  Later, I'll make these XSP pages and
> >>>dynamically generate the content.
> >>>
> >>>Here's where I've hit a couple issues.  The
> header,
> >>>footer and sidebars contain some dynamic content.
> 
> >>>      
> >>>
> >>For
> >>    
> >>
> >>>example, if a person is logged in, the header
> will
> >>>show something different.  I was able to get
> around
> >>>this by passing in the "remoteUser" parameter to
> >>>      
> >>>
> >>the
> >>    
> >>
> >>>stylesheet in the pipeline and then using
> >>>      
> >>>
> >>stylesheet
> >>    
> >>
> >>>logic.  But, there's also other logic I will need
> >>>      
> >>>
> >>to
> >>    
> >>
> >>>process that's a bit more complicated (ex. 
> >>>      
> >>>
> >>depending
> >>    
> >>
> >>>on the user's role, etc).  With my current
> layout,
> >>>      
> >>>
> >>I
> >>    
> >>
> >>>can't seem to find a way to add logic that can
> use
> >>>Java to these mostly static blocks.
> >>>
> >>>I've tried aggregating, but that doesn't seem to
> 
=== message truncated ===



		
____________________________________________________
Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Advice on site design - really close

Posted by Jan Hoskens <jh...@schaubroeck.be>.
footh wrote:

>I read about flow before and in fact I intended ot use
>it once I got this supposedly "basic" part of the site
>resolved.
>
>Anyway, I re-read the documentation and I can't seem
>to find out how it would help the situation described
>below.  How can I use flow logic combine 5 pages that
>require dynamic processing into one page?
>  
>

There are several ways to do this. Take a look at the docs for: 
aggregating (sitemap element), cinclude or xinclude (transformers).

I'll give a small example:
- Let each request go through one sitemap matcher
- This matcher has either an aggregate:
    <map:aggregate ... maybe defining a new surrouning parent element
       <map:part.... here your different parts (menu/content/sidebars...)

   or read in a template page and use includes:
    <map:generate src="template.xml"/> (template contains include tags 
for each different part)
    <map:transform type="cinclude"/> (this step reads the include tags 
and calls the different pipes to include)

- each part for menu/sidebars/... can be processed by separate matchers 
in an internal-only pipeline

- each matcher can contain its own flowscript functions if needed(thus 
program/call anything you like), or you can produce general information 
in your template sitemap matcher (eg by action , own component or again 
flowscript, doesn't matter) and set these in your session or context so 
it's available within the different parts.

- the template matcher will then contain all the information and you can 
style this to any outputtype you want (probably just plain html). Just 
remember to leave your html styling and javascript in different files 
and include these.

When creating your own generator/components remember to make these 
reusable and that there is already a lot of funcionality available.

Kind regards,
Jan



>--- Ralph Goers <Ra...@dslextreme.com> wrote:
>
>  
>
>>It sounds like you need to take a look at flowscript
>>or javaflow.
>>
>>footh wrote:
>>
>>    
>>
>>>I'm converting my site from pure JSP to Cocoon.
>>>
>>>I've read lots of tutorials on Cocoon and I've come
>>>really close to getting the site to work the way I
>>>want but I've hit a few snags.
>>>
>>>Basically, the site has a header, footer and two
>>>sidebars with content in the middle.  In JSP, I
>>>      
>>>
>>would
>>    
>>
>>>just have includes on every page for the header,
>>>footer, etc.  However, in Cocoon, I was hoping I
>>>      
>>>
>>could
>>    
>>
>>>have one "template" page that decided the layout.
>>>
>>>I was able to create this model, mainly using this
>>>tutorial:
>>>      
>>>
>>http://www.cocooncenter.org/articles/navigation.html
>>    
>>
>>>I created an XSL stylesheet for the header, footer,
>>>and two sidebars, along with associated XML content
>>>files and imported those into a "main" stylesheet. 
>>>Then, in the main stylesheet, I apply the templates
>>>for the constant parts by using the document
>>>      
>>>
>>function
>>    
>>
>>>in XSL, for ex:
>>>
>>><xsl:apply-templates
>>>select="document('..\menus\header.xml')/*"/>
>>>
>>>For the main content on each page, I have separate
>>>      
>>>
>>XML
>>    
>>
>>>files that, for now, are simply a dump of static
>>>      
>>>
>>HTML
>>    
>>
>>>and I use the copy-of XSL tag to insert it into the
>>>page.  Later, I'll make these XSP pages and
>>>dynamically generate the content.
>>>
>>>Here's where I've hit a couple issues.  The header,
>>>footer and sidebars contain some dynamic content. 
>>>      
>>>
>>For
>>    
>>
>>>example, if a person is logged in, the header will
>>>show something different.  I was able to get around
>>>this by passing in the "remoteUser" parameter to
>>>      
>>>
>>the
>>    
>>
>>>stylesheet in the pipeline and then using
>>>      
>>>
>>stylesheet
>>    
>>
>>>logic.  But, there's also other logic I will need
>>>      
>>>
>>to
>>    
>>
>>>process that's a bit more complicated (ex. 
>>>      
>>>
>>depending
>>    
>>
>>>on the user's role, etc).  With my current layout,
>>>      
>>>
>>I
>>    
>>
>>>can't seem to find a way to add logic that can use
>>>Java to these mostly static blocks.
>>>
>>>I've tried aggregating, but that doesn't seem to
>>>      
>>>
>>work
>>    
>>
>>>well with XSP.  Also, I'd like to not use cinclude
>>>since I'd like to avoid including the other
>>>      
>>>
>>elements
>>    
>>
>>>on every page like in JSP.
>>>
>>>Might anyone have any suggestions for me out there?
>>>
>>>Thanks a ton.
>>>
>>>JF 
>>>
>>>
>>>
>>>
>>>__________________________________________________
>>>Do You Yahoo!?
>>>Tired of spam?  Yahoo! Mail has the best spam
>>>      
>>>
>>protection around 
>>    
>>
>>>http://mail.yahoo.com 
>>>
>>>      
>>>
>>---------------------------------------------------------------------
>>    
>>
>>>To unsubscribe, e-mail:
>>>      
>>>
>>users-unsubscribe@cocoon.apache.org
>>    
>>
>>>For additional commands, e-mail:
>>>      
>>>
>>users-help@cocoon.apache.org
>>    
>>
>>> 
>>>
>>>      
>>>
>>
>>    
>>
>---------------------------------------------------------------------
>  
>
>>To unsubscribe, e-mail:
>>users-unsubscribe@cocoon.apache.org
>>For additional commands, e-mail:
>>users-help@cocoon.apache.org
>>
>>
>>    
>>
>
>
>
>		
>__________________________________ 
>Yahoo! Mail 
>Stay connected, organized, and protected. Take the tour: 
>http://tour.mail.yahoo.com/mailtour.html 
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>For additional commands, e-mail: users-help@cocoon.apache.org
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Advice on site design - really close

Posted by Marc Salvetti <ma...@notremanou.net>.
Hello,

for the aggregation pb, you can have a look to this article : 
http://www.cocooncenter.org/articles/stylefree.html
and maybe this one will help also if you start a cocoon project : 
http://wiki.apache.org/cocoon/CocoonBestPractices
For the application logic, it's usually recommended to keep it in flow 
eg. your sitemap call a flow function that do the logic and call 
cocoo.redirectTo or cocoon.sendPage at the end to launch the view 
pipeline, passing it the bizness data built in flow.
 From what i experienced so far, if you have simple logic in your pages, 
you can perform it with a couple of xsl tranforms and don't really need 
flow.
Whenever the logic becomes more complicated, especially when it includes 
date operations, it becomes much easier to use jx generator + flow

Hope this helps,

Marc

footh a écrit :

>I read about flow before and in fact I intended ot use
>it once I got this supposedly "basic" part of the site
>resolved.
>
>Anyway, I re-read the documentation and I can't seem
>to find out how it would help the situation described
>below.  How can I use flow logic combine 5 pages that
>require dynamic processing into one page?
>
>--- Ralph Goers <Ra...@dslextreme.com> wrote:
>
>  
>
>>It sounds like you need to take a look at flowscript
>>or javaflow.
>>
>>footh wrote:
>>
>>    
>>
>>>I'm converting my site from pure JSP to Cocoon.
>>>
>>>I've read lots of tutorials on Cocoon and I've come
>>>really close to getting the site to work the way I
>>>want but I've hit a few snags.
>>>
>>>Basically, the site has a header, footer and two
>>>sidebars with content in the middle.  In JSP, I
>>>      
>>>
>>would
>>    
>>
>>>just have includes on every page for the header,
>>>footer, etc.  However, in Cocoon, I was hoping I
>>>      
>>>
>>could
>>    
>>
>>>have one "template" page that decided the layout.
>>>
>>>I was able to create this model, mainly using this
>>>tutorial:
>>>      
>>>
>>http://www.cocooncenter.org/articles/navigation.html
>>    
>>
>>>I created an XSL stylesheet for the header, footer,
>>>and two sidebars, along with associated XML content
>>>files and imported those into a "main" stylesheet. 
>>>Then, in the main stylesheet, I apply the templates
>>>for the constant parts by using the document
>>>      
>>>
>>function
>>    
>>
>>>in XSL, for ex:
>>>
>>><xsl:apply-templates
>>>select="document('..\menus\header.xml')/*"/>
>>>
>>>For the main content on each page, I have separate
>>>      
>>>
>>XML
>>    
>>
>>>files that, for now, are simply a dump of static
>>>      
>>>
>>HTML
>>    
>>
>>>and I use the copy-of XSL tag to insert it into the
>>>page.  Later, I'll make these XSP pages and
>>>dynamically generate the content.
>>>
>>>Here's where I've hit a couple issues.  The header,
>>>footer and sidebars contain some dynamic content. 
>>>      
>>>
>>For
>>    
>>
>>>example, if a person is logged in, the header will
>>>show something different.  I was able to get around
>>>this by passing in the "remoteUser" parameter to
>>>      
>>>
>>the
>>    
>>
>>>stylesheet in the pipeline and then using
>>>      
>>>
>>stylesheet
>>    
>>
>>>logic.  But, there's also other logic I will need
>>>      
>>>
>>to
>>    
>>
>>>process that's a bit more complicated (ex. 
>>>      
>>>
>>depending
>>    
>>
>>>on the user's role, etc).  With my current layout,
>>>      
>>>
>>I
>>    
>>
>>>can't seem to find a way to add logic that can use
>>>Java to these mostly static blocks.
>>>
>>>I've tried aggregating, but that doesn't seem to
>>>      
>>>
>>work
>>    
>>
>>>well with XSP.  Also, I'd like to not use cinclude
>>>since I'd like to avoid including the other
>>>      
>>>
>>elements
>>    
>>
>>>on every page like in JSP.
>>>
>>>Might anyone have any suggestions for me out there?
>>>
>>>Thanks a ton.
>>>
>>>JF 
>>>
>>>
>>>
>>>
>>>__________________________________________________
>>>Do You Yahoo!?
>>>Tired of spam?  Yahoo! Mail has the best spam
>>>      
>>>
>>protection around 
>>    
>>
>>>http://mail.yahoo.com 
>>>
>>>      
>>>
>>---------------------------------------------------------------------
>>    
>>
>>>To unsubscribe, e-mail:
>>>      
>>>
>>users-unsubscribe@cocoon.apache.org
>>    
>>
>>>For additional commands, e-mail:
>>>      
>>>
>>users-help@cocoon.apache.org
>>    
>>
>>> 
>>>
>>>      
>>>
>>
>>    
>>
>---------------------------------------------------------------------
>  
>
>>To unsubscribe, e-mail:
>>users-unsubscribe@cocoon.apache.org
>>For additional commands, e-mail:
>>users-help@cocoon.apache.org
>>
>>
>>    
>>
>
>
>
>		
>__________________________________ 
>Yahoo! Mail 
>Stay connected, organized, and protected. Take the tour: 
>http://tour.mail.yahoo.com/mailtour.html 
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>
>
>  
>

	

	
		
___________________________________________________________________________ 
Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger 
Téléchargez cette version sur http://fr.messenger.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Advice on site design - really close

Posted by footh <fo...@yahoo.com>.
I read about flow before and in fact I intended ot use
it once I got this supposedly "basic" part of the site
resolved.

Anyway, I re-read the documentation and I can't seem
to find out how it would help the situation described
below.  How can I use flow logic combine 5 pages that
require dynamic processing into one page?

--- Ralph Goers <Ra...@dslextreme.com> wrote:

> It sounds like you need to take a look at flowscript
> or javaflow.
> 
> footh wrote:
> 
> >I'm converting my site from pure JSP to Cocoon.
> >
> >I've read lots of tutorials on Cocoon and I've come
> >really close to getting the site to work the way I
> >want but I've hit a few snags.
> >
> >Basically, the site has a header, footer and two
> >sidebars with content in the middle.  In JSP, I
> would
> >just have includes on every page for the header,
> >footer, etc.  However, in Cocoon, I was hoping I
> could
> >have one "template" page that decided the layout.
> >
> >I was able to create this model, mainly using this
> >tutorial:
>
>http://www.cocooncenter.org/articles/navigation.html
> >
> >I created an XSL stylesheet for the header, footer,
> >and two sidebars, along with associated XML content
> >files and imported those into a "main" stylesheet. 
> >Then, in the main stylesheet, I apply the templates
> >for the constant parts by using the document
> function
> >in XSL, for ex:
> >
> ><xsl:apply-templates
> >select="document('..\menus\header.xml')/*"/>
> >
> >For the main content on each page, I have separate
> XML
> >files that, for now, are simply a dump of static
> HTML
> >and I use the copy-of XSL tag to insert it into the
> >page.  Later, I'll make these XSP pages and
> >dynamically generate the content.
> >
> >Here's where I've hit a couple issues.  The header,
> >footer and sidebars contain some dynamic content. 
> For
> >example, if a person is logged in, the header will
> >show something different.  I was able to get around
> >this by passing in the "remoteUser" parameter to
> the
> >stylesheet in the pipeline and then using
> stylesheet
> >logic.  But, there's also other logic I will need
> to
> >process that's a bit more complicated (ex. 
> depending
> >on the user's role, etc).  With my current layout,
> I
> >can't seem to find a way to add logic that can use
> >Java to these mostly static blocks.
> >
> >I've tried aggregating, but that doesn't seem to
> work
> >well with XSP.  Also, I'd like to not use cinclude
> >since I'd like to avoid including the other
> elements
> >on every page like in JSP.
> >
> >Might anyone have any suggestions for me out there?
> >
> >Thanks a ton.
> >
> >JF 
> >
> >
> >
> >
> >__________________________________________________
> >Do You Yahoo!?
> >Tired of spam?  Yahoo! Mail has the best spam
> protection around 
> >http://mail.yahoo.com 
> >
>
>---------------------------------------------------------------------
> >To unsubscribe, e-mail:
> users-unsubscribe@cocoon.apache.org
> >For additional commands, e-mail:
> users-help@cocoon.apache.org
> >
> >  
> >
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail:
> users-help@cocoon.apache.org
> 
> 



		
__________________________________ 
Yahoo! Mail 
Stay connected, organized, and protected. Take the tour: 
http://tour.mail.yahoo.com/mailtour.html 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Advice on site design - really close

Posted by Ralph Goers <Ra...@dslextreme.com>.
It sounds like you need to take a look at flowscript or javaflow.

footh wrote:

>I'm converting my site from pure JSP to Cocoon.
>
>I've read lots of tutorials on Cocoon and I've come
>really close to getting the site to work the way I
>want but I've hit a few snags.
>
>Basically, the site has a header, footer and two
>sidebars with content in the middle.  In JSP, I would
>just have includes on every page for the header,
>footer, etc.  However, in Cocoon, I was hoping I could
>have one "template" page that decided the layout.
>
>I was able to create this model, mainly using this
>tutorial:
>http://www.cocooncenter.org/articles/navigation.html
>
>I created an XSL stylesheet for the header, footer,
>and two sidebars, along with associated XML content
>files and imported those into a "main" stylesheet. 
>Then, in the main stylesheet, I apply the templates
>for the constant parts by using the document function
>in XSL, for ex:
>
><xsl:apply-templates
>select="document('..\menus\header.xml')/*"/>
>
>For the main content on each page, I have separate XML
>files that, for now, are simply a dump of static HTML
>and I use the copy-of XSL tag to insert it into the
>page.  Later, I'll make these XSP pages and
>dynamically generate the content.
>
>Here's where I've hit a couple issues.  The header,
>footer and sidebars contain some dynamic content.  For
>example, if a person is logged in, the header will
>show something different.  I was able to get around
>this by passing in the "remoteUser" parameter to the
>stylesheet in the pipeline and then using stylesheet
>logic.  But, there's also other logic I will need to
>process that's a bit more complicated (ex.  depending
>on the user's role, etc).  With my current layout, I
>can't seem to find a way to add logic that can use
>Java to these mostly static blocks.
>
>I've tried aggregating, but that doesn't seem to work
>well with XSP.  Also, I'd like to not use cinclude
>since I'd like to avoid including the other elements
>on every page like in JSP.
>
>Might anyone have any suggestions for me out there?
>
>Thanks a ton.
>
>JF 
>
>
>
>
>__________________________________________________
>Do You Yahoo!?
>Tired of spam?  Yahoo! Mail has the best spam protection around 
>http://mail.yahoo.com 
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>For additional commands, e-mail: users-help@cocoon.apache.org
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org