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
f4d94ed7
Commit
f4d94ed7
authored
Apr 11, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
web_service: py3
parent
e3c7ffc4
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 @
f4d94ed7
...
@@ -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 @
f4d94ed7
...
@@ -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 @
f4d94ed7
...
@@ -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 @
f4d94ed7
...
@@ -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