Commit d756e69a authored by Nicolas Delaby's avatar Nicolas Delaby

Set alert code on Subscription objects

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@15497 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 72c08d9c
...@@ -669,13 +669,14 @@ class Subscription(Folder, SyncCode): ...@@ -669,13 +669,14 @@ class Subscription(Folder, SyncCode):
def __init__(self, id, title, publication_url, subscription_url, def __init__(self, id, title, publication_url, subscription_url,
destination_path, source_uri, target_uri, query, xml_mapping, destination_path, source_uri, target_uri, query, xml_mapping,
conduit, gpg_key, id_generator, gid_generator, media_type, login, conduit, gpg_key, id_generator, gid_generator, media_type, login,
password, activity_enabled): password, activity_enabled, alert_code):
""" """
We need to create a dictionnary of We need to create a dictionnary of
signatures of documents which belong to the synchronisation signatures of documents which belong to the synchronisation
process process
""" """
self.id = id self.id = id
self.setAlertCode(alert_code)
self.setActivityEnabled(activity_enabled) self.setActivityEnabled(activity_enabled)
self.publication_url = (publication_url) self.publication_url = (publication_url)
self.subscription_url = str(subscription_url) self.subscription_url = str(subscription_url)
...@@ -699,9 +700,22 @@ class Subscription(Folder, SyncCode): ...@@ -699,9 +700,22 @@ class Subscription(Folder, SyncCode):
self.setConduit(conduit) self.setConduit(conduit)
Folder.__init__(self, id) Folder.__init__(self, id)
self.title = title self.title = title
#self.signatures = PersitentMapping() #self.signatures = PersitentMapping()
def getAlertCodeList(self):
#XXX replace by a dictionary or a list in SyncCode
return [self.TWO_WAY, self.ONE_WAY_FROM_SERVER]
def getAlertCode(self):
return getattr(self, 'alert_code', 200)
def setAlertCode(self, value):
self.alert_code = int(value)
def isOneWayFromServer(self):
return self.getDomainType() == self.SUB and self.getAlertCode() == self.ONE_WAY_FROM_SERVER
def getActivityEnabled(self): def getActivityEnabled(self):
""" """
return true if we are using activity, false otherwise return true if we are using activity, false otherwise
......
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