Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
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
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alain Takoudjou
erp5
Commits
4908fe22
Commit
4908fe22
authored
Jun 21, 2017
by
Vincent Bechu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_officjs: add redirect in router for dropbox and fix bookmark
/reviewed-on
nexedi/erp5!302
parent
66cfe1e0
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
155 additions
and
195 deletions
+155
-195
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_jio_dropbox_configurator_html.html
...e/gadget_officejs_page_jio_dropbox_configurator_html.html
+16
-51
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_jio_dropbox_configurator_html.xml
...le/gadget_officejs_page_jio_dropbox_configurator_html.xml
+2
-2
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_jio_dropbox_configurator_js.txt
...dule/gadget_officejs_page_jio_dropbox_configurator_js.txt
+120
-138
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_jio_dropbox_configurator_js.xml
...dule/gadget_officejs_page_jio_dropbox_configurator_js.xml
+2
-2
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_router_js.js
...TemplateItem/web_page_module/gadget_officejs_router_js.js
+13
-0
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_router_js.xml
...emplateItem/web_page_module/gadget_officejs_router_js.xml
+2
-2
No files found.
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_jio_dropbox_configurator_html.html
View file @
4908fe22
<!doctype html>
<!doctype html>
<html>
<html>
<head>
<head>
<meta
charset=
"utf-8"
>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<title>
OfficeJS jIO Dropbox Configurator Page
</title>
<title>
OfficeJS jIO Dropbox Configurator Page
</title>
<script
src=
"rsvp.js"
></script>
<script
src=
"rsvp.js"
></script>
<script
src=
"renderjs.js"
></script>
<script
src=
"renderjs.js"
></script>
<script
src=
"gadget_officejs_page_jio_dropbox_configurator.js"
></script>
<script
src=
"gadget_officejs_page_jio_dropbox_configurator.js"
></script>
</head>
</head>
<body>
<body>
</body>
<article
class=
"ui-content ui-body-c"
>
<section
class=
"ui-content-header-plain"
>
<h3
class=
"ui-content-title ui-body-c"
>
<span
class=
"ui-icon ui-icon-custom ui-icon-database"
>
</span>
Your Dropbox Connection parameters
</h3>
</section>
<section
class=
"ui-content-header-plain"
>
<p>
Connecting to Dropbox
</p>
</section>
</article>
<article
class=
"ui-content ui-body-c document-access"
>
<section
class=
"ui-content-header-plain"
>
<h3
class=
"ui-content-title ui-body-c"
>
<span
class=
"ui-icon ui-icon-custom ui-icon-file-text-o"
>
</span>
Your Documents
</h3>
</section>
<section
class=
"ui-body-c ui-content-section"
>
<p
style=
"color: red"
>
Continue by
<b>
synchronizing
</b>
with your remote storage or
<b>
accessing
</b>
your documents
</p>
<div
class=
"ui-controlgroup ui-controlgroup-horizontal"
>
<div
class=
"ui-grid-a ui-responsive"
>
<div
class=
"ui-block-a"
>
<a
class=
"ui-btn"
href=
"#page=sync"
data-i18n=
"Synchronize"
>
Synchronize
</a>
</div>
<div
class=
"ui-block-b"
>
<a
class=
"ui-btn"
href=
"#page=document_list"
data-i18n=
"Go to document List"
>
Access document List
</a>
</div>
</div>
</div>
</section>
</article>
<div
class=
"global_setting_gadget"
style=
"display: none;"
></div>
</body>
</html>
</html>
\ No newline at end of file
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_jio_dropbox_configurator_html.xml
View file @
4908fe22
...
@@ -236,7 +236,7 @@
...
@@ -236,7 +236,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
95
6.64672.3552.2918
</string>
</value>
<value>
<string>
95
8.24259.25538.21094
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -254,7 +254,7 @@
...
@@ -254,7 +254,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
14
85780527.4
8
</float>
<float>
14
98039956.0
8
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_jio_dropbox_configurator_js.txt
View file @
4908fe22
/*global window, rJS, RSVP, URI, location,
/*global window, rJS, RSVP, URI, location,
loopEventListener, btoa */
loopEventListener, btoa */
/*jslint nomen: true, indent: 2, maxerr: 3*/
/*jslint nomen: true, indent: 2, maxerr: 3*/
(function (window, rJS, RSVP) {
(function (window, rJS, RSVP, console) {
"use strict";
"use strict";
function setDropboxConfiguration(gadget) {
function setDropboxConfiguration(gadget) {
return gadget.getSetting("portal_type")
return gadget.getSetting("portal_type")
.push(function (portal_type) {
.push(function (portal_type) {
var old_date = new Date(),
var old_date = new Date(),
configuration = {};
configuration = {};
// We are looking for documents modified in the past 3 month
// We are looking for documents modified in the past 3 month
old_date = new Date(old_date.getFullYear(), old_date.getMonth() - 3);
old_date = new Date(old_date.getFullYear(), old_date.getMonth() - 3);
configuration = {
configuration = {
type: "replicate",
type: "replicate",
// XXX This drop the signature lists...
// XXX This drop the signature lists...
query: {
query: {
query: 'portal_type:"' + portal_type + '" ',
query: 'portal_type:"' + portal_type + '" ',
// XX Synchonizing the whole module is too much, here is a way to start quietly
// XX Synchonizing the whole module is too much, here is a way to start quietly
// Supsended until modification_date is handled for synchronization
// Supsended until modification_date is handled for synchronization
limit: [0, 1234567890]
limit: [0, 1234567890]
},
},
use_remote_post: false,
use_remote_post: false,
conflict_handling: 2,
conflict_handling: 2,
check_local_modification: true,
check_local_modification: true,
check_local_creation: true,
check_local_creation: true,
check_local_deletion: false,
check_local_deletion: false,
check_remote_modification: true,
check_remote_modification: true,
check_remote_creation: true,
check_remote_creation: true,
check_remote_deletion: true,
check_remote_deletion: true,
local_sub_storage: {
local_sub_storage: {
type: "mapping",
type: "mapping",
attachment: {
attachment: {
'data': {
'data': {
get: {uri_template: 'enclosure'},
get: {uri_template: 'enclosure'},
put: {uri_template: 'enclosure'}
put: {uri_template: 'enclosure'}
}
}
},
},
sub_storage: {
sub_storage: {
type: "query",
type: "query",
sub_storage: {
sub_storage: {
type: "uuid",
type: "uuid",
sub_storage: {
sub_storage: {
type: "indexeddb",
type: "indexeddb",
database: "officejs-dropbox"
database: "officejs-dropbox"
}
}
}
}
}
}
},
},
remote_sub_storage: {
remote_sub_storage: {
type: "mapping",
type: "mapping",
attachment: {
attachment: {
'data': {
'data': {
get: {uri_template: 'enclosure'},
get: {uri_template: 'enclosure'},
put: {uri_template: 'enclosure'}
put: {uri_template: 'enclosure'}
}
}
},
},
mapping_dict: {
mapping_dict: {
"portal_type": ["equalSubProperty", "type"]
"portal_type": ["equalSubProperty", "type"]
},
},
sub_storage: {
sub_storage: {
type: "query",
type: "query",
sub_storage: {
sub_storage: {
type: "drivetojiomapping",
type: "drivetojiomapping",
sub_storage: {
sub_storage: {
type: "dropbox",
type: "dropbox",
access_token: gadget.props.access_token,
access_token: gadget.props.access_token,
root: "sandbox"
root: "sandbox"
}
}
}
}
}
}
}
}
};
};
return gadget.setSetting('jio_storage_description', configuration);
return gadget.setSetting('jio_storage_description', configuration);
})
})
.push(function () {
.push(function () {
return gadget.setSetting('jio_storage_name', "DROPBOX");
return gadget.setSetting('jio_storage_name', "DROPBOX");
})
})
.push(function () {
.push(function () {
return gadget.setSetting('sync_reload', true);
return gadget.setSetting('sync_reload', true);
})
})
.push(function () {
.push(function () {
return gadget.redirect({page: 'sync', auto_repair: 'true'});
return gadget.redirect({page: 'sync', auto_repair: 'true'});
});
});
}
}
var gadget_klass = rJS(window);
var gadget_klass = rJS(window);
gadget_klass
gadget_klass
.ready(function (g) {
.ready(function (g) {
g.props = {};
g.props = {};
return g.getElement()
return g.getElement()
.push(function (element) {
.push(function (element) {
g.props.element = element;
g.props.element = element;
g.props.deferred = RSVP.defer();
g.props.deferred = RSVP.defer();
});
});
})
})
.declareAcquiredMethod("updateHeader", "updateHeader")
.declareAcquiredMethod("updateHeader", "updateHeader")
.declareAcquiredMethod("redirect", "redirect")
.declareAcquiredMethod("redirect", "redirect")
.declareAcquiredMethod("reload", "reload")
.declareAcquiredMethod("reload", "reload")
.declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("setSetting", "setSetting")
.declareAcquiredMethod("setSetting", "setSetting")
.declareMethod("getGlobalSetting", function (key) {
.declareMethod("render", function (options) {
var gadget = this;
var gadget = this;
return gadget.getDeclaredGadget("global_setting_gadget")
return gadget.updateHeader({
.push(function (global_setting_gadget) {
title: "Connect To Drobox Storage",
return global_setting_gadget.getSetting(key);
back_url: "#page=jio_configurator",
});
panel_action: false
})
})
.declareMethod("setGlobalSetting", function (key, value) {
.push(function () {
var gadget = this;
gadget.props.access_token = options.token;
return gadget.getDeclaredGadget("global_setting_gadget")
return gadget.props.deferred.resolve();
.push(function (global_setting_gadget) {
});
return global_setting_gadget.setSetting(key, value);
})
});
.declareService(function () {
})
var gadget = this;
.declareMethod("render", function (options) {
return setDropboxConfiguration(gadget);
var gadget = this;
});
return gadget.updateHeader({
title: "Connect To Drobox Storage",
}(window, rJS, RSVP, console));
back_url: "#page=jio_configurator",
\ No newline at end of file
panel_action: false
})
.push(function (options) {
return gadget.getSetting('jio_storage_name');
})
.push(function (jio_storage_name) {
if (!jio_storage_name) {
gadget.props.element.querySelector(".document-access").setAttribute("style", "display: none;");
}
})
.push(function () {
gadget.props.access_token = options.token;
return setDropboxConfiguration(gadget);
});
});
}(window, rJS, RSVP));
\ No newline at end of file
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_jio_dropbox_configurator_js.xml
View file @
4908fe22
...
@@ -236,7 +236,7 @@
...
@@ -236,7 +236,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
9
56.64671.54901.45909
</string>
</value>
<value>
<string>
9
60.12610.20791.23552
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -254,7 +254,7 @@
...
@@ -254,7 +254,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
14
85780514.28
</float>
<float>
14
98039829.6
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_router_js.js
View file @
4908fe22
...
@@ -94,6 +94,19 @@
...
@@ -94,6 +94,19 @@
var
gadget
=
this
,
var
gadget
=
this
,
args
=
options
.
args
;
args
=
options
.
args
;
gadget
.
options
=
options
;
gadget
.
options
=
options
;
if
(
args
.
access_token
)
{
if
(
args
.
state
===
"
gdrive
"
)
{
args
.
page
=
"
jio_gdrive_configurator
"
;
}
else
{
args
.
page
=
"
jio_dropbox_configurator
"
;
}
return
this
.
getCommandUrlFor
({
"
page
"
:
args
.
page
,
"
token
"
:
args
.
access_token
})
.
push
(
function
(
hash
)
{
window
.
location
.
replace
(
hash
);
return
RSVP
.
timeout
(
REDIRECT_TIMEOUT
);
});
}
if
(
args
.
jio_key
===
undefined
||
args
.
jio_key
===
''
)
{
if
(
args
.
jio_key
===
undefined
||
args
.
jio_key
===
''
)
{
if
(
args
.
page
===
undefined
||
args
.
page
===
''
||
args
.
page
===
"
document_list
"
)
{
if
(
args
.
page
===
undefined
||
args
.
page
===
''
||
args
.
page
===
"
document_list
"
)
{
args
.
page
=
DEFAULT_PAGE
;
args
.
page
=
DEFAULT_PAGE
;
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_router_js.xml
View file @
4908fe22
...
@@ -236,7 +236,7 @@
...
@@ -236,7 +236,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
9
57.15167.59077.4374
1
</string>
</value>
<value>
<string>
9
60.12474.59711.278
1
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -254,7 +254,7 @@
...
@@ -254,7 +254,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
14
86742528.
7
</float>
<float>
14
98033186.7
7
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
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