pocket query data location

Hi

Where is pocketquery template and query data located? Is the data  within a database or within some configuration files?

I am asking because I need to remove one particular template which has rendered my entire pocketquery admin page useless. 

I tried to re install pocketquery add-on but the action didn't remove my existing queries and templates.

Tnx.

 

 

 

5 answers

1 accepted

1 vote
Accepted answer

I see. Please note that PocketQuery has a JS wrapper around the Google Chart library, so you should never need such code as above. The main problem in your case, however, is that you have <html>, <head> and <body> elements around your code. This is wrong since the template will be rendered within an existing HTML document. This is probably what broke your code. Otherwise, the correct template for you would probably be something like:

PocketQuery.chart('MotionChart', {
	dataTable: [
		['Apples',  new Date (1988,0,1), 1000, 300, 'East'],
  	    ['Oranges', new Date (1988,0,1), 1150, 200, 'West'],
        ['Bananas', new Date (1988,0,1), 300,  250, 'West'],
        ['Apples',  new Date (1989,6,1), 1200, 400, 'East'],
        ['Oranges', new Date (1989,6,1), 750,  150, 'West'],
        ['Bananas', new Date (1989,6,1), 788,  617, 'West']
	]
});

However, I still don't understand how a PocketQuery template can have influence on the admin screen. I guess you already deleted the template and don't have a screenshot?

I found the solution

connect to confluence database and execute query

update confluence.bandana set bandanavalue='test' where bandanakey='anime';

 

Anime is the name of problematic pocketquery template.

This fixes the problem.

Hi Delisa,

Actually, the keys are not simply the names, but a (long) namespace like: de.scandio.confluence.plugins.pocketquery.templates.anime

However, I don't quite understand this:

has rendered my entire pocketquery admin page useless

How did you achieve this? The templates are not rendered on the admin screen.

Regards, Felix [Scandio]

Hi Felix

I was playing with animation libraries for google charts and I pasted this code into template.

After that, admin screen showed only template area. It was broken, and only action allowed was to add new template. After a new template would be added into broken admin screen, postback returned only one json line. 

 

&lt;html&gt;
  &lt;head&gt;
    &lt;script type="text/javascript" src="https://www.google.com/jsapi"&gt;&lt;/script&gt;
    &lt;script type="text/javascript"&gt;
      google.load("visualization", "1", {packages:["motionchart"]});
      google.setOnLoadCallback(drawChart);
      function drawChart() {
        var data = new google.visualization.DataTable();
        data.addColumn('string', 'Fruit');
        data.addColumn('date', 'Date');
        data.addColumn('number', 'Sales');
        data.addColumn('number', 'Expenses');
        data.addColumn('string', 'Location');
        data.addRows([
          ['Apples',  new Date (1988,0,1), 1000, 300, 'East'],
          ['Oranges', new Date (1988,0,1), 1150, 200, 'West'],
          ['Bananas', new Date (1988,0,1), 300,  250, 'West'],
          ['Apples',  new Date (1989,6,1), 1200, 400, 'East'],
          ['Oranges', new Date (1989,6,1), 750,  150, 'West'],
          ['Bananas', new Date (1989,6,1), 788,  617, 'West']
        ]);

        var chart = new google.visualization.MotionChart(document.getElementById('chart_div'));

        chart.draw(data, {width: 600, height:300});
      }
    &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;div id="chart_div" style="width: 600px; height: 300px;"&gt;&lt;/div&gt;
  &lt;/body&gt;
&lt;/html&gt;

Kind Regards

Regarding the query, the bandanacontext attribute has value: 

'de.scandio.confluence.plugins.pocketquery.entities.Template',

but the name of actual template is saved within "bandanakey" attribute as a single string.

The entire xml with a namespace, name tag and content tag is saved as 'bandanavalue'.

Example:

&lt;de.scandio.confluence.plugins.pocketquery.entities.Template&gt;                                                  
    &lt;name&gt;geochart&lt;/name&gt;                                                                                        
         &lt;content&gt;&amp;lt;script&amp;gt;&amp;#x0D;                                                                                
               PocketQuery.chart(&amp;apos;drawMarkersMap&amp;apos;, {&amp;#x0D;                                                          
               showTip: true,&amp;#x0D;                                                                                       
               dataTable: [&amp;#x0D;                                                                                         
               [&amp;apos;Town&amp;apos;, &amp;apos;Population&amp;apos;],&amp;#x0D;                                                      
               [&amp;apos;Zagreb&amp;apos;, &amp;apos;Zagreb: 1,363,800,000&amp;apos;],&amp;#x0D;                                         
               [&amp;apos;Split&amp;apos;, &amp;apos;Split: 1,242,620,000&amp;apos;]&amp;#x0D;                                            
                   ]&amp;#x0D;                                                                                                    
               });&amp;#x0D;                                                                                                      
               &amp;lt;/script&amp;gt;&lt;/content&gt;                                                                                      
&lt;/de.scandio.confluence.plugins.pocketquery.entities.Template&gt;

 

Regards

 

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Oct 31, 2018 in Marketplace Apps

Marketplace Spotlight: Zephyr

Hello Atlassian Community! Each month, we run a series of Spotlights to highlight Marketplace vendors and apps that our team thinks this Community would find valuable. In last month's Spotlig...

344 views 0 1
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