eclipse - single source;three runtimes

Post on 17-May-2015

2.872 Views

Category:

Technology

1 Downloads

Preview:

Click to see full reader

DESCRIPTION

Presentation from Suresh Krishna madhuvarsu on the RCP, eRCP and RAP in the Redwood City DemoCamp.

TRANSCRIPT

04/12/23 All rights reserved. 2008. 1

Single Source : Three Runtimes

Suresh Krishna

Oracle Inc.

suresh.madhuvarsu@gmail.com

A tale of Desktop (RCP), Web (RAP) and Mobile (eRCP) applications.

04/12/23 All rights reserved. 2008. 2

Motivation is to…

Understand the strengths and limitations of three runtimes (RCP, RAP and eRCP)

Leverage these Eclipse platforms for business solutions

“how much” is really free ?

04/12/23 All rights reserved. 2008. 3

04/12/23 All rights reserved. 2008. 4

* conditions and refactoring apply

04/12/23 All rights reserved. 2008. 5

Simple Application…

“Task Organizer” application is created using Eclipse RCP

Application is functionally simple Can add, modify and delete the personal tasks Data is populated from a simple in memory

model; modified data is not persisted Demonstrates the strengths and limitations of

runtimes (RCP, RAP and eRCP)

04/12/23 All rights reserved. 2008. 6

RCP – TaskOrganizer

Create a simple View with Eclipse RCP plugin wizard

Contains simple TableViewer, TaskView, Sorter and CellModifier

Productization is done with the icons, splash screen and the launcher name

Personal Organization is exported as product so that it can be distributed as standalone

04/12/23 All rights reserved. 2008. 7

RCP – TaskOrganizer Code

TaskOrganizerApplication : Implements Application and defines the application's life cycle

ApplicationActionBarAdvisor : Manages the life cycle of actions added to windows

ApplicationWorkbenchAdvisor : Initializes the perspective

ApplicationWorkbenchWindowAdvisor : responsible for many of the visual aspects of windows (size, statusline, menubars, etc.)

Perspective : Contains the Personal Task Viewer that will be visible in the application

PersonalTaskView : Simple Table Viewer with data pre-populated from a model

04/12/23 All rights reserved. 2008. 8

RCP – TaskOrganizer – Demo

04/12/23 All rights reserved. 2008. 9

RAP – Overview

RAP allows you to build Ajax-enabled Web applications using the Eclipse development model.

Browser-side widget rendering is done with the qooxdoo Ajax library

Abstracts the JavaScript and allows you to work with the Java APIs to build RIAs.

Custom widget developers need to have JavaScript, qooxdoo, and RAP knowledge.

Client-side development allows for the embedding of client-side technologies like other JavaScript frameworks, Flash, and applets.

04/12/23 All rights reserved. 2008. 10

RAP - Architecture

Special implementation of the SWT, JFace and Workbench, and, as such, is actually a subset of RCP.

RAP applications are accessed via standard browsers in the same way RCP applications are executed on the desktop environment.

04/12/23 All rights reserved. 2008. 11

RAP - TaskOrganizer

Since RAP is an RCP subset, it cannot co-exist in the same Eclipse instance as RCP.

Download and set the RAP target platform; alternatively one can download the RAP SDK.

Refactor the code– Extension Points– Plugin Dependencies– Remove/Add/Modify classes– Define EntryPoint

Test with OSGi configuration

04/12/23 All rights reserved. 2008. 12

RAP – TaskOrganizer (transformation)

Organize the RAP application plug-in dependencies.– org.eclipse.ui, add the RAP equivalent

org.eclipse.rap.ui. Look for the compile errors and correct them with

compatible APIs, constants, etc.– Shell– SWT Style Bits

Modify or removed the functionality currently not supported in RAP (e.g., CellEditors).– As of now CellEditors are not supported in RAP

04/12/23 All rights reserved. 2008. 13

RAP – TaskOrganizer (transformation)

An EntryPoint (org.eclipse.rap.ui.entrypoint) represents the main entry point for a RAP application (It can be compared with the main() method in SWT applications)

EntryPoint creates the UI with the help of the WorkbenchAdvisor, Initial Perspective, and ApplicationActionBarAdvisor.

URL <host>:<port>/rap?startup=<entrypointname> As RAP uses the OSGi* as the server-side framework,

you will want to launch the application with the OSGi framework.

OSGi framework includes a Jetty server and the startup ports can be configured.

* The Equinox's OSGi framework component is the full implementation to the OSGi Core framework R4 specification.

04/12/23 All rights reserved. 2008. 14

RAP – TaskOrganizer - Launch

04/12/23 All rights reserved. 2008. 15

RAP – TaskOrganizer – Editing Capability

* CellEditor replacement in the personal task organizer

04/12/23 All rights reserved. 2008. 16

RAP – TaskOrganizer - Branding Add org.eclipse.rap.ui.branding extension point

– servletName: taskOrganizer : • Allows a user to access the application via

localhost:9090/taskOrganizer, rather than /rap.

– title: Personal Task Organizer : • Will be displayed as the title of the Web page in the browser,

either in the title bar or the tab.

– favicon: icons/alt_window_16.gif : • Available for use as part of the work done in Part 1, but if you

have a logo of your own in an .ico file, use that, as many browsers only accept .ico for the favicon.

– exitConfirmation: Do you want to Exit Personal Task Organizer? :

• Will display in a dialog when the user closes his browser or navigates to another URL while running the application.

04/12/23 All rights reserved. 2008. 17

RAP – TaskOrganizer - Branding

04/12/23 All rights reserved. 2008. 18

RAP – TaskOrganizer - Theming Theming is based on CSS and allows you to define colors,

fonts, borders, margins, and images for the widgets. Add the extension point org.eclipse.rap.ui.themes Unfortunately, there is no documentation on what

properties can be set on what widgets.– For example, the menu has its theme listed in

Menu.theme.xml, the List in List.theme.xml; etc.

04/12/23 All rights reserved. 2008. 19

RAP – TaskOrganizer – Before/After

04/12/23 All rights reserved. 2008. 20

RAP – TaskOrganizer – Packaging

Deploy your application to a servlet container Additional plug-ins must be bundled for deployment ServletBridge is the connection between the OSGi

framework and servlet container. – org.eclipse.equinox.servletbridge

– org.eclipse.equinox.servletbridge.http

– org.eclipse.equinox.http.servlet

– org.eclipse.equinox.http.registry

– javax.servlet

Crete a deploy script (war file, config creator, etc…) Run the build script to create the necessary files for

deployment Deploy the WAR file to a servlet container (e.g. Tomcat)

04/12/23 All rights reserved. 2008. 21

RAP – TaskOrganizer - Deploy

04/12/23 All rights reserved. 2008. 22

Smart Phone (R)evolution…

Palm Centro/Treo Black Berry iPhone Nokia N/E series,

Communicator Samsung BlackJack,

SCH Sony Ericsson P/W

series

04/12/23 All rights reserved. 2008. 23

eRCP – Overview

eRCP is a project — sponsored by IBM®, Nokia, and Motorola — that removes the desktop-oriented features of RCP.

Replaces the traditional frameworks to mobile (SWT -> eSWT; JFace -> eJface; Workbench -> eWorkbench; Update -> eUpdate)

SWT Mobile Extensions package to provide support for embedded UI features.

eSWT ties directly to the native GUI system. It employs native code to do this and is, therefore, platform-dependent.

Cannot run the eRCP GUI applications without having a port of eSWT and mobile extensions for the target platform.

04/12/23 All rights reserved. 2008. 24

eRCP - Architecture

Mobile Extensions : An optional package that provides UI elements commonly found on mobile devices.

04/12/23 All rights reserved. 2008. 25

eRCP – Supported Platforms

4 platforms for development and testing– Windows Desktop– Windows Mobile V5/6 Professional– Windows Mobile V5/6 Standard– WinCE V4.0 Professional

Windows Mobile and Windows CE platforms require actual device or the simulator to test the application

Windows Desktop provides a full eRCP environment; which makes it easy to develop and test the mobile applications on the desktops.

04/12/23 All rights reserved. 2008. 26

eRCP – TaskOrganizer – Refactoring Start with downloading the eRCP for Desktop runtime and

set the target environment Look for the compilation errors and change

– Dependant plugins• Add org.eclipse.ercp.eworkbench

– Extension points• Add org.eclipse.ercp.eworkbench.applications • Remove org.eclipse.core.runtime.applications• Remove org.eclipse.ui.perspectives• Remove org.eclipse.core.runtime.products

– API changes• SelectionAdapter -> SelectionListener• Remove CellModifiers -> Not supported• Remove RCP related classes

04/12/23 All rights reserved. 2008. 27

eRCP – TaskOrganizer – eWorkbench

eWorkbench does not have the Perspective model

An eRCP application does not have an IApplication or IEntryPoint as a starting point

eRCP app extends the eWorkbench instance and runs as child thread

eWorkbench shares its execution thread among all eRCP applications (allowing all the applications to run in a single JVM)

04/12/23 All rights reserved. 2008. 28

eRCP – TaskOrganizer – Launch

Create a launch configuration using the application type as org.eclipse.ercp.eworkbench.eWorkbench.

04/12/23 All rights reserved. 2008. 29

eRCP – TaskOrganizer – Deployment

Earlier release of Symbian OS (S80) has been discontinued and only a handful Windows mobile OS are supported

eRCP requires a JVM capable of supporting the CDC/FP v1.0 or later whereas majority of today's devices support only CLDC/MIDP.

Download the version for Windows Mobile 2003/5/6 or Windows CE platforms

Purchase a licensed copy of IBM WebSphere Everyplace Micro Environment for Windows Mobile, which comes with IBM's J9 VM for ARM-based devices

* Connected Device Configuration/Foundation Profile** Connected Limited Device Configuration/Mobile Information Device Profile

04/12/23 All rights reserved. 2008. 30

eRCP – TaskOrganizer on PocketPC

04/12/23 All rights reserved. 2008. 31

Single Source; Three RuntimesSingle Source; Three Runtimes

Thanks for attention !

Have Fun !

Suresh Krishna

top related