opening a file at the command-line

Having trouble installing <oXygen/>? Got a bug to report? Post it all here.
nihilo
Posts: 31
Joined: Wed Jun 04, 2003 2:24 am

opening a file at the command-line

Post by nihilo » Wed Jun 04, 2003 10:09 pm

I am trying to open Oxygen with an initial file, or open a file within Oxygen if it's already running, at the command-line. I've tried both the oxygen and the oxygen.sh shell scripts with the filename as the first argument, but this does not work. Oxygen opens successfully in either case, but the file is not opened. Perhaps there is an additional argument that I need? I didn't see anything about this in the documentation.

For example, to open foo.xsl, I would like to be able to type

Code: Select all

oxygen foo.xsl
, where 'oxygen' is aliased to one of the shell scripts (oxygen or oxygen.sh). I'm running Gentoo Linux, with a 2.4.20 kernel and java 1.4.1.

thanks...

Dan
Posts: 485
Joined: Mon Feb 03, 2003 10:56 am

Post by Dan » Thu Jun 05, 2003 10:39 am

Indeed, the script fails to open the file because there is a problem with the working directory.

For example, if I make an alias "oxy" to the "oxygen" script, the editor starts, but searches for the file argument relative to the installation directory.

The workaround is to specify the argument with full path:

# oxy /home/dan/test.xml

We will fix this problem in a next version.

Dan
Posts: 485
Joined: Mon Feb 03, 2003 10:56 am

Post by Dan » Thu Jun 05, 2003 10:51 am

Other workaround is to modify the oxygen.sh script like this:

-------------------
#!/bin/sh
ROOT=/home/dan/Oxygen2.0.1
java -Xmx256m -Dcom.oxygenxml.classpath.relativeToOxygen.jar=true -cp $ROOT:$ROOT/lib/oxygen.jar ro.sync.exml.Oxygen $1 $2 $3
-------------------

The ROOT must be set to the installation directory. The java command must be on a single line. It is possible for the editor ask again for the license. You have to browse for it.

nihilo
Posts: 31
Joined: Wed Jun 04, 2003 2:24 am

success -- thanks

Post by nihilo » Thu Jun 05, 2003 8:24 pm

Dan wrote:Other workaround is to modify the oxygen.sh script like this:

-------------------
#!/bin/sh
ROOT=/home/dan/Oxygen2.0.1
java -Xmx256m -Dcom.oxygenxml.classpath.relativeToOxygen.jar=true -cp $ROOT:$ROOT/lib/oxygen.jar ro.sync.exml.Oxygen $1 $2 $3
-------------------

The ROOT must be set to the installation directory. The java command must be on a single line. It is possible for the editor ask again for the license. You have to browse for it.
Great. This works with just a relative path to the file. Thanks a lot :-)

nihilo
Posts: 31
Joined: Wed Jun 04, 2003 2:24 am

one more issue

Post by nihilo » Thu Jun 05, 2003 8:50 pm

After following Dan's second post, Oxygen now opens a file with a relative path to the file, but I discovered another issue.

If Oxygen is already running, and I try to again open a file from the command line, nothing happens. The file isn't opened. So it seems that after you've opened a file, you can't open any more except from within Oxygen using the GUI Hopefully there's a workaround for this, as I am really happy with Oxygen, but I need to be able to open files at the command line when it's already running.

Dan
Posts: 485
Joined: Mon Feb 03, 2003 10:56 am

Post by Dan » Fri Jun 06, 2003 8:17 am

Yes, we will corect this. The current mechanism is to send to the running instance the arguments of the second call. The problem is also the way arguments are interpreted. We should send to the running instance the absolute paths of the arguments.

Thank you for pointing this.

Dan

Post Reply