Open files from exist-database via API

Oxygen general issues.
Chemo
Posts: 19
Joined: Mon Aug 15, 2011 10:57 am

Open files from exist-database via API

Post by Chemo »

Hi.

I try to open an xml-file from an exist database via the oXygen-API, not by webDAV, but by the common xmldb/xmlrpc protocol. I created an exist - Data Source ("eXist-Test") and Data Connections, one with the regular exist drivers ("eXist-Test-Connection") and one with the webDAV FTP source. Both work fine and I can browse my database in the Data Source Explorer with both, the exist-xmlrpc-connection and the webDAV-connection.
I am also able to access the files via API by webDAV:

Code: Select all

String file = xmldb:exist://localhost:8080/exist/webdav/db/dwdsdb/src/E_m_1829.xml;
authorAccess.getWorkspaceAccess().open(new URL(file));
Oxygen then asks for the user name and password.

But I'd rather like to open the file via the xmlrpc/xmldb connection.

None of the following paths are working:

Code: Select all

file = http://localhost:8080/exist/xmlrpc/db/dwdsdb/src/E_m_1829.xml;
file = xmldb:exist://localhost:8080/exist/xmlrpc/db/dwdsdb/src/E_m_1829.xml;
file = oxygen:xmldb:exist://localhost:8080/exist/xmlrpc/db/dwdsdb/src/E_m_1829.xml;
However, what does work is the usage of the pre-defined connection:

Code: Select all

file = oxygen:$eXist-Test/eXist-Test-Connection/db/dwdsdb/src/E_m_1829.xml;
But I am really uncomfortable with having to store the user name and password in plain in the oxygen setting. It's unsecure and it's complicated for the users of my framework to change the user account. So I would really prefer it to work like with webDAV, so that oxygen asks for the user data, when the file is accessed.

Can someone tell me, what the right syntax has to be to open a exist-file by the API via xmlrpc without this wierd predefined connection in the oxygen settings?

Thanks,
Thomas.
Radu
Posts: 9445
Joined: Fri Jul 09, 2004 5:18 pm

Re: Open files from exist-database via API

Post by Radu »

Hi Thomas,

Oxygen does not have out of the box support to open URLs with the protocol xmldb:exist.
We already have this registered as a feature request for a future version and we'll update this forum thread if we manage to implement it.

Right now Oxygen has support to open the Exist resources either using the WebDav approach (which you tested and works) or using the oxygen protocol which indeed relies on the fact that the user has configured a database connection in Oxygen. Oxygen stores the password specified in the connection settings encrypted on disk in the Oxygen preferences folder:

http://www.oxygenxml.com/doc/ug-oxygen/ ... alone.html

Our custom "oxygen" protocol implementation calls directly the Java API of the Exist JAR drivers so this is why we did not need to explicitly support the xmldb:exist protocol.

One possible workaround for you would be to write your own implementation of the xmldb:exist protocol using our custom protocol plugin type:

http://www.oxygenxml.com/doc/ug-oxygen/ ... lugin.html

There is an example of a custom protocol plugin implementation in the Plugins SDK.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Chemo
Posts: 19
Joined: Mon Aug 15, 2011 10:57 am

Re: Open files from exist-database via API

Post by Chemo »

Thank you for your answer.

I fixed the problems that I had with WebDAV, so WebDAV works fine for me for the moment and I'll stick to that.

But maybe in the future I will need to reconsider xmldb:exist.

Regards,
Thomas.
Post Reply