1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Event Module - Data Import

Event Module - Data Import

4 posts, 1 answered
  1. J.R. Garcia
    J.R. Garcia avatar
    24 posts
    Registered:
    12 Aug 2008
    27 Oct 2008
    Link to this post
    We have a client that wants to move their current calendar data to the Sitefinity events module. They have a CSV file that has a Title, Start Date, Start Time, End Time, All Day Event (True or false) and Location. Is there anyway we can map these fields in the CSV file to fields in the database?

    Thanks,
    J.R. Garcia
  2. Ivan
    Ivan avatar
    478 posts
    Registered:
    16 Jun 2015
    28 Oct 2008
    Link to this post
    Hi J.R. Garcia,

    unfortunately, we do not have this ability out of the box (meaning that there is no UI to upload a CSV file and simply map them), but this should be a pretty simple thing to do on your own by taking advantage of Events module API.

    What you'd need to do is simply loop through the CSV file and add new event for each event in the CSV. You can find Events module API walkthrough at this location:
    http://www.sitefinity.com/help/developer-manual/events-api-overview.html

    As you will see, Events module is based on Generic Content module, so for adding new events you'll be actually using ContentManager class and setting the meta data values. You can find the explanation of this concept in the link I gave you, but eventually you'll be using the code similar to examples located at this location:
    http://www.sitefinity.com/help/developer-manual/content-items-create.html

    I hope you'll find this information helpful. Let us know if there is anything else we can do for you.

    Kind regards,
    Ivan
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
    Answered
  3. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    04 Dec 2008
    Link to this post
    are there plans to extend the events manager to create events natively like

    event.startdate = date
    event.enddate = date

    etc? I realize that these are meta items and may change, but still, it would be convenient to think of events as "events" and not "content items".

    just an idea.. .thanks!
  4. Ivan
    Ivan avatar
    478 posts
    Registered:
    16 Jun 2015
    08 Dec 2008
    Link to this post
    Hello SelArom,

    yes, with the new GC API that is in works and should be released in Sitefinity 4.0 we will have much more streamlined API. This should result in a much cleaner objects and properties that will be strongly typed. I cannot really give you more details on this, because we are still in the design phase, but I see and acknowledge your point.

    I hope you'll find this information helpful. Let us know if there is anything else we can do for you.

    Regards,
    Ivan
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Register for webinar
4 posts, 1 answered