org.edorasframework.portletfaces.context.impl
Class PortletFacesContextImpl

java.lang.Object
  extended by javax.faces.context.FacesContext
      extended by org.edorasframework.extfaces.context.ExtFacesContext
          extended by org.edorasframework.portletfaces.context.PortletFacesContext
              extended by org.edorasframework.portletfaces.context.impl.PortletFacesContextImpl

public class PortletFacesContextImpl
extends PortletFacesContext

This class is the default implementation of the PortletFacesContext.

Author:
"Joel Kozikowski", mimacom ag, "Neil Griffin", mimacom ag

Field Summary
 
Fields inherited from class org.edorasframework.extfaces.context.ExtFacesContext
JAVAX_FACES_UPLOADED_FILES_MAP
 
Constructor Summary
PortletFacesContextImpl()
           
 
Method Summary
 void addComponentErrorMessage(String clientId, String key)
           
 void addComponentErrorMessage(String clientId, String key, Object... arguments)
           
 void addComponentErrorMessage(String clientId, String key, Object argument)
           
 void addComponentInfoMessage(String clientId, String key)
           
 void addComponentInfoMessage(String clientId, String key, Object... arguments)
           
 void addComponentInfoMessage(String clientId, String key, Object argument)
           
 void addGlobalErrorMessage(String key)
           
 void addGlobalErrorMessage(String key, Object... arguments)
           
 void addGlobalErrorMessage(String key, Object argument)
           
 void addGlobalInfoMessage(String key)
           
 void addGlobalInfoMessage(String key, Object... arguments)
           
 void addGlobalInfoMessage(String key, Object argument)
           
 void addGlobalSuccessInfoMessage()
          Adds a global information message to the current FacesContext with the standard Liferay "your-request-processed-successfully" key as the messageId.
 void addGlobalUnexpectedErrorMessage()
          Adds a global error message to the current FacesContext with the standard Liferay "an-unexpected-error-occurred" key as the messageId.
 void addMessage(String clientId, javax.faces.application.FacesMessage.Severity severity, String key)
           
 void addMessage(String clientId, javax.faces.application.FacesMessage.Severity severity, String key, Object... arguments)
           
 void addMessage(String clientId, javax.faces.application.FacesMessage.Severity severity, String key, Object argument)
           
 void addMessage(String clientId, javax.faces.application.FacesMessage facesMessage)
           
 void checkUserPortletPermission(String actionId)
          Checks to see if the current user has permission to execute the specified actionId (which, in turn, is assumed to be an action defined for the current portlet).
 javax.portlet.PortletURL createActionURL()
          Retrieves a render URL for the current facesContext.
 javax.portlet.PortletURL createPopupUrl(String viewId)
          Creates a URL capable of displaying a specified view Id in "Popup" mode.
 javax.portlet.PortletURL createRenderURL()
          Retrieves a render URL for the current facesContext.
 javax.portlet.ActionResponse getActionResponse()
          Retrieves the javax.portlet.ActionResponse object associated with the current JSF FacesContext.
 javax.faces.application.Application getApplication()
           
 Iterator<String> getClientIdsWithMessages()
           
 long getCompanyId()
          Returns the company Id associated with the community that is hosting the portlet associated with the current JSF FacesContext.
 String getDocumentLibraryURL()
          Returns an absolute URL to the Liferay document library, which is the main part of different struts action paths.
 javax.el.ELContext getELContext()
           
 javax.faces.context.ExternalContext getExternalContext()
           
 org.edorasframework.extfaces.context.ExtFacesContext getExtFacesContext()
           
 javax.faces.context.FacesContext getFacesContext()
          Returns the current facesContext.
 com.liferay.portal.model.User getGroupUser()
          Returns the user associated with the group (Liferay community) associated with the layout (portal page) that the portlet resides on.
 long getHostGroupId()
          Returns the "group Id" associated with the community that is hosting the portlet associated with the current JSF FacesContext.
 String getImageGalleryURL()
          Returns an absolute URL to the Liferay image gallery, which is the main part of different struts action paths.
 com.liferay.portal.model.Layout getLayout()
          Returns the layout being displayed in the current context.
protected  Liferay getLiferayManagedBean()
           
 org.edorasframework.liferayadapter.ServiceMap getLiferayServiceMap()
          Returns a Map of Liferay Services.
 Locale getLocale()
           
 javax.faces.application.FacesMessage.Severity getMaximumSeverity()
           
 String getMessage(Locale locale, String messageId)
           
 String getMessage(Locale locale, String messageId, Object... arguments)
           
 String getMessage(long companyId, Locale locale, String messageId)
          Returns the message associated with the specified messageId by delegating to the FacesMessageFactory, according to the specified Liferay companyId and specified locale.
 String getMessage(long companyId, Locale locale, String messageId, Object... arguments)
          Returns the message associated with the specified messageId by delegating to the FacesMessageFactory, according to the specified Liferay companyId, and specified locale and arguments that are to be substituted.
 String getMessage(String messageId)
           
 String getMessage(String messageId, Object... arguments)
           
 Iterator<javax.faces.application.FacesMessage> getMessages()
           
 Iterator<javax.faces.application.FacesMessage> getMessages(String clientId)
           
 javax.faces.component.UIForm getParentForm(javax.faces.component.UIComponent uiComponent)
           
 org.edorasframework.liferayadapter.PermissionCheckerWrapper getPermissionChecker()
          Returns the Liferay PermissionChecker associated with the request.
 long getPlid()
          Returns the "Plid" (the "portal layout id"), which is the identifier of the specific "page" the portlet exists on.
 javax.portlet.PortalContext getPortalContext()
          Retrieves the javax.portlet.PortalContext object associated with the current JSF FacesContext.
 String getPortalURL()
          Returns an absolute URL which is the context-path of the portal webapp.
 com.liferay.portal.model.Portlet getPortlet()
          Returns the com.liferay.portal.model.Portlet object for the portlet associated with the current request.
 javax.portlet.PortletConfig getPortletConfig()
          Retrieves the javax.portlet.PortletConfig object associated with the current JSF FacesContext.
 javax.portlet.PortletContext getPortletContext()
          Retrieves the javax.portlet.PortletContext object associated with the current JSF FacesContext.
 String getPortletContextName()
          Retrieves the name of the portlet associated with the current JSF FacesContext (usually, its the name of the portlet .war)
 String getPortletInstanceId()
          Returns the "portlet instance Id" of the currently running portlet.
 String getPortletName()
          Retrieves the name of the portlet associated with the current JSF FacesContext (as defined in portlet.xml's <portlet-name> tag).
 String getPortletNamespace()
          Returns a namespace prefix to be used for the portlet associated with the current JSF FacesContext instance.
 Object getPortletPreference(String preferenceName, Object defaultValue)
          Returns String representation of the value of the portlet preference associated with the specified name in from the javax.portlet.PortletPreferences object associated with the current JSF FacesContext.
 boolean getPortletPreferenceAsBool(String preferenceName, boolean defaultValue)
          Returns boolean representation of the value of the portlet preference associated with the specified name in from the PortletPreferenceMap object associated with the current JSF FacesContext.
 int getPortletPreferenceAsInt(String preferenceName, int defaultValue)
          Returns integer representation of the value of the portlet preference associated with the specified name in from the PortletPreferenceMap object associated with the current JSF FacesContext.
 short getPortletPreferenceAsShort(String preferenceName, short defaultValue)
          Returns short representation of the value of the portlet preference associated with the specified name in from the PortletPreferenceMap object associated with the current JSF FacesContext.
 String getPortletPreferenceAsString(String preferenceName, String defaultValue)
          Returns short representation of the value of the portlet preference associated with the specified name in from the PortletPreferenceMap object associated with the current JSF FacesContext.
 PortletPreferenceMap getPortletPreferenceMap()
          Returns the PortletPreferenceMap associated with the current JSF FacesContext.
 javax.portlet.PortletPreferences getPortletPreferences()
          Retrieves the javax.portlet.PortletPreferences object associated with the current JSF FacesContext.
 javax.portlet.RenderRequest getPortletRenderRequest()
          Retrieves the javax.portlet.RenderRequest object associated with the current JSF FacesContext.
 javax.portlet.RenderResponse getPortletRenderResponse()
          Retrieves the javax.portlet.RenderResponse object associated with the current JSF FacesContext.
 javax.portlet.PortletRequest getPortletRequest()
          Retrieves the javax.portlet.PortletRequest object associated with the current JSF FacesContext.
 javax.portlet.PortletResponse getPortletResponse()
          Retrieves the javax.portlet.PortletResponse object associated with the current JSF FacesContext.
 String getPortletRootId()
          Returns the "portlet root Id" of the currently running portlet.
 javax.portlet.PortletSession getPortletSession()
          Retrieves the javax.portlet.PortletSession object associated with the current JSF FacesContext.
 String getRemoteUser()
          Returns the user name/id of the user associated with the current JSF FacesContext
 javax.faces.render.RenderKit getRenderKit()
           
 boolean getRenderResponse()
           
 Object getRequestAttribute(String name)
           
 String getRequestContextPath()
           
 String getRequestParameter(String name)
           
 boolean getRequestParameterAsBool(String name, boolean defaultValue)
           
 int getRequestParameterAsInt(String name, int defaultValue)
           
 long getRequestParameterAsLong(String name, long defaultValue)
           
 String getRequestParameterFromMap(String name)
           
 String getRequestQueryString()
           
 String getRequestQueryStringParameter(String name)
           
 boolean getResponseComplete()
           
 javax.faces.context.ResponseStream getResponseStream()
           
 javax.faces.context.ResponseWriter getResponseWriter()
           
 org.edorasframework.liferayadapter.ServiceContext getServiceContext(String className)
          Returns an instance of a ServiceContext associated with the specified className.
 Object getSession(boolean create)
           
 Object getSessionAttribute(String name)
           
 Object getSessionSharedAttribute(String name)
          Returns the value of the session attribute associated with the specified name from PortletSession.APPLICATION_SCOPE
 com.liferay.portal.model.Theme getTheme()
          Returns the theme being displayed in the current context.
 org.edorasframework.liferayadapter.ThemeDisplayClone getThemeDisplay()
          Returns the com.liferay.portal.theme.ThemeDisplay object, which contains a variety methods for rendering theme specific look and feels.
 String getThemeImagesURL()
          Returns an absolute URL which is the path to the images of the theme associated with the current Layout.
 Map<String,File> getUploadedFilesMap()
           
 com.liferay.portal.model.User getUser()
          Returns the user record of the user associated with the current JSF FacesContext.
 long getUserId()
          Returns the user Id of the user associated with the current JSF FacesContext
 List<com.liferay.portal.model.Role> getUserRoles()
          Returns a list of all of the roles played by the user associated with the current JSF FacesContext.
 javax.faces.component.UIViewRoot getViewRoot()
           
 javax.portlet.WindowState getWindowState()
          Returns the window state of the portlet associated with the current JSF FacesContext
 boolean isUserInRole(String roleName)
          Returns TRUE if the current user is associated with the specified role.
 boolean isWindowMaximized()
          Returns TRUE if the Window state of the current portlet is set to MAXIMIZED
 boolean isWindowNormal()
          Returns TRUE if the Window state of the current portlet is set to MAXIMIZED
 javax.faces.component.UIComponent matchComponentInHierarchy(javax.faces.component.UIComponent parent, String partialClientId)
           
 javax.faces.component.UIComponent matchComponentInViewRoot(String partialClientId)
           
 void navigate(String fromAction, String outcome)
           
 void navigateTo(String outcome)
           
 void postLifecycleCleanup()
          Performs cleanup operations that are intended to be performed after the JSF lifecycle executes.
 void recreateComponentTree()
           
 void registerPhaseListener(javax.faces.event.PhaseListener phaseListener)
           
 void release()
           
 void removeChildrenFromComponentTree(String clientId)
           
 void removeMessages(String clientId)
           
 void removeMessagesForImmediateComponents()
           
 void removeMessagesForImmediateComponents(javax.faces.component.UIComponent uiComponent)
           
 void removeParentFormFromComponentTree(javax.faces.component.UIComponent uiComponent)
           
 void renderResponse()
           
 void resetView()
           
 void resetView(boolean renderResponse)
           
 Object resolveExpression(String elExpression)
           
 void responseComplete()
           
 void setExtFacesContext(org.edorasframework.extfaces.context.ExtFacesContext extFacesContext)
           
 void setPortletMode(javax.portlet.PortletMode portletMode)
          Sets the portlet mode of the portlet associated with the current JSF FacesContext to the specified portlet mode.
 void setRequestAttribute(String name, Object value)
           
 void setResponseStream(javax.faces.context.ResponseStream responseStream)
           
 void setResponseWriter(javax.faces.context.ResponseWriter responseWriter)
           
 void setSessionAttribute(String name, Object value)
           
 void setSessionSharedAttribute(String name, Object value)
          Sets the value of the a session attribute using the specified name and value within PortletSession.APPLICATION_SCOPE
 void setViewRoot(javax.faces.component.UIViewRoot viewRoot)
           
 void setWindowState(javax.portlet.WindowState windowState)
          Sets the window state of the portlet associated with the current JSF FacesContext to the specified window state.
 void setWindowStateToMaximized()
          A short-cut method for calling setWindowState(WindowState.MAXIMIZED)
 void setWindowStateToNormal()
          A short-cut method for calling setWindowState(WindowState.NORMAL)
 boolean userHasPortletPermission(String actionId)
          Returns TRUE if the current user has permission to execute the specified actionId (which, in turn, is assumed to be an action defined for the current portlet).
 boolean userHasRole(String roleName)
          Returns TRUE if the current user has the specified role name.
 
Methods inherited from class org.edorasframework.portletfaces.context.PortletFacesContext
getInstance, setInstance
 
Methods inherited from class org.edorasframework.extfaces.context.ExtFacesContext
setInstance
 
Methods inherited from class javax.faces.context.FacesContext
getCurrentInstance, setCurrentInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PortletFacesContextImpl

public PortletFacesContextImpl()
Method Detail

addGlobalUnexpectedErrorMessage

public void addGlobalUnexpectedErrorMessage()
Description copied from class: PortletFacesContext
Adds a global error message to the current FacesContext with the standard Liferay "an-unexpected-error-occurred" key as the messageId.

Specified by:
addGlobalUnexpectedErrorMessage in class PortletFacesContext

addGlobalSuccessInfoMessage

public void addGlobalSuccessInfoMessage()
Description copied from class: PortletFacesContext
Adds a global information message to the current FacesContext with the standard Liferay "your-request-processed-successfully" key as the messageId.

Specified by:
addGlobalSuccessInfoMessage in class PortletFacesContext

addGlobalErrorMessage

public void addGlobalErrorMessage(String key)
Specified by:
addGlobalErrorMessage in class org.edorasframework.extfaces.context.ExtFacesContext

addGlobalErrorMessage

public void addGlobalErrorMessage(String key,
                                  Object argument)
Specified by:
addGlobalErrorMessage in class org.edorasframework.extfaces.context.ExtFacesContext

addGlobalErrorMessage

public void addGlobalErrorMessage(String key,
                                  Object... arguments)
Specified by:
addGlobalErrorMessage in class org.edorasframework.extfaces.context.ExtFacesContext

addComponentErrorMessage

public void addComponentErrorMessage(String clientId,
                                     String key)
Specified by:
addComponentErrorMessage in class org.edorasframework.extfaces.context.ExtFacesContext

addComponentErrorMessage

public void addComponentErrorMessage(String clientId,
                                     String key,
                                     Object argument)
Specified by:
addComponentErrorMessage in class org.edorasframework.extfaces.context.ExtFacesContext

addComponentErrorMessage

public void addComponentErrorMessage(String clientId,
                                     String key,
                                     Object... arguments)
Specified by:
addComponentErrorMessage in class org.edorasframework.extfaces.context.ExtFacesContext

addGlobalInfoMessage

public void addGlobalInfoMessage(String key)
Specified by:
addGlobalInfoMessage in class org.edorasframework.extfaces.context.ExtFacesContext

addGlobalInfoMessage

public void addGlobalInfoMessage(String key,
                                 Object argument)
Specified by:
addGlobalInfoMessage in class org.edorasframework.extfaces.context.ExtFacesContext

addGlobalInfoMessage

public void addGlobalInfoMessage(String key,
                                 Object... arguments)
Specified by:
addGlobalInfoMessage in class org.edorasframework.extfaces.context.ExtFacesContext

addComponentInfoMessage

public void addComponentInfoMessage(String clientId,
                                    String key)
Specified by:
addComponentInfoMessage in class org.edorasframework.extfaces.context.ExtFacesContext

addComponentInfoMessage

public void addComponentInfoMessage(String clientId,
                                    String key,
                                    Object argument)
Specified by:
addComponentInfoMessage in class org.edorasframework.extfaces.context.ExtFacesContext

addComponentInfoMessage

public void addComponentInfoMessage(String clientId,
                                    String key,
                                    Object... arguments)
Specified by:
addComponentInfoMessage in class org.edorasframework.extfaces.context.ExtFacesContext

addMessage

public void addMessage(String clientId,
                       javax.faces.application.FacesMessage facesMessage)
Specified by:
addMessage in class javax.faces.context.FacesContext

addMessage

public void addMessage(String clientId,
                       javax.faces.application.FacesMessage.Severity severity,
                       String key)
Specified by:
addMessage in class org.edorasframework.extfaces.context.ExtFacesContext

addMessage

public void addMessage(String clientId,
                       javax.faces.application.FacesMessage.Severity severity,
                       String key,
                       Object argument)
Specified by:
addMessage in class org.edorasframework.extfaces.context.ExtFacesContext

addMessage

public void addMessage(String clientId,
                       javax.faces.application.FacesMessage.Severity severity,
                       String key,
                       Object... arguments)
Specified by:
addMessage in class org.edorasframework.extfaces.context.ExtFacesContext

createActionURL

public javax.portlet.PortletURL createActionURL()
Description copied from class: PortletFacesContext
Retrieves a render URL for the current facesContext.

Specified by:
createActionURL in class PortletFacesContext

createRenderURL

public javax.portlet.PortletURL createRenderURL()
Description copied from class: PortletFacesContext
Retrieves a render URL for the current facesContext.

Specified by:
createRenderURL in class PortletFacesContext

matchComponentInViewRoot

public javax.faces.component.UIComponent matchComponentInViewRoot(String partialClientId)
Specified by:
matchComponentInViewRoot in class org.edorasframework.extfaces.context.ExtFacesContext

matchComponentInHierarchy

public javax.faces.component.UIComponent matchComponentInHierarchy(javax.faces.component.UIComponent parent,
                                                                   String partialClientId)
Specified by:
matchComponentInHierarchy in class org.edorasframework.extfaces.context.ExtFacesContext

navigate

public void navigate(String fromAction,
                     String outcome)
Specified by:
navigate in class org.edorasframework.extfaces.context.ExtFacesContext

navigateTo

public void navigateTo(String outcome)
Specified by:
navigateTo in class org.edorasframework.extfaces.context.ExtFacesContext

recreateComponentTree

public void recreateComponentTree()
Specified by:
recreateComponentTree in class org.edorasframework.extfaces.context.ExtFacesContext

registerPhaseListener

public void registerPhaseListener(javax.faces.event.PhaseListener phaseListener)
Specified by:
registerPhaseListener in class org.edorasframework.extfaces.context.ExtFacesContext

release

public void release()
Specified by:
release in class javax.faces.context.FacesContext

removeChildrenFromComponentTree

public void removeChildrenFromComponentTree(String clientId)
Specified by:
removeChildrenFromComponentTree in class org.edorasframework.extfaces.context.ExtFacesContext

removeMessages

public void removeMessages(String clientId)
Specified by:
removeMessages in class org.edorasframework.extfaces.context.ExtFacesContext

removeMessagesForImmediateComponents

public void removeMessagesForImmediateComponents()
Specified by:
removeMessagesForImmediateComponents in class org.edorasframework.extfaces.context.ExtFacesContext

removeMessagesForImmediateComponents

public void removeMessagesForImmediateComponents(javax.faces.component.UIComponent uiComponent)
Specified by:
removeMessagesForImmediateComponents in class org.edorasframework.extfaces.context.ExtFacesContext

removeParentFormFromComponentTree

public void removeParentFormFromComponentTree(javax.faces.component.UIComponent uiComponent)
Specified by:
removeParentFormFromComponentTree in class org.edorasframework.extfaces.context.ExtFacesContext

renderResponse

public void renderResponse()
Specified by:
renderResponse in class javax.faces.context.FacesContext

resetView

public void resetView()
Specified by:
resetView in class org.edorasframework.extfaces.context.ExtFacesContext

resetView

public void resetView(boolean renderResponse)
Specified by:
resetView in class org.edorasframework.extfaces.context.ExtFacesContext

responseComplete

public void responseComplete()
Specified by:
responseComplete in class javax.faces.context.FacesContext

getActionResponse

public javax.portlet.ActionResponse getActionResponse()
Description copied from class: PortletFacesContext
Retrieves the javax.portlet.ActionResponse object associated with the current JSF FacesContext.

Specified by:
getActionResponse in class PortletFacesContext

getApplication

public javax.faces.application.Application getApplication()
Specified by:
getApplication in class javax.faces.context.FacesContext

getClientIdsWithMessages

public Iterator<String> getClientIdsWithMessages()
Specified by:
getClientIdsWithMessages in class javax.faces.context.FacesContext

getExternalContext

public javax.faces.context.ExternalContext getExternalContext()
Specified by:
getExternalContext in class javax.faces.context.FacesContext

getExtFacesContext

public org.edorasframework.extfaces.context.ExtFacesContext getExtFacesContext()
Specified by:
getExtFacesContext in class PortletFacesContext

setExtFacesContext

public void setExtFacesContext(org.edorasframework.extfaces.context.ExtFacesContext extFacesContext)

getFacesContext

public javax.faces.context.FacesContext getFacesContext()
Description copied from class: PortletFacesContext
Returns the current facesContext.

Specified by:
getFacesContext in class PortletFacesContext

getELContext

public javax.el.ELContext getELContext()
Overrides:
getELContext in class javax.faces.context.FacesContext

getLocale

public Locale getLocale()
Specified by:
getLocale in class org.edorasframework.extfaces.context.ExtFacesContext

getMaximumSeverity

public javax.faces.application.FacesMessage.Severity getMaximumSeverity()
Specified by:
getMaximumSeverity in class javax.faces.context.FacesContext

getMessage

public String getMessage(String messageId)
Specified by:
getMessage in class org.edorasframework.extfaces.context.ExtFacesContext

getMessage

public String getMessage(String messageId,
                         Object... arguments)
Specified by:
getMessage in class org.edorasframework.extfaces.context.ExtFacesContext

getMessage

public String getMessage(Locale locale,
                         String messageId)
Specified by:
getMessage in class org.edorasframework.extfaces.context.ExtFacesContext

getMessage

public String getMessage(Locale locale,
                         String messageId,
                         Object... arguments)
Specified by:
getMessage in class org.edorasframework.extfaces.context.ExtFacesContext

getMessages

public Iterator<javax.faces.application.FacesMessage> getMessages()
Specified by:
getMessages in class javax.faces.context.FacesContext

getMessages

public Iterator<javax.faces.application.FacesMessage> getMessages(String clientId)
Specified by:
getMessages in class javax.faces.context.FacesContext

getParentForm

public javax.faces.component.UIForm getParentForm(javax.faces.component.UIComponent uiComponent)
Specified by:
getParentForm in class org.edorasframework.extfaces.context.ExtFacesContext

getPortalContext

public javax.portlet.PortalContext getPortalContext()
Description copied from class: PortletFacesContext
Retrieves the javax.portlet.PortalContext object associated with the current JSF FacesContext.

Specified by:
getPortalContext in class PortletFacesContext

getPortletConfig

public javax.portlet.PortletConfig getPortletConfig()
Description copied from class: PortletFacesContext
Retrieves the javax.portlet.PortletConfig object associated with the current JSF FacesContext.

Specified by:
getPortletConfig in class PortletFacesContext

getPortletContext

public javax.portlet.PortletContext getPortletContext()
Description copied from class: PortletFacesContext
Retrieves the javax.portlet.PortletContext object associated with the current JSF FacesContext.

Specified by:
getPortletContext in class PortletFacesContext

getPortletContextName

public String getPortletContextName()
Description copied from class: PortletFacesContext
Retrieves the name of the portlet associated with the current JSF FacesContext (usually, its the name of the portlet .war)

Specified by:
getPortletContextName in class PortletFacesContext

setPortletMode

public void setPortletMode(javax.portlet.PortletMode portletMode)
Description copied from class: PortletFacesContext
Sets the portlet mode of the portlet associated with the current JSF FacesContext to the specified portlet mode.

Specified by:
setPortletMode in class PortletFacesContext

getPortletName

public String getPortletName()
Description copied from class: PortletFacesContext
Retrieves the name of the portlet associated with the current JSF FacesContext (as defined in portlet.xml's <portlet-name> tag).

Specified by:
getPortletName in class PortletFacesContext

getPortletNamespace

public String getPortletNamespace()
Description copied from class: PortletFacesContext
Returns a namespace prefix to be used for the portlet associated with the current JSF FacesContext instance. The namespace can be prefixed or suffixed to any control Id or Javascript variable to insure it is unique for the portlet instance on the page.

Specified by:
getPortletNamespace in class PortletFacesContext

getPortletPreference

public Object getPortletPreference(String preferenceName,
                                   Object defaultValue)
Description copied from class: PortletFacesContext
Returns String representation of the value of the portlet preference associated with the specified name in from the javax.portlet.PortletPreferences object associated with the current JSF FacesContext.

Specified by:
getPortletPreference in class PortletFacesContext

getPortletPreferenceAsBool

public boolean getPortletPreferenceAsBool(String preferenceName,
                                          boolean defaultValue)
Description copied from class: PortletFacesContext
Returns boolean representation of the value of the portlet preference associated with the specified name in from the PortletPreferenceMap object associated with the current JSF FacesContext.

Specified by:
getPortletPreferenceAsBool in class PortletFacesContext

getPortletPreferenceAsInt

public int getPortletPreferenceAsInt(String preferenceName,
                                     int defaultValue)
Description copied from class: PortletFacesContext
Returns integer representation of the value of the portlet preference associated with the specified name in from the PortletPreferenceMap object associated with the current JSF FacesContext.

Specified by:
getPortletPreferenceAsInt in class PortletFacesContext

getPortletPreferenceAsShort

public short getPortletPreferenceAsShort(String preferenceName,
                                         short defaultValue)
Description copied from class: PortletFacesContext
Returns short representation of the value of the portlet preference associated with the specified name in from the PortletPreferenceMap object associated with the current JSF FacesContext.

Specified by:
getPortletPreferenceAsShort in class PortletFacesContext

getPortletPreferenceAsString

public String getPortletPreferenceAsString(String preferenceName,
                                           String defaultValue)
Description copied from class: PortletFacesContext
Returns short representation of the value of the portlet preference associated with the specified name in from the PortletPreferenceMap object associated with the current JSF FacesContext.

Specified by:
getPortletPreferenceAsString in class PortletFacesContext

getPortletPreferenceMap

public PortletPreferenceMap getPortletPreferenceMap()
Description copied from class: PortletFacesContext
Returns the PortletPreferenceMap associated with the current JSF FacesContext.

Specified by:
getPortletPreferenceMap in class PortletFacesContext

getPortletPreferences

public javax.portlet.PortletPreferences getPortletPreferences()
Description copied from class: PortletFacesContext
Retrieves the javax.portlet.PortletPreferences object associated with the current JSF FacesContext.

Specified by:
getPortletPreferences in class PortletFacesContext

getPortletRenderRequest

public javax.portlet.RenderRequest getPortletRenderRequest()
Description copied from class: PortletFacesContext
Retrieves the javax.portlet.RenderRequest object associated with the current JSF FacesContext.

Specified by:
getPortletRenderRequest in class PortletFacesContext

getPortletRenderResponse

public javax.portlet.RenderResponse getPortletRenderResponse()
Description copied from class: PortletFacesContext
Retrieves the javax.portlet.RenderResponse object associated with the current JSF FacesContext.

Specified by:
getPortletRenderResponse in class PortletFacesContext

getPortletRequest

public javax.portlet.PortletRequest getPortletRequest()
Description copied from class: PortletFacesContext
Retrieves the javax.portlet.PortletRequest object associated with the current JSF FacesContext.

Specified by:
getPortletRequest in class PortletFacesContext

getPortletResponse

public javax.portlet.PortletResponse getPortletResponse()
Description copied from class: PortletFacesContext
Retrieves the javax.portlet.PortletResponse object associated with the current JSF FacesContext.

Specified by:
getPortletResponse in class PortletFacesContext

getPortletSession

public javax.portlet.PortletSession getPortletSession()
Description copied from class: PortletFacesContext
Retrieves the javax.portlet.PortletSession object associated with the current JSF FacesContext.

Specified by:
getPortletSession in class PortletFacesContext

getRemoteUser

public String getRemoteUser()
Description copied from class: PortletFacesContext
Returns the user name/id of the user associated with the current JSF FacesContext

Specified by:
getRemoteUser in class PortletFacesContext

getRenderKit

public javax.faces.render.RenderKit getRenderKit()
Specified by:
getRenderKit in class javax.faces.context.FacesContext

getRenderResponse

public boolean getRenderResponse()
Specified by:
getRenderResponse in class javax.faces.context.FacesContext

getRequestAttribute

public Object getRequestAttribute(String name)
Specified by:
getRequestAttribute in class org.edorasframework.extfaces.context.ExtFacesContext

setRequestAttribute

public void setRequestAttribute(String name,
                                Object value)
Specified by:
setRequestAttribute in class org.edorasframework.extfaces.context.ExtFacesContext

getRequestContextPath

public String getRequestContextPath()
Specified by:
getRequestContextPath in class org.edorasframework.extfaces.context.ExtFacesContext

getRequestParameter

public String getRequestParameter(String name)
Specified by:
getRequestParameter in class org.edorasframework.extfaces.context.ExtFacesContext

getRequestParameterAsBool

public boolean getRequestParameterAsBool(String name,
                                         boolean defaultValue)
Specified by:
getRequestParameterAsBool in class org.edorasframework.extfaces.context.ExtFacesContext

getRequestParameterAsInt

public int getRequestParameterAsInt(String name,
                                    int defaultValue)
Specified by:
getRequestParameterAsInt in class org.edorasframework.extfaces.context.ExtFacesContext

getRequestParameterAsLong

public long getRequestParameterAsLong(String name,
                                      long defaultValue)
Specified by:
getRequestParameterAsLong in class org.edorasframework.extfaces.context.ExtFacesContext

getRequestParameterFromMap

public String getRequestParameterFromMap(String name)
Specified by:
getRequestParameterFromMap in class org.edorasframework.extfaces.context.ExtFacesContext

getRequestQueryString

public String getRequestQueryString()
Specified by:
getRequestQueryString in class org.edorasframework.extfaces.context.ExtFacesContext

getRequestQueryStringParameter

public String getRequestQueryStringParameter(String name)
Specified by:
getRequestQueryStringParameter in class org.edorasframework.extfaces.context.ExtFacesContext

getResponseComplete

public boolean getResponseComplete()
Specified by:
getResponseComplete in class javax.faces.context.FacesContext

getResponseStream

public javax.faces.context.ResponseStream getResponseStream()
Specified by:
getResponseStream in class javax.faces.context.FacesContext

setResponseStream

public void setResponseStream(javax.faces.context.ResponseStream responseStream)
Specified by:
setResponseStream in class javax.faces.context.FacesContext

getResponseWriter

public javax.faces.context.ResponseWriter getResponseWriter()
Specified by:
getResponseWriter in class javax.faces.context.FacesContext

setResponseWriter

public void setResponseWriter(javax.faces.context.ResponseWriter responseWriter)
Specified by:
setResponseWriter in class javax.faces.context.FacesContext

getSessionSharedAttribute

public Object getSessionSharedAttribute(String name)
Description copied from class: PortletFacesContext
Returns the value of the session attribute associated with the specified name from PortletSession.APPLICATION_SCOPE

Specified by:
getSessionSharedAttribute in class PortletFacesContext

setSessionSharedAttribute

public void setSessionSharedAttribute(String name,
                                      Object value)
Description copied from class: PortletFacesContext
Sets the value of the a session attribute using the specified name and value within PortletSession.APPLICATION_SCOPE

Specified by:
setSessionSharedAttribute in class PortletFacesContext

getSession

public Object getSession(boolean create)
Specified by:
getSession in class org.edorasframework.extfaces.context.ExtFacesContext

getSessionAttribute

public Object getSessionAttribute(String name)
Specified by:
getSessionAttribute in class org.edorasframework.extfaces.context.ExtFacesContext

resolveExpression

public Object resolveExpression(String elExpression)
Specified by:
resolveExpression in class org.edorasframework.extfaces.context.ExtFacesContext

setSessionAttribute

public void setSessionAttribute(String name,
                                Object value)
Specified by:
setSessionAttribute in class org.edorasframework.extfaces.context.ExtFacesContext

getUploadedFilesMap

public Map<String,File> getUploadedFilesMap()
Specified by:
getUploadedFilesMap in class org.edorasframework.extfaces.context.ExtFacesContext

isUserInRole

public boolean isUserInRole(String roleName)
Description copied from class: PortletFacesContext
Returns TRUE if the current user is associated with the specified role.

Specified by:
isUserInRole in class PortletFacesContext

getViewRoot

public javax.faces.component.UIViewRoot getViewRoot()
Specified by:
getViewRoot in class javax.faces.context.FacesContext

setViewRoot

public void setViewRoot(javax.faces.component.UIViewRoot viewRoot)
Specified by:
setViewRoot in class javax.faces.context.FacesContext

isWindowMaximized

public boolean isWindowMaximized()
Description copied from class: PortletFacesContext
Returns TRUE if the Window state of the current portlet is set to MAXIMIZED

Specified by:
isWindowMaximized in class PortletFacesContext

isWindowNormal

public boolean isWindowNormal()
Description copied from class: PortletFacesContext
Returns TRUE if the Window state of the current portlet is set to MAXIMIZED

Specified by:
isWindowNormal in class PortletFacesContext

getWindowState

public javax.portlet.WindowState getWindowState()
Description copied from class: PortletFacesContext
Returns the window state of the portlet associated with the current JSF FacesContext

Specified by:
getWindowState in class PortletFacesContext

setWindowState

public void setWindowState(javax.portlet.WindowState windowState)
Description copied from class: PortletFacesContext
Sets the window state of the portlet associated with the current JSF FacesContext to the specified window state.

Specified by:
setWindowState in class PortletFacesContext

setWindowStateToMaximized

public void setWindowStateToMaximized()
Description copied from class: PortletFacesContext
A short-cut method for calling setWindowState(WindowState.MAXIMIZED)

Specified by:
setWindowStateToMaximized in class PortletFacesContext

setWindowStateToNormal

public void setWindowStateToNormal()
Description copied from class: PortletFacesContext
A short-cut method for calling setWindowState(WindowState.NORMAL)

Specified by:
setWindowStateToNormal in class PortletFacesContext

checkUserPortletPermission

public void checkUserPortletPermission(String actionId)
                                throws AuthorizationException
Description copied from class: PortletFacesContext
Checks to see if the current user has permission to execute the specified actionId (which, in turn, is assumed to be an action defined for the current portlet). If the authorization fails, a PrincipalException is thrown. Any other errors that occur will be caught and re-thrown, wrapped in a PortletRuntimeException.

Specified by:
checkUserPortletPermission in class PortletFacesContext
Throws:
AuthorizationException
See Also:
PortletFacesContext.userHasPortletPermission(String)

createPopupUrl

public javax.portlet.PortletURL createPopupUrl(String viewId)
Description copied from class: PortletFacesContext
Creates a URL capable of displaying a specified view Id in "Popup" mode.

Specified by:
createPopupUrl in class PortletFacesContext

userHasPortletPermission

public boolean userHasPortletPermission(String actionId)
Description copied from class: PortletFacesContext
Returns TRUE if the current user has permission to execute the specified actionId (which, in turn, is assumed to be an action defined for the current portlet). Any errors that occur will be caught and re-thrown, wrapped in a PortletRuntimeException.

Specified by:
userHasPortletPermission in class PortletFacesContext
See Also:
PortletFacesContext.checkUserPortletPermission(String)

userHasRole

public boolean userHasRole(String roleName)
Description copied from class: PortletFacesContext
Returns TRUE if the current user has the specified role name.

Specified by:
userHasRole in class PortletFacesContext

getCompanyId

public long getCompanyId()
Description copied from class: PortletFacesContext
Returns the company Id associated with the community that is hosting the portlet associated with the current JSF FacesContext.

Specified by:
getCompanyId in class PortletFacesContext

getGroupUser

public com.liferay.portal.model.User getGroupUser()
Description copied from class: PortletFacesContext
Returns the user associated with the group (Liferay community) associated with the layout (portal page) that the portlet resides on.

Specified by:
getGroupUser in class PortletFacesContext

getHostGroupId

public long getHostGroupId()
Description copied from class: PortletFacesContext
Returns the "group Id" associated with the community that is hosting the portlet associated with the current JSF FacesContext.

Specified by:
getHostGroupId in class PortletFacesContext

getLayout

public com.liferay.portal.model.Layout getLayout()
Description copied from class: PortletFacesContext
Returns the layout being displayed in the current context.

Specified by:
getLayout in class PortletFacesContext

postLifecycleCleanup

public void postLifecycleCleanup()
Description copied from class: PortletFacesContext
Performs cleanup operations that are intended to be performed after the JSF lifecycle executes. Meant to be called in the afterPhase method of a JSF phase listener once the RENDER_RESPONSE phase is complete.

Specified by:
postLifecycleCleanup in class PortletFacesContext

getLiferayManagedBean

protected Liferay getLiferayManagedBean()

getLiferayServiceMap

public org.edorasframework.liferayadapter.ServiceMap getLiferayServiceMap()
Description copied from class: PortletFacesContext
Returns a Map of Liferay Services.

Specified by:
getLiferayServiceMap in class PortletFacesContext

getPermissionChecker

public org.edorasframework.liferayadapter.PermissionCheckerWrapper getPermissionChecker()
Description copied from class: PortletFacesContext
Returns the Liferay PermissionChecker associated with the request.

Specified by:
getPermissionChecker in class PortletFacesContext

getPlid

public long getPlid()
Description copied from class: PortletFacesContext
Returns the "Plid" (the "portal layout id"), which is the identifier of the specific "page" the portlet exists on. Plid is the primary key of the "Layout" table.

Specified by:
getPlid in class PortletFacesContext

getPortlet

public com.liferay.portal.model.Portlet getPortlet()
Description copied from class: PortletFacesContext
Returns the com.liferay.portal.model.Portlet object for the portlet associated with the current request.

Specified by:
getPortlet in class PortletFacesContext

getPortletInstanceId

public String getPortletInstanceId()
Description copied from class: PortletFacesContext
Returns the "portlet instance Id" of the currently running portlet. This id is an internal identifier used by the Liferay API. Note that the Liferay API for getPorletId() is not exposed as getPortletId() in the PortletFaces API -- instead it is exposed as getPortletInstanceId(). This is because the Liferay API getPortletId() actually returns the "instance id" of the portlet, whereas most of the time developers really want the "root id" instead.

Specified by:
getPortletInstanceId in class PortletFacesContext
See Also:
PortletFacesContext.getPortletName()

getPortletRootId

public String getPortletRootId()
Description copied from class: PortletFacesContext
Returns the "portlet root Id" of the currently running portlet. This id is an internal identifier used by the Liferay API. Note that the Liferay API for getPorletId() is not exposed as getPortletId() in the PortletFaces API -- instead it is exposed as getPortletInstanceId(). This is because the Liferay API getPortletId() actually returns the "instance id" of the portlet, whereas most of the time developers really want the "root id" instead.

Specified by:
getPortletRootId in class PortletFacesContext
See Also:
PortletFacesContext.getPortletName()

getTheme

public com.liferay.portal.model.Theme getTheme()
Description copied from class: PortletFacesContext
Returns the theme being displayed in the current context.

Specified by:
getTheme in class PortletFacesContext

getThemeDisplay

public org.edorasframework.liferayadapter.ThemeDisplayClone getThemeDisplay()
Description copied from class: PortletFacesContext
Returns the com.liferay.portal.theme.ThemeDisplay object, which contains a variety methods for rendering theme specific look and feels.

Specified by:
getThemeDisplay in class PortletFacesContext

getUser

public com.liferay.portal.model.User getUser()
Description copied from class: PortletFacesContext
Returns the user record of the user associated with the current JSF FacesContext.

Specified by:
getUser in class PortletFacesContext

getUserId

public long getUserId()
Description copied from class: PortletFacesContext
Returns the user Id of the user associated with the current JSF FacesContext

Specified by:
getUserId in class PortletFacesContext

getUserRoles

public List<com.liferay.portal.model.Role> getUserRoles()
Description copied from class: PortletFacesContext
Returns a list of all of the roles played by the user associated with the current JSF FacesContext.

Specified by:
getUserRoles in class PortletFacesContext

getDocumentLibraryURL

public String getDocumentLibraryURL()
Description copied from class: PortletFacesContext
Returns an absolute URL to the Liferay document library, which is the main part of different struts action paths.

Specified by:
getDocumentLibraryURL in class PortletFacesContext

getImageGalleryURL

public String getImageGalleryURL()
Description copied from class: PortletFacesContext
Returns an absolute URL to the Liferay image gallery, which is the main part of different struts action paths.

Specified by:
getImageGalleryURL in class PortletFacesContext

getPortalURL

public String getPortalURL()
Description copied from class: PortletFacesContext
Returns an absolute URL which is the context-path of the portal webapp.

Specified by:
getPortalURL in class PortletFacesContext

getThemeImagesURL

public String getThemeImagesURL()
Description copied from class: PortletFacesContext
Returns an absolute URL which is the path to the images of the theme associated with the current Layout.

Specified by:
getThemeImagesURL in class PortletFacesContext

getServiceContext

public org.edorasframework.liferayadapter.ServiceContext getServiceContext(String className)
Description copied from class: PortletFacesContext
Returns an instance of a ServiceContext associated with the specified className.

Specified by:
getServiceContext in class PortletFacesContext

getMessage

public String getMessage(long companyId,
                         Locale locale,
                         String messageId)
Description copied from class: PortletFacesContext
Returns the message associated with the specified messageId by delegating to the FacesMessageFactory, according to the specified Liferay companyId and specified locale.

Specified by:
getMessage in class PortletFacesContext

getMessage

public String getMessage(long companyId,
                         Locale locale,
                         String messageId,
                         Object... arguments)
Description copied from class: PortletFacesContext
Returns the message associated with the specified messageId by delegating to the FacesMessageFactory, according to the specified Liferay companyId, and specified locale and arguments that are to be substituted.

Specified by:
getMessage in class PortletFacesContext


Copyright 2009, http://www.edorasframework.org