You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by Ross Gardler <rg...@apache.org> on 2005/06/21 19:06:39 UTC

Post processing using views

I have a skin that I use for adding links to a glossary page. In my 
xdocs I have links like this:

<a href="electronicBusiness" class="glossary">E-Business</a>

The skin uses the class="glossary" attribute to flag glossary links and 
this is converted to something like:

<a href="/glossary.html#electronicBusiness">E-Business</a>

This works just fine, but now I want to use the same kind of 
functionality in a views based site. So I have a couple of questions.

1) Is there a way to extend the the "skin" to do the necessary link 
rewriting? I know I can do it be extending the leather-dev skin, but is 
there a better way now we have views? This leads me to the next question:

2) can an input plugin add the necessary view extensions? That is, since 
I have now put the DTD and stylesheets for glossary.html into a plugin I 
would like the rewrite rules to be provided by the plugin as well, 
rather than the "skin"

Ross


Re: Post processing using views

Posted by Thorsten Scherler <th...@apache.org>.
Argh,

I send to early and lost the instructions how to do it. :( 

...but I will try again.

In the contract "content-main" you can apply this rewriting rules. e.g.
you can try:
 <xsl:apply-templates
select="div[@id='content']/div[@id='content-main']/*"/>

...
<xsl:template match="a[class='glossary']" >
...do rewriting
<xsl:apply-templates/>
</xsl:template>

The only problem IMO is that you may interfere with the other overall
processing. Just try the above and see how it works.

Please report back. ;-)

salu2

On Wed, 2005-06-22 at 11:20 +0200, Thorsten Scherler wrote:
> On Tue, 2005-06-21 at 18:06 +0100, Ross Gardler wrote:
> > I have a skin that I use for adding links to a glossary page. In my 
> > xdocs I have links like this:
> > 
> > <a href="electronicBusiness" class="glossary">E-Business</a>
> > 
> > The skin uses the class="glossary" attribute to flag glossary links and 
> > this is converted to something like:
> > 
> > <a href="/glossary.html#electronicBusiness">E-Business</a>
> > 
> 
> That is done right now in document2html.xsl, right?
> 
> > This works just fine, but now I want to use the same kind of 
> > functionality in a views based site. So I have a couple of questions.
> > 
> > 1) Is there a way to extend the the "skin" to do the necessary link 
> > rewriting? I know I can do it be extending the leather-dev skin, but is 
> > there a better way now we have views? This leads me to the next question:
> > 
> 
> Ok, the thing is we are still using the document2html.xsl from
> leather-dev. That means this link rewriting is normally done in an
> earlier processing step then where views come in to play. 
> 
> We need to discuss how we can place the views earlier in the processing.
> 
> 
> > 2) can an input plugin add the necessary view extensions? That is, since 
> > I have now put the DTD and stylesheets for glossary.html into a plugin I 
> > would like the rewrite rules to be provided by the plugin as well, 
> > rather than the "skin"
> > 
> 
> 
> To the second question, I agree that best practice would be that the
> plugin would offer the necessary view extensions. IMO that means that a
> plugin that is offering a contract implementation would need to
> "register" in the viewHelper plugin. I am still unsure what the best way
> will be. 
> 
-- 
thorsten

"Together we stand, divided we fall!" 
Hey you (Pink Floyd)


Re: Post processing using views

Posted by Thorsten Scherler <th...@apache.org>.
On Tue, 2005-06-21 at 18:06 +0100, Ross Gardler wrote:
> I have a skin that I use for adding links to a glossary page. In my 
> xdocs I have links like this:
> 
> <a href="electronicBusiness" class="glossary">E-Business</a>
> 
> The skin uses the class="glossary" attribute to flag glossary links and 
> this is converted to something like:
> 
> <a href="/glossary.html#electronicBusiness">E-Business</a>
> 

That is done right now in document2html.xsl, right?

> This works just fine, but now I want to use the same kind of 
> functionality in a views based site. So I have a couple of questions.
> 
> 1) Is there a way to extend the the "skin" to do the necessary link 
> rewriting? I know I can do it be extending the leather-dev skin, but is 
> there a better way now we have views? This leads me to the next question:
> 

Ok, the thing is we are still using the document2html.xsl from
leather-dev. That means this link rewriting is normally done in an
earlier processing step then where views come in to play. 

We need to discuss how we can place the views earlier in the processing.


> 2) can an input plugin add the necessary view extensions? That is, since 
> I have now put the DTD and stylesheets for glossary.html into a plugin I 
> would like the rewrite rules to be provided by the plugin as well, 
> rather than the "skin"
> 


To the second question, I agree that best practice would be that the
plugin would offer the necessary view extensions. IMO that means that a
plugin that is offering a contract implementation would need to
"register" in the viewHelper plugin. I am still unsure what the best way
will be. 

-- 
thorsten

"Together we stand, divided we fall!" 
Hey you (Pink Floyd)