Thursday, August 1, 2013

JAGGERY

What is JAGGERY


Jaggery is a javascript framework product build @wso2. It can write webapps and HTTP-focused web services for all aspectual of the application. Jaggery can easy to develop front-end,Server-side logic and persistence in pure Javascript. Jaggery is open-source and released under Apache 2.0.It can reduse gap to writing web apps and services.
Javascript is a pure server-side scripting engine, Jaggery combines all the strengths of Javascript with flexible and freely at both the developing  and deploying stages.

What is an JAG File?

  • An JAG file is just the same as an HTML file
  • An JAG file can contain text, HTML, XML, and scripts
  • Scripts in an JAG file are executed on the server
  • An JAG file has the file extension ".jag"

How to set up Jaggery  
1.Extract jaggery-0.9.0-SNAPSHOT_ALPHA3.zip to a directory you prefer.  lets call it JAGGERY_HOME
2.Navigate to JAGGERY_HOME/bin directory which contains all the Jaggery execution scripts.
3.Run sh JAGGERY_HOME/bin/server.sh   (JAGGERY_HOME/bin/server.batin windows) command to start the server
4.Point the browser URL to http://localhost:9763/taskmaster.


How To Deploy A Jaggery App
In-order to compose a Jaggery script you will need to give it a .jag extension. There are no restrictions for the directory structure, add your .jag files where ever you want, and copy the entire directory to {JAGGERY_HOME}/apps/ directory. The Jaggery Server will then deploy the directory as an application which will be shown in the management console. The directory name will be taken as the application context name. Alternatively your app could be uploaded as a .zip archive using the management console. The upload page can be found under the Add link in Jaggery Applications section.



It contains a management console, for admins to manage (deploy, reload, stop and start) Jaggery apps. Using the management console, admins can gather basic statistics about deployed applications. 
Jaggery Server is powered by WSO2 carbon OSGi Runtime 
Management console can be accessed by https://localhost:9443/admin - Username : "admin" , Password : "admin"


Please refer the Jaggery Documentaion for more Details. http://jaggeryjs.org/documentation.jag


Basic Syntax
The Basic syntax are <% %>,<%= %>,require().
This is a simple program how to write Jaggery.
  1. <%
  2. var total = 1 + 1;
  3. print(total);
  4. %>
<% %> are the escaping characters for Jaggery. All the server-side code need to be wrapped by these escape characters, so that it will execute correctly in the server.

Jaggery has print and log out puts. And it has request,response,session,application and webSocket variables. 

Jaggery has get,post put,del and XMLHTTPRequest http clients.

It has two data formats JSON and XML. Json dataformats are parse and stringify.

Data storage methods are  Database and MetadataStore. The samples are in the http://jaggeryjs.org/apidocs/rdb.jag and http://jaggeryjs.org/apidocs/metadatastore.jag.

The jiggery site has samples and it provides when your written jag is correct or not. The Try It helps for you. http://jaggeryjs.org/tryitview.jag

I think this document can give basic idea of JAGGERY. To dowanload alpha and try it out. 
                                THANK YOU!