The opentemplate client is an addon that will work as a downloader and browser of the recent cliparts, extensions and templates of the OpenTemplate.org site. The user will be able to get the latest templates from OT (OpenTemplates) and even filter the retrieval to just get a specific category.
This addon will be able to connect to the Opentemplate.org API and retrieve the data, parse it and store into a listbox. Once the user decide what he want's it will submit the URI and retrieve the content (using cURL). The add-on itself will provide with filters on combolist so that the retrieval can be filtered out before hand.
The main challenges are:
- the ideal widget would be a grid application as opposed to listbox.
- Retrieving an image might be challenging.
- Good OS detection and path manipulation (localization).
- Load images into a image component.
- Codewise detect and register each of the types of extensions into OOo.
How it works?
The Opentemplate client is composed of different parts, the client would need to be accesible to the users. The next step is to define the retrieval of the webservice on the OpenTemplate API.
The OpenTemplate API is based on a REST-inspired web service where it has some authentication process in order to use it. You can access the service through your opentemplate.org account or through a valid ip.
The next step is to interact with the API and filter the content, the client would need to.
So far there are some useful snippets written in OOoBasic to help us get most out of the content.
Register templates from Basic
com.sun.star.frame.DocumentTemplates service can be used to do that. http://api.openoffice.org/docs/common/ref/com/sun/star/frame/DocumentTemplates.html For instance.
oDocTemplates = CreateUnoService("com.sun.star.frame.DocumentTemplates")
bResult = oDocTemplates.addTemplate("group","templ","file:///C:/usr/1.ott")
Retrieve data online
Parse XML from Basic
Currently just a SAX model was found. I would want to see miniDom or DOM parsing for REST.
- Using UNO's Xml sax parser via the API - http://www.oooforum.org/forum/viewtopic.phtml?t=4907
- Query Results to XML - http://www.oooforum.org/forum/viewtopic.phtml?t=22956