com.atlassian.jira.plugin.issuelink
Interface IssueLinkRenderer

All Known Implementing Classes:
AbstractIssueLinkRenderer, ConfluenceIssueLinkRenderer, DefaultIssueLinkRenderer, RemoteJiraIssueLinkRenderer

@PublicSpi
public interface IssueLinkRenderer

Defines an issue link renderer to customise how issue links appear.

Since:
v5.0

Method Summary
 Map<String,Object> getFinalContext(RemoteIssueLink remoteIssueLink, Map<String,Object> context)
          Returns the context used to render the final HTML.
 Map<String,Object> getInitialContext(RemoteIssueLink remoteIssueLink, Map<String,Object> context)
          Returns the context used by the template to render the initial HTML.
 boolean requiresAsyncLoading(RemoteIssueLink remoteIssueLink)
          Returns true if an AJAX call is required to retrieve the final HTML.
 boolean shouldDisplay(RemoteIssueLink remoteIssueLink)
          Returns true if the remote issue link should be displayed.
 

Method Detail

getInitialContext

Map<String,Object> getInitialContext(RemoteIssueLink remoteIssueLink,
                                     Map<String,Object> context)
Returns the context used by the template to render the initial HTML. Implementers of this method should not make remote calls, use getFinalContext(RemoteIssueLink, Map) for that purpose. The resulting HTML will be injected as follows: <dl class="links-list"> <dt>Relationship Text</dt> <!-- ... Other Issue Links ... --> <dd id="uniqueHtmlElementId" class="remote-link"> <div class="link-content"> <!-- ISSUE LINK RENDERER CONTENT HERE --> </div> <div class="delete-link" id="delete_uniqueHtmlElementId"> <a class="icon icon-delete" title="Delete Link" id="delete-link_uniqueHtmlElementId" href="delete_remote_issue_link_url"><span>Delete Link</span></a> </div> </dd> <!-- ... Other Issue Links ... --> </dl>

Parameters:
remoteIssueLink - remote issue link
context - the contextual information that can be used during rendering.
Returns:
context used to render the initial HTML.

getFinalContext

Map<String,Object> getFinalContext(RemoteIssueLink remoteIssueLink,
                                   Map<String,Object> context)
Returns the context used to render the final HTML. This method will only be called if requiresAsyncLoading(RemoteIssueLink) returns true. The resulting HTML will be injected as follows: <dl class="links-list"> <dt>Relationship Text</dt> <!-- ... Other Issue Links ... --> <dd id="uniqueHtmlElementId" class="remote-link"> <div class="link-content"> <!-- ISSUE LINK RENDERER CONTENT HERE --> </div> <div class="delete-link" id="delete_uniqueHtmlElementId"> <a class="icon icon-delete" title="Delete Link" id="delete-link_uniqueHtmlElementId" href="delete_remote_issue_link_url"><span>Delete Link</span></a> </div> </dd> <!-- ... Other Issue Links ... --> </dl>

Parameters:
remoteIssueLink - remote issue link
context - the contextual information that can be used during rendering.
Returns:
velocity context used to render the final HTML

requiresAsyncLoading

boolean requiresAsyncLoading(RemoteIssueLink remoteIssueLink)
Returns true if an AJAX call is required to retrieve the final HTML. If true is returned, then getFinalContext(com.atlassian.jira.issue.link.RemoteIssueLink, java.util.Map) will be called to retrieve the final HTML for the issue link.

Parameters:
remoteIssueLink - remote issue link
Returns:
true if an AJAX call is required to retrieve the final HTML

shouldDisplay

boolean shouldDisplay(RemoteIssueLink remoteIssueLink)
Returns true if the remote issue link should be displayed.

Parameters:
remoteIssueLink - remote issue link
Returns:
true if the remote issue link should be displayed


Copyright © 2002-2012 Atlassian. All Rights Reserved.