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
Carlos Ramos Carreño
erp5
Commits
96a9d8c5
Commit
96a9d8c5
authored
Jul 04, 2017
by
Vincent Bechu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_officejs: fix storage only during the first sync
parent
7e0db3ad
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
26 deletions
+46
-26
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
+1
-3
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_jio_erp5_configurator_js.xml
..._module/gadget_officejs_page_jio_erp5_configurator_js.xml
+2
-2
bt5/erp5_officejs/PathTemplateItem/web_page_module/jio_fixstorage_js.js
...ejs/PathTemplateItem/web_page_module/jio_fixstorage_js.js
+41
-19
bt5/erp5_officejs/PathTemplateItem/web_page_module/jio_fixstorage_js.xml
...js/PathTemplateItem/web_page_module/jio_fixstorage_js.xml
+2
-2
No files found.
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_jio_erp5_configurator_js.js
View file @
96a9d8c5
...
...
@@ -11,8 +11,7 @@
return
RSVP
.
all
([
gadget
.
getSetting
(
"
portal_type
"
),
gadget
.
getSetting
(
"
erp5_attachment_synchro
"
,
undefined
),
gadget
.
getSetting
(
"
default_view_reference
"
,
"
jio_view
"
),
gadget
.
getSetting
(
"
storage_attachment_issue
"
,
false
)
gadget
.
getSetting
(
"
default_view_reference
"
,
"
jio_view
"
)
]);
})
.
push
(
function
(
result
)
{
...
...
@@ -81,7 +80,6 @@
if
(
extended_attachment_url
===
"
/{+id}/Document_downloadForOnlyOfficeApp
"
)
{
configuration
=
{
type
:
"
fix_local
"
,
is_fixed
:
result
[
3
],
sub_storage
:
configuration
};
}
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_jio_erp5_configurator_js.xml
View file @
96a9d8c5
...
...
@@ -273,7 +273,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
960.327
26.32486.40567
</string>
</value>
<value>
<string>
960.327
32.49023.25992
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -291,7 +291,7 @@
</tuple>
<state>
<tuple>
<float>
149916
0764.83
</float>
<float>
149916
1889.04
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/jio_fixstorage_js.js
View file @
96a9d8c5
...
...
@@ -3,11 +3,39 @@
(
function
(
jIO
,
Blob
,
Rusha
,
RSVP
,
URI
)
{
"
use strict
"
;
var
rusha
=
new
Rusha
(),
stringify
=
jIO
.
util
.
stringify
;
function
repairDocumentSignature
(
storage
,
signature_document
)
{
/* The aim is deleted corrupted data to have fresh one from server
And clear signature for inexistant document
This can be consider like a HACK
*/
return
storage
.
_sub_storage
.
allDocs
({
select_list
:
[
"
content_type
"
]
})
.
push
(
function
(
result
)
{
var
i
,
promise_list
=
[],
doc_list
=
result
.
data
.
rows
;
for
(
i
=
0
;
i
<
result
.
data
.
total_rows
;
i
+=
1
)
{
if
(
doc_list
[
i
].
value
.
content_type
!==
undefined
&&
!
doc_list
[
i
].
value
.
content_type
.
startsWith
(
"
application/x-asc
"
))
{
promise_list
.
push
(
storage
.
_sub_storage
.
remove
(
doc_list
[
i
].
id
)
);
}
}
return
RSVP
.
all
(
promise_list
);
})
.
push
(
function
()
{
signature_document
.
is_fixed
=
true
;
return
storage
.
_local_storage
.
put
(
storage
.
_signature_hash
,
signature_document
);
});
}
function
CompatibilityStorage
(
spec
)
{
this
.
_sub_storage
=
jIO
.
createJIO
(
spec
.
sub_storage
);
this
.
_is_fixed
=
spec
.
is_fixed
;
this
.
_replicate_storage
=
this
.
_sub_storage
.
__storage
;
this
.
_local_storage
=
this
.
_replicate_storage
.
_local_sub_storage
;
this
.
_signature_hash
=
this
.
_replicate_storage
.
_signature_hash
;
}
CompatibilityStorage
.
prototype
.
get
=
function
()
{
...
...
@@ -31,31 +59,25 @@
};
CompatibilityStorage
.
prototype
.
repair
=
function
()
{
var
context
=
this
;
var
storage
=
this
,
signature_doc
;
// Here fix the local storage for some cases.
if
(
!
context
.
_is_fixed
)
{
return
context
.
_sub_storage
.
allDocs
({
select_list
:
[
"
content_type
"
]
})
.
push
(
function
(
result
)
{
var
i
,
promise_list
=
[],
doc_list
=
result
.
data
.
rows
;
for
(
i
=
0
;
i
<
result
.
data
.
total_rows
;
i
+=
1
)
{
if
(
doc_list
[
i
].
value
.
content_type
!==
undefined
&&
!
doc_list
[
i
].
value
.
content_type
.
startsWith
(
"
application/x-asc
"
))
{
promise_list
.
push
(
context
.
_sub_storage
.
remove
(
doc_list
[
i
].
id
)
);
return
storage
.
_local_storage
.
get
(
this
.
_signature_hash
)
.
push
(
undefined
,
function
(
error
)
{
if
(
error
.
status_code
===
404
)
{
return
{
is_fixed
:
false
};
}
})
.
push
(
function
(
doc
)
{
if
(
!
doc
.
is_fixed
)
{
return
repairDocumentSignature
(
storage
,
doc
);
}
return
RSVP
.
all
(
promise_list
);
})
.
push
(
function
()
{
return
context
.
_sub_storage
.
repair
.
apply
(
context
.
_sub_storage
,
arguments
return
storage
.
_sub_storage
.
repair
.
apply
(
storage
.
_sub_storage
,
arguments
);
});
}
};
CompatibilityStorage
.
prototype
.
allAttachments
=
function
(
doc_id
)
{
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/jio_fixstorage_js.xml
View file @
96a9d8c5
...
...
@@ -229,7 +229,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
960.
25570.27528.138
2
</string>
</value>
<value>
<string>
960.
33037.19706.6480
2
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -247,7 +247,7 @@
</tuple>
<state>
<tuple>
<float>
14991
60625.83
</float>
<float>
14991
79222.51
</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