NBCR Summer Institute 2006 GridSphere:Hands-on Installation and Development Jason Novotny

Slides:



Advertisements
Similar presentations
JSF Portlet Backing Beans and UI Components Copyright © Liferay, Inc. All Rights Reserved. No material may be reproduced electronically or in.
Advertisements

Short Portlet Programming Guide in P-Grade (Gridsphere) environment G. Hermann.
Apache Tomcat as a container for Servlets and JSP
Web Application Server Apache Tomcat Downloading and Deployment Guide.
ANT: Another Nice Tool Ali Beyad October 1, 2003.
Web MVC-2: Apache Struts Rimon Mikhaiel
J.Sant Servlets Joseph Sant Sheridan Institute of Technology.
GridSphere Team; Albert Einstein Institut Hands on Portlets Writing a Portlet Albert Einstein Institute.
Object-Oriented Enterprise Application Development Tomcat 3.2 Configuration Last Updated: 03/30/2001.
Starting with Gridsphere Albert Einstein Institute Gridsphere Installation.
An introduction to Java Servlet Programming
JSP Java Server Pages Reference:
11.1 Grid Portals ITCS 4146/5146 Grid Computing, 2007, UNC-Charlotte, B. Wilkinson. March 11, 2007.
Portlet Deployment Albert Einstein Institute Deploying JSR portlet applications to GridSphere.
27-Jun-15 Directories and DDs. 2 Web apps A web application is basically a web site that: “Knows who you are”--it doesn’t just give you static pages,
14-Jul-15 Tomcat. 2 The Apache Jakarta Project The Apache Jakarta Project “creates and maintains open source solutions on the Java platform for distribution.
ECE356 – Database Systems Lab 1 – Building a Web Project with NetBeans Tiuley Alguindigue Lab Instructor – University of Waterloo, E & CE Dept. Fall 2013.
Portals and portlets Sean C. Sullivan October 24, 2006 Portland Java Users Group.
JSF Portlet Copyright © Liferay, Inc. All Rights Reserved. No material may be reproduced electronically or in print without written permission.
Java Servlets and JSP.
SERVLETS.
Gayle J Yaverbaum, PhD Professor of Information Systems Penn State Harrisburg.
Creating a Hello App Using Google App Engine. What are Google apps? Apps is an abbreviation for application. An app is a piece of software. It can run.
Introduction Servlets and JSP Celsina Bignoli
JSP and Servlets Lecture notes by Theodoros Anagnostopoulos.
DAT602 Database Application Development Lecture 15 Java Server Pages Part 1.
Apache Tomcat Web Server SNU OOPSLA Lab. October 2005.
Servlets Environment Setup. Agenda:  Setting up Java Development Kit  Setting up Web Server: Tomcat  Setting up CLASSPATH.
8-2.1 Grid Portals Slides for Grid Computing: Techniques and Applications by Barry Wilkinson, Chapman & Hall/CRC press, © Chapter 8, pp
8-2.1 Grid Portals © 2011 B. Wilkinson/Clayton Ferner. Fall 2011Grid computing course. Modification date: July 26, 2011.
AN OVERVIEW OF SERVLET TECHNOLOGY SERVER SETUP AND CONFIGURATION WEB APPLICATION STRUCTURE BASIC SERVLET EXAMPLE Java Servlets - Compiled By Nitin Pai.
J2EE training: 1 Course Material Usage Rules PowerPoint slides for use only in full-semester, for-credit courses at degree-granting.
SKT-SSU IT Training Center Servlet and JSP. Chapter Three: Servlet Basics.
111 Java Servlets Dynamic Web Pages (Program Files) Servlets versus Java Server Pages Implementing Servlets Example: F15 Warranty Registration Tomcat Configuration.
INDIVIDUAL ACHIEVEMENT. EDUCATIONAL EXCELLENCE. ADMINISTRATIVE INNOVATION. INSTITUTIONAL PERFORMANCE. 1 Develop and Deploy JSR-168 Portlets Presented by:
Mark Dixon 1 12 – Java Beans. Mark Dixon 2 Session Aims & Objectives Aims –To cover the use of Java Beans Objectives, by end of this week’s sessions,
The DSpace Course Module - Look & Feel Customisation.
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.
1 ® Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential. 1 Building Portlets with ColdFusion Pete Freitag Foundeo, Inc.
Java Servlets Lec 27. Creating a Simple Web Application in Tomcat.
Topic Java EE installation (Eclipse, glassfish, etc.) Eclipse configuration for EE Creating a Java Web Dynamic Project Creating your first servlet.
Enhancing portlets with charts and secure directory service Tomasz Kuczyński Poznan Supercomputing and Networking Center.
Application Specific Module Tutorial Akos Balasko 02/07/
Chapter 2 Web app architecture. High-level web app architecture  When a client request coming in and needs servlet to serve dynamic web content, what.
Portlets 1.
20-Nov-15introServlets.ppt Intro to servlets. 20-Nov-15introServlets.ppt typical web page – source Hello Hello.
A seminar on j2ee by saritha. s. What is J2EE J2EE (Java 2 Platform, Enterprise Edition) is a Java platform designed for the mainframe-scale computing.
11a.1 Grid Portals Copyright B. Wilkinson, This material is the property of Professor Barry Wilkinson (UNC-Charlotte) and is for the sole and exclusive.
CSI 3125, Preliminaries, page 1 SERVLET. CSI 3125, Preliminaries, page 2 SERVLET A servlet is a server-side software program, Responds oriented other.
CS320 Web and Internet Programming Introduction to Java Servlets Chengyu Sun California State University, Los Angeles.
COMP9321 Web Application Engineering Semester 2, 2015 Dr. Amin Beheshti Service Oriented Computing Group, CSE, UNSW Australia Week 3 1COMP9321, 15s2, Week.
1 Building Portals with InfoGlue Silicon Valley Code Camp 2007 Freeman Jackson INNOVATION FEED INC.
Short Course on Grid Computing Jornadas Chilenas de Computación 2010 INFONOR-CHILE 2010 November 15th - 19th, 2010 Antofagasta, Chile Dr. Barry Wilkinson.
Configuration Web Server Tomcat - Install JDK Install Tom cat Configure Tom cat for running Servlet C:\Program Files\Apache Software Foundation\Tomcat.
©SoftMoore ConsultingSlide 1 Overview of Servlets and JavaServer Pages (JSP)
HTTP protocol Java Servlets. HTTP protocol Web system communicates with end-user via HTTP protocol HTTP protocol methods: GET, POST, HEAD, PUT, OPTIONS,
NBCR Summer Institute 2006 GridPortlets:Hands-on Installation and Development Jason Novotny
J2EE/Java EE Apache Tomcat v9 IBM Websphere v8 Redhat JBoss EAP v6 Oracle Weblogic v12 Fusion Web Tier ServletsJSPJSF Business Tier JMXJMSEJB.
1 Lecture 8 George Koutsogiannakis/Summer 2011 CS441 CURRENT TOPICS IN PROGRAMMING LANGUAGES.
Topics to be covered (ni) Client side validation JSF (free tools as well) Webservices Tell Resources e.g. sites Packaging and deploying web applications.
1 Web Programming with Servlets & JSPs WEB APPLICATIONS – AN OVERVIEW.
Tutorial on Science Gateways, Roma, Riccardo Rotondo Web Application Development Introduction to application servers, web applications and portlets.
CS320 Web and Internet Programming Introduction to Java Servlets Chengyu Sun California State University, Los Angeles.
CS3220 Web and Internet Programming Introduction to Java Servlets
Kurt Mueller Steve Mock 8/24/04
Data Handlers.
CS3220 Web and Internet Programming Introduction to Java Servlets
Directories and DDs 25-Apr-19.
Directories and DDs 21-Jul-19.
Directories and DDs 14-Sep-19.
Presentation transcript:

