README.rst 4.24 KB
Newer Older
1 2
Install Cloudooo
================
3

4 5
::
  
6
  $ python2.6 setup.py install
7

8 9 10

Warnings:
 - you must have installed setuptools>=0.6c11 in this python.
11

Kazuhiko Shiozaki's avatar
Kazuhiko Shiozaki committed
12 13
Install LibreOffice / OpenOffice.org
====================================
14

15 16 17
Install LibreOffice or OpenOffice.org.
  - http://www.libreoffice.org/download/
  - http://download.openoffice.org/
18

19 20
Create Configuration File
=========================
21

22 23 24 25
The configuration file is used to start the application using paster.

::
  
26
  $ cp ./cloudooo/sample/sample.conf ./cloudooo.conf # Copy to current folder
27

28
The next step is define some attributes in cloudooo.conf:
Gabriel Monnerat's avatar
Gabriel Monnerat committed
29
    - working_path - folder to run the application. This folder need be created.
Kazuhiko Shiozaki's avatar
Kazuhiko Shiozaki committed
30 31
    - uno_path - folder where UNO library is installed (ex. /opt/libreoffice/basis-link/program/)
    - soffice_binary_path - folder where soffice.bin is installed (ex. /opt/libreoffice/program/)
32

33 34
Run Application
===============
35

36 37
::
  
38 39
  $ paster serve ./cloudooo.conf

40

41 42 43 44
or run as a daemon:

::
  
45
  $ paster serve ./cloudoo.conf --daemon
46

47

48
Stop Application
Nicolas Delaby's avatar
Nicolas Delaby committed
49
================
50

51 52
::
  
53 54
  $ kill -1 PASTER_PID

55
Warning: always use SIGHUP because only with this signal all processes are stopped correctly.
56 57

Cloudooo Description
Nicolas Delaby's avatar
Nicolas Delaby committed
58
====================
59

Kazuhiko Shiozaki's avatar
Kazuhiko Shiozaki committed
60 61 62
- XMLRPC + WSGI will be one bridge for easy access to LibreOffice / OpenOffice.org. This will implement one XMLRPC server into WSGI (Paster).
- PyUno is used to connect to LibreOffice / OpenOffice.org stated with open socket. The features will be handled all by pyuno.
- Only a process will have access to LibreOffice / OpenOffice.org by time.
63 64
- All clients receive the same object(proxy) when connects with XMLRPC Server.

65

Kazuhiko Shiozaki's avatar
Kazuhiko Shiozaki committed
66
Managing LibreOffice / OpenOffice.org process
67

68 69 70 71 72 73 74 75 76 77 78

- start 'soffice.bin':
  
  - Pyuno start 'soffice.bin' processes and the communication is through sockets
  
  - 'soffice.bin' processes run in brackground;

- control 'soffice.bin':
     
  - If the socket lose the connection, cloudooo kills the process, restarts processes and submit again the file;

79 80 81 82

XMLRPC Server - XMLRPC + WSGI
-----------------------------

83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
- Send document to 'soffice.bin' and return the document converted with metadata
  - XMLRPC receives a file and connects to 'soffice.bin' process by pyuno;
  - The pyuno opens a new document, write, add metadata and returns the document edited or converted to xmlrpc and it return the document to the user;
  - When finalize the use of 'soffice.bin', should make sure that it was finalized;
- Export to another format;
- Invite document and return metadata only;
- Edit metadata of the document;
- Problems and possible solutions
  
  - 'soffice.bin' is stalled;
  
    - finalize the process, start 'soffice.bin' and submit the document again (without restart the cloudooo);
  
  - 'soffice.bin' is crashed;
    
    - finalize the process, verify if all the process was killed, start 'soffice.bin' and submit the document again(without restart the cloudooo)
    
  - 'soffice.bin' received the document and stalled;
    
    - if 'soffice.bin' isn't responding, kill the process and start
     
  - The document that was sent is corrupted;
    
    - write in log the error and verify that the process aren't in memory
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136


FFMPEGHandler
====================

FFMPEGHandler is a handler of cloudooo for developing GUI convertion applications
using FFmpeg cross-platform.

Introduction
The FFMPEGHandler package defines a single class, Handler, which is interface to
audio and video convertion into cloudooo.

FFMPEGHandler has been developed with python 2.6 and ffmpeg 0.6.1.

Example

Converting file:

>>> from cloudooo.handler.ffmpeg import Handler
>>> handler = Handler('my_path_data', open(test.ogv).read(), 'ogv')
>>> converted_data = handler.convert('mpeg')

Getting information of file:

>>> from cloudooo.handler.ffmpeg import Handler
>>> handler = Handler('my_path_data', open(test.ogv).read(), 'ogv')
>>> metadata = handler.getMetadata()
>>> metadata
{ 'ENCODER': 'Lavf52.64.2'}

137 138 139 140 141 142 143 144 145 146 147 148
NOTE

In case of importing FFMPEGHandler library is needed to import its used libraries
as well and set its enviroment for handler.

Example

>>> from cloudooo.handler.ffmpeg import Handler
>>> self.kw = dict(env=dict(PATH="../software/parts/ffmpeg/bin"))
>>> handler = Handler('my_path_data', open(test.ogv).read(), 'ogv', **self.kw)
>>> converted_data = handler.convert('mpeg')