Using Adobe Flex in JSR-286 Portlets

Similar documents
Building Mashups Using the ArcGIS APIs for FLEX and JavaScript. Shannon Brown Lee Bock

COPYRIGHTED MATERIAL. Part I: Getting Started. Chapter 1: Introducing Flex 2.0. Chapter 2: Introducing Flex Builder 2.0. Chapter 3: Flex 2.

IBM JZOS Meets Web 2.0

"Charting the Course... WebSphere Portal 8 Development using Rational Application Developer 8.5. Course Summary

JUGAT Adobe Technology Platform for Rich Internet Applications

Developing Ajax Web Apps with GWT. Session I

A Closer Look at XPages in IBM Lotus Domino Designer 8.5 Ray Chan Advisory I/T Specialist Lotus, IBM Software Group

EUCOM/AFRICOM DEFENSE USER GROUP MEETING MARCH 2010 STUTTGART WELCOME!

JUGAT Flex 3. Christoph Atteneder. May Flash / Flex Development Technical Lead Adobe Systems Incorporated. All Rights Reserved.

IBM Rational Application Developer for WebSphere Software, Version 7.0

Advanced Web Systems 4- PORTLET API specifications (JSR 286) A. Venturini

eclipse rich ajax platform (rap)

Getting started with WebSphere Portlet Factory V7.0.0

Developing Applications for IBM WebSphere Portal 7.0

Getting started with WebSphere Portlet Factory V6.1

Adobe ColdFusion 11 Enterprise Edition

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

ABSTRACT INTRODUCTION THE ODS TAGSET FACILITY

Author. Publish. Use

Advanced Topics in WebSphere Portal Development Graham Harper Application Architect IBM Software Services for Collaboration

Using Flex 3 in a Flex 4 World *

Enriching Portal user experience using Dojo toolkit support in IBM Rational Application Developer v8 for IBM WebSphere Portal

Lotus Exam IBM Websphere Portal 6.1 Application Development Version: 5.0 [ Total Questions: 150 ]

Actual4Test. Actual4test - actual test exam dumps-pass for IT exams

FlexJS. OmPrakash Apache Flex PMC Member Advisory Software Engineer, IBM

JavaServer Faces Technology, AJAX, and Portlets: It s Easy if You Know How!

Adobe Flex Tutorial i

Tooling for Ajax-Based Development. Craig R. McClanahan Senior Staff Engineer Sun Microsystems, Inc.

JSR-286: Portlet Specification 2.0

Eclipse as a Web 2.0 Application Position Paper

Extending the JavaScript Development Toolkit

Developing Exceptional Mobile and Multi-Channel Applications using IBM Web Experience Factory

Distributed Multitiered Application

The 60-Minute Guide to Development Tools for IBM Lotus Domino, IBM WebSphere Portal, and IBM Workplace Applications

Flex 3 Pre-release Tour

Flex Data Services for Component Developers

IBM WebSphere Portlet Factory Profile Selection via IBM WebSphere Portal Personalization Rules

Calendar Management A Demonstration Application of TopBraid Live

Application Integration with WebSphere Portal V7

PASS4TEST. IT Certification Guaranteed, The Easy Way! We offer free update service for one year

Sun Java Studio Creator. Ken Paulsen Staff Engineer Sun Microsystems, Incorporated (Slides by: Craig R. McClanahan)

AD105 Introduction to Application Development for the IBM Workplace Managed Client

Oracle Developer Day

IBM Workplace Software Development Kit

vsphere Web Client SDK Documentation VMware vsphere Web Client SDK VMware ESXi vcenter Server 6.5.1

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

Tools to Develop New Linux Applications

Java EE 6: Develop Web Applications with JSF

Mischa Kölliker. JavaLounge Zürich, 23. Juni 2009

ADOBE DIGITAL ENTERPRISE PLATFORM DOCUMENT SERVICES OVERVIEW

Credits: Some of the slides are based on material adapted from

Introduction to Flex. Indy Nagpal. Web On The Piste August 2007

Unified Task List. IBM WebSphere Portal V7.0 Review the hardware and software requirements Review the product documentation

WebSphere Portal Application Development Best Practices using Rational Application Developer IBM Corporation

Web Front Technology: Interstage Interaction Manager

Provisioning WPF based WP Composite Applications to Expeditor

What's New in the Servlet and JavaServer Pages Technologies?

de la session Portal 6.1 Administration

A Model-Controller Interface for Struts-Based Web Applications

