[api-dev] Seeking code-snippets or hints for ...

2005-11-11 Thread Rony G. Flatscher




Hi there,

maybe with a little luck there may be people on this list who have
created already code (or know which corners to use) that I would be
seeking and are kind enough to make it available or point to it. Any
language is fine! 

This is what I would be interested in to achieve programmatical (using
ultimately Java):

  Register a package programmatically (programmatic counterpart of:
Tools - Package Manager, querying and adding a package to "My
Packages"),
  adding a Java Classpath entry to OOo (programmatic counterpart
of: Tools - Options - Java - Class Path),
  shutting down all instances of OOo including the Quickstarter.

The reason for this request is to create a script which would register
a package and configure Java, in order to relief users from these
potentially complex activities (especially w.r.t. OOo endusers).

Any hints or code (any language would suffice) snippets highly
appreciated. 

TIA,

---rony





Re: [api-dev] Seeking code-snippets or hints for ...

2005-11-11 Thread Daniel Boelzle

Hello Rony G.,

 This is what I would be interested in to achieve programmatical (using
 ultimately Java):
 
1. Register a package programmatically (programmatic counterpart of:
   Tools - Package Manager, querying and adding a package to My
   Packages),

Use the UNO deployment API, i.e. have a look at package
com.sun.star.deployment:
1. get the package manager factory singleton
2. get a package manager instance for context user
3. add the package

This is essentially what unopkg or pkgchk do (i.e. using the API).  If
there is a running office instance, they connect to it and perform the
deployment tasks.

2. adding a Java Classpath entry to OOo (programmatic counterpart of:
   Tools - Options - Java - Class Path),

A clean extension would refer to additional jar files within the
component's manifest.mf file, e.g. using ClassPath: add_my.jar.  That
way, the package manager keeps track of those jar files which could then
be included into your package.

3. shutting down all instances of OOo including the Quickstarter.

A shutdown ought not be necessary, at least not for components, Basic
scripts, type libraries etc.  UI configuration may be problematic,
because not all instances inside a running OOo process react on
configuration changes.

 The reason for this request is to create a script which would register a
 package and configure Java, in order to relief users from these
 potentially complex activities (especially w.r.t. OOo endusers).
 
 Any hints or code (any language would suffice) snippets highly appreciated.

HTH,
-Daniel

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



Re: [api-dev] Seeking code-snippets or hints for ...

2005-11-11 Thread Jürgen Schmidt

Rony G. Flatscher wrote:

Hi Daniel,

first of all: thank you *very* much for your kind and quick answer, 
which I think will help me a lot!



  2. adding a Java Classpath entry to OOo (programmatic counterpart of:
 Tools - Options - Java - Class Path),
   



A clean extension would refer to additional jar files within the
component's manifest.mf file, e.g. using ClassPath: add_my.jar.  That
way, the package manager keeps track of those jar files which could then
be included into your package.
 

Ha, that would be terrific and would ease everything considerably (also 
maintaining the plugin, if newer versions become available). Will be 
researching the packaging docs to see what else one can do with the help 
of the package manager!



  3. shutting down all instances of OOo including the Quickstarter.
   



A shutdown ought not be necessary, at least not for components, Basic
scripts, type libraries etc.  UI configuration may be problematic,
because not all instances inside a running OOo process react on
configuration changes.
 


Interesting, thank you for this insight!


calc add-ins for example needs currently a restart but this will 
hopefully change in a future version. But as Daniel already mentioned 
most of the currently deployable extensions don't need a restart.


Juergen




HTH,
 


Very much so, I am sure!

Regards,

---rony



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



Re: [api-dev] Seeking code-snippets or hints for ...

2005-11-11 Thread Carsten Driesner

Hi Rony,


A shutdown ought not be necessary, at least not for components, Basic
scripts, type libraries etc.  UI configuration may be problematic,
because not all instances inside a running OOo process react on
configuration changes.
 


A restart is not necessary for user interface changes based on add-ons, 
but all currently open document windows are not updated. If you open a 
new window, it includes all changes.


Regards,
Carsten

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



[api-dev] Info about Mail modules

2005-11-11 Thread Alexandro Colorado
I want to learn more about the mail interface for openoffice.org, I found  
some information bit is a bit narrow, where can I find more information  
like developers working on it, dependencies and how can I call them from a  
programming enviroment.


The current info is here:

http://api.openoffice.org/docs/common/ref/com/sun/star/mail/module-ix.html

--
Alexandro Colorado
CoLeader of OpenOffice.org ES
http://es.openoffice.org

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



Re: [api-dev] Add menu to XTopWindow

2005-11-11 Thread Carsten Driesner

Paolo Lacatena wrote:

Hi,
I want add a menu to a window. In Developer's Guide 2.0 I read that 
XTopWindow interface has a method setMenuBar() but this is not usable at 
this time because XMenuBar interface is deprecated. However, on IDL 
reference XMenuBar is not signed as deprecated.

Can I use it?
Yes, but support can be discontinued in one of the next major versions. 
Currently the application framework of OOo 2.0 uses these interfaces 
internally, so you can be sure that for OOo 2.0.x it's safe.



What is the alternative way to add a menu to a XTopWindow?

There is no alternative way, if you don't want to use VCL directly.

Regards,
Carsten

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



Re: [api-dev] Info about Mail modules

2005-11-11 Thread Alexandro Colorado
On Fri, 11 Nov 2005 16:44:48 -, Mathias Bauer [EMAIL PROTECTED]  
wrote:



Alexandro Colorado wrote:
I want to learn more about the mail interface for openoffice.org, I  
found

some information bit is a bit narrow, where can I find more information
like developers working on it, dependencies and how can I call them  
from a

programming enviroment.

The current info is here:

http://api.openoffice.org/docs/common/ref/com/sun/star/mail/module-ix.html


Today mail functionality in OOo is used for creating and sending a mail
using the mail related interfaces in the package com/sun/star/system and
for e-mail merging that AFAIR uses some of the interfaces in the mail
package. (You should consider that e-mail merging currently doesn't work
in OOo but is possibly deliverd by the CWS oooemailmerge that will be
integrated into the m140 milestone.)

So if no developer knowing the email merging stuff shows up here you
could ask on [EMAIL PROTECTED]

Best regards,
Mathias



Thanks mathias I will have a look on that list. Within the mail module  
there is an STMP service, does that means that OOo can send emails or by  
the abstraction it means that the stmp should be provided by an external  
application.


XSmtpService(http://api.openoffice.org/docs/common/ref/com/sun/star/mail/XSmtpService.html)	Represents  
a SMTP service abstraction.



--
Alexandro Colorado
CoLeader of OpenOffice.org ES
http://es.openoffice.org

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



Re: [api-dev] New document type information

2005-11-11 Thread Paolo Lacatena

Mathias Bauer wrote:


Paolo Lacatena wrote:
 


Hi All,

We are going to develop an open source application to design and run
business workflow and we are going to use OpenOffice.org suite as
document editor. We belive that maybe interesting to develop our
application as an extension of OOo suite; so we could create a new
document type to do this. We have a look to Developer's guide, but we
didn't find all information we need. We need to have more information
about the development of a new document type, how to add new command
in the framework layer and in the chain of responsability and how to
deploy the new application, like Writer, Calc etc , in the OOo
environment. We need more information about the system architecture
too.
   



You must develop a UNO component that implements the service
com.sun.star.document.OfficeDocument and a second UNO component that
implements the com.sun.star.frame.Controller service. Both are described
in the IDL reference and the Developers Guide.

Additionally you have to provide a window together with your controller
that either must be implemented using VCL directly or indirectly
(through our com.sun.star.awt.Toolkit). This window is used for drawing
output and user interaction. While parts of it are possible using our
Toolkit or (as I assume) our new Canvas API I'm afraid that currently it
would be too cumbersome and so you will need to use the VCL library
directly.

As an alternative you could try to do your drawing and user interaction
in an own native window and plug this into the window of your
controller, but I have only a limited experience with this, but I know
that it works because the same is done when plugins are embedded into an
OOo document, like e.g. the Acrobat Reader. Inside the native window you
can use any toolkit you like that allows you to get access to its window
handle for reparenting or that allows you to create a window as a child
of an arbitrary native window (that you again know by its window handle).

So as a start I recommend to study and understand the mentioned services
and think wether using VCL is an option or if you want to try the
native window approach. Then we can talk again. :-)

Best regards,
Mathias

 

We saw com.sun.star.document.OfficeDocument and 
com.sun.star.frame.Controller in the Developer's Guide and IDL Reference.

We haven't got problem about com.sun.star.document.OfficeDocument.
About com.sun.star.frame.Controller we have some questions:

how the user interface is built in the Frame-Controller-Model paradigm?
who create it and which interfaces are needed?

where we can find more documentation about the Dispatch Process? In 
particular, how we can add URL commands.


We want built a new application with a new document model. What do we do 
to load a new blank document with com.sun.star.frame.XComponentLoader 
Desktop Interface, i.e.


com.sun.star.lang.XComponent xComponentMyApp = xLoader.loadComponentFromURL(
   private:factory/myapp, _blank, 0, null);
Is it possible?

Thanks
Paolo

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



Re: [api-dev] macro doesn't run

2005-11-11 Thread Douglas Staas
How did you prove that the macro didn't run?
Because nothing happened. The macro is supposed to change text in the Draw file 
and display a graphic. Also, the print 'hallo' line doesn't run. The macro is 
not called. This is a case where running the same code with the same input 
results in different behavior, which should never happen. 


 Douglas Staas wrote:
  I'm still not sure if I understood you correctly.
  
  Here are the steps to recreate this situation. Let me know if something 
  isn't 
 clear. 
  
  1: open some other OO doc
  2: open my binder covers template OO doc
  3: the macro that runs on the open event (PromptForValues) brings up a 
  dialog.
  4: enter values in the dialog and click 'OK'
  5: nothing happens
  6: try rerunning PromptForValues. nothing happens after the dialog closes
  6: open the macro editor
  7: run PromptForValues again, enter values in the dialog
  8: after the dialog closes, Texts will be updated with the values you 
  entered
  9: close all OO docs
  10: open my binder covers template OO doc
  11: the macro that runs on open (PromptForValues) brings up a dialog
  12: enter values in the dialog and click 'OK'
  13: after the dialog closes, Texts will be updated with the values you 
  entered
  
  Summary: Macros don't run when a 2nd OO file is open unless the macro editor
  is open.
 
 How did you prove that the macro didn't run? Maybe it ran but just
 didn't work? Place a print hallo into the macro that should be called
 by pressing OK, save the document with the macros, do the procedure
 again and see if the macro is called in step 5.
 
 Best regards,
 Mathias
 
 -- 
 Mathias Bauer - OpenOffice.org Application Framework Project Lead
 Please reply to the list only, [EMAIL PROTECTED] is a spam sink.
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 

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



Re: [api-dev] macro doesn't run

2005-11-11 Thread Douglas Staas
Thanks to Paolo and everyone else who's offered ideas. Paolo's fix worked. 

11.3.3 appears to be very general. I don't see how it applies to this specific 
scenario. Then again, perhaps understanding the difference between an OK 
button and a Default type button would help. If so, where could I find 
documentation on that? ie: Where can I read about OK buttons causing a dialog 
to close before associated events are fired? 

Thanks, again. I'm sure I'll have more questions as I digest this and proceed. 
doug


 Hi Douglas,
 
 Alle 19:16, giovedì 10 novembre 2005, Douglas Staas ha scritto:
  My questions keep piling up. If this isn't the right place to ask them,
  where should I seek answers/useful documentation? If this is the right
  place to ask them, what do I need to do to engage in a dialog about these
  issues?
 
  * Macros don't run when a 2nd OO file is open unless the macro editor is
  open. When will this be resolved?
 
 
 I don't want to dig into details but ony let you know that IMHO your macro is 
 not well conceived and perhaps your problem is only a side effect of that.
 
 1) You have manually binded the events keyPressed and MousButton-pressed to 
 the SetAllTexts subroutine
 
 2) You have set the OK Button as Button Type = OK
 
 I think that your problem is due to the fact that the 2) causes the dialog to 
 close before the events has been raised.
 
 This is the normal behaviour and you can find a detailed explanation of that 
 in the DevGuide at:
 11.3.3Special Behavior of OpenOffice.org Basic
   Rescheduling
 
 BTW the DevGuide shows an example that covers exactly your situation.
 
 However, my suggestion is to remove the binding of events and modify your 
 PromptForValues as shown below.
 
 
 Sub PromptForValues
 DialogLibraries.LoadLibrary( SlaySysLibrary )
 oDialog = CreateUnoDialog( DialogLibraries.SlaySysLibrary.SlaysysDialog )
 If oDialog.Execute() = 1 Then
   SetAllText()
 End If
 end Sub
 
 
 hope that helps
 
 PaoloM
 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 

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



