Commit 7e6b8797 authored by Gabriel Monnerat's avatar Gabriel Monnerat

fix compatibility with erp5 : these changes remove two filters that can not be...

fix compatibility with erp5 : these changes remove two filters that can not be used to export odp's to html

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk/utils@37588 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 50e3d535
......@@ -190,13 +190,18 @@ class Manager(object):
This is a Backwards compatibility provided for ERP5 Project, in order to keep
compatibility with OpenOffice.org Daemon.
"""
# XXX - ugly way to remove "/" and "."
orig_format = orig_format.split('.')[-1]
orig_format = orig_format.split('/')[-1]
if "htm" in format:
zip = True
else:
zip = False
try:
response_dict = {}
# XXX - use html format instead of xhtml
if orig_format == "presentation" and format == "xhtml":
format = 'html'
response_dict['data'] = self.convertFile(file, orig_format, format, zip)
# FIXME: Fast solution to obtain the html or pdf mimetypes
if zip:
......@@ -222,6 +227,10 @@ class Manager(object):
try:
extension_list = self.getAllowedExtensionList({"mimetype": content_type})
response_dict['response_data'] = extension_list
# XXX - procedure to remove duplicate filters
for data in response_dict['response_data']:
if data[0] == "html":
response_dict['response_data'].remove(data)
return (200, response_dict, '')
except Exception, e:
logger.error(e)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment