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
Labels
Merge Requests
138
Merge Requests
138
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
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
b4e36a60
Commit
b4e36a60
authored
Apr 11, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
web_service: py3
parent
e16617ac
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
16 deletions
+14
-16
bt5/erp5_web_service/ModuleComponentTemplateItem/portal_components/module.erp5.DocumentConnection.py
...eItem/portal_components/module.erp5.DocumentConnection.py
+4
-4
bt5/erp5_web_service/ModuleComponentTemplateItem/portal_components/module.erp5.SFTPConnection.py
...plateItem/portal_components/module.erp5.SFTPConnection.py
+1
-1
bt5/erp5_web_service/ModuleComponentTemplateItem/portal_components/module.erp5.SQLConnection.py
...mplateItem/portal_components/module.erp5.SQLConnection.py
+4
-6
bt5/erp5_web_service/ToolComponentTemplateItem/portal_components/tool.erp5.WebServiceTool.py
...emplateItem/portal_components/tool.erp5.WebServiceTool.py
+5
-5
No files found.
bt5/erp5_web_service/ModuleComponentTemplateItem/portal_components/module.erp5.DocumentConnection.py
View file @
b4e36a60
...
...
@@ -26,7 +26,7 @@
#
##############################################################################
from
erp5.component.tool.WebServiceTool
import
ConnectionError
from
erp5.component.tool.WebServiceTool
import
WebService
ConnectionError
from
Products.ERP5.ERP5Site
import
getSite
class
MethodWrapper
(
object
):
...
...
@@ -45,11 +45,11 @@ class MethodWrapper(object):
return
method
.
absolute_url
(),
response
## try:
## except ValueError, msg:
## raise ConnectionError(msg)
## raise
WebService
ConnectionError(msg)
## except Exception, msg:
## raise ConnectionError(msg)
## raise
WebService
ConnectionError(msg)
else
:
raise
ConnectionError
(
"Method %s does not exist"
%
(
method_name
))
raise
WebService
ConnectionError
(
"Method %s does not exist"
%
(
method_name
))
class
DocumentConnection
:
"""
...
...
bt5/erp5_web_service/ModuleComponentTemplateItem/portal_components/module.erp5.SFTPConnection.py
View file @
b4e36a60
...
...
@@ -40,7 +40,7 @@ class SFTPError(Exception):
"""
Default exception for the connection
"""
pass
class
SFTPConnection
:
"""
...
...
bt5/erp5_web_service/ModuleComponentTemplateItem/portal_components/module.erp5.SQLConnection.py
View file @
b4e36a60
...
...
@@ -27,6 +27,8 @@
##############################################################################
from
Products.ERP5.ERP5Site
import
getSite
from
erp5.component.tool.WebServiceTool
import
WebServiceConnectionError
class
MethodWrapper
(
object
):
...
...
@@ -42,8 +44,8 @@ class MethodWrapper(object):
response
=
method
(
*
args
,
**
kw
)
return
method
.
absolute_url
(),
response
else
:
from
erp5.component.tool.WebServiceTool
import
ConnectionError
raise
ConnectionError
(
"Method %s does not exist"
%
(
method_name
))
raise
WebServiceConnectionError
(
"Method %s does not exist"
%
(
method_name
))
class
SQLConnection
:
"""
...
...
@@ -52,10 +54,6 @@ class SQLConnection:
"""
__allow_access_to_unprotected_subobjects__
=
1
def
__init__
(
self
,
*
args
,
**
kw
):
""" Do nothing """
pass
def
connect
(
self
):
"""Get a handle to a remote connection."""
return
self
...
...
bt5/erp5_web_service/ToolComponentTemplateItem/portal_components/tool.erp5.WebServiceTool.py
View file @
b4e36a60
...
...
@@ -34,8 +34,10 @@ from Products.ERP5Type.Tool.BaseTool import BaseTool
from
Products.ERP5Type
import
Permissions
import
six
class
ConnectionError
(
Exception
):
pass
class
WebServiceConnectionError
(
Exception
):
"""Error when connecting
"""
connection_plugin_registry
=
{}
...
...
@@ -92,9 +94,7 @@ class WebServiceTool(BaseTool):
"""
Return list of available connection plugins
"""
plugin_list
=
connection_plugin_registry
.
keys
()
plugin_list
.
sort
()
return
plugin_list
return
sorted
(
connection_plugin_registry
.
keys
())
security
.
declareProtected
(
Permissions
.
ManagePortal
,
'connect'
)
def
connect
(
self
,
url
,
user_name
=
None
,
password
=
None
,
transport
=
None
,
transport_kw
=
None
):
...
...
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