blob: 27fffa14cbf60339423bb78d3a83687e1893fe4d [file] [log] [blame]
<!DOCTYPE html>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<html>
<head>
<title>OpenOffice add-in build instructions</title>
<meta charset="UTF-8">
</head>
<body>
<h1>OpenOffice add-in build instructions</h1>
<p style="font-size:smaller">
This page is adapted from the <a href="http://www.geoapi.org/geoapi-openoffice/build.html">GeoAPI build page</a>.
</p>
<p>
All <code>XFoo</code> Java interfaces are generated from IDL files with the same name.
As long as <code>XFoo</code> Java/IDL interfaces are not modified, there is no need for the OpenOffice SDK.
But if any <code>XFoo</code> interface is modified, then the steps documented below must be done.
The last step shall be executed on the client machine
(users can also use the <i>"Tools / Package manager"</i> menu from OpenOffice GUI).
</p>
<p>
Replace <var>ooo-path</var> by the path to the OpenOffice installation directory.
That directory should contain the <code>program</code> sub-directories
The OpenOffice SDK shall be installed as a sub-directory of the OpenOffice root directory.
If the name of that SDK directory is different than <code>OpenOffice_SDK</code>,
then modify the <code>OO_SDK_HOME</code> value below accordingly.
</p>
<blockquote><pre>export OFFICE_BASE_HOME=ooo-path
export OO_SDK_HOME=$OFFICE_BASE_HOME/OpenOffice_SDK
export PATH=$OFFICE_BASE_HOME/program:$OO_SDK_HOME/bin:$PATH</pre></blockquote>
<h2>Compiles the UNO <code>*.urd</code> binary file:</h2>
<p>
The following command generates <code>*.urd</code> files (to be deleted later).
The <code>-C</code> option is for including additional service information,
the <code>-cid</code> option is for checking if identifiers fulfill the UNO naming requirements, and
the <code>-w</code> option is for displaying warning messages.
</p>
<blockquote><pre>cd application/sis-openoffice/src/main/java
idlc -C -cid -w -I $OO_SDK_HOME/idl org/apache/sis/openoffice/*.idl</pre></blockquote>
<div style="font-size:smaller"><b>MacOS troubleshooting:</b>
if the above command fails with a message like:
<blockquote><code>dyld: Library not loaded: @executable_path/libreg.dylib.3</code>
(…) <code>Reason: image not found</code></blockquote>
try adding the following environment variable:
<blockquote><pre>export DYLD_FALLBACK_LIBRARY_PATH=$OFFICE_BASE_HOME/program</pre></blockquote>
</div>
<h2>Compiles the UNO <code>*.rdb</code> registry file and the <code>*.class</code> file:</h2>
<p>
The <code>*.rdb</code> and <code>*.class</code> files generated by the following commands
will need to be committed in the source code repository.
Committing compilation results is usually not recommended, but in this particular case
most users will not have the necessary installation for producing those files themselves
(including the <code>*.class</code> files, which is not the usual <code>javac</code> output).
</p>
<blockquote><pre>regmerge ../unopkg/sis.rdb /UCR org/apache/sis/openoffice/*.urd
rm org/apache/sis/openoffice/*.urd
cd ../unopkg
javamaker -BUCR sis.rdb $OFFICE_BASE_HOME/program/types.rdb -Torg.apache.sis.openoffice.XReferencing</pre></blockquote>
<h2>Derives a <code>*.java</code> source from the <code>*.class</code> file:</h2>
<p>
Following command can be skipped if the API defined by <code>*.idl</code> files did not changed.
If this command is executed, the result will be sent to the console.
Developer need to bring any changes to the Java interface manually.
</p>
<blockquote><pre>javap org.apache.sis.openoffice.XReferencing</pre></blockquote>
<h2>Build:</h2>
<blockquote><pre>cd ../../..
mvn install</pre></blockquote>
<h2>Test in Apache OpenOffice:</h2>
<blockquote><pre>cd target
unopkg add apache-sis-1.0-SNAPSHOT.oxt --log-file log.txt
scalc -Xdebug -env:RTL_LOGFILE=log.txt</pre></blockquote>
</body>
</html>