Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
cloudooo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
cloudooo
Commits
6b0b9c40
Commit
6b0b9c40
authored
Nov 08, 2022
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ooo: add support for flat XML
parent
4e4b1c2e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
10 deletions
+36
-10
cloudooo/handler/ooo/tests/testOooHandler.py
cloudooo/handler/ooo/tests/testOooHandler.py
+32
-10
cloudooo/mime.types
cloudooo/mime.types
+4
-0
No files found.
cloudooo/handler/ooo/tests/testOooHandler.py
View file @
6b0b9c40
...
...
@@ -232,6 +232,7 @@ class TestHandler(HandlerTestCase):
[
(
'application/pdf'
,
'PDF - Portable Document Format'
),
(
'application/postscript'
,
'EPS - Encapsulated PostScript'
),
(
'application/vnd.oasis.opendocument.graphics'
,
'ODF Drawing'
),
(
'application/vnd.oasis.opendocument.graphics-flat-xml'
,
u'Flat XML ODF Drawing'
),
(
'image/gif'
,
'GIF - Graphics Interchange Format'
),
(
'image/jpeg'
,
'JPEG - Joint Photographic Experts Group'
),
(
'image/png'
,
'PNG - Portable Network Graphic'
),
...
...
@@ -248,9 +249,13 @@ class TestHandler(HandlerTestCase):
def
testGetAllowedConversionFormatList_ApplicationVndOasisOpendocumentText
(
self
):
"""Test allowed conversion format for application/vnd.oasis.opendocument.text"""
for
content_type
in
(
"application/vnd.oasis.opendocument.text;ignored=param"
,
"application/vnd.oasis.opendocument.text-flat-xml;ignored=param"
,
):
self
.
assertEquals
(
sorted
(
Handler
.
getAllowedConversionFormatList
(
"application/vnd.oasis.opendocument.text;ignored=param"
)),
[
(
'application/msword'
,
'Microsoft Word 97-2003'
),
sorted
(
Handler
.
getAllowedConversionFormatList
(
content_type
)),
[
(
'application/msword'
,
'Microsoft Word 97-2003'
),
(
'application/pdf'
,
'PDF - Portable Document Format'
),
(
'application/rtf'
,
'Rich Text'
),
(
'application/vnd.oasis.opendocument.text'
,
'ODF Text Document'
),
...
...
@@ -260,13 +265,8 @@ class TestHandler(HandlerTestCase):
(
'image/jpeg'
,
'JPEG - Joint Photographic Experts Group'
),
(
'image/png'
,
'PNG - Portable Network Graphic'
),
(
'text/html'
,
'HTML Document (Writer)'
),
(
'text/plain'
,
'Text - Choose Encoding'
)
])
def
testGetAllowedConversionFormatList_ApplicationVndOasisOpendocumentTextFlatXml
(
self
):
"""Test allowed conversion format for application/vnd.oasis.opendocument.text-flat-xml"""
self
.
assertEquals
(
sorted
(
Handler
.
getAllowedConversionFormatList
(
"application/vnd.oasis.opendocument.text-flat-xml;ignored=param"
)),
[])
(
'text/plain'
,
'Text - Choose Encoding'
),
])
def
testGetAllowedConversionFormatList_ApplicationVndOpenxmlformatsOfficedocumentWordprocessingmlDocument
(
self
):
"""Test allowed conversion format for application/vnd.openxmlformats-officedocument.wordprocessingml.document"""
...
...
@@ -291,6 +291,7 @@ class TestHandler(HandlerTestCase):
[
(
'application/pdf'
,
'PDF - Portable Document Format'
),
(
'application/postscript'
,
'EPS - Encapsulated PostScript'
),
(
'application/vnd.oasis.opendocument.graphics'
,
'ODF Drawing'
),
(
'application/vnd.oasis.opendocument.graphics-flat-xml'
,
u'Flat XML ODF Drawing'
),
(
'image/gif'
,
'GIF - Graphics Interchange Format'
),
(
'image/jpeg'
,
'JPEG - Joint Photographic Experts Group'
),
(
'image/png'
,
'PNG - Portable Network Graphic'
),
...
...
@@ -306,6 +307,7 @@ class TestHandler(HandlerTestCase):
[
(
'application/pdf'
,
'PDF - Portable Document Format'
),
(
'application/postscript'
,
'EPS - Encapsulated PostScript'
),
(
'application/vnd.oasis.opendocument.graphics'
,
'ODF Drawing'
),
(
'application/vnd.oasis.opendocument.graphics-flat-xml'
,
u'Flat XML ODF Drawing'
),
(
'image/gif'
,
'GIF - Graphics Interchange Format'
),
(
'image/jpeg'
,
'JPEG - Joint Photographic Experts Group'
),
(
'image/png'
,
'PNG - Portable Network Graphic'
),
...
...
@@ -324,6 +326,7 @@ class TestHandler(HandlerTestCase):
(
'application/vnd.ms-excel'
,
'Microsoft Excel 97-2003'
),
(
'application/vnd.ms-excel.sheet.macroEnabled.12'
,
'Microsoft Excel 2007-2016 XML (macro enabled)'
),
(
'application/vnd.oasis.opendocument.spreadsheet'
,
'ODF Spreadsheet'
),
(
'application/vnd.oasis.opendocument.spreadsheet-flat-xml'
,
u'Flat XML ODF Spreadsheet'
),
(
'application/vnd.oasis.opendocument.text'
,
'ODF Text Document'
),
(
'application/vnd.oasis.opendocument.text'
,
'Text (Writer/Web)'
),
(
'application/vnd.oasis.opendocument.text-flat-xml'
,
'Flat XML ODF Text Document'
),
...
...
@@ -349,6 +352,7 @@ class TestHandler(HandlerTestCase):
[
(
'application/pdf'
,
'PDF - Portable Document Format'
),
(
'application/postscript'
,
'EPS - Encapsulated PostScript'
),
(
'application/vnd.oasis.opendocument.graphics'
,
'ODF Drawing'
),
(
'application/vnd.oasis.opendocument.graphics-flat-xml'
,
u'Flat XML ODF Drawing'
),
(
'image/gif'
,
'GIF - Graphics Interchange Format'
),
(
'image/jpeg'
,
'JPEG - Joint Photographic Experts Group'
),
(
'image/png'
,
'PNG - Portable Network Graphic'
),
...
...
@@ -364,6 +368,7 @@ class TestHandler(HandlerTestCase):
[
(
'application/pdf'
,
'PDF - Portable Document Format'
),
(
'application/postscript'
,
'EPS - Encapsulated PostScript'
),
(
'application/vnd.oasis.opendocument.graphics'
,
'ODF Drawing'
),
(
'application/vnd.oasis.opendocument.graphics-flat-xml'
,
u'Flat XML ODF Drawing'
),
(
'image/gif'
,
'GIF - Graphics Interchange Format'
),
(
'image/jpeg'
,
'JPEG - Joint Photographic Experts Group'
),
(
'image/png'
,
'PNG - Portable Network Graphic'
),
...
...
@@ -379,6 +384,7 @@ class TestHandler(HandlerTestCase):
[
(
'application/pdf'
,
'PDF - Portable Document Format'
),
(
'application/postscript'
,
'EPS - Encapsulated PostScript'
),
(
'application/vnd.oasis.opendocument.graphics'
,
'ODF Drawing'
),
(
'application/vnd.oasis.opendocument.graphics-flat-xml'
,
u'Flat XML ODF Drawing'
),
(
'image/gif'
,
'GIF - Graphics Interchange Format'
),
(
'image/jpeg'
,
'JPEG - Joint Photographic Experts Group'
),
(
'image/png'
,
'PNG - Portable Network Graphic'
),
...
...
@@ -394,6 +400,7 @@ class TestHandler(HandlerTestCase):
[
(
'application/pdf'
,
'PDF - Portable Document Format'
),
(
'application/postscript'
,
'EPS - Encapsulated PostScript'
),
(
'application/vnd.oasis.opendocument.graphics'
,
'ODF Drawing'
),
(
'application/vnd.oasis.opendocument.graphics-flat-xml'
,
u'Flat XML ODF Drawing'
),
(
'image/gif'
,
'GIF - Graphics Interchange Format'
),
(
'image/jpeg'
,
'JPEG - Joint Photographic Experts Group'
),
(
'image/png'
,
'PNG - Portable Network Graphic'
),
...
...
@@ -409,6 +416,7 @@ class TestHandler(HandlerTestCase):
[
(
'application/pdf'
,
'PDF - Portable Document Format'
),
(
'application/postscript'
,
'EPS - Encapsulated PostScript'
),
(
'application/vnd.oasis.opendocument.graphics'
,
'ODF Drawing'
),
(
'application/vnd.oasis.opendocument.graphics-flat-xml'
,
u'Flat XML ODF Drawing'
),
(
'image/gif'
,
'GIF - Graphics Interchange Format'
),
(
'image/jpeg'
,
'JPEG - Joint Photographic Experts Group'
),
(
'image/png'
,
'PNG - Portable Network Graphic'
),
...
...
@@ -424,6 +432,7 @@ class TestHandler(HandlerTestCase):
[
(
'application/pdf'
,
'PDF - Portable Document Format'
),
(
'application/postscript'
,
'EPS - Encapsulated PostScript'
),
(
'application/vnd.oasis.opendocument.graphics'
,
'ODF Drawing'
),
(
'application/vnd.oasis.opendocument.graphics-flat-xml'
,
u'Flat XML ODF Drawing'
),
(
'image/gif'
,
'GIF - Graphics Interchange Format'
),
(
'image/jpeg'
,
'JPEG - Joint Photographic Experts Group'
),
(
'image/png'
,
'PNG - Portable Network Graphic'
),
...
...
@@ -439,6 +448,7 @@ class TestHandler(HandlerTestCase):
[
(
'application/pdf'
,
'PDF - Portable Document Format'
),
(
'application/postscript'
,
'EPS - Encapsulated PostScript'
),
(
'application/vnd.oasis.opendocument.graphics'
,
'ODF Drawing'
),
(
'application/vnd.oasis.opendocument.graphics-flat-xml'
,
u'Flat XML ODF Drawing'
),
(
'image/gif'
,
'GIF - Graphics Interchange Format'
),
(
'image/jpeg'
,
'JPEG - Joint Photographic Experts Group'
),
(
'image/png'
,
'PNG - Portable Network Graphic'
),
...
...
@@ -454,6 +464,7 @@ class TestHandler(HandlerTestCase):
[
(
'application/pdf'
,
'PDF - Portable Document Format'
),
(
'application/postscript'
,
'EPS - Encapsulated PostScript'
),
(
'application/vnd.oasis.opendocument.graphics'
,
'ODF Drawing'
),
(
'application/vnd.oasis.opendocument.graphics-flat-xml'
,
u'Flat XML ODF Drawing'
),
(
'image/gif'
,
'GIF - Graphics Interchange Format'
),
(
'image/jpeg'
,
'JPEG - Joint Photographic Experts Group'
),
(
'image/png'
,
'PNG - Portable Network Graphic'
),
...
...
@@ -469,6 +480,7 @@ class TestHandler(HandlerTestCase):
[
(
'application/pdf'
,
'PDF - Portable Document Format'
),
(
'application/postscript'
,
'EPS - Encapsulated PostScript'
),
(
'application/vnd.oasis.opendocument.graphics'
,
'ODF Drawing'
),
(
'application/vnd.oasis.opendocument.graphics-flat-xml'
,
u'Flat XML ODF Drawing'
),
(
'image/gif'
,
'GIF - Graphics Interchange Format'
),
(
'image/jpeg'
,
'JPEG - Joint Photographic Experts Group'
),
(
'image/png'
,
'PNG - Portable Network Graphic'
),
...
...
@@ -484,6 +496,7 @@ class TestHandler(HandlerTestCase):
[
(
'application/pdf'
,
'PDF - Portable Document Format'
),
(
'application/postscript'
,
'EPS - Encapsulated PostScript'
),
(
'application/vnd.oasis.opendocument.graphics'
,
'ODF Drawing'
),
(
'application/vnd.oasis.opendocument.graphics-flat-xml'
,
u'Flat XML ODF Drawing'
),
(
'image/gif'
,
'GIF - Graphics Interchange Format'
),
(
'image/jpeg'
,
'JPEG - Joint Photographic Experts Group'
),
(
'image/png'
,
'PNG - Portable Network Graphic'
),
...
...
@@ -499,6 +512,7 @@ class TestHandler(HandlerTestCase):
[
(
'application/pdf'
,
'PDF - Portable Document Format'
),
(
'application/postscript'
,
'EPS - Encapsulated PostScript'
),
(
'application/vnd.oasis.opendocument.graphics'
,
'ODF Drawing'
),
(
'application/vnd.oasis.opendocument.graphics-flat-xml'
,
u'Flat XML ODF Drawing'
),
(
'image/gif'
,
'GIF - Graphics Interchange Format'
),
(
'image/jpeg'
,
'JPEG - Joint Photographic Experts Group'
),
(
'image/png'
,
'PNG - Portable Network Graphic'
),
...
...
@@ -515,6 +529,7 @@ class TestHandler(HandlerTestCase):
(
'application/vnd.ms-excel'
,
'Microsoft Excel 97-2003'
),
(
'application/vnd.ms-excel.sheet.macroEnabled.12'
,
'Microsoft Excel 2007-2016 XML (macro enabled)'
),
(
'application/vnd.oasis.opendocument.spreadsheet'
,
'ODF Spreadsheet'
),
(
'application/vnd.oasis.opendocument.spreadsheet-flat-xml'
,
u'Flat XML ODF Spreadsheet'
),
(
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
,
'Microsoft Excel 2007-2013 XML'
),
(
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
,
'Office Open XML Spreadsheet'
),
(
'image/png'
,
'PNG - Portable Network Graphic'
),
...
...
@@ -535,6 +550,7 @@ class TestHandler(HandlerTestCase):
(
'application/vnd.ms-excel'
,
'Microsoft Excel 97-2003'
),
(
'application/vnd.ms-excel.sheet.macroEnabled.12'
,
'Microsoft Excel 2007-2016 XML (macro enabled)'
),
(
'application/vnd.oasis.opendocument.spreadsheet'
,
'ODF Spreadsheet'
),
(
'application/vnd.oasis.opendocument.spreadsheet-flat-xml'
,
u'Flat XML ODF Spreadsheet'
),
(
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
,
'Microsoft Excel 2007-2013 XML'
),
(
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
,
'Office Open XML Spreadsheet'
),
(
'image/png'
,
'PNG - Portable Network Graphic'
),
...
...
@@ -549,6 +565,7 @@ class TestHandler(HandlerTestCase):
(
'application/vnd.ms-excel'
,
'Microsoft Excel 97-2003'
),
(
'application/vnd.ms-excel.sheet.macroEnabled.12'
,
'Microsoft Excel 2007-2016 XML (macro enabled)'
),
(
'application/vnd.oasis.opendocument.spreadsheet'
,
'ODF Spreadsheet'
),
(
'application/vnd.oasis.opendocument.spreadsheet-flat-xml'
,
u'Flat XML ODF Spreadsheet'
),
(
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
,
'Microsoft Excel 2007-2013 XML'
),
(
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
,
'Office Open XML Spreadsheet'
),
(
'image/png'
,
'PNG - Portable Network Graphic'
),
...
...
@@ -581,6 +598,7 @@ class TestHandler(HandlerTestCase):
(
'application/vnd.ms-excel'
,
'Microsoft Excel 97-2003'
),
(
'application/vnd.ms-excel.sheet.macroEnabled.12'
,
'Microsoft Excel 2007-2016 XML (macro enabled)'
),
(
'application/vnd.oasis.opendocument.spreadsheet'
,
'ODF Spreadsheet'
),
(
'application/vnd.oasis.opendocument.spreadsheet-flat-xml'
,
u'Flat XML ODF Spreadsheet'
),
(
'application/vnd.oasis.opendocument.text'
,
'ODF Text Document'
),
(
'application/vnd.oasis.opendocument.text'
,
'Text (Writer/Web)'
),
(
'application/vnd.oasis.opendocument.text-flat-xml'
,
'Flat XML ODF Text Document'
),
...
...
@@ -609,6 +627,7 @@ class TestHandler(HandlerTestCase):
(
'application/vnd.ms-powerpoint'
,
'Microsoft PowerPoint 97-2003 AutoPlay'
),
(
'application/vnd.oasis.opendocument.graphics'
,
'ODF Drawing (Impress)'
),
(
'application/vnd.oasis.opendocument.presentation'
,
'ODF Presentation'
),
(
'application/vnd.oasis.opendocument.presentation-flat-xml'
,
u'Flat XML ODF Presentation'
),
(
'application/vnd.openxmlformats-officedocument.presentationml.presentation'
,
'Microsoft PowerPoint 2007-2013 XML'
),
(
'application/vnd.openxmlformats-officedocument.presentationml.presentation'
,
'Office Open XML Presentation'
),
(
'application/vnd.openxmlformats-officedocument.presentationml.slideshow'
,
'Microsoft PowerPoint 2007-2013 XML AutoPlay'
),
# TEST it
...
...
@@ -631,6 +650,7 @@ class TestHandler(HandlerTestCase):
(
'application/vnd.ms-powerpoint'
,
'Microsoft PowerPoint 97-2003 AutoPlay'
),
(
'application/vnd.oasis.opendocument.graphics'
,
'ODF Drawing (Impress)'
),
(
'application/vnd.oasis.opendocument.presentation'
,
'ODF Presentation'
),
(
'application/vnd.oasis.opendocument.presentation-flat-xml'
,
u'Flat XML ODF Presentation'
),
(
'application/vnd.openxmlformats-officedocument.presentationml.presentation'
,
'Microsoft PowerPoint 2007-2013 XML'
),
(
'application/vnd.openxmlformats-officedocument.presentationml.presentation'
,
'Office Open XML Presentation'
),
(
'application/vnd.openxmlformats-officedocument.presentationml.slideshow'
,
'Microsoft PowerPoint 2007-2013 XML AutoPlay'
),
...
...
@@ -653,6 +673,7 @@ class TestHandler(HandlerTestCase):
(
'application/vnd.ms-powerpoint'
,
'Microsoft PowerPoint 97-2003 AutoPlay'
),
(
'application/vnd.oasis.opendocument.graphics'
,
'ODF Drawing (Impress)'
),
(
'application/vnd.oasis.opendocument.presentation'
,
'ODF Presentation'
),
(
'application/vnd.oasis.opendocument.presentation-flat-xml'
,
u'Flat XML ODF Presentation'
),
(
'application/vnd.openxmlformats-officedocument.presentationml.presentation'
,
'Microsoft PowerPoint 2007-2013 XML'
),
(
'application/vnd.openxmlformats-officedocument.presentationml.presentation'
,
'Office Open XML Presentation'
),
(
'application/vnd.openxmlformats-officedocument.presentationml.slideshow'
,
'Microsoft PowerPoint 2007-2013 XML AutoPlay'
),
...
...
@@ -675,6 +696,7 @@ class TestHandler(HandlerTestCase):
(
'application/vnd.ms-powerpoint'
,
'Microsoft PowerPoint 97-2003 AutoPlay'
),
(
'application/vnd.oasis.opendocument.graphics'
,
'ODF Drawing (Impress)'
),
(
'application/vnd.oasis.opendocument.presentation'
,
'ODF Presentation'
),
(
'application/vnd.oasis.opendocument.presentation-flat-xml'
,
u'Flat XML ODF Presentation'
),
(
'application/vnd.openxmlformats-officedocument.presentationml.presentation'
,
'Microsoft PowerPoint 2007-2013 XML'
),
(
'application/vnd.openxmlformats-officedocument.presentationml.presentation'
,
'Office Open XML Presentation'
),
(
'application/vnd.openxmlformats-officedocument.presentationml.slideshow'
,
'Microsoft PowerPoint 2007-2013 XML AutoPlay'
),
...
...
cloudooo/mime.types
View file @
6b0b9c40
...
...
@@ -281,13 +281,17 @@ application/vnd.oasis.opendocument.chart odc
application/vnd.oasis.opendocument.database odb
application/vnd.oasis.opendocument.formula odf
application/vnd.oasis.opendocument.graphics odg
application/vnd.oasis.opendocument.graphics-flat-xml fodg
application/vnd.oasis.opendocument.graphics-template otg
application/vnd.oasis.opendocument.image odi
application/vnd.oasis.opendocument.presentation odp
application/vnd.oasis.opendocument.presentation-flat-xml fodp
application/vnd.oasis.opendocument.presentation-template otp
application/vnd.oasis.opendocument.spreadsheet ods
application/vnd.oasis.opendocument.spreadsheet-flat-xml fods
application/vnd.oasis.opendocument.spreadsheet-template ots
application/vnd.oasis.opendocument.text odt
application/vnd.oasis.opendocument.text-flat-xml fodt
application/vnd.oasis.opendocument.text-master odm
application/vnd.oasis.opendocument.text-template ott
application/vnd.oasis.opendocument.text-web oth
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment