Skip to Content.
Sympa Menu

idok-commit - [idok-commit] idok commit r98 - in trunk: lib sites/psi/oodaemon sites/psi/oodaemon/config sites/psi/oodaemon/dist sites/psi/oodaemon/docs sites/psi/oodaemon/scripts

idok-commit AT lists.psi.ch

Subject: Commit emails of the iDok project

List archive

[idok-commit] idok commit r98 - in trunk: lib sites/psi/oodaemon sites/psi/oodaemon/config sites/psi/oodaemon/dist sites/psi/oodaemon/docs sites/psi/oodaemon/scripts


Chronological Thread 
  • From: "Apache" <apache AT savannah.psi.ch>
  • To: idok-commit AT lists.psi.ch
  • Subject: [idok-commit] idok commit r98 - in trunk: lib sites/psi/oodaemon sites/psi/oodaemon/config sites/psi/oodaemon/dist sites/psi/oodaemon/docs sites/psi/oodaemon/scripts
  • Date: Wed, 14 May 2008 13:39:31 +0200
  • List-archive: <https://lists.web.psi.ch/pipermail/idok-commit/>
  • List-id: Commit emails of the iDok project <idok-commit.lists.psi.ch>

Author: huebner AT PSI.CH
Date: Wed May 14 13:39:30 2008
New Revision: 98

Log:
Added the recompiled version of the Open Office Server Daemon including the
PSI specific configuration files.

Added:
trunk/lib/OOServerDaemon.jar (contents, props changed)
trunk/sites/psi/oodaemon/
trunk/sites/psi/oodaemon/FAQ.html
trunk/sites/psi/oodaemon/README.html
trunk/sites/psi/oodaemon/build.xml
trunk/sites/psi/oodaemon/config/
trunk/sites/psi/oodaemon/config/build.properties
trunk/sites/psi/oodaemon/config/daemon.properties
trunk/sites/psi/oodaemon/config/oodaemon-config.xml
trunk/sites/psi/oodaemon/dist/
trunk/sites/psi/oodaemon/docs/
trunk/sites/psi/oodaemon/docs/generalDiagram.jpg (contents, props
changed)
trunk/sites/psi/oodaemon/duplicateOOInstances.sh (contents, props
changed)
trunk/sites/psi/oodaemon/iDocConv.sh
trunk/sites/psi/oodaemon/license.txt
trunk/sites/psi/oodaemon/scripts/
trunk/sites/psi/oodaemon/scripts/AdminStatus.sh
trunk/sites/psi/oodaemon/scripts/AdminStop.sh
trunk/sites/psi/oodaemon/scripts/Daemon.sh
trunk/sites/psi/oodaemon/scripts/DaemonDebug.sh
trunk/sites/psi/oodaemon/scripts/README.txt
trunk/sites/psi/oodaemon/scripts/_Daemon.sh
trunk/sites/psi/oodaemon/scripts/env.sh
trunk/sites/psi/oodaemon/scripts/killAllOpenOffice.sh

Added: trunk/lib/OOServerDaemon.jar
==============================================================================
Binary file. No diff available.

Added: trunk/sites/psi/oodaemon/FAQ.html
==============================================================================
--- (empty file)
+++ trunk/sites/psi/oodaemon/FAQ.html Wed May 14 13:39:30 2008
@@ -0,0 +1,56 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd";>

+

+<html>

+ <head>

+ <meta http-equiv="content-type" content="text/html;
charset=UTF-8"/>

+ <title>Open Office Server Daemon FAQ</title>

+ <link rel="shortcut icon"
href="http://www.openoffice.org/favicon.ico"; />

+ <meta name="description" content="Open Office Server Daemon
written in java"/>

+ <meta name="keywords" content="open office, OOo, oo, server,
daemon, java"/>

+ <style type="text/css">

+ body

+ {

+ font-weight : bold;

+ }

+ h1

+ {

+ text-align: center;

+ color : #0088AA;

+ font-family: Verdana;

+ }

+ h2

+ {

+ color : #0088AA;

+ font-family: Verdana;

+ font-size:16px;

+ font-weight:bold;

+ }

+ h3

+ {

+ color : #0088AA;

+ }

+ h4

+ {

+ color : #0088AA;

+ }

+ a

+ {

+ text-decoration : none;

+ color : #AAAAAA;

+ }

+ </style>

+ </head>

+<body>

+<br/>

+<h1>The Open Office Server Daemon FAQ</h1>

+<br/>

+<h2>I'm running JUnit Tests with Eclipse, and when I kill them, the daemon
is not notified</h2>

+It seems that the eclipse is not releasing everything when proceeding this
way. Try to take it into account and to test

+other ways (tests without JUnit, or killing JUnit another way).

+<h2>I have problems when trying to run daemon after running once with ant
run</h2>

+It is important to kill the daemon using ant stop when using ant run. When
you launch ant run,

+ it forks a new jvm with soffice as a child of this jvm. When you kill the
ant process, the daemon jvm is still

+ alive. You perhaps tried to kill all open office processes, but this daemon
jvm will still be running behind.

+

+</body>

+</html>
\ No newline at end of file

Added: trunk/sites/psi/oodaemon/README.html
==============================================================================
--- (empty file)
+++ trunk/sites/psi/oodaemon/README.html Wed May 14 13:39:30 2008
@@ -0,0 +1,293 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd";>

+

+<html>

+ <head>

+ <meta http-equiv="content-type" content="text/html;
charset=UTF-8"/>

+ <title>Open Office Server Daemon README</title>

+ <link rel="shortcut icon"
href="http://www.openoffice.org/favicon.ico"; />

+ <meta name="description" content="Open Office Server Daemon
written in java"/>

