Classes

AbstractPageManager

Page manager for controller.

Typedefs

RouteOptions : Object

An Object used to configure a route

ManagedPage : Object

An object representing a page that's currently managed by PageManager

AbstractPageManager 

Page manager for controller.

Kind: global class


new AbstractPageManager(pageFactory, pageRenderer, pageStateManager, pageHandlerRegistry) 

Initializes the page manager.

Param Type Default Description
pageFactory PageFactory   Factory used by the page manager to create instances of the controller for the current route, and decorate the controllers and page state managers.
pageRenderer PageRenderer   The current renderer of the page.
pageStateManager PageStateManager   The current page state manager.
pageHandlerRegistry HandlerRegistry Instance of HandlerRegistry that holds a list of pre-manage and post-manage handlers.

abstractPageManager._pageFactory : PageFactory 

Factory used by the page manager to create instances of the controller for the current route, and decorate the controllers and page state managers.

Kind: instance property of AbstractPageManager
Access: protected


abstractPageManager._pageRenderer : PageRenderer 

The current renderer of the page.

Kind: instance property of AbstractPageManager
Access: protected


abstractPageManager._pageStateManager : PageStateManager 

The current page state manager.

Kind: instance property of AbstractPageManager
Access: protected


abstractPageManager._pageHandlerRegistry : PageHandlerRegistry 

A registry that holds a list of pre-manage and post-manage handlers.

Kind: instance property of AbstractPageManager
Access: protected


abstractPageManager._managedPage : ManagedPage 

Details of the currently managed page.

Kind: instance property of AbstractPageManager
Access: protected


abstractPageManager._previousManagedPage : ManagedPage 

Snapshot of the previously managed page before it was replaced with a new one

Kind: instance property of AbstractPageManager
Access: protected


abstractPageManager.init() 

Kind: instance method of AbstractPageManager


abstractPageManager.manage() 

Kind: instance method of AbstractPageManager


abstractPageManager.destroy() 

Kind: instance method of AbstractPageManager


abstractPageManager._constructManagedPageValue(controller, view, route, options, params, controllerInstance, decoratedController, viewInstance) ⇒ ManagedPage 

Kind: instance method of AbstractPageManager
Access: protected

Param Type Description
controller string | function  
view string | function  
route Route  
options RouteOptions  
params Object.<string, string> The route parameters.
controllerInstance AbstractController  
decoratedController ControllerDecorator  
viewInstance React.Component  

abstractPageManager._storeManagedPageSnapshot() ⇒ ManagedPage 

Creates a cloned version of currently managed page and stores it in a helper property. Snapshot is used in manager handlers to easily determine differences between the current and the previous state.

Kind: instance method of AbstractPageManager
Access: protected


abstractPageManager._clearManagedPageValue() 

Clear value from managed page.

Kind: instance method of AbstractPageManager
Access: protected


abstractPageManager._stripManagedPageValueForPublic(value) ⇒ Object 

Removes properties we do not want to propagate outside of the page manager

Kind: instance method of AbstractPageManager
Access: protected

Param Type Description
value ManagedPage The managed page object to strip down

abstractPageManager._setRestrictedPageStateManager(extension, extensionState) 

Set page state manager to extension which has restricted rights to set global state.

Kind: instance method of AbstractPageManager

Param Type
extension ima.extension.Extension
extensionState Object.<string, \*>

abstractPageManager._initPageSource() 

Initialize page source so call init method on controller and his extensions.

Kind: instance method of AbstractPageManager
Access: protected


abstractPageManager._initController() 

Initializes managed instance of controller with the provided parameters.

Kind: instance method of AbstractPageManager
Access: protected


abstractPageManager._initExtensions() 

Initialize extensions for managed instance of controller with the provided parameters.

Kind: instance method of AbstractPageManager
Access: protected


abstractPageManager._switchToPageStateManager() 

Iterates over extensions of current controller and switches each one to pageStateManager and clears their partial state.

Kind: instance method of AbstractPageManager
Access: protected


