In the Remote API v1, we can create pages using wiki markup, but when it come to Confluence version 4, wiki markup is not available anymore. So may I know is there an easy one method way to convert the wiki markup generated in our current remote API client to XHTML and store it in database? Instead of changing the whole remote API client structure to generate XHTML content?
Community moderators have prevented the ability to post new answers.
Actually, you can continue to use the wiki markup with the v1 apis to create/update pages. You can no longer view the page information in wiki markup though.
If you use v2 APIs, then the page information has to be in xhtml format as well.
To convert the wiki markup to xhmtl, Use the convertWikiToStorageFormat(String token, String markup) method. This is available in both v1 and v2 apis. More details are at https://developer.atlassian.com/display/CONFDEV/Confluence+XML-RPC+and+SOAP+APIs
Aoyan is correct, we've introduced a new method called {{convertWikiToStorageFormat}}. You can learn more about the API changes here: https://developer.atlassian.com/display/CONFDEV/Changes+to+the+remote+API+in+Confluence+4.0
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank for the answer, very helpful. Now I the only remaining question is how to detect if a page is returned in XHTML or Wiki format?
I need this in order to provide backwards compatibility for a API that allows you to update wiki pages.
Still, I have no idea how to guess if getPage() returns XHTML or Wiki syntax.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Matthew,
Thanks for your reply. I need to extract pages and blog information using the SOAP API and index it with a search engine. Right now when I do this, I'm getting macros e.g. {viewfile} and things like that in my search results so I need to do a cleanup to display user friendly data.
I was checking the documentation for renderContent, looks like it is what I need. Do you know if no macros or wiki markup is removed when this method is used?
Thanks in advance!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Guys,
I'm using version 3.5 and I'm extracting page information using the SOAP API. For pages created using the Wiki Markup Language I get the content in that format, but I would like to convert it to XHTML or any other format without the wiki tags?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Katherine,
Confluence 3.5 does not use the XHTML format. If you want to convert it you will need to use a Confluence server running 4.0 or newer. What is your use case? You might find the renderContent method useful.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.