@Typed public abstract class ConversationUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
EXISTING_WINDOW_ID_SET_KEY |
| Modifier and Type | Method and Description |
|---|---|
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)
Allows to cleanup empty or inactive
WindowContexts which saves memory |
static Class<? extends Annotation> |
convertToScope(javax.enterprise.inject.spi.BeanManager beanManager,
Class conversationGroupKey,
Annotation... qualifiers)
Maps the given conversation-group-key to a scope-annotation
|
static Class<?> |
convertToSubGroup(Class<?> conversationGroupKey) |
static Class |
getConversationGroup(javax.enterprise.inject.spi.Bean<?> bean)
Calculates the conversation-group for a given
Bean. |
static Set<String> |
getExistingWindowIdSet(javax.faces.context.ExternalContext externalContext)
Exposes an unmodifiable representation of the active window-ids
which have been generated and stored for the current user
|
static String |
getNewViewId()
Exposes the next view-id.
|
static String |
getOldViewId()
Exposes the prev.
|
static WindowContextIdHolderComponent |
getWindowContextIdHolderComponent(javax.faces.context.FacesContext facesContext)
Resolves
WindowContextIdHolderComponent which is responsible for storing the window-id in case of a
server-side window-handler. |
static org.apache.myfaces.extensions.cdi.core.impl.scope.conversation.spi.WindowContextManager |
getWindowContextManager()
Resolves the current
WindowContextManager |
static WindowHandler |
getWindowHandler()
Resolves the current
WindowHandler |
static boolean |
isWindowActive(EditableWindowContextManager windowContextManager,
String windowId)
alternative to
getExistingWindowIdSet(javax.faces.context.ExternalContext) because it might be deactivated... |
static void |
postRenderCleanup(javax.faces.context.FacesContext facesContext)
Performs the cleanup of inactive and empty
WindowContexts (if permitted) and resets caches |
static boolean |
removeExistingWindowId(javax.faces.context.ExternalContext externalContext,
String windowContextId)
Allows to remove a window-id which has been created for a user(-session)
|
static String |
resolveWindowContextId(WindowHandler windowHandler,
boolean requestParameterSupported,
boolean allowUnknownWindowIds)
Tries to resolve the window-id via
WindowHandler, request-parameters, request-map, component |
static void |
sendRedirect(javax.faces.context.ExternalContext externalContext,
String url,
WindowHandler windowHandler)
Triggers a redirect via the
ExternalContext or the current WindowHandler, resets caches and
prevents FacesMessages |
static void |
storeCreatedWindowContextId(javax.faces.context.ExternalContext externalContext,
String windowContextId)
Allows to store the given window-id as active window-id
|
static void |
storeCurrentViewIdAsNewViewId(javax.faces.context.FacesContext facesContext)
Stores the view-id of the current
FacesContext as next view-id e.g. |
static void |
storeCurrentViewIdAsNewViewId(javax.faces.context.FacesContext facesContext,
WindowContext windowContext)
Stores the view-id of the current
FacesContext as next view-id e.g. |
static void |
storeCurrentViewIdAsOldViewId(javax.faces.context.FacesContext facesContext)
Stores the view-id of the current
FacesContext as prev. |
static void |
storeCurrentViewIdAsOldViewId(javax.faces.context.FacesContext facesContext,
org.apache.myfaces.extensions.cdi.core.impl.scope.conversation.spi.WindowContextManager windowContextManager)
Stores the view-id of the current
FacesContext as prev. |
static void |
storeViewIdAsNewViewId(WindowContext windowContext,
String newViewId)
Stores the given view-id as next view-id e.g.
|
static void |
tryToRestoreTheWindowIdEagerly(javax.faces.context.FacesContext facesContext,
EditableWindowContextManager windowContextManager,
WindowHandler windowHandler,
WindowContextConfig windowContextConfig) |
public static final String EXISTING_WINDOW_ID_SET_KEY
public static Class getConversationGroup(javax.enterprise.inject.spi.Bean<?> bean)
Bean.
Conversation-groups are only supported in combination with
ConversationScopedbean - current beanpublic static String resolveWindowContextId(WindowHandler windowHandler, boolean requestParameterSupported, boolean allowUnknownWindowIds)
WindowHandler, request-parameters, request-map, componentwindowHandler - current window-handlerrequestParameterSupported - flag which indicates if it is allowed to restore the id from the request-paramsallowUnknownWindowIds - flag which indicates if it is allowed to use id's which haven't been created for
the current userpublic static boolean cacheWindowId(javax.faces.context.ExternalContext externalContext,
String id,
boolean allowUnknownWindowIds)
externalContext - externalContextid - windowIdallowUnknownWindowIds - true to force the usage of the given idpublic static void storeCurrentViewIdAsOldViewId(javax.faces.context.FacesContext facesContext)
FacesContext as prev. view-id e.g. before a navigation occursfacesContext - current faces-contextpublic static void storeCurrentViewIdAsOldViewId(javax.faces.context.FacesContext facesContext,
org.apache.myfaces.extensions.cdi.core.impl.scope.conversation.spi.WindowContextManager windowContextManager)
FacesContext as prev. view-id e.g. before a navigation occursfacesContext - current faces-contextwindowContextManager - current window-context-managerpublic static void storeCurrentViewIdAsNewViewId(javax.faces.context.FacesContext facesContext)
FacesContext as next view-id e.g. after a navigation occurredfacesContext - current faces-contextpublic static void storeCurrentViewIdAsNewViewId(javax.faces.context.FacesContext facesContext,
WindowContext windowContext)
FacesContext as next view-id e.g. after a navigation occurredfacesContext - current faces-contextwindowContext - current window-contextpublic static void storeViewIdAsNewViewId(WindowContext windowContext, String newViewId)
windowContext - current window-contextnewViewId - next view-idpublic static String getOldViewId()
public static String getNewViewId()
public static WindowContextIdHolderComponent getWindowContextIdHolderComponent(javax.faces.context.FacesContext facesContext)
WindowContextIdHolderComponent which is responsible for storing the window-id in case of a
server-side window-handler.facesContext - current faces-contextpublic static void addWindowContextIdHolderComponent()
public static void sendRedirect(javax.faces.context.ExternalContext externalContext,
String url,
WindowHandler windowHandler)
throws IOException
ExternalContext or the current WindowHandler, resets caches and
prevents FacesMessagesexternalContext - current external-contexturl - target URLwindowHandler - current window-handlerIOException - in case of a failed redirectpublic static WindowHandler getWindowHandler()
WindowHandlerpublic static org.apache.myfaces.extensions.cdi.core.impl.scope.conversation.spi.WindowContextManager getWindowContextManager()
WindowContextManagerpublic static boolean removeExistingWindowId(javax.faces.context.ExternalContext externalContext,
String windowContextId)
externalContext - current external-contextwindowContextId - window-id to removepublic static Set<String> getExistingWindowIdSet(javax.faces.context.ExternalContext externalContext)
externalContext - current external-contextpublic static void storeCreatedWindowContextId(javax.faces.context.ExternalContext externalContext,
String windowContextId)
externalContext - current external-contextwindowContextId - window-idpublic static boolean cleanupInactiveWindowContexts(EditableWindowContextManager windowContextManager)
WindowContexts which saves memorywindowContextManager - current window-context-managerpublic static Class<? extends Annotation> convertToScope(javax.enterprise.inject.spi.BeanManager beanManager, Class conversationGroupKey, Annotation... qualifiers)
beanManager - current bean-managerconversationGroupKey - current conversation-group keyqualifiers - current qualifierspublic static boolean isWindowActive(EditableWindowContextManager windowContextManager, String windowId)
getExistingWindowIdSet(javax.faces.context.ExternalContext) because it might be deactivated...windowContextManager - current windowContextManagerwindowId - windowId in questionpublic static void postRenderCleanup(javax.faces.context.FacesContext facesContext)
WindowContexts (if permitted) and resets cachesfacesContext - current faces-contextpublic static void tryToRestoreTheWindowIdEagerly(javax.faces.context.FacesContext facesContext,
EditableWindowContextManager windowContextManager,
WindowHandler windowHandler,
WindowContextConfig windowContextConfig)
Copyright © 2010-2014 The Apache Software Foundation. All Rights Reserved.