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
Ludovic Kiefer
erp5
Commits
ecbfe8e1
Commit
ecbfe8e1
authored
Feb 23, 2012
by
Arnaud Fontaine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Webdav/FTP GET and PUT support for editing Components.
parent
d9a79831
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
0 deletions
+32
-0
product/ERP5Type/mixin/component.py
product/ERP5Type/mixin/component.py
+32
-0
No files found.
product/ERP5Type/mixin/component.py
View file @
ecbfe8e1
...
...
@@ -264,6 +264,38 @@ class ComponentMixin(PropertyRecordableMixin, Base):
def
_getDynamicModuleNamespace
():
raise
NotImplementedError
security
.
declareProtected
(
Permissions
.
ModifyPortalContent
,
'PUT'
)
def
PUT
(
self
,
REQUEST
,
RESPONSE
):
"""
Handle HTTP PUT requests for FTP/Webdav upload, which is object
dependent. For now only set the text content...
"""
self
.
dav__init
(
REQUEST
,
RESPONSE
)
self
.
dav__simpleifhandler
(
REQUEST
,
RESPONSE
,
refresh
=
1
)
text_content
=
REQUEST
.
get
(
'BODY'
,
None
)
if
text_content
is
None
:
RESPONSE
.
setStatus
(
304
)
else
:
self
.
setTextContent
(
text_content
)
RESPONSE
.
setStatus
(
204
)
return
RESPONSE
security
.
declareProtected
(
Permissions
.
ModifyPortalContent
,
'manage_FTPput'
)
manage_FTPput
=
PUT
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'manage_FTPget'
)
def
manage_FTPget
(
self
):
"""
Get source for FTP/Webdav. The default implementation of GET for Webdav,
available in webdav.Resource, calls manage_FTPget
XXX-arnau: encoding?
"""
return
self
.
getTextContent
()
security
.
declareProtected
(
Permissions
.
ModifyPortalContent
,
'importFromFilesystem'
)
@
classmethod
...
...
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