Class 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: 25374 $ $Date: 2022-12-05 18:38:30 -0300 (Mon, 05 Dec 2022) $
    • 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​(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 java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
    • 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 resource
        extraParameters - the extra parameters
        Since:
        15.0.0
    • Method Detail

      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.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 class PageWebResource
        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 class PageWebResource
        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 class PageWebResource
        Returns:
        the title value.
        See Also:
        IURLResolver
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • isCacheEnabled

        public boolean isCacheEnabled()
        Description copied from class: WebResource
        Returns if the cache is enabled for this web resource.
        Overrides:
        isCacheEnabled in class PageWebResource
        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 class WebResource
        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 class WebResource
        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 class PageWebResource
        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 class PageWebResource
        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 class WebResource
        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 class PageWebResource
        Returns:
        a immutable map where the key is the property name and the value is a list of the property's values.
      • 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 class WebResource
        Returns:
        the pattern.
      • getLocale

        public java.util.Locale getLocale()
        Description copied from class: WebResource
        Returns the locale for this web resource.
        Overrides:
        getLocale in class WebResource
        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 class PageWebResource
        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 class WebResource
        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 class WebResource
        Returns:
        the cache object or null if this web resource does not have cache.
      • 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 any website, this method will return null.

        Overrides:
        getWebsite in class WebResource
        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 class PageWebResource
        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 class PageWebResource
        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 class PageWebResource
        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 class PageWebResource
        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 class PageWebResource
        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 class PageWebResource
        Returns:
        the service interface identifier, or null if this page web resource does not have a runtime service interface.
        See Also:
        ServiceInterfaceConfig
      • 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 class PageWebResource
        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 class WebResource
        Parameters:
        considerGuestOnlyCache - indicates if the result should be true 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 class WebResource
        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 class WebResource
        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 class WebResource
        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 class PageWebResource
        Returns:
        the extension, starting with '.'. Example: ".htm"
      • 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 class PageWebResource
        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 class WebResource
        Returns:
        true if this web resource is available, false otherwise.
      • isDynamicRequestValid

        protected boolean isDynamicRequestValid​(HttpServletRequest request)
        Description copied from class: WebResource
        Indicates whether the given request is a valid dynamic request for this web resource.
        Overrides:
        isDynamicRequestValid in class WebResource
        Parameters:
        request - the request.
        Returns:
        true if valid, false otherwise.