Class ConfluenceWebLink
java.lang.Object
com.atlassian.confluence.plugin.descriptor.web.model.ConfluenceWebLink
- All Implemented Interfaces:
SettableWebLink
,com.atlassian.plugin.web.model.WebLink
A confluence specific wrapper for the
WebLink
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAccessKey
(GlobalHelper helper) getAccessKey
(Map params) com.atlassian.plugin.web.api.descriptors.WebFragmentModuleDescriptor
getDisplayableUrl
(javax.servlet.http.HttpServletRequest req, WebInterfaceContext context) Renders this web link in the given context.getDisplayableUrl
(javax.servlet.http.HttpServletRequest req, Map params) getId()
getRenderedUrl
(WebInterfaceContext context) Renders this web link in the given context.getRenderedUrl
(Map params) boolean
void
setLink
(com.atlassian.plugin.web.model.WebLink webLink) Provides a method to pass aWebLink
.
-
Constructor Details
-
ConfluenceWebLink
public ConfluenceWebLink() -
ConfluenceWebLink
public ConfluenceWebLink(com.atlassian.plugin.web.model.WebLink webLink)
-
-
Method Details
-
getRenderedUrl
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
- 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
- Specified by:
getDisplayableUrl
in interfacecom.atlassian.plugin.web.model.WebLink
-
getDescriptor
public com.atlassian.plugin.web.api.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
-
getAccessKey
- Specified by:
getAccessKey
in interfacecom.atlassian.plugin.web.model.WebLink
-
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
-