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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Sebastien Robin
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,\
"""
API SHACACHE
- POST /<key>
+ parameters required:
* data: it is the file content
The key is the file name.
- GET /<key>
The key is the sha512sum.
...
...
@@ -70,9 +65,6 @@ def WebSection_setObject(self, id, ob, **kw):
"""
Add any change of the file uploaded.
"""
ob
.
publishAlive
()
ob
.
setContentType
(
'application/octet-stream'
)
ob
.
setFilename
(
id
)
sha512sum
=
hashlib
.
sha512
()
self
.
REQUEST
.
_file
.
seek
(
0
)
...
...
@@ -86,12 +78,19 @@ def WebSection_setObject(self, id, ob, **kw):
if
reference
!=
id
:
raise
ValueError
(
'The content does not match with sha512sum provided.'
)
# Set object properties
ob
.
setContentType
(
'application/octet-stream'
)
ob
.
setFilename
(
id
)
ob
.
setReference
(
reference
)
return
ob
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
()
group
=
(
'networkcache'
,)
...
...
@@ -114,4 +113,12 @@ def WebSection_putFactory(self, name, typ, body):
id
=
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
bt5/erp5_web_shacache/bt/revision
View file @
f57ac544
36
\ No newline at end of file
37
\ 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