Re: Is there any way to make JabRef push to LyX work in Windows XP?

2007-04-12 Thread Enrico Forestieri
I am resending this as it seems to have disappeared in some black hole.
Sorry if this turns out as a duplicate.

On Wed, Apr 11, 2007 at 12:11:12PM -0700, James Yu wrote:

 Hi, Enrico,
 
 Thank you for the detail usage guide. However, I haven't gotten it to fully
 work so far. Could you help check what is wrong in my settings:
 
 In JabRef (running in XP) Path to Lyx pipe:  C:\cygwin\home\james\.lyx\
 jabrefpipe
 In XP command line: I run C:\ LyXPipeWatcher.exe 
 c:\\cygwin\\home\\james\\.lyx
 \\jabrefpipe
 In Cygwin, I put the lyxpipe script in /usr/local/bin  (and make it executable
 by chmod +x lyxpipe)
 in Cygwin's LyX's LyXServer pipe: /home/james/.lyx/lyxpipe  (of course,
 reconfigure and restart)
 
 With these settings, after I click Push to LyX in JabRef, I could see the
 flashing console window and the status bar in JabRef showed pushed  
 However, in LyX, I didn't see anything happen.
 
 Could you give some ideas about why it didn't work?  Are my settings correct?

Your settings are correct, however I just discovered that the official
cygwin version of LyX (the X11 version) has been built with the lyxpipe
functionality disabled. Most probably the build system used did not define
HAVE_MKFIFO, so stub functions were used (the lyxserver works, though).

Please try installing this version:
ftp://ftp.lyx.org/pub/lyx/bin/1.4.4/lyx-1.4.4-cygwin.tar.gz
this is fully functional and you can install it in parallel with the
official version. Unpack the archive and read the README file for
installation instructions.

-- 
Enrico


Re: Is there any way to make JabRef push to LyX work in Windows XP?

2007-04-12 Thread Enrico Forestieri
I am resending this as it seems to have disappeared in some black hole.
Sorry if this turns out as a duplicate.

On Wed, Apr 11, 2007 at 12:11:12PM -0700, James Yu wrote:

 Hi, Enrico,
 
 Thank you for the detail usage guide. However, I haven't gotten it to fully
 work so far. Could you help check what is wrong in my settings:
 
 In JabRef (running in XP) Path to Lyx pipe:  C:\cygwin\home\james\.lyx\
 jabrefpipe
 In XP command line: I run C:\ LyXPipeWatcher.exe 
 c:\\cygwin\\home\\james\\.lyx
 \\jabrefpipe
 In Cygwin, I put the lyxpipe script in /usr/local/bin  (and make it executable
 by chmod +x lyxpipe)
 in Cygwin's LyX's LyXServer pipe: /home/james/.lyx/lyxpipe  (of course,
 reconfigure and restart)
 
 With these settings, after I click Push to LyX in JabRef, I could see the
 flashing console window and the status bar in JabRef showed pushed  
 However, in LyX, I didn't see anything happen.
 
 Could you give some ideas about why it didn't work?  Are my settings correct?

Your settings are correct, however I just discovered that the official
cygwin version of LyX (the X11 version) has been built with the lyxpipe
functionality disabled. Most probably the build system used did not define
HAVE_MKFIFO, so stub functions were used (the lyxserver works, though).

Please try installing this version:
ftp://ftp.lyx.org/pub/lyx/bin/1.4.4/lyx-1.4.4-cygwin.tar.gz
this is fully functional and you can install it in parallel with the
official version. Unpack the archive and read the README file for
installation instructions.

-- 
Enrico


Re: Is there any way to make "JabRef push to LyX" work in Windows XP?

2007-04-12 Thread Enrico Forestieri
I am resending this as it seems to have disappeared in some black hole.
Sorry if this turns out as a duplicate.

On Wed, Apr 11, 2007 at 12:11:12PM -0700, James Yu wrote:

> Hi, Enrico,
> 
> Thank you for the detail usage guide. However, I haven't gotten it to fully
> work so far. Could you help check what is wrong in my settings:
> 
> In JabRef (running in XP) Path to Lyx pipe:  C:\cygwin\home\james\.lyx\
> jabrefpipe
> In XP command line: I run C:\> LyXPipeWatcher.exe 
> c:\\cygwin\\home\\james\\.lyx
> \\jabrefpipe
> In Cygwin, I put the lyxpipe script in /usr/local/bin  (and make it executable
> by chmod +x lyxpipe)
> in Cygwin's LyX's LyXServer pipe: /home/james/.lyx/lyxpipe  (of course,
> reconfigure and restart)
> 
> With these settings, after I click "Push to LyX" in JabRef, I could see the
> flashing console window and the status bar in JabRef showed "pushed ...". 
> However, in LyX, I didn't see anything happen.
> 
> Could you give some ideas about why it didn't work?  Are my settings correct?

Your settings are correct, however I just discovered that the official
cygwin version of LyX (the X11 version) has been built with the lyxpipe
functionality disabled. Most probably the build system used did not define
HAVE_MKFIFO, so stub functions were used (the lyxserver works, though).

Please try installing this version:
ftp://ftp.lyx.org/pub/lyx/bin/1.4.4/lyx-1.4.4-cygwin.tar.gz
this is fully functional and you can install it in parallel with the
official version. Unpack the archive and read the README file for
installation instructions.

-- 
Enrico


Re: Is there any way to make JabRef push to LyX work in Windows XP?

2007-04-11 Thread Andre Poenitz
On Tue, Apr 10, 2007 at 03:08:12PM +, Enrico Forestieri wrote:
 Yu, James writes:
  Abdelrazak Younes wrote:
   The solution is just to replace our handmade socket (or pipe) layer 
   with a portable one.
  
   It should not be very hard to implement even for a newcomer in the LyX 
   project. If someone's interested, comesee us at the devel list 
  
   Another solution for you James is to use Enrico's mixed windows/cygwin 
   version. Could you confirm that it works Enrico?
 
 Yes, but if you want that functionality from a native Windows app you
 have to use a workaround. See below.
 
  If I was not wrong, it did not work in cygwin!
 
 It works if you use cygwin apps. Native windows apps know nothing about
 named pipes. However, there's a workaround. Windows provides file change
 notifications, so you can tell a native app to use a given file as the
 lyxpipe. Then you monitor such file with a small program, and when the app
 writes to the file you receive a notification. So you simply copy what was
 written to the file to the real lyxpipe using a cygwin program (a bash
 script, for example).
 
 I wrote such watcher utility by modifying the example provided at
 http://www.relisoft.com/win32/watcher.html

There's QFileSystemWatcher.

Andre'


Re: Is there any way to make JabRef push to LyX work in Windows XP?

2007-04-11 Thread Enrico Forestieri
On Wed, Apr 11, 2007 at 01:46:26PM +0200, Andre Poenitz wrote:

 On Tue, Apr 10, 2007 at 03:08:12PM +, Enrico Forestieri wrote:
  Yu, James writes:
   Abdelrazak Younes wrote:
The solution is just to replace our handmade socket (or pipe) layer 
with a portable one.
   
It should not be very hard to implement even for a newcomer in the LyX 
project. If someone's interested, comesee us at the devel list 
   
Another solution for you James is to use Enrico's mixed windows/cygwin 
version. Could you confirm that it works Enrico?
  
  Yes, but if you want that functionality from a native Windows app you
  have to use a workaround. See below.
  
   If I was not wrong, it did not work in cygwin!
  
  It works if you use cygwin apps. Native windows apps know nothing about
  named pipes. However, there's a workaround. Windows provides file change
  notifications, so you can tell a native app to use a given file as the
  lyxpipe. Then you monitor such file with a small program, and when the app
  writes to the file you receive a notification. So you simply copy what was
  written to the file to the real lyxpipe using a cygwin program (a bash
  script, for example).
  
  I wrote such watcher utility by modifying the example provided at
  http://www.relisoft.com/win32/watcher.html
 
 There's QFileSystemWatcher.

That's for Qt 4.2 or higher, I think. I wonder how do they accomplish
that on *nix as, if I remember correctly, select() doesn't work on
plain files. Maybe they use something similar to fam on linux, but
on solaris, for example?

-- 
Enrico


Re: Is there any way to make JabRef push to LyX work in Windows XP?

2007-04-11 Thread Andre Poenitz
On Wed, Apr 11, 2007 at 09:07:31PM +0200, Enrico Forestieri wrote:
  There's QFileSystemWatcher.
 
 That's for Qt 4.2 or higher, I think. I wonder how do they accomplish
 that on *nix as, if I remember correctly, select() doesn't work on
 plain files. Maybe they use something similar to fam on linux, but
 on solaris, for example?

I don't know. Use the source, Luke ;-)

Andre'


Re: Is there any way to make JabRef push to LyX work in Windows XP?

2007-04-11 Thread Andre Poenitz
On Tue, Apr 10, 2007 at 03:08:12PM +, Enrico Forestieri wrote:
 Yu, James writes:
  Abdelrazak Younes wrote:
   The solution is just to replace our handmade socket (or pipe) layer 
   with a portable one.
  
   It should not be very hard to implement even for a newcomer in the LyX 
   project. If someone's interested, comesee us at the devel list 
  
   Another solution for you James is to use Enrico's mixed windows/cygwin 
   version. Could you confirm that it works Enrico?
 
 Yes, but if you want that functionality from a native Windows app you
 have to use a workaround. See below.
 
  If I was not wrong, it did not work in cygwin!
 
 It works if you use cygwin apps. Native windows apps know nothing about
 named pipes. However, there's a workaround. Windows provides file change
 notifications, so you can tell a native app to use a given file as the
 lyxpipe. Then you monitor such file with a small program, and when the app
 writes to the file you receive a notification. So you simply copy what was
 written to the file to the real lyxpipe using a cygwin program (a bash
 script, for example).
 
 I wrote such watcher utility by modifying the example provided at
 http://www.relisoft.com/win32/watcher.html

There's QFileSystemWatcher.

Andre'


Re: Is there any way to make JabRef push to LyX work in Windows XP?

2007-04-11 Thread Enrico Forestieri
On Wed, Apr 11, 2007 at 01:46:26PM +0200, Andre Poenitz wrote:

 On Tue, Apr 10, 2007 at 03:08:12PM +, Enrico Forestieri wrote:
  Yu, James writes:
   Abdelrazak Younes wrote:
The solution is just to replace our handmade socket (or pipe) layer 
with a portable one.
   
It should not be very hard to implement even for a newcomer in the LyX 
project. If someone's interested, comesee us at the devel list 
   
Another solution for you James is to use Enrico's mixed windows/cygwin 
version. Could you confirm that it works Enrico?
  
  Yes, but if you want that functionality from a native Windows app you
  have to use a workaround. See below.
  
   If I was not wrong, it did not work in cygwin!
  
  It works if you use cygwin apps. Native windows apps know nothing about
  named pipes. However, there's a workaround. Windows provides file change
  notifications, so you can tell a native app to use a given file as the
  lyxpipe. Then you monitor such file with a small program, and when the app
  writes to the file you receive a notification. So you simply copy what was
  written to the file to the real lyxpipe using a cygwin program (a bash
  script, for example).
  
  I wrote such watcher utility by modifying the example provided at
  http://www.relisoft.com/win32/watcher.html
 
 There's QFileSystemWatcher.

That's for Qt 4.2 or higher, I think. I wonder how do they accomplish
that on *nix as, if I remember correctly, select() doesn't work on
plain files. Maybe they use something similar to fam on linux, but
on solaris, for example?

-- 
Enrico


Re: Is there any way to make JabRef push to LyX work in Windows XP?

2007-04-11 Thread Andre Poenitz
On Wed, Apr 11, 2007 at 09:07:31PM +0200, Enrico Forestieri wrote:
  There's QFileSystemWatcher.
 
 That's for Qt 4.2 or higher, I think. I wonder how do they accomplish
 that on *nix as, if I remember correctly, select() doesn't work on
 plain files. Maybe they use something similar to fam on linux, but
 on solaris, for example?

I don't know. Use the source, Luke ;-)

Andre'


Re: Is there any way to make "JabRef push to LyX" work in Windows XP?

2007-04-11 Thread Andre Poenitz
On Tue, Apr 10, 2007 at 03:08:12PM +, Enrico Forestieri wrote:
> Yu, James writes:
> > Abdelrazak Younes wrote:
> > > The solution is "just" to replace our handmade socket (or pipe) layer 
> > > with a portable one.
> > >
> > > It should not be very hard to implement even for a newcomer in the LyX 
> > > project. If someone's interested, come us at the devel list 
> > >
> > > Another solution for you James is to use Enrico's mixed windows/cygwin 
> > > version. Could you confirm that it works Enrico?
> 
> Yes, but if you want that functionality from a native Windows app you
> have to use a workaround. See below.
> 
> > If I was not wrong, it did not work in cygwin!
> 
> It works if you use cygwin apps. Native windows apps know nothing about
> named pipes. However, there's a workaround. Windows provides file change
> notifications, so you can tell a native app to use a given file as the
> lyxpipe. Then you monitor such file with a small program, and when the app
> writes to the file you receive a notification. So you simply copy what was
> written to the file to the real lyxpipe using a cygwin program (a bash
> script, for example).
> 
> I wrote such "watcher" utility by modifying the example provided at
> http://www.relisoft.com/win32/watcher.html

There's QFileSystemWatcher.

Andre'


Re: Is there any way to make "JabRef push to LyX" work in Windows XP?

2007-04-11 Thread Enrico Forestieri
On Wed, Apr 11, 2007 at 01:46:26PM +0200, Andre Poenitz wrote:

> On Tue, Apr 10, 2007 at 03:08:12PM +, Enrico Forestieri wrote:
> > Yu, James writes:
> > > Abdelrazak Younes wrote:
> > > > The solution is "just" to replace our handmade socket (or pipe) layer 
> > > > with a portable one.
> > > >
> > > > It should not be very hard to implement even for a newcomer in the LyX 
> > > > project. If someone's interested, come us at the devel list 
> > > >
> > > > Another solution for you James is to use Enrico's mixed windows/cygwin 
> > > > version. Could you confirm that it works Enrico?
> > 
> > Yes, but if you want that functionality from a native Windows app you
> > have to use a workaround. See below.
> > 
> > > If I was not wrong, it did not work in cygwin!
> > 
> > It works if you use cygwin apps. Native windows apps know nothing about
> > named pipes. However, there's a workaround. Windows provides file change
> > notifications, so you can tell a native app to use a given file as the
> > lyxpipe. Then you monitor such file with a small program, and when the app
> > writes to the file you receive a notification. So you simply copy what was
> > written to the file to the real lyxpipe using a cygwin program (a bash
> > script, for example).
> > 
> > I wrote such "watcher" utility by modifying the example provided at
> > http://www.relisoft.com/win32/watcher.html
> 
> There's QFileSystemWatcher.

That's for Qt 4.2 or higher, I think. I wonder how do they accomplish
that on *nix as, if I remember correctly, select() doesn't work on
plain files. Maybe they use something similar to fam on linux, but
on solaris, for example?

-- 
Enrico


Re: Is there any way to make "JabRef push to LyX" work in Windows XP?

2007-04-11 Thread Andre Poenitz
On Wed, Apr 11, 2007 at 09:07:31PM +0200, Enrico Forestieri wrote:
> > There's QFileSystemWatcher.
> 
> That's for Qt 4.2 or higher, I think. I wonder how do they accomplish
> that on *nix as, if I remember correctly, select() doesn't work on
> plain files. Maybe they use something similar to fam on linux, but
> on solaris, for example?

I don't know. Use the source, Luke ;-)

Andre'


Re: Is there any way to make JabRef push to LyX work in Windows XP?

