portlets - Personal Web Pages

Download Report

Transcript portlets - Personal Web Pages

Grid Portals
ITCS 4146/5146 Grid Computing, 2007, UNC-Charlotte, B. Wilkinson. March 11, 2007
11.1
Grid Portal
• “A web-based application server enhanced
with the necessary software to
communicate to grid services and
resources”
• “Provides application scientist a
customized view of software and hardware
resources from a web browser” [1]
[1] “Grid Computing Making the Global Infrastructure a Reality” ed. F. Berman, G. C. Fox and A. J. G. Hey, Wiley, 2003,
Chapter 27 “The Grid portal development kit” by J. Novotny.
11.2
Grid Portals
• Uses a Web browser interface
– Can use from anywhere.
• Hides details of Grid middleware
– Good!!
• Provides
–
–
–
–
–
–
Access to grid information
Access to grid services
Automated execution of applications/jobs
Workflow management
File management
Single sign-on to grid resources
11.3
Access to Grid Services
• Security Services
– management of certificates
– access to virtual organization (people)
• Remote File Management
– access to files and directories
– moving files
• Remote job management
– job submission
– workflow management
11.4
Access to Information
• Portals also provide access to
information -- anything related to tasks
at hand, including communication with
virtual organization.
• In fact, some portals started simply as
informational portals in the same vein
as web portals such as yahoo.
11.5
Grid Portal Toolkits
Need software tools to put together grid
portals
Several portal “toolkits” developed since
mid-1990’s.
Used for application specific grid projects,
and for general-purpose grid portals
11.6
Available Technologies for
putting together portal toolkits
11.7
Java Servlets
Objects that allows a software developer to add
dynamic content to a Web server using the Java
platform.
Generate content commonly HTML but may be other
data such as XML.
Servlets can maintain state across many server
transactions by using HTTP cookies, session
variables or URL rewriting (altering URL before
requesting item).
http://en.wikipedia.org/wiki/Java_Servlet
11.8
JavaServer Pages (JSP)
A Java technology that allows software developers
to dynamically generate HTML, XML or other
types of documents in response to a Web client
request.
JSP syntax adds additional XML-like tags, called
JSP actions, to be used to invoke built-in
functionality.
JSPs compiled into Java Servlets by a JSP
compiler.
From: http://en.wikipedia.org/wiki/JavaServer_Pages
11.9
JavaBeans
Java classes used to encapsulate
many objects into a single object (the
bean), so that the bean can be
passed around rather than the
individual objects.
http://en.wikipedia.org/wiki/JavaBeans
11.10
Commodity Grid (CoG) Kits
(Examples: Java and Python CoG Kits)
A higher-level framework for grid devopment.
Allow rapid Grid application development.
Encourage collaborative code reuse and avoid
duplication of effort.
Used within GT3.2 and GT4.
Java-based GSI, gridFTP, myProxy, GRAM client.
Provides support for portal developers.
http://wiki.cogkit.org/index.php/Main_Page
11.11
Servlet engines
Provides support for servlets.
Example
Apache Tomcat
Apache Tomcat used in Assignment 6,
together with Gridsphere portlet framework)
11.12
Early Portal Toolkit Examples
1990s:
• The Grid Portal Development Kit (GPDK)
(not now supported)
– Used Java Server Pages (JSPs) for
presentation layer, and JavaBeans to access
backend.
• NPACI Grid Portal Toolkit (Gridport)
(National Partnership for Advanced
Computational Infrastructure)
11.13
• GridPort 2.0
– Perl-based Grid portal toolkit
• Ninf Portal
– JSP/Java Servlet front-end
• GridSpeed portal
– an extension of Ninf
11.14
11.15
Application-Based Portals
• Portals often specialized to a particular
application.
– for example, grid portal for high energy
physics.
• Portal toolkits give ability to taylor portal
to application or user.
11.16
NPACI Hotpage Grid portal
(based upon GridPort)
MPI program
Starting job
From a paper”Building GridPortals: The NPACI Grid Portal Toolkit” by M. P. Thomas and J. R. Boisseau.
11.17
Adapted from slides “The NCSA Alliance Portal and the Open Grid Computing Environment Project” by
D. Gannon, G. Fox, B. Plale, M. Pierce, M. Thomas, C. Severance, G. von Lazewski, and J. Alameda.
11.18
DOE Fusion
Grid Portal
Adapted from slides “Reuseable Grid Portral Components” by M Thomas.
11.19
Linked Environments for Atmospheric Discovery (LEAD)
Adapted from slides “Reuseable Grid Portral Components” by M Thomas.
11.20
NEES – www.neesgrid.org
• George E. Brown, Jr. Network for
Earthquake Engineering Simulation
– Large Installations of physical equipment for
earthquake experiments and simulations
– Part of the award is to make equipment
available for remote collaborators
• Focus is on collaboration and experimental
equipment sharing in addition to access to
computation
From slides “The NCSA Alliance Portal and the Open Grid Computing Environment Project” by D.
Gannon, G. Fox, B. Plale, M. Pierce, M. Thomas, C. Severance, G. von Lazewski, and J. Alameda.
11.21
Network for Earthquake Eng. and
Simulation (NEESGrid)
Adapted from slides “Reuseable Grid Portral Components” by M Thomas.
11.22
• Early grid portals “tools” not very
flexible.
• Tied to specific programming tools and
grid software, such as Globus 2.4.
• Specific programming structure not
suitable for users to develop portals
themselves.
• Not standardized APIs.
11.23
Portal Implementation
• Should be flexible, meet grid industry
standards, be able to be extended using
parts developed by others.
• General approach currently is to use
“software components” called portlets.
11.24
Portals with Portlets
• Portal server consists of portlets
• Each portlet provides certain functionality
and a window within the portal.
• Each portlet can be associated with a
particular grid service
• User can have any number of portlets as
he/she wishes (will be associated with
user’s persistent context).
11.25
Portlets provided for:
– Management of user proxy certificates
– Remote file Management via Grid FTP
– News/Message systems
• for collaborations
– Grid Event/Logging service
– Access to OGSA services
– Access to directory services
– Specialized Application Factory access
• Distributed applications
• Workflow
– Access to Metadata Index tools
• User searchable index
11.26
Portal Server
Event and
logging
Services
Application
Factory
Services
Messaging
and group
collaboration
Portal Server
Directory
& index
Services
MyProxy
Server
Metadata
Directory
Service(s)
Adapted from slides “The NCSA Alliance Portal and the Open Grid Computing Environment Project” by
D. Gannon, G. Fox, B. Plale, M. Pierce, M. Thomas, C. Severance, G. von Lazewski, and J. Alameda.
11.27
Portlet Approach to Grid Services
Event and
logging
Services
Application
Factory
Services
Portal Server
Messaging
and group
collaboration
Portlet Portlet Portlet
1
2
3
Portlet Portlet Portlet
4
5
6
Directory
& index
Services
MyProxy
Server
Metadata
Directory
Service(s)
Adapted from slides “The NCSA Alliance Portal and the Open Grid Computing Environment Project” by
D. Gannon, G. Fox, B. Plale, M. Pierce, M. Thomas, C. Severance, G. von Lazewski, and J. Alameda.
11.28
A Pane and portlet
The current
Visible pane
Proxy
Manager
Portlet
Adapted from slides “The NCSA Alliance Portal and the Open Grid Computing Environment Project” by
D. Gannon, G. Fox, B. Plale, M. Pierce, M. Thomas, C. Severance, G. von Lazewski, and J. Alameda.
11.29
Advantages of Portlet Approach
• Easy to add new grid services and
reconfigure user’s view (context)
• Different software developers can provide
portals to be plugged into portal
– Many parties developing portal and portlet tools
-- Jetspeed (Apache), Websphere (IBM),
GridSphere, …
• Portal/portlet standard called JSR 168
(portlet Java Specification Request open
standard).
11.30
Portal
Layout
11.31
National Science Foundation
Middleware Initiative (NMI)
• Started in 2001 initially over 3 years “to
create and deploy advanced network
services that simplify access to diverse
Internet information and services.”
• Provides a centralized location for important
grid software.
• Current NMI package includes Globus,
Condor, MPI-G2, and:
– a new grid portal project called OGCEGrid
(funding started Sept 2003).
11.32
Consortium established “Fall 2003 to foster
collaborations and shareable components
with portal developers worldwide”
The following screenshots taken from http://www.ogce.org
11.33
OGCE version 1
Sample feature
11.34
Membership:
Join/participate in different topic groups (Group tabs across top).
11.35
Schedule: Maintain a personal or group calendar.
11.36
Chat:
Engage other members of your group in online discussion.
11.37
Proxy Manager and Job Submit:
Obtain/manage Grid credentials to access Grid resources through browser.
Also shown are GRAM job launchers and sample "ping" portlet.
11.38
Grid FTP: Use your credential to browse remote
directories/upload/download files.
11.39
Grid Context:
Store arbitrary web objects (movies, web pages, audio
files) in a customizable, annotated directory tree.
11.40
The OGCE Release 2
• Consists of a core set of JSR 168
compatible Grid portlets.
• Portal container-independent.
• Currently can choose between uPortal and
GridSphere containers to deploy OGCS2
portlets.
http://www.collab-ogce.org/nmi/ogce2-docs/index.html
11.41
GridSphere
• Portal framework provides an opensource portlet based Web portal.
http://www.gridsphere.org/gridsphere/gridsphere
11.42
11.43
Assignment 6a
• Goal: To learn how to deploy portlets
within Gridsphere.
• Makes underlying software structure of
JSR 168 grid portals more concrete.
11.44
Structure
Gridsphere portal framework
Portlet
Deploy
Apache Tomcat servlet engine
11.45
Step 1: Download and Install Tomcat
Testpage: http://localhost:8080/
11.46
Step 2: Download and Install Gridsphere
After downloading and installing Gridsphere,
Gridsphere located at:
http://localhost:8080/gridsphere/
11.47
Goto http://localhost:8080/gridsphere/ to get
set-up screen:
11.48
After filling details, get usual Gridsphere screen.
Similar to course portal except PURSe registration
portlet not installed (a separate package):
11.49
Creating your own portlet
The portlet will accept one number and say
whether it is odd or even (“oddeven” portlet)
11.50
Files
Gridsphere provides tool to create template
files.
Portlet designer then needs to provide java
source file that does the required evaluation,
and
Provide/modify three portlet deployment
descriptor files.
11.51
Directory Structure
src holds
directory
structure
leading to
java
source file
webapp holds
deployment
descriptor files
11.52
Deployment descriptor files
Three deployment descriptor files needed to create a
portlet:
• Portlet.xml
• Layout.xml
• Group.xml
JSR 168 standard, describing portlet
Gridsphere file describing layout of
portlet within page
Gridsphere file describing collection
of portlets
Files are held webapp\WEB-INF directory.
(There are other deployment files, which generated
automatically during deployment.)
11.53
webapp\WEB-INF directory
Group.xml
Layout.xml
Portlet.xml
11.54
<portlet-tabbed-pane>
<portlet-tab label="Odd Even">
<title lang="en">Odd Even</title>
<portlet-tabbed-pane style="sub-menu">
<portlet-tab label="oddeventab">
<title lang="en">Odd Even</title>
Specified columns and rows of
<table-layout>
<row-layout>
a table in portlet. Components
<column-layout>
are in cells of table.
<portlet-frame label="Odd Even">
<portlet-class> edu.uncc.abw.portlets.OddEven
</portlet-class>
</portlet-frame>
</column-layout>
Path to portlet code
</row-layout>
(There is an alternative
</table-layout>
format using # symbol)
</portlet-tab>
</portlet-tabbed-pane>
</portlet-tab>
</portlet-tabbed-pane>
Layout.xml
11.55
group.xml
Specifies group for portlet
<?xml version="1.0" encoding="UTF-8"?>
<portlet-group>
Group name
<group-name>demo</group-name>
<group-description>The demo group</groupdescription>
<group-visibility>PUBLIC</group-visibility>
<portlet-role-info>
Portlet
<portlet-class>edu.uncc.abw.portlets.OddEven
</portlet-class>
<required-role>USER</required-role>
</portlet-role-info>
</portlet-group>
11.56
…
Portlet.xml
<portlet>
<description xml:lang="en">Odd Even Portlet</description>
<portlet-name>OddEven</portlet-name>
<display-name xml:lang="en">Odd Even Portlet</display-name>
<portlet-class>edu.uncc.abw.portlets.OddEven</portlet-class>
<expiration-cache>60</expiration-cache>
<supports>
Portlet
<mime-type>text/html</mime-type>
<portlet-mode>edit</portlet-mode>
<portlet-mode>help</portlet-mode>
</supports>
<supported-locale>en</supported-locale>
<portlet-info>
<title>Odd Even</title>
<short-title>Odd Even</short-title>
<keywords>odd even</keywords>
</portlet-info>
</portlet>
</portlet-app>
11.57
Java portlet
code
public class OddEven extends ActionPortlet {
private static final String DISPLAY_PAGE = "MainPage.jsp";
public void init(PortletConfig config) throws PortletException {
super.init(config);
DEFAULT_VIEW_PAGE = "prepare";
}
public void action(ActionFormEvent event) throws PortletException {
TextFieldBean value1 = event.getTextFieldBean("valueTF1");
TextBean answer = event.getTextBean("answer");
int val = Integer.parseInt( value1.getValue() );
if (value1.getValue() == null ) { answer.setValue(""); }
else {
if( isEven(val) ) {
answer.setValue("The number: " + value1.getValue() + " is Even");
} else {
answer.setValue("The number: " + value1.getValue() + " is Odd");
}
}
setNextState(event.getActionRequest(), DISPLAY_PAGE);
}
public void prepare(RenderFormEvent event) throws PortletException {
setNextState(event.getRenderRequest(), DISPLAY_PAGE);
}
public boolean isEven(int val) {
return val % 2 == 0;
}
11.58
}
JavaServer Pages, .jsp
OddEven.java also uses a file called
MainPage.jsp to dynamically
generate an HTML page.
MainPage.jsp held in webapp\jsp
directory
11.59
<%@ taglib uri="/portletUI" prefix="ui" %>
<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
<portlet:defineObjects/>
<ui:form>
<ui:table width="500">
<ui:tablerow>
<ui:tablecell>
This portlet will figure out if the inputed number is even or odd.
</ui:tablecell>
</ui:tablerow>
<ui:tablerow>
<ui:tablecell>
<ui:textfield size="10" beanId="valueTF1"/>
</ui:tablecell>
</ui:tablerow>
<ui:tablerow>
<ui:tablecell>
<ui:text beanId="answer"/>
</ui:tablecell>
</ui:tablerow>
<ui:tablerow>
<ui:tablecell>
<ui:actionsubmit action="action" value="Get Answer"/>
</ui:tablecell>
</ui:tablerow>
</ui:table>
</ui:form>
11.60
MainPage.jsp
Final Odd Even portlet
11.61
More
Information
See the links on
the Gridsphere
portal page
11.62
General information on portals
•
Books:
“Grid Computing Making the Global
Infrastructure a Reality” ed. F. Berman,
G. C. Fox and A. J. G. Hey, Wiley,
2003.
– Chapter 27 “The Grid portal development
kit” by J. Novotny.
– Chapter 28 “Building grid computing
portals: the NPACI grid portal toolkit” by M.
P. Thomas and J. R. Boisseau
11.63
More Information
• JSR 168 Portlet specification
http://jcp.org/aboutJava/communityprocess/review/
jsr168
• GridLab, The GridSphere Portal
http://www.gridsphere.org/gridsphere/gridsphere
• Network for Earthquake Engineering
Simulation Grid (NEESGrid)
http://www.neesgrid.org
11.64
Questions
11.65