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
Jérome Perrin
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
...
@@ -7,16 +7,20 @@ import urllib
import
urllib2
import
urllib2
def
IngestionPolicy_forward
(
self
,
reference
,
data_chunk
):
def
IngestionPolicy_forward
(
self
,
reference
,
data_chunk
):
configuration_dict
=
self
.
IngestionPolicy_getWendelinRelayConfigurationDict
()
for
configuration_dict
in
\
if
not
configuration_dict
[
"wendelin_url"
]:
self
.
IngestionPolicy_getWendelinRelayConfigurationDictList
():
return
if
not
configuration_dict
[
"wendelin_url"
]:
data
=
urllib
.
urlencode
({
'data_chunk'
:
data_chunk
})
return
url
=
"%s/%s/ingest?reference=%s"
%
(
configuration_dict
[
"wendelin_url"
],
data
=
urllib
.
urlencode
({
'data_chunk'
:
data_chunk
})
self
.
getRelativeUrl
(),
url
=
"%s/%s/ingest?reference=%s"
%
(
configuration_dict
[
"wendelin_url"
],
reference
)
self
.
getRelativeUrl
(),
request
=
urllib2
.
Request
(
url
,
data
)
reference
)
base64string
=
base64
.
encodestring
(
'%s:%s'
%
(
request
=
urllib2
.
Request
(
url
,
data
)
configuration_dict
[
"username"
],
base64string
=
base64
.
encodestring
(
'%s:%s'
%
(
configuration_dict
[
"password"
])).
replace
(
'
\
n
'
,
''
)
configuration_dict
[
"username"
],
request
.
add_header
(
"Authorization"
,
"Basic %s"
%
base64string
)
configuration_dict
[
"password"
])).
replace
(
'
\
n
'
,
''
)
urllib2
.
urlopen
(
request
,
timeout
=
configuration_dict
[
"timeout"
])
request
.
add_header
(
"Authorization"
,
"Basic %s"
%
base64string
)
\ No newline at end of file
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 @@
...
@@ -45,7 +45,9 @@
<item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<value>
<tuple/>
<tuple>
<string>
W: 25, 4: No exception type(s) specified (bare-except)
</string>
</tuple>
</value>
</value>
</item>
</item>
<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"
:
""
,
"wendelin_url"
:
""
,
"username"
:
""
,
"username"
:
""
,
"password"
:
""
,
"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 @@
...
@@ -54,7 +54,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
<value>
<string>
IngestionPolicy_getWendelinRelayConfigurationDict
</string>
</value>
<value>
<string>
IngestionPolicy_getWendelinRelayConfigurationDict
List
</string>
</value>
</item>
</item>
</dictionary>
</dictionary>
</pickle>
</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