Package com.atlassian.gadgets.dashboard
Class DashboardItemRepresentation
java.lang.Object
com.atlassian.gadgets.dashboard.DashboardItemRepresentation
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 Summary
Modifier and TypeMethodDescriptionstatic DashboardItemRepresentationdashboardItem(String amdModule, String html, String jsonRepresentation) io.atlassian.fugue.Option<String>Returns a JavaScript AMD module that renders the dashboard item.io.atlassian.fugue.Option<String>Open social gadget URLio.atlassian.fugue.Option<String>getHtml()Returns a verbatim html which represents the dashboard item.io.atlassian.fugue.Option<String>It is defined in case of local dashboard items and contains a stringified JSON object.static DashboardItemRepresentationopenSocialGadget(String gadgetUrl)
-
Method Details
-
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
Returns a JavaScript AMD module that renders the dashboard item.- Returns:
- amd module name
-
getHtml
Returns a verbatim html which represents the dashboard item.- Returns:
- unescaped html string
-
getGadgetUrl
Open social gadget URL- Returns:
- url
-
dashboardItem
public static DashboardItemRepresentation dashboardItem(@Nullable String amdModule, @Nullable String html, @Nonnull String jsonRepresentation) -
openSocialGadget
-