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
Labels
Merge Requests
138
Merge Requests
138
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
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
fd82f0d1
Commit
fd82f0d1
authored
Mar 25, 2019
by
Roque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_officejs: jio_allDocs queries can be done on local data storage after appcachestorage sync
parent
06d61302
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
54 additions
and
21 deletions
+54
-21
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_controller_page_controller_js.js
...e_module/gadget_officejs_controller_page_controller_js.js
+14
-7
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_controller_page_controller_js.xml
..._module/gadget_officejs_controller_page_controller_js.xml
+2
-2
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_discussion_tool_appcache.xml
..._page_module/gadget_officejs_discussion_tool_appcache.xml
+2
-2
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_appcachestorage_js.xml
...eb_page_module/gadget_officejs_jio_appcachestorage_js.xml
+2
-2
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_js.js
...athTemplateItem/web_page_module/gadget_officejs_jio_js.js
+32
-6
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_js.xml
...thTemplateItem/web_page_module/gadget_officejs_jio_js.xml
+2
-2
No files found.
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_controller_page_controller_js.js
View file @
fd82f0d1
...
...
@@ -90,13 +90,20 @@
/////////////////////////////////////////////////////////////////
.
declareMethod
(
"
getFormDefinition
"
,
function
(
portal_type
)
{
var
gadget
=
this
;
//TODO: the corresponding action must be get via allDocs -not implemented in appcachestorage yet
return
gadget
.
jio_get
(
"
portal_types/HTML Post/2
"
)
.
push
(
function
(
action_result
)
{
return
gadget
.
jio_get
(
action_result
.
_embedded
.
_view
.
my_action
[
"
default
"
])
.
push
(
function
(
result
)
{
return
result
.
_embedded
.
_view
.
my_form_definition
[
"
default
"
];
var
gadget
=
this
,
parent
=
"
portal_types/
"
+
portal_type
,
query
=
'
portal_type: "Action Information" AND reference: "jio_view" AND parent_relative_url: "
'
+
parent
+
'
"
'
;
return
gadget
.
jio_allDocs
({
query
:
query
})
.
push
(
function
(
data
)
{
if
(
data
.
data
.
rows
.
length
===
0
)
{
throw
"
Can not find jio_view action for portal type
"
+
portal_type
;
}
return
gadget
.
jio_get
(
data
.
data
.
rows
[
0
].
id
)
.
push
(
function
(
action_result
)
{
return
gadget
.
jio_get
(
action_result
.
action
)
.
push
(
function
(
form_result
)
{
return
form_result
.
form_definition
;
});
});
});
})
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_controller_page_controller_js.xml
View file @
fd82f0d1
...
...
@@ -225,7 +225,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
974.3
1714.23130.16571
</string>
</value>
<value>
<string>
974.3
8574.15384.64529
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -243,7 +243,7 @@
</tuple>
<state>
<tuple>
<float>
1553
262870.8
</float>
<float>
1553
525314.0
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_discussion_tool_appcache.xml
View file @
fd82f0d1
...
...
@@ -734,7 +734,7 @@ NETWORK:\n
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
974.3
1714.43269.18500
</string>
</value>
<value>
<string>
974.3
8461.51527.60023
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -752,7 +752,7 @@ NETWORK:\n
</tuple>
<state>
<tuple>
<float>
1553
114789.83
</float>
<float>
1553
524697.35
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_appcachestorage_js.xml
View file @
fd82f0d1
...
...
@@ -237,7 +237,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
974.3
1314.47298.6304
4
</string>
</value>
<value>
<string>
974.3
8565.24349.6519
4
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -255,7 +255,7 @@
</tuple>
<state>
<tuple>
<float>
1553
089133.43
</float>
<float>
1553
525326.06
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_js.js
View file @
fd82f0d1
...
...
@@ -60,6 +60,34 @@
});
}
function
processHateoasDict
(
raw_dict
)
{
var
return_dict
=
{};
try
{
var
raw_fields
=
raw_dict
.
_embedded
.
_view
,
type
=
raw_dict
.
_links
.
type
.
name
,
parent
=
raw_dict
.
_links
.
parent
.
name
;
return_dict
.
parent_relative_url
=
"
portal_types/
"
+
parent
;
return_dict
.
portal_type
=
type
;
for
(
var
field_key
in
raw_fields
)
{
var
field_id
=
""
;
if
(
raw_fields
[
field_key
][
"
default
"
]
!==
undefined
&&
raw_fields
[
field_key
][
"
default
"
]
!==
""
)
{
if
(
field_key
.
startsWith
(
"
my_
"
))
{
field_id
=
field_key
.
replace
(
"
my_
"
,
""
);
}
else
if
(
field_key
.
startsWith
(
"
your_
"
))
{
field_id
=
field_key
.
replace
(
"
your_
"
,
""
);
}
else
{
field_id
=
field_key
;
}
return_dict
[
field_id
]
=
raw_fields
[
field_key
][
"
default
"
];
}
}
}
catch
(
e
)
{
// raw_dict is a blob
return
raw_dict
;
}
return
return_dict
;
}
rJS
(
window
)
.
ready
(
function
(
gadget
)
{
...
...
@@ -128,8 +156,8 @@
// the hash layer of the appcachestorage is asociated to local data storage selected
jio_appchache_options
.
signature_sub_storage
.
sub_storage
.
database
=
"
appcachestorage-hash-
"
+
jio_storage_name
;
appcache_storage
=
jIO
.
createJIO
(
jio_appchache_options
);
//
check
if appcache-local sync needs to be done
// TODO: find a better flag for this
//
verify
if appcache-local sync needs to be done
// TODO: find a better flag for this
?
return
appcache_storage
.
get
(
sync_flag
)
.
push
(
undefined
,
function
(
error
)
{
return
appcache_storage
.
repair
()
...
...
@@ -159,10 +187,8 @@
var
urlParams
=
new
URLSearchParams
(
parser
.
search
);
id
=
urlParams
.
get
(
"
relative_url
"
);
if
(
id
===
null
)
{
id
=
configuration_ids_dict
[
""
+
i
];
}
//TODO: remember that the content is the pure hateoas dict returned by the script
// it should be processed in order to save a json document that allows allDocs queries
// without nested levels like _embedded, _view, etc
promise_list
.
push
(
appcache_storage
.
put
(
id
,
content_list
[
i
]));
var
content
=
processHateoasDict
(
content_list
[
i
]);
promise_list
.
push
(
appcache_storage
.
put
(
id
,
content
));
}
return
RSVP
.
all
(
promise_list
);
})
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_js.xml
View file @
fd82f0d1
...
...
@@ -234,7 +234,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
974.3
1702.6932.56797
</string>
</value>
<value>
<string>
974.3
8585.37530.16384
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>
1553
112587.71
</float>
<float>
1553
525541.12
</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