Aptana Blog

Jaxer and .NET: Image Rotation Example using C# and JS

One of our users asked about extending Jaxer to do some image processing. He wanted to extend Jaxer using a language he had been already using for some of his back-end work, in this case, Microsoft's C# language which is part of .NET.

I quickly launched my VMWare Fusion into Vista, gulp, and proceeded to run Microsoft's Visual Studio 2008. This posting won't be a tutorial on how to write C#, but i'll just go over some of the basics of setting up a simple C#-based COM object that can be used from within Jaxer.

The first thing to note is that to register COM objects in Vista, you need to be Administrator, so just launch Visual Studio as Administrator using the right-click menu 'Run as Administrator'. Once you have Visual Studio running, start by creating a new 'Class Library' project.

Once you've created the project, right-click on the project and go to the Properties menu, we'll want to make this object a COM-visible one.

In the 'Build' section of the properties, scroll to the bottom and check the 'Register for COM Interop' checkbox. This will make your object visible to other languages as a COM object.

The next thing you'll need to do is open your 'AssemblyInfo.cs' file, which is usually in your Properties folder of your project. Be sure to change the 'false' value to 'true' for the 'ComVisible' setting:

Now that you've done that, you can just create a COM object the 'usual' way. The complete project is attached, so you can take a look there. The image processing code was borrowed from the following online tutorial: http://blog.paranoidferret.com/index.php/2007/06/13/csharp-tutorial-image-editing-rotate/

Once you've got your object compiled, using it from within Jaxer is super-easy! You can just use the COMObject function to create a wrapped instance of the native object and then just use functions and properties on it just as if it were native JavaScript.

So here is the very short HTML file and JavaScript code running server-side via Jaxer that creates the COM object, loads our image, rotates it via the input field in the HTML form, and then saves it back as a new image. The communications from JS to .NET happens very quickly and as you can see, was super-simple to set up.

Here's a screenshot of the image being rotated:

What's really cool is that you can write anything you like in C#/VB.NET and easily access it via JavaScript in Jaxer. Note how in my sample, the onclick event for the button calls the server-side JavaScript function directly, which in turn calls the .NET COM object. That is, you can bind browser-side buttons directly to back-end .NET COM objects, all in JavaScript through Jaxer!

AttachmentSize
MyCOMObject.zip15.16 KB

Hybrid Ajax / Flex Apps. Are You Getting Better Fuel Efficiency?

There are some interesting threads going on in the Aptana Forums about using Aptana Studio with Adobe Flex and Flex Builder. The idea of using Ajax and Flex or Flash together is not new. Google Finance did a great job a few years ago blending the two to provide a very nice user experience with Flash-based interactive charts within an otherwise Ajax UI.

It seems that the Aptana community is uncovering increasing efficiencies in using Aptana Studio and Adobe's Flex Builder together. We've also known that many Adobe AIR users are building their Ajax apps for AIR using Aptana Studio, and have heard from others that using Aptana Jaxer to create JSON data services (written natively in JavaScript) consumable by Flash and Flex apps makes a lot of sense as well. Flash and Flex each have an "Ajax bridge" to expose JavaScript APIs for the embedded objects.

Anyways... It seems Adobe is now actively taking a deeper look at this trend in the hybridization of Ajax and Flash and Flex. I saw that they are offering $75 bucks for an hour phone call to discuss your experience with and thoughts on using these together.

Here's the link if you're interested: http://www.adobe.com/go/RIAintegration_study/. $75 bucks... That's almost the cost of a tank of gas in San Francisco.

Aptana surpasses 2 million Studio downloads...and we're just getting started!

This week Aptana shipped the 2 millionth copy of Aptana Studio! This is a huge milestone for Aptana for which we owe a big thank you to the community -- not just for downloading Studio, but more importantly for helping make Aptana Studio the leading open source IDE in its category through your feedback, ideas, and suggestions (and for reporting bugs when they happen).

For Open Source Developers by Open Source Developers

We really see the success of Aptana products stemming from the philosophy that it's "for developers by developers" and our open source model help us fulfill that through rapid release cycles, nightly builds, and overall a more fluid process that's constantly taking in feedback from the community. And what better kind of solution is there than the one the community told us to build.

We're continuing that philosophy now with our Aptana Cloud offering (currently in beta) as well as our support for Ruby on Rails, PHP and LAMP development, and of course app development with Ajax libraries on the client side and for those that want server-side Ajax, Aptana Jaxer, a first-of its kind open source Ajax server built around the Mozilla browser engine.

Help us help you. Join the Aptana Early Access Programs

Cloud, PHP and Jaxer are all in active beta stages right now and you can get your hands on them through the Aptana Cloud Early Access Program, so it's a great time to request early access and give early feedback. RadRails, for streamlined Ruby on Rails development is already 1.0 so feedback in the forums and the bug/enhancement system right now is best for that. This early feedback has direct and immediate impact on what we'll ship this year. So now is the time. Got something you want to see in Aptana's offerings? Let us know. Get involved. Help us help you.

Fun with Ext JS and Aptana Jaxer

Rich Waters of Ext JS has put up a great example of using Ext JS server-side with Aptana Jaxer. Check out the example and from there get the full source code to give it a go yourself.

"We can see that Jaxer lets developers leverage the hard work which has already been spent building client-side libraries on the server-side. These simple examples show off some of the true potential of utilizing the Ext JS framework on the server-side" says Rich.

The easy to follow example shows off a very simple wrapper around an Ext.data.Store and the corresponding Jaxer server code that returns JSON to a Ext JS datagrid.

Aptana Ruby on Rails book by Javier Ramirez released

A new Aptana RadRails book has been released. Aptana community member Javier Ramirez's "Aptana RadRails: An IDE For Rails Development" (Packt Publishing, May 2008) is now available. Find it at Amazon, or direct from Packt (where its a tad cheaper it seems), or at other fine book establishments around the world!

