summaryrefslogtreecommitdiff
path: root/jvmfwk
diff options
context:
space:
mode:
authorJoachim Lingner <jl@openoffice.org>2004-05-18 14:11:57 +0000
committerJoachim Lingner <jl@openoffice.org>2004-05-18 14:11:57 +0000
commitbd8762dd3254232595038164d61da245400c9cd9 (patch)
tree70451b64e409e21b7729eb8924ac36b66ea319b6 /jvmfwk
parent5670c036247f25e52789abb0f3c3832359b2928e (diff)
#i20052#
Diffstat (limited to 'jvmfwk')
-rw-r--r--jvmfwk/inc/jvmfwk/vendorplugin.h51
-rw-r--r--jvmfwk/source/fwkutil.cxx29
2 files changed, 66 insertions, 14 deletions
diff --git a/jvmfwk/inc/jvmfwk/vendorplugin.h b/jvmfwk/inc/jvmfwk/vendorplugin.h
index 2f5a71313658..a004f92f5fcf 100644
--- a/jvmfwk/inc/jvmfwk/vendorplugin.h
+++ b/jvmfwk/inc/jvmfwk/vendorplugin.h
@@ -2,9 +2,9 @@
*
* $RCSfile: vendorplugin.h,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: jl $ $Date: 2004-05-10 14:34:19 $
+ * last change: $Author: jl $ $Date: 2004-05-18 15:11:57 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -59,6 +59,7 @@
*
************************************************************************/
+/** @HTML */
#if !defined INCLUDED_JVMFWK_VENDORPLUGIN_H
#define INCLUDED_JVMFWK_VENDORPLUGIN_H
@@ -72,8 +73,9 @@ extern "C" {
/**
- This library is dynamically loaded and unloaded. Therefore do not
- keep global variables.
+ @file
+ Libraries which implement this interface will be dynamically loaded and
+ unloaded. Therefore do not keep global variables.
*/
typedef enum
@@ -90,25 +92,50 @@ typedef enum
-/** obtains information about Java installations of which all have the same
- vendor.
+/** obtains information about installations of Java Runtime Environments (JREs).
<p>
+ The function has parameters which determines which versions of the respective
+ JREs are supported. A JRE which does not meet the version requirements will
+ be ignored.</p>
+ The JavaInfo structurs returned in <code>parJavaInfo</code> should be ordered
+ according to their version. The one, representing a JRE with the highest
+ version should be the first in the array. </p>
+ <p>
+ The function allocates memory for an array and all the the JavaInfo objects returned
+ in <code>parJavaInfo</code>. The caller must free each JavaInfo object by calling
+ <code>jfw_freeJavaInfo</code>. The array is to be freed by rtl_freeMemory.
In case an error occurred parJavaInfo does not to be freed.
</p>
- The array parJavaInfo must be freed by the caller with rtl_freeMemory.
+
+ @param sMinVersion
+ [in] represents the minimum version of a JRE. It can be NULL.
+ @param sMaxVersion
+ [in] represents the maximum version of a JRE. It can be NULL.
+ @param arExcludeList
+ [in] contains a list of &quot;bad&quot; versions. JREs which have one of these
+ versions must not be returned by this function. It can be NULL.
+ @param nSizeExcludeList
+ [in] the number of version strings contained in <code>arExcludeList</code>.
+ @param parJavaInfo
+ [out] if the function runs successfully then <code>parJavaInfo</code> contains
+ on return an array of pointers to <code>JavaInfo</code> objects.
+ @param nSizeJavaInfo
+ [out] the number of <code>JavaInfo</code> pointers contained in
+ <code>parJavaInfo</code>.
+
@return
- JFW_PLUGIN_E_NONE,
- JFW_PLUGIN_E_ERROR,
- JFW_PLUGIN_E_INVALID_ARG,
+ JFW_PLUGIN_E_NONE </br>
+ JFW_PLUGIN_E_ERROR </br>
+ JFW_PLUGIN_E_INVALID_ARG </br>
JFW_PLUGIN_E_WRONG_VERSION_FORMAT
*/
javaPluginError jfw_plugin_getAllJavaInfos(
rtl_uString *sMinVersion,
rtl_uString *sMaxVersion,
rtl_uString * * arExcludeList,
- sal_Int32 nLenList,
+ sal_Int32 nSizeExcludeList,
JavaInfo*** parJavaInfo,
- sal_Int32 *nLenInfoList);
+ sal_Int32 *nSizeJavaInfo);
/**
@return
diff --git a/jvmfwk/source/fwkutil.cxx b/jvmfwk/source/fwkutil.cxx
index a9cd06d44c60..494cdafe6c4e 100644
--- a/jvmfwk/source/fwkutil.cxx
+++ b/jvmfwk/source/fwkutil.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: fwkutil.cxx,v $
*
- * $Revision: 1.15 $
+ * $Revision: 1.16 $
*
- * last change: $Author: jl $ $Date: 2004-05-18 12:50:10 $
+ * last change: $Author: jl $ $Date: 2004-05-18 15:11:57 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -895,9 +895,34 @@ JFW_MODE getMode()
rtl::OUString sOffice = buff.makeStringAndClear();
sal_Int32 index = 0;
+ //are we in the soffice process?
if ((index = ouExe.lastIndexOf(sOffice)) != 1
&& index + sOffice.getLength() == ouExe.getLength())
return JFW_MODE_OFFICE;
+ //we may have been started from javaldx etc.
+ //is there an soffice in the same directory?
+ rtl::OUString sOfficeURL = searchFileNextToThisLib(sOffice);
+
+ //is there <office>/share/config/javavendors.xml?
+ rtl::OUString sBaseDir = getBaseInstallation();
+ rtl::OUString sVendors;
+ if (sBaseDir.getLength() != 0)
+ {
+ //We are run within office installation
+ rtl::OUStringBuffer sSettings(256);
+ sSettings.append(sBaseDir);
+ sSettings.appendAscii("/share/config/");
+ sSettings.appendAscii(VENDORSETTINGS);
+ rtl::OUString sVend = sSettings.makeStringAndClear();
+
+ //check if the file exists
+ osl::DirectoryItem item;
+ osl::File::RC fileError = osl::DirectoryItem::get(sVend, item);
+ if (fileError == osl::FileBase::E_None)
+ sVendors = sVend;
+ }
+ if (sOfficeURL.getLength() > 0 && sVendors.getLength() > 0)
+ return JFW_MODE_OFFICE;
//FWK_MODE_ENV_SIMPLE ?