com.ibm.portal.state.accessors.portlet
Interface SharedStateAccessor

All Superinterfaces:
Accessor, Disposable, SharedStateIdentifierProvider
All Known Subinterfaces:
SharedStateAccessorController

public interface SharedStateAccessor
extends SharedStateIdentifierProvider, Accessor

Interface providing read-only accessor methods which allow for inspecting the shared state information related to of portlets this accessor operates on, in particular the public render parameters. The shared state may belong to an arbitrary amount of portlets

Note that public render parameters can be read through this accessor by any standard portlets. Though these parameters can neither be obtained through the portlet api (in particular javax.portal.PortletRequest#getParameterMap()) nor through the StateParameterService.

Any implementation of this interface should ensure that also the return types (i. e. the public render parameter map) are not modifiable.
Public render parameters may be global, i. e. accessibly by potentially every portlet. Use KEY_GLOBAL_PUBLIC_RENDER_PARAMETERS as key, aka sharedStateID for obtaining the appropriate SharedStateAccessor in the factory method ( PortletAccessorFactory.getSharedStateAccessor(String, com.ibm.portal.state.StateHolder) ).

Since:
6.1.0

Field Summary
static java.lang.String KEY_GLOBAL_PUBLIC_RENDER_PARAMETERS
          This key can be used to obtain global public render parameters, i.
static java.lang.String PORTAL_PATH_INFO_LOCALPART
          Deprecated. use PortalPublicRenderParameters.NAME_PATH_INFO instead
static javax.xml.namespace.QName PORTAL_PATH_INFO_QNAME
          Deprecated. use PortalPublicRenderParameters.QNAME_PATH_INFO instead
static java.lang.String PORTAL_PUBLIC_RENDER_PARAMETERS_URI
          Deprecated. use PortalPublicRenderParameters.NAMESPACE_URI instead
static java.lang.String VALUE_ASSIGNED_PAGE_PUBLIC_RENDER_PARAMETERS
          Value for the metadata of a public render parameter scope assignment.
static java.lang.String VALUE_PAGE_PUBLIC_RENDER_PARAMETERS
          This key can be used to obtain public render parameters for the current page, i.
 
Method Summary
 java.lang.String getParameter(javax.xml.namespace.QName key)
          Returns the first parameter of a parameter array that matches the key
 java.lang.String getParameter(javax.xml.namespace.QName key, java.lang.String aDefault)
          Returns the first parameter of a parameter array that matches the key
 java.util.Map<javax.xml.namespace.QName,java.lang.String[]> getParameters()
          Returns a map of public portlet render parameters (QName -> String[]).
 java.lang.String[] getParameters(javax.xml.namespace.QName key)
          Returns the parameters for the given key
 java.lang.String[] getParameters(javax.xml.namespace.QName key, java.lang.String... aDefaults)
          Returns the parameters for the given key
 
Methods inherited from interface com.ibm.portal.state.accessors.portlet.SharedStateIdentifierProvider
getIdentifier
 
Methods inherited from interface com.ibm.portal.Disposable
dispose
 

Field Detail

PORTAL_PUBLIC_RENDER_PARAMETERS_URI

@Deprecated
static final java.lang.String PORTAL_PUBLIC_RENDER_PARAMETERS_URI
Deprecated. use PortalPublicRenderParameters.NAMESPACE_URI instead
URI for public portal render parameters

See Also:
Constant Field Values

PORTAL_PATH_INFO_LOCALPART

@Deprecated
static final java.lang.String PORTAL_PATH_INFO_LOCALPART
Deprecated. use PortalPublicRenderParameters.NAME_PATH_INFO instead
Localpart of the QName of the path-info public portal render parameter

Since:
7.0.0.0
See Also:
Constant Field Values

PORTAL_PATH_INFO_QNAME

@Deprecated
static final javax.xml.namespace.QName PORTAL_PATH_INFO_QNAME
Deprecated. use PortalPublicRenderParameters.QNAME_PATH_INFO instead
QName for the path-info


KEY_GLOBAL_PUBLIC_RENDER_PARAMETERS

static final java.lang.String KEY_GLOBAL_PUBLIC_RENDER_PARAMETERS
This key can be used to obtain global public render parameters, i. e. parameters for all portlets. Portlets that declare the id for public render parameters with this key gain access to the declared parameters to potentially every portlet

See Also:
Constant Field Values

VALUE_PAGE_PUBLIC_RENDER_PARAMETERS

static final java.lang.String VALUE_PAGE_PUBLIC_RENDER_PARAMETERS
This key can be used to obtain public render parameters for the current page, i. e. parameters for all portlets on the current page. Portlets that declare the id for public render parameters with this key gain access to the declared parameters to potentially every portlet on the current page.

See Also:
Constant Field Values

VALUE_ASSIGNED_PAGE_PUBLIC_RENDER_PARAMETERS

static final java.lang.String VALUE_ASSIGNED_PAGE_PUBLIC_RENDER_PARAMETERS
Value for the metadata of a public render parameter scope assignment. This value assigns the scope to an identifier for the page or node that has the explicit assignment.

Since:
8.0
See Also:
Constant Field Values
Method Detail

getParameters

java.util.Map<javax.xml.namespace.QName,java.lang.String[]> getParameters()
Returns a map of public portlet render parameters (QName -> String[]). If no parameters can be found, an empty map is returned. Note that it is not guaranteed that the returned map is modifiable.

These parameters are prefilled with the public render parameters of the currently selected bucket encoded in the current state.

Returns:
Map of public render parameters (potentially unmodifiable). If there are no public render parameters at all, an empty map is returned. Does not return null.

getParameter

java.lang.String getParameter(javax.xml.namespace.QName key)
Returns the first parameter of a parameter array that matches the key

Parameters:
key - key
Returns:
the first parameter or null

getParameter

java.lang.String getParameter(javax.xml.namespace.QName key,
                              java.lang.String aDefault)
Returns the first parameter of a parameter array that matches the key

Parameters:
key - key
aDefault - the default value to be returned
Returns:
the first parameter or null

getParameters

java.lang.String[] getParameters(javax.xml.namespace.QName key)
Returns the parameters for the given key

Parameters:
key - key, not null
Returns:
the parameters or null

getParameters

java.lang.String[] getParameters(javax.xml.namespace.QName key,
                                 java.lang.String... aDefaults)
Returns the parameters for the given key

Parameters:
key - key, not null
defaults - the default values returned, if the key cannot be found
Returns:
the parameters or null