Navigation Service

17
Copyright © 2010. All rights Reserved, eXo Platform SAS Navigation

description

 

Transcript of Navigation Service

Page 1: Navigation Service

Copyright © 2010. All rights Reserved, eXo Platform SAS

Navigation

Page 2: Navigation Service

Copyright © 2010. All rights Reserved, eXo Platform SAS

Navigation service

•  Low level API between the portal and the MOP

•  A data controller focusing on –  State management

•  Historical problem •  Concurrent load/save/merge •  Correctness

– Model-less design •  Model API easy to plug •  Change notifications

–  Performances •  Load what is necessary •  Built-in cache

Page 3: Navigation Service

Copyright © 2010. All rights Reserved, eXo Platform SAS

Navigation service operations

•  Load –  Load a fragment of a larger tree – Create a detached snapshot that can be modified

•  Update – Update a fragment with the most recent state –  Suppose no transient changes

•  Rebase –  Same as update but cope with changes

•  Save –  Same as rebase but save to the persistent store

Page 4: Navigation Service

Copyright © 2010. All rights Reserved, eXo Platform SAS

 Che

ckou

t  state  

Rebased  state  

Persistent  state  

Data life cycle and flow

Page 5: Navigation Service

Copyright © 2010. All rights Reserved, eXo Platform SAS

Rebase  changes  

Get  fresh  copy  

Update  checkout  

Save  to  storage  

Operation workflow

Update   Rebase   Save  

Page 6: Navigation Service

Copyright © 2010. All rights Reserved, eXo Platform SAS

Conflict resolution

•  The rebase operations takes a list of changes and replay on another tree, each change – Operate on same input OK – Operate on different output merge

•  Conflict solved example with (a,b) – User 1 insert 1: (a,1,b) – User 2 insert 2 and save concurrently: (a,2,b) – User 1 saves: (a,1,2,b)

•  Conflict unsolved example with (a) – User 1 insert 1: (a,a/1) – User 2 removes a: () – User 1 saves: failure

Page 7: Navigation Service

Copyright © 2010. All rights Reserved, eXo Platform SAS

Model-less design

•  Navigation are used for different purposes – Internal UserNode objects – GateIn API

•  NodeContext<N> – <N> is the model / API : cares about usage – NodeContext : cares about state

•  The NodeModel<N> factory – Provided by the client – Used by the service

Page 8: Navigation Service

Copyright © 2010. All rights Reserved, eXo Platform SAS

Tree scope

•  Required by most operation performed on the tree

•  Defines what is loaded – Scope.SINGLE – Scope.CHILDREN – Scope.GRANDCHILDREN – Scope.ALL

•  Plugable eventually (visitor)

Page 9: Navigation Service

Copyright © 2010. All rights Reserved, eXo Platform SAS

Node changes

•  Operations modifying the NodeContext<N> generate a flow of changes

•  Used to synchronize an existing data model based on <N> – Used by the navigation editor to update the

state – Used by navigation portlet to determine if the

navigation should be refreshed

Page 10: Navigation Service

Copyright © 2010. All rights Reserved, eXo Platform SAS

Node filtering

•  The service has a built in node filtering capabilities – Access control (inferred by underlying page) – Time based: TEMPORAL nodes – Use case based •  Navigation portlets don’t display SYSTEM nodes •  Navigation editor displays SYSTEM node but only

for administrators

Page 11: Navigation Service

Copyright © 2010. All rights Reserved, eXo Platform SAS

Internal API

•  UserPortal – Models the relationship between a user and a

portal – Replaces the UserPortalConfig object – Built on top of the NavigationService – Defines notion of UserPortalFilter to filter

navigations – Resolve path to nodes •  Future legacy •  Emulation will be performed to redirect to correct

page

Page 12: Navigation Service

Copyright © 2010. All rights Reserved, eXo Platform SAS

Internal API

•  UserNode – The <N> of UserContext – Translates the localizable values (label) – Remove notion of stored URI, instead URI is

rebuilt from its path

Page 13: Navigation Service

Copyright © 2010. All rights Reserved, eXo Platform SAS

Navigation controller

•  An effort started 6 months ago and mostly finished (85%) – Decouple the request URL and the handling in

the portal in a flexible and configurable manner

– Associate a unique resource to an URL (REST)

•  Will be merged after the new navigation service is done

Page 14: Navigation Service

Copyright © 2010. All rights Reserved, eXo Platform SAS

URL handling

•  Navigation controller provides an API for generating URL from a resource

•  In particular the portal needs to generate URL for a given navigation node

Page 15: Navigation Service

Copyright © 2010. All rights Reserved, eXo Platform SAS

Performances concerns

•  On default navigation, SQL activity was reduced by ½

•  On large navigation, SQL activity is dominated by the first 2 levels instead of the whole navigation previously

•  Other fixes were applied to handle numerous pages – Better pagination support – Functional changes

Page 16: Navigation Service

Copyright © 2010. All rights Reserved, eXo Platform SAS

Roadmap

•  Navigation Service – developed against exogtn 3.1.7-REBASED

(very close to EPP 5.1) – ported to exogtn 3.2.x for 3.2.0-beta3 (end of

June) and GateIn trunk •  Navigation i18n – Will be part of 3.2.0-beta3 and GateIn trunk

•  Navigation controller – The current work will be remerged after

3.2.0-beta3 and finished

Page 17: Navigation Service

Copyright © 2010. All rights Reserved, eXo Platform SAS

Next steps

•  Apply the same model to pages and layouts after GateIn 3.2