Commit 94094bee authored by Sebastien Robin's avatar Sebastien Robin

many updates on method names, ex:

  RemoteValue -> SubscriberValue
  LocalValue -> PublisherValue
  edit_Publications -> manage_editPublication
Added several methods:
  applySubscriberDocument
  applyPublisherDocument
  resolveContext


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@228 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1ef01e23
......@@ -115,7 +115,7 @@ class ERP5Conduit(XMLSyncUtilsMixin):
This fucntion returns conflict_list, wich is of the form,
[conflict1,conflict2,...] where conclict1 is of the form :
[object.getPath(),keyword,local_and_actual_value,remote_value]
[object.getPath(),keyword,local_and_actual_value,subscriber_value]
"""
conflict_list = []
xml = self.convertToXml(xml)
......@@ -351,8 +351,8 @@ class ERP5Conduit(XMLSyncUtilsMixin):
#conflict_list += [Conflict(object_path=object.getPhysicalPath(),
# keyword=keyword,
# xupdate=string_io)]
#local_value=current_data, # not needed any more
#remote_value=data)] # not needed any more
#publisher_value=current_data, # not needed any more
#subscriber_value=data)] # not needed any more
# We will now apply the argument with the method edit
if args != {} and (isConflict==0 or force):
LOG('updateNode',0,'object._edit, args: %s' % str(args))
......
......@@ -39,19 +39,18 @@ class Conflict(SyncCode, Implicit):
"""
object_path : the path of the obect
keyword : an identifier of the conflict
local_value : the value that we have locally
remote_value : the value sent by the remote box
publisher_value : the value that we have locally
subscriber_value : the value sent by the remote box
"""
def __init__(self, object_path=None, keyword=None, xupdate=None, local_value=None,\
remote_value=None, domain=None, domain_id=None):
def __init__(self, object_path=None, keyword=None, xupdate=None, publisher_value=None,\
subscriber_value=None, subscriber=None):
self.object_path=object_path
self.keyword = keyword
self.setLocalValue(local_value)
self.setRemoteValue(remote_value)
self.domain = domain
self.setLocalValue(publisher_value)
self.setRemoteValue(subscriber_value)
self.subscriber = subscriber
self.resetXupdate()
self.domain_id = domain_id
def getObjectPath(self):
"""
......@@ -59,11 +58,11 @@ class Conflict(SyncCode, Implicit):
"""
return self.object_path
def getLocalValue(self):
def getPublisherValue(self):
"""
get the domain
"""
return self.local_value
return self.publisher_value
def getXupdateList(self):
"""
......@@ -101,51 +100,67 @@ class Conflict(SyncCode, Implicit):
get the domain
"""
try:
self.local_value = value
self.publisher_value = value
except TypeError: # It happens when we try to store StringIO
self.local_value = None
self.publisher_value = None
def getRemoteValue(self):
def getSubscriberValue(self):
"""
get the domain
"""
return self.remote_value
return self.subscriber_value
def setRemoteValue(self, value):
"""
get the domain
"""
try:
self.remote_value = value
self.subscriber_value = value
except TypeError: # It happens when we try to store StringIO
self.remote_value = None
self.subscriber_value = None
def applyLocalValue(self):
def applyPublisherValue(self):
"""
after a conflict resolution, we have decided
to keep the local version of this object
"""
p_sync = getToolByName(self,'portal_synchronizations')
p_sync.applyLocalValue(self)
p_sync.applyPublisherValue(self)
def applyRemoteValue(self):
def applyPublisherDocument(self):
"""
after a conflict resolution, we have decided
to keep the local version of this object
"""
p_sync = getToolByName(self,'portal_synchronizations')
p_sync.applyPublisherDocument(self)
def applySubscriberDocument(self):
"""
after a conflict resolution, we have decided
to keep the local version of this object
"""
p_sync = getToolByName(self,'portal_synchronizations')
p_sync.applySubscriberDocument(self)
def applySubscriberValue(self):
"""
get the domain
"""
p_sync = getToolByName(self,'portal_synchronizations')
p_sync.applyRemoteValue(self)
p_sync.applySubscriberValue(self)
def setDomain(self, domain):
def setSubscriber(self, subscriber):
"""
set the domain
"""
self.domain = domain
self.subscriber = subscriber
def getDomain(self):
def getSubscriber(self):
"""
get the domain
"""
return self.domain
return self.subscriber
def getKeyword(self):
"""
......@@ -153,17 +168,11 @@ class Conflict(SyncCode, Implicit):
"""
return self.keyword
def getDomainId(self):
"""
get the domain id
"""
return self.domain_id
def setDomainId(self, domain_id):
def getPropertyId(self):
"""
set the domain
get the property id
"""
self.domain_id = domain_id
return self.keyword
class Signature(SyncCode):
"""
......
This diff is collapsed.
......@@ -31,7 +31,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
<dtml-var manage_form_title>
</dtml-let>
<form action="addPublications" method="POST">
<form action="manage_addPublication" method="POST">
<table cellspacing="0" cellpadding="2" border="0">
<tr>
<td align="left" valign="top">
......
......@@ -31,7 +31,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
<dtml-var manage_form_title>
</dtml-let>
<form action="addSubscriptions" method="POST">
<form action="manage_addSubscription" method="POST">
<table cellspacing="0" cellpadding="2" border="0">
<tr>
<td align="left" valign="top">
......
......@@ -34,21 +34,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
<tr>
<th align="left" valign="top"></th>
<th align="left" valign="top">Side</th>
<th align="left" valign="top">Id</th>
<th align="left" valign="top">Object path</th>
<th align="left" valign="top">keyword</th>
<th align="left" valign="top">Property Id</th>
<th align="left" valign="top">Local Value</th>
<th align="left" valign="top">Remote Value</th>
</tr>
<dtml-in prefix="loop" expr="getConflictList()">
<tr>
<td align="left" valign="top"><a href="manageLocalValue?subscription_url=<dtml-var expr="loop_item.getDomain().getSubscriptionUrl()">&keyword=<dtml-var keyword>&object_path=<dtml-var "'/'.join(object_path)">">Local</a> <a href="manageRemoteValue?subscription_url=<dtml-var expr="loop_item.getDomain().getSubscriptionUrl()">&keyword=<dtml-var keyword>&object_path=<dtml-var "'/'.join(object_path)">">Remote</a></td>
<td align="left" valign="top"><dtml-var expr="loop_item.getDomain().getSubscriptionUrl()"></td>
<td align="left" valign="top"><dtml-var domain></td>
<td align="left" valign="top"><a href="manageLocalValue?subscription_url=<dtml-var expr="loop_item.getSubscriber().getSubscriptionUrl()">&property_id=<dtml-var expr="loop_item.getPropertyId()">&object_path=<dtml-var "'/'.join(object_path)">">Publisher</a> <a href="manageRemoteValue?subscription_url=<dtml-var expr="loop_item.getSubscriber().getSubscriptionUrl()">&property_id=<dtml-var expr="loop_item.getPropertyId()">&object_path=<dtml-var "'/'.join(object_path)">">Subscriber</a></td>
<td align="left" valign="top"><dtml-var expr="loop_item.getSubscriber().getSubscriptionUrl()"></td>
<td align="left" valign="top"><dtml-var "'/'.join(object_path)"></td>
<td align="left" valign="top"><dtml-var keyword></td>
<td align="left" valign="top"><dtml-var local_value></td>
<td align="left" valign="top"><dtml-var remote_value></td>
<td align="left" valign="top"><dtml-var expr="loop_item.getPropertyId()"></td>
<td align="left" valign="top"><dtml-var expr="loop_item.getPublisherValue()"></td>
<td align="left" valign="top"><dtml-var expr="loop_item.getSubscriberValue()"></td>
</tr>
</dtml-in>
</table>
......
......@@ -29,13 +29,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
<dtml-var manage_page_header>
<dtml-var manage_tabs>
<form action="addPublicationsForm">
<form action="manage_addPublicationForm">
<input type="submit" name="addPublication:method" value="Add a publication">
</form>
<dtml-in getPublicationList>
<h3>Publication <dtml-var sequence-index></br></h3>
<form action="editPublications" method="POST">
<form action="manage_editPublication" method="POST">
<table cellspacing="0" cellpadding="2" border="0">
<tr>
<td align="left" valign="top">
......@@ -100,12 +100,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
<input type="hidden" name="id" value="<dtml-var getId>" >
<!--input type="hidden" name="subscription" value="<dtml-var getSubscriptionList>" -->
</form>
<form action="ResetPublications" method="POST">
<form action="manage_resetPublication" method="POST">
<td align="left" valign="top">
<input type="submit" value=" Reset ">
<input type="hidden" name="id" value="<dtml-var getId>" >
</form>
<form action="deletePublications" method="POST">
<form action="manage_deletePublication" method="POST">
<td align="left" valign="top">
<input type="submit" value=" Delete ">
<input type="hidden" name="id" value="<dtml-var getId>" >
......
......@@ -29,13 +29,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
<dtml-var manage_page_header>
<dtml-var manage_tabs>
<form action="addSubscriptionsForm">
<form action="manage_addSubscriptionForm">
<input type="submit" name="addSubscription:method" value="Add a Subscription">
</form>
<dtml-in getSubscriptionList>
<h3>Subscription <dtml-var sequence-index></br></h3>
<form action="editSubscriptions" method="POST">
<form action="manage_editSubscription" method="POST">
<table cellspacing="0" cellpadding="2" border="0">
<tr>
<td align="left" valign="top">
......@@ -114,12 +114,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
<input type="submit" value=" LastSync ">
<input type="hidden" name="id" value="<dtml-var getId>" >
</form>
<form action="ResetSubscriptions" method="POST">
<form action="manage_resetSubscription" method="POST">
<td align="left" valign="top">
<input type="submit" value=" Reset ">
<input type="hidden" name="id" value="<dtml-var getId>" >
</form>
<form action="deleteSubscriptions" method="POST">
<form action="manage_deleteSubscription" method="POST">
<td align="left" valign="top">
<input type="submit" value=" Delete ">
<input type="hidden" name="id" value="<dtml-var getId>" >
......
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