Dear Jan Maté / Mattias, First of all thank you for the very useful CaldavZap software, I installed it in our company to be working with davical server.
To comply some of our needs I developed a tool to add events directly to the davical server database, and when a user press F5 and login again to your CaldavZap client all of them appear and can be managed without an issue (means that the way we are adding directly to the DB is correct).
The problem is that I have received many requests to remove the needing of F5 and typing again the login and password, so I enabled the reload button (var globalEnableRefresh=true; in config.js) hoping that once the user press it, the some extra events that may have been added to the server DB are detected and loaded. The refresh circle button is appearing correctly, but the problem is that clicking on it, dosent make any effect.
I "Swimmed" in your code during one week, trying to find the part of the code to perform the loading. Trying all combinations of parameters in the execution of the function "reloadResources(dontSaveSettings, loadArray)" in main.js. I created another one (forceReloadResources) to avoid touching your code and I called it from the div "intRefresh" onclick="forceReloadResources();" in index.html. I tried also to see how you make the initial loading after the login and simulate it in the click event (execute loadConfig() function and others in many ways..etc..etc), nothing of this worked.
Please I appreciate if you help me indicating where I have to modify or add a code to make all the calendar resources and their events reload again when the user press the reload button without needing of login again(even it is ok for me the alternative of triggering that synchronization or reloading automatically every 5 min without the need of pressing the button). By the way, I use the globalNetworkCheckSettings (using globalAccountSettings to avoid auth and login is not possible in our case, we have 20 users).
Thanks a lot,
Hi all,
your problem is, that you DIRECTLY modify your DAViCal database (= probably something like: INSERT INTO "caldav_data" ...). In this case, sync-tokens are NOT updated = the server will say "nothing new here". You need to use the CalDAV protocol and the HTTP PUT request to add an event into your database - in this case DAViCal not only adds the object into "caldav_data" table, but also handles the sync-token related code = the server then sends info about new/modified/deleted event(s) to CalDAV clients.
The full reload is working because in this case there is no sync-token (on first load) = everything from the "caldav_data" table is sent to the client (with a new sync-token). Then the client uses that token to request changes from that "sync-token" (consider the sync-token as something like "I want info about new/modified/deleted data from this date/time (when I got data from the server last time)".
JM
On 19. 10. 2023, at 10:10, mofatob193--- via Inf-IT DAV Clients davclients@lists.inf-it.com wrote:
Dear Jan Maté / Mattias, First of all thank you for the very useful CaldavZap software, I installed it in our company to be working with davical server.
To comply some of our needs I developed a tool to add events directly to the davical server database, and when a user press F5 and login again to your CaldavZap client all of them appear and can be managed without an issue (means that the way we are adding directly to the DB is correct).
The problem is that I have received many requests to remove the needing of F5 and typing again the login and password, so I enabled the reload button (var globalEnableRefresh=true; in config.js) hoping that once the user press it, the some extra events that may have been added to the server DB are detected and loaded. The refresh circle button is appearing correctly, but the problem is that clicking on it, dosent make any effect.
I "Swimmed" in your code during one week, trying to find the part of the code to perform the loading. Trying all combinations of parameters in the execution of the function "reloadResources(dontSaveSettings, loadArray)" in main.js. I created another one (forceReloadResources) to avoid touching your code and I called it from the div "intRefresh" onclick="forceReloadResources();" in index.html. I tried also to see how you make the initial loading after the login and simulate it in the click event (execute loadConfig() function and others in many ways..etc..etc), nothing of this worked.
Please I appreciate if you help me indicating where I have to modify or add a code to make all the calendar resources and their events reload again when the user press the reload button without needing of login again(even it is ok for me the alternative of triggering that synchronization or reloading automatically every 5 min without the need of pressing the button). By the way, I use the globalNetworkCheckSettings (using globalAccountSettings to avoid auth and login is not possible in our case, we have 20 users).
Thanks a lot,
Thank you Jan for the replay, effectively I make 2 inserts, one in caldav_data and another in calendar_item, using a dav_name composed by some primry and forien keys of a third part app that my tool also manages, so I make some kind of relation. I will try to make it the way you say, but I hope that I can keep choosing the dav_name that I am composing in that case and not be obligated to let the generation of the dave_name to server. As a guideness from your side, would you please indicate me the location in caldavzap code the locations of the rutines/procedure of adding and editing an event so I can use it as an example of and have an idea of how I can perform it from my side when needed (I am not expert in html (PUT, GET) neither ajax, I am a new php programmer and have some knowlages of javascripts and a simple notions o a basic html programming). Thanks a lot.
Hi Rodriguez,
as I mentioned in my previous e-mail, you cannot directly update the DB (even if you update 2 tables) and expect that the CalDAV synchronization will work. It will NOT work, because sync-tokens (for real synchronization) are not updated. See the information available at (my communication with other developers from the past): https://github.com/Kozea/Radicale/issues/306 - it is not about DAViCal, but here you can understand that there are 2 ways how to "synchronize" data with a CalDAV server - the good and the bad way. DAViCal (and also InfCloud) implements the "good way", but it works only if you insert your data into the DB using the CalDAV functionality (= NOT directly using INSERT, ...).
The PUT request is something like the POST request (= you send some data with the request) - in PHP you can use the CURL library for this functionality.
In our source code you can check the "webdav_protocol.js" file and the "putVcalendarToCollection" function. For new objects the request looks like:
method: PUT
URL: full URL where you want to put your object (e.g. https://your_server.com/caldav.php/principal/collection/file.ics)
contentType: text/calendar
request headers: If-None-Match: *
data: the vCalendar object ...
For vCalendar object update the request headers are usually different (to prevent conflicts) - e.g.: If-Match: <current_etag_of_the_object> ...
JM
On 19. 10. 2023, at 18:25, mofatob Rodriguez via Inf-IT DAV Clients davclients@lists.inf-it.com wrote:
Thank you Jan for the replay, effectively I make 2 inserts, one in caldav_data and another in calendar_item, using a dav_name composed by some primry and forien keys of a third part app that my tool also manages, so I make some kind of relation. I will try to make it the way you say, but I hope that I can keep choosing the dav_name that I am composing in that case and not be obligated to let the generation of the dave_name to server. As a guideness from your side, would you please indicate me the location in caldavzap code the locations of the rutines/procedure of adding and editing an event so I can use it as an example of and have an idea of how I can perform it from my side when needed (I am not expert in html (PUT, GET) neither ajax, I am a new php programmer and have some knowlages of javascripts and a simple notions o a basic html programming). Thanks a lot.
Dear Ján Maté,
Thanks a lot for your replay, finally I solved it using ,as you said, the HTTP requests for both, creating and editing the events, and the results were immediate (I believe because of the 10 seconds syncronization of caldavzap), so I even didnt need to use the sync button.
Best regards,