Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Oracle JET for Developers
Oracle JET for Developers

Oracle JET for Developers: Implement client-side JavaScript efficiently for enterprise Oracle applications

Arrow left icon
Profile Icon Malleswara Rao Pattamsetti
Arrow right icon
€32.99
Paperback Dec 2017 282 pages 1st Edition
eBook
€17.99 €26.99
Paperback
€32.99
Subscription
Free Trial
Renews at €18.99p/m
Arrow left icon
Profile Icon Malleswara Rao Pattamsetti
Arrow right icon
€32.99
Paperback Dec 2017 282 pages 1st Edition
eBook
€17.99 €26.99
Paperback
€32.99
Subscription
Free Trial
Renews at €18.99p/m
eBook
€17.99 €26.99
Paperback
€32.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Table of content icon View table of contents Preview book icon Preview Book

Oracle JET for Developers

Getting Started with Oracle JET

Rapid application development is the trend of building web applications today with the evolution of web 2.0 and the web frameworks. They are no more just represent the View portion of the MVC architecture, but also cover the responsibility of MVC architecture on the application interface (client-side MVC). This has become a reality with the growth of a number of web frameworks over the last decade. This has motivated organizations like Google and Facebook to develop frameworks such as Angular JS and React JS, which are ready to serve cloud application architecture. The Oracle Corporation observed the trend and appraised the future needs of web applications and developed a simple but efficient web framework by integrating Oracle and open source JavaScript libraries. 

In this chapter we will cover:

  • Getting started with Oracle JET
  • How to bootstrap your first Oracle JET project
  • Setting up npm and Node.js
  • Installing Yeoman and Grunt
  • Installing Oracle JET generator
  • Creating a project using the command line
  • Running a project with Grunt
  • Managing and running the project using the NetBeans IDE

Getting started with Oracle JET

Oracle JavaScript Extension Toolkit (JET) is an engineered toolkit containing the Oracle and open source JavaScript libraries. It supports the Model-View-ViewModel (MVVM) architecture, which allows the model to represent the application data, the view for the presentation, and the ViewModel to help manage the application state and expose data from the model to the view. The framework empowers the application developers by providing an open source modular toolkit developed using the recent JavaScript, HTML5, and CSS3 architecture principles. Oracle JET helps developers build both web-based and hybrid (mobile) applications that can easily integrate with other server-side applications and products running on cloud environments as well. It uses the trendy Oracle Alta UI for adding the application and to easily match your business context.

The following diagram represents the Oracle JET framework alignment in MVVM design:

Oracle JET features

The following are the set of features provided by the Oracle JET framework:

  • Comprehensive toolkit for web development
  • Embeds the widely known open source frameworks
  • Single-Page Application development support with template-based architecture and a powerful routing system
  • Built-in support for accessibility
  • Messaging and event services for both the model and view layer
  • Great support for internationalization, with more than 28 languages and 180 locales
  • Set of efficient and useful UI components with a validation framework
  • Two-way binding at its best
  • Better resource organization
  • Built-in support for mobile application development
  • Caching to support efficient pagination
  • Support for REST service invocation 
  • Integrated authorization using the OAuth 2.0 data model for REST services
Single-Page Applications (SPAs) are web apps that load a single HTML page and dynamically update that page as the user interacts with the app. SPAs use AJAX and HTML5 to create fluid and responsive web apps without constant page reloads. 

Oracle JET makes use of the following popular open source libraries along with JET components:

  • jQuery: JavaScript library with a range of useful utilities for REST, AJAX, animations, and JSON handling
  • jQuery UI: Helps in wrapping the Oracle JET components as robust UI components
  • Knockout JS: Provides two-way data binding support
  • RequireJS: Provides modularity and lazy loading of the resources via Asynchronous Module Definition (AMD)
  • Syntactically Awesome Style Sheets (SASS): Extends CSS3 to enable nested rules, inline imports, and mixins
  • Apache Cordova: For hybrid (mobile) application development
  • Oracle Alta UI: The UI design system for trendy interface design

Bootstrapping your first Oracle JET project

Generating your first Oracle JET project, managing it using an IDE, and running it on your computer is way easier with a modern set of tools and techniques such as Node.js, npm, Yeoman, and Grunt.

All this can be achieved using the standard mechanism including the following steps: 

You can also use other techniques, such as generating the project using IDE plugins or downloading the ZIP version of the templates and importing them into projects. ZIP versions are available for download at http://www.oracle.com/technetwork/developer-tools/jet/downloads/index.html.

Setting up npm and Node.js

