| Package | com.soma.model |
| Class | public class PageManager |
| Implements | IDisposable |
Author: Romuald Quantin - www.soundstep.com
Information:
Blog page - SomaUI
How does it work - Soma Protest
Project Host - Google Code
Documentation - Soma ASDOC
Class version: 2.0.1
Actionscript version: 3.0
Copyright:
The contents of this file are subject to the Mozilla Public License
Version 1.1 (the "License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied.
See the License for the specific language governing rights and
limitations under the License.
The Original Code is Soma.
The Initial Developer of the Original Code is Romuald Quantin.
Initial Developer are Copyright (C) 2008-2009 Soundstep. All Rights Reserved.
Usage:
The PageManager is a big part in Soma and it is not the purpose of the documentation to explain all the options and how it is used by Soma. Instead you can visit the Soma Protest Page Sytem page for more explanation.
The PageManager role is instantiating and removing pages from the XML Site Definition as well as handling the deep-linking URL with the SWFAddress.
The first to thing remember is: The PageManager will instantiate Page classes using the String found in the type attribute of the page node (this page class must be registered in the config file using Soma.getInstance().registerClass(MyPageClass)).
Here is an example of a page node:
<page id="home_id" type="Home" urlfriendly="home">
<title><![CDATA[Welcome]]></title>
</page>
new PageEvent(PageEvent.SHOW, "home_id").dispatch();
See also
| Property | Defined by | ||
|---|---|---|---|
| container : Sprite [read-only]
Return the Sprite that contains all the pages.
| PageManager | ||
| currentPage : Page
[read-only]
Get the current page displayed (Page).
| PageManager | ||
| DEEPLINKING_ENABLED : Boolean = true [static] Enables the deep-linking, the URL is built with the urlfriendly attribute of a page node.
| PageManager | ||
| isRemoving : Boolean [read-only]
Whether or not the PageManager is currently removing pages.
| PageManager | ||
| started : Boolean [read-only]
Whether or not the PageManager has been started.
| PageManager | ||
| TITLE_BROWSER_ENABLED : Boolean = false [static] Enables the PageManager instance to change the title of the browser, the title is built with the site name (Soma.getInstance().config.siteName) and the value of the title or the titleBrowser (priority on titleBrowser) node of a page node.
| PageManager | ||
| Method | Defined by | ||
|---|---|---|---|
|
Creates an PageManager instance
| PageManager | ||
|
dispose():void
Removes the children of the page container and destroys the container.
| PageManager | ||
|
getPageDepth(id:String):int
Get the depth attribute of a page node.
| PageManager | ||
|
getPageID(urlFriendly:String):String
Get the id attribute of a page node using the deep-linking value (URL).
| PageManager | ||
|
getPageType(id:String):String
Get the type attribute of a page node (the type is the class name that will be instantiated by the PageManager).
| PageManager | ||
|
getParentNonExcluded(idPage:String):String
Get the first parent that is not excluded (first page node parent that is not containing the attribute "exclude" set to true).
| PageManager | ||
|
getTitle(id:String):String
Get the value of the title node of a page node.
| PageManager | ||
|
getTitleBrowser(id:String):String
Get the value of the titleBrowser node of a page node.
| PageManager | ||
|
getUrlFriendly(id:String):String
Get the URL (deep-linking) value for a page.
| PageManager | ||
|
hasExcludedChildren(idPage:String):Boolean
Whether or not the page has nodes children that are excluded (page node child containing the attribute "exclude" set to true).
| PageManager | ||
|
isExcluded(idPage:String):Boolean
Whether or not the page node is excluded (contains the attribute "exclude" set to true).
| PageManager | ||
|
isExternalPage(id:String):Boolean
Whether or not a page node is an external page (contains the attribute "external" set to true).
| PageManager | ||
|
isMovieClipMode(id:String):Boolean
Whether or not a page node is a movieclip page (contains the attribute "movieclip" set to true).
| PageManager | ||
|
removePages(e:PageEvent = null):void
Meant to an internal Soma use: continue the process of hiding pages (called at the end of the "transition out complete" event of a page).
| PageManager | ||
|
setBrowserTitle(value:String):void
Set the title of the browser window depending of the page.
| PageManager | ||
|
show(id:String):void
Show a page (internally used by Soma after a PageEvent.SHOW event dispatched).
| PageManager | ||
|
showExternalLink(url:String):void
Show an external link (open a new browser window).
| PageManager | ||
|
Meant to an internal Soma use: continue the process of showing pages (called at the end of the "transition in complete" event of a page).
| PageManager | ||
|
start():void
Starts the PageManager (called by Soma during initialization process).
| PageManager | ||
| container | property |
container:Sprite [read-only]Return the Sprite that contains all the pages.
Implementation public function get container():Sprite
| currentPage | property |
currentPage:Page [read-only]Get the current page displayed (Page). You can cast the class result to your own page:
MyPage(Soma.getInstance().page.currentPage)
public function get currentPage():Page
| DEEPLINKING_ENABLED | property |
public static var DEEPLINKING_ENABLED:Boolean = trueEnables the deep-linking, the URL is built with the urlfriendly attribute of a page node.
| isRemoving | property |
isRemoving:Boolean [read-only]Whether or not the PageManager is currently removing pages.
Implementation public function get isRemoving():Boolean
| started | property |
started:Boolean [read-only]Whether or not the PageManager has been started.
Implementation public function get started():Boolean
| TITLE_BROWSER_ENABLED | property |
public static var TITLE_BROWSER_ENABLED:Boolean = falseEnables the PageManager instance to change the title of the browser, the title is built with the site name (Soma.getInstance().config.siteName) and the value of the title or the titleBrowser (priority on titleBrowser) node of a page node.
| PageManager | () | constructor |
public function PageManager()Creates an PageManager instance
| dispose | () | method |
public function dispose():voidRemoves the children of the page container and destroys the container.
| getPageDepth | () | method |
public function getPageDepth(id:String):intGet the depth attribute of a page node.
Parametersid:String — Attribute id of the page node.
|
int — A int (depth value).
|
| getPageID | () | method |
public function getPageID(urlFriendly:String):StringGet the id attribute of a page node using the deep-linking value (URL).
ParametersurlFriendly:String — String (value of the deep-linking).
|
String — A String (id of the page).
|
| getPageType | () | method |
public function getPageType(id:String):StringGet the type attribute of a page node (the type is the class name that will be instantiated by the PageManager).
Parametersid:String — Attribute id of the page node.
|
String — A String (the type attribute).
|
| getParentNonExcluded | () | method |
public function getParentNonExcluded(idPage:String):StringGet the first parent that is not excluded (first page node parent that is not containing the attribute "exclude" set to true).
ParametersidPage:String — Attribute id of the page node.
|
String — A String (id of the page node parent).
|
| getTitle | () | method |
public function getTitle(id:String):StringGet the value of the title node of a page node.
Parametersid:String — Attribute id of the page node.
|
String — A String.
|
| getTitleBrowser | () | method |
public function getTitleBrowser(id:String):StringGet the value of the titleBrowser node of a page node.
Parametersid:String — Attribute id of the page node.
|
String — A String.
|
| getUrlFriendly | () | method |
public function getUrlFriendly(id:String):StringGet the URL (deep-linking) value for a page.
Parametersid:String — Attribute id of the page node.
|
String — A string (string that will be append to the real URL).
|
| hasExcludedChildren | () | method |
public function hasExcludedChildren(idPage:String):BooleanWhether or not the page has nodes children that are excluded (page node child containing the attribute "exclude" set to true).
ParametersidPage:String — Attribute id of the page node.
|
Boolean — A Boolean.
|
| isExcluded | () | method |
public function isExcluded(idPage:String):BooleanWhether or not the page node is excluded (contains the attribute "exclude" set to true).
ParametersidPage:String — Attribute id of the page node.
|
Boolean — A Boolean.
|
| isExternalPage | () | method |
public function isExternalPage(id:String):BooleanWhether or not a page node is an external page (contains the attribute "external" set to true).
Parametersid:String — Attribute id of the page node.
|
Boolean — A Boolean.
|
| isMovieClipMode | () | method |
public function isMovieClipMode(id:String):BooleanWhether or not a page node is a movieclip page (contains the attribute "movieclip" set to true).
Parametersid:String — Attribute id of the page node.
|
Boolean — A Boolean.
|
| removePages | () | method |
public function removePages(e:PageEvent = null):voidMeant to an internal Soma use: continue the process of hiding pages (called at the end of the "transition out complete" event of a page).
Parameterse:PageEvent (default = null) — PageEvent instance.
|
| setBrowserTitle | () | method |
public function setBrowserTitle(value:String):void Set the title of the browser window depending of the page. It is internally used by the page manager but you can set the static variable PageManager.TITLE_BROWSER_ENABLED to false (default true) and set a custom value.
By default, the title is built with the site name (Soma.getInstance().config.siteName) and the value of the title or the titleBrowser (priority on titleBrowser) node of a page node.
value:String — Title of the browser window.
|
| show | () | method |
public function show(id:String):voidShow a page (internally used by Soma after a PageEvent.SHOW event dispatched).
Parametersid:String — Attribute id of the page node.
|
| showExternalLink | () | method |
public function showExternalLink(url:String):voidShow an external link (open a new browser window).
Parametersurl:String — Strig value of the external link to open.
|
| showPages | () | method |
public function showPages(e:PageEvent = null):voidMeant to an internal Soma use: continue the process of showing pages (called at the end of the "transition in complete" event of a page).
Parameterse:PageEvent (default = null) — PageEvent instance.
|
| start | () | method |
public function start():voidStarts the PageManager (called by Soma during initialization process).