2007-04-10 Thread Enrico Forestieri
Yu, James writes:
 Abdelrazak Younes wrote:
  The solution is just to replace our handmade socket (or pipe) layer 
  with a portable one.
 
  It should not be very hard to implement even for a newcomer in the LyX 
  project. If someone's interested, comesee us at the devel list 
 
  Another solution for you James is to use Enrico's mixed windows/cygwin 
  version. Could you confirm that it works Enrico?

Yes, but if you want that functionality from a native Windows app you
have to use a workaround. See below.

 If I was not wrong, it did not work in cygwin!

It works if you use cygwin apps. Native windows apps know nothing about
named pipes. However, there's a workaround. Windows provides file change
notifications, so you can tell a native app to use a given file as the
lyxpipe. Then you monitor such file with a small program, and when the app
writes to the file you receive a notification. So you simply copy what was
written to the file to the real lyxpipe using a cygwin program (a bash
script, for example).

I wrote such watcher utility by modifying the example provided at
http://www.relisoft.com/win32/watcher.html
and it works very well. I can push citations from JabRef directly into LyX
without problems. You need the cygwin version of LyX, of course.
The only nuisance is that you have to remember to launch the watcher
program in addition to LyX and JabRef.

-- 
Enrico



Re: Is there any way to make JabRef push to LyX work in Windows XP?

2007-04-10 Thread James Yu

Hi, Enrico,
Great you have tried something and succeeded.
Will you share with us the utility?
Thanks,
James

On 4/10/07, Enrico Forestieri [EMAIL PROTECTED] wrote:


Yu, James writes:
 Abdelrazak Younes wrote:
  The solution is just to replace our handmade socket (or pipe) layer
  with a portable one.
 
  It should not be very hard to implement even for a newcomer in the LyX
  project. If someone's interested, comesee us at the devel list
 
  Another solution for you James is to use Enrico's mixed windows/cygwin
  version. Could you confirm that it works Enrico?

Yes, but if you want that functionality from a native Windows app you
have to use a workaround. See below.

 If I was not wrong, it did not work in cygwin!

It works if you use cygwin apps. Native windows apps know nothing about
named pipes. However, there's a workaround. Windows provides file change
notifications, so you can tell a native app to use a given file as the
lyxpipe. Then you monitor such file with a small program, and when the app
writes to the file you receive a notification. So you simply copy what was
written to the file to the real lyxpipe using a cygwin program (a bash
script, for example).

I wrote such watcher utility by modifying the example provided at
http://www.relisoft.com/win32/watcher.html
and it works very well. I can push citations from JabRef directly into LyX
without problems. You need the cygwin version of LyX, of course.
The only nuisance is that you have to remember to launch the watcher
program in addition to LyX and JabRef.

--
Enrico




Re: Is there any way to make JabRef push to LyX work in Windows XP?

2007-04-10 Thread Enrico Forestieri
On Tue, Apr 10, 2007 at 01:11:53PM -0700, James Yu wrote:

 Hi, Enrico,
 Great you have tried something and succeeded.
 Will you share with us the utility?

No problem. Please find attached a tar archive containing an executable
and a bash script. You can put LyXPipeWatcher.exe wherever you want, but
it is mandatory that you copy the script to the cygwin /usr/local/bin
directory.

I don't know if I am allowed to redistribute modified sources from
http://www.relisoft.com/win32/watcher.html
so I am not including them. The sources are copyrighted but I could
not find anything about redistribution.

Usage is as follows.

Prerequisites:

 - Cygwin version of LyX (either the official one using Qt3/X11
   or mine own build using Qt3/Win will do).

 - Make sure that you have the cygwin bin directory in your system PATH.
   Most probably this is c:\cygwin\bin and you should add it to the Path
   variable in the System properties/Advanced/Environment variables
   panel (on Win2k I get it by choosing Properties after right clicking
   on the My Computer icon). You need admin privileges to do this.

 - Once you are in the previous panel, make sure that a variable named
   HOME is set, pointing to your cygwin home directory. For example,
   this could be c:\cygwin\home\James (use the Windows syntax here).

Usage with JabRef:

 - Set the lyxpipe path in LyX. You should set this path in the LyXServer
   pipe: entry you see after Tools-Preferences-Paths. Use the cygwin
   syntax here. Under the hypothesis that your cygwin home directory is
   c:\cygwin\home\James, I suggest using something like /home/.lyx/lyxpipe.
   Save the preferences and restart LyX.

 - Set the lyxpipe path in JabRef. Use whatever path you like here but
   make sure that it is *different* from the previous one.

 - Launch LyXpipeWatcher.exe specifying on the command line (or in a
   shortcut) the same lyxpipe path you gave to JabRef (the bash script
   will figure out by itself what is the real lyxpipe path).

 - Once you have LyX, JabRef and LyXpipeWatcher running, try pushing a
   reference to LyX. You should see a console window flashing briefly and
   then the reference should appear in LyX.

-- 
Enrico


LyXPipeWatcher.tar.gz
Description: application/tar-gz


Re: Is there any way to make JabRef push to LyX work in Windows XP?

2007-04-10 Thread Enrico Forestieri
Yu, James writes:
 Abdelrazak Younes wrote:
  The solution is just to replace our handmade socket (or pipe) layer 
  with a portable one.
 
  It should not be very hard to implement even for a newcomer in the LyX 
  project. If someone's interested, comesee us at the devel list 
 
  Another solution for you James is to use Enrico's mixed windows/cygwin 
  version. Could you confirm that it works Enrico?

