Geeks With Blogs

Lance's TextBox

Step three:

  Paste in the following RSSBus Web Part template, and click "Apply".

<rsb:info title="Google Calendar Sync" description="This template Syncs your SharePoint Calendar events with those in a Google Calendar account.">
  <input name="email" description="The email used to authenticate with Google." required="true"/>
  <input name="password" description="The password used to authenticate with Google." required="true" style="password"/>
  <input name="calendar" description="The SharePoint calendar to sync to." default="Calendar"/>
  <input name="days" description="The number of days to import events for." default="30"/>

<rsb:import lib="RSSBus.GoogleOps"/>

<!-- get all the events in the SharePoint calendar -->
<rsb:set attr="list" value="[[calendar]]"/>
<rsb:call op="spListItems" out="myitemout" save="myspitems" >
    <rsb:call op="spGetItem?itemid=[[sp:id]]" >
      <rsb:set attr="myitemout.title" value="[[sp:title]]"/>
      <rsb:set attr="myitemout.location" value="[[sp:location | def('')]]"/>
      <rsb:set attr="myitemout.start_time" value="[[sp:start_time]]"/>
      <rsb:set attr="myitemout.end_time" value="[[sp:end_time]]"/>
      <rsb:set attr="myitemout.description" value="[[sp:description | def('')]]" />

<!--get all the events in the Google calendar in the specified range -->
<rsb:set attr="fromdate" value="[[null | date('d')]]"/>
<rsb:set attr="todate" value="[[fromdate | dateadd(day, [[days]]) | todate('d') ]]"/>
<rsb:call op="googleCalSearch" out="mygcalout" save="mygitems">
  <rsb:set attr="mygcalout.title" value="[[ggl:title]]"/>
  <rsb:set attr="mygcalout.location" value="[[ggl:where | def('')]]"/>
  <rsb:set attr="mygcalout.start_time" value="[[ggl:starttime | todate]]"/>
  <rsb:set attr="mygcalout.end_time" value="[[ggl:endtime | todate]]"/>
  <rsb:set attr="mygcalout.description" value="[[ggl:description | def('')]]"/>

<!-- now find out what is in google calendar that is not in the sharepoint list, using title and start time as the filter -->
<rsb:set attr="diff.base" value="[[_feeds.myspitems]]"/>
<rsb:set attr="diff.feed" value="[[_feeds.mygitems]]"/>
<rsb:set attr="diff.filter" value="title,start_time"/>
<rsb:set attr="diff.list" value="[[list]]"/>
<rsb:call op="feedDiff" in="diff">
  <!-- for everything not in the sp list, add it!  -->
  <rsb:set attr="name#" value="Title"/>
  <rsb:set attr="name#" value="Location"/>
  <rsb:set attr="name#" value="Start Time"/>
  <rsb:set attr="name#" value="End Time"/>
  <rsb:set attr="name#" value="Description"/>
  <rsb:set attr="value#" value="[[title]]"/>
  <rsb:set attr="value#" value="[[location | def('')]]"/>
  <rsb:set attr="value#" value="[[start_time]]"/>
  <rsb:set attr="value#" value="[[end_time]]"/>
  <rsb:set attr="value#" value="[[description | def('')]]"/>
  <rsb:call op="spAddItem"/>
  <b>[[title]]</b> Successfully imported from Google Calendar.<br>

Step four:  After you click Apply,

Posted on Wednesday, January 13, 2010 2:14 PM | Back to top

Comments on this post: Test PS Script Formatter

No comments posted yet.
Your comment:
 (will show your gravatar)

Copyright © Lance Robinson | Powered by: