Full google calendar integration with Rails 3 site - ruby-on-rails

I need to integrate my rails 3 application with google calendar. The following are requirements of the application:
Within my application I can create calendar events and invite people (pretty much most of the google calendar features).
I want to be able to pull a users existing google calendars and sync? (potentially).
I need to ability to show the calendar in different forms (daily, weekly, monthly) and put additional graphics in the calendar.
I need to use items created in the calendar for other features and functions. Specifically I need to keep track of a calendar item with something in my database. For example, the ID of a new appointment is tied to a user's foo in my database.
At first I was thinking that I should just bring in google calendar into my application (directly into a div) but then with #4 I really need much more than that.
I found the following
http://cookingandcoding.com/docs/gcal4ruby/ (for API integration)
and
http://www.web-delicious.com/jquery-plugins-demo/wdCalendar/sample.php (for the visual display of calendars)
Before I go down this path I wanted to see if others had input on this. I'm mostly concerned about how to architect this solution, specifically:
let's assume I use the api listed above to create a calendar specifically for my application in google calendar and I interface with this single calendar.
let's also assume that I can create events in that calendar, get the ID back from google calendar and place that ID of each event in my database (where I need to store it and make reference to specific events I've created).
I also want to bring in existing calendars from the user (and resync them). Can this API do that?
Are these the right tools for this architecture?
Also I think I need to use omniauth so that I don't have to store the users google calendar user name and password.

Another JQuery Calendar plugin you might want to look at is Full Calendar. There is even a demo project that provides code to integrate it with Rails 3 available on GitHub

Related

Write LiveEvent to Calendar

Is it possible to create a LiveEvent that shows up on the Teams calendar?
Via the meetings api I can create regular Meetings or LiveEvents, however,
the api documentation includes a note that the resulting meetings will not show up on the users calendar. Given it's not on the calendar (and no where else visible?) it would seem we have to control all the settings programmatically via the api.
https://learn.microsoft.com/en-us/graph/api/application-post-onlinemeetings?view=graph-rest-1.0&tabs=http
We would like to create Meetings/LiveEvents and then allow people the option to manage the settings by accessing the event on their calendar.
The calendar api allows creation with the 'isOnlineMeeting' flag but that makes only a Meeting and not a LiveEvent. I don't see any way to create a calendar event as a LiveEvent?
https://learn.microsoft.com/en-us/graph/api/user-post-events?view=graph-rest-1.0&tabs=http
Is there any way to create a LiveMeeting that shows up on the calendar? Something I am missing?
Thanks

How to move event to another calendar in one account?

I'm integrating Outlook calendar to my app and I want my user can change their events from this calendar to another calendar (like changing from Calendar to calendar2 in the origin Outlook calendar).
But I can't find any endpoint to do this, even the UpdateEvent endpoint in their docs doesn't support this.
So how can I change event's calendar using MS graph API ? Right now the only way I'm thinking of is delete the old event in Calendar and create new event in calendar2 which is not 100% reliable because sometimes the delete or create request can failed
)
Currently the is no way to move an event to another calendar. You can add a feature request here so that the engineering team may implement it in future.
So far as you said the only way may be delete then create but also keep in mind that the create should add all the existing properties/data like extensions when creating in the new calendar.

Rails 3.2 form for one-to-many relationship

I have the following models:
User
Apps
Service
Apis
A User has a list of Services he/she can access.
When creating an App I need to be able to add/remove services to it based on the Services a User can access. The same applies for editing an App.
We are using simple form. The association method is great for displaying Services with a checkbox to add / remove from the App.
The problem we face is that Services have Apis and we need to display information related to the Apis under a Service. A User still needs to be able to select a Service to add/remove from an App, as well as display information about it's Apis below.
It's seems the association method in simple form does not support the functionality we need to display information related to Apis in addition to being able to add/remove an Service from an App based on the User's list of Services he/she can access.
We have spent some time trying to figure out how to solve this problem e.g., nested forms, array parameters, simple form api, etc.
I would think there would be a Rails way to do this.

Using mixpanel to build custom analytics dashboard for users

I love graphs.
I'd love to get my hands on some data and make it look pretty. But alas, I'm a little lost on what would be considered best practice.
I've selected mixpanel (only as an example) as I seems wonderfully easy to track custom events, and doesn't have any subdomain limitation like Google Analytics.
Say I had 100-1000+ users who have an account (which is publicly facing), and I'm currently tracking the public interactions their pages get. With mixpanel, I can see the data which is lovely, and I've segmented it to individual accounts. So far, so good!
But then, I want to show my users this information. And here my head begins to hurt. Do I schedule a cron jobs, pulling in the data from mixpanel and writing it to their respective accounts? Or is there a better way? I've looked into mixpanel's api (I'm using Ruby), but they keep telling me I should use the javascript api. But in using JS, how does one prevent others getting the data (ie. what's stopping someone faking mixpanel api-posts in the console, or viewing my private key?).
What would you consider a practical solution in such a case?
You can achieve this by storing the user specific events of each user with a $bucket property attached which has a value unique to each user as explained in the mixpanel docs here Mixpanel docs. If you want to still use ruby to serve the events, have a look at Mixpanel's recommended ruby client libraries
mixpanel_client looks like the much maintained option of the 2 mentioned. If you go with that then you can serve user specific events as shown in the example below(which is also in the gem's readme):
data = client.request do
# Available options
resource 'events/properties'
event '["test-event"]'
name 'hello'
values '["uno", "dos"]'
timezone '-8'
type 'general'
unit 'hour'
interval 24
limit 5
bucket 'contents'
from_date '2011-08-11'
to_date '2011-08-12'
on 'properties["product_id"]'
where '1 in properties["product_id"]'
buckets '5'
end
You could try a service like Keen IO that will allow you to generate encrypted scoped write and read API keys. Keen IO is built for customizable and programmatic analytics features such as exposing analytics to your customers, where as MixPanel is more for exploring your data in their UI. The idea with an encrypted scoped key is they will never be able to access your account, only the data you want them to see. You could easily tag your events with a customer ID and then use the Scoped Keys to ensure that you only ever show customers their own data.
https://keen.io/docs/security/#scoped-key
Also, Keen IO has an "importer" which allows you to export your mixpanel events into your Keen IO database.

Adding Outlook appointment using ASP.Net

I am creating an ASP.Net MVC project where users will add Outlook appointments to other users calendars. I other words; I wish for a user of my web app to be able to add an appointment directly in another persons calendar. This means sending it via email with no need for the receiver to accept it. It should be as if the receiver actually created it himself in Outlook.
Is this even possible to do?
The web app is hosted outside the customers network.
Best regards
Pål Eilertsen
You can create an ICS file that the user can double click and store the appointment. If multiple users, it can be sent to others. If you can get access to their exchange server (sounds like you can't), as SLaks asked, you can use something like this (http://goo.gl/G2nrd). If you have no access to Exchange directly, the ICS file format will allow the user to add the appointment.
If you want an example of an ics file (other than a Google search), sign up for a Microsoft event and click the "add to outlook" button. The fortunate thing about this methodology is it can also work with other mail/calendar applications that use the format.

Resources