diff options
author | Rüdiger Timm <rt@openoffice.org> | 2005-01-27 14:27:53 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2005-01-27 14:27:53 +0000 |
commit | 20a3ef622bf3275750607740744f12cf812f65dc (patch) | |
tree | b38c163bc8de41dacf38fe487a49e9950dbb56b0 /scripting | |
parent | dae6a8ac74cd5bf30addbe8702104e6a1322fccd (diff) |
INTEGRATION: CWS scriptingf10 (1.5.12); FILE MERGED
2005/01/20 16:39:39 toconnor 1.5.12.3: #i25268# further url handling fix
2005/01/18 14:50:47 toconnor 1.5.12.2: #i25269# url handling broken is some cases
2005/01/10 12:03:46 toconnor 1.5.12.1: #i25269# add getChildContainerForUrl method for UNO package scripts
Diffstat (limited to 'scripting')
-rw-r--r-- | scripting/java/com/sun/star/script/framework/container/UnoPkgContainer.java | 33 |
1 files changed, 25 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 42a6428cbf18..dd327c9a93b5 100644 --- a/scripting/java/com/sun/star/script/framework/container/UnoPkgContainer.java +++ b/scripting/java/com/sun/star/script/framework/container/UnoPkgContainer.java @@ -2,9 +2,9 @@ * * $RCSfile: UnoPkgContainer.java,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: rt $ $Date: 2004-11-15 15:56:34 $ + * last change: $Author: rt $ $Date: 2005-01-27 15:27:53 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -125,6 +125,11 @@ public class UnoPkgContainer extends ParcelContainer // gets the ParcelContainer for persisted uno packages public ParcelContainer getRegisteredUnoPkgContainer( String url ) { + if (!url.endsWith("/")) + { + url += "/"; + } + LogUtils.DEBUG("** getRegisterPackage ctx = " + containerUrl ); LogUtils.DEBUG("** getRegisterPackage for uri " + url ); LogUtils.DEBUG("** getRegisterPackage for langugage " + language ); @@ -145,6 +150,11 @@ public class UnoPkgContainer extends ParcelContainer private void registerPackageContainer( String url, ParcelContainer c ) { + if (!url.endsWith("/")) + { + url += "/"; + } + LogUtils.DEBUG("RegisterPackage ctx = " + containerUrl ); LogUtils.DEBUG("RegisterPackage language = " + language ); LogUtils.DEBUG("RegisterPackage " + c + " for url " + url ); @@ -153,6 +163,11 @@ public class UnoPkgContainer extends ParcelContainer public void deRegisterPackageContainer( String url ) { + if (!url.endsWith("/")) + { + url += "/"; + } + LogUtils.DEBUG("In deRegisterPackageContainer for " + url ); if ( hasRegisteredUnoPkgContainer( url ) ) { @@ -258,10 +273,7 @@ public class UnoPkgContainer extends ParcelContainer throw new com.sun.star.lang.WrappedTargetException( "Failed to resolve script " , null, new com.sun.star.lang.IllegalArgumentException( "Cannot resolve script location for script = " + functionName ) ); } - Parcel p = null; - p = (Parcel)pc.getByName( parcelName ); - scriptData = (ScriptMetaData)p.getByName( functionName ); - LogUtils.DEBUG("** found script data for " + functionName + " script is " + scriptData ); + scriptData = pc.findScript( psu ); return scriptData; } @@ -385,6 +397,12 @@ public class UnoPkgContainer extends ParcelContainer String uri = null; DeployedUnoPackagesDB db = null; uri = dPackage.getURL(); + + if ( !uri.endsWith( "/" ) ) + { + uri += "/"; + } + LogUtils.DEBUG("** processUnoPackage getURL() -> " + uri ); LogUtils.DEBUG("** processUnoPackage getName() -> " + dPackage.getName() ); LogUtils.DEBUG("** processUnoPackage getMediaType() -> " + dPackage.getPackageType().getMediaType() ); @@ -405,7 +423,6 @@ public class UnoPkgContainer extends ParcelContainer LogUtils.DEBUG("processUnoPackage - script library package"); String parentUrl = uri; - if ( uri.indexOf( "%2Funo_packages%2F" ) > -1 || uri.indexOf( "/uno_packages/" ) > -1 ) { @@ -425,7 +442,7 @@ public class UnoPkgContainer extends ParcelContainer LogUtils.DEBUG("processUnoPackage - composition is contained in " + parentUrl); } - ParcelContainer pkgContainer = getChildContainer( parentUrl ); + ParcelContainer pkgContainer = getChildContainerForURL( parentUrl ); if ( pkgContainer == null ) { pkgContainer = new ParcelContainer( this, m_xCtx, parentUrl, language, false ); |