Type Definitions
-
AccessDeniedException
-
Exception thrown when a portlet client is not allowed to access a data element
- Source:
Properties:
Name Type Description name
string The exception name, equal to "AccessDeniedException" message
string An optional message that provides more detail about the exception -
ErrorData
-
Provides the name of an error that occurred along with an optional message that provide more detail.
- Source:
Properties:
Name Type Description name
string The error name message
string An optional message that provides more detail about the error -
NotInitializedException
-
Thrown when a portlet attempts to use the API without comleting the intialization process. In general, this means that the onStateChange listener has not been added.
- Source:
Properties:
Name Type Description name
string The exception name, equal to "NotInitializedException" message
string An optional message that provides more detail about the exception -
onError(type, errorData)
-
The onError callback function that a portlet client participating in the portlet hub Ajax support may implement. Typically the callback will be used to provide the portlet client with information about asynchronous errors that occurred during processing.
The portlet client registers an onError callback by adding a listener for the portlet.onError event type through the addEventListener function.
Parameters:
Name Type Description type
string The event type "portlet.onError". errorData
ErrorData Provides information about the error. - Source:
-
onStateChange(type, RenderState, renderData)
-
The onStateChange callback function that each portlet client participating in the portlet hub Ajax support must implement.
The portlet client registers an onStateChange callback by adding a listener for the portlet.onStateChange event type through the addEventListener function.
When the portlet hub calls the onStateChange callback, it will pass a copy of the current render state as a parameter. The portlet client can make changes to the RenderState object without affecting the actual render state, which is maintained by the portlet hub. The portlet client uses the setRenderState method to make changes to the local copy of the RenderState object active.
Optionally, the portlet hub will make a RenderData object available to the portlet client. When the RenderData object is available, it contains the same data as would be available through a portlet resource request using the current render state with no additional resource parameters and with the resource URL cacheability option set to "PAGE".
The portlet client may not call portlet hub functions that can cause state to be updated (action, {@link updateRenderState}, startPartialAction) during onStateChange execution.
Parameters:
Name Type Description type
string The event type "portlet.onStateChange". RenderState
RenderState The render state renderData
RenderData The render data. Optionally provided by the portlet hub. - Source:
-
PartialActionInit
-
This data is returned to the portlet client by the startPartialAction function.
The portlet client can use the partial action URL to initiate processing. During processing, the portal will perform action and event processing. It will generate a string representing the new page state and pass it to the portlet's serveResource method.
The portlet is responsible for transmitting the page state string to the client and for calling the setPageState callback function.
The portlet hub will be blocked until the portlet calls the setPageState function and the portlet hub has successfully performed the state change.
- Source:
Properties:
Name Type Description url
string The partial action URL setPageState
function Callback function -
PortletConstants
-
Provides defined values for some commonly-used portlet constants
- Source:
Properties:
Name Type Description VIEW
string Specifies portlet mode 'view' EDIT
string Specifies portlet mode 'edit' HELP
string Specifies portlet mode 'help' NORMAL
string Specifies window state 'normal' MINIMIZED
string Specifies window state 'minimized' MAXIMIZED
string Specifies window state 'maximized' FULL
string Specifies resource URL cacheability "cacheLevelFull" PORTLET
string Specifies resource URL cacheability "cacheLevelPage" PAGE
string Specifies resource URL cacheability "cacheLevelPortlet" -
PortletParameters
-
Represents a portlet parameter.
Each object property represents a parameter name. The object may also contain no property names, which represents the case of the portlet having no parameters.
If properties are present, each property must refer to a array of string values. The array length must be at least 1, because each parameter must have a value. However, a value of 'null' may appear in any array entry.
To represent the parameter having a
null
value, the property value must equal [null].- Source:
Properties:
Name Type Description {string}
string[] The parameters object may have multiple properties. -
RenderData
-
Optional render data that may be provided by the portlet hub when a render state change occurs.
- Source:
Properties:
Name Type Description renderData
string The render data mimeType
string The mime type -
RenderState
-
Represents the render state.
RenderState objects obtained from the Portlet Hub define some helper functions for accessing the parameter values.
- Source:
Properties:
Name Type Description parameters
PortletParameters The portlet parameters portletMode
string The portlet mode windowState
string The window state clone()
function Returns a new copy of this object setPortletMode(pm)
function Sets the portlet mode to the specified value. The strings defined by the PortletConstants object should be used to specify the portlet mode. getPortletMode()
function Returns the current portlet mode setWindowState(ws)
function Sets the window state to the specified value getWindowState()
function Returns the current window state The strings defined by the PortletConstants object should be used to specify the window state. setValue(n,v)
function Sets a parameter with name n and value v. The value v may be a string or an array. setValues(n,v)
function Sets a parameter with name n and value v. The value v may be a string or an array. getValue(n,d)
function Gets the string parameter value for the name n. If n designates a multi-valued parameter, this function returns the first value in the values array. If parameter n is undefined, the function returns the optional default value d. getValues(n,d)
function Gets the string array parameter value for the name n. If parameter n is undefined, the function returns the optional default value array d. remove(n)
function Removes the parameter with name n. -
setPageState(pid, ustr)
-
Callback function that must be called after a partial action has been started.
The page state is generated by the portal and transmitted to the client by the portlet. The portlet client that initiated the partial action must pass the page state string to this function.
The callback should only be called once to conclude a partial action sequence.
Parameters:
Name Type Description pid
string The portlet ID for operation ustr
string The new page state in string form - Source:
Throws:
-
Thrown if the parameter is not a string
- Type
- TypeError