Jaggery
This chapter contains the following information:
Note
The screenshots in this section may vary depending on the product and the configuration options you are using.
Introduction to Jaggery
Jaggery is a framework to write Web applications and HTTP-focused Web services purely in Java Script, for all aspects of the application: front-end, server-side logic, communication and persistence. It is 100% open source and delivered under Apache license 2.0.
There is a myriad of different front-end and back-end technologies with multiple levels of data communication involved in Web development today. The biggest challenge in working with a pool of different technologies is preserving information integrity and consistency when it is passed through and converted from one technology to another. Jaggery successfully addresses most of these challenges.
The most powerful use case of Jaggery is handling any part of a Web application development through a single JavaScript framework - a single language and a single data format. This eliminates mismatches across different layers introduced by data conversion, and enables to create both applications and APIs at the same time, bridging the gap between Web applications and HTTP-focused Web services.
Given below are some of the main features and capabilities of Jaggery.
- Jaggery is developed on top of the component-based WSO2 Carbon platform, which is the award-winning enterprise run-time for application and Web service hosting. It consists of just the right set of components required for efficient functioning. As a result, Jaggery is lean and lightweight.
- Because of its component-based architecture, Jaggery can be easily provisioned by plugging in additional component to it.
- Jaggery is extremely agile and flexible. Most JavaScript application development mechanisms restrict developers to a framework-specific structure or pattern, demanding an additional learning curve. In contrast, Jaggery does not require adherence to a specific Web development standard or procedure. Users have the flexibility to write their scripts any way they want and simply execute on the Jaggery deployment engine without compilation or any kind of pre-processing. Development is as simple as writing your script and just dropping in to the Jaggery framework for auto-deployment. Jaggery smoothly and seamlessly decouples developers from the framework, allowing them to simply concentrate on the business logic.
- Jaggery is also cloud-enabled, which will soon be available with WSO2 Stratos for public and private cloud deployments, allowing users Web development and deployment capability on the Cloud.
- Jaggery talks smoothly in JSON. Clients can instantly send JSON information to the server and the application is capable of understanding the data format
- Jaggery has embedded URL pattern recognition and pattern matching libraries. Being able to handle URL patterns is a useful feature in Web application and API development.
- In-built capability to communicate with databases such as embedded H2, MySQL, Oracle etc.
- Jaggery scripts can be executed through a shell, which assists debugging.
Info
For more information on Jaggery, a quick-start guide, samples and documentation and a hands-on experience of this evolving product, refer to http://jaggeryjs.org.
Deploying Jaggery Applications
WSO2 supports Apache tomcat based Jaggery application deployment through the following feature in the WSO2 feature repository:
Name: WSO2 Carbon - Jaggery Server Feature
Identifier: org.wso2.carbon.jaggery.server.feature.group
If Jaggery application management capability is not included in your product by default, you can add it by installing the above feature using the instructions given in section Feature Management. This feature is bundled by default in the WSO2 Application Server (version 5.0.0 onwards).
Before deploying a Jaggery application through the Management Console, bundle it as a '.zip' archive with all the Jaggery application-related resources and third-party libraries.
Follow the instructions below to deploy the file in a running Carbon instance.
1. Log on to the product's Management Console. Click "Add" under menu "Jaggery Applications ."
2. The "Upload Jaggery Applications" page appears. Select your file and click "Upload."
If you want to add multiple services at the same time, click on the '+' sign next to the "Browse" button.
3. If the Jaggery application was deployed successfully, a message appears saying it was successful and the "Running Applications" window opens. For example,
If the Jaggery application is faulty, a "Faulty Jaggery Application Groups" link will appear. You can click the link to view the errors.
Note
Instead of using the Management Console, you can manually place the .zip file in <PRODUCT_HOME>/repository/deployment/server/jaggeryapps and it will be deployed. Instead of creating a zip file, you can also add the resource files such as style sheets, images, java scripts etc. in the said location (preferably within a folder) along with the index.jag file. The files will be auto deployed.