Before setting up npm and Node.js, let us understand these terminologies and how they help us in application development. Node.js is a JavaScript runtime environment built on Chrome's V8 JavaScript engine. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient. npm from Node.js is the package manager for JavaScript which helps in discovering the packages of reusable code and assembles them in powerful new ways. By using npm, you can install, share, and distribute your code easily and manage the project dependencies wisely. Node.js installation comes with npm and can be downloaded and installed from its home page.

We used the latest stable version available (v6.11.1 LTS) for the setup, as shown in the following steps:

  1. Download Node.js, installable from its home page (https://nodejs.org/en/).
  2. Run the installable, which starts up with the following interface:
  1. Click Next and accept the terms in the following interface: 
  1. Choose the installation directory. I am happy with the default directory provided and continue to the Next step, as follows:
  1. The next step gives us the Node.js runtime engine and npm package manager along with the documentation shortcuts and path entries. We can leave the default options selected and go to the Next step, which takes us to the final step:
  1. Click on the Install button, which should install Node.js, along with the npm package manager, on your computer:
Please be advised that neither the Node.js nor the npm have GUI. They are only accessible through the command line interface, hence you would need to run the commands on the command line.
  1. Once the installation is complete, you should see the success status as follows:
  1. Once the Node.js and npm installation is complete, you can open the command prompt and verify the installation and version using the commands shown in the following screenshot:

Installing Yeoman and Grunt

Yeoman is the scaffolding tool for web applications, and easily kick starts your new web project development, ensuring the best practices are covered. This means that you don’t have to go through the initial project setup tasks you would normally go through to get started; instead, get ready to use application structures along with modular architecture.

Grunt is a JavaScript task runner, a tool used to automatically perform frequent tasks such as minification, compilation, unit testing, linting (the process of running a program that will analyze code for potential errors), and so on. It uses a command-line interface to run custom tasks defined in a file (known as a Gruntfile). Grunt helps in automating the tedious non-functional activities such as minimization, compilation, unit testing, and linting. It's much easier than the method we have been using for years.

We can install them together using the following command: 

npm -g install yo grunt-cli

This should complete the installation, as shown in the following screenshot:

Installing Oracle JET generator

Oracle JET generator is a Yeoman generator for Oracle JET maintained by the Oracle Corporation. It helps us rapidly perform the project setup for a web application or hybrid mobile application on Android, iOS, or Windows.

It can be installed using the following command:

npm -g install generator-oraclejet

This should complete the installation, as shown in the following screenshot: 

Creating a project using the command line

Once Node.js, npm, Yeoman, Grunt, and the Oracle JET Yeoman generator are installed, we shall create a new project using the oraclejet command. The beauty of this command is that it generates the project with the name given by the readily available project, which is already created and stored in the node library with the code generator. The following are the steps involved in creating the project with this command:

  1. The oraclejet Yeoman command with the project name parameter creates the project with the name provided:
      yo oraclejet <project name> --template=navdrawer
  1. We are using the project name OracleJETSample, which should complete the project creation, as shown in the following screenshot:
  1. Once the project creation and verification is complete, the status of the application is ready, as follows:

Running a project with Grunt

  1. Once the project has been created in the preceding step, it can be built using the following command:
      cd <project name>
grunt build
  1. The preceding command should complete the project build, as shown in the following screenshot:

  1. Once the project is built successfully, it can be executed using the following command:
      grunt serve
  1. The preceding command should run the project, as shown in the following screenshot: 
  1. Once the project has started running, it should open the application, running in the default browser, as follows:

The default application was created using the navdrawer template, hence it is showing up with the default navdrawer template. We can open the project code in our favorite IDE and edit it to run again using the Grunt serve command.

However, the NetBeans IDE is providing the built-in plugins and support for npm and Grunt to manage these build and serve activities within the IDE. In addition, NetBeans provide great syntax advice and support for these plugins. Let's review the IDE installation, configuration, and usage in the following section.

Managing and running the project using NetBeans IDE

NetBeans Integrated Development Environment (IDE) provides a quick and easy way to develop desktop, mobile, and web applications with Java, JavaScript, HTML5, and other programming languages.

It can be downloaded and installed from its home page: https://netbeans.org/

Once the NetBeans IDE is installed, we can open the project using File | Open Project and select the project root folder, which opens the project in the IDE as follows:

NetBeans automatically identifies this project as an npm Grunt project and shows the directories accordingly. We can expand and review the folder structure. 

Right-clicking on the project root folder and selecting the Build command (as follows) gives us the option: 

The preceding Build option prompts you to configure project actions to call Grunt tasks from within NetBeans IDE. Choose Yes to open the configuration window:

Select all the options (checkboxes) and click OK to run Grunt commands enabled in the project actions, as follows:

Right-click on the project root folder again and click on the Build option to let Grunt build the project within the IDE, as shown in the following screenshot:

Once the project is built, select the project by clicking on the project root folder, and choose the Chrome option from the menu icons as shown in the following screenshot:

It will prompt you to select the start file; you can choose the web/index.html as the start file for the project. Click OK to run the project:

The application should open and run in the Chrome browser (assuming we already have the Chrome browser installed). The first time, it prompts you to install the Chrome NetBeans connector plugin; choose Yes to install it. This allows the pages to refresh automatically for future changes, through a NetBeans connection to the browser.

The application should be running and will show the landing page in the browser as follows:

This means that we have successfully built our first Oracle JET application and have run it using both command line and IDE instructions. We can make further changes to the application and observe the changes on web pages, which we will cover in the upcoming chapters.

Summary

Throughout this chapter, we learnt about the essential Oracle JET framework architecture and how it helps us build modern web applications. We also learnt the steps to be followed to generate a template-based, Single-Page Application with the help of tools and techniques including Node.js, npm, Yeoman, Grunt, and Oracle JET generator. We finished this chapter by understanding the NetBeans IDE, managing the project, and building and executing stages from within the IDE. 

In the next chapter, we will learn in detail about the Oracle Alta UI framework, used for building the Oracle JET framework.

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Develop resilient and robust client-side applications
  • Explore the power of popular JavaScript libraries such as jQuery, RequireJS, and custom Oracle JavaScript libraries
  • Integrate JavaScript for Oracle developers
  • Easily debug and secure your cloud interfaces

Description

This book will give you a complete practical understanding of the Oracle JavaScript Extension Toolkit (JET) and how you can use it to develop efficient client-side applications with ease. It will tell you how to get your own customized Oracle JET set up. You'll start with individual libraries, such as jQuery, Cordova, and Require.js. You'll also get to work with the JavaScript libraries created by Oracle, especially for cloud developers. You'll use these tools to create a working backend application with these libraries. Using the latest Oracle Alta UI, you'll develop a state-of-the-art backend for your cloud applications. You'll learn how to develop and integrate the different cloud services required for your application and use other third-party libraries to get more features from your cloud applications. Toward the end of the book, you'll learn how to manage and secure your cloud applications, and test them to ensure seamless deployment.

Who is this book for?

If you are a web components developer looking to create client-side apps that are resilient and robust using Oracle JET, then this book is the right choice for you.

What you will learn

  • Use Yeoman or npm to start a new Oracle JET-based project
  • Implement real-world use cases using Oracle JET components
  • Get to know the best practices for Oracle JET web applications
  • Explore Knockout.js, the framework behind Oracle JET
  • Implement a multi-platform app with OJ and Cordova
Estimated delivery fee Deliver to France

Premium delivery 7 - 10 business days

€10.95
(Includes tracking information)

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Dec 08, 2017
Length: 282 pages
Edition : 1st
Language : English
ISBN-13 : 9781787284746
Vendor :
Oracle
Languages :
Tools :

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Estimated delivery fee Deliver to France

Premium delivery 7 - 10 business days

€10.95
(Includes tracking information)

Product Details

Publication date : Dec 08, 2017
Length: 282 pages
Edition : 1st
Language : English
ISBN-13 : 9781787284746
Vendor :
Oracle
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 111.97
RESTful Java Web Services
€36.99
Java EE 8 Application Development
€41.99
Oracle JET for Developers
€32.99
Total 111.97 Stars icon
Banner background image

Table of Contents

10 Chapters
Getting Started with Oracle JET Chevron down icon Chevron up icon
Oracle Alta UI Chevron down icon Chevron up icon
Tool Integration Chevron down icon Chevron up icon
Knockout JS Chevron down icon Chevron up icon
Oracle JET Components – Form Elements, Controls, and Data Collections Chevron down icon Chevron up icon
OJ Components – Layouts, Navigation, and Visualizations Chevron down icon Chevron up icon
Framework Chevron down icon Chevron up icon
Hybrid Mobile Application Development Chevron down icon Chevron up icon
Testing and Debugging Chevron down icon Chevron up icon
Security and Version Migration Chevron down icon Chevron up icon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact [email protected] with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at [email protected] using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon Chevron up icon

Return Policy:

We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on [email protected] with the order number and issue details as explained below:

  1. If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on [email protected] within one hour of placing the order and we will replace/refund you the item cost.
  2. Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on [email protected] who will be able to resolve this issue for you.
  3. You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
  4. Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
  5. If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
  6. Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.

On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on [email protected] within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.

What tax is charged? Chevron down icon Chevron up icon

Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.

What payment methods can I use? Chevron down icon Chevron up icon

You can pay with the following card types:

  1. Visa Debit
  2. Visa Credit
  3. MasterCard
  4. PayPal
What is the delivery time and cost of print books? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela