Re: [api-dev] Upgrading from 1.x.x to 2.x.x -- Without Re-Learning An API?

2006-01-09 Thread Mathias Bauer
Christian Junker wrote:

>> I've heard that the new API makes it
>> easier to connect to, but since the old application has been written and is
>> working I don't want to change it.  I've also heard (but am not sure) that
>> in 2.x.x, to get OOo to listen to a Java connection, I have to do something
>> other than the old edit to Setup.xcu.
> 
> Yes, the SimpleBootstrap mechanism which automates the IPC via a named pipe.
> Everything related to making the office listen for TCP/IP connections
> is documented in the Developer's Guide (first chapter, I think)
> available at api.openoffice.org .

I hope you don't mind if I mention something you might see as trivial,
but just to avoid misunderstandings: though OOo2 offers a new and much
easier way to connect to it the old mechanism from OOo1 and of course
each written code using it still works. Moreover, if you want to write a
program that connects both to OOo1 and OOo2 you will still need to use
the old mechanism you already know.

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]



Re: [api-dev] Upgrading from 1.x.x to 2.x.x -- Without Re-Learning An API?

2006-01-02 Thread Christian Junker
Hi Hal, I have some good news for you...

2005/12/31, Hal Vaughan <[EMAIL PROTECTED]>:
> I was looking for a page or summary about what has changed from OOo 1.x.x to
> 2.x.x and can't find one.

There is none, because nothing has really *changed* (backwards
compatibility). The API has been extended instead, but your full code
that worked for 1.1.x should also work for 2.0, if not then you can
directly submit an issue for it.

> If I can use my old code with OOo 2.x.x, that
> would be perfect.  Is that possible?

Yes, see above.

> I've heard that the new API makes it
> easier to connect to, but since the old application has been written and is
> working I don't want to change it.  I've also heard (but am not sure) that
> in 2.x.x, to get OOo to listen to a Java connection, I have to do something
> other than the old edit to Setup.xcu.

Yes, the SimpleBootstrap mechanism which automates the IPC via a named pipe.
Everything related to making the office listen for TCP/IP connections
is documented in the Developer's Guide (first chapter, I think)
available at api.openoffice.org .

--
Best Regards
Christian Junker

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



Re: [api-dev] Upgrading from 1.x.x to 2.x.x -- Without Re-Learning An API?

2005-12-31 Thread Hal Vaughan
On Saturday 31 December 2005 06:59 am, Rony G. Flatscher wrote:
> Hi Hal,
> ... cut ...
>
> >I have not yet installed 2.x.x on any of my systems, since I need to keep
> > them "pure" for testing.
>
> Hmm, how about getting a VM-software like VMWare to create sealed off
> virtual machines (VM) having only the software installed you need. This
> way you can have different VMs (Windows, Linux, etc.) with different
> installations (one with OOo 1.x, one wihth 2.0).

I'd love to.  Can't afford it right now.  The business is still fairly new and 
at this point, most of the income has to either pay the rent or pay off 
startup debt.  Right now I have a multi-boot system for testing and I can 
backup the partitions, but it is a major pain to have to keep backing up or 
restoring when I change one or two things for testing.

I don't want both on a system because I want to be sure I'm using the version 
I want to use and not that I have some old code I forgot or something else 
somewhere that is connecting with the wrong version.  I'm self taught in 
programming, so there may be something I've missed, but I've seen it in 
debugging before where you think you've got everything working and there's a 
subroutine somewhere that you've forgotten about that makes the conditions 
entirely different than you think they are.  At this point I'm exhausted, 
burned out, and not far from the end of all the major work.  In other words, 
I'm more prone to mistakes.  Until I'm sure I can switch to 2.x.x without 
messing things up, I don't want it on my systems where there is even the 
slightest possibility of it creating confusion for me.