abstractPageManager._loadPageSource() ⇒ Object.<string, (Promise.<\*>\|\*)> 

Load page source so call load method on controller and his extensions. Merge loaded state and render it.

Kind: instance method of AbstractPageManager
Access: protected


abstractPageManager._getLoadedControllerState() ⇒ Object.<string, (Promise.<\*>\|\*)> 

Load controller state from managed instance of controller.

Kind: instance method of AbstractPageManager
Access: protected


abstractPageManager._getLoadedExtensionsState(controllerState) ⇒ Object.<string, (Promise.<\*>\|\*)> 

Load extensions state from managed instance of controller.

Kind: instance method of AbstractPageManager
Access: protected

Param Type
controllerState Object.<string, \*>

abstractPageManager._activatePageSource() 

Activate page source so call activate method on controller and his extensions.

Kind: instance method of AbstractPageManager
Access: protected


abstractPageManager._activateController() 

Activate managed instance of controller.

Kind: instance method of AbstractPageManager
Access: protected


abstractPageManager._activateExtensions() 

Activate extensions for managed instance of controller.

Kind: instance method of AbstractPageManager
Access: protected


abstractPageManager._updatePageSource() ⇒ Promise.<{status: number, content: ?string}> 

Update page source so call update method on controller and his extensions. Merge updated state and render it.

Kind: instance method of AbstractPageManager
Access: protected


abstractPageManager._getUpdatedControllerState() ⇒ Object.<string, (Promise.<\*>\|\*)> 

Return updated controller state for current page controller.

Kind: instance method of AbstractPageManager
Access: protected


abstractPageManager._getUpdatedExtensionsState(controllerState) ⇒ Object.<string, (Promise\|\*)> 

Return updated extensions state for current page controller.

Kind: instance method of AbstractPageManager
Access: protected

Param Type
controllerState Object.<string, \*>

abstractPageManager._deactivatePageSource() 

Deactivate page source so call deactivate method on controller and his extensions.

Kind: instance method of AbstractPageManager
Access: protected


abstractPageManager._deactivateController() 

Deactivate last managed instance of controller only If controller was activated.

Kind: instance method of AbstractPageManager
Access: protected


abstractPageManager._deactivateExtensions() 

Deactivate extensions for last managed instance of controller only if they were activated.

Kind: instance method of AbstractPageManager
Access: protected


abstractPageManager._destroyPageSource() 

Destroy page source so call destroy method on controller and his extensions.

Kind: instance method of AbstractPageManager
Access: protected


abstractPageManager._destroyController() 

Destroy last managed instance of controller.

Kind: instance method of AbstractPageManager
Access: protected


abstractPageManager._destroyExtensions() 

Destroy extensions for last managed instance of controller.

Kind: instance method of AbstractPageManager
Access: protected


abstractPageManager._clearComponentState(options) 

The method clear state on current renderred component to DOM.

Kind: instance method of AbstractPageManager

Param Type Description
options RouteOptions The current route options.

abstractPageManager._onChangeStateHandler(state) 

On change event handler set state to view.

Kind: instance method of AbstractPageManager

Param Type
state Object.<string, \*>

abstractPageManager._hasOnlyUpdate(controller, view, options) ⇒ boolean 

Return true if manager has to update last managed controller and view.

Kind: instance method of AbstractPageManager
Access: protected

Param Type
controller string | function
view string | function
options RouteOptions

abstractPageManager._runPreManageHandlers(nextManagedPage, action) ⇒ Promise.<any> 

Kind: instance method of AbstractPageManager
Access: protected

Param Type
nextManagedPage ManagedPage
action Object

abstractPageManager._runPostManageHandlers(previousManagedPage, action) ⇒ Promise.<any> 

Kind: instance method of AbstractPageManager
Access: protected

Param Type
previousManagedPage ManagedPage
action Object

RouteOptions : Object 

An Object used to configure a route

Kind: global typedef


ManagedPage : Object 

An object representing a page that’s currently managed by PageManager

Kind: global typedef