XOO functionalities
The project is an extension for OpenOffice, which allows users to browse, create and edit wiki documents, or upload and download attachments, all from inside OpenOffice Writer.
Aug 24 2009
XOO Progress
Hi all!
You are probably curious about the XOO status. Well I will begin to present the functionalities with screenshots, after that the known issues and future development.
NOTE : I apologize to the Windows Users. Unfortunately the extension is not very user friendly because the navigation panel loses every time the focus and the user has to press the navigation panel button again or to minimize the window in order to work easy. This issue appears only for Windows.I've mention at the known issues section details about the Navigation Panel problem. Of course the functionalities work for Windows too, but this issue makes the experience not very pleasant.
XOO toolbar and menu After you install XOO, you will notice a new Toolbar and a new Menu Option (XWiki). The user takes advantage of the XOO functionalities through this elements ( Toolbar buttons and Submenu options). When the mouse is over one of the toolbar buttons, there is a help text that specifies the button functionality.
Login
If the user has customized the XE installation, he/she has to specify the wiki relative path to the server and the XML-RPC relative path. The default values are "/xwiki" and "/xmlrpc"
Navigational panel The user can visualize the structure of the XWiki server, using the navigational panel. With this one there are some problems,but I will talk about them at the known issue section.
Edit a page The user can edit with OpenOffice an existing page selecting the page in the navigation panel and using "Edit page button"
The XWiki Syntax is transformed in XHTML. If the page contains images that are attached to the current page or to another page, the images are downloaded locally and the user sees them when he edits the page.
When the user edits a page, can include also other images from the local machine.
These images will become attachments for the current page, if the page will be publish to the server.
Publish a page After the user edits an existing page, he can publish it using the "Publish button".
Any other HTML created or opened with OpenOffice can be published. In this case, the user is requested to specify the name of the page and the space. where the current page will be published.
If the page contains pictures, these one become attachment for the page. Currently this operation is not optimal. All the pictures are sent to the server not only the modified ones.
View a page from the server using the default browser
Add a new page to the XWiki Server
Add a new space to the XWiki Server
Attach the current document to an XWiki page
The user can attached an opened OO Writer file, to an existing XWiki page, after he/she selects in the navigation panel the page that will be the parent.
Download attachments
The attachments can be downloaded to the local machine.
The user has to specify the location where the attachment will be downloaded.
Fortunately, today I've received a mail form another developer that gave to me some hints to implement it. Not as docking window, as modal -less (so it is now) but handling the events. We have to decide if we change the design or I should try (it is some work to do) to implement this way. If you want to read the email thread I was talking about you can find it here: http://www.nabble.com/DockingWindows-Java-ts24754063.html There are more issues and I registered them in Jira. http://jira.xwiki.org/jira/browse/XSANDBOX/component/10799 Feel free to add more.
XOO functionalities
XOO installation XOO can be installed in OpenOffice using Extension Manager
XOO toolbar and menu After you install XOO, you will notice a new Toolbar and a new Menu Option (XWiki). The user takes advantage of the XOO functionalities through this elements ( Toolbar buttons and Submenu options). When the mouse is over one of the toolbar buttons, there is a help text that specifies the button functionality.
Login
If the user has customized the XE installation, he/she has to specify the wiki relative path to the server and the XML-RPC relative path. The default values are "/xwiki" and "/xmlrpc"
Navigational panel The user can visualize the structure of the XWiki server, using the navigational panel. With this one there are some problems,but I will talk about them at the known issue section.
Edit a page The user can edit with OpenOffice an existing page selecting the page in the navigation panel and using "Edit page button"
The XWiki Syntax is transformed in XHTML. If the page contains images that are attached to the current page or to another page, the images are downloaded locally and the user sees them when he edits the page.
When the user edits a page, can include also other images from the local machine.
These images will become attachments for the current page, if the page will be publish to the server.
Publish a page After the user edits an existing page, he can publish it using the "Publish button".
Any other HTML created or opened with OpenOffice can be published. In this case, the user is requested to specify the name of the page and the space. where the current page will be published.
If the page contains pictures, these one become attachment for the page. Currently this operation is not optimal. All the pictures are sent to the server not only the modified ones.
View a page from the server using the default browser
Add a new page to the XWiki Server
Add a new space to the XWiki Server
Attach the current document to an XWiki page
The user can attached an opened OO Writer file, to an existing XWiki page, after he/she selects in the navigation panel the page that will be the parent.
Download attachments
The attachments can be downloaded to the local machine.
The user has to specify the location where the attachment will be downloaded.
Known Issues
My first big issue was the Navigational Panel.The ideal one should be a docking window for each opened document. Currently , it is only one instance in the whole extension which is of course not the happiest approach. I read the developers guide from OpenOffice, I tried different "solutions" but none worked. On the OO developers list after 3 weeks of mailing I've received the answer:"Hi Christina,
Sorry for the late answer but I have tried to look for a solution. Unfortunately I wasn't able to find anything what can help you here. The object you get via the DialogProvider service just implements XDialog and XTopWindow neither implements anything that you need. I fear that your workaround is currently the best available solution. Please write a request for enhancement and the owner to cd@openoffice.org. I hope that we can extend the implementation to support your use case."
Fortunately, today I've received a mail form another developer that gave to me some hints to implement it. Not as docking window, as modal -less (so it is now) but handling the events. We have to decide if we change the design or I should try (it is some work to do) to implement this way. If you want to read the email thread I was talking about you can find it here: http://www.nabble.com/DockingWindows-Java-ts24754063.html There are more issues and I registered them in Jira. http://jira.xwiki.org/jira/browse/XSANDBOX/component/10799 Feel free to add more.
OpenOffice API development
I'm sorry to write that, but the API from OpenOffice was much more tricky as I've expected. It is not well documented, many things are missing (docking windows, complete open folder control, an easy way to get the extension path etc) . For example, I didn't expected to add an icon at a button to be a big deal. Well I was surprised that OO doesn't accept relative path, only absolute URL, so I had to get the extension path. The solution suggested by OpenOffice.org was to write a configuration file (to be recognized this file should have a defined schema too), in that file to set a property with the value "%origin%" which is a macro that contains the current path. After that, from java code, I had to read this file and call the MacroExpander to get the real value. It's incredible that I waste a lot of time with that small window for the navigation and the problem still persists :-|Future development
The next things to do are to find solve the navigation panel problem, add support for all the documents with macros, add some progress bars and find a way to minimize the time to get the XWiki server structure , solve the openoffice style problems and so on. I'm looking forward for your feedback on my project!Executable
You can find an executable with my extension attached here If you can't download it, you can find a link hereJul 05 2009
XOO Status
Hi!
In this post I invite you to test the small XOO. Your feedback is very important to me.
Features till now:
- Connection wizard - you have to provide the complete URL address of the XWiki ex: http://localhost/xwiki/xmlrpc
- Navigation panel - it is a temporal one
- Open a page from the XWiki Server with OpenOffice - right click in the navigational panel on a page name
- Bidirectional converter and html cleaner - for these one I've written some tests :
- To build the project, it is not necessary to have OpenOffice SDK installed. Just run
mvn install
- To install the extension
Open Office 3.0 -> Tools -> Extension Manager -> add (the zip output); Restart OpenOffice
Jun 24 2009
Bidirectional Converter
Hi!
In this post I will talk about how I implemented the Bidirectional Converter for my extension.
I've used the existing code from the XWiki platform rendering module. In order to be able to do this, I've created a new instance of EmbeddableComponentManager . This object is initialized just once in the whole extension, in the XWikiExtension class.
xwiki 2.0 syntax -> xhtml
- I've used a Parser for XWiki 2.0 syntax. The result is the a XDOM structure
- I've applied transformation on the XDom object, for the macros
- I've used a Renderer for XHTML.
- I've used a Parser for xhtml syntax. The result is the a XDOM structure
- I've used a Renderer for XWiki 2.0 syntax.
Jun 18 2009
New features
Hi!
It's been a while since my last post, and I apologize for that. Consequently, this post will be longer than the usual ones, and I will talk about what I have done recently.
First of all, not it is easier to build the project (run just mvn install). For more details, please read the README file associated with the project. I've also attached at this post a version of XOO. In order to log in you should provide the complete URL of the server (for example if you want to connect to the local XWiki server you can try url: http://localhost/xwiki/xmlrpc~~ , username ~~Admin, password admin. After you are logged in, you can see the structure of the XWiki server choosing Menu->XWiki->Navigation Panel. Right click on a page name and OpenOffice will open the html page (the conversion in xhtml isn't ready yet, and that's why you will see the syntax of the page , not interpreted).
So let's talk about the components:
First of all, not it is easier to build the project (run just mvn install). For more details, please read the README file associated with the project. I've also attached at this post a version of XOO. In order to log in you should provide the complete URL of the server (for example if you want to connect to the local XWiki server you can try url: http://localhost/xwiki/xmlrpc~~ , username ~~Admin, password admin. After you are logged in, you can see the structure of the XWiki server choosing Menu->XWiki->Navigation Panel. Right click on a page name and OpenOffice will open the html page (the conversion in xhtml isn't ready yet, and that's why you will see the syntax of the page , not interpreted).
So let's talk about the components:
- The navigational panel . Here I had a problem. I wanted something similar with the custom control from XWord, but I didn't manage to find a solution. So for now, I thought to have a dialog with the tree structure. By default, the OpenOffice dialogs are modal. That means, the focus is on the dialog, and the user cannot do something else until he closes the dialog. I needed of course a non-modal dialog. Unfortunately, there was very few documentation about how to do it, so I wasted some time. The solution I've implemented is this one: create a new window with the desktop as parent and display the dialog provided by the dialogProvider Service in this window. In this case, the user can also edit a text and having the navigational panel on the screen. I will paste here some code, maybe it is useful for somebody who has the same problem.
The navigational panel is not in the right place,for now. I will do more research about another way to implement this control. If the dialog remains the only choice then some coordinates should be calculated.obj = xMCF.createInstanceWithContext("com.sun.star.awt.DialogProvider2", m_xContext); XDialogProvider2 xDialogProvider = (XDialogProvider2) UnoRuntime.queryInterface(XDialogProvider2.class, obj); XDialog xDialog = xDialogProvider.createDialogWithHandler(DialogURL, this); XControl dialogControl = (XControl) UnoRuntime.queryInterface(XControl.class, xDialog); XControlModel xBasicDialogModel = dialogControl.getModel(); Object dialog = xMCF.createInstanceWithContext("com.sun.star.awt.UnoControlDialog", m_xContext); XControl xControl = (XControl) UnoRuntime.queryInterface(XControl.class, dialog); xControl.setModel(xBasicDialogModel); XToolkit xToolkit = (XToolkit) UnoRuntime.queryInterface(XToolkit.class, xMCF.createInstanceWithContext( "com.sun.star.awt.Toolkit", m_xContext)); WindowDescriptor aDescriptor = new WindowDescriptor(); aDescriptor.Type = WindowClass.TOP; aDescriptor.WindowServiceName = ""; aDescriptor.ParentIndex = -1; aDescriptor.Parent = xToolkit.getDesktopWindow(); aDescriptor.WindowAttributes = WindowAttribute.BORDER | WindowAttribute.MOVEABLE | WindowAttribute.SIZEABLE | WindowAttribute.CLOSEABLE; XWindowPeer xPeer = xToolkit.createWindow(aDescriptor); XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, xPeer); xWindow.setVisible(false); xControl.createPeer(xToolkit, xPeer); m_xDialog = (XDialog) UnoRuntime.queryInterface(XDialog.class, dialog); m_xControlContainer = (XControlContainer) UnoRuntime.queryInterface(XControlContainer.class, m_xDialog);
- File storage. In order to edit, create a new page and publish a new one, I create some temporal files that stores the information. So for every page I create a folder in the default java temp folder. This folder will contain the page itself in html and the objects associated with the page (images for example). In this scope, I've created a class that handles all the work with temporal files.
- Opening a html file from OpenOffice. OpenOffice works only with URLs, so I had to convert the file's path in a url using XFileIdentifierConverter interface
- Converter XWiki syntax - xhtml. I'm working on this now. I tried to implement it (http://svn.xwiki.org/svnroot/xwiki/sandbox/gsoc/xoo/src/main/java/org/xwiki/xoo/xwikilib/converter/internal/DefaultBidirectionalConverter.java), but I have an exception at the rendering step. If you have any idea what I am doing wrong, please let me know.
Jun 01 2009
Creating a wizard for connecting to an XWiki server
Hi!
Finally, I've implemented a first feature for the XOO project : the wizard for connecting to a XWiki server
In order to achieve this goal, I've created the following classes
Besides this classes, I've also created a BASIC dialogs library which contains for the moment only the dialog for the connection settings. To include this, I've modified the dep.xml file and the META-INF/manifest.mf
Next step .. A navigation panel for browsing the documents inside the wiki!!
Finally, I've implemented a first feature for the XOO project : the wizard for connecting to a XWiki server
In order to achieve this goal, I've created the following classes
- XWikiDialog.java - this class is the base class for all the Dialogs that I need in the application. It contains methods like create a new Dialog , get the set of the properties of a control from the dialog, dispose the dialog. It was necessary to create this kind of class because in the OpenOffice API is not simple to create a dialog. (I have to use the DialogProvider service which gives the dialog created with the basic editor using the URL parameter).
- SettingsDialog.java - this class extends the XWikiDialog and represents the Dialog which appears when the user wants to change the connection settings. For now, it has only 3 fields for the server url, username and password
- Settings.java - this class contains all the settings made by the user. For now it has only 3 attributes (server url, username and password). It can be more generic if I use a dictionary structure instead of all those attributes
- Utils.java - this class displays useful messages for the user (like the error messagebox when there cannot be established a connection with the XWiki server).
- XWikiAddIn.java - a singleton which contains the XWiki stucture, the XMLRPCClient and the settings.
- Debug.java - a singleton used for displaying messages for debugging
- IConstants.java - an interfaces with all the constants from the project. I find this interface useful especially for the localization.
Besides this classes, I've also created a BASIC dialogs library which contains for the moment only the dialog for the connection settings. To include this, I've modified the dep.xml file and the META-INF/manifest.mf
Next step .. A navigation panel for browsing the documents inside the wiki!!
May 27 2009
How to build and install XOO
Hi!
If you want to build and install the XOO project, you have to follow this steps:
- Download and install OpenOffice.org 3. from http://www.openoffice.org/
- Download and install OpenOffice SDK 3. from http://download.openoffice.org/3.1.0/sdk.html . A useful link is also : http://wiki.services.openoffice.org/wiki/SDKInstallation. If you want to be sure that the installation worked, try to build one of the examples from the SDK folder. In order to be able to run an example you have to set the environment variables for the SDK. (Run one of the setsdkenv script)
- Download the CVS project http://api.openoffice.org/source/browse/api/maven2integration/ and run mvn install in order to install the maven open office plugin in the local repository
- Enter in the root folder of the XOO project and run
mvn assembly:assembly -Dooo=/path/to/OpenOffice.org_installation -Dooosdk=/path/to/OOSDK
ex: mvn assembly:assembly -Dooo=/home/kristina/opt/openoffice.org3 -Dooosdk=/opt/openoffice.org/basis3.0/sdk - In the target folder there is an archive xoo-1.0-bin.zip. This is the extension. In order to install it run:
$ unopkg add --shared xoo-1.0-bin.zip
Another method to install the extension is:
OppenOffice.org Writer -> Tools -> Extension Manager -> Add -> Browse to the path of the zip file xoo-1.0-bin.zip
Restart the Writer.; A new menu XWiki should be enabled.
Open Office Extension Structure
Hi!
In this post I will talk about the OpenOffice Extension structure and Maven Integration
In order to create the basis of the XOO I needed the following files:
1. description. xml
* http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/Extensions/Description_of_XML_Elements
* Here I added for now only the version and the Id. In the future I will add also icon, display name, registration, extension description etc
2. META-INF manifest.xml.
* http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/Extensions/File_Format
* This file is used by the Extension Manager to know what type of files are in the extension. So I added some lines to describe the configuration files and the uno component
3. Configuration files
* Addons.xcu Here i describe the structure of the menus. For now I have only a menu option with a submenu
* ProtocolHandler.xcu. The protocol handler mechanism is an API that enables programmers to add arbitrary URL schemas to the existing set of command URLs by writing additional protocol handlers for them. In my configuration file I had to specify the protocols used by the component: http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/WritingUNO/Configuration
4. The UNO component which contains
* a Register Handler Class. This class is used to register services. It has to provide two methods:
o getComponentFactory http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/WritingUNO/Providing_a_Single_Factory_Using_a_Helper_Method
o writeRegistryServiceInfo http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/WritingUNO/Write_Registration_Info_Using_a_Helper_Method
* the base AddOn class which extends WeakBase provided by OpenOffice SDK http://api.openoffice.org/docs/java/ref/com/sun/star/lib/uno/helper/WeakBase.html
* the Jar Manifest file which must specify which is the Registration class
In order to build an create the extension using Maven, I had to:
In this post I will talk about the OpenOffice Extension structure and Maven Integration
In order to create the basis of the XOO I needed the following files:
1. description. xml
* http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/Extensions/Description_of_XML_Elements
* Here I added for now only the version and the Id. In the future I will add also icon, display name, registration, extension description etc
2. META-INF manifest.xml.
* http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/Extensions/File_Format
* This file is used by the Extension Manager to know what type of files are in the extension. So I added some lines to describe the configuration files and the uno component
3. Configuration files
* Addons.xcu Here i describe the structure of the menus. For now I have only a menu option with a submenu
* ProtocolHandler.xcu. The protocol handler mechanism is an API that enables programmers to add arbitrary URL schemas to the existing set of command URLs by writing additional protocol handlers for them. In my configuration file I had to specify the protocols used by the component: http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/WritingUNO/Configuration
4. The UNO component which contains
* a Register Handler Class. This class is used to register services. It has to provide two methods:
o getComponentFactory http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/WritingUNO/Providing_a_Single_Factory_Using_a_Helper_Method
o writeRegistryServiceInfo http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/WritingUNO/Write_Registration_Info_Using_a_Helper_Method
* the base AddOn class which extends WeakBase provided by OpenOffice SDK http://api.openoffice.org/docs/java/ref/com/sun/star/lib/uno/helper/WeakBase.html
* the Jar Manifest file which must specify which is the Registration class
In order to build an create the extension using Maven, I had to:
- use the Maven - OpenOffice plugin . This builds the UNO classes and the idl files
- add some OpenOffice dependencies in the pom.xml file (I used "dependency" tag )
- customize the Jar manifest file (I used "archive", "manifestEntries" and "manifestSection" tags)
- use assembly Maven plugin which creates the zip archive with the specified files. This archive can be installed in OpenOffice Writer
May 18 2009
Conversion Manager
Hi everybody!
In this post I will talk about one of the most important component of my project: the converter between the XWiki format and the SWriter format.
My problem is this one: in order to create a new XWIKi page or to edit an old one, I have to convert the documents from one of the wiki syntax, in a format that is compatible with OO Writer. OOWriter supports many formats :.odt, .html,.doc,.txt, .swt etc. To convert from a supported format to other supported one, the OO SDK API offers Filter properties and XStorable objects.
This is my plan of implementation
Please let me know if you have a feedback regarding this approach.
These days I've found an interesting open source OO extension, that allows the user to export a file from OO to a mediawiki server. Here can be found the source code: http://sw.openoffice.org/source/browse/sw/swext/mediawiki/src/. I've downloaded it and seems to be useful for me. The GUI is developed using the basic dialog files, exactly how I wrote in the last post.
What I am doing now? Well I'm trying to integrate maven with Open Office SDK. I used the plugin recommended by Sergiu. There isn't any maven repository with this plugin on the internet, so I had to checkout the project using cvs and to install on my computer. I've created a maven project using this plugin, and it created for me a nice folder structure for the idl files and the java sources. With the initial pom.xml file, the java class which used the sun.com.star package didn't build. After I added some dependencies in the pom file with the artifacts from open office server, it worked. Unfortunately, the plugin wasn't developed any more, so I have to find out a way to create a oxt file which will include the created jar, but also the xcu files (used for the menus) and the basic dialogs. I hope very soon you will have the code from the extension from the last post, but built with maven instead of the netbeans plugin.
In this post I will talk about one of the most important component of my project: the converter between the XWiki format and the SWriter format.
My problem is this one: in order to create a new XWIKi page or to edit an old one, I have to convert the documents from one of the wiki syntax, in a format that is compatible with OO Writer. OOWriter supports many formats :.odt, .html,.doc,.txt, .swt etc. To convert from a supported format to other supported one, the OO SDK API offers Filter properties and XStorable objects.
This is my plan of implementation
- bidirectional converter wiki syntax - html. (For the first time this convertor won't be implemented, I will use directly the html format for the XWiki pages
- converter from the swriter html in pure html. This step is necessary because, although the OO Writer has a good support for the html files, it makes them "dirty". What I have to do at this step is:
o Remove unnecessary id, class and type attributes (almost all of them are unnecessary).
- run the file through a utility like HTML Tidy.
- make the file as compact as possible. Remove any unnecessary styles, line breaks, tc.
- remove unnecessary markup.
o Remove font tags.
o Remove styles in the tag.
o Make sure tags all have a scope attribute.
o Remove tags nested inside and tags.
Please let me know if you have a feedback regarding this approach.
These days I've found an interesting open source OO extension, that allows the user to export a file from OO to a mediawiki server. Here can be found the source code: http://sw.openoffice.org/source/browse/sw/swext/mediawiki/src/. I've downloaded it and seems to be useful for me. The GUI is developed using the basic dialog files, exactly how I wrote in the last post.
What I am doing now? Well I'm trying to integrate maven with Open Office SDK. I used the plugin recommended by Sergiu. There isn't any maven repository with this plugin on the internet, so I had to checkout the project using cvs and to install on my computer. I've created a maven project using this plugin, and it created for me a nice folder structure for the idl files and the java sources. With the initial pom.xml file, the java class which used the sun.com.star package didn't build. After I added some dependencies in the pom file with the artifacts from open office server, it worked. Unfortunately, the plugin wasn't developed any more, so I have to find out a way to create a oxt file which will include the created jar, but also the xcu files (used for the menus) and the basic dialogs. I hope very soon you will have the code from the extension from the last post, but built with maven instead of the netbeans plugin.
May 01 2009
GUI development with OOo SDK
Hi everyone!
In the last days I tried to know better the Open Office SDK. Before I had submitted my gsoc application, I did a small extension with a dialog that contains more labels. I've created and load the Dialog at the runtime, something similar with this example: http://doc.services.openoffice.org/wiki/Documentation/DevGuide/Basic/Creating_Dialogs_at_Runtime
The extension runs OK, but I was not happy with this way of development because took a lot of time to arrange the controls in the dialog. (There wasn't any visual help, and I had to try manual which is are the best coordonates and size for my controls). There is a lot of work for XOO and I don't want to waste so much time with the GUI. The sollution I've found is this one: 1. create a new library for the new dialogs 2. add a new dialog in the library 3. design the dialog with the OpenOffice Dialog Editor. ( This one is used in generally to design dialogs that are used from macros and the events are generally handled using OO Basic Subs - OO Basic is a scripting language very similar with the Visual Basic from Microsoft) 4. export the library The library should be deployed with the rest of the extension
From the java component:
XControlModel xControlModel1 = xTextField1Control.getModel();
XPropertySet xPropertySet1 = (XPropertySet)UnoRuntime.queryInterface(
XPropertySet.class, xControlModel1 );
try
{
aText = (String)xPropertySet1.getPropertyValue( aTextPropertyStr );
}
catch (Exception e) {
e.printStackTrace();
}
)
But what about the events? I would like to handle the events like button click and so on from my java component. Fortunately, there are more ways to do this
I did a small example installing the basic library and the UNO component and it works! The main advantage of this kind of development is the productivity. The advantages of the first method ( that one with all the code in java) is speed and the code homogeneity .
Another feature of the OpenOffice extension that I discovered is the "Options" from the Extension Manager. Every extension displayed in the extension manager can have some configuration options. Relative easy can be done some dialogs that will allow the user the configure the extension before installing it. ( I would like for example to add here a checkbox option - automatically connect to xwiki - to avoid trying to connect when the user only wants to edit a simple .odt file)
Other interesting feature of OOo are the Autopilot dialogs.For a wizard with more steps ( when you have to display more dialogs to make a setting), every dialog can have more pages. Every Control has a property called "Step". A control is displayed only if the step property of the dialog coincides with its step property or if it has the value 0 for the step property (0 means that it is displayed anytime).
My next small research will be about the SWriter html document format and how can I convert to and from this format.
In the last days I tried to know better the Open Office SDK. Before I had submitted my gsoc application, I did a small extension with a dialog that contains more labels. I've created and load the Dialog at the runtime, something similar with this example: http://doc.services.openoffice.org/wiki/Documentation/DevGuide/Basic/Creating_Dialogs_at_Runtime
The extension runs OK, but I was not happy with this way of development because took a lot of time to arrange the controls in the dialog. (There wasn't any visual help, and I had to try manual which is are the best coordonates and size for my controls). There is a lot of work for XOO and I don't want to waste so much time with the GUI. The sollution I've found is this one: 1. create a new library for the new dialogs 2. add a new dialog in the library 3. design the dialog with the OpenOffice Dialog Editor. ( This one is used in generally to design dialogs that are used from macros and the events are generally handled using OO Basic Subs - OO Basic is a scripting language very similar with the Visual Basic from Microsoft) 4. export the library The library should be deployed with the rest of the extension
From the java component:
- we can access the dialog created using DialogProvider2 class. In order to use this class we have to specify of course the url of the dialog created. This one will look something like :" vnd.sun.star.script:Library1.Dialog1?location=application" - in my new library Library1 is in My Macos space and the new dialog Dialog1 is in the library. Using the DialogProvider2 class, I got a XDialog object
- after this step I can access and modify the properties of every control from the Dialog
XControlModel xControlModel1 = xTextField1Control.getModel();
XPropertySet xPropertySet1 = (XPropertySet)UnoRuntime.queryInterface(
XPropertySet.class, xControlModel1 );
try
{
aText = (String)xPropertySet1.getPropertyValue( aTextPropertyStr );
}
catch (Exception e) {
e.printStackTrace();
}
)
But what about the events? I would like to handle the events like button click and so on from my java component. Fortunately, there are more ways to do this
- http://specs.openoffice.org/ide/NonScriptDialogEvents.odt
- Write some BASIC code that implements event handlers for your dialog controls. Those handlers might be very small, in the most simple approach they would just call one of your UNO event handling objects. The BASIC library containing your glue code can easily put into the package for your extension. The OO.o Extension Manager already supports deployment of BASIC libraries
- Use the dialog editor to design the dialogs. Assign no events to the controls. At runtime, after creating the UNO AWT dialog, attach the needed event listeners to the controls
I did a small example installing the basic library and the UNO component and it works! The main advantage of this kind of development is the productivity. The advantages of the first method ( that one with all the code in java) is speed and the code homogeneity .
Another feature of the OpenOffice extension that I discovered is the "Options" from the Extension Manager. Every extension displayed in the extension manager can have some configuration options. Relative easy can be done some dialogs that will allow the user the configure the extension before installing it. ( I would like for example to add here a checkbox option - automatically connect to xwiki - to avoid trying to connect when the user only wants to edit a simple .odt file)
Other interesting feature of OOo are the Autopilot dialogs.For a wizard with more steps ( when you have to display more dialogs to make a setting), every dialog can have more pages. Every Control has a property called "Step". A control is displayed only if the step property of the dialog coincides with its step property or if it has the value 0 for the step property (0 means that it is displayed anytime).
My next small research will be about the SWriter html document format and how can I convert to and from this format.
Apr 29 2009
Introduction
Hi! My name is Cristina Scheau (cristinaS from IRC). I will work on "XWiki Integration with OpenOffice". My actual design page is : http://dev.xwiki.org/xwiki/bin/view/Design/XWikiIntegrationWithOpenOffice The project will be an Open Office extension. In a nutshell, my action plan is:
- Doing some research about the OpenOffice SDK API
- Discussing with the community about the software archtecture
- Developing a GUI for XOO extension
- Implementing a wizard for connecting to a XWiki server and a xwiki navigational panel
- Implementing the core classes that will be used in the future development
- Implementing the functionalities: edit existing XWiki pages and add new XWiki pages from OpenOffice
- Implementing the functionalities: download and upload attachments
- Implementing : editing attachments supported by Open Office
- Refining the GUI and adding new small functionalities
- Improving the project using the feedback from the users