You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@forrest.apache.org by Ross Gardler <rg...@apache.org> on 2007/04/01 00:24:00 UTC

Re: using Subversion keyword substitution instead of published date in skin navstrip

Brolin Empey wrote:
> Thanks for the suggestions.
> 
> I missed the FAQ about the CVS keywords because I was searching the
> FAQ page for SVN terms.
> 
> I already knew that the "Last Published" line was written by
> client-side JavaScript code.  This led me to believe that client-side
> scripting was used because it was not possible to include
> page-specific properties in the output of the skinning process.  I
> decided to ask on this list in case my assumption was incorrect.
> 
> For now, I have settled on using the SVN "Id" keyword in the body of
> each page.  This is not as elegant of a solution as having the
> expansion of the "Id" keyword in the skin, since it means there is a
> chance of having a page without the "Id" keyword.  However, my
> solution is still better than the "Last Published" line, because the
> latter always prints the current date and time on my public Web site.
> This is misleading and not useful.  It is much more useful and
> meaningful to me to have the date and time the source file was last
> modified.
> 
> Here is what I did:
> 
> In main/webapp/skins/pelt/xslt/html/site2xhtml.xsl I used a test that

You should not be editing the skin provided by Forrest. the reason 
being, if you upgrade to a later version of Forrest you will have to 
re-apply your changes. Thus you are creating a maintenance problem for 
yourself.

Forrest has a mechanism to allow you to create your own skins in order 
to help with this problem. I linked to an introductory doc on this in my 
original reply. If you need more details than you can find in the docs 
then ask away.

> I would still be
> interested if someone finds a way to put the "Id" keyword in the skin
> (more specifically, in the footer), though.

You're nearly there. The footer is generated by the site2xhtml.xsl, 
search for "start Footer" to find the relevant part.

This XSL has lots of information available to it, including the body 
content (obviously).

What you need to do is, rather than add the date to the body of the 
content, you need to add it as meta-data, then processes this meta data 
in site2xhtml.html

How is meta-data handled in 0.7? I'm afraid I can't remember, I have a 
feeling it is handled very badly in 0.7. The good news is that we are 
rapidly working towards a 0.8 release (no really, it should be out 
*very* soon - see recent activity on the dev list to be convinced. In 
0.8 there is much better handling of meta data.

Therefore, my recommendation is to stick with what you have for now, 
then when 0.8 is released and you have upgraded, ask your question again.

Ross


Re: using Subversion keyword substitution instead of published date in skin navstrip

Posted by Brolin Empey <br...@gmail.com>.
On 4/1/07, Ross Gardler <rg...@apache.org> wrote:
> Brolin Empey wrote:
> > When you say I need to add the date as metadata, where would I add the
> > date?  Do you mean by using meta elements in the head section of the
> > xdocs source file?
>
> Like I said, in 0.7 meta-data handling is poor. Better to switch to 0.8
> first. There's no point in you doing the work for 0.7 only to have to
> change in 0.8.

I did not intend to use the metadata handling in 0.7.  I was asking
for clarification because I did not know what you meant.

> The final release date (if passed in the above vote) is intended to be
> Monday 2007-04-16 at 22:00 UTC

In that case, I will keep what I have until 0.8 is released.

Brolin

Re: using Subversion keyword substitution instead of published date in skin navstrip

Posted by Ross Gardler <rg...@apache.org>.
Brolin Empey wrote:
> When you say I need to add the date as metadata, where would I add the
> date?  Do you mean by using meta elements in the head section of the
> xdocs source file?

Like I said, in 0.7 meta-data handling is poor. Better to switch to 0.8 
first. There's no point in you doing the work for 0.7 only to have to 
change in 0.8.

> Ideally I would like for Forrest to be able to access the SVN metadata
> without having to use and enable SVN keyword substitution for each
> source file.  Is this possible?

Almost certainly it will be. But Forrest does not currently support 
this, it will require a new Cocoon Genereator, hence some Java coding. 
If you are interested then join us on the Dev list where we can provide 
some background info on how to do it.

> How soon is "very soon" to you?  By the end of next week?  By the end of 
> April?

The vote has not finished yet, but you can see the proposed timeline 
(and the vote) in http://marc.info/?t=117496909600002&r=1&w=2

The final release date (if passed in the above vote) is intended to be 
Monday 2007-04-16 at 22:00 UTC

Of course, this is dependant on no blockers being discovered during the 
testing phase.

Ross

Re: using Subversion keyword substitution instead of published date in skin navstrip

Posted by Ross Gardler <rg...@apache.org>.
Brian M Dube wrote:
> Brolin Empey wrote:
>> Normally I would not like to edit the skin provided by Forrest as I
>> have done, for the maintenance reason you cited.  However, the
>> document I read on creating a new skin seemed to strongly discourage
>> users from creating their own skin unless they could not do what they
>> wanted by modifying an existing skin.
> 
> In this case, I would take that to be an encouragement to copy a skin to 
> your project and modify the copy, rather than start from scratch. It's a 
> great way to learn about skins, which could further lead to adventures 
> with custom skins from scratch or heavily modified standard skins.

That is correct. Although I would not copy an existing skin as such. I 
would create my own skin and import the stylesheets from the existing 
skin. Then override the templates you need to change. See, for example, 
how the pelt skin imports the common stylesheets.

This makes maintenance much easier when upgrading to a new release.

Ross

Re: using Subversion keyword substitution instead of published date in skin navstrip

Posted by Brian M Dube <br...@gmail.com>.
Brolin Empey wrote:
> Normally I would not like to edit the skin provided by Forrest as I
> have done, for the maintenance reason you cited.  However, the
> document I read on creating a new skin seemed to strongly discourage
> users from creating their own skin unless they could not do what they
> wanted by modifying an existing skin.

In this case, I would take that to be an encouragement to copy a skin to 
your project and modify the copy, rather than start from scratch. It's a 
great way to learn about skins, which could further lead to adventures 
with custom skins from scratch or heavily modified standard skins.

Brian

Re: using Subversion keyword substitution instead of published date in skin navstrip

Posted by Brolin Empey <br...@gmail.com>.
Normally I would not like to edit the skin provided by Forrest as I
have done, for the maintenance reason you cited.  However, the
document I read on creating a new skin seemed to strongly discourage
users from creating their own skin unless they could not do what they
wanted by modifying an existing skin.

When you say I need to add the date as metadata, where would I add the
date?  Do you mean by using meta elements in the head section of the
xdocs source file?

Ideally I would like for Forrest to be able to access the SVN metadata
without having to use and enable SVN keyword substitution for each
source file.  Is this possible?

How soon is "very soon" to you?  By the end of next week?  By the end of April?

Brolin