|
|
API@OOo: NEWSLETTER October/2003
Dear OOo community,
This is the second issue of the API@OOo NEWSLETTER. At the beginning
of each month, I am summarizing what was going on in the previous month
within the OOo API project and the OOo SDK.
*** ====================================================================
*** OOo API and OOo SDK Highlights this Month
*** --------------------------------------------------------------------
- #01: Code Snippet Generator
- #02: Mysterious Slow Printing/Storing via C++/Java
- #03: Thread Safety of UNO Bride and OOo API:
- #04: Cause of Problems with PostgreSQL and line breaks
- #05: XDispatch API and Slot-IDs
- #06: BASIC macros from the command line
- #07: OOo as a Windows NT Service
- #08: C++ Header Files for SDK
- #09: Comparing OOo TextDocuments Programmatically
- #10: New API@OOo Periodicals
- #11: OOoBean: API Prototype and Test Framework draft available
- #12: OOoBASIC: ThisComponent <-> StarDesktop.CurrentComponent
- #13: Books on OOoBASIC by Wolfgang Henderkes
- #14: StarDesktop.ThisComponent and StarDesktop.CurrentComponent
- #15: Replacing a TextTable with a bookmark in a TextDocument
- #16: Setting a Document Read-Only
- #17: Converting SWX to PDF
- #18: Inserting an Image into a Document
- #19: Controlling the Termination of OOo from the OOoBean
- #20: Why Any Values Cannot be Casted to Interfaces
- #21: C++-UNO: Reference<> and Any Hints
- #22: OpenOffice.org Calc component in Browser (Applet, Active-X)
- #23: Running Multiple Instances of OOo for a Single User
- #24: Findin Filter Names for MediaDescriptor
- #25: Approaches for Avoiding queryInterface in Java
- #26: Getting Available Printer Names with Java
- #27: How to Use the Mail Merge API
- #28: Renaming BASIC Libraries by User Interface
- #29: How to Use UserFields with Date/Time Formats in Text Docs
- #30: Changing the Cursor of the Document Window
- #31: Why Remote Connect does not Work even Though it Works Locally
- #32: Escape Characters in BASIC Strings
*** ====================================================================
*** #01: Code Snippets Generator
*** --------------------------------------------------------------------
Paolo Mantovani announces [1] his generator for CodeSnippets [2].
The CodeSnippets collection is an attempt to make answers to questions
which include source code and where given on our mailing list, available
in a structured and searchable form [3]
1:http://api.openoffice.org/servlets/ReadMsg?msgId=847215&listName=dev
2:http://www.openoffice.org/issues/showattachment.cgi?attach_id=9857
3:http://api.openoffice.org/source/browse/api/www/Examples/Snippets/
*** ====================================================================
*** #02: Mysterious Slow Printing/Storing via C++/Java
*** --------------------------------------------------------------------
The mysterious slow printing and storing of documents via C++ and Java
was solved [1]: In conjunction with yield in the message queue processing
in the Windows implementation of VCL was set to sleep for a second. As
soon as the call came from another thread then the main thread, as it is
the case for the C++ and Java UNO bridge, processing was slowed down.
For bridges calling into the main thread of OOo, like COM, the problem
did not occur. An IssueZilla defect report is filed [2] and the fix is
expected for OOo 1.1.1.
1:http://api.openoffice.org/servlets/ReadMsg?msgId=847886&listName=dev
2:http://www.openoffice.org/issues/show_bug.cgi?id=18883
*** ====================================================================
*** #03: Thread Safety of UNO Bride and OOo API:
*** --------------------------------------------------------------------
Several OOo developers stated that the UNO bridge is thread save and
the OOo API is supposed to be thread safe [1-5]. But also was stated
in the same articles that defects (e.g. deadlocks or crashes) are not
unlikely in this area and should be reported to IssueZilla [6].
1:http://api.openoffice.org/servlets/ReadMsg?msgId=849240&listName=dev
2:http://api.openoffice.org/servlets/ReadMsg?msgId=849412&listName=dev
3:http://api.openoffice.org/servlets/ReadMsg?msgId=850820&listName=dev
4:http://api.openoffice.org/servlets/ReadMsg?msgId=855941&listName=dev
5:http://api.openoffice.org/servlets/ReadMsg?msgId=849289&listName=dev
6:http://www.openoffice.org/project_issues.html
*** ====================================================================
*** #04: Cause of Problems with PostgreSQL and line breaks
*** --------------------------------------------------------------------
Andre Roth figured out [1] that wrong line breaks when doing mailmerge via
PostgreSQL [2] occur due to a strange conversion within the PostgreSQL
ODBC driver.
1:http://api.openoffice.org/servlets/ReadMsg?msgId=855970&listName=dev
2:http://www.postgresql.org/
*** ====================================================================
*** #05: XDispatch API and Slot-IDs
*** --------------------------------------------------------------------
Michael Hoennig pointed [1] to a file which contains definitions of the
XDispatch slot-API [2]. But he also stated that this API, other then
the normal API, is not stable and might change without notice.
1:http://api.openoffice.org/servlets/ReadMsg?msgId=855999&listName=dev
2:http://api.openoffice.org/servlets/ProjectDownloadList?action=download&dlID=12
*** ====================================================================
*** #06: BASIC macros from the command line
*** --------------------------------------------------------------------
Mathias Bauer explained [1] how BASIC macros can be started from the
command line.
1:http://api.openoffice.org/servlets/ReadMsg?msgId=856094&listName=dev
*** ====================================================================
*** #07: OOo as a Windows NT Service:
*** --------------------------------------------------------------------
Ralf Wenzel pointed 1] to a link [2] how to run OOo as a Windows NT Service.
1:http://api.openoffice.org/servlets/ReadMsg?msgId=863018&listName=dev
2:http://www.techeez.com/windows_tips/service_under_nt.htm
*** ====================================================================
*** #08: C++ Header Files for SDK:
*** --------------------------------------------------------------------
Juergen Schmidt explained [1] why the SDK does not contain C++ header files
and how you can generate them on your own.
1:http://api.openoffice.org/servlets/ReadMsg?msgId=863786&listName=dev
*** ====================================================================
*** #09: Comparing OOo TextDocuments Programmatically
*** --------------------------------------------------------------------
Michael Hoennig stated [1] that there is no API yet for the user interface
function of comparing documents (Menu: Edit/Compare Documents). But
Darragh Sherwin posted [2] pseudo code which could be used to create such
a function.
1:http://api.openoffice.org/servlets/ReadMsg?msgId=858151&listName=dev
2:http://api.openoffice.org/servlets/ReadMsg?msgId=858921&listName=dev
*** ====================================================================
*** #10: New API@OOo Periodicals
*** --------------------------------------------------------------------
On October 1st we started with the API@OOo NEWSLETTER. Where this
newsletter is mostly a summary of important issues in regard to the
OOo API and OOo SDK, we started some other periodicals with different
agendas:
API@OOo TOPIC is our 2-weekly platform for a single current issue every
time, kinda the "topic of the week", except that it only comes every
two weeks. The first reading [1] set focus on our CodeSnippet project
and the second release [2] set focus on prospects of contributing to OOo.
API@OOo TOPIC, as well as API@Ooo NEWSLETTER, are also posted to the
low-traffic mailing list features@api.openoffice.org for those who
cannot deal with the huge number of mails on dev@api.openoffice.org.
With API@OOo PENDING I started an experiment of animating the community
and core developers to answer all questions. Thus unanswered questions
to the list are tracked and listed [3]. This is neither a promise to
answer all questions nor a motivation not to read the documentation
anymore. If questions are answered in the documentation and can be
expected to be found there, the answer simply might be "see manual".
API@OOo GUIDE is the new name for a periodical which I was already
posting irregularly for quite a while: Hints and rules about this list.
This periodical now is posted once a mouth [4] automatically.
1:http://api.openoffice.org/servlets/ReadMsg?msgId=863958&listName=dev
2:http://api.openoffice.org/servlets/ReadMsg?msgId=869847&listName=dev
3:http://api.openoffice.org/servlets/ReadMsg?msgId=867133&listName=dev
4:http://api.openoffice.org/servlets/ReadMsg?msgId=881371&listName=dev
*** ====================================================================
*** #11: OOoBean: API Prototype and Test Framework draft available
*** --------------------------------------------------------------------
Michael Hoennig committed and announced [1] the first prototype of the new
OOoBean basic API [3]. It comes with a test framework draft. The OOoBean
has not yet any functionality, it just compiles. But the purpose is
only a discussion base of the API yet. The project website [2] is
updated too.
1:http://api.openoffice.org/servlets/ReadMsg?msgId=867771&listName=dev
2:http://api.openoffice.org/source/browse/api/www/Projects/OOoBean/source/
3:http://api.openoffice.org/Projects/OOoBean/
*** ====================================================================
*** #12: OOoBASIC: ThisComponent <-> StarDesktop.CurrentComponent
*** --------------------------------------------------------------------
Stephan Wunderlich pointed out [1] why ThisComponent is to be preferred
over StarDesktop.CurrentComponent in document bound macros. It explains
why sometimes macros don't want to work, if StarDesktop.CurrentComponent
is used.
1:http://api.openoffice.org/servlets/ReadMsg?msgId=867808&listName=dev
*** ====================================================================
*** #13: Books on OOoBASIC by Wolfgang Henderkes
*** --------------------------------------------------------------------
Wolfgang Henderkes mentioned [1] his books about OOoBASIC. They are available
in German and a translation for French is in progress.
One of his books "SO/OOo-BASIC Tutor fuer Einsteiger" is available online [2].
1:http://api.openoffice.org/servlets/ReadMsg?msgId=870706&listName=dev
2:http://www.IT-Know-how.NET.
*** ====================================================================
*** #14: StarDesktop.ThisComponent and StarDesktop.CurrentComponent
*** --------------------------------------------------------------------
Mathias Bauer explained [1] the difference between the OOoBASIC
properties StarDesktop.ThisComponent and StarDesktop.CurrentComponent
and why the latter creates problems when using the OOo IDE.
1:http://api.openoffice.org/servlets/ReadMsg?msgId=874234&listName=dev
*** ====================================================================
*** #15: Replacing a TextTable with a bookmark in a TextDocument
*** --------------------------------------------------------------------
Stephan Wunderlich posted [1] an OOoBASIC code example of how to
replace a TextTable with a bookmark in a TextDocument.
1:http://api.openoffice.org/servlets/ReadMsg?msgId=873459&listName=dev
*** ====================================================================
*** #16: Setting a Document Read-Only
*** --------------------------------------------------------------------
Matthias Bauer explained [1] that the read-only mode of OOo documents
is a pure UI feature and he added some OOoBASIC source code to
switch this mode using the dispatch API. Additionally he opened
an RFE in IsszueZilla [2].
1:http://api.openoffice.org/servlets/ReadMsg?msgId=874387&listName=dev
2:http://www.openoffice.org/issues/show_bug.cgi?id=21210
*** ====================================================================
*** #17: Converting SWX to PDF
*** --------------------------------------------------------------------
Stephan Wunderlich posted [1] OOoBASIC source code to convert an SXW file
to PDF. The important point is that it is a pure export (a document
cannot be represented by a PDF file, thus storeToURL is to be used,
not storeAsURL [2].
1:http://api.openoffice.org/servlets/ReadMsg?msgId=877325&listName=dev
2:http://api.openoffice.org/servlets/ReadMsg?msgId=877480&listName=dev
*** ====================================================================
*** #18: Inserting an Image into a Document
*** --------------------------------------------------------------------
Stephan Wunderlich posted [1] a code example to insert an image with Java
into a TextDocument at a given TextCursor position. Oliver Hopt posted
[2] a version in Java. Who transforms these into our XML code snippet
format [3]?
1:http://api.openoffice.org/servlets/ReadMsg?msgId=871171&listName=dev
2:http://api.openoffice.org/servlets/ReadMsg?msgId=890809&listName=dev
3:http://api.openoffice.org/SDK/snippets/index.html
*** ====================================================================
*** #19: Controlling the Termination of OOo from the OOoBean
*** --------------------------------------------------------------------
Juergen Kindler explained [1] how to control termination of OOo
from applications using the OOo JavaBean. This is done by adding a
terminate listener on OOo and a shutdown hook on the Java runtime.
1:http://api.openoffice.org/servlets/ReadMsg?msgId=872283&listName=dev
*** ====================================================================
*** #20: Why Any Values Cannot be Casted to Interfaces
*** --------------------------------------------------------------------
Juergen Schmidt answered [1] why some Java programs fail with OOo 1.1
which worked with previous versions when casting an Any to an interface.
It was actually a bug in previous versions that it worked.
To convert an Any Java, you always should use the AnyConverter helper
class.
1:http://api.openoffice.org/servlets/ReadMsg?msgId=872559&listName=dev
*** ====================================================================
*** #21: C++-UNO: Reference<> and Any Hints
*** --------------------------------------------------------------------
Daniel Boelzle published common hints and peephole optimizations
concerning C++ Any and Reference<> objects. Juergen Schmidt put
these in the tips and tricks area [2] on our website.
1:http://api.openoffice.org/servlets/ReadMsg?msgId=877615&listName=dev
2:http://api.openoffice.org/TipsAndTricks/cpp_uno_coding_hints.html
*** ====================================================================
*** #22: OpenOffice.org Calc component in Browser
*** --------------------------------------------------------------------
Michael Hoennig pointed out [1] upcoming possibilities to display OOo
documents in a browser as a Java Applet or Active-X control. Mathias
Bauer replied [2] that a simple Active-X control is already available
[3].
1:http://api.openoffice.org/servlets/ReadMsg?msgId=886453&listName=dev
2:http://api.openoffice.org/servlets/ReadMsg?msgId=889492&listName=dev
3:http://util.openoffice.org/source/browse/util/extensions/source/activex/
*** ====================================================================
*** #23: Running Multiple Instances of OOo for a Single User
*** --------------------------------------------------------------------
Juergen Schmidt posted [1] a solution of how to run multiple OOo
instances under the same user. Where the principle is the same for
both UNIX and Windows, for both operating systems details are given.
Joerg Barfurth added [2] some information on how to setup multiple
OOo environments without physical copies.
1:http://api.openoffice.org/servlets/ReadMsg?msgId=888981&listName=dev
2:http://api.openoffice.org/servlets/ReadMsg?msgId=891087&listName=dev
*** ====================================================================
*** #24: Finding Filter Names for MediaDescriptor
*** --------------------------------------------------------------------
Mathias Bauer pointed out [1] where to find the names of the filters
which can be used in com.sun.star.document.MediaDescriptor [2].
1:http://api.openoffice.org/servlets/ReadMsg?msgId=891021&listName=dev
2:http://www.openoffice.org/files/documents/25/111/filter_description.html
*** ====================================================================
*** #25: Approaches for Avoiding queryInterface in Java
*** --------------------------------------------------------------------
Jonathon proposed a wrapper [1] library for spreadsheet documents to
drastically reduce the need for queryInterface calls in Java. Michael
Hoennig stated [2] that something similar is planned as an official UNO
feature, but that (and why) Jonathon's approach is still sensible [3].
Stephan Bermann explained [4] how his approach will work. And finally
Jonathon announced [5] that he started his project.
1:http://api.openoffice.org/servlets/ReadMsg?msgId=888354&listName=dev
2:http://api.openoffice.org/servlets/ReadMsg?msgId=888525&listName=dev
3:http://api.openoffice.org/servlets/ReadMsg?msgId=891494&listName=dev
4:http://api.openoffice.org/servlets/ReadMsg?msgId=902273&listName=dev
5:http://api.openoffice.org/servlets/ReadMsg?msgId=901791&listName=dev
*** ====================================================================
*** #26: Getting Available Printer Names with Java
*** --------------------------------------------------------------------
Hal Vaughan presented [1] his solution of getting all available printer
names from a Java application for use in PrinterDescriptor with XPrintable.
1:http://api.openoffice.org/servlets/ReadMsg?msgId=902158&listName=dev
*** ====================================================================
*** #27: How to Use the Mail Merge API
*** --------------------------------------------------------------------
Andre Roth pointed [1] to an example of using the mail merge API from
Andrew Pitonyak's macro collection [2].
1:http://api.openoffice.org/servlets/ReadMsg?msgId=894267&listName=dev
2:http://www.pitonyak.org/
*** ====================================================================
*** #28: Renaming BASIC Libraries by User Interface
*** --------------------------------------------------------------------
Bernard Marcelly explained [1] how to change the name of a BASIC library
from the Library tab page of the Organizer dialog.
1:http://api.openoffice.org/servlets/ReadMsg?msgId=897608&listName=dev
*** ====================================================================
*** #29: How to Use UserFields with Date/Time Formats in Text Docs
*** --------------------------------------------------------------------
Andrew Pitonyak posted [1] a code example from his macro collection [2]
of how to use userfields with date/time format in text documents.
1:http://api.openoffice.org/servlets/ReadMsg?msgId=898100&listName=dev
2:http://www.pitonyak.org/oo.php
*** ====================================================================
*** #30: Changing the Cursor of the Document Window
*** --------------------------------------------------------------------
Andrew Pitonyak summarized [1] some previously given information on how
to change the screen cursor of a OOo document window.
1:http://api.openoffice.org/servlets/ReadMsg?msgId=901486&listName=dev
*** ====================================================================
*** #31: Why Remote Connect does not Work even Though it Works Locally
*** --------------------------------------------------------------------
Kai Sommerfeld explained [1] how it can happen that a local process can
connect to OOo but no remote process from other machines. The solution
is, not just listen to localhost.
1:http://api.openoffice.org/servlets/ReadMsg?msgId=904801&listName=dev
*** ====================================================================
*** #32: Escape Characters in BASIC Strings
*** --------------------------------------------------------------------
Andreas Bregas answered [1] to a question of how control characters
can be represented in BASIC. Escape characters to not work, but the
chr() function of BASIC does.
1:http://api.openoffice.org/servlets/ReadMsg?msgId=902696&listName=dev
*** ====================================================================
*** About this NEWSLETTER
*** --------------------------------------------------------------------
If you think this newsletter is useful and you would like to take over
responsibility for the API@OOo NEWSLETTER, just drop us a hint. Or if
you just have something interesting for the next API@OOo NEWSLETTER,
mail your article to mi@openoffice.org. The community would appreciate
your contribution.
Michael
|


