Some points...

Hi Andreas,

Andreas Saeger escribió:
Hello,
I'm referring to http://www.openoffice.org/issues/show_bug.cgi?id=89534
It seems to be necessary to "unlock" an installed Java library before we
can use it with our beloved hsqldb. How do I actually "unlock" a Java
library? I followed the path outlined by Ariel and merged
<node oor:name="DriverSettings">
        <node oor:name="com.sun.star.sdbcx.comp.hsqldb.Driver">
                <node oor:name="PermittedJavaMethods">
                        <prop oor:name="Ariel Functions" oor:op="replace" 
oor:type="xs:string">
                                
<value>ar.com.arielconstenlahaile.dbextras.funcsql.Fechas.*</value>
                        </prop>
                </node>
        </node>
</node>

into DataAccess.xcu, which is the same registry file where all my
datasources are defined as well. This seems to correspond with the
definitions given in the respective DataAccess.xcs.


Oh, who had this great PermittedJavaMethods idea?

of course it wasn't our dear base development team, but some one afraid of security-issues

My dear, you have now to create an extension in order to merge this into your configuration!

I guess (=didn't try) that if you just add this to your /home/ariel/.openoffice.org2/user/registry/data/org/openoffice/Office/DataAccess.xcu it won't be cached.


Other way: try it with the configuration API (this one I tried, and WORKED, oh Lord!):

'***************************************************************************
Option Explicit

PRIVATE CONST DRIVER_SETTINGS_NODE_PATH = "org.openoffice.Office.DataAccess/DriverSettings"
PRIVATE CONST HSQLDB_DRIVER = "com.sun.star.sdbcx.comp.hsqldb.Driver"
PRIVATE CONST METHODS = "PermittedJavaMethods"

Sub HSQLDB_StoredProcedures

        Dim oConfig as Object   
        oConfig = getConfigurationAccess(DRIVER_SETTINGS_NODE_PATH, true)
        
        Dim oHsqlDriver as Object
        oHsqlDriver = oConfig.getByName(HSQLDB_DRIVER)
        
        Dim oJavaMethods as Object
        
        'Of course, simpler is to use the hierarchical mane directly ;-)
        
'"/org.openoffice.Office.DataAccess/DriverSettings/com.sun.star.sdbcx.comp.hsqldb.Driver/PermittedJavaMethods"
        oJavaMethods = oHsqlDriver.getByName(METHODS)
        
        Dim oNewMethod as Variant, sMethods$
        sMethods = "My Own HSQLDB StoredProcedures"

As insertByName throws an exception if there exists another element with the same name, the previous line should be replaced, to be on the safe side, with

sMethods = CreateUniqueNameForContainerElement(oJavaMethods,"My Own HSQLDB StoredProcedures")


And add the following function (that obviously creates a unique name for a container element):

'*******************************************************************
Function CreateUniqueNameForContainerElement(oContainer as Object, sElementName as String) as String
        Dim sUniqueName$ : sUniqueName = sElementName
        If HasUnoInterfaces(oContainer, "com.sun.star.container.XNameAccess") 
Then
                Dim i& : i = 0
                Do While oContainer.hasByName(sUniqueName)
                        sUniqueName = sElementName + i
                        i = i + 1
                Loop
        Else
                sUniqueName = "" 'return an empty string
        End If
        CreateUniqueNameForContainerElement = sUniqueName
End Function
'*******************************************************************


Regards
Ariel.


--
Ariel Constenla-Haile
La Plata, Argentina

[EMAIL PROTECTED]
[EMAIL PROTECTED]

http://www.ArielConstenlaHaile.com.ar/ooo/



"Aus der Kriegsschule des Lebens
                - Was mich nicht umbringt,
        macht mich härter."
                Nietzsche Götzendämmerung, Sprüche und Pfeile, 8.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to