Great Sebastien,
That looks good to me..
My main comment, would be considering upgrades. Suppose you want to
upgrade your USB key or local install and not your database. Would it be
possible to have the installer ask wether or not to override the
existing database. Maybe add script to the menu to allow to
import/export the database to XML could be useful also if we want to
import a database coming from another wiki.
We have somewhere an ant task which could allow to make the import in
HSQLDB from XML files instead of from sql. This could be done by the ant
script and the default database commited as XML files in the tree. The
ant task calls a groovy script making the import in an empty database.
This looks really cool and I think one great next step will be adding
the P2P XWiki plugin which would allow syncrhonizing your local wiki
with a distant wiki. This would allow to have an offline Wiki on your
USB key which can be synchronized online..
You can put a alpha-package on
so we can test on USB keys and
see how it goes.
Ludovic
Sébastien Gaïde a écrit :
Hi list,
In order to ease XWiki installation for those who don't want to deal
with tomcat/mysql, Ludovic asked me to work on a standalone
installation of XWiki based on jetty and hsqldb.
I think I get to a point where I have something useful, so I wanted to
describe what I have done, and if Ludo agrees to create an account for
me, I will be able to commit some files in the next few days ;-)
So, I have added a 'standalone' target into the build.xml file (see
below). This target expands a jetty.5.1.5 archive, removes the sample
applications, inserts the xwiki release (exploded war) into the
webapps directory, copies some configuration files in order to make
xwiki use an in-process hsqldb database. hsqldb database files are
also copied into the package. The database data have been taken from
the mysql export (xwiki-db-0.9.2.sql).
At the root of this package, 4 scripts are eventually copied in order
to help user to start/stop the application server (start_xwiki.bat|sh,
stop_xwiki.bat|sh).
The produced package is usable 'as-is' simply by copying the files
somewhere on your disk. And yes, it works on a USB key also. It
weights a total of 37 MB.
With this target, I have also written a basic Nullsoft Installer
script, in order to help Windows users in installing the package.
Basically this installer installs all the files produced by the
standalone target in a user specified directory, then create 3
shortcuts in the Windows start menu: start, stop (à la tomcat) and
uninstall. Before doing this the installer checks if a jre 1.4 or
newer is installed (I'm not sure that 1.4 is required for xwiki, this
can be changed easily), if not the user is redirected to the download
section of the Java web site. This installer weight a total of 30 MB.
On the todo list of this installer :
- add the possibility to specify a port number for the jetty server ;
- install a bundled jre if needed (have to check the sun license in
order to be sure this is possible)
- add a final window explaining what to do after the installation (use
the start/stop shortcuts, start a browser...)
On the todo list of this standalone installation :
- add an installer for Mac OS X platforms
- add an installer for Linux platforms (autopackage ?), may be not so
useful, since Linux users are more acquainted to tomcat/mysql
installation ...
Any question, comment, idea would be greatly appreciated.
Seb.
here is the standalone target code :
<!-- Standalone package properties -->
<property name="standalone.base.dir"
value="${basedir}/standalone"/>
<property name="standalone.jetty.archive.dir"
value="jetty-5.1.5"/>
<property name="standalone.jetty.archive"
value="${standalone.base.dir}/${standalone.jetty.archive.dir}.zip"/>
<property name="standalone.package.name"
value="xwikionjetty"/>
<property name="standalone.release.dir"
value="${release.dir}/${standalone.package.name}"/>
<fileset id="standalone.db.bootstrap"
dir="${standalone.base.dir}/db" includes="xwiki_db.*"/>
<fileset id="standalone.config"
dir="${standalone.base.dir}/config" includes="xwiki.cfg,
hibernate.cfg.hsql.xml"/>
<fileset id="standalone.scripts"
dir="${standalone.base.dir}/scripts" includes="*"/>
<target name="standalone" depends="release">
<!-- unzip jetty archive into standalone release dir -->
<!-- exclude some jetty provided jar files in order to avoid
clashes -->
<!-- these jars are provided by xwiki -->
<unzip src="${standalone.jetty.archive}"
dest="${release.dir}">
<patternset>
<exclude name="**/ext/xercesImpl.jar"/>
<exclude name="**/ext/xml-apis.jar"/>
<exclude name="**/ext/xmlParserAPIs-2.5.jar"/>
</patternset>
</unzip>
<move todir="${standalone.release.dir}">
<fileset dir="${release.dir}/${standalone.jetty.archive.dir}"/>
</move>
<!-- remove example webapps -->
<delete file="${standalone.release.dir}/webapps/javadoc.war"/>
<delete dir="${standalone.release.dir}/webapps/template"/>
<!-- explode xwiki war file into jetty/webapps -->
<mkdir dir="${standalone.release.dir}/webapps/xwiki"/>
<unwar src="${release.warfile}"
dest="${standalone.release.dir}/webapps/xwiki"/>
<!-- replace configuration files with standalone version -->
<copy todir="${standalone.release.dir}/webapps/xwiki/WEB-INF"
overwrite="true">
<fileset refid="standalone.config"/>
</copy>
<!-- install db bootstrap -->
<mkdir dir="${standalone.release.dir}/db"/>
<copy todir="${standalone.release.dir}/db">
<fileset refid="standalone.db.bootstrap" />
</copy>
<!-- install start/stop scripts -->
<copy todir="${standalone.release.dir}">
<fileset refid="standalone.scripts"/>
</copy>
</target>
------------------------------------------------------------------------
--
You receive this message as a subscriber of the xwiki-dev(a)objectweb.org mailing list.
To unsubscribe: mailto:xwiki-dev-unsubscribe@objectweb.org
For general help: mailto:sympa@objectweb.org?subject=help
ObjectWeb mailing lists service home page:
http://www.objectweb.org/wws