Package com.atlassian.gadgets.plugins
Class PluginGadgetSpec
java.lang.Object
com.atlassian.gadgets.plugins.PluginGadgetSpec
A gadget spec provided by a plugin.
There are two major categories of plugin gadgets: published gadgets and external gadgets.
Published gadgets are gadget specs that are packaged as resources within the plugin. They are served by the Atlassian Gadgets Publisher plugin at a URL of the form
External gadgets are gadget specs that are hosted on an external web site. Declaring external gadgets within a plugin makes the application aware of these gadgets, so they can be displayed in a directory of available gadgets, for example. The location of external gadgets returned from
There are two major categories of plugin gadgets: published gadgets and external gadgets.
Published gadgets are gadget specs that are packaged as resources within the plugin. They are served by the Atlassian Gadgets Publisher plugin at a URL of the form
http://<hostname>[:<port>]/[<context>/]<path/to/gadget/location.xml>.
The location of published gadgets returned from getLocation() is a relative path to the gadget spec file
within the plugin.
External gadgets are gadget specs that are hosted on an external web site. Declaring external gadgets within a plugin makes the application aware of these gadgets, so they can be displayed in a directory of available gadgets, for example. The location of external gadgets returned from
getLocation() is the absolute URL of the gadget
spec file, beginning with http or https. External gadgets served through protocols other than HTTP
are not supported.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classAn immutable representation of a unique identifier for plugin gadget specs, composed of a plugin key and resource location path name. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PluginGadgetSpecBuilderbuilder()booleancom.atlassian.plugin.web.ConditionReturns the spec resource as an input stream, for processing.getKey()Returns a unique identifier for this spec.com.atlassian.plugin.web.ConditionIfisHostedExternally()returns true, this method returns the absolute URL of the gadget spec file, beginning with http or https.Returns the module key for this spec.getParameter(String name) Returns the plugin key for this spec.inthashCode()booleanhasParameter(String name) booleanReturns true if this spec is hosted externally (meaning it is not part of a plugin served by the Gadgets Publisher plugin), false otherwise.toString()
-
Constructor Details
-
Method Details
-
builder
-
getEnabledCondition
public com.atlassian.plugin.web.Condition getEnabledCondition()- Returns:
- the condition on whether this gadget should be made available in gadget feed resource and gadget spec xml resource.
-
getLocalCondition
public com.atlassian.plugin.web.Condition getLocalCondition()- Returns:
- the condition on whether this gadget should be made available in gadget directory dialog and product specific page if implemented, such as dashboard in JIRA.
-
getKey
Returns a unique identifier for this spec.- Returns:
- the unique identifier
-
getModuleKey
Returns the module key for this spec.- Returns:
- the module key
-
getPluginKey
Returns the plugin key for this spec.- Returns:
- the plugin key
-
getPublishLocation
- Returns:
- the customised spec publish location for this gadget.
-
getLocation
IfisHostedExternally()returns true, this method returns the absolute URL of the gadget spec file, beginning with http or https. IfisHostedExternally()returns false, this method returns a relative location -- the path of the spec file within its plugin.- Returns:
- the location string
-
getInputStream
Returns the spec resource as an input stream, for processing.- Returns:
- the input stream
-
isHostedExternally
public boolean isHostedExternally()Returns true if this spec is hosted externally (meaning it is not part of a plugin served by the Gadgets Publisher plugin), false otherwise.- Returns:
- true if the spec is hosted externally, false otherwise
-
hasParameter
-
getParameter
-
getDateLoaded
-
hashCode
public int hashCode() -
equals
-
toString
-
builder()instead.