Quantcast

Re: Standalone Lightning for webapps?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Standalone Lightning for webapps?

Alan Lord (News)
On 27/01/16 13:40, CC wrote:
> Just a sanity check before I spend too much time on this.
>
> I need to write some standalone code on a (Linux) web server that serves calendar data to browsers via Ajax. It should return either HTML or Javascript to the browser, so that the browser can display a month view (just like a Lightning month view).

How about using something like:

http://fullcalendar.io/

Why re-invent the wheel?

HTH

Al


_______________________________________________
dev-apps-calendar mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-calendar
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Standalone Lightning for webapps?

Stefan Sitter-2
On 27.01.2016 14:40, CC wrote:

> Just a sanity check before I spend too much time on this.
>
> I need to write some standalone code on a (Linux) web server that
> serves calendar data to browsers via Ajax. It should return either
> HTML or Javascript to the browser, so that the browser can display a
> month view (just like a Lightning month view).
>
> This code will probably need to get ics data from a shared calendar
> server (probably Calendar (calendarserver.org) on the same box)
> before returning it to the browser, but a simpler back-end
> (SQLite/whatever) would probably be Ok.

The open source SOGo groupware server implements a web calendar
interface that looks like Lightning:
http://www.sogo.nu/tour/screenshots.html

> How difficult would it be to re-use the Lightning source code to do
> this? So, basically, I want to chop out the Thunderbird integration
> and the GUI and replace it with Ajax/HTML/Javascript. I can write
> C++/Javascript/etc, so the hacking is Ok, but I'd just like to
> confirm that the Lighning is structured in such a way that this is
> possible and there's something useful left after I've removed the
> Thunderbird bits. Or has anyone already done this?

Ok, so you are looking for a library to parse ics data? Currently
Lightning uses the libical library written in C for this task. A
replacement written in JavaScript is in development and available for
testing in Lightning trunk nightly builds.

https://github.com/libical/libical
https://github.com/mozilla-comm/ical.js/

The Lightning UI is written in XUL and therefore requires a Mozilla
based application. Maybe this will change in the future when Mozilla
drops support for XUL.

/Stefan
_______________________________________________
dev-apps-calendar mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-calendar
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Standalone Lightning for webapps?

Philipp Kewisch-2
In reply to this post by Alan Lord (News)
On 1/27/16 4:13 PM, CC wrote:

> On Wednesday, January 27, 2016 at 2:32:33 PM UTC, Alan Lord wrote:
>
>> How about using something like:
>>
>> http://fullcalendar.io/
>
> I think - I may be wrong - that it only displays a public Google calendar. Public calendars appear in search results and can be viewed by anybody. The calendar itself is stored at Google. If you want to change the calendar, you have to log on at Google with a Google account. It looks nice, but has a very limited use case. I could do pretty much the same trivially by displaying the source calendar in an iframe, and Google gives you a link to do exactly that.
>
> I've looked at a lot of other options, but they all have similar limitations. Basically, the JS/jQuery ones are, I think, all display-only, so you have to handle talking to the calendar server yourself in your server code.
>
> The advantage of using the Lightning code would be that it handles both the front- and back-end: it talks to the calendar server, *and* it creates JS for output. I think. This lets you create private calendars which can be both read and written by a group of users.
>

The Lightning code is pretty much geared towards working in a client
side application. If you are implementing this from scratch I'd rather
suggest using various other libraries. You should defintiely do 1,  then
you have the choice of either doing 2, 3 or 4.


1) Fullcalendar
This is really the best solution for calendar display in the browser.
Use a custom backend that hooks up to the remote server and maybe does
some caching.

2) dav.js + ical.js
This should allow you to access the calendar server from a client. Using
it directly from the browser may not work with many servers due to CORS.
If you tell the server to accept CORS you might be able to though. If
you use sabredav, you can check out the CORSPlugin in the repo mentioned
in (4).

You can possibly use dav.js from node though and proxy the data in any
format you want if you prefer the indirection.

You can then use ical.js to parse the ical data (or have the server
return jCal instead, calendarserver/sabredav support this), then hand
this off to fullcalendar or whatever else you use.


