Building XML Portals with Cocoon M atthew Langham S&N AG [email protected].
-
Upload
raymond-gray -
Category
Documents
-
view
213 -
download
0
Transcript of Building XML Portals with Cocoon M atthew Langham S&N AG [email protected].
Matthew Langham, S&N AG
Matthew Langham
• Technical Director Open Source Group– S&N AG, Paderborn Germany
• Co-Author: – Cocoon: Building XML Applications
• S&N donated Portal and authentication components to Cocoon– Main development by Carsten Ziegeler
• Committer and Release Manager
Matthew Langham, S&N AG
Agenda
• Starting with Apache Cocoon
• Adding Authentication
• Opening the Portal
• Building a Portal
• Examples and Outlook
Matthew Langham, S&N AG
Cocoon
• Apache Open Source project– http://xml.apache.org/cocoon
• Originally Started by Stefano Mazzocchi– Original goal: Redesign Apache.org
• XML Publishing Platform– Makes extensive use of XML and XSL
• Aim: To Separate Concerns (SoC)– Site Administrator, Content Deployer,
Layout Deployer
Matthew Langham, S&N AG
Cocoon
• Document generation on the server– Logical names used
„http://myserver/cocoon/helloworld“
• Runs in different environments – Servlet-Engine– Command Line
Matthew Langham, S&N AG
Cocoon
• Used for various Web application scenarios
– From Web sites to complete XML Portals– XML processing systems
• Extensible Architecture– Based on Apache Avalon– Integrates other open source projects
• Xalan, Xerces, FOP, Batik
– Add new components written in Java
Matthew Langham, S&N AG
Cocoon Architecture
• Sitemap– Centralized Configuration File in XML
• Sub-sitemaps possible
– Contains set of ready-to-use components• Use them to build functions• Write and „drop-in“ your own
– Contains collection of Pipelines (Functions)
Matthew Langham, S&N AG
Cocoon Architecture
• Pipelines– Pipeline processes a request
• Request matched to pipeline with a Matcher
– Contains chain of Java components• Generator• Transformer• Serializer
<map:match pattern=“welcome”> <map:generate src=“welcome.xml”/> <map:transform src=“stylesheets/welcome-page2html.xsl”/> <map:serialize type=“html”/></map:match>
Matthew Langham, S&N AG
Request<map:sitemap> <map:components> <map:generators/> <map:transformers/> <map:serializers/> <map:readers/> <map:selectors/> <map:matchers/> <map:actions/> </map:components> <...> <map:pipelines> <map:pipeline/> <map:pipeline/> <...> </map:pipelines></map:sitemap>
<map:sitemap> <map:components> <map:generators/> <map:transformers/> <map:serializers/> <map:readers/> <map:selectors/> <map:matchers/> <map:actions/> </map:components> <...> <map:pipelines> <map:pipeline/> <map:pipeline/> <...> </map:pipelines></map:sitemap>
GT
TS
Sitemap
Request
XSL
HTML
XML DB
Matthew Langham, S&N AG
HTMLHTMLPDFPDF
Cocoon Architecture
XSLStylesheets
XSLStylesheets
XML Pipeline ConfigurationXML Pipeline Configuration
XSL Layout generationXSL Layout generation
XMLProcessing
XMLProcessing
DatabaseDatabase News Provider
PersonalNews
XML
SQL
LoginWeather
Stocks
Matthew Langham, S&N AG
Building XML Applications
• Cocoon is great .. for …– Publishing, Data source integration, multi-
channel
• But we wanted to do more!– Build XML Applications with additional
functionality
• While evaluating existing portal solutions– We decided that what was really needed
was an integrated Cocoon XML portal
Matthew Langham, S&N AG
sunShine – built on Cocoon
• Commercial product developed by S&N– Based on Cocoon– Additional components and project
specific additions
• sunRise (auth) and sunSpot (portal)– Cocoon components– Completed in mid 2001– Used in various projects (production!)– Donated to Cocoon in Feb. 2002
Matthew Langham, S&N AG
Authentication (org.apache.cocoon.webapps.authentication)
• Mission– Authentication of Users– Protect Documents– Flexible Integration of User Databases– Support for Web Applications– Completely Designed using Cocoon-
Concepts!
Matthew Langham, S&N AG
Authentication (org.apache.cocoon.webapps.authentication)
• Solution– New Cocoon components for
• Common Session Handling• Actions for Authentication
– Everything configurable in Sitemap• Flexibility through pipelines• Mapping: Function Pipeline Call• Documents grouped by Handlers
Matthew Langham, S&N AG
Authentication (org.apache.cocoon.webapps.authentication)
Authentication Framework
Request Document A
DocumentProtected ?
YES
Get handler
UserAuthenticated?
YES: Respond with A
NO: Respond with A
Redirect Document
NO
Respond with Redirect-to Document
Document Protection - Flow
Matthew Langham, S&N AG
Authentication (org.apache.cocoon.webapps.authentication)
• Configuration– Mapping: Function Pipeline Call– Flexible Integration of data-sources– Simple Development of Management
Tools
Matthew Langham, S&N AG
Authentication (org.apache.cocoon.webapps.authentication)
Matthew Langham, S&N AG
Authentication (org.apache.cocoon.webapps.authentication)
Matthew Langham, S&N AG
Portal (org.apache.cocoon.webapps.portal)
• Mission– Flexible integration of User Databases– Profiles and Configuration completely defined in XML– Integration of “data-feeds” (portlets)– Portal user functionality– Multi-Channel – Completely designed using Cocoon-Concepts!
Matthew Langham, S&N AG
Portal (org.apache.cocoon.webapps.portal)
• Solution– Use “sunRise” for User Management– New Cocoon components for
• Portal generation• Portal configuration
– Everything configurable in Sitemap• Mapping Function Pipeline Call
– Coplets can be• A URI• A Cocoon Pipeline• A Java Class
Matthew Langham, S&N AG
Portal (org.apache.cocoon.webapps.portal)
• Portal Profile in XML per User– Selected Information Blocks (coplets)– Ordering and Configuration of coplets– Selected Layout (Colors etc)
• Profile Hierarchy for flexible maintenance– Changes reflected on next login– Profile Caching
• Profiles can be stored in files, databases ...
Matthew Langham, S&N AG
Portal
• Everything is configurable– Available coplets and their features– Layout information– User rights
• Example features of a coplet– Minimizing / Maximizing– Hiding– Configuration
Matthew Langham, S&N AG
PortalPortal Generator
Get UserProfile
Add contentof each coplet
XSLT Transformer
Layout Portal
HTML Serializer
Generate Response
Matthew Langham, S&N AG
Portal
• Flexible Presentation– Stylesheets for multi-channel– Coplets can be channel-dependent
• Flexible Integration of– Authentication– Data-sources– Management Tools
Matthew Langham, S&N AG
Portal
Matthew Langham, S&N AG
Portal
Matthew Langham, S&N AG
Portal
Matthew Langham, S&N AG
Building A Portal
• Download the Cocoon distribution– Build from CVS
• Use the included example Portal as a base
• Choose some feeds– Standard format such as RSS helps
• News, Weblogs, …
– Other formats via Pipeline
• Define the coplet pipeline– Just a regular Cocoon pipeline
Matthew Langham, S&N AG
Coplet Pipelines
<map:match pattern="sunbanksunlet-onlinesundn.xml"> <map:generate src="http://www.s-und-n.de/aktuelles/news.xml"/> <map:transform src="sunbank/styles/sunLet_sundnNews.xsl"/> <map:serialize type="xml"/></map:match>
<map:match pattern="sunbanksunlet-account.xml"> <map:generate src="sunbank/resources/auth/sunlet-account.xml"/> <map:transform src="sunbank/styles/sunlet-account.xsl"/> <map:serialize type="xml"/></map:match>
<map:match pattern="sunbanksunlet-online-*.xml"> <map:generate src="http://p.moreover.com/cgi-local/page?index_{1}+xml"/> <map:transform src="sunbank/styles/sunLet_MoreoverDotCom.xsl"/> <map:serialize type="xml"/></map:match>
Matthew Langham, S&N AG
Building A Portal
• Configure the coplets– Edit coplet definition file or use provided
tools
• Add new coplet to profile– Edit profile definition file or use provided
tools
• Define your Portal Layout– Just change the stylesheet– Use a Selector to have a “night” portal
Matthew Langham, S&N AG
A News Portal
Matthew Langham, S&N AG
Outlook
• Merging other Cocoon portal ideas
• Flexible architecture– Different pluggable Portal Managers
• Flexible Presentation– Not limited to tables
• JSR 168 support– Evaluation if and when available
Matthew Langham, S&N AG
From a bank…
Matthew Langham, S&N AG
…to the moon
• Andrew J Lewis, NASA:
Cocoon 2.x is being used as the core of a new portal that is being built at NASA Kennedy Space Center.
Thanks you all for making my job SOOO much easier!!!
Matthew Langham, S&N AG
…and other fans
• Bert Van Kets, The Vision Web Belgium NV
Although I'm working in a Microsoft adept environment, where people install every Microsoft Server Product available, it took only 1 little 20 minutedemonstration of the S&N Cocoon Portal to convince everybody the companyneeds this.
... the portal was up and running and ready to be filled with content in 1 day, including presentation adjustments. The underlying technology of XML, XSLT and the implemented Java components make the portal very easy to manageand adjust.
Matthew Langham, S&N AG
Closing the Portal
• XML Portal available in Cocoon today!– Tried and trusted
• Used by NASA, BASF-IT Services and others
– It‘s open source• You don‘t like it? – help us make it better!
• Example portal included– Show your customers!– Change the stylesheet for more Wows!
• Documentation is available
Matthew Langham, S&N AG
Cleaning Up
• The Company– http://www.s-und-n.de
• Email me– [email protected]
• Cocoon Authentication and Portal– http://xml.apache.org/cocoon– CVS checkout and build– Contains documentation– Contains tools