How to prevent script running when a page loads

Hi,

I am a consultant working at WorldPay in the UK. WorldPay are using Confluence 5.0 with the sql-script, run, and script plugins. WorldPay has paid for the sql-script pugin, and is evaluating the other two.

This is the markup:

<ac:macro ac:name="panel">
  <ac:rich-text-body>
    <p>Moved to own space: <ac:link>
        <ri:page ri:content-title="Reference Data Home" ri:space-key="RDS"/>
      </ac:link>
    </p>
  </ac:rich-text-body>
</ac:macro>
<p> </p>
<h2>BobSwift SQL Macro</h2>
<h4>The following table selects all records from the tmpControl table in the RelMgr MySQL database on UKDC1-TC-JIR02</h4>
<ac:macro ac:name="sql">
  <ac:parameter ac:name="dataSource">relmgr</ac:parameter>
  <ac:parameter ac:name="atlassian-macro-output-type">BLOCK</ac:parameter>
  <ac:plain-text-body><![CDATA[select * from tmpControl]]></ac:plain-text-body>
</ac:macro>
<p> </p>
<h3>Add or update values</h3> <ac:macro ac:name="run"> <ac:parameter ac:name="replace">A:default:Name,B:default:Value</ac:parameter> <ac:parameter ac:name="id">SQLTest1</ac:parameter> <ac:parameter ac:name="autoRun">false</ac:parameter> <ac:parameter ac:name="titleReset">Clear</ac:parameter> <ac:parameter ac:name="exportVersion">replace</ac:parameter> <ac:parameter ac:name="atlassian-macro-output-type">BLOCK</ac:parameter> <ac:parameter ac:name="titleRun">Update</ac:parameter> <ac:rich-text-body> <ac:macro ac:name="sql"> <ac:parameter ac:name="dataSource">relmgr</ac:parameter> <ac:parameter ac:name="atlassian-macro-output-type">BLOCK</ac:parameter> <ac:plain-text-body><![CDATA[insert into tmpControl set name='$A', value='$B']]></ac:plain-text-body> </ac:macro> </ac:rich-text-body>

The bold section is run whenever the page is loaded or refreshed (e.g. whenthe Preview button is pressed). How do we make it so that the macros in the highlighted section are run only when the button is pressed, i.e on demand?

Many thanks,

Steve Brown

1 answer

This widget could not be displayed.

To be clear the macro is the one after the "Add or update values" heading.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Aug 22, 2018 in Marketplace Apps

How a Marketplace app tech team is achieving gender diversity

Hello! My name is Genevieve Blanch, and I'm the Marketing Manager at RefinedWiki, creators of apps to give teams the tools to customize Atlassian platforms. Currently, 44% of the tech team at Re...

490 views 3 18
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you