class IManager(Interface):
"""Provides method to manipulate documents and metadatas using OOo"""
def convertFile(file, source_format, destination_format, zip,
page=None, **kw):
"""Returns the converted file in the given format.
zip parameter can be specified to return the result of conversion
in the form of a zip archive (which may contain multiple parts).
This can be useful to convert a single ODF file to HTML
and png images.
"""
def getFileMetadataItemList(file, source_format, base_document):
"""Returns a list key, value pairs representing the
metadata values for the document. The structure of this
list is "unpredictable" and follows the convention of each file.
"""
def updateFileMetadata(file, source_format, metadata_dict):
"""Updates the file in the given source_format with provided metadata and
return the resulting new file."""
def getAllowedExtensionList(request_dict):
"""Returns a list extension which can be generated from given extension or
document type."""
Cloudooo defines interfaces for the service it provides as well as for components it can support. The main interface is named IManager. It allows to convert a file (convertFile), extract metadata from a file (getFileMetadataItemList), update metadata into a file (updateFileMetadata) and request the list of extensions which a file can be converted to (ex. .doc, .pdf, etc.).
Currently, the conversion interface only takes specified parameters. In the future, it should support more conversion parameters, so that it is possible to change the resolution of an image or access the nth image in a video. Such features are already supported in ERP5 through built-in conversion APIs which are meant to be moved out from ERP5 to Cloudooo.