+ <meta name="keywords" content="open office, OOo, oo, server,
daemon, java"/>

+ <style type="text/css">

+ body

+ {

+ font-weight : bold;

+ }

+ h1

+ {

+ text-align: center;

+ color : #0088AA;

+ font-family: Verdana;

+ }

+ h2

+ {

+ color : #0088AA;

+ font-family: Verdana;

+ }

+ h3

+ {

+ color : #0088AA;

+ }

+ h4

+ {

+ color : #0088AA;

+ }

+ a

+ {

+ text-decoration : none;

+ color : #AAAAAA;

+ }

+ </style>

+ </head>

+<body>

+<br/>

+<h1>The Open Office Server Daemon</h1>

+<br/>

+<h2>The daemon</h2>

+<p>

+The daemon is based on the oood daemon written in python by

+<a href="mailto:JoergBudi AT gmx.de";>Joerg Budischewski</a> that you can find
at

+<a href="http://udk.openoffice.org/python/oood/";>OpenOffice.org</a>. The
current daemon is written in Java. A big part of this documentation is

+also taken from oood.

+</p>

+This daemon controls a pool of 'anonymous' office instances (workers).

+The workers can be used as backend for java/python/C++ batch

+processes for document conversion, mail merges, etc. . You don't need to
rewrite your current scripts,

+a client connects to a daemon-controlled office just as if would connect to
a normal office.

+

+The daemon ensures, that only one client at a time is connected to one
openoffice instance. Workers

+get restarted after a certain amount of uses or after office crashes.

+

+A client can connect to a daemon as if it would connect to a normal
'non-daemoned' Open office server,

+so you don't need to adapt your code/scripts.<br/>

+<br/>

+<center><img src="docs/generalDiagram.jpg" alt="'How it works' diagram"
/></center><br/>

+

+<h3>Why a daemon ?</h3>

+<p>For various reasons :

+<ul>

+ <li><i>OpenOffice does not support multithreading (officially)</i>,
it could work in some cases, but it's really unstable.<br/>

+ If you use only one app dealing with multiple threads, you would use
your own queue to handle it. But otherwise, you have

+ no real solution.

+ </li>

+ <li><i>Memory leaks</i> : Open office has various memory leaks that
create heavy memory usage very rapidly (and particularly when

+ dealing with OLE objects). The daemon restarts automatically server
instances after it has been used many times.</li>

+ <li><i>Lost threads</i> : Some server users have complained about
OpenOffice lost threads (increasing the number of running threads),

+ I've not noticed it myself, but that could happen using old versions
or particular API calls</li>

+</ul>

+</p>

+<h3>State</h3>

+<p>

+Currently, the daemon is in beta testing, meaning that features are working,
but heavy testing must be done.

+</p>

+

+<h3>Security</h3>

+<p>

+The daemon and its usage is in general <strong>INSECURE</strong>. Everyone,
who can connect

+to the daemon can use the underlying office instances and thus

+has full access to the machine (with the daemon's user rights) and

+via socket communication to other machines accessible via sockets

+from the worker machine.

+</p>

+

+<p>

+All worker instances run under the same (= the daemon's userid) meaning

+that a menace user may spy other worker office instances.

+</p>

+<p>

+However, some simple limitations can be done.

+<ul>

+<li> Limiting the access to the daemon.<br>

+ You can use the connection string to limit the access to a certain
network interface.

+ E.g. using <i>socket,host=localhost,port=2002;urp</i>

+ means, that the daemon (and the underlying office instances) can only be
accessed

+ from the same machine, where the daemon is running on.

+ One may easily extend the daemon source to limit access e.g. to certain
hosts.

+ There is no user administration.

+

+<li> User rights <br>

+ Create a special user for running the office instances. Limit the

+ user's rights to the absolute minimum.

+</ul>

+

+You should use this solution only in a trustworthy environments.

+

+<h2>Installation</h2>

+

+<h3> Open Office Server installation</h3>

+

+<p>

+<font size="4">The following informations are only needed if you want many
users in parallel.<br/>

+For one user at a time using a simple queue, a simple Open Office
installation suffice for the daemon.</font></p>

+

+The office daemon works on an arbitrary number of office user installations,
which

+must have been created from the same network installation with a single
system user.<br/>

+

+

+

+Ideally you create a new system user (e.g. oodaemon) therefor, but if you
just

+want to try it out, you can use your normal system user.<br/>

+

+<font size="2"><p>( The following description is more or less copied from a
mail by J. Barfurth

+in <i>dev AT api.openoffice.org</i> ).</p></font>

+

+First do a new multi-user installation ( start

+

+ <i>$ setup -net</i> on linux/unix

+

+) from the downloaded installation set.

+

+

+Afterwards, create multiple single user installations by starting

+(use <i>01</i> instead of <i>XX</i>)<br/>

+

+<p>

+&nbsp;&nbsp;&nbsp;&nbsp; <i>$ setup -d
/home/ooodaemon/ooServerInstance_XX</i>

+( on windows : <i>setup.exe -d C:/oodaemon/ooServerInstance_XX</i> )

+</p>

+from within the office/program directory.

+After the setup run, edit <i>~/.sversionrc</i> file and replace

+<i>OpenOffice.org x.x.x</i> with <i>OpenOffice.org x.x.x_srvXX</i>.<br/>

+Repeat these steps with XX = 02, 03, ... . You need as many installations

+as you expect concurrent users. You may also start with a low number

+and add instances later on.

+</p>

+Afterwards, your .sversionrc file should look like :

+

+<i>

+<pre>

+[Versions]

+OpenOffice.org x.x srv01=file:///home/oood/ooServerInstance_01

+OpenOffice.org x.x srv02=file:///home/oood/ooServerInstance_02

+OpenOffice.org x.x srv03=file:///home/oood/ooServerInstance_03

+...

+

+( on windows : adjust the path to the correct form )

+</pre>

+</i>

+<h3>Daemon installation</h3>

+<ol>

+ <li>open <i>config/oodaemon-config.xml</i> and change :

+ <ul>

+ <li><i>open-office-install-path</i> : the open office
installation path (ex in windows : <i>C:/Program Files/OpenOffice.org
2.2</i>)</li>

+ <li><i>user-installation</i> : users installations
(ex : <i>file:///home/oood/ooServerInstance_01</i>)

+ <li>Ports in acceptors</li>

+ </ul>

+ </li>

+ <li><i>ANT</i> : configure <i>config/build.properties</i>

+ </li>

+ <li><i>shell scripts</i> : configure scripts/env.* (.sh for linux and
.bat for windows) .</li>

+</ol>

+

+<h2> Usage </h2>

+<h3> Usage patterns</h3>

+<p>

+You can now connect to the daemon with an arbitrary (Java, C++, python)

+client program in exactly the same way as you connect to a normal

+OpenOffice.<br/>

+

+The daemon delegates your request to one of its worker offices. For the

+time of usage, this worker office is exclusivly used by your client program.

+The end of usage is detected by the daemon through a breakdown

+of the interprocess bridge (which occurs, when the last

+reference is gone, the client explicitly disposes the remote bridge or

+the client process terminates).

+</p>

+

+<h3> How to use it </h3>

+<p>

+The basic usage of the daemon is to run it in background, then ask for
information or stop it using

+another process called "admin".<br/>

+<font size="4">WARNING : The daemon is designed to be stopped using ant
stop, killing it other ways may lead to uncontrolled server instances

+still running in background that would need to be killed
manually.</font><br/><br/>

+You have several ways to launch it :

+<ul>

+ <li>

+ Ant :

+ <ul>

+ <li>

+ <i>ant run</i> : launch the daemon
(it will use the jar file created during compilation).<br/>

+ <font size="4">WARNING : killing the
ant process doesn't kill the daemon or open office server instances,

+ you must use <i>ant stop</i> to stop
the daemon in a safe way. Use <i>ant -p</i> to get informations about
targets.</font>

+ </li>

+ <li>

+ <i>ant stop</i> : stops the daemon
running in background (admin instance).

+ </li>

+ <li>

+ <i>ant status</i> : gets informations
about the running daemon (admin instance).

+ </li>

+ </ul>

+ </li>

+ <li>

+ Scripts : You can use the scripts that are in the
<i>scripts</i> directory. A README file is there for informations about

+ each shell script.

+ </li>

+ <li>

+ Command line : Use scripts/_Daemon.* with <i>--help</i>
option for more informations.

+ </li>

+</ul>

+</p>

+

+<h3>Logging</h3>

+Log levels (increasing order) :<br/>

+

+You can write your own logger, if needed, by implementing Logger abstract
class (see LoggerBasicImpl.java for an example).

+

+<table border="1">

+ <tr><td>NONE</td><td>no output, nothing, nada</td></tr>

+ <tr><td>ERROR</td><td>only errors and fatal errors will be displayed
(stack traces not available)</td></tr>

+ <tr><td>INFO</td><td>informations about the execution process will be
displayed</td></tr>

+ <tr><td>WARNING</td><td>warnings displayed added to previous level
informations</td></tr>

+ <tr><td>DEBUG</td><td>debug information ( + exceptions stack traces
)</td></tr>

+ <tr><td>DETAILED_DEBUG</td><td>debug + minor informations (exceptions
during tries, sleep, etc...)</td></tr>

+</table>

+<h2>Advanced</h2>

+<h3> Performance</h3>

+All requests to the office are tunneled through the daemon process. This

+means an additional load on the server machine and a performance overhead

+for every request. This is typically neglectable when your call frequency

+is low (say less than 10 Calls/s), but becomes a significant overhead

+for higher call frequencies.

+

+<h3> Robustness </h3>

+Robustness and stability is certainly a keyfeature of a daemon. The following

+situations are currently handled:

+

+<ul>

+<li> Running out of workers <br />

+In case all worker instances are busy and the pool is empty, new clients
will wait in a simple queue.

+The order in which clients catch their worker in the ready pool is not
determined, it is based on

+Java's syncronization implementation.

+

+<li> A worker office crashes or deadlocks <br />

+Before a worker reenters the pool, it is checked, whether

+it is still responsive and it checks whether a deadlock

+with the solarmutex blocks the whole office. In case

+such a situation occured, the worker is killed and a fresh

+instance is started and added again to the pool.

+

+<br/>

+The check is currently quite rudimentary, it may

+be improved in future.

+</li>

+

+<li> Worker processes are restarted after a certain amount of client uses.
This ensures,

+that an ill office instance will die sooner or later.

+</li>

+

+<li> Note: In case the daemon itself crashes (I am currently not aware of
such a situation),

+ the worker instances don't

+ terminate, an admin needs to kill the instances by hand and
restart the daemon.

+</li>

+

+</ul>

+

+<h2>License </h2>

+As you are used to when using OOo, this thing is LGPL.

+

+<h2>Feedback</h2>

+Please give feedback to the OpenOffice community through
dev AT api.openoffice.org mailing list.<br/>

+If you have questions or feedback for the first python version (oood) : <a
href="mailto:JoergBudi AT gmx.de";>Joerg Budischewski</a><br/>

+If you have questions or feedback about this java port : <a
href="mailto:oodaemon AT extraserv.net";>Jounayd Id Salah (aka jis)</a><br/>

+

+</body>

+</html>


Added: trunk/sites/psi/oodaemon/build.xml
==============================================================================
--- (empty file)
+++ trunk/sites/psi/oodaemon/build.xml Wed May 14 13:39:30 2008
@@ -0,0 +1,326 @@
+<?xml version="1.0" encoding="utf-8"?>

+

+<project name="OpenOffice Server Daemon" default="all">

+ <!--

+ ====================================================

+ PROPERTIES

+ ====================================================

+ -->

+ <property name="logger"
value="INFO" />

+ <property name="debug"
value="false" />

+

+ <property environment="env"/>

+ <!-- distribution directory -->

+ <property name="dist.dir"
value="dist" />

+ <!-- java sources directory -->

+ <property name="src.dir"
value="src" />

+ <property name="lib.dir"
value="lib" />

+ <!-- classes directory -->

+ <property name="bin.dir"
value="bin" />

+ <property name="web.dir"
value="web" />

+ <!-- javadoc directory -->

+ <property name="javadoc.dir"
value="javadoc" />

+ <property name="docs.dir"
value="docs" />

+ <!-- configuration directory -->

+ <property name="config.dir"
value="config" />

+ <property name="scripts.dir"
value="scripts" />

+ <property name="build.properties.file"
value="${config.dir}/build.properties" />

+ <property name="daemon.properties.file"
value="${config.dir}/daemon.properties" />

+

+ <property file="${build.properties.file}" />

+ <property file="${daemon.properties.file}" />

+

+ <property name="meta-inf.dir"
value="${dist.dir}/META-INF" />

+ <property name="daemon.jar"
value="OOServerDaemon.jar" />

+ <property name="daemon.dist"
value="OOServerDaemon.zip" />

+ <property name="daemon.config"
value="config/oodaemon-config.xml" />

+ <property name="daemon.java.library.path"
value="${openoffice.path}/program${path.separator}dist/win32" />

+

+ <!--

+ ====================================================

+ PATH

+ ====================================================

+ -->

+ <path id="classpath">

+ <fileset dir="${lib.dir}">

+ <include name="*.jar" />

+ </fileset>

+ <fileset dir="${dist.dir}">

+ <include name="${daemon.jar}" />

+ </fileset>

+ <!--<pathelement location="${bin.dir}"/>-->

+ </path>

+ <!--

+ ====================================================

+ VALIDATE PROPERTIES

+ ====================================================

+ -->

+ <target name="validate.for.compiling">

+ <condition property="daemon.properties.file.exists">

+ <and>

+ <isset property="daemon.properties.file"/>

+ <available file="${daemon.properties.file}"/>

+ </and>

+ </condition>

+ </target>

+ <target name="validate.for.running">

+ <condition property="openoffice.path.exists">

+ <and>

+ <isset property="openoffice.path"/>

+ <available file="${openoffice.path}/program"
type="dir"/>

+ </and>

+ </condition>

+ <condition property="dist.win32.path.exists">

+ <available file="dist/win32" type="dir"/>

+ </condition>

+ </target>

+

+ <!-- OK TO COMPILE and errors -->

+ <target name="ok.to.compile"

+ depends="validate.for.compiling,
check.daemon.properties.file" />

+ <target name="check.daemon.properties.file"
unless="daemon.properties.file.exists">

+ <echo message="ERROR VALIDATING PROPERTIES :
${daemon.properties.file} does not exist"/>

+ <fail/>

+ </target>

+

+ <!-- OK TO RUN and errors -->

+ <target name="ok.to.run"

+ depends="validate.for.running, check.openoffice.path,
check.dist.win32.path"/>

+ <target name="check.openoffice.path" unless="openoffice.path.exists">

+ <echo message="ERROR VALIDATING PROPERTIES : path does not
exist => ${openoffice.path}/program"/>

+ <fail/>

+ </target>

+ <target name="check.dist.win32.path" unless="dist.win32.path.exists">

+ <echo message="ERROR VALIDATING PROPERTIES : path does not
exist => dist/win32"/>

+ <fail/>

+ </target>

+ <!--

+ ====================================================

+ DATE

+ ====================================================

+ -->

+ <tstamp>

+ <format property="date" pattern="MM/dd/yyyy" locale="en"/>

+ </tstamp>

+

+ <tstamp>

+ <format property="date.full" pattern="MM/dd/yyyy HH:mm:ss"
locale="en"/>

+ </tstamp>

+ <!--

+ ====================================================

+ CLEAN

+ ====================================================

+ -->

+ <target name="clean">

+ <echo message="Cleaning ..." />

+ <delete dir="${meta-inf.dir}" />

+ <delete file="${dist.dir}/${daemon.jar}" />

+ <delete file="${dist.dir}/${daemon.dist}" />

+ <delete dir="${bin.dir}" />

+ <delete dir="${javadoc.dir}" />

+ </target>

+ <!--

+ ====================================================

+ PREPARE

+ ====================================================

+ -->

+ <target name="prepare">

+ <echo message="Preparing ..." />

+ <mkdir dir="${bin.dir}"/>

+ </target>

+ <!--

+ ====================================================

+ COMPILE

+ ====================================================

+ -->

+ <target name="compile" depends="prepare, ok.to.compile"
description="compile java sources">

+ <echo message="Compiling ..." />

+ <javac debug="${build.debug}" destdir="${bin.dir}"
encoding="utf-8">

+ <src path="${src.dir}"/>

+ <classpath>

+ <fileset dir="${lib.dir}" includes="*.jar" />

+ </classpath>

+ </javac>

+ </target>

+ <!--

+ ====================================================

+ RUN

+ ====================================================

+ -->

+ <target name="run" depends="jar, ok.to.run" description="Runs daemon">

+ <java

+ classname="com.anwrt.ooserver.daemon.Daemon"

+ dir="${basedir}"

+ fork="true"

+ >

+ <jvmarg
value="-Djava.library.path=${daemon.java.library.path}"/>

+ <arg value="-config" />

+ <arg value="${daemon.config}" />

+ <arg value="-logger" />

+ <arg value="${daemon.logger}" />

+ <classpath refid="classpath" />

+ </java>

+ </target>

+ <!--

+ ====================================================

+ STATUS

+ ====================================================

+ -->

+ <target name="status" depends="jar, ok.to.run" description="admin :
get status of a running daemon">

+ <java

+ classname="com.anwrt.ooserver.daemon.Daemon"

+ dir="${basedir}"

+ fork="true"

+ >

+ <jvmarg
value="-Djava.library.path=${daemon.java.library.path}"/>

+ <arg value="-config" />

+ <arg value="${daemon.config}" />

+ <arg value="-admin" />

+ <arg value="status" />

+ <arg value="-logger" />

+ <arg value="${daemon.logger}" />

+ <classpath refid="classpath" />

+

+ </java>

+ </target>

+ <!--

+ ====================================================

+ STOP

+ ====================================================

+ -->

+ <target name="stop" depends="jar, ok.to.run" description="admin :
stops a current running daemon">

+ <java

+ classname="com.anwrt.ooserver.daemon.Daemon"

+ dir="${basedir}"

+ fork="true"

+ >

+ <jvmarg
value="-Djava.library.path=${daemon.java.library.path}"/>

+ <arg value="-config" />

+ <arg value="${daemon.config}" />

+ <arg value="-admin" />

+ <arg value="stop" />

+ <arg value="-logger" />

+ <arg value="${daemon.logger}" />

+ <classpath refid="classpath" />

+

+ </java>

+ </target>

+ <!--

+ ====================================================

+ VERSION

+ ====================================================

+ -->

+ <target name="version" depends="jar, ok.to.run" description="ask for
current daemon version">

+ <echo message="version declared to ant : ${version}" />

+ <java

+ classname="com.anwrt.ooserver.daemon.Daemon"

+ >

+ <arg value="--version" />

+ <classpath refid="classpath" />

+ </java>

+ </target>

+ <!--

+ ====================================================

+ HELP

+ ====================================================

+ -->

+ <target name="help" depends="jar, ok.to.run" description="ask for
daemon help">

+ <java

+ classname="com.anwrt.ooserver.daemon.Daemon"

+ >

+ <arg value="--help" />

+ <classpath refid="classpath" />

+ </java>

+ </target>

+ <!--

+ ====================================================

+ JAR

+ ====================================================

+ -->

+ <target name="jar" depends="compile" description="Creates
${dist.dir}/${daemon.jar}">

+ <echo message="Creating jar ..." />

+ <mkdir dir="${meta-inf.dir}"/>

+ <manifest file="${meta-inf.dir}/MANIFEST.MF">

+ <section name="OpenOffice Server Daemon informations">

+ <attribute name="Title" value="OpenOffice
Server Daemon"/>

+ <attribute name="Version" value="${version}"/>

+ <attribute name="Date" value="${date.full}"/>

+ </section>

+ </manifest>

+ <jar

+ jarfile="${dist.dir}/${daemon.jar}"

+ basedir="${bin.dir}"

+ manifest="${meta-inf.dir}/MANIFEST.MF"/>

+ </target>

+ <!--

+ ====================================================

+ JAVADOC

+ ====================================================

+ -->

+ <target name="javadoc" depends="prepare" unless="no-doc">

+ <echo message="Making javadoc ..." />

+ <mkdir dir="${javadoc.dir}"/>

+

+ <javadoc destdir="${javadoc.dir}"

+ sourcepath="${src.dir}"

+ windowtitle="OpenOffice Server Daemon ${version}"

+ doctitle="OpenOffice Server Daemon ${version}"

+ author="true"

+ version="true"

+ use="false"

+ additionalparam="-quiet">

+ <classpath refid="classpath" />

+ <packageset dir="${src.dir}" defaultexcludes="true">

+ <include name="com/anwrt/ooserver/daemon/**"/>

+ </packageset>

+ </javadoc>

+ </target>

+ <!--

+ ====================================================

+ DIST

+ ====================================================

+ -->

+ <target name="dist" depends="jar" description="distribution files
(jar, zip, dll, ...)">

+ <echo message="Creating distribution package ..."/>

+ <mkdir dir="${dist.dir}/tmp"/>

+ <mkdir dir="${dist.dir}/tmp/config"/>

+ <mkdir dir="${dist.dir}/tmp/scripts"/>

+ <copy todir="${dist.dir}/tmp/config">

+ <fileset dir="${config.dir}/examples" includes="*"/>

+ </copy>

+ <copy todir="${dist.dir}/tmp/scripts">

+ <fileset dir="${scripts.dir}/examples" includes="*"/>

+ </copy>

+ <zip destfile="${dist.dir}/${daemon.dist}"

+ basedir="${basedir}"

+ excludes="**/CVS/**, **/env.*, **/examples/**"

+ includes="${src.dir}/**, ${lib.dir}/**,

+ ${scripts.dir}/*, ${docs.dir}/**.jpg,

+ ${dist.dir}/**/**.jar, ${dist.dir}/**/**.dll,
build.xml,

+ ${config.dir}/daemon.properties,

+ license.txt, README.html, FAQ.html">

+ <fileset dir="${dist.dir}/tmp" includes="**/**"/>

+ </zip>

+ <delete dir="${dist.dir}/tmp"/>

+ </target>

+ <!--

+ ====================================================

+ WEB

+ ====================================================

+ -->

+ <target name="web" description="Prepare project's sourceforge
website">

+ <copy todir="${web.dir}">

+ <fileset dir="${basedir}">

+ <include name="README.html"/>

+ <include name="FAQ.html"/>

+ <include name="docs/generalDiagram.jpg"/>

+ </fileset>

+ </copy>

+ </target>

+ <!--

+ ====================================================

+ ALL

+ ====================================================

+ -->

+ <target name="all" depends="jar, javadoc"/>

+</project>
\ No newline at end of file

Added: trunk/sites/psi/oodaemon/config/build.properties
==============================================================================
--- (empty file)
+++ trunk/sites/psi/oodaemon/config/build.properties Wed May 14 13:39:30
2008
@@ -0,0 +1,14 @@
+#-----------------------------------------------------------------------------------

+# Open Office Daemon configuration for the ant file : build.xml

+#-----------------------------------------------------------------------------------

+

+# the openoffice path

+# linux : should be something like : /usr/lib/openoffice

+openoffice.path=/home/oodaemon/ooServerInstance_01

+

+# build.debug : sets the java compilation to debug

+build.debug=true

+

+# daemon logger level

+# see the readme for details about log levels

+daemon.logger=DETAILED_DEBUG
\ No newline at end of file

Added: trunk/sites/psi/oodaemon/config/daemon.properties
==============================================================================
--- (empty file)
+++ trunk/sites/psi/oodaemon/config/daemon.properties Wed May 14 13:39:30
2008
@@ -0,0 +1 @@
+version=1.0 beta
\ No newline at end of file

Added: trunk/sites/psi/oodaemon/config/oodaemon-config.xml
==============================================================================
--- (empty file)
+++ trunk/sites/psi/oodaemon/config/oodaemon-config.xml Wed May 14 13:39:30
2008
@@ -0,0 +1,62 @@
+<?xml version="1.0"?>
+<!--
+__________________________________________
+Open Office Daemon configuration file
+__________________________________________
+-->
+<oodaemon-config>
+ <!-- Use this to allow connects from all hosts -->
+ <!--acceptor value="socket,host=0,port=2002;urp"-->
+
+ <!-- allow connections from this machine only -->
+ <acceptor value="socket,host=localhost,port=8100"/>
+
+ <!-- is used to shutdown and retrieve information from the daemon -->
+ <admin-acceptor value="socket,host=localhost,port=8101"/>
+
+ <!-- path to Open Office installation -->
+ <!-- linux : should be something like : "/usr/lib/openoffice" -->
+ <open-office-install-path path="/home/oodaemon/ooServerInstance_01" />
+ <!-- path to user installations -->
+ <!-- linux : should be something like :
"file:///local/home/USER_NAME/.openoffice.org2" -->
+ <!-- windows : should be in documents and settings directory -->
+ <user-installation url="file:///home/oodaemon/ooServerInstance_01" />
+ <user-installation url="file:///home/oodaemon/ooServerInstance_02" />
+ <user-installation url="file:///home/oodaemon/ooServerInstance_03" />
+ <user-installation url="file:///home/oodaemon/ooServerInstance_04" />
+
+ <!-- number of secondes, that are given an openoffice worker instance to
start.
+ In case the time is exceeded, daemon will terminate (and thus
signaling,
+ that there is something wrong with the overall setup)
+ DEFAULT : 180
+ -->
+ <tolerated-startuptime-per-instance value="180"/>
+
+ <!-- a concrete OOo instances gets sick with time (e.g. memory leaks,
inconsistencies,
+ aborted scripts which left documents opened, etc. ). Attribute max
gives the
+ number upper number of 'uses' by
+ a client, after which tbe office instance gets restarted. As a fixed
+ limit tends to lead to load peaks on certain points of time, this
limit can
+ be randomized with the random attribute.
+ DEFAULT : max=20 random=5
+ -->
+ <usage-count-per-instance max="20" random="5"/>
+
+ <!-- The verbosity of the daemon.
+ NONE no output, nothing, nada
+ ERROR only errors and fatal errors will be
displayed (stack traces not available)
+ INFO informations about the execution process will
be displayed
+ WARNING warnings displayed added to previous level
informations
+ DEBUG debug information ( + exceptions stack traces
)
+ DETAILED_DEBUG debug + minor informations (exceptions during tries,
sleep, etc...)
+ -->
+ <logger level="DETAILED_DEBUG"/>
+
+ <!-- customize delays to wait when performing certain actions -->
+ <delays>
+ <!-- generally used when waiting before doing another new task
(waiting an open office instance to start, etc...) -->
+ <sleeping>4</sleeping>
+ <!-- generally used for waiting something to shutdown -->
+ <shutdown>1</shutdown>
+ </delays>
+</oodaemon-config>

Added: trunk/sites/psi/oodaemon/docs/generalDiagram.jpg
==============================================================================
Binary file. No diff available.

Added: trunk/sites/psi/oodaemon/duplicateOOInstances.sh
==============================================================================
--- (empty file)
+++ trunk/sites/psi/oodaemon/duplicateOOInstances.sh Wed May 14 13:39:30
2008
@@ -0,0 +1,10 @@
+#! /bin/bash
+
+cp -rl /home/oodaemon/ooServerInstance_01 /home/oodaemon/ooServerInstance_02
+cp -rl /home/oodaemon/ooServerInstance_01 /home/oodaemon/ooServerInstance_03
+cp -rl /home/oodaemon/ooServerInstance_01 /home/oodaemon/ooServerInstance_04
+
+chown -RL oodaemon:oodaemon /home/oodaemon/ooServerInstance_01/
+chown -RL oodaemon:oodaemon /home/oodaemon/ooServerInstance_02/
+chown -RL oodaemon:oodaemon /home/oodaemon/ooServerInstance_03/
+chown -RL oodaemon:oodaemon /home/oodaemon/ooServerInstance_04/

Added: trunk/sites/psi/oodaemon/iDocConv.sh
==============================================================================
--- (empty file)
+++ trunk/sites/psi/oodaemon/iDocConv.sh Wed May 14 13:39:30 2008
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+DOCTYPESOURCE=$1
+DOCTYPEDEST=$2
+
+
+rm -f /tmp/tempfile.$DOCTYPEDEST
+rm -f /tmp/tempfile.$DOCTYPESOURCE
+
+cat > /tmp/tempfile.$DOCTYPESOURCE
+
+/opt/jdk1.6.0_01/bin/java \
+
-Xbootclasspath/p:/opt/dms/commons-io.jar:/opt/dms/juh.jar:/opt/dms/jurt.jar:/opt/dms/ridl.jar:/opt/dms/slf4j-api.jar:/opt/dms/slf4j-jdk14.jar:/opt/dms/unoil.jar:/opt/dms/commons-cli.jar:/opt/dms/jodconverter.jar
\
+ -cp /opt/dms/jodconverter-cli.jar \
+ com.artofsolving.jodconverter.cli.ConvertDocument
/tmp/tempfile.$DOCTYPESOURCE /tmp/tempfile.$DOCTYPEDEST
+
+
+cat /tmp/tempfile.$DOCTYPEDEST
+
+rm -f /tmp/tempfile.$DOCTYPEDEST
+rm -f /tmp/tempfile.$DOCTYPESOURCE
+

Added: trunk/sites/psi/oodaemon/license.txt
==============================================================================
--- (empty file)
+++ trunk/sites/psi/oodaemon/license.txt Wed May 14 13:39:30 2008
@@ -0,0 +1,165 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+
+ This version of the GNU Lesser General Public License incorporates
+the terms and conditions of version 3 of the GNU General Public
+License, supplemented by the additional permissions listed below.
+
+ 0. Additional Definitions.
+
+ As used herein, "this License" refers to version 3 of the GNU Lesser
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
+General Public License.
+
+ "The Library" refers to a covered work governed by this License,
+other than an Application or a Combined Work as defined below.
+
+ An "Application" is any work that makes use of an interface provided
+by the Library, but which is not otherwise based on the Library.
+Defining a subclass of a class defined by the Library is deemed a mode
+of using an interface provided by the Library.
+
+ A "Combined Work" is a work produced by combining or linking an
+Application with the Library. The particular version of the Library
+with which the Combined Work was made is also called the "Linked
+Version".
+
+ The "Minimal Corresponding Source" for a Combined Work means the
+Corresponding Source for the Combined Work, excluding any source code
+for portions of the Combined Work that, considered in isolation, are
+based on the Application, and not on the Linked Version.
+
+ The "Corresponding Application Code" for a Combined Work means the
+object code and/or source code for the Application, including any data
+and utility programs needed for reproducing the Combined Work from the
+Application, but excluding the System Libraries of the Combined Work.
+
+ 1. Exception to Section 3 of the GNU GPL.
+
+ You may convey a covered work under sections 3 and 4 of this License
+without being bound by section 3 of the GNU GPL.
+
+ 2. Conveying Modified Versions.
+
+ If you modify a copy of the Library, and, in your modifications, a
+facility refers to a function or data to be supplied by an Application
+that uses the facility (other than as an argument passed when the
+facility is invoked), then you may convey a copy of the modified
+version:
+
+ a) under this License, provided that you make a good faith effort to
+ ensure that, in the event an Application does not supply the
+ function or data, the facility still operates, and performs
+ whatever part of its purpose remains meaningful, or
+
+ b) under the GNU GPL, with none of the additional permissions of
+ this License applicable to that copy.
+
+ 3. Object Code Incorporating Material from Library Header Files.
+
+ The object code form of an Application may incorporate material from
+a header file that is part of the Library. You may convey such object
+code under terms of your choice, provided that, if the incorporated
+material is not limited to numerical parameters, data structure
+layouts and accessors, or small macros, inline functions and templates
+(ten or fewer lines in length), you do both of the following:
+
+ a) Give prominent notice with each copy of the object code that the
+ Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the object code with a copy of the GNU GPL and this license
+ document.
+
+ 4. Combined Works.
+
+ You may convey a Combined Work under terms of your choice that,
+taken together, effectively do not restrict modification of the
+portions of the Library contained in the Combined Work and reverse
+engineering for debugging such modifications, if you also do each of
+the following:
+
+ a) Give prominent notice with each copy of the Combined Work that
+ the Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
+ document.
+
+ c) For a Combined Work that displays copyright notices during
+ execution, include the copyright notice for the Library among
+ these notices, as well as a reference directing the user to the
+ copies of the GNU GPL and this license document.
+
+ d) Do one of the following:
+
+ 0) Convey the Minimal Corresponding Source under the terms of this
+ License, and the Corresponding Application Code in a form
+ suitable for, and under terms that permit, the user to
+ recombine or relink the Application with a modified version of
+ the Linked Version to produce a modified Combined Work, in the
+ manner specified by section 6 of the GNU GPL for conveying
+ Corresponding Source.
+
+ 1) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (a) uses at run time
+ a copy of the Library already present on the user's computer
+ system, and (b) will operate properly with a modified version
+ of the Library that is interface-compatible with the Linked
+ Version.
+
+ e) Provide Installation Information, but only if you would otherwise
+ be required to provide such information under section 6 of the
+ GNU GPL, and only to the extent that such information is
+ necessary to install and execute a modified version of the
+ Combined Work produced by recombining or relinking the
+ Application with a modified version of the Linked Version. (If
+ you use option 4d0, the Installation Information must accompany
+ the Minimal Corresponding Source and Corresponding Application
+ Code. If you use option 4d1, you must provide the Installation
+ Information in the manner specified by section 6 of the GNU GPL
+ for conveying Corresponding Source.)
+
+ 5. Combined Libraries.
+
+ You may place library facilities that are a work based on the
+Library side by side in a single library together with other library
+facilities that are not Applications and are not covered by this
+License, and convey such a combined library under terms of your
+choice, if you do both of the following:
+
+ a) Accompany the combined library with a copy of the same work based
+ on the Library, uncombined with any other library facilities,
+ conveyed under the terms of this License.
+
+ b) Give prominent notice with the combined library that part of it
+ is a work based on the Library, and explaining where to find the
+ accompanying uncombined form of the same work.
+
+ 6. Revised Versions of the GNU Lesser General Public License.
+
+ The Free Software Foundation may publish revised and/or new versions
+of the GNU Lesser General Public License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Library as you received it specifies that a certain numbered version
+of the GNU Lesser General Public License "or any later version"
+applies to it, you have the option of following the terms and
+conditions either of that published version or of any later version
+published by the Free Software Foundation. If the Library as you
+received it does not specify a version number of the GNU Lesser
+General Public License, you may choose any version of the GNU Lesser
+General Public License ever published by the Free Software Foundation.
+
+ If the Library as you received it specifies that a proxy can decide
+whether future versions of the GNU Lesser General Public License shall
+apply, that proxy's public statement of acceptance of any version is
+permanent authorization for you to choose that version for the
+Library.

Added: trunk/sites/psi/oodaemon/scripts/AdminStatus.sh
==============================================================================
--- (empty file)
+++ trunk/sites/psi/oodaemon/scripts/AdminStatus.sh Wed May 14 13:39:30
2008
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+source env.sh
+./_Daemon.sh -config $configFilePath -admin status -logger DETAILED_DEBUG

Added: trunk/sites/psi/oodaemon/scripts/AdminStop.sh
==============================================================================
--- (empty file)
+++ trunk/sites/psi/oodaemon/scripts/AdminStop.sh Wed May 14 13:39:30
2008
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+source env.sh
+./_Daemon.sh -config $configFilePath -admin stop -logger DETAILED_DEBUG

Added: trunk/sites/psi/oodaemon/scripts/Daemon.sh
==============================================================================
--- (empty file)
+++ trunk/sites/psi/oodaemon/scripts/Daemon.sh Wed May 14 13:39:30 2008
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+source env.sh
+./_Daemon.sh -config $configFilePath -logger INFO

Added: trunk/sites/psi/oodaemon/scripts/DaemonDebug.sh
==============================================================================
--- (empty file)
+++ trunk/sites/psi/oodaemon/scripts/DaemonDebug.sh Wed May 14 13:39:30
2008
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+source env.sh
+./_Daemon.sh -config $configFilePath -logger DETAILED_DEBUG

Added: trunk/sites/psi/oodaemon/scripts/README.txt
==============================================================================
--- (empty file)
+++ trunk/sites/psi/oodaemon/scripts/README.txt Wed May 14 13:39:30 2008
@@ -0,0 +1,15 @@
+----------------------------------------

+

+ SHELL SCRIPTS

+

+----------------------------------------

+

+Daemon.x : default script to run the daemon

+DaemonDebug.x : the same as Daemon but runs in debug mode

+AdminStop.x : stops the daemon running in background

+AdminStatus.x : gets the status of the daemon running in background

+_Daemon.x : runs daemon with no parameters, parameters can be
specified using _Daemon param1 param2 etc...

+

+env.x : user's environment parameters (must be created from
examples/env.x)

+

+killAllOpenOffice.x : kills all open office instances running (created by
daemon or not)
\ No newline at end of file

Added: trunk/sites/psi/oodaemon/scripts/_Daemon.sh
==============================================================================
--- (empty file)
+++ trunk/sites/psi/oodaemon/scripts/_Daemon.sh Wed May 14 13:39:30 2008
@@ -0,0 +1,5 @@
+#!/bin/bash
+source env.sh
+cd ..
+export
cp="lib/juh.jar:lib/jurt.jar:lib/ridl.jar:lib/unoil.jar:dist/OOServerDaemon.jar"
+java -Djava.library.path=$javaLibraryPath -cp $cp
com.anwrt.ooserver.daemon.Daemon $*

Added: trunk/sites/psi/oodaemon/scripts/env.sh
==============================================================================
--- (empty file)
+++ trunk/sites/psi/oodaemon/scripts/env.sh Wed May 14 13:39:30 2008
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+export javaLibraryPath="/home/oodaemon/ooServerInstance_01/program/"
+export configFilePath="config/oodaemon-config.xml"

Added: trunk/sites/psi/oodaemon/scripts/killAllOpenOffice.sh
==============================================================================
--- (empty file)
+++ trunk/sites/psi/oodaemon/scripts/killAllOpenOffice.sh Wed May 14
13:39:30 2008
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+killall soffice
+killall soffice.bin



  • [idok-commit] idok commit r98 - in trunk: lib sites/psi/oodaemon sites/psi/oodaemon/config sites/psi/oodaemon/dist sites/psi/oodaemon/docs sites/psi/oodaemon/scripts, Apache, 05/14/2008

Archive powered by MHonArc 2.6.19.

Top of Page