Mailing List Archive

motd question
Hi,

I'm trying to add a motd pane only to the main page of my dispatcher website.
Adding the following lines to my pelt-html.content.panel.xml makes the pane to
appear in every index.html page of the website:

<forrest:contract name="content-motd-page">
<forrest:property name="content-motd-page">
<motd>
<motd-option pattern="index.html">
<motd-title></motd-title>
<motd-page location="alt">My message here.</motd-page>
</motd-option>
</motd>
</forrest:property>
</forrest:contract>

I've changed the filename of the main page of my website following the
answer to question 2.13 of the FAQ:

http://forrest.apache.org/docs_0_100/faq.html#defaultStartPage

but I'd rather prefer to achieve my goal giving a proper path to the pattern
option of the motd contract. The problem is that the index.xml of the main
page is directly under the xdocs folder and I don't know how to be more
specific and tell forrest that I don't want the motd to be applied to the index
pages of subdirectories under xdocs. Could someone tell me how to do it,
please?

TIA

Vicent

PS: I'm using forrest from SVN repository (revision 1072403)

::

Share what you know, learn what you don't
Re: motd question [ In reply to ]
On Fri, Apr 01, 2011 at 12:52:41PM +0200, Vicent Mas wrote:
> Hi,
>
> I'm trying to add a motd pane only to the main page of my dispatcher website.
> Adding the following lines to my pelt-html.content.panel.xml makes the pane to
> appear in every index.html page of the website:
>
> <forrest:contract name="content-motd-page">
> <forrest:property name="content-motd-page">
> <motd>
> <motd-option pattern="index.html">
> <motd-title></motd-title>
> <motd-page location="alt">My message here.</motd-page>
> </motd-option>
> </motd>
> </forrest:property>
> </forrest:contract>
>
> I've changed the filename of the main page of my website following the
> answer to question 2.13 of the FAQ:
>
> http://forrest.apache.org/docs_0_100/faq.html#defaultStartPage
>
> but I'd rather prefer to achieve my goal giving a proper path to the pattern
> option of the motd contract. The problem is that the index.xml of the main
> page is directly under the xdocs folder and I don't know how to be more
> specific and tell forrest that I don't want the motd to be applied to the index
> pages of subdirectories under xdocs. Could someone tell me how to do it,
> please?

The motd contract uses the XSLT contains() function to determine
whether the motd is displayed for a given path. It does not appear
that the contains() function is intelligent enough to do what you
want. Also, a brief search shows a general lack of support for regular
expressions in XSLT 1.0.

Perhaps the motd could be injected via the Cocoon pipeline, where
regular expressions are supported.

-Brian
Re: motd question [ In reply to ]
Brian M Dube wrote:
> Vicent Mas wrote:
> >
> > I'm trying to add a motd pane only to the main page of my dispatcher website.
> > Adding the following lines to my pelt-html.content.panel.xml makes the pane to
> > appear in every index.html page of the website:
> >
> > <forrest:contract name="content-motd-page">
> > <forrest:property name="content-motd-page">
> > <motd>
> > <motd-option pattern="index.html">
> > <motd-title></motd-title>
> > <motd-page location="alt">My message here.</motd-page>
> > </motd-option>
> > </motd>
> > </forrest:property>
> > </forrest:contract>

In the "skins" method, which is where this MOTD stuff
orinigated, there is also the "starts-with" attribute.
See docs in main/fresh-site/src/documentation/skinconf.xml
i.e. a 'forrest seed-sample' site.

We use this for forrest.apache.org site to have a specific
message for only the home page index.html
See $FORREST_HOME/site-author/skinconf.xml

Not sure if that is available with Dispatcher.

-David

> > I've changed the filename of the main page of my website following the
> > answer to question 2.13 of the FAQ:
> >
> > http://forrest.apache.org/docs_0_100/faq.html#defaultStartPage
> >
> > but I'd rather prefer to achieve my goal giving a proper path to the pattern
> > option of the motd contract. The problem is that the index.xml of the main
> > page is directly under the xdocs folder and I don't know how to be more
> > specific and tell forrest that I don't want the motd to be applied to the index
> > pages of subdirectories under xdocs. Could someone tell me how to do it,
> > please?
>
> The motd contract uses the XSLT contains() function to determine
> whether the motd is displayed for a given path. It does not appear
> that the contains() function is intelligent enough to do what you
> want. Also, a brief search shows a general lack of support for regular
> expressions in XSLT 1.0.
>
> Perhaps the motd could be injected via the Cocoon pipeline, where
> regular expressions are supported.
>
> -Brian
Re: motd question [ In reply to ]
2011/4/4 David Crossley <crossley@apache.org>:
> Brian M Dube wrote:
>> Vicent Mas wrote:
>> >
>> > I'm trying to add a motd pane only to the main page of my dispatcher website.
>> > Adding the following lines to my pelt-html.content.panel.xml makes the pane to
>> > appear in every index.html page of the website:
>> >
>> >         <forrest:contract name="content-motd-page">
>> >           <forrest:property name="content-motd-page">
>> >             <motd>
>> >               <motd-option pattern="index.html">
>> >                 <motd-title></motd-title>
>> >                 <motd-page location="alt">My message here.</motd-page>
>> >               </motd-option>
>> >             </motd>
>> >           </forrest:property>
>> >         </forrest:contract>
>
> In the "skins" method, which is where this MOTD stuff
> orinigated, there is also the "starts-with" attribute.
> See docs in main/fresh-site/src/documentation/skinconf.xml
> i.e. a 'forrest seed-sample' site.
>
> We use this for forrest.apache.org site to have a specific
> message for only the home page index.html
> See $FORREST_HOME/site-author/skinconf.xml
>
> Not sure if that is available with Dispatcher.
>
> -David
>
>> > I've changed the filename of the main page of my website following the
>> > answer to question 2.13 of the FAQ:
>> >
>> > http://forrest.apache.org/docs_0_100/faq.html#defaultStartPage
>> >
>> > but I'd rather prefer to achieve my goal giving a proper path to the pattern
>> > option of the motd contract. The problem is that the index.xml of the main
>> > page is directly under the xdocs folder and I don't know how to be more
>> > specific and tell forrest that I don't want the motd to be applied to the index
>> > pages of subdirectories under  xdocs. Could someone tell me how to do it,
>> > please?
>>
>> The motd contract uses the XSLT contains() function to determine
>> whether the motd is displayed for a given path. It does not appear
>> that the contains() function is intelligent enough to do what you
>> want. Also, a brief search shows a general lack of support for regular
>> expressions in XSLT 1.0.
>>
>> Perhaps the motd could be injected via the Cocoon pipeline, where
>> regular expressions are supported.
>>
>> -Brian
>

