Installing Application Definition in MashPoint: HitsLink Web Service Sample

In this article, we will create the Application Definition and configure MashPoint to get data from the Hitslink Web Service. HitsLink (http://www.hitslink.com/) is a service that provides web site analytic services, much like Google Analytics. If you are using Hitslink services, they provide a web services that you can query data programmatically. This article provides a step-by-step on how to get it done through our MashPoint and ADF

For an overview of MashPoint, see this article.

 

Step 1: Create HitsLink Account

First, you need to sign-up an account on the Hitslink’s developer site, which you can do here. We will use username/password to be able to use the Hitslink Web Service.

9-11-2008 3-15-57 PM

Step 2: Download and Install MashPoint and BDC Editor

This use case requires MashPoint, which you can download and get an overview from our web site here. For this use case, we will use the Microsoft’s BDC Editor application to create the Application Definition File, which you download from here.

Step 3: Connect to HitsLink Web Services

Run the BDC Editor, and then click on Add LOB System -> Select “Connect to Webservice”, and enter the HitsLink web services url (http://www.hitslink.com/reportws.asmx), and then click on “Connect” button.

9-11-2008 3-29-26 PM

HitsLink provides 3 different methods of getting data. In this article, I only use the “GetDataFromQueryString” method. Let’s drag and drop “GetDataFromQueryString” method to Design Surface, and then click on the “OK” button.

9-11-2008 3-30-18 PM

Next, we will add our method to get the desired data. Expand the Entities node from the tree, go down to the Instance node unser the GetDataFromQueryString method. Right click on the Instance node and select “Add Method Instance”, as shown in this figure below:

9-11-2008 3-31-10 PM

Select method instance type “Finder” on the properties window.

9-11-2008 3-32-16 PM

Next, set default value for parameters by click on “DefaultValues” property and enter your user name and password. Enter the query id of 15, which is the report on the Unique Visitor History:

9-11-2008 3-34-46 PM

How to get correct ID of report you need? You need to sign-in to the Hitslink here and click on report that you want to see then take a look on address bar. For example, reportid=15 is the “Unique Visitor History” report and reportid=9 is the “Page View History”.

9-11-2008 2-57-18 PM

Now, you can right click and try to execute MethodInstance, but there will be an error since Hitslink’s backend returned a data structure that is incompatible with Microsoft’s BDC. But this ADF will works within MashPoint.

Right click on the root node and export the Application Definition File to disk:

9-11-2008 3-01-52 PM

Step 4: Edit the ADF file.

Before you can use the ADF file in MashPoint, you must do some minor editing. Open up the Application Definition just export in your favorite XML editor or any other tools, and search and delete the following content section.

<TypeDescriptor TypeName="BDC.Row[],Hitslink" IsCollection="true" Name="Rows"> <TypeDescriptors> <TypeDescriptor TypeName="BDC.Row,Hitslink" Name="Item"> <TypeDescriptors> <TypeDescriptor TypeName="BDC.Column[],Hitslink" IsCollection="true" Name="Columns"> <TypeDescriptors> <TypeDescriptor TypeName="BDC.Column,Hitslink" Name="Item"> <TypeDescriptors> <TypeDescriptor TypeName="System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Name="Value" /> </TypeDescriptors> </TypeDescriptor> </TypeDescriptors> </TypeDescriptor> </TypeDescriptors> </TypeDescriptor> </TypeDescriptors> </TypeDescriptor>

Add the following content to position the section just delete.

<TypeDescriptor TypeName="Bamboo.Bda.ApplicationRegistry.SystemSpecific.Adaptors.RowColumnAdaptor" IsCollection="true" Name="Rows">
<Properties> <Property Name="Column" Type="System.String">Value</Property> </Properties>
<TypeDescriptors>
  <TypeDescriptor Name="Columns" TypeName="System.Data.DataRow">
  <TypeDescriptors>
    <TypeDescriptor Name="Day" TypeName="System.String" />
    <TypeDescriptor Name="Page Views" TypeName="System.String" />
    <TypeDescriptor Name="Unique Visitors" TypeName="System.String" />
    <TypeDescriptor Name="Monthly Uniques" TypeName="System.String" />
    <TypeDescriptor Name="New Visitors" TypeName="System.String" />
    <TypeDescriptor Name="Page Views Prior Period" TypeName="System.String" />
  </TypeDescriptors>
  </TypeDescriptor>
</TypeDescriptors>
</TypeDescriptor>

Note: The statement <Property Name="Column" Type="System.String"> specifies Field/Property to access in the columns enumeration of the report data.

Note: Make sure these type descriptor contains the report names are correct because each of report have different fields name. You can view them by edit column options on report as shown below.

9-11-2008 3-45-42 PM

Continue to search and replace the following text ReturnTypeDescriptorName="Return", and change it to ReturnTypeDescriptorName="Rows".  Delete the following text ReturnTypeDescriptorLevel="0".

Save the file. Now it's time to upload it into MashPoint.

Step 5: Upload ADF to MashPoint.

Open up your Bamboo Shared Service in Central Admin and select "Import application definition".

9-11-2008 3-48-41 PM

Browse to the ADF file that you just modified and select "Import".  After the application has been imported, you will see this page:

9-11-2008 3-50-49 PM

You should also see a listing of the entities as defined in the application definition. In this sample we have one entity, and if you click “Entity1”, you will see additional information about that entity. Let's look at the “Entity1” entity.

9-11-2008 3-52-22 PM

In this view you see should see all the fields that we defined earlier for “Entity1” entity, including Day, Monthly Uniques, New Visitors, Page Views, Page Views Prior Period and Unique Visitors.

You can now display the data in your SharePoint site using the Bamboo Data-Viewer Web Part. Instructions to install the Bamboo Data-Viewer Web Part with MashPoint can be found here.  Once the Web Part is installed, you can configure the connection to MashPoint as shown here:

9-11-2008 3-55-06 PM

You have many more settings in the Data-Viewer Web Part that I won't describe here. A list of available features is available in the Application Notes which are available here or part of the installation program that you downloaded earlier.

We have completed the configuration of the Web Part, so click "OK" and exit Edit mode. You should see the Data-Viewer Web Part displaying data from the Hitslink.

9-11-2008 3-58-15 PM

 You can download the entire sample ADF file here.

References:


Posted Sep 11 2008, 05:02 PM by Hien Nguyen
Filed under: , ,

Blogs

    MashPoint - A Breakthrough in SharePoint Data Integration
  • Home
  • Contact

Download MashPoint Now!

MashPoint - Data Integration for SharePointDownload the official MashPoint release, available as of November 7th, 2008.

Jonas Nilsson Q&A

Bamboo Solutions Corporation, 2002-2009