170 likes | 267 Views
E217 EP Portlets and Servlets: Step by Step and Side by Side. Tommy Phillips Principal Systems Consultant E-Business West tommy@sybase.com. Introduction. Why Use Servlets in a Portal? How Do You Use Servlets in a Portal? Code Samples. Portal Display.
E N D
E217EP Portlets and Servlets: Step by Step and Side by Side • Tommy Phillips • Principal Systems Consultant • E-Business West • tommy@sybase.com
Introduction • Why Use Servlets in a Portal? • How Do You Use Servlets in a Portal? • Code Samples
Portal Display • Live Demo: Sybase Enterprise Portal Page
Why Use Servlets? • Existing Code Re-use • Servlet Include • Back End to Applet – Or Portlet • Controversial, but Sometimes Useful • Developer Experience • Fast Ramp-up
Why in a Portal? • Portlets Provide "GUI Integration" • Not EAI – Improving Daily Tasks • Leverage Existing Work • Incremental Implementation of Global Vision
Session Dynamic Page Portlet Portlet Portlet External Systems External Systems External Systems External Systems Background: How JTF Portlets Work Browser Servlet: portal PI DB
And What Is In Those "Portlets"? • Pre-Built Portlets: • Search, News, ERP access, etc. • Custom Portlets: • HTML-Based Presentation • Java-Coded Business Logic • OnePage • Mostly Used For Aggregation • Heterogenous Data Sources • Homogeneous Presentation
Portlet Structure: Presentation • Presentation Layer: .inc File • Mapped to Distinct Client Platforms (HTML, WAP, etc.) • HTML: <BODY> Contents • Static Presentation • Form Elements (Buttons, Text Areas, etc.) • JTF Tags • Much like JSP Custom Tags • Allow JavaBean Data Access • Includes (Static or Servlet)
A Closer Look At A JTF Portlet • Live Demo • Code • Include File • Java code
How To: Existing Servlet Re-use • Servlet Include • JTF Tag: • "<jtf:include servlet="servletURL" value1="" operator="equals" value2=""/>" • Parameter Use • Caution: Watch Out for HTML
Existing Servlet Re-Use: Code Sample • Servlet • Base Function: Display Page • JTF Include Servlet • Simple Inclusion • HTML Header Tricks • Cleaning Up Gracefully
An Included Servlet • Live Demo • Raw Servlet • Included Servlet • Code • Servlet Code • Portlet Include
How To: Back End for Portlet • Step 0: Applet Back End • Simple Text Content • Servlet Explicit Formatting • JTF Explicit Formatting • Format With JTF List
Live Demo Code Applet Servlet Back End for Applet
Primary Use of Servlets is to Generate HTML Whole Page or Partial Servlets Can Generate Any Text An Applet Can Display Servlet Output Simple Parsing Into Rich User Interface Breaking the Bonds of HTML Presentation Sidebar: Servlets as Applet Back Ends
Live Demo Code Portlet Include Java Code Servlet Code Transforming to Back End for Portlet
Sybase EP Portlets Provide Rich GUI Functionality Servlets Can Supplement New Portlet Development Portlets Can Include Existing Servlets Into the Portal Summary