Thanks a lot to both of you for your help. I'll try your suggestions asap.

Vicent


--
Share what you know, learn what you don't.
Re: motd question [ In reply to ]
On 2011-04-04 Vicent Mas <uvemas@gmail.com> said:

> 2011/4/4 David Crossley <crossley@apache.org>:
> > Brian M Dube wrote:
> >> Vicent Mas wrote:
> >> > I'm trying to add a motd pane only to the main page of my dispatcher
> >> > website. Adding the following lines to my pelt-html.content.panel.xml
> >> > makes the pane to appear in every index.html page of the website:
> >> >
> >> > <forrest:contract name="content-motd-page">
> >> > <forrest:property name="content-motd-page">
> >> > <motd>
> >> > <motd-option pattern="index.html">
> >> > <motd-title></motd-title>
> >> > <motd-page location="alt">My message here.</motd-page>
> >> > </motd-option>
> >> > </motd>
> >> > </forrest:property>
> >> > </forrest:contract>
> >
> > In the "skins" method, which is where this MOTD stuff
> > orinigated, there is also the "starts-with" attribute.
> > See docs in main/fresh-site/src/documentation/skinconf.xml
> > i.e. a 'forrest seed-sample' site.
> >
> > We use this for forrest.apache.org site to have a specific
> > message for only the home page index.html
> > See $FORREST_HOME/site-author/skinconf.xml
> >
> > Not sure if that is available with Dispatcher.
> >
> [...]
> >
> Thanks a lot to both of you for your help. I'll try your suggestions asap.
>
> Vicent

Hi,

I've updated my local repo and checked that the 'starts-with' attribute stuff
of motd is not available with dispatcher. I've customised the content-motd-
page.contract.xml that comes with dispatcher adding some 'starts-with' stuff.
I've used $FORREST_HOME/main/webapp/skins/pelt/xslt/html/site-to-xhtml.xsl as
a guide (not sure if it is the best choice but it has been good enough for
me). Now the motd contract works as I want.

So again thanks for your help,

Vicent
::

Share what you know, learn what you don't
Re: motd question [ In reply to ]
Vicent Mas wrote:
>
> I've updated my local repo and checked that the 'starts-with' attribute stuff
> of motd is not available with dispatcher. I've customised the content-motd-
> page.contract.xml that comes with dispatcher adding some 'starts-with' stuff.
> I've used $FORREST_HOME/main/webapp/skins/pelt/xslt/html/site-to-xhtml.xsl as
> a guide (not sure if it is the best choice but it has been good enough for
> me). Now the motd contract works as I want.
>
> So again thanks for your help,

Yes the "pelt" skin is the one that the Forrest project
keeps up-to-date. It is what the Forrest project website uses.
http://forrest.apache.org/docs/dev/status-themes.html
So that is the correct one to base your work upon.

Are you able to provide a patch for Dispatcher?

-David
Re: motd question [ In reply to ]
On 2011-04-13 David Crossley <crossley@apache.org> said:

> Vicent Mas wrote:
> > I've updated my local repo and checked that the 'starts-with' attribute
> > stuff of motd is not available with dispatcher. I've customised the
> > content-motd- page.contract.xml that comes with dispatcher adding some
> > 'starts-with' stuff. I've used
> > $FORREST_HOME/main/webapp/skins/pelt/xslt/html/site-to-xhtml.xsl as a
> > guide (not sure if it is the best choice but it has been good enough for
> > me). Now the motd contract works as I want.
> >
> > So again thanks for your help,
>
> Yes the "pelt" skin is the one that the Forrest project
> keeps up-to-date. It is what the Forrest project website uses.
> http://forrest.apache.org/docs/dev/status-themes.html
> So that is the correct one to base your work upon.
>
> Are you able to provide a patch for Dispatcher?
>
> -David

Hi,

I've attached the patch to this mail. You can apply it from the FORREST_HOME
like this:

$ patch -p0 <content-motd-page-contract.diff

Please, note that I've not tried to port all motd functionality from
$FORREST_HOME/main/webapp/skins/pelt/xslt/html/site-to-xhtml.xsl to the
dispatcher contract. I've just picked what I needed to achieve my goal.

That being said, If the patch is fine with you I can attach it to an issue at
jira.

Hope it helps,

Vicent
::

Share what you know, learn what you don't