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
f57ac544
Commit
f57ac544
authored
Jul 05, 2011
by
Lucas Carvalho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure that the document is only published by last.
parent
0eb076a7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
10 deletions
+17
-10
bt5/erp5_web_shacache/ExtensionTemplateItem/ShaCache.py
bt5/erp5_web_shacache/ExtensionTemplateItem/ShaCache.py
+16
-9
bt5/erp5_web_shacache/bt/revision
bt5/erp5_web_shacache/bt/revision
+1
-1
No files found.
bt5/erp5_web_shacache/ExtensionTemplateItem/ShaCache.py
View file @
f57ac544
...
@@ -35,11 +35,6 @@ def WebSection_getDocumentValue(self, key, portal=None, language=None,\
...
@@ -35,11 +35,6 @@ def WebSection_getDocumentValue(self, key, portal=None, language=None,\
"""
"""
API SHACACHE
API SHACACHE
- POST /<key>
+ parameters required:
* data: it is the file content
The key is the file name.
- GET /<key>
- GET /<key>
The key is the sha512sum.
The key is the sha512sum.
...
@@ -70,9 +65,6 @@ def WebSection_setObject(self, id, ob, **kw):
...
@@ -70,9 +65,6 @@ def WebSection_setObject(self, id, ob, **kw):
"""
"""
Add any change of the file uploaded.
Add any change of the file uploaded.
"""
"""
ob
.
publishAlive
()
ob
.
setContentType
(
'application/octet-stream'
)
ob
.
setFilename
(
id
)
sha512sum
=
hashlib
.
sha512
()
sha512sum
=
hashlib
.
sha512
()
self
.
REQUEST
.
_file
.
seek
(
0
)
self
.
REQUEST
.
_file
.
seek
(
0
)
...
@@ -86,12 +78,19 @@ def WebSection_setObject(self, id, ob, **kw):
...
@@ -86,12 +78,19 @@ def WebSection_setObject(self, id, ob, **kw):
if
reference
!=
id
:
if
reference
!=
id
:
raise
ValueError
(
'The content does not match with sha512sum provided.'
)
raise
ValueError
(
'The content does not match with sha512sum provided.'
)
# Set object properties
ob
.
setContentType
(
'application/octet-stream'
)
ob
.
setFilename
(
id
)
ob
.
setReference
(
reference
)
ob
.
setReference
(
reference
)
return
ob
return
ob
def
WebSection_putFactory
(
self
,
name
,
typ
,
body
):
def
WebSection_putFactory
(
self
,
name
,
typ
,
body
):
"""
"""
XXX
API SHACACHE
- PUT /<key>
+ parameters required:
* data: it is the file content
The key is the file name.
"""
"""
portal
=
self
.
getPortalObject
()
portal
=
self
.
getPortalObject
()
group
=
(
'networkcache'
,)
group
=
(
'networkcache'
,)
...
@@ -114,4 +113,12 @@ def WebSection_putFactory(self, name, typ, body):
...
@@ -114,4 +113,12 @@ def WebSection_putFactory(self, name, typ, body):
id
=
new_id
)
id
=
new_id
)
document
=
container
.
_getOb
(
new_id
)
document
=
container
.
_getOb
(
new_id
)
# We can only change the state of the object after all the activities and
# interaction workflow, to avoid any security problem.
document
.
activate
(
after_path_and_method_id
=
(
document
.
getPath
(),
\
(
'convertToBaseFormat'
,
'Document_tryToConvertToBaseFormat'
,
\
'immediateReindexObject'
,
'recursiveImmediateReindexObject'
)))
\
.
WebSite_publishDocumentByActivity
()
return
document
return
document
bt5/erp5_web_shacache/bt/revision
View file @
f57ac544
36
37
\ No newline at end of file
\ No newline at end of file
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