Commit fbe53e44 authored by Jérome Perrin's avatar Jérome Perrin

Merge remote-tracking branch 'upstream/master' into zope4py3

parents 293552e6 5b3d41bb
Pipeline #39184 failed with stage
in 0 seconds
# This script is called to defer fulltext indexing. # This script is called to defer fulltext indexing.
METHOD_ID = script.id + 'Activity' METHOD_ID = script.id + 'Activity'
GROUP_METHOD_ID = 'portal_catalog/catalogObjectList' GROUP_METHOD_ID = 'portal_catalog/deferredCatalogObjectList'
activateObject = context.getPortalObject().portal_activities.activateObject activateObject = context.getPortalObject().portal_activities.activateObject
try: try:
priority = context.getActivityRuntimeEnvironment().getPriority() priority = context.getActivityRuntimeEnvironment().getPriority()
......
...@@ -29,6 +29,8 @@ def filterActions(actions): ...@@ -29,6 +29,8 @@ def filterActions(actions):
filtered_actions[action_category_name].extend(action_list) filtered_actions[action_category_name].extend(action_list)
else: else:
filtered_actions[action_category_name] = action_list filtered_actions[action_category_name] = action_list
if filter_action_script_id:
filtered_actions = getattr(context, filter_action_script_id)(filtered_actions)
return {action_category_name: sorted(action_list, key=lambda x: x.get('priority', 1.0)) return {action_category_name: sorted(action_list, key=lambda x: x.get('priority', 1.0))
for action_category_name, action_list in filtered_actions.items()} for action_category_name, action_list in filtered_actions.items()}
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>actions</string> </value> <value> <string>actions, filter_action_script_id=None</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
...@@ -1472,8 +1472,12 @@ def calculateHateoas(is_portal=None, is_site_root=None, traversed_document=None, ...@@ -1472,8 +1472,12 @@ def calculateHateoas(is_portal=None, is_site_root=None, traversed_document=None,
} }
# Find current action URL and extract embedded view # Find current action URL and extract embedded view
filter_action_script_id = ''
if hasattr(site_root, 'getLayoutProperty'):
filter_action_script_id = site_root.getLayoutProperty('configuration_filter_action_script_id', default='')
erp5_action_dict = portal.Base_filterDuplicateActions( erp5_action_dict = portal.Base_filterDuplicateActions(
portal.portal_actions.listFilteredActionsFor(traversed_document)) portal.portal_actions.listFilteredActionsFor(traversed_document),
filter_action_script_id)
for erp5_action_key in erp5_action_dict.keys(): for erp5_action_key in erp5_action_dict.keys():
for view_action in erp5_action_dict[erp5_action_key]: for view_action in erp5_action_dict[erp5_action_key]:
# Try to embed the form in the result # Try to embed the form in the result
......
...@@ -78,6 +78,7 @@ ...@@ -78,6 +78,7 @@
<list> <list>
<string>my_configuration_login</string> <string>my_configuration_login</string>
<string>my_configuration_logout</string> <string>my_configuration_logout</string>
<string>my_configuration_filter_action_script_id</string>
</list> </list>
</value> </value>
</item> </item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_configuration_filter_action_script_id</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_view_mode_reference</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Filter Action Script Id</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -709,6 +709,61 @@ class TestERP5Document_getHateoas_mode_traverse(ERP5HALJSONStyleSkinsMixin): ...@@ -709,6 +709,61 @@ class TestERP5Document_getHateoas_mode_traverse(ERP5HALJSONStyleSkinsMixin):
document.getRelativeUrl())) document.getRelativeUrl()))
self.assertEqual(result_dict['_embedded']['_view']['_actions']['put']['method'], 'POST') self.assertEqual(result_dict['_embedded']['_view']['_actions']['put']['method'], 'POST')
@simulate('Base_getRequestUrl', '*args, **kwargs',
'return "http://example.org/bar"')
@simulate('Base_getRequestHeader', '*args, **kwargs',
'return "application/hal+json"')
@simulate('Base_filterActionId', 'actions', """
filtered_actions = {}
for action_category_name, action_list in actions.items():
filtered_actions[action_category_name] = [action for action in action_list if 'foo' in action['id']]
return filtered_actions
""")
@changeSkin('Hal')
def test_getHateoasDocument_filtered_view(self):
self.portal.web_site_module.hateoas.edit(configuration_filter_action_script_id='Base_filterActionId')
document = self._makeDocument()
document.Foo_view.listbox.ListBox_setPropertyList(
field_title='Foo Lines',
field_list_method='objectValues',
field_portal_types='Foo Line | Foo Line',
field_stat_method='portal_catalog',
field_stat_columns='quantity | Foo_statQuantity',
field_editable=1,
field_columns='id|ID\ntitle|Title\nquantity|Quantity\nstart_date|Date\ncatalog.uid|Uid',
field_editable_columns='id|ID\ntitle|Title\nquantity|quantity\nstart_date|Date',
field_search_columns='id|ID\ntitle|Title\nquantity|Quantity\nstart_date|Date',
field_domain_root_list='foo_category|FooCat\nfoo_domain|FooDomain\nnot_existing_domain|NotExisting',)
parent = document.getParentValue()
fake_request = do_fake_request("GET")
result = self.portal.web_site_module.hateoas.ERP5Document_getHateoas(REQUEST=fake_request, mode="traverse", relative_url=document.getRelativeUrl(), view="view")
self.assertEqual(fake_request.RESPONSE.status, 200)
self.assertEqual(fake_request.RESPONSE.getHeader('Content-Type'),
"application/hal+json"
)
result_dict = json.loads(result)
self.assertEqual(result_dict['_links']['self'], {"href": "http://example.org/bar"})
self.assertEqual(result_dict['_links']['parent'],
{"href": "urn:jio:get:%s" % parent.getRelativeUrl(), "name": parent.getTitle()})
self.assertEqual(result_dict['_links']['view']['href'],
"%s/web_site_module/hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=%s&view=view_formbox_fooline" % (
self.portal.absolute_url(),
quote_plus(document.getRelativeUrl())))
self.assertEqual(result_dict['_links']['view']['title'], "FormBox FooLine")
self.assertEqual(result_dict['_links']['view']['name'], "view_formbox_fooline")
self.assertNotIn('_embedded', result_dict)
for category, value in result_dict['_links'].items():
if 'action' in category:
if isinstance(value, dict):
self.assertIn('foo', value['name'])
else:
for link in value:
self.assertIn('foo', link['name'])
@simulate('Base_getRequestUrl', '*args, **kwargs', @simulate('Base_getRequestUrl', '*args, **kwargs',
'return "http://example.org/bar"') 'return "http://example.org/bar"')
@simulate('Base_getRequestHeader', '*args, **kwargs', @simulate('Base_getRequestHeader', '*args, **kwargs',
......
...@@ -46,13 +46,13 @@ class MailevaSOAPConnector(XMLObject): ...@@ -46,13 +46,13 @@ class MailevaSOAPConnector(XMLObject):
security.declareObjectProtected(Permissions.AccessContentsInformation) security.declareObjectProtected(Permissions.AccessContentsInformation)
# Default Properties # Default Properties
property_sheets = ( PropertySheet.Base property_sheets = (PropertySheet.Base
, PropertySheet.XMLObject , PropertySheet.XMLObject
, PropertySheet.CategoryCore , PropertySheet.CategoryCore
) )
def processResponse(self, response, maileva_exchange, failed=False): def processResponse(self, response, maileva_exchange, failed=False):
maileva_exchange.edit( maileva_exchange.edit(
response = response response=response
) )
maileva_exchange.confirm() maileva_exchange.confirm()
# change state, no need to wait alarm check # change state, no need to wait alarm check
...@@ -61,28 +61,29 @@ class MailevaSOAPConnector(XMLObject): ...@@ -61,28 +61,29 @@ class MailevaSOAPConnector(XMLObject):
maileva_exchange.getFollowUpValue().fail() maileva_exchange.getFollowUpValue().fail()
def submitRequest(self, maileva_exchange): def submitRequest(self, maileva_exchange):
authenticated = HttpAuthenticated(username=self.getUserId(), password=self.getPassword()) authenticated = HttpAuthenticated(username=self.getUserId(),
password=self.getPassword())
runtime_environment = self.getActivityRuntimeEnvironment() runtime_environment = self.getActivityRuntimeEnvironment()
if runtime_environment: if runtime_environment:
runtime_environment.edit( runtime_environment.edit(
conflict_retry=False, conflict_retry=False,
max_retry=0) max_retry=0)
try: try:
response = suds.client.Client(url = self.getProperty('submit_url_string'), transport=authenticated).service.submit(__inject={'msg': maileva_exchange.getRequest()}) response = suds.client.Client(
url=self.getSubmitLinkUrlString(),
transport=authenticated
).service.submit(__inject={'msg': maileva_exchange.getRequest()})
maileva_exchange.activate().MailevaExchange_processResponse(response) maileva_exchange.activate().MailevaExchange_processResponse(response)
except socket.error as e: except socket.error as e:
if e.errno == socket.errno.ECONNREFUSED: if e.errno == socket.errno.ECONNREFUSED:
if runtime_environment: if runtime_environment:
runtime_environment.edit(max_retry=None) runtime_environment.edit(max_retry=None)
except Exception as e: except Exception as e:
maileva_exchange.activate().MailevaExchange_processResponse(str(e), failed = True) maileva_exchange.activate().MailevaExchange_processResponse(str(e), failed=True)
def checkPendingNotifications(self): def checkPendingNotifications(self):
authenticated = HttpAuthenticated(username=self.getUserId(), password=self.getPassword()) authenticated = HttpAuthenticated(username=self.getUserId(), password=self.getPassword())
client = suds.client.Client(url = self.getProperty("tracking_url_string"), transport=authenticated) client = suds.client.Client(url=self.getTrackingLinkUrlString(), transport=authenticated)
notification_dict = {} notification_dict = {}
for notification in client.service.checkPendingNotifications("GENERAL"): for notification in client.service.checkPendingNotifications("GENERAL"):
notification_dict[notification.reqTrackId] = { notification_dict[notification.reqTrackId] = {
...@@ -95,7 +96,8 @@ class MailevaSOAPConnector(XMLObject): ...@@ -95,7 +96,8 @@ class MailevaSOAPConnector(XMLObject):
def getPendingNotificationDetails(self, request_id, debug=False): def getPendingNotificationDetails(self, request_id, debug=False):
authenticated = HttpAuthenticated(username=self.getUserId(), password=self.getPassword()) authenticated = HttpAuthenticated(username=self.getUserId(), password=self.getPassword())
result = suds.client.Client(url = self.getProperty("tracking_url_string"), transport=authenticated).service.getPendingNotificationDetails(request_id) result = suds.client.Client(url=self.getTrackingLinkUrlString(),
transport=authenticated).service.getPendingNotificationDetails(request_id)
return { return {
"status": str(result.status), "status": str(result.status),
"notification_status": str(result.notificationStatus), "notification_status": str(result.notificationStatus),
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
</portal_type> </portal_type>
<portal_type id="Maileva SOAP Connector"> <portal_type id="Maileva SOAP Connector">
<item>Login</item> <item>Login</item>
<item>MailevaSOAPConnector</item>
<item>Reference</item> <item>Reference</item>
<item>Url</item> <item>Url</item>
</portal_type> </portal_type>
......
...@@ -38,6 +38,12 @@ ...@@ -38,6 +38,12 @@
<key> <string>portal_type</string> </key> <key> <string>portal_type</string> </key>
<value> <string>Base Type</string> </value> <value> <string>Base Type</string> </value>
</item> </item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>type_class</string> </key> <key> <string>type_class</string> </key>
<value> <string>MailevaSOAPConnector</string> </value> <value> <string>MailevaSOAPConnector</string> </value>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Property Sheet" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_count</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_mt_index</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>_tree</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>MailevaSOAPConnector</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Property Sheet</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Length" module="BTrees.Length"/>
</pickle>
<pickle> <int>0</int> </pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Content Existence Constraint" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_identity_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_range_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>constraint_portal_type</string> </key>
<value> <string>python: (\'Link\',)</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>link_existence_constraint</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Content Existence Constraint</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="String Attribute Match Constraint" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_identity_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_local_properties</string> </key>
<value>
<tuple>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>message_property_not_set</string> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>string</string> </value>
</item>
</dictionary>
</tuple>
</value>
</item>
<item>
<key> <string>_range_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>constraint_property</string> </key>
<value>
<tuple>
<string>password</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>password_constraint</string> </value>
</item>
<item>
<key> <string>message_attribute_not_match</string> </key>
<value> <string>password has to be set.</string> </value>
</item>
<item>
<key> <string>message_no_such_property</string> </key>
<value> <string>password has to be set.</string> </value>
</item>
<item>
<key> <string>message_property_not_set</string> </key>
<value> <string>Certificate has to be set.</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>String Attribute Match Constraint</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Acquired Property" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_local_properties</string> </key>
<value>
<tuple>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>mode</string> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>string</string> </value>
</item>
</dictionary>
</tuple>
</value>
</item>
<item>
<key> <string>acquisition_base_category</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>acquisition_object_id</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>alt_accessor_id</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>elementary_type/content</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_acquired_property_id</string> </key>
<value>
<tuple>
<string>url_string</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_portal_type</string> </key>
<value> <string>python: (\'Link\',)</string> </value>
</item>
<item>
<key> <string>content_translation_acquired_property_id</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Include link URL</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>submit_link_property</string> </value>
</item>
<item>
<key> <string>mode</string> </key>
<value> <string>w</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Acquired Property</string> </value>
</item>
<item>
<key> <string>storage_id</string> </key>
<value> <string>submit_link</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="String Attribute Match Constraint" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_identity_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_local_properties</string> </key>
<value>
<tuple>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>message_property_not_set</string> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>string</string> </value>
</item>
</dictionary>
</tuple>
</value>
</item>
<item>
<key> <string>_range_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>constraint_property</string> </key>
<value>
<tuple>
<string>submit_link_url_string</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>submit_link_url_string_constraint</string> </value>
</item>
<item>
<key> <string>message_attribute_not_match</string> </key>
<value> <string>Submit URL have to be set</string> </value>
</item>
<item>
<key> <string>message_no_such_property</string> </key>
<value> <string>Submit URL have to be set</string> </value>
</item>
<item>
<key> <string>message_property_not_set</string> </key>
<value> <string>Payzen URL have to be set</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>String Attribute Match Constraint</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Acquired Property" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_local_properties</string> </key>
<value>
<tuple>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>mode</string> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>string</string> </value>
</item>
</dictionary>
</tuple>
</value>
</item>
<item>
<key> <string>acquisition_base_category</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>acquisition_object_id</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>alt_accessor_id</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>elementary_type/content</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_acquired_property_id</string> </key>
<value>
<tuple>
<string>url_string</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_portal_type</string> </key>
<value> <string>python: (\'Link\',)</string> </value>
</item>
<item>
<key> <string>content_translation_acquired_property_id</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Link for tracking url</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>tracking_link_property</string> </value>
</item>
<item>
<key> <string>mode</string> </key>
<value> <string>w</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Acquired Property</string> </value>
</item>
<item>
<key> <string>storage_id</string> </key>
<value> <string>tracking_link</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="String Attribute Match Constraint" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_identity_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_local_properties</string> </key>
<value>
<tuple>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>message_property_not_set</string> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>string</string> </value>
</item>
</dictionary>
</tuple>
</value>
</item>
<item>
<key> <string>_range_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>constraint_property</string> </key>
<value>
<tuple>
<string>tracking_link_url_string</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>tracking_link_url_string_constraint</string> </value>
</item>
<item>
<key> <string>message_attribute_not_match</string> </key>
<value> <string>Tracking URL have to be set</string> </value>
</item>
<item>
<key> <string>message_no_such_property</string> </key>
<value> <string>Tracking URL have to be set</string> </value>
</item>
<item>
<key> <string>message_property_not_set</string> </key>
<value> <string>Payzen URL have to be set</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>String Attribute Match Constraint</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="String Attribute Match Constraint" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_identity_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_local_properties</string> </key>
<value>
<tuple>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>message_property_not_set</string> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>string</string> </value>
</item>
</dictionary>
</tuple>
</value>
</item>
<item>
<key> <string>_range_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>constraint_property</string> </key>
<value>
<tuple>
<string>user_id</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>user_id_constraint</string> </value>
</item>
<item>
<key> <string>message_attribute_not_match</string> </key>
<value> <string>User ID have to be set</string> </value>
</item>
<item>
<key> <string>message_no_such_property</string> </key>
<value> <string>User ID have to be set</string> </value>
</item>
<item>
<key> <string>message_property_not_set</string> </key>
<value> <string>vads_site_id have to be set</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>String Attribute Match Constraint</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
maileva_connector = context.portal_catalog.getResultValue( maileva_connector_list = context.portal_catalog(
portal_type='Maileva SOAP Connector', portal_type='Maileva SOAP Connector',
reference=reference, validation_state='validated',
validation_state='validated') limit=2)
if not maileva_connector:
raise ValueError('Maileav soap connector is not defined') # Ensure there is no duplication.
return maileva_connector if not len(maileva_connector_list):
raise ValueError('Maileva soap connector is not defined')
elif len(maileva_connector_list) != 1:
raise ValueError('More them one Maileva soap connector was found!')
return maileva_connector_list[0]
...@@ -115,8 +115,8 @@ ...@@ -115,8 +115,8 @@
<key> <string>right</string> </key> <key> <string>right</string> </key>
<value> <value>
<list> <list>
<string>my_submit_url_string</string> <string>my_submit_link_url_string</string>
<string>my_tracking_url_string</string> <string>my_tracking_link_url_string</string>
<string>my_translated_validation_state_title</string> <string>my_translated_validation_state_title</string>
</list> </list>
</value> </value>
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>my_submit_url_string</string> </value> <value> <string>my_submit_link_url_string</string> </value>
</item> </item>
<item> <item>
<key> <string>message_values</string> </key> <key> <string>message_values</string> </key>
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>my_tracking_url_string</string> </value> <value> <string>my_tracking_link_url_string</string> </value>
</item> </item>
<item> <item>
<key> <string>message_values</string> </key> <key> <string>message_values</string> </key>
......
translateString = context.Base_translateString
if context.getSendState() != 'failed': if context.getSendState() != 'failed':
return context.Base_redirect('Document_viewMailevaConnectionStatus', keep_items={'portal_status_message': 'This document is not in failed state'}) return context.Base_redirect('Document_viewMailevaConnectionStatus',
keep_items={'portal_status_message': translateString('This document is not in failed state')})
maileva_exchange = context.getFollowUpRelatedValue(portal_type='Maileva Exchange') maileva_exchange = context.getFollowUpRelatedValue(portal_type='Maileva Exchange')
context.PDF_sendToMaileva( context.PDF_sendToMaileva(
recipient = maileva_exchange.getDestinationValue(), recipient = maileva_exchange.getDestinationValue(),
sender = maileva_exchange.getSourceValue() sender = maileva_exchange.getSourceValue()
) )
return context.Base_redirect('PDF_viewPDFJSPreview', keep_items={'portal_status_message': 'This document is resending to maileva'}) return context.Base_redirect('PDF_viewPDFJSPreview',
keep_items={'portal_status_message': translateString('This document is resending to maileva')})
...@@ -3,5 +3,6 @@ Maileva Exchange | Arrow ...@@ -3,5 +3,6 @@ Maileva Exchange | Arrow
Maileva Exchange | Event Maileva Exchange | Event
Maileva Exchange | HttpExchange Maileva Exchange | HttpExchange
Maileva SOAP Connector | Login Maileva SOAP Connector | Login
Maileva SOAP Connector | MailevaSOAPConnector
Maileva SOAP Connector | Reference Maileva SOAP Connector | Reference
Maileva SOAP Connector | Url Maileva SOAP Connector | Url
\ No newline at end of file
MailevaSOAPConnector
\ No newline at end of file
...@@ -889,10 +889,13 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject): ...@@ -889,10 +889,13 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
""" """
return ZCatalog.countResults(self, REQUEST, **kw) return ZCatalog.countResults(self, REQUEST, **kw)
def wrapObjectList(self, object_value_list, catalog_value): def wrapObjectList(self, object_value_list, catalog_value, deferred=False):
""" """
Return a list of wrapped objects for reindexing. Return a list of wrapped objects for reindexing.
""" """
if deferred:
# No need to wrap
return object_value_list
portal = self.getPortalObject() portal = self.getPortalObject()
user_set = set() user_set = set()
...@@ -990,6 +993,8 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject): ...@@ -990,6 +993,8 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
else: else:
super(CatalogTool, self).catalogObjectList(object_list, *args, **kw) super(CatalogTool, self).catalogObjectList(object_list, *args, **kw)
deferredCatalogObjectList = catalogObjectList
security.declarePrivate('uncatalogObjectList') security.declarePrivate('uncatalogObjectList')
def uncatalogObjectList(self, message_list): def uncatalogObjectList(self, message_list):
"""Uncatalog a list of objects""" """Uncatalog a list of objects"""
......
...@@ -671,7 +671,7 @@ class ZCatalog(Folder, Persistent, Implicit): ...@@ -671,7 +671,7 @@ class ZCatalog(Folder, Persistent, Implicit):
return [] return []
security.declarePrivate('wrapObjectList') security.declarePrivate('wrapObjectList')
def wrapObjectList(self, object_value_list, catalog_value): def wrapObjectList(self, object_value_list, catalog_value, deferred=False):
""" """
Return a list of wrapped objects for reindexing. Return a list of wrapped objects for reindexing.
...@@ -690,6 +690,7 @@ class ZCatalog(Folder, Persistent, Implicit): ...@@ -690,6 +690,7 @@ class ZCatalog(Folder, Persistent, Implicit):
"""Catalog a list of objects. """Catalog a list of objects.
""" """
catalog = self.getSQLCatalog(sql_catalog_id) catalog = self.getSQLCatalog(sql_catalog_id)
deferred = kw.get('deferred', False)
hot_reindexing = (self.hot_reindexing_state is not None) and \ hot_reindexing = (self.hot_reindexing_state is not None) and \
(catalog is not None) and \ (catalog is not None) and \
(self.source_sql_catalog_id == catalog.id) (self.source_sql_catalog_id == catalog.id)
...@@ -791,6 +792,7 @@ class ZCatalog(Folder, Persistent, Implicit): ...@@ -791,6 +792,7 @@ class ZCatalog(Folder, Persistent, Implicit):
self.wrapObjectList( self.wrapObjectList(
object_value_list=d['obj'], object_value_list=d['obj'],
catalog_value=destination_catalog, catalog_value=destination_catalog,
deferred=deferred,
), ),
**kw **kw
) )
...@@ -801,6 +803,7 @@ class ZCatalog(Folder, Persistent, Implicit): ...@@ -801,6 +803,7 @@ class ZCatalog(Folder, Persistent, Implicit):
self.wrapObjectList( self.wrapObjectList(
object_value_list=d['obj'], object_value_list=d['obj'],
catalog_value=archive_catalog, catalog_value=archive_catalog,
deferred=deferred,
), ),
**kw **kw
) )
...@@ -815,6 +818,7 @@ class ZCatalog(Folder, Persistent, Implicit): ...@@ -815,6 +818,7 @@ class ZCatalog(Folder, Persistent, Implicit):
self.wrapObjectList( self.wrapObjectList(
object_value_list=current_catalog_object_list, object_value_list=current_catalog_object_list,
catalog_value=catalog, catalog_value=catalog,
deferred=deferred,
), ),
**kw **kw
) )
...@@ -828,6 +832,7 @@ class ZCatalog(Folder, Persistent, Implicit): ...@@ -828,6 +832,7 @@ class ZCatalog(Folder, Persistent, Implicit):
self.wrapObjectList( self.wrapObjectList(
object_value_list=object_set, object_value_list=object_set,
catalog_value=destination_catalog, catalog_value=destination_catalog,
deferred=deferred,
), ),
**kw **kw
) )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment