Class UIPortlet


public class UIPortlet extends UIApplication
This UI component represent a portlet window on a page.
Each user request to a portlet will be passed through this class then delegate call to the portlet container
UIPortletLifecycle do the main request router: delegate the job to portlet action listeners according to the url parameters
ProcessAction, ServeResource, Render action listeners will receive event if request url contain parameter point to them, those event will delegate call to portlet container to call JSR 286 portlet lifecycle method
ProcessEvents, ChangePortletMode, ChangeWindowState listener will receive event after the portlet action invocation response. (dispatched during the process of ProcessActionListener)
DeleteComponent, EditPortlet action listener is portal specific listener, come from the UI of portal
See Also:
  • Field Details

  • Constructor Details

    • UIPortlet

      public UIPortlet()
  • Method Details

    • getId

      public String getId()
      Overrides:
      getId in class UIComponent
    • getStorageName

      public String getStorageName()
    • getWindowId

      public String getWindowId()
    • getSkinId

      public String getSkinId()
      Retrieves the skin identifier associated with this portlet or null if there isn't one (for example, it doesn't make any sense in the WSRP scenario).
      Returns:
      the skin identifier associated with this portlet or null if there isn't one
    • getShowPortletMode

      public boolean getShowPortletMode()
      Returns:
      true if portlet is configured to show control icon that allow to change portlet mode
    • getTheme

      public String getTheme()
      Theme is composed of map between theme name and skin name. Theme format: {skinName}:{themeName}::{anotherSkin}:{anotherTheme}. For example: the default them is 'Default:DefaultTheme::Vista:VistaTheme::Mac:MacTheme'. Default theme means if portal skin is 'Default', this portlet's theme is 'DefaultTheme. If portal change skin to 'Vista', portlet theme will be change to 'VistaTheme'.
      Returns:
      current theme setting
    • getCurrentPortletMode

      public javax.portlet.PortletMode getCurrentPortletMode()
    • setCurrentPortletMode

      public void setCurrentPortletMode(javax.portlet.PortletMode mode)
    • getCurrentWindowState

      public javax.portlet.WindowState getCurrentWindowState()
    • setCurrentWindowState

      public void setCurrentWindowState(javax.portlet.WindowState state)
    • getDisplayName

      public String getDisplayName()
      Get localized displayName metadata configured in portlet.xml.
      If can't find localized displayName, return portlet name.
      If portlet doesn't exists anymore, return empty string.
      This value is cached in session, that means it only query to portlet container one time
      Returns:
      display name
    • getSupportModes

      public List<String> getSupportModes()
    • getPublicRenderParamNames

      public List<String> getPublicRenderParamNames()
      This methods return the public render parameters names supported by the targeted portlet; in other words, it sorts the full public render params list and only return the ones that the current portlet can handle
    • getPublicParameters

      public Map<String,String[]> getPublicParameters(Map<String,String[]> portletParameters)
    • getPublicParameters

      public Map<String,String[]> getPublicParameters()
    • create

      public <I extends org.gatein.pc.api.invocation.PortletInvocation> I create(Class<I> type, PortalRequestContext prc) throws Exception
      Create the correct portlet invocation that will target the portlet represented by this UI component.
      Type Parameters:
      I - the invocation type
      Parameters:
      type - the invocation type
      prc - the portal request context
      Returns:
      the portlet invocation
      Throws:
      Exception - any exception
    • update

      public void update(org.gatein.pc.api.state.PropertyChange... changes) throws Exception
      Throws:
      Exception
    • getState

      public PortletState getState()
    • setState

      public void setState(PortletState state)
    • getPreferences

      public org.exoplatform.portal.pom.spi.portlet.Portlet getPreferences() throws Exception
      Returns the state of the portlet as a set of preferences.
      Returns:
      the preferences of the portlet
      Throws:
      Exception - any exception
    • getPortletContext

      public org.gatein.pc.api.StatefulPortletContext<org.exoplatform.portal.pc.ExoPortletState> getPortletContext() throws Exception
      Returns the portlet context of the portlet.
      Returns:
      the portlet context
      Throws:
      Exception - any exception
    • update

      public void update(org.exoplatform.portal.pc.ExoPortletState updateState) throws Exception
      Update the state of the portlet.
      Parameters:
      updateState - the state update
      Throws:
      Exception - any exception
    • getModifiedState

      public org.exoplatform.portal.pc.ExoPortletState getModifiedState(org.gatein.pc.api.PortletContext modifiedContext) throws Exception
      Return modifed portlet stated (after portlet action invovation)
      Parameters:
      modifiedContext -
      Throws:
      Exception
    • getClonedState

      public org.exoplatform.portal.pc.ExoPortletState getClonedState(org.gatein.pc.api.PortletContext clonedContext) throws Exception
      Return cloned portlet state (updated after portlet action invocation). This method is used in case WSRP
      Parameters:
      clonedContext -
      Throws:
      Exception
    • getCurrentUIPortlet

      public static UIPortlet getCurrentUIPortlet()
    • invoke

      public org.gatein.pc.api.invocation.response.PortletInvocationResponse invoke(org.gatein.pc.api.invocation.PortletInvocation invocation) throws org.gatein.pc.api.PortletInvokerException
      Performs an invocation on this portlet.
      Parameters:
      invocation - the portlet invocation
      Returns:
      the portlet invocation response
      Throws:
      org.gatein.pc.api.PortletInvokerException - any invoker exception
    • generateRenderMarkup

      public org.exoplatform.commons.utils.Text generateRenderMarkup(org.gatein.pc.api.invocation.response.PortletInvocationResponse pir, WebuiRequestContext context)
      Parsing response from portlet container. The response contains:
      html markup, portlet title, response properties:
      - JS resource dependency (defined in gatein-resources.xml)
      - html header
      - cookie
      - extra markup header
      If errors occur during portlet lifecycle processing. PortletExceptionHandleService is called. Add plugins to this service to customize portlet error handler
      Parameters:
      pir - - response object from portlet container
      context - - request context
      Returns:
      markup to render on browser
      See Also:
      • PortletExceptionHandleService
    • supportsPublicParam

      public String supportsPublicParam(QName supportedPublicParam)
      Tells, according to the info located in portlet.xml, wether this portlet supports the public render parameter qname given as method argument. If the qname is supported, the public render parameter id is returned otherwise false is returned.
      Parameters:
      supportedPublicParam - the supported public parameter qname
      Returns:
      the supported public parameter id
    • supportsPublicParam

      public boolean supportsPublicParam(String supportedPublicParam)
      Tells, according to the info located in portlet.xml, wether this portlet supports the public render parameter given as a method argument
    • supportsProcessingEvent

      public boolean supportsProcessingEvent(QName name)
      Tells, according to the info located in portlet.xml, wether this portlet can handle a portlet event with the QName given as the method argument
    • supportsPublishingEvent

      public boolean supportsPublishingEvent(QName name)
    • getSupportedPublicParams

      public Map<QName,String> getSupportedPublicParams()
    • getSupportedProcessingEvents

      public List<QName> getSupportedProcessingEvents()
    • getSupportedPublishingEvents

      public List<QName> getSupportedPublishingEvents()
    • getDisplayTitle

      public String getDisplayTitle()
      Returns the title showed on the InfoBar. The title is computed in following manner.
      1. First, the method getTitle(), inherited from UIPortalComponent is called. The getTitle() returns what users set in the PortletSetting tab, the current method returns call result if it is not null.
      2. configuredTitle, which is the localized value of javax.portlet.title is returned if it is not null.
      3. If the method does not terminate at neither (1) nor (2), the configured display name is returned.
      Returns: