[Solved] Re: [libreoffice-users] java macro and multiple class methods

2013-06-13 Thread Tom Davies
Hi :)
Congrats.  No need to apologise fro the noise/traffic!  Congrats on solving the 
puzzle :)
Congrats and regards from 

Tom :)  






>
> From: Vieri 
>To: users@global.libreoffice.org 
>Sent: Thursday, 13 June 2013, 7:27
>Subject: Re: [libreoffice-users] java macro and multiple class methods
> 
>
>Never mind... Right after posting this e-mail it started to work correctly. I 
>don't know what I was doing wrong before.
>
>Sorry for the noise.
>
>Vieri
>
>
>--- On Thu, 6/13/13, Vieri  wrote:
>
>> Hi,
>> 
>> I have a java macro and a parcel-descriptor.xml with just
>> one method declared:
>> 
>> 
>> 
>>     
>>         <locale lang="en">
>>             <displayname
>> value="CO.Java"/>
>>            
>> <description>
>>                 CO
>> macro.
>>            
>> </description>
>>         </locale>
>>         <functionname
>> value="CO.CO_submit"/>
>>         <logicalname
>> value="CO.CO_submit"/>
>>         <languagedepprops>
>>             <prop
>> name="classpath" value="COLO.jar"/>
>>         </languagedepprops>
>>     
>> 
>> 
>> Suppose I have another class method (CO_test) I'd like to
>> call from LO. I'd like to add CO.CO_test just like I
>> declared CO.CO_submit.
>> How can I do this?
>> 
>> If I try the following:
>> 
>> 
>> 
>>     
>>         <locale lang="en">
>>             <displayname
>> value="CO.Java"/>
>>            
>> <description>
>>                 CO
>> macro.
>>            
>> </description>
>>         </locale>
>>         <functionname
>> value="CO.CO_submit"/>
>>         <logicalname
>> value="CO.CO_submit"/>
>>         <languagedepprops>
>>             <prop
>> name="classpath" value="COLO.jar"/>
>>         </languagedepprops>
>>     
>>     
>>         <locale lang="en">
>>             <displayname
>> value="COtest.Java"/>
>>            
>> <description>
>>                 CO
>> test macro.
>>            
>> </description>
>>         </locale>
>>         <functionname
>> value="CO.CO_test"/>
>>         <logicalname
>> value="CO.CO_test"/>
>>         <languagedepprops>
>>             <prop
>> name="classpath" value="COLO.jar"/>
>>         </languagedepprops>
>>     
>> 
>> 
>> then I can see both methods in LO. So I can select any of
>> the two and run them. However, no matter which one of the
>> two I try to run, only the CO.CO_submit method will be run.
>> 
>> What am I doing wrong?
>> 
>> I haven't found a single example on the internet or in the
>> docs where a parcel-descriptor defines more than one method
>> to call.
>> 
>> Surely I could duplicate the jar and parcel-descriptor files
>> and define one method in each of them but that seems too
>> inefficient.
>> 
>> Thanks,
>> 
>> Vieri
>> 
>> 
>> -- 
>> To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
>> Problems? 
>> http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
>> Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
>> List archive: http://listarchives.libreoffice.org/global/users/
>> All messages sent to this list will be publicly archived and
>> cannot be deleted
>> 
>> 
>
>-- 
>To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
>Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
>Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
>List archive: http://listarchives.libreoffice.org/global/users/
>All messages sent to this list will be publicly archived and cannot be deleted
>
>
>
-- 
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted



Re: [libreoffice-users] java macro and multiple class methods

2013-06-12 Thread Vieri
Never mind... Right after posting this e-mail it started to work correctly. I 
don't know what I was doing wrong before.

Sorry for the noise.

Vieri


--- On Thu, 6/13/13, Vieri  wrote:

> Hi,
> 
> I have a java macro and a parcel-descriptor.xml with just
> one method declared:
> 
> 
> 
>     
>         
>              value="CO.Java"/>
>            
> 
>                 CO
> macro.
>            
> 
>         
>          value="CO.CO_submit"/>
>          value="CO.CO_submit"/>
>         
>              name="classpath" value="COLO.jar"/>
>         
>     
> 
> 
> Suppose I have another class method (CO_test) I'd like to
> call from LO. I'd like to add CO.CO_test just like I
> declared CO.CO_submit.
> How can I do this?
> 
> If I try the following:
> 
> 
> 
>     
>         
>              value="CO.Java"/>
>            
> 
>                 CO
> macro.
>            
> 
>         
>          value="CO.CO_submit"/>
>          value="CO.CO_submit"/>
>         
>              name="classpath" value="COLO.jar"/>
>         
>     
>     
>         
>              value="COtest.Java"/>
>            
> 
>                 CO
> test macro.
>            
> 
>         
>          value="CO.CO_test"/>
>          value="CO.CO_test"/>
>         
>              name="classpath" value="COLO.jar"/>
>         
>     
> 
> 
> then I can see both methods in LO. So I can select any of
> the two and run them. However, no matter which one of the
> two I try to run, only the CO.CO_submit method will be run.
> 
> What am I doing wrong?
> 
> I haven't found a single example on the internet or in the
> docs where a parcel-descriptor defines more than one method
> to call.
> 
> Surely I could duplicate the jar and parcel-descriptor files
> and define one method in each of them but that seems too
> inefficient.
> 
> Thanks,
> 
> Vieri
> 
> 
> -- 
> To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
> Problems? 
> http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
> Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
> List archive: http://listarchives.libreoffice.org/global/users/
> All messages sent to this list will be publicly archived and
> cannot be deleted
> 
> 

