Short Portlet Programming Guide in P-Grade (Gridsphere) environment G. Hermann.

Slides:



Advertisements
Similar presentations
Chapter 6 Server-side Programming: Java Servlets
Advertisements

17 HTML, Scripting, and Interactivity Section 17.1 Add an audio file using HTML Create a form using HTML Add text boxes using HTML Add radio buttons and.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 16 Introduction to Ajax.
EIONET Training Zope Page Templates Miruna Bădescu Finsiel Romania Copenhagen, 28 October 2003.
JSP and web applications
Struts Portlet Copyright © Liferay, Inc. All Rights Reserved. No material may be reproduced electronically or in print without written permission.
Struts Portlet Adding an Action Copyright © Liferay, Inc. All Rights Reserved. No material may be reproduced electronically or in print without.
JSF Portlet Backing Beans and UI Components Copyright © Liferay, Inc. All Rights Reserved. No material may be reproduced electronically or in.
Chapter 16 Graphical User Interfaces John Keyser’s Modifications of Slides by Bjarne Stroustrup
JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
Apache Struts Technology
A really fairly simple guide to: mobile browser-based application development (part 1) Chris Greenhalgh G54UBI / Chris Greenhalgh
A Blackboard Building Block™ Crash Course for Web Developers
The Web Warrior Guide to Web Design Technologies
Using JavaServer Pages Harry R. Erwin, PhD CIT304/CSE301.
1 Frameworks. 2 Framework Set of cooperating classes/interfaces –Structure essential mechanisms of a problem domain –Programmer can extend framework classes,
Object-Oriented Enterprise Application Development Tomcat 3.2 Configuration Last Updated: 03/30/2001.
Internet Technologies 1 Master of Information System Management Java Server Faces Model/View/Controller Design Pattern for Web Development Slides.
Java Server Faces Model/View/Controller Design Pattern for Web Development Slides adapted from “Core JavaServer Faces” by Geary and Horstmann and the J2EE.
WWW and Internet The Internet Creation of the Web Languages for document description Active web pages.
Application Architectures Vijayan Sugumaran Department of DIS Oakland University.
Tutorial 6 Forms Section A - Working with Forms in JavaScript.
ECE356 – Database Systems Lab 1 – Building a Web Project with NetBeans Tiuley Alguindigue Lab Instructor – University of Waterloo, E & CE Dept. Fall 2013.
UNIT-V The MVC architecture and Struts Framework.
DAT602 Database Application Development Lecture 15 Java Server Pages Part 1.
Chapter 10 EJB Concepts of EJB Three Components in Creating an EJB Starting/Stopping J2EE Server and Deployment Tool Installation and Configuration of.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
CSCI 6962: Server-side Design and Programming Course Introduction and Overview.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
Chapter 5 Java Script And Forms JavaScript, Third Edition.
Web Technologies Website Development Trade & Industrial Education
Java Omar Rana University of South Asia. Course Overview JAVA  C/C++ and JAVA Comparison  OOP in JAVA  Exception Handling  Streams  Graphics User.
Java Programming, 3e Concepts and Techniques Chapter 3 Section 65 – Manipulating Data Using Methods – Java Applet.
Department of Mechanical Engineering, LSUSession VII MATLAB Tutorials Session VIII Graphical User Interface using MATLAB Rajeev Madazhy
JSP Java Server Pages Softsmith Infotech.
Design Patterns Phil Smith 28 th November Design Patterns There are many ways to produce content via Servlets and JSPs Understanding the good, the.
JSP Architecture Outline  Model 1 Architecture  Model 2 Architecture.
DSpace UI Alexey Maslov. DSpace in general A digital library tool useful for storage, maintenance, and retrieval of digital documents Two types of interaction:
Section 17.1 Add an audio file using HTML Create a form using HTML Add text boxes using HTML Add radio buttons and check boxes using HTML Add a pull-down.
JSF Introduction Copyright © Liferay, Inc. All Rights Reserved. No material may be reproduced electronically or in print without written permission.
Chapter 34 Java Technology for Active Web Documents methods used to provide continuous Web updates to browser – Server push – Active documents.
Lecturer: Prof. Piero Fraternali, Teaching Assistant: Alessandro Bozzon, Advanced Web Technologies: Struts–
Chapter 3 Servlet Basics. 1.Recall the Servlet Role 2.Basic Servlet Structure 3.A simple servlet that generates plain text 4.A servlet that generates.
Chapter 13. Applets and HTML HTML Applets Computer Programming with JAVA.
In the next step you will enter some data records into the table. This can be done easily using the ‘Data Browser’. The data browser can be accessed via.
J2EE Overview Web Programming CSCI J2EE multi-tier architecture Servlet: Java class loaded into Web server JSP page: enhanced HTML page that is.
Chapter 6 Server-side Programming: Java Servlets
Java Web Development with NetBeans IDE -- Kai Qian Chapter 5 JavaServer Faces (JSF) Technology.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Introduction to Android (Part.
Rails & Ajax Module 5. Introduction to Rails Overview of Rails Rails is Ruby based “A development framework for Web-based applications” Rails uses the.
Overview of Form and Javascript fundamentals. Brief matching exercise 1. This is the software that allows a user to access and view HTML documents 2.
Parameter Study Principles & Practices. What is Parameter Study? Parameter study is the application of a single algorithm over a set of independent inputs:
3 Copyright © 2004, Oracle. All rights reserved. Working in the Forms Developer Environment.
JSP BASICS AND ARCHITECTURE. Goals of JSP Simplify Creation of dynamic pages. Separate Dynamic and Static content.
Preface IIntroduction Objectives I-2 Course Overview I-3 1Oracle Application Development Framework Objectives 1-2 J2EE Platform 1-3 Benefits of the J2EE.
Chapter 3 JSP Overview. The Problem with Servlets processing the request and generating the response are both handled by a single servlet class Java programming.
AJAX. Overview of Ajax Ajax is not an API or a programming language Ajax aims to provide more responsive web applications In normal request/response HTTP.
The Jetspeed Portal Bluesunrise.com and The Apache Software Foundation January 28, 2002 From
1 Java Server Pages A Java Server Page is a file consisting of HTML or XML markup into which special tags and code blocks are inserted When the page is.
AJAX Use Cases for WSRP Subbu Allamaraju BEA Systems Inc WSRP F2F Meeting, May 2006.
Java Programming: Advanced Topics 1 Building Web Applications Chapter 13.
10 Copyright © 2004, Oracle. All rights reserved. Building ADF View Components.
CHAPTER 7 LESSON C Creating Database Reports. Lesson C Objectives  Display image data in a report  Manually create queries and data links  Create summary.
SDJ INFOSOFT PVT. LTD. 2 BROWSERBROWSER JSP JavaBean DB Req Res Application Layer Enterprise server/Data Sources.
Apache Struts Technology A MVC Framework for Java Web Applications.
1 Web Programming with Servlets & JSPs WEB APPLICATIONS – AN OVERVIEW.
Section 10.1 Define scripting
In this session, you will learn to:
Working in the Forms Developer Environment
Section 17.1 Section 17.2 Add an audio file using HTML
Presentation transcript:

Short Portlet Programming Guide in P-Grade (Gridsphere) environment G. Hermann

Content Main ideas Execution model Representation Part I Java – JSP collaboration Part II Definition of Portlets by portlet.xml and layout.xml Tomcat directory hierarchy

Main ideas Layout design and business logic are separated Response WEB pages are generated with the help of run time compiled and linked java code. Even little parts of WEB pages can be handled independently (portlet concept)

Warning ! We restrict ourselves to the Portlet implementation of the Gridsphere Focus on the class ActionPortlet Tasks: –Defines “states” described by Java Servlet Pages (Jsp) –Defines callback routines called before HTML response generation (view) after user action (update)

Execution model - possible ways HTTML response generation First request from client init(PotletConfig) Y(ActionFormEvent)X(RenderFormEvent) Next requests from client

Execution model-regime modify HTTML response generation First request from client init(PotletConfig) Y(ActionFormEvent)X(RenderFormEvent) Next requests from client

Execution model-regime show HTTML response generation First request from client init(PotletConfig) X(RenderFormEvent) Next requests from client

Representation I java code (Action Portlet) defines the callback routines and the current (and next) state made intuitive to the client by defining the selection of the proper Jsp page in that state. The java code is responsible for the whole business logic. Java Servlet Page (JSP) (file: xx.jsp) Composes the frame of the layout and defines communication interface between the client and java code in a given state. The UI Tag Library defines the layout and the passive –data- interface between java code and JSP. The Java representation of the UI Tag Library follows the Bean concept. The JSP representation of UI Tag Library is XML. “portlet.xml” defines the portlet and references the java code “layout.xml” defines the menu hierarchy haw the callable portlets should appear. (layout.xml is GridSphere specific!)

Representation II HTTML response generation First request from client init(PotletConfig) Y(ActionFormEvent)X(RenderFormEvent) Next requests from client class Any extends ActionPortlet Ani.jsp UI Tag Library objects

Remarks(1) UI TAG LIBRARY The UI Tag Library is not discussed in detailed in the subsequent example. The Java side usage of it is self explaining by the Bean paradigm. For the XML usage of it in the JSP file consult the document: uide/TagGuide.htm uide/TagGuide.htm What you must know is that the interface variables are identified by associated Strings

Remarks(2) State Transitions Please note that the event handling interrupt routines of the Java Class ActionPortlet may terminate with the state transition instruction setNextState(PortletReqest,String), where the String parameter may refer either –a name of a routine, or –a JSP. The action defined in that JSP defines the next state.

Remarks(3) other state subtilities The String “DEFAULT_HELP_PAGE” is used to define a JSP when the client hits the “?” icon on the portlet The String “DEFAULT_EDIT_PAGE” is used to define a JSP when client hits the “pen” edit icon.

Remarks (4) Programing style The JSP pages may contain direct java code fragments among UI tags and forms. However you are emphatically asked to avoid them: The overview of the program logic can be lost easily if the program code is fragmented, and the JSP is not used as its designated: for gathering and rendering of client data.

Part I: Life Cycle of a Portlet by an example The simple Portlet “EnterName” redisplays a single string entered by the client.

EnterName.java and the corresponding EnterName.jsp files

First Request arrives from the client HTTML response generation First request from client Init(PotletConfig) Y(ActionFormEvent)X(RenderFormEvent) Next requests from client The routine init will be activated

Java – Jsp connections-1 DEFAULT_VIEW_PAGE determines that before the elaboration of the first response the given rendering routine will be called.

First Rendering HTTML response generation First request from client Init(PotletConfig) Y(ActionFormEvent)X(RenderFormEvent) Next requests from client Variables need to show to the client are prepared

Java – Jsp connections-2 The jsp is referenced by the java code. After the running of the routine the HTML generation defined by the Jsp will be performed

Java – Jsp connections-3 The parameter referenced by the handle “nameSessionHandle” does not exist, therefore the bean object referenced “nameOld” – wich will be created upon the first reference –receives the value “not defined”.

Java – Jsp connections-4 The bean referenced as “nameOld” will be used to display the value known by the system before the user interaction.

Java – Jsp connections-5 The jsp page will generate the HTML response

HTML generated by the JSP as it appears for the Client The Jsp page will generate the HTML code in the response for the selected frame

Java – Jsp connections-6 The internally generated bean objects are used to exchange data between Jsp defined HTML code and Java routines

Java – Jsp connections-7 The user hitting the button labeled as “Update” generates a Request activating the routine updateName

Java – Jsp connections-8 Example: The Client fills the text field as “newValue”, and hits the Button “Update”

Repeated request arrives HTTML response generation First request from client Init(PotletConfig) Y(ActionFormEvent)X(RenderFormEvent) Next requests from client The prescribed ActionFormEvent handler will be activated.

Java – Jsp connections-9 In the action event handler the value defined by the client and stored in a bean referenced as “nameNew” will be read

Java – Jsp connections-10 The text value will be forwarded to the subsequent rendering routine via the handle “nameSessionHandle”

Java – jsp connections As a last step the routine triggers the rendering event

Repeated Rendering HTTML response generation First request from client Init(PotletConfig) Y(ActionFormEvent)X(RenderFormEvent) Next requests from client

Java – Jsp connections-11 As the value associated by “nameSessionHandle” is not empty the bean referenced as “nameOld” will receive this value

HTML generated by the JSP as it appears for the Client after repeated Rendering The bean referenced “nameOld” now has the value “newValue”

Summary of all external Java- Jsp connections

Part II Definition of a Portlet A new portlet prepared by the java and JSP files must have an entry in the file “portlet.xml” and it must be referenced in the file “layout.xml”, must define an interpreter java class path, And a title label

portlet.xml The new potrlet Portlet name will be referenced in file layout.xml Text in the title of the portlet Path of the java class controlling the portlet

The layout.xml Must define the menu hierarchy Define the appropriate labels for the user navigation Reference the used portlets

layout.xml Portlet as a submenu item Display name of a group of a submenu Display name of of a submenu item Referencing the name of the potled defined in portlet.xml Referencing the web application

Summary of connectons: layout.xml, portlet.xml and HTML image

webapps/ …/ jsp/ …/ WEB-INF/ …/ portal30/ …/ hello/ …/ enterName.jsp …jsp lib/ classes/ …/ portlet.xml layout.xml hu/ sztaki/ lpds/ pgportal/ portlets/ hello/ EnterName.class Tomcat dictionary The jar files encountered here must correspond to the import references defined in EnterName.java