Commit f84a7336 authored by Vincent Bechu's avatar Vincent Bechu

[erp5_officejs_ui_test] Add onlyoffice convertion tests

parent 6c6488e7
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testOnlyOfficePresentationConvert</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode></unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Test OfficeJS UI</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">Test OfficeJS UI</td></tr>
</thead><tbody>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" />
<!-- Clean Up -->
<tr>
<td>open</td>
<td>${base_url}/bar_module/ListBoxZuite_reset</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Reset Successfully.</td>
<td></td>
</tr>
<!-- Initialize -->
<tr>
<td>open</td>
<td>${base_url}/portal_skins/erp5_officejs_ui_test/gadget_ooffice_presentation_upload.html</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[text()='Document Created']</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/web_site_module/ooffice_presentation/</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n="Storages"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[@data-i18n="Storages"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[text()='Local is Enough']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[text()='Local is Enough']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[text()='Test Document']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[text()='Test Document']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForOnlyOffice/macros/wait_for_load_presentation"/>
<tr>
<td>click</td>
<td>//button[@data-i18n="Save"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope="notification"]//button[text()='Data Updated']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[@data-i18n="Synchronize"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[text()='Add']</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/portal_skins/erp5_officejs_ui_test/gadget_ooffice_presentation_convert_check.html</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[text()='Converted pptx OK']</td>
<td></td>
</tr>
\ No newline at end of file
......@@ -187,6 +187,26 @@
<td>//a[@data-i18n='Document']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n='Upload']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[@data-i18n='Upload']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//input[@value='Upload']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[@data-i18n='Document']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForOnlyOffice/macros/open_document_with_title"/>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForOnlyOffice/macros/wait_for_load_presentation"/>
<tr>
......@@ -218,4 +238,19 @@
<td>verifyValue</td>
<td>//textarea[@title='Description']</td>
<td>${description}</td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n='Download']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[@data-i18n='Download']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//input[@value='Download']</td>
<td></td>
</tr>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testOnlyOfficeSpreadsheetConvert</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode></unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Test OfficeJS UI</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">Test OfficeJS UI</td></tr>
</thead><tbody>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" />
<!-- Clean Up -->
<tr>
<td>open</td>
<td>${base_url}/bar_module/ListBoxZuite_reset</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Reset Successfully.</td>
<td></td>
</tr>
<!-- Initialize -->
<tr>
<td>open</td>
<td>${base_url}/portal_skins/erp5_officejs_ui_test/gadget_ooffice_spreadsheet_upload.html</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[text()='Document Created']</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/web_site_module/ooffice_spreadsheet/</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n="Storages"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[@data-i18n="Storages"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[text()='Local is Enough']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[text()='Local is Enough']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[text()='Test Document']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[text()='Test Document']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForOnlyOffice/macros/wait_for_load_spreadsheet"/>
<tr>
<td>click</td>
<td>//button[@data-i18n="Save"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope="notification"]//button[text()='Data Updated']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[@data-i18n="Synchronize"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[text()='Add']</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/portal_skins/erp5_officejs_ui_test/gadget_ooffice_spreadsheet_convert_check.html</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[text()='Converted xlsx OK']</td>
<td></td>
</tr>
\ No newline at end of file
......@@ -182,6 +182,26 @@
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForOnlyOffice/macros/wait_for_load_spreadsheet"/>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForOnlyOffice/macros/save"/>
<tr>
<td>click</td>
<td>//a[@data-i18n='Document']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n='Upload']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[@data-i18n='Upload']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//input[@value='Upload']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[@data-i18n='Document']</td>
......@@ -218,4 +238,19 @@
<td>verifyValue</td>
<td>//textarea[@title='Description']</td>
<td>${description}</td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n='Download']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[@data-i18n='Download']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//input[@value='Download']</td>
<td></td>
</tr>
\ No newline at end of file
......@@ -187,6 +187,26 @@
<td>//a[@data-i18n='Document']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n='Upload']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[@data-i18n='Upload']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//input[@value='Upload']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[@data-i18n='Document']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForOnlyOffice/macros/open_document_with_title"/>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForOnlyOffice/macros/wait_for_load"/>
<tr>
......@@ -218,4 +238,19 @@
<td>verifyValue</td>
<td>//textarea[@title='Description']</td>
<td>${description}</td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n='Download']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[@data-i18n='Download']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//input[@value='Download']</td>
<td></td>
</tr>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testOnlyfficeTextConvert</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode></unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Test OfficeJS UI</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">Test OfficeJS UI</td></tr>
</thead><tbody>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" />
<!-- Clean Up -->
<tr>
<td>open</td>
<td>${base_url}/bar_module/ListBoxZuite_reset</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Reset Successfully.</td>
<td></td>
</tr>
<!-- Initialize -->
<tr>
<td>open</td>
<td>${base_url}/portal_skins/erp5_officejs_ui_test/gadget_ooffice_text_upload.html</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[text()='Document Created']</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/web_site_module/ooffice_text/</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n="Storages"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[@data-i18n="Storages"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[text()='Local is Enough']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[text()='Local is Enough']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[text()='Test Document']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[text()='Test Document']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForOnlyOffice/macros/wait_for_load"/>
<tr>
<td>click</td>
<td>//button[@data-i18n="Save"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope="notification"]//button[text()='Data Updated']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[@data-i18n="Synchronize"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[text()='Add']</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/portal_skins/erp5_officejs_ui_test/gadget_ooffice_text_convert_check.html</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[text()='Converted docx OK']</td>
<td></td>
</tr>
\ No newline at end of file
/*jslint indent: 2, nomen: true */
/*global window, rJS, jIO, URL, RSVP*/
(function (window, rJS, jIO, URL, RSVP) {
"use strict";
function check(gadget, storage, format) {
return new RSVP.Queue()
.push(function () {
return RSVP.all([
storage.getAttachment('test', format),
jIO.util.ajax({
type: "GET",
url: new URL('./test_ooo_' + gadget.param.type + '.' + format, window.location.href),
dataType: "blob"
})
]);
})
.push(function (result) {
return RSVP.all([
jIO.util.readBlobAsText(result[0]),
jIO.util.readBlobAsText(result[1].target.response)
]);
})
.push(function (result) {
var div = window.document.createElement('div');
if (result[0].target.response == result[1].target.response) {
div.textContent = 'Converted ' + format + ' OK';
gadget.element.appendChild(div);
}
});
}
rJS(window)
.declareService(function () {
var storage = jIO.createJIO({
type: "indexeddb",
database: "local_default"
}),
gadget = this,
element_list =
gadget.element.querySelectorAll("[data-renderjs-configuration]"),
len = element_list.length,
i,
queue = new RSVP.Queue(),
format_list;
gadget.param = {};
for (i = 0; i < len; i += 1) {
gadget.param[element_list[i].getAttribute('data-renderjs-configuration')] =
element_list[i].textContent;
}
format_list = JSON.parse(gadget.param.format_list);
len = format_list.length;
for (i = 0; i < len; i += 1) {
queue.push(check(gadget, storage, format_list[i]));
}
return queue;
});
}(window, rJS, jIO, URL, RSVP));
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Cacheable__manager_id</string> </key>
<value> <string>http_cache</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>gadget_ooffice_convert_check.js</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/javascript</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<!DOCTYPE html>
<html>
<head>
<!--
data-i18n=No records
data-i18n=Records
-->
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width" />
<title>Check Text Conversion</title>
<!-- renderjs -->
<script src="rsvp.js"></script>
<script src="renderjs.js"></script>
<script src="jio.js"></script>
<!-- custom script -->
<script src="gadget_ooffice_convert_check.js" type="text/javascript"></script>
</head>
<body>
<script data-renderjs-configuration="format_list" type="text/x-renderjs-configuration">["pptx"]</script>
<script data-renderjs-configuration="type" type="text/x-renderjs-configuration">presentation</script>
</body>
</html>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>gadget_ooffice_presentation_convert_check.html</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<!DOCTYPE html>
<html>
<head>
<!--
data-i18n=No records
data-i18n=Records
-->
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width" />
<title>Upload OnlyOffice Document</title>
<!-- renderjs -->
<script src="rsvp.js"></script>
<script src="renderjs.js"></script>
<script src="jio.js"></script>
<!-- custom script -->
<script src="gadget_ooffice_upload.js" type="text/javascript"></script>
</head>
<body>
<script data-renderjs-configuration="portal_type" type="text/x-renderjs-configuration">Presentation</script>
<script data-renderjs-configuration="format" type="text/x-renderjs-configuration">ppty</script>
<script data-renderjs-configuration="type" type="text/x-renderjs-configuration">presentation</script>
</body>
</html>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>gadget_ooffice_presentation_upload.html</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<!DOCTYPE html>
<html>
<head>
<!--
data-i18n=No records
data-i18n=Records
-->
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width" />
<title>Check Text Conversion</title>
<!-- renderjs -->
<script src="rsvp.js"></script>
<script src="renderjs.js"></script>
<script src="jio.js"></script>
<!-- custom script -->
<script src="gadget_ooffice_convert_check.js" type="text/javascript"></script>
</head>
<body>
<script data-renderjs-configuration="format_list" type="text/x-renderjs-configuration">["xlsx"]</script>
<script data-renderjs-configuration="type" type="text/x-renderjs-configuration">spreadsheet</script>
</body>
</html>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>gadget_ooffice_spreadsheet_convert_check.html</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<!DOCTYPE html>
<html>
<head>
<!--
data-i18n=No records
data-i18n=Records
-->
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width" />
<title>Upload OnlyOffice Document</title>
<!-- renderjs -->
<script src="rsvp.js"></script>
<script src="renderjs.js"></script>
<script src="jio.js"></script>
<!-- custom script -->
<script src="gadget_ooffice_upload.js" type="text/javascript"></script>
</head>
<body>
<script data-renderjs-configuration="portal_type" type="text/x-renderjs-configuration">Spreadsheet</script>
<script data-renderjs-configuration="format" type="text/x-renderjs-configuration">xlsy</script>
<script data-renderjs-configuration="type" type="text/x-renderjs-configuration">spreadsheet</script>
</body>
</html>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>gadget_ooffice_spreadsheet_upload.html</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<!DOCTYPE html>
<html>
<head>
<!--
data-i18n=No records
data-i18n=Records
-->
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width" />
<title>Check Text Conversion</title>
<!-- renderjs -->
<script src="rsvp.js"></script>
<script src="renderjs.js"></script>
<script src="jio.js"></script>
<!-- custom script -->
<script src="gadget_ooffice_convert_check.js" type="text/javascript"></script>
</head>
<body>
<script data-renderjs-configuration="format_list" type="text/x-renderjs-configuration">["docx"]</script>
<script data-renderjs-configuration="type" type="text/x-renderjs-configuration">text</script>
</body>
</html>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>gadget_ooffice_text_convert_check.html</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<!DOCTYPE html>
<html>
<head>
<!--
data-i18n=No records
data-i18n=Records
-->
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width" />
<title>Upload OnlyOffice Document</title>
<!-- renderjs -->
<script src="rsvp.js"></script>
<script src="renderjs.js"></script>
<script src="jio.js"></script>
<!-- custom script -->
<script src="gadget_ooffice_upload.js" type="text/javascript"></script>
</head>
<body>
<script data-renderjs-configuration="portal_type" type="text/x-renderjs-configuration">Text</script>
<script data-renderjs-configuration="format" type="text/x-renderjs-configuration">docy</script>
<script data-renderjs-configuration="type" type="text/x-renderjs-configuration">text</script>
</body>
</html>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>gadget_ooffice_text_upload.html</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
/*jslint indent: 2, nomen: true */
/*global window, rJS, jIO, URL*/
(function (window, rJS, jIO, URL) {
"use strict";
rJS(window)
.declareService(function () {
var storage = jIO.createJIO({
type: "indexeddb",
database: "local_default"
}),
gadget = this,
element_list =
gadget.element.querySelectorAll("[data-renderjs-configuration]"),
len = element_list.length,
i,
param = {};
for (i = 0; i < len; i += 1) {
param[element_list[i].getAttribute('data-renderjs-configuration')] =
element_list[i].textContent;
}
return storage.put('test', {
'reference': 'test_ooffice_upload',
'title': 'Test Document',
'filename': 'test.' + param.format,
'portal_type': param.portal_type,
'parent_relative_url': "document_module",
'content_type': "application/x-asc-" + param.type
})
.push(function (id) {
return jIO.util.ajax({
type: "GET",
url: new URL('./test_ooo_' + param.type + '.' + param.format, window.location.href),
dataType: "blob"
})
.then(function (res) {
return storage.putAttachment(id, 'data', res.target.response);
});
})
.push(function () {
var div = window.document.createElement('div');
div.textContent = 'Document Created';
gadget.element.appendChild(div);
});
});
}(window, rJS, jIO, URL));
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Cacheable__manager_id</string> </key>
<value> <string>http_cache</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>gadget_ooffice_upload.js</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/javascript</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>test_ooo_presentation.pdf</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/pdf</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>test_ooo_presentation.pptx</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/octet-stream</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>test_ooo_presentation.ppty</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/octet-stream</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>test_ooo_spreadsheet.pdf</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/pdf</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>test_ooo_spreadsheet.xlsx</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/octet-stream</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>test_ooo_spreadsheet.xlsy</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/octet-stream</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>test_ooo_text.docx</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/octet-stream</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>test_ooo_text.docy</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/octet-stream</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>test_ooo_text.pdf</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/pdf</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
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