cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sergio Carvalho <sergio.carva...@acm.org>
Subject [donation] SectionCutter action
Date Sun, 14 Oct 2001 21:57:44 GMT
Hi,

I'm sorry for the delay sending the section cutter action I talked about in a
thread some days ago. I had plans for implementing regexp matching on the action
before donating it to the Cocoon project, but too many last-minute tasks pop up
too often :-( I'll try to pick this up next weekend.

The action is used like this:
1) Declare the action in the map:actions element of the sitemap. Define the
different site sections, and the variables there:
     <map:action name="cut-section" 
                 src="org.apache.cocoon.acting.SectionCutterAction">
        <section pattern="jogos">
          <set-var name="section" value="jogos" />
          <set-var name="title" value="Jogos" />
        </section>
        <section pattern="forums/read/chat/quadro/">
          <set-var name="section" value="chat" />
          <set-var name="title" value="Chat" />
          <set-var name="dart" value="tagarela.portugalmail.pt" />
        </section>
      </map:action>

2) Use the action on the sitemap, just like all other actions:
     <map:match pattern="**">
       <map:act type="cut-section">
       ...

The variables defined with set-var on the section definition will be available
in the sitemap as {section}, {title}, {dart} for the example above.

Currently, the pattern matches against the beggining of the URI, with no
wildcards. I plan (need) to have it match regular expressions.

Cheers,

--
Sergio Carvalho
---------------
sergio.carvalho@acm.org

If at first you don't succeed, skydiving is not for you

Mime
View raw message