> Other than that, it is possible to have 1.x *and* 2.x installed on the
> same machine and test them independently from each other. You merely
> need to set the environment before invoking your programs. Here two
> (Windows) scripts, that define the Java-based environment variables:
>
> The 1.1.5 version:
>
> -- cut here 
> @rem set-OOo-1.cmd
> @rem settings for OpenOffice.org 1.1.5
>
> set OOoBase=D:\Programme\OpenOffice.org1.1.5
> set OOoP=%OOoBase%\program
> set OOoJar=%OOoBase%\program\classes
>
> rem append to CLASSPATH
> set
> CLASSPATH=%CLASSPATH%;%OOoJar%\jurt.jar;%OOoJar%\unoil.jar;%OOoJar%\ridl.ja
>r;%OOoJar%\juh.jar
>
> rem needed for OOo < 2.0:
> set CLASSPATH=%CLASSPATH%;%OOoJar%\sandbox.jar
> -- cut here 
>
> The 2.0 version:
>
> -- cut here 
> @set-OOo-2.cmd
> @rem settings for OpenOffice.org 2.0.0
>
> set OOoBase=D:\Programme\OpenOffice.org 2.0
> set OOoP=%OOoBase%\program
> set OOoJar=%OOoBase%\program\classes
>
> rem append to CLASSPATH
> set
> CLASSPATH=%CLASSPATH%;%OOoJar%\jurt.jar;%OOoJar%\unoil.jar;%OOoJar%\ridl.ja
>r;%OOoJar%\juh.jar -- cut here 

I had considered something like that and may still use it.

> >I was looking for a page or summary about what has changed from OOo 1.x.x
> > to 2.x.x and can't find one.  If I can use my old code with OOo 2.x.x,
> > that would be perfect.  Is that possible?  I've heard that the new API
> > makes it easier to connect to, but since the old application has been
> > written and is working I don't want to change it.  I've also heard (but
> > am not sure) that in 2.x.x, to get OOo to listen to a Java connection, I
> > have to do something other than the old edit to Setup.xcu.
> >
> >So do I need to change my Java classes for 2.x.x?  What do I do instead of
> >adding the setting info to listen to port 8100 to Setup.xcu?  Is there a
> >"Changes from 1.x.x to 2.x.x" document somewhere so I don't have to
> >re-learn the API to figure out what has changed?
>
> AFAIK 1.1 programs should work with 2.0 as well.
>
> What is possible (already with 1.5 BTW!) is to use
> "com.sun.star.comp.helper.Bootstrap.bootstrap()", e.g.:
>
> XComponentContext context=Bootstrap.bootstrap();
> say("context v2:\t"+pp(context));
>
> XMultiComponentFactory xmcf=context.getServiceManager();

The code I'm using for 1.1.1 is this:
try {
XMultiServiceFactory xLocalServiceManager =

com.sun.star.comp.helper.Bootstrap.createSimpleServiceManager();
XUnoUrlResolver xURLResolver = 
(XUnoUrlResolver)UnoRuntime.queryInterface(
XUnoUrlResolver.class, 
xLocalServiceManager.createInstance(
"com.sun.star.bridge.UnoUrlResolver"));
oSmgr = (XMultiServiceFactory)UnoRuntime.queryInterface(
XMultiServiceFactory.class, 
xURLResolver.resolve(sConnect));
oLoader = (XComponentLoader)UnoRuntime.queryInterface(
XComponentLoader.class, 
oSmgr.createInstance("com.sun.star.frame.Desktop"));
}

(sConnect = 
"uno:socket,host=localhost,port=;urp;StarOffice.ServiceManager" and 
 is usually replaced with 8100 but could be changed easily)

So it looks like even in the earlier versions there is some kind of bootstrap.  
I re

Re: [api-dev] Upgrading from 1.x.x to 2.x.x -- Without Re-Learning An API?

2005-12-31 Thread Rony G. Flatscher




Hi Hal,
... cut ...

  I have not yet installed 2.x.x on any of my systems, since I need to keep them "pure" for testing.
  

Hmm, how about getting a VM-software like VMWare to create sealed off
virtual machines (VM) having only the software installed you need. This
way you can have different VMs (Windows, Linux, etc.) with different
installations (one with OOo 1.x, one wihth 2.0). 

Other than that, it is possible to have 1.x *and* 2.x installed on the
same machine and test them independently from each other. You merely
need to set the environment before invoking your programs. Here two
(Windows) scripts, that define the Java-based environment variables:

The 1.1.5 version:
-- cut here 
@rem set-OOo-1.cmd
@rem settings for OpenOffice.org 1.1.5

set OOoBase=D:\Programme\OpenOffice.org1.1.5
set OOoP=%OOoBase%\program
set OOoJar=%OOoBase%\program\classes

rem append to CLASSPATH
set CLASSPATH=%CLASSPATH%;%OOoJar%\jurt.jar;%OOoJar%\unoil.jar;%OOoJar%\ridl.jar;%OOoJar%\juh.jar

rem needed for OOo < 2.0:
set CLASSPATH=%CLASSPATH%;%OOoJar%\sandbox.jar
-- cut here 

The 2.0 version:

-- cut here 
@set-OOo-2.cmd
@rem settings for OpenOffice.org 2.0.0

