You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openoffice.apache.org by Larry Evans <cp...@suddenlink.net> on 2013/03/02 22:46:42 UTC

calc BeanShell script save gives "error saving script" window.

The script is attached.

The OpenOffice version is(from the about button):

OpenOffice.org 3.2.0
OOO320m12 (Build:9483)

The OS is:

Linux evansl-desktop 2.6.32-41-generic #90-Ubuntu SMP Tue May 22
11:29:51 UTC 2012 x86_64 GNU/Linux

The steps:

  1) Open simple_script1.ods
  2) Tools>Macros>Organize Macros>BeanShell>Standard>NumberFive.bsh
  3) Enter the attached into the Edit window
  4) Press Save button at bottom of Edit window.

There then appears an Error window with:

      Error saving script:
      com.sun.star.ucb.iInteractiveAugmentedIOException: Got no data
      stream!

What should I do to Save this script.  Also, eventually, I'll want to
use this script in a formula.  I'd like guidance on how to do that.

TIA.

-regards,
Larry

Re: calc BeanShell script save gives "error saving script" window.

Posted by Larry Evans <cp...@suddenlink.net>.
On 03/03/13 08:57, Larry Evans wrote:
[snip]
> and then loaded the attached .ods file
OOPS.  Forgot the .ods file.  It's attached here:



Re: unexpected location for user/Scripts (was Re: calc BeanShell script save gives "error saving script" window.

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

On Tue, Mar 05, 2013 at 11:14:56AM -0600, Larry Evans wrote:
> > I went through most of the steps in the tutorial, and now I'm at the
> > place with:
> >
> >   in Linux
> >         /home/user_name/.openoffice.org/3/user/Scripts/java/HelloWorld
> >        
> > I happen to have other scripts in:
> >
> >         /home/user_name/.openoffice.org/3/user/Scripts
> >        
> > In particular, I have:
> >
> >   /home/evansl/.openoffice.org/3/user/Scripts/beanshell/LibraryTest:
> >   total used in directory 32 available 54238344
> >   drwxr-xr-x 3 evansl evansl 4096 Jun 11  2012 .
> >   drwxr-xr-x 3 evansl evansl 4096 Jun 11  2012 ..
> >   -rw-r--r-- 1 evansl evansl 1998 Jun 11  2012 MemUsage.bsh
> >   -rw-r--r-- 1 evansl evansl  688 Jun 11  2012 parcel-descriptor.xml
> >        
> > With this, I would have expected to be able to run the MemUsage.bsh
> > script; however, when I tried, no LibraryTest was shown.
> >
> > Then, I looked in the download directory and found:
> >
> >  
> > /home/evansl/download/OpenOffice/r1372282/Apache_OpenOffice_incubating_3.4.1_Linux_x86-64_install-arc_en-US/openoffice.org3/.openoffice.org/3/user/Scripts
> >  
> > Then, I copied the beanshell scripts from my:
> >   ~/.openoffice.org/3/user/Scripts
> > to the one in the download directory, and now MemUsage.bsh is
> > available for execution in a document.
> >
> > Is this the expected behaviour?  IOW, are the */user/Scripts expected
> > to be stored in the "application" directory:
> >
> >  
> > /home/evansl/download/OpenOffice/r1372282/Apache_OpenOffice_incubating_3.4.1_Linux_x86-64_install-arc_en-US/


The explanation on this tutorial should use a placeholder:

<UserInstallationDir>/Scripts/beanshell|java|python


If you are using a standard OpenOffice installed in /opt/
<UserInstallationDir> is $HOME/.openoffice.org/<version>/user/

The self contained installation you downloaded to test, has the user
installation directory inside itself, as you already noticed.


Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina

Re: calc BeanShell script save gives "error saving script" window.

Posted by Larry Evans <cp...@suddenlink.net>.
On 03/04/13 13:05, Larry Evans wrote:
> On 03/04/13 12:33, Ariel Constenla-Haile wrote:
>> On Mon, Mar 04, 2013 at 09:15:30AM -0600, Larry Evans wrote:
>>> And after enabling macros, got window entitled "OpenOffice.org error"
>>> with body
>>> contains yellow triangle with ! in middle and text:
>>>
>>>   A Scripting Framework error occurred while running the BeanShell
>>>   script Library1.Macro1.bsh
>>>
>>>   Message: The scripting language BeanShell is not supported.
>>>
>>> What should I do now?
>>>
>>> Again, thanks for the help, Ariel.
>> My mistake, I took the jars from the build I work with (to be 4.0), not
>> 3.4.1. These are the proper JARs from 3.4.1: 
>>
>> http://people.apache.org/~arielch/api/class_3.4.1.tar.gz
>>
>>
>> Regards
> Thanks Ariel.  I downloaded
>
> class_3.4.1.tar.gz
>
> unzipped and untarred and then copied all the jars to the classes directory
> which now shows:
>
> /home/evansl/download/OpenOffice/r1372282/Apache_OpenOffice_incubating_3.4.1_Linux_x86-64_install-arc_en-US/openoffice.org/basis3.4/program/classes:
>   total used in directory 10132 available 54240108
> C -rw-r--r--  1 evansl evansl  371657 Mar  4 12:08 bsh.jar
> C -rw-r--r--  1 evansl evansl   16258 Mar  4 12:03 ScriptProviderForJavaScript.jar
> C -rw-r--r--  1 evansl evansl   11684 Mar  4 12:03 ScriptProviderForJava.jar
> C -rw-r--r--  1 evansl evansl   22500 Mar  4 12:03 ScriptProviderForBeanShell.jar
> C -rw-r--r--  1 evansl evansl   94774 Mar  4 12:03 ScriptFramework.jar
>
> I then started scalc, as before:
>
> ~/download/OpenOffice/r1372282/Apache_OpenOffice_incubating_3.4.1_Linux_x86-64_install-arc_en-US/openoffice.org3/program $ ./scalc BeanShell.ods &
> [sh<1>] 6945
> ~/download/OpenOffice/r1372282/Apache_OpenOffice_incubating_3.4.1_Linux_x86-64_install-arc_en-US/openoffice.org3/program $
>
> I enabled the macros; however, I'm still getting the same error message that I mentioned in my previous post :(
>
> Should I maybe set the class path to:
>
> home/evansl/download/OpenOffice/r1372282/Apache_OpenOffice_incubating_3.4.1_Linux_x86-64_install-arc_en-US/openoffice.org/basis3.4/program/classes
>
> somewhere?
>
> TIA.
>
>
OOPS.  I killed the QuickStart and then did the same command line
invocation, and now the error message
doesn't appear.

That's kinda unintuitive :(

Anyway,  I can now run the macro without problem.

Thanks for the help, Ariel.

-regards,
Larry


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@openoffice.apache.org
For additional commands, e-mail: users-help@openoffice.apache.org


Re: calc BeanShell script save gives "error saving script" window.

Posted by Larry Evans <cp...@suddenlink.net>.
On 03/04/13 12:33, Ariel Constenla-Haile wrote:
> On Mon, Mar 04, 2013 at 09:15:30AM -0600, Larry Evans wrote:
>> And after enabling macros, got window entitled "OpenOffice.org error"
>> with body
>> contains yellow triangle with ! in middle and text:
>>
>>   A Scripting Framework error occurred while running the BeanShell
>>   script Library1.Macro1.bsh
>>
>>   Message: The scripting language BeanShell is not supported.
>>
>> What should I do now?
>>
>> Again, thanks for the help, Ariel.
> My mistake, I took the jars from the build I work with (to be 4.0), not
> 3.4.1. These are the proper JARs from 3.4.1: 
>
> http://people.apache.org/~arielch/api/class_3.4.1.tar.gz
>
>
> Regards
Thanks Ariel.  I downloaded

class_3.4.1.tar.gz

unzipped and untarred and then copied all the jars to the classes directory
which now shows:

/home/evansl/download/OpenOffice/r1372282/Apache_OpenOffice_incubating_3.4.1_Linux_x86-64_install-arc_en-US/openoffice.org/basis3.4/program/classes:
  total used in directory 10132 available 54240108
C -rw-r--r--  1 evansl evansl  371657 Mar  4 12:08 bsh.jar
C -rw-r--r--  1 evansl evansl   16258 Mar  4 12:03 ScriptProviderForJavaScript.jar
C -rw-r--r--  1 evansl evansl   11684 Mar  4 12:03 ScriptProviderForJava.jar
C -rw-r--r--  1 evansl evansl   22500 Mar  4 12:03 ScriptProviderForBeanShell.jar
C -rw-r--r--  1 evansl evansl   94774 Mar  4 12:03 ScriptFramework.jar

I then started scalc, as before:

~/download/OpenOffice/r1372282/Apache_OpenOffice_incubating_3.4.1_Linux_x86-64_install-arc_en-US/openoffice.org3/program $ ./scalc BeanShell.ods &
[sh<1>] 6945
~/download/OpenOffice/r1372282/Apache_OpenOffice_incubating_3.4.1_Linux_x86-64_install-arc_en-US/openoffice.org3/program $

I enabled the macros; however, I'm still getting the same error message that I mentioned in my previous post :(

Should I maybe set the class path to:

home/evansl/download/OpenOffice/r1372282/Apache_OpenOffice_incubating_3.4.1_Linux_x86-64_install-arc_en-US/openoffice.org/basis3.4/program/classes

somewhere?

TIA.

-regards,
Larry



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@openoffice.apache.org
For additional commands, e-mail: users-help@openoffice.apache.org


Re: calc BeanShell script save gives "error saving script" window.

Posted by Ariel Constenla-Haile <ar...@apache.org>.
On Mon, Mar 04, 2013 at 09:15:30AM -0600, Larry Evans wrote:
> And after enabling macros, got window entitled "OpenOffice.org error"
> with body
> contains yellow triangle with ! in middle and text:
> 
>   A Scripting Framework error occurred while running the BeanShell
>   script Library1.Macro1.bsh
> 
>   Message: The scripting language BeanShell is not supported.
> 
> What should I do now?
> 
> Again, thanks for the help, Ariel.

My mistake, I took the jars from the build I work with (to be 4.0), not
3.4.1. These are the proper JARs from 3.4.1: 

http://people.apache.org/~arielch/api/class_3.4.1.tar.gz


Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina

Re: calc BeanShell script save gives "error saving script" window.

Posted by Larry Evans <cp...@suddenlink.net>.
On 03/04/13 08:31, Ariel Constenla-Haile wrote:
> On Mon, Mar 04, 2013 at 07:59:57AM -0600, Larry Evans wrote:
>> On 03/03/13 17:50, Ariel Constenla-Haile wrote:
>>> Hi,
>>>
>>> On Sun, Mar 03, 2013 at 12:09:25PM -0600, Larry Evans wrote:
>>>> // Debug: Invoking method (after massaging values): public static
>>>> java.lang.Object
>>>> com.sun.star.uno.UnoRuntime.queryInterface(java.lang.Class,java.lang.Object)
>>>> with tmpArgs:
>>>> // Debug: tmpArgs[0] = interface com.sun.star.frame.XModel type = class
>>>> java.lang.Class
>>>> java.lang.NullPointerException
>>>>     at bsh.Reflect.invokeOnMethod(Unknown Source)
>>>>     at bsh.Reflect.invokeStaticMethod(Unknown Source)
>>>>     at bsh.Name.invokeMethod(Unknown Source)
>>>>     at bsh.BSHMethodInvocation.eval(Unknown Source)
>>>>     at bsh.BSHPrimaryExpression.eval(Unknown Source)
>>>>     at bsh.BSHPrimaryExpression.eval(Unknown Source)
>>>>     at bsh.BSHAssignment.eval(Unknown Source)
>>>>     at bsh.Interpreter.eval(Unknown Source)
>>>>     at bsh.Interpreter.eval(Unknown Source)
>>>>     at bsh.Interpreter.eval(Unknown Source)
>>>>     at
>>>> com.sun.star.script.framework.provider.beanshell.ScriptImpl.invoke(Unknown
>>>> Source)
>>> "Unknown Source" means sources were compiled without -g, hard to guess
>>> what's happening there. Try these jars compiled with -g:
>>> http://people.apache.org/~arielch/api/scriptingfwkdebug.tar.gz
>>> The JARs in the folder classes should be placed in
>>> openoffice.org/basis3.5/program/classes/
>> I can see no basis3.5:
>> Instead, I just see basis3.4.  What should I do?
> I should have used placeholders ;) Put the jars in
> openoffice.org/basis<major.minor>/program/classes/
>
> basis3.4 in your case.
[snip]

After replacing the existing jars with the debug ones, did:

~/download/OpenOffice/r1372282/Apache_OpenOffice_incubating_3.4.1_Linux_x86-64_install-arc_en-US/openoffice.org3/program
$ ./scalc BeanShell.ods &
[sh] 5533

And after enabling macros, got window entitled "OpenOffice.org error"
with body
contains yellow triangle with ! in middle and text:

  A Scripting Framework error occurred while running the BeanShell
  script Library1.Macro1.bsh

  Message: The scripting language BeanShell is not supported.

What should I do now?

Again, thanks for the help, Ariel.

-regards,
Larry

 



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@openoffice.apache.org
For additional commands, e-mail: users-help@openoffice.apache.org


Re: unexpected location for user/Scripts (was Re: calc BeanShell script save gives "error saving script" window.

Posted by Larry Evans <cp...@suddenlink.net>.
On 03/05/13 10:53, Larry Evans wrote:
> On 03/04/13 08:31, Ariel Constenla-Haile wrote:
> [snip]
>> About debugging Java stuff, if you are planning to use BeansShell,
>> you should think about using an IDE to write your code, the "editor"
>> that shows up when you press "Edit" in the Script Organizer is
>> rather suboptimal. There seems to be a plug-in for Netbeans:
>> http://netbeans.dzone.com/beanshell-scripting-netbeans
>> Long time ago I wrote this tutorial:
>> http://wiki.openoffice.org/wiki/Scripting_in_Java_with_NetBeans_IDE
>> It has some information that might apply to scripting and debugging
>> with BeanShell.
> Hi Ariel,
>
> I went through most of the steps in the tutorial, and now I'm at the
> place with:
>
>   in Linux
>         /home/user_name/.openoffice.org/3/user/Scripts/java/HelloWorld
>        
> I happen to have other scripts in:
>
>         /home/user_name/.openoffice.org/3/user/Scripts
>        
> In particular, I have:
>
>   /home/evansl/.openoffice.org/3/user/Scripts/beanshell/LibraryTest:
>   total used in directory 32 available 54238344
>   drwxr-xr-x 3 evansl evansl 4096 Jun 11  2012 .
>   drwxr-xr-x 3 evansl evansl 4096 Jun 11  2012 ..
>   -rw-r--r-- 1 evansl evansl 1998 Jun 11  2012 MemUsage.bsh
>   -rw-r--r-- 1 evansl evansl  688 Jun 11  2012 parcel-descriptor.xml
>        
> With this, I would have expected to be able to run the MemUsage.bsh
> script; however, when I tried, no LibraryTest was shown.
>
> Then, I looked in the download directory and found:
>
>  
> /home/evansl/download/OpenOffice/r1372282/Apache_OpenOffice_incubating_3.4.1_Linux_x86-64_install-arc_en-US/openoffice.org3/.openoffice.org/3/user/Scripts
>  
> Then, I copied the beanshell scripts from my:
>   ~/.openoffice.org/3/user/Scripts
> to the one in the download directory, and now MemUsage.bsh is
> available for execution in a document.
>
> Is this the expected behaviour?  IOW, are the */user/Scripts expected
> to be stored in the "application" directory:
>
>  
> /home/evansl/download/OpenOffice/r1372282/Apache_OpenOffice_incubating_3.4.1_Linux_x86-64_install-arc_en-US/
>  
> -regards,
> Larry
>
>
>
Please note that the download was from the earlier link to the
unofficial tar you provided in the post:

http://article.gmane.org/gmane.comp.apache.openoffice.user/852

OTOH, when I tried using the official download:

http://hivelocity.dl.sourceforge.net/project/openofficeorg.mirror/stable/3.4.1/Apache_OpenOffice_incubating_3.4.1_Linux_x86-64_install-deb_en-US.tar.gz

It worked as expected.  IOW, I could see all the *.bsh files in my

home/evansl/.openoffice.org/3/user/Scripts/beanshell/LibraryTest:

directory.

HTH.

-regards,
Larry



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@openoffice.apache.org
For additional commands, e-mail: users-help@openoffice.apache.org


unexpected location for user/Scripts (was Re: calc BeanShell script save gives "error saving script" window.

Posted by Larry Evans <cp...@suddenlink.net>.
On 03/04/13 08:31, Ariel Constenla-Haile wrote:
[snip]
> About debugging Java stuff, if you are planning to use BeansShell,
> you should think about using an IDE to write your code, the "editor"
> that shows up when you press "Edit" in the Script Organizer is
> rather suboptimal. There seems to be a plug-in for Netbeans:
> http://netbeans.dzone.com/beanshell-scripting-netbeans

> Long time ago I wrote this tutorial:
> http://wiki.openoffice.org/wiki/Scripting_in_Java_with_NetBeans_IDE
> It has some information that might apply to scripting and debugging
> with BeanShell.

Hi Ariel,

I went through most of the steps in the tutorial, and now I'm at the
place with:

  in Linux
        /home/user_name/.openoffice.org/3/user/Scripts/java/HelloWorld
       
I happen to have other scripts in:

        /home/user_name/.openoffice.org/3/user/Scripts
       
In particular, I have:

  /home/evansl/.openoffice.org/3/user/Scripts/beanshell/LibraryTest:
  total used in directory 32 available 54238344
  drwxr-xr-x 3 evansl evansl 4096 Jun 11  2012 .
  drwxr-xr-x 3 evansl evansl 4096 Jun 11  2012 ..
  -rw-r--r-- 1 evansl evansl 1998 Jun 11  2012 MemUsage.bsh
  -rw-r--r-- 1 evansl evansl  688 Jun 11  2012 parcel-descriptor.xml
       
With this, I would have expected to be able to run the MemUsage.bsh
script; however, when I tried, no LibraryTest was shown.

Then, I looked in the download directory and found:

 
/home/evansl/download/OpenOffice/r1372282/Apache_OpenOffice_incubating_3.4.1_Linux_x86-64_install-arc_en-US/openoffice.org3/.openoffice.org/3/user/Scripts
 
Then, I copied the beanshell scripts from my:
  ~/.openoffice.org/3/user/Scripts
to the one in the download directory, and now MemUsage.bsh is
available for execution in a document.

Is this the expected behaviour?  IOW, are the */user/Scripts expected
to be stored in the "application" directory:

 
/home/evansl/download/OpenOffice/r1372282/Apache_OpenOffice_incubating_3.4.1_Linux_x86-64_install-arc_en-US/
 
-regards,
Larry


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@openoffice.apache.org
For additional commands, e-mail: users-help@openoffice.apache.org


Re: calc BeanShell script save gives "error saving script" window.

Posted by Ariel Constenla-Haile <ar...@apache.org>.
On Mon, Mar 04, 2013 at 07:59:57AM -0600, Larry Evans wrote:
> On 03/03/13 17:50, Ariel Constenla-Haile wrote:
> > Hi,
> >
> > On Sun, Mar 03, 2013 at 12:09:25PM -0600, Larry Evans wrote:
> >> // Debug: Invoking method (after massaging values): public static
> >> java.lang.Object
> >> com.sun.star.uno.UnoRuntime.queryInterface(java.lang.Class,java.lang.Object)
> >> with tmpArgs:
> >> // Debug: tmpArgs[0] = interface com.sun.star.frame.XModel type = class
> >> java.lang.Class
> >> java.lang.NullPointerException
> >>     at bsh.Reflect.invokeOnMethod(Unknown Source)
> >>     at bsh.Reflect.invokeStaticMethod(Unknown Source)
> >>     at bsh.Name.invokeMethod(Unknown Source)
> >>     at bsh.BSHMethodInvocation.eval(Unknown Source)
> >>     at bsh.BSHPrimaryExpression.eval(Unknown Source)
> >>     at bsh.BSHPrimaryExpression.eval(Unknown Source)
> >>     at bsh.BSHAssignment.eval(Unknown Source)
> >>     at bsh.Interpreter.eval(Unknown Source)
> >>     at bsh.Interpreter.eval(Unknown Source)
> >>     at bsh.Interpreter.eval(Unknown Source)
> >>     at
> >> com.sun.star.script.framework.provider.beanshell.ScriptImpl.invoke(Unknown
> >> Source)
> > "Unknown Source" means sources were compiled without -g, hard to guess
> > what's happening there. Try these jars compiled with -g:
> > http://people.apache.org/~arielch/api/scriptingfwkdebug.tar.gz
> > The JARs in the folder classes should be placed in
> > openoffice.org/basis3.5/program/classes/
> I can see no basis3.5:
> Instead, I just see basis3.4.  What should I do?

I should have used placeholders ;) Put the jars in
openoffice.org/basis<major.minor>/program/classes/

basis3.4 in your case.

About debugging Java stuff, if you are planning to use BeansShell, you
should think about using an IDE to write your code, the "editor" that
shows up when you press "Edit" in the Script Organizer is rather
suboptimal. There seems to be a plug-in for Netbeans:
http://netbeans.dzone.com/beanshell-scripting-netbeans

Long time ago I wrote this tutorial:
http://wiki.openoffice.org/wiki/Scripting_in_Java_with_NetBeans_IDE
It has some information that might apply to scripting and debugging with
BeanShell.


Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina

Re: calc BeanShell script save gives "error saving script" window.

Posted by Larry Evans <cp...@suddenlink.net>.
On 03/03/13 17:50, Ariel Constenla-Haile wrote:
> Hi,
>
> On Sun, Mar 03, 2013 at 12:09:25PM -0600, Larry Evans wrote:
>> // Debug: Invoking method (after massaging values): public static
>> java.lang.Object
>> com.sun.star.uno.UnoRuntime.queryInterface(java.lang.Class,java.lang.Object)
>> with tmpArgs:
>> // Debug: tmpArgs[0] = interface com.sun.star.frame.XModel type = class
>> java.lang.Class
>> java.lang.NullPointerException
>>     at bsh.Reflect.invokeOnMethod(Unknown Source)
>>     at bsh.Reflect.invokeStaticMethod(Unknown Source)
>>     at bsh.Name.invokeMethod(Unknown Source)
>>     at bsh.BSHMethodInvocation.eval(Unknown Source)
>>     at bsh.BSHPrimaryExpression.eval(Unknown Source)
>>     at bsh.BSHPrimaryExpression.eval(Unknown Source)
>>     at bsh.BSHAssignment.eval(Unknown Source)
>>     at bsh.Interpreter.eval(Unknown Source)
>>     at bsh.Interpreter.eval(Unknown Source)
>>     at bsh.Interpreter.eval(Unknown Source)
>>     at
>> com.sun.star.script.framework.provider.beanshell.ScriptImpl.invoke(Unknown
>> Source)
> "Unknown Source" means sources were compiled without -g, hard to guess
> what's happening there. Try these jars compiled with -g:
> http://people.apache.org/~arielch/api/scriptingfwkdebug.tar.gz
> The JARs in the folder classes should be placed in
> openoffice.org/basis3.5/program/classes/

>From the code downloaded from:

 
http://people.apache.org/~arielch/packages/r1372282-glibc-2.5/linux_x86-64/Apache_OpenOffice_incubating_3.4.1_Linux_x86-64_install-arc_en-US.tar.gz

as instructed (I thought) from your post of 03 Mar 2013 12:59:00 GMT:

 
http://mail-archives.apache.org/mod_mbox/openoffice-users/201303.mbox/%3C20130303125900.GB29551%40localhost%3E

I can see no basis3.5:

 
~/download/OpenOffice/r1372282/Apache_OpenOffice_incubating_3.4.1_Linux_x86-64_install-arc_en-US
$ find openoffice.org -name basis\*
   openoffice.org/basis3.4
 
~/download/OpenOffice/r1372282/Apache_OpenOffice_incubating_3.4.1_Linux_x86-64_install-arc_en-US
$

Instead, I just see basis3.4.  What should I do?
>
> If you know how to attach a debugger, you can debug the problem (the
> sources for BeanShell and the ScriptingFramework are also included).

I've used gdb; however, only with c++ programs.  I don't
remember doing it with java, but I'm not sure :(

Thanks very much for you patience and help Ariel.

kind regards,
Larry



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@openoffice.apache.org
For additional commands, e-mail: users-help@openoffice.apache.org


Re: calc BeanShell script save gives "error saving script" window.

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

On Sun, Mar 03, 2013 at 12:09:25PM -0600, Larry Evans wrote:
> // Debug: Invoking method (after massaging values): public static
> java.lang.Object
> com.sun.star.uno.UnoRuntime.queryInterface(java.lang.Class,java.lang.Object)
> with tmpArgs:
> // Debug: tmpArgs[0] = interface com.sun.star.frame.XModel type = class
> java.lang.Class
> java.lang.NullPointerException
>     at bsh.Reflect.invokeOnMethod(Unknown Source)
>     at bsh.Reflect.invokeStaticMethod(Unknown Source)
>     at bsh.Name.invokeMethod(Unknown Source)
>     at bsh.BSHMethodInvocation.eval(Unknown Source)
>     at bsh.BSHPrimaryExpression.eval(Unknown Source)
>     at bsh.BSHPrimaryExpression.eval(Unknown Source)
>     at bsh.BSHAssignment.eval(Unknown Source)
>     at bsh.Interpreter.eval(Unknown Source)
>     at bsh.Interpreter.eval(Unknown Source)
>     at bsh.Interpreter.eval(Unknown Source)
>     at
> com.sun.star.script.framework.provider.beanshell.ScriptImpl.invoke(Unknown
> Source)

"Unknown Source" means sources were compiled without -g, hard to guess
what's happening there. Try these jars compiled with -g:
http://people.apache.org/~arielch/api/scriptingfwkdebug.tar.gz
The JARs in the folder classes should be placed in
openoffice.org/basis3.5/program/classes/

If you know how to attach a debugger, you can debug the problem (the
sources for BeanShell and the ScriptingFramework are also included).


Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina

Re: calc BeanShell script save gives "error saving script" window.

Posted by Larry Evans <cp...@suddenlink.net>.
On 03/03/13 10:01, Ariel Constenla-Haile wrote:
> On Sun, Mar 03, 2013 at 08:57:49AM -0600, Larry Evans wrote:
>> and the calc window opened. I then put macros security at medium, and then
>> loaded the attached .ods file, and then created a macro containing the
>> previously attached NumberFive.bsh. I was able to save it this time;
>> however,
>> when I tried to run it, I got an Error window with a pink octagon and red
>> X and the message:
>> Sourced file: inline evaluation of : ``import
>> com.sun.star.uno.UnoRuntime; import com.sun.star.uno.XcomponentContext;
>> i...": Not an array
>> So obviously it's not interpreting the file as java. I've again attached
>> the file. What am I doing wrong?
>
> Are you running the macro from "Tools" - "Macros" - "Run Macro..." /
"Tools"
> - "Macros" - "Organize macros" - "BeanShell..." - "Run"? or are you
> running the macro from the "editor"?
>From the editor.
>
>
> If from the editor, try putting debug(); at the top of the editor, to
> see what's happening (I guess a null pointer exception), remove debug();
> before storing the file.
Changed 1st line to:

  debug();

then ran in editor and got error window with text:

  sourced file: inline evaluation of: ``debug(); import
com.sun.star.uno.UnoRuntime; import ..." unknown error: null

In the terminal window where ./scalc was typed, there was:

-----------cut here------------
evansl@evansl-desktop:~/download/OpenOffice/r1372282/Apache_OpenOffice_incubating_3.4.1_Linux_x86-64_install-arc_en-US/openoffice.org3/program$
./scalc&
[1] 7051
evansl@evansl-desktop:~/download/OpenOffice/r1372282/Apache_OpenOffice_incubating_3.4.1_Linux_x86-64_install-arc_en-US/openoffice.org3/program$
** (soffice:7061): WARNING **: Invalidate all children called

// Debug: Trying to load class: com.sun.star.frame.XModel
// Debug: getResolvedMethod cache MISS: class
com.sun.star.script.framework.provider.ScriptContext - getInvocationContext
// Debug: Searching for method: getInvocationContext() in
'com.sun.star.script.framework.provider.ScriptContext'
// Debug: cacheResolvedMethod putting: class
com.sun.star.script.framework.provider.ScriptContext public
com.sun.star.document.XScriptInvocationContext
com.sun.star.script.framework.provider.ScriptContext.getInvocationContext()
// Debug: Invoking method (entry): public
com.sun.star.document.XScriptInvocationContext
com.sun.star.script.framework.provider.ScriptContext.getInvocationContext()
with args:
// Debug: Invoking method (after massaging values): public
com.sun.star.document.XScriptInvocationContext
com.sun.star.script.framework.provider.ScriptContext.getInvocationContext()
with tmpArgs:
// Debug: trying to resolve variable: UnoRuntime
// Debug: trying class: UnoRuntime
// Debug: Trying to load class: com.sun.star.uno.UnoRuntime
// Debug: invokeMethod: trying static - UnoRuntime
// Debug: invoke static Method
// Debug: getResolvedMethod cache MISS: class
com.sun.star.uno.UnoRuntime - queryInterface
// Debug: Searching for method: queryInterface( java.lang.Class, null )
in 'com.sun.star.uno.UnoRuntime'
// Debug: Looking for most specific method: queryInterface
// Debug: cacheResolvedMethod putting: class com.sun.star.uno.UnoRuntime
public static java.lang.Object
com.sun.star.uno.UnoRuntime.queryInterface(java.lang.Class,java.lang.Object)
// Debug: Invoking method (entry): public static java.lang.Object
com.sun.star.uno.UnoRuntime.queryInterface(java.lang.Class,java.lang.Object)
with args:
// Debug: args[0] = interface com.sun.star.frame.XModel type = class
java.lang.Class
// Debug: args[1] = null type = class bsh.Primitive
// Debug: Invoking method (after massaging values): public static
java.lang.Object
com.sun.star.uno.UnoRuntime.queryInterface(java.lang.Class,java.lang.Object)
with tmpArgs:
// Debug: tmpArgs[0] = interface com.sun.star.frame.XModel type = class
java.lang.Class
java.lang.NullPointerException
    at bsh.Reflect.invokeOnMethod(Unknown Source)
    at bsh.Reflect.invokeStaticMethod(Unknown Source)
    at bsh.Name.invokeMethod(Unknown Source)
    at bsh.BSHMethodInvocation.eval(Unknown Source)
    at bsh.BSHPrimaryExpression.eval(Unknown Source)
    at bsh.BSHPrimaryExpression.eval(Unknown Source)
    at bsh.BSHAssignment.eval(Unknown Source)
    at bsh.Interpreter.eval(Unknown Source)
    at bsh.Interpreter.eval(Unknown Source)
    at bsh.Interpreter.eval(Unknown Source)
    at
com.sun.star.script.framework.provider.beanshell.ScriptSourceModel.execute(Unknown
Source)
    at
com.sun.star.script.framework.provider.beanshell.ScriptEditorForBeanShell.execute(Unknown
Source)
    at
com.sun.star.script.framework.provider.beanshell.ScriptEditorForBeanShell.actionPerformed(Unknown
Source)
    at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2012)
    at
javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2335)
    at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:404)
    at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
    at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
    at java.awt.Component.processMouseEvent(Component.java:6389)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3268)
    at java.awt.Component.processEvent(Component.java:6154)
    at java.awt.Container.processEvent(Container.java:2045)
    at java.awt.Component.dispatchEventImpl(Component.java:4750)
    at java.awt.Container.dispatchEventImpl(Container.java:2103)
    at java.awt.Component.dispatchEvent(Component.java:4576)
    at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4633)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4297)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4227)
    at java.awt.Container.dispatchEventImpl(Container.java:2089)
    at java.awt.Window.dispatchEventImpl(Window.java:2518)
    at java.awt.Component.dispatchEvent(Component.java:4576)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:672)
    at java.awt.EventQueue.access$400(EventQueue.java:96)
    at java.awt.EventQueue$2.run(EventQueue.java:631)
    at java.awt.EventQueue$2.run(EventQueue.java:629)
    at java.security.AccessController.doPrivileged(Native Method)
    at
java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:105)
    at
java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:116)
    at java.awt.EventQueue$3.run(EventQueue.java:645)
    at java.awt.EventQueue$3.run(EventQueue.java:643)
    at java.security.AccessController.doPrivileged(Native Method)
    at
java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:105)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:642)
    at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:275)
    at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:200)
    at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:185)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:177)