Yes, but if you want that functionality from a native Windows app you
have to use a workaround. See below.

 If I was not wrong, it did not work in cygwin!

It works if you use cygwin apps. Native windows apps know nothing about
named pipes. However, there's a workaround. Windows provides file change
notifications, so you can tell a native app to use a given file as the
lyxpipe. Then you monitor such file with a small program, and when the app
writes to the file you receive a notification. So you simply copy what was
written to the file to the real lyxpipe using a cygwin program (a bash
script, for example).

I wrote such watcher utility by modifying the example provided at
http://www.relisoft.com/win32/watcher.html
and it works very well. I can push citations from JabRef directly into LyX
without problems. You need the cygwin version of LyX, of course.
The only nuisance is that you have to remember to launch the watcher
program in addition to LyX and JabRef.

-- 
Enrico



Re: Is there any way to make JabRef push to LyX work in Windows XP?

2007-04-10 Thread James Yu

Hi, Enrico,
Great you have tried something and succeeded.
Will you share with us the utility?
Thanks,
James

On 4/10/07, Enrico Forestieri [EMAIL PROTECTED] wrote:


Yu, James writes:
 Abdelrazak Younes wrote:
  The solution is just to replace our handmade socket (or pipe) layer
  with a portable one.
 
  It should not be very hard to implement even for a newcomer in the LyX
  project. If someone's interested, comesee us at the devel list
 
  Another solution for you James is to use Enrico's mixed windows/cygwin
  version. Could you confirm that it works Enrico?

Yes, but if you want that functionality from a native Windows app you
have to use a workaround. See below.

 If I was not wrong, it did not work in cygwin!

It works if you use cygwin apps. Native windows apps know nothing about
named pipes. However, there's a workaround. Windows provides file change
notifications, so you can tell a native app to use a given file as the
lyxpipe. Then you monitor such file with a small program, and when the app
writes to the file you receive a notification. So you simply copy what was
written to the file to the real lyxpipe using a cygwin program (a bash
script, for example).

I wrote such watcher utility by modifying the example provided at
http://www.relisoft.com/win32/watcher.html
and it works very well. I can push citations from JabRef directly into LyX
without problems. You need the cygwin version of LyX, of course.
The only nuisance is that you have to remember to launch the watcher
program in addition to LyX and JabRef.

--
Enrico




Re: Is there any way to make JabRef push to LyX work in Windows XP?

2007-04-10 Thread Enrico Forestieri
On Tue, Apr 10, 2007 at 01:11:53PM -0700, James Yu wrote:

 Hi, Enrico,
 Great you have tried something and succeeded.
 Will you share with us the utility?

No problem. Please find attached a tar archive containing an executable
and a bash script. You can put LyXPipeWatcher.exe wherever you want, but
it is mandatory that you copy the script to the cygwin /usr/local/bin
directory.

I don't know if I am allowed to redistribute modified sources from
http://www.relisoft.com/win32/watcher.html
so I am not including them. The sources are copyrighted but I could
not find anything about redistribution.

Usage is as follows.

Prerequisites:

 - Cygwin version of LyX (either the official one using Qt3/X11
   or mine own build using Qt3/Win will do).

 - Make sure that you have the cygwin bin directory in your system PATH.
   Most probably this is c:\cygwin\bin and you should add it to the Path
   variable in the System properties/Advanced/Environment variables
   panel (on Win2k I get it by choosing Properties after right clicking
   on the My Computer icon). You need admin privileges to do this.

 - Once you are in the previous panel, make sure that a variable named
   HOME is set, pointing to your cygwin home directory. For example,
   this could be c:\cygwin\home\James (use the Windows syntax here).

Usage with JabRef:

 - Set the lyxpipe path in LyX. You should set this path in the LyXServer
   pipe: entry you see after Tools-Preferences-Paths. Use the cygwin
   syntax here. Under the hypothesis that your cygwin home directory is
   c:\cygwin\home\James, I suggest using something like /home/.lyx/lyxpipe.
   Save the preferences and restart LyX.

 - Set the lyxpipe path in JabRef. Use whatever path you like here but
   make sure that it is *different* from the previous one.

 - Launch LyXpipeWatcher.exe specifying on the command line (or in a
   shortcut) the same lyxpipe path you gave to JabRef (the bash script
   will figure out by itself what is the real lyxpipe path).

 - Once you have LyX, JabRef and LyXpipeWatcher running, try pushing a
   reference to LyX. You should see a console window flashing briefly and
   then the reference should appear in LyX.

-- 
Enrico


LyXPipeWatcher.tar.gz
Description: application/tar-gz


Re: Is there any way to make "JabRef push to LyX" work in Windows XP?

2007-04-10 Thread Enrico Forestieri
Yu, James writes:
> Abdelrazak Younes wrote:
> > The solution is "just" to replace our handmade socket (or pipe) layer 
> > with a portable one.
> >
> > It should not be very hard to implement even for a newcomer in the LyX 
> > project. If someone's interested, come us at the devel list 
> >
> > Another solution for you James is to use Enrico's mixed windows/cygwin 
> > version. Could you confirm that it works Enrico?

Yes, but if you want that functionality from a native Windows app you
have to use a workaround. See below.

> If I was not wrong, it did not work in cygwin!

It works if you use cygwin apps. Native windows apps know nothing about
named pipes. However, there's a workaround. Windows provides file change
notifications, so you can tell a native app to use a given file as the
lyxpipe. Then you monitor such file with a small program, and when the app
writes to the file you receive a notification. So you simply copy what was
written to the file to the real lyxpipe using a cygwin program (a bash
script, for example).

I wrote such "watcher" utility by modifying the example provided at
http://www.relisoft.com/win32/watcher.html
and it works very well. I can push citations from JabRef directly into LyX
without problems. You need the cygwin version of LyX, of course.
The only nuisance is that you have to remember to launch the watcher
program in addition to LyX and JabRef.

-- 
Enrico



Re: Is there any way to make "JabRef push to LyX" work in Windows XP?

2007-04-10 Thread James Yu

Hi, Enrico,
Great you have tried something and succeeded.
Will you share with us the "utility"?
Thanks,
James

On 4/10/07, Enrico Forestieri <[EMAIL PROTECTED]> wrote:


Yu, James writes:
> Abdelrazak Younes wrote:
> > The solution is "just" to replace our handmade socket (or pipe) layer
> > with a portable one.
> >
> > It should not be very hard to implement even for a newcomer in the LyX
> > project. If someone's interested, come us at the devel list
> >
> > Another solution for you James is to use Enrico's mixed windows/cygwin
> > version. Could you confirm that it works Enrico?

Yes, but if you want that functionality from a native Windows app you
have to use a workaround. See below.

> If I was not wrong, it did not work in cygwin!

It works if you use cygwin apps. Native windows apps know nothing about
named pipes. However, there's a workaround. Windows provides file change
notifications, so you can tell a native app to use a given file as the
lyxpipe. Then you monitor such file with a small program, and when the app
writes to the file you receive a notification. So you simply copy what was
written to the file to the real lyxpipe using a cygwin program (a bash
script, for example).

I wrote such "watcher" utility by modifying the example provided at
http://www.relisoft.com/win32/watcher.html
and it works very well. I can push citations from JabRef directly into LyX
without problems. You need the cygwin version of LyX, of course.
The only nuisance is that you have to remember to launch the watcher
program in addition to LyX and JabRef.

--
Enrico




Re: Is there any way to make "JabRef push to LyX" work in Windows XP?

2007-04-10 Thread Enrico Forestieri
On Tue, Apr 10, 2007 at 01:11:53PM -0700, James Yu wrote:

> Hi, Enrico,
> Great you have tried something and succeeded.
> Will you share with us the "utility"?

No problem. Please find attached a tar archive containing an executable
and a bash script. You can put LyXPipeWatcher.exe wherever you want, but
it is mandatory that you copy the script to the cygwin /usr/local/bin
directory.

I don't know if I am allowed to redistribute modified sources from
http://www.relisoft.com/win32/watcher.html
so I am not including them. The sources are copyrighted but I could
not find anything about redistribution.

Usage is as follows.

Prerequisites:

 - Cygwin version of LyX (either the official one using Qt3/X11
   or mine own build using Qt3/Win will do).

 - Make sure that you have the cygwin bin directory in your system PATH.
   Most probably this is c:\cygwin\bin and you should add it to the Path
   variable in the "System properties/Advanced/Environment variables"
   panel (on Win2k I get it by choosing Properties after right clicking
   on the "My Computer" icon). You need admin privileges to do this.

 - Once you are in the previous panel, make sure that a variable named
   HOME is set, pointing to your cygwin home directory. For example,
   this could be c:\cygwin\home\James (use the Windows syntax here).

Usage with JabRef:

 - Set the lyxpipe path in LyX. You should set this path in the "LyXServer
   pipe:" entry you see after Tools->Preferences->Paths. Use the cygwin
   syntax here. Under the hypothesis that your cygwin home directory is
   c:\cygwin\home\James, I suggest using something like /home/.lyx/lyxpipe.
   Save the preferences and restart LyX.

 - Set the lyxpipe path in JabRef. Use whatever path you like here but
   make sure that it is *different* from the previous one.

 - Launch LyXpipeWatcher.exe specifying on the command line (or in a
   shortcut) the same lyxpipe path you gave to JabRef (the bash script
   will figure out by itself what is the real lyxpipe path).

 - Once you have LyX, JabRef and LyXpipeWatcher running, try pushing a
   reference to LyX. You should see a console window flashing briefly and
   then the reference should appear in LyX.

-- 
Enrico


LyXPipeWatcher.tar.gz
Description: application/tar-gz


Re: Is there any way to make JabRef push to LyX work in Windows XP?

2007-04-06 Thread Georg Baum
Am Donnerstag, 5. April 2007 21:20 schrieb Yu, James:

 What I understand about this is that JabRef simply writes out the 
 citation entry to a file named lyxpipe.in. The code segment is like:

This is no real file. It is a so called named pipe or FIFO, but since on 
UNIX everything is a file it can be used like a real file on those 
systems.

 My question is: How LyX goes the receiving? Any code segment example?

When LyX starts it opens the FIFO for reading and listens. When a command 
arrives it acts accordingly. The code for this is mainly in 
src/support/socktools.[Ch] and src/lyxsocket.[Ch]

If you look at src/support/socktools.C you'll see that only stubs of the 
needed functions are implemented on windows. I understand that named pipes 
do exist on windows, but you need different functions to deal with them, 
and so far nobody was interested enough to implement this.

You are most welcome to fill in the missing bits, as Abdel wrote it should 
not be too hard.


Georg



Re: Is there any way to make JabRef push to LyX work in Windows XP?

2007-04-06 Thread Georg Baum
Am Donnerstag, 5. April 2007 21:20 schrieb Yu, James:

 What I understand about this is that JabRef simply writes out the 
 citation entry to a file named lyxpipe.in. The code segment is like:

This is no real file. It is a so called named pipe or FIFO, but since on 
UNIX everything is a file it can be used like a real file on those 
systems.

 My question is: How LyX goes the receiving? Any code segment example?

When LyX starts it opens the FIFO for reading and listens. When a command 
arrives it acts accordingly. The code for this is mainly in 
src/support/socktools.[Ch] and src/lyxsocket.[Ch]

If you look at src/support/socktools.C you'll see that only stubs of the 
needed functions are implemented on windows. I understand that named pipes 
do exist on windows, but you need different functions to deal with them, 
and so far nobody was interested enough to implement this.

You are most welcome to fill in the missing bits, as Abdel wrote it should 
not be too hard.


Georg



Re: Is there any way to make "JabRef push to LyX" work in Windows XP?

2007-04-06 Thread Georg Baum
Am Donnerstag, 5. April 2007 21:20 schrieb Yu, James:

> What I understand about this is that JabRef simply writes out the 
> citation entry to a file named "lyxpipe.in". The code segment is like:

This is no real file. It is a so called "named pipe" or FIFO, but since on 
UNIX "everything is a file" it can be used like a real file on those 
systems.

> My question is: How LyX goes the receiving? Any code segment example?

When LyX starts it opens the FIFO for reading and listens. When a command 
arrives it acts accordingly. The code for this is mainly in 
src/support/socktools.[Ch] and src/lyxsocket.[Ch]

If you look at src/support/socktools.C you'll see that only stubs of the 
needed functions are implemented on windows. I understand that named pipes 
do exist on windows, but you need different functions to deal with them, 
and so far nobody was interested enough to implement this.

You are most welcome to fill in the missing bits, as Abdel wrote it should 
not be too hard.


Georg



Is there any way to make JabRef push to LyX work in Windows XP?

2007-04-05 Thread Yu, James
I understand that in Windows environment the citation push function from 
JabRef to LyX doesn't work, due to some OS-level implementation 
problem.  But,  is there any way to get around this limit, like using a 
helper program, or ...?  Has anybody found a way to achieve that?


Any solution for this would be helpful to people who are forced to stick 
with Windows environment.


Thanks,

James


Re: Is there any way to make JabRef push to LyX work in Windows XP?

2007-04-05 Thread Abdelrazak Younes

Yu, James wrote:
I understand that in Windows environment the citation push function from 
JabRef to LyX doesn't work, due to some OS-level implementation 
problem.  But,  is there any way to get around this limit, like using a 
helper program, or ...?  Has anybody found a way to achieve that?


Any solution for this would be helpful to people who are forced to stick 
with Windows environment.


What interface does Jabref use? Pipe or Socket?
The solution is just to replace our handmade socket (or pipe) layer 
with a portable one.


It should not be very hard to implement even for a newcomer in the LyX 
project. If someone's interested, comesee us at the devel list :-)


Another solution for you James is to use Enrico's mixed windows/cygwin 
version. Could you confirm that it works Enrico?


Abdel.



Re: Is there any way to make JabRef push to LyX work in Windows XP?

2007-04-05 Thread Yu, James

Abdelrazak Younes wrote:

Yu, James wrote:
I understand that in Windows environment the citation push function 
from JabRef to LyX doesn't work, due to some OS-level implementation 
problem.  But,  is there any way to get around this limit, like using 
a helper program, or ...?  Has anybody found a way to achieve that?


Any solution for this would be helpful to people who are forced to 
stick with Windows environment.


What interface does Jabref use? Pipe or Socket?
What I understand about this is that JabRef simply writes out the 
citation entry to a file named lyxpipe.in. The code segment is like:


.
  final File lyxpipe = new File( Globals.prefs.get(lyxpipe) +.in);
.
  try {
  FileWriter fw = new FileWriter(lyxpipe);
  BufferedWriter lyx_out = new BufferedWriter(fw);
  String citeStr = ;
  citeStr = LYXCMD:sampleclient:citation-insert: + keyString;
  lyx_out.write(citeStr + \n);
  lyx_out.close();
  } catch (IOException excep) {
  couldNotWrite = true;
  return;
  }
.

My question is: How LyX goes the receiving? Any code segment example?

The solution is just to replace our handmade socket (or pipe) layer 
with a portable one.


It should not be very hard to implement even for a newcomer in the LyX 
project. If someone's interested, comesee us at the devel list :-)


Another solution for you James is to use Enrico's mixed windows/cygwin 
version. Could you confirm that it works Enrico?


Abdel.



If I was not wrong, it did not work in cygwin!


James


Is there any way to make JabRef push to LyX work in Windows XP?

2007-04-05 Thread Yu, James
I understand that in Windows environment the citation push function from 
JabRef to LyX doesn't work, due to some OS-level implementation 
problem.  But,  is there any way to get around this limit, like using a 
helper program, or ...?  Has anybody found a way to achieve that?


Any solution for this would be helpful to people who are forced to stick 
with Windows environment.


Thanks,

James


Re: Is there any way to make JabRef push to LyX work in Windows XP?

2007-04-05 Thread Abdelrazak Younes

Yu, James wrote:
I understand that in Windows environment the citation push function from 
JabRef to LyX doesn't work, due to some OS-level implementation 
problem.  But,  is there any way to get around this limit, like using a 
helper program, or ...?  Has anybody found a way to achieve that?


Any solution for this would be helpful to people who are forced to stick 
with Windows environment.


What interface does Jabref use? Pipe or Socket?
The solution is just to replace our handmade socket (or pipe) layer 
with a portable one.


It should not be very hard to implement even for a newcomer in the LyX 
project. If someone's interested, comesee us at the devel list :-)


Another solution for you James is to use Enrico's mixed windows/cygwin 
version. Could you confirm that it works Enrico?


Abdel.



Re: Is there any way to make JabRef push to LyX work in Windows XP?

2007-04-05 Thread Yu, James

Abdelrazak Younes wrote:

Yu, James wrote:
I understand that in Windows environment the citation push function 
from JabRef to LyX doesn't work, due to some OS-level implementation 
problem.  But,  is there any way to get around this limit, like using 
a helper program, or ...?  Has anybody found a way to achieve that?


Any solution for this would be helpful to people who are forced to 
stick with Windows environment.


What interface does Jabref use? Pipe or Socket?
What I understand about this is that JabRef simply writes out the 
citation entry to a file named lyxpipe.in. The code segment is like:


.
  final File lyxpipe = new File( Globals.prefs.get(lyxpipe) +.in);
.
  try {
  FileWriter fw = new FileWriter(lyxpipe);
  BufferedWriter lyx_out = new BufferedWriter(fw);
  String citeStr = ;
  citeStr = LYXCMD:sampleclient:citation-insert: + keyString;
  lyx_out.write(citeStr + \n);
  lyx_out.close();
  } catch (IOException excep) {
  couldNotWrite = true;
  return;
  }
.

My question is: How LyX goes the receiving? Any code segment example?

The solution is just to replace our handmade socket (or pipe) layer 
with a portable one.


It should not be very hard to implement even for a newcomer in the LyX 
project. If someone's interested, comesee us at the devel list :-)


Another solution for you James is to use Enrico's mixed windows/cygwin 
version. Could you confirm that it works Enrico?


Abdel.



If I was not wrong, it did not work in cygwin!


James


Is there any way to make "JabRef push to LyX" work in Windows XP?

2007-04-05 Thread Yu, James
I understand that in Windows environment the citation push function from 
JabRef to LyX doesn't work, due to some OS-level implementation 
problem.  But,  is there any way to get around this limit, like using a 
helper program, or ...?  Has anybody found a way to achieve that?


Any solution for this would be helpful to people who are forced to stick 
with Windows environment.


Thanks,

James


Re: Is there any way to make "JabRef push to LyX" work in Windows XP?

2007-04-05 Thread Abdelrazak Younes

Yu, James wrote:
I understand that in Windows environment the citation push function from 
JabRef to LyX doesn't work, due to some OS-level implementation 
problem.  But,  is there any way to get around this limit, like using a 
helper program, or ...?  Has anybody found a way to achieve that?


Any solution for this would be helpful to people who are forced to stick 
with Windows environment.


What interface does Jabref use? Pipe or Socket?
The solution is "just" to replace our handmade socket (or pipe) layer 
with a portable one.


It should not be very hard to implement even for a newcomer in the LyX 
project. If someone's interested, come us at the devel list :-)


Another solution for you James is to use Enrico's mixed windows/cygwin 
version. Could you confirm that it works Enrico?


Abdel.



Re: Is there any way to make "JabRef push to LyX" work in Windows XP?

2007-04-05 Thread Yu, James

Abdelrazak Younes wrote:

Yu, James wrote:
I understand that in Windows environment the citation push function 
from JabRef to LyX doesn't work, due to some OS-level implementation 
problem.  But,  is there any way to get around this limit, like using 
a helper program, or ...?  Has anybody found a way to achieve that?


Any solution for this would be helpful to people who are forced to 
stick with Windows environment.


What interface does Jabref use? Pipe or Socket?
What I understand about this is that JabRef simply writes out the 
citation entry to a file named "lyxpipe.in". The code segment is like:


.
  final File lyxpipe = new File( Globals.prefs.get("lyxpipe") +".in");
.
  try {
  FileWriter fw = new FileWriter(lyxpipe);
  BufferedWriter lyx_out = new BufferedWriter(fw);
  String citeStr = "";
  citeStr = "LYXCMD:sampleclient:citation-insert:" + keyString;
  lyx_out.write(citeStr + "\n");
  lyx_out.close();
  } catch (IOException excep) {
  couldNotWrite = true;
  return;
  }
.

My question is: How LyX goes the receiving? Any code segment example?

The solution is "just" to replace our handmade socket (or pipe) layer 
with a portable one.


It should not be very hard to implement even for a newcomer in the LyX 
project. If someone's interested, come us at the devel list :-)


Another solution for you James is to use Enrico's mixed windows/cygwin 
version. Could you confirm that it works Enrico?


Abdel.



If I was not wrong, it did not work in cygwin!


James