Help - please! I've created a blueprint and want to skip the Editor / have the page created automatically when the user completes the information in the soy wizard.
I able to get a title field to display in the soy wizard. And I can get the input from that field to populate the title field when the editor page is displayed. However, I can't get my blueprint to skip the editor page. I always still have to click "Create" at the bottom of the Editor page to create the page.
I have used the following documentation as a base:
https://developer.atlassian.com/display/CONFDEV/Javascript+API+for+blueprint+wizards
Specifically, here's what I did:
1. Added the following entries to my atlassian-plug.xml file:
<transformation extension="js"> <transformer key="jsI18n"/> </transformation> <resource name="create-article-listener.js" location="com/atlassian/confluence/plugins/filelist/js/create-article-listener.js" type="download"/>
2. Added the create-result="view" attribute to my blueprint module so it now looks like this:
<blueprint key="newsarticle-blueprint" name="News article template" index-key="news-draft" create-result="view" > <content-template ref="newsarticle-content-template" /> <dialog-wizard key="newsarticle-wizard" > <dialog-page id="page1Id" template-key="MyPlugin.Blueprints.newsarticle.page1Form" title-key="my.blueprint.wizard.page1.title" description-header-key="my.blueprint.wizard.page1.desc.header" description-content-key="my.blueprint.wizard.page1.desc.content" /> </dialog-wizard> </blueprint>
3. Created a JavaScript file named create-article-listener.js that contains the following content:
(function ($) { function validate($container, spaceKey) { var $titleField = $container.find("#newsarticle-content-template-title"), pageTitle = $.trim($titleField.val()), error; if (!pageTitle) { error = AJS.I18n.getText("article.blueprint.wizard.form.validation.name.required"); } else if (!Confluence.Blueprint.canCreatePage(spaceKey, pageTitle)) { error = AJS.I18n.getText("article.blueprint.wizard.form.validation.name.exists"); } if (error) { $titleField.focus().siblings(".error").html(error); return false; } return true; } function page1Submit(ev, state) { return validate(state.$container, state.wizardData.spaceKey); } Confluence.Blueprint.setWizard('com.plugins.confluence.newsarticle.newsarticle:create-news-article', function(wizard) { wizard.on("submit.page1Id", page1Submit); }); })(AJS.$);
4. Added a div class to my soy template for the field title. Soy template (excerpt) looks like this:
<div class="field-group"> <label for="newsarticle-content-template-title">Article title</label> <input id="newsarticle-content-template-title" class="text long-field" type="text" name="title" placeholder="{getText('article.blueprint.wizard.form.label.name.placeholder')}" maxlength="255"> <div class="error"></div> </div>
Community moderators have prevented the ability to post new answers.
This is simple, in your atlassian-plugin.xml descriptor , under your blueprint element, do this ... :
<blueprint key="<your blueprint key>" ...... create-result="view">
...
....
</blueprint>
create-result="view" will skip the editor.
I gave it a try, but it still doesn't work !
Here is my post about the same issue : https://answers.atlassian.com/questions/39989714
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You forgot to add the content-template-key, and keep the index-key blank. Also put the i18n-name-key, set its value in your i18n properties file. Remove the name attribute.
<blueprint key="newsarticle-blueprint" content-template-key="
newsarticle-content-template" index-key="" create-result="view" i18n-name-key="my.blueprint.title" >
<content-template ref="newsarticle-content-template" />
<dialog-wizard key="newsarticle-wizard" >
<dialog-page id="page1Id" template-key="MyPlugin.Blueprints.newsarticle.page1Form"
title-key="my.blueprint.wizard.page1.title"
description-header-key="my.blueprint.wizard.page1.desc.header"
description-content-key="my.blueprint.wizard.page1.desc.content" />
</dialog-wizard>
</blueprint>
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.