evansl@evansl-desktop:~/download/OpenOffice/r1372282/Apache_OpenOffice_incubating_3.4.1_Linux_x86-64_install-arc_en-US/openoffice.org3/program$

-----------cut here------------

Thanks for the help Ariel, and
any further help would certainly be appreciated.
>
>
> This file as a macro that runs fine:
> http://people.apache.org/~arielch/api/BeanShell.ods
>
> The ODS you attached on the other mail has code that work only with
> Writer:
Yes, sorry about that.  I was just trying to save that
one in OO3.2 and was having trouble just doing that.
However, as seen by the latest NumberFive.bsh,
The XTextDocument was changed to XSpreadsheetDocument.
[snip]

-regards,
Larry



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@openoffice.apache.org
For additional commands, e-mail: users-help@openoffice.apache.org


Re: calc BeanShell script save gives "error saving script" window.

Posted by Larry Evans <cp...@suddenlink.net>.
On 03/03/13 10:33, Larry Evans wrote:
> On 03/03/13 10:01, Ariel Constenla-Haile wrote:
> [snip]
>> This file as a macro that runs fine:
>> http://people.apache.org/~arielch/api/BeanShell.ods 
> After downloading that file, I opened it and got an "OpenOffice.org
> Error" with text:
>
>   Message: Sourced file: inline evaluation of:
> ``/*****************************************
> * * * Licensed ..." unknown error: null
>
> Any help is appreciated in resolving this problem ;)
>
> -Larry
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@openoffice.apache.org
> For additional commands, e-mail: users-help@openoffice.apache.org
>
>
The terminal window output was:

evansl@evansl-desktop:~/download/OpenOffice/r1372282/Apache_OpenOffice_incubating_3.4.1_Linux_x86-64_install-arc_en-US/openoffice.org3/program$
./scalc BeanShell.ods&
[2] 7427
evansl@evansl-desktop:~/download/OpenOffice/r1372282/Apache_OpenOffice_incubating_3.4.1_Linux_x86-64_install-arc_en-US/openoffice.org3/program$
// Debug: trying to resolve variable: bsh
// Debug: trying class: bsh
// Debug: Trying to load class: java.lang.bsh
// Debug: Trying to load class: java.io.bsh
// Debug: Trying to load class: java.util.bsh
// Debug: Trying to load class: java.net.bsh
// Debug: Trying to load class: java.awt.bsh
// Debug: Trying to load class: java.awt.event.bsh
// Debug: Trying to load class: javax.swing.bsh
// Debug: Trying to load class: javax.swing.event.bsh
// Debug: Trying to load class: bsh
// Debug: getClass(): bsh not    found in NameSpace: global
(bsh.NameSpace@3f56e5ed)
// Debug: not a class, trying var prefix bsh
// Debug: Looking for most specific constructor: class bsh.XThis
// Debug: trying to resolve variable: bsh
// Debug: resolved variable: bsh in namespace: NameSpace: global
(bsh.NameSpace@3f56e5ed)
// Debug: found This reference evaluating LHS
// Debug: trying to resolve variable: bsh
// Debug: resolved variable: bsh in namespace: NameSpace: global
(bsh.NameSpace@3f56e5ed)
// Debug: found This reference evaluating LHS
// Debug: Looking for most specific constructor: class bsh.XThis
// Debug: trying to resolve variable: bsh
// Debug: resolved variable: bsh in namespace: NameSpace: global
(bsh.NameSpace@3f56e5ed)
// Debug: found This reference evaluating LHS
// Debug: trying to resolve variable: bsh
// Debug: resolved variable: bsh in namespace: NameSpace: global
(bsh.NameSpace@3f56e5ed)
// Debug: found This reference evaluating LHS
// Debug: trying to resolve variable: bsh
// Debug: resolved variable: bsh in namespace: NameSpace: global
(bsh.NameSpace@3f56e5ed)
// Debug: found This reference evaluating LHS
// Debug: trying to resolve variable: bsh
// Debug: resolved variable: bsh in namespace: NameSpace: global
(bsh.NameSpace@3f56e5ed)
// Debug: found This reference evaluating LHS
// Debug: Time to initialize interpreter: 22
// Debug: trying to resolve variable: bsh
// Debug: resolved variable: bsh in namespace: NameSpace: global
(bsh.NameSpace@3f56e5ed)
// Debug: found This reference evaluating LHS
// Debug: eval(String):
/**************************************************************
 *
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 *
 *************************************************************/
