<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom">
 
 <title>Andrea Campolonghi</title>
 
 <link href="http://andreacfm.com/" />
 <updated>2013-05-18T03:02:33-07:00</updated>
 <id>http://andreacfm.com</id>
 <author>
   <name>Andrea Campolonghi</name>
 </author>
 
 
 <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/andreacfm" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="andreacfm" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry>
   <title>Fake xhr request from rspec</title>
   <link href="http://andreacfm.com/2013/02/28/fake-xhr-request-from-rspec" />
   <updated>2013-02-28T16:36:00-08:00</updated>
   <id>http://andreacfm.com/2013/02/28/fake-xhr-request-from-rspec</id>
   <content type="html">&lt;p&gt;I discovered today that I had no idea of how to fake an &lt;em&gt;xhr&lt;/em&gt; request in an Rspec controller test. I need this cause some of my layout strategy behaves on the &lt;em&gt;request.xhr?&lt;/em&gt; method.&lt;/p&gt;

&lt;p&gt;As expected &lt;em&gt;Rspec&lt;/em&gt; solved the issue in a cool and elegant way.&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="ruby"&gt; &lt;span class="n"&gt;get&lt;/span&gt; &lt;span class="ss"&gt;:show&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;  &lt;span class="c1"&gt;# normal request&lt;/span&gt;
 
    &lt;span class="n"&gt;xhr&lt;/span&gt; &lt;span class="ss"&gt;:get&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:show&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; 
    &lt;span class="c1"&gt;# exactly the same request, This time fake to be an xhr &lt;/span&gt;
    &lt;span class="c1"&gt;# call. request.xhr? will be true &lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



</content>
 </entry>
 
 <entry>
   <title>ruby alias vs alias_method</title>
   <link href="http://andreacfm.com/2012/11/29/ruby-alias-vs-alias-method" />
   <updated>2012-11-29T00:00:00-08:00</updated>
   <id>http://andreacfm.com/2012/11/29/ruby-alias-vs-alias-method</id>
   <content type="html">&lt;p&gt;While &lt;em&gt;alias&lt;/em&gt; and &lt;em&gt;alias_method&lt;/em&gt; looks very similar at first they hide a substantial different behaviour. Look
at the following code.&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="ruby"&gt;&lt;span class="c1"&gt;### Basic alias behaviour&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Boss&lt;/span&gt;
  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;name&lt;/span&gt;
     &lt;span class="nb"&gt;p&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;Andrea&amp;quot;&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;
  &lt;span class="k"&gt;alias&lt;/span&gt; &lt;span class="ss"&gt;:full_name&lt;/span&gt; &lt;span class="ss"&gt;:name&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;

&lt;span class="no"&gt;Boss&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;new&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="c1"&gt;# =&amp;gt; Andrea&lt;/span&gt;
&lt;span class="no"&gt;Boss&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;new&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;full_name&lt;/span&gt; &lt;span class="c1"&gt;# =&amp;gt; Andrea&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;This is the the basic behaviour we could expect from the &lt;em&gt;alias&lt;/em&gt; method. &lt;em&gt;#full_name&lt;/em&gt; is perfectly aliased to #name.
But what happens if we subclass Boss?&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="ruby"&gt;&lt;span class="c1"&gt;### Alias in subclass&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Employee&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="no"&gt;Boss&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;name&lt;/span&gt;
       &lt;span class="nb"&gt;p&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;Bob&amp;quot;&lt;/span&gt;
    &lt;span class="k"&gt;end&lt;/span&gt;

&lt;span class="k"&gt;end&lt;/span&gt;

&lt;span class="no"&gt;Employee&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;new&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="c1"&gt;# =&amp;gt; Bob&lt;/span&gt;
&lt;span class="no"&gt;Employee&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;new&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;full_name&lt;/span&gt;  &lt;span class="c1"&gt;# =&amp;gt; Andrea&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Looks like &lt;em&gt;Employee#full_name&lt;/em&gt; points to the superclass &lt;em&gt;#name&lt;/em&gt; method and not at &lt;em&gt;Employee#name&lt;/em&gt;! And this is the truth.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;alias&lt;/em&gt; is a ruby keyword and is executed when source code gets parsed. When Boss class is parsed &lt;em&gt;Boss#full_name&lt;/em&gt; is aliased to &lt;em&gt;Boss#name&lt;/em&gt;
and this will be truth for any Boss instance as per any Class instance that subclass Boss.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;alias_method&lt;/em&gt; is instead, as the word says, a method and is executed in the current self scope.&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="ruby"&gt;&lt;span class="c1"&gt;### Using alias_method&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Boss&lt;/span&gt;
  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;name&lt;/span&gt;
     &lt;span class="nb"&gt;p&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;Andrea&amp;quot;&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;
  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nc"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;apply_alias&lt;/span&gt;
      &lt;span class="n"&gt;alias_method&lt;/span&gt; &lt;span class="ss"&gt;:full_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:name&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;
  &lt;span class="n"&gt;apply_alias&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Employee&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="no"&gt;Boss&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;name&lt;/span&gt;
       &lt;span class="nb"&gt;p&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;Bob&amp;quot;&lt;/span&gt;
    &lt;span class="k"&gt;end&lt;/span&gt;
    &lt;span class="n"&gt;apply_alias&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;

&lt;span class="no"&gt;Boss&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;new&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="c1"&gt;# =&amp;gt; Andrea&lt;/span&gt;
&lt;span class="no"&gt;Boss&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;new&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;full_name&lt;/span&gt; &lt;span class="c1"&gt;# =&amp;gt; Andrea&lt;/span&gt;
&lt;span class="no"&gt;Employee&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;new&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="c1"&gt;# =&amp;gt; Bob&lt;/span&gt;
&lt;span class="no"&gt;Employee&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;new&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;full_name&lt;/span&gt; &lt;span class="c1"&gt;# =&amp;gt; Bob&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;&lt;em&gt;alias_method&lt;/em&gt; is executed the first time in the self scope of Boss and then the self scope of Employee and apply the method aliasing
in the way we expected.
While this looks like a tiny difference using &lt;em&gt;alias_method&lt;/em&gt; grant more flexibility and may avoid unpredictable code behaviour.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Railo 4 beta released</title>
   <link href="http://andreacfm.com/2012/07/03/railo-4-beta-released" />
   <updated>2012-07-03T09:40:00-07:00</updated>
   <id>http://andreacfm.com/2012/07/03/railo-4-beta-released</id>
   <content type="html">&lt;p&gt;Railo 4 beta has been released.
See more info in &lt;a href="http://www.getrailo.org/index.cfm/whats-up/railo-40-beta-released/"&gt;Railo&lt;/a&gt; blog. Many improvements and new features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;closures&lt;/li&gt;
&lt;li&gt;rest support&lt;/li&gt;
&lt;li&gt;loop and cfloop enhancements&lt;/li&gt;
&lt;li&gt;better Application.cfc management&lt;/li&gt;
&lt;li&gt;function caching&lt;/li&gt;
&lt;li&gt;compiler enhancemnets&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Really looks a great release !!!!! Good job.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Redis cache extension for Railo</title>
   <link href="http://andreacfm.com/2012/05/18/redis-cache-extension-for-railo" />
   <updated>2012-05-18T09:24:00-07:00</updated>
   <id>http://andreacfm.com/2012/05/18/redis-cache-extension-for-railo</id>
   <content type="html">&lt;p&gt;I have recently had occasion to work with &lt;a href="http://redis.io/" target="_blank"&gt;Redis&lt;/a&gt; and I got really impressed by how is fast and reliable. Redis is a nosql key/value store quite commonly used in the Ruby world where I am digging these days.&lt;/p&gt;

&lt;p&gt;Many well known projects like Resque, Sidekiq and others make a wide use of Redis for storing any kind of data. What makes Redis really shining, over being so fast, is the ability to manage typed data like hashes, sets and lists. This feature makes the engine suitable to be used in many more situations than a plain key value store.&lt;/p&gt;

&lt;p&gt;Looking around into the cfml community I discovered that Redis almost completely unknown in the coldfusion world. What a shame???&lt;/p&gt;

&lt;p&gt;What a better occasion to make another cache extension for Railo. I have found in &lt;a href="https://github.com/xetorthio/jedis" target="_blank"&gt;Jedis&lt;/a&gt; a very well designed and fully featured Java client and well&amp;hellip; here we are.&lt;/p&gt;

&lt;p&gt;The result is an extension that you can easily install on your Railo server. Once you got it running creating a new cache and use is very easy.
You can find some more info on &lt;a href="https://github.com/andreacfm/Redis-Cache-Extension" target="_blank"&gt;github&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I made some fast test comparing with the Railo MongoDb cache extension that I have developed as well.&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="xml"&gt;&lt;span class="nt"&gt;&amp;lt;cfloop&lt;/span&gt; &lt;span class="na"&gt;from=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;1&amp;quot;&lt;/span&gt; &lt;span class="na"&gt;to=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;10&amp;quot;&lt;/span&gt; &lt;span class="na"&gt;index=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;j&amp;quot;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;cfset&lt;/span&gt; &lt;span class="na"&gt;start =&lt;/span&gt; &lt;span class="s"&gt;gettickcount()&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;cfloop&lt;/span&gt; &lt;span class="na"&gt;from=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;1&amp;quot;&lt;/span&gt; &lt;span class="na"&gt;to=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;5000&amp;quot;&lt;/span&gt; &lt;span class="na"&gt;index=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;i&amp;quot;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;cfcache&lt;/span&gt; &lt;span class="na"&gt;action=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;put&amp;quot;&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;a#i#&amp;quot;&lt;/span&gt; &lt;span class="na"&gt;value=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;#i#&amp;quot;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;cfcache&lt;/span&gt; &lt;span class="na"&gt;action=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;get&amp;quot;&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;a#i#&amp;quot;&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;v&amp;quot;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/cfloop&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;cfset&lt;/span&gt; &lt;span class="na"&gt;end =&lt;/span&gt; &lt;span class="s"&gt;gettickcount()&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;cfset&lt;/span&gt; &lt;span class="na"&gt;time =&lt;/span&gt; &lt;span class="s"&gt;end&lt;/span&gt; &lt;span class="err"&gt;-start&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;cfset&lt;/span&gt; &lt;span class="na"&gt;total =&lt;/span&gt; &lt;span class="s"&gt;total&lt;/span&gt; &lt;span class="err"&gt;+&lt;/span&gt; &lt;span class="err"&gt;time&lt;/span&gt; &lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;cfoutput&amp;gt;&lt;/span&gt;#time/1000# s&lt;span class="nt"&gt;&amp;lt;br/&amp;gt;&amp;lt;/cfoutput&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;cfflush&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;cfset&lt;/span&gt; &lt;span class="err"&gt;cacheClear()&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/cfloop&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;cfoutput&amp;gt;&lt;/span&gt;Average sec: #(total/10)/1000#&lt;span class="nt"&gt;&amp;lt;/cfoutput&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;This simple snippets runs 10 iterations with 5000 write/read operations each. ONn my machine MongoDb executes this in 3 secs average per iteration.
Redis will do the same job in 1 sec average so basically 66% faster. I have reporetd the same performance even launching the scripts from 4 concurrents threads.&lt;/p&gt;

&lt;h3&gt;Resources&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/andreacfm/Redis-Cache-Extension" target="_blank"&gt;github repository with installation details and more&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://redis.io/" target="_blank"&gt;Redis&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/xetorthio/jedis" target="_blank"&gt;Jedis&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</content>
 </entry>
 
 <entry>
   <title>Rspec rails views tips</title>
   <link href="http://andreacfm.com/2012/04/22/rspec-rails-views-tips" />
   <updated>2012-04-22T00:00:00-07:00</updated>
   <id>http://andreacfm.com/2012/04/22/rspec-rails-views-tips</id>
   <content type="html">&lt;p&gt;In the last days I faced some new challenge in testing rails views with rspec.
Here is what I learned.&lt;/p&gt;

&lt;p&gt;I am useing the veru handy rails controller &lt;a href="http://api.rubyonrails.org/classes/AbstractController/ViewPaths/ClassMethods.html#method-i-prepend_view_path"&gt;prepend_view_path&lt;/a&gt; helper to be able to choose dynamically what views to use to render the actual request.
A sample code is the following:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="ruby"&gt;&lt;span class="c1"&gt;#controller&lt;/span&gt;
&lt;span class="n"&gt;before_filter&lt;/span&gt; &lt;span class="ss"&gt;:prepend_view_path_if_required&lt;/span&gt;

&lt;span class="kp"&gt;private&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;prepend_view_path_if_required&lt;/span&gt;
    &lt;span class="n"&gt;prepend_view_path&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;views/custom_view_path&amp;quot;&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;my_condition&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;When my_condition returns true, the passed path will placed on top of the views_path rails controller stack. Rails will then look into this location as first choice when looking for a view to render. This technique allows me to choose what view to render in different conditions without the need to hacks into my routes. Is a nice tool. You just say to rails: &amp;ldquo;if this condition is true looks for views here as a first choice. If nothing is found go on and check into the rest of the views locations stack&amp;rdquo;&lt;/p&gt;

&lt;p&gt;What was a bit challenging was the view testing when prepend_view_path plays a role into the rendering process.
Testing a single view placed for example in &amp;ldquo;views/custom_view_path/view_to_test&amp;rdquo; is not a big deal.&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="ruby"&gt;  &lt;span class="c1"&gt;# rspec view test&lt;/span&gt;
  &lt;span class="n"&gt;it&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;.&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;.&lt;/span&gt;
    &lt;span class="n"&gt;render&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;custom_view_path/view_to_test&amp;quot;&lt;/span&gt;
    &lt;span class="n"&gt;rendered&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;should&lt;/span&gt; &lt;span class="n"&gt;match&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;text to match&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;
  &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;.&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;But what if the view you are testing has code that render a partial?&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="ruby"&gt;&lt;span class="c1"&gt;#custom_view_path/view_to_test&lt;/span&gt;
&lt;span class="n"&gt;render&lt;/span&gt; &lt;span class="ss"&gt;:partial&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;users/login&amp;quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;When you run it rspec creates a fake controller for you that will not know nothing about the &amp;lsquo;views path prepending&amp;rsquo; that your application is expecting to use.
The users/login partial will be looked for in &amp;ldquo;app/views/users&amp;rdquo; folder but not in &amp;ldquo;app/views/custom_view_path/users&amp;rdquo; where you may expect it is looked for.
While a was trying to stub/mock things I then dicovereed that I could simply call the prepend_view_path method on the controller that rspec creates in views specs.
My spec is looking like this:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="ruby"&gt;&lt;span class="c1"&gt;# rspec view test&lt;/span&gt;
&lt;span class="n"&gt;before&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
    &lt;span class="n"&gt;prepend_view_path&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;views/custom_view_path&amp;quot;&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;

&lt;span class="n"&gt;it&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;.&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;.&lt;/span&gt;
    &lt;span class="n"&gt;render&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;custom_view_path/view_to_test&amp;quot;&lt;/span&gt;
    &lt;span class="n"&gt;rendered&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;should&lt;/span&gt; &lt;span class="n"&gt;match&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;text to match&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;
&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;.&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;When I run my test the correct views path is added to the controller and my spec runs as expected.
Simply and clean.&lt;/p&gt;

&lt;p&gt;I then faced a new task.
The application I am building uses an helper method called is_mobile_request? that check if the call comes from a mobile. A view I was testing is rendering a partial that isa actually using this same helper method. While this is a smell of a not perfect design I needed a way to stub the result of this helper method call so that my view was able to render as expected.
My solution was to declare the spec of type helper and to stub the method on the helper scope.&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="ruby"&gt;&lt;span class="c1"&gt;# rspec view test&lt;/span&gt;
&lt;span class="n"&gt;describe&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;custom_view_path/view_to_test.html.erb&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="ss"&gt;:helper&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;

&lt;span class="n"&gt;before&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
    &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;.&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;.&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;
    &lt;span class="n"&gt;stub&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;helper&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;is_mobile_request?&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="kp"&gt;false&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;.&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;.&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;

&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;What happens here is that declaring the spec as type helper I can use/stub the helper scope in my spec.&lt;/p&gt;

&lt;h3&gt;Conclusion&lt;/h3&gt;

&lt;p&gt;While I use rspec every day I often find ways to learn new things about it. My advise is to look into rspec code/docs/groups before trying to create hacks to test things. Most of the times a clean and elegant solution is already baked into rspec just to solve your issue.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Ruby tip. Double association in a ternary operator</title>
   <link href="http://andreacfm.com/2012/02/09/ruby-tip-make-a-double-associations-in-a-ternary-operator" />
   <updated>2012-02-09T00:00:00-08:00</updated>
   <id>http://andreacfm.com/2012/02/09/ruby-tip-make-a-double-associations-in-a-ternary-operator</id>
   <content type="html">&lt;p&gt;I found myself today in the opportunity to use a double association in a ternary operator. Basically I wanted to assign 2 variables based on a certain condition.
Normal ruby double assignment works easy like this:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="ruby"&gt;&lt;span class="c1"&gt;#simple double assignment&lt;/span&gt;
&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;
&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="c1"&gt;# 1&lt;/span&gt;
&lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="c1"&gt;# 2&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Up to here no surprise. But what if I want to evaluate a condition and assigns both the variables??&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="ruby"&gt;&lt;span class="c1"&gt;#double assignment . Wrong ways&lt;/span&gt;
&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kp"&gt;true&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kp"&gt;true&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Both this attempts ends in a syntax error. The right way:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="ruby"&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kp"&gt;false&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="c1"&gt;# 3&lt;/span&gt;
&lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="c1"&gt;# 4&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Easy and clean. Values comes in an array and are correctly assigned.
Of course this works for any number of variables you need to assign&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="ruby"&gt;&lt;span class="c1"&gt;# triple assignment in ternary operator&lt;/span&gt;
&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kp"&gt;false&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt; &lt;span class="c1"&gt;# 4&lt;/span&gt;
&lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt; &lt;span class="c1"&gt;# 5&lt;/span&gt;
&lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt; &lt;span class="c1"&gt;# 6&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



</content>
 </entry>
 
 <entry>
   <title>Rails migration redo</title>
   <link href="http://andreacfm.com/2012/01/29/rails-migration-redo" />
   <updated>2012-01-29T00:00:00-08:00</updated>
   <id>http://andreacfm.com/2012/01/29/rails-migration-redo</id>
   <content type="html">&lt;p&gt;A very good practice, when writing a rails migration, is to be sure that the down methods works as expected. Once the migration is ready you should make it run and, if anything is fine, you should  rollback it and run it again. In this way you are sure that both the up and down migration works as you planned.&lt;/p&gt;

&lt;p&gt;To make it faster you can use the following command&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="ruby"&gt;&lt;span class="n"&gt;rake&lt;/span&gt; &lt;span class="ss"&gt;db&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="ss"&gt;migrate&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="k"&gt;redo&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;This will run a rollback of the lates migration and will run it again.&lt;/p&gt;

&lt;p&gt;You can even say how many steps you want to rollback and the re apply using the steps attributes as you do in a normal roll back command:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="ruby"&gt;&lt;span class="n"&gt;rake&lt;/span&gt; &lt;span class="ss"&gt;db&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="ss"&gt;migrate&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="k"&gt;redo&lt;/span&gt; &lt;span class="n"&gt;step&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;div&gt;&lt;/div&gt;

</content>
 </entry>
 
 <entry>
   <title>Monitor resque workers via upstart</title>
   <link href="http://andreacfm.com/2012/01/11/monitor-resque-workers-via-upstart" />
   <updated>2012-01-11T00:00:00-08:00</updated>
   <id>http://andreacfm.com/2012/01/11/monitor-resque-workers-via-upstart</id>
   <content type="html">&lt;p&gt;Resque is a Redis-backed Ruby library for creating background jobs, placing them on multiple queues, and processing them later. Resque works firing up a set number of workers than will coninuously look for job to be processed and will execute them following the rules defined when the workers are launched. You can have a single worker process any queue or having a single worker processing a single queue or even fire up more workers that will look forward to a single queue. Read more about &lt;a href="https://github.com/defunkt/resque" target="_blank"&gt;resque&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;A very important topic is to be sure that the workers are always available and that any time your application is deployed also the workers are restarted. This is crucial cause the worker load an instance of your application and will then process the jobs against this application instance. If you deploy a new version of your application but you do not restart your workers the jobs will be run on an outdated code version and this is clearly something you do not want!&lt;!--more--&gt;&lt;/p&gt;

&lt;p&gt;I have solved both the issues using upstart to monitor the workers deamon and a rake task that kill all the workers any time the application is deployed. Basically the idea is that any time a worker is killed upstart will restart it with the most up to date application version.&lt;/p&gt;

&lt;p&gt;Here is a sample of the upstart script I use to monitor the workers for my application:&lt;/p&gt;

&lt;script src="https://gist.github.com/1259382.js?file=resque_worker_upstart.sh"&gt; &lt;/script&gt;


&lt;p&gt;If you are not familiar with upstart you can read more &lt;a href="http://upstart.ubuntu.com/" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p style="text-align: left;"&gt;What this script does is  launching the workers in a defined rails environment using a passed namespace ( I use namespace to ensure that I can safely use the same Redis engine for different applications/environments ). You can also note that the script execute the command from the application directory using an unpriviledged user. This trick was due to the fact that I run the application and the workers using a specific user ( 'my_user' in the example) and not as root as upstart attempt to do. The rest of the script load in the shell rvm with ruby 1.9.2 before executing the script.&lt;/p&gt;


&lt;p style="text-align: left;"&gt;Once this conf script has started upstart will monitor the processes and will restart it something gets killed or does not respond.&lt;/p&gt;


&lt;p style="text-align: left;"&gt;Great! I know need a task to be runned via capistrano when a new deployment gets completed. Killing the worker will invoke upstart to restart them with the lastest deployed codebase.&lt;/p&gt;


&lt;p style="text-align: left;"&gt;&lt;script src="https://gist.github.com/1259382.js?file=restart_workers_task.rb"&gt; &lt;/script&gt;&lt;/p&gt;


&lt;p style="text-align: left;"&gt;Invoking the task will kill any workers that is registered with the Resque instance running in your application. Be sure to run the task just before to restart your application. In this way you are sure that the task will attempt to kill the correct pids.&lt;/p&gt;


&lt;script src="https://gist.github.com/1259382.js?file=restart_workers_cli"&gt; &lt;/script&gt;


&lt;p&gt;Et voila! Any feed bask is welcome.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Git rebase --onto to the rescue ( part 1 )</title>
   <link href="http://andreacfm.com/2011/11/03/git-rebase-onto-to-the-rescue-part-1" />
   <updated>2011-11-03T00:00:00-07:00</updated>
   <id>http://andreacfm.com/2011/11/03/git-rebase-onto-to-the-rescue-part-1</id>
   <content type="html">&lt;p&gt;I am now using git since more than a year as my primary scm. I tend to use it also against svn repo,  I can so focusing on git  becoming always more comfortable using it.&lt;/p&gt;

&lt;p&gt;To be honest up to now my git use has always been quite basic, while projects I was working on never needed more that a master/develop/topic branches workflow. Recently I faced a more complex issue related to the necessary  support for proper &lt;strong&gt;support branch&lt;/strong&gt; that was going to diverge for a long time from the develop branch.&lt;/p&gt;

&lt;p&gt;We have a develop branch where is done the job for new version 2.0 while we still have a stable branch where we support version 1.0. The issue comes from the fact that version 1.0 is not going to receive only simple hotfixes but will also be improved with new feature that need to be ported to version 2.0..&lt;/p&gt;

&lt;p&gt;For the first month or so we still were able to merge the 2 branches but not they have diverged too much. Merge is not an option and so we had to find a new strategy.&lt;/p&gt;

&lt;p&gt;Our goal was to carry all the changes made on a topic branch borned by the 2.0 branch into the same 2.0 and also to the 1.0 without merging 2.0 into 1.0. This can be solved cherry-picking any single commit from the topic branch to the 2.0 and then merge topic into 1.0. While this works fine we faced situations where the topic branch were actually getting too long and cherry picking many commits can be buggy and tricky.&lt;/p&gt;

&lt;!--more--&gt;


&lt;p&gt;We finally solved our issue using a git feature called rebas &amp;mdash;onto.&lt;/p&gt;

&lt;p&gt;An example (you can clone example code here https://github.com/andreacfm/git-test):&lt;/p&gt;

&lt;p style="text-align: center;"&gt;&lt;img class="size-full wp-image-210 aligncenter" src="/images/posts/Screen-Shot-2011-11-03-at-10.02.06-AM1.png" alt="" width="700" height="234" /&gt;&lt;/p&gt;


&lt;p&gt;Our repo has a develop branch checked out  from a master branch. Both master and develop have commits made after they diverged. A topic branch is also borned by develop and some job was made on it.&lt;/p&gt;

&lt;p&gt;Rebase onto helps us cause it allows us to say to git to rebase the topic branch on master &lt;strong&gt;VIA&lt;/strong&gt; develop. Basically git makes a diff between master and topic excluding all the job that was made on develop after that devlelop diverged from master. This diff gets applied to master.&lt;/p&gt;

&lt;p&gt;Our goal is to bring the 2 commits made on topic branch to master and to develop branch without having to merge develop into master. Topic needs to be rebased &amp;mdash;onto master and merged into develop. To make this we need a temporary copy of topic.&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="sh"&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;git checkout topic
&lt;span class="nv"&gt;$ &lt;/span&gt;git checkout -b temp
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;The temp branch allows us to perform the 2 different actions (merge on develop and rebase onto master) leaving git calculate the diff for us. More on this in the next post.&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="sh"&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;git rebase --onto master develop topic
&lt;span class="nv"&gt;$ &lt;/span&gt;git co master
&lt;span class="nv"&gt;$ &lt;/span&gt;git merge topic
&lt;span class="nv"&gt;$ &lt;/span&gt;git checkout develop
&lt;span class="nv"&gt;$ &lt;/span&gt;git merge temp
&lt;span class="nv"&gt;$ &lt;/span&gt;git branch -D topic
&lt;span class="nv"&gt;$ &lt;/span&gt;git branch -d temp
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Before we rebase &amp;mdash;onto topic to master via develop. We need then to go to master and to fast-forward master to topic by merging. We can now merge the temp branch into develop
and delete both topic and branch.
Here is what we obtain:&lt;/p&gt;

&lt;p&gt;&lt;img class="size-full wp-image-218 aligncenter" src="/images/posts/Screen-Shot-2011-11-03-at-10.33.08-AM.png" alt="" width="724" height="518" /&gt;&lt;/p&gt;

&lt;p&gt;As you see both develop and master branch has received just the commits made on the topic branch but still develop has not been merged into master.
Rebase &amp;mdash;onto saved our day cause avoid us to make very long cherry picking session on many different branches (forgot to say our project is much more complex that this example). Respect to the cherry picking technique rebase &amp;mdash;onto is also less error prone cause let git calculate the commits you need to apply. Sometimes reading the git tree commits is very hard on big projects and this increase the possibility to loose some commits around.&lt;/p&gt;

&lt;p&gt;More on this to come.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Make your ruby classes Comparable and Enumerable</title>
   <link href="http://andreacfm.com/2011/07/27/make-your-ruby-classes-comparable-and-enumerable" />
   <updated>2011-07-27T00:00:00-07:00</updated>
   <id>http://andreacfm.com/2011/07/27/make-your-ruby-classes-comparable-and-enumerable</id>
   <content type="html">&lt;p&gt;Something very cool in ruby are mixins. As the word says mixin is a technique to mixed a module into a class using the statement &amp;ldquo;include&amp;rdquo;.
While including a module is a very large topic I focused on the opportunity to include module defined in the Ruby standard library into your class to take advantages of the methods and abilities that these modules provide.
The &lt;a href="http://www.ruby-doc.org/core/classes/Comparable.html" target="_blank"&gt;Comparable&lt;/a&gt; module in ruby define methods like  &amp;lt;   &amp;lt;=   ==   &amp;gt;   &amp;gt;=   between?  .
What if I want to achieve is making my class instances &lt;strong&gt;comparable&lt;/strong&gt; so that I can ask to ruby if &lt;strong&gt;class_a &amp;gt; class_b&lt;/strong&gt;.&lt;!--more--&gt; Here an example:&lt;/p&gt;

&lt;script src="https://gist.github.com/1075795.js"&gt; &lt;/script&gt;


&lt;p&gt;The Person class include the module Comparable and implements one single method (&amp;lt;=&amp;gt;). This methods is used by the Comparable module to perform the logic of any of the operator that the module provide.In the example I say to the Person class to compare instances through the @name attribute. But we even gain more functionalities. Once that our classes are able to be compared they are also able to be sorted if placed inside an array. Amazing!!!&lt;/p&gt;

&lt;script src="https://gist.github.com/1109218.js"&gt; &lt;/script&gt;


&lt;p&gt;But what if I want to find Persons by name?? Wen can use for this purpose the &lt;a href="http://www.ruby-doc.org/core/classes/Enumerable.html" target="_blank"&gt;Enumerable&lt;/a&gt; module. What we can do is to create a custom PersonEnumerator class like this:&lt;/p&gt;

&lt;script src="https://gist.github.com/1075798.js"&gt; &lt;/script&gt;


&lt;p&gt;Including the Enumerable module and implementing the each method we gain most of the many methods that the module expose. In our example I &lt;strong&gt;find&lt;/strong&gt; a person object passing a block that filters each Person by name.&lt;/p&gt;

&lt;p&gt;The mixin technique applied to the ruby standard library  is very powerfull. Your code code gets more elegant and more &lt;strong&gt;Ruby Way&lt;/strong&gt; for you to maintain and for your collaborator to read and understand&lt;/p&gt;

&lt;p&gt;Ruby amazes me any day more!&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Ruby instance_eval</title>
   <link href="http://andreacfm.com/2011/07/02/ruby-instance_eval" />
   <updated>2011-07-02T00:00:00-07:00</updated>
   <id>http://andreacfm.com/2011/07/02/ruby-instance_eval</id>
   <content type="html">&lt;p&gt;Working on one of my first ruby gem I have started to learn more about ruby meta programming and ruby core language.
My gem needs a sort of singleton class that needs to be configured when the application starts. I have choosed to use a Module as singleton cause a ruby module cannot be initialized and so it just fits my needs.
I will then include the configured module into the model that will need it.&lt;/p&gt;

&lt;!--more--&gt;


&lt;p&gt;What I wanted to achieve was something like:&lt;/p&gt;

&lt;script src="https://gist.github.com/1059936.js"&gt; &lt;/script&gt;


&lt;p&gt;I created my module and added 2 class methods one called configure that is planned to take care of the block and a method called set that is going to apply the requested configurations.
Something like this:&lt;/p&gt;

&lt;script src="https://gist.github.com/1059940.js"&gt; &lt;/script&gt;


&lt;p&gt;If you run this code you get an exception saying to you that:&lt;strong&gt;
undefined method ‘set’ for main:Object&lt;/strong&gt;
This was a bit confusing at first. The error is thrown cause the block is created outside of the module scope and is executed in the scope where it was created. In this special case the scope is the general Object scope.
What I need is that the block passed to the configure method is executed in the scope of My_module. This can be achieved using the instance_eval method.
Passing the block as argument to instance_eval this is executed in the current self scope. Exactly what I need.&lt;/p&gt;

&lt;script src="https://gist.github.com/1060794.js"&gt; &lt;/script&gt;


&lt;p&gt;In conclusion instance_eval is one of the important topic in ruby meta programming allowing blocks to be sent around and executed in the calling instance scope.&lt;/p&gt;

&lt;p&gt;﻿&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Learning Ruby: gets and chomp</title>
   <link href="http://andreacfm.com/2011/06/11/learning-ruby-gets-and-chomp" />
   <updated>2011-06-11T00:00:00-07:00</updated>
   <id>http://andreacfm.com/2011/06/11/learning-ruby-gets-and-chomp</id>
   <content type="html">&lt;p&gt;Playing with the ruby console I am wondering how I can read some input from the console.&lt;/p&gt;

&lt;p&gt;Ruby ships with the method &lt;strong&gt;gets&lt;/strong&gt; that makes easy to read console input. Just try the following code:&lt;/p&gt;

&lt;script src="https://gist.github.com/1021064.js"&gt; &lt;/script&gt;


&lt;p&gt;When the console asks for your name just type it. The ruby program will read the console input and will welcome you. You will note that  a new line is added after that the variable&lt;em&gt; name&lt;/em&gt; is  printed out. This is the default behaviour of the gets function. Gets add a new line after any variable that memorize. If this is not desired  you can call the method &lt;strong&gt;chomp&lt;/strong&gt; on the gets result and the newline is suppressed.&lt;/p&gt;

&lt;p&gt;Change your code as follows and the new line will not be printed anymore:&lt;/p&gt;

&lt;script src="https://gist.github.com/1021068.js"&gt; &lt;/script&gt;

</content>
 </entry>
 
 <entry>
   <title>Something about bundler and gems dependencies</title>
   <link href="http://andreacfm.com/2011/06/05/something-about-bundler-and-gems-dependencies" />
   <updated>2011-06-05T00:00:00-07:00</updated>
   <id>http://andreacfm.com/2011/06/05/something-about-bundler-and-gems-dependencies</id>
   <content type="html">&lt;p&gt;Since some months I have started to programm in Ruby and especially using the Rails framework. I have to say I find Rails so great that I realized, that after some months, that I can be quite productive knowing very little about Ruby itself. This tells you how powerfull can be a dsl written in Ruby and talks about the nice job Rails developers did but is not going to make me shine as a Ruby developer.&lt;/p&gt;

&lt;p&gt;I have decided to step back and I am finally going to open a Programming Ruby book seriously. I will go throught my Ruby discovering writing here my tests and anything I will discover in my learning Ruby travel. This will help me to fix some concept in my mind and hopefully someone else will learn from my mistakes.&lt;/p&gt;

&lt;p&gt;For the moment I discovered something about bundler I really didn&amp;rsquo;t know before and I &amp;rsquo;d like to share. I have just ended reading a post of Yehuda Katz about &lt;a href="http://yehudakatz.com/2011/05/30/gem-versioning-and-bundler-doing-it-right/?utm_source=rubyweekly&amp;amp;utm_medium=email" target="_blank"&gt;Bundler and Gems dependencies&lt;/a&gt; that really opened my eyes.&lt;/p&gt;

&lt;p&gt;Something from Yehuda post:&lt;/p&gt;

&lt;!--more--&gt;


&lt;h2&gt;&lt;em&gt;Basic Versioning Rules for Apps&lt;/em&gt;&lt;/h2&gt;


&lt;p&gt;&lt;em&gt;
&lt;/em&gt;&lt;/p&gt;

&lt;ol&gt;
    &lt;li&gt;&lt;em&gt;After bundling, always check your Gemfile.lock into
version control. If you do this, you do not need to specify exact
versions of gems in your Gemfile. Bundler will take care of ensuring
that all systems use the same versions.&lt;/em&gt;&lt;/li&gt;
    &lt;li&gt;&lt;em&gt;After updating your Gemfile, always run bundle install first. This will conservatively update your Gemfile.lock. This means that except for the gem that you changed in your Gemfile, no other gem will change.&lt;/em&gt;&lt;/li&gt;
    &lt;li&gt;&lt;em&gt;If a conservative update is impossible, bundler will prompt you to run bundle update [somegem]. This will update the gem &lt;strong&gt;and any necessary dependencies&lt;/strong&gt;. It will not update unrelated gems.&lt;/em&gt;&lt;/li&gt;
    &lt;li&gt;&lt;em&gt;If you want to fully re-resolve all of your dependencies, run bundle update. This will re-resolve all dependencies from scratch.&lt;/em&gt;&lt;/li&gt;
    &lt;li&gt;&lt;em&gt;When running an executable, &lt;strong&gt;ALWAYS&lt;/strong&gt; use bundle exec [command]. Quoting from the bundler documentation: &lt;em&gt;
In some cases, running executables without bundle exec may work, if the
executable happens to be installed in your system and does not pull in
any gems that conflict with your bundle. However, this is unreliable and
is the source of considerable pain. Even if it looks like it works, it
may not work in the future or on another machine.&lt;/em&gt; See below, “Executables” for more information and advanced usage.
&lt;/em&gt;&lt;/li&gt;
    &lt;li&gt;&lt;em&gt;Remember that you can always go back to your old Gemfile.lock by using git checkout Gemfile.lock or the equivalent command in your version control.&lt;/em&gt;&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;&lt;em&gt;
&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;&lt;em&gt;Executables&lt;/em&gt;&lt;/h2&gt;


&lt;p&gt;&lt;em&gt;
&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;When you install a gem to the system, Rubygems creates wrappers for
every executable that the gem makes available. When you run an
executable from the command line &lt;strong&gt;without bundle exec&lt;/strong&gt;,
this wrapper invokes Rubygems, which then uses the normal Rubygems
activation mechanism to invoke the gem’s executable. This has changed in
the past several months, but Rubygems will invoke &lt;strong&gt;the latest version of the gem installed in your system&lt;/strong&gt;, even if your Gemfile.lock specifies a different version. In addition, it will activate the &lt;strong&gt;latest (compatible) installed version of dependencies of that gem&lt;/strong&gt;, even if a different version is specified in your Gemfile.lock.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;
&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This means that invoking executables as normal system executables
bypasses bundler’s locked dependencies. In many cases, this will not
pose a problem, because developers of your app tend to have the right
version of the system-installed executable. For a long time, the Rake
gem was a good example of this phenomenon, as most Gemfile.locks declared Rake 0.8.7, and virtually all Ruby developers had Rake 0.8.7 installed in their system.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;
&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;As a result, users fell into the unfortunate belief that running
system executables was compatible with bundler’s locked dependencies. To
work around some of the remaining cases, people often advocate the use
of rvm gemsets. Combined with manually setting up application-specific
gemsets, this can make sure that the “system executables” as provided
via the gemset remain compatible with the Gemfile.lock.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;
&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Unfortunately, this kludge (and others) sufficiently reduced the pain
that most people ignored the advice of the bundler documentation to
always use bundle exec when running executables tied to gems in the application’s Gemfile.lock.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;
&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;It’s worth noting that typing in rake foo (or anyexecutable foo) in the presence of a Gemfile.lock,
and expecting it to execute in the bundler sandbox doesn’t make any
sense, since you’re not invoking Bundler. Bundler’s sandbox relies on
its ability to be present at the very beginning of the Ruby process, and
to therefore have the ability to ensure that the versions of all loaded
libraries will reflect the ones listed in the Gemfile.lock.
By running a system executable, you are executing Ruby code before
Bundler can modify the load path and replace the normal Rubygems loading
mechanism, allowing arbitrary unmanaged gems to get loaded into memory.
Once that happens, all bets are off.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I have to say I learn new things about Ruby  every day and I really have to thank devs like Yehuda that keep posting so interesting topics.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Railo cfmap addEvent() support</title>
   <link href="http://andreacfm.com/2011/03/02/railo-cfmap-addevent-support" />
   <updated>2011-03-02T00:00:00-08:00</updated>
   <id>http://andreacfm.com/2011/03/02/railo-cfmap-addevent-support</id>
   <content type="html">&lt;p&gt;A couple of weeks ago I was reading a post from Raymond Camden that remembered me I completely forgot to add support to addevent() in Railo cfmap implementation. The blog post was quite interesting and showed a way to add streetview to a google map, generated by cfmap, using the Coldfusion.Map.addEvent function. Read the post &lt;a href="http://www.coldfusionjedi.com/index.cfm/2011/2/11/Adding-Google-Streetview-to-ColdFusion-CFMAP" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Of course code was not running in Railo due to the lack of the method in the Railo js library.&lt;/p&gt;

&lt;p&gt;I made a patch and support was added in Railo 3.2.1.005/3.3.0.005.&lt;/p&gt;

&lt;p&gt;So following the Ray example (all credits to Ray for the following code) you can run the following code in Railo and adding a streeview to your cfmap using the addEvent() function.&lt;/p&gt;

&lt;script src="https://gist.github.com/835275.js"&gt; &lt;/script&gt;


&lt;p&gt;Please note that in Railo js library are available both the &lt;strong&gt;Railo&lt;/strong&gt; and &lt;strong&gt;Coldfusion&lt;/strong&gt; namespaces so &lt;strong&gt;Railo.Map.addEvent()&lt;/strong&gt; is equivalent as running &lt;strong&gt;Coldfusion.Map.addEvent()&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Have fun!&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>MongoDb Cache Extension for Railo - New Update</title>
   <link href="http://andreacfm.com/2011/02/13/mongodb-cache-extension-for-railo-new-update" />
   <updated>2011-02-13T00:00:00-08:00</updated>
   <id>http://andreacfm.com/2011/02/13/mongodb-cache-extension-for-railo-new-update</id>
   <content type="html">&lt;p&gt;A new update the the MongoDB Cache extension for Railo is on the extension provider.&lt;/p&gt;


&lt;p&gt;Some bug was fixed and performance improved by a better tuning of the query that respects the cache expiration timeout. In my tests I could reach 400 interactions ( put and get of 400 items ) in in average time of 1200ms. Pretty awesome!!!!&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Railo WebSockets Gateway Extension</title>
   <link href="http://andreacfm.com/2011/01/24/railo-websockets-gateway-extension" />
   <updated>2011-01-24T00:00:00-08:00</updated>
   <id>http://andreacfm.com/2011/01/24/railo-websockets-gateway-extension</id>
   <content type="html">&lt;p&gt;I have just uploaded the Railo WebSockets Gateway Extension to the Railo preview extension provider.&lt;/p&gt;


&lt;p&gt;This extension enables you to launch a server that is capable to manage messaging from HTML &lt;a title="http://dev.w3.org/html5/websockets/" rel="nofollow" href="http://dev.w3.org/html5/websockets/"&gt;WebSockets&lt;/a&gt;.&lt;/p&gt;


&lt;p&gt; The server runs on a dedicated port. Railo will receive notifications when a connection is opened, closed and any time a message is sent invoking a cfc listener class. The gateway can also being invoked via SendGatewayMessage so to allow your app to push message to all the connected clients.&lt;/p&gt;


&lt;p&gt;While only few browsers natively support WebSockets up to now exists many libraries that mange the failover to flash sockets or other technologies like ajax long polling etc... WebSockets are a great way to implement messaging and data pushing using well known technologies like javascript. The gateway just makes it a breeze pushing data from your Railo application to any connected client.&lt;/p&gt;


&lt;p&gt;You can find docs about the extension in the &lt;a href="http://wiki.getrailo.org/wiki/Extensions:WebSockets_Gateway" target="_blank"&gt;Railo wiki&lt;/a&gt; and some sample code cloning the following github repo https://github.com/andreacfm/websockets_example_apps.&lt;/p&gt;


&lt;p&gt;Please post any feedback in the &lt;a href="http://groups.google.com/group/railo" target="_blank"&gt;Railo Google Group&lt;/a&gt; and any bug in the Railo Jira bugtraker.&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Railo MongoDB cache extension updated</title>
   <link href="http://andreacfm.com/2010/11/13/railo-mongodb-cache-extension-updated" />
   <updated>2010-11-13T00:00:00-08:00</updated>
   <id>http://andreacfm.com/2010/11/13/railo-mongodb-cache-extension-updated</id>
   <content type="html">&lt;p&gt;I have uploaded yesterday a main update of the MongoDB Cache extension for Railo. See installation details &lt;a href="http://wiki.getrailo.org/wiki/extensions:mongodb" target="_blank"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I have improved the management of timespan and timeidle expiring using some incredible feature that MongoDB offers.&lt;/p&gt;

&lt;p&gt;1) Any time you ask for a key the plugin attempts to delete it running a MongoDB query ( optimized using index on any relevant field ) and then fetch it. If key is still there means that is a still valid entry.&lt;/p&gt;

&lt;p&gt;2) Any 20 seconds a clean process is runned so to keep the db more updated as possible and making the the flush operation on cacheGet() more efficient.&lt;/p&gt;

&lt;p&gt;In my test this has improved speed of about 30% delegating more operation to the db itself.&lt;/p&gt;

&lt;p&gt;The following code makes 2000 read/write operation in an average of 1500/1600 ms.&lt;/p&gt;

&lt;script src="https://gist.github.com/1035561.js"&gt; &lt;/script&gt;


