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
Klaus Wölfel
erp5
Commits
b700cece
Commit
b700cece
authored
Sep 21, 2016
by
Cédric Le Ninivin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_officejs: Add ERP5 jIO configurator to specify ERP5 URL
parent
aa7b0075
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
972 additions
and
59 deletions
+972
-59
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_appcache.xml
...TemplateItem/web_page_module/gadget_officejs_appcache.xml
+4
-4
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_jio_configurator_js.js
...b_page_module/gadget_officejs_page_jio_configurator_js.js
+1
-51
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_jio_dav_configurator_html.html
...odule/gadget_officejs_page_jio_dav_configurator_html.html
+5
-4
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_jio_erp5_configurator_html.html
...dule/gadget_officejs_page_jio_erp5_configurator_html.html
+71
-0
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_jio_erp5_configurator_html.xml
...odule/gadget_officejs_page_jio_erp5_configurator_html.xml
+363
-0
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_jio_erp5_configurator_js.js
...e_module/gadget_officejs_page_jio_erp5_configurator_js.js
+169
-0
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_jio_erp5_configurator_js.xml
..._module/gadget_officejs_page_jio_erp5_configurator_js.xml
+359
-0
No files found.
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_appcache.xml
View file @
b700cece
...
...
@@ -141,6 +141,7 @@ gadget_officejs_jio.html\n
gadget_officejs_page_add_document.html\n
gadget_officejs_page_jio_configurator.html\n
gadget_officejs_page_jio_dav_configurator.html\n
gadget_officejs_page_jio_erp5_configurator.html\n
gadget_officejs_page_login.html\n
gadget_officejs_page_logout.html\n
gadget_officejs_page_share_webrtc_jio.html\n
...
...
@@ -157,6 +158,7 @@ gadget_officejs_jio.js\n
gadget_officejs_page_add_document.js\n
gadget_officejs_page_jio_configurator.js\n
gadget_officejs_page_jio_dav_configurator.js\n
gadget_officejs_page_jio_erp5_configurator.js\n
gadget_officejs_page_login.js\n
gadget_officejs_page_logout.js\n
gadget_officejs_page_share_webrtc_jio.js\n
...
...
@@ -176,8 +178,6 @@ gadget_officejs_jio_web_page_view.html\n
gadget_officejs_jio_web_page_view.js\n
gadget_officejs_jio_web_illustration_view.html\n
gadget_officejs_jio_web_illustration_view.js\n
rjsunsafe/gadget_ckeditor.js\n
rjsunsafe/gadget_ckeditor.html\n
NETWORK:\n
*
...
...
@@ -310,7 +310,7 @@ NETWORK:\n
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
95
1.28226.17594.11093
</string>
</value>
<value>
<string>
95
2.33234.39189.52889
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -328,7 +328,7 @@ NETWORK:\n
</tuple>
<state>
<tuple>
<float>
146
5466150.81
</float>
<float>
146
8340832.92
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_jio_configurator_js.js
View file @
b700cece
...
...
@@ -5,57 +5,7 @@
"
use strict
"
;
function
setERP5Configuration
(
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
+
'
" AND modification_date:>="
'
+
old_date
.
toISOString
()
+
'
"
'
,
limit
:
[
0
,
1234567890
]
},
use_remote_post
:
true
,
conflict_handling
:
1
,
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
:
"
query
"
,
sub_storage
:
{
type
:
"
uuid
"
,
sub_storage
:
{
type
:
"
indexeddb
"
,
database
:
"
officejs-erp5
"
}
}
},
remote_sub_storage
:
{
type
:
"
erp5
"
,
url
:
(
new
URI
(
"
hateoas
"
))
.
absoluteTo
(
location
.
href
)
.
toString
(),
default_view_reference
:
"
jio_view
"
}
};
return
gadget
.
setSetting
(
'
jio_storage_description
'
,
configuration
);
})
.
push
(
function
()
{
return
gadget
.
setSetting
(
'
jio_storage_name
'
,
"
ERP5
"
);
})
.
push
(
function
()
{
return
gadget
.
reload
();
});
return
gadget
.
redirect
({
page
:
'
jio_erp5_configurator
'
});
}
function
setLocalConfiguration
(
gadget
)
{
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_jio_dav_configurator_html.html
View file @
b700cece
...
...
@@ -50,21 +50,22 @@
</form>
</section>
</article>
<article
class=
"ui-content ui-body-c"
>
<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
Text
Documents
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"
>
Synchronize
</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"
>
Go to
document List
</a>
<a
class=
"ui-btn"
href=
"#page=document_list"
data-i18n=
"Go to document List"
>
Access
document List
</a>
</div>
</div>
</div>
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_jio_erp5_configurator_html.html
0 → 100644
View file @
b700cece
<!doctype html>
<html>
<head>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<title>
OfficeJS jIO ERP5 Configurator Page
</title>
<script
src=
"rsvp.js"
></script>
<script
src=
"renderjs.js"
></script>
<script
src=
"gadget_officejs_page_jio_erp5_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 ERP5 Connection parameters
</h3>
</section>
<section
class=
"ui-content-header-plain"
>
<p>
You have to be logged in this ERP5 prior to synchronising
</p>
</section>
<section
class=
"ui-body-c ui-content-section"
>
<form
class=
"erp5-configuration-form"
>
<div
class=
"ui-form"
>
<div
class=
"ui-field-contain"
>
<label
data-i18n=
"Connection URL:"
>
Connection URL:
</label>
<input
type=
"url"
name=
"erp5_url"
required
disabled
/>
</div>
<div
class=
"select-storage ui-controlgroup ui-controlgroup-horizontal"
>
<div
class=
"ui-grid-b ui-responsive"
>
<div
class=
"ui-block-a"
></div>
<div
class=
"ui-block-b"
></div>
<div
class=
"ui-block-c"
>
<button
type=
"submit"
data-i18n=
"Connect"
class=
"ui-btn-btn-right"
>
Connect
</button>
</div>
</div>
</div>
</form>
</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>
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_jio_erp5_configurator_html.xml
0 → 100644
View file @
b700cece
This diff is collapsed.
Click to expand it.
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_jio_erp5_configurator_js.js
0 → 100644
View file @
b700cece
/*global window, rJS, RSVP, URI, location,
loopEventListener, btoa */
/*jslint nomen: true, indent: 2, maxerr: 3*/
(
function
(
window
,
rJS
,
RSVP
)
{
"
use strict
"
;
function
setjIOERP5Configuration
(
gadget
)
{
var
erp5_url
=
gadget
.
props
.
element
.
querySelector
(
"
input[name='erp5_url']
"
).
value
;
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
(),
old_date
.
getDate
()
-
15
);
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
+
'
" AND modification_date:>="
'
+
old_date
.
toISOString
()
+
'
"
'
,
limit
:
[
0
,
1234567890
]
},
use_remote_post
:
true
,
conflict_handling
:
1
,
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
:
"
query
"
,
sub_storage
:
{
type
:
"
uuid
"
,
sub_storage
:
{
type
:
"
indexeddb
"
,
database
:
"
officejs-erp5
"
}
}
},
remote_sub_storage
:
{
type
:
"
erp5
"
,
url
:
(
new
URI
(
"
hateoas
"
))
.
absoluteTo
(
erp5_url
)
.
toString
(),
default_view_reference
:
"
jio_view
"
}
};
return
gadget
.
setSetting
(
'
jio_storage_description
'
,
configuration
);
})
.
push
(
function
()
{
return
gadget
.
setSetting
(
'
jio_storage_name
'
,
"
ERP5
"
);
})
.
push
(
function
()
{
return
gadget
.
setGlobalSetting
(
'
erp5_url
'
,
erp5_url
);
})
.
push
(
function
()
{
return
gadget
.
reload
();
});
}
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
()
{
var
gadget
=
this
;
return
gadget
.
updateHeader
({
title
:
"
Connect To ERP5 Storage
"
,
back_url
:
"
#page=jio_configurator
"
,
panel_action
:
false
})
.
push
(
function
()
{
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
()
{
return
gadget
.
props
.
deferred
.
resolve
();
});
})
/////////////////////////////////////////
// Form submit
/////////////////////////////////////////
.
declareService
(
function
()
{
var
gadget
=
this
;
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
gadget
.
props
.
deferred
.
promise
;
})
.
push
(
function
()
{
return
loopEventListener
(
gadget
.
props
.
element
.
querySelector
(
'
form
'
),
'
submit
'
,
true
,
function
()
{
return
setjIOERP5Configuration
(
gadget
);
}
);
});
})
.
declareService
(
function
()
{
var
gadget
=
this
;
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
gadget
.
props
.
deferred
.
promise
;
})
.
push
(
function
()
{
return
gadget
.
getSetting
(
"
global_setting_gadget_url
"
);
})
.
push
(
function
(
global_setting_gadget_url
)
{
return
gadget
.
declareGadget
(
global_setting_gadget_url
,
{
scope
:
"
global_setting_gadget
"
,
sandbox
:
"
iframe
"
,
element
:
gadget
.
props
.
element
.
querySelector
(
"
.global_setting_gadget
"
)
}
);
})
.
push
(
function
(
global_setting_gadget
)
{
return
global_setting_gadget
.
getSetting
(
"
erp5_url
"
);
})
.
push
(
function
(
erp5_url
)
{
var
erp5_url_input
=
gadget
.
props
.
element
.
querySelector
(
"
input[name='erp5_url']
"
);
erp5_url_input
.
value
=
erp5_url
||
"
https://www.example.org
"
;
erp5_url_input
.
removeAttribute
(
"
disabled
"
);
erp5_url_input
.
parentNode
.
classList
.
remove
(
'
ui-state-disabled
'
);
});
});
}(
window
,
rJS
,
RSVP
));
\ No newline at end of file
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_jio_erp5_configurator_js.xml
0 → 100644
View file @
b700cece
This diff is collapsed.
Click to expand it.
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