Re: [api-dev] macro doesn't run

2005-11-11 Thread Douglas Staas
Ok, so due to the rescheduling of threads, sometimes an OK button's events 
get fired as expected and sometimes the dialog is closed before those events 
get run? Does this mean that binding code to OK button events is generally a 
bad idea with Open Office? I'm just trying to understand. This subtle quirk 
appears to be unique to Open Office. Is this something that'll be addressed 
some day?

thanks
doug


 An OK button performs a default action. so, you think that it should 
 only do what you told it to, but in reality, it is ALSO doing the 
 default OK action, which you did not expect because you did not know 
 what an OK button was.
 
 Douglas Staas wrote:
 
 Thanks to Paolo and everyone else who's offered ideas. Paolo's fix worked. 
 
 11.3.3 appears to be very general. I don't see how it applies to this 
 specific 
 scenario. Then again, perhaps understanding the difference between an OK 
 button and a Default type button would help. If so, where could I find 
 documentation on that? ie: Where can I read about OK buttons causing a dialog 
 to 
 close before associated events are fired? 
 
 Thanks, again. I'm sure I'll have more questions as I digest this and 
 proceed. 
 doug
 
 
   
 
 Hi Douglas,
 
 Alle 19:16, giovedì 10 novembre 2005, Douglas Staas ha scritto:
 
 
 My questions keep piling up. If this isn't the right place to ask them,
 where should I seek answers/useful documentation? If this is the right
 place to ask them, what do I need to do to engage in a dialog about these
 issues?
 
 * Macros don't run when a 2nd OO file is open unless the macro editor is
 open. When will this be resolved?
   
 
 I don't want to dig into details but ony let you know that IMHO your macro 
 is 
 not well conceived and perhaps your problem is only a side effect of that.
 
 1) You have manually binded the events keyPressed and MousButton-pressed to 
 the SetAllTexts subroutine
 
 2) You have set the OK Button as Button Type = OK
 
 I think that your problem is due to the fact that the 2) causes the dialog 
 to 
 close before the events has been raised.
 
 This is the normal behaviour and you can find a detailed explanation of 
 that 
 in the DevGuide at:
 11.3.3Special Behavior of OpenOffice.org Basic
 Rescheduling
 
 BTW the DevGuide shows an example that covers exactly your situation.
 
 However, my suggestion is to remove the binding of events and modify your 
 PromptForValues as shown below.
 
 
 Sub PromptForValues
 DialogLibraries.LoadLibrary( SlaySysLibrary )
 oDialog = CreateUnoDialog( DialogLibraries.SlaySysLibrary.SlaysysDialog 
  )
 If oDialog.Execute() = 1 Then
 SetAllText()
 End If
 end Sub
 
 
 hope that helps
 
 PaoloM
 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
   
 
 
 -- 
 Andrew Pitonyak
 My Macro Document: http://www.pitonyak.org/AndrewMacro.sxw
 My Book: http://www.hentzenwerke.com/catalog/oome.htm
 Info:  http://www.pitonyak.org/oo.php
 See Also: http://documentation.openoffice.org/HOW_TO/index.html
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 

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



Re: [api-dev] macro doesn't run

2005-11-11 Thread Andrew Douglas Pitonyak
In my opinion, yes. If you want the default behavior, then do not 
attache anything else to it, otherwise, do it all in your own code.


Douglas Staas wrote:


Ok, so due to the rescheduling of threads, sometimes an OK button's events 
get fired as expected and sometimes the dialog is closed before those events get run? 
Does this mean that binding code to OK button events is generally a bad idea with Open 
Office? I'm just trying to understand. This subtle quirk appears to be unique to Open 
Office. Is this something that'll be addressed some day?

thanks
doug


 

An OK button performs a default action. so, you think that it should 
only do what you told it to, but in reality, it is ALSO doing the 
default OK action, which you did not expect because you did not know 
what an OK button was.


Douglas Staas wrote:

   

Thanks to Paolo and everyone else who's offered ideas. Paolo's fix worked. 

11.3.3 appears to be very general. I don't see how it applies to this specific 
 

scenario. Then again, perhaps understanding the difference between an OK 
button and a Default type button would help. If so, where could I find 
documentation on that? ie: Where can I read about OK buttons causing a dialog to 
close before associated events are fired? 
   

Thanks, again. I'm sure I'll have more questions as I digest this and proceed. 
doug





 


Hi Douglas,

Alle 19:16, giovedì 10 novembre 2005, Douglas Staas ha scritto:
  

   


My questions keep piling up. If this isn't the right place to ask them,
where should I seek answers/useful documentation? If this is the right
place to ask them, what do I need to do to engage in a dialog about these
issues?

* Macros don't run when a 2nd OO file is open unless the macro editor is
open. When will this be resolved?


 

I don't want to dig into details but ony let you know that IMHO your macro is 
not well conceived and perhaps your problem is only a side effect of that.


1) You have manually binded the events keyPressed and MousButton-pressed to 
the SetAllTexts subroutine


2) You have set the OK Button as Button Type = OK

I think that your problem is due to the fact that the 2) causes the dialog to 
close before the events has been raised.


This is the normal behaviour and you can find a detailed explanation of that 
in the DevGuide at:

11.3.3Special Behavior of OpenOffice.org Basic
Rescheduling

BTW the DevGuide shows an example that covers exactly your situation.

However, my suggestion is to remove the binding of events and modify your 
PromptForValues as shown below.



Sub PromptForValues
  DialogLibraries.LoadLibrary( SlaySysLibrary )
  oDialog = CreateUnoDialog( DialogLibraries.SlaySysLibrary.SlaysysDialog )
  If oDialog.Execute() = 1 Then
SetAllText()
  End If
end Sub


hope that helps

PaoloM




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

  

   


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



 


--
Andrew Pitonyak
My Macro Document: http://www.pitonyak.org/AndrewMacro.sxw
My Book: http://www.hentzenwerke.com/catalog/oome.htm
Info:  http://www.pitonyak.org/oo.php
See Also: http://documentation.openoffice.org/HOW_TO/index.html


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

   



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

 



--
Andrew Pitonyak
My Macro Document: http://www.pitonyak.org/AndrewMacro.odt
My Book: http://www.hentzenwerke.com/catalog/oome.htm
Info:  http://www.pitonyak.org/oo.php
See Also: http://documentation.openoffice.org/HOW_TO/index.html


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



Re: [api-dev] Info about Mail modules

2005-11-11 Thread Mathias Bauer
Alexandro Colorado wrote:
 On Fri, 11 Nov 2005 16:44:48 -, Mathias Bauer [EMAIL PROTECTED]  
 wrote:
 
 Alexandro Colorado wrote:
 I want to learn more about the mail interface for openoffice.org, I  
 found
 some information bit is a bit narrow, where can I find more information
 like developers working on it, dependencies and how can I call them  
 from a
 programming enviroment.

 The current info is here:

 http://api.openoffice.org/docs/common/ref/com/sun/star/mail/module-ix.html

 Today mail functionality in OOo is used for creating and sending a mail
 using the mail related interfaces in the package com/sun/star/system and
 for e-mail merging that AFAIR uses some of the interfaces in the mail
 package. (You should consider that e-mail merging currently doesn't work
 in OOo but is possibly deliverd by the CWS oooemailmerge that will be
 integrated into the m140 milestone.)

 So if no developer knowing the email merging stuff shows up here you
 could ask on [EMAIL PROTECTED]

 Best regards,
 Mathias

 
 Thanks mathias I will have a look on that list. Within the mail module  
 there is an STMP service, does that means that OOo can send emails or by  
 the abstraction it means that the stmp should be provided by an external  
 application.
 
 XSmtpService(http://api.openoffice.org/docs/common/ref/com/sun/star/mail/XSmtpService.html)
Represents  
 a SMTP service abstraction.

At least for the Send document as mail we don't use this API. I don't
know about the emailmerging.

Best regards,
Mathias

-- 
Mathias Bauer - OpenOffice.org Application Framework Project Lead
Please reply to the list only, [EMAIL PROTECTED] is a spam sink.

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