&lt;p&gt;Amazing !!!!!&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Railo Membase Cache Extension available for beta testing. </title>
   <link href="http://andreacfm.com/2010/10/09/railo-membase-cache-extension-available-for-beta-testing" />
   <updated>2010-10-09T00:00:00-07:00</updated>
   <id>http://andreacfm.com/2010/10/09/railo-membase-cache-extension-available-for-beta-testing</id>
   <content type="html">&lt;p&gt;&lt;img style="float: left; border: 0; margin: 10px;" src="/images/posts/membase_logo.png" alt="" width="274" height="68" /&gt;&lt;em&gt;NorthScale Membase Server is an elastic key-value database that stores
web application data far more efficiently and cost effectively than it
can be stored in a relational database. With NorthScale Membase Server,
organizations can deploy a highly available, cloud-friendly data layer
that expands dynamically as application needs change, delivering
performance exceeding that of any other NoSQL solution. API compatible
with memcached, the de facto standard web caching software, Membase is
easy to use and supported by virtually every programming language and
application framework.&lt;/em&gt;&lt;/p&gt;


&lt;p&gt;&lt;a href="http://www.northscale.com/products/membase_server.html" target="_blank"&gt;Membase&lt;/a&gt; gives you an easy way to access and use &lt;a href="http://memcached.org/" target="_blank"&gt;memcached &lt;/a&gt;as a key-value database. Membase is a very powerfull solution if you need a reliable, fast and distribuited cache engine. &lt;/p&gt;


&lt;p&gt;The Extension allows you to use Membase as a key/value cache for your
Objects (components), Templates, Queries and Resources (such as files
etc).&lt;/p&gt;


&lt;p&gt;More info can be found in the&lt;a href="http://www.getrailo.org/" target="_blank"&gt; Railo&lt;/a&gt; wiki : &lt;a href="http://wiki.getrailo.org/wiki/extensions:membase" target="_blank"&gt;http://wiki.getrailo.org/wiki/extensions:membase &lt;/a&gt;&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Railo MongoDB Cache Extension on Beta Test </title>
   <link href="http://andreacfm.com/2010/09/30/railo-mongodb-cache-extension-on-beta-test" />
   <updated>2010-09-30T00:00:00-07:00</updated>
   <id>http://andreacfm.com/2010/09/30/railo-mongodb-cache-extension-on-beta-test</id>
   <content type="html">&lt;p&gt;&lt;img style="border: 0; float: left; margin-left: 10px; margin-right: 10px; margin-top: 5px; margin-bottom: 5px;" src="/images/posts/mongodb-logo.png" alt="" width="256" height="117" /&gt;In these days I am really interested in &lt;a href="http://it.wikipedia.org/wiki/NoSQL" target="_blank"&gt;nosql&lt;/a&gt; tools and especially in the  &lt;a href="http://www.mongodb.org/" target="_blank"&gt;MongoDB&lt;/a&gt;  document databse. &lt;/p&gt;


&lt;p&gt;What amazes me about mongo is that is much more than a key value pair storage while it expose a quite complete query api, a full indexes support and an atomic Fast-In-Place data update.&lt;/p&gt;


&lt;p&gt;Over this MongoDB supports asynchronous replication of data between servers for failover and redundancy. This makes really easy to share and replicate data between a cluster.&lt;/p&gt;


&lt;p&gt;The result is that Mongodb is an incredibly fast and flexible document database. &lt;/p&gt;


&lt;p&gt;Following what &lt;a href="http://www.markdrew.co.uk/blog/post.cfm/couchdb-cache-extension-beta-for-railo" target="_blank"&gt;Mark Drew&lt;/a&gt; was  doing for CouchDb I thought was a good idea to implement a &lt;a href="http://www.getrailo.org/" target="_self"&gt;Railo&lt;/a&gt; Cache plugin that bring into Railo world the power of MongoDB used as cache engine. &lt;/p&gt;


&lt;p&gt;The extension implements the Railo Cache interface at 100%. This means that you can switch from any other cache that Railo support to MongoDb cache with safety. The driver serialize  any object ( or queries or templates etc... ) you want to cache and will reinflate them up when you need to read them. An index is created over the key of your cache objects so that reading them will be a breeze. The plugin also support the &lt;a href="http://www.mongodb.org/display/DOCS/Replica+Sets" target="_blank"&gt;mongodb replica Sets&lt;/a&gt; ( cluster )  and makes your application wait if a failover is in place.&lt;/p&gt;


&lt;p&gt;Many thanks to &lt;a href="http://www.markdrew.co.uk/blog/post.cfm/couchdb-cache-extension-beta-for-railo" target="_blank"&gt;Mark Drew&lt;/a&gt; that made the installation docs over the Railo wiki. You can find more info, installation step by step and details here: &lt;/p&gt;


&lt;p&gt;&lt;a href="http://wiki.getrailo.com/wiki/extensions:mongodb" target="_blank"&gt;http://wiki.getrailo.com/wiki/extensions:mongodb&lt;/a&gt;&lt;/p&gt;


&lt;p&gt;&lt;a href="http://wiki.getrailo.com/wiki/extensions:mongodb" target="_blank"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/p&gt;


&lt;p&gt; &lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>RailoAjax is going to close</title>
   <link href="http://andreacfm.com/2010/08/21/railoajax-is-going-to-close-1" />
   <updated>2010-08-21T00:00:00-07:00</updated>
   <id>http://andreacfm.com/2010/08/21/railoajax-is-going-to-close-1</id>
   <content type="html">&lt;p&gt;&lt;img style="border: 0; float: left; margin: 5px;" src="/images/posts/railoajax.png" alt="" width="95" height="99" /&gt;While this can looks like a bad new .... well it is not.&lt;/p&gt;


&lt;p&gt;Latest Railo BER ( 3.1.2.019 ) has included also the missing part of RailoAjax project into the Railo core distribution. From this point the development and maintenanace of the tags will be made directly from the Railo project itself.&lt;/p&gt;


&lt;p&gt;As per today Railo included the following tags:&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;cfajaxproxy&lt;/li&gt;
&lt;li&gt;cfajaximport&lt;/li&gt;
&lt;li&gt;cfdiv&lt;/li&gt;
&lt;li&gt;cfmap&lt;/li&gt;
&lt;li&gt;cfmapitem&lt;/li&gt;
&lt;li&gt;cfwindow&lt;/li&gt;
&lt;li&gt;cflayout and cflayoutarea ( just for tabs )&lt;/li&gt;
&lt;li&gt;ajaxonload function&lt;/li&gt;
&lt;li&gt;the js library that support the previous tags &lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;I am quite happy about this step. RailoAjax just started like a fun coding of the ajaxproxy and ended into the Railo core..... I really have to thanks all the Railo Team for the support received.&lt;/p&gt;


&lt;p&gt;So please note the following:&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;If you have a RailoAjax extension installed into your server or we context please remove it before update to 3.1.2.019. Or if you have already updated just remove the extension and restart the Railo.&lt;/li&gt;
&lt;li&gt;The RailoAjax &lt;a href="http://projects.getrailo.org/projects/railoajax/" target="_blank"&gt;website&lt;/a&gt; and the &lt;a href="http://trac.getrailo.org/railoajax" target="_blank"&gt;trac&lt;/a&gt;  will be shutted down when Railo 3.2 will be delivered.&lt;/li&gt;
&lt;li&gt;The RailoAjax extension provider &lt;a href="http://railoajax.org/extensionProvider.cfc"&gt;http://railoajax.org/extensionProvider.cfc &lt;/a&gt; will be still available up to the 31 december 2010.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;If you have any issues please contact me or raise a &lt;a href="http://jira.jboss.org/browse/RAILO" target="_blank"&gt;JIRA&lt;/a&gt; tickect&lt;em&gt;&lt;/em&gt;. &lt;/p&gt;


&lt;p&gt;If you want to help coding new functionalities the source code is available on &lt;a href="http://github.com/andreacfm/railoajax" target="_blank"&gt;github&lt;/a&gt;.&lt;/p&gt;


&lt;p&gt; &lt;/p&gt;


&lt;p&gt; &lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Mango Github Gists plugin</title>
   <link href="http://andreacfm.com/2010/08/16/mango-github-gists-plugin" />
   <updated>2010-08-16T00:00:00-07:00</updated>
   <id>http://andreacfm.com/2010/08/16/mango-github-gists-plugin</id>
   <content type="html">&lt;p&gt;&lt;img style="border: 0pt none; margin: 5px; float: left;" src="/images/posts/logo_gist.png" alt="" width="152" height="41" /&gt;Something very cool about &lt;a href="https://github.com/" target="_blank"&gt;github&lt;/a&gt; services are &lt;a href="http://gist.github.com/" target="_blank"&gt;gists&lt;/a&gt;.&lt;/p&gt;


&lt;p&gt;Gists are a sort of snippets than you can create, share and embedd using a simple js script tag. I have started to use them very often and I think I will that more and more in the future. JUst think about that gists are also plain git repo and as any git repo can be cloned and shared between your team.&lt;/p&gt;


&lt;p&gt;I have created a very simple Mango plugin ( mango in very easy when you want to create plugins !!! ) so that you can embed your gists in your mango posts.&lt;/p&gt;


&lt;p&gt;Syntax is incredibly easy .... just have a look &lt;a href="http://wiki.github.com/andreacfm/mango.gists/" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;


&lt;p&gt;The mango auto install url is : &lt;strong&gt;http://github.com/downloads/andreacfm/mango.gists/com.andreacfm.mango.gists_1.0.zip&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;You can also download the zip or clone the source form the same GitHub repo.&lt;/p&gt;


&lt;p&gt;Have fun !&lt;/p&gt;


&lt;p&gt;[gist:525626]&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>CfEclipse and script based cfcs</title>
   <link href="http://andreacfm.com/2010/08/11/cfeclipse-and-script-based-cfcs" />
   <updated>2010-08-11T00:00:00-07:00</updated>
   <id>http://andreacfm.com/2010/08/11/cfeclipse-and-script-based-cfcs</id>
   <content type="html">&lt;p&gt;While the &lt;a href="http://www.cfeclipse.org/" target="_blank"&gt;cfeclipse&lt;/a&gt; team is working on giving support to the new scripting syntax added recently in cfml I falled into something that can help someone to have a better feeeling in the meantime.&lt;/p&gt;

&lt;p&gt;I was not aware, until yesterday, that this syntax is supported in a script based cfc:&lt;/p&gt;

&lt;script src="https://gist.github.com/1035566.js"&gt; &lt;/script&gt;


&lt;p&gt;So while it does not really looks &amp;ldquo;amazing&amp;rdquo; this will give you code colouring and syntax highlighting. But, most important, the syntax is fully supported from ACF and Railo too ( did not test on OpenBD ).&lt;/p&gt;

&lt;p&gt;Some of you will be asking why to do that ? Just use cfbuilder &amp;hellip;. and I agree. Cfbuilder is a great tool also if , in my opinion , lack of linux support. But I am one of those who are convinced that cfml deserves an open and strong ide to attract more developers so &amp;hellip; if you think like me consider to donate something to &lt;a href="http://www.cfeclipse.org/" target="_blank"&gt;cfeclipse project&lt;/a&gt;.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>BlazeDS 3.2 integration in Railo</title>
   <link href="http://andreacfm.com/2010/07/27/blazeds-3-2-integration-in-railo" />
   <updated>2010-07-27T00:00:00-07:00</updated>
   <id>http://andreacfm.com/2010/07/27/blazeds-3-2-integration-in-railo</id>
   <content type="html">&lt;p&gt;&lt;img style="border: 0; float: left; margin: 10px;" src="/images/posts/flex.jpg" alt="" width="130" height="130" /&gt;In the &lt;a href="http://groups.google.com/group/railo?lnk=" target="_blank"&gt;Railo mailing lists &lt;/a&gt;are often required informations about the settings needed to implement calls via the AMF protocol. If you use the &lt;a href="http://trac.getrailo.org/installers/" target="_blank"&gt;Railo Installers&lt;/a&gt; ( thanks again Jordan for this !! ) anything should already being setted up and ready to use but in case of any needs there was a lack of public informations about this topic.&lt;/p&gt;


&lt;p&gt;We have now a nice &lt;a href="http://wiki.getrailo.org/wiki/Amf:configuration" target="_blank"&gt;wiki section&lt;/a&gt; where you can find a very exhaustive explanations of many aspect of this topic ( credits to &lt;a href="http://www.getrailo.com/index.cfm/about-us/railo-team/roland-ringgenberg/" target="_blank"&gt;Roland Ringgenberg&lt;/a&gt; ) .&lt;/p&gt;


&lt;p&gt;Have a nice Railo/Blaze Ds integration !!&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Railo tip: cffile action touch</title>
   <link href="http://andreacfm.com/2010/06/30/railo-tip-cffile-action-touch" />
   <updated>2010-06-30T00:00:00-07:00</updated>
   <id>http://andreacfm.com/2010/06/30/railo-tip-cffile-action-touch</id>
   <content type="html">&lt;p&gt;For linux/unix user is quite common to use the command &lt;em&gt;&lt;strong&gt;touch&lt;/strong&gt;&lt;/em&gt; (from the shell) to update the last modified date of a file (to the current time) or to create a new file.&lt;/p&gt;


&lt;p&gt;You can do that as well from Railo :&lt;/p&gt;




&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="html"&gt;&lt;span class="nt"&gt;&amp;lt;cffile&lt;/span&gt; &lt;span class="na"&gt;action=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;touch&amp;quot;&lt;/span&gt; &lt;span class="na"&gt;file=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;whatever.cfm&amp;quot;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;&lt;span style="font-family: arial, sans-serif; font-size: medium; "&gt;&lt;span style="border-collapse: collapse; font-size: 15px;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>StructNew takes arguments</title>
   <link href="http://andreacfm.com/2010/06/02/structnew-takes-arguments" />
   <updated>2010-06-02T00:00:00-07:00</updated>
   <id>http://andreacfm.com/2010/06/02/structnew-takes-arguments</id>
   <content type="html">&lt;p&gt;During last Sotr I was talking with &lt;a href="http://www.markdrew.co.uk/blog/" target="_blank"&gt;Mark Drew&lt;/a&gt; and &lt;a href="http://getrailo.org" target="_blank"&gt;Micheal Offner-Streit ( the Railo cto )&lt;/a&gt;  and we discovered one of the many gems hidden into Railo engine.&lt;/p&gt;


&lt;p&gt;Any cf developer has always fight with the missing support for a linked hash map in cfml. This lack has made a task  keeping a struct in a defined order. In railo you can simple do this:&lt;/p&gt;




&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="html"&gt;&lt;span class="nt"&gt;&amp;lt;cfset&lt;/span&gt; &lt;span class="na"&gt;str =&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt;&lt;span class="s"&gt;structNew(&amp;#39;linked&amp;#39;)&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;What you have now is a struct 100% similar to a normal struct that has the whole capabilities of a linked hash map. For example the map keep the elements into an ordered stack.&lt;/p&gt;


&lt;p&gt;You can read more in the &lt;a href="http://wiki.getrailo.org/wiki/FUNCTION:STRUCTNEW" target="_blank"&gt;railo wiki docs&lt;/a&gt;.&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Railo Amazon S3 extension included into core</title>
   <link href="http://andreacfm.com/2010/05/28/railo-amazon-s3-extension-included-into-core" />
   <updated>2010-05-28T00:00:00-07:00</updated>
   <id>http://andreacfm.com/2010/05/28/railo-amazon-s3-extension-included-into-core</id>
   <content type="html">&lt;p&gt;As you can read from the official &lt;a href="http://www.railo.ch/blog/index.cfm/2010/5/27/Paid-Railo-Extension-Amazon-S3-now-free-moves-to-the-core" target="_blank"&gt;Railo Blog&lt;/a&gt; the Amazon S3 extension will now be free to download and will be soon moved into the Railo core package. &lt;br /&gt;This is an amazing news from Railo and just one of the extra feature Railo will add in the next future. &lt;/p&gt;


&lt;p&gt;So let's stay tuned!!! &lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Railo starts ajax support</title>
   <link href="http://andreacfm.com/2010/04/12/railo-start-ajax-support" />
   <updated>2010-04-12T00:00:00-07:00</updated>
   <id>http://andreacfm.com/2010/04/12/railo-start-ajax-support</id>
   <content type="html">&lt;p&gt;I am a bit late blogging about this but I had a quite 'intense' maech. &lt;/p&gt;


&lt;p&gt;Since version 3.1.2.009 &lt;a href="http://getrailo.org" target="_blank"&gt;Railo&lt;/a&gt; starts the ajax tags support . You can read more &lt;a href="http://www.railo.ch/blog/index.cfm/2010/3/24/Railo-Ajax-changes-in-312009" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;


&lt;p&gt;Ok so what's teh big news? What make me proud is that I developed those tags and after a long debugging they are finally part of the Railo core engine. The tags comes from the RailoAjax project that will go on focusing on the remaining ajax tags to fill the gap with ACF ( that's the plan .... but it's a long road to do ....).&lt;/p&gt;


&lt;p&gt;This is an example of how a community effort can really contribute to the main project. I am sure more efforts will come in the future ... so if you an idea .... some spare time ..... and you wish to contribute do not hesitate to contact me .... Railo needs you.&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Railo Installers IIS update</title>
   <link href="http://andreacfm.com/2010/03/25/railo-installers-iis-update" />
   <updated>2010-03-25T00:00:00-07:00</updated>
   <id>http://andreacfm.com/2010/03/25/railo-installers-iis-update</id>
   <content type="html">&lt;p&gt;Jordan Micheals has posted a great update to the &lt;a href="http://trac.getrailo.org/installers/" target="_self"&gt;Railo Installers&lt;/a&gt; project. &lt;/p&gt;


&lt;p&gt;Read more &lt;a href="http://groups.google.com/group/railo-beta/browse_thread/thread/d0087715afb042a0" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;


&lt;p&gt;Some of the bugs fixed/enhancements:&lt;/p&gt;


&lt;p&gt;&lt;span style="color: #000000; font-family: arial, sans-serif; line-height: normal;"&gt;3.1.2.001-pl1 Patch Notes: &lt;br /&gt;-------------------------- &lt;br /&gt;- [NEW] IIS6 Is now fully supported on Windows Server 2003 &lt;br /&gt;- [NEW] IIS7 Is now properly supported on Windows 7 machines &lt;br /&gt;- [NEW] IIS7/IIS6 now set "index.cfm" as a default document option &lt;br /&gt;- [NEW] Windows 64-bit is now available &lt;br /&gt;- [BUGFIX] Windows 32-bit Installer will now auto-detect 64-bit machines &lt;br /&gt;and will install the 64-bit connector when being installed on a 64-bit &lt;br /&gt;version of Windows. This is true for both IIS6 and IIS7. This avoids the &lt;br /&gt;  "LoadLibraryEx" failure in IIS if a 32-bit connector has been &lt;br /&gt;installed on a 64-bit version of IIS. &lt;br /&gt;- [UPDATE] The Tomcat connector has been upgraded from version 1.2.28 to &lt;br /&gt;1.2.30 (latest as of this release) &lt;br /&gt;- [UPDATE] The Tomcat Engine has been upgraded from version 6.0.20 to &lt;br /&gt;6.0.26 (latest as of this release) &lt;br /&gt;- [UPDATE] Source code in the Java JDK has been removed in order to &lt;br /&gt;reduce the size of the installers by approximately 20 MB. The installers &lt;br /&gt;now hover around the 100MB range. More rarely-used aspects of the JDK &lt;br /&gt;that ships with the installer may be removed at a later date in order to &lt;br /&gt;reduce the download size even more. &lt;/span&gt;&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Take the Railo 4k Challenge and win a ticket to cf.Objective()!</title>
   <link href="http://andreacfm.com/2010/03/12/take-the-railo-4k-challenge-and-win-a-ticket-to-cf-objective" />
   <updated>2010-03-12T00:00:00-08:00</updated>
   <id>http://andreacfm.com/2010/03/12/take-the-railo-4k-challenge-and-win-a-ticket-to-cf-objective</id>
   <content type="html">&lt;p&gt;If you are interested in Railo and you are thinking to take part of cf.Objective() you cannot loose &lt;a href="http://www.railo.ch/blog/index.cfm/2010/3/12/Take-the-Railo-4k-Challenge-and-win-a-ticket-to-cfObjective" target="_blank"&gt;this&lt;/a&gt;. Write 4k of amazing Railo code and win a ticket.&lt;/p&gt;


&lt;p&gt; &lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Model Glue Caching - patch update</title>
   <link href="http://andreacfm.com/2010/01/08/model-glue-caching-patch-update" />
   <updated>2010-01-08T00:00:00-08:00</updated>
   <id>http://andreacfm.com/2010/01/08/model-glue-caching-patch-update</id>
   <content type="html">&lt;p&gt;Two days ago I have posted some code that solve ( in part )  an annoying bug regarding caching in Model Glue framework.&lt;/p&gt;


&lt;p&gt;As per MG docs the caching declaration can be used on any event-handler and include tag but, in practice. caching is only working if applied to the initial event-handler ( the first invoked by the url ). &lt;/p&gt;


&lt;p&gt;Since we want to use MG on our project, and we absolutely need a granular caching system, we are implementing  what we think can be a good solution and we would like to share for feedback and testings ( of course the MG team is the first in receiving our code for review and possible inclusion in future releases ).&lt;/p&gt;


&lt;p&gt;We have made a new review to the first patch and now MG can support the following instructions:&lt;/p&gt;




&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="xml"&gt;&lt;span class="nt"&gt;&amp;lt;event-handler&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;page.index&amp;quot;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;broadcasts&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;results&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;result&lt;/span&gt; &lt;span class="na"&gt;do=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;views.one&amp;quot;&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;result&lt;/span&gt; &lt;span class="na"&gt;do=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;views.two&amp;quot;&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;result&lt;/span&gt; &lt;span class="na"&gt;do=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;template.main&amp;quot;&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;/results&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;views&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;include&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;three&amp;quot;&lt;/span&gt; &lt;span class="na"&gt;template=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;pages/three.cfm&amp;quot;&lt;/span&gt; &lt;span class="na"&gt;cache=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;true&amp;quot;&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;include&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;four&amp;quot;&lt;/span&gt; &lt;span class="na"&gt;template=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;pages/four.cfm&amp;quot;&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;/views&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/event-handler&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="xml"&gt;&lt;span class="nt"&gt;&amp;lt;event-handler&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;views.one&amp;quot;&lt;/span&gt; &lt;span class="na"&gt;cache=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;true&amp;quot;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;broadcasts&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    ....... 
    &lt;span class="nt"&gt;&amp;lt;views&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;include&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;one&amp;quot;&lt;/span&gt; &lt;span class="na"&gt;template=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;pages/one.cfm&amp;quot;&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/views&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/event-handler&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="xml"&gt;&lt;span class="nt"&gt;&amp;lt;event-handler&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;views.two&amp;quot;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;broadcasts&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
        ......
    &lt;span class="nt"&gt;&amp;lt;views&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;include&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;two&amp;quot;&lt;/span&gt; &lt;span class="na"&gt;template=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;pages/two.cfm&amp;quot;&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/views&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/event-handler&amp;gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;As you  can see from this code MG can cache a single views but , and this is the best feature I guess , is also able to cache a full event.handler even if that is not the initial event handler.&lt;/p&gt;


&lt;p&gt;This solution can really speed up yout MG app reducing dramatically the effort you ask to your server to what your page exactly needs. Any time you are able to cache an "inner request" event MG will just include a bunch of html skipping any broadcasting and this can really save a lot of unnecessary server stress.&lt;/p&gt;


&lt;p&gt;Over that imagine you can easily cache a full page excluding just the single lines that ( for example ) are reserved to logged user info/panel ( and of course skipping any unnecessary message broadcasting ).&lt;/p&gt;


&lt;p&gt;You can find the &lt;a href="/get/mg/cache/EventContext.txt" target="_blank"&gt;patch here&lt;/a&gt; ( replace file &lt;span style="color: #4b4b4b; font-family: Verdana, Geneva, sans-serif; line-height: 20px;"&gt;/ModelGlue/gesture/eventrequest/EventContext.cfc)&lt;/span&gt;&lt;/p&gt;


&lt;p&gt;Let me have your feedbacks and suggestions.&lt;/p&gt;


&lt;p&gt;REMEMBER : THIS IS CODE SHARED FOR TESTING AND NOT FOR PRODUCTION USE.&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>jQuery 1.4</title>
   <link href="http://andreacfm.com/2010/01/08/jquery-1-4" />
   <updated>2010-01-08T00:00:00-08:00</updated>
   <id>http://andreacfm.com/2010/01/08/jquery-1-4</id>
   <content type="html">&lt;p&gt;&lt;img style="border:0; margin-top: 10px; margin-bottom: 10px; float: left;" src="/images/posts/jquery.gif" alt="" width="132" height="132" /&gt;I am quite interested in what is happening in jQuery for the next 2 weeks. &lt;/p&gt;


&lt;p&gt;With the release of version 1.4 the jQ team has announced 14 days of news, code relaeases etc.&lt;/p&gt;


&lt;p&gt;The &lt;a href="http://jquery14.com" target="_blank"&gt;website&lt;/a&gt; created for the event is nice and as pre release day news we got a brand new &lt;a href="http://jquery14.com/pre-release-1/new-jquery-api-site" target="_blank"&gt;api browser site&lt;/a&gt; that looks most efficient and organized.&lt;/p&gt;


&lt;p&gt;So let's wait and see what news will come in teh next weeks.&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Model Glue Caching patch </title>
   <link href="http://andreacfm.com/2010/01/06/model-glue-caching-patch" />
   <updated>2010-01-06T00:00:00-08:00</updated>
   <id>http://andreacfm.com/2010/01/06/model-glue-caching-patch</id>
   <content type="html">&lt;p&gt;&lt;img style="border: 0; float: left; margin: 10px;" src="/images/posts/mgLogo.gif" alt="" width="125" height="117" /&gt;I started last week a very big project where we decided to use the MG framework as rendering engine. &lt;/p&gt;


&lt;p&gt;The site will have a huge traffic and will need to display many 'heavy portlets' different by user or context etc... &lt;/p&gt;


&lt;p&gt;We started to make some test and investigations on how we could implement pur rendering architecture using the MG view caching system.  In short time we discovered that the cache declaration based on the include tag was not processed and considered by the framework. &lt;/p&gt;


&lt;p&gt;The final result of our research job was that the only caching support "really" working was the once on the initial event object ( basically the first event called in a new request ).&lt;/p&gt;


&lt;p&gt;This was a killer, not for the MG caching system per se ( we use an adapter to ehCache ) but because we completely needed to remove MG from the project. We then decided to make some more test and in a short time we could create a patch that allow  MG to cache views based on the declarations made in any single include xml tag.&lt;/p&gt;


&lt;p&gt;So with this patch code like this :&lt;/p&gt;




&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="xml"&gt;&lt;span class="nt"&gt;&amp;lt;include&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;myview&amp;quot;&lt;/span&gt; &lt;span class="na"&gt;template=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;pages/web/css_js.cfm&amp;quot;&lt;/span&gt; &lt;span class="na"&gt;cache=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;true&amp;quot;&lt;/span&gt; &lt;span class="na"&gt;cacheKeyValues=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;id&amp;quot;&lt;/span&gt; &lt;span class="na"&gt;cacheTimeout=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;3600&amp;quot;&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;will create a cache copy for 3600 seconds of the view based on the value of the id argument.&lt;/p&gt;


&lt;p&gt;Please note that any keys looks for value into the event object  so, if you want to use sessionid as a cache key, you should push that into the event object on request start. Following a &lt;a href="http://corfield.org/" target="_blank"&gt;Sean Corfield&lt;/a&gt; suggestion the generate key now also consider the host where the view is processed, so If you run the same application from differents domains any domain generate a different cache.&lt;/p&gt;


&lt;p&gt;We send code to Dan Wilson that is the MG maintainer for review and testing.&lt;/p&gt;


&lt;p&gt;If you want to use and test ( do not use that in production cause is really not tested code ) &lt;a href="/get/mg/cache/EventContext.txt" target="_blank"&gt;downlaod&lt;/a&gt; the patch and replace the file /ModelGlue/gesture/eventrequest/EventContext.cfc. &lt;/p&gt;


&lt;p&gt;Send your feedback ( or share on MG mailing list ).&lt;/p&gt;


&lt;p&gt; &lt;/p&gt;


&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; margin: 0px;"&gt;Credits goes especially to &lt;a style="color: #cc6600; text-decoration: none;" href="/www.millemultimedia.it" target="_blank"&gt;Cristian Costantini&lt;/a&gt;.&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Replace CfDocument with Flying Saucer Xhtml renderer</title>
   <link href="http://andreacfm.com/2009/12/23/replace-cfdocument-with-flying-source-xhtml-renderer" />
   <updated>2009-12-23T00:00:00-08:00</updated>
   <id>http://andreacfm.com/2009/12/23/replace-cfdocument-with-flying-source-xhtml-renderer</id>
   <content type="html">&lt;p&gt;As per my previous post about Xhtml &lt;a href="http://www.getrailo.org/" target="_blank"&gt;Railo&lt;/a&gt; capabilities I will post my firsts experiences using &lt;a href="https://xhtmlrenderer.dev.java.net/" target="_blank"&gt;Flying Saucer&lt;/a&gt; as enhancements of cfdocument tag.&lt;/p&gt;

&lt;p&gt;Now, cfdocument is not bad but the rendering capabilities are quite limitated and when I discovered that cfdocument, up to cf9, do not support justified text alignment I decided to give a try with &lt;a href="https://xhtmlrenderer.dev.java.net/" target="_blank"&gt;Flying Saucer&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The library works taking your xhtml and rendering that into a pdf processing your css.&lt;/p&gt;

&lt;p&gt;What is good is that css2 and 3 are processed correctly so, for example, you can create a page header like:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="css"&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="nc"&gt;.header&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="k"&gt;display&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="k"&gt;block&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;position&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;running&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;header&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;@page&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nt"&gt;size&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;8&lt;/span&gt;&lt;span class="nc"&gt;.5in&lt;/span&gt; &lt;span class="nt"&gt;11in&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
  &lt;span class="nt"&gt;margin&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;18&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="nt"&gt;0&lt;/span&gt;&lt;span class="o"&gt;%;&lt;/span&gt;
  &lt;span class="k"&gt;@top-left&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="nt"&gt;content&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;element&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;header&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;The element in the body that is selected as .header is not rendered as normally you expect but is rendered into any page heading.&lt;/p&gt;

&lt;p&gt;Of course same works for footer.  See more about css @page &lt;a href="http://www.w3.org/TR/CSS2/page.html" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Creating a page-break is a breath:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="css"&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="nc"&gt;.break&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;page&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;break&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;after&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="k"&gt;always&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Any div with class break will make a new page starts from the div position.&lt;/p&gt;

&lt;p&gt;I also discovered that pdf needs fonts to be embedded into the file itself.&lt;/p&gt;

&lt;p&gt;This is not supported in css spec but Flying Saucer added some extra css &amp;lsquo;helper&amp;rsquo; so that embedding a font is easy like this:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="css"&gt;&lt;span class="k"&gt;@font-face&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nt"&gt;src&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;url&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;file&lt;/span&gt;&lt;span class="o"&gt;:///&lt;/span&gt;&lt;span class="nt"&gt;TradeGothicLTStd&lt;/span&gt;&lt;span class="nc"&gt;.ttf&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
    &lt;span class="nt"&gt;-fs-pdf-font-embed&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;embed&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;So far the possibilities looks immense and I think they are .&lt;/p&gt;

&lt;p&gt;I have created a java class that the absolute path of the xhtml you need to convert and the path of where you want your pdf to be placed and does the job for you.&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="java"&gt;&lt;span class="kn"&gt;package&lt;/span&gt; &lt;span class="n"&gt;com&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;andreacfm&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;utils&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;com.lowagie.text.*&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.xhtmlrenderer.pdf.ITextRenderer&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.xhtmlrenderer.resource.XMLResource&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.w3c.dom.Document&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.xml.sax.InputSource&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.io.*&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;PDFReader&lt;/span&gt;&lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;createPDF&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;String&lt;/span&gt; &lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;String&lt;/span&gt; &lt;span class="n"&gt;pdf&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="kd"&gt;throws&lt;/span&gt; &lt;span class="n"&gt;IOException&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;DocumentException&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;OutputStream&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;os&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="n"&gt;FileOutputStream&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pdf&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
            &lt;span class="n"&gt;ITextRenderer&lt;/span&gt; &lt;span class="n"&gt;renderer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="n"&gt;ITextRenderer&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
            &lt;span class="n"&gt;Document&lt;/span&gt; &lt;span class="n"&gt;doc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;XMLResource&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;load&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="n"&gt;InputSource&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="o"&gt;)).&lt;/span&gt;&lt;span class="na"&gt;getDocument&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
            &lt;span class="n"&gt;renderer&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setDocument&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;doc&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
            &lt;span class="n"&gt;renderer&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;layout&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
            &lt;span class="n"&gt;renderer&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;createPDF&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
            &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;close&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
            &lt;span class="n"&gt;os&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
            &lt;span class="o"&gt;}&lt;/span&gt;
         &lt;span class="k"&gt;finally&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
                &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
                    &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;close&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
                    &lt;span class="o"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;IOException&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
                    &lt;span class="c1"&gt;// ignore&lt;/span&gt;
                &lt;span class="o"&gt;}&lt;/span&gt;
             &lt;span class="o"&gt;}&lt;/span&gt;
         &lt;span class="o"&gt;}&lt;/span&gt;
     &lt;span class="o"&gt;}&lt;/span&gt;
 &lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;You can call it like :&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="html"&gt;&lt;span class="nt"&gt;&amp;lt;cfset&lt;/span&gt; &lt;span class="na"&gt;objPDFReader =&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt;&lt;span class="s"&gt;createObject(&amp;#39;java&amp;#39;,&amp;#39;com.andreacfm.utils.PDFReader&amp;#39;).init()&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;cfset&lt;/span&gt; &lt;span class="na"&gt;objPDFReader&lt;/span&gt;&lt;span class="err"&gt;.&lt;/span&gt;&lt;span class="na"&gt;createPDF&lt;/span&gt;&lt;span class="err"&gt;(&lt;/span&gt;&lt;span class="na"&gt;xhtmlPath&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt;&lt;span class="na"&gt;pdfPath&lt;/span&gt;&lt;span class="err"&gt;)&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;To install the library&lt;/strong&gt; download the &lt;a href="https://xhtmlrenderer.dev.java.net/"&gt;source&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Copy:
core-renderer.jar
iText-2.0.8.jar
&lt;a href="/get/andreacfm.jar" target="_blank"&gt;andreacfm.jar&lt;/a&gt; ( if you want to load also my util class )&lt;/p&gt;

&lt;p&gt;into folder WEB-INF/lib&lt;/p&gt;

&lt;p&gt;At this point flying saucer is ready to go but I found some more details to be fixed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DO NOT MAKE THESE STEPS ON PRODUCTION ENVIRONMENT BEFORE  TESTING YOUR APPLICATIONS.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;
&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For cf8 users&lt;/strong&gt;. I have been forced to replace the xalan library that ships cf8 with the latest xalan release due to a bug that prevent the correct namespaceevaluations.
I downlaoded the xalan source from &lt;a href="http://apache.panu.it/xml/xalan-j/"&gt;here&lt;/a&gt;. I then copied serializer.jar,xml-apis.jar,xalan.jar,xsltc.jar and xerceImpl.jar into&lt;/p&gt;

&lt;p&gt;WEB-INF/cfusion/lib/updates&lt;/p&gt;

&lt;p&gt;In this way when you restart cf server the new xalan version is loaded ( update folder is at the top of jrun classpath ). This worked for me but I cannot be 100% sure that any other xml implementation of cf server will have an impact.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For Railo Users&lt;/strong&gt;. Flying Saucer works fine with itext 2.0.8. Version 2.1.2, that ships with Railo, brakes previous code. You will need to downgrade to 2.0.8 to make it works correctly. Due to the fact that Railo is often deployed on differents Application Server this can be done in differents ways. Contact me if you want to share yoru experience on this point.
I personally added a folder to the Tomcat classpath.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Bad html to Xhtml. The Railo way.</title>
   <link href="http://andreacfm.com/2009/12/22/bad-html-to-xhtml-the-railo-way" />
   <updated>2009-12-22T00:00:00-08:00</updated>
   <id>http://andreacfm.com/2009/12/22/bad-html-to-xhtml-the-railo-way</id>
   <content type="html">&lt;p&gt;I have worked quite hard in the last period with an interesting xhtml rendering java library called "&lt;a href="https://xhtmlrenderer.dev.java.net/" target="_blank"&gt;flying saucer&lt;/a&gt;" ( I will post more about that in the next future).&lt;/p&gt;


&lt;p&gt;This library takes a valid xhtml string and is capable to convert it into a pdf document ( and more formats ) . &lt;/p&gt;


&lt;p&gt;What makes this lib special is the ability to format the output using css 2 and 3 stataments. And I could not imagine ahow many things css 2 and 3 is capable of....&lt;/p&gt;


&lt;p&gt;I was just worried about the source doc cause that &lt;strong&gt;must&lt;/strong&gt; be a perfectly valid xml document. Sometimes, depending on how the string to be parsed is generated, respecting the strict xml rules can be difficult.&lt;/p&gt;


&lt;p&gt;I then discovered that Railo ships an htmlFormat() function that is capable to "repair" your bad html and gives you back a nice xhtml format. &lt;/p&gt;


&lt;p&gt;Look at this example:&lt;/p&gt;


&lt;p&gt;This is a very bad html piece of code saved into a variables and parsed into htmlParse()&lt;/p&gt;




&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="html"&gt;&lt;span class="nt"&gt;&amp;lt;cfsavecontent&lt;/span&gt; &lt;span class="na"&gt;variable=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;html&amp;quot;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
Text
&lt;span class="nt"&gt;&amp;lt;h3&amp;gt;&lt;/span&gt;Title
    &lt;span class="nt"&gt;&amp;lt;ul&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;li&amp;gt;&lt;/span&gt;item&lt;span class="nt"&gt;&amp;lt;li&amp;gt;&lt;/span&gt;
        item
     &lt;span class="nt"&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;
     &lt;span class="nt"&gt;&amp;lt;li&amp;gt;&lt;/span&gt;More text&lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;&amp;quot;&lt;/span&gt; &lt;span class="nt"&gt;&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/cfsavecontent&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;cfset&lt;/span&gt; &lt;span class="na"&gt;xml=&lt;/span&gt;&lt;span class="s"&gt;htmlParse(html)&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;Here is the output generated by htmlParse()&lt;/p&gt;




&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="xml"&gt;&lt;span class="cp"&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;Text
    &lt;span class="nt"&gt;&amp;lt;br&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h3&amp;gt;&lt;/span&gt;Title&lt;span class="nt"&gt;&amp;lt;/h3&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;ul&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;li&amp;gt;&lt;/span&gt;item&lt;span class="nt"&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;li&amp;gt;&lt;/span&gt;item&lt;span class="nt"&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;ul&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;li&amp;gt;&lt;/span&gt;More text &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;As you can see this is a perfectly valid xhtml string.&lt;/p&gt;


&lt;p&gt;I am now sure that I can give to my xhtml rendrering library the xhtml formts it needs with no worry about how bad the source can be.&lt;/p&gt;


&lt;p&gt;Thanks to &lt;a href="http://www.getrailo.org/" target="_blank"&gt;Railo&lt;/a&gt; for this amazing feature.&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>RailoAjax 0.5.2 with cfmap is out</title>
   <link href="http://andreacfm.com/2009/12/11/railoajax-0-5-2-with-cfmap-is-out" />
   <updated>2009-12-11T00:00:00-08:00</updated>
   <id>http://andreacfm.com/2009/12/11/railoajax-0-5-2-with-cfmap-is-out</id>
   <content type="html">&lt;p&gt;&lt;a href="http://projects.getrailo.org/projects/railoajax/" target="_self"&gt;Railo Ajax&lt;/a&gt; arrived to version 0.5.2.&lt;/p&gt;


&lt;p&gt;From this release &lt;strong&gt;cfmap&lt;/strong&gt; has entered into the set of tags that RailoAjax ships. Cfmap support is still experimental and do not cover event the 50% of the ACF version but development is on the way. &lt;/p&gt;


&lt;p&gt;See more &lt;a href="http://projects.getrailo.org/projects/railoajax/" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;


&lt;p&gt;Remember that the demo app that you see online is installed ( if required ) when RailoAjax deploy on your Railo server. So you can have a look to the demo code that can help you on development stage.&lt;/p&gt;


&lt;p&gt;Another important announcment is that CFMENU is on the way to appear from a community contribution. Cfmenu has been added to 0.6 milestone ( at least in alpha version ).&lt;/p&gt;


&lt;p&gt;Next step will be focused on docs. For a month or so the main efforts ( over cfmap implementation ) will be on dodumenting what has been done up to know keeping an eye on bugs of course.&lt;/p&gt;


&lt;p&gt;Do not hesistate to contact me for any question and of course .... project is open ... so feel free to jump in ....&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Where Railo comes from......</title>
   <link href="http://andreacfm.com/2009/12/08/where-railo-comes-from" />
   <updated>2009-12-08T00:00:00-08:00</updated>
   <id>http://andreacfm.com/2009/12/08/where-railo-comes-from</id>
   <content type="html">&lt;p&gt;[youtube:1LwG1Qmgtb0]&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>My first cfwheels plugin - ioc interface</title>
   <link href="http://andreacfm.com/2009/12/07/my-first-cfwheels-plugin-ioc-interface" />
   <updated>2009-12-07T00:00:00-08:00</updated>
   <id>http://andreacfm.com/2009/12/07/my-first-cfwheels-plugin-ioc-interface</id>
   <content type="html">&lt;p&gt;&lt;img style="float: left; margin: 10px;" src="/images/posts/cfwheels-logo.png" alt="" width="93" height="121" /&gt;I decided to play around with &lt;a href="http://cfwheels.org" target="_blank"&gt;cfwheels&lt;/a&gt; cause I was amazed by some examples I saw around and I have to admit is good fun. &lt;/p&gt;


&lt;p&gt;After 1 hr testing I realized that no ioc support is build into cfwheels and ..... I really cannot live with no Ioc container available at any time so I decided to add a plugin for managing a beanFactory into cfwheels.&lt;/p&gt;


&lt;p&gt;Probably is not the best cfwheel plugin ever written but was very easy and painless. While I tend to be very OO guy I am amazed by conventions in last period ( I am also playing with Sean Corfield &lt;a href="http://fw1.riaforge.org/" target="_blank"&gt;FW1&lt;/a&gt; ). While I am also an happy user of Coldbox and ModelGlue I find that sometimes frameworks added complexity also to easy tasks. From here my desire to look into frameworks that make of conventions their core basement.&lt;/p&gt;


&lt;p&gt;In my mind conventions means less code in default situations and about this cfwheels and fw1 at the moment are the best. Btw I also think that for a more complex task Coldbox really has something more to help development of more advanced applications.&lt;/p&gt;


&lt;p&gt;You can find the plugin &lt;a href="http://cfwheels.org/plugins/listing/22" target="_blank"&gt;here&lt;/a&gt; to play with it and have a look to &lt;a href="http://cfwheels.org" target="_blank"&gt;cfwheels&lt;/a&gt;.&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>ColdBox Book Released</title>
   <link href="http://andreacfm.com/2009/12/03/coldbox-book-released" />
   <updated>2009-12-03T00:00:00-08:00</updated>
   <id>http://andreacfm.com/2009/12/03/coldbox-book-released</id>
   <content type="html">&lt;p&gt;I am a big coldbox fan and I am very glad to post about the release of the &lt;a href="http://blog.coldbox.org/post.cfm/coldbox-book-released" target="_blank"&gt;ColdBox Book&lt;/a&gt;. I am ordering a copy for me and, if you are serious about coldbox, I strongly recomend it.&lt;/p&gt;


&lt;p&gt;Coldbox has always been very well documented and the book will surely be an interesting way to go deeply into coldbox framework.&lt;/p&gt;


&lt;p&gt;Thanks to Luis for the hard job.&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Railo Ajax 0.5.1.5 released</title>
   <link href="http://andreacfm.com/2009/11/08/railo-ajax-0-5-1-5-released" />
   <updated>2009-11-08T00:00:00-08:00</updated>
   <id>http://andreacfm.com/2009/11/08/railo-ajax-0-5-1-5-released</id>
   <content type="html">&lt;p&gt;A new version has been released.&lt;/p&gt;


&lt;p&gt;The most interesting news is the complete refactor of the UI tags. RailoAjax library now provide bridges classes that need a speficic adapter to perform the action required. This allows to switch between one library support to another with no need to change the core code.&lt;/p&gt;


&lt;p&gt;An example can be found &lt;a href="http://projects.getrailo.org/RailoAjax/tests/index.cfm?template=cfwindow/ext.cfm" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;


&lt;p&gt;Once the concrete implementation is done ( the Ext cfwindow is already done ) you can choose the library using the cfajaximport tag.&lt;/p&gt;




&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="html"&gt;&lt;span class="nt"&gt;&amp;lt;cfajaximport&lt;/span&gt; &lt;span class="na"&gt;library=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;ext&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;Having implemented a bridge pattern for any UI implementation has also allowed us to provide a set of new events provided directly by the Railo.Events engine that do not rely on the specific implementation making code even more portable. The following event has been added :&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;Window.beforeCreate&lt;/li&gt;
&lt;li&gt;Window.afterCreate&lt;/li&gt;
&lt;li&gt;Window.beforeShow&lt;/li&gt;
&lt;li&gt;Window.afterShow&lt;/li&gt;
&lt;li&gt;Window.beforeHide&lt;/li&gt;
&lt;li&gt;Window.afterHide&lt;/li&gt;
&lt;li&gt;Window.beforeClose&lt;/li&gt;
&lt;li&gt;Window.afterClose&lt;/li&gt;
&lt;li&gt;Layout.afterTabSelect&lt;/li&gt;
&lt;li&gt;Layout.beforeTabInit&lt;/li&gt;
&lt;li&gt;Layout.afterTabInit&lt;/li&gt;
&lt;li&gt;Layout.beforeTabCreate&lt;/li&gt;
&lt;li&gt;Layout.afterTabCreate&lt;/li&gt;
&lt;li&gt;Layout.beforeTabRemove&lt;/li&gt;
&lt;li&gt;Layout.afterTabRemove&lt;/li&gt;
&lt;li&gt;Layout.beforeTabSelect&lt;/li&gt;
&lt;li&gt;Layout.afterTabSelect&lt;/li&gt;
&lt;li&gt;Layout.beforeTabDisable&lt;/li&gt;
&lt;li&gt;Layout.afterTabDisable&lt;/li&gt;
&lt;li&gt;Layout.beforeTabEnable&lt;/li&gt;
&lt;li&gt;Layout.afterTabEnable&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;What is usefull is that these events will always be usable in the same way not depending by the the tag concrete implementation. So If I need to listen to a window hide event and I have choosed the ext implementation I can use both the following syntax:&lt;/p&gt;




&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="javascript"&gt;&lt;span class="nx"&gt;Railo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Events&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;subscribe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;callback&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Window.beforeHide&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;//or&lt;/span&gt;
&lt;span class="nx"&gt;Railo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getWindowObject&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;mywin&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;addListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;beforeclose&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;callback&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;The RailoLayout.js package has already been rewritten with the default jquery implementation.&lt;/p&gt;


&lt;p&gt;Version 0.5.2 will allow ui tags to receive an options arguments called 'args'. This struct will be converted into json and pushed into the implementation init method. In this way any config defined by the jquery or ext apis will become available. I am also working on a start for cfmap implementation.  &lt;/p&gt;


&lt;p&gt; &lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Cf Event Manager 1.0</title>
   <link href="http://andreacfm.com/2009/10/25/cf-event-manager-1-0" />
   <updated>2009-10-25T00:00:00-07:00</updated>
   <id>http://andreacfm.com/2009/10/25/cf-event-manager-1-0</id>
   <content type="html">&lt;p&gt;After more than 1 year of testing I have finally reached a stable version of a feature I use since long time.&lt;/p&gt;


&lt;p&gt;  &lt;p&gt;A previous version released on riaforge 6 months ago has been completely rewritten and extended.&lt;/p&gt;  ### Who Em is for??  &lt;ul&gt;   &lt;li&gt;Developers interested in developing cfml using an events based programming paradigm in the every day coding practice&amp;#160; (not only inside an MVC like model glue or coldbox). &lt;/li&gt;    &lt;li&gt;Anyone interested in making his own applications extensibles.&lt;/li&gt;    &lt;li&gt;Developers looking for a base framework to build on.&lt;/li&gt; &lt;/ul&gt;  ### Is Em an MVC framework ??  &lt;p&gt;No, EM is about events. &lt;/p&gt;  &lt;p&gt;Almost any application is based on events so EM can be the base of almost any cfml application or framework you want to build.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;A dedicated site has been created&amp;#160;&amp;#160; &lt;a href="http://cfeventmanager.com"&gt;http://cfeventmanager.com&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;Tickets, Road Map and Docs ( actually 60% ) can be found at&amp;#160; &lt;a href="http://trac.cfeventmanager.com"&gt;http://trac.cfeventmanager.com&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Please have a look and let me have your feedbacks. A demo site is included in the downlaod package or is visible on the site.&lt;/p&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Railo Projects</title>
   <link href="http://andreacfm.com/2009/10/22/railo-projects" />
   <updated>2009-10-22T00:00:00-07:00</updated>
   <id>http://andreacfm.com/2009/10/22/railo-projects</id>
   <content type="html">&lt;p&gt;I have just finished to move RailoAjax project to the new, and final location, into the brand new space Railo is creating for supporting OS projects.&lt;/p&gt;


&lt;p&gt;  &lt;p&gt;Site is now visible at &lt;a title="http://projects.getrailo.org/projects/railoajax/" href="http://projects.getrailo.org/projects/railoajax/"&gt;http://projects.getrailo.org/projects/railoajax/&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Svn has been migrated and can be found at &lt;a title="http://projects.getrailo.org/projects/railoajax/" href="http://svn.getrailo.org/svn/railoajax/"&gt;http://svn.getrailo.org/svn/railoajax/&lt;/a&gt;&amp;#160; ( checkout as guest/guest)&lt;/p&gt;  &lt;p&gt;Trac install&amp;#160; &lt;a title="http://projects.getrailo.org/projects/railoajax/" href="http://getrailo.org/trac/railoajax/"&gt;http://getrailo.org/trac/railoajax/&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;If you have a started project related to Railo or an idea you and you need support on your development please visit :&lt;/p&gt;  ### http://projects.getrailo.org  &lt;p&gt;or drop me a line. &lt;/p&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Templating in jQuery with jTemplates</title>
   <link href="http://andreacfm.com/2009/10/15/templating-in-jquery-with-jtemplates" />
   <updated>2009-10-15T00:00:00-07:00</updated>
   <id>http://andreacfm.com/2009/10/15/templating-in-jquery-with-jtemplates</id>
   <content type="html">&lt;p&gt;I am working in these days on the front side of an application that need to manage a huge amount of data pushed in JSON format. &lt;/p&gt;


&lt;p&gt;  &lt;p&gt;These datas are not needed to be analyzed or filtered. &lt;/p&gt;  &lt;p&gt;What I&amp;#160; need is to be able to display info ( coming in a unique set of data )&amp;#160; in many different part of the page using quite complex html generated by many conditional statements. Of course I need to be able to refresh the different areas individually. &lt;/p&gt;  &lt;p&gt;I have used in the past spry or ext in these case but I always considered both oversized for this job, at the end the dataset has not to be manipulated. &lt;/p&gt;  &lt;p&gt;I have then found a very powerfull solutions in &lt;a href="http://jtemplates.tpython.com/" target="_blank"&gt;jTemplates&lt;/a&gt;. This is a wonderfull templating tool that can be used as jquery plugin or in plain js. Between the features available :&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;conditional statements&lt;/li&gt;    &lt;li&gt;looping&lt;/li&gt;    &lt;li&gt;parameters&lt;/li&gt;    &lt;li&gt;nested templates&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Performance are very good. Have a try I really recommend this. &lt;/p&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Railo Ajax 0.5.1.4</title>
   <link href="http://andreacfm.com/2009/10/08/railo-ajax-0-5-1-4" />
   <updated>2009-10-08T00:00:00-07:00</updated>
   <id>http://andreacfm.com/2009/10/08/railo-ajax-0-5-1-4</id>
   <content type="html">&lt;p&gt;This version of &lt;a href="http://railoajax.org" target="_blank"&gt;RailoAjax&lt;/a&gt; starts the support of functions not strictly related to a tag or to a UI object like tabs or windows. &lt;/p&gt;


&lt;p&gt;Firsts functions to be supported are:&lt;/p&gt;


&lt;p&gt;&lt;strong&gt;Railo.Ajax.submitForm&lt;br /&gt;(formId,url,callbackhandler[,errorhandler,httpMethod,asynch,returnFormat,beforeSend])&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;You can use this fucntions to ask a form to be ajax submitted at any time with no need to trigger the submit event.&lt;/p&gt;


&lt;p&gt;&lt;strong&gt;Railo.Ajax.ajaxForm&lt;br /&gt;(formId[,target,callbackhandler,errorhandler,returnFormat,beforeSend])&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;This function is used to configure a form to be submitted in ajax mode. The main difference with the previous one is that in this case the form will be submitted in ajax mode in any case, and not only when invoked by the function itself.&lt;/p&gt;


&lt;p&gt;Railo.Ajax.navigate is on development stage.&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>ColdFusion 9 is out</title>
   <link href="http://andreacfm.com/2009/10/05/coldfusion-9-is-out" />
   <updated>2009-10-05T00:00:00-07:00</updated>
   <id>http://andreacfm.com/2009/10/05/coldfusion-9-is-out</id>
   <content type="html">&lt;p&gt;I was expecting the release for Max but this morning I found the new CF9 available for download from Adobe Web Site.&lt;/p&gt;


&lt;p&gt;  &lt;p&gt;Many intersting news respect to cf8 are availble :&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Orm Support&lt;/li&gt;    &lt;li&gt;Cfspreadsheet&lt;/li&gt;    &lt;li&gt;Caching&lt;/li&gt;    &lt;li&gt;Exposing of services like mailing, pdf manipulation etc….&lt;/li&gt;    &lt;li&gt;Many more….&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;A lot of job will start now to test, on official release finally, all the new possibilities that cf9 ships.&lt;/p&gt;  &lt;p&gt;Good job!&lt;/p&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>RailoAjax.org</title>
   <link href="http://andreacfm.com/2009/10/03/railoajax-org" />
   <updated>2009-10-03T00:00:00-07:00</updated>
   <id>http://andreacfm.com/2009/10/03/railoajax-org</id>
   <content type="html">&lt;p&gt;The RailoAjax project has finally arrived to his own location.&lt;/p&gt;


&lt;p&gt;  &lt;p&gt;&lt;a href="http://railoajax.org" target="_blank"&gt;RailoAjax.org&lt;/a&gt; is a the home site that will show news, guides to get started and will be updated with any usefull information about releases, road map, tutotials etc…&lt;/p&gt;  &lt;p&gt;The documentation part has been moved into a dedicated Trac Install that can be found at &lt;a href="http://docs.railoajax.org"&gt;http://docs.railoajax.org&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;The Trac install will be used for:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Docs in wiki format &lt;/li&gt;    &lt;li&gt;Tickets &lt;/li&gt;    &lt;li&gt;Milestones and road map &lt;/li&gt;    &lt;li&gt;Svn Browse &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;A new extension provider has been created and is already available:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://railoajax.org/provider.cfc"&gt;http://railoajax.org/provider.cfc&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Use the Railo’s google group list for posting any related question or contact me at : &lt;a href="mailto:andrea@railoajax.org"&gt;andrea@railoajax.org&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;The spece on assembla site will be closed in teh next days.&lt;/p&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>RailoAjax core is jquery free.</title>
   <link href="http://andreacfm.com/2009/09/18/railoajax-core-is-jquery-free" />
   <updated>2009-09-18T00:00:00-07:00</updated>
   <id>http://andreacfm.com/2009/09/18/railoajax-core-is-jquery-free</id>
   <content type="html">&lt;p&gt;To make library lighter, especially for core usage, I have removed the jQuery dependency from the core RailoAjax library. What does this mean ??&lt;/p&gt;


&lt;p&gt;Core tags like cfajacproxy or cfdiv do not use any UI lib and they rely on the lonely RailoAjax library. Up to version 0.5.1 some task like binding and xhr calls where made with the jQuery help and we were forced to load jQuery in any page.&lt;/p&gt;


&lt;p&gt;From version 0.5.1.1 ( already available ) RailoAjax is free from jquery dependency:&lt;/p&gt;


&lt;h3&gt;XHR&lt;/h3&gt;

&lt;p&gt;You can now use RailoAjax as a XHR utility:&lt;/p&gt;




&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="js"&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Railo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;XHR&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;br&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;request&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;br&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;br&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;success&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="p"&gt;....&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;br&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;});&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;br&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;&lt;/p&gt;&lt;/p&gt;

&lt;h3&gt;DOM Events&lt;/h3&gt;

&lt;p&gt;Dom event binding can be added like this:&lt;/p&gt;




&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="js"&gt;&lt;span class="nx"&gt;Railo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Util&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;addEvent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;dom&lt;/span&gt; &lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;callback&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;&lt;a href="http://sizzlejs.com/" target="_blank"&gt;&lt;img style="border: 0; margin-top: 0px; margin-bottom: 0px; float: left; margin-left: 10px; margin-right: 10px;" src="/assets/content//logos/sizzle.png" alt="" width="180" height="131" /&gt;&lt;/a&gt;Btw I decide to keep one dependency in RailoAjax that is &lt;a href="http://sizzlejs.com/" target="_blank"&gt;Sizzle.js&lt;/a&gt;. &lt;/p&gt;


&lt;p&gt;Sizzle is the most powerfull selector engine out there. Sizzle is fast, flexible and come from jQuery core.&lt;/p&gt;


&lt;p&gt;Check out docs if you like. &lt;/p&gt;


&lt;p&gt;You can use sizzle just as you were used to use jQuery selector:&lt;/p&gt;




&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="js"&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;element&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Sizzle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;#myId&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="err"&gt;/p&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;Of course Sizzle return array of dom elements and not jQuery Objects.&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Railo Ajax 0.5.1</title>
   <link href="http://andreacfm.com/2009/09/13/railo-ajax-0-5-1" />
   <updated>2009-09-13T00:00:00-07:00</updated>
   <id>http://andreacfm.com/2009/09/13/railo-ajax-0-5-1</id>
   <content type="html">&lt;p&gt;&lt;img style="border: 0pt none; margin: 5px 10px; float: left;" src="/images/posts/railoajax.jpg" alt="" width="161" height="167" /&gt;RailoAjax 0.5.1 has been released.&lt;/p&gt;


&lt;p&gt;This update added the initial support for cflayout and in particular for the tab type. Over the cf8 compatibility I am trying to add more things like e deeper callback support and some extra functionalities from tje jquery UI library.&lt;/p&gt;


&lt;p&gt;You can update from Railo Admin ( if you already installed the extension ) or install from these 2 extensions providers:&lt;/p&gt;


&lt;p&gt;&lt;a rel="nofollow" href="http://www.andreacfm.com/railoEx/andreacfm.cfc" target="_blank"&gt;http://www.andreacfm.com/railoEx/andreacfm.cfc&lt;/a&gt;
&lt;br /&gt; or
&lt;br /&gt; &lt;a rel="nofollow" href="http://preview.getrailo.org/ExtensionProvider.cfc" target="_blank"&gt;http://preview.getrailo.org/ExtensionProvider.cfc&lt;/a&gt; ( this will be
&lt;br /&gt; updated tomorrow - monday 14 during the day).&lt;/p&gt;


&lt;p&gt;Let me have your feedback and wishlist for the next project ehhancement.&lt;/p&gt;


&lt;p&gt; &lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Railo Ajax 0.5.0.3</title>
   <link href="http://andreacfm.com/2009/09/07/railo-ajax-0-5-0-3" />
   <updated>2009-09-07T00:00:00-07:00</updated>
   <id>http://andreacfm.com/2009/09/07/railo-ajax-0-5-0-3</id>
   <content type="html">&lt;p&gt;I have just updated the RailoAjax extension provider with the new release. Many bugs have been fixed and a started cflayout ( just for tab up to now ) has been added to the demo page. Please let me have yur feedbacks, bugs, suggestions etc...&lt;/p&gt;


&lt;p&gt;You can grab a copy from svn repository or use the following extension provider:&lt;/p&gt;


&lt;p&gt;&lt;a href="http://code.assembla.com/railoAjaxProxy/subversion/nodes"&gt;Svn&lt;/a&gt;&lt;/p&gt;


&lt;p&gt;&lt;strong&gt;AndreaCfm Extension Provider&lt;/strong&gt; : &lt;em&gt;http://www.andreacfm.com/railoEx/andreacfm.cfc&lt;/em&gt;&lt;/p&gt;


&lt;p&gt;&lt;strong&gt;&lt;strong&gt;From Railo preview server&lt;/strong&gt;&lt;/strong&gt;&lt;em&gt;&lt;strong&gt; : &lt;/strong&gt;http://preview.getrailo.org/ExtensionProvider.cfc &lt;br /&gt;&lt;/em&gt;&lt;/p&gt;


&lt;h3&gt;Change log:&lt;/h3&gt;

&lt;p&gt;0.5.0.3&lt;br /&gt;-------------------------------&lt;br /&gt;* Cflayout-tab binding.&lt;br /&gt;* Added support for tab add,hide,remove.&lt;br /&gt;* Support for tab custom styling. &lt;br /&gt;* Defined demo structure&lt;br /&gt;* Bug fixing.&lt;br /&gt;* Started docs in wiki.getrailo.org.&lt;br /&gt;&lt;br /&gt;0.5.0.2&lt;br /&gt;-------------------------------&lt;br /&gt;* Added cflayout tab initial support.&lt;br /&gt;&lt;br /&gt;0.5.0.1&lt;br /&gt;-------------------------------&lt;br /&gt;* New examples in demo pages.&lt;br /&gt;* Support for context root deployment.&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Railo Ajax Extension Provider</title>
   <link href="http://andreacfm.com/2009/08/29/railo-ajax-extension-provider" />
   <updated>2009-08-29T00:00:00-07:00</updated>
   <id>http://andreacfm.com/2009/08/29/railo-ajax-extension-provider</id>
   <content type="html">&lt;p&gt;I have created a Railo extension provider from my website. For the moment the only application you can install is the Railo Ajax Project that is also available from the &lt;strong&gt;&lt;em&gt;http://preview.getrailo.org/ExtensionProvider.cfc&lt;/em&gt;&lt;/strong&gt; provider. &lt;/p&gt;


&lt;p&gt;So now you have more choice... and I had the occasion to go deeper into railo extensions programming...&lt;/p&gt;


&lt;p&gt;Just add this url in the providers list of your Railo Admin ( server or web ) :&lt;/p&gt;


&lt;p&gt;&lt;em&gt;&lt;strong&gt;http://www.andreacfm.com/railoEx/andreacfm.cfc&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;


&lt;p&gt;Verify the provider and then you will find the Railo Ajax application available in the applications list. Run the install thread that will also install some demo into yoru webroot.&lt;/p&gt;


&lt;p&gt;IMPORTANT:&lt;/p&gt;


&lt;p&gt;&lt;em&gt;If you have already installed the extension from the &lt;/em&gt;http://preview.getrailo.org/ExtensionProvider.cfc &lt;em&gt;provider stay with that. I will update both the providers with new versions at the same time but as the providers are different and the extension have the same id some conflict is possible. Just choose one provider.&lt;/em&gt;&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Railo Ajax Extension 0.5 now available from Railo Admin</title>
   <link href="http://andreacfm.com/2009/08/27/railo-ajax-extension-0-5-now-available-from-railo-admin" />
   <updated>2009-08-27T00:00:00-07:00</updated>
   <id>http://andreacfm.com/2009/08/27/railo-ajax-extension-0-5-now-available-from-railo-admin</id>
   <content type="html">&lt;p&gt;&lt;img style="border: 0; float: left; margin-left: 10px; margin-right: 10px; margin-top: 5px; margin-bottom: 5px;" src="/images/posts/railoajax.jpg" alt="" width="172" height="180" /&gt;&lt;/p&gt;


&lt;p&gt;Some moths ago I started to work on a project to create Railo support for ajax tags. The idea was to implement CfAjaxProxy using the new custom tag based on cfc format that Railo makes available.&lt;/p&gt;


&lt;p&gt;We decided to use &lt;a href="http://jquery.com/" target="_blank"&gt;jQuery&lt;/a&gt; &lt;a href="http://www.jquery.com/" target="_blank"&gt;&lt;/a&gt;as library to work on. I have a good feeling with it and we kept the door opened also for UI tags implementation. Things went quite well and I am particulary happy of the Bind system that manage cfc/url and javascript bindings.&lt;/p&gt;


&lt;p&gt;I have also added support for &lt;strong&gt;cfdiv&lt;/strong&gt; and for testing purposes also of &lt;strong&gt;cfwindow&lt;/strong&gt; and cfajaximport ( this is really more as internal use for now ). Installing the Railo Ajax Extension you will also have the option to install a demo page that I will make more explicative in the next days. New examples, comments and notes are on the way.&lt;/p&gt;


&lt;p&gt;You can find install isntructions &lt;a href="http://www.railo.ch/blog/index.cfm/2009/8/27/Railo--AJAX-Tags" target="_blank"&gt;here&lt;/a&gt; while project is actually hosted &lt;a href="http://www.assembla.com/wiki/show/ayq2o8uq0r3PTOeJe5aVNr" target="_blank"&gt;here&lt;/a&gt;. Please use assembla site for tickects and any other support needs. You can also post on the &lt;a href="http://groups.google.com/group/railo-beta" target="_self"&gt;railobeta&lt;/a&gt; Google Group.&lt;/p&gt;