-- 
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted



Re: [libreoffice-users] java macro

2013-05-09 Thread Vieri


--- On Thu, 5/9/13, Regina Henschel  wrote:

> Hi Vieri,
> 
> Vieri schrieb:
> 
> 
> > I didn't need to use BeanShell. I edited the parcel
> descriptor xml
> > file directly.
> > 
> > I finally found out why I wasn't seeing the macro (or
> at least I
> > think so). I needed to create my class within "default
> package" (I'm
> > using NetBeans IDE).
> > 
> > I'm able to launch my Java macros now.
> 
> you earlier mentioned "I followed a guide to run Java macros
> in LO". Where is that guide?
> 
> I only found the very old guides
> http://www.openoffice.org/framework/scripting/scriptingf1/developer-guide.html
> http://www.openoffice.org/framework/scripting/scriptingf1/netbeans-devguide.html
> Are they still valid from your point of experience? What
> should be changed/added?

Hi Regina,

I followed those guides too but the sentence "The OpenOffice.org Scripting 
module has been tested with NetBeans 3.4." got me thinking that it may not be 
wise to use something that's "apparently" not updated (I have netbeans 7.3). 
I'm not saying it's outdated so I may give it a try tomorrow.

Anyway, I then found another guide and I believe it explains the netbeans part 
a little more deeply and doesn't really require a module (the only thing I have 
to do manually is prepare the xml descriptor and copy the jar files to the LO 
script dir):
http://wiki.openoffice.org/wiki/Scripting_in_Java_with_NetBeans_IDE
The part that I was doing wrong was related to point "10" in that guide. I 
wasn't placing my classes within "default package".

Surely I read other articles here and there but with these two it should be 
enough.

Vieri


-- 
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted



Re: [libreoffice-users] java macro

2013-05-09 Thread Regina Henschel

Hi Vieri,

Vieri schrieb:



I didn't need to use BeanShell. I edited the parcel descriptor xml
file directly.

I finally found out why I wasn't seeing the macro (or at least I
think so). I needed to create my class within "default package" (I'm
using NetBeans IDE).

I'm able to launch my Java macros now.


you earlier mentioned "I followed a guide to run Java macros in LO". 
Where is that guide?


I only found the very old guides
http://www.openoffice.org/framework/scripting/scriptingf1/developer-guide.html
http://www.openoffice.org/framework/scripting/scriptingf1/netbeans-devguide.html
Are they still valid from your point of experience? What should be 
changed/added?


Kind regards
Regina

--
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted


Re: [libreoffice-users] java macro

2013-05-09 Thread Vieri


--- On Thu, 5/9/13, Regina Henschel  wrote:

> Hi Vieri,
> 
> Vieri schrieb:
> > Hi,
> >
> > I'm new to making Java macros. I compiled my Java
> class, created the
> > parcel-descriptor.xml file and
> placed the .xml, .jar and .class files within the following
> folders I
> also created:
> >
> >
> C:\Users\\AppData\Roaming\LibreOffice\4\user\Scripts\java\MACRO1
> >
> >
> >
> C:\Program Files\LibreOffice 4.0\share\Scripts\java\MACRO1
> >
> > When I re-launch LO and go to Macros-> Run Macros, I
> don't see my
> MACRO1 java macro under "My Macros" or "LibreOffice
> Macros".
> >
> > Why is that? Shouldn't I at least see the listing?
> 
> Do you have used Tools > Macros > Organize Macros >
> BeanShell... to add it?

Thanks Regina.
I didn't need to use BeanShell.
I edited the parcel descriptor xml file directly.

I finally found out why I wasn't seeing the macro (or at least I think so). I 
needed to create my class within "default package" (I'm using NetBeans IDE).

I'm able to launch my Java macros now.
Thanks,

Vieri


-- 
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted



Re: [libreoffice-users] java macro

2013-05-09 Thread Tom Davies
Hi :)
Regina know a lot more about all this so hopefully her answer will fix it.  


