forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thorsten Scherler <thors...@apache.org>
Subject Re: [Discuss] Templating language - forrest:templates and Struts Tiles
Date Mon, 22 Nov 2004 17:29:07 GMT
El lun, 22-11-2004 a las 12:42, Thorsten Scherler escribió:
> > 2 - Content filtering. Let's say I want to colorize java code...
> 
> Can you extend?

I may have an idea to do it as I understand it.

Problem: 
You want highlight certain content. Like the cached sites of google.
e.g.
http://www.google.ch/search?q=cache:bwxwyjoorUUJ:www.target-x.de/+target-x&hl=de

Solution: 
This I guess would be done by a custom xsl that is looking for a certain
string or certain markup element and add the css-elements to it. I
reckon that should be done in a plugin e.g.
org.apache.forrest.plugin.highlight.

Now it getting into advanced features of f:t. ;-)

Due to the fact that we are working with registered contracts every
contract is known to the controller. So are the used plugins.

Now we come to an interaction between view and plugin. The above
mentioned plugin will use as input the content nugget and deliver
filtered and highlighted content back to the view.
<forrest:plugin 
  name="org.apache.forrest.plugin.highlight" 
  input="content"/>

Now back to the google example. It should be possible to add input
parameter for the highlight plugin.
<forrest:plugin 
  name="org.apache.forrest.plugin.highlight" 
  input="content">
  <param name="filter1" type="string" value="target-x"/>
  <param name="filter2" type="tag">
    <div id="someId"/>
  </param>
</forrest:plugin>

The forrest:view would be something like:
<forrest:view output-format="xhtml, fo" name="default">
  <forrest:hook name="intro">
   <forrest:nugget name="grouplogo"/>
  </forrest:hook>
  <forrest:hook name="newsfeedHook">
    <forrest:nugget name="newsfeed"/>
  </forrest:hook>
  <forrest:hook name="content">
    <forrest:plugin 
  	name="org.apache.forrest.plugin.highlight" 
  	input="content">
  	<param name="filter1" type="string" value="target-x"/>
    </forrest:plugin>
  </forrest:hook>
</forrest:view>

-- 
thorsten

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


Mime
View raw message