[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] sync/inc/class.bo_sync.inc.php, 1.53
From: |
nomail |
Subject: |
[Phpgroupware-cvs] sync/inc/class.bo_sync.inc.php, 1.53 |
Date: |
Wed, 30 Jun 2004 11:41:07 +0200 |
Update of /sync/inc
Modified Files:
Branch:
class.bo_sync.inc.php
date: 2004/06/30 09:41:07; author: mkaemmerer; state: Exp; lines: +41 -1
Log Message:
- added conversion to internal format in case of a conflict
=====================================================================
Index: sync/inc/class.bo_sync.inc.php
diff -u sync/inc/class.bo_sync.inc.php:1.52 sync/inc/class.bo_sync.inc.php:1.53
--- sync/inc/class.bo_sync.inc.php:1.52 Tue Jun 22 09:35:41 2004
+++ sync/inc/class.bo_sync.inc.php Wed Jun 30 09:41:07 2004
@@ -626,5 +626,45 @@
return $devinfo["uri"];
}
+ /**
+ * Convert and save conflict data
+ *
+ * The conflict record from the device is converted to our internal format
to
+ * allow easier comparison with the other conflict record. The record is
+ * saved in the conflict database after serialize and base64 encoding.
+ *
+ * @param integer $deviceid unique device ID for internal devices database
+ * @param string $source Source name from device (e.g. 'contacts')
+ * @param string $LUID local identifier of a record in the source (local
recordid of the syncdevice)
+ * @param string $ldata data value of the record from the device
+ * @return integer >= 0 if successfull, < 0 in case of error
+ * @param integer $deviceid thats name is requested
+ */
+ function ConvertAndAddConfict($deviceid, $source, $LUID, $LData)
+ {
+ // get the responsible IPC class
+ $this->GetIpcforSource($source);
+ if (!isset($this->ipc) or ($this->ipc == false))
+ {
+ error_log("Sync Module: Error: There is no source called '$source'. Can
not synchronize");
+ return -1;
+ }
+
+ $mimetype =
$session_data['sync_currentsourceinfo']['contentType.RX.type'];
+ $mimeversion =
$session_data['sync_currentsourceinfo']['contentType.RX.version'];
+ $typeOut = "x-phpgroupware/$source-show-data-array";
+
+ $data = $this->ipc->convertData($LData, $mimetype, $mimeversion,
$typeOut, '1.0');
+ if (!isarray($data))
+ {
+ error_log("Error: Could not convert data $deviceid $source $LUID
".serialize($LData));
+ return -1;
+ }
+ $data = base64_encode(serialize($data));
+
+ return $this->so->AddConfict($deviceid, $source, $LUID, $data);
+ }
+
+
}
?>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] sync/inc/class.bo_sync.inc.php, 1.53,
nomail <=