Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to export data from Java class structure #1

Open
aparod opened this issue Sep 21, 2015 · 2 comments
Open

Add ability to export data from Java class structure #1

aparod opened this issue Sep 21, 2015 · 2 comments

Comments

@aparod
Copy link

aparod commented Sep 21, 2015

I started using this library hoping to be able to read an ONIX file into Java, make changes, then output my changes to a different file. Jonix makes the first two tasks easy, but there seems to be no support for exporting data directly from the Java classes. I would like to be able to do something like this:

File outputFile = new File("/path/to/output/file.xml");
PrintStream printStream = new PrintStream(outputFile);

ONIXWriter onixWriter = new ONIXWriter(header, product); // or maybe an ONIXMessage
onixWriter.setOnixVersion(3);
onixWriter.setOutputFormat("xml"); // Or JSON, CSV, etc
onixWriter.setPrintStream(printStream);
onixWriter.write();
@zach-m
Copy link
Owner

zach-m commented Sep 21, 2015

Hi Adam
Exporting back to XML is not something i've seen much demand for. and therefore never included it in my roadmap.
Nevertheless, it isn't too difficult to implement. I might be adding it soon..
Regards
Zach

On 21 בספט׳ 2015, at 20:11, Adam Parod notifications@github.com wrote:

I started using this library hoping to be able to read an ONIX file into Java, make changes, then output my changes to a different file. Jonix makes the first two tasks easy, but there seems to be no support for exporting data directly from the Java classes. I would like to be able to do something like this:

File outputFile = new File("/path/to/output/file.xml");
PrintStream printStream = new PrintStream(outputFile);

ONIXWriter onixWriter = new ONIXWriter(header, product); // or maybe an ONIXMessage
onixWriter.setOnixVersion(3);
onixWriter.setOutputFormat("xml"); // Or JSON, CSV, etc
onixWriter.setPrintStream(printStream);
onixWriter.write();

Reply to this email directly or view it on GitHub.

@BuddhaOhneHals
Copy link

Hi Zach,
thank you for the library and your work!

I have to convert an ONIX 2 format into ONIX 3 and wanted to use your library for that. Is it possible to convert a Onix2-Product (or a BaseProduct) into a Onix3-Product and then somehow generate the XML for the product?

Thanks and best regards,
Timo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants