Class DashboardItemRepresentation

java.lang.Object
com.atlassian.gadgets.dashboard.DashboardItemRepresentation

@PublicApi public class DashboardItemRepresentation extends Object
Detailed information that can be used to render the dashboard item.

Dashboard items can take one of three forms:

  • Local JS dashboard item: dashboard item rendered entirely in the browser. It specifies an AMD module which needs to be called in order to render the item.
  • Local server-side dashboard item: dashboard item that has been rendered on the server. The representation contains an HTML which needs to be displayed. They may also contain AMD module for additional client-side processing.
  • Open-social gadget: it contains url that can be used to render the gadget in an iFrame

In case of local dashboard items, a jsonRepresentation will be returned which can be used to easily interact with the dashboard-plugin JavaScript API.

  • Method Details

    • getJsonRepresentation

      public io.atlassian.fugue.Option<String> getJsonRepresentation()
      It is defined in case of local dashboard items and contains a stringified JSON object.

      Json representation contains the following fields:

      • id
      • title
      • titleUrl
      • gadgetSpecUrl -- in case of local dashboard items that replace open social gadgets
      • height
      • width
      • color
      • column
      • colorUrl
      • gadgetUrl
      • isMaximizable
      • renderedGadgetUrl
      • hasNonHiddenUserPrefs
      • userPrefs
      • loaded
      • errorMessage
      • inlineHtml -- if it's a server-side local dashboard item
      • amdModule -- if it's a JavaScript local dashboard item
      • configurable
      • context
      Returns:
      a stringified JSON object with dashboard item rendering information.
    • getAmdModule

      public io.atlassian.fugue.Option<String> getAmdModule()
      Returns a JavaScript AMD module that renders the dashboard item.
      Returns:
      amd module name
    • getHtml

      public io.atlassian.fugue.Option<String> getHtml()
      Returns a verbatim html which represents the dashboard item.
      Returns:
      unescaped html string
    • getGadgetUrl

      public io.atlassian.fugue.Option<String> getGadgetUrl()
      Open social gadget URL
      Returns:
      url
    • dashboardItem

      public static DashboardItemRepresentation dashboardItem(@Nullable String amdModule, @Nullable String html, @Nonnull String jsonRepresentation)
    • openSocialGadget

      public static DashboardItemRepresentation openSocialGadget(@Nonnull String gadgetUrl)