Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5_fork
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
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
Eteri
erp5_fork
Commits
ed338a9c
Commit
ed338a9c
authored
Jul 07, 2021
by
Roque
Browse files
Options
Browse Files
Download
Plain Diff
Appstore improvements
See merge request
nexedi/erp5!1454
parents
b9abe7c2
2e4152f4
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
382 additions
and
45 deletions
+382
-45
bt5/erp5_officejs_appstore_base/PathTemplateItem/web_page_module/gadget_ojs_appstore_panel_html.html
...eItem/web_page_module/gadget_ojs_appstore_panel_html.html
+1
-1
bt5/erp5_officejs_appstore_base/PathTemplateItem/web_page_module/gadget_ojs_appstore_panel_html.xml
...teItem/web_page_module/gadget_ojs_appstore_panel_html.xml
+2
-2
bt5/erp5_officejs_appstore_base/SkinTemplateItem/portal_skins/erp5_officejs_appstore_base/SoftwarePublication_submitSoftwarePublication.py
...ore_base/SoftwarePublication_submitSoftwarePublication.py
+52
-37
bt5/erp5_officejs_appstore_base/SkinTemplateItem/portal_skins/erp5_officejs_appstore_base/SoftwareRelease_cancelRelatedWebDocument.py
...appstore_base/SoftwareRelease_cancelRelatedWebDocument.py
+10
-5
bt5/erp5_officejs_appstore_website/PathTemplateItem/image_module/store_officejs_logo_png.png
...PathTemplateItem/image_module/store_officejs_logo_png.png
+0
-0
bt5/erp5_officejs_appstore_website/PathTemplateItem/image_module/store_officejs_logo_png.xml
...PathTemplateItem/image_module/store_officejs_logo_png.xml
+317
-0
No files found.
bt5/erp5_officejs_appstore_base/PathTemplateItem/web_page_module/gadget_ojs_appstore_panel_html.html
View file @
ed338a9c
...
...
@@ -22,7 +22,7 @@
<
/div
>
<
/div
>
<
div
class
=
"
panel_img
"
>
<
img
class
=
"
ui-title
"
alt
=
"
OfficeJS
"
src
=
"
gadget_erp5_panel
.png
"
/>
<
img
class
=
"
ui-title
"
alt
=
"
OfficeJS
"
src
=
"
officejs_logo
.png
"
/>
<
/div
>
<
/div
>
</script>
...
...
bt5/erp5_officejs_appstore_base/PathTemplateItem/web_page_module/gadget_ojs_appstore_panel_html.xml
View file @
ed338a9c
...
...
@@ -267,7 +267,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
9
83.54930.13960.61730
</string>
</value>
<value>
<string>
9
92.13065.39275.59033
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -285,7 +285,7 @@
</tuple>
<state>
<tuple>
<float>
1
589291757.75
</float>
<float>
1
625152849.26
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs_appstore_base/SkinTemplateItem/portal_skins/erp5_officejs_appstore_base/SoftwarePublication_submitSoftwarePublication.py
View file @
ed338a9c
def
rejectSoftwarePublication
(
software_publication
):
software_publication
.
submit
()
software_publication
.
reject
()
return
def
extractWebManifest
(
html_file
):
html
=
context
.
Base_parseHtml
(
html_file
)
for
tag
in
html
:
if
tag
[
0
]
==
'starttag'
and
tag
[
1
]
==
'link'
and
(
'rel'
,
'manifest'
)
in
tag
[
2
]:
for
attribute
in
tag
[
2
]:
if
attribute
[
0
]
==
'href'
:
return
attribute
[
1
]
def
getBaseDirectory
(
namelist
):
base
=
""
for
name
in
namelist
:
if
"/"
in
name
:
temp_base
=
name
.
split
(
"/"
)[
0
]
if
base
and
base
!=
temp_base
:
base
=
""
break
else
:
base
=
temp_base
else
:
base
=
""
break
if
base
:
base
+=
"/"
return
base
portal
=
context
.
getPortalObject
()
software_publication
=
context
if
software_publication
.
getSimulationState
()
!=
"draft"
:
...
...
@@ -6,13 +37,17 @@ if software_publication.getSimulationState() != "draft":
software_publication_line
=
software_publication
.
objectValues
(
portal_type
=
"Software Publication Line"
,
)[
0
]
software_product
=
software_publication_line
.
getResourceValue
(
portal_type
=
"Software Product"
)
if
not
software_product
:
rejectSoftwarePublication
(
software_publication
)
return
portal
=
context
.
getPortalObject
()
software_release
=
software_publication_line
.
getAggregateValue
(
portal_type
=
"Software Release"
)
version
=
software_release
.
getReference
()
software_release_url
=
software_release
.
getRelativeUrl
()
user_login
=
software_publication
.
getSourceReference
()
application_publication_section
=
portal
.
portal_categories
.
publication_section
.
application
zip_file
=
portal
.
portal_catalog
.
getResultValue
(
...
...
@@ -22,50 +57,25 @@ zip_file = portal.portal_catalog.getResultValue(
)
if
not
zip_file
:
# XXX Do something?
rejectSoftwarePublication
(
software_publication
)
return
software_release
=
software_publication_line
.
getAggregateValue
(
portal_type
=
"Software Release"
)
from
cStringIO
import
StringIO
import
zipfile
from
zipfile
import
BadZipfile
zipbuffer
=
StringIO
()
zipbuffer
.
write
(
str
(
zip_file
.
getData
()))
zip_reader
=
zipfile
.
ZipFile
(
zipbuffer
)
user_login
=
software_publication
.
getSourceReference
()
version
=
software_release
.
getReference
()
# look for Base Directory
base
=
""
for
name
in
zip_reader
.
namelist
():
if
"/"
in
name
:
temp_base
=
name
.
split
(
"/"
)[
0
]
if
base
and
base
!=
temp_base
:
base
=
""
break
else
:
base
=
temp_base
else
:
base
=
""
break
if
base
:
base
+=
"/"
base_length
=
len
(
base
)
def
extractWebManifest
(
html_file
):
html
=
context
.
Base_parseHtml
(
html_file
)
for
tag
in
html
:
if
tag
[
0
]
==
'starttag'
and
tag
[
1
]
==
'link'
and
(
'rel'
,
'manifest'
)
in
tag
[
2
]:
for
attribute
in
tag
[
2
]:
if
attribute
[
0
]
==
'href'
:
return
attribute
[
1
]
software_release_url
=
software_release
.
getRelativeUrl
()
try
:
zip_reader
=
zipfile
.
ZipFile
(
zipbuffer
)
except
BadZipfile
:
rejectSoftwarePublication
(
software_publication
)
return
base_length
=
len
(
getBaseDirectory
(
zip_reader
.
namelist
()))
tag
=
"preparing_sr_%s"
%
software_release_url
default_page
=
""
web_manifest_url
=
None
for
name
in
zip_reader
.
namelist
():
if
zip_reader
.
getinfo
(
name
).
file_size
==
0
:
continue
...
...
@@ -89,9 +99,14 @@ for name in zip_reader.namelist():
follow_up
=
software_release_url
,
portal_type
=
"File"
,
)
try
:
publication_source_category
=
"contributor/"
+
software_publication
.
getSource
()
except
TypeError
:
rejectSoftwarePublication
(
software_publication
)
return
# XX Hackish
document
.
setCategoryList
(
document
.
getCategoryList
()
+
[
"contributor/"
+
software_publication
.
getSource
()
])
document
.
getCategoryList
()
+
[
publication_source_category
])
if
url
in
(
"index.html"
,
"index.htm"
):
default_page
=
document
.
getRelativeUrl
()
web_manifest_url
=
extractWebManifest
(
document
.
getData
())
...
...
bt5/erp5_officejs_appstore_base/SkinTemplateItem/portal_skins/erp5_officejs_appstore_base/SoftwareRelease_cancelRelatedWebDocument.py
View file @
ed338a9c
...
...
@@ -8,16 +8,23 @@ web_document_list = portal.portal_catalog(
validation_state
=
"submitted"
,
)
for
web_document
in
web_document_list
:
web_document
.
cancel
()
software_product
=
context
.
getFollowUpValue
(
portal_type
=
"Software Product"
)
web_site
=
software_product
.
SoftwareProduct_getRelatedWebSite
()
version_web_section
=
None
if
software_release
.
getReference
()
in
web_site
:
version_web_section
=
web_site
[
software_release
.
getReference
()]
#backward compatibily
if
not
version_web_section
and
software_release
.
getVersion
()
in
web_site
:
version_web_section
=
web_site
[
software_release
.
getVersion
()]
if
not
version_web_section
:
return
version_web_section
=
web_site
[
software_release
.
getVersion
()]
version_web_section
.
setCriterion
(
'validation_state'
,
'cancel'
)
version_web_section
.
setTitle
(
"Rejected "
+
version_web_section
.
getTitle
())
def
webSectionUpdatePredicate
(
current_section
):
...
...
@@ -26,5 +33,3 @@ def webSectionUpdatePredicate(current_section):
webSectionUpdatePredicate
(
child_section
)
webSectionUpdatePredicate
(
version_web_section
)
#version_web_section.cancel()
bt5/erp5_officejs_appstore_website/PathTemplateItem/image_module/store_officejs_logo_png.png
0 → 100644
View file @
ed338a9c
12.9 KB
bt5/erp5_officejs_appstore_website/PathTemplateItem/image_module/store_officejs_logo_png.xml
0 → 100644
View file @
ed338a9c
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Image"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_Access_contents_information_Permission
</string>
</key>
<value>
<tuple>
<string>
Anonymous
</string>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Add_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Change_local_roles_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Modify_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_View_Permission
</string>
</key>
<value>
<tuple>
<string>
Anonymous
</string>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_count
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
_mt_index
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
_tree
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAQ=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
content_md5
</string>
</key>
<value>
<string>
2da3b1fbfe49c09a2639a6f60f85a339
</string>
</value>
</item>
<item>
<key>
<string>
content_type
</string>
</key>
<value>
<string>
image/png
</string>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
officejs_logo.png
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
filename
</string>
</key>
<value>
<string>
OfficeJS-logo.png
</string>
</value>
</item>
<item>
<key>
<string>
height
</string>
</key>
<value>
<int>
400
</int>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
store_officejs_logo_png
</string>
</value>
</item>
<item>
<key>
<string>
language
</string>
</key>
<value>
<string>
en
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Image
</string>
</value>
</item>
<item>
<key>
<string>
short_title
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
OfficeJS Logo
</string>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
001
</string>
</value>
</item>
<item>
<key>
<string>
width
</string>
</key>
<value>
<int>
400
</int>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAU=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"Length"
module=
"BTrees.Length"
/>
</pickle>
<pickle>
<int>
0
</int>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"OOBTree"
module=
"BTrees.OOBTree"
/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<global
name=
"OOBTree"
module=
"BTrees.OOBTree"
/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record
id=
"5"
aka=
"AAAAAAAAAAU="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
document_publication_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAY=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
edit_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAc=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"6"
aka=
"AAAAAAAAAAY="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
publish_alive
</string>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
error_message
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
time
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1625152695.87
</float>
<string>
UTC
</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
published_alive
</string>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"7"
aka=
"AAAAAAAAAAc="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
edit
</string>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
error_message
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
993.8785.47238.42973
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
<value>
<string>
current
</string>
</value>
</item>
<item>
<key>
<string>
time
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1625152464.19
</float>
<string>
UTC
</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
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