<?xml version="1.0"?>
<rss version="2.0">
<channel>
  <title>Spikes Of Nothingness - new tag</title>
  <link>http://weblog.flop.ca/tags/new/</link>
  <description>Florin T.PATRASCU&#039;s blog</description>
  <language>en</language>
  <copyright>Florin T.PATRASCU</copyright>
  <lastBuildDate>Sat, 12 May 2012 02:12:08 GMT</lastBuildDate>
  <generator>Pebble (http://pebble.sourceforge.net)</generator>
  <docs>http://backend.userland.com/rss</docs>
  
  
  <item>
    <title>StringTemplate Renderer for JPublish, a Component this time ;)  </title>
    <link>http://weblog.flop.ca/2007/09/01/1188678524233.html</link>
    
      
        <description>
          &lt;p&gt;  &lt;/p&gt;
Hi there,&lt;br /&gt;
&lt;br /&gt;
For those of you maintaining JPublish sites developed with Velocity or FreeMarker, using the newly added StringTemplate renderer is not an easy option, especially if those sites are in production. So what can you do if you want to use ST? &lt;br /&gt;
&lt;br /&gt;
Don&#039;t worry, you can render StringTemplate syntax in Velocity/FreeMarker driven pages by using the StringTemplate component that I just added to the JPublish component family.&lt;br /&gt;
&lt;br /&gt;
Using it is very simple. &lt;br /&gt;
&lt;br /&gt;
Build the ST Component from &lt;a href=&#034;http://jpublish.googlecode.com/svn/trunk/components/jpStringTemplate/&#034;&gt;SVN&lt;/a&gt;&amp;nbsp; and load it in jpublish.xml:&lt;br /&gt;
&lt;blockquote&gt;&amp;lt;component-manager&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;components&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;component id=&amp;quot;JPST&amp;quot; classname=&amp;quot;ca.flop.jpublish.components.JPSTComponent&amp;quot;&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;stringtemplate-groups&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;group name=&amp;quot;default&amp;quot; relative-root-dir=&amp;quot;/st_content&amp;quot; refresh-interval=&amp;quot;15&amp;quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lexer=&amp;quot;org.antlr.stringtemplate.language.DefaultTemplateLexer&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;group name=&amp;quot;menus&amp;quot; relative-root-dir=&amp;quot;/st_menus&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/stringtemplate-groups&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/component&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/components&amp;gt;&lt;br /&gt;
&amp;lt;/component-manager&amp;gt;&lt;br /&gt;
&lt;/blockquote&gt;&lt;br /&gt;
and then use the ST component wherever ST is required, for example in a Velocity page:&lt;br /&gt;
&lt;strong&gt;&lt;font color=&#034;#333399&#034;&gt; $components.JPST.renderPath(&amp;quot;menus:main_menu&amp;quot;)&lt;/font&gt;&lt;/strong&gt;, the contents of the &lt;strong&gt;main_menu.st&lt;/strong&gt; file will be immediately rendered in-line.&lt;br /&gt;
&lt;br /&gt;
I will add more details in the &lt;a href=&#034;http://code.google.com/p/jpublish/wiki/JPublishUserGuide&#034;&gt;JPublish Wiki&lt;/a&gt;, meanwhile you can find the code and a &lt;a href=&#034;http://jpublish.googlecode.com/svn/trunk/components/jpStringTemplate/web/&#034;&gt;demo web application&lt;/a&gt; in our SVN.&lt;br /&gt;
&lt;br /&gt;
Have fun!&lt;br /&gt;
-florin
        </description>
      
      
    
    
    
    <category>Java</category>
    
    <comments>http://weblog.flop.ca/2007/09/01/1188678524233.html#comments</comments>
    <guid isPermaLink="true">http://weblog.flop.ca/2007/09/01/1188678524233.html</guid>
    <pubDate>Sat, 01 Sep 2007 20:28:44 GMT</pubDate>
  </item>
  
  </channel>
</rss>

