|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public NavigationStateProcessor
Interface representing NavigationStateProcessor.NavigationState is internally Represented as an JSON object.
Paramters are predefined.
{
sid:
{
value: <sid>,
params:
{
}
},
pid:
{
value: <pid>,
params:
{
}
},
pageselection:
{
<spaceid>:
{
value: <pageid>,
params:
{
lm:<timestamp>}
},
<spaceid>:
{
value: <pageid>,
params:
{
lm:<timestamp>}
}
},
wparams:
{
<wid>:
{
value:
{
rp:
{
w:<"200">,h:<"300">,st:<"NORMAL">},
cp:
{
<page:"3">}
},
params:
{
lm:<timestamp>}
},
<wid>:
{
value:
{
rp:
{
w:<"300">,h:<"400">,st:<"MAX">},
cp:
{
<page:"4">}
},
params:
{
lm:<timestamp>}
}
},
lcparams:
{
<pid>:
{
templateURL: "<dav:filestore/layout-templates/2ColumnEqual>",
{
value:
{
<lcid>:
{
value:
{
rp:
{
w:<"70%">}
}
},
<lcid>:
{
value:
{
rp:
{
w:<"30%">}
}
}
},
params:
{
lm:<timestamp>}
},
<pid>:
{
templateURL: "<dav:filestore/layout-templates/3ColumnEqual>",
{
value:
{
<lcid>:
{
value:
{
rp:
{
w:<"30%">}
}
},
<lcid>:
{
value:
{
rp:
{
w:<"30%">}
}
},
<lcid>:
{
value:
{
rp:
{
w:<"40%">}
}
}
},
params:
{
lm:<timestamp>}
}
},
sparams:
{
<id>:
{
global:
{
params:
{
lm:<timestamp>},
value:
{
<name>:
{
value: <value>,
params:
{
lm:<timestamp>}
},
<name>:
{
value: <value>,
params:
{
lm:<timestamp>}
}
},
<scope-id>:
{
params:
{
lm:<timestamp>},
value:
{
<name>:
{
value: <value>,
params:
{
lm:<timestamp>}
},
<name>:
{
value: <value>,
params:
{
lm:<timestamp>}
}
}
}
}
Navigation State parameters will be written to url or persistence store upon configuration.
Here's the default configuration:
Method Summary | |
---|---|
String |
encodeWidgetIdentifier(String wid,
NavigationStateModel navigationStateModel)
Encodes the specified widget instance id. |
String |
decodeWidgetIdentifier(String wid,
NavigationStateModel navigationStateModel)
Decodes a unique widget instance id. |
Object |
decode(String url,
Function callback)
Decode the url and store the state into a JSON Object. |
String |
encode(Object state,
Function callback,
Object oldState,
Object additionalParams,
NavigationStateModel navigationStateModel)
Encode state object and generate fragment. |
String |
generateUrl(Object state,
Function callback,
JSON params)
Deprecated. Use generateURL instead. |
String |
generateURL(Object state,
Function callback,
JSON params)
Encode state object and generate full url. |
Object |
preprocess(Object state,
Function callback)
Preprocess could be used to filter the original state. |
void |
dispose(Function callback)
Dispose the any navigation state that's persisted. |
Object |
postprocess(Object state,
Function callback,
Object oldState,
Object additionalParams)
Postprocess could be used to filter the original state before url is generated. |
Method Detail |
---|
String encodeWidgetIdentifier(String wid, NavigationStateModel navigationStateModel)
wid
-
widget instance id; different page may have same widget instance id.navigationStateModel
-
String decodeWidgetIdentifier(String wid, NavigationStateModel navigationStateModel)
wid
-
unique widget instance id.navigationStateModel
-
Object decode(String url, Function callback)
callback:function(state)
{
};
url
-
url stringcallback
-
callback function
String encode(Object state, Function callback, Object oldState, Object additionalParams, NavigationStateModel navigationStateModel)
callback(fragment);
If no callback is defined, url fragment is returned.
state
-
JSON object representing Mashup statecallback
-
callback function which takes the following parameters: additionalParams
(JSON) - if the additionalParams was passed in to the encode function, then it must be passed back into the callback function
responseParams
(JSON) - Optional If additionalParams.allowRedirect
is true and this is an asynchronous commit, then the implementation of this function may pass responseParams.doRedirect
set to true to refresh the page after the commit is completed
oldState
-
JSON object representing Mashup state before it gets updatedadditionalParams
-
Optional JSON object to control various aspects of encoding or the registered callbacknavigationStateModel
-
- Returns:
-
the url fragment that contains navigation state
String generateUrl(Object state, Function callback, JSON params)
state
- callback
- params
- String generateURL(Object state, Function callback, JSON params)
callback:function(url)
{
};
state
-
JSON object representing Mashup statecallback
-
callback functionparams
-
additional parameter in json format
Object preprocess(Object state, Function callback)
callback:function(state)
{
};
state
-
JSON object representing Mashup statecallback
-
callback function
void dispose(Function callback)
callback:function()
{
};
callback
-
callback functionObject postprocess(Object state, Function callback, Object oldState, Object additionalParams)
callback:function(state)
{
};
state
-
JSON object representing Mashup statecallback
-
callback functionoldState
-
JSON object representing Mashup state before it gets updatedadditionalParams
-
Optional JSON object to control various aspects of encoding or the registered callback.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |