distributed layout management

80
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

Upload: altessa

Post on 30-Jan-2016

45 views

Category:

Documents


0 download

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 Presentation

TRANSCRIPT

Page 1: Distributed Layout Management

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

Page 2: Distributed Layout Management

Agenda

• History• Configuring Fragments • Restrictions and Merging • Processor Pipeline • Fragment Manager• Subscribed Fragments• Future work• Questions

Page 3: Distributed Layout Management

What is DLM?

?Distributed Layout Management

?

Page 4: Distributed Layout Management

What is DLM?

Fragment

Fragment

User Owned

Page 5: Distributed Layout Management

What is DLM?

FragmentOwned Tab

Fragment OwnedChannel

User OwnedChannel

Page 6: Distributed Layout Management

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

Page 7: Distributed Layout Management

What is DLM?

CompletelyLocked UI

CompletelyFlexible UI

Schools Choose

Page 8: Distributed Layout Management

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.

Page 9: Distributed Layout Management

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

Page 10: Distributed Layout Management

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

Page 11: Distributed Layout Management

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.

Page 12: Distributed Layout Management

DLM.XML Properties

• <dlm:property name='defaultLayoutOwner' value='fragmentTemplate'/>

– Identifies account whose layout should be copied for any newly created fragment accounts.

Page 13: Distributed Layout Management

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.

Page 14: Distributed Layout Management

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.

Page 15: Distributed Layout Management

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.

Page 16: Distributed Layout Management

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.

Page 17: Distributed Layout Management

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

Page 18: Distributed Layout Management

Demo

– All users but guest should see Entertainment fragment.

– Entertainment fragment owned by ent-lo account.– Changes to layout should appear for other users.

Page 19: Distributed Layout Management

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.

Page 20: Distributed Layout Management

DLM.XML Audience Factories

– AllUsersEvaluatorFactory• No content. • Always returns true.

– GuestUserEvaluatorFactory• No content.• Returns true if IPerson.isGuest() returns true.

Page 21: Distributed Layout Management

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

Page 22: Distributed Layout Management

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.

Page 23: Distributed Layout Management

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)

Page 24: Distributed Layout Management

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.

Page 25: Distributed Layout Management

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

Page 26: Distributed Layout Management

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

Page 27: Distributed Layout Management

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.

Page 28: Distributed Layout Management

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 );

Page 29: Distributed Layout Management

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.

Page 30: Distributed Layout Management

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

Page 31: Distributed Layout Management

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.

Page 32: Distributed Layout Management

uPortal Layouts: pre-DLM

UP_LAYOUT_STRUCTUP_LAYOUT_PARAM

LayoutStore Loads

StructureXSLT

LayoutManager manages

ThemeXSLT

Page 33: Distributed Layout Management

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)

Page 34: Distributed Layout Management

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

Page 35: Distributed Layout Management

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

Page 36: Distributed Layout Management

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

Page 37: Distributed Layout Management

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)

Page 38: Distributed Layout Management

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.

Page 39: Distributed Layout Management

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.

Page 40: Distributed Layout Management

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.

Page 41: Distributed Layout Management

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

Page 42: Distributed Layout Management

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>

Page 43: Distributed Layout Management

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.

Page 44: Distributed Layout Management

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

Page 45: Distributed Layout Management

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

Page 46: Distributed Layout Management

Processing Pipeline

• UI Enhancements• Scenario: Fragment Subscription

Page 47: Distributed Layout Management

Processing Pipeline

• Scenario: Fragment Subscription

Page 48: Distributed Layout Management

Processing Pipeline

• Scenario: Fragment Subscription

Page 49: Distributed Layout Management

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

Page 50: Distributed Layout Management

Processing Pipeline

UserInstance

DistributedLayoutManager

processLayoutParameters()

getUserLayout()

SAX Event Stream

Pro

cess

ing

Pip

elin

e

IParameterProcessorIOptionalParameterProcessor

ISaxProcessor

org.jasig.portal.layout.dlm.processing

Page 51: Distributed Layout Management

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)

Page 52: Distributed Layout Management

Processing Pipeline

• Parameter Processors

processParameters( )

DistributedLayoutManagerProcessLayout

Parameters()

Pro

cess

ing

Pip

e

UserInstance

processParameters() method called on all

processors

Page 53: Distributed Layout Management

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

Page 54: Distributed Layout Management

ProcessingPipe

Processing Pipeline

• SAX Processors

ISaxProcessorA

ISaxProcessorB

Page 55: Distributed Layout Management

Processing Pipeline

• SAX Processors

ISaxProcessorA

getContentHandler( ) Content Handler A

UICH

Content Handler A

UICH

returns

User InstanceContent Handler

Page 56: Distributed Layout Management

Processing Pipeline

• SAX Processors

ISaxProcessorB

getContentHandler( ) Content Handler B

CHA

Content Handler B

CHA

returns

Content Handler A

UICH

Page 57: Distributed Layout Management

Processing Pipeline

• SAX Processor Chain

User InstanceContent Handler

DistributedLayout

Manager

Content Handler

A

Content Handler

B

SAX Event Stream

Page 58: Distributed Layout Management

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>

Page 59: Distributed Layout Management

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.

Page 60: Distributed Layout Management

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.

Page 61: Distributed Layout Management

Fragment Manager Channel

• In Luminis IV, source in sandbox, not yet in uPortal 2.x.

Page 62: Distributed Layout Management

Fragment Manager Channel

Page 63: Distributed Layout Management

Fragment Manager Channel

Will always appear until owner logs in for first time.

Owner username.

Page 64: Distributed Layout Management

Fragment Manager Channel

Sungard proprietary permission aggregation channel.

Page 65: Distributed Layout Management

Fragment Manager Channel

Sungard proprietary permission aggregation channel.

Page 66: Distributed Layout Management

Fragment Manager Channel

Page 67: Distributed Layout Management

Fragment Manager Channel

Page 68: Distributed Layout Management

Fragment Layout Set-up

Fragment Owner logs in

Page 69: Distributed Layout Management

Fragment Layout Set-up

Fragment Owner required to change password

Page 70: Distributed Layout Management

Fragment Layout Set-up

Fragment Owner’sempty layout

Note fragmentname in title.

Page 71: Distributed Layout Management

Fragment Layout Set-up

Fragment Owner’sfinished layout

Page 72: Distributed Layout Management

Enabling a Fragment

AdminEnables Fragment

Note missingpasswordmessage.

Page 73: Distributed Layout Management

Enabling a Fragment

Page 74: Distributed Layout Management

Subscribing to a Fragment

Faculty User

Page 75: Distributed Layout Management

Subscribing to a Fragment

Faculty User

Page 76: Distributed Layout Management

Subscribing to a Fragment

Faculty User

Page 77: Distributed Layout Management

Subscribing to a Fragment

Faculty User

Page 78: Distributed Layout Management

Subscribing to a Fragment

Faculty User

Page 79: Distributed Layout Management

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?

Page 80: Distributed Layout Management

Questions

?