OL Blog's profileThe Microsoft Office Liv...BlogLists Tools Help

Blog


    January 19

    The Microsoft Office Live Contact Map sample code

    The Microsoft Office Live Contact Map sample code

    The Microsoft Office Live team has created some sample code to show off just one way that you can use Microsoft Office Live Web services to create a mashup that extends the functionality of an Office Live business application. The first one we’re releasing is called Microsoft Office Live Contact Map.

    This mashup takes advantage of the Microsoft Virtual Earth platform, which is a next generation mapping and location service. Once you know how to combine the Virtual Earth mapping data with data from Office Live, the possibilities are endless.

    The Contact Map sample uses one of the business applications, Business Contact Manager, which is a light Customer Relations Manager tool.  This application is available with any Office Live Premium or Office Live Essentials subscription. The Contact Map creates a map control that allows you to display the location of contacts from the Business Contact Manager Contacts list on a map provided by Virtual Earth.

    Look at the end result

    The best way to understand the functionality is to install it on an Office Live business application. The download is an executable file that includes everything you need, including a sample page containing a Web Part displaying the map, so that you can quickly see the results of the code. Here’s all you need to do to check it out.

    1.      To download the exe, go to the Microsoft Download Center.

    2.      Click the .exe file to install the Contact Map files to the following location:

     C:\Microsoft Office Live Developer Resources\Contact Map Sample

    3.      Upload the files to a document library in a business application. For example, you can put the files in the Business Documents library of Business Contact Manager.

    4.      In the documents library, click “samplepage.”

    This Sample Web page opens in the business application, with a Page Viewer Web Part displaying the Contact Map. The right side of this Web Part includes a check box for each of the contacts from Business Contact Manager that specify a business address. Select the check box beside each of the contacts that you want to appear on the map and a pushpin appears at that contact’s address.

    The Contact Map 

     

    How it works

    There are several functions in the maps JScript file that combine to make this mashup.

    Set up a map

    The getMap function initializes a Virtual Earth Map (VEMap) object.

    Get contacts to be added to the map

    The getContacts function uses the Microsoft Windows SharePoint Services version 3.0 Web service to get the list of contacts from the specified context. In this sample, the context is Office Live Business Contact Manager (WEBBCM).

    This is an important piece of code for you to examine.  It is a reference you can use to model your own calls to the Windows SharePoint Services Web services hosted by Office Live.  These services give you access to the lists in the various Office Live business applications, such as the Contacts list used in this example.  You can read data from the list, insert, update and delete records, and much more. 

    We’ve already done the work of putting JScript functions together to package up the SOAP requests you need to talk to Office Live Web services. You can use these same functions from the common JScript (olsharedlibv1.js) file to jump start your development work. 

    Add and remove contacts on the map

    When the Contact Map page is first loaded, we retrieve the contacts that include address information by using Windows SharePoint Services Web services. We cache each contact as an object in the browser’s memory. When the addContactToMap function is called, we pass the address information from the contact object of the selected contact into the Virtual Earth API to add a pushpin on the map in the right location.  We cache the Virtual Earth pushpin object into this contact object. When you cancel the selection of a contact, the removeContactFromWeb function simply calls back out to the Virtual Earth API and passes the object to remove the pushpin.

    Go to town

    This is just a quick example of the type of services you can add to your client’s Office Live Premium or Office Live Essentials subscription. The Web services provided by Windows SharePoint Services and Virtual Earth combine to provide an impressive visual representation of the client’s data.  The common JScript functions help you accomplish this with minimal effort.

    To learn more about the Web services offered by Windows SharePoint Services, download the Windows SharePoint Services 3.0 SDK.

    To learn more about which Windows SharePoint Services Web services are supported by Office Live, read the Office Live Developer’s Guide.

    To learn more about Microsoft Virtual Earth, read the Virtual Earth Interactive SDK.

     The Office Live Developer Platform team

    Comments (4)

    Please wait...
    Sorry, the comment you entered is too long. Please shorten it.
    You didn't enter anything. Please try again.
    Sorry, we can't add your comment right now. Please try again later.
    To add a comment, you need permission from your parent. Ask for permission
    Your parent has turned off comments.
    Sorry, we can't delete your comment right now. Please try again later.
    You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
    Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
    Complete the security check below to finish leaving your comment.
    The characters you type in the security check must match the characters in the picture or audio.
    OL Blog has turned off comments on this page.
    May 26
    OL Blogwrote:
    Thanks for the comments and help altArtifact
     
    The DEEP program? yes, I did follow up on that and I believe you also received a note, it has not started yet but when it does you are in if you are interested.
     
    Filiberto Selvas
    Jan. 29
    Artwrote:
    PS. Live Spaces is really shaping up to be something. Gee wiz! The ad that was displaying above earlier made me explore it a bit further. Nice Work! Good ad design too - whoever did it.
    Jan. 23
    Artwrote:
    Well, lo and behold. You guys are speaking again.
     
    BTW, it's nice to see a little help being given to a few people on the Office Live message boards as there are so many struggling along with problems that only you can answer. We brave and few who try to help will keep plodding along and we hope you will fix a few things while we plod.
    How's that Deep program going? Oh yes, I'm not supposed to ask that.
     
    All the Best,
    altArtifact
     
    Jan. 22

    Trackbacks

    The trackback URL for this entry is:
    http://officeliveblog.spaces.live.com/blog/cns!7A0018FE70A946FB!494.trak
    Weblogs that reference this entry
    • None