distributed layout management
DESCRIPTION
Distributed Layout Management. Mark R. Boyd Principal Engineer Information and Communication Systems The Church of Jesus Christ of Latter-Day Saints Formerly Software Architect Sungard Higher Education. Agenda. History Configuring Fragments Restrictions and Merging Processor Pipeline - PowerPoint PPT PresentationTRANSCRIPT
Distributed Layout Management
Mark R. Boyd
Principal EngineerInformation and Communication Systems
The Church of Jesus Christ of Latter-Day Saints
Formerly Software Architect
Sungard Higher Education
Agenda
• History• Configuring Fragments • Restrictions and Merging • Processor Pipeline • Fragment Manager• Subscribed Fragments• Future work• Questions
What is DLM?
?Distributed Layout Management
?
What is DLM?
Fragment
Fragment
User Owned
What is DLM?
FragmentOwned Tab
Fragment OwnedChannel
User OwnedChannel
What is DLM?
– Fall 2001 Campus Pipeline Platform inflexible UI– uPortal selected for end user customization– But…– Schools must be able to lock some portion of UI – No consensus on what should be locked in place – Only three months to implement– Only one resource available
What is DLM?
CompletelyLocked UI
CompletelyFlexible UI
Schools Choose
What is DLM?
– Leverage uPortal ability to create/edit layouts. (ie: use accounts (fragment owners) as source of fragment.
– Enhance editing with layout element restrictions for fragment owners. (ie: selectively restrict tabs, columns, or channels individually.)
– Facilitate persistence of end user edits to fragment elements.
– Define concept of fragment precedence in view of fragment restrictions.
– Gracefully merge fragment layouts and user edits into a coherent view.
• Result: Distributed Layout Management– Ownership of the portal layout viewed by a user is distributed among
fragment owner accounts and the user’s own edits.
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
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
uPortal Layouts
• Raw uPortal layouts represented by hierarchical folders.
• Structure XSLT transform converts to XML structure indicative of visual presentation.
• Theme XSLT transform converts to target markup like HTML, WML, etc.
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
uPortal Layouts: DLM Style
• Each element originating from a fragment has two added DLM attributes:
– dlm:fragment: the fragment identifier (currently is index in dlm.xml)
– dlm:precedence: the declared precedence of the fragment
uPortal Layouts: DLM Style
• Fragment elements can have restrictions that limit what end users can do. (Asserted false. Not included for true.)– dlm:moveAllowed = restricts lower precedence
elements from moving to a better real-estate location.– dlm:editAllowed = restricts editing structure specific
attributes. (Ex: name for tabs, width for columns)– dlm:deleteAllowed = prevents user from deleting.– dlm:addChildAllowed = restricts adding child
elements. (Ex: columns to tabs and channels to columns.)
• Restrictions set by Fragment owners in uPortal UI.– Demo:renaming and moving
uPortal Layouts: ILF and PLF
• End-user-changes to fragments persisted in user’s layout as “ghost” elements and DLM directives.
• Therefore, each user has two layouts:
• Merging algorithm reapplies changes at log in time as much as is still allowed.
• Garbage collects changes that are not allowed or have no effect. (Self minimizing)
DLM Directives
• dlm:delete = indicates fragment elements that were removed.
• dlm:edit/dlm:pref = an edit made to a fragment element’s attribute.
• dlm:position = indicates user placement of fragment and user owned elements.
• dlm:parm = indicates user added/overridden channel parameter.
Channel Ad-hoc Parameter Persistence
• ChannelStaticData publish time parameters– getParameter(key)– setParameter(key, value)– store()
• Store() depends on support of backing layout management approach. DLM persists ad-hoc parameter changes in PLF via dlm:param directives.
• Fragment Owner values flow to fragment users.– Demo: Post-it channel.
Merging Characteristics Quiz
• What happens if user deleted and element and fragment owner later marked it as not removeable?– The element will reappear and not be removeable
thereafter.• What happens if user adds a channel to a fragment
column and fragment owner later restricts adding channels to that column?– The added channel will be removed.
• What happens if user has rearranged channels in fragment column and fragment owner then adds another channel at the top?– Added channel drops to bottom of column.
DLM and Permissions
• Fragments granted to users via dlm.xml declared evaluators.
• Channels granted to users via group membership.
• Graceful degradation: merging algorithm silently drops channels from fragments if user has insufficient permissions.
FragmentAudience
ChannelAudience
DLM and Permissions (Demo)
<dlm:fragment name='Post-its' ownerID='post-lo' precedence='80'>
<dlm:audience evaluatorFactory=‘…GroupMembership…'>
<paren mode="OR">
<attribute mode='memberOf' name='Students'/>
<attribute mode='memberOf' name='Faculty'/>
</paren>
</dlm:audience>
</dlm:fragment>
DLM and Permissions (Demo)
• post-lo user member of Student and Faculty groups.• “Student Post-its” channel granted to Students.• “Faculty Post-its” channel granted to Faculty.• Post-lo logs in and subscribed to both channels on
“Post-its” tab.• Faculty users see?
– Post-its tab with only Faculty Post-its channel.• Student users see?
– Post-its tab with only Student Post-its channel.
DLM 2.0
• DLM 1.0 opportunities for improvement– File based declaration,
• Administrator access required for host• Propagation tactics in server farm
– Web server bounce required.– No delegation of management responsibilities– No UI processing extensions without recompile– No subscribe-able fragments– No simple enable/disable of fragments
DLM 2.0
UP_DLM_FRAGMENTSUP_DLM_SUBSCRIPTIONS
Pluggable URL Handling Processor Pipeline
FragmentManagerChannel
SubscriberChannel
SubscriptionTargets
Processor
StructureTransformation
ThemeTransformation
IPermissibleImplementation
Delegation
Create FragmentManage PrecedenceManage AudienceManage PermissionsDelete Fragment
RDB Based Configuration
Processing Pipeline
• UI Enhancements• Scenario: Fragment Subscription
Processing Pipeline
• Scenario: Fragment Subscription
Processing Pipeline
• Scenario: Fragment Subscription
Processing Pipeline
• Scenario: Fragment Subscription– Momentarily Injected Structure Specific
Target Points– Modified Structure/Theme Transforms to
Present UI Targets– Provided handling for selected target.
• How do you do that?
Pluggable URL Handling Processor Pipeline
Processing Pipeline
UserInstance
DistributedLayoutManager
processLayoutParameters()
getUserLayout()
SAX Event Stream
Pro
cess
ing
Pip
elin
e
IParameterProcessorIOptionalParameterProcessor
ISaxProcessor
org.jasig.portal.layout.dlm.processing
Processing Pipeline
• Processor Interfaces– IParameterProcessor: URL handler endpoint
• setResources(IPerson, DistributedLayoutManager)• processParameters(UserPreferences, HttpServletRequest)
– IOptionalParameterprocessor: uP_dlmPrc=<processor key>
• isFinished()
– ISaxProcessor: Temporary modifications to layout
• getCacheKey()• getContentHandler(ContentHandler)
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
ProcessingPipe
Processing Pipeline
• SAX Processors
ISaxProcessorA
ISaxProcessorB
Processing Pipeline
• SAX Processors
ISaxProcessorA
getContentHandler( ) Content Handler A
UICH
Content Handler A
UICH
returns
User InstanceContent Handler
Processing Pipeline
• SAX Processors
ISaxProcessorB
getContentHandler( ) Content Handler B
CHA
Content Handler B
CHA
returns
Content Handler A
UICH
Processing Pipeline
• SAX Processor Chain
User InstanceContent Handler
DistributedLayout
Manager
Content Handler
A
Content Handler
B
SAX Event Stream
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
– <property name="fixedProcessors"> <list> <bean class=“fully qualified class name" singleton="false"/> <bean class=“another class name" singleton="false"/>
…additional fixed processors
</list></property>
• Singleton: set to true if single instance of the processor can concurrently be used for all users. Ie: thread safe.
Processing Pipeline
– <property name=“optionalProcessors"> <map> <entry key=“some key”> <bean class=“fully qualified class name" singleton="false"/> </entry> <entry key=“another key”> <bean class=“another class name" singleton="false"/> </entry>
…additional entries
</map></property>
• Singleton: be careful.
Fragment Manager Channel
• In Luminis IV, source in sandbox, not yet in uPortal 2.x.
Fragment Manager Channel
Fragment Manager Channel
Will always appear until owner logs in for first time.
Owner username.
Fragment Manager Channel
Sungard proprietary permission aggregation channel.
Fragment Manager Channel
Sungard proprietary permission aggregation channel.
Fragment Manager Channel
Fragment Manager Channel
Fragment Layout Set-up
Fragment Owner logs in
Fragment Layout Set-up
Fragment Owner required to change password
Fragment Layout Set-up
Fragment Owner’sempty layout
Note fragmentname in title.
Fragment Layout Set-up
Fragment Owner’sfinished layout
Enabling a Fragment
AdminEnables Fragment
Note missingpasswordmessage.
Enabling a Fragment
Subscribing to a Fragment
Faculty User
Subscribing to a Fragment
Faculty User
Subscribing to a Fragment
Faculty User
Subscribing to a Fragment
Faculty User
Subscribing to a Fragment
Faculty User
The Road Ahead
• Non-compiling Luminis version of uPortal available in sandbox including I18N feature set.
• I18N features to be rolled into 2.x baseline.– Who?– When?
• DLM 2.0 Changes to be rolled into 2.x baseline. – Who?– When?
Questions
?