Package org.exoplatform.web.url
Class PortalURL<R,U extends PortalURL<R,U>>
java.lang.Object
org.exoplatform.web.url.PortalURL<R,U>
An URL for a resource managed by the portal.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal BooleangetAjax()Returns the ajax mode.booleanReturns the current authority use.final StringReturns the confirm message.final MimeTypeReturns 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 beMimeType.XHTML).abstract Set<QualifiedName> Returns the set of parameter names provided this url.abstract StringgetParameterValue(QualifiedName parameterName) Returns a specified parameter value or null when it is not available.Returns the query parameters.getQueryParameterValue(String parameterName) Returns a query parameter value or null if it does not exist.final String[]getQueryParameterValues(String parameterName) Returns a query parameter value or null if it does not exist.abstract RReturns the current resource associated with this URL.booleanReturns the current scheme use.booleanvoidreset()Reset the Portal URL statefinal UUpdate the ajax mode.voidsetAuthorityUse(boolean authorityUse) Control the authority generation (the server name appended with the port when its value is different than 80) of the URL.final UsetConfirm(String confirm) Updates the confirm message.voidsetCSRFCheck(boolean csrfCheck) voidvoidsetMimeType(MimeType mimeType) Set the mime type on this URL.final voidsetQueryParameterValue(String parameterName, String parameterValue) Update the parameter value when the parameterValue argument is not null or remove it when the parameterValue argument is null.final voidsetQueryParameterValues(String parameterName, String[] parameterValues) Update the parameter value when the parameterValues argument is not null or remove it when the parameterValues argument is null.abstract UsetResource(R resource) Set a new resource on this URL.voidsetSchemeUse(boolean schemeUse) Control the scheme generation (httporhttpsaccording to the request) of the URL.final StringtoString()Generates the URL value.
-
Field Details
-
ajax
. -
confirm
. -
queryParams
protected org.gatein.common.util.ParameterMap queryParams. -
mimeType
.
-
-
Constructor Details
-
PortalURL
Create a portal URL instance.- Parameters:
context- the url context- Throws:
NullPointerException- if the context is null
-
-
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 (httporhttpsaccording 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
Returns the ajax mode.- Returns:
- the ajax mode
-
setAjax
Update the ajax mode.- Parameters:
ajax- the new ajax mode- Returns:
- this object
-
getConfirm
Returns the confirm message.- Returns:
- the confirm message
-
setConfirm
Updates the confirm message.- Parameters:
confirm- the new confirm message- Returns:
- this object
-
getResource
Returns the current resource associated with this URL.- Returns:
- the resource
-
setResource
Set a new resource on this URL.- Parameters:
resource- the new resource- Returns:
- this object
-
getParameterNames
Returns the set of parameter names provided this url.- Returns:
- the parameter names
-
getParameterValue
Returns a specified parameter value or null when it is not available.- Parameters:
parameterName- the parameter name- Returns:
- the parameter value
-
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 beMimeType.XHTML).- Returns:
- the current mime type
-
setMimeType
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
-
setLocale
-
isCSRFCheck
public boolean isCSRFCheck() -
setCSRFCheck
public void setCSRFCheck(boolean csrfCheck) -
reset
public void reset()Reset the Portal URL state -
getQueryParameters
Returns the query parameters. Null can be returned.- Returns:
- the query parameters
-
getQueryParameterValue
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 nameparameterValue- the parameter value- Throws:
NullPointerException- if the parameter value is null
-
getQueryParameterValues
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 nameparameterValues- the parameter value- Throws:
NullPointerException- if the parameter value is null
-
getContext
-
toString
Generates the URL value.
-