Package lumis.portal.page
Class PageWebResourceWithExtraParametersWrapper
- java.lang.Object
-
- lumis.portal.url.WebResource
-
- lumis.portal.page.PageWebResource
-
- lumis.portal.page.PageWebResourceWithExtraParametersWrapper
-
- All Implemented Interfaces:
java.lang.Cloneable
,ICacheEntry
,ICloneableCacheEntry
public class PageWebResourceWithExtraParametersWrapper extends PageWebResource
PageWebResource
wrapper to allow adding extra parameters in parameter map.- Since:
- 15.0.0
- Version:
- $Revision$ $Date$
-
-
Constructor Summary
Constructors Constructor Description PageWebResourceWithExtraParametersWrapper(PageWebResource pwr, java.util.Map<java.lang.String,java.lang.String[]> extraParameters)
Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.String
calculatePath()
Returns the path to access this web resource.PageWebResource
clone()
boolean
equals(java.lang.Object obj)
java.net.URL
getCanonicalUrl()
Returns the canonical URL for this web resource.java.util.Date
getCreatedDateTime()
Returns the date-time this web resource was created.java.lang.String
getDynamicPath()
Returns the dynamic path to access this web resource.java.lang.String
getFriendlyPath()
Returns the friendly path to access this web resource.java.lang.String
getFriendlyURLPattern()
Returns the pattern to be used to resolve friendly URL for this web resource.java.lang.String
getId()
Returns the unique identifier for this web resource.java.util.Locale
getLocale()
Returns the locale for this web resource.java.lang.String
getName()
Returns the name for this web resource.PageConfig
getPage()
Returns the page this web resource is based on.PageCacheConfig
getPageCache()
Returns the cache definition for this web resource.PageWebResourceData
getPageWebResourceData()
Returns the data generated in runtime for this page web resource.java.lang.String
getParameter(java.lang.String parameterName)
Returns the value of a parameter for this web resource.java.util.Map<java.lang.String,java.lang.String[]>
getParameterMap()
Returns a map containing all parameters for this web resource.java.lang.String[]
getParameterValues(java.lang.String parameterName)
Returns the values of a parameter for this web resource.WebResource
getParent()
Returns the web resource of the parent element of this web resource.javax.portlet.PortletMode
getPortletMode()
Returns the portlet mode for the target in this page web resource.IProject
getProject()
Returns the project this web resource belongs to (if any).
It is important to notice that the relation webresource <-> project is not persisted.java.util.Map<java.lang.String,java.util.List<java.lang.String>>
getProperties()
Returns the properties for this web resource.protected java.lang.String
getRecommendedFileExtension()
Returns the file extension recommended for this web resource, according to its configurations.java.lang.String
getRunTimeServiceInstanceId()
Returns the service instance identifier of the runtime service instance for this page web resource.java.lang.String
getRunTimeServiceInterfaceId()
Returns the service interface identifier of the runtime service interface for this page web resource.protected java.lang.String
getSeoRuleUrlPattern()
Get the Url Path from the SeoRule linked to this WebResource.java.lang.String
getTargetId()
Returns the target identifier for this page web resource.int
getTargetScope()
Returns the target scope for this page web resource.java.lang.String
getTitle()
Returns the title for this web resource.java.lang.String
getUrlTitle()
Returns the title value meant to be used for friendly URL generation of this web resource.IWebsite
getWebsite()
Returns the website this web resource belongs to.javax.portlet.WindowState
getWindowState()
Returns the window state for the target in this page web resource.int
hashCode()
protected boolean
hasSSI()
Returns whether this web resource has Server Side Include (requires SSI pos-processing).protected boolean
isAvailableForGetRequest()
Returns whether this web resource is available for a GET request to it.boolean
isCacheEnabled()
Returns if the cache is enabled for this web resource.boolean
isCacheEnabled(boolean considerGuestOnlyCache)
Returns if the cache is enabled for this web resource for the current user.protected boolean
isDynamicRequestValid(javax.servlet.http.HttpServletRequest request)
Indicates whether the given request is a valid dynamic request for this web resource.boolean
isPreviewModeEnabled()
Returns true if this page web resource is being processed in preview mode.void
setPreviewModeEnabled(boolean previewModeEnabled)
Sets the preview mode for processing this page web resource.java.lang.String
toString()
Returns a string representation for debug and logging purposes.-
Methods inherited from class lumis.portal.page.PageWebResource
isFriendlyURLEnabled, setDynamicPath
-
Methods inherited from class lumis.portal.url.WebResource
getPath, localize, mayBePersisted, setFriendlyPath, setId, setLocale, setPageCache, setWebsite
-
-
-
-
Constructor Detail
-
PageWebResourceWithExtraParametersWrapper
public PageWebResourceWithExtraParametersWrapper(PageWebResource pwr, java.util.Map<java.lang.String,java.lang.String[]> extraParameters)
Creates a new instance.- Parameters:
pwr
- the wrapped web resourceextraParameters
- the extra parameters- Since:
- 15.0.0
-
-
Method Detail
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
getName
public java.lang.String getName()
Description copied from class:WebResource
Returns the name for this web resource. The name is usually used for management display purposes.- Overrides:
getName
in classPageWebResource
- Returns:
- this web resource's name, localized according to its locale.
- See Also:
WebResource.getLocale()
-
getTitle
public java.lang.String getTitle()
Description copied from class:WebResource
Returns the title for this web resource. The title is usually used as an end-user title.- Overrides:
getTitle
in classPageWebResource
- Returns:
- this web resource's title, localized according to its locale.
- See Also:
WebResource.getLocale()
-
getUrlTitle
public java.lang.String getUrlTitle()
Description copied from class:WebResource
Returns the title value meant to be used for friendly URL generation of this web resource.- Overrides:
getUrlTitle
in classPageWebResource
- Returns:
- the title value.
- See Also:
IURLResolver
-
getCanonicalUrl
public java.net.URL getCanonicalUrl()
Description copied from class:PageWebResource
Returns the canonical URL for this web resource.The canonical URL value is provided by
IPageWebResourceDataProvider
inPageWebResourceData.getCanonicalUrl()
.- Overrides:
getCanonicalUrl
in classPageWebResource
- Returns:
- the canonical URL, or
null
if this web resource is not available for access in a web site. - See Also:
- The Canonical Link Relation
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
isCacheEnabled
public boolean isCacheEnabled()
Description copied from class:WebResource
Returns if the cache is enabled for this web resource.- Overrides:
isCacheEnabled
in classPageWebResource
- Returns:
true
if the cache is enabled,false
otherwise.
-
getId
public java.lang.String getId()
Description copied from class:WebResource
Returns the unique identifier for this web resource.- Overrides:
getId
in classWebResource
- Returns:
- the unique identifier for this web resource, or
null
if it is not persisted.
-
getDynamicPath
public java.lang.String getDynamicPath()
Description copied from class:WebResource
Returns the dynamic path to access this web resource. The dynamic path, starts with '/' and is relative to the portal web application root.- Overrides:
getDynamicPath
in classWebResource
- Returns:
- the dynamic path for this web resource.
- See Also:
WebResource.getFriendlyPath()
-
getParameterMap
public java.util.Map<java.lang.String,java.lang.String[]> getParameterMap()
Description copied from class:WebResource
Returns a map containing all parameters for this web resource.- Overrides:
getParameterMap
in classPageWebResource
- Returns:
- an immutable map containing all parameters for this web resource.
-
getParent
public WebResource getParent()
Description copied from class:WebResource
Returns the web resource of the parent element of this web resource.- Overrides:
getParent
in classPageWebResource
- Returns:
- the parent of this web resource, or
null
if it has no parent.
-
getFriendlyPath
public java.lang.String getFriendlyPath()
Description copied from class:WebResource
Returns the friendly path to access this web resource. The friendly path, if set, always starts with '/' and is relative to the portal web application root. One exception to this rule is if the friendly path corresponds to the application root, in this case an empty string is returned.Note that even thought a friendly path is returned, the use of friendly URL may be disabled for this web resource.
- Overrides:
getFriendlyPath
in classWebResource
- Returns:
- the friendly path or
null
if there is no friendly path set. - See Also:
WebResource.getPath()
-
getProperties
public java.util.Map<java.lang.String,java.util.List<java.lang.String>> getProperties()
Description copied from class:WebResource
Returns the properties for this web resource.- Overrides:
getProperties
in classPageWebResource
- Returns:
- a immutable map where the key is the property name and the value is a list of the property's values.
-
getPageWebResourceData
public PageWebResourceData getPageWebResourceData()
Description copied from class:PageWebResource
Returns the data generated in runtime for this page web resource.- Overrides:
getPageWebResourceData
in classPageWebResource
-
getFriendlyURLPattern
public java.lang.String getFriendlyURLPattern()
Description copied from class:WebResource
Returns the pattern to be used to resolve friendly URL for this web resource.The specific syntax or usage of the pattern is up to the
IURLResolver
configured for this web resource.- Overrides:
getFriendlyURLPattern
in classWebResource
- Returns:
- the pattern.
-
getPage
public PageConfig getPage()
Description copied from class:PageWebResource
Returns the page this web resource is based on.- Overrides:
getPage
in classPageWebResource
- Returns:
- the page.
-
getLocale
public java.util.Locale getLocale()
Description copied from class:WebResource
Returns the locale for this web resource.- Overrides:
getLocale
in classWebResource
- Returns:
- the locale.
-
getTargetId
public java.lang.String getTargetId()
Description copied from class:PageWebResource
Returns the target identifier for this page web resource.- Overrides:
getTargetId
in classPageWebResource
- Returns:
- the target identifier.
-
getCreatedDateTime
public java.util.Date getCreatedDateTime()
Description copied from class:WebResource
Returns the date-time this web resource was created.- Overrides:
getCreatedDateTime
in classWebResource
- Returns:
- the date-time this web resource was created.
-
getPageCache
public PageCacheConfig getPageCache()
Description copied from class:WebResource
Returns the cache definition for this web resource.- Overrides:
getPageCache
in classWebResource
- Returns:
- the cache object or
null
if this web resource does not have cache.
-
getTargetScope
public int getTargetScope()
Description copied from class:PageWebResource
Returns the target scope for this page web resource.- Overrides:
getTargetScope
in classPageWebResource
- Returns:
- the target scope. One of the TARGET_SCOPE_* constants in
IServiceInterfaceUrl
.
-
getWebsite
public IWebsite getWebsite()
Description copied from class:WebResource
Returns the website this web resource belongs to.The full URL to access this web resource is composed by a base URL of the web site it belongs, and the path of this web resource.
If this
web resource
is located in an area of portal that do not belong to anywebsite
, this method will returnnull
.- Overrides:
getWebsite
in classWebResource
- Returns:
- the website this web resource belongs to.
-
getPortletMode
public javax.portlet.PortletMode getPortletMode()
Description copied from class:PageWebResource
Returns the portlet mode for the target in this page web resource.- Overrides:
getPortletMode
in classPageWebResource
- Returns:
- the portlet mode.
-
getWindowState
public javax.portlet.WindowState getWindowState()
Description copied from class:PageWebResource
Returns the window state for the target in this page web resource.- Overrides:
getWindowState
in classPageWebResource
- Returns:
- the window state.
-
isPreviewModeEnabled
public boolean isPreviewModeEnabled()
Description copied from class:PageWebResource
Returns true if this page web resource is being processed in preview mode.- Overrides:
isPreviewModeEnabled
in classPageWebResource
- Returns:
- true if preview mode is enabled, false otherwise.
-
setPreviewModeEnabled
public void setPreviewModeEnabled(boolean previewModeEnabled)
Description copied from class:PageWebResource
Sets the preview mode for processing this page web resource.- Overrides:
setPreviewModeEnabled
in classPageWebResource
- Parameters:
previewModeEnabled
- true to enable, false to disable.
-
getRunTimeServiceInstanceId
public java.lang.String getRunTimeServiceInstanceId()
Description copied from class:PageWebResource
Returns the service instance identifier of the runtime service instance for this page web resource.- Overrides:
getRunTimeServiceInstanceId
in classPageWebResource
- Returns:
- the service instance identifier, or
null
if this page web resource does not have a runtime service instance. - See Also:
ServiceInstanceConfig
-
getRunTimeServiceInterfaceId
public java.lang.String getRunTimeServiceInterfaceId()
Description copied from class:PageWebResource
Returns the service interface identifier of the runtime service interface for this page web resource.- Overrides:
getRunTimeServiceInterfaceId
in classPageWebResource
- Returns:
- the service interface identifier, or
null
if this page web resource does not have a runtime service interface. - See Also:
ServiceInterfaceConfig
-
clone
public PageWebResource clone() throws java.lang.CloneNotSupportedException
- Specified by:
clone
in interfaceICloneableCacheEntry
- Overrides:
clone
in classPageWebResource
- Throws:
java.lang.CloneNotSupportedException
-
getProject
public IProject getProject() throws PortalException
Description copied from class:WebResource
Returns the project this web resource belongs to (if any).
It is important to notice that the relation webresource <-> project is not persisted. Instead, it is calculated at runtime.
This method may require a current transaction.- Overrides:
getProject
in classPageWebResource
- Returns:
- the project this web resource belongs to (if any).
- Throws:
PortalException
-
isCacheEnabled
public boolean isCacheEnabled(boolean considerGuestOnlyCache)
Description copied from class:WebResource
Returns if the cache is enabled for this web resource for the current user.- Overrides:
isCacheEnabled
in classWebResource
- Parameters:
considerGuestOnlyCache
- indicates if the result should betrue
even if the cache is only for guest.- Returns:
true
if the cache is enabled,false
otherwise.
-
getParameter
public java.lang.String getParameter(java.lang.String parameterName)
Description copied from class:WebResource
Returns the value of a parameter for this web resource. If the parameter has multiple values, the first is returned.- Overrides:
getParameter
in classWebResource
- Parameters:
parameterName
- the parameter name.- Returns:
- the value, or
null
if no parameter with such name exists for this web resource.
-
getParameterValues
public java.lang.String[] getParameterValues(java.lang.String parameterName)
Description copied from class:WebResource
Returns the values of a parameter for this web resource.- Overrides:
getParameterValues
in classWebResource
- Parameters:
parameterName
- the parameter name.- Returns:
- the values, or
null
if no parameter with such name exists for this web resource.
-
toString
public java.lang.String toString()
Description copied from class:WebResource
Returns a string representation for debug and logging purposes.- Overrides:
toString
in classWebResource
- Returns:
- string representation for debug and logging purposes.
-
getRecommendedFileExtension
protected java.lang.String getRecommendedFileExtension()
Description copied from class:WebResource
Returns the file extension recommended for this web resource, according to its configurations.- Overrides:
getRecommendedFileExtension
in classPageWebResource
- Returns:
- the extension, starting with '.'. Example: ".htm"
-
getSeoRuleUrlPattern
protected java.lang.String getSeoRuleUrlPattern() throws PortalException
Description copied from class:WebResource
Get the Url Path from the SeoRule linked to this WebResource.- Overrides:
getSeoRuleUrlPattern
in classPageWebResource
- Returns:
- The url path pattern or
null
if not specified. - Throws:
PortalException
-
calculatePath
protected java.lang.String calculatePath()
Description copied from class:WebResource
Returns the path to access this web resource. The returned value is taken from cache configuration,WebResource.getFriendlyPath()
orWebResource.getDynamicPath()
.- Overrides:
calculatePath
in classWebResource
- Returns:
- the path to access this web resource, starting with '/' and relative to the portal web application root.
-
hasSSI
protected boolean hasSSI()
Description copied from class:WebResource
Returns whether this web resource has Server Side Include (requires SSI pos-processing).- Overrides:
hasSSI
in classPageWebResource
- Returns:
true
if this web resource has SSI,false
otherwise.
-
isAvailableForGetRequest
protected boolean isAvailableForGetRequest()
Description copied from class:WebResource
Returns whether this web resource is available for a GET request to it.Normally non-persisted web resources whose dynamic path differs from the main path indicates that it was not generated
- Overrides:
isAvailableForGetRequest
in classWebResource
- Returns:
true
if this web resource is available,false
otherwise.
-
isDynamicRequestValid
protected boolean isDynamicRequestValid(javax.servlet.http.HttpServletRequest request)
Description copied from class:WebResource
Indicates whether the given request is a valid dynamic request for this web resource.- Overrides:
isDynamicRequestValid
in classWebResource
- Parameters:
request
- the request.- Returns:
true
if valid,false
otherwise.
-
-