You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Keijo Lehto <ma...@koodiorja.com> on 2003/03/16 00:15:08 UTC
Creating a MenuGenerator based on DirectoryGenerator
Hi,
I'm thinking about writing my own "MenuGenerator" by modifying
org.apache.cocoon.generation.DirectoryGenerator so that it will read the
filesystem under my "mount" directory and generate <section>s from
directories and <resource>s from certain XML files under those
directories under mount.
The generator would be called every time a user requests for a resource
on the site and the generator would then decide what
directories/resources would be shown in the menu based on current user's
permissions (linking between users, user groups and resources will be
located in a database). If I've understood correctly, this wouldn't
cause too much payload for the server since the results would be cached
and the menu would have to be generated only if the site structure
changes, right?
The question is: Am I doing something really stupid here? I'm kind of
newbie with Cocoon and I most certainly haven't yet understood the whole
potential of it so all comments are more than welcome. However, the site
I'm building should be completely dynamic and, therefore, the menu
creation should be somewhat realtime. Is there a component that would do
this already?
An example menu generated by the generator could be as follows:
<menu>
<section name="Studying">
<resource name="index.xml"/>
<resource name="freshmen.xml"/>
<resource name="links.xml"/>
</section>
<section name="Something else">
...
</section>
</menu>
and it would be aggregated in cocoon sitemap and shown in the final
output for the user.
Cheers,
Keijo
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org
PhpGenerator help
Posted by JD Daniels <jd...@datatrio.com>.
Has anyone gotten the phpgenerator to work? I have followed this page:
http://wiki.cocoondev.org/Wiki.jsp?page=PHPGenerator
and do not get any error messages.. just a blank html page (The html/body
tags are present, just no content)
My config:
Redhat 7.3
tomcat 4.1.18
Cocoon 2.1-dev (March 16 cvs checkout)
My phpsrvlt.jar is only 10k ... seems kinda small - Is this right?
JD
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org
Re: Creating a MenuGenerator based on DirectoryGenerator
Posted by Miles Egan <mi...@caddr.com>.
On Sat, 2003-03-15 at 15:15, Keijo Lehto wrote:
> Hi,
>
> I'm thinking about writing my own "MenuGenerator" by modifying
> org.apache.cocoon.generation.DirectoryGenerator so that it will read the
> filesystem under my "mount" directory and generate <section>s from
> directories and <resource>s from certain XML files under those
> directories under mount.
We're doing something like this on our site. It works pretty well and
is fairly straightforward.
miles
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org
Re: Creating a MenuGenerator based on DirectoryGenerator
Posted by Upayavira <uv...@upaya.co.uk>.
> Is there a name for this pattern? That's exactly what a Struts
> ActionForward (or is it Actionmapping?) is! And there's another name
> for it in Maverick.
Forrest calls it 'Semantic Linking', to quote from
http://xml.apache.org/forrest/linking.html:
"Forrest's solution is simple: instead of <link href="todo.html">, write <link
href="site:todo">, where:
site is a URI 'scheme'; a namespace that restricts the syntax and semantics of the
rest of the URI [rfc2396]. The semantics of 'site' are "this identifier locates something
in the site's XML sources".
todo identifies the content in todo.xml, by reference to a 'node' of content declared in
site.xml.
We call this semantic linking because instead of linking to a physical representation
(todo.html), we've linked to the 'idea' of "the todo file". It doesn't matter where it
physically lives; that will be sorted out by Forrest.
Regards, Upayavira
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org
Re: Creating a MenuGenerator based on DirectoryGenerator
Posted by Ryan Hoegg <rh...@isisnetworks.net>.
Upayavira wrote:
>One thing that Forrest does which is impressive (which I will steal for my site at some point) is to allow linking to other pages in a site without knowing the page's final URL.
>When linking to a page, you use the page's ID. A couple of input modules and a transformer then translate that ID into the proper URL.
>
>
Is there a name for this pattern? That's exactly what a Struts
ActionForward (or is it Actionmapping?) is! And there's another name
for it in Maverick.
--
Ryan Hoegg
ISIS Networks
http://www.isisnetworks.net
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org
Re: Creating a MenuGenerator based on DirectoryGenerator
Posted by Upayavira <uv...@upaya.co.uk>.
> The question is: Am I doing something really stupid here? I'm kind of
> newbie with Cocoon and I most certainly haven't yet understood the
> whole potential of it so all comments are more than welcome. However,
> the site I'm building should be completely dynamic and, therefore, the
> menu creation should be somewhat realtime. Is there a component that
> would do this already?
When I first came to Cocoon, I had similar thoughts about deriving the navigation
from the files themselves. However, I decided against it in the end, and decided to
follow the model used by Forrest, which is to use a 'linkmap' document. Having made
this decision, my site (70 pages+) was up and running two hours later - so it obviously
worked.
One thing that Forrest does which is impressive (which I will steal for my site at some
point) is to allow linking to other pages in a site without knowing the page's final URL.
When linking to a page, you use the page's ID. A couple of input modules and a
transformer then translate that ID into the proper URL.
Hope this helps.
Regards, Upayavira
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org