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 String
getAccessKey(GlobalHelper helper)
String
getAccessKey(Map params)
com.atlassian.plugin.web.descriptors.WebFragmentModuleDescriptor
getDescriptor()
String
getDisplayableUrl(javax.servlet.http.HttpServletRequest req, WebInterfaceContext context)
Renders this web link in the given context.String
getDisplayableUrl(javax.servlet.http.HttpServletRequest req, Map params)
String
getId()
String
getRenderedUrl(WebInterfaceContext context)
Renders this web link in the given context.String
getRenderedUrl(Map params)
boolean
hasAccessKey()
void
setLink(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:
getRenderedUrl
in 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:
getDisplayableUrl
in interfacecom.atlassian.plugin.web.model.WebLink
-
getDescriptor
public com.atlassian.plugin.web.descriptors.WebFragmentModuleDescriptor getDescriptor()
- Specified by:
getDescriptor
in interfacecom.atlassian.plugin.web.model.WebLink
-
hasAccessKey
public boolean hasAccessKey()
- Specified by:
hasAccessKey
in interfacecom.atlassian.plugin.web.model.WebLink
-
getAccessKey
public String getAccessKey(GlobalHelper helper)
-
getAccessKey
public String getAccessKey(Map params)
- Specified by:
getAccessKey
in interfacecom.atlassian.plugin.web.model.WebLink
-
getId
public String getId()
- Specified by:
getId
in interfacecom.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 aWebLink
.- Specified by:
setLink
in interfaceSettableWebLink
- Parameters:
webLink
- the link for this WebLink
-
-