Class ConfluenceWebLink
- java.lang.Object
-
- com.atlassian.confluence.plugin.descriptor.web.model.ConfluenceWebLink
-
- All Implemented Interfaces:
SettableWebLink,com.atlassian.plugin.web.model.WebLink
public class ConfluenceWebLink extends Object implements SettableWebLink
A confluence specific wrapper for theWebLink
-
-
Constructor Summary
Constructors Constructor Description ConfluenceWebLink()ConfluenceWebLink(com.atlassian.plugin.web.model.WebLink webLink)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetAccessKey(GlobalHelper helper)StringgetAccessKey(Map params)com.atlassian.plugin.web.descriptors.WebFragmentModuleDescriptorgetDescriptor()StringgetDisplayableUrl(javax.servlet.http.HttpServletRequest req, WebInterfaceContext context)Renders this web link in the given context.StringgetDisplayableUrl(javax.servlet.http.HttpServletRequest req, Map params)StringgetId()StringgetRenderedUrl(WebInterfaceContext context)Renders this web link in the given context.StringgetRenderedUrl(Map params)booleanhasAccessKey()voidsetLink(com.atlassian.plugin.web.model.WebLink webLink)Provides a method to pass aWebLink.
-
-
-
Method Detail
-
getRenderedUrl
public String getRenderedUrl(WebInterfaceContext context)
Renders this web link in the given context. The context path is not prepended, unlikegetDisplayableUrl(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:
getRenderedUrlin interfacecom.atlassian.plugin.web.model.WebLink
-
getDisplayableUrl
public String getDisplayableUrl(javax.servlet.http.HttpServletRequest req, WebInterfaceContext context)
Renders this web link in the given context. CallsWebFragmentHelper.renderVelocityFragment(String, Map)with the URL of the web link and the result ofWebInterfaceContext.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 forHttpServletRequest.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:
getDisplayableUrlin interfacecom.atlassian.plugin.web.model.WebLink
-
getDescriptor
public com.atlassian.plugin.web.descriptors.WebFragmentModuleDescriptor getDescriptor()
- Specified by:
getDescriptorin interfacecom.atlassian.plugin.web.model.WebLink
-
hasAccessKey
public boolean hasAccessKey()
- Specified by:
hasAccessKeyin interfacecom.atlassian.plugin.web.model.WebLink
-
getAccessKey
public String getAccessKey(GlobalHelper helper)
-
getAccessKey
public String getAccessKey(Map params)
- Specified by:
getAccessKeyin interfacecom.atlassian.plugin.web.model.WebLink
-
getId
public String getId()
- Specified by:
getIdin interfacecom.atlassian.plugin.web.model.WebLink
-
setLink
public void setLink(com.atlassian.plugin.web.model.WebLink webLink)
Description copied from interface:SettableWebLinkProvides a method to pass aWebLink.- Specified by:
setLinkin interfaceSettableWebLink- Parameters:
webLink- the link for this WebLink
-
-