From 6850e7e205c3b5f759157579356b43de07cd32a5 Mon Sep 17 00:00:00 2001 From: Fabien Morin <fabien@nexedi.com> Date: Tue, 14 Aug 2007 14:01:50 +0000 Subject: [PATCH] add an interface for Conduits git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@15670 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5SyncML/Interface/IConduit.py | 90 ++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 product/ERP5SyncML/Interface/IConduit.py diff --git a/product/ERP5SyncML/Interface/IConduit.py b/product/ERP5SyncML/Interface/IConduit.py new file mode 100644 index 0000000000..cd903092ff --- /dev/null +++ b/product/ERP5SyncML/Interface/IConduit.py @@ -0,0 +1,90 @@ +############################################################################## +# +# Copyright (c) 2007 Nexedi SARL and Contributors. All Rights Reserved. +# Fabien Morin <fabien.morin@gmail.com> +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsability of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# garantees and support are strongly adviced to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################## + +try: + from Interface import Interface +except ImportError: + # for Zope versions before 2.6.0 + from Interface import Base as Interface + +class IConduit(Interface): + """ + A conduit is a piece of code in charge of + + - updating an object attributes from an XUpdate XML stream + + (Conduits are not in charge of creating new objects which + are eventually missing in a synchronisation process) + + If an object has be created during a synchronisation process, + the way to proceed consists in: + + 1- creating an empty instance of the appropriate class + in the appropriate directory + + 2- updating that empty instance with the conduit + + The first implementation of ERP5 synchronisation + will define a default location to create new objects and + a default class. This will be defined at the level of the synchronisation + tool + + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx + Look carefully when we are adding elements, + for example, when we do 'insert-after', with 2 xupdate:element, + so adding 2 differents objects, actually it adds only XXXX one XXX object + In this case the getSubObjectDepth(), doesn't have + too much sence + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + There is also one problem, when we synchronize a conflict, + we are not waiting + the response of the client, so that we are not sure if it take into account, + we may have CONFLICT_NOT_SYNCHRONIZED AND CONFLICT_SYNCHRONIZED + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + """ + + def __init__(self): + self.args = {} + + def addNode(): + """ + A node is added + """ + + def deleteNode(): + """ + A node is deleted + """ + + def updateNode(): + """ + A node is updated with some xupdate + """ + -- 2.30.9