I am building an externally hosted gadget for our local jira instance that will graph some of our issues. I am having a problem with the tutorials that utilize the Atlassian Gadgets Javscript Framework.
Using the script example on this page:
https://developer.atlassian.com/display/GADGETS/Using+the+Atlassian+Gadgets+JavaScript+Framework
I am unable to instanciate the gadget object, and I get the message :
Uncaught ReferenceError: AJS is not defined
It seems the require statement : #requireResource("com.atlassian.gadgets.publisher:ajs-gadgets") is not loading the components. I am using the follwing script which is based on the tutorial:
<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="__MSG_gadget.title__" directory_title="__MSG_gadget.title__" description="__MSG_gadget.description__">
<Require feature="dynamic-height" />
<Optional feature="auth-refresh"/>
<Require feature="oauthpopup" />
<Require feature="setprefs" />
<Require feature="settitle" />
<Require feature="views" />
<Optional feature="atlassian.util" />
<Optional feature="gadget-directory">
<Param name="categories">Other</Param>
</Optional>
#oauth
#supportedLocales("gadget.common,your.gadget.resource.prefix")
</ModulePrefs>
<Content type="html">
<![CDATA[
/* (1) This resource is required for using the gadget framework */
#requireResource("com.atlassian.gadgets.publisher:ajs-gadgets")
#includeResources()
<script type="text/javascript">
(function () {
/* (2) Construct and initialise the gadget */
var gadget = AJS.Gadget({
baseUrl: "//someurl.com/Dashboard.jspa"
});
})();
</script>
]]>
</Content>
</Module>
Community moderators have prevented the ability to post new answers.
I am still unable to load Atalssian Gadget framework via the require statements in the gadget xml file. My only option has been to crawl up the DOM, and access AJS from the gadget host browser window after the gadget fully loads.
i think u missed
#requireResource("com.atlassian.jira.gadgets:common")
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
#supportedLocales("gadget.common,your.gadget.resource.prefix")
could some one give example to "your.gadget.resource.prefix"
I mean how to give path to resource here for my below example
my group id is => com.jira.test
artifact id is => rgadget
package =>com.jira.test
my gadget module name is => mgadget
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.