3) JMAP (https://github.com/jmapio)
You can use the jmap-perl proxy to proxy calls to the caldav server,
then use the jmap protocol to show the data in the frontend. See also
https://github.com/linagora/jmap-client for a client implementation,
note it is currently geared towards mail though. There also seems to be
another js library for it on the jmapio site.

4) custom JSON frontend using HAL + ical.js
If you can choose the actual caldav server, you could use sabredav and
then use/adapt the custom frontend Linagora wrote for it. The frontend
serves the calendar data in a JSON format using the HAL standard.
https://github.com/linagora/esn-sabre

You may still need ical.js to parse the server data though.

Writing a full calendaring solution is not an easy task though :)


_______________________________________________
dev-apps-calendar mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-calendar
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Standalone Lightning for webapps?

Alan Lord (News)
In reply to this post by Alan Lord (News)
On 27/01/16 15:13, CC wrote:
> On Wednesday, January 27, 2016 at 2:32:33 PM UTC, Alan Lord wrote:
>
>> How about using something like:
>>
>> http://fullcalendar.io/
>
> I think - I may be wrong - that it only displays a public Google calendar.

Yes you are. It will display whatever calendar data you want if you
write the right code. It's "simply" code to display calendar data in a
nice way using familiar libraries like jQuery.

HTH

Al
_______________________________________________
dev-apps-calendar mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-calendar
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Standalone Lightning for webapps?

gneandr-11
In reply to this post by Philipp Kewisch-2
On 27.01.2016 19:39, Philipp Kewisch wrote:

> On 1/27/16 4:13 PM, CC wrote:
>> On Wednesday, January 27, 2016 at 2:32:33 PM UTC, Alan Lord wrote:
>>
>>> How about using something like:
>>>
>>> http://fullcalendar.io/
>>
>> I think - I may be wrong - that it only displays a public Google calendar. Public calendars appear in search results and can be viewed by anybody. The calendar itself is stored at Google. If you want to change the calendar, you have to log on at Google with a Google account. It looks nice, but has a very limited use case. I could do pretty much the same trivially by displaying the source calendar in an iframe, and Google gives you a link to do exactly that.
>>
>> I've looked at a lot of other options, but they all have similar limitations. Basically, the JS/jQuery ones are, I think, all display-only, so you have to handle talking to the calendar server yourself in your server code.
>>
>> The advantage of using the Lightning code would be that it handles both the front- and back-end: it talks to the calendar server, *and* it creates JS for output. I think. This lets you create private calendars which can be both read and written by a group of users.
>>
>
> The Lightning code is pretty much geared towards working in a client
> side application. If you are implementing this from scratch I'd rather
> suggest using various other libraries. You should defintiely do 1,  then
> you have the choice of either doing 2, 3 or 4.
>
>
> 1) Fullcalendar
> This is really the best solution for calendar display in the browser.
> Use a custom backend that hooks up to the remote server and maybe does
> some caching.
>
> 2) dav.js + ical.js
> This should allow you to access the calendar server from a client. Using
> it directly from the browser may not work with many servers due to CORS.
> If you tell the server to accept CORS you might be able to though. If
> you use sabredav, you can check out the CORSPlugin in the repo mentioned
> in (4).
>
> You can possibly use dav.js from node though and proxy the data in any
> format you want if you prefer the indirection.
>
> You can then use ical.js to parse the ical data (or have the server
> return jCal instead, calendarserver/sabredav support this), then hand
> this off to fullcalendar or whatever else you use.
>
>
> 3) JMAP (https://github.com/jmapio)
> You can use the jmap-perl proxy to proxy calls to the caldav server,
> then use the jmap protocol to show the data in the frontend. See also
> https://github.com/linagora/jmap-client for a client implementation,
> note it is currently geared towards mail though. There also seems to be
> another js library for it on the jmapio site.
>
> 4) custom JSON frontend using HAL + ical.js
> If you can choose the actual caldav server, you could use sabredav and
> then use/adapt the custom frontend Linagora wrote for it. The frontend
> serves the calendar data in a JSON format using the HAL standard.
> https://github.com/linagora/esn-sabre
>
> You may still need ical.js to parse the server data though.
>
> Writing a full calendaring solution is not an easy task though :)
>
>
Just to complement Philipp's answer.
He mentioned "sabredav", see the fruux pages which is based on sabredav.
Head over to https://fruux.com/developers/

Good luck

_______________________________________________
dev-apps-calendar mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-calendar
Loading...