rendering contexts and components what is a uportal3 context ? –defines all aspects of a...

17
Rendering Contexts and Components What is a uPortal3 context ? Defines all aspects of a traditional portal instance • Design, navigation, profiles • Parameter syntax • Portlet selections, session scopes Multiple, concurrent contexts can be used Example contexts static frame showing a single portlet simple navigation with human-readable URLs uPortal2 clone

Upload: quentin-armstrong

Post on 12-Jan-2016

214 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Rendering Contexts and Components What is a uPortal3 context ? –Defines all aspects of a traditional portal instance Design, navigation, profiles Parameter

Rendering Contexts and Components

• What is a uPortal3 context ?– Defines all aspects of a traditional portal instance

• Design, navigation, profiles• Parameter syntax• Portlet selections, session scopes

– Multiple, concurrent contexts can be used

• Example contexts– static frame showing a single portlet– simple navigation with human-readable URLs– uPortal2 clone

Page 2: Rendering Contexts and Components What is a uPortal3 context ? –Defines all aspects of a traditional portal instance Design, navigation, profiles Parameter

Rendering Contexts and Components

cont

ext

B

cont

ext

X

context resolver

cont

ext

Aparameterprocessing

rend

erin

g pi

pelin

e

layoutsource

transformer

transformer

filter

serializer

selects a context to be usedin processing the incoming requestparses request URL syntax

initiates actions on:•portlets•rendering pipeline elementsgenerates initial user layoutmarkup.

Aggregated, simple layoutsa chain of transformers andfilters compiles presentationmarkup.

URL command syntax canbe customized by providingalternate processing andURL generation components

Page 3: Rendering Contexts and Components What is a uPortal3 context ? –Defines all aspects of a traditional portal instance Design, navigation, profiles Parameter

Context resolvers

• Servlet Path context resolver– switch contexts by going to a specific servlet path– http://hostname/uPortal/context/.../render.uP– default, ServletPathContextResolver implementation

• Alternatively contexts can be resolved using– user information

• authentication state• user affiliation (groups), attributes (permissions)

– user agent information (browser)– internal states, session (ex.:down for maintenance)

Page 4: Rendering Contexts and Components What is a uPortal3 context ? –Defines all aspects of a traditional portal instance Design, navigation, profiles Parameter

Context responsibilities

uPortal Framework

User Interaction Presentation

Channel Channel Channel

Page 5: Rendering Contexts and Components What is a uPortal3 context ? –Defines all aspects of a traditional portal instance Design, navigation, profiles Parameter

Context responsibilities

uPortal3 Context

User Interaction Presentation

Portlet Portlet Portlet

IPortletWindowManager / JSR168 container (Pluto)

Page 6: Rendering Contexts and Components What is a uPortal3 context ? –Defines all aspects of a traditional portal instance Design, navigation, profiles Parameter

Contexts

• IContext– service(HttpRequest, HttpResponse)

• CompoundContext implements IContext– separates parameter processing and rendering– IRequestParameterController

• processParameters(HttpRequest, HttpResponse)

– IPortalRenderer• render(HttpRequest, HttpResponse)

Page 7: Rendering Contexts and Components What is a uPortal3 context ? –Defines all aspects of a traditional portal instance Design, navigation, profiles Parameter

Rendering: drilling down

• TreeRenderer implements IPortalRenderer– Responsible for rendering cycle initiation/events– Assumes a rooted structure of components

• IRenderingComponentManager– Defines the topology of rendering components– Responsible for finding optimal cache entry points

• PipelineComponentManager – defines linear pipeline rendering structures

Page 8: Rendering Contexts and Components What is a uPortal3 context ? –Defines all aspects of a traditional portal instance Design, navigation, profiles Parameter

Rendering: SAX pipelines

• uPortal2-like pipeline in which components pass SAX events to each other

• ISaxConsumer and ISaxRenderer• Components

– abstract Filters and Buffers– Serializers– XSL transformers

• SAX Cache entry points– know how to replay cache– returned by cache managers

• implementing IPipelineCacheManager

Page 9: Rendering Contexts and Components What is a uPortal3 context ? –Defines all aspects of a traditional portal instance Design, navigation, profiles Parameter

Rendering: String pipelines

• Pipeline that operates by transforming Strings• quick, non-restricted

• IStringRenderer and IStringFilter• Components

– RegexStringFilter• PortletRenderingInitiationFilter

– StringResponseWriter

• String cache filters, managers, entry points

Page 10: Rendering Contexts and Components What is a uPortal3 context ? –Defines all aspects of a traditional portal instance Design, navigation, profiles Parameter

Rendering: Hybrid pipelines

• Pipelines that can be configured with multiple types of components– org.jasig.portal.rendering.hybrid– component manager implementation

• connector structure

– cache manager implementation• multiple cache types• prioritized

• Should be primary choice for configuring context rendering

• uP2 context example

Page 11: Rendering Contexts and Components What is a uPortal3 context ? –Defines all aspects of a traditional portal instance Design, navigation, profiles Parameter

Rendering: XML layout sources

• Starting point for the SAX pipelines– XmlFileLayoutSource

• implements IPortalRenderer, ISaxRenderer

• org.jasig.portal.layout.uportal2 package– LegacyLayoutSource

• wraps IUserLayoutManager

– SimpleUserLayoutManager • lightly modified uPortal2 version• with simplified DAO Impl

Page 12: Rendering Contexts and Components What is a uPortal3 context ? –Defines all aspects of a traditional portal instance Design, navigation, profiles Parameter

Rendering: XSLT TransformationFilter

• A flexible XSLT SAX rendering component– Configured with ITransformerPreferences– Insert arbitrary element attributes & params

• Transformer preferences– contain IStylesheetDescription

• location, mime type, etc.• IParamDescription and IElementAttributeDescription

– default values, persistance scope, target elements

– responsible for keeping track of current values of stylesheet params, attributes

– RuntimeTransformerPreferences (in memory)– TransformerPreferencesImpl (persistent)

• ITransformerHelper – stylesheet handling

Page 13: Rendering Contexts and Components What is a uPortal3 context ? –Defines all aspects of a traditional portal instance Design, navigation, profiles Parameter

Contexts

• IContext– service(HttpRequest, HttpResponse)

• CompoundContext implements IContext– separates parameter processing and rendering– IRequestParameterController

• processParameters(HttpRequest, HttpResponse)

– IPortalRenderer• render(HttpRequest, HttpResponse)

Page 14: Rendering Contexts and Components What is a uPortal3 context ? –Defines all aspects of a traditional portal instance Design, navigation, profiles Parameter

CompoundContext parameter processing

• Before the rendering starts, need to make sense of the request parameters …

• RequestParameterProcessorListController– based on a prioritized list of parameter processors– each parameter processor talks to some component– ordered list of IRequestParameterProcessors

• boolean processParameters(req, res)• allows multiple rounds of processing for variable evaluation

– set of IUrlConstructorProviders

• Example: uPortal2 transformation legacy syntax

Page 15: Rendering Contexts and Components What is a uPortal3 context ? –Defines all aspects of a traditional portal instance Design, navigation, profiles Parameter

Context patterns: parameter-aware component

• Goal– isolation and targeted injection of components

• Parameter-aware context component– directly involved in the rendering– assisting other rendering components– assisting other parameter processors

• Pattern:– Implement URL constructor (i.e. how to write)– Implement ParameterProcessor (i.e. how to parse)– Connect processor, component itself and other pieces

using dependency injection– Test URL constructor and processor against

eachother

Page 16: Rendering Contexts and Components What is a uPortal3 context ? –Defines all aspects of a traditional portal instance Design, navigation, profiles Parameter

Context patterns: parameter-aware component

• Example 1: Legacy (uP2) Layout param syntax– see PDF

• Example 2: Persistence manager– job: fire off persistence events– request param command to initiate persistence– no rendering, just param processing– injected into secondary parts of the downstream

components (i.e. preferences impl for the XSLT Filter)

– Commands interface (optional)– IRequestParameterProcessor impl.– URL constructor impl.

Page 17: Rendering Contexts and Components What is a uPortal3 context ? –Defines all aspects of a traditional portal instance Design, navigation, profiles Parameter

The fate of the URL constructors

• Controller configuration is passed to Pluto’s PortletURLFactoryImpl

• PortletURL delivered to the portlets– implements IPortletUrl

• adds ability to obtain uPortal-specific URL constructors• getUrlConstructor(name)

– IPortletUrlConstructor • implements portlet URL syntax• also configurable