atlassian - Is there a way to use a plugin/macro in Confluence to display results on a page? -


completely hypothetical here, wondering if had thoughts.

i've created rest endpoint in confluence uses rest api browser.

i've had idea involves displaying results rest endpoint on specific confluence page in table form. know if possible?

so user goes confluence page edit , either uses macro or plugin access rest endpoint. rest returns information user requires , user can display information on page.

i thinking have involve either:

  1. writing macro accesses rest endpoint , converts results table.
  2. writing macro accesses rest api browser results , display in table.

i'm not expecting in-depth answers here, i'm wondering if has tried similar? or has thoughts how begin go this? searches haven't brought similar results.

assuming you're on confluence server, start forking simple confluence add-on, e.g. gister.

in execute method, of macro, i'd swap out code there , replace more this:

@override public string execute(map<string, string> parameters,                       string body,                       conversioncontext conversioncontext)         throws macroexecutionexception {     string url = parameters.get("url");             return "<script>/*your code here*/</script><div data=rest-url='"" + url + "\" class=\"macro-rest-api\"></div>"; } 

this started allowing inject correct rest api page.

later you'll need add more parameters it's bit more dynamic.

you can write own javascript in section /*your code here*/ prints table in nearest dicv.macro-rest-api

also, move javascript separate web-resource module can update w/o recompiling.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -