<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Wirestorm &#187; Ajax</title>
	<atom:link href="http://wirestorm.net/blog/category/ajax/feed/?category_name=ajax" rel="self" type="application/rss+xml" />
	<link>http://wirestorm.net/blog</link>
	<description>Ray Hilton&#039;s blog about interesting technology</description>
	<lastBuildDate>Mon, 12 Dec 2011 11:07:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2-bleeding</generator>
		<item>
		<title>Eclipse + PHP + J2EE + Rails</title>
		<link>http://wirestorm.net/blog/2007/07/04/eclipse-php-j2ee-rails/</link>
		<comments>http://wirestorm.net/blog/2007/07/04/eclipse-php-j2ee-rails/#comments</comments>
		<pubDate>Wed, 04 Jul 2007 02:33:42 +0000</pubDate>
		<dc:creator>rayh</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://wirestorm.net/blog/?p=47</guid>
		<description><![CDATA[I have just decided to upgrade Eclipse, and thought it best to start from scratch. I do a lot of work in Java, PHP as well as Ruby on Rails and so I tried to set up an integrated environment using Eclipse. I have documented the steps here as much as a reminder for myself [...]]]></description>
			<content:encoded><![CDATA[<p>I have just decided to upgrade Eclipse, and thought it best to start from scratch.  I do a lot of work in Java, PHP as well as Ruby on Rails and so I tried to set up an integrated environment using Eclipse.  I have documented the steps here as much as a reminder for myself as a guide for other people trying to something similar.</p>
<p>First, download and unzip the Ecipse + J2EE package from <a href="http://www.eclipse.org/downloads/">http://www.eclipse.org/downloads/</a>.  You do not need to &#8216;install&#8217; Eclipse as such, just put the uncompressed directory somewhere logical (/Applications on a Mac, for example).<a href="http://www.eclipse.org/downloads/">
</a></p>
<ol>
<li>Launch Eclipse <img src='http://wirestorm.net/blog/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </li>
<li>Select: <strong>Help</strong> -> <strong>Software Update</strong> -> <strong>Final and Install</strong>.</li>
<li>Select  <strong>Search for new features to install</strong></li>
<li>Check the <strong>Europa Discovery Service</strong></li>
<li>Select<strong> Add Remote Site</strong></li>
</ol>
<ol>
<li>Type in name:<strong> Aptana </strong>(For javascript support)</li>
<li>Type in url: <strong>http://update.aptana.com/install/3.2/</strong></li>
<li>Select <strong>OK
</strong></li>
</ol>
<li>Select<strong> </strong><strong>Add Remote Site</strong> (For Ruby on Rails support)<strong>
</strong></p>
<ol>
<li>Type in name:<strong> RadRails</strong></li>
<li>Type in url:<strong> http://update.aptana.com/install/rails/3.2/</strong></li>
<li>Select<strong> OK</strong></li>
</ol>
</li>
<li>Select<strong> Add Remote Site </strong>(For SVN integration)
<ol>
<li>Type in name: <strong>Subclipse</strong></li>
<li>Type in url:<strong> http://subclipse.tigris.org/update_1.2.x</strong></li>
<li>Select<strong> OK</strong></li>
</ol>
</li>
<li>Select<strong> Add Remote Site</strong> (for PHP support)<strong>
</strong></p>
<ol>
<li>Type in name: <strong>PDT</strong></li>
<li>Type in url:<strong> http://download.eclipse.org/tools/pdt/updates/</strong></li>
<li>Select<strong> OK</strong></li>
</ol>
</li>
<li>Select<strong> Add Remove Site </strong>(for Hibernate support)
<ol>
<li>Type in name:<strong> Hibernate Tools</strong></li>
<li>Type in url:<strong> http://download.jboss.org/jbosside/updates/development</strong></li>
<li>Select<strong> OK
</strong></li>
</ol>
</li>
<li>Select <strong>Finish</strong></li>
<li>Select your nearest mirror, when prompted</li>
<li>Select <strong>Eurpoa Discovery Site</strong> -> <strong>Programming Languages</strong> -> <strong>Ruby Development Tools</strong></li>
<li>Select <strong>PDT</strong></li>
<li>Select <strong>Aptana</strong></li>
<li>Select <strong>RadRails</strong></li>
<li>Select <strong>Subclipse</strong></li>
<li>Select<strong> Hibernate Tools
</strong></li>
<li>Select <strong>Select Required</strong> (to resolve dependencies)</li>
<li>Select <strong>Next</strong></li>
<li>Accept the agreement(s) and <strong>select Next</strong></li>
<li>Select <strong>Finish</strong></li>
<li>Go for a walk.</li>
<p>Phew, so after all that, you should have an Eclipse IDE set up to support PHP, Ruby, Rails, Javascript, Java, Hibernate and  Subversion.  You can, of course, select many other tools from the Europa discovery site for other development tools, graphical editing and the like.</p>
]]></content:encoded>
			<wfw:commentRss>http://wirestorm.net/blog/2007/07/04/eclipse-php-j2ee-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windy Road » (Re)Introducing Javascript And Hidden Applets (JAHA)</title>
		<link>http://wirestorm.net/blog/2007/04/26/windy-road-%c2%bb-reintroducing-javascript-and-hidden-applets-jaha/</link>
		<comments>http://wirestorm.net/blog/2007/04/26/windy-road-%c2%bb-reintroducing-javascript-and-hidden-applets-jaha/#comments</comments>
		<pubDate>Thu, 26 Apr 2007 09:41:11 +0000</pubDate>
		<dc:creator>rayh</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://wirestorm.net/blog/?p=46</guid>
		<description><![CDATA[Windy Road has a nice article on the use of Javascript And Hidden Applets, what they call JAHA.  This is similar to the technique I have used in Robonobo, however I am having all sorts of issues on Mactel Firefox, possibly due to the Apple MRJ / Firefox integration. It would be nice to have [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://windyroad.org/">Windy Road</a> has a nice article on the use of <a href="http://windyroad.org/?p=23">Javascript And Hidden Applets</a>, what they call JAHA.  This is similar to the technique I have used in Robonobo, however I am having all sorts of issues on Mactel Firefox, possibly due to the Apple MRJ / Firefox integration.</p>
<p>It would be nice to have a small js library that allowed you to dynamically instantiate and destroy embedded, hidden applets.</p>
]]></content:encoded>
			<wfw:commentRss>http://wirestorm.net/blog/2007/04/26/windy-road-%c2%bb-reintroducing-javascript-and-hidden-applets-jaha/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Injecting Events onto XPCOM&#8217;s UI Thread</title>
		<link>http://wirestorm.net/blog/2006/06/05/injecting-events-onto-xpcoms-ui-thread/</link>
		<comments>http://wirestorm.net/blog/2006/06/05/injecting-events-onto-xpcoms-ui-thread/#comments</comments>
		<pubDate>Mon, 05 Jun 2006 15:04:26 +0000</pubDate>
		<dc:creator>rayh</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[XUL]]></category>

		<guid isPermaLink="false">http://rayh.co.uk/blog/?p=14</guid>
		<description><![CDATA[Finally worked this out&#8230; These pages are rather helpful: Mozilla&#8217;s guide to using proxies and XulPlanet&#8217;s description of the nsIProxyObjectManager This interface defines a proxy manager. An instance of this manager is used to create a proxy for a particular object on which you wish to invoke a method. If you are calling from any [...]]]></description>
			<content:encoded><![CDATA[<p>Finally worked this out&#8230;</p>
<p>These pages are rather helpful: <a href="http://www.mozilla.org/projects/xpcom/Proxies.html">Mozilla&#8217;s guide to using proxies</a> and <a href="http://www.xulplanet.com/references/xpcomref/ifaces/nsIProxyObjectManager.html">XulPlanet&#8217;s description of the nsIProxyObjectManager</a></p>
<p>This interface defines a proxy manager.  An instance of this manager is used to create a proxy for a particular object on which you wish to invoke a method.  If you are calling from any other thread that which you initialized xpcom on, you will need to do this, and as far as I am aware, there is no trivial way of doing otherwise.</p>
<p>Anyway, the code to open a new window would be as follows.  Note, this method assumes that there is already a constructed object called windowWatcher, which is an instanceof nsIWindowWatcher, see previous post for details.</p>
<pre><code> public void openWindow(String chromeUri, String name) {
nsIEventQueueService eventQueueServive =
(nsIEventQueueService)serviceManager.getServiceByContractID(
"@mozilla.org/event-queue-service;1",
nsIEventQueueService.NS_IEVENTQUEUESERVICE_IID);

nsIEventQueue eventQueue = eventQueueServive.getSpecialEventQueue(
nsIEventQueueService.UI_THREAD_EVENT_QUEUE);

nsIProxyObjectManager proxy =
(nsIProxyObjectManager)componentManager.createInstanceByContractID(
"@mozilla.org/xpcomproxy;1",
null,
nsIProxyObjectManager.NS_IPROXYOBJECTMANAGER_IID);

nsIWindowWatcher windowProxy =
(nsIWindowWatcher)proxy.getProxyForObject(
eventQueue,
windowWatcher.NS_IWINDOWWATCHER_IID,
windowWatcher,
nsIProxyObjectManager.INVOKE_SYNC );

windowProxy.openWindow(null, chromeUri, name, "centerscreen", null);
} </code></pre>
<p>The code here uses the service manager to get an instance of the event queue manager, which is subsequently used to retreive the main UI event queue.  This is then passed to the proxy manager&#8217;s getProxyForObject method, along with the IID of the nsIWindowWatcher interface, the actual instance, and flag representing the type of proxy operation (async, sync, etc, see the xulplanet page for more info).</p>
<p>This method returns an instance of nsIWindowWatcher, which is actually a proxy which will inject events onto the UI thread for you.  Then, just use the object as normal, sweet!</p>
]]></content:encoded>
			<wfw:commentRss>http://wirestorm.net/blog/2006/06/05/injecting-events-onto-xpcoms-ui-thread/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>JavaXPCOM</title>
		<link>http://wirestorm.net/blog/2006/04/29/javaxpcom/</link>
		<comments>http://wirestorm.net/blog/2006/04/29/javaxpcom/#comments</comments>
		<pubDate>Sat, 29 Apr 2006 16:01:26 +0000</pubDate>
		<dc:creator>rayh</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[XUL]]></category>

		<guid isPermaLink="false">http://rayh.co.uk/blog/?p=13</guid>
		<description><![CDATA[After poking around for some hours (then days) trying to find some useful information on how to use JavaXPCOM (which is a bridge between XPCOM and Java, formally known as Javaconnect) I stumbled across a few things as well as hacking together some understanding myself and through C++ examples of XPCOM usage. We decided a [...]]]></description>
			<content:encoded><![CDATA[<p>After poking around for some hours (then days) trying to find some useful information on how to use JavaXPCOM (which is a bridge between XPCOM and Java, formally known as Javaconnect) I stumbled across a few things as well as hacking together some understanding myself and through C++ examples of XPCOM usage.</p>
<p>We decided a while back to adopt an XML based protocol wherever possible, and moreover, RDF where appropriate.  When communicating with a central server, this would use HTTP, so it seemed logical to use the same on the localhost.  So, XUL uses AJAX, basically, to do asynchronous calls over HTTP to localhost, and retreives XML which is then passed into objects representing the returned resources.  This way, we dont need to heavily integrate Java and XUL using XPCOM, and we allow other applications to be able to place nicely with the API over a well-known protocol and format.  Anyway, this means that the only work JavaXPCOM needs to do is:</p>
<ul>
<li>Start XPCOM using a XULRunner installation</li>
<li>Start an XUL window and pass control over to it</li>
<li>Be able to call javascript/xul events from java (to open windows, etc)</li>
</ul>
<p>So to start with, we need to find an XULRunner install.  As it stands, we will distribute a version with the installer, but JavaXPCOM contains code to easily find installed versions as well (this is actually documented on the <a href="http://developer.mozilla.org/en/docs/JavaXPCOM">JavaXPCOM site</a>).</p>
<ol>
<li>Set the path the XULRunner directory, here we are doing it explicitly:
<code>File grePath = new File(new File(".").getAbsolutePath(), "platform/win32/xulrunner");</code></li>
<li>Next create an instance of the LocationProvider
<code>LocationProvider locProvider = new LocationProvider(grePath);</code></li>
<li>Initialize JavaXPCOM embedding:
<code>Mozilla.getInstance().initEmbedding(grePath, grePath, locProvider);</code></li>
<li>Now we need to start an XUL application, so we get an instance of the XPCOM service manager
<code>nsIServiceManager serviceManager = moz.getServiceManager();</code></li>
<li>Now we need to get the @mozilla.org/toolkit/app-startup;1 service:
<code>nsIAppStartup appStartup = (nsIAppStartup)serviceManager.getServiceByContractID("@mozilla.org/toolkit/app-startup;1", nsIAppStartup.NS_IAPPSTARTUP_IID);</code></li>
<li>Get the nsIWindowWatcher interface to the above
<code>nsIWindowCreator windowCreator = (nsIWindowCreator)appStartup.queryInterface(nsIWindowCreator.NS_IWINDOWCREATOR_IID);</code></li>
<li>Get the window watcher service
<code>nsIWindowWatcher windowWatcher = (nsIWindowWatcher)serviceManager.getServiceByContractID("@mozilla.org/embedcomp/window-watcher;1", nsIWindowWatcher.NS_IWINDOWWATCHER_IID);</code></li>
<li>Set the window creator (from step 6)
<code>windowWatcher.setWindowCreator(windowCreator);</code></li>
<li>Create the root XUL window:
<code>nsIDOMWindow win = windowWatcher.openWindow(null, "chrome://your-app/content/window.xul", "mywindow", "chrome,resizable,centerscreen", null);</code></li>
<li>Set this as the active window
<code>windowWatcher.setActiveWindow(win);</code></li>
<li>Hand over the application to xpcom/xul, this will block:
<code>appStartup.run();</code></li>
</ol>
<p>Now, the LocationProvider is responsible for providing path(s) and file(s) that XPCOM needs.  I have implemented a version that when the &#8216;ChromeML&#8217; location is asked for returns an array of File&#8217;s, the first of which points to my own applications chrome folder, and the second of which is the xulrunner&#8217;s own chrome folder.  This seems to work, but there are several issues:</p>
<ol>
<li>I do not seem to be able to open XUL windows (or in anyway interact with xpcom/xul) from another thread.  Since this run() method on nsIAppStartup blocks, this is a bit annoying.  I presume there is a way to run this loop manually, or hook into it so we can queue up requests from other threads to be invoked on the xpcom thread.</li>
</ol>
<p>Ok, thats only one major issue for now, but I&#8217;m sure I will think of others.
If anyone has any ideas how these problems can be solved, or how one may circumvent them, I&#8217;m all ears.  Also, I know that this area is so bleeding edge it hurts, so it would be nice to talk to some other people doing the same things!</p>
]]></content:encoded>
			<wfw:commentRss>http://wirestorm.net/blog/2006/04/29/javaxpcom/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>AJAX Rocks&#8230;</title>
		<link>http://wirestorm.net/blog/2005/10/22/ajax-rocks/</link>
		<comments>http://wirestorm.net/blog/2005/10/22/ajax-rocks/#comments</comments>
		<pubDate>Sat, 22 Oct 2005 18:24:20 +0000</pubDate>
		<dc:creator>rayh</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://rayh.co.uk/blog/?p=5</guid>
		<description><![CDATA[Ajax is damn cool. I am currently working on a small project using Google Maps which displays properties on a map. There is a central object which manages communication (via googles GXmlHttp) with the servers-side php. Upon response, this same object parses the response XML and then updates its observers. Each component then has an [...]]]></description>
			<content:encoded><![CDATA[<p>Ajax is damn cool. </p>
<p>I am currently working on a small project using Google Maps which displays properties on a map.  There is a central object which manages communication (via googles GXmlHttp) with the servers-side php.  Upon response, this same object parses the response XML and then updates its observers.  </p>
<p>Each component then has an object which manages its display, it subscribes to the main object, and upon update will redraw that elements innerHTML, mostly by transfrorming the responseXML with XSLT using googles GXslt class).</p>
<p>This got me thinking about a component base widget framework implemented in javascript, something that a server side application could easily communicate with.  Imagine something like awt/swing being rendered to a javascript/html browser, rather than a normal windowing system.  Upon an event, the component would send the event object back to the server, the server would process this, and update all components subscribed to the model, the components would then decide whether they need to be redrawn or not, and the new state of these components would be collected, packaged up in xml, and sent back to the client.</p>
<p>This would mean that only the components that change would need to be updated and redrawn, and the whole page need not be reloaded.  </p>
<p>A quick poke around found a couple of interesting projects:</p>
<ul>
<li><a href="http://dojotoolkit.org/">http://dojotoolkit.org/</a>
<p>
No real demos yet, but looks promising, has a 0.1 version number, so perhaps not ready for production use <img src='http://wirestorm.net/blog/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> 
</p>
</li>
<li>
<a href="http://qooxdoo.oss.schlund.de">http://qooxdoo.oss.schlund.de</a></p>
<p>
This seems very cool, nice gui, seems quite mature and pretty nippy.
</p>
</li>
<li>
<a href="http://www.zimbra.com/">http://www.zimbra.com/</a></p>
<p>
 This is a collberation tool, email, contacts, calendar, etc, using their own AJAX Toolkit
</p>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://wirestorm.net/blog/2005/10/22/ajax-rocks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

