org.apache.myfaces.extensions.cdi.jsf.impl.util
Class ConversationUtils
java.lang.Object
org.apache.myfaces.extensions.cdi.jsf.impl.util.ConversationUtils
public class ConversationUtils
- extends Object
internal! utils
- Author:
- Gerhard Petracek
Method Summary |
static void |
addWindowContextIdHolderComponent()
Needed for server-side window-handler and client-side window handler for supporting postbacks |
static boolean |
cacheWindowId(javax.faces.context.ExternalContext externalContext,
String id,
boolean allowUnknownWindowIds)
|
static boolean |
cleanupInactiveWindowContexts(EditableWindowContextManager windowContextManager)
|
static Class<? extends Annotation> |
convertToScope(javax.enterprise.inject.spi.BeanManager beanManager,
Class conversationGroupKey,
Annotation... qualifiers)
|
static Class |
getConversationGroup(javax.enterprise.inject.spi.Bean<?> bean)
|
static Set<String> |
getExistingWindowIdSet(javax.faces.context.ExternalContext externalContext)
|
static String |
getNewViewId()
|
static String |
getOldViewId()
|
static WindowContextIdHolderComponent |
getWindowContextIdHolderComponent(javax.faces.context.FacesContext facesContext)
|
static WindowContextManager |
getWindowContextManager()
|
static WindowHandler |
getWindowHandler()
|
static boolean |
isWindowActive(EditableWindowContextManager windowContextManager,
String windowId)
alternative to getExistingWindowIdSet(javax.faces.context.ExternalContext) because it might be deactivated... |
static boolean |
removeExistingWindowId(javax.faces.context.ExternalContext externalContext,
String windowContextId)
|
static String |
resolveWindowContextId(WindowHandler windowHandler,
boolean requestParameterSupported,
boolean allowUnknownWindowIds)
|
static void |
sendRedirect(javax.faces.context.ExternalContext externalContext,
String url,
WindowHandler windowHandler)
|
static void |
storeCreatedWindowContextId(javax.faces.context.ExternalContext externalContext,
String windowContextId)
|
static void |
storeCurrentViewIdAsNewViewId(javax.faces.context.FacesContext facesContext)
|
static void |
storeCurrentViewIdAsNewViewId(javax.faces.context.FacesContext facesContext,
WindowContext windowContext)
|
static void |
storeCurrentViewIdAsOldViewId(javax.faces.context.FacesContext facesContext)
|
static void |
storeCurrentViewIdAsOldViewId(javax.faces.context.FacesContext facesContext,
WindowContextManager windowContextManager)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EXISTING_WINDOW_ID_SET_KEY
public static final String EXISTING_WINDOW_ID_SET_KEY
ConversationUtils
public ConversationUtils()
getConversationGroup
public static Class getConversationGroup(javax.enterprise.inject.spi.Bean<?> bean)
resolveWindowContextId
public static String resolveWindowContextId(WindowHandler windowHandler,
boolean requestParameterSupported,
boolean allowUnknownWindowIds)
cacheWindowId
public static boolean cacheWindowId(javax.faces.context.ExternalContext externalContext,
String id,
boolean allowUnknownWindowIds)
- Parameters:
externalContext
- externalContextid
- windowIdallowUnknownWindowIds
- true to force the usage of the given id
- Returns:
- false if the id doesn't exist in the storage (e.g. in case of bookmarks)
storeCurrentViewIdAsOldViewId
public static void storeCurrentViewIdAsOldViewId(javax.faces.context.FacesContext facesContext)
storeCurrentViewIdAsOldViewId
public static void storeCurrentViewIdAsOldViewId(javax.faces.context.FacesContext facesContext,
WindowContextManager windowContextManager)
storeCurrentViewIdAsNewViewId
public static void storeCurrentViewIdAsNewViewId(javax.faces.context.FacesContext facesContext)
storeCurrentViewIdAsNewViewId
public static void storeCurrentViewIdAsNewViewId(javax.faces.context.FacesContext facesContext,
WindowContext windowContext)
getOldViewId
public static String getOldViewId()
getNewViewId
public static String getNewViewId()
getWindowContextIdHolderComponent
public static WindowContextIdHolderComponent getWindowContextIdHolderComponent(javax.faces.context.FacesContext facesContext)
addWindowContextIdHolderComponent
public static void addWindowContextIdHolderComponent()
- Needed for server-side window-handler and client-side window handler for supporting postbacks
sendRedirect
public static void sendRedirect(javax.faces.context.ExternalContext externalContext,
String url,
WindowHandler windowHandler)
throws IOException
- Throws:
IOException
getWindowHandler
public static WindowHandler getWindowHandler()
getWindowContextManager
public static WindowContextManager getWindowContextManager()
removeExistingWindowId
public static boolean removeExistingWindowId(javax.faces.context.ExternalContext externalContext,
String windowContextId)
getExistingWindowIdSet
public static Set<String> getExistingWindowIdSet(javax.faces.context.ExternalContext externalContext)
storeCreatedWindowContextId
public static void storeCreatedWindowContextId(javax.faces.context.ExternalContext externalContext,
String windowContextId)
cleanupInactiveWindowContexts
public static boolean cleanupInactiveWindowContexts(EditableWindowContextManager windowContextManager)
convertToScope
public static Class<? extends Annotation> convertToScope(javax.enterprise.inject.spi.BeanManager beanManager,
Class conversationGroupKey,
Annotation... qualifiers)
isWindowActive
public static boolean isWindowActive(EditableWindowContextManager windowContextManager,
String windowId)
- alternative to
getExistingWindowIdSet(javax.faces.context.ExternalContext)
because it might be deactivated...
- Parameters:
windowContextManager
- current windowContextManagerwindowId
- windowId in question
- Returns:
- true if the window is known and active, false otherwise
Copyright © 2010 The Apache Software Foundation. All Rights Reserved.