Upload
osborne-mitchell
View
218
Download
0
Tags:
Embed Size (px)
Citation preview
uPortal Presentation Layer
For FLUID SummitSeptember 27, 2007
Susan Bramhall,Yale University
http://wiki.fluidproject.org/display/fluid/uPortal+Presentation+Layer
Summer 2007 JA_SIG Conference
DLM the uPortal Pushmi-pullyu:
http://www.ja-sig.org/wiki/download/attachments/6063795/DLM-TheuPortalPushmi-Pullyu_Bramhall-Helwig-JA-SIG_20070626.ppt?version=1
Good conceptual overview of DLM
A fragment is a piece of a tree
tab
colu
mn
channels
tab
colu
mn
channels
A predefined fragment including 2 tabs, 3 columns, several channels
How is the “tree of content” created?
• Some content is pushed to the user
• Some is subscribed to by the user
• Some is allowed to go anywhere on the tree
• Some must remain is a certain place
uPortal 2.0 December 2001
• Justin Tiltonhttp://www.ja-sig.org/wiki/download/attachments/13455/looknfeel.pdf
(Works in IE)
This is a great presentation of base uPortal presentation / layout management using Simple Layout Manager.
With thanks to uPortal 2.0 architect
Peter Kharchenko:
SLM issues…
• Layouts were based on template selected based on user attributes.
• Whenever the user modified the layout the ENTIRE layout tree was saved
• User never saw changes to template after that
Summer 2007 JA_SIG
Conference
• Mark Boyd Summer 2007 DLM seminarhttp://www.ja-sig.org/wiki/download/attachments/6063795/DlmSummer2007.ppt?version=1No notes but excellent presentation of 2.6 Distributed Layout
Manager as released in 2.6 plus features in Luminis IV not yet in uPortal
DLM History
2001
2002
uPortal adopted by Campus Pipeline, DLM work starts
DLM 1.0 pushed fragments debut in Luminis
2003
2004
2005
2006
ALM work begins in earnest
SCT asked to contribute DLM
DLM 1.0 debuts in uPortal 2.5
DLM 2.0 Processing Pipeline
2007DLM 2.0 in Luminis
DLM History
• DLM 1.0 (uPortal 2.5)
– Pushed fragments– Variable Restrictions– User Modifications to fragment– XML file based configuration
• DLM 2.0– Graceful Fragment Degratation– Processor pipeline (uPortal 2.6)– Subscribed fragments – Fragment Manager channel/DB based configuration
uPortal Layouts: pre-DLM
UP_LAYOUT_STRUCTUP_LAYOUT_PARAM
LayoutStore Loads
StructureXSLT
LayoutManager manages
ThemeXSLT
uPortal Layouts: DLM Style
UP_LAYOUT_STRUCTUP_LAYOUT_PARAM
DLM LayoutStore
Loads
DLMStructure
XSLT
DLMLayoutManager
managesDLM
ThemeXSLT ILF
PLF
FragmentCache
Merge
ILF = Incorporated Layout Fragment (user’s viewed layout)
PLF = PersonalLayoutFragment (user’s persisted layout)
uPortal Layouts: Fragment Owners
UP_LAYOUT_STRUCTUP_LAYOUT_PARAM
DLM LayoutStore
Loads
DLMStructure
XSLT
DLMLayoutManager
managesDLM
ThemeXSLT ILF
PLF
FragmentCache
ILF = Incorporated Layout Fragment (user’s viewed layout)
PLF = PersonalLayoutFragment (user’s persisted layout)
same
Configuring Fragments
• <development base dir>/properties/dlm.xml• <web-app base>/WEB-INF/classes/properties/dlm.xml
– Properties.– Fragment account declarations.– Audiences that receive those fragments automatically.
DLM.XML Properties
• <dlm:property name='defaultLayoutOwner' value='fragmentTemplate'/>
– Identifies account whose layout should be copied for any newly created fragment accounts.
DLM.XML Properties
• <dlm:property name='layoutDecorator' value='someClass'/>– Deprecated.– Identifies implementation of interface
org.jasig.portal.layout.dlm.LayoutDecorator.• public void decorate (Document layout,
IPerson person, UserProfile profile)
– Allowed customizations to post-merging layout.
DLM.XML Properties
• <dlm:property name='org.jasig.portal.layout.dlm.RDBMDistributedLayoutStore.fragment_cache_refresh' value="5"/>– Determines refresh period of cached fragment layouts
for layout change propagation to other servers.– Value in minutes.
DLM.XML Fragments
• <dlm:fragment name='Entertainment' ownerID='ent-lo' precedence='100'>
– name = name of fragment, shows when owner is logged in.
– ownerID = username for account whose layout is the fragment’s layout.
– precedence = determine’s ordering and bumping rights. If same as another fragment then index of declaration in dlm.xml is used.
– Content is zero to many <dlm:audience> tags.
DLM.XML Audiences
• <dlm:audience evaluatorFactory=‘<someClass'> – Audience identifies who should get the fragment
layout.– Factory must implement
org.jasig.portal.layout.dlm.EvaluatorFactory.• public Evaluator getEvaluator( Node audience );
– Audience parameter is DOM representation of audience tag’s XML content.
– Content must be well-formed XML understood by declared factory.
DLM.XML Audiences
• <dlm:fragment name='Entertainment' ownerID='ent-lo' precedence='100'>
<dlm:audience evaluatorFactory= 'org.jasig.portal.layout.dlm.providers. PersonEvaluatorFactory'>
<paren mode="NOT"> <attribute name="username" mode='equals' value='guest'/> </paren>
</dlm:audience>
</dlm:fragment>
Determines
Demo
– All users but guest should see Entertainment fragment.
– Entertainment fragment owned by ent-lo account.– Changes to layout should appear for other users.
DLM.XML Audience Factories
– Factory implements org.jasig.portal.layout.dlm.EvaluatorFactory.
• public Evaluator getEvaluator( Node audience );
– Evaluator interface• public boolean isApplicable( IPerson person );
– If any audience evaluator answers true then the fragment is granted.
– Four factories included in org.jasig.portal.layout.dlm.provider package.
DLM.XML Audience Factories
– AllUsersEvaluatorFactory• No content. • Always returns true.
– GuestUserEvaluatorFactory• No content.• Returns true if IPerson.isGuest() returns true.
DLM.XML Audience Factories
– PersonEvaluatorFactory• Evaluates IPerson.getAttribute(name) values.• Audience can have one to many paren or attribute elements
and “ORs” their responses together.• Paren element has single attribute “mode” with allowed
values of “AND”, “OR”, and “NOT” and nested element outcomes combine accordingly with NOT acting as if it contained a nested, envelopting “OR” paren.
• Attribute element has three attributes:– name: used as the key for IPerson.getAttribute(key).– mode: can be “contains”, “startsWith”, “exists”, “equals”,
and “endsWith”.– value: is the value used for comparison
DLM.XML Audience Factories
– PersonEvaluatorFactory quiz• <dlm:audience evaluatorFactory=…>
<attribute name=“eyes” mode=“equals” value=“green”/> <attribute name=“eyes” mode=“equals” value=“hazel”/> <attribute name=“eyes” mode=“equals” value=“brown”/></dlm:audience>
• Will grant the fragment to anyone with green or hazel or brown eyes.
DLM.XML Audience Factories
– PersonEvaluatorFactory quiz• <dlm:audience evaluatorFactory=…>
<paren mode=“NOT”> <attribute name=“eyes” mode=“equals” value=“green”/> <attribute name=“hair” mode=“equals” value=“blonde”/> </paren></dlm:audience>
• Will grant the fragment to anyone without both green eyes AND blonde hair. If they have one or the other or both they don’t get it.
• Expression: NOT( eyes=green OR hair=blonde)• Expression: (eyes NOT green) AND (hair NOT blonde)
DLM.XML Audience Factories
– PersonEvaluatorFactory quiz• <dlm:audience evaluatorFactory=…>
<paren mode=“NOT”> <attribute name=“eyes” mode=“equals” value=“brown”/> </paren> <attribute name=“eyes” mode=“equals” value=“brown”/></dlm:audience>
• Will grant the fragment to anyone with eyes NOT(brown) OR brown so everyone gets it.
DLM.XML Audience Factories
– GroupMembershipEvaluatorFactory• Inherits same logical expressions as in
PersonEvaluatorFactory
• “attribute” element only supports attributes:– mode: “memberOf” and “deepMemberOf”– name: name of the group being checked for membership
DLM.XML Audience Factories
– GroupMembershipEvaluatorFactory quiz
• <attribute mode=“memberOf” name=“Everyone”/>– true for Sam, false for Jill.
• <attribute mode=“deepMemberOf” name=“Everyone”/>– true for both Sam and Jill.
Everyone
Students
contains
Sam
Jill
DLM.XML Audience Factories
– Extra Credit quiz• <dlm:fragment …>
<dlm:audience evaluatorFactory=“PersonEvaluatorFactory”> <attribute name=“eyes” mode=“equals” value=“brown”/> </dlm:audience> <dlm:audience evalutorFactory=“GroupMembershipEvaluatorFactory”> <attribute mode=“memberOf” name=“Students”/> </dlm:audience></dlm:fragment>
– Multiple audience tags OR’ed together.– Eyes equal brown OR member of Students.
Custom Evaluator Factories
• If you need it, build it.
– Factory implements org.jasig.portal.layout.dlm.EvaluatorFactory.
• public Evaluator getEvaluator( Node audience );
– Evaluator interface• public boolean isApplicable( IPerson person );
DLM.XML Fragment Precedence
• Location, Location, Location – screen real-estate is not created equal.
– DLM’s merging algorithm pushes tabs from granted fragments into user’s layout view.
– Tabs to left bump tabs to the right off of the screen.
– Channels at top bump channels at the bottom off of the screen.
– Identical precedence reverts to index in dlm.xml.
DLM.XML Fragment Precedence
• <dlm:fragment name=‘A‘… precedence='100'>• <dlm:fragment name=‘B‘… precedence=‘50'>• <dlm:fragment name=‘C‘… precedence=‘75'>• <dlm:fragment name=‘D‘… precedence=‘50'>• User tab “E” • and no restrictions (to be discussed shortly)
Quiz: In what order would merged tabs appear?
A C B D E
DLM 2.0 Features
• Graceful fragment degradation (uPortal 2.6)
• Processor pipeline (uPortal 2.6)
• Subscribe Fragments
• Fragment Manager channel/DB based configuration
Processing Pipeline
• Parameter Processors
processParameters( )
DistributedLayoutManagerProcessLayout
Parameters()
Pro
cess
ing
Pip
e
UserInstance
processParameters() method called on all
processors
getContentHandler( )
User InstanceContent Handler
SAX Event Stream
Processing Pipeline
• SAX Processors
User InstanceContent Handler
DistributedLayoutManager
getUserLayout()
Pro
cess
ing
Pip
e
UserInstance
SomeContent Handler
returns
Processing Pipeline
• Configured in properties/dlmContext.xml– <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans> <bean id='dlmProcessingPipe‘ class="org.jasig.portal.layout.dlm.processing.ProcessingPipe singleton="false"> <property name="fixedProcessors">…</property> <property name=“optionalProcessors">…</property> </bean>
– </beans>
Processing Pipeline in uPortal 2.6
• Defined by dlmContext.xml
• ThemeParamInjector– Passes full name to theme
• RegularViewChannelRemover– Watches for removal of channel
• AjaxPreferencesThemeParamInjector– Sets isAjaxEnabled and isLoggedInUser
Examples
• ExampleStickyTabEnforcerWatches for a tab with name "Sticky Tab" and if
found sets that tab as the currently active tab on every request
• ExampleBookmarksRemoverAlters the SAX event stream coming from the
DistributedLayoutManager by stripping out any events related to a channel with name="Bookmarks".