public class ConfluenceWebLink extends Object implements SettableWebLink
WebLink
Constructor and Description |
---|
ConfluenceWebLink() |
ConfluenceWebLink(com.atlassian.plugin.web.model.WebLink webLink) |
Modifier and Type | Method and Description |
---|---|
String |
getAccessKey(GlobalHelper helper) |
String |
getAccessKey(Map params) |
com.atlassian.plugin.web.descriptors.WebFragmentModuleDescriptor |
getDescriptor() |
String |
getDisplayableUrl(javax.servlet.http.HttpServletRequest req,
Map params) |
String |
getDisplayableUrl(javax.servlet.http.HttpServletRequest req,
WebInterfaceContext context)
Renders this web link in the given context.
|
String |
getId() |
String |
getRenderedUrl(Map params) |
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 . |
public ConfluenceWebLink()
public ConfluenceWebLink(com.atlassian.plugin.web.model.WebLink webLink)
public String getRenderedUrl(WebInterfaceContext context)
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.
context
- how the link is being rendered, includes relevant Confluence content and perhaps custom parameterspublic String getRenderedUrl(Map params)
getRenderedUrl
in interface com.atlassian.plugin.web.model.WebLink
public String getDisplayableUrl(javax.servlet.http.HttpServletRequest req, WebInterfaceContext context)
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.
req
- the current request, used for HttpServletRequest.getContextPath()
context
- how the link is being rendered, includes relevant Confluence content and perhaps custom parameterspublic String getDisplayableUrl(javax.servlet.http.HttpServletRequest req, Map params)
getDisplayableUrl
in interface com.atlassian.plugin.web.model.WebLink
public com.atlassian.plugin.web.descriptors.WebFragmentModuleDescriptor getDescriptor()
getDescriptor
in interface com.atlassian.plugin.web.model.WebLink
public boolean hasAccessKey()
hasAccessKey
in interface com.atlassian.plugin.web.model.WebLink
public String getAccessKey(GlobalHelper helper)
public String getAccessKey(Map params)
getAccessKey
in interface com.atlassian.plugin.web.model.WebLink
public String getId()
getId
in interface com.atlassian.plugin.web.model.WebLink
public void setLink(com.atlassian.plugin.web.model.WebLink webLink)
SettableWebLink
WebLink
.setLink
in interface SettableWebLink
webLink
- the link for this WebLinkCopyright © 2003–2016 Atlassian. All rights reserved.