|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Object | +--PTPortlet
A client-side object wrapper for a Portlet. Contains methods for accessing portlet attributes, in-place-refresh
of portlet content, firing and listening for portlet events, and the getting/setting of session preferences.
Usage:
var myportlet = PTPortlet.getPortletByID(227);
myportlet.setSessionPref('mypref', 'myprefvalue');
myportlet.refresh('nextpage.jsp');
| Field Summary | |
String |
containerID
The id attribute of the portlet's corresponding HTML element |
String |
gatewayPrefixURL
The URL of the gateway prefix |
String |
guid
The portlet object's global unique id |
String |
id
The portlet object's id |
Boolean |
isCollapsed
Whether or not the portlet is currently collapsed (optional) |
String |
name
The portlet's internationalized name |
Number |
refreshInterval
The portlet's refresh interval, in milliseconds (optional) |
String |
refreshURL
The URL to use for refreshing the portlet (optional) |
String |
remoteBaseURL
The base URL of the portlet's remote server |
String |
remoteRequestURL
The fully qualified URL of the portlet's web service |
Object |
responseErrorHandler
The handler to call when a response error occurs, if the default behavior is undesirable (string or function reference, optional) |
Array |
responseErrors
An array of response error objects. |
Object |
responsePostProcHandler
The handler to call after calling the response handler (string or function reference, optional) |
Object |
responsePreProcHandler
The handler to call before calling the response handler. |
String |
secureGatewayPrefixURL
The secure URL of the gateway prefix |
<static> <final> Object |
VERSION
|
| Constructor Summary | |
PTPortlet
(id, guid, name, containerID, remoteRequestURL, remoteBaseURL, gatewayPrefixURL, secureGatewayPrefixURL, isCollapsed, refreshURL, refreshInterval)
PTPortlet object constructor |
|
| Method Summary | |
void
|
clearEvent(eventName,eventNamespace)
Clears the event listener for an event |
void
|
clearRefreshInterval()
Sets the refreshInterval of the portlet to 0 and clears any current refresh timers.
|
PTHTTPPOSTRequest
|
deleteSessionPref(name)
Deletes a single session pref |
PTHTTPPOSTRequest
|
deleteSessionPrefs(array)
Deletes multiple session prefs |
void
|
formGetRefresh(form,requestHeaders)
Requests updated content from the server by submitting a form GET request |
void
|
formPostRefresh(form,requestHeaders)
Requests updated content from the server by submitting a form POST request |
Object
|
formRefresh(form,requestHeaders)
Requests updated content from the server by submitting a form |
Number
|
getRefreshInterval()
Returns the refreshInterval of the portlet, in milliseconds.
|
String
|
getRefreshURL()
Returns the refresh URL of the portlet |
void
|
raiseEvent(eventName,eventArgs,eventNamespace)
Raise an new event |
Object
|
refresh(url,requestHeaders)
Refresh the portlet content from the server. |
void
|
refreshOnEvent(eventName,eventNamespace)
Associate portlet refresh action with a specific event |
void
|
registerForEvent(eventName,eventCallback,eventNamespace)
Register to be notified of an event |
void
|
setInnerHTML(html)
Sets the innerHTML of the portlet from a string
|
void
|
setRefreshInterval(refreshInterval)
Sets the refreshInterval of the portlet (in milliseconds) and resets the refresh counter to zero.
|
String
|
setRefreshURL(url)
Sets the refresh URL of the portlet |
String
|
transformURL(url)
Transform a URL to be gatewayed |
<static> PTPortlet
|
getPortletByGUID(guid)
Returns a single portlet, given an GUID |
<static> PTPortlet
|
getPortletByID(id)
Returns a single portlet, given an ID |
<static> PTPortlet
|
getPortletByName(name)
Returns a single portlet, given a name NOTE: There is no restriction against having multiple portlets on the same page which have the same name, so portlet lookup by name in these cases is not guaranteed. |
<static> String
|
getSessionPref(name)
Get a single session pref Undefined pref returns empty string. |
<static> Hash
|
getSessionPrefs(names)
Get multiple session prefs Undefined prefs return empty string. |
<static> PTHTTPPOSTRequest
|
setSessionPref(name,value)
Set a single session pref |
<static> PTHTTPPOSTRequest
|
setSessionPrefs(hash)
Set multiple session prefs |
| Field Detail |
String containerID
String gatewayPrefixURL
String guid
String id
Boolean isCollapsed
String name
Number refreshInterval
String refreshURL
String remoteBaseURL
String remoteRequestURL
Object responseErrorHandler
Array responseErrors
Object responsePostProcHandler
Object responsePreProcHandler
String secureGatewayPrefixURL
<static> <final> Object VERSION
| Constructor Detail |
PTPortlet(id, guid, name, containerID, remoteRequestURL, remoteBaseURL, gatewayPrefixURL, secureGatewayPrefixURL, isCollapsed, refreshURL, refreshInterval)
id - The portlet object's id (string)
guid - The portlet object's global unique id (string)
name - The portlet's internationalized name (string)
containerID - The id attribute of the portlet's corresponding HTML element (string)
remoteRequestURL - The fully qualified URL of the portlet's web service (string)
remoteBaseURL - The base URL of the portlet's remote server (string)
gatewayPrefixURL - The URL of the gateway prefix (string)
secureGatewayPrefixURL - The secure URL of the gateway prefix (string)
isCollapsed - Whether or not the portlet is currently collapsed (boolean, optional)
refreshURL - The URL to use for refreshing the portlet (string, optional)
refreshInterval - The portlet's refresh interval, in milliseconds (integer, optional)
responsePreProcHandler - The handler to call before calling the response handler. Returning false from this handler cancels the call to the response handler. (string or function reference, optional). Important: Most in-place refresh actions are already making use of the responsePreProcHandler to inspect the response for errors before proceeding. If you wish to override the responsePreProcHandler for a portlet, make sure to add in an explicit call to _refreshErrorHandler and pass in the response to check for errors manually; otherwise default error-handling for your portlet's in-place refresh activities will be disabled.
responsePostProcHandler - The handler to call after calling the response handler (string or function reference, optional) Author Patrick Corcoran
| Method Detail |
void clearEvent(eventName,eventNamespace)
eventName - The name of the event to clear (string)
eventNamespace - The namespace for the event (string, optional)
void clearRefreshInterval()
refreshInterval of the portlet to 0 and clears any current refresh timers.PTHTTPPOSTRequest deleteSessionPref(name)
name - The name of the pref to be deleted (string)
PTHTTPPOSTRequest deleteSessionPrefs(array)
array - Array of named values to be deleted (Array)
void formGetRefresh(form,requestHeaders)
form - Specifies the form to submit via GET. This method will accept a form name, a form id, or a reference to the form object. Note that form elements of type FILE, IMAGE, and SUBMIT are ignored. If you need the value for a SUBMIT element to be passed to the server, you should create a HIDDEN element whose name and value are equivalent to the SUBMIT element, and the HIDDEN element will be passed through in its place.
requestHeaders - Headers to set in the HTTP request (associative array, optional)
void formPostRefresh(form,requestHeaders)
form - Specifies the form to submit via POST. This method will accept a form name, a form id, or a reference to the form object. Note that form elements of type FILE, IMAGE, and SUBMIT are ignored. If you need the value for a SUBMIT element to be passed to the server, you should create a HIDDEN element whose name and value are equivalent to the SUBMIT element, and the HIDDEN element will be passed through in its place.
requestHeaders - Headers to set in the HTTP request (associative array, optional)
Object formRefresh(form,requestHeaders)
form - Specifies the form to submit. This method will accept a form name, a form id, or a reference to the form object. Note that form elements of type FILE, IMAGE, and SUBMIT are ignored. If you need the value for a SUBMIT element to be passed to the server, you should create a HIDDEN element whose name and value are equivalent to the SUBMIT element, and the HIDDEN element will be passed through in its place.
requestHeaders - Headers to set in the HTTP request (associative array, optional)
Number getRefreshInterval()
refreshInterval of the portlet, in milliseconds.String getRefreshURL()
void raiseEvent(eventName,eventArgs,eventNamespace)
eventName - The name of the event to be raised (string)
eventArgs - A hash of arguments to be passed with the event (object, optional)
eventNamespace - The namespace for the event (string, optional)
Object refresh(url,requestHeaders)
url - URL to use for refreshing content (string, optional)
requestHeaders - Headers to set in the HTTP request (associative array, optional)
void refreshOnEvent(eventName,eventNamespace)
eventName - The name of the event which triggers refresh action (string)
eventNamespace - The namespace for the event (string, optional)
void registerForEvent(eventName,eventCallback,eventNamespace)
eventName - The name of the event (string)
eventCallback - The name of a function or a reference to a function which serves as a callback when the event is triggered (string or function)
eventNamespace - The namespace for the event (string, optional)
void setInnerHTML(html)
innerHTML of the portlet from a stringhtml - The html to be rendered (string)
void setRefreshInterval(refreshInterval)
refreshInterval of the portlet (in milliseconds) and resets the refresh counter to zero.
Setting a refreshInterval less than 1000ms (1 second) is not recommended. Shorter intervals can precipitate race conditions between server and client.refreshInterval - (integer)
String setRefreshURL(url)
url - to set as refreshURL
String transformURL(url)
url - The URL to be gatewayed (string)
<static> PTPortlet getPortletByGUID(guid)
guid - GUID of Portlet being requested (string)
<static> PTPortlet getPortletByID(id)
guid - ID of Portlet being requested (string)
<static> PTPortlet getPortletByName(name)
name - Name of Portlet being requested (string)
<static> String getSessionPref(name)
name - The name of the pref to be retrieved (string)
<static> Hash getSessionPrefs(names)
names - The names of the prefs to be retrieved (Array of strings)
<static> PTHTTPPOSTRequest setSessionPref(name,value)
name - The name of the pref to be set (string)
value - The value of the pref to be set (string)
<static> PTHTTPPOSTRequest setSessionPrefs(hash)
hash - Associative array of name/value pairs to be set (string)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||