Package nsi :: Package granulate :: Module Granulate' :: Class Granulate
[hide private]
[frames] | no frames]

Class Granulate

source code

object --+
         |
        Granulate


- Provides the content granularization delegating the responsability to the appropriate class.    
- Keeps the oood server related information (host and port).

About the usage of the methods: getSummaryDocument, getThumbnailsDocument, getTableDocumentList,
getImageDocumentList and granulateDocument:           
    - The first parameter is the filename (without the path), like "test.odt"
    - The second one is a string representing the file content. 
            Ex. >>> file = open(filepath,'r') 
                >>> file.read()        

Instance Methods [hide private]
 
__init__(self, host=None, port=None)
Set the host and port of the oood daemon during the instance creation
source code
 
__process(self, filename=None, data=None)
Checks the file type and creates the proper object.
source code
 
getImageDocumentList(self, filename=None, data=None)
Get a Image List from Office and PDF Documents
source code
 
getServer(self)
Get OpenOffice Daemon - oood informations for conversion document
source code
 
getSummaryDocument(self, filename=None, data=None)
Get Office Document's summary (odf, doc, ppt for instance)
source code
 
getTableDocumentList(self, filename=None, data=None)
Get a Table List from Office and PDF Documents
source code
 
getThumbnailsDocument(self, filename=None, data=None)
Get Office Document's Thumbnails (odf, doc, ppt for instance)
source code
 
granulateDocument(self, filename=None, data=None)
Retrieve the grains of Documents.
source code
 
setServer(self, host=None, port=None)
Set OpenOffice Daemon - oood host and port for conversion document
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Class Variables [hide private]
  ooodServer = None
  supportedOfficeDocument = ('application/vnd.oasis.opendocument...
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, host=None, port=None)
(Constructor)

source code 

Set the host and port of the oood daemon during the instance creation

Overrides: object.__init__

granulateDocument(self, filename=None, data=None)

source code 

Retrieve the grains of Documents. (tables and images, for example)


Class Variable Details [hide private]

supportedOfficeDocument

Value:
('application/vnd.oasis.opendocument.text',
 'application/vnd.sun.xml.writer',
 'application/msword',
 'application/rtf',
 'application/vnd.stardivision.writer',
 'application/x-starwriter',
 'application/vnd.oasis.opendocument.spreadsheet',
 'application/vnd.sun.xml.calc',
...