Hi there,
maybe one of the questions was buried to deep in this thread.
Looking at the following input and output from
ScriptURIHelper.getStorageURI() it seems that there is a bug, in that
the directory (dubbed "library" in the scripting framework) which
contains the scripts is not resolved correctly. The "library" part is
not delimited with the 'file.separator' character, but with a dot !
... cut ...
as we have it in OOo Basic and ooRexx, here is in Java:
//***********************************************************************
import com.sun.star.uno.XComponentContext;
import com.sun.star.comp.helper.Bootstrap;
import com.sun.star.script.provider.ScriptURIHelper;
import com.sun.star.script.provider.XScriptURIHelper;
/**
*
* @author ariel
*/
public class ScriptURIHelperDemo {
/** Creates a new instance of ScriptURIHelperDemo */
public ScriptURIHelperDemo() {
}
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
try {
String[][] sScripts = {
{
"Basic", "user",// Language, Location
"vnd.sun.star.script:Standard.Module1.Main?" +
"language=Basic&location=application"// Script URI
},
{
"BeanShell", "share",
"vnd.sun.star.script:HelloWorld.helloworld.bsh?" +
"language=BeanShell&location=share"
},
{
"JavaScript", "share",
"vnd.sun.star.script:HelloWorld.helloworld.js?" +
"language=JavaScript&location=share"
},
{
"Java", "share",
"vnd.sun.star.script:HelloWorld.HelloWorld.printHW?" +
"language=Java&location=share"
},
{
"Python", "share",
"vnd.sun.star.script:pythonSamples|TableSample.py$createTable?" +
"language=Python&location=share"
}
};
// get the remote office component context
XComponentContext xContext = Bootstrap.bootstrap();
XScriptURIHelper xScriptURIHelper; String sLanguage, sLoc;
for (String[] scripts : sScripts) {
sLanguage = scripts[0];
sLoc = scripts[1];
System.out.printf("*********************************************" +
"%n%s - %s%n%n", sLanguage, sLoc);
xScriptURIHelper = ScriptURIHelper.create( xContext,
sLanguage, sLoc );
System.out.printf("getRootStorageURI() - %s%n%n",
xScriptURIHelper.getRootStorageURI() );
String sOriginalURI = scripts[2];
String sStorageURI = xScriptURIHelper.getStorageURI(
sOriginalURI );
String sScriptURI = xScriptURIHelper.getScriptURI(
sStorageURI );
System.out.printf( "script URI - %s%n" +
"getStorageURI() - %s%n" + "getScriptURI() - %s%n%n", sOriginalURI,
sStorageURI, sScriptURI);
}
} catch (java.lang.Exception e) {
e.printStackTrace();
} finally {
System.exit(0);
}
}
}
//***********************************************************************
the output in Linux/SuSe is
*********************************************
Basic - user
getRootStorageURI() -
file:///home/ariel/.openoffice.org2/user/Scripts/basic
script URI -
vnd.sun.star.script:Standard.Module1.Main?language=Basic&location=application
getStorageURI() -
file:///home/ariel/.openoffice.org2/user/Scripts/basic/Standard.Module1.Main
getScriptURI() -
vnd.sun.star.script:Standard.Module1.Main?language=Basic&location=user
*********************************************
BeanShell - share
getRootStorageURI() -
file:///opt/openoffice.org2.4/program/../share/Scripts/beanshell
script URI -
vnd.sun.star.script:HelloWorld.helloworld.bsh?language=BeanShell&location=share
getStorageURI() -
file:///opt/openoffice.org2.4/program/../share/Scripts/beanshell/HelloWorld.helloworld.bsh
getScriptURI() -
vnd.sun.star.script:HelloWorld.helloworld.bsh?language=BeanShell&location=share
*********************************************
JavaScript - share
getRootStorageURI() -
file:///opt/openoffice.org2.4/program/../share/Scripts/javascript
script URI -
vnd.sun.star.script:HelloWorld.helloworld.js?language=JavaScript&location=share
getStorageURI() -
file:///opt/openoffice.org2.4/program/../share/Scripts/javascript/HelloWorld.helloworld.js
getScriptURI() -
vnd.sun.star.script:HelloWorld.helloworld.js?language=JavaScript&location=share
*********************************************
Java - share
getRootStorageURI() -
file:///opt/openoffice.org2.4/program/../share/Scripts/java
script URI -
vnd.sun.star.script:HelloWorld.HelloWorld.printHW?language=Java&location=share
getStorageURI() -
file:///opt/openoffice.org2.4/program/../share/Scripts/java/HelloWorld.HelloWorld.printHW
getScriptURI() -
vnd.sun.star.script:HelloWorld.HelloWorld.printHW?language=Java&location=share
*********************************************
Python - share
getRootStorageURI() -
file:///opt/openoffice.org2.4/program/../share/Scripts/python
script URI -
vnd.sun.star.script:pythonSamples|TableSample.py$createTable?language=Python&location=share
getStorageURI() -
file:///opt/openoffice.org2.4/program/../share/Scripts/python/pythonSamples/TableSample.py$createTable
getScriptURI() -
vnd.sun.star.script:pythonSamples|TableSample.py$createTable?language=Python&location=share
So can the result of "getStorageURI()" be regarded as a bug?
---rony
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]