Class ConfluenceWebLink

  • All Implemented Interfaces:
    SettableWebLink, com.atlassian.plugin.web.model.WebLink

    public class ConfluenceWebLink
    extends Object
    implements SettableWebLink
    A confluence specific wrapper for the WebLink
    • Constructor Detail

      • ConfluenceWebLink

        public ConfluenceWebLink()
      • ConfluenceWebLink

        public ConfluenceWebLink​(com.atlassian.plugin.web.model.WebLink webLink)
    • Method Detail

      • getRenderedUrl

        public String getRenderedUrl​(WebInterfaceContext context)
        Renders this web link in the given context. The context path is not prepended, unlike getDisplayableUrl(HttpServletRequest, WebInterfaceContext). You probably want to use that method instead.

        The Velocity context is not exactly the same as in the method it replaced. For example, rather than using $helper.page in your URL template, you should use just $page.

        Parameters:
        context - how the link is being rendered, includes relevant Confluence content and perhaps custom parameters
        Returns:
        a URL relative to the context path, generated from running Velocity against this link's URL parameter
      • getRenderedUrl

        public String getRenderedUrl​(Map params)
        Specified by:
        getRenderedUrl in interface com.atlassian.plugin.web.model.WebLink
      • getDisplayableUrl

        public String getDisplayableUrl​(javax.servlet.http.HttpServletRequest req,
                                        WebInterfaceContext context)
        Renders this web link in the given context. Calls WebFragmentHelper.renderVelocityFragment(String, Map) with the URL of the web link and the result of WebInterfaceContext.toMap() on the provided context. The HTTP request is used to prepend the context path.

        The Velocity context is not exactly the same as the method it replaced. For example, rather than using $helper.page in your URL template, you should use just $page.

        Parameters:
        req - the current request, used for HttpServletRequest.getContextPath()
        context - how the link is being rendered, includes relevant Confluence content and perhaps custom parameters
        Returns:
        a URL relative to the server's hostname generated from running Velocity against this link's URL parameter
      • getDisplayableUrl

        public String getDisplayableUrl​(javax.servlet.http.HttpServletRequest req,
                                        Map params)
        Specified by:
        getDisplayableUrl in interface com.atlassian.plugin.web.model.WebLink
      • getDescriptor

        public com.atlassian.plugin.web.descriptors.WebFragmentModuleDescriptor getDescriptor()
        Specified by:
        getDescriptor in interface com.atlassian.plugin.web.model.WebLink
      • hasAccessKey

        public boolean hasAccessKey()
        Specified by:
        hasAccessKey in interface com.atlassian.plugin.web.model.WebLink
      • getAccessKey

        public String getAccessKey​(Map params)
        Specified by:
        getAccessKey in interface com.atlassian.plugin.web.model.WebLink
      • getId

        public String getId()
        Specified by:
        getId in interface com.atlassian.plugin.web.model.WebLink
      • setLink

        public void setLink​(com.atlassian.plugin.web.model.WebLink webLink)
        Description copied from interface: SettableWebLink
        Provides a method to pass a WebLink.
        Specified by:
        setLink in interface SettableWebLink
        Parameters:
        webLink - the link for this WebLink