Here's the summary:

A comprehensive guide to using RadRails to develop your Ruby on Rails projects in a professional and productive manner

  • Comprehensive guide to using RadRails during the whole development cycle
  • Code Assistance, Graphical Debugger, Testing, Integrated Console
  • Manage your gems, plug-ins, servers, generators, and Rake tasks
  • Rails 2.0-ready
  • Includes a chapter about Subversion and Database integration
  • Smart Code Assistants for HTML, JavaScript, and CSS

Aptana RadRails is an Integrated Development Environment for Ruby on Rails projects. Built on top of the well-known Eclipse platform, RadRails provides all the tools you need to create a whole Rails application from a single interface, allowing you to focus on the creative part of the development as your IDE takes care of the mechanics.

What you will learn from this book

This book will show you how to use the tools RadRails provides to improve your productivity:

  • Tools for writing code: Specialized Editors for Ruby, HTML, CSS, and JavaScript; >> Code Assistance; Code Completion; Refactoring; Quick Code Navigation; Outline Views
  • Tools for testing and debugging: Unit Testing; Graphical Debugger; Monitoring of Log Files
  • Tools for project management: Specialized views for launching your Tasks and Generators; Management of your Gems and Plug-ins; Rails Servers Control
  • You will also learn how to use other Eclipse plug-ins for synchronizing your projects with Subversion and for managing your databases.

Who this book is written for

This book is for Ruby on Rails developers who want to make the most of the framework by using an Integrated Development Environment.

Even though the book explains everything you need to follow the contents, the focus is on how to use the tool and not on the Rails framework itself, so previous working knowledge of Rails is highly advisable. Previous knowledge of Eclipse is not necessary.

--------------------------------------------------------------------------------

Author: Javier Ramírez

Javier Ramírez has been developing Web Applications since before the term Web Application was coined. Born in Zaragoza, Spain, in 1974, he started programming as a hobby around the age of 11 assisted by his older sister. A few years later, he got his first modem and became a regular of BBSes and Newsgroups. His interest in developing server applications that can be accessed remotely comes from those times.

He has learned —and forgotten— many programming languages, including Basic, dBase III, Cobol, Pascal, SQL, C, C++, ASP, TCL, JavaScript, PHP, and Java, the language on which he has focused for most of his career so far. He has held the positions of programmer, analyst, consultant, team leader, post-sales engineer, project manager, and software architect, totaling over 12 years in the IT business.

Having developed projects mainly for banks and other big corporations in Spain, Italy and the US, he co-founded some years ago a small software development shop, which provided him with valuable experience about the difficulties and the joys of entrepreneurship. After two years, he left the company in pursuit of new professional challenges.

For the last two years, he has been proudly working for ASPgems, where he discovered Ruby on Rails, which soon became his framework of choice for developing Web Applications. He is one of the organizers of the Spanish Rails Conference, also participating as a Speaker in the two events held so far.

He has also been an instructor on Robotics, Java, FatWire Content Server, and Ruby on Rails, and a University Lecturer in the subjects of 'Software Engineering' and 'The Java Programming Language', which he currently teaches at Universidad Francisco de Vitoria, in Madrid.

Javier Ramírez holds a B.Sc. in Business Information Systems with First Class Honors and a degree in Ingeniería en Sistemas de Computación.

------------------------------------------------------------------------------------------------

Javier's other postings in the Aptana forums

Aptana-At-Large in June 2008

In June, Aptana and ColdFusion enthusiast, Mark Drew will be at CFUnited presenting:

Fresh AIR: Getting to grips with Aptana and AIR apps
This session will give a nice and fresh introduction to developing AIR applications using Aptana. By using a ColdFusion developer's existing knowledge of HTML and JavaScript (and some quick introductions to JavaScript libraries such as EXT and JQuery), the whole process of developing rich desktop apps will be demystified.
Mark, who has been central to the CFEclipse project, is sure to deliver a great session, so be sure to check it out.

Aptana to Launch Cloud Platform (eWeek)

Aptana will build off of its IDE and AJAX success with its new technology. Read the full story.
Learn more about Aptana Cloud, an "Elastic Application Cloud" that's ideal for Web developers who use scripting languages.
Join the early access program.

'DOM Scraping' with Aptana Jaxer

One of the things I was working on recently is 'screen scraping' some data from several sites and presenting them in a single page. Of course Jaxer seems like the perfect tool for this as I can go fetch the data server-side, pull it all together, then present the final page to the browser. It was so exciting to see this work that I thought I'd make this post to share my experience with you!

We’re working now on adding support in Jaxer for being able to programmatically create 'window' objects, filling them with content from a remote URL, having that content actually execute, then being able to go into that window object and pull DOM elements out.

Unfortunately for me, that work isn't ready yet, so I wanted to see if there was some workaround I could use until it was ready. Well, after some research and trial and error, a workaround was found. The only catch with this code is that if there is any JavaScript on the page(s) you are fetching, that code will not execute, that’s coming soon.

Note that all of the code below can be contained within a single script tag:

So, the first thing I wanted to do is make it really easy to fetch a remote document and grab out some content. I didn't want to use string matching or regular expressions of any kind, I wanted to use my trusted 'getElementById' to fetch named elements directly. (Of course I ran into sites that don't name their elements, but fortunately many use named classes, so I had to fetch them that way, but I get ahead of myself.)

Let's get started. The following two lines is all that is required to fetch a remote URL synchronously on the server and then pull out a named element:

Now that we have 'item' as the element we were trying to fetch, we just have to add that element to our current blank page. I created a simple function called 'addElementToPage(title, element)' that takes care of this for me. Here's the next line:

That's it. Now I do that 2 more times to fetch content from 2 other sites.

You'll notice that I didn't use getElementById() as those elements were not named, but fortunately they had class names associated with them. I found a convenient function called getElementsByClass() that I used in this case. Since it returns an array of elements, I use the [0] index to retrieve the first item in the list, which in my case, is probably the only item.

Believe it or not, that's basically it. At this point, your three 'DOM fragments' have been fetched and inserted into your new document. Here's the result:

Following are the convenience functions that help make the magic happen. The first function is addElementToPage(). It very simply just creates an H2 tag and sets the title and a DIV tag which contains the contents of the fetched element:

This next function, getDocumentFromURL(), is the one that does most of the work. (I found some good info on the subject of HTML to DOM here: http://jszen.blogspot.com/2007/02/how-to-parse-html-strings-into-dom.html) It first goes and retrieves the remote page. Then it creates a 'document fragment' from the contents of the fetched site. That fragment is then added to a dynamically created IFRAME. Finally, the Document object from the IFRAME is fetched and returned. In short, we can pass in a URL, get the string value, place it into an IFRAME, then pull out the resulting Document object so that we can work on it.

This final function was found at http://www.dustindiaz.com/getelementsbyclass/ and walks a node looking for an element with a specific class name. It was used in the case where elements don't have ID's, so a class name is used instead.

What's exciting about this sample is that it is relatively simple, uses the full power of server-side JavaScript and more importantly, Jaxer's cool server-side DOM capability to enable real 'DOM scraping'. Once window object creation is finished in Jaxer (real soon now), then you'll be able to fetch remote pages, execute their integrated code, then proceed to fetch out items from the resulting DOM.

Server-side jQuery and more cool tricks with Aptana Jaxer

In this example, (the first in a series) we're going to build a simple voting tool, using a single page of DHTML. The implementation is quite basic but covers a good few examples of how to use Aptana Jaxer in real world situations, such as :

  • Using Ajax libraries on the server (jQuery in this example)
  • Server-side DOM manipulation (using jQuery)
  • Storing and retrieving Session data
  • Creating and accessing a database
  • E4X as a templating mechanism (E4X provides native XML support in JavaScript)
  • Handling form data

Let's Vote...

This example was written as a single page webapp. You could remove the Javascript to another file and make it all unobtrusive if that is what gets you excited, but I'm just using an inline script tag, as the code is only about 30 or so lines long. Also in Jaxer we could have easily implemented this using Jaxer's seamless ajax callback mechanism but for the purpose of this example we'll stick with a traditional form post.

Let's get started. Most folks reading this should be familiar with the standard blog/portal poll, where you are presented with a set of choices.

and once you have voted you get to see the current results of the voting.

In our example we allow multiple votes per user but you can easily change that by just commenting out a single line of code.

One of the interesting features of this application is that, by using server-side DOM manipulation in Jaxer, you can remove any unwanted content before it is sent to the client browser. We use this to hide the vote results until the user has voted

This is a useful technique for permission based forms where, for example, you may want remove the credit card details unless the user has established the correct permissions and been validated by the server.

A very basic web page

So let's jump in and have a look at the code used to make this work. The code in this article has been updated to use the API of Jaxer 0.9.8 or later, for The full source listing below contains comments to indicate where the code was changed to work with the later API.

Above is the contents of the HEAD element. Just the usual suspects, setting the title and some simple CSS stuff. The only interesting part is at line #3, where we load the jQuery library on the server, because we intend to do some serverside DOM manipulation before the page is sent to the client.

The runat='server' attribute tells Jaxer to load this javascript library on the server.

The autoload attribute is a recent addition to Jaxer, and it instructs Jaxer to load that page and keep it cached as preparsed bytecode (for faster library loadtime) for any future calls to this page, including callbacks.

In the body of the document we have a simple form which we will dynamically populate on the server. The form will post the vote to itself on the server.

We are marking up the DOM content with the classnames 'voter' and 'nonvoter' to identify content that is specific to a user's status, and make it easily accessible using jQuery on the server.

Server Side Javascript

Now we get to the Javascript. The app has a single script tag in the body which is designated to run on the server.

The first dozen or so lines are simply creating a DB and preparing a schema for use.

So we've connected to the database (which was automatically created if needed, how convenient!) and set up the schema and initial content we expect. We also setup an Array (questions) containing the questions for the voting poll

Next we need to check the session value we are storing (status) to determine whether this user has already voted, and then check to see if the form data for the vote is being posted. Then, if we are actually voting, we write the vote to the database and set the user status to 'voter'.

When we write the vote to the database, we grab the sessionID and the remote IP address and write those out with the vote data, this will let us enforce single voting later if we need it.

Finally query the database to get the current vote counts, remembering to subtract 1 from the total to account for the dummy rows we inserted to seed database and prevent any nulls from appearing in the results totals.

Now we build the DOM, to do this we issue a query to the DB to get the current vote tally.

Using E4X - ECMAScript For XML as a simple templating tool we create the DOM with the nodes populated according to our dataset.

One of the nice features of server-side javascript with Jaxer is that you have access to all neat things built into Mozilla without the worry of client side browser support, which enables reliable use of the advanced features of the Javascript language.

If you look closely at the code below you'll notice we use a simple syntax for variable substitution using curly braces containing javascript code inside the E4X assigments. This allows us to use this for templating as long as we are creating valid XML nodes.

So the document now has a DOM that has been populated with the content for BOTH voters and non-voters. We use a little jQuery magic to remove the elements we don't want presented to the user.

In this way the user will EITHER see the form with the question and the submit button

OR the current voting results data.

Now we set the session variable status to be the current status of the user as they have either voted or not.

Finally as the page that is served has no further dependency on Jaxer once it leaves the server, we tell Jaxer to not bother injecting the client framework. Normally the client framework would be automatically inserted as a script tag in the outgoing HTML, but our simple example doesn't need to communicate back to the Jaxer server, as it contains no server callbacks.

So there you have it, a simple poll on a single page, using many of Jaxer's cool features.

Supporting Files

The full code and supporting files for this article are available here

Full Source Listing

AttachmentSize
choices.png7.09 KB
voted.png7.61 KB
votepoll.zip36.12 KB

Dojo / Dijit markup and templates via Aptana Jaxer

Tony Issakov has written up a nice conceptual article on how Aptana Jaxer can simplify certain tasks of dojo and dijit development. He starts with a simple case of how Jaxer can enable simplified server-side dijit markup, then expands the ideas to JSF, JSTL, and templates. Tony explains: "Once upon a time dojo had markup ability using custom tags. This was pulled because as it turns out, some browsers just scrap tags they don't understand. One browser that did support tags of a non HTML nature though was Mozilla and in turn we get this freedom back via Jaxer." For example: can become...

Aptana Jaxer 0.9.5 Now Available with Faster Performance, New Features

Aptana Jaxer has been updated to 0.9.5 providing increased performance for server-side JavaScript and a host of other enhancements to make End-to-End Ajax development easier.

Aptana Studio users can get the latest via Help > Software Updates. Otherwise, download the latest now.

  • Increased Performance
    • Aptana Jaxer's core is now based on Mozilla FireFox Beta3 and thus delivers improved JS performance and memory management.
    • Jaxer now pre-parses scripts to bytecode for faster execution during callbacks.
  • More Natural JS Environment
    • Window and document objects on the server-side now parallel more closely how you work with them on the client-side. This means a more natural coding style with server-side JavaScript in Jaxer and a more browser compatible experience.
    • Jaxer no longer inlines external scripts to the page, this allows for correct use of browser cache on client side content and makes 'view source' a much more pleasant experience. This also applies to Jaxer's ClientFramework (the client-side JavaScript Jaxer puts in pages to facilitate callbacks and remote method invocation). Instead such external scripts are cachebusted with the buildnumber so that upgrading the server will automatically expire any old client side cache copies.
    • A new autoload feature has been added to allow for an entire script file to be cached server-side and reloaded on every regular and callback request. This is ideal for loading JavaScript libraries server-side. A configuration option is provided to expire the script every time the containing page is accessed, to ease development cycles -- this is the default config setting. See http://www.aptana.com/node/202 for a full example.
  • Improved Platform Support
    • Significantly improved Unix support. Jaxer now builds and runs on Solaris too!
    • mySQL support is now also provided for Mac OSX
    • A number of Windows Vista security/UAC related problems have been addressed
  • API Enhancements
    • Jaxer's file system API has been updated -- mostly around the 'quick' static method. For example: Jaxer.File.chmod('myfile.tx',0400)
    • A simple Stopwatch timer API now allows for timing measurements in code.

Easy File Uploading using Aptana Jaxer

One of the common web tasks that always seems to involve a lot of arcane knowledge of backend systems, is how to upload files. Like most systems, Aptana Jaxer uses the post/receive model, where a web form is posted to the server, and the target of that form will receive and process the content. Where Jaxer makes this really easy is that it is all done with regular JavaScript and HTML. No special enviroment vars, excessive string processing, or finding handles to oddly named temp files is required.

All you need is a form to present to the user, which contains an input element of type upload, and an HTML page to receive the submitted form containing a "runat=server" script block that retrieves the data from the request. You could have the form and the recipient be the same page, however in this example I'll use two files for clarity. As an aside in Jaxer you can actually send the form directly to a JavaScript function living on the server but we'll look at that configuration in a future blog entry.

Example HTML Upload Form

This example upload form simply allows you to select up to 2 files for upload from the local filesystem. Pressing 'upload' posts the contents of that form to an HTML page containing the JavaScript shown later.

The form will look like the following when viewed in a browser. Pressing the browse button will present you with a file selection dialog, or you can type the path into the input box directly. I've used 2 file slots in this example to demostrate that the files passed in are available as part of an files array contained in the request object (a JavaScript representation of the HTTP request) and are accessed like any other JavaScript array.


'upload' sends the selected file(s) to the server.


Example Aptana Jaxer code to receive file uploads

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.

The data posted by the form is available within the Jaxer.request object.

For the purposes of this example we are specifically interested in the Jaxer.request.files array which contains an array of Jaxer.Request.FileInfo objects, one for each file posted with the form.

The Jaxer.Request.FileInfo object contains some useful properties describing the file, such as fileName, contentType, etc.

Uploading two files from my filesystem from the form in this example would return a page of output like below. We have uploaded the file to same location as the submission.html file used as the form action in the originating HTML.

Saved to : C:\aptana\JaxerDev\public\work\bar.txt
original filename : bar.txt
temp filename : C:\aptana\JaxerDev\tmp\tmp
contentType : text/plain
size : 15754
Saved to : C:\aptana\JaxerDev\public\work\foo.txt
original filename : foo.txt
temp filename : C:\aptana\JaxerDev\tmp\tmp-1
contentType : text/plain
size : 816

Well that's really all there is to it. It's simple and easy and you never have to think about anything other than HTML and Javascript.

API docs for the FileInfo object and the Jaxer.Request object are available online.

Aptana-At-Large in March 2008

Next week Aptana will be at AjaxWorld (NYC), iPhone Developer Summit (NYC), and EclipseCon (Silicon Valley). Join us. We want to meet you, answer your questions, and get your feedback and ideas to make Aptana Studio and Aptana Jaxer even better for you. (Of course you can do that anytime via our ASAP enhancement request system too).

AjaxWorld, March 18-20, New York, NY
Kevin Hakman presents Aptana Studio: Your Unfair Advantage for AJAX, iPhone, Adobe AIR, PHP and Rails Development and Rapid Development of Enterprise Ajax Apps both on Wednesday, March 19.

iPhone Developer Summit, March 18-20, New York, NY
Also on Wednesday March 19, Kevin Hakman presents Developing AJAX Applications for iPhone and iPod Touch.

EclipseCon, March 17-19, Santa Clara, CA
Eclipse Monkey committer and Aptana engineer Ingo Muschenetz shares Building Eclipse-based Products: A View From the Trenches on March 18, and Aptana engineer Kevin Sawicki delivers Pimp My Editor with insights for extending and customizing features in Eclipse.

We'll also be at the EclipseCon Ajax focused Birds of a Feather meeting -- check the schedule for details.

RadRails 1.0 Release

I'm happy to announce that RadRails 1.0 has been released today. This release has been a long time coming and includes a lot of new features and polish. We're especially proud of the progress we've made here at Aptana since we took over the project. RadRails 0.7.2 users will definitely want to check out this new release - it offers a more stable environment, full Rails 2.0 support, support for JRuby, and a boatload of new features. For those who want the comprehensive list of changes since the 0.9.3 release, you can find the changelist in ASAP.

The highlights include:

  • A new Rails Shell console - A screencast dedicated to this feature is available at aptana.tv.
  • 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

These new features join an already impressive set of functionality:

  • A Fast Ruby debugger
  • RHTML, YML, HTML, JS, and CSS editors with code assist.
  • Unit testing integration and GUI
  • Refactoring
  • Code analysis and warnings
  • IDE Scriptable via Ruby
  • Much, much more!

Please note that unless you've been using 1.0.0 nightlies Aptana/Eclipse will not automatically update you to 1.0. You'll need to force an install of RadRails 1.0 via the Start Page, Plugins Manager, or Software update mechanism that you used to initially install RadRails. For those who prefer to use the Software Update route, the update site URL for RadRails is: http://update.aptana.com/update/rails/3.2/

Aptana recap: Library updates and bug fixes on the way

This week, the Aptana development team continued working on the 1.1.5 release for Aptana Studio and the 0.95 release for the Jaxer server.

New Release

We're planning to release "nightly" versions of Aptana Studio 1.1.5 and Jaxer 0.95 next week. These releases will contain numerous bug fixes. The Aptana Studio release should contain updates for many of the bundled Ajax Library frameworks, including support for EXT 2.0.2., Yahoo UI 2.5, Adobe Spry 1.6, and more.

Tips and Tricks

Do you have a question about an Aptana Studio Pro license? Or do you need some basic troubleshooting help? Visit our recently re-organized Aptana Studio FAQ and see if your question has already been answered there.

If you still need help, you can always file a support request in our ASAP system, of course.

Community Buzz

We'd like to thank our community for their help with submitting bugs and feature requests in ASAP. If you've submitted a bug or a feature request and are curious if we've implemented the fix or feature yet, visit your ASAP ticket and look for the Fix Version field. This field lists the current target release date for the fix or feature.

Jaxer on AIR: Build Desktop & Server Apps in Ajax

Yesterday Adobe announced the availability of Adobe AIR 1.0. At the same time, Aptana released the Adobe AIR plugin for Aptana Studio which simplifies development of Ajax applications that run "on AIR". (Adobe AIR Plugin for Aptana Studio)

If you are not familiar with Adobe AIR, it enables you to use the skills and Web technologies you already know, HTML, CSS, and JavaScript, to write applications that can be deployed to the Windows and Mac desktop, and shortly on Linux desktops too.

And what is Aptana Jaxer, you ask? Jaxer is an Ajax server that enables you to leverage those same Web skills and technologies, HTML, CSS, and JavaScript, to write server-side code and do a whole new range of things with JavaScript like interact with databases, file systems, and remote data sources, do server-side DOM manipulations, cross-domain data calls, make socket connections, and call server-side JavaScript functions from the client-side, plus lots more. Yes, you write both client and server code using HTML and Ajax. You can even write entire web applications in a single HTML file if you wish.

With that said, it becomes much clearer as to what ‘Jaxer on AIR’ is all about -- two systems that enable you to leverage your Ajax skills for building desktop and server apps, unified into a single, very interesting model. With Jaxer you can implement your server-side to know if an app is running in AIR and thus take advantage of offline synchronization and local access to the client system as permitted, or if you’re running on the Web with a subset of the total potential features of your Ajax apps and Web pages.

I did a 10-minute screencast showing a simple example of this. I take one of Jack Slocum’s great Ext / Adobe AIR demos (EXT Tasks Demo) and Jaxer-enabled it. I added a single JavaScript function that can query my backend database, and I use the results to fill the user interface.

This demo just scratches the surface of what is possible, but I hope it opens the doors to your thinking about how to utilize these great technologies – it’s my version of their chocolate and our peanut-butter happily together, enjoy!

View 'Jaxer on AIR' Screencast

Ajax Pioneer Kevin Hakman joins Aptana, Inc.

We are excited to announce that Kevin Hakman has joined Aptana to head up marketing and developer community programs. Kevin is a recognized leader in the Ajax community. Long before the term "Ajax" was coined, Kevin was pioneering single page web application concepts via the company he co-founded, General Interface Corp., one of the first enterprise Ajax libraries and visual development tools companies. General Interface Corp. went on to be acquired by TIBCO Software in 2004 as a compliment the company's service-oriented architecture (SOA) products. Today TIBCO General Interface is used by many Fortune-scale companies for rapid Web application development and deployment atop their XML and SOAP data sources.

In addition to his historic role on the steering committee of the OpenAjax Alliance, Kevin currently chairs the organization's integrated development environment working group. The OpenAjax Alliance IDE Working Group which includes Adobe, Aptana, the Eclipse Foundation, IBM, Microsoft, Sun, TIBCO and others is now close to delivering a draft specification for a uniform way to describe Ajax libraries and controls and thus streamline the ability to use Ajax libraries within your development tools of choice. Kevin is a frequent speaker at Ajax industry events and is an author to many published articles on Ajax in the enterprise.

A Jaxer Roadmap

This past week we released another point release of Jaxer, version 0.9.3, updating the standalone server as well as the one packaged within Aptana Studio. Of course there were bug fixes, performance improvements, and API enhancements. Perhaps most important, this was our first release to officially support Linux. Supporting Linux isn't trivial because of the multitude of variants, but it is very strategic as the deployment platform of choice for many people. Look for more distros being supported and more forms of distribution, from buildable source drops to tarballs and installable packages and even to complete EC2 and VMWare images. And thanks to the community for already helping us with supporting Linux distros.

So where are these releases leading — what are some things on the immediate roadmap for Jaxer?

  • An even more Ajax-y experience: the callback environment will be made more natural, server-side support for Ajax libraries will expand, mashups will be easier to implement, etc.
  • Scalability and performance: we'll release some interesting benchmarks on current Jaxer performance and stability, illustrate how it scales, and make some significant improvements.
  • More APIs: we'll make database, file, network, and native interfaces more powerful while maintaining clean APIs that feel at home in JavaScript and HTML.
  • More integration: we're creating a true bridge to Java by leveraging DWR (Direct Web Remoting) server-side, in addition to our current support for Tomcat (and other servlet containers); we'll expand the list of supported web servers from the current Apache 2.x and Jetty to IIS, Apache 1.3, and perhaps others; and we'll work on other database drivers.
  • Deployment: we're working on making one-click deployment a reality, so you can develop your Ajax apps in Studio, leveraging Jaxer for the server side, and click to deploy your app to a hosted, managed, monitored, and scalable environment.
  • Tooling: How about seamless end-to-end debugging of your Ajax app — step through your program starting on the server, move to the browser, go back to the server for a callback, then back to the browser for processing the result...
  • Real-world apps: in the spirit of eating our own dog food, and supporting dog food consumption in the community, look for complete applications written on Jaxer and en expansion of our web site and of Studio so you can share your snippets, samples, projects and applications.

Oh, and the time frame? We're not exactly the patient type, so for many of these think weeks rather than months. Want something specific to come out even faster? Join the discussions on the forums, join the effort (some folks are supporting Linux distros, others are building persistence frameworks, some are putting together samples), or join our team.

Aptana recap: Jaxer now available for Linux

This past week, the Aptana development team released a patch release that provides support for the Jaxer server on Linux. Read on to learn more details about this release.

New Release

Earlier this week, Aptana released new "nightly" builds of both Aptana Studio (v.1.1.3) and the Jaxer server (0.93). Aptana Studio 1.1.3 contains several bug fixes. Jaxer 0.93 contains several major new additions including support for Linux and integration with Amazon's EC2 technology. You can read more about these developments on our blog:

Community Buzz

Frequent visitors to the Aptana web site may have noticed some changes recently. We've been in the process of re-organizing some of our documentation in order to make things easier for the community to find. One recent major addition that we've made is the Book of Jaxer, which is now the main landing page for all of our Jaxer documentation. Additionally, we've compiled a new FAQ page for Aptana Studio, which should answer most of your questions about Aptana Studio licenses and otherwise help you get started with Studio.

If you're having trouble finding a certain piece of information or notice that we're missing a Help topic on something, please file a new request in ASAP, and we'll try to get the information added to the site as quickly as we can.

Tips and Tricks

Are you new to Jaxer development, but aren't quite sure how to get started? Our new Jaxer Quick Start Guide is a fast and easy way to walk through the entire process. This guide covers all of the basic information that you'll need to get started with Jaxer, including installation, creating your first Jaxer project, and resources for learning more.

Jaxer Server now on EC2

Are you looking for a quick and easy way to deploy your Jaxer applications? You can now take advantage of the cloud technology provided by Amazon's Elastic Compute Cloud (also known as EC2). EC2 provides you with a fast way to get going with Jaxer and to deploy it on a hosted infrastructure. With your own EC2 instance, you can make your Jaxer applications available for both private and public consumption.

The Jaxer Team has set up a CentOS image with Jaxer pre-configured and ready to go. Find out how to get your own instance running (and more) on the Running an EC2 Instance of the Jaxer Server page.

We'd love to hear about what you're building with Jaxer, so if you're working on a Jaxer app or just have a few questions about Jaxer, we'd like to invite you to participate in our Jaxer community forums.

Jaxer Server Now on Linux

The Jaxer Team is proud to announce that we now support Jaxer for several Linux platforms:

  • Ubuntu
  • CentOS
  • Fedora

To learn how to get up and running on Linux, see the Jaxer Standalone Installation guide for Linux.

We've been working with volunteer beta testers within the Jaxer community to bring you these distros, and we plan to support additional distros in the future. However, this is our initial release for Linux support and because the various Linux platforms have so many nuances, some Linux platforms could likely still have some issues. Our Linux support is very community driven, so we invite you to participate in the platform vote on the forums to voice your opinion about your preferred platform:

http://forums.aptana.com/viewtopic.php?t=4844

If you have Jaxer up and running on a platform that we have not listed, let us know so we can add it to the list of supported platforms. Additionally, if you need help troubleshooting issues with Jaxer on your Linux platform, post your questions on the Jaxer forums.

A very simple file based blog on Jaxer

This tutorial is a sample of some functionality you can quickly achieve in Jaxer. In this case we'll be building a very basic file-based "blog".

The idea is simple: Create an HTML page that will show all the "posts". A post is created by creating or FTPing a txt file to the server and naming it so it will appear in the order desired. We'll also add the ability to use Markdown syntax in the txt file so you can easily do some basic HTML without the HTML syntax.

You can easily extend this to add a page where posts can be written and previewed, re-ordered/renamed, move to using a DB instead of txt files, etc.

We'll want a folder named "articles" as a sub-folder of our project. Next we'll create a simple index HTML page as a peer of that folder, with a div inside the body containing the id "posts".

<html>
<head>
<title>My Blog</title>
</head>
<body>
<h1>My Blog</h1>
<div id="posts"></div>
</body>
</html>

To get started writing server side Javascript we 'll add a script tag in the head with a runat attribute set to server:

<script runat="server">
</script>

Jaxer has a nice API that allows you to work with the filesystem directly on the server. We're going to take advantage of that to have it grab files inside the "articles" folder that is a peer of our html file on the server:

function init() {
var path = Jaxer.Dir.resolve("articles");
var dir = new Jaxer.Dir(path);
var files = dir.readDir().map(function(file) {
return file.leaf;
});
}

Now we have a function which grabs the "articles" directory and then gets a listing of all the filenames inside that directory. Next we want to loop over the files, read in their contents and append it to a string that we'll be pushing back into the div with id "posts".

var html = "";
for (var i = 0; i < files.length; i++) {
var read = Jaxer.File.read("articles/" + files[i]);
html+= read;
}
document.getElementById('posts').innerHTML = html;

Pretty simple. We read all the files, concat their contents together into a string and then push that into the posts div. We can try it out by having this function run when the server has loaded the page/DOM. We just modify the body tag like so:

<body onserverload="init();">

This tells Jaxer to run our init function when it has completed creation of the page's load process.

Obviously, concatenating all the files contents together doesn't look too nice. Lets wrap each file's contents in a div with class "post" so we can style it later.

var read = Jaxer.File.read("articles/" + files[i]);
html+= makePost(read);

function makePost(contents) {
return "<div class=\"post\">" + contents + "</div>\n";
}

That's much better. Now we don't have all the files in one giant string.

But this hasn't bought us much - we still have to write the HTML tags inside the txt files if we want to do any styling or marking up of the content. Let's provide a markup syntax to allow users to use simple text conventions to generate HTML. One such library is Markdown. We're going to use a nice Markdown in JS library provided from: http://softwaremaniacs.org/playground/showdown-highlight/

It's pretty simple to use. First we include the library on the server side:

<script src="showdown.js" runat="server"/>

Next, we use it to mark up the file's contents before we wrap it in the div:

...
var read = Jaxer.File.read("articles/" + files[i]);
html+= makePost(markdown(read));
...
function markdown(content) {
var converter = new Showdown.converter();
return converter.makeHtml(contents);
}

And there you have it. We now have a blog index page which will grab all of our article text files, run them through markdown and insert them into post divs for us.

To wrap up here's the full code:

<html>
<head>
<title>Articles</title>
</head>
<script src="/showdown.js" runat="server">
</script>
<script runat="server">
var converter = new Showdown.converter();
function createPost(contents){
// Run markdown filter on contents
var text = converter.makeHtml(contents);
return "<div class=\"post\">" + text + "</div>";
}
function init() {
try {
// read all the articles in text files in "articles" sub-dir of this dir (#.txt)
var articlesPath = Jaxer.Dir.resolve("articles");
var files = new Jaxer.Dir(articlesPath).readDir();
var string = "";
var i = 0;
for (i = 0; i < files.length; i++) {
var filename = Jaxer.Dir.combine(articlesPath, files[i].leaf);
if (new Jaxer.FileUtils().ext(filename) == "txt") {
var raw = Jaxer.File.read(filename);
string += createPost(raw);
}
}
document.getElementById('output').innerHTML = string;
}
catch (err) {
document.getElementById('output').innerHTML = err.description;
}
}
</script>
<body onserverload="init()">
<div id="output"></div>
</body>
</html>

Jaxer integration with Apache Tomcat released

A how to guide on integrating Jaxer with Apache Tomcat has been released.

This guide walks you through how to enable Jaxer to post-process your HTML and JSP pages for your Tomcat web applications. The tutorial includes two WAR files, one that adds support for Jaxer callbacks on your Tomcat pages and the other includes samples on possible ways to integrate Jaxer with your JSP/HTML pages.

Jaxer also has a connector available for the Jetty HTTP server which is used inside Aptana Studio.

Please use this forum thread to discuss the Jaxer-Tomcat connect

The Power of Mozilla - Now Playing at a Server Near You

Jaxer lets you use your full stack of Ajax technologies — HTML, JavaScript, DOM manipulation, XHR, etc. — on the server, to make web application development a lot smoother and more natural.

But Jaxer is also based on the Mozilla engine, in fact on the same core that will power Firefox 3, just without the rendering. And this simple fact unlocks a lot of power that's been built up over many years by Mozilla developers. Unless your apps and sites have targeted Firefox exclusively — unlikely, given its market share — they could not rely on JavaScript features beyond version 1.4. And how about the numerous extensions that have been developed for Firefox, some of which actually ship with the browser? Most developers don't even know about them, and they couldn't rely on them being available to most of their target audience.

But now all that Firefox 3 goodness is under the hood of your Jaxer, on the server side, under your full control. So if JavaScript 1.7 and 1.8 generators, iterators, and array comprehensions float your boat, then happy sailing. Soon native JSON parsing and encoding will be available, along with other features on the march towards JavaScript 2. Perhaps more significantly, you have a rich SOA stack: SOAP, WSDL, and other four-letter friends from the enterprise architect's bestiary. Microformats, anyone? Simply use the script loader to import the built-in Microformats.js and you have access to hCard, hCalendar, and other functionalities. XSLT transformations are at your fingertips by just "new"ing up an XSLTProcessor object. There are all sorts of hidden gems to discover: did you know there's a very nice RDF subsystem in there? How about base64 encoding and decoding? Try typing for (var p in Components.classes) { print(p); } in the Jaxer Shell to see that we've just scratched the surface of what's available.

Of course, if you don't see something you need, you can always just build it: think server-side GreaseMonkey scripts on steroids. I can't wait to see what people will come up with, now that all these capabilities are free from their browser dependence. There's already been a number of cool examples on various blogs, and we'll start to roll out more on a regular basis. More importantly, we'll make it easy to share your own samples and snippets with the community. Stay tuned...

Aptana recap: Aptana Studio 1.1.1 release coming soon

With the excitement of the 0.9 release of Jaxer and the Aptana Studio 1.1 release behind them, the Aptana development team spent the past week working on the first patch release for 0.9/1.1. The Aptana community should have access to these patches early next week.

New Release

The upcoming Aptana Studio 1.1 release will be a patch release that fixes several bugs in 1.1, including the following issues:

  • An encoding bug where workspace text encoding isn't saved after re-starting Aptana (STU-1111)
  • A bug involving CSS pseudo classes (STU-1035)
  • A bug in Prototype code assist involving the $() function(STU-134)

Tips and Tricks

We're aware that some users have been having difficulty installing the recent updates to Aptana Studio. The team is working on isolating the causes of this issue and hope to improve the situation soon. In the meantime, if you have been unable to download/install the updates, try performing a manual installation as directed on the update site:

http://update.aptana.com/update/3.2/

Community Buzz

We see a lot of bug reporting and feature requests on the forums; however, the best way to get support or to request a new feature is to fill out a ticket in ASAP

http://support.aptana.com/issues/

By filing a ticket in ASAP, you enable us to track the status of a ticket more easily, and you can also easily search for related bugs and feature requests.

Next Week

Next week, we'll get started with work on the 1.2 release. Current plans for the 1.2 release include a number of updates to the Ajax libraries bundled with Aptana Studio (EXT, Yahoo UI, etc.) and a migration to the Eclipse 3.3 platform as the base platform for Aptana.

Aptana releases support for Adobe AIR Beta 3

We are pleased to announce that our Adobe AIR plugin for Aptana Studio now supports beta 3 of the Adobe AIR SDK.

This release requires Aptana Studio 1.1 or later which can be downloaded here.

What's new in this release:

  • Inclusion of the AIRIntrospector.js allowing inspection of running applications by pressing F12
  • Updated sandbox samples for both application and non-application models
  • New fields added to the application.xml wizard page making it easier to create the initial configuration of your application
  • Updated samples compatible with the Adobe AIR Beta 3 SDK

Instructions to install Adobe AIR beta 3 support

Aptana Jaxer -- An Entirely New Kind of Server

Wow, it’s been a long road getting to this release date, but I am very excited and proud of our team, and I'm happy to say that today we released our beta 1 of Jaxer -- what we believe to be the first true Ajax Server product.

So what is an “Ajax Server”? Simply put, we unify the development model for Ajax developers. That is, write “Ajax” code client AND server. The same APIs, the same JavaScript, the same HTML and best of all, manipulate the DOM on the server.

What does all that mean? It means that you can do a getElementById() and set its innerHTML on the server side just as easily as you can on the browser. You can write a single JavaScript function and share it between browser and server. You can write server functions which can be transparently called from the browser -- synchronous or asynchronously.

If you’re a beginning Ajax developer and any of that sounds complicated, it’s not. It simply means you can now build an entire Web 2.0 application, client and server, using only the Ajax technologies you love.

I asked several of the leaders in the Ajax space to join with us and with you, the Ajax community, in defining where we go from here. I’m very honored to say that we’ve got an all-star group assembled as our Aptana Advisory Board, just take a look at this who’s who list.

We’ve placed a few screencasts online so you can take a quick look at what Jaxer is all about and how you can start playing with it right away.

Send us your feedback, your suggestions, and tell us what you are building. After all, building a free, open-source product ultimately means we’re building this for you!

Regards,
Paul Colton

Aptana Studio 1.1 now available to all users

Earlier this week, the Aptana team rolled out a beta version of the upcoming Aptana Studio 1.1 release to our Pro users. This release contains many new features and implements some of the most popular feature requests we’ve gotten in recent months. Read on to learn more about the upcoming 1.1 release.

New Release

The release of Aptana Studio 1.1 is now available all users. This release contains many new features, including some of the most-often requested features by our users. Some of the highlights of 1.1 include the following enhancements:

  • A new Servers View to manage the servers for your projects
  • Enhanced HTML preview preferences:
    • Manage your preferences on a per-project basis
    • Set a root directory other than the project root for preview
    • Assign a run configuration or a server to a project
  • Code Assist Profiles View renamed to “References View”…now with the ability to add global references, such as adding the EXT framework to your coding environment
  • Editor toolbars: Each Editor now has a toolbar for common commands/shortcuts, such as wrapping selected text with a “bold” tag
  • Multi-line file search now added to “Search” functionality

Tips and Tricks

Do you have a suggestion for a new feature for Aptana Studio? Submit your feature request to the ASAP database. This will allow other users to “vote” on your feature request and help us plan future releases.

Community Buzz

We are aware that some users are encountering problems as they try to update Aptana Studio. We are working on this issue and hope to have it fixed soon. In the meantime, the more information that we can gather from our user community, the easier it will be to pinpoint the issue. If you do encounter an error while trying to update Aptana Studio, please file a bug report in the ASAP database, or add your comments to an existing issue.

Syndicate content