Transcript Slide 1
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 • Fragment Manager • Subscribed Fragments • Future work • Questions
What is DLM?
?
Distributed Layout Management ?
Fragment Fragment
What is DLM?
User Owned
Fragment Owned Tab Fragment Owned Channel
What is DLM?
User Owned Channel
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
Completely Locked UI
What is DLM?
Schools Choose Completely Flexible UI
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
2007 DLM 2.0 in Luminis 2006 DLM 2.0 Processing Pipeline 2005 DLM 1.0 debuts in uPortal 2.5
2004 SCT asked to contribute DLM 2003 ALM work begins in earnest 2001 2002 DLM 1.0 pushed fragments debut in Luminis uPortal adopted by Campus Pipeline, DLM work starts
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
•
•
– Properties.
– Fragment account declarations.
– Audiences that receive those fragments automatically.
DLM.XML Properties
•
DLM.XML Properties
•
– 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
•
– Value in minutes.
DLM.XML Fragments
•
– 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.XML Audiences
•
– 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
•
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.XML Audience Factories
– PersonEvaluatorFactory quiz •
• Expression: NOT( eyes=green OR hair=blonde) • Expression: (eyes NOT green) AND (hair NOT blonde)
DLM.XML Audience Factories
– PersonEvaluatorFactory quiz •
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 Everyone contains Students Sam Jill •
•
DLM.XML Audience Factories
– Extra Credit quiz •
– 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
•
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
LayoutStore Loads LayoutManager manages Structure XSLT Theme XSLT UP_LAYOUT_STRUCT UP_LAYOUT_PARAM
uPortal Layouts: DLM Style
Fragment Cache Merge DLM LayoutManager manages ILF DLM Structure XSLT DLM Theme XSLT DLM LayoutStore Loads PLF UP_LAYOUT_STRUCT UP_LAYOUT_PARAM ILF = Incorporated Layout Fragment (user’s viewed layout) PLF = PersonalLayoutFragment (user’s persisted layout)
uPortal Layouts: Fragment Owners
Fragment Cache DLM LayoutManager manages ILF DLM Structure XSLT DLM Theme XSLT same DLM LayoutStore Loads PLF UP_LAYOUT_STRUCT UP_LAYOUT_PARAM ILF = Incorporated Layout Fragment (user’s viewed layout) PLF = PersonalLayoutFragment (user’s persisted layout)
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.
Fragment Audience Channel Audience • Graceful degradation : merging algorithm silently drops channels from fragments if user has insufficient permissions.
DLM and Permissions (Demo)
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
Subscriber Channel
DLM 2.0
Fragment Manager Channel IPermissible Implementation Delegation Create Fragment Manage Precedence Manage Audience Manage Permissions Delete Fragment RDB Based Configuration UP_DLM_FRAGMENTS UP_DLM_SUBSCRIPTIONS Subscription Targets Processor Pluggable URL Handling Processor Pipeline Structure Transformation Theme Transformation
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
User Instance processLayoutParameters() IParameterProcessor IOptionalParameterProcessor
org.jasig.portal.layout.dlm.processing
getUserLayout() SAX Event Stream ISaxProcessor Distributed Layout Manager
Processing Pipeline
• Processor Interfaces – IParameterProcessor: URL handler endpoint • setResources( IPerson , DistributedLayoutManager ) • processParameters( UserPreferences , HttpServletRequest ) – IOptionalParameterprocessor: uP_dlmPrc=
Processing Pipeline
• Parameter Processors User Instance ProcessLayout Parameters() Distributed Layout Manager processParameters( ) processParameters() method called on all processors
Processing Pipeline
• SAX Processors User Instance Distributed Layout Manager getUserLayout() User Instance Content Handler User Instance Content Handler getContentHandler( ) SAX Event Stream returns Some Content Handler
Processing Pipeline
• SAX Processors ProcessingPipe ISaxProcessorA ISaxProcessorB
Processing Pipeline
• SAX Processors User Instance Content Handler getContentHandler( ) returns ISaxProcessorA Content Handler A UICH Content Handler A UICH
Processing Pipeline
• SAX Processors Content Handler A UICH getContentHandler( ) returns ISaxProcessorB Content Handler B CHA Content Handler B CHA
Processing Pipeline
• SAX Processor Chain User Instance Content Handler Content Handler A Content Handler B SAX Event Stream Distributed Layout Manager
Processing Pipeline
• Configured in properties/dlmContext.xml
–