summaryrefslogtreecommitdiff
path: root/scripting
diff options
context:
space:
mode:
authorJoachim Lingner <jl@openoffice.org>2010-05-03 11:51:05 +0200
committerJoachim Lingner <jl@openoffice.org>2010-05-03 11:51:05 +0200
commit86e2dc0dcb9d79f1267dbd88d68bba6da3de871e (patch)
treea34a3583e91907f58b5793e38a7f4d8b4a23ca9a /scripting
parent3807193d03962da3247a7b74bd58d2d511786fc2 (diff)
jl152 import 263452 from native0jl:#i77196# fixed bundled extension help tree view, scripts in shared extensions...
Diffstat (limited to 'scripting')
-rw-r--r--scripting/java/com/sun/star/script/framework/container/UnoPkgContainer.java20
-rwxr-xr-xscripting/java/com/sun/star/script/framework/provider/ScriptProvider.java18
-rw-r--r--scripting/source/provider/ActiveMSPList.cxx7
-rw-r--r--scripting/source/provider/ActiveMSPList.hxx1
4 files changed, 38 insertions, 8 deletions
diff --git a/scripting/java/com/sun/star/script/framework/container/UnoPkgContainer.java b/scripting/java/com/sun/star/script/framework/container/UnoPkgContainer.java
index 4c6a4f1eda2b..edf6a2d806b7 100644
--- a/scripting/java/com/sun/star/script/framework/container/UnoPkgContainer.java
+++ b/scripting/java/com/sun/star/script/framework/container/UnoPkgContainer.java
@@ -50,10 +50,15 @@ public class UnoPkgContainer extends ParcelContainer
{
private Map registeredPackages = new HashMap();
+ protected String extensionDb;
+ protected String extensionRepository;
- public UnoPkgContainer( XComponentContext xCtx, String locationURL, String language ) throws com.sun.star.lang.IllegalArgumentException, com.sun.star.lang.WrappedTargetException
+ public UnoPkgContainer( XComponentContext xCtx, String locationURL,
+ String _extensionDb, String _extensionRepository, String language ) throws com.sun.star.lang.IllegalArgumentException, com.sun.star.lang.WrappedTargetException
{
super( xCtx, locationURL, language, false );
+ extensionDb = _extensionDb;
+ extensionRepository = _extensionRepository;
init();
}
@@ -218,8 +223,8 @@ public class UnoPkgContainer extends ParcelContainer
DeployedUnoPackagesDB dp = null;
try
{
- String path = containerUrl.substring( 0, containerUrl.lastIndexOf("/") );
- String packagesUrl = PathUtils.make_url( path, "Scripts/unopkg-desc.xml" );
+// String path = containerUrl.substring( 0, containerUrl.lastIndexOf("/") );
+ String packagesUrl = PathUtils.make_url( extensionDb, "/Scripts/" + extensionRepository + "-extension-desc.xml" );
LogUtils.DEBUG("getUnoPackagesDB() looking for existing db in " + packagesUrl );
if ( m_xSFA.exists( packagesUrl ) )
{
@@ -277,8 +282,8 @@ public class UnoPkgContainer extends ParcelContainer
OutputStream os = null;
try
{
- String path = containerUrl.substring( 0, containerUrl.lastIndexOf("/") );
- String packagesUrl = PathUtils.make_url( path, "Scripts/unopkg-desc.xml" );
+// String path = containerUrl.substring( 0, containerUrl.lastIndexOf("/") );
+ String packagesUrl = PathUtils.make_url( extensionDb, "/Scripts/" + extensionRepository + "-extension-desc.xml" );
xos = m_xSFA.openFileWrite( packagesUrl );
XTruncate xTrc = (XTruncate) UnoRuntime.queryInterface( XTruncate.class, xos );
if ( xTrc != null )
@@ -375,7 +380,10 @@ public class UnoPkgContainer extends ParcelContainer
String parentUrl = uri;
if ( uri.indexOf( "%2Funo_packages%2F" ) > -1 ||
- uri.indexOf( "/uno_packages/" ) > -1 )
+ uri.indexOf( "/uno_packages/" ) > -1 ||
+ uri.indexOf("$UNO_USER_PACKAGES_CACHE/") > -1 ||
+ uri.indexOf("$UNO_SHARED_PACKAGES_CACHE/") > -1 ||
+ uri.indexOf("$BUNDLED_EXTENSIONS/") > -1 )
{
//its in a bundle need to determine the uno-package file its in
LogUtils.DEBUG("processUnoPackage - is part of a uno bundle");
diff --git a/scripting/java/com/sun/star/script/framework/provider/ScriptProvider.java b/scripting/java/com/sun/star/script/framework/provider/ScriptProvider.java
index c43756072ba3..e83410f3f35c 100755
--- a/scripting/java/com/sun/star/script/framework/provider/ScriptProvider.java
+++ b/scripting/java/com/sun/star/script/framework/provider/ScriptProvider.java
@@ -213,26 +213,40 @@ public abstract class ScriptProvider
}
else
{
+ String extensionDb = null;
+ String extensionRepository = null;
+ if ( originalContextURL.startsWith( "bundled" ) )
+ {
+ contextUrl = "vnd.sun.star.expand:$BUNDLED_EXTENSIONS";
+ extensionDb = "vnd.sun.star.expand:${$BRAND_BASE_DIR/program/" + PathUtils.BOOTSTRAP_NAME + "::UserInstallation}/user";
+ extensionRepository = "bundled";
+ }
+
if ( originalContextURL.startsWith( "share" ) )
{
contextUrl = "vnd.sun.star.expand:${$BRAND_BASE_DIR/program/" + PathUtils.BOOTSTRAP_NAME + "::BaseInstallation}/share";
+ extensionDb = "vnd.sun.star.expand:${$BRAND_BASE_DIR/program/" + PathUtils.BOOTSTRAP_NAME + "::UserInstallation}/user";
+ extensionRepository = "shared";
}
else if ( originalContextURL.startsWith( "user" ) )
{
contextUrl = "vnd.sun.star.expand:${$BRAND_BASE_DIR/program/" + PathUtils.BOOTSTRAP_NAME + "::UserInstallation}/user";
+ extensionDb = "vnd.sun.star.expand:${$BRAND_BASE_DIR/program/" + PathUtils.BOOTSTRAP_NAME + "::UserInstallation}/user";
+ extensionRepository = "user";
}
if ( originalContextURL.endsWith( "uno_packages") )
{
isPkgProvider = true;
}
- if ( originalContextURL.endsWith( "uno_packages") && !originalContextURL.equals( contextUrl ) )
+ if ( originalContextURL.endsWith( "uno_packages") && !originalContextURL.equals( contextUrl )
+ && !extensionRepository.equals("bundled"))
{
contextUrl = PathUtils.make_url( contextUrl, "uno_packages" );
}
if ( isPkgProvider )
{
- m_container = new UnoPkgContainer( m_xContext, contextUrl, language );
+ m_container = new UnoPkgContainer( m_xContext, contextUrl, extensionDb, extensionRepository, language );
}
else
{
diff --git a/scripting/source/provider/ActiveMSPList.cxx b/scripting/source/provider/ActiveMSPList.cxx
index f8400ed77950..3c6206d8d051 100644
--- a/scripting/source/provider/ActiveMSPList.cxx
+++ b/scripting/source/provider/ActiveMSPList.cxx
@@ -59,6 +59,7 @@ ActiveMSPList::ActiveMSPList( const Reference< XComponentContext > & xContext )
{
userDirString = ::rtl::OUString::createFromAscii("user");
shareDirString = ::rtl::OUString::createFromAscii("share");
+ bundledDirString = ::rtl::OUString::createFromAscii("bundled");
}
ActiveMSPList::~ActiveMSPList()
@@ -307,6 +308,12 @@ ActiveMSPList::createNonDocMSPs()
Reference< provider::XScriptProvider > shareMsp( m_xContext->getServiceManager()->createInstanceWithArgumentsAndContext( serviceName, args, m_xContext ), UNO_QUERY );
// should check if provider reference is valid
m_hMsps[ shareDirString ] = shareMsp;
+
+ args[ 0 ] <<= bundledDirString;
+ Reference< provider::XScriptProvider > bundledMsp( m_xContext->getServiceManager()->createInstanceWithArgumentsAndContext( serviceName, args, m_xContext ), UNO_QUERY );
+ // should check if provider reference is valid
+ m_hMsps[ bundledDirString ] = bundledMsp;
+
created = true;
}
diff --git a/scripting/source/provider/ActiveMSPList.hxx b/scripting/source/provider/ActiveMSPList.hxx
index 5adf2fc5a961..b127f3c41b16 100644
--- a/scripting/source/provider/ActiveMSPList.hxx
+++ b/scripting/source/provider/ActiveMSPList.hxx
@@ -107,6 +107,7 @@ private:
osl::Mutex m_mutex;
::rtl::OUString userDirString;
::rtl::OUString shareDirString;
+ ::rtl::OUString bundledDirString;
css::uno::Reference< css::uno::XComponentContext > m_xContext;
};
} // func_provider