phpgroupware-cvs
[Top][All Lists]
Advanced

[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.9
Date: Fri, 26 Nov 2004 13:34:57 +0100

Update of /sync/sync4j/de/probusiness/pbgroupware/sync
Modified Files:
        Branch: 
          PHPGwSyncSource.java

date: 2004/11/26 12:34:57;  author: fipsfuchs;  state: Exp;  lines: +11 -34

Log Message:
new version from internal CVS moved to original project
=====================================================================
Index: sync/sync4j/de/probusiness/pbgroupware/sync/PHPGwSyncSource.java
diff -u sync/sync4j/de/probusiness/pbgroupware/sync/PHPGwSyncSource.java:1.8 
sync/sync4j/de/probusiness/pbgroupware/sync/PHPGwSyncSource.java:1.9
--- sync/sync4j/de/probusiness/pbgroupware/sync/PHPGwSyncSource.java:1.8        
Mon Jun 28 10:08:20 2004
+++ sync/sync4j/de/probusiness/pbgroupware/sync/PHPGwSyncSource.java    Fri Nov 
26 12:34:57 2004
@@ -94,15 +94,7 @@
                final Vector params = new Vector();
                addTimestamp(since, params);
                ActualState = SyncItemState.DELETED;
-               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;
+               return callGetItemsByID(principal, "getDeletedSyncItemIDs", 
params);
        }
        /* (non-Javadoc)
         * @see 
sync4j.framework.engine.source.SyncSource#getNewSyncItemKeys(java.security.Principal,
 java.sql.Timestamp)
@@ -128,7 +120,6 @@
         * @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
@@ -141,9 +132,7 @@
 
                // add getSyncItem parameters
                params.add(id);
-//             these info are not necessary anymore because we get it directly 
from
-//             inputmessageprocessor
-//             params.add(SourceType.type);
+               params.add(SourceType.type);
                
                final Vector result = (Vector) executeXMLRPC(principal, 
"getSyncItemFromId", params);
 
@@ -152,24 +141,19 @@
                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()));
                }
        }
@@ -178,7 +162,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("getSyncItemsFromIds");
+               logger.fine("getSyncItemFromIds");
                final int len = syncItemKeys.length;
                final SyncItem[] ret = new SyncItem[len];
                for (int i = 0; i < len; i++) {
@@ -253,10 +237,7 @@
 
                // add setSyncItem parameters
                params.add(id.getKeyAsString());
-//             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(SourceType.type);
                params.add(dataString);
                final Boolean res = (Boolean) executeXMLRPC(principal, 
"setSyncItem", params);
                if (res.booleanValue()) {
@@ -295,10 +276,8 @@
 //             ct.put(CONTENT_TYPE_KEY_VERSION, sourceType.getVersion());
 //             ret.put(SYNCITEM_CONTENTTYPE, ct);
 
-//             these info are not necessary anymore because we get it directly 
from
-//             inputmessageprocessor
-//             params.add(sourceType.getType());
-//             params.add(sourceType.getVersion());
+               params.add(sourceType.getType());
+               params.add(sourceType.getVersion());
 
                final int len = syncItems.length;
                params.add(new Integer(syncItems.length).toString());
@@ -471,10 +450,8 @@
                // get content type (mime)
                final SyncSourceInfo Info = (SyncSourceInfo) getInfo();
                // TODO: later we should implement a callback to get other 
types if needed by phpgw 
-//             these info are not necessary anymore because we get it directly 
from
-//             inputmessageprocessor
-//             final ContentType SourceType = Info.getPreferredType();
-//             itemparams.add(SourceType.type);
+               final ContentType SourceType = Info.getPreferredType();
+               itemparams.add(SourceType.type);
                itemparams.add(idlist);
                 
                logger.info("calling second xmlrpc: getSyncItemsbyID");




reply via email to

[Prev in Thread] Current Thread [Next in Thread]