How can I call PlaySQL and Graphviz plugin macros in my own plugin?

Parimal Patel March 31, 2014

Hi,

I want to achieve the functionalities as described below:

1) Get Object reference of Macros from PlaySQL and Graphviz

2) Run a query, parse the results and substitute them into a script for graphviz

3) Pass this script to graphviz macro

4) Save the generated graph to Page

I am a newbie to confluence architecture and intermediate to OSGi concepts.

Can you guide me in this ?

And also help me to fill in the gaps in procedure ..

Thanks & regards,

Parimal

2 answers

1 accepted

1 vote
Answer accepted
Bob Swift OSS (Bob Swift Atlassian Apps)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 1, 2014

If you have your own plugin, the easiest way is to generate wiki markup for the graphviz macro including body (with your graphviz script) and run it through the wiki subrenderer to generate the html.

Parimal Patel April 1, 2014

Hi Bob,

Thanks for reply..

Can you elaborate with these two things:

  1. Generating wiki markup
  2. Run markup through wiki subrenderer

Meanwhile I will search on the approach suggested by you.

Cheers

Bob Swift OSS (Bob Swift Atlassian Apps)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 1, 2014

Can't really add much. You have code so you can generate a string representing the wiki markup for the graphviz macro you want to have displayed. Your plugin needs get the wiki subrender component (via injection or any other means you prefer) and use the render API.

1 vote
Adrien Ragot 2
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 31, 2014

Hi Parimal,

I'm not a user of Graphviz; Are you trying to make a graph from the results of a query? You may avoid creating a plugin if you succeed to nest the "Play SQL" inside of the "Graph from table" one. Have you already tried and was that suitable?

Cheers

Parimal Patel March 31, 2014

Thanks Adrien,

No.. actually I haven't tried this.

I have prepared one script for graphviz which will display Ports of a Network Switch.

According to me, the results obtained from a query can be used to substitute node labels in my graphviz script..

After this I can easily convert it to graphs using Graphviz.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events