ADF Mobile : Data Services Java Beans. Ma Ping

Similar documents
Copyright 2012, Oracle and/or its affiliates. All rights reserved.

ADF Mobile Code Corner

ADF Mobile Code Corner

Copyright 2014, Oracle and/or its affiliates. All rights reserved.

ADF Mobile Code Corner

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

Take Your Oracle Forms on the Road Using ADF Mobile. Mia Urman, OraPlayer & Denis Tyrell, Oracle Corporation

Oracle Fusion Middleware

Oracle Fusion Middleware 11g: Build Applications with ADF Accel

Oracle Retail Accelerators for WebLogic Server 11g

ADF Code Corner. 70. How-to build dependent list boxes with Web Services Business Services. Abstract: twitter.com/adfcodecorner

Mobile Application Development: Introducing ADF Mobile Native Client Framework

Java EE 6: Develop Web Applications with JSF

Real Application Security Administration

ADF Mobile Code Corner

Oracle Exam 1z0-441 Oracle Mobile Development 2015 Essentials Version: 6.0 [ Total Questions: 85 ]

New Features in Java language

Java SE7 Fundamentals

API Documentation. Web Application Development. Zsolt Tóth. University of Miskolc. Zsolt Tóth (University of Miskolc) API Documentation / 28

1Z0-441

Java EE 7: Back-end Server Application Development 4-2

Real Life ADF Mobile. 10 things that you don't get from the developer guide

Developing Cross Device Mobile Applications

Database to XML Wizard

ADF Code Corner How-to declaratively build a master-detail behavior with DVT components. Abstract: twitter.com/adfcodecorner

Session 12. RESTful Services. Lecture Objectives

<Insert Picture Here> Accelerated Java EE Development: The Oracle Way

ADF Code Corner How-to launch a popup upon rendering of a page fragment in a region using JSF 2. Abstract: twitter.

NetBeans 5.5 Web Services Consumption in Visual Web Pack Specification

What's New in ActiveVOS 7.1 Includes ActiveVOS 7.1.1

Oracle Fusion Middleware 11g: Build Applications with ADF I

ADF Code Corner. 64. How-to implement a Select Many Shuttle with pre- selected values. Abstract: twitter.com/adfcodecorner

Object-Oriented Programming

ADF Code Corner. 90. Filtering ADF bound lists. Abstract: twitter.com/adfcodecorner

Oracle - Developing Applications for the Java EE 7 Platform Ed 1 (Training On Demand)

Creating a REST API which exposes an existing SOAP Service with IBM API Management

Creating a REST API which exposes an existing SOAP Service with IBM API Management

Product Documentation. ER/Studio Portal. User Guide. Version Published February 21, 2012

Oracle Database. Installation and Configuration of Real Application Security Administration (RASADM) Prerequisites

Making The Future Java

Skyway Builder 6.3 Reference

Active Endpoints. ActiveVOS Platform Architecture Active Endpoints

Copyright 2014, Oracle and/or its affiliates. All rights reserved.

Specialized - Mastering JEE 7 Web Application Development

WPF and MVVM Study Guides

ADF Code Corner Implementing auto suggest functionality in ADF Faces. Abstract:

Call: JSP Spring Hibernate Webservice Course Content:35-40hours Course Outline

Improve and Expand JavaServer Faces Technology with JBoss Seam

DbSchema Forms and Reports Tutorial

Chapter 3 Objects and Classes

ADF Code Corner How-to enforce LOV Query Filtering. Abstract: twitter.com/adfcodecorner

PDF SIMPLE JAVA WEB SERVICE EXAMPLE

Course Details. Skills Gained. Who Can Benefit. Prerequisites. View Online URL:

How to be a Good Bean

Getting started with WebSphere Portlet Factory V7.0.0

Syllabus- Java + Android. Java Fundamentals

DbSchema Forms and Reports Tutorial

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

Templates and Databinding. SWE 432, Fall 2017 Design and Implementation of Software for the Web

Chapter 2 Introduction

<Insert Picture Here> Advanced ADF Faces. Frank Nimphius Principal Product Manager

Oracle Fusion Middleware 11g: Build Applications with ADF I

Packaging Data for the Web

PSD1B Advance Java Programming Unit : I-V. PSD1B- Advance Java Programming

1 Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Grading Rubric Homework 1

Aim behind client server architecture Characteristics of client and server Types of architectures

ADF EMG XML Data Control. Powerful and Easy ADF Data Control for XML data

Introduction to Web Application Development Using JEE, Frameworks, Web Services and AJAX

Getting started with WebSphere Portlet Factory V6.1

Sri Vidya College of Engineering & Technology

Oracle Fusion Developer Guide (ISBN: ) Preview Chapter 1. The Quick Lerner s Guide to Oracle Fusion Web Application Development PREVIEW

Overview. Principal Product Manager Oracle JDeveloper & Oracle ADF

Chapter 13 XML: Extensible Markup Language

Oracle Applications OAF, MSCA, MA and ADF. May 06, 2011

CS445 Week 9: Lecture

Develop Mobile Front Ends Using Mobile Application Framework A - 2

The DSL created in Scala was accomplished using the Implicit conversion (Views) feature of Scala.

How To Get Database Schema In Java Using >>>CLICK HERE<<<

Flex and Java. James Ward. twitter://jlward4th Adobe Systems Incorporated. All Rights Reserved.

CO Java EE 6: Develop Web Services with JAX-WS & JAX-RS

Java Enterprise Edition

ADF Code Corner. 048-How-to build XML Menu Model based site menus and how to protect them with ADF Security and JAAS. Abstract:

JavaBeans, Properties of Beans, Constrained Properties

Orgnazition of This Part

DESIGN PATTERN - INTERVIEW QUESTIONS

Getting Started with Web Services

IT6503 WEB PROGRAMMING. Unit-I

Chapter 6 Introduction to Defining Classes

Application Integration with WebSphere Portal V7

JAVA+ANDROID CURRICULUM 6 WEEKS. INTRODUCTION TO JAVA Understanding Requirement: Why Java Why Java is important to the Internet JAVA on LINUX Platform

CHAPTER 1: A GENERAL INTRODUCTION TO PROGRAMMING 1

Getting Started with Web Services

JAVA. 1. Introduction to JAVA

Pick A Winner! In What Tool Should I Develop My Next App?

Java EE 7 is ready What to do next? Peter Doschkinow Senior Java Architect

XML: Extensible Markup Language

Nothing to see here...

127 Church Street, New Haven, CT O: (203) E: GlobalSearch ECM User Guide

Transcription:

ADF Mobile : Data Services Java Beans Ma Ping ping.ma@oracle.com

Overview Topics covered in this lesson include: Roadmap and Best Practices Data Services Overview Data Objects and CRUD Objects Data Relationships Definition Data Change Events Bean Data Controls and Exposing Data to UI

Roadmap for Defining Java Bean Data Services Identify Application Data Requirement Data Objects Data Relationship CRUD (Create/Read/Update/Delete) Operations Requirement Implement Java Beans (POJOs) to support Data Objects and CRUD operations Expose Java Beans as Bean Data Controls Bean Data Controls can then be used to construct the user interface

Best Practices for Data Services and Application Development Always understand data processing requirement before implementing Data Services Start with implementing Java Beans that implement Data Objects and support CRUD operations Populate the Data Objects initially with local/stub data specified within the Java Beans So that client application can be developed in parallel with server-side logic Test and enhance ADF Mobile application iteratively using stub data

ADF Mobile Data Services Overview Device Native Container HTML5 & JavaScript ADF Mobile AMX View ADF Controller Local HTML Web View SOAP Web Services Java Beans Data Controls Local Data Java VM Mobile Device Server REST (XML w/ XSD) Services REST (JSON) Services

Beans and Data Controls Types Data Controls exposes Device Native Contaier data to User Interface: Bean Data Controls Web Services Data Controls URL Data Controls Java Beans Java Beans Data Controls Data Objects and CRUD Objects: contains core application logic to process data Java VM Managed Beans: Invoked by user interface/amx page to perform UI related functions This lesson focuses on Bean Data Control, Data Objects, and CRUD Objects

Embedded Java Virtual Machine ADF Mobile container embeds a light-weight, headless Java Virtual Machine Headless = no UI library as ADF Mobile leverages HTML5- based UI Based on Java version 1.4 No generics support such as typed collections like set<string> No annotation support Additional links/documentation on JVM: 1. CDC API comparison chart: http://www.oracle.com/technetwork/java/cdc-packages-150013.pdf (See especially column for "FP 1.1 JSR 219" which is the same as the ADF Mobile s embedded JVM) 2. Javadoc of APIs in CDC/Foundation Profile Libraries: http://docs.oracle.com/javame/config/cdc/ref-impl/fp1.1.2/jsr219/index.html

Java Bean Data Services Two types of POJOs need to be developed to process data: Data Objects: Represents a Data Object (e.g. Employees) Define attributes and types for each data object Contain getter/setter for the attributes Represent data object hierarchical relationships CRUD Objects: Instantiate and populates Data Objects Support CRUD (Create/Read/Update/Delete) operations Access web services or local database Expose data access methods to UI via Bean Data Control

Data Objects Definition Typically one Java class per data object Steps to create data object to hold data Create a Java Class Declare and initialize data attributes as variables Generate Accessors through context menu Check Notify Listener when Property Changes to add data change listeners to propagate changes to UI This adds propertychangesupport APIs to all the SET, ADD, and REMOVE methods in the Data Object Propagate attribute value changes to the user interface

CRUD Objects Definition Expose methods for CRUD operations Data may reside in CRUD object itself, flat files, local database, and/or web services Instantiate and populate one or more Data Objects May contain additional Property and Provider Data change notification logic

Steps to Create CRUD Objects Declare one or more collections to hold data within the CRUD Object In the Constructor, Instantiate the list variable (for example as ArrayList) Invoke data population logic here if you wish to load data whenever the CRUD Object is instantiated In the GET or data retrieval method Convert the ArrayList into an Array of Data Objects and return data

Steps to Create CRUD Objects Implement additional methods to retrieve or update data For example, a READ method that calls a web services to retrieve a list of employees from a department Another example, a UPDATE method that updates a field in the local SQLite DB Add providerchangesupport calls as needed Similar syntax as propertychangesupport calls in the Data Objects Stocktracker sample app contains examples of this call Implement any additional methods For example, returning employee count, etc.

Define Data Object Relationships Define data relationships by creating multiple layers of Data and CRUD Objects For example, in the simple HR example: A department ( Parent data object) contains several employees ( Child data object) Employees: Data Object for Employees Departments: Data Object for Departments EmployeeList: CRUD Object that returns a list of employees DepartmentList: CRUD Object that returns departments and employees

Department CRUD Objects Declare a list for Department and declare/instantiate the EmployeeList CRUD Objects public class DepartmentList { private static List s_departments = null; private static EmployeeList s_employees = new EmployeeList(); QLite database EmployeeList may be populated on instantiation if data is populated in the constructor, or add a method that invokes EmployeeList s GET Method to populate data

Department CRUD Objects Implement additional methods to retrieve data for example get employees by department ID public Employee[] getemployeesbydept(int deptid) { ArrayList reports = new ArrayList(); } Employee[] emps = s_employees.getemployees(); for (int x = 0; x < emps.length; x++) { Employee e = emps[x]; if (e.getdeptid() == deptid) { reports.add(e); } } Note the code that converts ArrayList to Array return (Employee[])reports.toArray(new Employee[reports.size()]);

ArrayList & Array of Data Objects Use ArrayList to hold data when populating and processing data Much more flexible than an Array[ ] as array size is fixed during creation and data needs to be assigned to a specific location (array[1]) Supports methods like (add/remove/contains/size/get) that allows data to be easily processed/searched/etc. Convert ArrayList to Array of Data Object when returning data Data needs to be returned as an Array of Data Objects, as required by ADF Mobile internals

Propagate Data Change Events to User Interface When data is changed in Java, you must fire a data change event listener to propagate changes to bindings and user interface Methods are automatically generated when checking Notify Listener When Property Changes when generating accessors for the POJOs Additional calls are also needed whenever data change event needs to be propagated

Different Data Change Events and Corresponding Listeners PropertyChangeListener: Invoke to propagate an attribute value change Supports firepropertychange, firepropertydelete, and firepropertycreate propertychangesupport.firepropertychange( firstname", oldfirstname, newfirstname); ProviderChangeListener: Invoke to propagate changes in a data collection/object Supports fireproviderchange, fireproviderrefresh, fireproviderdelete, and fireprovidercreate propertychangesupport.firepropertycreate( perso ns", personid, persondataobject);

Exposing POJOs to User Interface Right (Ctrl) Click on the CRUD Data Object Create Bean Data Control Modify datacontrols.dcx for data control attributes, hints, validation rules, etc.

Modify Data Control Details 1. Modify the DataControls.dcx file Attribute tab only 2. Set Default Value, Key (to support any Key operation), UI Hints, and Validation Rules (Compare, Length, List, and Range only)

Use Data Controls on Page Data Controls have been created Drag and Drop onto page, just like with Web Based ADF Modify as needed

Summary Topics we covered in this lesson were: Roadmap and Best Practices Data Services Overview Data Objects and CRUD Objects Data Relationships Definition Data Change Events Bean Data Controls and Exposing Data to UI <Insert Picture Here>

Learn More Oracle.com/technology/jdev Download Tutorials Discussion forum Samples ADF Developer Guide More <Insert Picture Here>