Return-Path: X-Original-To: apmail-incubator-ooo-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-ooo-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 063277646 for ; Fri, 25 Nov 2011 20:04:25 +0000 (UTC) Received: (qmail 85134 invoked by uid 500); 25 Nov 2011 20:04:24 -0000 Delivered-To: apmail-incubator-ooo-commits-archive@incubator.apache.org Received: (qmail 85110 invoked by uid 500); 25 Nov 2011 20:04:24 -0000 Mailing-List: contact ooo-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ooo-dev@incubator.apache.org Delivered-To: mailing list ooo-commits@incubator.apache.org Received: (qmail 85103 invoked by uid 99); 25 Nov 2011 20:04:24 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 Nov 2011 20:04:24 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 Nov 2011 20:04:18 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 1F8132388C06; Fri, 25 Nov 2011 20:02:50 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1206297 [19/19] - in /incubator/ooo/ooo-site/trunk/content/framework: documentation/ documentation/devmanual/ documentation/filters/ documentation/filterui/ documentation/mimetypes/ documentation/others/ drafts/ proposals/ proposals/apply/... Date: Fri, 25 Nov 2011 20:02:33 -0000 To: ooo-commits@incubator.apache.org From: kschenk@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20111125200250.1F8132388C06@eris.apache.org> Added: incubator/ooo/ooo-site/trunk/content/framework/scripting/scriptingf1/commandline-devguide.html URL: http://svn.apache.org/viewvc/incubator/ooo/ooo-site/trunk/content/framework/scripting/scriptingf1/commandline-devguide.html?rev=1206297&view=auto ============================================================================== --- incubator/ooo/ooo-site/trunk/content/framework/scripting/scriptingf1/commandline-devguide.html (added) +++ incubator/ooo/ooo-site/trunk/content/framework/scripting/scriptingf1/commandline-devguide.html Fri Nov 25 20:00:55 2011 @@ -0,0 +1,185 @@ + + + + Developing Scripts on the Command Line + + + + + +

Developing Scripts on the Command Line

+For users who do not wish to develop their OpenOffice.org scripts using an IDE +there is a simple command line interface built into the OpenOffice.org Scripting +module which can be used for the generation and deployment of OpenOffice.org +Scripts. + +

Contents

+ + +

Prerequisites

+
    +
  • The Scripting module office.jar file should be included in the +classpath. You can download this file from here +
  • +
  • The main Scripting Framework jar file ScriptFramework.jar also needs +to be included in the classpath. You can find it in the program/classes +directory of your OpenOffice.org installation. +
  • +
  • The CommandLineTools class will only work if an XML parser (such +as Apache Xerces) +is available in the classpath.
  • +
+ +

The CommandLineTools class

+The CommandLineTools class takes the following options (Note: +Options in angle brackets "<>" are required, options in square +brackets "[]" are optional): +
[-o Path to OpenOffice.org Installation] -g [Path to Parcel directory] [options] +

Generates a Script Parcel for the given the +parcel directory. The optional -o flag is used to specify that path +to your OpenOffice.org installation. If it is not provided the CommandLineTools +class will attempt to discover your OpenOffice.org installation and will print +an error if it fails. The parcel name will be the name of the parcel +directory plus the .sxp extension.

+ +

[-o Path to OpenOffice.org Installation] -d <Path to Script Parcel> <Target +Directory|Document>

+

Deploys the given Script Parcel to a directory or an +OpenOffice.org document. The optional -o flag is used to specify that path +to your OpenOffice.org installation. If it is not provided the CommandLineTools +class will attempt to discover your OpenOffice.org installation and will print +an error if it fails. A directory will be created with the name of +the Parcel and the contents of the Parcel will be put into that +directory.

+
    +
  • If deploying to an OpenOffice.org installation the target +directory should be the <OpenOffice.org Installation>/user/Scripts or +<OpenOffice.org Installation>/share/Scripts directory. If the either the +Script Parcel or the target do not exist an error message is printed. +Otherwise the Script Parcel is deployed to the target.
  • +
+
+

Top

+

Examples

+ +

Top

+
Last Modified: Nov 19 2003 + + Propchange: incubator/ooo/ooo-site/trunk/content/framework/scripting/scriptingf1/commandline-devguide.html ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/ooo/ooo-site/trunk/content/framework/scripting/scriptingf1/developer-guide.html URL: http://svn.apache.org/viewvc/incubator/ooo/ooo-site/trunk/content/framework/scripting/scriptingf1/developer-guide.html?rev=1206297&view=auto ============================================================================== --- incubator/ooo/ooo-site/trunk/content/framework/scripting/scriptingf1/developer-guide.html (added) +++ incubator/ooo/ooo-site/trunk/content/framework/scripting/scriptingf1/developer-guide.html Fri Nov 25 20:00:55 2011 @@ -0,0 +1,302 @@ + + + + Writing Scripts in BeanShell and Java + + + + +

Writing Scripts in BeanShell, JavaScript and Java

+ +

Contents

+ + +

Hello World in BeanShell

+Here's a BeanShell script that inserts Hello World at the start of an +OpenOffice.org Writer document: +

+
+    import com.sun.star.frame.XModel;
+    import com.sun.star.text.*;
+    import com.sun.star.uno.UnoRuntime;
+    import drafts.com.sun.star.script.provider.XScriptContext;
+
+    model = context.getDocument(); 
+    textdoc = (XTextDocument)
+        UnoRuntime.queryInterface(XTextDocument.class, model);
+
+    oText = textdoc.getText(); 
+    oCursor = oText.createTextCursor(); 
+    oText.insertString(oCursor, "Hello World", false)
+
+Top +

Trying out your BeanShell script

+Trying out your Hello World BeanShell script is easy: +
    +
  • Start OpenOffice.org and open a new Writer document.
  • +
  • Select the Tools/Configure... menu item.
  • +
  • Select the menu tab. In the Category section select + OpenOffice.org Scripts/share/Java/selector +
  • In the Function list select ScriptSelector.showOrganizer +
  • Now click the New button to create a menu item for this script. You can + rename the menu item by clicking on it in the Menu entries list, and + move it around the menu hierarchy using the arrow buttons. +
  • Click OK to apply your change +
  • Select your new menu item +
  • A Script dialog appears, browse to a BeanShell script + eg. Root/share/BeanShell/Highlight/highlighter.bsh and click Edit. +
  • A BeanShell Debugger window will appear. Click Clear to clear the window + and copy in the text of your Hello World example +

    +
  • +
  • Now click on the Run button. +
  • You should see Hello World appear at the start of the Writer document. +
  • Click Close so that the highlighter.bsh script is not overwritten +
+ +

+If you are new to the OpenOffice.org API this is a great way to experiment +with it.

+

When you are happy with your BeanShell script, you can create a +Script Parcel which can be deployed to OpenOffice.org installations or +documents for use by others. This can be done using NetBeans or from the command line.

+

+Top + + +

Hello World in JavaScript

+ Here's a JavaScript script that inserts Hello World at the start of +an OpenOffice.org Writer document:

+
+    importClass(Packages.com.sun.star.uno.UnoRuntime);
+    importClass(Packages.com.sun.star.text.XTextDocument);
+
+    var oModel = XSCRIPTCONTEXT.getDocument(); 
+    var oTextdoc = UnoRuntime.queryInterface(XTextDocument, oModel);
+    var oText = oTextdoc.getText(); 
+    var oCursor = oText.createTextCursor(); 
+
+    oText.insertString(oCursor, "Hello World", false);
+
+ +

The XSCRIPTCONTEXT variable above is a global instance of the +XScriptContext type which is available to all JavaScript scripts +executed by the Scripting Framework. See Writing +OpenOffice.org Scripts and the XScriptContext type for the methods available +for the XScriptContext type.

+

Top

+

Trying out a JavaScript script in +OpenOffice.org

+Once again you can use the Edit/Debug Scripts dialog to open a +JavaScript script in an editor. The Rhino JavaScript Editor from the Mozilla Rhino project can be used +to debug and test your JavaScript scripts. +
    +
  • Create a menu item for the Script dialog as described in the + BeanShell instructions above +
  • Open the Script dialog, navigate to + Root/share/JavaScript/ExportSheetsToHTML/exportsheetstohtml.hs and + click edit.
  • +
  • A Rhino Debugger window will appear. Delete the text in the window and + paste in the Hello World code +

    +
  • +
  • To run the script select File/Run and then click on the Go button. +
+

The Rhino Debugger also includes debugging functionality, so you can +set breakpoints in your JavaScript script and step through the code as +it is executed.

+

+Top + +

+

Hello World in Java

+Here's the Hello World script in Java: +

+

    import com.sun.star.frame.XModel;
+    import com.sun.star.text.*;
+    import com.sun.star.uno.UnoRuntime;
+    import drafts.com.sun.star.script.provider.XScriptContext;
+
+    public class MyClass {
+
+        // The script method must be public
+        // It can either be static or non-static
+
+        public void showForm(XScriptContext xSc) {
+
+            // getting the text document object
+            XModel xmodel = xSc.getDocument();
+
+            XTextDocument xtextdoc = (XTextDocument)
+                UnoRuntime.queryInterface(XTextDocument.class, xmodel);
+            XText xtext = xtextdoc.getText();
+            XTextCursor xtextcursor = xtext.createTextCursor();
+
+            xtext.insertString(xtextcursor, "Hello World", false);
+        }
+    }
+
+

+

OpenOffice.org scripts in Java need to be compiled in order to execute them. +See the Developing Scripts in NetBeans +and Developing Scripts on the +command line guides for instructions on how to compile and deploy +OpenOffice.org scripts in Java.

+

Top

+

Writing OpenOffice.org scripts and the XScriptContext type

+The XScriptContext type is used to obtain the the document context, +desktop and component factory from an OpenOffice.org script. Any public Java +method which accepts XScriptContext as it's first parameter can be +executed as an OpenOffice.org script. For BeanShell scripts, an instance of +XScriptContext is available in a global variable called "context" which +can be used by the script. +

The following accessor methods are available on the XScriptContext +type:

+
    +
  • Current document - access the document context against which the +script was invoked +

    <XScriptContext +Instance>.getDocument()
    +returns ::com::sun::star::frame::XModel

    +
  • +
  • OpenOffice.org Desktop - access the desktop of the running OpenOffice.org +

    <XScriptContext +Instance>.getDesktop()
    +returns +::com::sun::star::frame::XDesktop

    +
  • +
  • Component Factory - access a ComponentContext factory to create +other UNO components as required +

    <XScriptContext +Instance>.getComponentContext()
    +returns +::com::sun::star::uno::XComponentContext

    +
  • +
+The Java or BeanShell script must import the XScriptContext interface, +using the following import directive: +
    import drafts.com.sun.star.script.provider.XScriptContext;
+
+

Top

+

Tips on writing OpenOffice.org scripts

+
    +
  • +

    Performance: Currently scripts are being loaded by the +Scripting Framework each time they are run. As such it is important to +keep the size of your scripts and any dependent jar files they are using +reasonably small. In future releases this script loading will be +optimised by changing the point at which the scripts are loaded by +OpenOffice.org and using various caching schemes once they are loaded. +However, the initial load will always be effected by the script and +it's dependent jar/class file sizes.

    +
  • +
  • +

    Threading: Scripts are run synchronously by the Scripting +Framework. If you wish to perform any background task or provide some +user interaction via a dialog for instance, then it is your +responsibility to spawn a thread in the running script which can manage +this process or interaction and let the script return promptly. Within +this running thread you should follow the normal UNO component +threading guidelines to ensure that they do not deadlock OpenOffice.org +through inappropriate use of the UNO API.

    +
  • +
+Top +

Parcel Descriptor DTD and sample XML

+Each Script Parcel must contain a parcel-descriptor.xml file which provides +all the necessary metadata for the script. The DTD for the +parcel-descriptor.xml follows: + +
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- DTD for Parcel Meta data for use in the OpenOffice.org Scripting Framework Project -->
+
+<!ELEMENT description (#PCDATA)>
+<!ELEMENT displayname EMPTY>
+<!ELEMENT functionname EMPTY>
+<!ELEMENT prop EMPTY>
+<!ELEMENT languagedepprops (prop+)>
+<!ELEMENT script (description, displayname, functionname, languagedepprops*)>
+<!ELEMENT parcel (script+)>
+<!ATTLIST displayname
+	value CDATA #REQUIRED
+>
+<!ATTLIST locale
+	lang CDATA #REQUIRED
+>
+<!ATTLIST functionname
+	value CDATA #REQUIRED
+>
+<!ATTLIST prop
+	name CDATA #REQUIRED
+	value CDATA #REQUIRED
+>
+<!ATTLIST script
+	language CDATA #REQUIRED
+>
+<!ATTLIST parcel
+	language CDATA #REQUIRED
+>
+
+ +

+ +The following is an example of a parcel-descriptor.xml file that +defines a script, implemented in Java. The languagedepprops element is +used to extend the JVM's classpath. + +

+<?xml version="1.0" encoding="UTF-8"?>
+<!--Sample Meta Data for use with the Scripting Framework Project in OpenOffice.org -->
+<!DOCTYPE parcel SYSTEM "parcel.dtd">
+
+<parcel language="Java">
+	<script language="Java">
+		<displayname value="Memory.usage"/>
+		<description>
+			Displays the memory current memory usage
+		</description>
+		<functionname value="memoryUtils.memoryUsage"/>
+		<languagedepprops>
+			<prop name="classpath" value="/opt/foo.jar:/usr/java/src.jar"/>
+		</languagedepprops>
+	</script>
+</parcel>
+
+ +Top +
Last Modified: Nov 28 2003 + + Propchange: incubator/ooo/ooo-site/trunk/content/framework/scripting/scriptingf1/developer-guide.html ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/ooo/ooo-site/trunk/content/framework/scripting/scriptingf1/faq.html URL: http://svn.apache.org/viewvc/incubator/ooo/ooo-site/trunk/content/framework/scripting/scriptingf1/faq.html?rev=1206297&view=auto ============================================================================== --- incubator/ooo/ooo-site/trunk/content/framework/scripting/scriptingf1/faq.html (added) +++ incubator/ooo/ooo-site/trunk/content/framework/scripting/scriptingf1/faq.html Fri Nov 25 20:00:55 2011 @@ -0,0 +1,97 @@ + + + + + FAQ + + + + + +

Frequently Asked Questions for the Office +Scripting Framework

+

Questions

+
    +
  1. What is the + OpenOffice.org Scripting Framework? +

    +
  2. Why are you developing the + OpenOffice.org Scripting Framework? +

    +
  3. In what release of + OpenOffice.org will the Scripting Framework be released? +

    +
  4. Why is there a delay + in starting the first script? +

    +
  5. + I have removed the examples scripts provided with my OpenOffice.org + installation and installed my own but the script in ExampleSpreadSheet.sxc + still works. Why? +

    +
+

Answers

+
    + +
  1. What is the OpenOffice.org Scripting Framework? +

    The Scripting Framework is a project to allow users of OpenOffice.org + to write scripts to automate commonly performed tasks in a language + of their choice. +

    Top + +

  2. Why are you developing the OpenOffice.org Scripting Framework? +

    The Scripting Framework is a project to allow users of OpenOffice.org + to write scripts to automate commonly performed tasks in a language + of their choice. +

    There are currently two ways for users and developers to add + functionality to OpenOffice.org, namely macros and UNO components.

    +

    Macros are a set of instructions which OpenOffice.org can interpret + at runtime to carry out a specific set of tasks in OpenOffice.org. Users + can create a macro by recording a number of tasks in OpenOffice.org, + save this set of tasks as a macro and then bind this macro to a menu or + keypress. The macro is run by hitting the bound menu or key. Advanced + users can write their own StarBasic macros in an embedded StarBasic IDE + if they wish.

    +

    UNO components are compiled C++ or Java components, which a + developer can write using the UNO API to access and manipulate + OpenOffice.org. The component is written in an external IDE in C++ or + Java (or any language with a supported UNO bridge). The end user needs + to install any new component in their OpenOffice.org to make use of this + new functionality. UNO component development is supported by the ODK.

    +

    The Scripting Framework aims to strike a balance between these two + approaches of customizing OpenOffice.org. The framework will allow + scripts to be written in a variety of languages, deployed into + OpenOffice.org installations or documents, loaded at runtime and + executed in OpenOffice.org. The framework will allow any number of + different scripting languages to be plugged into OpenOffice.org for + which there is an UNO bridge. Our focus will be to support languages + with a Java implementation, but the framework can be made to work with + any scripting langauge with a supported UNO bridge such as the UNO + Python bridge. In this way users and developers will be able to write +

    Top + +

  3. In what release of OpenOffice.org will the + Scripting Framework be released? +

    The Scripting Framework will be released as part of OpenOffice.org 2.0. In + the meantime completed features will be made available via developer builds. +

    Top + +

  4. Why is there a delay in starting the first script? +

    The delay is caused by the startup of the inprocess JVM by OpenOffice.org. +

    Top + +

  5. I have removed the examples provided with the + Script Framework installation and installed my own but the script in + ExampleSpreadSheet.sxc still works. Why? +

    +

    Both the script and the Key bindings are contained in the document + itself. +

    +

    Top +

    +
+
+

Last Modified: Nov 19 2003 +

+ + Propchange: incubator/ooo/ooo-site/trunk/content/framework/scripting/scriptingf1/faq.html ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/ooo/ooo-site/trunk/content/framework/scripting/scriptingf1/fig1.png URL: http://svn.apache.org/viewvc/incubator/ooo/ooo-site/trunk/content/framework/scripting/scriptingf1/fig1.png?rev=1206297&view=auto ============================================================================== Binary file - no diff available. Propchange: incubator/ooo/ooo-site/trunk/content/framework/scripting/scriptingf1/fig1.png ------------------------------------------------------------------------------ svn:mime-type = image/png Added: incubator/ooo/ooo-site/trunk/content/framework/scripting/scriptingf1/fig2.png URL: http://svn.apache.org/viewvc/incubator/ooo/ooo-site/trunk/content/framework/scripting/scriptingf1/fig2.png?rev=1206297&view=auto ============================================================================== Binary file - no diff available. Propchange: incubator/ooo/ooo-site/trunk/content/framework/scripting/scriptingf1/fig2.png ------------------------------------------------------------------------------ svn:mime-type = image/png Added: incubator/ooo/ooo-site/trunk/content/framework/scripting/scriptingf1/fig3.png URL: http://svn.apache.org/viewvc/incubator/ooo/ooo-site/trunk/content/framework/scripting/scriptingf1/fig3.png?rev=1206297&view=auto ============================================================================== Binary file - no diff available. Propchange: incubator/ooo/ooo-site/trunk/content/framework/scripting/scriptingf1/fig3.png ------------------------------------------------------------------------------ svn:mime-type = image/png Added: incubator/ooo/ooo-site/trunk/content/framework/scripting/scriptingf1/fig4.png URL: http://svn.apache.org/viewvc/incubator/ooo/ooo-site/trunk/content/framework/scripting/scriptingf1/fig4.png?rev=1206297&view=auto ============================================================================== Binary file - no diff available. Propchange: incubator/ooo/ooo-site/trunk/content/framework/scripting/scriptingf1/fig4.png ------------------------------------------------------------------------------ svn:mime-type = image/png Added: incubator/ooo/ooo-site/trunk/content/framework/scripting/scriptingf1/fig5.png URL: http://svn.apache.org/viewvc/incubator/ooo/ooo-site/trunk/content/framework/scripting/scriptingf1/fig5.png?rev=1206297&view=auto ============================================================================== Binary file - no diff available. Propchange: incubator/ooo/ooo-site/trunk/content/framework/scripting/scriptingf1/fig5.png ------------------------------------------------------------------------------ svn:mime-type = image/png Added: incubator/ooo/ooo-site/trunk/content/framework/scripting/scriptingf1/fig6.png URL: http://svn.apache.org/viewvc/incubator/ooo/ooo-site/trunk/content/framework/scripting/scriptingf1/fig6.png?rev=1206297&view=auto ============================================================================== Binary file - no diff available. Propchange: incubator/ooo/ooo-site/trunk/content/framework/scripting/scriptingf1/fig6.png ------------------------------------------------------------------------------ svn:mime-type = image/png Added: incubator/ooo/ooo-site/trunk/content/framework/scripting/scriptingf1/index.html URL: http://svn.apache.org/viewvc/incubator/ooo/ooo-site/trunk/content/framework/scripting/scriptingf1/index.html?rev=1206297&view=auto ============================================================================== --- incubator/ooo/ooo-site/trunk/content/framework/scripting/scriptingf1/index.html (added) +++ incubator/ooo/ooo-site/trunk/content/framework/scripting/scriptingf1/index.html Fri Nov 25 20:00:55 2011 @@ -0,0 +1,193 @@ + + + + + + + +

OpenOffice.org Scripting Framework

+ +

Project Owners: John Rice +, Noel Power + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Documentation for the latest release

+
+

Name

+
+

Description +

+
+

New Features

+
+ The Scripting Framework is now installed with OpenOffice.org. + Basic macros can now be executed as previously or via the + Scripting Framework as well as the other languages supported. + Scripts are listed and can be assigned in the: +
    +
  • Tools/Configure dialog +
  • Basic dialog controls properties editor +
  • Form controls properties editor in documents +
  • Hyperlinks, Graphics and Objects property dialogs +
+
+

Install

+
+

Just install the OpenOffice.org snapshot developer build 680_m15 from here

+
+

Script User Guides

+
+

General User Guide

+
+

Utility Scripts +contributed +by the OpenOffice.org community

+
+

Script Developer Guides

+
+

Writing Scripts in BeanShell, JavaScript and Java

+
+

Developing Scripts in NetBeans

+
+

Developing Scripts on the command line

+
+

Architecture Overview

+
+

Description of Scripting Framework architecture

+
FAQFrequently Asked +Questions for the OpenOffice.org Scripting Framework
+

What's Next

+
+

Planned features for the OpenOffice.org Scripting Framework

+
+

+ + + + + + + + + + + + + + + + + + + + + +
+

Previous Releases +

+
+

Version

+
+

Released

+
+

Early Developer Release Version 0.3

+
+

June 2003

+
+

Early Developer Release +Version 0.2

+
+

April 2003

+
+

Early Developer Release +Version 0.1

+
+

November 2002

+
+

+
+ + + + + + + + + + + +
+

Mailing List

+
+

Installation, User or Developer queries on the OpenOffice.org +Scripting Framework

+
+

Issues

+
+

Issues found in the OpenOffice.org Scripting Framework should be +logged in Issuezilla
+ component: framework
+ subcomponent: scripting

+
+

Last Modified: Nov 19 2003 +

+ + Propchange: incubator/ooo/ooo-site/trunk/content/framework/scripting/scriptingf1/index.html ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/ooo/ooo-site/trunk/content/framework/scripting/scriptingf1/netbeans-devguide.html URL: http://svn.apache.org/viewvc/incubator/ooo/ooo-site/trunk/content/framework/scripting/scriptingf1/netbeans-devguide.html?rev=1206297&view=auto ============================================================================== --- incubator/ooo/ooo-site/trunk/content/framework/scripting/scriptingf1/netbeans-devguide.html (added) +++ incubator/ooo/ooo-site/trunk/content/framework/scripting/scriptingf1/netbeans-devguide.html Fri Nov 25 20:00:55 2011 @@ -0,0 +1,242 @@ + + +Developing Scripts in NetBeans + + + + + + + +

Developing Scripts in NetBeans

+ +This document describes how to set up NetBeans for OpenOffice.org Scripting +and how to write a simple script using NetBeans. You can download +the NetBeans IDE from the +NetBeans download page. + +

Contents:

+ + + + +

Pre-requisites

+ +
    + + +
  • Install the OpenOffice.org Scripting module +To install this module, shutdown NetBeans and copy the office.jar file to +your <NetBeans installation>/modules directory. + +
  • Create a directory somewhere on your machine in which you will develop +your scripts. + +
  • Note: The OpenOffice.org Scripting module has been tested with NetBeans 3.4 +
+ +Now start NetBeans and mount the directory you created using the +File/Mount Filesystem menu option. You also need to mount the following +of the jar files in the <OpenOffice.org installation>/program/classes directory +in order to access the OpenOffice.org API from your scripts: +

+unoil.jar, ridl.jar, sandbox.jar, jurt.jar, juh.jar + +

+Top + +

+ +

Creating a Parcel Recipe

+ +OpenOffice.org scripts are delivered in Script Parcels. Like OpenOffice.org documents they +are zip files. Script Parcels have the .sxp extension. Script Parcels are +generated from Parcel Recipes where all of the files that are necessary +to create the parcel are put together. To create a new Parcel Recipe: + +
    +
  • Right click on your mounted filesystem +
  • Select New/Office Scripting/Parcel Recipe +
  • In the New Wizard window that appears enter a name for your Parcel Recipe +
  • Select a language for your Parcel Recipe from the Initial Script +Language dropdown list. +
  • Click the Finish button to create your Parcel Recipe +
+ +This will create a new directory with the name you chose. In this directory +you will find a Contents directory where all of your files will +be placed. An empty stub file will have been placed in the +Contents directory and can be used as a starting point for your script. + +

+Note: To add further empty stub scripts to your Parcel Recipe, right +click on the Contents directory and use the New/Office Scripting/Empty Script +menu item. + +

+Top + +

+ +

Actions available for Parcel Recipe

+ +If the user right clicks on the parcel directory they should be +able to use the following actions: + +
    +
  • Compile: Compiles all of the .java files in the Parcel Recipe + +
  • Build: Compiles all of the .java files in the Parcel Recipe. +It then searches for valid OpenOffice.org scripts in the language you selected +in the Contents directory files and pops up a dialog +which allows you to select which Java methods or BeanShell scripts +you wish to export as OpenOffice.org scripts. +Once you have finish making your selections, it creates a +<Parcel Recipe Name>.sxp Script Parcel file in the Parcel +Recipe directory. You can configure what files are put into the +Script Parcel using the File Filter property. If you script includes any +jar files that need to be in the classpath when it is executed you should +add them to the Classpath property of your Parcel Recipe. + +
  • Configure: This pops up the Configure dialog, which allows you +to select what OpenOffice.org scripts to export. Any changes you make in +this dialog will only appear in your Script Parcel after you run +Build again. +
+

+Top + +

+ +

Actions available for Script Parcels

+ +Script Parcels supports only one action: + +
    +
  • Deploy: This will deploy the Script Parcel to an OpenOffice.org Document +or to an OpenOffice.org installation. If the Script Parcel already exists +in the target, you will be asked whether you want to overwrite. +
+ +

+Note: If you deploy a Script Parcel to an OpenOffice.org +installation you need to use the Tools/Scripting Add-on's/Refresh All Scripts +menu item for the new script to appear in the Assign Script dialog. + +

+Note: You can also deploy to OpenOffice.org documents within NetBeans +using drag and drop or cut and paste. +

+Top + +

+ +

Actions available for OpenOffice.org Documents

+ +OpenOffice.org Documents are also recognised by NetBeans. Any parcels contained +in the document will be displayed as nodes of the OpenOffice.org document. Deleting +one of these nodes will remove the Script Parcel from the document. You +should ensure that the document is not open in OpenOffice.org before deleting +any parcels it may contain. + +OpenOffice.org documents support the standard Delete, Cut and Copy actions and +the following custom actions: + +
    +
  • Open: This will open the document in OpenOffice.org using the path +in the Office Settings property to find the OpenOffice.org installation. + +

    +If the path to OpenOffice.org is not valid, an error dialog will be popped +up informing the user that they need to set their Path to Office +Installation property. This setting can be changed by bringing +up the Tools/Options dialog and changing +IDE Configuration/Server and External Tool Settings/Office Settings +

+

+Top + +

+ +

Debugging Java OpenOffice.org scripts in NetBeans

+ +
    +
  • Follow the instructions at + +Debugging Java components in NetBeans/Forte for Java +to set up your OpenOffice.org installation to allow debugging of the JVM. + +
  • Start OpenOffice.org and run one of your Java scripts. This will +make sure the JVM is running. + +
  • Attach to OpenOffice.org JVM using the NetBeans Debug/Start Session/Attach... +menu option. + +
  • Load a script source in NetBeans and set up breakpoints using +Debug/New Breakpoint... menu option. + +
  • Run the script in OpenOffice.org. +
+ +

+Note: As the BeanShell scripting language does not support debugging +it is not possible to debug BeanShell OpenOffice.org scripts from NetBeans. You +can however use the Interactive BeanShell scripting menu item under the Tools +menu in OpenOffice.org to test BeanShell code. Just enter any BeanShell code +and hit the Eval button to execute it. +

+Top + +

+ +

Troubleshooting

+ +
    +
  • If you encounter problems when developing or deploying scripts in +NetBeans, one thing you can try is to move your NetBeans settings directory +(.netbeans on UNIX, netbeans in Windows - can be found in your home +directory) to another name and restart NetBeans. + +

  • The Choose What to Export as Scripts dialog only displays +methods which are defined within class files, it will not display +methods in class files which are within jar files in the Parcel Recipe. + +

  • If you include package directives in the Java source files of your +Parcel Recipe, you should ensure that the source files are in the appropriate +directories for your package directives. This is because the +default NetBeans compiler implementation does not use the -d switch to the +Java compiler. As a result class files do not get placed in the appropriate +directories and methods in these classes will not appear in the +Choose What to Export as Scripts dialog. + +

    +There are a couple of workarounds for this problem: + +

    +

      +
    1. Use the command line tools +
    2. Set the Target flag in the Tools/Options window under +Building/Compiler Types/Internal Compilation +
    +
+ +

+Top + +


+Last Modified: Nov 19 2003 + + Propchange: incubator/ooo/ooo-site/trunk/content/framework/scripting/scriptingf1/netbeans-devguide.html ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/ooo/ooo-site/trunk/content/framework/scripting/scriptingf1/office.jar URL: http://svn.apache.org/viewvc/incubator/ooo/ooo-site/trunk/content/framework/scripting/scriptingf1/office.jar?rev=1206297&view=auto ============================================================================== Binary file - no diff available. Propchange: incubator/ooo/ooo-site/trunk/content/framework/scripting/scriptingf1/office.jar ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: incubator/ooo/ooo-site/trunk/content/framework/scripting/scriptingf1/rhino.gif URL: http://svn.apache.org/viewvc/incubator/ooo/ooo-site/trunk/content/framework/scripting/scriptingf1/rhino.gif?rev=1206297&view=auto ============================================================================== Binary file - no diff available. Propchange: incubator/ooo/ooo-site/trunk/content/framework/scripting/scriptingf1/rhino.gif ------------------------------------------------------------------------------ svn:mime-type = image/gif Added: incubator/ooo/ooo-site/trunk/content/framework/scripting/scriptingf1/user-guide.html URL: http://svn.apache.org/viewvc/incubator/ooo/ooo-site/trunk/content/framework/scripting/scriptingf1/user-guide.html?rev=1206297&view=auto ============================================================================== --- incubator/ooo/ooo-site/trunk/content/framework/scripting/scriptingf1/user-guide.html (added) +++ incubator/ooo/ooo-site/trunk/content/framework/scripting/scriptingf1/user-guide.html Fri Nov 25 20:00:55 2011 @@ -0,0 +1,478 @@ + + + + + + + + + + +

User Guide for the OpenOffice.org Scripting +Framework

+

Contents

+ +

Pre-requisites

+

Before you install the Scripting Framework, be aware of the +following:

+
    +
  • +

    This is an Early Developer Release +of the OpenOffice.org Scripting Framework provided for users and +developers of +OpenOffice.org to try out and provide feedback. Future releases of the +Framework may change.

    +
  • +
  • +

    The Scripting Framework is currently available in English only.

    +
  • +
+

Configuring display +of OpenOffice.org scripts

+

As the Scripting Framework project is still in development, display +of OpenOffice.org scripts is switched off by default in your OpenOffice.org +installation. To enable the Scripting Framework download one of the following UNO packages:
+

+
    +
  • EnableSF.zip simply enables the display of +Scripting Framework scripts +in parallel with the existing method for listing Basic macros. Note that the +Basic macros will also be listed under the Scripting Framework scripts.
  • +
  • EnableSF2.zip simply enables the display of Scripting Framework scripts +instead of the existing method for listing Basic macros.
  • +
+The UNO package is then installed using the pkgchk executable found in the OpenOffice.org program directory.
+pkgchk EnableSF.zip +

Assigning OpenOffice.org Scripts

+

The execution of OpenOffice.org scripts can be assigned to menu and +key items +and also to application, document, object and dialog events.
+

+

To assign a script to a new menu item:
+

+
    +
  1. Select the Tools/Configure menu item, and go to the Menu tab.
  2. +
  3. In the Category section of the Menu tab, scroll to the bottom of +the list and expand the item OpenOffice.org Scripts
  4. +
  5. You should see entries for share (scripts in the share directory +of your OpenOffice.org installation), user (scripts in the user +directory of your OpenOffice.org installation), and the current +document. Expand one of these entries to see the languages for which +scripts are available
  6. +
  7. Under the language entries you will see entries for script that +are available. Select one of these entries.
  8. +
  9. A list of the script functions available for assignment will +appear in the Function list. Select one of the functions.
  10. +
  11. Now click the New button to create a new menu assignment. The new +menu item will appear in the Menu Entries section of the tab. You can +rename the new menu item by clicking on it.
  12. +
+To assign a script to a key combination:
+
    +
  1. Select the Tools/Configure menu item, and go to the Keyboard tab.
  2. +
  3. To select an OpenOffice.org script to assign, follow steps +2 to 5 for creating menu  items.
    +
  4. +
  5. Now select a key combination from the Shortcut Keys section and +click the Modify button to create a new menu assignment.
  6. +
+To assign a script to an event:
+
    +
  1. Select the Tools/Configure menu item, and go to the Events tab.
  2. +
  3. To select an OpenOffice.org script, follow steps 2 to 5 for +creating menu items.
    +
  4. +
  5. Now select an event from the list and click the Assign button to +assign the selected script to the selected event.
  6. +
+To assign a script to an event for an embedded Object (eg. a chart):
+ +
    +
  1. Select the embedded Object in your document and then select the +Format/Object... menu item.
  2. +
  3. In the Object dialog that appears select the Macro tab.
  4. +
  5. You should be able to select an OpenOffice.org script and assign +it to an Object event as in the assign script to event steps above.
  6. +
+To assign a script to a Hyperlink:
+
    +
  1. Select the Insert/Hyperlink menu item.
  2. +
  3. In the Hyperlink dialog clicking on the Events button will allow +you to assign an OpenOffice.org script to a hyperlink event.
  4. +
+To assign a script to a Graphic:
+
    +
  1. Select the Format/Graphics... menu item.
  2. +
  3. In the Graphics dialog you can assign an OpenOffice.org script to +an event in the Macro tab.
  4. +
+To assign a script to a Form control:
+
    +
  1. Insert a Form control (eg. a button) into your document by +clicking on the form functions button on the left hand toolbar, +selecting a control and then selecting an area in your document to +create the control.
  2. +
  3. Select the control and then select the Format/Control... menu +item to bring up a Properties dialog for the control.
  4. +
  5. Select the Events tab of the Properties dialog and click on one +of the buttons labelled "..." beside the event to which you want to +assign an OpenOffice.org script.
  6. +
  7. An Assign Macro dialog will pop up in which you can select an +OpenOffice.org script and assign it to the selected event.
    +
  8. +
+To assign a script to a control in an OpenOffice.org Basic dialog:
+
    +
  1. Open the OpenOffice.org Basic dialog editor and create a dialog +with a control on it (eg. a button)
  2. +
  3. Right click on the control and select Properties... on the popup +menu.
    +
  4. +
  5. Select the Events tab of the Properties dialog and click on one +of the buttons labelled "..." beside the event to which you want to +assign an OpenOffice.org script.
  6. +
  7. An Assign Macro dialog will pop up in which you can select an +OpenOffice.org script and assign it to the selected event.
    +
  8. +
+

Running the example OpenOffice.org Scripts

+

There are three example scripts supplied with the Scripting +Framework, Highlight, MemoryUsage, and ExportSheetsToHTML.
+

+

Highlight is a BeanShell application level +script for Writer that allows the user to search for a word or phrase. +It will highlight all instances in red and give a count of the number +of +instances.

+

The second example, MemoryUsage, is a Java script stored in a Calc +spreadsheet that checks the current memory usage in the Java Virtual +Machine and updates cells in the spreadsheet with the usage values. The +spreadsheet also contains a graph which will update when the cell +values +are changed.

+

The ExportSheetsToHTML example is a JavaScript application level +script for Calc which will save each individual sheet in a Calc +spreadsheet as a separate html file.

+

Running the Highlight example

+

To run this example you first need to create a menu item from which +you can execute the script.

+
    +
  • +

    Start OpenOffice.org and open an +existing Writer document or create a new one.

    +
  • +
  • +

    Follow the steps for creating a menu +item in the Assigning OpenOffice.org Scripts section. The Highlight +example is available at OpenOffice.org Scripts/share/BeanShell/Highlight
    +

    +
  • +
  • +

    Your new menu item will now be +available and clicking on it will invoke the script.

    +
  • +
  • +

    You should see a Highlight Text dialog appear which you can use +to highlight various text strings you are looking for in the document.

    +
  • +
+

Running the MemoryUsage example

+

The Java version of the MemoryUsage example is already deployed +inside an OpenOffice.org document, ExampleSpreadSheet.sxc. To run the +Java +example, just open:

+

<OpenOffice.org +Installation>/user/Scripts/java/ExampleSpreadSheet.sxc.

+

You can then execute the MemoryUsage script by pressing CTRL+Shift+M +with the ExampleSpreadSheet.sxc window focused. You should see the +memory usage values being updated, and the graph should change to +reflect the new values. You can also find the MemoryUsage example under +OpenOffice.org Scripts/share/Java/MemoryUsage in the Tools/Configure +dialog.
+

+

Running the ExportSheetsToHTML +example
+

+

To run this example you first need to create or open an existing +spreadsheet document. If you have created a new document save it (eg. +c:\temp\mycalcdoc.sxc)
+

+

Follow the instructions in the Assigning OpenOffice.org Scripts +section to create a key assignment for the script. You can find the +ExportSheetsToHTML example at +OpenOffice.org Scripts/share/JavaScript/ExportSheetsToHTML.

+
    +
+This will have created a key binding to the ExportSheetsToHTML script. +Pressing your key binding will now save each sheet in HTML format in +the +same +directory as the original document (eg. c:\temp\mycalcdoc_sheet1.html, +c:\temp\mycalcdoc_sheet2.html, ...)
+

Top

+

OpenOffice.org Security

+

The Scripting Framework currently uses +the same +Security +settings as OpenOffice.org Basic.  The settings allow the user to +control +the +execution of macros present in OpenOffice.org documents. Found in  +the  Tools->Options dialog under  +OpenOffice.org->Security, these  settings allow the user  +to specify the conditions under which it is permissable to execute +document based OpenOffice.org Basic macros and OpenOffice.org scripts.

+

A full description of how these settings +work can be found by clicking +the "Help" button in the dialog, and then clicking "OpenOffice.org", +and +"Security" in the left-hand pane of the Help dialog. The possible +scenarios associated with the security settings are summarised in the +table below.
+
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

"Run Macro"

+
+

"Confirm in the case of other document sources"

+
+

"Show Warning before Running"

+
+

Document path in "Path List"

+
+

Behaviour

+
+

Never

+
+

N/A

+
+

N/A

+
+

N/A

+
+

Macros/Scripts never run. No warning displayed.

+
+

According to path list

+
+

No

+
+

No

+
+

No

+
+

Macros/Scripts never run. No warning displayed.

+
+

According to path list

+
+

No

+
+

No

+
+

Yes

+
+

Macros/Scripts run. No warning displayed.

+
+

According to path list

+
+

No

+
+

Yes

+
+

No

+
+

Macros/Scripts never run. No warning displayed.

+
+

According to path list

+
+

No

+
+

Yes

+
+

Yes

+
+

Warning displayed on document load. If "Run" button clicked +macros will run, otherwise they will not.

+
+

According to path list

+
+

Yes

+
+

No

+
+

No

+
+

Warning with checkbox to add path to path list is displayed on +document load. If "Run" button clicked macros/scripts will run, +otherwise +they will not. Regardless of which button is clicked, if checkbox is +ticked document path is added to "Path List".

+
+

According to path list

+
+

Yes

+
+

No

+
+

Yes

+
+

Macros/Scripts run. No warning displayed.

+
+

According to path list

+
+

Yes

+
+

Yes

+
+

No

+
+

Warning with checkbox to add path to path list is displayed on +document load. If "Run" button clicked macros/scripts will run, +otherwise +they will not. Regardless of which button is clicked, if checkbox is +ticked document path is added to "Path List".

+
+

According to path list

+
+

Yes

+
+

Yes

+
+

Yes

+
+

Warning displayed on document load. If "Run" button clicked +macros/scripts will run, otherwise they will not.

+
+

Always

+
+

N/A

+
+

No

+
+

N/A

+
+

Macros/Scripts run. No warning displayed.

+
+

Always

+
+

N/A

+
+

Yes

+
+

N/A

+
+

Warning displayed on document load. If "Run" button clicked +macros/scripts will run, otherwise they will not

+
+


+Top

+
Last Modified: Nov 19 2003 + + Propchange: incubator/ooo/ooo-site/trunk/content/framework/scripting/scriptingf1/user-guide.html ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/ooo/ooo-site/trunk/content/framework/scripting/scriptingf1/whats-next.html URL: http://svn.apache.org/viewvc/incubator/ooo/ooo-site/trunk/content/framework/scripting/scriptingf1/whats-next.html?rev=1206297&view=auto ============================================================================== --- incubator/ooo/ooo-site/trunk/content/framework/scripting/scriptingf1/whats-next.html (added) +++ incubator/ooo/ooo-site/trunk/content/framework/scripting/scriptingf1/whats-next.html Fri Nov 25 20:00:55 2011 @@ -0,0 +1,58 @@ + + + + + What's Next + + + + + +

Planned Features for the OpenOffice.org Scripting Framework

+ +

Redesign of the Tools/Configure dialog

+

+The current Tools/Configure dialog is not very usable. A + +specification is being completed for the complete redesign of this dialog. + +

ScriptProviderForPython

+

+Joerg Budischewski has provided UNO bindings for Python and has done some +work on making a ScriptRuntime available for a previous version of the +Scripting Framework. This ScriptRuntime needs to be updated to support the +new Scripting Framework architecture so users can create OpenOffice.org +scripts in Python. + +

Make OpenOffice.org dialogs available to all scripting languages

+

+Currently dialogs created by the OpenOffice.org Basic dialog editor +can only be instantiated using the Basic CreateUNODialog function. In the +next milestone it should be possible to instantiate these dialogs from other +languages.

+ +

Digital Signing Support

+

+The intention is to use digital signing of script parcels to give +a higher degree of security for OpenOffice.org users of these new +language scripts. The Scripting Framework will be enhanced to verify +the digital signatures of scripts before they are executed. +Appropriate configuration settings could be added so users can +control script execution.

+ +

Common Packaging Format

+

+We will move to a common packaging format for UNO components, OpenOffice.org +scripts, and OpenOffice.org Basic macros. +

+ +

???

+

+All suggestions for further features welcome on dev@framework.openoffice.org +or in IssueZilla under category framework, subcategory scripting. +

+
+

Last Modified: Nov 28 2003 +

+ + Propchange: incubator/ooo/ooo-site/trunk/content/framework/scripting/scriptingf1/whats-next.html ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/ooo/ooo-site/trunk/content/framework/scripting/testindex.html URL: http://svn.apache.org/viewvc/incubator/ooo/ooo-site/trunk/content/framework/scripting/testindex.html?rev=1206297&view=auto ============================================================================== --- incubator/ooo/ooo-site/trunk/content/framework/scripting/testindex.html (added) +++ incubator/ooo/ooo-site/trunk/content/framework/scripting/testindex.html Fri Nov 25 20:00:55 2011 @@ -0,0 +1,193 @@ + + + + + + + +

OpenOffice.org Scripting Framework

+ +

Project Owners: John Rice +, Noel Power + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Documentation for the latest release

+
+

Name

+
+

Description +

+
+

New Features

+
+ The Scripting Framework is now installed with OpenOffice.org. + Basic macros can now be executed as previously or via the + Scripting Framework as well as the other languages supported. + Scripts are listed and can be assigned in the: +
    +
  • Tools/Configure dialog +
  • Basic dialog controls properties editor +
  • Form controls properties editor in documents +
  • Hyperlinks, Graphics and Objects property dialogs +
+
+

Install

+
+

Just install the OpenOffice.org snapshot developer build 680_m15 from here

+
+

Script User Guides

+
+

General User Guide

+
+

Utility Scripts +contributed +by the OpenOffice.org community

+
+

Script Developer Guides

+
+

Writing Scripts in BeanShell, JavaScript and Java

+
+

Developing Scripts in NetBeans

+
+

Developing Scripts on the command line

+
+

Architecture Overview

+
+

Description of Scripting Framework architecture

+
FAQFrequently Asked +Questions for the OpenOffice.org Scripting Framework
+

What's Next

+
+

Planned features for the OpenOffice.org Scripting Framework

+
+

+ + + + + + + + + + + + + + + + + + + + + +
+

Previous Releases +

+
+

Version

+
+

Released

+
+

Early Developer Release Version 0.3

+
+

June 2003

+
+

Early Developer Release +Version 0.2

+
+

April 2003

+
+

Early Developer Release +Version 0.1

+
+

November 2002

+
+

+
+ + + + + + + + + + + +
+

Mailing List

+
+

Installation, User or Developer queries on the OpenOffice.org +Scripting Framework

+
+

Issues

+
+

Issues found in the OpenOffice.org Scripting Framework should be +logged in Issuezilla
+ component: framework
+ subcomponent: scripting

+
+

Last Modified: Nov 19 2003 +

+ + Propchange: incubator/ooo/ooo-site/trunk/content/framework/scripting/testindex.html ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/ooo/ooo-site/trunk/content/framework/scripting/utilities-download.html URL: http://svn.apache.org/viewvc/incubator/ooo/ooo-site/trunk/content/framework/scripting/utilities-download.html?rev=1206297&view=auto ============================================================================== --- incubator/ooo/ooo-site/trunk/content/framework/scripting/utilities-download.html (added) +++ incubator/ooo/ooo-site/trunk/content/framework/scripting/utilities-download.html Fri Nov 25 20:00:55 2011 @@ -0,0 +1,236 @@ + + + + Scripts contributed by the OpenOffice.org community + + + + + +

Utility Scripts contributed by the OpenOffice.org community

+This page contains downloads of utility scripts that have been +contributed by the OpenOffice.org community. These scripts are intended +to demonstrate how to write Java (or the dynamically-typed Beanshell) +scripts for OpenOffice, with full access to both the OpenOffice.org API +and the Java APIs. The scripts are for use with the Early Developer +Release 0.3 of the Office Scripting Framework and all subsequent +releases. +

Pre-requisites

+
    +
  • OpenOffice.org 1.1beta2 or above installed with the Scripting +Framework Early Developer release 0.3. If you have not already done this +then see the installation guide.
  • +
+

General Installation Procedure

+
    +
  • The scripts are made available for download as Zip files. To +install the scripts, simply unzip them in either the +<OfficeInstallation>/user or <OfficeInstallation>/share +directories.
  • +
  • The scripts are then available to be bound to the key or menu of +your choice using the Assign dialogs.
    +
  • +
  • If the scripts require any additional pre-requisites, +installation steps or subsequent modification this will be documented +below.
  • +
  • If you wish to deploy these scripts into a document you will need +to create a new parcel recipe and copy the sources from the zip files +below. See the Developer +Guide for Netbeans for more information.
    +
  • +
+

Available Scripts

+ +

Word Count

+Author: Duncan Foster
+Aim: Provides a simple word count of the selected text.
+Language: BeanShell
+Pre-requisites: none
+Download:  WordCount.zip +(2Kb)
+Installation: no additional steps needed
+Description: Uses the OpenOffice API to get the selected text, +and then uses Java's StringTokenizer (using the default delimiters) to +obtain a word count. Displays the result in a simple Swing dialog.
+Issues: none
+
+Top
+

Capitalisation

+Author: Duncan Foster
+Aim: Converts the selected text from upper case to first letter +upper case, rest lower case, to lower case.
+Language: BeanShell
+Pre-requisites: none
+Download:  Capitalise.zip +(2Kb)
+Installation: no additional steps needed
+Description: Uses the OpenOffice API to get the selected text (or +makes a selection of the current word if no text selected), and then +uses Java to change the case. Rotates from "THIS" -> "This" -> +"this" -> "THIS". The script attempts to break up selected text into +sentences using the Java StringTokenizer. The script also attempts to +maintain the selection.
+Issues: The script fails to maintain the selection if two +separate areas of text are selected. For example, if the first and last +words of the previous sentence were selected, only one (undefined) would +remain selected after the script has been run.
+Top
+

Post to Newsgroups

+Author: Neil Montgomery
+Aim: Facilitates the posting of an OpenOffice document to a +newsgroup.
+Language: Java
+Pre-requisites: none
+Download: Newsgroup.zip +(540Kb)
+Installation: no additional steps needed
+Description:  The script will detect if a local +installation of either Netscape or Mozilla has been used to subscribe to +any newsgroups. These newsgroups will be listed for the user in a combo +box. If no newsgroups are detected the user must supply the name of the +newgroup and server. The user may also supply the reply-to address, +subject and message body (in the comment text field). The user can also +specify the format in which to send the attached document (the currently +active document). If the document hasn't already been saved with a +title, then the default name for the attachment(s) will be +"Attachment.sxw" and/or "Attachment.html".
+Issues: none.
+Top
+

Scripting Framework +Issuezilla Query -> Writer

+Author: John Rice
+Aim: Outputs the results of an Issuezilla query into the open +Writer document.
+Language: BeanShell
+Pre-requisites: none
+Download: SFBugsQueryIssuezilla.zip +(2Kb)
+Installation: The script sets a HTTP proxy on lines 43,44. The +user will need to modify or remove these according to their local +settings. The script also contains a certain amount of debug output +which the user may want to remove.
+Description:  The script uses Java to open a HTTP +connection to the OpenOffice.org website, passing a URL for an +Issuezilla query for Scripting Framework bugs. The script then writes +summary information for each bug into the open Writer document.
+Issues: none.
+Top
+

Scripting Framework Issuezilla +Query -> Calc

+Author: John Rice
+Aim: Outputs the results of an Issuezilla query into the open +Calc document.
+Language: BeanShell
+Pre-requisites: none
+Download: SFBugsQueryIssuezillaCalc.zip +(2Kb)
+Installation: The script sets a HTTP proxy on lines 25,26. The +user will need to modify or remove these according to their local +settings.
+Description:  The script uses Java to open a HTTP +connection to the OpenOffice.org website, passing a URL for an +Issuezilla query for Scripting Framework bugs. The script then writes +summary information for each bug into the open Calc document.
+Issues: none.
+Top
+

Insert Copyright Symbol

+ Author: Duncan Foster
+ Aim: Inserts a copyright symbol +(or replaces the current selection with a copyright symbol).
+ Language: Beanshell
+ Pre-requisites: none
+ Download: InsertC.zip +(4Kb)
+ Installation: No additional +steps needed.
+ Description: Inserts a copyright +symbol (or replaces the current selection with a copyright symbol).
+ Issues: None.
+Top
+

Insert Trademark Symbol

+ Author: Duncan Foster
+ Aim: Inserts a trademark symbol +(or replaces the current selection with a trademark symbol).
+ Language: Beanshell
+ Pre-requisites: none
+ Download: InsertTM.zip +(4Kb)
+ Installation: No additional +steps needed.
+ Description: Inserts a trademark +symbol (or replaces the current selection with a trademark symbol).
+ Issues: None.
+Top
+

Insert Hidden Text
+

+ Author: Duncan Foster
+ Aim: Inserts a hidden text field
+ Language: Beanshell
+ Pre-requisites: none
+ Download: InsertHiddenText.zip +(4Kb)
+ Installation: No additional +steps needed.
+ Description: Replaces the +currently selected text with a hidden text field with the same contents.
+ Issues: None.
+Top
+

Export To HTML
+

+ Author: John Rice
+ Aim: Saves a copy of the +document in HTML format.
+ Language: Beanshell
+ Pre-requisites: none
+ Download: ExportToHTML.zip +(4Kb)
+ Installation: No additional +steps needed.
+ Description: Saves a copy of the +document in the user's home directory in HTML format. Does not change +the type of the current document (as happens with "Save As").
+ Issues: None.
+Top
+

Combined Utilities

+Aim: A zip file containing all +of the scripts above.
+Download: all.zip +(550Kb)
+
+Top
+
+
Last Modified: +Fri Jun 20 15:28:18 BST 2003 + + Propchange: incubator/ooo/ooo-site/trunk/content/framework/scripting/utilities-download.html ------------------------------------------------------------------------------ svn:eol-style = native