Re: [oXygen-user] Read from database?

You should start with the example code from the Author Developer Guide which is also included in the Author SDK as a PDF document: http://www.oxygenxml.com/doc/ug-oxygen/topics/dg-java-api.html http://www.oxygenxml.com/doc/ug-oxygen/tasks/dg-configuring-actions-menus-to... The Java source code of the built-in actions displayed in Author mode on the toolbar and the contextual menu of the DITA editor is located in the Author SDK in the folder samples/Oxygen Default Frameworks/src/ro/sync/ecss/extensions/dita Please look at the classes ro.sync.ecss.extensions.dita.topic.InsertImageOperation and ro.sync.ecss.extensions.dita.topic.table.InsertTableOperation which require entering data in a dialog box. Best regards, Sorin Roderik Dernison wrote:
Hello,
I'm now looking at the author sdk, because that seems the way to go for me. Which of the samples can I use and what would be the best point to start?
Kind regards,
Roderik Dernison INL
-----Oorspronkelijk bericht----- Van: Sorin Ristache [mailto:sorin@sync.ro] Verzonden: vrijdag 12 augustus 2011 13:41 Aan: Roderik Dernison CC: Oxygen User List Onderwerp: Re: [oXygen-user] Read from database?
Hello,
A Selection Plugin should be used for processing the selected text in the Text editing mode of an editor of type XML (XML files, XSL files, XSD files, etc). If you want to copy the data from a MySQL table to a DITA document you can display the table contents in Oxygen by browsing the database contents in the Data Source Explorer view, right clicking on the table name and selecting the Edit action from the popup menu. This action will display the table in a new Oxygen view as in the following example from the User Manual:
http://www.oxygenxml.com/doc/ug-oxygen/topics/relational-table-explorer.html
Just select and copy the data from the table and paste it in the DITA document opened in Oxygen.
Is this what you want to do?
If you want in fact to customize Author editing mode for editing DITA documents in order to display a popup screen for the user with some data extracted from the MySQL database you should write an Author extension by using the Author API which is available in the Author SDK. There are many examples including the Java source code of Author actions in the SDK:
http://www.oxygenxml.com/InstData/Editor/Developer/oxygenAuthorSDK.zip
http://www.oxygenxml.com/developer.html#XML_Editor_Authoring_SDK
If you want to go this route please let us know if you have problems with the Author API or you get unexplained errors in your Author extension code.
Best regards, Sorin
Roderik Dernison wrote:
Hello,
I use a MySql database. I added the correct driver to the lib directory of Oxygen. I connected it using option 1 you describe. I haven't seen any errors anywhere, not in the output.log. The plugin I use is a SelectionPlugin. I'll try and see what the CustomProtocolPlugin does.
Kind regards,
Roderik Dernison INL
-----Oorspronkelijk bericht----- Van: Sorin Ristache [mailto:sorin@sync.ro] Verzonden: vrijdag 12 augustus 2011 11:34 Aan: Roderik Dernison CC: oxygen-user@oxygenxml.com Onderwerp: Re: [oXygen-user] Read from database?
Hello,
What is the name and version of the database? How did you connect to the database in Oxygen when you could see the data from the database correctly:
1. through a database connection based on a JDBC database driver and defined in Preferences -> Data Sources, (http://www.oxygenxml.com/doc/ug-oxygen/topics/preferences-data-source s.html)
or
2. using a custom protocol plugin developed in Java as described in the User Manual? (http://www.oxygenxml.com/doc/ug-oxygen/tasks/howto-custom-protocol-pl ugin.html)
If you already have a working connection defined in Preferences a simple way of adding the data to the DITA document is to browse the database contents in the Data Source Explorer view, open the XML file or the SQL table containing the data in Oxygen and copy and paste the data from there to the DITA document.
If you connect to the database with a custom protocol plugin please give us more details about the error that you get in the Java code of your plugin (which acts as a database client) when you try to establish the connection with the database server.
Regards, Sorin
Roderik Dernison wrote:
Hi,
I'm trying to write a plugin to select data from a popup screen. This works - more or less - for static data. But when I try (with Spring and Hibernate) to read from a database the popup screen doesn't show up.
The first thing I tried was to make a connection in Oxygen and my data is shown there.
How can I insert data from my database into my (Dita) document?
Kind regards
Roderik Dernison
INL
________________________________
---------------------------------------------------------- Aan dit bericht kunnen geen rechten worden ontleend. Het bericht is alleen bestemd voor de geadresseerde. Indien het bericht niet voor u is bestemd, verzoeken wij u dit aan ons te melden en het bericht te verwijderen.
This message shall not constitute any obligations. This message is intended solely for the addressee. If you have received this message in error, please inform us and delete the message. ----------------------------------------------------------
________________________________
---------------------------------------------------------- Aan dit bericht kunnen geen rechten worden ontleend. Het bericht is alleen bestemd voor de geadresseerde. Indien het bericht niet voor u is bestemd, verzoeken wij u dit aan ons te melden en het bericht te verwijderen.
This message shall not constitute any obligations. This message is intended solely for the addressee. If you have received this message in error, please inform us and delete the message. ----------------------------------------------------------
participants (1)
-
Sorin Ristache