Language Independent Scripting FrameworkDesign Document - Last update: 16th August 2002This document should only be read after having read the Architecture Document . This document contains:
Class & Object Interaction DiagramsBinding Object Class Diagram(source ). Binding Object Interaction Diagram( source ). Script Invocation Interaction Diagram( source ). Script Invocation Class Diagram( source ). Binding storage sequence diagramsActions available on Bindings( source ).XBinding represents a binding, this is an event (string) and script (string) pair. XBindingStore is the interface for access the binding storage of a certain document or the application. It provides store, remove and query functionality of binding objects implementing the XBinding interface. Query available on Bindings(source ). OpenOffice - IDE Integration Interaction DiagramsEditing a script in an IDE(source ) Context:
Debugging a script in an IDE(source ) This diagram describes how OpenOffice and the IDE interact to facilitate debugging. When the user starts up the IDE the debugging connection (e.g. debugger from IDE attaching to the OpenOffice JVM) should be established. This is the time to check whether individual runtimes or OpenOffice have to be restarted in order to facilitate debugging from the IDE. The dialog protocol is this:
Debugging a script exception in an IDE(source ) Exception handling is a variation of the code editing and debug enabling diagrams. The diagram describes the dialog between OpenOffice and the IDE when the IDE has not been started yet so the attachment to the OpenOffice JVM from the IDE has to be done. The dialog is the following:
Proposed file structure for scriptingThe file structure for the application and the document will be the same, the only difference is the structure for the document will stored in the document zip file. The file structure is as followsscripting/under the language specific folder each script parcel has a separate folder. The file and folder structure in a script parcel is arbitrary, it depends on how the developer organizes files and folders of the parcel. A registry file exists at the script level in the directory structure that identifies the scripts that are installed (in either the document or application) or other metadata associated with the script. Language-Specific & Logical Script namesGeneric script name:script://<sname>/[<qtype>['?'<query>]] ; name of a script functionality sname =: <name> ; query type qtype =: <name> ; query query =: <qelm>(','<qelm>)* ; query element qelm =: <word>'='<name> Language specific script name: script:///<lname>'?'<lpart> ; language runtime name lname =: <name> ; language specific portion of name lpart =: sequence of any printable characters name =: <word>('.'<word>)* word =: <alpha>(['-'|'_'](<alpha>|<digit>))* alpha =: an alphabetical character as in rfc2396-1.6 digit =: a digit character as in rfc2396-1.6 Deployment DTD<?xml version="1.0" encoding="UTF-8"?><!ELEMENT script (logicalname, languagename, dependencies, description?, delivery)> <!ELEMENT bundle (script+)> <!ELEMENT logicalname EMPTY> <!ELEMENT languagename EMPTY> <!ELEMENT dependencies (dependfile+)> <!ELEMENT description (#PCDATA)> <!ELEMENT delivery (deliverfile+)> <!ELEMENT deliverfile EMPTY> <!ELEMENT dependfile EMPTY> <!ATTLIST script language CDATA #REQUIRED deploymentdir CDATA #REQUIRED > <!ATTLIST logicalname value CDATA #REQUIRED > <!ATTLIST languagename value CDATA #REQUIRED location CDATA #REQUIRED > <!ATTLIST dependfile name CDATA #REQUIRED isdeliverable (yes | no) #REQUIRED > <!ATTLIST deliverfile name CDATA #REQUIRED type (binary | data | source | resource) #REQUIRED > Sample deployment XML<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE bundle SYSTEM "deployment.dtd"> <bundle> <script language="Java" deploymentdir="calc.convert.EuroConvert"> <logicalname value="calc.convert.EuroConvert"/> <languagename value="com.sun.star.calc.EuroConvert" location="convert.jar"/> <dependencies> <dependfile name="data/currenices.txt" isdeliverable="yes"/> </dependencies> <delivery> <deliverfile name="convert.jar" type="binary"/> <deliverfile name="currencies.txt" type="resource"/> </delivery> </script> </bundle> DTD for Script Registry<?xml version="1.0" encoding="UTF-8"?><!ELEMENT script (logicalname, languagename, description, properties, dependencies)> <!ELEMENT logicalname EMPTY> <!ELEMENT languagename EMPTY> <!ELEMENT description (#PCDATA)> <!ELEMENT properties (#PCDATA)> <!ELEMENT dependencies (file)> <!ELEMENT file EMPTY> <!ATTLIST script language CDATA #REQUIRED rootdir CDATA #REQUIRED > <!ATTLIST logicalname value CDATA #REQUIRED > <!ATTLIST languagename value CDATA #REQUIRED location CDATA #REQUIRED > <!ATTLIST file name CDATA #REQUIRED > Sample XML for Script Registry<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE script SYSTEM "registry.dtd"> <script language="Java" rootdir="calc.convert.EuroConvert"> <logicalname value="calc.convert.EuroConvert"/> <languagename value="com.sun.star.calc.EuroConvert" location="convert.jar"/> <description>A Euro Converter</description> <properties>Other properties</properties> <dependencies> <file name="data/currencies.txt"/> </dependencies> </script> Deployment InterfacesXParcel Interface access to a parcel file hierarchy by retrieving the hierarchy and adding/removing content (using w3c standard urls with wildcards in them to add/remove a number of files/folders). The parcel name can also be retrieved. The interface XParcel is implemented by the Parcel service.XParcelStore provides access to parcels installed into a document or the application context. Complete parcel packages (archived as zip) can be installed. Parcels can be created (to fill with content through the XParcel interface) and parcels can be removed. A list of all the installed parcels can also be obtained. Script storage interfacesThe toplevel storage service is ScriptingStorage. Every document and the application has one ScriptingStorage component that provides access to the scripts stored in that context. ScriptingStorage implements several interfaces:
IDL FilesThe following are the proposed interfaces. In some cases, these are just placeholders and need further work.CannotResolveScriptNameException.idl
|