简体   繁体   中英

Atlassian Confluence Blueprint wizard - Non existent soy template

I am building a confluence plugin including blueprint wizard dialog with blueprint. But when I try to load the wizard JS error appears in browser console,

Uncaught error wizard points to a non-existent Soy template, OutputPlugin.Blueprints.Simple.page1Form'. Check your web-resources or server logs.

What I have tried are,

  • Checked server logs. No evidence was there.
  • Tried clean and reinstall plugin and SDK.

However, I have already added soy into web resources in atlassian-plugin.xml file.

I followed atlassian confluence plugin tutorial " Write an intermediate blueprint plugin "

I am using Confluence 6.14.0 and atlasisian SDK 8.16.0

atlassian-plugin.xml

<web-resource key="ma2.create_wizard-resources" name="ma2.create_wizard Web Resources">
        ...
        <transformation extension="soy">
            <transformer key="soyTransformer">
                <functions>com.atlassian.confluence.plugins.soy:soy-core-functions
                </functions>
            </transformer>
        </transformation>

        ...
        <resource type="download" name="outputTemplate.soy.js" location="/soy/outputTemplate.soy" />
</web-resource>

<blueprint key="output-blueprint" content-template-key="output-template" index-key="output-index" i18n-name-key="output.blueprint.name">
        <content-template ref="output-template"/>
        <dialog-wizard key="outputTemplate-wizard">
            <dialog-page id="page1Id"
                         template-key="OutputPlugin.Blueprints.Simple.page1Form"
                         title-key="output.blueprint.wizard.page1.title"
                         description-header-key="test"
                         description-content-key="test1"
                         last="true"/>
        </dialog-wizard>
</blueprint>

outputTemplate.soy

{namespace OutputPlugin.Blueprints.Simple}
/**
* A form that accepts a person's name
*/ 
{template .page1Form}
    <form action="#" method="post" class="aui">
        <fieldset>
            <div class="field-group">
                <label for="contentvar">{getText('output.blueprint.form.label.title.vName')}</label>
                <input id="contentvar" class="text" type="text" name="contentVar">
            </div>
        </fieldset>
    </form>
{/template}

Finally found the solution. First problem was my server console did not logged necessary logs. There were only java jdk and synchrony logs. So I configured logs as mentioned in this confluence support page to have all the logs of "com.atlassian.confluence.core". Then I found the error

[INFO] [talledLocalContainer] com.atlassian.soy.impl.QuieterSoySyntaxException: In file /soy/outputTemplate.soy: End of SoyDoc not at end of line [line 4, column 1].

Finally the problem was a space after end of soy doc.

/**
 * A form that accepts a person's name
 */{space}

instead of

/**
 * A form that accepts a person's name
 */

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM