| View previous topic :: View next topic |
| Author |
Message |
Trinkler Guest
|
Posted: Fri Feb 27, 2004 6:00 am Post subject: How to grant that OOo is running? (Java) |
|
|
Hello again,
I integrated some handles with OOo - Documents in my JavaApplication...
The first time i granted that OOo is up by launching it
on startup in -invisible mode during launch of my application.
But now I face the problem, that some users close the complete
Office after viewing one document.
The Javaapp is processing on and tries to connect to the Office
the next time a document was requested ... BUT there is no listening office anymore
I tried to initalize a loop requesting access to a remoteServiceManager before i want real access, but I despaired
catching the thousandth ConnectionException and others.
I only want to check if OOo is running and listening in an easy way.
Maybe anyone has a nice solution or want to give me a kick to get me on the right way ?  |
|
| Back to top |
|
 |
dickkniep Guest
|
Posted: Sat Feb 28, 2004 5:00 am Post subject: Script that checks if OpenOffice is running on Linux |
|
|
Hi there, here is a little script (in Python) that checks if OpenOffice is running, and if not start it with the appropriate parameters.
def CheckAppRun( chknam ):
k = os.popen('ps -e','r',1000)
h = k.read(1000)
l = ''
while h:
h = k.read(1000)
l += h
k.close()
try:
l.index(chknam)
Gevonden = True
except: Gevonden=False
return Gevonden
def StartOO(wppgmdir):
if os.name in ('dos','nt','xp'):
pass
elif os.name == 'posix':
if not CheckAppRun('soffice.bin'):
print wppgmdir
os.spawnv(os.P_NOWAIT, wppgmdir, [wppgmdir,'-accept=socket,host=localhost,port=2002;urp;'])
time.sleep(13)
The sleep is to make sure that OO has initialized and is ready to accept connections.
Hope this helps....
Cheers,
Dick |
|
| Back to top |
|
 |
Trinkler Guest
|
Posted: Mon Mar 01, 2004 4:52 am Post subject: |
|
|
Many Thanks for your script
But, finally I didn't use it, cause I had an idea while reading your post...
Now I'm trying to create a socket connection at the officeport and return a "status"-int.
If a BindException occurs - status "launched" is returned (the Exception catched).
Otherwise (the connection has been created) status "not launched" is returned ... after closing the socket I execute OOo.
Now I'm looping round until i get the status "launched" returned by the function.
Trinkler |
|
| Back to top |
|
 |
doctorlove General User


Joined: 08 Feb 2005 Posts: 25
|
Posted: Fri Feb 25, 2005 5:30 am Post subject: Script that checks if OpenOffice is running on Linux |
|
|
you can try "telnet <oohost> 8100"
if oo is listening, telnet will be accepted. _________________ born to be alive |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|