I have an Java application with Jira integration. The Integration means user may create an issue in the Application format and the Application will transfer it to the Jira Server. And vice versa: user firstly may create an issue on the Jira Server and later it will be trasrfered to the Application.
The application persists issue description in XHTML. Jira persits it in own markup. So I need a converter.
I decided to use an com.atlassian.renderer:atlassian-renderer
library. XHTML -> jira conversion is pretty easy:
private DefaultWysiwygConverter converter= new DefaultWysiwygConverter();
String jiraMarkup = converter.convertXHtmlToWikiMarkup(xhtmlString);
But vice versa conversion is unbelievably awfully complex! I can't just call
String xhtmlString= converter.convertWikiMarkupToXHtml(newjiraMarkup);
DefaultWysiwygConverter
need to pass a WikiStyleRenderer
instance. The library doesn't contain a default WikiStyleRenderer
implementation. It has a V2RendererFacade
, but its constructor needs a four arguments. Each one of them is abstraction which need to be implemented some way etc etc...
public V2RendererFacade(RendererConfiguration rendererConfiguration, LinkRenderer defaultLinkRenderer, EmbeddedResourceRenderer defaultEmbeddedRenderer, Renderer renderer) {
this.rendererConfiguration = rendererConfiguration;
this.defaultLinkRenderer = defaultLinkRenderer;
this.defaultEmbeddedRenderer = defaultEmbeddedRenderer;
this.renderer = renderer;
}
Is any simple and straight way to do this conversion? Any working examples?