Difference between revisions of "API/Samples"
Line 1: | Line 1: | ||
UNO allows the usage of the OpenOffice.org API from different programming languages and it is often very useful to find some short examples showing different API use cases for different programming languages. Under this section in the wiki you can find examples of such API use case for the different supported programming languages. | UNO allows the usage of the OpenOffice.org API from different programming languages and it is often very useful to find some short examples showing different API use cases for different programming languages. Under this section in the wiki you can find examples of such API use case for the different supported programming languages. | ||
− | ==Samples== | + | == Samples == |
* [[API/Samples/Java]] | * [[API/Samples/Java]] | ||
Line 10: | Line 10: | ||
* [[API/Samples/Any_Language]] | * [[API/Samples/Any_Language]] | ||
− | ==Guideline== | + | == Where to get the sourcecode? == |
+ | |||
+ | You can find some of the examples described above (and additional stuff) in the OpenOffice.org Subversion repository. The directory structure below /contrib/sdk is similar to the one in the wiki: | ||
+ | |||
+ | /contrib/sdk/examples/java contains - as you might expect - Java examples | ||
+ | |||
+ | === Checkout the sourcecode === | ||
+ | |||
+ | You need a working Subversion client to checkout the source from the repository. On Unix you can use the following command to retrieve all Java examples: | ||
+ | |||
+ | svn export svn://svn.services.openoffice.org/ooo/contrib/sdk/examples/java java-examples | ||
+ | |||
+ | On Windows you can use a graphical client, e.g. [http://tortoisesvn.net/ TortoiseSVN]. | ||
+ | |||
+ | == Guideline == | ||
This example section follows some rules that should be taken into account when somebody wants to contribute to these example collection. The examples for the different languages are collected dynamically and that is one reason why contributors should follow these rules. | This example section follows some rules that should be taken into account when somebody wants to contribute to these example collection. The examples for the different languages are collected dynamically and that is one reason why contributors should follow these rules. | ||
Revision as of 14:44, 9 January 2009
UNO allows the usage of the OpenOffice.org API from different programming languages and it is often very useful to find some short examples showing different API use cases for different programming languages. Under this section in the wiki you can find examples of such API use case for the different supported programming languages.
Samples
- API/Samples/Java
- API/Samples/Cpp
- API/Samples/StarBasic
- API/Samples/Python
- API/Samples/Groovy
- API/Samples/Any_Language
Where to get the sourcecode?
You can find some of the examples described above (and additional stuff) in the OpenOffice.org Subversion repository. The directory structure below /contrib/sdk is similar to the one in the wiki:
/contrib/sdk/examples/java contains - as you might expect - Java examples
Checkout the sourcecode
You need a working Subversion client to checkout the source from the repository. On Unix you can use the following command to retrieve all Java examples:
svn export svn://svn.services.openoffice.org/ooo/contrib/sdk/examples/java java-examples
On Windows you can use a graphical client, e.g. TortoiseSVN.
Guideline
This example section follows some rules that should be taken into account when somebody wants to contribute to these example collection. The examples for the different languages are collected dynamically and that is one reason why contributors should follow these rules.
- select the right programming language and the appropriate sub category (e.g. Writer, Calc, ....)
- save your example in an hierarchical structure, e.g API/Samples/Java/Office/MyExample
- use always the category API and Samples and additionally the category for your language ad sub category. In the example above it is Java and Office
The hierarchical structure can be extended on demand to group examples in a further category!