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
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Cédric Le Ninivin
erp5
Commits
800fa2df
Commit
800fa2df
authored
May 19, 2016
by
Cédric Le Ninivin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_officejs_appstore_base: Use dedicated application redirect manifest
parent
8158b09e
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
38 additions
and
355 deletions
+38
-355
bt5/erp5_officejs_appstore_base/PathTemplateItem/web_page_module/gadget_ojs_appstore_redirect_appcache.xml
...web_page_module/gadget_ojs_appstore_redirect_appcache.xml
+0
-339
bt5/erp5_officejs_appstore_base/PathTemplateItem/web_page_module/gadget_ojs_appstore_redirect_page_html.html
...b_page_module/gadget_ojs_appstore_redirect_page_html.html
+11
-4
bt5/erp5_officejs_appstore_base/PathTemplateItem/web_page_module/gadget_ojs_appstore_redirect_page_html.xml
...eb_page_module/gadget_ojs_appstore_redirect_page_html.xml
+2
-2
bt5/erp5_officejs_appstore_base/SkinTemplateItem/portal_skins/erp5_officejs_appstore_base/SoftwareRelease_publishRelatedWebDocument.py
...ppstore_base/SoftwareRelease_publishRelatedWebDocument.py
+24
-10
bt5/erp5_officejs_appstore_base/SkinTemplateItem/portal_skins/erp5_web_versioning/WebSection_renderOfficeJSApplicationPage.py
...eb_versioning/WebSection_renderOfficeJSApplicationPage.py
+1
-0
No files found.
bt5/erp5_officejs_appstore_base/PathTemplateItem/web_page_module/gadget_ojs_appstore_redirect_appcache.xml
deleted
100644 → 0
View file @
8158b09e
This diff is collapsed.
Click to expand it.
bt5/erp5_officejs_appstore_base/PathTemplateItem/web_page_module/gadget_ojs_appstore_redirect_page_html.html
View file @
800fa2df
<!DOCTYPE html>
<!DOCTYPE html>
<html
manifest=
"
officejsredirect.appcache
"
>
<html
manifest=
"
${application_appcache}
"
>
<body>
<body>
<SCRIPT
LANGUAGE=
"JavaScript"
>
<script
language=
"JavaScript"
>
document.location.href="${latest_version}/"
function
redirect_version
()
{
</SCRIPT>
document
.
location
.
href
=
"
${latest_version}/
"
};
window
.
applicationCache
.
addEventListener
(
'
cached
'
,
redirect_version
);
window
.
applicationCache
.
addEventListener
(
'
noupdate
'
,
redirect_version
);
window
.
applicationCache
.
addEventListener
(
'
updateready
'
,
function
(){
window
.
location
.
reload
()});
// XXX This is a hack for when the network is too slow.
window
.
setTimeout
(
redirect_version
,
10000
);
</script>
</body>
</body>
</html>
</html>
\ No newline at end of file
bt5/erp5_officejs_appstore_base/PathTemplateItem/web_page_module/gadget_ojs_appstore_redirect_page_html.xml
View file @
800fa2df
...
@@ -244,7 +244,7 @@
...
@@ -244,7 +244,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
95
0.60513.63859.18056
</string>
</value>
<value>
<string>
95
1.19443.53509.7185
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -262,7 +262,7 @@
...
@@ -262,7 +262,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
146
2201287.71
</float>
<float>
146
3665193.7
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_officejs_appstore_base/SkinTemplateItem/portal_skins/erp5_officejs_appstore_base/SoftwareRelease_publishRelatedWebDocument.py
View file @
800fa2df
portal
=
context
.
getPortalObject
()
portal
=
context
.
getPortalObject
()
software_release
=
context
software_release
=
context
# Publish Web Document
web_document_list
=
portal
.
portal_catalog
(
web_document_list
=
portal
.
portal_catalog
(
portal_type
=
portal
.
getPortalDocumentTypeList
(),
portal_type
=
portal
.
getPortalDocumentTypeList
(),
strict_follow_up_uid
=
software_release
.
getUid
(),
strict_follow_up_uid
=
software_release
.
getUid
(),
validation_state
=
"submitted"
,
validation_state
=
"submitted"
,
)
)
today
=
DateTime
().
earliestTime
()
today
=
DateTime
().
earliestTime
()
for
web_document
in
web_document_list
:
for
web_document
in
web_document_list
:
web_document
.
setEffectiveDate
(
today
)
web_document
.
setEffectiveDate
(
today
)
web_document
.
publish
()
web_document
.
publish
()
software_product
=
context
.
getFollowUpValue
(
portal_type
=
"Software Product"
)
software_product
=
context
.
getFollowUpValue
(
portal_type
=
"Software Product"
)
web_site
=
software_product
.
SoftwareProduct_getRelatedWebSite
()
web_site
=
software_product
.
SoftwareProduct_getRelatedWebSite
()
# Publish Web Site, Websection and update version
today
=
DateTime
().
earliestTime
()
today
=
DateTime
().
earliestTime
()
if
web_site
.
getValidationState
()
!=
'published'
:
if
web_site
.
getValidationState
()
!=
'published'
:
web_site
.
setEffectiveDate
(
today
)
web_site
.
setEffectiveDate
(
today
)
...
@@ -33,6 +30,28 @@ web_site.edit(
...
@@ -33,6 +30,28 @@ web_site.edit(
configuration_latest_version
=
software_release
.
getVersion
(),
configuration_latest_version
=
software_release
.
getVersion
(),
)
)
# Update appcache
web_manifest_reference
=
web_site
.
getId
()
+
".appcache"
web_manifest
=
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
"Web Manifest"
,
reference
=
web_manifest_reference
,
)
if
not
web_manifest
:
web_manifest
=
portal
.
web_page_module
.
newContent
(
portal_type
=
"Web Manifest"
,
reference
=
web_manifest_reference
,
title
=
web_site
.
getTitle
()
+
" Manifest"
,
)
web_manifest
.
publishAlive
()
web_manifest
.
setData
(
"""CACHE MANIFEST
# generated on %s
CACHE:
NETWORK:
*"""
%
(
DateTime
().
rfc822
()))
# Is latest Websection what we want?
# Is latest Websection what we want?
if
"latest"
not
in
web_site
.
objectIds
():
if
"latest"
not
in
web_site
.
objectIds
():
latest_web_section
=
version_web_section
.
Base_createCloneDocument
(
batch_mode
=
True
)
latest_web_section
=
version_web_section
.
Base_createCloneDocument
(
batch_mode
=
True
)
...
@@ -44,8 +63,3 @@ else:
...
@@ -44,8 +63,3 @@ else:
latest_web_section
.
setCriterion
(
'version'
,
software_release
.
getVersion
())
latest_web_section
.
setCriterion
(
'version'
,
software_release
.
getVersion
())
latest_web_section
.
setTitle
(
version_web_section
.
getTitle
())
latest_web_section
.
setTitle
(
version_web_section
.
getTitle
())
latest_web_section
.
setAggregate
(
version_web_section
.
getAggregate
())
latest_web_section
.
setAggregate
(
version_web_section
.
getAggregate
())
# Archive former versions
#for web_section in web_site.objectValues(portal_type="Web Section"):
# if web_section.getId() not in ('latest', 'development', 'hateoas', version_web_section.getId()):
# web_section.setCriterion('validation_state', 'archived')
bt5/erp5_officejs_appstore_base/SkinTemplateItem/portal_skins/erp5_web_versioning/WebSection_renderOfficeJSApplicationPage.py
View file @
800fa2df
...
@@ -9,4 +9,5 @@ web_section = REQUEST.get("current_web_section")
...
@@ -9,4 +9,5 @@ web_section = REQUEST.get("current_web_section")
return
default_web_page
.
WebPage_viewAsWeb
(
mapping_dict
=
{
return
default_web_page
.
WebPage_viewAsWeb
(
mapping_dict
=
{
"latest_version"
:
web_section
.
getLayoutProperty
(
"configuration_latest_version"
,
default
=
"development"
),
"latest_version"
:
web_section
.
getLayoutProperty
(
"configuration_latest_version"
,
default
=
"development"
),
"application_appcache"
:
web_section
.
getId
()
+
".appcache"
,
})
})
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