set OOoBase=D:\Programme\OpenOffice.org 2.0
set OOoP=%OOoBase%\program
set OOoJar=%OOoBase%\program\classes

rem append to CLASSPATH
set CLASSPATH=%CLASSPATH%;%OOoJar%\jurt.jar;%OOoJar%\unoil.jar;%OOoJar%\ridl.jar;%OOoJar%\juh.jar
-- cut here 

  I was looking for a page or summary about what has changed from OOo 1.x.x to
2.x.x and can't find one.  If I can use my old code with OOo 2.x.x, that
would be perfect.  Is that possible?  I've heard that the new API makes it
easier to connect to, but since the old application has been written and is
working I don't want to change it.  I've also heard (but am not sure) that
in 2.x.x, to get OOo to listen to a Java connection, I have to do something
other than the old edit to Setup.xcu.

So do I need to change my Java classes for 2.x.x?  What do I do instead of
adding the setting info to listen to port 8100 to Setup.xcu?  Is there a
"Changes from 1.x.x to 2.x.x" document somewhere so I don't have to
re-learn the API to figure out what has changed?
  

AFAIK 1.1 programs should work with 2.0 as well.

What is possible (already with 1.5 BTW!) is to use
"com.sun.star.comp.helper.Bootstrap.bootstrap()", e.g.:

  XComponentContext context=Bootstrap.bootstrap();
say("context v2:\t"+pp(context));

XMultiComponentFactory xmcf=context.getServiceManager();
  


  
My clients are all small business professionals, so I'm using my services as
a chance to lobby for OOo and FOSS in general.  While my app will work fine
if I continue to use 1.1.1, there are times my clients use OOo to edit the
documents my system uses.  I'd really rather have them use 2.x.x and be
exposed to that, but not if it means it takes me a lot of time to upgrade
my software.
  

Well, you and your clients should be set to move on to 2.0, AFAICT.

---rony

P.S.: If you use the XUnoUrlResolver, you could still install and test
both versions of OOo (1.1.x, 2.x) and still connect to either by merely
defining distinct ports for each version, e.g. 8100 for 1.1.x and 8200
for 2.x.





[api-dev] Upgrading from 1.x.x to 2.x.x -- Without Re-Learning An API?

2005-12-30 Thread Hal Vaughan
I'm sure this has been hashed out before.  I've been looking through the API
site and can't find the kind of document I'm looking for, so I'm hoping for
a good pointer or two here to help me find what I need.

I was rather active on the API mailing list a few years ago, while
developing an application that used OOo.  Since then I have been working
constantly on other parts of the application and simply did not have the
time to keep up with what was going on with OOo and the changes going on. 
At the time learning the Macro language was very difficult and I learned
Java just so I could use it with the API to control OOo.  At that time I
found the reference and the API very difficult to work with and it took me
a lot of time just to write a wrapper class so I could call with higher
level functions and have the wrapper handle all the low level API work.

I would like to upgrade my application to use OOo 2.x.x now.  This
application (basically a specialized mail merge that works on the clients'
computers with data I generate for it) runs on Windows and Linux and has
had no problems in over 1 1/2 years, so other than upgrading to use Java
1.5 and a higher version of OOo, I want to change as little as possible (it
ain't broke, so I ain't fixin' it!).  I also, to be frank, do NOT have time
to learn a new API.

I have not yet installed 2.x.x on any of my systems, since I need to keep
them "pure" for testing.

I was looking for a page or summary about what has changed from OOo 1.x.x to
2.x.x and can't find one.  If I can use my old code with OOo 2.x.x, that
would be perfect.  Is that possible?  I've heard that the new API makes it
easier to connect to, but since the old application has been written and is
working I don't want to change it.  I've also heard (but am not sure) that
in 2.x.x, to get OOo to listen to a Java connection, I have to do something
other than the old edit to Setup.xcu.

So do I need to change my Java classes for 2.x.x?  What do I do instead of
adding the setting info to listen to port 8100 to Setup.xcu?  Is there a
"Changes from 1.x.x to 2.x.x" document somewhere so I don't have to
re-learn the API to figure out what has changed?

My clients are all small business professionals, so I'm using my services as
a chance to lobby for OOo and FOSS in general.  While my app will work fine
if I continue to use 1.1.1, there are times my clients use OOo to edit the
documents my system uses.  I'd really rather have them use 2.x.x and be
exposed to that, but not if it means it takes me a lot of time to upgrade
my software.

Thanks for any help and information on this!

Hal

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