org.silex.core.Deeplink

mx.core.UIObject
org.silex.core.Deeplink

This class handles the deeplinks : when to change the deeplink through javascript and when to open pages corresponding to the html deeplink value.  In the repository : /trunk/core/Deeplink.as

Version

1

Author

Alexandre Hoyau

Summary
org.silex.core.DeeplinkThis class handles the deeplinks : when to change the deeplink through javascript and when to open pages corresponding to the html deeplink value.
Variables
silex_ptrReference to silex main Api object (org.silex.core.Api).
deeplink_arrayArray corresponding to the path of the currently displayed page.
Properties
currentPathString corresponding to the path of the currently displayed page or the page which is openning.
currentPath
Variables
currentHashValueReflects the hash value, i.e.
currentPageTitleReflects the html page title.
Functions
DeeplinkConstructor.
checkHashCheck if javascript’s url hash need to be updated.
setHashUpdate javascript and silex currentHashValue.
changeWebsiteChange the current website name.
getCurrentPathBuild the current path from the opened pages.
getLayoutPathParse the org.silex.core.Layout objects until a specific layout.
applyPathBuild the deeplink array with the section names that need to be applied (remove those which are already opened).
doApplyPathCheck if a deeplink has to be reached and reset deeplink_array if we reachd the target.

Variables

silex_ptr

private var silex_ptr: org.silex.core.Api

Reference to silex main Api object (org.silex.core.Api).

deeplink_array

var deeplink_array: Array

Array corresponding to the path of the currently displayed page.  @example [start,silex,home]

Properties

currentPath

function get currentPath():String

String corresponding to the path of the currently displayed page or the page which is openning.  Corresponds to deeplink_array.  @example start/silex/home

currentPath

function set currentPath(newPath_str: String)

Variables

currentHashValue

var currentHashValue: String

Reflects the hash value, i.e. javascript’s silexJsObj.currentHashValue and html hash value.

currentPageTitle

var currentPageTitle: String

Reflects the html page title.

Functions

Deeplink

function Deeplink(api: org.silex.core.Api,
initialPath: String,
initialPageTitle: String)

Constructor.

Parameters

param api reference to silex main Api object (org.silex.core.Api)
param initialPath string corresponding to the path of the page to be displayed at start
param initialPageTitle string corresponding to the title of the page to be displayed at start

checkHash

function checkHash()

Check if javascript’s url hash need to be updated.

setHash

function setHash(newHashValue)

Update javascript and silex currentHashValue.

changeWebsite

function changeWebsite(id_site: String)

Change the current website name.  Ask javascript to display a different website name after the “#”.

Parameters

param id_site new name

getCurrentPath

function getCurrentPath():Array

Build the current path from the opened pages.  Parse all the org.silex.core.Layout objects of the application.

Returns

the path of the displayed page

getLayoutPath

function getLayoutPath(targetLayout_ptr: org.silex.core.Layout):Array

Parse the org.silex.core.Layout objects until a specific layout.  Used to get a layout path.  Used by org.silex.core.Application::save().

Returns

the path of the page opened on the layout

applyPath

function applyPath(path_str: String)

Build the deeplink array with the section names that need to be applied (remove those which are already opened).  Open the first section which has to be opened.

Parameters

param path_str the targeted path

doApplyPath

function doApplyPath():Boolean

Check if a deeplink has to be reached and reset deeplink_array if we reachd the target.

Returns

true if the deeplink target has been reached

private var silex_ptr: org.silex.core.Api
Reference to silex main Api object (org.silex.core.Api).
var deeplink_array: Array
Array corresponding to the path of the currently displayed page.
function get currentPath():String
String corresponding to the path of the currently displayed page or the page which is openning.
var currentHashValue: String
Reflects the hash value, i.e.
var currentPageTitle: String
Reflects the html page title.
function Deeplink(api: org.silex.core.Api,
initialPath: String,
initialPageTitle: String)
Constructor.
function checkHash()
Check if javascript’s url hash need to be updated.
function setHash(newHashValue)
Update javascript and silex currentHashValue.
function changeWebsite(id_site: String)
Change the current website name.
function getCurrentPath():Array
Build the current path from the opened pages.
function getLayoutPath(targetLayout_ptr: org.silex.core.Layout):Array
Parse the org.silex.core.Layout objects until a specific layout.
function applyPath(path_str: String)
Build the deeplink array with the section names that need to be applied (remove those which are already opened).
function doApplyPath():Boolean
Check if a deeplink has to be reached and reset deeplink_array if we reachd the target.