Wednesday, August 20th, 2008
Category: Aptana
, JavaScript
, Server

Tom Kirkpatrick has written about a new API in Jaxer, Jaxer.Process, that allows you to call out to the host operating system. His example has a call out to get the uptime on the machine:
JAVASCRIPT:
-
-
<script runat="server-proxy">
-
function runUptime() {
-
// run the uptime and return the output from STDOUT
-
return Jaxer.Process.exec("/usr/bin/uptime");
-
}
-
</script>
-
You can see the application running live.
Friday, August 1st, 2008
Category: Aptana
Greg Murray has blogged about a new release candidate for Aptana Jaxer that contains a lot of new features.
Kevin Hakman told us about the release:
We've had server-side JS database APIs all along, but now handing result sets is even easier. There's also now full fine grain control and access to the entire communication cycle with APIs for message headers, redirects, content and types. Speaking of types… for the first time with Jaxer, you can return content types other than HTML including JSON, XML, GIF, etc… Yes, even GIFs. Jaxer has a fresh new Image API that among other things can convert Canvas to static images and serve them up. Like, Greg, I too really like the idea of using Jaxer for easily creating JSON data services which is a rapidly growing trend as developers discover the powerful capabilities of JSON more and more. In Jaxer, it's very cool since it's all native JavaScript on the client, on the wire, and on the server. There's even enhanced JSON serialization to make it even easier than before on both client and server. JSON services also open Jaxer to be useful in combination with rich internet clients other than Ajax UIs such as Flash, Flex or even Silverlight since all those support JavaScript on the client and can consume JSON data. For Ajax and RIA developers this is a boon since you can now write your client-side and server-side code in the same language. And if you prefer XML data services Jaxer's native E4X (ECMAScript for XML) support means you can handle XML docs natively in JS on Jaxer as well.
This release also includes a totally new concept: a secure sandbox which as Greg explains, "lets you load, on the server, pages from other domains and allow their JavaScript to execute without giving them access to the Jaxer API or your own server-side code, but still gives your code access to their window objects and anything inside them". For anyone who has ever done screenscaping for mashups or other applications, this really helps a lot since Ajax pages have historically thwarted scraping operations. With this feature in Jaxer you can securely get a remote page, execute its functions, and scrape the resulting DOM nodes (yes, you need not do tedious manipulations with strings) and voila!
Here are the features:
- Application context settings that allowing for easier app configuration, app properties, database settings, etc...
- Database API enhancements with richer APIs for working with result sets.
- Server-side image manipulation including server-side canvas support and ability to convert to other image types.
- Native command execution API so that you can run system commands and handle the output from those.
- Asynchronous server-side JavaScript processing lets you implement callbacks in your server-side code too.
- Ability to return custom content types (e.g. json, xml, gif, html, etc...)
- Full control of the request/response lifecycle including setting redirects, headers, content, etc...
- Secure sandbox supporting cross domain calls, sandboxed JavaScript execution, META refreshes, ...
- Serialization support for JavaScript objects to and from XML, E4X and JSON.
Uri Sarid has a great post that shows how you can do DOM Scraping with Jaxer, and updates it for this latest release:
There's a lot of other new goodness in Jaxer 1.0, as well as the official released version of the Mozilla engine found in Firefox 3. So for example getElementsByClassName is natively implemented (see John Resig's speed comparison), in addition to the other Mozilla features such as built-in XPath functionality and a very robust DOM feature set — just what you need for some serious 'screen scraping', mashups, and content repurposing.
Let's see it in action!
It includes code that shows the Sandbox in action, as well as the DOM work:
JAVASCRIPT:
-
-
// Gets a fragment of the remote page's HTML, after some cleanup
-
function getFragment(title, url, isClassName, identifier, classesToRemove)
-
{
-
var sandbox = new Jaxer.Sandbox(url);
-
var contents = sandbox.document[isClassName ? 'getElementsByClassName' : 'getElementById'](identifier);
-
var container = addToPage(title, contents);
-
if (classesToRemove)
-
{
-
if (typeof classesToRemove == "string") classesToRemove = [classesToRemove];
-
classesToRemove.forEach(function(className)
-
{
-
removeNodeList(container.getElementsByClassName(className));
-
});
-
}
-
return container.innerHTML;
-
}
-
getFragment.proxy = true;
-
Monday, July 28th, 2008
Category: Aptana
Paul Colton posted that Aptana has a couple of new recruits in Greg Murray and Ryan Johnson.
Greg Murray was the Ajax guy at Sun, created jMaki, and did a lot of work in organizations such as the Open Ajax Alliance. Ryan Johnson is the creator of the livepipe and object.event Ajax libraries. What are they doing?
Greg's primary role will be creating increasingly robust application frameworks for Jaxer, Aptana's open source Ajax server product. Ryan has already been working on MVC concepts for Jaxer and will be collaborating with Greg and the rest of the Jaxer team to drive that and other great concepts for Jaxer forward.
The timing could not be better. Greg and Ryan have joined up just before we get the Jaxer 1.0 release candidate out the door to the whole community (it's just a matter of days now). This puts us in a great position to start working on some of the next things that'll be in store for Jaxer in the coming months -- and there are some great ideas brewing. For example, Greg and Ryan have already been collaborating with the Jaxer team to create an ActiveRecord-like JavaScript ORM for Jaxer that promises to make working with JavaScript data a pleasure -- since it'll all be native JavaScript!
Friday, July 4th, 2008
Category: .NET
, Aptana
What does your CEO do? Paul Colton, CEO of Aptana, gets his fingers dirty. He just wrote a post about accessing COM objects from JavaScript with Jaxer.
This is possible as the JavaScript is running on the server, and this server is running on Windows. You can download the source code to check it all out.
HTML:
-
-
-
-
-
function rotate(angle)
-
{
-
var img = COMObject("ImageProcessor.ImageProcessing");
-
-
img.LoadImage(Jaxer.request.documentRoot + "/photo.jpg");
-
img.RotateImage(angle);
-
img.SaveImage(Jaxer.request.documentRoot + "/new.jpg");
-
}
-
</script>
-
-
<input type="button" value="Rotate"
-
onclick="rotate(document.getElementById('angle').value);
-
document.getElementById('img').src =
-
document.getElementById('img').src + '?' + new Date()"/>
-
-
<img id='img' src="new.jpg"/>
-
</body>
-
</html>
-
Wednesday, June 11th, 2008
Category: Aptana
, Ext
When Aptana released Jaxer, it really excited the community because you could now leverage your client-side skills on the server end of things. Rich Waters of Ext JS talks about how to leverage Ext JS on the server via Jaxer. The code created by Rich creates a Ext JaxerStore which allows you to run queries and directly put them into a Ext Store. This has the benefit of leveraging the same Ext language syntax you've become accustomed to for server-side processing by allowing Jaxer to wrap client and server-side communications up allowing either synchronous or asynchronous calls between the client and server.
I asked Rich why would developers do this versus doing a simple Ajax call to a template sitting on a server:
The template bit lets you generate the html before the page is served up so that no extra client side calls are necessary. I think the Ext template system is really slick and easier than even a lot of other existing server side templating systems. More or less it was also just an example to get people thinking about what could be done now that Ext can be run server-side.
The code snippet allows you to make the calls to Jaxer very easily:
JAVASCRIPT:
-
-
Ext.onReady(function() {
-
var store = new Ext.data.JaxerStore({
-
table : 'demo',
-
fields : [
-
{name : 'name'},
-
{name : 'phone'},
-
{name : 'email'}
-
],
-
readerConfig : {
-
sortInfo : {
-
sort : 'name',
-
dir : 'asc'
-
}
-
}
-
});
-
-
// create the Grid
-
var grid = new Ext.grid.GridPanel({
-
store : store,
-
columns : [
-
{header : "Name", sortable : true, dataIndex : 'name'},
-
{header : "Phone #", sortable : true, dataIndex : 'phone'},
-
{header : "Email", sortable : true, dataIndex : 'email'}
-
],
-
viewConfig : {
-
forceFit : true
-
},
-
stripeRows : true,
-
height : 350,
-
width : 680,
-
title : 'Jaxer Demo Grid',
-
renderTo : Ext.getBody()
-
});
-
});
-
which would then populate a grid control and render it accordingly.
The source code to this new functionality can be downloaded here.
Tuesday, June 10th, 2008
Category: Aptana
, Cloud
, JavaScript

Dougal Matthews has been playing with Aptana Cloud in a beta form. He wrote up this piece that walks you through the functionality with screenshots:
After creating a project it then is automatically available in the cloud options.
When you click on the project under the cloud menu you are taken through a (very easy to use) wizard for configuration. This runs your through a few steps, setting up a site name, picking a payment plan (the beta is free), payment details and so on. Most of these screens are fairly standard, however the service selection is quite interesting. I imagine these prices are not final, so just take them with a pinch of salt.
The payment scheme seems to be quite flexible and we can see a large number of services that are included, PHP being the main server side language at the moment, with Aptana Jaxer still being a beta… (Ruby of Rails is on the ‘coming soon’ list). The prices range from the cheapest being 256 MB ram and 5 GB hard disc for $0.99 a day, up to 2 GB of ram and 25 GB hard disc for $8.22 a day. Seems fairly reasonably priced.
After set-up is finished, it phones home and does some magic.
This is an important step for Aptana, as it not only gives us a good general cloud service, but it also gives you the perfect place to play with Jaxer. I am looking forward to seeing more.
Monday, April 28th, 2008
Category: Aptana
, Cloud
, JavaScript

Aptana have announced their cloud platform initiative, Aptana Cloud.
Aptana Cloud plugs right into your IDE to provide instant deployment, smart synchronization, and seamless migration as you scale. Aptana Cloud is ideal for developers who use scripting languages to create Ajax, Facebook, mySpace and all other sorts of Web applications.
The key is that this isn't a infrastructure play, which they clearly point out:
Aptana Cloud is architected to complement Cloud infrastructure providers like Amazon, Google, Joyent and others. To get started we've selected Joyent who serves up some of the largest of all Facebook apps.
This shows that their platform is designed to go meta, allowing you to deploy to various clouds in the future.
I think that the number one meme from Web 2.0 Expo last week was the "cloud", coming off of the excitement of Google App Engine. With Aptana Cloud we will see sophisticated tools to make us productive in the cloud. I am very excited to see that it won't be too long until developers will be able to build an application, hit DEPLOY, and be done. This is a huge win.
For developers:
- IDE plug-in integrates Cloud development, deployment and management life-cycles right into Aptana Studio in either its standalone or Eclipse based editions
- Instant deployment of projects to Cloud
- One click sync your project to the Cloud, or provide fine grained sync control too
- Integrated service management consoles
- Configure desired memory size and disk size
- Develop and instantly preview remote files right inside your Studio desktop environment
- Subversion source control.
As Ajax developers, the vision of Jaxer in the cloud is very interesting too. The entire application using JavaScript, and deployed up into the cloud, all through the nice IDE.
I was also pleased to read that not only Ruby on Rails, but Python is on the docket. After developing Django applications and playing with Google App Engine, I would love to be able to use Studio for Python code too. Not that Emacs (X or GNU) isn't great, Steve!
Darryl Taft wrote:
Aptana adds extra value via IDE integration, deployment automation and active monitoring and notification services, Hakman said. “It's like the ease and simplicity between iTunes on your desktop and its connectivity to services on the Web,†he said.
For developers, the IDE plug-in integrates cloud development, deployment and management lifecycles right into Aptana Studio in either its standalone or Eclipse-based editions, Hakman said. "The ability to deploy stuff to the cloud from Eclipse is part of this as well."
Other developer features include instant deployment of projects to the cloud; one click can sync your project to the cloud or provide fine-grained sync control; the technology features integrated cloud services management, enables users to provision their cloud right from Aptana Studio, configure desired memory size and disk size, develop and instantly preview remote files right inside the Studio desktop environment, and includes Subversion Source Control.
Can't wait go get an invite. If you want one too, request an account.
Also, Aptana Studio just passed 1,5 million downloads. Impressive.
Monday, April 14th, 2008
Category: Aptana
, Articles
, JavaScript
, Server
Davey Waterson of the Aptana Jaxer team has posted an article on using jQuery on the server-side with E4X and more that shows an example of server-side Ajax with a popular framework.
The article describes a polling application that features:
- Using jQuery server-side to manipulate a DOM before it's sent to the client
- Doing some database / SQL interactions, server-side in javascript of course
- User sessions in javascript (Jaxer.session.set('status', status);)
- Using E4X on the server-side.
There are fun little features such as nuking portions of the page if the permissions call for it:
JAVASCRIPT:
-
-
$((status == 'voter') ? '.nonvoter' : '.voter').remove();
-
Since the application delivers no JavaScript itself, this would all work even if the user has JavaScript turned off, on a simple mobile phone, etc.
Thursday, March 20th, 2008
Category: Aptana
, Examples
, JavaScript
Dealing with file uploads can be a test of a Web framework. I personally long for the input type="file" to be improved with items such as multiple="true" for multiselection, let alone showing the status of the upload (20% complete).
The Jaxer folks have posted on Easy File Uploading using Aptana Jaxer which shows how you can tinker in JavaScript to get everything you need in a very simple way:
To receive the data from the form when submitted we put some Jaxer code into the page the form will be submitted to. The code below should be in script block with a runat = 'server' attribute, which makes the code run serverside and doesn't present it to the client so you don't expose any serverside filenames or folder structures.
HTML:
-
-
<script type='text/javascript' runat='server'>
-
var message = "";
-
-
for (fileCount=0; fileCount <Jaxer.request.files.length; fileCount++){
-
var fileInfo = Jaxer.request.files[fileCount];
-
-
var destinationFilePath = Jaxer.Dir.resolvePath(fileInfo.originalFileName);
-
fileInfo.save(destinationFilePath);
-
-
message += "<br>" + [
-
"Saved to : " + destinationFilePath
-
, "original filename : " + fileInfo.originalFileName
-
, "temp filename : " + fileInfo.tempFileName
-
, "contentType : " + fileInfo.contentType
-
, "size : " + fileInfo.fileSize
-
].join("<br />");
-
-
}
-
document.write(message);
-
</script>
-
Wednesday, March 12th, 2008
Category: Announcements
, Aptana
, Rails
, Screencast
Aptana took over the RadRails open source project a few months back, and now have fully integrated it with Aptana Studio with the RadRails 1.0 release.
RadRails 1.0 runs as a plug-in to Aptana Studio. So in addition to all the Ruby on Rails IDE goodies and the integrated Rails shell command-line console, developers get the great HTML, CSS, DOM, JavaScript and Ajax features in Aptana Studio, which can run stand alone or within Eclipse to that all your other Eclipse tools can be right there as well.
The new version has a slew of new and enhanced functionality such as:
- Rails 2.0 support
- JRuby support
- Bundled auto-installing gems for rails development
- A Ruby profiler for Pro users
- An RDoc preview view
- Extended RHTML/ERb color preferences
- Code completion for ActiveRecord model fields and finders
- Code completion suggesting method call arguments
- Significant expansion of code warnings and analysis, including syntax changes from Ruby 1.8 to 1.9
- An improved look and feel
You can watch a screencast of the product at work or a full feature list.
Aptana continues to add new functionality to its products as it tries to hit the "best tools for Web development with scripting languages" vision.
Tuesday, March 4th, 2008
Category: Aptana
, Dojo
Yesterday we posted about Dojo and AIR and how the framework could be well suited for certain desktop applications.
Today we have Kriz Zyp talking about their Jaxer support and how you can use the Django template language, that Dojo recently added, to once again do its thing on the server side.
Kris tells us more:
HTML:
-
-
-
djConfig = {baseUrl:"/dojo/",usePlainJson: true, parseOnLoad: true};
-
</script>
-
<script runat="both" type="text/javascript" src="../../../dojo/dojo.js"></script>
-
-
dojo.require("dojo.jaxer");
-
...
-
</script>
-
Once this is done, Dojo should load in Jaxer, and you can utilize the library capa