I am trying to develop a gadget that will ultimately incorporate ChartJS, but I am having issues with the default gadget, as it does not load.
The code I am putting into the attlassian-plugin.xml is the following:
<atlassian-plugin key="${project.groupId}.${project.artifactId}" name="${project.name}" plugins-version="2">
<plugin-info>
<description>${project.description}</description>
<version>${project.version}</version>
<vendor name="${project.organization.name}" url="${project.organization.url}" />
<param name="plugin-icon">images/pluginIcon.png</param>
<param name="plugin-logo">images/pluginLogo.png</param>
</plugin-info>
<!-- add our i18n resource -->
<resource type="i18n" name="i18n" location="report"/>
<!-- add our web resources -->
<web-resource key="report-resources" name="report Web Resources">
<dependency>com.atlassian.auiplugin:ajs</dependency>
<resource type="download" name="report.css" location="/css/report.css"/>
<resource type="download" name="report.js" location="/js/report.js"/>
<resource type="download" name="images/" location="/images"/>
<context>report</context>
</web-resource>
<!-- publish our component -->
<component key="myPluginComponent" class="com.wfs.report.MyPluginComponentImpl" public="true">
<interface>com.wfs.report.MyPluginComponent</interface>
</component>
<!-- import from the product container -->
<component-import key="applicationProperties" interface="com.atlassian.sal.api.ApplicationProperties" />
<webwork1 key="demoaction" name="JTricks Demo Action" class="java.lang.Object">
<actions>
<action name="com.wfs.report.DemoAction" alias="DemoAction">
<view name="input">/templates/input.vm</view>
<view name="success">/templates/joy.vm</view>
<view name="error">/templates/tears.vm</view>
</action>
</actions>
</webwork1>
<atlassian-plugin name="Hello World" key="example.plugin.helloworld" plugins-version="2">
<plugin-info>
<description>A basic gadget module</description>
<vendor name="Atlassian Software Systems" url="http://www.atlassian.com"/>
<version>1.0</version>
</plugin-info>
<gadget key="unique-gadget-key" location="gadget.xml"/>
</atlassian-plugin>
</atlassian-plugin>
and my gadget.xml which i put in the resources directory is:
<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="JIRA Issues" author_email="adent#example.com" directory_title="JIRA Issues"
screenshot="images/screenshot.png"
thumbnail="images/thumbnail.png">
<Optional feature="dynamic-height" />
</ModulePrefs>
<Content type="html">
<![CDATA[
Hello, world!
]]>
</Content>
</Module>
</xml>
which I copied from https://developer.atlassian.com/display/GADGETS/Creating+your+Gadget+XML+Specification
yet I still get
It looks like you have one plugin descriptor nested inside another plugin descriptor. (I'm surprised that it actually passed validation!)
Change this:
<atlassian-plugin name="Hello World" key="example.plugin.helloworld" plugins-version="2">
<plugin-info>
<description>A basic gadget module</description>
<vendor name="Atlassian Software Systems" url="http://www.atlassian.com"/>
<version>1.0</version>
</plugin-info>
<gadget key="unique-gadget-key" location="gadget.xml"/>
</atlassian-plugin>
to just this:
<gadget key="unique-gadget-key" location="gadget.xml"/>
Related
I am new to Confluence. I am playing decorators and CSS.
This is my atlassian-plugin.xml:
<plugin-info>
<description>${project.description}</description>
<version>${project.version}</version>
<vendor name="${project.organization.name}" url="${project.organization.url}" />
<param name="plugin-icon">images/ohanaFavicon.png</param>
<param name="plugin-logo">images/ohanaPluginLogo.gif</param>
</plugin-info>
<resource type="i18n" name="i18n" location="mysite" />
<web-resource key="mysite-resources" name="mysite Web Resources">
<dependency>com.atlassian.auiplugin:ajs</dependency>
<context>mysite</context>
</web-resource>
<theme key="mysiteheme" name="Mysite Theme" class="com.atlassian.confluence.themes.BasicTheme">
<description>A theme for tests</description>
<param name="includeClassicStyles" value="false" />
<resource type="download" name="default-theme.css" location="/includes/css/default-theme.css">
<param name="source" value="webContext" />
</resource>
<resource type="download" name="mysite.css" location="/theme-mysite/css/mysite.css" />
<resource type="download" name="mysite.js" location="/theme-mysite/js/mysite.js" />
<resource type="download" key="images" name="images/" location="/theme-mysite/images"/>
<layout key="${atlassian.plugin.key}:main" />
</theme>
<layout key="main" name="Main Decorator" overrides="/decorators/main.vmd" class="com.atlassian.confluence.themes.VelocityDecorator">
<resource type="velocity" name="decorator" location="/theme-mysite/decorators/main.vmd" />
</layout>
In mysite.css, I have the following CSS rule:
background: url(images/header-bkgd.png) 5px -115px;
However, I am not able to see the display of the background image. What is missing in what I did? The "images" directory is under "theme-mysite" directory, which is under the "resources" directory.
A broader question: I have read the book <> and did quite online search. But I am still not able to find any sample or tutorial explaining how to refer background images in a CSS file. Where to acquire such knowledge?
Best.
Update
I tried this:
background: url(../images/header-bkgd.png)
When looking at the change in Confluence, Chrome shows 404 for the image and the path to it is:
http://localhost:1990/confluence/s/en_GB/6441/NOCACHE/1.0.0-SNAPSHOT/_/download/resources/images/header-bkgd.png
I also tried
background: url(../theme-mysite/images/header-bkgd.png);
The generated path in Chrome is:
http://localhost:1990/confluence/s/en_GB/6441/NOCACHE/1.0.0-SNAPSHOT/_/download/resources/theme-mysite/images/header-bkgd.png
The image does not exist either.
You try to change like this
background: url(../images/header-bkgd.png) 5px -115px;
Finally got it resolved myself. I need to add this:
<resource type="download" key="images" name="images/" location="/theme-mysite/images"/>
outside '...'
We use Jira.. like many others.. but we also use a forum for our business discussions board and have been since before Jira existed, so we have a lot of historical information in there.
It is possible to add "Gadgets" to the dashboard, but is it possible to add a webview somewhere?
Follow this guide:
https://developer.atlassian.com/jiradev/jira-platform/guides/dashboards/tutorial-writing-gadgets-for-jira
Open src/main/resources/gadget.xml:
<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="__MSG_gadget.title__" directory_title="__MSG_gadget.title__"
description="__MSG_gadget.description__">
<Optional feature="gadget-directory">
<Param name="categories">
JIRA
</Param>
</Optional>
<Optional feature="atlassian.util" />
<Optional feature="auth-refresh" />
<Require feature="views" />
<Require feature="settitle"/>
<Require feature="oauthpopup" />
#oauth
<Locale messages="__ATLASSIAN_BASE_URL__/download/resources/jira-gadget-tutorial-plugin/i18n/ALL_ALL.xml"/>
</ModulePrefs>
<Content type="html" view="profile">
<!-- omitted for now -->
</Content>
</Module>
Did you see:
<Content type="html" view="profile">
<!-- omitted for now -->
</Content>
Just insert your frame here:
<Content type="html" view="profile">
<iframe src="your forum url">
</Content>
all
I want to manage freeswitch gateway by lua,how to do it?
such as:
<configuration name="lua.conf" description="LUA Configuration">
<settings>
<param name="xml-handler-script" value="gen_dir_user_xml.lua" />
<param name="xml-handler-bindings" value="directory" />
</settings>
</configuration>
this is manage the users configuration.
thanks
why to add lua code? this question is required config file and any lua code,but it has lua code.. the user management lua code so:
local req_domain = params:getHeader("domain")
local req_key = params:getHeader("key")
local req_user = params:getHeader("user")
local req_password = params:getHeader("pass")
local dbh = freeswitch.Dbh("freeswitch","postgres","tttt");
freeswitch.consoleLog("NOTICE","start connect DB...\r\n");
assert(dbh:connected());
dbh:query("select password from users where id="..req_user,function(row)
freeswitch.consoleLog("NOTICE",string.format("%s\n",row.password))
req_password=string.format("%s",row.password)
end);
dbh:release();
freeswitch.consoleLog("NOTICE","info:"..req_domain.."--"..req_key.."--"..req_user.."--"..req_password.."\n");
--assert (req_domain and req_key and req_user,
--"This example script only supports generating directory xml for a single user !\n")
if req_domain ~= nil and req_key~=nil and req_user~=nil then
XML_STRING =
[[<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="freeswitch/xml">
<section name="directory">
<domain name="]]..req_domain..[[">
<params>
<param name="dial-string"
value="{presence_id=${dialed_user}#${dialed_domain}}${sofia_contact(${dialed_user}#${dialed_domain})}"/>
</params>
<groups>
<group name="default">
<users>
<user id="]] ..req_user..[[">
<params>
<param name="password" value="]]..req_password..[["/>
<param name="vm-password" value="]]..req_password..[["/>
</params>
<variables>
<variable name="toll_allow" value="domestic,international,local"/>
<variable name="accountcode" value="]] ..req_user..[["/>
<variable name="user_context" value="default"/>
<variable name="directory-visible" value="true"/>
<variable name="directory-exten-visible" value="true"/>
<variable name="limit_max" value="15"/>
<variable name="effective_caller_id_name" value="Extension ]] ..req_user..[["/>
<variable name="effective_caller_id_number" value="]] ..req_user..[["/>
<variable name="outbound_caller_id_name" value="${outbound_caller_name}"/>
<variable name="outbound_caller_id_number" value="${outbound_caller_id}"/>
<variable name="callgroup" value="techsupport"/>
</variables>
</user>
</users>
</group>
</groups>
</domain>
</section>
</document>]]
else
XML_STRING =
[[<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="freeswitch/xml">
<section name="directory">
</section>
</document>]]
end
Look at fusionpbx source code, it has lots of Lua code.
Is there anyway to get Spring.Net to log what it's doing as it constructs objects? Something on the order of
Constructing Object A
Constructing Object B
etc etc.....
I need to resolve a circular dependency within my application, and seeing the order in which Spring is creating the objects could be a huge help.
This can easily be done. Spring uses Common.Logging. You can grab logging output from Spring.Objects.Factory.* classes and look for ... Creating instance of Object 'your-id-here' ... messages.
Note that you have to log at DEBUG level, which means you'll see quite a lot of other information too.
The following app.config would log creation calls to the console, using log4net:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="common">
<section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" />
</sectionGroup>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>
</configSections>
<common>
<logging>
<factoryAdapter type="Common.Logging.Log4Net.Log4NetLoggerFactoryAdapter, Common.Logging.Log4Net">
<arg key="configType" value="INLINE" />
</factoryAdapter>
</logging>
</common>
<log4net>
<appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender">
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger %ndc - %message%newline" />
</layout>
</appender>
<!-- this logger will catch creation messages -->
<logger name="Spring.Objects.Factory">
<level value="DEBUG" />
<appender-ref ref="ConsoleAppender" />
</logger>
</log4net>
</configuration>
So most of this is boiler-plate Common.Logging and log4net configuration, which is well documented on the Common.Logging website. If you want to append to a file or something else, see the log4net docs.
I'm doing a site definition for SharePoint 2007. When the site is created, a document library called "Folder2" is created also. Now, I need to add some documents to this document library and appear as items in the document library standard views.
My code is:
<Lists>
<List FeatureId="00bfea71-e717-4e80-aa17-d0c71b360101" Type="101" Title="Folder2" Url="Folder2">
<Data>
<Rows>
<Row>
<Field Name="Name">MyFile.txt</Field>
<Field Name="Title">MyFile.txt</Field>
<Field Name="FileLeafRef">MyFile.txt</Field>
</Row>
</Rows>
</Data>
</List>
</Lists>
When I see the items of the Document Library there is one element with title "1_". Does anybody know how to add files in a site definition?
The onet.xml I used is the same as blank site.
Thanks!!!
For Document Libraries, instead of Data/Rows/Row, use Modules:
<Lists>
<List FeatureId="00bfea71-e717-4e80-aa17-d0c71b360101" Type="101" Title="Folder2" Url="Folder2" />
</Lists>
<Modules>
<Module Name="Documents" />
</Modules>
Then in Modules at the bottom of onet.xml, you can define your Module as follows:
<Module Name="Documents" Url="Folder2" Path="">
<File Url="MyFile.txt" Name="MyFile.txt" Type="GhostableInLibrary">
<Property Name="Title" Value="MyFile.txt" />
</File>
</Module>