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
alecs_myu
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>
<html>
<head>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<title>
OfficeJS jIO Dropbox Configurator Page
</title>
<script
src=
"rsvp.js"
></script>
<script
src=
"renderjs.js"
></script>
<script
src=
"gadget_officejs_page_jio_dropbox_configurator.js"
></script>
</head>
<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>
<!doctype html>
<html>
<head>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<title>
OfficeJS jIO Dropbox Configurator Page
</title>
<script
src=
"rsvp.js"
></script>
<script
src=
"renderjs.js"
></script>
<script
src=
"gadget_officejs_page_jio_dropbox_configurator.js"
></script>
</head>
<body>
</body>
</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 @@
</item>
<item>
<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>
<key>
<string>
state
</string>
</key>
...
...
@@ -254,7 +254,7 @@
</tuple>
<state>
<tuple>
<float>
14
85780527.4
8
</float>
<float>
14
98039956.0
8
</float>
<string>
UTC
</string>
</tuple>
</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,
loopEventListener, btoa */
/*jslint nomen: true, indent: 2, maxerr: 3*/
(function (window, rJS, RSVP) {
"use strict";
function setDropboxConfiguration(gadget) {
return gadget.getSetting("portal_type")
.push(function (portal_type) {
var old_date = new Date(),
configuration = {};
// We are looking for documents modified in the past 3 month
old_date = new Date(old_date.getFullYear(), old_date.getMonth() - 3);
configuration = {
type: "replicate",
// XXX This drop the signature lists...
query: {
query: 'portal_type:"' + portal_type + '" ',
// XX Synchonizing the whole module is too much, here is a way to start quietly
// Supsended until modification_date is handled for synchronization
limit: [0, 1234567890]
},
use_remote_post: false,
conflict_handling: 2,
check_local_modification: true,
check_local_creation: true,
check_local_deletion: false,
check_remote_modification: true,
check_remote_creation: true,
check_remote_deletion: true,
local_sub_storage: {
type: "mapping",
attachment: {
'data': {
get: {uri_template: 'enclosure'},
put: {uri_template: 'enclosure'}
}
},
sub_storage: {
type: "query",
sub_storage: {
type: "uuid",
sub_storage: {
type: "indexeddb",
database: "officejs-dropbox"
}
}
}
},
remote_sub_storage: {
type: "mapping",
attachment: {
'data': {
get: {uri_template: 'enclosure'},
put: {uri_template: 'enclosure'}
}
},
mapping_dict: {
"portal_type": ["equalSubProperty", "type"]
},
sub_storage: {
type: "query",
sub_storage: {
type: "drivetojiomapping",
sub_storage: {
type: "dropbox",
access_token: gadget.props.access_token,
root: "sandbox"
}
}
}
}
};
return gadget.setSetting('jio_storage_description', configuration);
})
.push(function () {
return gadget.setSetting('jio_storage_name', "DROPBOX");
})
.push(function () {
return gadget.setSetting('sync_reload', true);
})
.push(function () {
return gadget.redirect({page: 'sync', auto_repair: 'true'});
});
}
var gadget_klass = rJS(window);
gadget_klass
.ready(function (g) {
g.props = {};
return g.getElement()
.push(function (element) {
g.props.element = element;
g.props.deferred = RSVP.defer();
});
})
.declareAcquiredMethod("updateHeader", "updateHeader")
.declareAcquiredMethod("redirect", "redirect")
.declareAcquiredMethod("reload", "reload")
.declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("setSetting", "setSetting")
.declareMethod("getGlobalSetting", function (key) {
var gadget = this;
return gadget.getDeclaredGadget("global_setting_gadget")
.push(function (global_setting_gadget) {
return global_setting_gadget.getSetting(key);
});
})
.declareMethod("setGlobalSetting", function (key, value) {
var gadget = this;
return gadget.getDeclaredGadget("global_setting_gadget")
.push(function (global_setting_gadget) {
return global_setting_gadget.setSetting(key, value);
});
})
.declareMethod("render", function (options) {
var gadget = this;
return gadget.updateHeader({
title: "Connect To Drobox Storage",
back_url: "#page=jio_configurator",
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
/*global window, rJS, RSVP, URI, location,
loopEventListener, btoa */
/*jslint nomen: true, indent: 2, maxerr: 3*/
(function (window, rJS, RSVP, console) {
"use strict";
function setDropboxConfiguration(gadget) {
return gadget.getSetting("portal_type")
.push(function (portal_type) {
var old_date = new Date(),
configuration = {};
// We are looking for documents modified in the past 3 month
old_date = new Date(old_date.getFullYear(), old_date.getMonth() - 3);
configuration = {
type: "replicate",
// XXX This drop the signature lists...
query: {
query: 'portal_type:"' + portal_type + '" ',
// XX Synchonizing the whole module is too much, here is a way to start quietly
// Supsended until modification_date is handled for synchronization
limit: [0, 1234567890]
},
use_remote_post: false,
conflict_handling: 2,
check_local_modification: true,
check_local_creation: true,
check_local_deletion: false,
check_remote_modification: true,
check_remote_creation: true,
check_remote_deletion: true,
local_sub_storage: {
type: "mapping",
attachment: {
'data': {
get: {uri_template: 'enclosure'},
put: {uri_template: 'enclosure'}
}
},
sub_storage: {
type: "query",
sub_storage: {
type: "uuid",
sub_storage: {
type: "indexeddb",
database: "officejs-dropbox"
}
}
}
},
remote_sub_storage: {
type: "mapping",
attachment: {
'data': {
get: {uri_template: 'enclosure'},
put: {uri_template: 'enclosure'}
}
},
mapping_dict: {
"portal_type": ["equalSubProperty", "type"]
},
sub_storage: {
type: "query",
sub_storage: {
type: "drivetojiomapping",
sub_storage: {
type: "dropbox",
access_token: gadget.props.access_token,
root: "sandbox"
}
}
}
}
};
return gadget.setSetting('jio_storage_description', configuration);
})
.push(function () {
return gadget.setSetting('jio_storage_name', "DROPBOX");
})
.push(function () {
return gadget.setSetting('sync_reload', true);
})
.push(function () {
return gadget.redirect({page: 'sync', auto_repair: 'true'});
});
}
var gadget_klass = rJS(window);
gadget_klass
.ready(function (g) {
g.props = {};
return g.getElement()
.push(function (element) {
g.props.element = element;
g.props.deferred = RSVP.defer();
});
})
.declareAcquiredMethod("updateHeader", "updateHeader")
.declareAcquiredMethod("redirect", "redirect")
.declareAcquiredMethod("reload", "reload")
.declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("setSetting", "setSetting")
.declareMethod("render", function (options) {
var gadget = this;
return gadget.updateHeader({
title: "Connect To Drobox Storage",
back_url: "#page=jio_configurator",
panel_action: false
})
.push(function () {
gadget.props.access_token = options.token;
return gadget.props.deferred.resolve();
});
})
.declareService(function () {
var gadget = this;
return setDropboxConfiguration(gadget);
});
}(window, rJS, RSVP, console));
\ 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 @@
</item>
<item>
<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>
<key>
<string>
state
</string>
</key>
...
...
@@ -254,7 +254,7 @@
</tuple>
<state>
<tuple>
<float>
14
85780514.28
</float>
<float>
14
98039829.6
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_router_js.js
View file @
4908fe22
...
...
@@ -94,6 +94,19 @@
var
gadget
=
this
,
args
=
options
.
args
;
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
.
page
===
undefined
||
args
.
page
===
''
||
args
.
page
===
"
document_list
"
)
{
args
.
page
=
DEFAULT_PAGE
;
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_router_js.xml
View file @
4908fe22
...
...
@@ -236,7 +236,7 @@
</item>
<item>
<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>
<key>
<string>
state
</string>
</key>
...
...
@@ -254,7 +254,7 @@
</tuple>
<state>
<tuple>
<float>
14
86742528.
7
</float>
<float>
14
98033186.7
7
</float>
<string>
UTC
</string>
</tuple>
</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