简体   繁体   English

如何从MySql Db搜索CalDav Blob?

[英]How to search CalDav Blob from MySql Db?

I'm currently trying to integrate a CalDav Calendar into my website. 我目前正在尝试将CalDav日历集成到我的网站中。 I'm using "baikal" and it actually works fine, i'm already able to access my calendar via iphone, macbook and so on. 我正在使用“贝加尔湖”,它实际上工作正常,我已经能够通过iPhone,Macbook等访问日历。

What I wanna do now is reading the Events from the mysql database and display them in my own calendar. 我现在想做的是从mysql数据库中读取事件,并在我自己的日历中显示它们。 It works fine so far, I found a library that can parse these Blobs which stores all calendardata. 到目前为止,它运行良好,我找到了一个可以解析这些Blob的库,该库存储了所有calendardata。

My problem now is: How can I search through this blob? 我现在的问题是:如何搜索该斑点? For example, i want to display all events between date x and y, or display all events that contain "concert" in the summary/title. 例如,我要显示日期x和y之间的所有事件,或显示摘要/标题中包含“音乐会”的所有事件。

I did some research on this but i wasn't able to find anything so I thought I ask! 我对此进行了一些研究,但是我什么都找不到,所以我想问!

looking forward to your replies and thanks in advance! 期待您的答复并提前致谢! david 大卫

Why dont you use CalDAV to access the calendar, instead of trying to directly hit the MySQL DB ? 为什么不使用CalDAV访问日历,而不是尝试直接访问MySQL数据库? From what I understand, you don't even own the schema as it comes from the Baikal server (?...) so you are running the risk of having to redo the work if/when Baikal changes the way they store the data. 据我了解,您甚至都不拥有来自贝加尔湖服务器的架构(?...),因此如果贝加尔湖更改了存储数据的方式,您将不得不重做工作。

Another advantage is that you are guaranteed to get a more consistent result: for example, time range queries (from date x to date y) can be tricky so by using CalDAV queries, both CalDAV clients and your calendar are going to return the same set of events whereas by trying to implement something on your own, you will likely diverge from what the CalDAV server returns. 另一个优点是可以确保您获得更一致的结果:例如,时间范围查询(从日期x到日期y)可能很棘手,因此通过使用CalDAV查询,CalDAV客户端和日历都将返回相同的集合事件,而通过尝试自行实现某些事情,您可能会与CalDAV服务器返回的结果有所不同。

There are php CalDAV clients. 有PHP CalDAV客户端。 See for example Is there any php CalDav client library? 参见例如是否有任何php CalDav客户端库?

See http://tools.ietf.org/html/rfc4791#section-7.8.1 for a timerange based CalDAV query. 有关基于时间范围的CalDAV查询,请参见http://tools.ietf.org/html/rfc4791#section-7.8.1

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM