public interface

ApplicationLinkUIService

com.atlassian.applinks.api.ApplicationLinkUIService
Known Indirect Subclasses

Class Overview

Generates HTML fragments to support a standardized UX for displaying and controlling application link status.

A typical use case: A plugin servlet is generating some content that involves making an application link request, and it gets a CredentialsRequiredException indicating that the link is unavailable. The servlet can use ApplicationLinkUIService as follows to generate a standard message box with a "please authenticate with [application name]" link:

     ApplicationLinkUIService.MessageBuilder messageBuilder =
         applicationLinkUIService.authorisationRequest(myAppLink)
             .format(ApplicationLinkUIService.MessageFormat.BANNER);
     String messageHtml = messageBuilder.getHtml();
 

The BANNER format is a standard AUI message box of the "warning" style, which is meant to be displayed at the very top of a page or a gadget. This is appropriate if the overall page/gadget content depends on the application link's state; successful completion of the authentication/authorisation flow will cause the page/gadget to be refreshed. To display a smaller inline message that does not apply to the entire page, use INLINE instead.

In order for these elements to have the proper styling and behavior, the front end must import CSS and Javascript from the web resource "com.atlassian.applinks.applinks-plugin:applinks-public".

It is also possible to generate these elements entirely on the front end instead, if this is more convenient for a particular plugin. Functions for this are in "applinks.public.js" in the applinks-public web resource.

Internationalization of message text is handled by the standard com.atlassian.sal.api.message.I18nResolver mechanism.

Summary

Nested Classes
interface ApplicationLinkUIService.MessageBuilder An HTML fragment builder returned by authorisationRequest(ApplicationLink)
enum ApplicationLinkUIService.MessageFormat Constants for use with format(MessageFormat)
Public Methods
abstract ApplicationLinkUIService.MessageBuilder authorisationRequest(ApplicationLink appLink)
Returns a ApplicationLinkUIService.MessageBuilder to construct an HTML fragment with a "please authenticate with [application]" message, and a link that lets the user begin authentication.

Public Methods

public abstract ApplicationLinkUIService.MessageBuilder authorisationRequest (ApplicationLink appLink)

Returns a ApplicationLinkUIService.MessageBuilder to construct an HTML fragment with a "please authenticate with [application]" message, and a link that lets the user begin authentication.

Parameters
appLink an application link; cannot be null
Returns