/*
    Import standard OpenOffice.org API classes. For more information on
    these classes and the OpenOffice.org API, see the OpenOffice.org
    Developers Guide at:

    http://api.openoffice.org/
*/

import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XComponentContext;
import com.sun.star.frame.XDesktop;
import com.sun.star.frame.XModel;

/*
    Import XScriptContext class. An instance of this class is available
    to all BeanShell scripts in the global variable "XSCRIPTCONTEXT". This
    variable can be used to access the document for which this script
    was invoked.

    Methods available are:

        XSCRIPTCONTEXT.getDocument() returns XModel
        XSCRIPTCONTEXT.getInvocationContext() returns
XScriptInvocationContext or NULL
        XSCRIPTCONTEXT.getDesktop() returns XDesktop
        XSCRIPTCONTEXT.getComponentContext() returns XComponentContext

    For more information on using this class see the scripting
    developer guides at:

       
http://api.openoffice.org/docs/DevelopersGuide/ScriptingFramework/ScriptingFramework.xhtml
*/
       
// Hello World in BeanShell
import com.sun.star.lang.XServiceInfo;

oDoc =
UnoRuntime.queryInterface(XModel.class,XSCRIPTCONTEXT.getInvocationContext());
if ( oDoc == null )
  oDoc = XSCRIPTCONTEXT.getDocument();

xServiceInfo =
UnoRuntime.queryInterface(com.sun.star.lang.XServiceInfo.class, oDoc);
if ( xServiceInfo == null ||
!xServiceInfo.supportsService("com.sun.star.sheet.SpreadsheetDocument")) {
    System.err.println("Document isn't a spreadsheet document");
    return 0;
}

xController = oDoc.getCurrentController();
xSheetView =
UnoRuntime.queryInterface(com.sun.star.sheet.XSpreadsheetView.class,
xController);
xActiveSheet = xSheetView.getActiveSheet();
xActiveSheet.getCellByPosition(0,0).setValue(123.456789);

// BeanShell OpenOffice.org scripts should always return 0
return 0;

// Debug: eval: nameSpace = NameSpace: global (bsh.NameSpace@3f56e5ed)
// Debug: trying to resolve variable: bsh
// Debug: trying class: bsh
// Debug: Trying to load class: java.lang.bsh
// Debug: Trying to load class: java.io.bsh
// Debug: Trying to load class: java.util.bsh
// Debug: Trying to load class: java.net.bsh
// Debug: Trying to load class: java.awt.bsh
// Debug: Trying to load class: java.awt.event.bsh
// Debug: Trying to load class: javax.swing.bsh
// Debug: Trying to load class: javax.swing.event.bsh
// Debug: Trying to load class: bsh
// Debug: getClass(): bsh not    found in NameSpace: global
(bsh.NameSpace@3f56e5ed)
// Debug: not a class, trying var prefix bsh
// Debug: Looking for most specific constructor: class bsh.XThis
// Debug: trying to resolve variable: bsh
// Debug: resolved variable: bsh in namespace: NameSpace: global
(bsh.NameSpace@3f56e5ed)
// Debug: found This reference evaluating LHS
// Debug: trying to resolve variable: bsh
// Debug: resolved variable: bsh in namespace: NameSpace: global
(bsh.NameSpace@3f56e5ed)
// Debug: found This reference evaluating LHS
// Debug: Looking for most specific constructor: class bsh.XThis
// Debug: trying to resolve variable: bsh
// Debug: resolved variable: bsh in namespace: NameSpace: global
(bsh.NameSpace@3f56e5ed)
// Debug: found This reference evaluating LHS
// Debug: trying to resolve variable: bsh
// Debug: resolved variable: bsh in namespace: NameSpace: global
(bsh.NameSpace@3f56e5ed)
// Debug: found This reference evaluating LHS
// Debug: trying to resolve variable: bsh
// Debug: resolved variable: bsh in namespace: NameSpace: global
(bsh.NameSpace@3f56e5ed)
// Debug: found This reference evaluating LHS
// Debug: trying to resolve variable: bsh
// Debug: resolved variable: bsh in namespace: NameSpace: global
(bsh.NameSpace@3f56e5ed)
// Debug: found This reference evaluating LHS
// Debug: Time to initialize interpreter: 37
// Debug: Trying to load class: com.sun.star.frame.XModel
// Debug: getResolvedMethod cache MISS: class
com.sun.star.script.framework.provider.ScriptContext - getInvocationContext
// Debug: Searching for method: getInvocationContext() in
'com.sun.star.script.framework.provider.ScriptContext'
// Debug: cacheResolvedMethod putting: class
com.sun.star.script.framework.provider.ScriptContext public
com.sun.star.document.XScriptInvocationContext
com.sun.star.script.framework.provider.ScriptContext.getInvocationContext()
// Debug: Invoking method (entry): public
com.sun.star.document.XScriptInvocationContext
com.sun.star.script.framework.provider.ScriptContext.getInvocationContext()
with args:
// Debug: Invoking method (after massaging values): public
com.sun.star.document.XScriptInvocationContext
com.sun.star.script.framework.provider.ScriptContext.getInvocationContext()
with tmpArgs:
// Debug: trying to resolve variable: UnoRuntime
// Debug: trying class: UnoRuntime
// Debug: Trying to load class: com.sun.star.uno.UnoRuntime
// Debug: invokeMethod: trying static - UnoRuntime
// Debug: invoke static Method
// Debug: getResolvedMethod cache MISS: class
com.sun.star.uno.UnoRuntime - queryInterface
// Debug: Searching for method: queryInterface( java.lang.Class, null )
in 'com.sun.star.uno.UnoRuntime'
// Debug: Looking for most specific method: queryInterface
// Debug: cacheResolvedMethod putting: class com.sun.star.uno.UnoRuntime
public static java.lang.Object
com.sun.star.uno.UnoRuntime.queryInterface(java.lang.Class,java.lang.Object)
// Debug: Invoking method (entry): public static java.lang.Object
com.sun.star.uno.UnoRuntime.queryInterface(java.lang.Class,java.lang.Object)
with args:
// Debug: args[0] = interface com.sun.star.frame.XModel type = class
java.lang.Class
// Debug: args[1] = null type = class bsh.Primitive
// Debug: Invoking method (after massaging values): public static
java.lang.Object
com.sun.star.uno.UnoRuntime.queryInterface(java.lang.Class,java.lang.Object)
with tmpArgs:
// Debug: tmpArgs[0] = interface com.sun.star.frame.XModel type = class
java.lang.Class
java.lang.NullPointerException
    at bsh.Reflect.invokeOnMethod(Unknown Source)
    at bsh.Reflect.invokeStaticMethod(Unknown Source)
    at bsh.Name.invokeMethod(Unknown Source)
    at bsh.BSHMethodInvocation.eval(Unknown Source)
    at bsh.BSHPrimaryExpression.eval(Unknown Source)
    at bsh.BSHPrimaryExpression.eval(Unknown Source)
    at bsh.BSHAssignment.eval(Unknown Source)
    at bsh.Interpreter.eval(Unknown Source)
    at bsh.Interpreter.eval(Unknown Source)
    at bsh.Interpreter.eval(Unknown Source)
    at
