Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Hiram Cabrera on Dec 16, 2009 07:33
open dhtmlx forum
dhtmlxScheduler

Is It possible to show events from a ics file?
Is there a way to load a bulk events into the scheduler?

Thanks for your support
Answer posted by Alex (support) on Dec 16, 2009 08:08

>> Is It possible to show events from a ics file?

Scheduler can load data in XML or iCal format

http://dhtmlx.com/dhxdocs/doku.php?id=dhtmlxscheduler:server_side_integration

>> Is there a way to load a bulk events into the scheduler?

How many events do you want to load ?

It is possible to use dynamic loading if there are a lot of events: http://dhtmlx.com/dhxdocs/doku.php?id=dhtmlxscheduler:server_side_integration#dynamical_loading

Answer posted by Hiram Cabrera on Dec 16, 2009 08:46
Thanks for your reply!

Which is the file that I have to modify in order to load events from an ical file in dhtmlxscheduler joomla plugin?

My iCal file has about 9000 events, which could be the best way to load them into dhtmlxscheduler? if there are some code to figure out I really appreciate that

Thanks!!!

=)
Answer posted by Hiram Cabrera on Dec 16, 2009 09:05
Related to add new events into scheduler, I saw a table events_rec which contains the data of the calendar. Is it possible to import data into the table from an ical file?
I'd ilke to publish two calendars with different event category, which is your advice in order to do that?

Thank you.
Answer posted by Stanislav (support) on Dec 16, 2009 09:55
Technically the scheduler will be able to load iCal file of any size, but for 9k events it will be slow. So the best way is to import events in DB and use dynamic-loading mode of scheduler, to load only events which are visible in a current view. 
While importing normal events is not a problem, format of recurring events in scheduler and in iCal format are very different and can't be easily converted 
Answer posted by Hiram Cabrera on Dec 16, 2009 10:05
I see,

Could you please show me how to import events in DB  and coding dynamic-loading mode of scheduler on Joomla plugin?

Thank you!
Answer posted by Hiram Cabrera on Dec 17, 2009 06:09
Hi!,

any workaround about import events into DB and coding dymanic-loading mode on joomla plugin?

Somebody show me how to do that, please
=)
Answer posted by Alex (support) on Dec 17, 2009 06:44

Hello,

>> any workaround about import events into DB

we don't have a ready solution

>>  coding dymanic-loading mode on joomla plugin

you can place scheduler.setLoadingMode('month') in the scheduler initialization, the components\com_scheduler\models\scheduler.php file:

scheduler.init("scheduler_here",null,"'.$options['default_mode'].'");

scheduler.setLoadingMode("month");


   

Answer posted by Hiram Cabrera on Dec 17, 2009 07:31
Thanks for your reply
I'm going to coding your suggestion =)

I think I have another question. It's about how can I get data from an ics file, I don't know which file do I have to modify. Could you please show me how to do that?

I really appreciate all the support you give us!!!

Thanks a lot!
Answer posted by Alex (support) on Dec 17, 2009 08:26

If you want to load events from ics file, the following can be used:

scheduler.load("events.ics","ical");

Where "events.ics" path to file.

Answer posted by Hiram Cabrera on Dec 17, 2009 09:17
Thanks

which file does need be modified???

Regards!!!
Answer posted by Alex (support) on Dec 17, 2009 09:29

scheduler initialization is in the components\com_scheduler\models\scheduler.php file. You can replace existent load method call with the necessary one:

//scheduler.load("'.JURI::root().'components/com_scheduler/events_rec.php?uid="+scheduler.uid());

scheduler.load("events.ics","ical");

Answer posted by Hiram Cabrera on Dec 17, 2009 09:43

I did the code changes suggested with no success.

this is the situation:

Ics file is located at the same folder that scheduler.php is. The ics file name is moon.ics and I add the following line below the commented one you suggest.

scheduler.load("moon.ics","ical");

scheduler sends no error but an empty calendar, any advice??

Thank you!!

Answer posted by Alex (support) on Dec 18, 2009 05:21

You should define the path starting from the site root.

Answer posted by Hiram Cabrera on Dec 18, 2009 06:06
I'm still load ics file whith no success, following your recomendation I define the ics path as below.

scheduler.load("'.JURI::root().'components/com_scheduler/models/moon.ics","ical");

Is there anything wrong?

Thank you!
Answer posted by Stanislav (support) on Dec 18, 2009 07:42
On page of scheduler, please check the generated source ( ctrl-u ) , and try to use path inside the load command ( from the generated source ) in separate window of a browser.
Does it loading file or returning some kind of error?
Answer posted on Dec 18, 2009 08:31

Actually there is an error:

Message: Permission denied
Line: 1
Char: 2547
Code: 0
URI: http://(server)/joomla/components/com_scheduler/codebase/dhtmlxscheduler.js

moon.ics file has 777 file permissions, any advice?

 

thank you!

Answer posted by Stanislav (support) on Dec 21, 2009 02:34
Be sure that domains used in load command and in url of page are the same. Javascript can't operate with data not from the same domain ( the domains need to be fully exactly , including www part if it exists ) 
Answer posted by Stanislav (support) on Dec 21, 2009 02:37
Also , you can import data in DB, instead of loading from ical file

  1. grab http://support.dhtmlx.com/x-files/scheduler_2_1/icaltodb.zip
  2. unpack it on same server where joomla resides
  3. run index.php
  4. fill db connection parameters ( table name is “events_rec”), chose ical file for importing
  5. press import button
Answer posted by Hiram Cabrera on Dec 21, 2009 06:16

Hello,

the domain used in load command is the same that the url, any other idea?

 

thank you

Answer posted by Stanislav (support) on Dec 22, 2009 03:59
>>Message: Permission denied
Such error can occur only in two cases

a) cross domain request
b) setting restrictive IE security settings ( higher than default )