Skip to content

Commit

Permalink
When new note is inserted from Web Client then the timestamp is not s…
Browse files Browse the repository at this point in the history
…et and hence
  • Loading branch information
vettukal committed Aug 20, 2012
1 parent 225f67f commit a053132
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 15 deletions.
Expand Up @@ -11,6 +11,7 @@
import org.openintents.cloudsync.shared.OICloudSyncRequest;
import org.openintents.cloudsync.shared.OICloudSyncRequestFactory;
import org.openintents.cloudsync.shared.TaskProxy;
import org.openintents.cloudsync.util.Dumper;
import org.openintents.cloudsync.util.NotepadSync;
import org.openintents.cloudsync.util.RecievedData;
import org.openintents.cloudsync.util.SyncUtil;
Expand All @@ -28,7 +29,7 @@

public class AsyncSync extends AsyncTask<String[], Void, String[] >{

private static final String TAG = "CloudSyncActivity";
private static final String TAG = "AsyncSync";
private static final boolean debug = true;

protected static RecievedData[] rdArray=null;
Expand Down Expand Up @@ -411,6 +412,7 @@ public void onSuccess(List<TaskProxy> arg0) {
if (debug) Log.d(TAG, "Size of list"+list.size());
}
});
Ulg.d("TaskProxy List:-> "+list.toString());
return list;
}

Expand Down
Expand Up @@ -89,10 +89,10 @@ public void onMessage(Context context, Intent intent) {
MessageDisplay.displayMessage(context, intent);
if (debug) Log.d(TAG,"recieved c2dm message:-> ");

cdmTimeTask.setContext(this);
cdmTimeTask.setHandle(timeHandle);
timeHandle.removeCallbacks(cdmTimeTask);
timeHandle.postDelayed(cdmTimeTask, 30000);
// cdmTimeTask.setContext(this);
// cdmTimeTask.setHandle(timeHandle);
// timeHandle.removeCallbacks(cdmTimeTask);
// timeHandle.postDelayed(cdmTimeTask, 30000);

}
}
Expand Down
Expand Up @@ -3,24 +3,25 @@
import android.util.Log;

public class Ulg {
static boolean extDebug= true;
public static void d(String TAG, String message) {
Log.d(TAG, message);
if(extDebug) Log.d(TAG, message);
}

public static void v(String TAG, String message) {
Log.v(TAG, message);
if(extDebug)Log.v(TAG, message);
}

public static void i(String TAG, String message) {
Log.i(TAG, message);
if(extDebug)Log.i(TAG, message);
}

public static void i(String message) {
Log.i("vincent", message);
if(extDebug)Log.i("debugging", message);
}

public static void d(String message) {
Log.d("vincent", message);
if(extDebug)Log.d("debugging", message);
}


Expand Down
Expand Up @@ -54,5 +54,7 @@ public static void dump(String msg, long[] array) {
}

}



}
Expand Up @@ -83,10 +83,11 @@ public String update(@DefaultValue("") @FormParam("_id") String _id,
}

long id = Long.parseLong(_id);

long appEngineTime = service.getAppEngineTime();
Task task = service.readTask(id);
String t = Util.appendJSON(task.getJsonStringData(), "title", title);
t = Util.appendJSON(t, "note", note);
task.setTimestamp(appEngineTime);
task.setJsonStringData(t);
service.updateTask(task);

Expand Down Expand Up @@ -131,10 +132,12 @@ public String newNote(@DefaultValue("") @FormParam("title") String title,
Note n = new Note();
n.title = title;
n.note = note;
n.created_date = n.modified_date = service.getAppEngineTime();
long appEngineTime = service.getAppEngineTime();
n.created_date = n.modified_date = appEngineTime;

task.setAppPackageName(Util.NOTEPAD_PACKAGE_NAME);
task.setJsonStringData(Util.toJSON(n));
task.setTimestamp(appEngineTime);
service.updateTask(task);
return "";
}
Expand Down
Expand Up @@ -30,7 +30,7 @@ public Task updateTask(Task task) {
//this is where you can put c2dm message
task.setEmailAddress(DataStore.getUserEmail());
task = db.update(task);
//DataStore.sendC2DMUpdate("INSERT" + ":");
//DataStore.sendC2DMUpdate("UPDATE" + ":");
//In the above line the TaskChange.UPDATE only means "update" string and separator is :
return task;
}
Expand Down
2 changes: 1 addition & 1 deletion OICloudSync-AppEngine/war/WEB-INF/appengine-web.xml
Expand Up @@ -15,7 +15,7 @@
-->
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
<application>oicloudsync</application>
<version>fivebugcorrection</version>
<version>sixtimestampbugfix</version>

<!--
Allows App Engine to send multiple requests to one instance in parallel:
Expand Down
@@ -1,3 +1,2 @@
# Module oicloudsync
# RPC service class, partial path of RPC policy file
com.google.gwt.logging.shared.RemoteLoggingService, D981642EFA42F70DEE26F7EF8CAC42EC.gwt.rpc

0 comments on commit a053132

Please sign in to comment.