XML-RPC文档转换服务器

cloudooo的Python项目详细描述


安装cloudooo

$ python2.6 setup.py install

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

安装libreoffice/openoffice.org

Install LibreOffice or OpenOffice.org.

创建配置文件

The configuration file is used to start the application using paster. $ cp ./cloudooo/samples/samples.conf . # Copy to current folder

The next step is define some attributes in cloudooo.conf:
  • working_path - folder to run the application. This folder need be created.
  • 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/)

运行应用程序

$ paster serve ./cloudooo.conf

or run as a daemon:

$ paster serve ./cloudoo.conf –daemon

停止应用程序

$ kill -1 PASTER_PID

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

cloudooo描述

  • xmlrpc+wsgi将是方便访问libreoffice/openoffice.org的一个桥梁。这将在wsgi(paster)中实现一个xmlrpc服务器。
  • pyuno用于连接libreoffice/openoffice.org,它使用open socket声明。这些功能都将由pyuno处理。
  • 只有一个进程可以访问libreoffice/openoffice.org。
  • 当连接到xmlrpc服务器时,所有客户端都接收相同的对象(代理)。

管理libreoffice/openoffice.org流程

  • 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, restartes processes and submit again the file;

xmlrpc服务器-xmlrpc+wsgi

  • 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 solution
    • ‘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 corrupt; - write in log the error and verify that the process aren’t in memory

1.2.3(2010-04-01)

  • Eggify handlers
  • Configuration file tells to cloudooo which handler must be loaded
  • Update interface (not implemented yet)

1.2.2(2010-02-07)

  • No longer use Xvfb.

1.2.1(2010-01-21)

  • Improve ERP5 compatibility.

1.2.0(2010-01-19)

  • Support LibreOffice3.3rc3.

1.1.0(2010-01-13)

  • Refactor runCloudOOoUnitTest.py to control better the daemon process
  • Use argparse instead of optparse
  • Refactor tests to use boolean asserts to validate True or False.
  • Use python-magic to validate the output documents according to mimetype.
  • Change folder structure of cloudooo to put handler, mimemapper, helpers related to handler in same folder than handler.
  • Refactor code to use json instead of jsonpickle.
  • Add getTableItem, getTableItemList and getTableMatrix for OOGranulate
  • Add getParagraphItemList and getParagraphItem for OOGranulate
  • Add getImageItemList and getImage for OOGranulate
  • Add OdfDocument
  • Add granulate interface.

1.0.9

  • use pkg_resources to get helper scripts.
  • move internal scripts to helper folder.
  • removed cloudooo as dependency of internal scripts.
  • modified way that the filters of OpenOffice.org are passed.

1.0.8

  • Remove all attributes that works with cloudooo script paths.
  • Use all scripts according to your python eggs.
  • Fixed problem when a spreadsheet will be converted to html.

1.0.7

  • Remove entry points, treat those as ordinary files.
  • Search all script files using pkg_resources.

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java什么数据库最类似于Map,每个用户/id存储无限多个“键”和“值”?   java仅使用super pom进行测试   内存不足如何解析java。OutOfMemoryError:Java堆空间在增加堆大小的情况下将意味着延迟OutOfMemoryError   来自另一个类的mysql和java jdbc调用[运行时应用程序]   java通过下拉菜单更改搜索框搜索的内容   JAVAlang.ClassNotFoundException:sun。jdbc。odbc。JdbcOdbcDriver   java Selenium点击链接   JavaSpringHibernate:从唯一值列表中获取对象列表   java Bing广告与桌面身份验证问题   java如何在没有任何外部SDK的情况下从安卓打印到收据打印机?   未调用java菜单片段类   java在IDEA和PyCharm中同时为同一个项目工作   java我们如何为同一个异常提供不同的海关信息   jakarta ee中是否预定义了“请求”和“响应”变量或值?   java更好地解决“之前和之后”难题?   尝试将数据从Excel添加到Java   发送电子邮件的Java代码只适用于一个电子邮件id?   java如何从资产解析XML?