NBCR Summer Institute 2006 GridSphere:Hands-on Installation and Development Jason Novotny

Requirements You will need the following software packages on you local machine Java > 1.4.x (java.sun.com) Apache Ant > 1.6 (ant.apache.org) Apache Tomcat > 5.0.x (tomcat.apache.org) Knowledge in Java programming Knowledge in Servlet programming It helps to have a look at the JSR 168 specification ( or read articles on javaworld.com ( 2003/jw-0801-portlet.html) or sun.com ( echart/jsr168/) 2003/jw-0801-portlet.htmlhttp://developers.sun.com/prodtech/portalserver/reference/t echart/jsr168/

Requirements (II) For programming part a good Java IDE (please don’t use vi for real programming) NetBeans ( Eclipse ( IntelliJ Idea ( commercialwww.jetbrains.org

Getting the required software Tomcat: Ant: gz

Getting GridSphere GridSphere is available from d=download Download GridSphere 2.2 (we will refer to that directory from now on as GRIDSPHERE_HOME) Unzip/Untar it $CATALINA_HOME needs to be set to the root directory of tomcat ANT_HOME needs to be set to the root directory of ant export ANT_HOME=

Installing cd gridsphere $ANT_HOME/bin/ant install To enable deploying portlets in a running GridSphere please modify the $CATALINA_HOME/conf/tomcat- users.xml file $CATALINA_HOME/bin/startup.sh ere

Setup GridSphere Fill out the GridSphere setup screen

Running GridSphere

Programming Stop tomcat ($CATALINA_HOME/bin/shutdown.sh) We will create a ‘Hello World’ Example Steps involved: Create the templates Create the jsp, the portlet code Modify the descriptor files Deploy to GridSphere Change the Code Redeploy to GridSphere We going to write a classic HelloWorld example All files can be found at

Creating template files GridSphere provides a mechanism to create template files for your project It is not required to use but it provides some help In GRIDSPHERE_HOME run ‘ant new-project’ You will be asked for a project title, enter Hello World You will be asked for a project name, this will be used for the webapplication name, enter gsexamples (this will be used as directory name for your project) You will be asked whether you want this to be a GS or JSR portletwebapp, enter jsr All templatefiles are now created in GRIDSPHERE_HOME/project/gsexamples If you made a mistake simply erase the GRIDSPHERE_HOME/project/gsexamples directory and start over again

Simple Hello World create a file in the subdirectory src/org/gridsphere/gsexamples/portlets named HelloWorld.java package org.gridsphere.gsexamples; import javax.portlet.GenericPortlet; import javax.portlet.RenderRequest; import javax.portlet.RenderResponse; import javax.portlet.PortletException; import java.io.PrintWriter; import java.io.IOException; public class HelloWorld extends GenericPortlet { public void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException { response.setContentType("text/html"); PrintWriter out = response.getWriter(); out.println(" Hello World "); }

Deployment descriptors All files are located in webapp/WEB-INF We need to edit a couple of deployment descriptor files portlet.xml - JSR 168 standard, describing the portlet layout.xml - GridSphere file, describing the layout of the portlet within a page group.xml - GridSphere file, Describing a collection of portlets More files are needed but are autogenerated and need not to be modified for this example web.xmlweb.xml - Standard web.xml descriptorweb.xml gridsphere-portlet.xml - GridSphere specific PortletServices.xml - For use with GridSphere Portlet Services

portlet.xml (JSR) Specifiy the portlet in webapp/WEB-INF/portlet.xml The classic Hello World example HelloPortlet Hello World org.gridsphere.gsexamples.portlets.HelloWorld 60 text/html edit help en Hello World hello

layout.xml (GS) Specifiy the layout in webapp/WEB-INF/layout.xml GridSphere Examples Hello gsexamples#HelloPortlet

group.xml (GS) Specify the layout in webapp/WEB-INF/group.xml to define which portlet belong together Hello An example group PUBLIC gsexamples#HelloPortlet USER

Deployment Use ‘ant install’ to deploy this portlet to GridSphere Start GridSphere Subscribe to the Hello World group in the Profile Manager

Hello World

Using UI Beans... Let’s enhance the example a bit Make use of the GridSphere UI Visual Beans Enter a name, say hello or goodbye

Creating the JSP JSP’s are stored in webapp/jsp subdirectory of your just created helloworld project Create a jsp file uihelloworld.jsp there !

Creating the portlet Create a directory src/org/gridsphere/gsexamples/portlets/ Create the following portletcode in UiHelloWorld.java: package org.gridsphere.gsexamples.portlets; import org.gridlab.gridsphere.provider.portlet.jsr.ActionPortlet; import org.gridlab.gridsphere.provider.event.jsr.RenderFormEvent; import org.gridlab.gridsphere.provider.event.jsr.ActionFormEvent; import org.gridlab.gridsphere.provider.event.jsr.FormEvent; import org.gridlab.gridsphere.provider.portletui.beans.TextBean; import org.gridlab.gridsphere.provider.portletui.beans.TextFieldBean; import javax.portlet.PortletConfig; import javax.portlet.PortletException;

UiHelloWorld.java public class UiHelloWorld extends ActionPortlet { private static final String DISPLAY_PAGE = "uihelloworld.jsp"; public void init(PortletConfig config) throws PortletException { super.init(config); DEFAULT_VIEW_PAGE = "prepare"; } private void greet(FormEvent event) { TextBean hellobye = event.getTextBean("hellobye"); hellobye.setValue("Hello"); TextFieldBean name = event.getTextFieldBean("name"); TextBean greeting = event.getTextBean("greeting"); if (name.getValue()==null) name.setValue("stranger"); greeting.setValue(name.getValue()); } public void prepare(RenderFormEvent event) throws PortletException { greet(event); setNextState(event.getRenderRequest(), DISPLAY_PAGE); } public void sayHello(ActionFormEvent event) throws PortletException { greet(event); setNextState(event.getActionRequest(), DISPLAY_PAGE); } public void sayGoodBye(ActionFormEvent event) throws PortletException { greet(event); TextBean hellobye = event.getTextBean("hellobye"); hellobye.setValue("Good Bye"); setNextState(event.getActionRequest(), DISPLAY_PAGE); }

portlet.xml Edit the section of the portlet.xml Download as webapp/WEB-INF/portlet-2.xml...<portlet> An Ui Hello World example An Ui Hello World example UiHelloWorld UiHelloWorld org.gridsphere.gsexamples.portlets.UiHelloWorld org.gridsphere.gsexamples.portlets.UiHelloWorld 0 0 text/html text/html en en Ui Hello World Ui Hello World hello, ui, world hello, ui, world </portlet>...

layout.xml Download as webapp/WEB-INF/layout-2.xml <portlet-tabbed-pane> GridSphere Examples GridSphere Examples Hello Hello gsexamples#UiHelloWorld gsexamples#UiHelloWorld </portlet-tabbed-pane>

group.xml Download as webapp/WEB-INF/group-2.xml <portlet-group> HelloWorld HelloWorld UI Hello World Example UI Hello World Example PUBLIC PUBLIC gsexamples#UiHelloWorld gsexamples#UiHelloWorld USER USER </portlet-group>

Redeploy Portlet If you change code you can easily redploy the portlet ant install In GridSphere reload the Hello World portlet app

Deployed portlet! Click on the ‘Hello’ tab Enter your name!

Questions ?