Sie sind auf Seite 1von 82

WIRTSCHAFTSUNIVERSITT WIEN BAKKALAUREATSARBEIT

Titel der Bakkalaureatsarbeit: Automatische Erstellung von Orientierungshilfen fr PrsentorInnen in OpenOffice.org Impress En lis!"er Titel der Bakkalaureatsarbeit: Automated Creation of Guideposts & Hints for Presenters in OpenOffice.org Impress Ver#asser: $atrikel%Nr&: Studienri!"tun : Kurs: Te'ts(ra!"e: Betreuerin)Betreuer:

omini! Gundac!er "#$%&%$ '"(( $)& *a!!alaureat +irtschaftsinformati! %$)& ,ertiefungs!urs ,I - *a!!alaureatsar.eit Electronic Commerce Englisch ao. /niv. Prof. r. 0on1 G. 2latscher

Ich versichere3 dass ich die *a!!alaureatsar.eit sel.ststndig verfasst4 andere als die angege.enen 5uellen und Hilfsmittel nicht .enut6t und mich auch sonst !einer unerlau.ten Hilfe .edient ha.e. dass ich die Ausar.eitung 6u dem o.igen 7hema .isher 8eder im In9 noch im Ausland :einer *eurteilerin- einem *eurteiler 6ur *egutachtung; in irgendeiner 2orm als Prfungsar.eit vorgelegt ha.e. dass diese Ar.eit mit der vom *etreuer .eurteilten Ar.eit .ereinstimmt.

atum

/nterschrift

Page )

Table *# C*ntents
% Introduction...................................................................................................................& %.% A.stract..................................................................................................................& %.) 0esearch 5uestion................................................................................................& %.( <e18ords...............................................................................................................& ) General Part..................................................................................................................= ).% Open O.>ect 0e??.................................................................................................= ).%.% Histor1............................................................................................................= ).%.) 0e??@A...........................................................................................................A ).%.( Overvie8.........................................................................................................A ).%.# B1nta?.............................................................................................................C ).) OpenOffice.org....................................................................................................%( ).).% Histor1..........................................................................................................%( ).).) Overvie8.......................................................................................................%( ).).( Architecture..................................................................................................%# ).).# Bervices & Interfaces...................................................................................%& ).( *ean Bcripting 2rame8or! for 0e??....................................................................%C ).(.% *ean Bcripting 2rame8or!...........................................................................%C ).(.) *B2#0e??....................................................................................................)" ).(.( *B2.C@B.......................................................................................................)) ).(.# /DO.C@B......................................................................................................)( ).(.$ 0outines.......................................................................................................)# ).# Bummar1.............................................................................................................)$ ( Installation Guide........................................................................................................)& (.% Installation 'ava...................................................................................................)& (.) Installation OpenOffice.org..................................................................................)= (.( Installation Open O.>ect 0e??.............................................................................)= (.# Installation *B2#0e??.........................................................................................)A # Impress Automation...................................................................................................() #.% General................................................................................................................() #.) Introduction E?ample...........................................................................................(# #.( E?amples.............................................................................................................#" #.(.% E?ample"%...................................................................................................#%

Page ( #.(.) E?ample")...................................................................................................#$ #.(.( E?ample"(...................................................................................................#C #.(.# E?ample"#...................................................................................................$# #.(.$ E?ample"$...................................................................................................$= #.(.& E?ample"&...................................................................................................&% #.(.= E?ample"=...................................................................................................&& #.(.A E?ample"A...................................................................................................=% #.(.C E?ample"C...................................................................................................=$ $ Conclusion..................................................................................................................=C & 0eferences..................................................................................................................A"

Page #

Table *# Fi ures
2igure %3 Communication .et8een /DO components E2lat"&F.....................................%$ 2igure )3 /DO Component Godel E2lat"$F.....................................................................%$ 2igure (3 Illustration of BerviceGanager EOpenOf"=cF................................................... %= 2igure #3 Interfaces & Gethods EOpenOf"=cF.................................................................%A 2igure $3 Architecture of *B2#0e?? E2lat"&cF................................................................)% 2igure &3 2rom oo0e?? to Automation EAham"$F...........................................................)$ 2igure =3 Options ialog in OOo.....................................................................................)C 2igure A3 E?tension Ganager..........................................................................................(" 2igure C3 Gacros installation...........................................................................................(% 2igure %"3 Presentation ocument Godel EOOo ev"$F.................................................(# 2igure %%3 Organi6e Gacros...........................................................................................($ 2igure %)3 Gacro editor...................................................................................................(& 2igure %(3 HHello +orldH 7e?tBhape ..............................................................................(C 2igure %#3 Clic!Event on 7e?tBhape..............................................................................(C 2igure %$3 Progress .ar..................................................................................................#( 2igure %&3 Pacman on his 8a1 to the cherries............................................................... #= 2igure %=3 *om. 8ith fuse..............................................................................................$) 2igure %A3 E?plosion slide...............................................................................................$( 2igure %C3 Cloc! transition..............................................................................................$& 2igure )"3 Input dialogs..................................................................................................&" 2igure )%3 Generated .rea! slide...................................................................................&" 2igure ))3 Blide effects...................................................................................................&# 2igure )(3 2igure )#3 ialog for choosing the speed.......................................................................&$ uration of one slide......................................................................................&$

2igure )$3 5uestion dialog for end slide.........................................................................&$ 2igure )&3 Guideposts from heading..............................................................................&C 2igure )=3 Guideposts 8ith .oo!mar!s..........................................................................=# 2igure )A3 Generated agenda.........................................................................................=A

Page $

Table *# Sni((ets
Bnippet %3 Hello +orld....................................................................................................%" Bnippet )3 ,aria.les........................................................................................................%" Bnippet (3 Control Btructures %.......................................................................................%% Bnippet #3 Control Btructures ).......................................................................................%% Bnippet $3 Control Btructures (.......................................................................................%) Bnippet &3 Control Btructures #.......................................................................................%) Bnippet =3 *B2#0e?? simple e?ample...........................................................................)( Bnippet A3 *B2#0e?? message .o? e?ample................................................................)( Bnippet C3 /sing /DO.C@B.............................................................................................)# Bnippet %"3 Interfaces 8ith es!top...............................................................................(& Bnippet %%3 Introduction e?ample :""Iintroduction.re?;.................................................(A Bnippet %)3 Progress.ar :"%Iprogress.ar.re?;..............................................................#) Bnippet %(3 Pacman :")Ipacman.re?;...........................................................................#= Bnippet %#3 *om. :"(I.om..re?;...................................................................................$% Bnippet %$3 Cloc! :"#Icloc!.re?;....................................................................................$$ Bnippet %&3 Create *rea! Blide :"$I.rea!.re?;..............................................................$A Bnippet %=3 ,arious tas!s :"&IfinishIpresentation.re?;.................................................&( Bnippet %A3 Guideposts from headings :"=Iguideposts.re?;......................................... &A Bnippet %C3 Guideposts 8ith circles and .oo!mar!s :"AIguidepostsIcircles.re?;........ =( Bnippet )"3 Create an agenda :"CIagenda.re?;............................................................==

Introduction

Page &

+ Intr*du!ti*n
7his chapter 8ill give 1ou a short overvie8 a.out the content4 the structure and the approach of this .achelor thesis.

+&+

Abstra!t

7his .achelor paper 8ill give an introduction to the OpenOffice.org suite4 especiall1 the presentation program Impress4 and ho8 the scripting language Open O.>ect 0e?? can help to automate the use of it. 7he result of the automations should ma!e the life easier for presenters and add some e?tra value to the presentations. 7his paper is divided into t8o parts. 7he first part 8ill cover the more theoretical and general part of the .achelor thesis. 7hese chapters 8ill address the technical environment including the OpenOffice.org suite itself4 the scripting language Open O.>ect 0e?? :oo0e??;4 the *ean Bcripting 2rame8or! :*B2; and an overall9vie8 to get familiar 8ith the interaction of those components. After that4 the second part 8ill present some snippets and nutshells that demonstrate the automation of Impress. 7he concluding part should give a short summar1 of the paper.

+&,

Resear!" -uesti*n

Ho8 can Open O.>ect 0e?? help to automate the use of Impress and assist the presenter to ma!e presentations more appealing and attractive for .oth4 the audience and the presenter himselfJ

+&.

Ke/0*rds

OpenOffice.org4 Impress4 Open O.>ect 0e??4 *ean Bcripting 2rame8or! for Open O.>ect 0e??4 Automation4 Guideposts4 Hints

General Part

Page =

, 1eneral 2art
7his chapter contains an overvie8 of all the used tools4 applications and frame8or!s4 8hich are needed for the automation of Impress and other OpenOffice.org applications. In addition to the technical prereKuisites4 the most important terms 8ill .e defined here4 to ease the access to the topic of the .achelor paper.

,&+

3(en 3b4e!t Re''

7he paper starts 8ith some introductor1 8ords a.out the scripting language Open O.>ect 0e?? and ho8 it emerges from I*GLs 0EMM language. 7here 8ill also .e a section 8ith the .asic s1nta? of Open O.>ect 0e??4 8hich is reall1 not that hard to learn and understand.

,&+&+

Hist*r/

Open O.>ect 0e?? has its seeds in the Hhuman centric languageH 0EMM :Restructured E5tended E5ecutorH; implemented .1 Gi!e Co8lisha8 of I*G .et8een )" Garch %C=C and mid9%CA). 7he main purpose of the development of 0EMM 8as to replace I*GNs mainframe .atch language EMEC II. E2lat"&aF Eventuall1 in %CC& 0EMM 8as .een standardi6ed .1 ADBI4 8hich pu.lished it under the code ADBI M(.)=#O%CC& PInformation 7echnolog1 O Programming @anguage 0EMMQ. E+i!i0e"=F In the %CC"s4 there 8ere t8o ne8er variants of 0EMM4 8hich 8ere released3 Det0e?? O this version compiles to 'ava .1te9code and ma!es use of the 'ava o.>ect model. 7herefore it is not generall1 up8ards9compati.le 8ith the RclassicL 0EMM. O.>ect 0e?? O the generall1 up8ards9compati.le version of 0EMM4 8hich implements the o.>ect9oriented paradigm. E+i!i0e"=F

General Part

Page A

As noted a.ove4 O.>ect 0e?? is the o.>ect9oriented approach to the scripting language 0e??. One of the reKuirements of this version 8as the full compati.ilit1 8ith other interpreters that 8ere not o.>ect9oriented or other Open Bource 0e?? interpreters currentl1 availa.le. EOO0e??"=.F 7his 8as a reKuest of the BHA0E BIG :special interest group;. In %CC= after C 1ears of development4 the commercial version of O.>ect 0EMM 8as released included in POB-) +arpQ. @ater on4 I*G .uilt versions for +indo8s4 AIM and e?perimental ports for @inu? and Bolaris. E2lat"&aF 7he last step of 0EMM .ecoming Open O.>ect 0e?? 8as the decision from I*G to ma!e their product availa.le to the open source communit1. 7he1 choose the 0e??@A for managing the pro>ect in )""#. 7he first release of Open O.>ect 0e?? 8as announced in Garch )""$. EOO0e??"=aF

