Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin
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
Levin Zimmermann
wendelin
Commits
60f581c0
Commit
60f581c0
authored
Dec 18, 2016
by
Klaus Wölfel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wendelin_relay: support forwarding to multiple wendelin
parent
5ac6e94f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
17 deletions
+23
-17
bt5/erp5_wendelin_relay/ExtensionTemplateItem/portal_components/erp5.extension.WendelinRelay.py
...ateItem/portal_components/erp5.extension.WendelinRelay.py
+17
-13
bt5/erp5_wendelin_relay/ExtensionTemplateItem/portal_components/erp5.extension.WendelinRelay.xml
...teItem/portal_components/erp5.extension.WendelinRelay.xml
+3
-1
bt5/erp5_wendelin_relay/SkinTemplateItem/portal_skins/erp5_wendelin_relay/IngestionPolicy_getWendelinRelayConfigurationDictList.py
.../IngestionPolicy_getWendelinRelayConfigurationDictList.py
+2
-2
bt5/erp5_wendelin_relay/SkinTemplateItem/portal_skins/erp5_wendelin_relay/IngestionPolicy_getWendelinRelayConfigurationDictList.xml
...IngestionPolicy_getWendelinRelayConfigurationDictList.xml
+1
-1
No files found.
bt5/erp5_wendelin_relay/ExtensionTemplateItem/portal_components/erp5.extension.WendelinRelay.py
View file @
60f581c0
...
...
@@ -7,16 +7,20 @@ import urllib
import
urllib2
def
IngestionPolicy_forward
(
self
,
reference
,
data_chunk
):
configuration_dict
=
self
.
IngestionPolicy_getWendelinRelayConfigurationDict
()
if
not
configuration_dict
[
"wendelin_url"
]:
return
data
=
urllib
.
urlencode
({
'data_chunk'
:
data_chunk
})
url
=
"%s/%s/ingest?reference=%s"
%
(
configuration_dict
[
"wendelin_url"
],
self
.
getRelativeUrl
(),
reference
)
request
=
urllib2
.
Request
(
url
,
data
)
base64string
=
base64
.
encodestring
(
'%s:%s'
%
(
configuration_dict
[
"username"
],
configuration_dict
[
"password"
])).
replace
(
'
\
n
'
,
''
)
request
.
add_header
(
"Authorization"
,
"Basic %s"
%
base64string
)
urllib2
.
urlopen
(
request
,
timeout
=
configuration_dict
[
"timeout"
])
\ No newline at end of file
for
configuration_dict
in
\
self
.
IngestionPolicy_getWendelinRelayConfigurationDictList
():
if
not
configuration_dict
[
"wendelin_url"
]:
return
data
=
urllib
.
urlencode
({
'data_chunk'
:
data_chunk
})
url
=
"%s/%s/ingest?reference=%s"
%
(
configuration_dict
[
"wendelin_url"
],
self
.
getRelativeUrl
(),
reference
)
request
=
urllib2
.
Request
(
url
,
data
)
base64string
=
base64
.
encodestring
(
'%s:%s'
%
(
configuration_dict
[
"username"
],
configuration_dict
[
"password"
])).
replace
(
'
\
n
'
,
''
)
request
.
add_header
(
"Authorization"
,
"Basic %s"
%
base64string
)
try
:
urllib2
.
urlopen
(
request
,
timeout
=
configuration_dict
[
"timeout"
])
except
:
pass
bt5/erp5_wendelin_relay/ExtensionTemplateItem/portal_components/erp5.extension.WendelinRelay.xml
View file @
60f581c0
...
...
@@ -45,7 +45,9 @@
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
<tuple>
<string>
W: 25, 4: No exception type(s) specified (bare-except)
</string>
</tuple>
</value>
</item>
<item>
...
...
bt5/erp5_wendelin_relay/SkinTemplateItem/portal_skins/erp5_wendelin_relay/IngestionPolicy_getWendelinRelayConfigurationDict.py
→
bt5/erp5_wendelin_relay/SkinTemplateItem/portal_skins/erp5_wendelin_relay/IngestionPolicy_getWendelinRelayConfigurationDict
List
.py
View file @
60f581c0
return
{
return
[
{
"wendelin_url"
:
""
,
"username"
:
""
,
"password"
:
""
,
"timeout"
:
60
}
"timeout"
:
60
}
]
bt5/erp5_wendelin_relay/SkinTemplateItem/portal_skins/erp5_wendelin_relay/IngestionPolicy_getWendelinRelayConfigurationDict.xml
→
bt5/erp5_wendelin_relay/SkinTemplateItem/portal_skins/erp5_wendelin_relay/IngestionPolicy_getWendelinRelayConfigurationDict
List
.xml
View file @
60f581c0
...
...
@@ -54,7 +54,7 @@
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
IngestionPolicy_getWendelinRelayConfigurationDict
</string>
</value>
<value>
<string>
IngestionPolicy_getWendelinRelayConfigurationDict
List
</string>
</value>
</item>
</dictionary>
</pickle>
...
...
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