[api-dev] Extension - Addon.xcu

2009-12-08 Thread Jörg Schmidt
Hello,

in an extension (*.oxt) i use the following Addon.xcu to create an
button in the browserobject-toolbar - works correct in OOo 2.4.0 but not
in OOo 3.1.
(in OOo 3.1 i dont get a button in the browserobject-toolbar after
installation of the extension)

What can i do?


Regards,
Jörg


'--

?xml version='1.0' encoding='UTF-8'?
oor:component-data xmlns:oor=http://openoffice.org/2001/registry;
xmlns:xs=http://www.w3.org/2001/XMLSchema; oor:name=Addons
oor:package=org.openoffice.Office
 node oor:name=AddonUI
  node oor:name=OfficeToolbarMerging
   node oor:name=org.openoffice.test.testcomponent oor:op=replace
node oor:name=T1 oor:op=replace
 prop oor:name=MergeToolBar
  valuebrowserobjectbar/value
 /prop
 prop oor:name=MergePoint
  value.uno:Refresh/value
 /prop
 prop oor:name=MergeCommand
  valueAddAfter/value
 /prop
 prop oor:name=MergeFallback
  valueAddLast/value
 /prop
 prop oor:name=MergeContext
  value/
 /prop
 node oor:name=ToolBarItems
  node oor:name=B1 oor:op=replace
   prop oor:name=URL oor:type=xs:string

valuevnd.sun.star.script:Serien.HDCode.start_hd?language=Basicamp;loc
ation=application/value
/prop
   prop oor:name=Title oor:type=xs:string
valueTestaufruf/value
/prop
  /node
 /node
/node
   /node
  /node
 /node
/oor:component-data

'--



-
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org



Re: [api-dev] base api : Tables.createDataDescriptor do not show appendByDescriptor method

2009-12-08 Thread Fernand Vanrie

Laurent ,

From wath i know, i supose you have to define your Columndescriptor also
something
like:
with descCol
. name = testcolumn1
.type = datatype.INTEGER
.IsNullable=ColumnValues.NO_NULLS
.IsAutoincrement = true

thanks to Roberto Benitez and his exelent book i found this working sub:
Sub createTable()

Dim Context As Object
Dim DB As Object
Dim Conn As Object
Dim Tables AS Object
Dim Columns As Object
Dim Keys As Object
Dim KeyColumns As Object   
   Dim TableDescriptor As Object

   Dim ColumnDescriptor As Object
   Dim KeyDescriptor
   Dim DataTypes As object
   Dim ColumnValues As Object
   Dim KeyTypes As Object

   Context=CreateUnoService(com.sun.star.sdb.DatabaseContext)
   DB=Context.getByName(ConvertToURL(H:\Documents\Book\Sample 
Databases\DB1.odb) )

   Conn=DB.getConnection(,)

   DataTypes=com.sun.star.sdbc.DataType
   ColumnValues=com.sun.star.sdbc.ColumnValue
   KeyTypes=com.sun.star.sdbcx.KeyType
   REM CREATE DESCRIPTOR
   Tables=Conn.Tables
   TableDescriptor=Tables.createDataDescriptor()
   TableDescriptor.Name=INCIDENTS
   Columns=TableDescriptor.Columns
   ColumnDescriptor=Columns.createDataDescriptor()
  
   REM APPEND COLUMN 1

   With ColumnDescriptor
   .Name=INCIDENTID
   .Type=DataTypes.INTEGER
   .IsNullable=ColumnValues.NO_NULLS
   .IsAutoIncrement=True
   End With
   rem
   Columns.appendByDescriptor(ColumnDescriptor)
REM APPEND COLUMN 2
   With ColumnDescriptor
   .Name=EMPID
   .Type=DataTypes.INTEGER
   .IsNullable=ColumnValues.NO_NULLS
   .IsAutoIncrement=false REM WAS SET TO  TRUE ON PREVIOUS
   End With
   Columns.appendByDescriptor(ColumnDescriptor)
REM APPEND COLUMN 3
   With ColumnDescriptor
   .Name=DESCRIPTION
   .Type=DataTypes.LONGVARCHAR
   .IsNullable=ColumnValues.NULLABLE
   End With
   Columns.appendByDescriptor(ColumnDescriptor)

   REM CREATE KEY
   Keys=TableDescriptor.Keys
   KeyDescriptor=Keys.createDataDescriptor()
   KeyDescriptor.Type=KeyTypes.PRIMARY
   KeyDescriptor.Name=INCIDENTS_PK
   KeyColumns=KeyDescriptor.Columns
   ColumnDescriptor=KeyColumns.createDataDescriptor()
   ColumnDescriptor.Name=INCIDENTID
   KeyColumns.appendByDescriptor(ColumnDescriptor)
   Keys.AppendByDescriptor(KeyDescriptor)
  
   REM FINALLY, APPEND THE TABLE TO THE TABLE SUPPLIER
   Tables.appendByDescriptor(TableDescriptor)   
   Conn.Close()

End Sub

hope it helps
Fernand

Hi all

I'm facing a problem for 3 days i cannot solve using database and 
OOoBasic


My goal is to dynamically create a table

It used to work in some light tests based on Andrew's document (thanks 
to him) but now, going in my whole stuff, i encounter the following 
problem


I create my DataDescriptor,
descCol = connection.Tables.createDataDescriptor

I define the column, good, no problem

But, it raises an error when i want to
cols = descTable.Columns
cols.appendByDescriptor(descCol)

The appendByDescriptor method is not available for the created 
dataDescriptor , confirmed with the use of XRay


Is there any known cases where this can happen ?

I have also to say that i do somme uggly stuff on 
moving/deleting/copying .odb files before creating the connection but 
i do not expect problem here as examinating the connection seems ok, 
giving for example, all the tables list and doing requests (select, 
insert, update)
Btw, is there a way to list all the currently active connections that 
OOo manages in order to explore if i do not have some already opened, 
trying to close them for testing ?


Thanks a lot for any hints you may give to a poor lost scripter in 
database API world


Laurent



-
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org



-
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org



[api-dev] Will OpenOffice 3.1.1 supports com objects

2009-12-08 Thread Karthik Nagarajan
Hi,

I have downloaded openoffice 3.1.1, I want to convert doc to pdf using
microsoft 

.net. What dll i need to include and can you provide some code snippet
to 

convert.

 

 

Before i was using openoffice 2.3, I used to include 4 dll's into .net
project

C:\Program Files\OpenOffice.org 2.0\program\assembly\cli_basetypes.dll

C:\Program Files\OpenOffice.org 2.0\program\assembly\cli_cppuhelper.dll

C:\Program Files\OpenOffice.org 2.0\program\assembly\cli_types.dll

C:\Program Files\OpenOffice.org 2.0\program\assembly\cli_ure.dll

 

But all these dll's are not available in the newer version 3.1.1.

 

I want use it in .net project by including com objects of openoffice, as
i have 
plenty of files to convert, it is difficult to do it manually.
 
I know it is possible to convert to pdf using openoffice 2.3 com
objects.

 

But in the newer version those dll's are missing.

 

Thanks  Regards,

Karthik

Programmer Analyst

 

 



Re: [api-dev] Will OpenOffice 3.1.1 supports com objects

2009-12-08 Thread Juergen Schmidt

Hi Karthik,

yes it is still supported. The mentioned dll can you find today in the 
SDK becasue you need them mainly during the development. It's easier to 
find them in the SDK instead of searching the global assembly cache 
where they are as well after the default installation.


The SDK contains also some examples C# and VBA.NET show how to use the 
API from a .NT language.


I hope this helps

Juergen

Karthik Nagarajan wrote:

Hi,

I have downloaded openoffice 3.1.1, I want to convert doc to pdf using
microsoft 


.net. What dll i need to include and can you provide some code snippet
to 


convert.

 

 


Before i was using openoffice 2.3, I used to include 4 dll's into .net
project

C:\Program Files\OpenOffice.org 2.0\program\assembly\cli_basetypes.dll

C:\Program Files\OpenOffice.org 2.0\program\assembly\cli_cppuhelper.dll

C:\Program Files\OpenOffice.org 2.0\program\assembly\cli_types.dll

C:\Program Files\OpenOffice.org 2.0\program\assembly\cli_ure.dll

 


But all these dll's are not available in the newer version 3.1.1.

 


I want use it in .net project by including com objects of openoffice, as
i have 
plenty of files to convert, it is difficult to do it manually.
 
I know it is possible to convert to pdf using openoffice 2.3 com

objects.

 


But in the newer version those dll's are missing.

 


Thanks  Regards,

Karthik

Programmer Analyst

 

 






-
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org



Re: [api-dev] Extension - Addon.xcu

2009-12-08 Thread Steffen Grund

Hello Jörg,

when I change browserobjectbar to standardbar, your Addons.xcu 
works. It seems that browserobjectbar is not valid anymore, but I am 
not familiar with it, so I am at a loss there.


Where in the UI can you activate that toolbar?

HTH, Steffen

Jörg Schmidt wrote:

Hello,

in an extension (*.oxt) i use the following Addon.xcu to create an
button in the browserobject-toolbar - works correct in OOo 2.4.0 but not
in OOo 3.1.
(in OOo 3.1 i dont get a button in the browserobject-toolbar after
installation of the extension)

What can i do?


Regards,
Jörg


'--

?xml version='1.0' encoding='UTF-8'?
oor:component-data xmlns:oor=http://openoffice.org/2001/registry;
xmlns:xs=http://www.w3.org/2001/XMLSchema; oor:name=Addons
oor:package=org.openoffice.Office
 node oor:name=AddonUI
  node oor:name=OfficeToolbarMerging
   node oor:name=org.openoffice.test.testcomponent oor:op=replace
node oor:name=T1 oor:op=replace
 prop oor:name=MergeToolBar
  valuebrowserobjectbar/value
 /prop
 prop oor:name=MergePoint
  value.uno:Refresh/value
 /prop
 prop oor:name=MergeCommand
  valueAddAfter/value
 /prop
 prop oor:name=MergeFallback
  valueAddLast/value
 /prop
 prop oor:name=MergeContext
  value/
 /prop
 node oor:name=ToolBarItems
  node oor:name=B1 oor:op=replace
   prop oor:name=URL oor:type=xs:string

valuevnd.sun.star.script:Serien.HDCode.start_hd?language=Basicamp;loc
ation=application/value
/prop
   prop oor:name=Title oor:type=xs:string
valueTestaufruf/value
/prop
  /node
 /node
/node
   /node
  /node
 /node
/oor:component-data

'--



-
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org






-
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org



Re: [api-dev] Extension - Addon.xcu

2009-12-08 Thread Ariel Constenla-Haile
Hello Jörg, Steffen,

On Tuesday 08 December 2009, 07:43, Steffen Grund wrote:
 Hello Jörg,
 
 when I change browserobjectbar to standardbar, your Addons.xcu
 works. It seems that browserobjectbar is not valid anymore, but I am
 not familiar with it, so I am at a loss there.

no, you're right. MergeToolBar specifies the target toolbar. You have to use 
the name part of the toolbar resource URL. E.g. 
private:resource/toolbar/standardbar
quoting 
http://wiki.services.openoffice.org/wiki/Framework/Article/Addon_Menu_Toolbar_Merging

the name part is also the name of the xml file without extension, file which 
should be located, on Linux, in  
/opt/openoffice.org/basis3.2/share/config/soffice.cfg/modules/module/toolbar/name_part.xml

and there is no browserobjectbar.xml in any folder.


  in an extension (*.oxt) i use the following Addon.xcu to create an
  button in the browserobject-toolbar - works correct in OOo 2.4.0 but not
  in OOo 3.1.
  (in OOo 3.1 i dont get a button in the browserobject-toolbar after
  installation of the extension)
 
  What can i do?

there is o such toolbar in OOo 3.1. Browse 
/opt/openoffice.org/basis3.2/share/config/soffice.cfg/modules/module/toolbar 
to 
find out if it was renamed or merged.

Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina

-
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org



Re: [api-dev] base api : Tables.createDataDescriptor do not show appendByDescriptor method

2009-12-08 Thread Laurent Godard

Hi Fernand

As i told, plain example worked

The problem is that even if i can define a good TableDescriptor, the 
tables.columns do not show any .appendByDescriptor method, even if the 
connection is not read only as i can do update and insert requests


As i do some odd manipulations with moving odb files, unregistering 
datasources, registering and reconnect, i suspect things come from them


I had a look at pooling but did not find anything suitable

Btw, i had some results by reconnecting inside the sub to my datasource 
and not use the one i passed by argument to my sub.
I'll continue on this way, trying to identifiy exactly what happens and 
verify it does not work only by accident


Any hint on listing connection that are opened and manipulate 
(terminate, hard reload them) would help or at least give me some better 
knowledge over the global process of the api


Thanks again for your response

Laurent



-
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org



Re: [api-dev] Extension - Addon.xcu

2009-12-08 Thread Carsten Driesner

Ariel Constenla-Haile wrote:

Hello Jörg, Steffen,

On Tuesday 08 December 2009, 07:43, Steffen Grund wrote:

Hello Jörg,

when I change browserobjectbar to standardbar, your Addons.xcu
works. It seems that browserobjectbar is not valid anymore, but I am
not familiar with it, so I am at a loss there.


no, you're right. MergeToolBar specifies the target toolbar. You have to use 
the name part of the toolbar resource URL. E.g. 
private:resource/toolbar/standardbar
quoting 
http://wiki.services.openoffice.org/wiki/Framework/Article/Addon_Menu_Toolbar_Merging


the name part is also the name of the xml file without extension, file which 
should be located, on Linux, in  
/opt/openoffice.org/basis3.2/share/config/soffice.cfg/modules/module/toolbar/name_part.xml


and there is no browserobjectbar.xml in any folder.

Hi Ariel,

Thanks for your help. Your explanation is correct and that's why Jörg 
doesn't see the button. There is no way for the merging code to use any 
other toolbar if the referenced one is not available. As OOo 2.4 and OOo 
3.1 are two different major versions toolbars can be removed/added.


Regards,
Carsten

-
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org



[api-dev] open office with VB

2009-12-08 Thread Govind

Hello,

We need to implement an Application in VB 6, where we need to open the .doc
files using OO and read the bookmarks in the tables. And should catch the
Document open, close, Doc Activate and Deactivate events.

Is this possible from VB6 using Open office. Please send the
samples if any.

Thanks in advance.

Regards,
Govind.


Re: [api-dev] open office with VB

2009-12-08 Thread Cor Nouws

Hi Govind,

Govind wrote (8-12-2009 15:00)

We need to implement an Application in VB 6, where we need to open the .doc
files using OO and read the bookmarks in the tables. And should catch the
Document open, close, Doc Activate and Deactivate events.


Most of it I know for sure. I should have to do checks for the events. 
But you can do that yourself ;-) or maybe someone else knows right away.



Is this possible from VB6 using Open office. Please send the
samples if any.


Pls have a look at the dev-guide:
- 
http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/AdvUNO/Language_Bindings


And there are good topics in the OOoForum as well, for example:
- http://www.oooforum.org/forum/viewtopic.phtml?t=16895
- http://www.oooforum.org/forum/viewtopic.phtml?t=9815

Another useful source to start:
- http://www.kalitech.fr/clients/doc/VB_APIOOo_en.html

HTH  best regards,
Cor

PS CC-ed because you are not subscribed to the list -- pls reply to the 
list only.



--
Cor Nouws
  - nl.OpenOffice.org marketing contact
  - Community Contributor Representative in the Community Council
Gevoel niet vrij te zijn? Zie www.nieuwsteversie.nl

-
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org



Re: [api-dev] Extension - Addon.xcu

2009-12-08 Thread Jörg Schmidt
Hello Carsten,
Hello Ariel,

Thanks for the help, but:

Carsten Driesner wrote:
 http://wiki.services.openoffice.org/wiki/Framework/Article/Add
on_Menu_Toolbar_Merging

yes, i know this

 the name part is also the name of the xml file without extension, file
which
 should be located, on Linux, in

/opt/openoffice.org/basis3.2/share/config/soffice.cfg/modules/module/t
oolbar/name_part.xml

in my opinion, there is a problem.
In OOo 2.4.0 is the xml-file (in Windows):

C:\Programme\OpenOffice.org
2.4\share\config\soffice.cfg\modules\dbbrowser\toolbar\browserobjectbar.
xml

but in OOo 3.1.0 the file for the functional same toolbar is:

C:\Programme\OpenOffice.org
3\Basis\share\config\soffice.cfg\modules\dbbrowser\toolbar\toolbar.xml

and i think the file-name toolbar.xml is not a clear (unambiguous)
name.
For example i find the same name in:

C:\Programme\OpenOffice.org
3\Basis\share\config\soffice.cfg\modules\scalc\toolbar\toolbar.xml
C:\Programme\OpenOffice.org
3\Basis\share\config\soffice.cfg\modules\swriter\toolbar\toolbar.xml
...


And now? What can i do?
What must i write for:

'...
prop oor:name=MergeToolBar
  valuebrowserobjectbar/value
/prop
'...

when i will merge in this toolbar:
C:\Programme\OpenOffice.org
3\Basis\share\config\soffice.cfg\modules\dbbrowser\toolbar\toolbar.xml


 There is no way for the merging code to use any
 other toolbar if the referenced one is not available.

OK, thats clear for me.


 As OOo 2.4 and OOo
 3.1 are two different major versions toolbars can be removed/added.

the functional same toolbar exists in OOo 2.4 and 3.1, only the name is
not the same, in OOo 2.4 the (file-)name is browserobjectbar.xml and
in OOo 3.1 toolbar.xml.




Or another question:
How can i create a addon.xcu in a extension for a new independent
toolbar which i can dock _in the area  of the DataSource-browser_?
(DataSource-Browser is the 'Window' i get with: View-DataSources in the
menu, or shortcut F4)
Note: it is (in my opinion) not possible to drag a 'normal' toolbar in
the area of the DataSource-browser.



Regards,
Jörg


-
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org



Re: [api-dev] Extension - Addon.xcu

2009-12-08 Thread Jörg Schmidt
Hello Steffen,

steffen.gr...@sun.com wrote:
 when I change browserobjectbar to standardbar, your Addons.xcu
 works. It seems that browserobjectbar is not valid anymore,
 but I am
 not familiar with it, so I am at a loss there.

 Where in the UI can you activate that toolbar?

i mean the toolbar you can see if you click View-Data Sources in the
OOo-menu - the shortcut is F4


Regards,
Jörg


-
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org



Re: [api-dev] Extension - Addon.xcu

2009-12-08 Thread Ariel Constenla-Haile
Hello Jörg,

On Tuesday 08 December 2009, 15:33, Jörg Schmidt wrote:
 in my opinion, there is a problem.
 In OOo 2.4.0 is the xml-file (in Windows):
 
 C:\Programme\OpenOffice.org
 2.4\share\config\soffice.cfg\modules\dbbrowser\toolbar\browserobjectbar.
 xml
 
 but in OOo 3.1.0 the file for the functional same toolbar is:
 
 C:\Programme\OpenOffice.org
 3\Basis\share\config\soffice.cfg\modules\dbbrowser\toolbar\toolbar.xml
 
 and i think the file-name toolbar.xml is not a clear (unambiguous)
 name.
 For example i find the same name in:
 
 C:\Programme\OpenOffice.org
 3\Basis\share\config\soffice.cfg\modules\scalc\toolbar\toolbar.xml
 C:\Programme\OpenOffice.org
 3\Basis\share\config\soffice.cfg\modules\swriter\toolbar\toolbar.xml
 ...
 
 
 And now? What can i do?
 What must i write for:
 
 '...
 prop oor:name=MergeToolBar
   valuebrowserobjectbar/value
 /prop
 '...
 
 when i will merge in this toolbar:
 C:\Programme\OpenOffice.org
 3\Basis\share\config\soffice.cfg\modules\dbbrowser\toolbar\toolbar.xml

you must specify the module the toolbar belongs to:

MergeContext  Defines in which application module context the merge instruction 
should be active. Contexts must be separated by a comma. An empty context 
means that the instruction is always active. The context string is identical 
with the module identifier accessible from the com.sun.star.frame.ModuleManager 
service. The following module identifiers are defined (for a complete list 
refer 
to Office modules since OpenOffice.org 2.3)
http://wiki.services.openoffice.org/wiki/Office_modules_since_OpenOffice.org_2.3
(should be updated, in OOo 3.2 the macro in that page counts 22 modules)

/opt/openoffice.org/basis3.2/share/config/soffice.cfg/modules/module/toolbar/name_part.xml

In your case module is dbbrowser, so use com.sun.star.sdb.DataSourceBrowser 
for the DataSourceBrowser.


Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina

-
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org