Hi,

the current documentation of the css.document.DocumentInfo and
css.document.StandaloneDocumentInfo services is outdated and buggy, see

http://api.openoffice.org/docs/common/ref/com/sun/star/document/StandaloneDocumentInfo.html

and included links for the current documentation and

http://qa.openoffice.org/issues/show_bug.cgi?id=26672

for an issue describing the obvious documentation (and/or
implementation) bugs.

Fixing this seems to be a great opportunity to convert the
StandaloneDocumentInfo service to a "new style" service with a multiple
inheritance interface and attributes, keeping the PropertySet only for
compatibility reasons. "Custom" properties would be handled by an
explicit interface then as the current way to add them to the property
set is prone to name clashes.

This has let me think whether we could have a "real" service for the
non-standalone document info also. This would allow us to remove any
link dependencies to the implementation class in the code and also make
the implementation exchangeable.

Another idea is: why not have only one service for both cases,
standalone as document based as well?

For loading and saving document based DocumentInfo objects the XML
filter currently hands over the document model to the importer/exporter.
They ask the model for its DocumentInfo and import or export everything
using the DocumentInfo API.

We also could create a "documentinfo object" and call methods to load
itself from the document storage or store itself into it. The standalone
case would be supported by providing methods to load and store from a
MediaDescriptor.

Alltogether I think we could have (custom properties, attributes and
exceptions still to be defined):

interface XDocumentInformation // don't have a better idea ATM
{
    interface XDocumentInfo;
    interface XPropertySet;
    interface XFastPropertySet; // ?!
    interface XPropertyContainer;

    loadFromStorage( [in] Storage stor );
    storeToFromStorage( [in] Storage stor );
    loadFromMediaDescriptor( [in]
        sequence<com::sun::star::beans::PropertyValue> Arguments)
    loadStoreToMediaDescriptor( [in]
        sequence<com::sun::star::beans::PropertyValue> Arguments)
};

service DocumentInfo: XDocumentInformation
{
};

This service is usable for both cases, standalone and document based.

The service "StandaloneDocumentInfo" could stay as it is and is only
kept for old code that doesn't use the new one so there is no value in
converting it to a new style service.

Ciao,
Mathias

-- 
Mathias Bauer (mba) - Project Lead OpenOffice.org Writer
OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS
Please don't reply to "[EMAIL PROTECTED]".
I use it for the OOo lists and only rarely read other mails sent to it.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to