&lt;p&gt;A special thanks to the Gert that hepled me a lot in writing the Railo Extension ( a post/tutorial is on the way ).&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Railo 3.1.1 Released</title>
   <link href="http://andreacfm.com/2009/08/12/railo-3-1-1-released" />
   <updated>2009-08-12T00:00:00-07:00</updated>
   <id>http://andreacfm.com/2009/08/12/railo-3-1-1-released</id>
   <content type="html">&lt;p&gt;&lt;img style="border: 0pt none; margin-left: 10px; margin-right: 10px; float: left;" src="/images/posts/railo.gif" alt="" width="82" height="52" /&gt; As expected in the community Railo 3.1.1 has been released for cfunited. &lt;/p&gt;


&lt;p&gt;At the moment there is no official post by the team but my Railo has updated to version 3.1.1 right now so I guess .... here we are.&lt;/p&gt;


&lt;p&gt;Over the usual bug fixing ( Railo users are used to get bug fixing very fast ....... think about that.....)  this release is important cause is the first stable release after that Railo choosed the OS way. Since some month now I am using Railo as my only cfml engine and I take this occasion to say thanks to Gert, Micheal and all the team for the good work! &lt;/p&gt;


&lt;p&gt;You can download Railo &lt;a href="http://www.getrailo.org/index.cfm/download/" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Fusion Debug 3.0</title>
   <link href="http://andreacfm.com/2009/08/12/fusion-debug-3-0" />
   <updated>2009-08-12T00:00:00-07:00</updated>
   <id>http://andreacfm.com/2009/08/12/fusion-debug-3-0</id>
   <content type="html">&lt;p&gt;As I blogged in the past I am a fusion debug user and I was waiting the new release that also cover Railo 3.1 as debuggable cfml engine. Here more informations about the new fusion debug release:&lt;/p&gt;


&lt;p&gt;&lt;strong&gt;New features included in FusionDebug 3.0&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;Full support for Railo 3.1 Open Source / Enterprise&lt;br /&gt;Conditional Breakpoints&lt;br /&gt;Break on Runtime Exceptions&lt;br /&gt;Run To Line&lt;br /&gt;Custom Extensions&lt;br /&gt;&lt;br /&gt;Detailed Feature Focus: http://www.fusion-reactor.com/fd/featurefocus/&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Quick Links&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Download: http://www.fusion-reactor.com/fd/downloads.cfm&lt;br /&gt;Upgrade: http://www.fusion-reactor.com/fd/upgrade.cfm&lt;br /&gt;Buy: http://www.fusion-reactor.com/fd/buy.cfm&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Other Sources&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Fusion Newsletter: http://www.fusion-reactor.com/newsletter/August2009.cfm&lt;br /&gt;Press Release: http://www.prweb.com/releases/2009/08/prweb2733124.htm&lt;br /&gt;&lt;/p&gt;


&lt;p&gt; &lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>SwfObject Mango Plugin Released</title>
   <link href="http://andreacfm.com/2009/08/09/swfobject-mango-plugin-released" />
   <updated>2009-08-09T00:00:00-07:00</updated>
   <id>http://andreacfm.com/2009/08/09/swfobject-mango-plugin-released</id>
   <content type="html">&lt;p&gt;Again I was amazed of how easy is creating a plugin for Mango blog platform. &lt;/p&gt;


&lt;p&gt;I needed to load swfobject library in any page and I made up a plugin to add this functionality to my mango installation. &lt;/p&gt;


&lt;p&gt;Plugin is very easy and once activated just load swfobject 2.2 on any page for use of any other code or plugin. Here you can get it!&lt;/p&gt;


&lt;p&gt; &lt;/p&gt;


&lt;p&gt;&lt;img style="float: left; border: 0; margin-left: 10px; margin-right: 10px;" src="/assets/content//icons/download.png" alt="" width="90" height="90" /&gt;&lt;/p&gt;


&lt;p&gt;&lt;strong&gt;Last Version&lt;/strong&gt; : 2.2&lt;br /&gt;&lt;strong&gt;Require :&lt;/strong&gt; Mango 1.3+&lt;br /&gt;&lt;strong&gt;Auto Install Url :&lt;/strong&gt; &lt;a href="http://mangoswfobject.riaforge.org/index.cfm?event=action.download" target="_blank"&gt;http://mangoswfobject.riaforge.org/index.cfm?event=action.download&lt;/a&gt;&lt;/p&gt;


&lt;p&gt; &lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>EventManager Vol 1</title>
   <link href="http://andreacfm.com/2009/07/12/eventmanager-vol-1" />
   <updated>2009-07-12T00:00:00-07:00</updated>
   <id>http://andreacfm.com/2009/07/12/eventmanager-vol-1</id>
   <content type="html">&lt;p&gt;I start today a series of post on the usage and documentation of my EventManager for coldfusion. &lt;a href="http://www.assembla.com/wiki/show/cfEventManager/bwB6IEtdar3QLXeJe5afGb" target="_blank"&gt;You can find more docs and svn code here.&lt;/a&gt;&lt;/p&gt;


&lt;h3&gt;Initialize The EventManager&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;EventManager is done to work standalone or to be easily integrated with Coldspring. Both examples will be provided.&lt;/em&gt;&lt;/p&gt;


&lt;h3&gt;Standalone&lt;/h3&gt;

&lt;p&gt;&lt;code class="coldfusion"&gt;&lt;br /&gt;&lt;!--- normally saved as singletone on application start ---&gt;&lt;br /&gt;&lt;cfset application.em = craeteObject('component','EventManager.EventManager').init() /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/p&gt;
&lt;h3&gt;&lt;em&gt;Init( Events:Array , Listeners:Array , XmlPath:String , AutowireEvents:Boolean , Debug:Boolean , Scope:String )&lt;/em&gt;&lt;/h3&gt;
&lt;p&gt;The init method takes the following arguments.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Events:Array - default arrayNew(1) - Array of structs representing the events to register.&lt;/li&gt;
&lt;li&gt;Listeners:Array - default arrayNew(1) - Array of structs representing the listeners to register.&lt;/li&gt;
&lt;li&gt;XmlPath:String - default "" - Relative Path to an xml file containing events and listeners to be registered.&lt;/li&gt;
&lt;li&gt;AutowireEvents:Boolean - default false - If true any event create for being dispatched is autowired using beanInjector.&lt;/li&gt;
&lt;li&gt;Debug:Boolean - default false - If true force Em to save a trace of any operation executed.&lt;/li&gt;
&lt;li&gt;Scope:String - default 'request' -  Says to Em how to save the tracing info if debug mode is true. &lt;em&gt;Request&lt;/em&gt; use the request scope and clean up the trace memory any time the request die. &lt;em&gt;Instance&lt;/em&gt; persists the informations into the EventManager instance itself.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;code class="coldfusion"&gt;&lt;!--- events array ---&gt;&lt;br /&gt;&lt;cfset events = arrayNew(1) /&gt;&lt;br /&gt;&lt;!--- events  ---&gt;    &lt;br /&gt;&lt;cfset event = structNew() /&gt;&lt;br /&gt;&lt;cfset event.name = 'myevent' /&gt;&lt;br /&gt;&lt;cfset event.type = 'evapp.events.myevent' /&gt;&lt;br /&gt;.....add more events....&lt;br /&gt;&lt;br /&gt;&lt;!--- listeners array ---&gt;    &lt;br /&gt;&lt;cfset listeners = arrayNew(1) /&gt;&lt;br /&gt;&lt;!--- listener  ---&gt;   &lt;br /&gt;&lt;cfset listener = structNew() /&gt;&lt;br /&gt;&lt;cfset listener.event = 'myevent' /&gt;&lt;br /&gt;&lt;cfset listener.listener = 'evapp.listeners.mylistener' /&gt;&lt;br /&gt;&lt;cfset listener.method = 'manageData' /&gt;&lt;br /&gt;&lt;cfset listener.priority = 10 /&gt;&lt;br /&gt;&lt;cfset listener.initMehod = 'setUp' /&gt;&lt;br /&gt;&lt;cfset listener.cache = true /&gt;&lt;br /&gt;.....add more listeners....&lt;br /&gt;&lt;br /&gt;&lt;cfset eventManager = createObject('component','EventManager.EventManager')&lt;br /&gt;.init(events,listeners) /&gt;&lt;/code&gt;&lt;/p&gt;
### Xml Syntax via xmlPath
&lt;p&gt;You can setUp your events/listeners using xml notation. The xmlPath
argument you can pass to init mode represent the relative path to the
xml config file.
&lt;/p&gt;
&lt;p&gt;&lt;code class="coldfusion"&gt;&lt;cfset eventManager = createObject('component','EventManager.EventManager')&lt;br /&gt;.init(xmlPath='/myapp/config/eventmanager.xml') /&gt; &lt;/code&gt;&lt;/p&gt;
&lt;p&gt;In init method using the xmlPath
attribute will not overwrite or stop the eventManager from loading
arrays of events and listeners if provided.&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="html"&gt;&lt;span class="nt"&gt;&amp;lt;code&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;coldfusion&amp;quot;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;cfset&lt;/span&gt; &lt;span class="na"&gt;eventManager =&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt;&lt;span class="s"&gt;createObject(&amp;#39;component&amp;#39;,&amp;#39;EventManager.EventManager&amp;#39;)&amp;lt;br&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;.init(events,listeners,&amp;#39;/myapp/config/eventmanager.xml&amp;#39;) /&amp;gt; &lt;span class="nt"&gt;&amp;lt;br&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The previuos example will load all the events from array and xml and
then will register listeners from array and from the xml too.&lt;/p&gt;
&lt;p&gt;See &lt;a href="http://www.assembla.com/wiki/show/cfEventManager/xml" target="_blank"&gt;xml for schema details&lt;/a&gt;. In teh resource folder are present both .dtd and .xsd to validate your xml.&lt;/p&gt;
###
Coldspring Tip
&lt;p&gt;If laoded via coldspring you can use the great syntax tool to create arrays and struct from xml that coldpring shipd for free&lt;/p&gt;
&lt;p&gt;
&lt;code class="xml"&gt;&lt;bean id="Events" class="coldspring.beans.factory.config.ListFactoryBean"&gt;&lt;br /&gt;
&lt;property name="sourceList"&gt;
&lt;list&gt;&lt;br /&gt;
&lt;map&gt;&lt;br /&gt;
&lt;entry key="name"&gt;&lt;br /&gt;
&lt;value&gt;myEvent&lt;/value&gt;&lt;br /&gt;
&lt;/entry&gt;&lt;br /&gt;
&lt;entry key="type"&gt;&lt;br /&gt;
&lt;value&gt;EventManager.Event&lt;/value&gt;&lt;br /&gt;
&lt;/entry&gt;&lt;br /&gt;
&lt;/map&gt;&lt;br /&gt;
....... more events here ...
&lt;br /&gt;
&lt;/list&gt;
&lt;br /&gt;
&lt;/property&gt;
&lt;br /&gt;&lt;/bean&gt;
&lt;br /&gt;&lt;bean id="Listeners" class="coldspring.beans.factory.config.ListFactoryBean"&gt;&lt;br /&gt;
&lt;property name="sourceList"&gt;
&lt;br /&gt;
&lt;list&gt;&lt;br /&gt;
&lt;map&gt;&lt;br /&gt;
&lt;entry key="event"&gt;&lt;br /&gt;
&lt;value&gt;myEvent&lt;/value&gt;&lt;br /&gt;
&lt;/entry&gt;&lt;br /&gt;
&lt;entry key="listener"&gt;&lt;br /&gt;
&lt;value&gt;evapp.listeners.mylistener&lt;/value&gt;&lt;br /&gt;
or&lt;br /&gt;
&lt;bean ref="listenerBeanID"/&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/entry&gt;&lt;br /&gt;
&lt;entry key="method"&gt;&lt;br /&gt;
&lt;value&gt;methodToFire&lt;/value&gt;&lt;br /&gt;
&lt;/entry&gt;&lt;br /&gt;
&lt;/map&gt;&lt;br /&gt;
.................... more listeners &lt;br /&gt;
&lt;/list&gt;&lt;br /&gt;
&lt;/property&gt;&lt;br /&gt;
&lt;/bean&gt;     &lt;br /&gt;
&lt;bean id="eventManager" class="EventManager.EventManager" lazy-init="false"&gt;&lt;br /&gt;
&lt;constructor-arg name="events"&gt;&lt;br /&gt;
&lt;ref bean="Events"/&gt;&lt;br /&gt;
&lt;/constructor-arg&gt;&lt;br /&gt;
&lt;/bean&gt;&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Fusion Debug available for Railo </title>
   <link href="http://andreacfm.com/2009/07/09/railo-fusion-debug" />
   <updated>2009-07-09T00:00:00-07:00</updated>
   <id>http://andreacfm.com/2009/07/09/railo-fusion-debug</id>
   <content type="html">&lt;p&gt;&lt;img style="float: left; border: 0; margin-left: 10px; margin-right: 10px;" src="/assets/content//logos/logofd.png.png" alt="" width="178" height="60" /&gt;One of the lack in the Railo world was the availability of an inline debugger. I always use fusion debug or internal cf inline debugger when using abode cf and sometimes I felt the lack of that developing with Railo.&lt;/p&gt;


&lt;p&gt;The good news is that a railo compliant version of &lt;a href="http://www.fusion-reactor.com/" target="_blank"&gt;Fusion Debug&lt;/a&gt; will be available very very soon ( the public beta programm has just finished some week ago ). I had the opportunity to test the beta product and was working just fine as I expected it. &lt;/p&gt;


&lt;p&gt;The functionalities are great and basically the same of the Fusion Debug version for coldfusion. Installation gave me some trouble that I easily solved on the &lt;a href="http://groups.google.com/group/fusiondebug3beta" target="_blank"&gt;google groups&lt;/a&gt; that the guys of Integral setted up to support .  &lt;/p&gt;


&lt;p&gt;As far as I know the&lt;a href="http://www.getrailo.com/index.cfm/products/railo-bundles/railo-enterprise-bundle/" target="_blank"&gt; enterprise Railo&lt;/a&gt; edition will include a license of both Reactor and Debug products. I am a Fusion Debug license owner but I am not sure if the Railo product will need a license update or not. I am waiting the product release in the next weeks to check it. &lt;/p&gt;


&lt;p&gt;In conclusion I think that having an inline debugger available make Railo even more a robust solution.&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Cf Event Manager</title>
   <link href="http://andreacfm.com/2009/06/05/cf-event-manager" />
   <updated>2009-06-05T00:00:00-07:00</updated>
   <id>http://andreacfm.com/2009/06/05/cf-event-manager</id>
   <content type="html">&lt;p&gt;I have now released a first version of a tool that I am implementing and using since a while.&lt;/p&gt;


&lt;p&gt;CfEventManager is exactly what the word say. An EventManager tool for cfml programming.&lt;br /&gt;Some of the features:&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;Very light with a simple API to use/implement.&lt;/li&gt;
&lt;li&gt;Flexible to allow registering of events / listeners from cfml syntax, xml file and programmatically on runtime.&lt;/li&gt;
&lt;li&gt;Ability to cache the listeners objects.&lt;/li&gt;
&lt;li&gt;Use the built in event object or create your own in few easy steps.&lt;/li&gt;
&lt;li&gt;Ability ti stop event propagation.&lt;/li&gt;
&lt;li&gt;Order the listeners with a customized priority order.&lt;/li&gt;
&lt;li&gt;Autowire events object via coldspring by using the Brian Koteks beanInjector class.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;On next releases to 1.0:&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;Dispatching of async events.&lt;/li&gt;
&lt;li&gt;addEventListener based on regex match.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&lt;a href="http://code.assembla.com/cfEventManager/subversion/nodes" target="_blank"&gt;Download and Svn&lt;br /&gt;&lt;br /&gt;&lt;/a&gt;&lt;a href="http://www.assembla.com/wiki/show/bwB6IEtdar3QLXeJe5afGb" target="_blank"&gt;Docs ( not completed yet )&lt;br /&gt;&lt;/a&gt;&lt;/p&gt;


&lt;p&gt;&lt;a href="http://www.andreacfm.com/page.cfm/open-source/cf-event-manager" target="_blank"&gt;Project Page on this Blog&lt;/a&gt;&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>First step on CentOs</title>
   <link href="http://andreacfm.com/2009/04/30/first-step-on-centos" />
   <updated>2009-04-30T00:00:00-07:00</updated>
   <id>http://andreacfm.com/2009/04/30/first-step-on-centos</id>
   <content type="html">&lt;p&gt;&lt;img style="float: left; border: 0; margin: 10px;" src="/images/posts/centos_icon_60.png" alt="" width="63" height="60" /&gt;After deciding to move to &lt;a href="http://www.getrailo.org" target="_blank"&gt;Railo &lt;/a&gt;I get curious about OS systems and I am trying to set up a test environment using &lt;a href="http://www.centos.org/" target="_blank"&gt;CentOs&lt;/a&gt; that looks like the best Enterprise linux distribution now available ( I am very new to linux world so I am possible completely wrong ).&lt;/p&gt;


&lt;p&gt;I installed centos 5.3 on a virtual machine and now ????? &lt;/p&gt;


&lt;p&gt;I will post my experience and newbie tips like:&lt;/p&gt;


&lt;p&gt;STARTING APACHE ON CENTOS&lt;/p&gt;


&lt;p&gt;&amp;lt;code class="coldfusion"&amp;gt;&lt;br /&gt;START APACHE&lt;br /&gt;/sbin/service httpd start&lt;br /&gt;&lt;br /&gt;
RESTART APACHE&lt;br /&gt;
/sbin/service httpd restart&lt;br /&gt;&lt;br /&gt;
STOP APACHE&lt;br /&gt;
/sbin/service httpd stop&lt;br /&gt;&lt;br /&gt;
ALL THE OPTIONS&lt;br /&gt;
/sbin/service httpd&lt;br /&gt;#will output all the possible methods you can call on httpd service.
&amp;lt;/code&amp;gt;&lt;/p&gt;


&lt;p&gt;More newbie tips on CentOs, up to installing a development environment for railo, in the next future.&lt;/p&gt;


&lt;p&gt; &lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Text Ads Mango Plugin 0.1 </title>
   <link href="http://andreacfm.com/2009/04/20/text-ads-mango-plugin-0-1" />
   <updated>2009-04-20T00:00:00-07:00</updated>
   <id>http://andreacfm.com/2009/04/20/text-ads-mango-plugin-0-1</id>
   <content type="html">&lt;p&gt;I have now released the very first version of TextAds , a Mango plugin that enable the management and display of text ads on your mango installation.&lt;br /&gt;At this first stage plugin support just one provider planning to add more in the next future.&lt;br /&gt;Let me have your feedback.&lt;/p&gt;


&lt;p&gt;I am also interested in knowing which provider ( over adwords ) of text ads you are working with.&lt;/p&gt;


&lt;p&gt;&lt;img style="border: 0pt none; float: left; margin-left: 10px; margin-right: 10px;" src="/assets/content/icons/download.png" alt="" width="90" height="90" /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;&lt;strong&gt;Last Version&lt;/strong&gt; : 0.1&lt;br /&gt;&lt;strong&gt;Last Update&lt;/strong&gt; : 20 apr 2009&lt;br /&gt;&lt;strong&gt;Require :&lt;/strong&gt; Mango 1.3+&lt;br /&gt;&lt;strong&gt;Auto Install Url :&lt;/strong&gt; &lt;a href="/get/com.andreacfm.mango.textads.zip" target="_blank"&gt;http://andreacfm.com/get/com.andreacfm.mango.textads.zip&lt;/a&gt;&lt;/p&gt;


&lt;p&gt; &lt;/p&gt;


&lt;p&gt; &lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Speed up your eclipse</title>
   <link href="http://andreacfm.com/2009/04/07/speed-up-your-eclipse" />
   <updated>2009-04-07T00:00:00-07:00</updated>
   <id>http://andreacfm.com/2009/04/07/speed-up-your-eclipse</id>
   <content type="html">&lt;p&gt;&lt;img style="border: 0; float: left; margin: 10px;" src="/assets/content//logos/eclipse.png" alt="" width="171" height="91" /&gt;I think that any eclipse users has experimented  the fact that  eclipse tends to slow down. In the past I had to reinstall the whole environment especially after loading new plugins that was probably breaking something down. Btw I always followed as best practice to clen up eclipse any 6 months and I learned fast how to export preferences to be able to push them into the new install. In this way to pass to a new and clean eclipse install is quite painless.&lt;/p&gt;


&lt;p&gt;In the last period I tried to reduce the number of opened projects in my workspace to the really important ones, and I  also experimented the solution of mantaining many workspaces but I do not feel very compofortable with that. &lt;/p&gt;


&lt;p&gt;I then got the idea to check what kind of settings eclipse was passing to the jvm and blogging around I found a great post of &lt;a href="http://www.henke.ws/post.cfm/Turbo-charging-Eclipse" target="_blank"&gt;Mike Henke&lt;/a&gt;.&lt;/p&gt;


&lt;p&gt;I added the following arguments to my eclipse.ini file:&lt;/p&gt;


&lt;p&gt;&amp;lt;code class="coldfusion"&amp;gt;&lt;br /&gt;-vm &lt;br /&gt;C:Program FilesJavajre1.6.0_12injavaw.exe&lt;br /&gt;-vmargs&lt;br /&gt;-Xms512m&lt;br /&gt;-Xmx512m&lt;br /&gt;-XX:PermSize=128m&lt;br /&gt;-XX:MaxPermSize=128m&lt;br /&gt;-Xverify:none&amp;lt;/code&amp;gt;&lt;/p&gt;


&lt;p&gt;The vm path depends on what do you have available in your machine, but I suggest you to update at least to version 1.6 update 12. Be carefull do not leave extra white spaces and .... look your turbo eclipse start to fly...&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Railo 3.1 is out</title>
   <link href="http://andreacfm.com/2009/04/01/railo-3-1-is-out" />
   <updated>2009-04-01T00:00:00-07:00</updated>
   <id>http://andreacfm.com/2009/04/01/railo-3-1-is-out</id>
   <content type="html">&lt;p&gt;At the and arrived the day of the release of Railo 3.1. This is a milestone due to the fact that from this date Railo is officialy Open Source and most important joins a wide supported  project like Jboss.&lt;/p&gt;


&lt;p&gt;Many news that I think will make the fortune of Railo that I am starting to consider any day more like my choice for the future:&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;Brand new sites taht will be soon filled with news and docs ( &lt;a href="http://www.getrailo.com" target="_blank"&gt;getRailo.com&lt;/a&gt; and &lt;a href="http://www.getrailo.org" target="_blank"&gt;getRailo.org&lt;/a&gt; )&lt;/li&gt;
&lt;li&gt;Beta 3.1 version on Resin&lt;/li&gt;
&lt;li&gt;First experiment ( this is whant I am mostly interested in ) of jboss/railo installer on IIS7&lt;/li&gt;
&lt;li&gt;Railo will now have an extension manager connected to the website repository. There will be an api to give any developer the road to follow to write your own extensions and the place where to share them......I think this will be the key.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Good luck to railo and to the railo team!&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Running Mango on Railo. Preserve single quotes issue.</title>
   <link href="http://andreacfm.com/2009/03/10/running-mango-on-railo-preserve-single-quotes-issue" />
   <updated>2009-03-10T00:00:00-07:00</updated>
   <id>http://andreacfm.com/2009/03/10/running-mango-on-railo-preserve-single-quotes-issue</id>
   <content type="html">&lt;p&gt;&lt;img style="border: 0pt none; margin: 10px; float: left;" src="/images/posts/one_sweet_mangoblog_150x75a.png" alt="mango blog" width="150" height="75" /&gt;Trying mangoblog on my Railo installation I found at once a bug that invole the different way that railo and cf have to preserve the single quotes in sql syntax where the sql statement is represented by variables.&lt;/p&gt;


&lt;p&gt;Mango Blog use a class called QueryInterface where most of the query devoted to collect data ara executed and cached so to speed up teh next identical request.&lt;/p&gt;


&lt;p&gt;The used method is this:&lt;/p&gt;


&lt;p&gt;&amp;lt;code class="coldfusion"&amp;gt;&lt;/p&gt;


&lt;p&gt;&amp;lt;cffunction name="makeQuery" access="public" output="false" returntype="any"&amp;gt;        &lt;br /&gt;        &amp;lt;cfargument name="query" required="true" type="string"&amp;gt;&lt;br /&gt;        &amp;lt;cfargument name="cacheMinutes" required="false" type="numeric" default="-1"&amp;gt;&lt;br /&gt;        &amp;lt;cfargument name="returnResult" required="false" type="boolean" default="true"&amp;gt;&lt;br /&gt;        &lt;br /&gt;        &amp;lt;cfset var customQuery = queryNew('id')/&amp;gt;&lt;br /&gt;        &amp;lt;cfset var queryStatement = trim(arguments.query)&amp;gt;&lt;br /&gt;&lt;br /&gt;        &amp;lt;cfif arguments.cacheMinutes GT -1 AND arguments.returnResult&amp;gt;&lt;br /&gt;            &amp;lt;cfquery name="customQuery" datasource="#variables.datasource.name#"  username="#variables.datasource.username#" password="#variables.datasource.password#" cachedwithin="#createtimespan(0,0,arguments.cacheMinutes,0)#"&amp;gt;&lt;br /&gt;            #toString(queryStatement)#&lt;br /&gt;            &amp;lt;/cfquery&amp;gt;&lt;br /&gt;        &amp;lt;cfelse&amp;gt;&lt;br /&gt;            &amp;lt;cfquery name="customQuery" datasource="#variables.datasource.name#" username="#variables.datasource.username#" password="#variables.datasource.password#"&amp;gt;&lt;br /&gt;            #toString(queryStatement)#&lt;br /&gt;            &amp;lt;/cfquery&amp;gt;&lt;br /&gt;        &amp;lt;/cfif&amp;gt;&lt;br /&gt;        &lt;br /&gt;        &amp;lt;cfif arguments.returnResult&amp;gt;&lt;br /&gt;            &amp;lt;cfreturn customQuery /&amp;gt;&lt;br /&gt;        &amp;lt;/cfif&amp;gt;&lt;br /&gt;        &lt;br /&gt;    &amp;lt;/cffunction&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/code&amp;gt;&lt;/p&gt;


&lt;p&gt;As you see the sql syntax is represented by the variable queryStatement.&lt;/p&gt;


&lt;p&gt;To be sure that the essential sinqle quotes are preserved Railo add an psq attribute:&lt;/p&gt;


&lt;p&gt;&amp;lt;code class="coldfusion"&amp;gt;&lt;br /&gt;&amp;lt;cfquery name="q" datasource="dsn" psq="true"&amp;gt;&lt;br /&gt;.................&lt;/p&gt;


&lt;p&gt;&amp;lt;/code&amp;gt;&lt;/p&gt;


&lt;p&gt;Since from cf8 this code is accettable also in coldfusion due to the added ability to pass an argumentcollection to most of the tags where only the recognized attributes are evaluated while the others are skipped. &lt;/p&gt;


&lt;p&gt;But I didn't want to loose cf7 compatibility ( this will crash trying to evaluate the psq attributes )  so i tried to use, also for Railo ,the preserveSingleQuotes() function and surprise....is working just fine. Following Railo docs "psq" attributes should be the safest way but after about 2 weeks of runnign Mango with this change I am now convinced that preserveSingleQuotes() will server us ok in this case.&lt;/p&gt;


&lt;p&gt;&amp;lt;code class="coldfusion"&amp;gt;&amp;lt;cfif arguments.cacheMinutes GT -1 AND arguments.returnResult&amp;gt;&lt;br /&gt;            &amp;lt;cfquery name="customQuery" datasource="#variables.datasource.name#"  username="#variables.datasource.username#" password="#variables.datasource.password#" cachedwithin="#createtimespan(0,0,arguments.cacheMinutes,0)#"&amp;gt;&lt;br /&gt;            #preserveSingleQuotes(queryStatement)#&lt;br /&gt;            &amp;lt;/cfquery&amp;gt;&lt;br /&gt;        &amp;lt;cfelse&amp;gt;&lt;br /&gt;            &amp;lt;cfquery name="customQuery" datasource="#variables.datasource.name#" username="#variables.datasource.username#" password="#variables.datasource.password#"&amp;gt;&lt;br /&gt;            #preserveSingleQuotes(queryStatement)#&lt;br /&gt;            &amp;lt;/cfquery&amp;gt;&lt;br /&gt;        &amp;lt;/cfif&amp;gt;&lt;/p&gt;


&lt;p&gt;&amp;lt;/code&amp;gt;&lt;/p&gt;


&lt;p&gt;In this way we keep a full compaitbility from on cf7, cf8 and Railo too.&lt;/p&gt;


&lt;p&gt; &lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Jquery Ui 1.7</title>
   <link href="http://andreacfm.com/2009/03/06/jquery-ui-1-7" />
   <updated>2009-03-06T00:00:00-08:00</updated>
   <id>http://andreacfm.com/2009/03/06/jquery-ui-1-7</id>
   <content type="html">&lt;p&gt;&lt;img style="border: 0; float: left; margin: 10px;" src="/images/posts/jquery.gif" alt="jquery" width="132" height="132" /&gt;Has been released today &lt;a href="http://blog.jqueryui.com/2009/03/jquery-ui-17/" target="_blank"&gt;version 1.7 of jquery UI library&lt;/a&gt;. I  have never used it so much but from this realease i think that UI becomes a valid options.&lt;/p&gt;


&lt;p&gt;In my opinion the library has a big lack that is the fact that looks like the jquery team is not interested in developing also a data management tool to be use with the UI widgets but .... we can mix it with spry dataset or extjs stores.&lt;/p&gt;


&lt;p&gt;Some of the biggest news from the jquery blog:&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;
&lt;h4&gt;jQuery 1.3 compatibility&lt;/h4&gt;
&lt;p&gt;jQuery 1.7 is the first release that is compatible with jQuery 1.3.
That’s a good thing (if you can make the switch), since jQuery 1.3
brings major performance improvements to many areas of jQuery UI.
Specifically, firing events, DOM operations, and getting element
offsets have had massive performance improvements. &lt;a href="http://blog.jquery.com/2009/01/14/jquery-13-and-the-jquery-foundation/"&gt;More about the jQuery 1.3 release&lt;/a&gt;…
&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;h4&gt;Revamped and optimized plugins&lt;/h4&gt;
&lt;p&gt;In addition to a long list of bug fixes and improvements, we’ve
refactored and optimized each plugin to use the cleanest HTML possible,
with a flexible set of options to make it easy for developers to extend
and tweak widgets. We’ve also added a new &lt;a href="http://jqueryui.com/demos/progressbar/"&gt;progress bar&lt;/a&gt; plugin in this release.
&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;h4&gt;CSS framework&lt;/h4&gt;
&lt;p&gt;jQuery UI 1.7 is built upon a brand new and powerful CSS framework
that is designed to support not only jQuery UI’s own plugins, but also
custom plugin development, so any developer can easily make their
plugins ThemeRoller ready. It is a special kind of CSS framework that
is aimed specifically at user interface development as opposed to
overall page layout. The framework provides classes for commonly used
UI elements, states, containers and icons and is manipulated by jQuery
UI ThemeRoller. &lt;a href="http://jqueryui.com/docs/Theming/API"&gt;More about the jQuery UI CSS Framework&lt;/a&gt;…
&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;h4&gt;Themeroller v2&lt;/h4&gt;
&lt;p&gt;&lt;a href="http://jqueryui.com/themeroller"&gt;ThemeRoller&lt;/a&gt; has been
completely redesigned to complement the new CSS framework and widget
designs. ThemeRoller now resides in a vertical sidebar and has loads of
new features. We also created a &lt;a href="http://jqueryui.com/themeroller/developertool/"&gt;ThemeRoller Developer Tool&lt;/a&gt; (a bookmarklet, so you can bring ThemeRoller into any web page) and a &lt;a href="http://jqueryui.com/docs/Theming/ThemeSwitcher"&gt;Theme Switcher&lt;/a&gt; (so you can switch between themes with a simple drop-down box).
&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;h4&gt;Demos &amp;amp; Documentation&lt;/h4&gt;
&lt;p&gt;Maybe you’ve seen it already: We merged the top navigation links “Demos” and “Documentation” into a unified &lt;a href="http://jqueryui.com/demos/"&gt;Demos &amp;amp; Documentation&lt;/a&gt;
section, so it’s easy to browse demos and read the documentation all in
one integrated experience. We’ve grouped demos of similar features and
options together so you can easily tab from one to another and compare.
As you navigate within a page, we update the URL to ensure accurate
bookmarking and deep linking.
&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;h4&gt;Full offline documentation&lt;/h4&gt;
&lt;p&gt;Full documentation for each plugin is now included in the release. Just take a look at the /docs/ folder in the &lt;a href="http://jquery-ui.googlecode.com/files/jquery-ui-1.7.zip"&gt;development bundle&lt;/a&gt;.
There’s a separate (and simple) html file for each jQuery UI plugin
method. There’s no styesheet for these files yet, but they’re quite
functional even without. We’ll see about making it a little more like
the website &lt;a href="http://jqueryui.com/demos/"&gt;Demos &amp;amp; Documentation&lt;/a&gt; in a future release.
&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;h4&gt;Major website improvements&lt;/h4&gt;
&lt;p&gt;We refactored the &lt;a href="http://jqueryui.com/download"&gt;download builder&lt;/a&gt;
(using progressive enhancement, so it now works with JavaScript
disabled) and integrated a base theme into the download along with a
demo html file of all the widgets for easy integration. We refactored
and improved the landing pages for the &lt;a href="http://jqueryui.com/development"&gt;Development&lt;/a&gt; and &lt;a href="http://jqueryui.com/support"&gt;Support&lt;/a&gt; sections to be more information-rich and up-to-date.
&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;h4&gt;CSS framework and themes on Google AJAX Libraries API&lt;/h4&gt;
&lt;p&gt;As before, the latest stable release of jQuery UI (now 1.7) is hosted on &lt;a href="http://code.google.com/apis/ajaxlibs/documentation/index.html#jqueryUI"&gt;Google’s CDN&lt;/a&gt;.
New in this release, however, Google is also hosting the new jQuery UI
CSS Framework, as well as our current suite of pre-built themes: &lt;a href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.0/themes/base/jquery-ui.css"&gt;base&lt;/a&gt;, &lt;a href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.0/themes/black-tie/jquery-ui.css"&gt;black-tie&lt;/a&gt;, &lt;a href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.0/themes/blitzer/jquery-ui.css"&gt;blitzer&lt;/a&gt;, &lt;a href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.0/themes/cupertino/jquery-ui.css"&gt;cupertino&lt;/a&gt;, &lt;a href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.0/themes/dot-luv/jquery-ui.css"&gt;dot-luv&lt;/a&gt;, &lt;a href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.0/themes/excite-bike/jquery-ui.css"&gt;excite-bike&lt;/a&gt;, &lt;a href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.0/themes/hot-sneaks/jquery-ui.css"&gt;hot-sneaks&lt;/a&gt;, &lt;a href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.0/themes/humanity/jquery-ui.css"&gt;humanity&lt;/a&gt;, &lt;a href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.0/themes/mint-choc/jquery-ui.css"&gt;mint-choc&lt;/a&gt;, &lt;a href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.0/themes/redmond/jquery-ui.css"&gt;redmond&lt;/a&gt;, &lt;a href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.0/themes/smoothness/jquery-ui.css"&gt;smoothness&lt;/a&gt;, &lt;a href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.0/themes/south-street/jquery-ui.css"&gt;south-street&lt;/a&gt;, &lt;a href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.0/themes/start/jquery-ui.css"&gt;start&lt;/a&gt;, &lt;a href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.0/themes/swanky-purse/jquery-ui.css"&gt;swanky-purse&lt;/a&gt;, &lt;a href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.0/themes/trontastic/jquery-ui.css"&gt;trontastic&lt;/a&gt;, &lt;a href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.0/themes/ui-darkness/jquery-ui.css"&gt;ui-darkness&lt;/a&gt;, &lt;a href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.0/themes/ui-lightness/jquery-ui.css"&gt;ui-lightness&lt;/a&gt;, and &lt;a href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.0/themes/vader/jquery-ui.css"&gt;vader&lt;/a&gt;.
&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;h4&gt;Themes bundle&lt;/h4&gt;
&lt;p&gt;You can now download all the ThemeRoller Gallery themes at once: &lt;a href="http://jquery-ui.googlecode.com/files/jquery-ui-themes-1.7.zip"&gt;jquery-ui-themes-1.7.zip&lt;/a&gt;. Or if you’re savvy with svn: &lt;a href="http://jquery-ui.googlecode.com/svn/tags/1.7/themes/"&gt;http://jquery-ui.googlecode.com/svn/tags/1.7/themes/&lt;/a&gt;.
&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;h4&gt;A new dedicated blog&lt;/h4&gt;
&lt;p&gt;If you’re reading this, you probably know it already. We finally made the switch to our very own blog at &lt;a href="http://blog.jqueryui.com/"&gt;http://blog.jqueryui.com/&lt;/a&gt;,
where we’ll regularly blog about development, theming, and more during
each release. To link the jQuery and jQuery UI blogs, Richard Worth is
starting a “&lt;em&gt;This week in jQuery UI&lt;/em&gt;” series on the &lt;a href="http://blog.jqueryui.com/"&gt;jQuery UI blog&lt;/a&gt;, while Karl Swedberg (of &lt;a href="http://learningjquery.com/"&gt;learningjquery.com&lt;/a&gt;) will do a “&lt;em&gt;This week in jQuery&lt;/em&gt;” series on the &lt;a href="http://blog.jquery.com/"&gt;jQuery blog&lt;/a&gt;, and they will link to eachother.
&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt; &lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Ses Url on railo and coldfusion on Jrun 4</title>
   <link href="http://andreacfm.com/2009/03/01/ses-url-on-railo-and-coldfusion-on-jrun-4" />
   <updated>2009-03-01T00:00:00-08:00</updated>
   <id>http://andreacfm.com/2009/03/01/ses-url-on-railo-and-coldfusion-on-jrun-4</id>
   <content type="html">&lt;p&gt;Going on working with my new multiserver installation I falled into an issue that took me a bit of time to go throught.&lt;/p&gt;


&lt;p&gt;I could normaly run my application using cf, railo and openbd but all the application was failing trying to call a ses url like:&lt;/p&gt;


&lt;p&gt;&amp;lt;code class="coldfusion"&amp;gt;http://railo/index.cfm/mypage/&lt;br /&gt;&amp;lt;/code&amp;gt;&lt;/p&gt;


&lt;p&gt;The server is simply not able to find the .cfm mapping and just do not invoke any cfm engine like .cfm mapping was not in the url.... what made me think is that this happen only with the instances I added to jrun but not to the main cfusion server ( the ones that I installed jrun with ; in my case cf8 ).&lt;/p&gt;


&lt;p&gt;I started look around and especially in the web.xml ( placed under the web-inf folder of any server instance ) file where mapping and settings for the jrun server instance are placed ( In my case file is here : C:JRun4serverscf7cfusion.earcfusion.warWEB-INFweb.xml) . With my surprise I found that in any cf instance added to Jrun this code is commented by default:&lt;/p&gt;


&lt;p&gt;&amp;lt;code class="coldfusion"&amp;gt;&amp;lt;!--Start Ses &lt;br /&gt;  &amp;lt;servlet-mapping id="coldfusion_mapping_6"&amp;gt;&lt;br /&gt;     &amp;lt;servlet-name&amp;gt;CfmServlet&amp;lt;/servlet-name&amp;gt;&lt;br /&gt;     &amp;lt;url-pattern&amp;gt;*.cfml/*&amp;lt;/url-pattern&amp;gt;&lt;br /&gt;  &amp;lt;/servlet-mapping&amp;gt;&lt;br /&gt;  &amp;lt;servlet-mapping id="coldfusion_mapping_7"&amp;gt;&lt;br /&gt;    &amp;lt;servlet-name&amp;gt;CfmServlet&amp;lt;/servlet-name&amp;gt;&lt;br /&gt;    &amp;lt;url-pattern&amp;gt;*.cfm/*&amp;lt;/url-pattern&amp;gt;&lt;br /&gt;  &amp;lt;/servlet-mapping&amp;gt;&lt;br /&gt;  &amp;lt;servlet-mapping id="coldfusion_mapping_8"&amp;gt;&lt;br /&gt;    &amp;lt;servlet-name&amp;gt;CFCServlet&amp;lt;/servlet-name&amp;gt;&lt;br /&gt;    &amp;lt;url-pattern&amp;gt;*.cfc/*&amp;lt;/url-pattern&amp;gt;&lt;br /&gt;  &amp;lt;/servlet-mapping&amp;gt;&lt;br /&gt;  End Ses --&amp;gt;&lt;br /&gt;&amp;lt;/code&amp;gt;&lt;/p&gt;


&lt;p&gt;Basically if you uncomment this code and restart the server also a mapping like : .cfm/page make the server invoking the coldfusion engine while before the jrun server simply was not able to recognize the mapping and was answering that no application was setted up to answer to the request.&lt;/p&gt;


&lt;p&gt;While I solved the cf issue I found more problems to set up railo mapping cause as we all know jrun is not the railo "first choice" and settings are a bit different as in the default railo installation under Resin .... After some testing I added this code to C:JRun4servers
ailoWEB-INFweb.xml , restared the server and also railo started to respond correctly...&lt;/p&gt;


&lt;p&gt;&amp;lt;code class="coldfusion"&amp;gt;&amp;lt;!--Start Ses --&amp;gt;&lt;br /&gt;  &amp;lt;servlet-mapping&amp;gt;&lt;br /&gt;     &amp;lt;servlet-name&amp;gt;CFMLServlet&amp;lt;/servlet-name&amp;gt;&lt;br /&gt;     &amp;lt;url-pattern&amp;gt;*.cfml/*&amp;lt;/url-pattern&amp;gt;&lt;br /&gt;  &amp;lt;/servlet-mapping&amp;gt;&lt;br /&gt;  &amp;lt;servlet-mapping&amp;gt;&lt;br /&gt;    &amp;lt;servlet-name&amp;gt;CFMLServlet&amp;lt;/servlet-name&amp;gt;&lt;br /&gt;    &amp;lt;url-pattern&amp;gt;*.cfm/*&amp;lt;/url-pattern&amp;gt;&lt;br /&gt;  &amp;lt;/servlet-mapping&amp;gt;&lt;br /&gt;  &amp;lt;servlet-mapping&amp;gt;&lt;br /&gt;    &amp;lt;servlet-name&amp;gt;CFMLServlet&amp;lt;/servlet-name&amp;gt;&lt;br /&gt;    &amp;lt;url-pattern&amp;gt;*.cfc/*&amp;lt;/url-pattern&amp;gt;&lt;br /&gt;  &amp;lt;/servlet-mapping&amp;gt;&lt;br /&gt;  &amp;lt;!--End Ses --&amp;gt;    &lt;br /&gt;&amp;lt;/code&amp;gt;&lt;/p&gt;


&lt;p&gt;Please note that I need to restart completely Jrun and not only the railo instance to make chanhges being recognized. I am not sure wht ( probbaly some kind of main config cache ) but after restarting jrun also Railo instance started to work fine with ses url.&lt;/p&gt;


&lt;p&gt;I have not yet solved the matter with openBd but I plan to look into it soon.&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Xml parsing issue on railo and openbd. </title>
   <link href="http://andreacfm.com/2009/02/17/xml-parsing-issue-on-railo-and-openbd" />
   <updated>2009-02-17T00:00:00-08:00</updated>
   <id>http://andreacfm.com/2009/02/17/xml-parsing-issue-on-railo-and-openbd</id>
   <content type="html">&lt;p&gt;&lt;img style="float: left; border: 0; margin: 10px;" src="/images/posts/railo.gif" alt="Railo" width="82" height="52" /&gt;&lt;img style="float: left; border: 0; margin: 10px;" src="/images/posts/bluedragon.gif" alt="Open bluedragon" width="270" height="55" /&gt;&lt;/p&gt;


&lt;p&gt; &lt;/p&gt;


&lt;p&gt; &lt;/p&gt;


&lt;p&gt;As per my previous post I have installed Railo and Open BlueDragon on Jrun 4 as instances of a multiserver installation that also support cf8 and cf7.&lt;/p&gt;


&lt;p&gt;Starting my tests I noted that both Railo and OpenBd in this particular configuration shows issues performing xml parse operations. &lt;/p&gt;


&lt;p&gt;I got errors on both servers running code like:&lt;/p&gt;


&lt;p&gt;&amp;lt;code class="coldfusion"&amp;gt;&lt;br /&gt;var xml = xmlParse(xml);&lt;br /&gt;result = xmlSearch(xml,'/items/');&lt;br /&gt;&amp;lt;/code&amp;gt;&lt;/p&gt;


&lt;p&gt;Googling around I discovered that Jrun miss some classes/configurations that both Railo and OpenBd native installtion provide.&lt;/p&gt;


&lt;p&gt;I added this line in the java.config file as java.args ( I cut it for making it readable  but you must add it all in one line with no spaces ).&lt;/p&gt;


&lt;p&gt;&amp;lt;code class="coldfusion"&amp;gt;&lt;br /&gt;-Djavax.xml.parsers.DocumentBuilderFactory=&lt;br /&gt;com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl&lt;br /&gt;&amp;lt;/code&amp;gt;&lt;/p&gt;


&lt;p&gt;Restart the server and the xml functionalities will be regulary available.&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Installing Railo and Open BlueDragon with ColdFusion 8 Multiserver on JRUN4</title>
   <link href="http://andreacfm.com/2009/02/09/installing-railo-on-jrun4" />
   <updated>2009-02-09T00:00:00-08:00</updated>
   <id>http://andreacfm.com/2009/02/09/installing-railo-on-jrun4</id>
   <content type="html">&lt;p&gt;&lt;img style="border: 0pt none; margin: 10px; float: left;" src="/images/posts/railo.gif" alt="Railo" width="82" height="52" /&gt;In the last meeting of the &lt;a href="http://www.cfmentor.com/" target="_blank"&gt;Italian CFUG &lt;/a&gt;we
got
a very interesting speach about the ability to install coldfusion
as multiserver ( Jrun 4 platform )  and the convenience to deploy under
it more instances of coldfusion or  of any other JAVA J2EE
Web or Enterprise Application. I so started my tests for setting up my
personal test environment with Adobe cf, Railo and Openbd all deployed
under the same multiserver installation.&lt;/p&gt;


&lt;p&gt;I started my test installing Cf8 as multiserver and the process ended succesfully. Cf8 is now installed in c:\jrun4serverscfusion &lt;/p&gt;


&lt;p&gt;At this poit Jrun 4 is installed and is reachable through port 8000. &lt;/p&gt;


&lt;p&gt;I use IIS 7 locally so I decided to let coldfusion installer take care  of the appropriate settings over my default web site. Up to here nothing really changed in the ways I use cf: iis is correctly mapped, cf admin is always reachable through cfide an so on. What change is the fact the cf8 is now a single instance of a JRUN multiserver installation ready to receive and manage more applications. &lt;/p&gt;


&lt;p&gt;&lt;img style="border: 0; margin: 10px;" src="/images/posts/jrun.jpg" alt="Jrun 4" width="746" height="356" /&gt;&lt;/p&gt;


&lt;p&gt;I downloaded Railo War file from &lt;a href="http://www.railo-technologies.com/en/index.cfm?treeID=213" target="_blank"&gt;here&lt;/a&gt;. &lt;/p&gt;


&lt;p&gt;Back to the Jrun4 administrator I created e new server ( I called it Railo ) and this was confirmed on port 8302. &lt;/p&gt;


&lt;p&gt;&lt;em&gt;On the Pictures you see my Jrun4 with many instances already deployed so just keep them as example.&lt;br /&gt;&lt;/em&gt;&lt;/p&gt;


&lt;p&gt;Follow the next steps:&lt;/p&gt;


&lt;p&gt;1) Change the Railo.war file extension to .zip and unzip that.&lt;/p&gt;


&lt;p&gt;2) Go to your {jrun4 folder}/servers/Railo/ and delete the default-ear folder. ( Optional but recomended )&lt;/p&gt;


&lt;p&gt;3) In the Jrun4 admin panel select the railo server ( if is not running switch it on ) .Go to the J2EE Componenets tab and click on deploy in the Web Application Area . &lt;/p&gt;


&lt;p&gt;&lt;img style="border: 0; margin: 10px;" src="/images/posts/railo_jrun_1.jpg" alt="Railo on jrun" width="670" height="316" /&gt;&lt;/p&gt;


&lt;p&gt;4) Search the folder where you unzipped the war file and confirm. Wait the time jrun need to deploy railo and....maybe looks too easy but.....you are done. Railo is deployed and ready to serve your cfm pages.&lt;/p&gt;


&lt;p&gt;You can now reach your railo installation like
http://localhost:{installation port}/{server name - railo in my
case}/railo-context/admin/server.cfm.&lt;/p&gt;


&lt;p&gt;&lt;img style="border: 0; margin: 10px;" src="/images/posts/railo_jrun_2.jpg" alt="Railo on jrun" width="618" height="352" /&gt;&lt;/p&gt;


&lt;p&gt; &lt;/p&gt;


&lt;p&gt;Now I have Railo installed and working but I want to set up a real test suite that gives me the ability to test the same code with different engine with no files copy or syncro.&lt;/p&gt;


&lt;p&gt;1) Craete a new site in IIS ( I have IIS 7 on Vista ). Point it to your webroot ( in my case d:wwwroot ) and add a custom header like 'railo'. &lt;/p&gt;


&lt;p&gt;2) In the Jrun administrator go in the J2EE components tab and click on the server name. In the &lt;strong class="h3"&gt;Web Application Overview&lt;/strong&gt;where change your context root to "/" and point the document root to the position of your IIS wwwroot  ( d:wwwroot for me). &lt;/p&gt;


&lt;p&gt;&lt;img style="border: 0; margin: 10px;" src="/images/posts/jrun_railo_3.jpg" alt="Railo on jrun" width="764" height="358" /&gt;&lt;/p&gt;


&lt;p&gt;3) Now we need to set up our web server. In your jrun installation folder go in the bin folder and open the wsconfig file. A java tool will open up.&lt;br /&gt;Click on Add. Select railo as jrun host, IIS as web server and railo as the site name we want to configure. Click on advanced and add &lt;em&gt;.cfm&lt;/em&gt; and &lt;em&gt;.cfc&lt;/em&gt; as mimtypes. Confirming the  tool will add the correct mapping to your IIS 7 so that the railo web site will use railo engine and not cf8 for processing cfm and cfc files.&lt;/p&gt;


&lt;p&gt;4) As last step open your host file . &lt;br /&gt;On vista should be something like : C:WindowsSystem32driversetchosts &lt;/p&gt;


&lt;p&gt;Add this 2 line :&lt;/p&gt;


&lt;p&gt;127.0.0.1        railo&lt;br /&gt;127.0.0.1        cf8&lt;/p&gt;


&lt;p&gt;Save and close the file.&lt;/p&gt;


&lt;p&gt;Now if you open your browser and try to call&lt;strong&gt; http://cf8/&lt;/strong&gt; the call will be directed to 127.0.0.1 and in my case will call the IIS default web site. &lt;/p&gt;


&lt;p&gt;But if I call http://railo/ my IIS is setted to recognice &lt;em&gt;railo&lt;/em&gt; as railo web site header and process cfml using railo engine.&lt;/p&gt;


&lt;p&gt;For testing it I simply put an index.cfm file under wwwroot with this call inside:&lt;/p&gt;




&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="html"&gt;    &lt;span class="nt"&gt;&amp;lt;cfdump&lt;/span&gt; &lt;span class="na"&gt;var=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;#server#&amp;quot;&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;&lt;strong&gt;http://cf8/index.cfm&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;&lt;img style="border: 0; margin: 10px;" src="/images/posts/cf8-dump.jpg" alt="" width="799" height="255" /&gt;&lt;/p&gt;


&lt;p&gt;&lt;strong&gt;http://railo/index.cfm&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;&lt;img style="border: 0; margin: 10px;" src="/images/posts/railo-dump.jpg" alt="" width="854" height="413" /&gt;&lt;/p&gt;


&lt;p&gt; &lt;/p&gt;


&lt;p&gt;So our test suite is ready. Following the same step you can easily deploy &lt;a href="http://openbluedragon.org/" target="_blank"&gt;Open BlueDragon&lt;/a&gt; (  you can fin ethe war file &lt;a href="http://www.openbluedragon.org/download.cfm" target="_blank"&gt;here&lt;/a&gt; ) as well as more instnaces of cf8 or previous version like cf7 or 6.1 ( be carefull to your jre version for previous cf version support ). &lt;/p&gt;


&lt;p&gt;I find this solution really effective to test exactly the same code versus more engine without too many troubles.&lt;/p&gt;


&lt;p&gt;And from here ..... clustering deploying more web application in the same server instance....many  new possibilities to explore.&lt;/p&gt;


&lt;p&gt;I am now seriously starting playing with railo and openbd and I will go on posting  about them as on our beloved cf8 as well.&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Testing jdk 1.6.0_11 </title>
   <link href="http://andreacfm.com/2009/02/03/testing-jdk-1-6-0-11" />
   <updated>2009-02-03T00:00:00-08:00</updated>
   <id>http://andreacfm.com/2009/02/03/testing-jdk-1-6-0-11</id>
   <content type="html">&lt;p&gt;I have made a fast speed test to see how much the new jdk has increased my cf8 speed.&lt;/p&gt;


&lt;p&gt;The test was very easy and consisting on the looping 1000 times around a createObject statement and run a simple init method on each like following:&lt;/p&gt;




&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="html"&gt;&lt;span class="nt"&gt;&amp;lt;cfloop&lt;/span&gt; &lt;span class="na"&gt;from=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;1&amp;quot;&lt;/span&gt; &lt;span class="na"&gt;to=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;1000&amp;quot;&lt;/span&gt; &lt;span class="na"&gt;index=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;i&amp;quot;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;cfset&lt;/span&gt; &lt;span class="na"&gt;createObject&lt;/span&gt;&lt;span class="err"&gt;(&amp;#39;&lt;/span&gt;&lt;span class="na"&gt;component&lt;/span&gt;&lt;span class="err"&gt;&amp;#39;,&amp;#39;&lt;/span&gt;&lt;span class="na"&gt;testobject&lt;/span&gt;&lt;span class="err"&gt;&amp;#39;).&lt;/span&gt;&lt;span class="na"&gt;init&lt;/span&gt;&lt;span class="err"&gt;()&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/cfloop&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;&lt;strong&gt;Here the results&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt; &lt;em&gt;&lt;strong class="message"&gt;JDK 1.6.0_7 ( as my previous built on cf8 )&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;


&lt;p&gt;ColdFusion : 2.4 secs average&lt;/p&gt;


&lt;p&gt;Railo : 1.1 secs average&lt;/p&gt;


&lt;p&gt; &lt;span class="message"&gt;JDK 1.6.0_11&lt;/span&gt;&lt;/p&gt;


&lt;p&gt;ColdFusion : 1.2 secs average&lt;/p&gt;


&lt;p&gt;Railo : 0.7 secs average&lt;/p&gt;


&lt;p&gt;I was really surprised to discover that my cf8 increased the craeteObject speed of 50% and I have honestly to say that also the &lt;a href="http://www.railo-technologies.com/en/index.cfm" target="_blank"&gt;railo&lt;/a&gt; speed really impressed me&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Learning Ext.js</title>
   <link href="http://andreacfm.com/2009/01/31/learning-ext-js" />
   <updated>2009-01-31T00:00:00-08:00</updated>
   <id>http://andreacfm.com/2009/01/31/learning-ext-js</id>
   <content type="html">&lt;p&gt;&lt;a href="http://www.amazon.co.uk/gp/product/1847195148?ie=UTF8&amp;amp;amp;tag=andr-21&amp;amp;amp;linkCode=as2&amp;amp;amp;camp=1634&amp;amp;amp;creative=6738&amp;amp;amp;creativeASIN=1847195148" target="_blank"&gt;&lt;img style="border: 0pt none; margin: 10px; float: left;" src="/images/posts/learning-ext.jpg" alt="learning ext" width="122" height="150" /&gt;&lt;/a&gt;&lt;/p&gt;


&lt;p&gt;I have recently read the first book written about the js library &lt;a href="http://www.extjs.com" target="_blank"&gt;Ext.js&lt;/a&gt;.&lt;/p&gt;


&lt;p&gt;The book is written bye : Shea Frederick, &lt;a href="http://blog.cutterscrossing.com/" target="_blank"&gt;Steve 'Cutter' Blades&lt;/a&gt; and Colin Ramsay.&lt;/p&gt;


&lt;p&gt;I was a bit afraid of bying the very first book about Ext and honestly I have to say that after the first 2 chapters my doubts were growing very fast. &lt;/p&gt;


&lt;p&gt;Infact the book in the firsts chapters tends to treat really basic arguments with a very scholastic approach. Many writer tend to start their books with quite basic staff but in this case  think the first 30/40 pages could have a had a better use.&lt;/p&gt;


&lt;p&gt;After that things start to get interesting. The book analize Ext approaching the Form api passing then to Grids, Tree, Layout Drag and Drops etc... Any macro area of the Api is analyzed with some working example and many suggestion and tips.&lt;/p&gt;


&lt;p&gt;The examples for any argument are well documented and explained. &lt;/p&gt;


&lt;p&gt;I also appreciated the fact that the authors spent a lot of pages giving tips or ideas on how the example could be coded in a different way pushing the reader to explore more the Ext Api. &lt;/p&gt;


&lt;p&gt;And here was the big surprise about Ext. Following the book examples I found a lot of Ext features that are are documented only in the api  with no higlight in extjs web site or forums.&lt;/p&gt;


&lt;p&gt;I so discovered how really work the store class and the easy that is to implement your application ( also without usign ext widgets ) using the Store class as your dataset repository. This makes your app really agnostic about the data format you are receiving. Ext map the data using a reader class and makes your application not coupled to the kind of data format ( array, json, xml ) that your application is receiving.&lt;/p&gt;


&lt;p&gt;I was also impressed about the gris and especially working with the inline editing. Ext is able to make your data persist on client marking as dirty the modified elements up to the data commit. Amazing.&lt;/p&gt;


&lt;p&gt;So. I was surprised about Ext power and  stability. &lt;/p&gt;


&lt;p&gt;I have already started to play with the library widgets ( but I am also considering the Ext Data funsctionality with no Ext widget support )  and I really want to recomend the book that can really open your eyes to the Ext powerfull World.&lt;/p&gt;


&lt;p&gt; &lt;/p&gt;


&lt;p&gt; &lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>jdk1.6.0_11 speed up coldfusion createObject</title>
   <link href="http://andreacfm.com/2009/01/28/jdk1-6-0-11-speed-up-coldfusion-createobject" />
   <updated>2009-01-28T00:00:00-08:00</updated>
   <id>http://andreacfm.com/2009/01/28/jdk1-6-0-11-speed-up-coldfusion-createobject</id>
   <content type="html">&lt;p&gt; During 2008 many posts in the cf community proved how a bug in the java 1.6 jdks was slowing down the creation of coldfusion objects. &lt;/p&gt;


&lt;p&gt;I personally realized that starting using more frameworks like &lt;a href="http://www.coldspringframework.org/" target="_blank"&gt;coldspring&lt;/a&gt;, &lt;a href="http://www.transfer-orm.com/" target="_blank"&gt;transfer&lt;/a&gt; and in general due to the fact that cf8 gives to developers ( finally!! ) the ability to code more tight to a really OO architecture. I started noting that applications with a large use of coldspring became very slow on start up ( also 20/30 seconds ) and in some case I had to give up with Transfer framework cause the performance were degrading to a very low level (I could use some shortcut and implement the framework but I do not like to use a feature at 50% ! I prefer to use a completely new road and implementing that at 100%).&lt;/p&gt;


&lt;p&gt;&lt;img style="border: 0; float: left; margin-left: 10px; margin-right: 10px;" src="/assets/content//logos/322px-java-logo.svg-1.png" alt="" width="66" height="96" /&gt;Btw the bug was found in the 1.6 jdks versions and last jdk release solve it. From the first test look like performance relly speed up. The same application that was starting in 20/30 sec is now loading in 5/6 seconds that is a reasonable time due to the high number of object generations.&lt;/p&gt;


&lt;p&gt;You can &lt;a href="http://java.sun.com/javase/downloads/index.jsp" target="_blank"&gt;donwload jdk from here&lt;/a&gt; and change default jdk in the cf admin ( for standalone instance ) or in jrun admin panel for multiserver installs.&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Jquery 1.3 and Sizzle</title>
   <link href="http://andreacfm.com/2009/01/22/jquery-1-3-and-sizzle" />
   <updated>2009-01-22T00:00:00-08:00</updated>
   <id>http://andreacfm.com/2009/01/22/jquery-1-3-and-sizzle</id>
   <content type="html">&lt;p&gt;One of the most interesting thing of the new jquery release ( &lt;a href="http://code.google.com/p/jqueryjs/downloads/detail?name=jquery-1.3.1.js&amp;amp;downloadBtn=" target="_blank"&gt;1.3.1 with bug fixing&lt;/a&gt; ) is the new css selctor engine called "Sizzle".&lt;/p&gt;


&lt;p&gt;The css engine has been abstracted from the jquery core code so to be usable alsoinstand alone mode. Normally this shoud not be so important news but the fact that sizzle parsing speed looks to be so impressive make it available also to others library like prototype,mootools and others.&lt;/p&gt;


&lt;p&gt;Find more about Sizzle &lt;a href="http://sizzlejs.com/" target="_blank"&gt;Sizzle&lt;/a&gt;. &lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>OPS javaScript easy event manager.</title>
   <link href="http://andreacfm.com/2009/01/13/ops-javascript-easy-event-manager" />
   <updated>2009-01-13T00:00:00-08:00</updated>
   <id>http://andreacfm.com/2009/01/13/ops-javascript-easy-event-manager</id>
   <content type="html">&lt;p&gt;At this step is just an idea.&lt;/p&gt;


&lt;p&gt;How many times did you find to deal with many objects and to start loosing control over the events flow of teh applications.&lt;/p&gt;


&lt;p&gt;I use many times different libraries ( I always try to follow the
best practice ) implementing his own way to manage events. it works but
many times is not a very efficient way of desgin your applications.
It's a long time I have in mind to build a centralized event manager
framework-agnostic to be used as external support for :&lt;/p&gt;




&lt;ul&gt;
    &lt;li&gt;create new custom events&lt;/li&gt;
    &lt;li&gt;resgister events in a respository&lt;/li&gt;
    &lt;li&gt;being able to subscribe to these events&lt;/li&gt;
    &lt;li&gt;dispach teh eevnt from any place in my application&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;I finally started to build OPS as a simple events manager.&lt;/p&gt;


&lt;p&gt;Here a fast example of a very very alpha release, just to post the concept:&lt;/p&gt;




&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="js"&gt;&lt;span class="cm"&gt;/* Craete e new event using the OPS factory.&lt;/span&gt;
&lt;span class="cm"&gt;I also pass a callback that will receive the full event like argument.&lt;/span&gt;
&lt;span class="cm"&gt;*/&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;myEvent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;OPS&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Factory&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Event&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;myEvent&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ev&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
        &lt;span class="nx"&gt;alert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ev&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getData&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="cm"&gt;/*&lt;/span&gt;
&lt;span class="cm"&gt;register the event in the OPS.Events repository&lt;/span&gt;
&lt;span class="cm"&gt;*/&lt;/span&gt;
&lt;span class="nx"&gt;OPS&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Events&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;addEvent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;myEvent&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="cm"&gt;/*&lt;/span&gt;
&lt;span class="cm"&gt;my observer is an object that fill up an input filed when something happen&lt;/span&gt;
&lt;span class="cm"&gt;*/&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;observer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ev&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
    &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;div_Foo&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;ev&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getData&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="cm"&gt;/* subscribe the observer to run when myEvent is dispatched */&lt;/span&gt;
&lt;span class="nx"&gt;OPS&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Events&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;subscribe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="nx"&gt;observer&lt;/span&gt; &lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;myEvent&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;$&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;ready&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(){&lt;/span&gt;

    &lt;span class="nx"&gt;$&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;#select_Foo&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;change&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(){&lt;/span&gt;

    &lt;span class="cm"&gt;/* on select change I add data to myEvent */&lt;/span&gt;
        &lt;span class="nx"&gt;myEvent&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;setData&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;$&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;val&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
        &lt;span class="cm"&gt;/* dispatch the event from the OPS repository passing the event itself ( with data added ) as argument */&lt;/span&gt;
        &lt;span class="nx"&gt;OPS&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Events&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;dispatchEvent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;myEvent&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;As you see in the example I before create e new event using the
internally OPS.Factory.Event class giving a name and optionally a
callback.&lt;br /&gt;The event is then added to repository that store it by name.&lt;br /&gt;An
observer method is subscribed to the event that is then dispatched
passing event object itself as argument with a dynamic data argument
that can store anything.&lt;br /&gt;As you see teh event is dispached as answer to a change attached with jquery but could dispatched in any other postion.&lt;/p&gt;


&lt;p&gt;
I will add a sort of api and more examples/ test quite soon.&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>New site .. back on Mango</title>
   <link href="http://andreacfm.com/2009/01/13/new-site-back-on-mango" />
   <updated>2009-01-13T00:00:00-08:00</updated>
   <id>http://andreacfm.com/2009/01/13/new-site-back-on-mango</id>
   <content type="html">&lt;p&gt;&lt;img style="border: 0; float: left; margin-left: 5px; margin-right: 5px;" src="/images/posts/one_sweet_mangoblog_150x75a.png" alt="mango blog" width="150" height="75" /&gt;Due to the opportunity to change the hosting company ( I am quite
upset to the poor performance of crystal tech shared hosts ) I also
took the occasion to renew my website.&lt;/p&gt;


&lt;p&gt;I finally decide to move to Mango Blog due to the good impression I had of the job of laura and nahuel from &lt;a href="http://www.asfusion.com" target="_blank"&gt;ASFusion&lt;/a&gt; in the last year especially for MATE flex framework.&lt;/p&gt;


&lt;p&gt;In the next days I will finish to morev the content from old site that is from now unavailable. Just a bit of patience&lt;/p&gt;

</content>
 </entry>
 
 
</feed>
