AWS Community Day CPH - Three problems of Terraform
Java Script from Browser to Server
1. JavaScript from Browser to
Ruchira Wageesha & Manuranga Perera
Last Updated: March 2014
Server
Jaggery Team
2. *
About the Presenters
๏ Ruchira is an Associate Technical Lead who mainly
focuses on the WSO2 User Engagement Server, WSO2
Enterprise Store and Jaggeryjs. He also has engaged in
several customer engagements and QuickStart
programs. Additionally, he is conversant in Mozilla
Rhino, XSLT and server-siide JavaScript.
๏ Manuranga is a Senior Software Engineer at WSO2.
His focus areas include programming languages and
algorithm design as well as dynamic front-ends. He
holds a BSc in Computer Science and Engineering from
University of Moratuwa, Sri Lanka. As part of his final-year
research project, he developed a Dynamic Rule-
Based Load Balancing Framework (a software-based
load balancing framework that has the ability to
dynamically change the load balancing scheme for
improving performance).
3. *
About WSO2
๏ Global enterprise, founded in
2005 by acknowledged leaders in
XML, web services technologies,
standards and open source
๏ Provides only open source
platform-as-a-service for private,
public and hybrid cloud
deployments
๏ All WSO2 products are 100% open
source and released under the
Apache License Version 2.0.
๏ Is an Active Member of OASIS,
Cloud Security Alliance, OSGi
Alliance, AMQP Working Group,
OpenID Foundation and W3C.
๏ Driven by Innovation
๏ Launched first open source API
Management solution in 2012
๏ Launched App Factory in 2Q 2013
๏ Launched Enterprise Store and
first open source Mobile solution
in 4Q 2013
5. *
Outline
๏ Introduction to Jaggery
๏ Writing web applications using Jaggery
๏ Accessing Java from Jaggery
๏ Working with the WSO2 platform through Jaggery
๏ Demo
6. *
What is Jaggery
๏ JavaScript based web framework
๏ Bit similar to PHP
๏ Can think it as PHP where the language is JavaScript
7. *
Why Jaggery
๏ There are so much of web frameworks
๏ .NET, node/expressjs, ruby, python, Java
8. *
Web Developers
๏ Always work with JavaScript for their front ends
๏ Will have to work with a different language for their backend
๏ Deal with JSONs most of the time
9. *
Why Jaggery
๏ What if they can use the same frontend skills for backends as well
๏ Still enjoy all favorite Java APIs from JavaScript
๏ Synchronous programing pattern
10. *
Jaggery Overview
๏ Based on WSO2 Carbon Platform
๏ Uses Mozilla Rhino for JavaScript execution
๏ Requests are served by Java Servlets
๏ Inherits all other features of a carbon server
๏ e.g. Multitenancy, Dep Sync etc.
11. *
Jaggery Features
๏ Access Java from JavaScript
๏ No more code compilation
๏ edit, save, refresh
๏ Connecting with any JDBC/NoSQL databases
๏ Either using built in Database object or using Java APIs
๏ SOAP service invocation using WSRequest object
๏ REST service invocation using
๏ XMLHttpRequest
๏ jQuery get/post like simplified methods
12. *
Jaggery Features
๏ WebSockets support
๏ Log4j based logging configurations for your apps
๏ Expandability through Jaggery modules
13. *
Jaggery Tooling
๏ Dev Studio editor, debugger
๏ IntelliJ editor plugin
๏ VIM
๏ Sublime
14. *
Jaggery Web Development
๏ HTTP request information access
๏ request, response, session objects
๏ Application level configurations
๏ application object
๏ Application lifecycle scripts
๏ initScripts and destroyScripts
๏ URL mappings through jaggery.conf
๏ Basic auth through jaggery.conf
15. *
Jaggery Web Development
๏ Organize your code using include(), include_once() and require()
๏ File object to read/write files
๏ URIMatcher for implementing RESTful APIs
๏ Database object to work with JDBC/Cassandra databases
๏ connection pooling through carbon data sources
๏ E4X for dealing with XMLs
16. *
Carbon Platform Integration
๏ Easy integration with WSO2 carbon platform through carbon module
๏ Work with WSO2 Governance Registry APIs
๏ Consume WSO2 Governance Artifacts
๏ Deal with platform user stores
๏ Work with tenants and implement Multi-tenanted SaaS apps easily
๏ E.g. Enterprise Store, API Manager, User Engagement Server etc.