There are a couple of places to get written documentation but probably not as 
many as we would like.  This list is often quite a good place to get single 
issue answers but for a broader perspective Chapter 13 of the "Getting Started 
Guide" might help a bit.  I think Andrew Pitonyak wrote it and it's free
https://wiki.documentfoundation.org/Documentation/Publications#Getting_Started_with_LibreOffice
 but the best place "manual" is Andrew Pitonyaks' book at the bottom of the 3rd 
party section for programmers
https://wiki.documentfoundation.org/Documentation/Other_Documentation_and_Resources#Programmers


Good luck with this!
Regards from 

Tom :)  





>
> From: Regina Henschel 
>To: users@global.libreoffice.org 
>Sent: Thursday, 9 May 2013, 12:38
>Subject: Re: [libreoffice-users] java macro
> 
>
>Hi Vieri,
>
>Vieri schrieb:
>> Hi,
>>
>> I'm new to making Java macros. I compiled my Java class, created the
>> parcel-descriptor.xml file and
>placed the .xml, .jar and .class files within the following folders I
>also created:
>>
>> C:\Users\\AppData\Roaming\LibreOffice\4\user\Scripts\java\MACRO1
>>
>>
>>
>C:\Program Files\LibreOffice 4.0\share\Scripts\java\MACRO1
>>
>> When I re-launch LO and go to Macros-> Run Macros, I don't see my
>MACRO1 java macro under "My Macros" or "LibreOffice Macros".
>>
>> Why is that? Shouldn't I at least see the listing?
>
>Do you have used Tools > Macros > Organize Macros > BeanShell... to add it?
>
>Kind regards
>Regina
>
>
-- 
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted



Re: [libreoffice-users] java macro

2013-05-09 Thread Regina Henschel

Hi Vieri,

Vieri schrieb:

Hi,

I'm new to making Java macros. I compiled my Java class, created the
parcel-descriptor.xml file and

placed the .xml, .jar and .class files within the following folders I
also created:


C:\Users\\AppData\Roaming\LibreOffice\4\user\Scripts\java\MACRO1




C:\Program Files\LibreOffice 4.0\share\Scripts\java\MACRO1


When I re-launch LO and go to Macros-> Run Macros, I don't see my

MACRO1 java macro under "My Macros" or "LibreOffice Macros".


Why is that? Shouldn't I at least see the listing?


Do you have used Tools > Macros > Organize Macros > BeanShell... to add it?

Kind regards
Regina


--
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted


Re: [libreoffice-users] java macro

2013-05-09 Thread Vieri
Hi Tom,

I just need to get the job done.
Right now, I can use whatever language, just as long as it's supported within 
LO. The problem with LO and OOo is that it "apparently" supports X programming 
language (such as Java) but there's barely enough documentation on how to "bind 
it" to the application. For instance, I followed a guide to run Java macros in 
LO but they simply don't show up in LO/"run macros". That's beyond the scope of 
programming per-se. It's more of how LO deals with macros.
Anyway, maybe I'll have better luck with Python (as far as its "integration" 
with LO is concerned).

Thanks,

Vieri

--- On Thu, 5/9/13, Tom Davies  wrote:

> Hi :)
> Errr, now that you have learned about programming in a
> general way and looking to consolidate details would it be a
> good time to learn something more solid?  C++ or Python
> perhaps?  
> 
> Oracle seem to be having a lot of trouble writing code that
> doesn't get compromised really fast.  So, many people are
> getting rid of Java and moving away from it as fast as
> possible.  Even the US Homeland Security apparently sent a
> notice to tell people to avoid Java and uninstall it asap. 
> Of course a lot of large companies are a bit stuck and there
> are still a lot of adverts for programmers that know java. 
> 
> 
> In my country jobs for Java programmers start at 20k but for
> C++ programmers start at 30k
> Regards from 
> Tom :)  
> 
> 
> 
> 
> 
> 
> >
> > From: Vieri 
> >To: users@global.libreoffice.org
> 
> >Sent: Thursday, 9 May 2013, 9:12
> >Subject: [libreoffice-users] java macro
> > 
> >
> >Hi,
> >
> >I'm new to making Java macros.
> >I compiled my Java class, created the
> parcel-descriptor.xml file and placed the .xml, .jar and
> .class files within the following folders I also created:
> >
> >C:\Users\\AppData\Roaming\LibreOffice\4\user\Scripts\java\MACRO1
> >
> >C:\Program Files\LibreOffice
> 4.0\share\Scripts\java\MACRO1
> >
> >When I re-launch LO and go to Macros-> Run Macros, I
> don't see my MACRO1 java macro under "My Macros" or
> "LibreOffice Macros".
> >
> >Why is that? Shouldn't I at least see the listing?
> >
> >Java JRE 7 seems to work because if I select the
> LibreOffice java HelloWorld example, it prints a message in
> my document.
> >
> >Thanks,
> >
> >Vieri
> >
> >
> >-- 
> >To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
> >Problems? 
> >http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
> >Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
> >List archive: http://listarchives.libreoffice.org/global/users/
> >All messages sent to this list will be publicly archived
> and cannot be deleted
> >
> >
> >
> >
> -- 
> To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
> Problems? 
> http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
> Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
> List archive: http://listarchives.libreoffice.org/global/users/
> All messages sent to this list will be publicly archived and
> cannot be deleted
> 
> 

-- 
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted



Re: [libreoffice-users] java macro

2013-05-09 Thread William Drago

Tom & Vieri,

Let's not get the Java browser plugin and the Java 
programming language confused...


Java is an excellent programming language and in no way can 
be considered any less solid than C++. In fact, in many ways 
it is more secure and more reliable than code written in C++.


What people are uninstalling/disabling (even me) is the Java 
browser plugin, not the JRE/JDK. The plugin has indeed had 
many security issues, and with Flash and HTML5 very few 
people are using Java applets in their websites anymore.


So... Java plugin = bad. Java programming language = excellent.

Now that that's settled, C++ is a language that every 
programmer should at least be familiar with. Whatever 
language you choose as a primary programming language is 
determined by a variety of factors, but as a general rule 
you'll be more productive in Java than C++.


Python is also an excellent programming language, but I have 
too little experience with it to comment any further than that.


-Bill

On 5/9/2013 5:25 AM, Tom Davies wrote:

Hi :)
Errr, now that you have learned about programming in a general way and looking 
to consolidate details would it be a good time to learn something more solid?  
C++ or Python perhaps?

Oracle seem to be having a lot of trouble writing code that doesn't get 
compromised really fast.  So, many people are getting rid of Java and moving 
away from it as fast as possible.  Even the US Homeland Security apparently 
sent a notice to tell people to avoid Java and uninstall it asap.  Of course a 
lot of large companies are a bit stuck and there are still a lot of adverts for 
programmers that know java.

In my country jobs for Java programmers start at 20k but for C++ programmers 
start at 30k
Regards from
Tom :)








From: Vieri 
To: users@global.libreoffice.org
Sent: Thursday, 9 May 2013, 9:12
Subject: [libreoffice-users] java macro


Hi,

I'm new to making Java macros.
I compiled my Java class, created the parcel-descriptor.xml file and placed the 
.xml, .jar and .class files within the following folders I also created:

C:\Users\\AppData\Roaming\LibreOffice\4\user\Scripts\java\MACRO1

C:\Program Files\LibreOffice 4.0\share\Scripts\java\MACRO1

When I re-launch LO and go to Macros-> Run Macros, I don't see my MACRO1 java macro under "My 
Macros" or "LibreOffice Macros".

Why is that? Shouldn't I at least see the listing?

Java JRE 7 seems to work because if I select the LibreOffice java HelloWorld 
example, it prints a message in my document.

Thanks,

Vieri


--
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted







--
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted



Re: [libreoffice-users] java macro

2013-05-09 Thread Tom Davies
Hi :)
Errr, now that you have learned about programming in a general way and looking 
to consolidate details would it be a good time to learn something more solid?  
C++ or Python perhaps?  

Oracle seem to be having a lot of trouble writing code that doesn't get 
compromised really fast.  So, many people are getting rid of Java and moving 
away from it as fast as possible.  Even the US Homeland Security apparently 
sent a notice to tell people to avoid Java and uninstall it asap.  Of course a 
lot of large companies are a bit stuck and there are still a lot of adverts for 
programmers that know java.  

In my country jobs for Java programmers start at 20k but for C++ programmers 
start at 30k
Regards from 
Tom :)  






>
> From: Vieri 
>To: users@global.libreoffice.org 
>Sent: Thursday, 9 May 2013, 9:12
>Subject: [libreoffice-users] java macro
> 
>
>Hi,
>
>I'm new to making Java macros.
>I compiled my Java class, created the parcel-descriptor.xml file and placed 
>the .xml, .jar and .class files within the following folders I also created:
>
>C:\Users\\AppData\Roaming\LibreOffice\4\user\Scripts\java\MACRO1
>
>C:\Program Files\LibreOffice 4.0\share\Scripts\java\MACRO1
>
>When I re-launch LO and go to Macros-> Run Macros, I don't see my MACRO1 java 
>macro under "My Macros" or "LibreOffice Macros".
>
>Why is that? Shouldn't I at least see the listing?
>
>Java JRE 7 seems to work because if I select the LibreOffice java HelloWorld 
>example, it prints a message in my document.
>
>Thanks,
>
>Vieri
>
>
>-- 
>To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
>Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
>Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
>List archive: http://listarchives.libreoffice.org/global/users/
>All messages sent to this list will be publicly archived and cannot be deleted
>
>
>
>
-- 
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted