Java Script from Browser to Server

20
Last Updated: March 2014 Ruchira Wageesha & Manuranga Perera JavaScript from Browser to Server Jaggery Team
  • date post

    19-Oct-2014
  • Category

    Technology

  • view

    390
  • download

    4

description

 

Transcript of Java Script from Browser to Server

Page 1: Java Script from Browser to Server

Last Updated: March 2014

Ruchira Wageesha & Manuranga Perera

JavaScript from Browser to Server

Jaggery Team

Page 2: Java Script from Browser to Server

**

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).

Page 3: Java Script from Browser to Server

*

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

Page 4: Java Script from Browser to Server

**

What WSO2 Delivers

Page 5: Java Script from Browser to Server

*

Outline

๏ Introduction to Jaggery

๏ Writing web applications using Jaggery

๏ Accessing Java from Jaggery

๏ Working with the WSO2 platform through Jaggery

๏ Demo

Page 6: Java Script from Browser to Server

*

What is Jaggery

๏ JavaScript based web framework

๏ Bit similar to PHP

๏ Can think it as PHP where the language is JavaScript

Page 7: Java Script from Browser to Server

*

Why Jaggery

๏ There are so much of web frameworks๏ .NET, node/expressjs, ruby, python, Java

Page 8: Java Script from Browser to Server

*

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

Page 9: Java Script from Browser to Server

*

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

Page 10: Java Script from Browser to Server

*

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.

Page 11: Java Script from Browser to Server

*

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

Page 12: Java Script from Browser to Server

*

Jaggery Features

๏ WebSockets support

๏ Log4j based logging configurations for your apps

๏ Expandability through Jaggery modules

Page 13: Java Script from Browser to Server

*

Jaggery Tooling

๏ Dev Studio editor, debugger

๏ IntelliJ editor plugin

๏ VIM

๏ Sublime

Page 14: Java Script from Browser to Server

*

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

Page 15: Java Script from Browser to Server

*

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

Page 16: Java Script from Browser to Server

*

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.

Page 17: Java Script from Browser to Server

*

Demo

Page 18: Java Script from Browser to Server

**

More Information

[1] http://jaggeryjs.org/

[2] https://github.com/wso2/jaggery

[3] https://github.com/wso2/jaggery-extensions

[4] https://github.com/manuranga/todo-app

[5] https://developer.mozilla.org/en-US/docs/Mozilla/Projects/Rhino/Scripting_Java

Page 19: Java Script from Browser to Server

**

Business Model