|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object message.MessageHelper
This is intended as the main interface between portlet code and the messaging system. It can be used to send and receive messages, and to load/save message mappings between the portlet preferences and the session. Each portlet should ensure that loadPrefs is called at least once per session (for example at the beginning of doView).
Field Summary | |
protected MessageCentre |
msgCentre
|
protected java.lang.String |
portletID
|
protected java.lang.String |
sessionID
|
Fields inherited from interface message.MessageConstants |
INPUT, MSG_CENTRE_KEY, MSG_LOADED, MSG_PORTLET_ID, MSG_SESSION_ID_RETRIEVER, NS_LOCAL, OUTPUT, PREF_IN_PREFIX, PREF_NAME, PREF_OUT_PREFIX, PREF_PUBLISHNAME, PREF_PUBLISHNS, PREF_SOURCENAME, PREF_SOURCENS |
Constructor Summary | |
MessageHelper(javax.portlet.PortletRequest request)
Retrieve MessageHelper. |
|
MessageHelper(javax.portlet.PortletSession session,
java.lang.String portletID,
java.lang.String sessionID)
Retrieve MessageHelper for messaging between portlets in one or more webapps. |
Method Summary | |
protected static void |
clearPrefs(javax.portlet.PortletPreferences prefs)
|
java.lang.Object |
get(java.lang.String name)
Get message. |
java.lang.String |
getAsString(java.lang.String name)
Get message as String. |
protected static java.util.Set |
getLoadedPrefs(javax.portlet.PortletSession session)
|
static MessageCentre |
getMessageCentre(javax.portlet.PortletSession session,
java.lang.String sessionID)
Retrieve MessageCentre for messaging between portlets in one or more webapps. |
static java.lang.String |
getPortletID(javax.portlet.PortletRequest request)
Utility: get (and set, if not yet present) a unique ID for this portlet instance, stored in the session. |
static java.lang.String |
getSessionID(javax.portlet.PortletRequest request)
Utility: get a browser session ID. |
protected static boolean |
loadedPrefs(javax.portlet.PortletSession session,
java.lang.String portletID)
|
static void |
loadPrefs(javax.portlet.PortletRequest request)
Loads portlet preferences for message mappings into the session, if this has not already been done (checked using loadedPrefs). |
static void |
loadPrefs(javax.portlet.PortletRequest request,
java.lang.String portletID,
java.lang.String sessionID)
Loads portlet preferences for message mappings into the session, if this has not already been done (checked using loadedPrefs). |
static void |
savePrefs(javax.portlet.PortletRequest request,
java.lang.String portletID,
java.lang.String sessionID)
|
void |
send(java.lang.String name,
java.lang.Object message)
Send message. |
static void |
setLoadedPrefs(javax.portlet.PortletSession session,
java.lang.String portletID,
boolean isLoaded)
Sets a marker for whether or not the message mappings in the specified portlet's preferences have been loaded into the session. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected MessageCentre msgCentre
protected java.lang.String portletID
protected java.lang.String sessionID
Constructor Detail |
public MessageHelper(javax.portlet.PortletSession session, java.lang.String portletID, java.lang.String sessionID)
public MessageHelper(javax.portlet.PortletRequest request)
Method Detail |
public static MessageCentre getMessageCentre(javax.portlet.PortletSession session, java.lang.String sessionID)
public static java.lang.String getPortletID(javax.portlet.PortletRequest request)
public static java.lang.String getSessionID(javax.portlet.PortletRequest request)
protected static boolean loadedPrefs(javax.portlet.PortletSession session, java.lang.String portletID)
protected static java.util.Set getLoadedPrefs(javax.portlet.PortletSession session)
public static void setLoadedPrefs(javax.portlet.PortletSession session, java.lang.String portletID, boolean isLoaded)
public static void loadPrefs(javax.portlet.PortletRequest request)
public static void loadPrefs(javax.portlet.PortletRequest request, java.lang.String portletID, java.lang.String sessionID)
public static void savePrefs(javax.portlet.PortletRequest request, java.lang.String portletID, java.lang.String sessionID)
protected static void clearPrefs(javax.portlet.PortletPreferences prefs)
public java.lang.Object get(java.lang.String name)
public java.lang.String getAsString(java.lang.String name)
public void send(java.lang.String name, java.lang.Object message)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |