JoyentJoyent

Day One. Here we go!.

In our first approach to the Smart Platform we’re going to try to understand what is every file for, create our first application and start adding the first routes and actions.

We’ll try to complete a RESTful application to manage tasks during these articles and, to get started, we’ll take care of retrieving either a collection of our resources or a single instance and, of course, to create new ones.

Also, this is our first look at Smart Platform Templates; we’ll only describe the basic things like setting a variable or looping over a collection of resurces. Conditionals, includes and other template options will be covered as we go.

And now, let’s see how to get half of the application done in less than five minutes!.

Continue readingDay One. Here we go!.»

Day two: Proper HTTP PUT & DELETE with jQuery.

In our previous article we learnt how to create a basic application for the Smart platform, the meaning of some relevant files and added the first couple of actions for our RESTful TODO list application. Now, we’re about to complete our Task Resource by adding the routes and functions to allow for modifications and deletion of Tasks.

Continue readingDay two: Proper HTTP PUT & DELETE with jQuery.»

Day three: com.joyent.Resource hooks and the search method.

Once we’ve got our basic RESTful task resource, we’re about to convert our tasks list into a sortable collection because, well, priorities in life change, and we might need to reorder our pending stuff.
We’ll review the different options provided to filter our searches, sort them, limit the number of results. Also, we’re going to review some of the available hooks which allow us to perform additional operations during the life cycle of our Resources.

Continue readingDay three: com.joyent.Resource hooks and the search method.»

Day Four: Smart Platform and JavaScript libraries

Now that we have a working tasks application, seems to be the perfect moment to start polishing it a bit with the help of the available JavaScript libraries on the Smart Platform. We’ll add a bit of privacy to our application, requiring user login in order to access our tasks list and learn about application level hooks.
Then, we’ll review how to add our own libraries and, of course, start using them too.

Continue readingDay Four: Smart Platform and JavaScript libraries»

Day five: Smart XML fun with E4X

We’re going to continue our walkthrough across the different libraries provided by the Smart Platform and some other goodies. As you might now, the Smart Platform comes with all the available features of core JavaScript 1.8, which includes E4X, a programming language extension that adds native XML support to JavaScript.

During this article we’ll learn how to use it for both, processing and generating our XML documents, how to tell the browser about content-types and start using system.http and the datejs library which also comes bundled with Smart.

Continue readingDay five: Smart XML fun with E4X»

Tips from James A. Duncan

Well, yeah, has some advantages to spend several hours daily with the platform creator. Here are some tips extracted from those daily conversations.

Continue readingTips from James A. Duncan»