Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to initialize a xhtml renderer

Florian February 26, 2013

I try to initialize the com.atlassian.confluence.content.render.xhtml.Renderer but had no luck so far to figure out how...

Could anybody give me some tips or point me to the right direction?

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
Mirko Skramusky
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.
February 26, 2013

Hi Florian!

You can inject the component named "viewRenderer", it's an instance of this Renderer interface.

Regards

Florian February 27, 2013

Hi Mirko

I tried to inject it via

public void setviewRenderer(Renderer viewRenderer)
	{
	    this.viewRenderer = viewRenderer;
	}

as written here: https://developer.atlassian.com/display/CONFDEV/Accessing+Confluence+Components+from+Plugin+Modules

but its still null when I try to use it.

Mirko Skramusky
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.
February 27, 2013

Can you please try it with "setViewRenderer" (camel case) or simply "setRenderer"? The component is available, we only have to find the correct naming for dependency injection. ;) You can check for plugin available components in the following list:

<confluence-url>/admin/pluginexports.action

Florian February 27, 2013

Thanks for the pluginexports link!

I noticed it says something about V2 so I changed my code to:

private final Renderer viewRenderer;
    
    public MyClass( Renderer viewRenderer ){
    	this.viewRenderer = viewRenderer;
    }

and it worked!

Thanks! :)

TAGS
AUG Leaders

Atlassian Community Events