Developing Applications with Java EE 6 on WebLogic Server 12c

JavaEE Interview Prep

ArcGIS for Mobile An Introduction. Bonnie Stayer

Adobe ColdFusion (2016 release)

What's New in ActiveVOS 7.1 Includes ActiveVOS 7.1.1

Working with the ArcGIS Viewer for Flex Application Builder

SOFTWARE DEVELOPMENT SERVICES WEB APPLICATION PORTAL (WAP) TRAINING. Intuit 2007

IBM Realtests LOT-911 Exam Questions & Answers

Introduction Haim Michael. All Rights Reserved.

The goal of this book is to teach you how to use Adobe Integrated

Building JavaServer Faces Applications

Composer Guide for JavaScript Development

Chapter 10 Web-based Information Systems

Lightstreamer. The Streaming-Ajax Revolution. Product Insight

Vision of J2EE. Why J2EE? Need for. J2EE Suite. J2EE Based Distributed Application Architecture Overview. Umair Javed 1

Rich Client GUI's with RCP & RAP

Tieflow Workflow Toolkit Flash Simulator

Portail : WebSphere Portlet Factory RIA et Web 2.0 autour de WebSphere Portal

Mix It Up: Visual Studio 2010 and ASP.NET 4.0. Singapore 25 March 2009

IBM Exam C IBM WebSphere Portal 8.5 Solution Development Version: 6.1 [ Total Questions: 59 ]

Creating Web Mapping Applications. Nikki Golding

vsphere Web Client Extensions Programming Guide vsphere 5.1

The Web has changed. What began as a text-based system for scientists

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

Google Plugin for Eclipse

JVA-563. Developing RESTful Services in Java

Web Mapping Applications with ArcGIS. Bernie Szukalski Derek Law

Adobe ColdFusion level 1 course content (3-day)

Alfresco Developer Guide

AD406: What s New in Digital Experience Development with IBM Web Experience Factory

IBM Rational Developer for System z Version 7.5

Technical White Paper

Interactive webmaps with ArcGIS. Kristel Meikas, AlphaGIS

Web 2.0 Käyttöliittymätekniikat

<put document name here> 1/13

Demonstrated Node Configuration for the Central Data Exchange Node

PRODUCT DESCRIPTIONS AND METRICS

Portlets and Ajax: Building More Dynamic Web Apps

IT6503 WEB PROGRAMMING. Unit-I

IBM LOT-911. IBM WebSphere Portal 8.0 Solution Development.

Performance evaluation of J2EE

Transcription:

Using Adobe Flex in JSR-286 Portlets This article shall show you how the Adobe Flex SDK can be used in a Portal environment to enhance the user interface for a Portlet. It has also previously been possible to use Flex with JSR-168 Portlets and alike [FlexPortal], but with the new Portlet 2.0 specification (JSR-286) some things have improved, such as the support for asynchronous requests, public render parameters and events. Support for the JSR-286 specification has been available in Websphere Portal since version 6.1. It will be shown what is possible with the technology combination Flex/Portlets and where the limits are. The article builds around a Flex demo Portlet example, which is available for download below. A short introduction to Flex Adobe Flex SDK [FlexProductHome], meanwhile in version 3.0, is an open source user interface oriented framework that allows the creation of binary SWF files from XML markup and ActionScript. As opposed to the traditional more visual Flash approach, mainly used by people with a graphical design background, this approach targets at classical programmers. An experienced Java programmer will find it easy to get acquainted with Adobe's Eclipsebased, commercial development environment, called Flex Builder. A compiler called mxmlc is run to compile the MXML markup and the ActionScripts into a single SWF file. This SWF file will then be rendered on the client side by the Flash Player plug-in available in most web browsers. The compilation can either be performed at development time or on-the-fly on the server. For the demo the first approach has been chosen, since it is the default procedure and requires no additional products installed on the server. Data Access In order to embed Flex into web applications, this technology depends on interfaces for data exchange, which are available both on the client and on the server side [FlexHelp]: a) server side data exchange pure HTTP services (GET / POST) SOAP / XML Web Services Remoting: direct access to server-side Java objects The latter employs a proprietary binary protocol on top of HTTP, which has some performance advantage. It is only available when you have a license for a special server product sold by Adobe. For our purpose, the pure asynchronous HTTP service requests are the best choice, since it allows us not only to stay within standard protocols but also to stay within the portal context.

It is worth noting that Flex has no means of accessing databases directly. b) client side data exchange initialization through parameter-passing an Ajax bridge, which allows both, the calling of and listening to JavaScript commands outside the Flash container The example accompanying this article has on the client-side only made use of initialization through parameter-passing for keeping the example simple. Flex versus JavaScript So one or the other reader might be asking what is better JavaScript or Flex? The answer is that both technologies have their advantages and disadvantages and in the end it will depend on a project's concrete requirements and the developers' skills and/or preferences. And, as outlined in the previous section, the decision needn't be excluding one or the other: both technologies can coexist and interact with each other. Nevertheless, let me state a brief comparison of the technologies here: Traditionally JavaScript has been hard to handle because of its very limited type safety. Until now, no JavaScript development environment was therefore able to give generic editing support for the objects and methods defined in JavaScript libraries. Flex, on the other hand, is a framework that provides a reliable type system. This is one of the reasons, why there is a powerful IDE available for Flex, namely the Eclipse-based Flex Builder. But, just recently, also editing support for JavaScript has reached a new level by the new Eclipse JavaScript Development Toolkit (JSDT) [JSDT-Primer]. JSDT properly models the JavaScript language in the background and provides type management and class inference for JavaScript libraries by an inference engine. Uneven Web browser compatibility is another drawback of JavaScript. This can be encapsulated by JavaScript libraries, but it needs to be explicitly taken care of. Flex leverages the widely available Flash Player plug-in, which behaves the same way in any browser and on any platform. Drag and drop between two Flash files embedded on the same web page is not possible (e.g. between two Flex Portlets). In comparison to a UI based on JavaScript this is a disadvantage. The CMS Flex Demo Portlets Now let's have a look at the demo example provided with this article. Below you can see a screen shot of the application.

The application is pretty simple. In view mode of the cms detail Portlet, you have a blue display HTML area where you can view the contents generated in edit mode in Flex Rich Text Editor. Upon clicking save & view new content is being stored into the user's preferences and a newcontentitem event is being thrown. The cms history Portlet is listening to such events and stores each content item in a list in the Portlet session. The list is being displayed in a sortable Flex DataGrid. Double-clicking on an item in that list will in turn throw a contentitemfromhistoryselected event, which is consumed by the cms detail Portlet and stored in the user's preferences. Noteworthy In addition to the above, it is worth mentioning the following issues: Since you cannot throw events from within a serveresource method (see [JSR-286], pp. 105), you will have to do full page submits using action URLs in order to send and receive events. This will interrupt the smooth user experience of Flash. In order to pass objects between the Java server code and the Flash client it

is a good idea to serialize the objects into its XML representation. For the flex demo portlet the Java API for XML Binding (JAXB), now an integral part of Java 6 SE, has been used for this task. Before JSR-286, it has been proposed to use plain Servlets or XML Web Services instead of the new resource serving mechanism for loading content to an asynchronously requesting UI client ([DojoPortal], pp. 10). This meant that the portal's context wasn't accessible. Now when using the serveresource() method, full access is given to a user's environment such as the persisted preferences of a user and security constraints can be enforced by the portal server. Download The sample code download consists of a ready-to-deploy portlet application as Web Archive (WAR), containing two portlets: a) a Flex cms detail portlet, and b) a Flex cms history portlet. The Source code for both Java and Flex are included (Java source located at / WEB-INF/src, Flex source at /flex-files). When deploying to Websphere Portal, you will have to wire the two cms content events by manual configuration, once you have put the two portlets on a common portal page, since, until now, there is no auto-wiring provided:

References [FlexPortal] Coenraets, Christophe (2004). Using Macromedia Flex in a Portal Environment. http://www.adobe.com/devnet/flex/articles/flex_portals.html [FlexProductHome] Adobe Corporation (2008). Flex Product Home Page. http://www.adobe.com/products/flex/ [FlexHelp] Adobe Corporation (2008). Adobe Flex 3 Help. http://livedocs.adobe.com/flex/3/html/help.html [JSDT-Primer] Childs, Bradley (2008). Meet the JavaScript Development Toolkit. http://www.ibm.com/developerworks/library/os-eclipse-jsdt/index.html [JSR-286] Hepper, Stefan et al. (2008). Java Portlet Specification, Version 2.0. http://jcp.org/en/jsr/detail?id=286 [DojoPortal] Bishop, Karl; Philips, Doug (2007). Using the Dojo Toolkit with WebSphere Portal. http://download.boulder.ibm.com/ibmdl/pub/software/ dw/wes/pdf/0711_bishop-dojo-and-wp6.pdf