[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Proposal regarding Scripting and document specific settings
Hi all, I would like to make a few proposals regarding scripting and document specific setings: A) The current event specification <script:event> contains an event name ("script:event-name") that can take a value like "on-click", a script language ("script:language"), a libary name ("script:library") and a macro name ("script:macro-name"). The schema also has an attribute "script:location" that can take the values "document" and "application", but is unfortunately not described in the specification itself. With the exception of the "script:event-name" attribute (and maybe the "script:language"), all attributes seem to contain very application specific values that only can be interpreted when knowing the scripting model in place. It might also be the case that these attributes might not be appropriate for some scripting models that are diffent than OpenOffice.org's where the above attributes obviously have their roots. Making assumption about the scripting model however seems to be outside the scope of the Open Office XML specification. For this reason, I would like to propose to replace these attributes with a generic xlink:href attribute that can take arbitrary URLs to reference scripts. What looks as follows in the OOo specification <script:event script:language="StarBasic" script:event-name="on-click" script:macro-name="Standard.Module1.Main" script:location="application"/> would turn into <script:event script:event-name="on-click" xlink:type="simple" xlink:href="vnd.sun.star.script://Standard.Module1.Main?language=StarBasic&location=application"> B) Additionally, we might replace the plain string value for the event names with namespaced names. This would be similar to the specification for form control and chart types (see http://lists.oasis-open.org/archives/office/200308/msg00015.html), and it might allow to include event names from other specifications, like DOM or HTML. The above example could become: <script:event xmlns:xhtml="http://www.w3.org/..." script:event-name="xhtml:onclick" xlink:type="simple" xlink:href="vnd.sun.star.script://Standard.Module1.Main?language=StarBasic&location=application"> C) The current specification allows scripts to be included in the document by using the <office:script> element. The content of this element are script:library-embedded> and <script:library-linked> elements. The first one contains <script:module> elements that again contain script code as plain text. The second one contains a link to external script code. This specification seems to be very much related to OpenOffice.org's scripting model as well. For this reason, I would like to propose to replace the <office:script> element with an <office:scripts> element that can contain a new <office:script> element. This element has no attributes an can contain any (application specific) content. As an alternative, we might specify that the <office:scripts> element might already contain any content, so that <office:script> isn't required at all. For files stored in packages we might recommend to store scripts in separate package streams, so that open office XML and other schemes are not mixed. That's in fact something the OpenOffice.org application does already. Example: <office:scripts> <office:script> <!-- Everything contained in this element is application --> <!-- specific and not part of the Open Office schema --> <ooo:library xmlns:ooo="http://www.openoffice.org/..."> <ooo:module ooo:name="Module 1"> sub main print "hello world" end main </ooo:module> </ooo:library> </office:script> </office:scripts> D) Applications specific settings are currently contained in the <office:settings> element. The element's content are <config:config-item-set> elements, where each of these element contains a certain class of settings. In OpenOffice.org for instance there is one class of settings that influence the document itself, for instance information about the printer in use, and a second class for settings that only influence the view of the document, like the zoom level. The classes are differed by its name that is stored the the "config:name" attribute of <config:config-item-set>. The name currently is a plain string. To avoid name clashes with configuations saved by different applications, I would like to propose to turn this name into a namespaced name as well. Example: <office:settings> <!--- the "ooo:" in config:name is the only change --> <config:config-item-set xmlns:ooo="http://www.openoffice.org/..." config:name="ooo:view-settings"> <config:config-item config:name="ViewAreaTop" config:type="int">0</config:config-item> </config:config-item-set> </office:settings> Best regards Michael
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]