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:
- writing macro accesses rest endpoint , converts results table.
- 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
Post a Comment