Class PortalURL<R,U extends PortalURL<R,U>>

java.lang.Object
org.exoplatform.web.url.PortalURL<R,U>
Direct Known Subclasses:
NodeURL, SimpleURL

public abstract class PortalURL<R,U extends PortalURL<R,U>> extends Object
An URL for a resource managed by the portal.
Version:
$Revision$
Author:
Julien Viet
  • Field Details

    • ajax

      protected Boolean ajax
      .
    • confirm

      protected String confirm
      .
    • queryParams

      protected org.gatein.common.util.ParameterMap queryParams
      .
    • mimeType

      protected MimeType mimeType
      .
  • Constructor Details

  • Method Details

    • getSchemeUse

      public boolean getSchemeUse()
      Returns the current scheme use.
      Returns:
      the scheme use
    • setSchemeUse

      public void setSchemeUse(boolean schemeUse)
      Control the scheme generation (http or https according to the request) of the URL. If the scheme is enabled, the authority property will be set to true.
      Parameters:
      schemeUse - the scheme use value
    • getAuthorityUse

      public boolean getAuthorityUse()
      Returns the current authority use.
      Returns:
      the authority use
    • setAuthorityUse

      public void setAuthorityUse(boolean authorityUse)
      Control the authority generation (the server name appended with the port when its value is different than 80) of the URL. If the authority is disabled, the scheme property will be set to false.
      Parameters:
      authorityUse - the authority use value
    • getAjax

      public final Boolean getAjax()
      Returns the ajax mode.
      Returns:
      the ajax mode
    • setAjax

      public final U setAjax(Boolean ajax)
      Update the ajax mode.
      Parameters:
      ajax - the new ajax mode
      Returns:
      this object
    • getConfirm

      public final String getConfirm()
      Returns the confirm message.
      Returns:
      the confirm message
    • setConfirm

      public final U setConfirm(String confirm)
      Updates the confirm message.
      Parameters:
      confirm - the new confirm message
      Returns:
      this object
    • getResource

      public abstract R getResource()
      Returns the current resource associated with this URL.
      Returns:
      the resource
    • setResource

      public abstract U setResource(R resource)
      Set a new resource on this URL.
      Parameters:
      resource - the new resource
      Returns:
      this object
    • getParameterNames

      public abstract Set<QualifiedName> getParameterNames()
      Returns the set of parameter names provided this url.
      Returns:
      the parameter names
    • getParameterValue

      public abstract String getParameterValue(QualifiedName parameterName)
      Returns a specified parameter value or null when it is not available.
      Parameters:
      parameterName - the parameter name
      Returns:
      the parameter value
    • getMimeType

      public final MimeType getMimeType()
      Returns the current mime type that this URL will be generated for, or null if none is set (which means there is no guarantees about the mime type that will be used as target but it's likely to be MimeType.XHTML ).
      Returns:
      the current mime type
    • setMimeType

      public void setMimeType(MimeType mimeType)
      Set the mime type on this URL. The mime type will be used when URL is generated to encode the URL for the specified mime type.
      Parameters:
      mimeType - the new mime type
    • getLocale

      public Locale getLocale()
    • setLocale

      public void setLocale(Locale locale)
    • isCSRFCheck

      public boolean isCSRFCheck()
    • setCSRFCheck

      public void setCSRFCheck(boolean csrfCheck)
    • reset

      public void reset()
      Reset the Portal URL state
    • getQueryParameters

      public Map<String,String[]> getQueryParameters()
      Returns the query parameters. Null can be returned.
      Returns:
      the query parameters
    • getQueryParameterValue

      public String getQueryParameterValue(String parameterName) throws NullPointerException
      Returns a query parameter value or null if it does not exist.
      Parameters:
      parameterName - the parameter name
      Returns:
      the parameter value
      Throws:
      NullPointerException - if the parameter name is null
    • setQueryParameterValue

      public final void setQueryParameterValue(String parameterName, String parameterValue) throws NullPointerException
      Update the parameter value when the parameterValue argument is not null or remove it when the parameterValue argument is null.
      Parameters:
      parameterName - the parameter name
      parameterValue - the parameter value
      Throws:
      NullPointerException - if the parameter value is null
    • getQueryParameterValues

      public final String[] getQueryParameterValues(String parameterName) throws NullPointerException
      Returns a query parameter value or null if it does not exist.
      Parameters:
      parameterName - the parameter name
      Returns:
      the parameter value
      Throws:
      NullPointerException - if the parameter name is null
    • setQueryParameterValues

      public final void setQueryParameterValues(String parameterName, String[] parameterValues) throws NullPointerException
      Update the parameter value when the parameterValues argument is not null or remove it when the parameterValues argument is null.
      Parameters:
      parameterName - the parameter name
      parameterValues - the parameter value
      Throws:
      NullPointerException - if the parameter value is null
    • getContext

      public URLContext getContext()
    • toString

      public final String toString()
      Generates the URL value.
      Overrides:
      toString in class Object
      Returns:
      the URL value