Download presentation
Presentation is loading. Please wait.
Published byWilfred Dennis Modified over 8 years ago
1
Introduction to portlet development Carla Carrubba (carla.carrubba@ct.infn.it) INFN Dpt. Of Catania Giuseppina Inserra (giuseppina.inserra@ct.infn.it) INFN Dpt. Of Cataniacarla.carrubba@ct.infn.itgiuseppina.inserra@ct.infn.it Web course on the development of applications for Catania Science Gateways, 16 July 2013
2
Outline Introduction Portlet Life cycle Modes Files Integrated Development Enviroment MyFirst Portlet
3
Introduction What is a portlet? Portlet is pluggable user interface software component that is managed and displayed in a web portal. Portlet applications, have become a Java standard: the JSR-168 standard defines the Portlet 1.0 specification, and the JSR-286 standard defines the Portlet 2.0 specification. JSR-168/286 standard portlets should be deployable on any portlet container.
4
Introduction Where use a portlet? In a portlet container. We have chosen the award winning Liferay portal framework which offers a rich, easy-to- use "web 2.0" interface using AJAX and other presentation layer technologies. Liferay (www.liferay.com): is a portal framework designed to be a single web-based environment from which all of a user’s applications can run, and these applications are integrated together in a consistent and systematic way.www.liferay.com
5
Introduction Why use a portlet? Sc. Gtwy E Sc. Gtwy DSc. Gtwy CSc. Gtwy B Sc. Gtwy A Portlet Portlets
6
Portlet: Life Cycle
7
Class GenericPortlets { init (PortletConfig); processAction (ActionRequest, ActionResponse); render (RenderRequest, RenderResponse); destroy(); doView (Request, Response); doEdit (Request, Response); doHelp (Request, Response); }
8
Portlet Modes A portlet works in three different states: View Mode: generates a markup ( a portion of a web page) Edit Mode: allows portlet customisation and setting preferences Help Mode: explains portlet functionalities
9
Action Request Action Request processAction() Render Request view.jsp doView() edit.jsp doEdit() doHelp() help.jsp view2.jsp
10
Render request Render Request view.jsp doView() view2.jsp
11
Portlet: Data exchange Interaction between jsp pages and java code JSP page Java code Application Server (Glassfish) <jsp:useBean <jsp:useBean Class Extends GenericPortlet … Class Extends GenericPortlet … JSP uses <form… statements to send parameters to Java code Java code extends class GenericPortlet overriding methods: Init, doView, doHelp, doEdit, processAction Java code uses 2 Classes to exchange data from/to JSPs
12
Portlet Files (root) Used by ‘ ant ’ to compile and deploy the portlet Define here JSP’s styles JSP image files JavaScript files Portlet JSP pages
13
Portlet files(WEB-INF) Used to define database and other resources settings Portlet configuration files Portlet configuration files Jar Library directory (local scope) Java source files Tag library descriptors for XML file
14
Integrated Development Enviroment
15
Thank you Question?
16
MyFirst-Portlet Hands on!! Wiki on myFirstPortlet Download and Deploy myFirst-portlet View myFirst-portlet on your Liferay bundle Customize myFirst-portlet in your personal portlet Test your personal portlet
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.