,&+&,

Re''LA

P7he 0e?? @anguage Association :0e??@A; is an independent4 non9profit organi6ation dedicated to promoting the use and understanding of the 0e?? programming languageP E0e??@A"=F 7his special interest group 8as involved in porting O.>ect 0e?? to an open source pro>ect in )""# as mentioned a.ove. Ever1 1ear4 the group holds a annual meeting called SAnnual International 0e?? B1mposiumP 8here the mem.ers and other e?perts present ne8 and interesting pro>ects.

,&+&.

36er6ie0

7his paragraph deals 8ith the main features and fundamental principles of the 0e?? language. One of the ma>or advantages of 0e?? is that it is ver1 eas1 to learn4 even 8ithout advanced programming s!ills4 and that it facilitates a rapid development

General Part process. 7he main features are the follo8ing3

Page C

Natural lan ua e s/nta' O +ith Open O.>ect 0e?? 8riting and maintaining programs is ver1 eas1. Intuitive instructions4 8hich are oriented to the English language4 ma!e programming accessi.le to I7 or .usiness users. *ecause 0e?? does not use an1 strange a..reviations4 it is eas1 to read a program or script and readil1 understand its functionalit14 for e?ample. RB1stem.out.println:P??Q;L in 'ava and Ba1 P??Q in 0e??.

3b4e!t *rientati*nO Bupports effective componenti6ation and all the other advantages of the o.>ect9oriented paradigm.

