Language

The Free and Open Productivity Suite
Released: Apache OpenOffice 4.1.15

API

SDK

Tips ‘n’ Tricks

Miscellaneous


:: com :: sun :: star :: document ::

service ExtendedTypeDetection
Description
describes a class of service which will be used for deep TypeDetection in a generic way

Due to the registered types, flat TypeDetection is already possible, i.e. the assignment of types (e.g. to a URL) only on the basis of configuration data. If, however, you imagine special cases (e.g. modifying the file extension of a Writer file from .sdw to .doc), it quickly becomes clear that you cannot always get a correct result with flat detection. To be certain to get correct results, you need deep detection, i.e. the file itself has to be examined. And that is exactly the function of DetectServices. They get all the information collected so far on a document and then decide which type to assign it to. In the new modular model, such a detector is meant as UNO service which registers itself in the office and is requested by the generic type detection if necessary.
Therefore you need two pieces of information:

  • The ServiceName - This must be a valid UNO service name. It is also an entry in the corresponding configuration list.
    Example: "com.company.devision.DetectService"
    Note that this realy means the implementation name of the service. Because it's not possible otherwise to distinguish between more then one registered detect services in same office installation! But it's possible for the generic type detection to create an uno service by his implementation name too.
  • A list of Types able to be recognized by this service - You can also implement and register detectors for groups of types.
See service TypeDetection and his configuration for further informations.

See also
TypeDetection
Developers Guide
OfficeDev - Integrating Import and Export Filters
OfficeDev - XML Filter Detection

Exported Interfaces - Summary
XExtendedFilterDetection

makes the deep detection (details)

Exported Interfaces - Details
XExtendedFilterDetection
Description
makes the deep detection

Generic type detection searchs for a registered DetectService for an already flat detected type. If any could be found it will be created and used by calling methods of this interface. It gets a MediaDescriptor which contains information about the document which should be detected and must return

  • an internal type name for detected format
  • or NULL if format is unknown nor supported.
May be that given descriptor already includes the opened document stream as parameter MediaDescriptor::InputStream. Then this one should be used everytime. If it's not included in descriptor the value of MediaDescriptor::URL must be used to open requested ressource by this service.
Note: The stream should be added to the descriptor if it wasn't a part of them before. So further steps on the whole detection process can use it and will perform her work. It's further not allowed to hold a reference to this stream any longer. Only copies will be valid then. Otherwise nobody can close this stream then.


 
Top of Page

Apache Software Foundation

Copyright & License | Privacy | Contact Us | Donate | Thanks

Apache, OpenOffice, OpenOffice.org and the seagull logo are registered trademarks of The Apache Software Foundation. The Apache feather logo is a trademark of The Apache Software Foundation. Other names appearing on the site may be trademarks of their respective owners.