com.sun.star.script.framework.provider.beanshell.ScriptImpl.invoke(Unknown
Source)



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@openoffice.apache.org
For additional commands, e-mail: users-help@openoffice.apache.org


Re: calc BeanShell script save gives "error saving script" window.

Posted by Larry Evans <cp...@suddenlink.net>.
On 03/03/13 10:01, Ariel Constenla-Haile wrote:
[snip]
> This file as a macro that runs fine:
> http://people.apache.org/~arielch/api/BeanShell.ods 

After downloading that file, I opened it and got an "OpenOffice.org
Error" with text:

  Message: Sourced file: inline evaluation of:
``/*****************************************
* * * Licensed ..." unknown error: null

Any help is appreciated in resolving this problem ;)

-Larry


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@openoffice.apache.org
For additional commands, e-mail: users-help@openoffice.apache.org


Re: calc BeanShell script save gives "error saving script" window.

Posted by Ariel Constenla-Haile <ar...@apache.org>.
On Sun, Mar 03, 2013 at 08:57:49AM -0600, Larry Evans wrote:
> and the calc window opened.  I then put macros security at medium, and then
> loaded the attached .ods file, and then created a macro containing the
> previously attached NumberFive.bsh. I was able to save it this time;
> however,
> when I tried to run it, I got an Error window with a pink octagon and red
> X and the message:
>    Sourced file: inline evaluation of : ``import
> com.sun.star.uno.UnoRuntime; import com.sun.star.uno.XcomponentContext;
> i...": Not an array
> So obviously it's not interpreting the file as java.  I've again attached
> the file.  What am I doing wrong?

Are you running the macro from "Tools" - "Macros" - "Run Macro..." / "Tools"
- "Macros" - "Organize macros" - "BeanShell..." - "Run"? or are you
running the macro from the "editor"?

If from the editor, try putting debug(); at the top of the editor, to
see what's happening (I guess a null pointer exception), remove debug();
before storing the file.

This file as a macro that runs fine:
http://people.apache.org/~arielch/api/BeanShell.ods

The ODS you attached on the other mail has code that work only with
Writer:


xTextDoc = (XTextDocument)
UnoRuntime.queryInterface(XTextDocument.class,oDoc);
xText = xTextDoc.getText();
xTextRange = xText.getEnd();
xTextRange.setString( "Hello World (in BeanShell)" );


Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina

Re: calc BeanShell script save gives "error saving script" window.

Posted by Larry Evans <cp...@suddenlink.net>.
On 03/03/13 08:21, Ariel Constenla-Haile wrote:
> On Sun, Mar 03, 2013 at 08:10:41AM -0600, Larry Evans wrote:
>> So:
>>
>>   http://www.openoffice.org/dev_docs/source/sys_reqs_aoo34.html
>>
>> where it says gnome is required is wrong?  IOW, it should just
>> say libgtk2?
> Gnome is only a requirement for accessibility to work (via Orca), but
> you can use OpenOffice in any desktop environment as long as you have
> gtk2 libraries.
>
>>> What desktop environment do you have?
>> My os is ubuntu 10.04 LTS.  However, it appears I've also
>> got gnome because on my panel, when I select System,
>> it shows an "About Gnome" item.  What's confusing is
>> that synaptic shows gnome is not installed.
> If you have the default Ubuntu installation, then you already have all
> gtk2 libraries :)
>
>>> You
>>> don't need to install gnome, and sure you have gtk2 libraries already
>>> installed ;)
>> Yep, synaptic shows several packages installed with names
>> starting with libgtk2, in particular it shows:
>>
>>   libgtk2.0-dev
> packages ending with *-dev are for development, you don't need them
> unless you are planning to develop with that library.
>
>
> Regards
Thanks.  I've downloaded:

 
http://people.apache.org/~arielch/packages/r1372282-glibc-2.5/linux_x86-64/Apache_OpenOffice_incubating_3.4.1_Linux_x86-64_install-arc_en-US.tar.gz.md5
 
http://people.apache.org/~arielch/packages/r1372282-glibc-2.5/linux_x86-64/Apache_OpenOffice_incubating_3.4.1_Linux_x86-64_install-arc_en-US.tar.gz

and gunzipped and tar -xf the .tar.gz file.  This resulted in 2 directories:

 
/home/evansl/download/OpenOffice/r1372282/Apache_OpenOffice_incubating_3.4.1_Linux_x86-64_install-arc_en-US:
  total used in directory 16 available 54485852
  drwxr-xr-x 4 evansl evansl 4096 Aug 18  2012 .
  drwxr-xr-x 3 evansl evansl 4096 Aug 18  2012 ..
  drwxr-xr-x 4 evansl evansl 4096 Aug 18  2012 openoffice.org
  drwxr-xr-x 5 evansl evansl 4096 Aug 18  2012 openoffice.org3

In a terminal window, in directory:

 
/home/evansl/download/OpenOffice/r1372282/Apache_OpenOffice_incubating_3.4.1_Linux_x86-64_install-arc_en-US/openoffice.org3/program

I typed:

  ./scalc

and the calc window opened.  I then put macros security at medium, and then
loaded the attached .ods file, and then created a macro containing the
previously attached NumberFive.bsh. I was able to save it this time;
however,
when I tried to run it, I got an Error window with a pink octagon and red
X and the message:
   Sourced file: inline evaluation of : ``import
com.sun.star.uno.UnoRuntime; import com.sun.star.uno.XcomponentContext;
i...": Not an array
So obviously it's not interpreting the file as java.  I've again attached
the file.  What am I doing wrong?

TIA.

-regards,
Larry


 
 


Re: calc BeanShell script save gives "error saving script" window.

Posted by Ariel Constenla-Haile <ar...@apache.org>.
On Sun, Mar 03, 2013 at 08:10:41AM -0600, Larry Evans wrote:
> So:
> 
>   http://www.openoffice.org/dev_docs/source/sys_reqs_aoo34.html
> 
> where it says gnome is required is wrong?  IOW, it should just
> say libgtk2?

Gnome is only a requirement for accessibility to work (via Orca), but
you can use OpenOffice in any desktop environment as long as you have
gtk2 libraries.

> > What desktop environment do you have?
> My os is ubuntu 10.04 LTS.  However, it appears I've also
> got gnome because on my panel, when I select System,
> it shows an "About Gnome" item.  What's confusing is
> that synaptic shows gnome is not installed.

If you have the default Ubuntu installation, then you already have all
gtk2 libraries :)

> > You
> > don't need to install gnome, and sure you have gtk2 libraries already
> > installed ;)
> Yep, synaptic shows several packages installed with names
> starting with libgtk2, in particular it shows:
> 
>   libgtk2.0-dev

packages ending with *-dev are for development, you don't need them
unless you are planning to develop with that library.


Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina

Re: calc BeanShell script save gives "error saving script" window.

Posted by Larry Evans <cp...@suddenlink.net>.
On 03/03/13 07:57, Ariel Constenla-Haile wrote:
> On Sun, Mar 03, 2013 at 07:51:17AM -0600, Larry Evans wrote:
>> On 03/03/13 06:59, Ariel Constenla-Haile wrote:
>>> On Sun, Mar 03, 2013 at 06:32:51AM -0600, Larry Evans wrote:
>>>> I found gnome was needed; however, when I tried to install
>>>> gnome2.28, I had an unresolvable dependency between
>>>> packages; hence, I'm stuck with the OpenOffice I've got
>>>> or at least the one that's provided by my package manager,
>>>> synaptic :(
>>>
>>> You can try with this unofficial tar:
>>>
http://people.apache.org/~arielch/packages/r1372282-glibc-2.5/#full-archived-sets
>>> (the UI is in English, but it does not require any installation, and
>>> uses its own user profile).
>>>
>>>
>>> Regards
>> Does that unoffical tar require gnome? I would think even "unofficial"
>> downloads would
>> still have the same or similar requirements.
>
> They require gtk2, not gnome.
So:

  http://www.openoffice.org/dev_docs/source/sys_reqs_aoo34.html

where it says gnome is required is wrong?  IOW, it should just
say libgtk2?

> What desktop environment do you have?
My os is ubuntu 10.04 LTS.  However, it appears I've also
got gnome because on my panel, when I select System,
it shows an "About Gnome" item.  What's confusing is
that synaptic shows gnome is not installed.
> You
> don't need to install gnome, and sure you have gtk2 libraries already
> installed ;)
Yep, synaptic shows several packages installed with names
starting with libgtk2, in particular it shows:

  libgtk2.0-dev
  libgtk2.0-bin

Is that enough?

TIA.

-regards,
Larry



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@openoffice.apache.org
For additional commands, e-mail: users-help@openoffice.apache.org


Re: calc BeanShell script save gives "error saving script" window.

Posted by Ariel Constenla-Haile <ar...@apache.org>.
On Sun, Mar 03, 2013 at 07:51:17AM -0600, Larry Evans wrote:
> On 03/03/13 06:59, Ariel Constenla-Haile wrote:
> > On Sun, Mar 03, 2013 at 06:32:51AM -0600, Larry Evans wrote:
> >> I found gnome was needed; however, when I tried to install
> >> gnome2.28, I had an unresolvable dependency between
> >> packages; hence, I'm stuck with the OpenOffice I've got
> >> or at least the one that's provided by my package manager,
> >> synaptic :(
> >
> > You can try with this unofficial tar:
> > http://people.apache.org/~arielch/packages/r1372282-glibc-2.5/#full-archived-sets
> > (the UI is in English, but it does not require any installation, and
> > uses its own user profile).
> >
> >
> > Regards
> Does that unoffical tar require gnome?  I would think even "unofficial"
> downloads would
> still have the same or similar requirements.

They require gtk2, not gnome. What desktop environment do you have? You
don't need to install gnome, and sure you have gtk2 libraries already
installed ;)


Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina

Re: calc BeanShell script save gives "error saving script" window.

Posted by Larry Evans <cp...@suddenlink.net>.
On 03/03/13 06:59, Ariel Constenla-Haile wrote:
> On Sun, Mar 03, 2013 at 06:32:51AM -0600, Larry Evans wrote:
>> I found gnome was needed; however, when I tried to install
>> gnome2.28, I had an unresolvable dependency between
>> packages; hence, I'm stuck with the OpenOffice I've got
>> or at least the one that's provided by my package manager,
>> synaptic :(
>
> You can try with this unofficial tar:
> http://people.apache.org/~arielch/packages/r1372282-glibc-2.5/#full-archived-sets
> (the UI is in English, but it does not require any installation, and
> uses its own user profile).
>
>
> Regards
Does that unoffical tar require gnome?  I would think even "unofficial"
downloads would
still have the same or similar requirements.

-regards,
Larry



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@openoffice.apache.org
For additional commands, e-mail: users-help@openoffice.apache.org


Re: calc BeanShell script save gives "error saving script" window.

Posted by Ariel Constenla-Haile <ar...@apache.org>.
On Sun, Mar 03, 2013 at 06:32:51AM -0600, Larry Evans wrote:
> I found gnome was needed; however, when I tried to install
> gnome2.28, I had an unresolvable dependency between
> packages; hence, I'm stuck with the OpenOffice I've got
> or at least the one that's provided by my package manager,
> synaptic :(

You can try with this unofficial tar:
http://people.apache.org/~arielch/packages/r1372282-glibc-2.5/#full-archived-sets
(the UI is in English, but it does not require any installation, and
uses its own user profile).


Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina

Re: calc BeanShell script save gives "error saving script" window.

Posted by Larry Evans <cp...@suddenlink.net>.
On 03/02/13 16:48, Ariel Constenla-Haile wrote:
> Hi Larry,
>
> On Sat, Mar 02, 2013 at 03:46:42PM -0600, Larry Evans wrote:
>> The script is attached.
>>
>> The OpenOffice version is(from the about button):
>>
>> OpenOffice.org 3.2.0
>> OOO320m12 (Build:9483)
>
> This is too old.
>
>> The OS is:
>>
>> Linux evansl-desktop 2.6.32-41-generic #90-Ubuntu SMP Tue May 22
>> 11:29:51 UTC 2012 x86_64 GNU/Linux
>>
>> The steps:
>>
>> 1) Open simple_script1.ods
>> 2) Tools>Macros>Organize Macros>BeanShell>Standard>NumberFive.bsh
>> 3) Enter the attached into the Edit window
>> 4) Press Save button at bottom of Edit window.
>>
>> There then appears an Error window with:
>>
>> Error saving script:
>> com.sun.star.ucb.iInteractiveAugmentedIOException: Got no data
>> stream!
>
> I couldn't reproduce this, because I don't have simple_script1.ods, but
> with 3.4.1 I was able to create a script, save it, assign it to an
> event, etc.
>
>> What should I do to Save this script.
>
> May be try with a newer version (you can try it without installing it).
>
>
Thanks Ariel; however, from looking at:

http://www.openoffice.org/dev_docs/source/sys_reqs_aoo34.html

I found gnome was needed; however, when I tried to install
gnome2.28, I had an unresolvable dependency between
packages; hence, I'm stuck with the OpenOffice I've got
or at least the one that's provided by my package manager,
synaptic :(

-regards,
Larry



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@openoffice.apache.org
For additional commands, e-mail: users-help@openoffice.apache.org


Re: calc BeanShell script save gives "error saving script" window.

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

On Sat, Mar 02, 2013 at 03:46:42PM -0600, Larry Evans wrote:
> The script is attached.
> 
> The OpenOffice version is(from the about button):
> 
> OpenOffice.org 3.2.0
> OOO320m12 (Build:9483)

This is too old.

> The OS is:
> 
> Linux evansl-desktop 2.6.32-41-generic #90-Ubuntu SMP Tue May 22
> 11:29:51 UTC 2012 x86_64 GNU/Linux
> 
> The steps:
> 
>   1) Open simple_script1.ods
>   2) Tools>Macros>Organize Macros>BeanShell>Standard>NumberFive.bsh
>   3) Enter the attached into the Edit window
>   4) Press Save button at bottom of Edit window.
> 
> There then appears an Error window with:
> 
>       Error saving script:
>       com.sun.star.ucb.iInteractiveAugmentedIOException: Got no data
>       stream!

I couldn't reproduce this, because I don't have simple_script1.ods, but
with 3.4.1 I was able to create a script, save it, assign it to an
event, etc.

> What should I do to Save this script.

May be try with a newer version (you can try it without installing it).

> Also, eventually, I'll want to use this script in a formula.  I'd like
> guidance on how to do that.

Do you want to use it as a Function, just like you can do it with Basic
macros, or to manipule the document?

We have a dedicated mailing list for programing, scripting, API,
extension, etc.: api@openoffice.apache.org


Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina