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
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Jérome Perrin
erp5
Commits
5e811546
Commit
5e811546
authored
Apr 11, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
web_service: py3
parent
d628c170
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 @
5e811546
...
@@ -26,7 +26,7 @@
...
@@ -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
from
Products.ERP5.ERP5Site
import
getSite
class
MethodWrapper
(
object
):
class
MethodWrapper
(
object
):
...
@@ -45,11 +45,11 @@ class MethodWrapper(object):
...
@@ -45,11 +45,11 @@ class MethodWrapper(object):
return
method
.
absolute_url
(),
response
return
method
.
absolute_url
(),
response
## try:
## try:
## except ValueError, msg:
## except ValueError, msg:
## raise ConnectionError(msg)
## raise
WebService
ConnectionError(msg)
## except Exception, msg:
## except Exception, msg:
## raise ConnectionError(msg)
## raise
WebService
ConnectionError(msg)
else
:
else
:
raise
ConnectionError
(
"Method %s does not exist"
%
(
method_name
))
raise
WebService
ConnectionError
(
"Method %s does not exist"
%
(
method_name
))
class
DocumentConnection
:
class
DocumentConnection
:
"""
"""
...
...
bt5/erp5_web_service/ModuleComponentTemplateItem/portal_components/module.erp5.SFTPConnection.py
View file @
5e811546
...
@@ -40,7 +40,7 @@ class SFTPError(Exception):
...
@@ -40,7 +40,7 @@ class SFTPError(Exception):
"""
"""
Default exception for the connection
Default exception for the connection
"""
"""
pass
class
SFTPConnection
:
class
SFTPConnection
:
"""
"""
...
...
bt5/erp5_web_service/ModuleComponentTemplateItem/portal_components/module.erp5.SQLConnection.py
View file @
5e811546
...
@@ -27,6 +27,8 @@
...
@@ -27,6 +27,8 @@
##############################################################################
##############################################################################
from
Products.ERP5.ERP5Site
import
getSite
from
Products.ERP5.ERP5Site
import
getSite
from
erp5.component.tool.WebServiceTool
import
WebServiceConnectionError
class
MethodWrapper
(
object
):
class
MethodWrapper
(
object
):
...
@@ -42,8 +44,8 @@ class MethodWrapper(object):
...
@@ -42,8 +44,8 @@ class MethodWrapper(object):
response
=
method
(
*
args
,
**
kw
)
response
=
method
(
*
args
,
**
kw
)
return
method
.
absolute_url
(),
response
return
method
.
absolute_url
(),
response
else
:
else
:
from
erp5.component.tool.WebServiceTool
import
ConnectionError
raise
WebServiceConnectionError
(
"Method %s does not exist"
%
(
method_name
))
raise
ConnectionError
(
"Method %s does not exist"
%
(
method_name
))
class
SQLConnection
:
class
SQLConnection
:
"""
"""
...
@@ -52,10 +54,6 @@ class SQLConnection:
...
@@ -52,10 +54,6 @@ class SQLConnection:
"""
"""
__allow_access_to_unprotected_subobjects__
=
1
__allow_access_to_unprotected_subobjects__
=
1
def
__init__
(
self
,
*
args
,
**
kw
):
""" Do nothing """
pass
def
connect
(
self
):
def
connect
(
self
):
"""Get a handle to a remote connection."""
"""Get a handle to a remote connection."""
return
self
return
self
...
...
bt5/erp5_web_service/ToolComponentTemplateItem/portal_components/tool.erp5.WebServiceTool.py
View file @
5e811546
...
@@ -34,8 +34,10 @@ from Products.ERP5Type.Tool.BaseTool import BaseTool
...
@@ -34,8 +34,10 @@ from Products.ERP5Type.Tool.BaseTool import BaseTool
from
Products.ERP5Type
import
Permissions
from
Products.ERP5Type
import
Permissions
import
six
import
six
class
ConnectionError
(
Exception
):
pass
class
WebServiceConnectionError
(
Exception
):
"""Error when connecting
"""
connection_plugin_registry
=
{}
connection_plugin_registry
=
{}
...
@@ -92,9 +94,7 @@ class WebServiceTool(BaseTool):
...
@@ -92,9 +94,7 @@ class WebServiceTool(BaseTool):
"""
"""
Return list of available connection plugins
Return list of available connection plugins
"""
"""
plugin_list
=
connection_plugin_registry
.
keys
()
return
sorted
(
connection_plugin_registry
.
keys
())
plugin_list
.
sort
()
return
plugin_list
security
.
declareProtected
(
Permissions
.
ManagePortal
,
'connect'
)
security
.
declareProtected
(
Permissions
.
ManagePortal
,
'connect'
)
def
connect
(
self
,
url
,
user_name
=
None
,
password
=
None
,
transport
=
None
,
transport_kw
=
None
):
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