数据库和谷歌日历之间的数据同步 [英] Data sync between database and google calendar

查看:204
本文介绍了数据库和谷歌日历之间的数据同步的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用Google日历将我的数据库(我的数据库上的任务,具有描述,日期,开始时间和结束时间以及用户)同步。

I would like to sync my db (tasks on my db, that have a decription, a date, a start time and an end time, and a user) with Google calendar.

为了与谷歌同步我打算使用这些组件(当然我可以以某种方式写整个东西在我自己的,但这是我可以为未来计划的东西,我很短的时间,或者替代的,你可以建议一些连接到谷歌日历发送/接收数据的工作代码?)

For sync with google i plan to use these components (of course I could somehow write the whole stuff on my own but this is something I can plan for the future now I am short of time, or in alternative can you suggest some working code that connects to google calendar to send/recieve data?).

现在我的主要问题是没有真正链接到Delphi编程,我必须要求一个Delphi相关的问题,因为其他问题得到unviewd(如这个我问)。

Now my main problem is not really linked to Delphi programming anyway I must ask a Delphi related questions because other questions get unviewd (like this one i asked).

所以我想知道如何做同步。注意:我做单向同步,生成的日历将是一个只读日历。

So I wonder how to do the sync. Note: I do one way sync and the generated calendar will be a read only calendar.

我可以设置过去和未来的最大数量进行同步(如10以前的日子和未来的100个例子)。那么我的想法是这样的:
当我启动同步应用程序,我完全阅读了在该范围内的谷歌日历itmes,我比较一下我在数据库中,然后我合并更改。然后在计时器上检查我的数据库差异,并且我上传更改。

I can set a max number in the past and future to be synced (like 10 days in past and 100 in the future for example). Then the idea I have is this: as I start the sync app I comletely read the google calendar itmes in the range, I compare one by one with what I have in db and then I "merge" changes. Then on timer I check for differences in my db and i upload changes.

但我不确定这些是最好的解决方案。

But I am not sure that these is the best solution.

真实情况的简化是这样的:想象一下,这是一个CRM,为每个用户提供一些任务。由于超出每个任务,所以我只想在我的应用程序中管理一个逻辑,但是将日历归档到google的想法是,它可以从任何移动设备轻松获得。这是一种单向同步的方式。我也可以让日历不会被readonly无论如何在每一次同步我将下载新插入的任务,但我会忽略被删除的和编辑的。在第二种情况下,跟踪数据库的变化还不够,但是我也会跟踪Google上的变化,至少要拦截新增的任务。

A simplification of the real case is this: imagine it is a CRM with some task assigend to every user. Since beyond every task there is a logic i want to managea that logic only in my application, but the idea of pulishing the calendar to google is that it is then easily available from any mobile device. This is way there is a one way sync. Ic ould also let the calendar not be readonly anyway at every sync I wil "download" the newly inserted tasks but I will ignore the deleted ones and the edited ones. In this second case it is not enough to track changes in db, but I shuold also track changes on google, at least to "intercept" the newly added tasks.

I我知道这是gerneic问题,但我想触发一个可以有用的答案,etiher重定向到同步算法或Delphi示例代码或任何可以帮助我在这个问题上进步。谢谢。

I am aware this is gerneic question but I would like to trigger an answer that can be useful, etiher redirecting me to a sync algorithm or to Delphi sample code or anything that can help me progress on this issue. Thanks.

推荐答案

Google:日历同步算法

Google: "calendar sync algorithms"

  • https://wiki.mozilla.org/Calendar:Syncing_Algorithm
  • http://today.java.net/pub/a/today/2007/01/16/synchronizing-web-client-database.html
  • Sync Algorithms

最后一个实际上很有趣,因为它直接导致到StackOverflow;)要点是:我认为没有必要重新发明轮子。 Ps:第一个链接包含一些类似于你的有用的想法。

The last one actually is funny because it leads right back to StackOverflow ;) Point is: I think there is no need to reinvent the wheel. Ps: The first link contains some useful thoughts similar to yours.

这篇关于数据库和谷歌日历之间的数据同步的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