OpenOffice Basic is cool. It can manipulate everything in your document, spreadsheets and slides. It helps you to create complicated reports automatically. But OpenOffice Basic is not cool. It lacks everything a modern hardcore developer needs: Personal favorite text editors, version controls, source repositories, etc. OpenOffice Basic macros are created and edited only with Basic IDE, and stored in some hidden place in your hard disk, not in the source form but in XML. They cannot be managed with modern development tools like svn, git, different text editors, and cloud storage backup.
What if there is a tool that let you work off-line, out of the OpenOffice Basic IDE box, with your favorite text editor, on anywhere on your hard drive? That's why I wrote obasync to do this job: Synchronize your local Basic macro sources with OpenOffice Basic storage. It frees me from Basic IDE and I can apply every source code development tools now.
Talk delivered in FOSDEM’17
ULB Solbosch Campus, Brussels, 4 & 5 February 2017
Track: Developer rooms: Open Document Editors
Room: K.4.401
Date/Time: Saturday 4 February 2017 13:30-13:50
https://fosdem.org/2017/schedule/event/office_source_code_mgmt/
Video: https://www.youtube.com/watch?v=qB1rAAgkYGY
obasync - Office Basic macro source synchronizer
https://pypi.python.org/pypi/obasync
https://github.com/imacat/obasync
2. “Office Basic Source Code Management” is created by imacat (Yang Shih-Ching),
and licensed under a Creative Commons Attribution 3.0 Unported License
3. imacat / Yang Shih-Ching
● Taiwan OpenOffice/LibreOffice community
● Apache OpenOffice PMC
● Women in FOSS in Taiwan
32. In Calc Mosaic,
after all the mosaic sheets are created,
Basic macros are inserted to play these sheets.
33. Document Basic Macro Storage
● The document Basic macro storage is the
BasicLibraries attribute of the
OfficeDocument object.
OfficeDocumentOfficeDocument
BasicLibrariesBasicLibraries
Basic LibraryBasic Library
Basic Module (String)Basic Module (String)
doc_libs = doc.getPropertyValue("BasicLibraries")
34. System and User
Basic Macro Storage
● But the system and user Basic macros are
stored together at a different location, the
ApplicationScriptLibraryContainer service.
ApplicationApplication
ApplicationScriptLibraryContainerApplicationScriptLibraryContainer
Basic LibraryBasic Library
Basic Module (String)Basic Module (String)
app_libs = service_manager.createInstance(
"com.sun.star.script.ApplicationScriptLibraryContainer")
35. Basic Library Storage
● ApplicationScriptLibraryContainer has the
XNameAccess interface.
– Use hasByName() to check if a library exist.
– Use getByName() to obtain a library.
ApplicationApplication
Basic LibraryBasic Library
Basic Module (String)Basic Module (String)
ApplicationScriptLibraryContainerApplicationScriptLibraryContainer
36. Basic Library
● The Basic library is an XNameContainer.
– Use getByName() to obtain a module.
– Use replaceByName() to update a module.
– Use insertByName() to add a module.
– Use removeByName() to delete a module.
ApplicationApplication
ApplicationScriptLibraryContainerApplicationScriptLibraryContainer
Basic Module (String)Basic Module (String)
Basic LibraryBasic Library
37. Basic Module
● The Basic module obtained with the previous
getByName() is a String that contains one or
more Basic subroutines as Basic macros.
ApplicationApplication
ApplicationScriptLibraryContainerApplicationScriptLibraryContainer
Basic LibraryBasic Library
Basic Module (String)Basic Module (String)
44. Developers can store the source files
with cloud sync servicescloud sync services,
and access their source files EVERYWHERE!
45. Developers can apply version control systemversion control system
to manage their source files.
CVSCVS
46. Developers can host their projectshost their projects
on common project hosting services.
47. Developers can apply build toolsbuild tools
to automate extension packaging,
unit tests, and releases.
makemake
48. In addition, with the build tools,
we can establish
project layout rulesproject layout rules and templatestemplates
to simplify and automate project management.
makemake
50. Pokémon GO IV Calculator
● It is entirely in my folder.
– I work seamlessly on my PC and my laptop.
51. Pokémon GO IV Calculator
● It is entirely in my folder.
– I work seamlessly on my PC and my laptop.
– I do not worry if my hard disk dies.
52. Pokémon GO IV Calculator
● It is entirely in my folder.
– I work seamlessly on my PC and my laptop.
– I do not worry if my hard disk dies.
● I use for version control.
53. Pokémon GO IV Calculator
● It is entirely in my folder.
– I work seamlessly on my PC and my laptop.
– I do not worry if my hard disk dies.
● I use for version control.
● I host my project on .
54. Pokémon GO IV Calculator
● It is entirely in my folder.
– I work seamlessly on my PC and my laptop.
– I do not worry if my hard disk dies.
● I use for version control.
● I host my project on .
● I use with a build.xml and a
fixed project template to build and release.
55. Pokémon GO IV Calculator
Project Structure
rootroot PokemonGoIVPokemonGoIV
oxtoxt META-INFMETA-INF
PokemonGoIVPokemonGoIV
pkg-descpkg-desc
Main.vb, …etc.
Addons.xcu
description.xml
build.xml
README
VERSION
Main.vb, …etc.manifest.xml
pkg-description.txt
Main.xba, …etc.