Class PageWebResourceFunctionMapper

    • Field Detail

      • BEFORE_WRITE_FUNCTION_NAME

        protected static final String BEFORE_WRITE_FUNCTION_NAME
        Define the before write function name.
        Since:
        7.0.0
        See Also:
        Constant Field Values
    • Constructor Detail

      • PageWebResourceFunctionMapper

        public PageWebResourceFunctionMapper​(PageWebResource pageWebResource,
                                             HttpServletRequest request)
        Creates a new instance with the given parameters.
        Parameters:
        pageWebResource - the page web resource.
        Since:
        7.0.0
    • Method Detail

      • resolveURL

        public static String resolveURL​(String url)
                                 throws PortalException
        Resolves the given URL.
        The URL will only be resolved against the applied themes if the requested page was previously set within beforeEvaluation().
        Parameters:
        url - the URL to be resolved.
        Returns:
        the resolved URL.
        Throws:
        PortalException
        Since:
        7.0.0
      • writeIfNotYetWritten

        public static String writeIfNotYetWritten​(String fragment,
                                                  String key)
                                           throws IOException
        Returns the given fragment if the given key was not used yet. Otherwise returns null.
        Parameters:
        fragment - the fragment to be rendered in before writer.
        key - the unique key to use.
        Throws:
        IOException
        Since:
        7.0.0
      • localize

        public static String localize​(String[] args)
                               throws PortalException
        Resolves the string.
        Parameters:
        args - the localize function parameters.
        1. First argument is the identifier of the string to be localized.
        2. Second argument is optional, and is a list of resource paths separated by ';' to be included in the localization.
        3+. Any extra argument will be considered a localization parameter.
        Returns:
        localized string.
        Throws:
        PortalException - if an error occur localizing the string.
        Since:
        11.0.0