You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openoffice.apache.org by Ariel Constenla-Haile <ar...@gmail.com> on 2011/11/15 01:40:15 UTC

[API] Re: No addRow method in XGridDataModel interface in Oo 3.4 beta

Hi Gerardo,

On Mon, Nov 14, 2011 at 06:02:46PM -0600, Gerardo Gómez wrote:
> Hello.
> I've developed an extension which uses the XGridDataModel (especifically a
> grid). This extension works ok on Ooo 3.3, but when i try to use it in the
> new version, the 3.4 beta, the dialog that has the grid doesn't work at
> all. This message is shown when i try to display the dialog with the grid:
> 
> /opt/ooo-dev3/program/../basis-link/ure-link/lib/libstdc++.so.6: version
> `GLIBCXX_3.4.11' not found (required by /usr/lib/libproxy.so.1)
> Failed to load module: /usr/lib/gio/modules/libgiolibproxy.so
> Exception in thread "Thread-175" java.lang.NoSuchMethodError:
> com.sun.star.awt.grid.XGridDataModel.addRow(Ljava/lang/String;[Ljava/lang/Object;)V
>         at util.OoGridDataModel.addRow(OoGridDataModel.java:43)
>         at util.OoGridDataModel.addRow(OoGridDataModel.java:39)
>         at
> org.openoffice.gdocs.ui.dialogs.ImportDialog.getDocumentsGrid(ImportDialog.java:811)
>         at
> org.openoffice.gdocs.ui.dialogs.ImportDialog.initComponents(ImportDialog.java:319)
>         at
> org.openoffice.gdocs.ui.dialogs.ImportDialog.<init>(ImportDialog.java:257)
>         at org.openoffice.gdocs.UNOGDocs$3.run(UNOGDocs.java:262)
>         at java.lang.Thread.run(Thread.java:662)
> 
> I think that this problem has to do with the new version (maybe because it
> is a beta).

the API was changed in an incompatible way with
http://hg.services.openoffice.org/OOO340/rev/435dac48d5dd
since 3.4 you have to use css.awt.grid.XMutableGridDataModel, it should
be document on the SDK you downloaded with OOo 3.4 beta


Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina

Re: [API] Re: No addRow method in XGridDataModel interface in Oo 3.4 beta

Posted by Frank Schönheit <fr...@gmx.de>.
Hi Fernand,

> I am sure you can explain me why the DatasourceBrowser is not working 
> with a connection made from the DriverManager !

The connection obtained at the DriverManager is a css.sdbc.Connection,
while the data source browser expects a css.sdb.Connection, which offers
more features.

Ciao
Frank


Re: [API] Re: No addRow method in XGridDataModel interface in Oo 3.4 beta

Posted by Ariel Constenla-Haile <ar...@apache.org>.
Hi Fernand,

On Tue, Nov 15, 2011 at 11:35:35AM +0100, Fernand Vanrie wrote:
> Ariel ,
> 
> As y do not know about  C++ and Java i stick to Basic :-)
> Thanks (as always) for the knowledge !
> 
> BTW , I am interested in the Gridcontrol , because the Datasource
> browser is not working with a connection made using the
> "DriverManger".
> 
> oManager = CreateUnoService("com.sun.star.sdbc.DriverManager")
> oConn = oManager.getConnectionWithInfo(sURL, oParms())
> 
> When using the "Database Context"  to get a connenction  , the
> DataSourceBrowser is working,
> 
> I am sure you can explain me why the DatasourceBrowser is not
> working with a connection made from the DriverManager !

How were you trying this? Were you trying to pass oConn as value for
"ActiveConnection" when loading the DSB?

According to the API scpec.
http://api.openoffice.org/docs/common/ref/com/sun/star/sdb/DataSourceBrowser.html

the DSB does not accept an "ActiveConnection", only these properties
from the DataAccessDescriptor
http://api.openoffice.org/docs/common/ref/com/sun/star/sdb/DataAccessDescriptor.html
are accepted:

* DataAccessDescriptor::DataSourceName
* DataAccessDescriptor::Command
* DataAccessDescriptor::CommandType
* optional DataAccessDescriptor::Selection
* optional DataAccessDescriptor::BookmarkSelection
* optional DataAccessDescriptor::ResultSet

notice that the DataSourceName is not optional, and no ActiveConnection
(== you have to give the name of a registered data source).


Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina

Re: [API] Re: No addRow method in XGridDataModel interface in Oo 3.4 beta

Posted by Fernand Vanrie <so...@pmgroup.be>.
Ariel ,

As y do not know about  C++ and Java i stick to Basic :-)
Thanks (as always) for the knowledge !

BTW , I am interested in the Gridcontrol , because the Datasource 
browser is not working with a connection made using the "DriverManger".

oManager = CreateUnoService("com.sun.star.sdbc.DriverManager")
oConn = oManager.getConnectionWithInfo(sURL, oParms())

When using the "Database Context"  to get a connenction  , the 
DataSourceBrowser is working,

I am sure you can explain me why the DatasourceBrowser is not working 
with a connection made from the DriverManager !

Greetz

Fernand

> Hi Fernando, Gerardo, *,
>
> On Tue, Nov 15, 2011 at 09:59:48AM +0100, Fernand Vanrie wrote:
>> Ariel, Gerardo
>>
>> I am working with LibreOffice OOO340m1 (Build:302) and all new
>> featers (like Backgroundcolors etc..) using the API and Basic seems
>> to work:
>>
>> dlg.Model.createInstance("com.sun.star.awt.grid.UnoControlGridModel")
>> gcolm2 = CreateUnoService("com.sun.star.awt.grid.DefaultGridColumnModel")
>> gcolm2.addColumn(oCol)
>> gdatam2 = CreateUnoService("com.sun.star.awt.grid.DefaultGridDataModel")
>> gdatam2.addRow(nRowCount,oData2())
> because this is Basic, but com.sun.star.awt.grid.DefaultGridDataModel in
> 3.4 implements XMutableGridDataModel, addRow is a method from this interface,
> not from XGridDataModel anymore:
>
> AOOo:
> http://svn.apache.org/viewvc/incubator/ooo/trunk/main/offapi/com/sun/star/awt/grid/DefaultGridDataModel.idl?view=markup
> http://svn.apache.org/viewvc/incubator/ooo/trunk/main/offapi/com/sun/star/awt/grid/XMutableGridDataModel.idl?view=markup
> (May be the beta SDK docs could be uploaded to
> http://ooo-site.staging.apache.org/api/ )
>
> LO:
> http://api.libreoffice.org/docs/common/ref/com/sun/star/awt/grid/DefaultGridDataModel.html
> http://api.libreoffice.org/docs/common/ref/com/sun/star/awt/grid/XMutableGridDataModel.html
>
> You don't have problems in Basic of course, but in C++ and Java you have
> to query the right interface, XMutableGridDataModel  instead of XGridDataModel.
> Gerardo should upgrade the minimal version to 3.4 otherwise the
> extension won't work.
>
>
> Regards


Re: [API] Re: No addRow method in XGridDataModel interface in Oo 3.4 beta

Posted by Ariel Constenla-Haile <ar...@apache.org>.
Hi Fernando, Gerardo, *,

On Tue, Nov 15, 2011 at 09:59:48AM +0100, Fernand Vanrie wrote:
> Ariel, Gerardo
> 
> I am working with LibreOffice OOO340m1 (Build:302) and all new
> featers (like Backgroundcolors etc..) using the API and Basic seems
> to work:
> 
> dlg.Model.createInstance("com.sun.star.awt.grid.UnoControlGridModel")
> gcolm2 = CreateUnoService("com.sun.star.awt.grid.DefaultGridColumnModel")
> gcolm2.addColumn(oCol)
> gdatam2 = CreateUnoService("com.sun.star.awt.grid.DefaultGridDataModel")
> gdatam2.addRow(nRowCount,oData2())

because this is Basic, but com.sun.star.awt.grid.DefaultGridDataModel in
3.4 implements XMutableGridDataModel, addRow is a method from this interface, 
not from XGridDataModel anymore:

AOOo:
http://svn.apache.org/viewvc/incubator/ooo/trunk/main/offapi/com/sun/star/awt/grid/DefaultGridDataModel.idl?view=markup
http://svn.apache.org/viewvc/incubator/ooo/trunk/main/offapi/com/sun/star/awt/grid/XMutableGridDataModel.idl?view=markup
(May be the beta SDK docs could be uploaded to
http://ooo-site.staging.apache.org/api/ )

LO:
http://api.libreoffice.org/docs/common/ref/com/sun/star/awt/grid/DefaultGridDataModel.html
http://api.libreoffice.org/docs/common/ref/com/sun/star/awt/grid/XMutableGridDataModel.html

You don't have problems in Basic of course, but in C++ and Java you have
to query the right interface, XMutableGridDataModel  instead of XGridDataModel.
Gerardo should upgrade the minimal version to 3.4 otherwise the
extension won't work.


Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina

Re: [API] Re: No addRow method in XGridDataModel interface in Oo 3.4 beta

Posted by Fernand Vanrie <so...@pmgroup.be>.
Ariel, Gerardo

I am working with LibreOffice OOO340m1 (Build:302) and all new featers 
(like Backgroundcolors etc..) using the API and Basic seems to work:

dlg.Model.createInstance("com.sun.star.awt.grid.UnoControlGridModel")
gcolm2 = CreateUnoService("com.sun.star.awt.grid.DefaultGridColumnModel")
gcolm2.addColumn(oCol)
gdatam2 = CreateUnoService("com.sun.star.awt.grid.DefaultGridDataModel")
gdatam2.addRow(nRowCount,oData2())

Greetz

Fernand
> Hello Ariel.
> Thank you again for pointing me in to the right direction. I think this
> same error is caused in LibreOffice by this change in the UNO-AWT API.
> Thanks.
>
> On Mon, Nov 14, 2011 at 6:40 PM, Ariel Constenla-Haile<
> ariel.constenla.haile@gmail.com>  wrote:
>
>> Hi Gerardo,
>>
>> On Mon, Nov 14, 2011 at 06:02:46PM -0600, Gerardo Gómez wrote:
>>> Hello.
>>> I've developed an extension which uses the XGridDataModel (especifically
>> a
>>> grid). This extension works ok on Ooo 3.3, but when i try to use it in
>> the
>>> new version, the 3.4 beta, the dialog that has the grid doesn't work at
>>> all. This message is shown when i try to display the dialog with the
>> grid:
>>> /opt/ooo-dev3/program/../basis-link/ure-link/lib/libstdc++.so.6: version
>>> `GLIBCXX_3.4.11' not found (required by /usr/lib/libproxy.so.1)
>>> Failed to load module: /usr/lib/gio/modules/libgiolibproxy.so
>>> Exception in thread "Thread-175" java.lang.NoSuchMethodError:
>>>
>> com.sun.star.awt.grid.XGridDataModel.addRow(Ljava/lang/String;[Ljava/lang/Object;)V
>>>          at util.OoGridDataModel.addRow(OoGridDataModel.java:43)
>>>          at util.OoGridDataModel.addRow(OoGridDataModel.java:39)
>>>          at
>>>
>> org.openoffice.gdocs.ui.dialogs.ImportDialog.getDocumentsGrid(ImportDialog.java:811)
>>>          at
>>>
>> org.openoffice.gdocs.ui.dialogs.ImportDialog.initComponents(ImportDialog.java:319)
>>>          at
>>>
>> org.openoffice.gdocs.ui.dialogs.ImportDialog.<init>(ImportDialog.java:257)
>>>          at org.openoffice.gdocs.UNOGDocs$3.run(UNOGDocs.java:262)
>>>          at java.lang.Thread.run(Thread.java:662)
>>>
>>> I think that this problem has to do with the new version (maybe because
>> it
>>> is a beta).
>> the API was changed in an incompatible way with
>> http://hg.services.openoffice.org/OOO340/rev/435dac48d5dd
>> since 3.4 you have to use css.awt.grid.XMutableGridDataModel, it should
>> be document on the SDK you downloaded with OOo 3.4 beta
>>
>>
>> Regards
>> --
>> Ariel Constenla-Haile
>> La Plata, Argentina
>>


Re: [API] Re: No addRow method in XGridDataModel interface in Oo 3.4 beta

Posted by Gerardo Gómez <ge...@gmail.com>.
Hello Ariel.
Thank you again for pointing me in to the right direction. I think this
same error is caused in LibreOffice by this change in the UNO-AWT API.
Thanks.

On Mon, Nov 14, 2011 at 6:40 PM, Ariel Constenla-Haile <
ariel.constenla.haile@gmail.com> wrote:

> Hi Gerardo,
>
> On Mon, Nov 14, 2011 at 06:02:46PM -0600, Gerardo Gómez wrote:
> > Hello.
> > I've developed an extension which uses the XGridDataModel (especifically
> a
> > grid). This extension works ok on Ooo 3.3, but when i try to use it in
> the
> > new version, the 3.4 beta, the dialog that has the grid doesn't work at
> > all. This message is shown when i try to display the dialog with the
> grid:
> >
> > /opt/ooo-dev3/program/../basis-link/ure-link/lib/libstdc++.so.6: version
> > `GLIBCXX_3.4.11' not found (required by /usr/lib/libproxy.so.1)
> > Failed to load module: /usr/lib/gio/modules/libgiolibproxy.so
> > Exception in thread "Thread-175" java.lang.NoSuchMethodError:
> >
> com.sun.star.awt.grid.XGridDataModel.addRow(Ljava/lang/String;[Ljava/lang/Object;)V
> >         at util.OoGridDataModel.addRow(OoGridDataModel.java:43)
> >         at util.OoGridDataModel.addRow(OoGridDataModel.java:39)
> >         at
> >
> org.openoffice.gdocs.ui.dialogs.ImportDialog.getDocumentsGrid(ImportDialog.java:811)
> >         at
> >
> org.openoffice.gdocs.ui.dialogs.ImportDialog.initComponents(ImportDialog.java:319)
> >         at
> >
> org.openoffice.gdocs.ui.dialogs.ImportDialog.<init>(ImportDialog.java:257)
> >         at org.openoffice.gdocs.UNOGDocs$3.run(UNOGDocs.java:262)
> >         at java.lang.Thread.run(Thread.java:662)
> >
> > I think that this problem has to do with the new version (maybe because
> it
> > is a beta).
>
> the API was changed in an incompatible way with
> http://hg.services.openoffice.org/OOO340/rev/435dac48d5dd
> since 3.4 you have to use css.awt.grid.XMutableGridDataModel, it should
> be document on the SDK you downloaded with OOo 3.4 beta
>
>
> Regards
> --
> Ariel Constenla-Haile
> La Plata, Argentina
>