[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] sync/sync4j/de/probusiness/pbgroupware/sync/PHPGwSyn
From: |
nomail |
Subject: |
[Phpgroupware-cvs] sync/sync4j/de/probusiness/pbgroupware/sync/PHPGwSyncSource.java, 1.8 |
Date: |
Mon, 28 Jun 2004 12:08:20 +0200 |
Update of /sync/sync4j/de/probusiness/pbgroupware/sync
Modified Files:
Branch:
PHPGwSyncSource.java
date: 2004/06/28 10:08:20; author: mleonhardt; state: Exp; lines: +34 -11
Log Message:
- updated s4j-syncmodul
=====================================================================
Index: sync/sync4j/de/probusiness/pbgroupware/sync/PHPGwSyncSource.java
diff -u sync/sync4j/de/probusiness/pbgroupware/sync/PHPGwSyncSource.java:1.7
sync/sync4j/de/probusiness/pbgroupware/sync/PHPGwSyncSource.java:1.8
--- sync/sync4j/de/probusiness/pbgroupware/sync/PHPGwSyncSource.java:1.7
Wed Jun 9 18:35:09 2004
+++ sync/sync4j/de/probusiness/pbgroupware/sync/PHPGwSyncSource.java Mon Jun
28 10:08:20 2004
@@ -94,7 +94,15 @@
final Vector params = new Vector();
addTimestamp(since, params);
ActualState = SyncItemState.DELETED;
- return callGetItemsByID(principal, "getDeletedSyncItemIDs",
params);
+ final SyncItemKey[] deletedkeys = callGetIDs(principal,
"getDeletedSyncItemIDs", params);
+
+ int i = 0;
+ final int len = deletedkeys.length;
+ final SyncItem[] ret = new SyncItem[len];
+ for (i = 0; i < len; i++) {
+ ret[i] = createSyncItem(deletedkeys[i], new String("dummy"));
+ }
+ return ret;
}
/* (non-Javadoc)
* @see
sync4j.framework.engine.source.SyncSource#getNewSyncItemKeys(java.security.Principal,
java.sql.Timestamp)
@@ -120,6 +128,7 @@
* @see
sync4j.framework.engine.source.SyncSource#getSyncItemFromId(java.security.Principal,
sync4j.framework.engine.SyncItemKey)
*/
public SyncItem getSyncItemFromId(final Principal principal, final
SyncItemKey syncItemKey) throws SyncSourceException {
+ logger.info("getSyncItemFromId B ");
final Vector params = new Vector();
// get the Key
@@ -132,7 +141,9 @@
// add getSyncItem parameters
params.add(id);
- params.add(SourceType.type);
+// these info are not necessary anymore because we get it directly
from
+// inputmessageprocessor
+// params.add(SourceType.type);
final Vector result = (Vector) executeXMLRPC(principal,
"getSyncItemFromId", params);
@@ -141,19 +152,24 @@
if (ErrorCode.intValue() < 0) {
logger.info("getSyncItemFromId Error: " +
ErrorCode.toString());
if (ErrorCode.intValue() == -2) {
+ logger.info("getSyncItemFromId returning null!
");
+ return null;
//GUID not found - should be a new entry - we
throw
- throw new SyncSourceException("cannot retrieve
item: id=" + resID + ",error=" + ErrorCode.toString());
+// throw new SyncSourceException("cannot retrieve
item: id=" + resID + ",error=" + ErrorCode.toString());
} else {
//TODO: temporary fixed till fix is in official
sync4j:
- //return null;
+// return null;
ActualState = SyncItemState.UNKNOWN;
+ logger.info("getSyncItemFromId returning Unkown
item! ");
return createSyncItem(syncItemKey, new
String("").getBytes());
}
+
// throw new SyncSourceException("cannot retrieve item: id=" +
resID + ",error=" + ErrorCode.toString());
} else {
final String datastr = (String)
result.toArray()[2].toString();
logger.fine("created SyncItem: " + id + " with Data [" +
new String(Base64.decode(datastr.getBytes())) +
"]");
+ logger.info("getSyncItemFromId returning new item! " +
syncItemKey);
return createSyncItem(syncItemKey,
Base64.decode(datastr.getBytes()));
}
}
@@ -162,7 +178,7 @@
* @see
sync4j.framework.engine.source.SyncSource#getSyncItemsFromIds(java.security.Principal,
sync4j.framework.engine.SyncItemKey[])
*/
public SyncItem[] getSyncItemsFromIds(final Principal principal, final
SyncItemKey[] syncItemKeys) throws SyncSourceException {
- logger.fine("getSyncItemFromIds");
+ logger.fine("getSyncItemsFromIds");
final int len = syncItemKeys.length;
final SyncItem[] ret = new SyncItem[len];
for (int i = 0; i < len; i++) {
@@ -237,7 +253,10 @@
// add setSyncItem parameters
params.add(id.getKeyAsString());
- params.add(SourceType.type);
+// these info are not necessary anymore because we get it directly
from
+// inputmessageprocessor we submit an empty mimetype
+// params.add(SourceType.type);
+ params.add("");
params.add(dataString);
final Boolean res = (Boolean) executeXMLRPC(principal,
"setSyncItem", params);
if (res.booleanValue()) {
@@ -276,8 +295,10 @@
// ct.put(CONTENT_TYPE_KEY_VERSION, sourceType.getVersion());
// ret.put(SYNCITEM_CONTENTTYPE, ct);
- params.add(sourceType.getType());
- params.add(sourceType.getVersion());
+// these info are not necessary anymore because we get it directly
from
+// inputmessageprocessor
+// params.add(sourceType.getType());
+// params.add(sourceType.getVersion());
final int len = syncItems.length;
params.add(new Integer(syncItems.length).toString());
@@ -450,8 +471,10 @@
// get content type (mime)
final SyncSourceInfo Info = (SyncSourceInfo) getInfo();
// TODO: later we should implement a callback to get other
types if needed by phpgw
- final ContentType SourceType = Info.getPreferredType();
- itemparams.add(SourceType.type);
+// these info are not necessary anymore because we get it directly
from
+// inputmessageprocessor
+// final ContentType SourceType = Info.getPreferredType();
+// itemparams.add(SourceType.type);
itemparams.add(idlist);
logger.info("calling second xmlrpc: getSyncItemsbyID");
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] sync/sync4j/de/probusiness/pbgroupware/sync/PHPGwSyncSource.java, 1.8,
nomail <=