<?xml version="1.0"?>
<rss version="2.0">
<channel>
  <title>Spikes Of Nothingness - dwr tag</title>
  <link>http://weblog.flop.ca/tags/dwr/</link>
  <description>Florin T.PATRASCU&#039;s blog</description>
  <language>en</language>
  <copyright>Florin T.PATRASCU</copyright>
  <lastBuildDate>Sat, 12 May 2012 02:12:08 GMT</lastBuildDate>
  <generator>Pebble (http://pebble.sourceforge.net)</generator>
  <docs>http://backend.userland.com/rss</docs>
  
  
  <item>
    <title>jQuery, DWR and RESTLET; JPublish demo web application  available</title>
    <link>http://weblog.flop.ca/2010/04/02/1270224444782.html</link>
    
      
        <description>
          		&lt;p&gt;
For those of you asking for examples of integrating jQuery, DWR and Rest with JPublish, I just uploaded a very simple demo at Google code, in case you&#039;re interested. This is a 5.7M file and you can get if from here: &lt;a href=&#034;http://jpublish.googlecode.com/files/jp-jq-testing.zip&#034;&gt;http://jpublish.googlecode.com/files/jp-jq-testing.zip&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This demo is using the latest version of jQuery, DWR and it is based on the JPublish from trunk. Using RESTLET 1.1.3. All the required libraries are included in the zip file.
&lt;/p&gt;

&lt;p&gt;
Should you have any question about this demo or JPublish in general, please do not hesitate to ask. Have fun!
&lt;/p&gt;
        </description>
      
      
    
    
    
    <category>Java</category>
    
    <comments>http://weblog.flop.ca/2010/04/02/1270224444782.html#comments</comments>
    <guid isPermaLink="true">http://weblog.flop.ca/2010/04/02/1270224444782.html</guid>
    <pubDate>Fri, 02 Apr 2010 16:07:24 GMT</pubDate>
  </item>
  
  <item>
    <title>Profiling the JPublish web applications</title>
    <link>http://weblog.flop.ca/2007/12/20/1198164545130.html</link>
    
      
        <description>
          &lt;p&gt;  &lt;/p&gt;
We recently deployed a lot of new functionality to a very complex JPublish driven &lt;a href=&#034;http://www.masterfile.com/&#034;&gt;web site&lt;/a&gt; and profiling many aspects of the code we developed was a mandatory prerequisite. To make our life easier, we used the very simple profiling tool provided as Open Source by the Atlassian team: &lt;a href=&#034;http://opensource.atlassian.com/profiling/introduction.html&#034;&gt;atlassian-profiler.&lt;/a&gt; &lt;br /&gt;
&lt;br /&gt;
The atlassian-profiler lib is now integrated with the JPublish framework and profiling can be easily enabled by tweaking your jpublish.xml configuration file. For example, to enable the JPublish profiler, simply add the following line to the jpublish.xml config file:&lt;br /&gt;
&lt;blockquote&gt;&amp;lt;profiling&amp;gt;true&amp;lt;/profiling&amp;gt;&lt;br /&gt;
&lt;/blockquote&gt;You can also set the minimum time reported in the trace when profiling. You probably only want to&lt;br /&gt;
profile methods that take more than 50ms, which is done like so:&lt;br /&gt;
&lt;blockquote&gt;&amp;lt;profiling MIN_TIME=&amp;quot;50&amp;quot;&amp;gt;true&amp;lt;/profiling&amp;gt;&lt;br /&gt;
&lt;/blockquote&gt;After that check your console for interesting facts :)&lt;br /&gt;
&lt;br /&gt;
We discovered with satisfaction that the new ability to execute JPublish Actions via AJAX DWR calls works beautifully and the overhead is unbelievable small. Once again DWR rocks!&lt;br /&gt;
&lt;br /&gt;
Watch our &lt;a href=&#034;http://code.google.com/p/jpublish/&#034;&gt;JPublish&lt;/a&gt; site for more goodies to come :)&lt;br /&gt;
&lt;br /&gt;
Cheers!&lt;br /&gt;
-florin
        </description>
      
      
    
    
    
    <category>Java</category>
    
    <category>projects</category>
    
    <comments>http://weblog.flop.ca/2007/12/20/1198164545130.html#comments</comments>
    <guid isPermaLink="true">http://weblog.flop.ca/2007/12/20/1198164545130.html</guid>
    <pubDate>Thu, 20 Dec 2007 15:29:05 GMT</pubDate>
  </item>
  
  <item>
    <title>Executing JPublish Actions from DWR? What else can be simpler? :)</title>
    <link>http://weblog.flop.ca/2007/10/27/1193531279888.html</link>
    
      
        <description>
          &lt;p&gt;  &lt;/p&gt;
I was always envying the ability of Webwork to execute Actions via DWR and it was clear that any JPublish user will need something similar. However, I wanted a simpler implementation.&lt;br /&gt;
&lt;br /&gt;
As promised, now you have it:) If you&#039;ll update your &lt;a href=&#034;http://jpublish.googlecode.com/svn/&#034;&gt;JPublish framework from SVN&lt;/a&gt;, including the &lt;a href=&#034;http://jpublish.googlecode.com/svn/trunk/modules/dwr/&#034;&gt;DWR module&lt;/a&gt;, you&#039;ll see what I am talking about . Yup, you can execute any JPublish action (BSH, JS, JRUBY, GROOVY or Java compiled code) making remote calls via DWR. In the SVN there is also a demo showing you how to do this: &lt;a href=&#034;http://jpublish.googlecode.com/svn/trunk/samples/simpledwr/&#034;&gt;SimpleDWR&lt;/a&gt; &lt;br /&gt;
&lt;br /&gt;
In the small explanation below I presume you&#039;re already familiar with how JPublish and DWR work together.&lt;br /&gt;
&lt;br /&gt;
This is what you need to remotely execute a JPublish Action:&lt;br /&gt;
- first modify the dwr.xml file and define the Action you want to publish through the DWR.&lt;br /&gt;
&lt;blockquote&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;init&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;creator id=&amp;quot;jpublish&amp;quot; class=&amp;quot;ca.flop.jpublish.dwr.JPublishCreator&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;/init&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;...&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;create creator=&amp;quot;jpublish&amp;quot; javascript=&amp;quot;InfoAction&amp;quot; scope=&amp;quot;application&amp;quot;&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;param name=&amp;quot;class&amp;quot; value=&amp;quot;ca.flop.jpublish.dwr.DWRJPublishActionManager&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;param name=&amp;quot;actionName&amp;quot; value=&amp;quot;InfoAction.bsh&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;/create&amp;gt;&lt;br /&gt;
&lt;/blockquote&gt;&lt;br /&gt;
- then define the InfoAction.bsh. Here is the code from our &lt;a href=&#034;http://jpublish.googlecode.com/svn/trunk/samples/simpledwr/web/actions/InfoAction.bsh&#034;&gt;SVN example&lt;/a&gt;:&lt;br /&gt;
&lt;blockquote&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;String infoMsg = &amp;quot;Hi, this is JPublish 4&amp;quot;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;context.put(&amp;quot;infoMsg&amp;quot;, infoMsg);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;context.put(&amp;quot;serverDate&amp;quot;, new Date());&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;print( infoMsg);&lt;br /&gt;
&lt;/blockquote&gt;&lt;br /&gt;
- now let&#039;s call the InfoAction in an AJAXified HTML page and display the &lt;strong&gt;infoMsg&lt;/strong&gt; and the &lt;strong&gt;serverDate&lt;/strong&gt; values returned by the InfoAction script,&amp;nbsp; a server side BSH script executed by JPublish. Would that be hard? What do you think? Here is the code:&lt;br /&gt;
&lt;blockquote&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;..&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;script type=&#039;text/javascript&#039; src=&#039;$request.ContextPath/dwr/interface/InfoAction.js&#039;/&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;...&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;Below is a simple demonstration of the ability to invoke JPublish Actions via DWR:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;input type=&amp;quot;button&amp;quot; value=&amp;quot;Info&amp;quot; onclick=&#039;InfoAction.execute( params, function(response) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dwr.util.setValue(&amp;quot;serverDate&amp;quot;, response.serverDate);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dwr.util.setValue(&amp;quot;info&amp;quot;, response.infoMsg);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; });&#039;/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;Messages received from server:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;div class=&amp;quot;dateField&amp;quot; id=&amp;quot;serverDate&amp;quot;&amp;gt;-server date-&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;div class=&amp;quot;salute&amp;quot; id=&amp;quot;info&amp;quot;&amp;gt;JPublish Salute...&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;/blockquote&gt;&lt;br /&gt;
Guess what? Uhhh..... that&#039;s all :)&lt;br /&gt;
&lt;br /&gt;
Have fun!&lt;br /&gt;
-florin&lt;br /&gt;
&amp;nbsp;
        </description>
      
      
    
    
    
    <category>Java</category>
    
    <category>projects</category>
    
    <comments>http://weblog.flop.ca/2007/10/27/1193531279888.html#comments</comments>
    <guid isPermaLink="true">http://weblog.flop.ca/2007/10/27/1193531279888.html</guid>
    <pubDate>Sun, 28 Oct 2007 00:27:59 GMT</pubDate>
  </item>
  
  </channel>
</rss>

