Hi to all,
I created a own blueprint plugin based on the Atlassian tutorial simple / intermediate.
Everything works fine (page created / title set by context provider), but the rules I attached in my JavaScript file are ignored. I also tried to push a simple alert to the front end, it will be ignored also.
I can´t see any wrong code, also the script works in the first versions of my plugin.
Soy
{namespace SlaBpPlugin.Blueprints.Simple}
/**
* A form to insert SLA data
*/
{template .page1Form}
<form action="#" method="post" class="aui">
<fieldset>
<div class="field-group">
<label for="slaId">{getText('slabp.form.label.title.slaId')} <span class="aui-icon icon-required">required</span></label>
<input id="slaId" class="text" type="text" name="slaId">
</div>
<div class="field-group">
<label for="slaName">{getText('slabp.form.label.title.slaName')} <span class="aui-icon icon-required">required</span></label>
<input id="slaName" class="text" type="text" name="slaName">
</div>
<div class="field-group">
<label for="slaDescription">{getText('slabp.form.label.title.slaDescription')}</label>
<input id="slaDescription" class="text" type="text" name="slaDescription">
</div>
<div class="field-group">
<label for="template-key">{getText('slabp.form.label.templatekey')}</label>
<select id="template-key" class="select" name="contentTemplateKey">
<option value="sla_de_bp01">{getText('slabp.blueprint.title.sla_de_bp01')}</option>
<option value="sla_at_bp01">{getText('slabp.blueprint.title.sla_at_bp01')}</option>
</select>
</div>
</fieldset>
</form>
{/template}
JS
Confluence.Blueprint.setWizard('com.riso.confluence.addon.slabp.slabp:create-by-sample-template', function(wizard) {
wizard.on('submit.page1Id', function(e, state) {
var slaId = state.pageData.slaId;
var slaName = state.pageData.slaName;
if (!slaId){
alert('Please provide an ID for this SLA.');
return false;
}
if (!slaName){
alert('Please provide a name for this SLA.');
return false;
}
});
});
XML
<atlassian-plugin key="${atlassian.plugin.key}" 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="slabp"/>
<!-- add our web resources -->
<web-resource key="slabp-resources" name="slabp Web Resources">
<dependency>com.atlassian.auiplugin:ajs</dependency>
<dependency>com.atlassian.confluence.plugins.confluence-create-content-plugin:resources</dependency>
<transformation extension="soy">
<transformer key="soyTransformer">
<functions>com.atlassian.confluence.plugins.soy:soy-core-functions
</functions>
</transformer>
</transformation>
<resource type="download" name="slabp.css" location="/css/slabp.css" />
<resource type="download" name="slabp.js" location="/js/slabp.js" />
<resource type="download" name="slabp.soy.js" location="/soy/slabp.soy" />
<resource type="download" name="images/" location="/images" />
<context>create-content</context>
</web-resource>
<!-- Template for Blueprint -->
<content-template key="sla_de_bp01" i18n-name-key="slabp.blueprint.title.sla_de_bp01">
<resource name="template" type="download" location="/templates/sla_de_bp01.xml" />
context-provider class="com.riso.confluence.addon.slabp.SlaBpContextProvider" />
</content-template>
<!-- Second Template for Blueprint -->
<content-template key="sla_at_bp01" i18n-name-key="slabp.blueprint.title.sla_at_bp01">
<resource name="template" type="download" location="/templates/sla_at_bp01.xml" />
</content-template>
<!-- Add to the Create Menu -->
<web-item key="create-by-sample-template" i18n-name-key="slabp.create-link.title" section="system.create.dialog/content">
<description key="slabp.create-link.description" />
<resource name="icon" type="download" location="/images/templateSymbol.png" />
<param name="blueprintKey" value="sla-blueprint" />
</web-item>
<!-- Blueprint -->
<blueprint key="sla-blueprint" index-key="my-index" i18n-name-key="slabp.name"
how-to-use-template="SlaBpPlugin.Blueprints.Simple.letsGetStarted">
<content-template ref="sla_de_bp01" />
<content-template ref="sla_at_bp01" />
<dialog-wizard key="slabp-wizard">
<dialog-page id="page1Id"
template-key="SlaBpPlugin.Blueprints.Simple.page1Form"
title-key="slabp.wizard.page1.title"
description-header-key="slabp.wizard.page1.desc.header"
description-content-key="slabp.wizard.page1.desc.content"
last="true" />
</dialog-wizard>
</blueprint>
</atlassian-plugin>
Regards
Uli
Hello Uli,
Hope you are having a pleasant week. I would recommend sharing this at our Atlassian Developer Community, since those members would have more experience developing a blueprint for Confluence than here.
This community is more end-users, whereas the Developer community has users who are also interested in developing for Atlassian products.
Let me know if you have any trouble!
Regards,
Shannon
Hi Shannon,
thank you for your reply.
I opened an new issue in the developer community.
Regards
Uli
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Uli,
Thank you for letting me know! When it's resolved, you can also follow-up here and let us know the solution, in case anyone else ended up on Community with the same problem.
Regards,
Shannon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Shannon,
here the link to Developer Community post:
https://community.developer.atlassian.com/t/blueprint-wizard-js-is-ignored/32752
Regards
Uli
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for sharing, Uli! Hopefully someone there will be able to help you out.
Take care, and have a pleasant week.
Regards,
Shannon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.