Do IBMSBT has a built in XML to JSON converter in JAVA? - ibm-connections

I'm trying to figure out how to convert XML to JSON in IBMSBT because not all CNX api's and Object does not support tranformation out of the box. (example: Profile) I need to return JSON only.
So before I add yet another 3. party project. Do IBMSBT have a built in XML to JSON converter ?
Thanks for any reply helping me in the right direction

What #PaulBastide is saying: use the
com.ibm.commons.util.io.json
package in com.ibm.commonsxxx.jar, which is part of the SBT

Related

How to convert open api YAML structure to json

I want to make my UI to display all the information about the API.
Can you please tell me the best way to convert YAML structure to json?
Sometime i was also went through this issue and I solve them by using the online tools example : https://onlineyamltools.com/convert-yaml-to-json. that convert YAML structured file into JSON structured file .
but if you need a Javascript parser you can use js-yaml
you can use it to convert yaml to json with your js code.

Parsing and Unmarshing CCD XML using Jaxb

I have a requirement to read and parse CCD xml in my application. It gave me error initially for id attribute which I solved by renaming ID attribute.
But when I try to unmarshal CCD xml to java obj from generated Java classes I am not getting the value for the java object
As CCD xml is quite complex. So what's the best way to parse CCD xml? I am open to use Java. Please suggest.
I suggest using the MDHT CDA API
https://projects.eclipse.org/projects/modeling.mdht
You can download the latest runtime
https://sourceforge.net/projects/oht-modeling/files/Releases/Runtime/
There is also the certification site which uses MDHT
https://sitenv.org
Every time I have parsed a CDA/CCD I use directly XPath expressions to query content, for me this is the easiest and best performance solution.
Martí

Exporting data from JSon

We are creating a map application that has a list view of the resultant set using JSON and jQuery and presenting the result to the user. How can we give the user the ability to download the result as an Excel file/CSV file?
Assuming a web application...
Convert JSON to CSV
Present It as an HTTP response.
You mentioned JSON and jQuery. I assume this is being used on the client side? There are a number of utilities for making the JSON-to-CSV conversion depending on the language you would want to use. Here are some examples.
Javascript/jQuery
PHP
Python

BASE64DecoderStream to Document(org.w3c.dom.Document)

I'm getting the server e-mail an attached file (XML) which is an InputStream and inside contains a BASE64DecoderStream, and would like to turn this into a BASE64DecoderStream Document (org.w3c.dom.Document) for me to do research in XML I'm getting.
Anyone know how to turn?
Already I am very grateful!
You need to use a javax.xml.parsers.DocumentBuilder. Create an org.xml.sax.InputSource wrapping the InputStream you get from the getContent() method,
then use the DocumentBuilder.parse() method. You'll find more details about the JAXP (javax.xml) API in the javadocs.

Fusesource - how to encode/decode base64 within a route

Trying to encode/decode base64 within an XML document that is handled within a route in Fusesource ESB.
We are using Blueprint.xml to try to encode/decode, but cannot find a way to do this.
We need our ruote to convert XML data to base64 string to hit an external webservice that requires some binary. We also need to extract some binary coming back from the webservice response and change this into .pdf (or a string first).
Fuse ESB / Apache Camel offers a number of data formats for encoding/decoding
http://camel.apache.org/data-format.html
Though we don't have a Base64 out of the box. So I have logged a ticket to add such a format in a future release: https://issues.apache.org/jira/browse/CAMEL-5807
You can build a custom data format, or use the message translator EIP pattern with a Java bean and do a bit of java code to do the encoding/decoding yourself. http://camel.apache.org/message-translator.html
There is a camel-fop component for outputting to PDF: http://camel.apache.org/fop.html

Resources