Integaration of Schduler with Orchard CMS

Hi,

We are doing a POC i.e. integration of scheduler in Orchard CMS application as our client using Orchard CMS. We are facing a major issue i.e. loading of basic calendar control and not able to proceed further. Please let us know how should we achive this. It would be of great help if you share the sample or document on this regard.

Thanks in advance for your support.

Regards,
Kamal

Hello Kamal,
we haven’t currently tried scheduler with Orchard, can you provide some more details about this problem? Is there is a script error, or just calendar isn’t displayed?

Hi,

We have started integrating DHTMLX calendar with OrchardCMS. Please find our observations below.

  1. We have integrated the DHTMLXCalendar Sample with Orchard CMS. When we run the application and calling the BasicCalendar then we got error i.e. “Scheduler is undefined” as shown in attached snapshot.
  2. On further analysis, we did the below exercise :
    a. We have create a simple MVC sample by including FullCalendar(JQuery, Open Source, arshaw.com/fullcalendar/) Js file and ran the application and is working fine.
    b. We have created a simple MVC Sample by including DHTMLXCalendar file and is working fine. For better understanding the flow, we have deleted “dhtmlxscheduler.js” file and ran the application and got the above error i.e Scheduler is undefined…
  3. By doing this, we came to know that DHTMLXCalendar integrated with OrchardCMS might not recognize the dhtmlxscheduler.js file even it(js file reference) is rendering into output file.
  4. Also, we assume that the DHTMLX dll is adding this “dhtmlxscheduler.js” file reference in the output but orchardcms is not find this location.
  5. We have added the reference at view page, even then DHTMLX dll is using its own reference. Is there any to override the Js file reference of DHTMLX dll.

Please find the output and error details in the attached document.

Please help us how should we proceed for further.





Hello,
try to override path to the codebase folder(which should contain dhtmlxscheduler.js and other files) and paths to the data and save actions
it may be something like this:

var scheduler = new DHXScheduler(); scheduler.Codebase = Url.Content("~/Scripts/dhtmlxScheduler"); scheduler.SaveAction = Url.Content("~/ControllerName/Save"); scheduler.DataAction = Url.Content("~/ControllerName/Data"); be sure to use default constructor for scheduler, it will disable url autogeneration

Hi,

Thanks for your suggestion.

We are able to overcome js file reference issue and not we are not getting earlier mentioned issue. But we are facing another issue i.e. HTML5 tag issue("<!Doctype html>"). Please find the detailed explanation below:

Orchard CMS is using master layout(document.cshtml) and our page is rendering using this layout. Initially, when we run the application, we are not able to view calendar. On furhter analysis, we found that the html5 syntax(<!Doctype html>) is causing the problem. We removed this tag and able to view the calendar in the output.
In continuation, we have created a MVC3.0 sample and included the html5 syntax(<!Doctype html>) on top of the page and run the application. We are not able display the calendar in output but when we remove this tag then application is working fine.

Please help us how should we proceed for further. We assume that this might be issue with js file.

Thanks in advance for your help.

Regards,
Kamal

Hello,
make sure to set initial height of scheduler’s container, something like that:

[code]


<%= Model.Render() %>
[/code] when scheduler is initialized on the client, it adjusts it's sizes to the sizes of the parent element, so if the parent is collapsed, calendar won't be displayed

Hi Aliaksandr,

Great, It is working fine.

Thanks for your great help

Regards,
Kamal

Hi Aliaksandr,

Thanks again for your quick help.

we are able to integrate the Calendar with Orchard CMS and view the calendar along with other content. But we are facing a issue with data loading.
As you said in earlier reply, we have over ride the data action property i.e. “scheduler.DataAction = Url.Content(”/Modules/DHTMLXCalendar/Controllers/BasicScheduler/Data");" But data method is not triggering and not displaying the data on the calendar. On further analysis, we found that the Scheduler load method is not properly formed. it is coming as “Scheduler.load(”/BasicScheduler/Modules/DHTMLXCalendar/Controllers/BasicScheduler/Data") instead of “Scheduler.load(”/Modules/DHTMLXCalendar/Controllers/BasicScheduler/Data") ". So Could you please help us to solve this issue.

Regards,
Kamal

You should use default constructor for DHXScheduler object:

var scheduler = new DHXScheduler()

otherwise, if you pass controller instance into it, scheduler will try to generate urls using controller name and values of DataAction and SaveAction properties

Hi,

Thanks for your reply.

By looking into one of your earlier reply, We did the same i.e. “var scheduler = new DHXScheduler(this)” is commented and corrected as var scheduler = new DHXScheduler() and proper url is coming. Now, we are getting another error i.e. Pemission Dened from js file. We are looking into the same. If you know the solution, it would be of great help fro us to solve issue quickly.

Regards,
Kamal

Hi,

Also, We would like to add more information on the below error i.e. Permission Denied
We are getting this error at the line i.e. “this.xmlDoc.open(postMode ? “POST” : “GET”, filePath, this.async);” of the “dtmlXMLLoaderObject.prototype.loadXML=function(filePath, postMode, postVars, rpc)” method in dhtmlxscheduler.js file.

Regards,
Kamal

Hi Aliaksandr,

We would like to update you that we found the root cause of the issue i.e. ‘improper Url formation for dataaction’. We have corrected("~/DHTMLXCalendar/BasicScheduler/Data") and now sample data is loading to the calendar.

Regards,
Kamal

Hi Aliaksandr,

Now we are trying to load the events from database. As you know Orchard CMS is using N-hibernate as ORM tool. We are following the same(N-hibernate) to load the data but it is not recoginising the Driver(Controller) actions and also not loading the data and calendar. It would be of great help, if you share any sample or document to load the data using N-hibernate.

Thanks in advance for your support.

Regards,
Kamal