com.atlassian.confluence.plugin.descriptor.web.model
Class ConfluenceWebLink

java.lang.Object
  extended by com.atlassian.confluence.plugin.descriptor.web.model.ConfluenceWebLink
All Implemented Interfaces:
SettableWebLink, com.atlassian.plugin.web.model.WebLink

public class ConfluenceWebLink
extends java.lang.Object
implements SettableWebLink

A confluence specific wrapper for the WebLink


Constructor Summary
ConfluenceWebLink()
           
ConfluenceWebLink(com.atlassian.plugin.web.model.WebLink webLink)
           
 
Method Summary
 java.lang.String getAccessKey(GlobalHelper helper)
           
 java.lang.String getAccessKey(java.util.Map params)
           
 com.atlassian.plugin.web.descriptors.WebFragmentModuleDescriptor getDescriptor()
           
 java.lang.String getDisplayableUrl(javax.servlet.http.HttpServletRequest req, java.util.Map params)
           
 java.lang.String getDisplayableUrl(javax.servlet.http.HttpServletRequest req, WebInterfaceContext context)
          Renders this web link in the given context.
 java.lang.String getId()
           
 java.lang.String getRenderedUrl(java.util.Map params)
           
 java.lang.String getRenderedUrl(WebInterfaceContext context)
          Renders this web link in the given context.
 boolean hasAccessKey()
           
 void setLink(com.atlassian.plugin.web.model.WebLink webLink)
          Provides a method to pass a WebLink.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfluenceWebLink

public ConfluenceWebLink()

ConfluenceWebLink

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

getRenderedUrl

public java.lang.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 java.lang.String getRenderedUrl(java.util.Map params)
Specified by:
getRenderedUrl in interface com.atlassian.plugin.web.model.WebLink

getDisplayableUrl

public java.lang.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 java.lang.String getDisplayableUrl(javax.servlet.http.HttpServletRequest req,
                                          java.util.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 java.lang.String getAccessKey(GlobalHelper helper)

getAccessKey

public java.lang.String getAccessKey(java.util.Map params)
Specified by:
getAccessKey in interface com.atlassian.plugin.web.model.WebLink

getId

public java.lang.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


Copyright © 2003-2013 Atlassian. All Rights Reserved.