I7(li!it data t/(in O In 0e??4 there is no need to e?plicitl1 declare varia.les. 7hat reduces the comple?it1 of application code and ma!es programming more intuitive and faster.

8e!i7al arit"7eti! O Open O.>ect 0e?? performs calculations in a more accurate 8a1. 7he a.sence of rounding ma!es it eas1 to compl1 8ith legal reKuirements for financial reporting.

Cr*ss%(lat#*r7 inter*(erabilit/ O 0educes development costs and supports s!ills transfer across platforms.

Ra(id dia n*sti!s O In the case of e?ceptions and errors4 Open O.>ect 0e?? provides the user 8ith clear messages and a .uilt9 in4 multi9level de.ugger.

EOO0e??"=aF

,&+&9

S/nta'

In order to understand the e?amples and snippets in the follo8ing sections of this paper4 a short introduction into the Open O.>ect 0e?? language is inevita.le. 7his paper does not 8ant to .rea! an1 conventions for descri.ing a programming language4 so the first piece of code is the infamous SHello +orldP e?ample.

General Part

Page %"

Snippet 1: Hello World

7his snippet sho8s man1 aspects of 0e??3 $ulti line !*77ents O Btarting 8ith a slash and an asteris!4 a comment can span over multiple lines. An asteris! and a slash closes the comment. Sin le line !*77ent O Btarting 8ith a dou.le minus sign or dash4 a comment can .e made onl1 till the end of the line. C*77and end O Dormall14 a command consists of all characters till the semicolon. It is possi.le to 8rite as man1 commands as one prefers in one line. If there is no semicolon4 the command ends at the end of the line. Basi! !*77ands O BAT prints the follo8ing string literals4 varia.les4 etc. to the command shell 8here the 0e?? script 8as started. EMI7 "4 as the name implies4 e?its the program and sends " .ac! to the shell. +hereas " generall1 means that the program finished 8ith no pro.lems or errors. E2lat"&.F

Snippet 2: Variables 7his snippet sho8s the follo8ing facts3 One do not need to specif1 a data t1pe or something similar. 0e?? automaticall1 detects if the value inside a varia.le is a string or a numeric value and handles the

General Part operation itself.

Page %%

0e?? also treats several 8hite spaces in commands and string concatenations as one 8hitespace. 7hat is 8h1 the output of the SAY num.er % and SAY num.er ) are eKual. 7he dou.le9pipe in a string concatenation avoids the single 8hitespace .et8een the strings and connects the value of a and the value of b seamless together. 7he last SAY command adds the t8o values regardless the fact that b 8as initiali6ed 8ith a string literal containing the num.er #. E2lat"&.F 7he ne?t snippets sho8 ho8 control structures are implemented in 0e??3

Snippet 3: Control Structures 1 7he IF O ELSE implementation of 0e?? loo!s li!e in an1 other programming language. If one 8ants to ma!e a .loc! of commands4 for e?ample to .e processed in the IF or ELSE .ranch4 then the DO O END commands are appropriate. 7here is no need for a enclosing tag.

Snippet 4: Control Structures 2 +ith the !e18ords DO and END respectivel1 a loop is implemented in 0e??. One can specif1 the num.er of iterations after DO.

General Part

Page %)

Snippet 5: Control Structures 3 7he eKuivalent to a for O loop in 'ava is the DOTOBY loop. +ith this loop one can specif1 the start value of a control varia.le4 the value 8hen the loop should .e e?ited and the value that 8ould .e added to the control varia.le after each iteration.

Snippet 6: Control Structures 4 7he last snippet sho8s the DO-WHILE loop. In fact it is nearl1 the same li!e the DOTO-BY loop4 .ut unli!e this version4 one has to manage the increase of the control varia.le himself. 7he !e18ord WHILE can .e changed to UNTIL4 8hich alters the 8a1 ho8 the loop 8ill .e e?ited. E2lat"&.F

General Part

Page %(

,&,

3(en3##i!e&*r

7his paragraph deals 8ith the ne?t essential part of this .achelor paper3 7he OpenOffice.org office suite. 7he first part descri.es the historic facts of the pro>ect4 later on the paper sho8s the main components of OpenOffice.org. OpenOffice.org is a free suite of office applications availa.le under the GD/ @esser General Pu.lic @icense :@GP@;. 7he soft8are pac!age includes a 8ord processor4 a spreadsheet4 a presentation program4 a data.ase program and a vector graphics editor. 7he suite is targeted to reduce the mar!et share of GicrosoftNs Office and en>o1s increasing popularit1 amongst the communit1. E+i!iOo"=F

,&,&+

Hist*r/

7he origin of OpenOffice.org is the compan1 Btar ivision4 8hich 8as founded in German1 in %CA& .1 Garco *Urries. OpenOffice.org emerged from the earlier proprietar1 soft8are application suite BtarOffice. E+i!iOo"=F After Bun Gicros1stems acKuired Btar ivision in %CCC4 the1 released BtarOffice $.)4 the first version 8hich 8as free of charge. EOpenOf"=aF In )""" Bun released the source code under .oth the @GP@ and the Bun Industr1 Btandards Bource @icense :BIBB@;. Bince the autumn of that 1ear4 the product is no8 called OpenOffice.org. Tears later Bun changed the s1stems 8ith t8o different license t1pes and decides to continue their 8or! 8ith the usage of the @GP@. At the time 8hen this paper 8as 8ritten4 the current version of OpenOffice.org 8as ).).% 0C% .uild B0C&A"Im%& and 8as released on Ga1 $th4 )""=. E+i!iOo"=F

,&,&,

36er6ie0

7he OpenOffice.org office suite consists of different applications. Dearl1 all of them have corresponding applications in GicrosoftNs Office. 7his fact should ma!e it easier for users4 to s8itch to the open source suite.

General Part 7he components are the follo8ing3

Page %#

Writer O 7he 8ord processing application4 similar to GB +ord4 can .e used to create te?t documents4 from simple letters to .oo!s or thesis li!e this one.

Cal! O 7he spreadsheet program is the counterpart to GB E?cel 8ith the .asic functionalities li!e ta.les4 cell and calculations .ut also provides the user 8ith a comprehensive range of advanced functions.

I7(ress : 7he presentation soft8are of OpenOffice.org. @i!e Po8erPoint4 Impress can .e used for creating multimedia presentations. 7his component 8ill .e heavil1 used across the paper.

Base : *ase is a data.ase application and can .e compared 8ith GB Access. In *ase creation of ta.les4 reports4 Kueries and forms is possi.le.

8ra0 :

ra8 represents a vector graphics editor to create and design

ever1thing from simple diagrams to d1namic ( illustrations. $at" : A tool4 8hich can .e used to create mathematical eKuations4 either 8ith a graphical user interface :G/I; or a eKuation editor. E+i!iOo"=F EOpenOf"=.F

,&,&.

Ar!"ite!ture

7his section 8ill cover the architecture of OpenOffice.org to act as an entr1 point for the automation. 7he facts presented here are essential for the understanding of the snippets and nutshells in this paper. OpenOffice.org is .ased on a client9server architecture. 7he communication .et8een the la1ers is t1picall1 supposed to run over 7CP-IP soc!ets .1 using /DO remote protocol :urp;4 8hereas a t1pical installation of this office suite runs on a single PC rather than on different machines 8ith each running different operating s1stems4 8hich is possi.le.

General Part 2igure % illustrates the communication .et8een /DO o.>ects.

Page %$

Figure 1: Communication between !" components #Flat$6% 7he o.>ect model used in OpenOffice.org is called /niversal Det8or! O.>ects :/DO; and ever1 component or o.>ect is defined using an interface description language :I @;. 7hat means that each application4 for e?ample Impress4 represents a set of those components assem.led together. 2igure ) tries to picture this concept4 8hereas it should .e noted that s8riter or scalc can here .e replaced .1 an1 otherOpenOffice.org applications. E2lat"$F

Figure 2: !" Component &odel #Flat$5%

General Part

Page %&

,&,&9
3b4e!ts

Ser6i!es ; Inter#a!es

SIn /DO4 an o.>ect is a soft8are artifact that has methods that 1ou can call and attri.utes that 1ou can get and set. E?actl1 8hat methods and attri.utes an o.>ect offers is specified .1 the set of interfaces it supports.P EOpenOf"=cF Inter#a!e SAn interface specifies a set of attri.utes and methods that together define one single aspect of an o.>ectP EOpenOf"=cF

Each /DO component consists of interfaces and properties4 8hich provide access to the different functionalities of the components. Properties are used for storing information for these services. 7o retrieve a ne8 instance of a service component one has to use a BerviceGanager4 8hich is an implementation of the factor1 method pattern in soft8are programming. 7he methods HcreateInstance:;H or HcreateInstanceWithArguments:;H in com.ination 8ith the full1 Kualified name of the /DO component can .e used to create the so9called service o.>ects.

General Part

Page %=

Figure 3: 'llustration o( Ser)ice&anager #"pen"($*c% In order to get access to methods from an interface4 one has to Kuer1 the service o.>ect for the interface itself. 7his step is mandator1 and returns an o.>ect4 8hich has the methods of the reKuested interface4 8hich can .e invo!ed no8. 7his 8or! flo8 seems ver1 a8!8ard4 .ut offers fe8 advantages li!e the separation and grouping of methods that .elong semanticall1 and functionall1 together. E2lat"$F

General Part

Page %A

Figure 4: 'nter(aces + &et,ods #"pen"($*c% 2igure # sho8s ho8 t8o o.>ects 8ith interfaces and corresponding methods loo! li!e in OpenOffice.org using an /G@ diagram. TextD cument contains te?t4 is searcha.le and refresha.le. *ecause 7e?t ocument is al8a1s an O!!iceD cument4 it implements also the interfaces "# $i!iab%e4 "# $e%4 "&rintab%e and "St rab%e. All Interfaces .egin 8ith an M in OpenOffice to distinguish them from other entities.

General Part

Page %C

,&.

Bean S!ri(tin Fra7e0*rk #*r Re''

7he ne?t chapter covers the last step to .e a.le to automate OpenOffice.org using 0e??. Bun provides each /DO O.>ect in OpenOffice.org 8ith a 'ava adapter so that it can full1 .e controlled and automated using BunLs o8n popular programming language. Bo there is onl1 one lin! left .et8een 'ava and 0e??4 and Open O.>ect 0e?? respectivel1. 7he *ean Bcripting 2rame8or! and *B2#0e?? ma!e this possi.le.

,&.&+

Bean S!ri(tin Fra7e0*rk

7he *ean Bcripting 2rame8or! provides a .unch of classes4 8hich ma!e it possi.le to access 'ava o.>ects and methods from scripting languages. It also provides scripting language support 8ithin 'ava applications. Especiall1 the first application area is used for automation of OpenOffice.org 8hen 8e 8ant to access the 'ava Interfaces of the /DO o.>ects and call the methods via 0e??. E*B2"=aF Again4 I*G 8as the founder of this pro>ect in %CCC and chose the Apache Boft8are 2oundation to manage the source code. *B2 is no8 part of the Apache 'a!arta Pro>ect 8here it is released under the Apache @icense. +hen *B2 8as availa.le in version ).(4 it 8as donated to the Apache Boft8are 2oundation4 the current version is ).#.". E+i!i*B"=F4 E*B2"=.F 7he supported script languages of *B2 are3 <a6as!ri(t :using 0hino ECGABcript4 from the Go6illa pro>ect; NetRe'' :an e?tension of the I*G 0EMM scripting language in 'ava4 mentioned a.ove; 2/t"*n :using '1thon; T!l :using 'acl; 5SLT St/les"eets :as a component of Apache MG@ pro>ectNs Malan and Merces;

General Part Bome languages are also supported .ecause the1 have their o8n *B2 engine3 <a6a :using *eanBhell4 from the *eanBhell pro>ect; 1r**6/ <L* :P0O@OG implemented in 'ava; <Rub/ <ud*S!ri(t 3b4e!tS!ri(t 3(en 3b4e!t Re''4 using *B2#0e??

Page )"

E*B2"=aF 7here are t8o important components in *B23 BSF$ana er O 7his class is responsi.le for all the registered scripting e?ecution engines and maintains the o.>ect registr14 8hich permits scripts access to 'ava o.>ects. BSFEn ine O 7hrough this interface it is possi.le to handle script e?ecution and o.>ect registration in a generic 8a14 .ecause it provides an a.stract vie8 of the scripting languageLs capa.ilities. E*B2"=cF

,&.&,

BSF9Re''

*B2#0e??4 as a.ove mentioned4 is an e?tension to ma!e it possi.le to use the scripting language 0e?? to dive into the 8orld of 'ava. 7his means that one can access ever1 'ava o.>ect or method via 0e??. Also the reverse 8a14 using 0e?? in 'ava4 is provided .1 *B2#0e?? E*B2#0e"=cF +ith this .ridge4 0e?? can get access to the largest e?ternal function pac!age on earth4 8hich 8as additionall1 ported to each and ever1 important operating s1stem and

General Part hard8are platform E2lat"&cF 2rom the historical point of vie84 it 8as Prof. Gag. he 8as 8or!ing at a universit1.

Page )%

r. 0on1 G. 2latscher

8ho

developed *B2#0e?? in ( different steps. Each version 8as named after the cit1 8here

7he SEssener ,ersionP 8as developed in )""" in cooperation 8ith a student from Prof. 2latscher4 Peter <alendar. He presented this version in spring )""% to the 0e??@A. 7he ne?t ,ersion 8as called SAugs.urger ,ersionP and 8as finished in )""(. 7he ma>or changes4 .eside some .ugfi?es4 8as the addition of e?ternal functions from 0e?? into the S*B2#0e??.dllP pac!age. 7he current version4 the S,ienna ,ersionP4 8ith the num.er ).& allo8s Open O.>ect 0e?? programs to address 'ava fields as if the1 8ere Open O.>ect 0e?? attri.utes. 7here are also t8o important methods4 b x and unb x4 8hich can 8rap and un8rap primitive data t1pes in 'ava to the corresponding classes. E2lat"&cF4 E*B2#0e"=cF

Figure 5: -rc,itecture o( .SF4/e00 #Flat$6c%

General Part

Page ))

2igure $ sho8s the Architecture of the S,ienna ,ersionP of *B2#0e??. 7here is a cls file4 8hich supports *B2 routines and contains services that ma!e the most important 'ava classes directl1 availa.le via the environment s1m.ol &bs#9re''. E2lat"&cF

,&.&.

BSF&CLS

7his section 8ill sho8 ho8 0e?? can access some 8ell !no8n 'ava classes and ho8 it can call methods and retrieve results from them. As mentioned a.ove4 8ith the help of the BSF'(LS module4 one can access a huge amount of classes and functionalit14 8hich is availa.le in and for the 8orld of 'ava. 2rom accessing the standard 'ava classes4 8hich 8ere shipped 8ith the 'ava B < itself li!e the s1stem properties4 date o.>ects4 ' *C connections4 B8ing and B+7 G/Is through more sophisticated third part1 tools and pac!ages. Ever1 'ava API can .e accessed from the scripting language Open O.>ect 0e??. 7he module provides the developer 8ith some .asic and general functions for loading classes4 for e?ample the method bs!'% a$(%ass) 8hich acts as a creator for 'ava o.>ects. 7he follo8ing snippet should sho8 ho8 eas1 it is to access a 'ava Class 8ith >ust a fe8 lines of code. One remar! in advance4 in 0e?? one can include a module 8ith functions in t8o different 8a1s3 Usin ::RE-UIRES dire!ti6e 9 7his !ind of including the module has to .e in the last line of 1our script. It is invo!ed .efore an1 other statement is interpreted and .ecause of this4 the functions 8ould .e availa.le across the 8hole 0e?? scripts. 7he ne?t snippet uses this st1le of import. Usin CALL O 7he invocation of (ALL has to .e .efore the first usage of a

method of the included module. In the case of including BSF'(LS4 (ALL* BSF'(LS should .e 8ritten4 .efore one calls a *B2 function. 7he latter of the snippets for *B2#0e?? uses this st1le of import. E2lat"&dF

General Part

Page )(

Snippet *: .SF4/e00 simple e0ample 7his snippet sho8s ho8 to create a ne8 Date o.>ect and store this o.>ect into a 0e?? varia.le. $ateOb+ect contains no8 a 'ava o.>ect4 to 8hich a message is send using the t8iddle operator. Bending a message in 0e?? means to call a method on this o.>ect. Again the result4 a String o.>ect4 is saved into a 0e?? varia.le and is printed 8ith the help of the SAY command. 7he BSF'(LS module also contains some useful helper classes4 li!e message .o?es and input .o?es 8hich are .uild open the 'ava class 'OptionPane. 7he ne?t snippet uses a message .o? to notif1 the user a.out something.

Snippet 1: .SF4/e00 message bo0 e0ample 7he script sends the class $ia% g the message messageB x 8ith the te?t that should .e displa1ed. 7here are some other parameter4 8hich are optional4 for e?ample the title of the dialog and the t1pe.

,&.&9

UN3&CLS

7his section 8ill present the final step to automate OpenOffice.org programs using the module UNO'(LS4 8hich ma!es the life of developer easier4 .ecause this module provides common functionalit14 8hich is used across the automation process. +ithout using UNO'(LS it 8ould ta!e up to )$ lines of code to >ust open a .lan! +riter document. All the initiali6ation of U,L,es %-ers4 NamingSer-ices and Fact ries is a ver1 intricate 8a1 of doing such .asic tas!s. And .ecause the process of creating macros or scripts for automation in OpenOffice.org should .e a ver1 simple thing to do4 UNO'(LS provides the developer 8ith a load of helper functions. 7he difficult parts and those parts4 8hich 8ill .e the same for ever1 script one 8ants to 8rite4 are summed up in single methods li!e UNO'createDes.t /01. 7his method ta!es care of nearl1

General Part

Page )#

ever1thing from creating the /DO runtime to instantiating the /0@ 8here OpenOffice.org is listening on. 7he ne?t snippet 8ill sho8 ho8 eas1 it is to create an empt1 +riter document 8hen 1ou are using the UNO'(LS module3

Snippet 2: sing !"3C4S Bnippet C uses another helper routine contained in the UNO'(LS4 .UNO2n &r /s& 7his function creates an empt1 &r /ert3 o.>ect. *ecause UNO'(LS alread1 includes BSF'(LS4 there is no need for a ,E4UI,E* statement in those scripts4 8hich 8ant to use the OpenOffice.org /DO modules.

,&.&=

R*utines

A short overvie8 of some methods presented in the reference card included in the current *B2#0e?? version3 un 'createDes.t /05c ntext61*-*returns*the*% ca%*O/enO!!ice*$es.t /* b+ect* un 'get&r /erties0 1*-*returns*a*b%an.*$e%imite$)*enc $e$*string*7ith*a%%*$e!ine$ * /r /erties*! r*the*ser-ice* b+ect* un 'getScri/t( ntext01**-*returns*a*UNO*/r x3)*i!*the* returning*c ntext*re%ate$*UNO*/r x3* b+ects8* o getD cument*0the*$ cument*ser-ice* b+ect)*an*"# $e%1 o getDes.t /*0the*$es.t /*ser-ice* b+ect)*an*"Des.t /1 o get( m/ nent( ntext*0the*c ntext* b+ect)*an*"( m/ nent( ntext1 E*B2#0e"=aF E*B2#0e"=.F ,exx*scri/t*7as*in- .e$ *

b3 * O/enO!!ice) * 'ni% * e%se' * The * UNO * /r x3 * b+ect * has * the * ! %% 7ing * meth $s)*

General Part

Page )$

,&9

Su77ar/

7his paragraph sums up the previous chapters to ma!e again clear4 ho8 the automation of Impress in this .achelor paper is going to .e accomplished. 7o illustrate this procedure 2igure & from a previous .achelor thesis from a student of the universit1 of .usiness administration in ,ienna sho8s the different la1ers .et8een a method call in Open O.>ect 0e?? and OpenOffice.org.

Figure 6: From oo/e00 to -utomation #-,am$5%

7he scripts developed in Open O.>ect 0e?? are using the module UNO'(LS to .enefit from the simplified o.>ect creations and initiali6ations. In the ne?t step4 the procedures in UNO'(LS use the functionalit1 provided .1 the module BSF'(LS. As 8ritten in the chapter a.out *B24 one can use a scripting language4 in this case and 8ith the *B2#0e?? e?tension the scripting language Open O.>ect 0e??4 to ma!e use of 'ava. E?actl1 this point .rings su.stantial improvement to the development process .ecause it is not necessar1 to develop in 'ava and .1 the use of UNO'(LS one can save a lot of lines of code

In OpenOffice.org there is a comprehensive support of 'ava to communicate 8ith the /DO components. 7his represents the 'ava /DO la1er on 2igure &.

General Part

Page )&

7he 'ava /DO model then is connected to the /DO certainl1 and this leads to OpenOffice.org itself to conduct the automation. E2lat"$F As the last chapters have sho8n4 an open source scripting language can .e used to control and automate an open source office suite on .ehalf of OpenOffice.org. *ut not onl1 that4 OpenOffice.org itself can invo!e Open O.>ect 0e?? macros. 7his fact is ver1 important4 .ecause all of the snippets for automating Impress 8ill .e 8ritten in form of macros. It com.ines the po8er and straightfor8ardness of Open O.>ect 0e?? 8ith the full featured and open interfaces of OpenOffice.org to ma!e it possi.le to easil1 automate the programs of this office suite4 even 8ithout 8ide e?perience in the field of programming and development.

Installati*n 1uide

7his chapter 8ill descri.e and sho8 ho8 to set up the environment for developing and running the snippets provided .1 this paper. 7his section 8ill onl1 tal! a.out the current versions of each application and programming language. 7he steps (.%4 (.). and (.( must not .e follo8ed .1 in this specific order. 7he onl1 step4 8hich has a fi?ed order is step num.er #4 the installation of *B2#0e??. 7he other installations should .e finished prior to this tas!.

.&+

Installati*n <a6a

2irst of all4 1ou have to have at least 'ava %.# installed on 1our machine to 8or! 8ith *B2#0e??. *ecause it is enough to have the 'ava 0untime Edition :'0E; installed nearl1 ever1 PC is capa.le for automating OpenOffice.org from the 'ava point of vie8. *ut 1ou can also use the 'ava .undled 8ith it4 for development. 7o chec! 8hether the computer has a 'ava installation at all or if the 'ava version can .e used for the snippets4 the command +a-a*-ersi n in the command prompt 8ill sho8 the result. evelopment <it :' <;4 8hich has the '0E alread1

Installation Guide

Page )=

Tou can do8nload 'ava from BunLs 8e. page at http3-->ava.sun.com. It is also ver1 useful if 1ou do8nload or at least use the API documentation availa.le at http3-->ava.sun.com-reference-api-. Here 1ou can choose the proper documentation 8ith the version num.er 1ou are using. 7he current version of 'ava is 'ava & :' < &u%; and is availa.le at

http3-->ava.sun.com->avase-do8nloads-inde?.>sp. 7he version used for developing the nutshells in this .achelor paper is %.&."I"%. E*B2#0e"=cF

.&,
Tou

Installati*n 3(en3##i!e&*r
can do8nload the latest version of OpenOffice.org at

http3--do8nload.openoffice.org-inde?.html. If the desired PC has no valid 'ava installation there is an option on the do8nload page to include the 'ava '0E 8ith the do8nload. 2or all of the people 8ho s!ipped the latter paragraph4 this option 8ould .e applica.le. 7he current version of OpenOffice.org is ).).%4 8hich is used for 8riting this paper. Tou can do8nload the office suite for +indo8s4 @inu?4 Bolaris4 Gac OB M and 2ree *B and in different languages. 7he automation itself 8as onl1 tested in +indo8s .ut it should also 8or! 8ith @inu?.

.&.
Open

Installati*n 3(en 3b4e!t Re''


O.>ect 0e?? can .e do8nloaded from the 8e.site

http3--888.oore??.org-do8nload.html. Open O.>ect 0e??4 li!e OpenOffice.org is availa.le for different operating s1stems li!e +indo8s4 Gac OB M4 @inu?4 AIM and Bolaris. Again4 the documentation can also .e do8nloaded from the 8e.site. 7he current version of Open O.>ect 0e?? is (.%.) and is used for creating the snippets in this .achelor paper.

Installation Guide

Page )A

.&9

Installati*n BSF9Re''

7he installation of *B2#0e?? is pro.a.l1 the most sophisticated step for preparing the computer for the automation snippets. *ut if one follo8s the installation guide supplied 8ith the release and the previous steps 8ere finished successfull14 there should .e no pro.lems4 even for non9e?perts. 7he current release of the *B2#0e?? is availa.le under http3--8i.8u9

8ien.ac.at-rgf-re??-.sf#re??-current the 8e. space from Prof. universit1 of .usiness administration 8e. server.

r. Gag. 2latscher on the

*B2#0e?? comes in form of a 6ip file4 8hich contains all files4 the installation scripts4 some e?amples from previous .achelor thesisL and other 0e?? communit1 mem.ers and installation guides for ever1 step. 2or the first part of the installation4 the *B2#0e?? part4 the file rea$meBSF9,exx'txt is the proper one. 7o start the installation run the setup script setu/'rex using the re?? command. 7his command should no8 .e availa.le in the command prompt after installing Open O.>ect 0e?? in one of the previous steps. 7his script should create four ne8 files3

.sf#re??.cmd O +ith this4 *B2#0e?? scripts can alread1 .e run install*B2#0e??.cmd O 7his script copies the 'ava archives :>ars; and d1namic lin! li.raries to the used 'ava e?tension folder. Do8 ever1 'ava application can use *B2#0e??

uninsta%%BSF9,exx'cm$ O 7his script undoes the actions from the install script. setEn-ir nment9BSF9,exx'cm$ O 7his script sets the proper environment varia.les for using *B2#0e??

On a @inu? PCLs all the generated scripts 8ill not have the e?tension cmd4 the scripts are .sh files. 0unning the script install*B2#0e?? 8ill finish the installation .1 no8 and *B2#0e?? can .e tested .1 calling different !inds of commands to ensure that ever1thing is

Installation Guide 8or!ing correctl1. 0unning the scripts in! BSF'rex and in! BSF-

Page )C

'rex 8ith .oth the rexx and rexx+*

command should give the user an output in form of the registered *B2 functions. E*B2#0e??"=9(F 7he second part of the installation is to ma!e the .ridge to OpenOffice.org and install the 0e?? support for the office suite. 7he corresponding readme file is called rea$meOO 'txt. 7he first step is to ensure that 'ava is ena.led for OpenOffice.org. 2or this reason start an1 application of the office suite4 for e?ample +riter4 and select the menu item O/ti ns *in the T %s menu. In the tree on the left side there is an entr1 called :a-a) * 8hich sho8s some options on the right side of the dialog.

Figure *: "ptions 5ialog in ""o 2igure = sho8s the dialog in 8hich the user has to select the desired '0E. 7his version should .e the same as the version for 8hich *B2#0e?? is installed. After ma!ing changes on this settings4 OpenOffice.org as 8ell as the 5uic!Btarter should .e closed. 0unning the command rexx*setu/OO 'rex*/ath-t OO -$irect r3 8ill create the install scripts for the OpenOffice.org support.

Installation Guide An e?ample3 rexx*setu/OO 'rex*;$8<O/enO!!ice' rg*='=>'

Page ("

Again some scripts for installing the support4 uninstalling and setting up of the environmental varia.les 8ill .e generated. 0unning the insta%%OO 'cm$ 8ill actuall1 install the support. All Instances of OpenOffice.org should .e closed to ensure that the configuration ta!es effect in ever1 module. 7o test the OpenOffice.org support there are a t8o 0e?? scripts :testOO 'rex and testOO ='rex; 8hich should .e started 8ith either the rexx and rexx+ command. 7he scripts should open a +riter document and insert some te?t into the document. 7he last step for the configuration and installation is the macro support in OpenOffice.org. 7o do that clic! on the menu entr1 SExtensi n*#anagerP in the T Scri/t&r -i$erF r E*B2#0e"=dF ,exx'+ar4 it 8ill install the macro support for Open O.>ect 0e??. %s* menu in an OpenOffice.org application. After clic!ing on A$$*and selecting the >ar9!i%e *

Figure 1: 60tension &anager After restarting OpenOffice.org4 in the menu #acr s VW Organi?e*#acr s 1ou can see if the installation 8as finished successfull1. 2igure C sho8s e?actl1 ho8 it should loo! li!e.

Installation Guide

Page (%

Figure 2: &acros installation

Impress Automation

Page ()

I7(ress Aut*7ati*n

After creating the .asis !no8ledge for conducting automation in OpenOffice.org4 this chapter contains general information a.out the document overvie8 of Impress and some descriptive 8ords regarding the automation. 7his .achelor paper 8ants to sho8 ho8 Open O.>ect 0e?? can ease the life of presenters using Impress. 7he e?amples presented in this paper can also .rush up and advance e?isting presentations also in consideration of the audience. A lot of presentations created .1 students4 managers or normal 'ohn oes lac! of

different !inds of gimmic!s4 8hich are ver1 useful for .oth the presenter himself and the audience. 7hose improvements can .e guideposts to illustrate the status of the current slide in the presentation and other helpful and valua.le things. 7he implementation of this automation 8ill .e developed in form of macros 8ritten in Open O.>ect 0e??4 .ecause this !ind of reali6ation 8ould allo8 running the scripts on e?isting presentation .1 selecting a menu entr1 in the OpenOffice.org application. 7his paper 8ill not cover an1 stand9alone Open O.>ect 0e?? scripts .ecause such .ehavior 8ill not meet the given reKuirements for this application area. 7he starting point of each automation process is an e?isting :e?isting from the content point of vie8; presentation4 8hich should .e further enhanced .1 the macros provided in this .achelor paper.

9&+

1eneral
ra8 are vector9oriented applications for creating

In OpenOffice.org Impress and

presentations and dra8ings. *oth applications support different !ind of things to dra84 for e?ample rectangles4 te?t4 curves and other graphic shapes. /nli!e to the te?t documents in +riter and the spreadsheet document in Calc4 ra8

and Impress use the so9called dra8pages for displa1ing the content. 2igure %" reflects this fact 8ith the dra8page container in the middle of the graphic. 7he document service manager pictured 8ith the fa.ric s1m.ol at the top of the figure is used for creating all the dra8ing elements and shape o.>ects. 7hese o.>ects 8ill .e later inserted into the dra8pages.

Impress Automation 7here are man1 different t1pes of shapes to add to a dra8page in Impress & most important ones are3 @ra/hicOb+ectSha/e4 8hich can displa1 an image from a file ( nnect rSha/e4 8hich can connect other Sha/es E%%i/seSha/es can .e various circles and ellipses. ,ectang%eSha/e that pictures a rectangle on a dra8page TextSha/e can .e used for displa1ing te?t on a slide

Page (( ra84 the

7he controller is used to present the presentation in the G/I and for assigning st1les and la1outs to the dra8ings. 7he figure also sho8s the interfaces for accessing the #aster&ages and the La3 ut#anager. EOoo ev"$F

Impress Automation

Page (#

Figure 1$: 7resentation 5ocument &odel #""o5e)$5%

9&,

Intr*du!ti*n E'a7(le

7o ma!e the introduction for the Open O.>ect 0e?? macros easier4 this paragraph 8ill tal! a.out a ver1 simple macro4 8hich adds a slide to an e?isting presentation and puts a te?t field 8ith a t1pe of the notorious SHello +orldP la.el on each additional slide. 7he previous slide 8ill get a te?t field that causes a slide transition to the ne?t page 8hen someone clic!s on the te?t. 7here 8ill .e an e?amination of ever1 action ta!en in the script so that the .asic functionalit14 li!e getting access to the dra8 pages4 8ill .e cleared .1 no8.

Impress Automation

Page ($

Gost of the functions4 interfaces and properties 8ill .e used throughout the 8hole .achelor paper. *ecause the snippets 8ill .e e?ecuted as a macro inside OpenOffice.org the first thing to do is to open an e?isting presentation or to create a ne8 one using Impress. In the menu T %s O #acr s O Organi?e*#acr s there is the entr1 ,exx)*8hich opens

a dialog to create4 edit and run the 8ritten macros4 as sho8n on 2igure %%4

Figure 11: "rgani8e &acros

7he dialog for editing the macros acts also as a de.ug 8indo8 8here the lines4 8hich cause an error are mar!ed and the error message is sho8n. /nfortunatel1 there is no s1nta? highlighting in the edit dialog4 so the .est thing one can do is to 8rite the macros in a third part1 editor li!e gvim4 8hich supports the s1nta? of Open O.>ect 0e??. 7hen4 after 8riting the scripts4 the1 can .e copied into the macro editor of OpenOffice.org.

Impress Automation

Page (&

Figure 12: &acro editor 7he dialog is sho8n on the 2igure %)4 from here the script can .e e?ecuted. 7he source code of the introduction snippet can .e seen in the Bnippet %%.

7his cutout from Bnippet %% 8ill get the Scri/ting( ntext 8hose function is to provide the developer 8ith the document services and interfaces. 7his is specific for the macros in Open O.>ect 0e??4 if one 8ants to 8or! 8ith the Impress interfaces from a standalone script4 the UNO'createDes.t /01 procedure 8ill get the related interfaces.

Snippet 1$: 'nter(aces wit, 5es9top

Impress Automation

Page (=

Impress Automation

Page (A

Snippet 11: 'ntroduction e0ample :$$;introduction3re0<

7his cutout of the source code creates a TextSha/e for displa1ing the te?t SHello Presentation9+orldP on the ne8 slide.

If a user clic!s on the nextSha/e TextSha/e4 the presentation goes on to the ne?t slide. 7he function get( nstant from the*BSF'(LS module is used a lot in the macros. It is an eas1 8a1 to retrieve constants from classes 8ith the use of the class name and the name of the constant.

7he ne8l1 created page properties 8ill .e changed here. 7he propert1 value (hange * specifies ho8 the transition 8ill .e conducted. A value of " means that the user needs to clic! to trigger the effects and to change to the ne?t slide. % means that the page is automaticall1 s8itched and ) means that ever1 effect 8ill run automaticall1 .ut the user needs to clic! to change to the ne?t slide. If (hange has the value %4 Durati n specifies ho8 man1 seconds each page 8ill .e sho8n.

Impress Automation

Page (C

7he t8o shapes4 one TextSha/e for the SHello +orldP la.el and the other one for the clic! te?t field to go to the ne?t slide4 are added to the dra8pages using the add method.

7he varia.le run&resentati n is " 8hen the user does 8ant to start the presentation after the changes of the slides 8ere done. 7he impress document 8ill .e Kueried for the "&resentati nSu//%ier interface. 7his interface has a method to get the "&resentati n interface to start the presentation. 7he ne?t t8o figures sho8 the output of the macro.

Figure 13: =Hello World= >e0tS,ape

Figure 14: Clic96)ent on >e0tS,ape After running the script4 the presentation 8ill .e updated and depending on the decision made at the .eginning4 it 8ill also .e started.

Impress Automation

Page #"

9&.

E'a7(les

After descri.ing the .asic functions for automation of Impress 8ith the help of the introduction e?ample4 the ne?t paragraph 8ill .e dealing 8ith the other e?amples. 7hese e?amples 8ill create helpful features and additions to presentations. 7his paper 8ill also include some e?amples4 8hich 8ill ta!e off some recurring tas!s from the presenter so that she or he >ust needs to concentrate on the content of the presentation. 7he macros 8ill improve the presentations and give the audience a .etter understanding of the progress of the address .1 creating guideposts and progress .ars. 7he first four macros 8ill .e dealing 8ith the progress of presentations and give the audience an information4 ho8 far the presentation is alread1 advanced. 2urthermore the ne?t t8o macros 8ill provide the presenter 8ith a possi.ilit1 to ta!e over recurring tas!s. 7he ne?t t8o macros are the most sophisticated ones. 7he1 8ill create guideposts on each slide4 8ith the main headings of the presentation. 7he last e?ample 8ill automaticall1 create the agenda of a presentation.

Impress Automation

Page #%

9&.&+

E'a7(le>+

Impress Automation

Page #)

Snippet 12: 7rogressbar :$1;progressbar3re0<

Impress Automation

Page #(

7he first e?ample for advancing presentations in OpenOffice.org adds a progress .ar to the .ottom of each slide. *ecause in most presentations4 the first slide is some sort of a 8elcome or introduction page4 this page 8ill not contain a progress .ar. 7hat means on the second slide 1ou can see a rectangle 8ith a filled section on the left side3

Figure 15: 7rogress bar Each slide 8ill sho8 ne8 shapes4 8here the filled shapes 8idth is increased incremental. 7his 8ill give the audience a feeling ho8 advanced the progress of the presentation is. Also the presenter 8ill get a critical information a.out the state of the presentation. As the presentation goes on4 the rectangle 8ill .e filled more and more till it reaches the end.

7he first thing to do is to go through all the e?isting dra8pages. 7his 8ill .e reali6ed 8ith a DO O TO iteration starting 8ith the dra8page 8ith inde? %4 8hich is actuall1 the second slide .ecause the inde? is " .ased. If there is alread1 a progress .ar4 the grouped shape 8ill .e removed. 7he macro then generates a ,ectang%eSha/e and passes it to a routine4 8hich resi6es the component and places it to the correct position.

Impress Automation

Page ##

7his snippet sho8s the routine for positioning and resi6ing shapes4 8hich is used in ever1 macro. As one can see the routine creates a Si?e O.>ect 8ith arguments num.er t8o and three and a & int O.>ect 8ith the latter one. Argument num.er one is the shape itself.

7his routine creates the round edges of .oth the .order shape and the shape that represents the progress in the presentation .1 ad>usting the 8idth of the rectangle. 7here is also a shado8 created for the shapes.

7he shape for the progress .ar filling has not >ust a normal solid color. 7he Fi%%St3%e is a @ra$ient O.>ect4 8hich can create a transition from one color to another 8ith detailed configuration ho8 this transition 8ill .e done. 7he @ra$ient O.>ect is generated in an o8n function. 7his function returns the o.>ect and can .e accessed from outside through the varia.le resu%t. Again the function for formatting the shape 8ill .e called here.

Impress Automation

Page #$

9&.&,

E'a7(le>,

Impress Automation

Page #&

Impress Automation

Page #=

Snippet 13: 7acman :$2;pacman3re0< E?ample num.er ) is also a macro4 8hich displa1s the current status of the presentation. 7he animation starts on the second slide4 li!e in the first e?ample. On the left side of this slide there 8ill .e an Pacman image and on the other side of the slide4 there are some cherries. On the line from Pacman to the cherries are a lot of 1ello8 points. Each slide the Pacman image 8ill .e shifted to the left. After running the script4 it loo!s li!e Pacman eats all the points till he finall1 reaches the cherr1 on the last slide of the presentation.

Figure 16: 7acman on ,is wa? to t,e c,erries

7his snippet ma!es use of another Sha/e4 the @ra/hicOb+ectSha/e4 8hich loads an image from the hard drive to displa1 it on the slides.

7he @ra/hicOb+ectSha/e is created through the Impress #u%tiSer-iceFact r3 interface and is then ad>usted to the position and si6e on the slide. 7he file /0@ can .e edited .1 changing the corresponding propert1 value.

Impress Automation

Page #A

7his snippet sho8s the placing of the circle shapes4 8hich represent the points in the Pacman game. 7he placement starts at the current position of Pacman and adds E%%i/seSha/e o.>ects to the dra8page till the ?9coordinate reaches the end in form of the position of the cherr1. 7he circles are >ust E%%i/seSha/e o.>ects that have the (irc%eAin$ FULL. 7he other options are SE(TION for a circle 8ith a cut connected .1 a line4 (UT for a circle 8ith a cut connected .1 t8o lines :for e?ample a ca!e diagram; and an A,(4 8hich is a circle 8ith an open cut. After the creation of the shapes4 the1 8ill .e added to a Sha/e@r u/4 all of the shapes 8hich are inside the sha/e@r u/ o.>ect 8ill .e grouped together using the "Sha/e@r u/er from a dra8page. 7o .e a.le to remove them in the case of a second run of the macro the group gets a name.

Impress Automation

Page #C

9&.&.

E'a7(le>.

Impress Automation

Page $"

Impress Automation

Page $%

Snippet 14: .omb :$3;bomb3re0<

7he t1pe of the ne?t macro is again a progress sho8ing macro. Instead of Pacman going to the end of the slide4 there 8ill .e a fuse 8ith a flame. 7he fuse is connected to a .om.. 7he fuse 8ill .e reali6ed 8ith the help of a ,ectang%eSha/e. As the progress of the presentation is advancing4 the fuse is .urning do8n. One of the difference to the last e?ample is that the macro is generating a ne8 slide at the end of the presentation and put some shapes on the dra8page. 7he ne8 dra8page as 8ell as the shapes on it 8ill have some effects4 8hich are assigned in the script. 7he last slide contains a TextSha/e 8ith the te?t P*OOOGGGXXQ and an @ra/hicOb+ectSha/e 8ith an e?plosion image.

Impress Automation

Page $)

7he /0@ of the image is set in the cutout using the "&r /ert3Set interface. 7he method used for fetching the filename is operating s1stem independent. 7he images have to .e in the same folder as the presentation. 7he animation effect of the TextSha/e* P*OOOGGGGXXXXQ 8ill .e a fade from the center of the slide and 8ill .e conducted in a fast sped. Bimilar to that4 the effect of the image 8ith the e?plosion should .e a little .it slo8er and 8ith a hori6ontal rotation.

7he counterpart to the Sha/e Animati nE!!ect o.>ect for slide transitions is the Fa$eE!!ect o.>ect. 7he ,ANDO# value sets a random effect to the slide transition 8ith medium speed. 7he .om. 8ith the fuse as 8ell as the slide 8ith the e?plosion image are displa1ed on the ne?t t8o figures.

Figure 1*: .omb wit, (use

Impress Automation

Page $(

Figure 11: 60plosion slide

2or sure4 this demonstration of a progress illustration and the e?ample 8ith Pacman is not ver1 appropriate for .usiness presentations. 2or these !ind of presentations the progress .ar 8ill .e the .est solution. 7his should .e >ust a proof of concept ho8 eas1 it is to put a ver1 helpful feature to a presentation4 also 8ith a 8hiff of pla1fulness..

Impress Automation

Page $#

9&.&9

E'a7(le>9

Impress Automation

Page $$

Snippet 15: Cloc9 :$4;cloc93re0< 2or this macro the progress is illustrated as a cloc! on each slide4 8hich turns more and more red as the presentation goes .1. 7his macro 8ill generate a E%%i/seSha/e in form of a circle using the propert1 value (irc%eAin$ FULL for the .ac!ground of the cloc!. 7he shape for displa1ing the elapsed

Impress Automation

Page $&

time 8ill .e a SE(TION E%%i/seSha/e. 7o configure the section4 the values for the start and end angle need to .e set.

*1 setting the values as seen in the cutout a.ove4 the section is forced to start at %) oNcloc!. ecreasing the startAng%e value after each slide 8ill e?pand the section cloc!8ise. 7he fill color of the section is also changing throughout the presentation.

7he color is represented .1 a he?adecimal value. Btarting 8ith 8hite :222222; and fading to red. 7his is done .1 su.tracting values from the start color. 7he transition of the cloc!s loo!s li!e 2igure %C.

Figure 12: Cloc9 transition

Impress Automation

Page $=

9&.&=

E'a7(le>=

Impress Automation

Page $A

Snippet 16: Create .rea9 Slide :$5;brea93re0<

7he ne?t macro 8ill support the presenter .1 automaticall1 creating a slide in the middle of the presentation. 2or long presentations it could .e necessar1 to ma!e such a .rea! to let the audience get some refreshments. 7he user 8ill .e as!ed for the duration of the .rea! and for a message4 8hich 8ill .e sho8n on the ne8 slide. 7he duration has to .e entered in minutes. After the time is elapsed the presentation 8ill continue 8ith the ne?t slide. 7he slide .efore the .rea! as 8ell as all created shapes 8ill get effects in addition to the slide transition.

Impress Automation

Page $C

7his line is responsi.le for the e?ception handling in Open O.>ect 0e??. If an1 error occurs during the runtime of the script4 the code at the mar!er ANY 8ill .e e?ecuted. 7he script has to handle possi.le e?ceptions .ecause it has to operate 8ith a data entered .1 a user. +hen the user does not enter a valid num.er4 there 8ould .e a BTD7AM error and the script 8ould crash. In order to handle those pro.lems4 the mar!er ANY 8as implemented in the rear section of the script.

7he code then sho8s up another message .o? 8ith the line num.er 8here the pro.lem occurred.

7he cutout from the snippet a.ove sho8s ho8 the middle of the presentation is .een calculated. 7he -- operator acts as the modulo function in Open O.>ect 0e?? to get the rest of a division of integers. 7he in/utB x procedure from the BSF'(LS module is used for entering the duration of the .rea!. 7he value 8ill .e saved into the varia.le minutes. 7he dialogs and the .rea! slide can .e seen on the ne?t figures.

Impress Automation

Page &"

Figure 2$: 'nput dialogs

Figure 21: @enerated brea9 slide

Impress Automation

Page &%

9&.&?

E'a7(le>?

Impress Automation

Page &)

Impress Automation

Page &(

Snippet 1*: Various tas9s :$6;(inis,;presentation3re0<

Gacro num.er & carries out some recurring tas!s4 8hich can cost a lot of time if one has to do it manuall1. 7he user 8ill .e as!ed for each function that should .e added to the presentation. 7he follo8ing functions are support .1 this macro3

2ade effects and duration of the slide transitions :the user can choose from some predefined effects and speeds;

Animation effects for ever1 Bhape o.>ect of the dra8 pages :again4 the user can choose from different effects;

Automaticall1 generated P7han!s for 1our attentionQ slide irect start of the presentation at the end of the macro

7his cutout sho8s ho8 arra1s can .e created in Open O.>ect 0e?? using the 'arra32 !* method. 7hen the user 8ill .e as!ed in form of a dialog 8ith a com.o .o?4 8hich displa1s the effects from the arra1. If the user clic!s on PCancelQ in the dialog4 the

Impress Automation returned value 8ill .e the nil o.>ect.

Page &#

7he he?adecimal value " "A represents a line .rea! and is used in a dialog .o? to separate the message.

7he macro can also change the animation effects of ever1 shape on ever1 dra8page if the user 8ants to. /sing the interface "Sha/es of a dra8page one can get access to ever1 shape o.>ect on it. @i!e iterating through the dra8pages of a presentation4 one can access the shapes using an inde?. 7he dialogs for as!ing after the effects are sho8n on the ne?t figures.

Figure 22: Slide e((ects

Impress Automation

Page &$

Figure 23: 5ialog (or c,oosing t,e speed

Figure 24: 5uration o( one slide

Figure 25: Auestion dialog (or end slide

Impress Automation

Page &&

9&.&@

E'a7(le>@

Impress Automation

Page &=

Impress Automation

Page &A

Snippet 11: @uideposts (rom ,eadings :$*;guideposts3re0< 7he goal of this macro is to create guideposts on the slides of a presentation. 7he onl1 thing the creator of the presentation has to care a.out is that the slides have te?t fields 8ith the predefined st1le Hea$ing or Hea$ingB assigned to them. 7hen the macro

Impress Automation

Page &C

scans each slide for those heading tagged shapes. After gathering this information4 the script creates a rectangular section on the left side of the slides and puts the headings on it. 7o give the audience the chance to .e a8are of the status of the presentation4 the current heading te?t is red colored. 2igure )& sho8s a part of a slide4 8hich 8as changed .1 the macro. 7he macro supports a guidepost structure up to t8o levels.

Figure 26: @uideposts (rom ,eading 7o ma!e sure that there 8ill .e no guidepost on the last slide :this slide can .e for e?ample a P7han! 1ou for 1our attentionQ slide; the user 8ill .e as!ed for that4 .efore the start of the macroNs main >o..

7he first thing to do is to iterate through all the slides to get ever1 dra8page. +ith the dra8page4 one can access ever1 shape that is added to it. 7he propert1 St3%e has itself another propert1 called Dis/%a3Name'*If the name is PHeadingC the inde? of the relevant slide and the te?t of the heading is added to the arra1. 7here e?ists also a counter varia.le to calculate the span .et8een the headings on the guidepost9section. 7he

Impress Automation

Page ="

missing lines of the snippet are >ust removing previous guideposts if necessar1. 7he code is the same as in the e?amples for creating a progress information.

7he ne?t cutout is responsi.le for creating the heading fields in the guidepost9section of the slides. In a DO*ODE, iteration all the heading fields in the arra1 are e?amined 8ith the help of the &A,SE*DA, command. 7his command puts the slide inde? and the te?t of the heading into different varia.les. As seen in line && of the previous cutout4 this information is stored as one literal into the arra1. epending on the current inde? of the slide and the inde? of the ne?t slide4 the heading 8ill .e colored in red or in .lac!.

Impress Automation

Page =%

9&.&A

E'a7(le>A

Impress Automation

Page =)

Impress Automation

Page =(

Snippet 12: @uideposts wit, circles and boo9mar9s :$1;guideposts;circles3re0<

Gacro num.er A is also adding a guidepost9section to the slides of a presentation. 7here are t8o differences compared to the macro num.er = a.ove. 2rom the graphical point of vie84 the guideposts 8ill .e displa1ed as circles connected .1 lines. Instead of the te?t of the heading a serial num.er is sho8n on the slides. 7he color of the num.ers as 8ell as the lines4 8hich connect them4 8ill .e changed as the presentation goes .1. 7he result can .e seen on 2igure )=.

Impress Automation

Page =#

*ut the most important difference is the use of .oo!mar!s in this script. Each guidepost gets an On(%ic. event4 8hich directl1 leads to the slide 8ith the corresponding heading. 7his 8ill provide a fast and eas1 8a1 of navigating through the presentation 8ithout 8riting those actions and graphical shapes manuall1.

Figure 2*: @uideposts wit, boo9mar9s Onl1 the parts of the code4 8hich are different compared to Bnippet %A 8ill .e sho8n in this paragraph.

+hen the macro has found a slide 8ith a heading te?t field4 the related dra8page gets a name4 to .e a.le to access it later 8ith a .oo!mar!. 7he name is set 8ith the help of the "Name$ interface and is the inde? of the heading slide. 7hese lines set the name of the dra8page to the inde? of the slide.

7his cutout sho8s ho8 the On(%ic. event is .een connected to the .oo!mar! using the inde? of the guidepost circle shape. 7he te?t inside the circle 8ill .e a serial num.er and is assigned to the shape in the line %(#.

Impress Automation

Page =$

9&.&B

E'a7(le>B

Impress Automation

Page =&

Impress Automation

Page ==

Snippet 2$: Create an agenda :$2;agenda3re0< 7he last macro of this .achelor paper is a script that generates a slide 8ith the agenda of the presentation. 7he agenda 8ill .e created using the te?t fields 8ith heading st1le. If the agenda is alread1 created in the past and the script is started again4 the agenda 8ill .e updated 8ith the current heading tags. 7his script 8ill again use various parts of the previous e?amples to retrieve the arra1 8ith the heading information. 7o ensure a failsafe process4 the macro chec!s if there is an1 heading te?t field at all and sho8s a message dialog in the case of none?istence.

7his procedure gets a dra8page as an argument and sets the name of it for ena.ling the possi.ilit1 to refresh it 8hen running the macro at a later date. 7he La3 ut propert1 is set to % that means the slide gets a te?t field at the top and a listing at the center. 7he te?t of the te?t shape is set to PAgendaQ .1 accessing the shape 8ith the inde? ".

2or formating the listing 8ith the headings this procedure is called. 7he line spacing as 8ell as the font si6e is ad>usted to create a good loo!ing agenda.

Impress Automation

Page =A

7he script appends each heading to the listing te?t field on the agenda slide .1 using a Text(urs r. @ine num.er =( sho8s the command ho8 the cursor 8ill .e placed at the end. 7he "Text,ange interface 8ill then .e used to append the te?t 8ith a carriage return. 2igure )A sho8s a generated agenda slide.

Figure 21: @enerated agenda

Conclusion

Page =C

= C*n!lusi*n
7he conclusion of this .achelor thesis is that 8ith the help of Open O.>ect 0e??4 *ean Bcripting 2rame8or!4 *B2#0e?? and OpenOffice.org it is possi.le to automate the office suite 8ithout an1 e?pert !no8ledge a.out programming languages. 7he onl1 real reKuirement for the development is to .e a.le to search self9dependent in the 8e. for the functionalit1 one is loo!ing for. *ut this is not >ust the case for this t1pe of 8or!. 2or nearl1 ever1 tas! one is coping 8ith4 there is a need to find the desired information as fast as possi.le4 .ut not loosing the sight of the Kualit1 of the results. 7he open source scripting language Open Office 0e?? is ver1 eas1 to learn and can use the massive amount of classes provided .1 'ava 8ith the help of *B2 and *B2#0e??. 7his 8ill give the scripting language more po8er and opens the door to the /DO .ased architecture of OpenOffice.org. 7he macros themselves are ver1 useful and could save presenters a lot of time4 especiall1 for the macros4 8hich are dealing 8ith the progress indication. *ut that should not .e the onl1 important output of this paper. Other students 8ho are also interested in this topic can .enefit from the results and .uild open the snippets to create even more sophisticated macros. *ecause there 8ere not so man1 e?amples for automation of Impress4 actuall1 there is onl1 one on the homepage of OpenOffice.org4 it 8as not ver1 eas1 to get in touch 8ith the interfaces4 properties and functionalit1 of Impress. +ith the help of the e?cellent evelopers Guide4 some nutshells from previous .achelor papers and the online communit1 of OpenOffice.org it 8as possi.le to create the snippets in this .achelor paper in a reasona.le amount of time. It also emerged that the functions in .oth the UNO'(LS and BSF'(LS 8ere ver1 helpful4 for e?ample the ones 8hich return the names of the inferfaces using reflection and the properties of an o.>ect. And if more and more snippets and e?amples are getting online4 the communit1 gro8s and gro8s and the collective !no8ledge 8ould increase over the 1ears4 the po8er of OpenOffice.org and open source soft8are in general 8ill .e strengthen.

0eferences

Page A"

? Re#eren!es
EAham"$F Ahammer4 )""$ E*B2"=aF Apache 'a!arta Pro>ect3 *ean Bcripting 2rame8or!4 2ront Page4 http3-->a!arta.apache.org-.sf-4 retrieved on )""=9"$9)& E*B2"=.F Apache 'a!arta Pro>ect3 *ean Bcripting 2rame8or!4 2reKuentl1 As!ed 5uestions4 http3-->a!arta.apache.org-.sf-faK.html4 retrieved on )""=9"$9)& E*B2"=cF Apache 'a!arta Pro>ect3 *ean Bcripting 2rame8or!4 Ganual4 Andreas3 OpenOffice.org Automation3 O.>ect Godel4

Bcripting @anguages4 SDutshellP9E?amples4 *achelor Course Paper4

http3-->a!arta.apache.org-.sf-manual.html4 retrieved on )""=9"$9)& E*B2#0e"=aF 2latscher4 0on1 G.3 7he ,ienna ,ersion of *B2#0e?? 9 Changes for OOo4 http3--8i.8u98ien.ac.at-rgf-re??-.sf#re??-current-changesOOo.t?t4 )""=9 "%9)A4 retrieved on )""=9"$9)# E*B2#0e"=.F 2latscher4 0on1 G.3 7he ,ienna ,ersion of *B2#0e?? O 0eference Card OpenOffice.org4 http3--8i.8u98ien.ac.at-rgf-re??-.sf#re??-current-refcardOOo.pdf4 )""=9"%9)A4 retrieved on )""=9"$9)# E*B2#0e"=cF 2latscher4 0on1 G.3 7he ,ienna ,ersion of *B2#0e?? O 0eadme of *B2#0e??4 http3--8i.8u98ien.ac.at-rgf-re??-.sf#re??-current-readme*B2#0e??.t?t4 )""=9"%9)A4 retrieved on )""=9"$9)# E*B2#0e"=dF 2latscher4 0on1 G.3 7he ,ienna ,ersion of *B2#0e?? O 0eadme of OOo support4 http3--8i.8u98ien.ac.at-rgf-re??-.sf#re??-current-readmeOOo.t?t )""=9"%9)A4 retrieved on )""=9"$9)#

0eferences E2lat"$F 2latscher4 0on1 G.3 Automating to 0e?? OpenOffice.org using 8ith

Page A% Oo0e??3 )""$4

Architecture4

Gluing

*B2#0e??4

+irtschaftsuniversitt +ien :,ienna /niversit1 of Economics and *usiness Administration;4 Austria4 http3--8i.8u9 8ien.ac.at-rgf-re??-or?%&-)""$Ior?%&IGluing)oo0e??IOOo.pdf4 retrieved on )""=9"$9)" E2lat"&aF 2latscher4 0on1 G.3 0esurrecting 0EMM4 Introducing O.>ect 0e??4 )""&4 +irtschaftsuniversitt +ien :,ienna /niversit1 of Economics and *usiness Administration;4 Austria4 http3--prog.vu..ac..e-Y8dmeuter-0 @"&-2latscher.pdf4 retrieved on )""=9"$9%A E2lat"&.F 2latscher4 0on1 G.3 Automatisierung von +indo8s An8endungen :%; 9 Einfhrung4 http3--8i.8u9 8ien.ac.at-rgf-8u-lehre-auto8in-material-folien-AutomatisierungI"%.pdf4 retrieved on )""&9"(9%$ E2lat"&cF 2latscher4 0on1 G.3 7he ,ienna ,ersion of *B2#0e??4 Presentation at the )""& International 0e?? B1mposium4 /BA4 )""&4 http3--8i.8u98ien.ac.at-rgf-re??-or?%=-)""&Ior?%=I*B2I,iennaEd.pdf4 retrieved on )""=9"$9)" E2lat"&dF 2latscher4 0on1 G.3 Automatisierung von +indo8sAn8endungen :(; O Ausnahmen :E?ceptions;4 0eferen6en4 http3--8i.8u9 8ien.ac.at-rgf-8u-lehre-auto8in-material-folien-AutomatisierungI"(.pdf4 retrieved on )""&9"(9%= EOO0e??"=aF Open O.>ect 0e?? Homepage4 Product *rochure4 http3--888.oore??.org-oo0e??9*rochure.pdf4 retrieved on )""=9"$9%= ire!tiven :33routine4 33reKuires; Z.er.lic!4 An8eisungen4 Pro6eduren4 2un!tionen4

0eferences EOO0e??"=.F Open O.>ect 0e?? Homepage4 A.out4 http3--888.oore??.org-inde?.html4 retrieved on )""=9"$9%= EOpenOf"=aF Open Office Homepage4 A.out 4 http3--a.out.openoffice.org-inde?.html4 retrieved on )""=9"$9)" EOpenOf"=.F Open Office Homepage4 Product 4

Page A)

http3--888.openoffice.org-product-inde?.html4 retrieved on )""=9"$9)" EOpenOf"=cF Open Office Homepage4 API O evelopers Guide4 2irst Bteps4 http3--api.openoffice.org-docs- evelopersGuide-2irstBteps-2irstBteps.? html4 retrieved on )""=9"$9)" EOOo ev"$F Open Office Homepage4 retrieved on )""=9"$9)%# E+i!i*B"=F +i!imedia 2oundation Inc4 *ean Bcripting 2rame8or!4 http3--en.8i!ipedia.org-8i!i-*eanIBcriptingI2rame8or!4 retrieved on )""=9"$9"& E+i!iOo"=F +i!imedia 2oundation Inc4 OpenOffice.org4 http3--en.8i!ipedia.org-8i!i-Openoffice.org4 retrieved on )""=9"$9"$ E+i!i0e"=F +i!imedia 2oundation Inc4 0EMM4 http3--en.8i!ipedia.org-8i!i-0EMM4 retrieved on )""=9"$9"# evelopers Guide4 Ga1 )""$4

http3--api.openoffice.org-docs- evelopersGuide- evelopersGuide.pdf4