Lightning Tools Blog

SharePoint Tools, Web Parts and Discussions

Lightning Storm Forums release 1.0.0.14

Isn’t it funny how requirements are like London buses and always come along 3 at a time. The Storm Forums have been out for around 18 months now and from original release users needed to have Contributor site permissions or above to be able to create new topics and replies. This seemed good to us as we envisioned the forums being used mostly in collaboration environments. We use 7 lists for the forums – most of which are hidden, so we decided to use permissions at the Site level rather than having to set them at 7 different places.

All was good until around 2 months ago we had 4 different companies come to us and say they wanted users with Read-Only site permissions to be able to create new replies + topics. When 1 person suggests a feature you take note, but when 3 or 4 mention it in such a brief period of time you understand it is something worth implementing – so that is what we have done.

If you download the latest version of the forums in the web part toolbar properties you’ll notice two new checkboxes:

image

Now you can choose exactly what Read Only site users can do. You can decide if you want them to be creating new topics, or just replying to existing ones.

If you are an existing customer you can get the new version from the Downloads page after logging in, or pick up the trial from the Storm Forums homepage.

Let us know your feedback once you’ve tried it, and remember if you have an idea make sure you shout it over to us :-)

<nick/>

How to connect SharePoint BDC to Oracle through TNS

In this walkthrough we will demonstrate how to integrate Oracle with Microsoft SharePoint through the Oracle Transparent Network Substrate (TNS) and display Oracle data on SharePoint page. In order to do that we will describe how to create application definition files for the Business Data Catalog by means of BDC Meta Man.

There are one articles which we are going to reference to. It describes Business Data Catalog - getting started

This walk through only applies to BDC Meta Man 4.0.0.7 and later.

  1. Prerequisites.
    • First of all we should have tnsnames.ora file. It can be taken from a machine where Oracle runs or you may create it manually. If you look at this post you may find detailed information regarding tnsnames.ora http://www.orafaq.com/wiki/Tnsnames.ora In our case a file will look as follows (for example) and we will put it to “D:/Work” folder:

      XE_ORION =
        (DESCRIPTION =
          (ADDRESS = (PROTOCOL = TCP)(HOST = Orion)(PORT = 1521))
          (CONNECT_DATA =
            (SERVER = DEDICATED)
            (SERVICE_NAME = XE)
          )
        )

      ORCL_CYGNUS =
        (DESCRIPTION =
          (ADDRESS = (PROTOCOL = TCP)(HOST = Cygnus)(PORT = 1521))
          (CONNECT_DATA =
            (SERVER = DEDICATED)
            (SERVICE_NAME = ORCL)
          )
        )

    • Since BDC MetaMan uses Oracle Data Provider for .NET (ODP.NET) in order to connect to Oracle database so you should have ODP.NET installed on the machine where BDC Meta Man runs. In order to do that you should install Oracle Database 10g Express Client. It can be found here http://www.oracle.com/technology/software/products/database/xe/htdocs/102xewinsoft.html After that please make sure that you have installed ODP.NET. In order to do that open “C:\Windows\assembly” folder and find Oracle.DataAccess assembly.

      Oracle.DataAccess assembly x64
    • If SharePoint and BDC Meta Man are running on different machines you should also have ODP.NET installed on the machine where SharePoint runs. In order to do that just install Oracle Database 10g Express Client on this machine. But if you are using SharePoint on a 64 bit operating system you should install ODP.NET x64 bit. You may find it in Oracle Database 11g Release 1 Client (11.1.0.6.0) for Microsoft Windows (x64) which can be download here http://www.oracle.com/technology/software/products/database/oracle11g/111060_win64soft.html It’s sufficient to install only ODP.NET from Oracle client. A step of Oracle client x64 installation process is shown below. After that please make sure that you have installed x64 version of ODP.NET. In order to do that open “C:\Windows\assembly” folder and find Oracle.DataAccess assembly for x64 platform.
      Oracle Data Provider x64 for .NET

      [ Please click the image for a larger view ]

      Oracle.DataAccess assembly x64
    • If you are using BDC Meta Man on a 64 bit operating system when connecting to Oracle you may be prompted with the error: “ORA-06413: Connection not open”. This seems to be a problem with Oracle and any application installed in a directory that has brackets "()" in it (you may find a description here http://itknowledgeexchange.techtarget.com/itanswers/solution-for-ora-6413-error-showinh-connection-not-open/). If you check BDC Meta Man may be installed at: “C:\Program Files (x86)\BDC Meta Man”. The solution to get around this is to change the default installation path to something like: “C:\BDC Meta Man”
  2. Now open BDC Meta Man and select menu Configuration->Settings

    Menu Configuration->Settings
  3. In the “Configuration Options” dialog select “Oracle” item in the left list box, click “Browse” button, point tnsnames.ora file location and click “Save” button

    Point tnsnames.ora file

  4. Now we should click the drop down menu “Connect to data source” and select “Oracle” menu item.

    Select Oracle menu item

  5. After that we are able to select Oracle database from a drop-down list on "Connect to Data source" dialog and enter user name and password.

    Select Oracle database and type username and password

  6. After clicking "Connect" button BDC Meta Man will now connect to your Oracle data source and display the database. Expand the database you have connected to so you can see all the tables available for you to use. All the next steps about how to display the data on SharePoint page are described in Business Data Catalog - getting started article in details. We will walkthrough briefly.

    All Oracle tables are available to use

  7. Drag and Drop one table onto Design Surface. Upon dragging and dropping the table, the entity is created with the Finder, SpecificFinder and IdEnumerator methods.

    Drag and Drop one table onto Design Surface

  8. Open menu item Configuration->Settings in order to set the path to save our Oracle application definition file.

    Set the path to save application definition file

  9. Click “Generate” button on BDC Meta Man toolbar. If everything is ok then we will see this message.

    Oracle application definition file has been created

  10. Import generated application definition file to SharePoint 2007, add Business Data List web part and configure it by selecting just imported Business Data catalog Entity (Business Data Catalog - getting started article describes in details how to do that). Now we will be able to see Oracle data on SharePoint page. 

    Oracle data on SharePoint page

We hope this walkthrough will be useful for you. If you have any questions feel free to email them to support@lightningtools.com.

<dmitry/>

Lightning Conductor Calendar View

The Lightning Conductor is a cross site collection roll up web part that allows you to aggregate content from lists or libraries from any site collection within the current web application.

The Lightning Conductor Web Part has always provided three views to see the content; Default View (The default list view will display), SPGridView (Select your own columns for display without modification to any XML or XSL), and the XSL view which does allow you to design your own view. We have sample XSL files built into the web part, and also some are available from the support section within our site: http://www.lightningtools.com/lightning-conductor-web-part/custom-xsl-style.aspx

Our customers have requested a Calendar view for displaying Calendar List Items and Task List items. Lightning Tools has therefore built a new XSL file which can simply be uploaded to the style gallery via the web parts property pane.

The new calendar view provides you with Day, Week and Month view, and color coded entries depending upon the status of a task.

To begin using the new Calendar view:

1.If you haven’t already, download and install the Lightning Conductor Web Part.

2. Add the Lightning Conductor Web Part to your page.

3. Open the toolpane by clicking on the open the toolpane link.

4. Choose the source by selecting Sites, Site Collections, All Site Collections or specific Lists.

Lightning Conductor Web Part Source

6. In the view section, select ‘Chosen XSL File’

7. Click the browse button, and upload the XSL file.

8. Click Ok.

The Calendar List items display as shown below:

The Tasks list items show as below. The Tasks in green are completed, the red are deferred and the purple have not started. It is possible for you to further customise the XSL and change these colors to suit your own requirements.

You can download the Calendar View XSL File amongst the other XSL files from: http://www.lightningtools.com/lightning-conductor-web-part/custom-xsl-style.aspx

</Brett>

Using Filters and the Business Connectivity Services object model

In our last blog post we covered how to use the Business Connectivity Services object model on the server to connect to BCS services metadata store, retrieve information about the lob systems, external content types, methods and how to execute a method of an external content type.

Executing BCS External Content Type Methods in C#

In this blog post we will demonstrate how to execute an external content type’s finder method which has a filter defined

1, Using SharePoint Designer 2010 create a new External Content Type using the Employees table from AdventureWorks2000. Setup a filter for this ECT against the First Name column

image

[click image for a larger view]

Notice that we have ticked the checkbox for ‘Ignore filter if Value is:’

2, Open up Visual Studio 2010 and create a new Visual Web Part project from within the SharePoint 2010 project section.

3, With the web parts user control in design mode add some text saying ‘First Name :’ and drag n drop a textbox and button on, setting the textbox ID to be FirstNameTextbox and the button ID to be SearchButton. Finally add a GridView so that your user control looks something similar to…

image

4, We need to add a reference to Microsoft.BusinessData.dll, right click on the References folder in Solution Explorer and choose Add Reference. Browse to the dll at

c:\program files\common files\microsoft shared\web server extensions\14\ISAPI\Microsoft.BusinessData.dll

5, Open the code view of our user control - VisualWebPart1UserControl.ascx.cs, and add the following using statements…

using Microsoft.SharePoint.BusinessData;
using Microsoft.SharePoint.BusinessData.SharedService;
using Microsoft.BusinessData.MetadataModel;
using Microsoft.BusinessData.Runtime;
using Microsoft.SharePoint.Administration;
using Microsoft.BusinessData.MetadataModel.Collections;
using Microsoft.SharePoint.BusinessData.Runtime;
using System.Data;

6, Add the following method…

private void executeFilterMethod()
{

    // get the catalog of entities to work with...
   
BdcService service = SPFarm.Local.Services.GetValue<BdcService>();
    IMetadataCatalog catalog = service.GetDatabaseBackedMetadataCatalog(SPServiceContext.Current);

 

    // get the Employee external content type...
    IEntity entity = catalog.GetEntity("http://localhost", "Employees");

    // get the filters for the default Finder method
    IFilterCollection filters = entity.GetDefaultFinderFilters();

    // if FirstNameTextbox has a value set the filter value...
    if (FirstNameTextbox.Text != string.Empty)
    {
        WildcardFilter filter = (WildcardFilter)filters[0];
        filter.Value = FirstNameTextbox.Text;
    }

    // return the filtered data using the default Finder method...
    IEntityInstanceEnumerator enumerator = entity.FindFiltered(filters, entity.GetLobSystem().GetLobSystemInstances()[0].Value);

    DataTable table = null;

    // loop through the data returned
    while (enumerator.MoveNext())
    {
        // first time setup the datatable, everytime there after add a row...
        if (table == null)
            table = enumerator.Current.EntityAsDataTable;
        else
            enumerator.Current.EntityAsDataRow(table);       

    }

    // bind data to our GridView...
    GridView1.DataSource = table;
    GridView1.DataBind();

}

7, Double click on the button on our user control to add a click event handler, and simply call the method above we defined

protected void SearchButton_Click(object sender, EventArgs e)
{
    executeFilterMethod();
}

8, That is all the code we have to write, we can now press F5 and Visual Studio will deploy the wsp to our site.

When SharePoint opens put the web page into edit mode and insert a web part. You’ll find in the Custom web part category VisualWebPart1. When you add this you can click the Button, and you’ll be returned all the data from the Employees External Content Type, or enter a first name such as Michael and you’ll see just those matching results coming back:

image

Check back again soon as we’ll be writing plenty more about how to use the BCS object model.

<nick/>

Executing BCS External Content Type Methods in C#

In our previous blog post we have gone through how to use the Business Connectivity Services object model to retrieve information about external content types which have been deployed to SharePoint’s Business Connectivity Services.

In this blog post we will show you how to get the Business Connectivity Services methods collection for an external content type and execute the finder and specific finder methods with Business Connectivity Services object model.  

Please follow the steps 1 to 5 that are described in our previous blog post to create a simple Visual Web Part and add appropriate references and using statements.

Connect to BdcService and GetEntities

When you have the visual web part created follow the steps below to get you working with external content type’s methods via Business Connectivity Services object model.

1) Add the following using statement to your visual web part’s source code. This namespace allows us to use KeyValuePair class

using System.Collections.Generic;

2) Change Page_Load method, so now it should call the new method to execute external content type’s methods.

protected void Page_Load(object sender, EventArgs e)

    // GetExternalContentTypesAndLobSystems(); 
    EnumerateAndExecuteExternalContentTypeMethods();
}

3) Now, lets define the new method, which should enumerate the methods of an external content type and executes the finder and specific finder methods.

Here is the code of the new method.

private void EnumerateAndExecuteExternalContentTypeMethods()
{
    // Get reference to BDC Service 
    BdcService service = SPFarm.Local.Services.GetValue<BdcService>();

 

    // Get MetaData Catalog 
    IMetadataCatalog catalog = service.GetDatabaseBackedMetadataCatalog(SPServiceContext.Current);

    // Get entity with appropriate namespace and name 
    IEntity entity = catalog.GetEntity("http://win-74y1750o0mq", "Employee");

    // Some heading for the literal control 
    Literal1.Text = "<h1>" + entity.Name + " Methods</h1> " + "</br>";

    // Some variable for finder and specific finder methods' records 
    int finderMethodRecordsCount = 0;
    string strFirstName = "";

    // Get methods collection 
    foreach (KeyValuePair<string, IMethod> method in entity.GetMethods())
    {
        // Show methods name 
        Literal1.Text += method.Key + ",";

        // Get current method's instance 
        IMethodInstance methodInstance = method.Value.GetMethodInstances()[method.Key];
        if (methodInstance.MethodInstanceType == MethodInstanceType.Finder)
        {

            // Execute finder method 
            IEntityInstanceEnumerator ieie = entity.FindFiltered(method.Value.GetFilters(methodInstance), entity.GetLobSystem().GetLobSystemInstances()[0].Value);

            // Count records count 
            while (ieie.MoveNext())
            {
                finderMethodRecordsCount++;
            }
        }

        // Execute specific finder method. 
        if (methodInstance.MethodInstanceType == MethodInstanceType.SpecificFinder)
        {
            // Identity value 
            int i = 1;

            // Create new identity 
            Identity identity = new Identity(i);

            // Execute specific finder method and get the entity instance 
            IEntityInstance entInstance = entity.FindSpecific(identity, entity.GetLobSystem().GetLobSystemInstances()[0].Value);

            // Show the first name of the entity instance returned by specific finder 
            strFirstName = entInstance["FirstName"].ToString();
        }
    }

    Literal1.Text += "<br/> Finder method's retrieved records count  = " + finderMethodRecordsCount.ToString();
    Literal1.Text += "<br/> Specific finder method's returned instance's first name is " + strFirstName;
}

 

We’ll now go through the important lines of code individually so we can explain a little more about them…

4) Firstly we need to get the BdcService, metadata catalog and then external content types via the Business Connectivity Services object model.

In this example we have used Employee external content type with http://win-74y1750o0mq namespace.

    // Get reference to BDC Service 
    BdcService service = SPFarm.Local.Services.GetValue<BdcService>();

 

    // Get MetaData Catalog 
    IMetadataCatalog catalog = service.GetDatabaseBackedMetadataCatalog(SPServiceContext.Current);

    // Get entity with appropriate namespace and name 
    IEntity entity = catalog.GetEntity("http://win-74y1750o0mq", "Employee");

5) When you have the Employee external content type you can loop through all the methods available to you in that ECT

IEntity’s GetMethods function returns collection of KeyValuePair<string,IMethod>, where the key is the name of the method, and IMethod is the method itself.

    // Get methods collection 
    foreach (KeyValuePair<string, IMethod> method in entity.GetMethods())
    {
        // Show methods name 
        Literal1.Text += method.Key + ",";

6) When we loop through the methods available to us we need to check the MethodInstanceType value to figure out what type of method it is

    // Get current method's instance 
    IMethodInstance methodInstance = method.Value.GetMethodInstances()[method.Key];
    if (methodInstance.MethodInstanceType == MethodInstanceType.Finder)
    {

7) If this iteration returns the Finder method we should execute it, then we’ll simply loop through the records it returns so we can get a record count.

To execute the finder method we should call IEntity’s FindFiltered method.

First parameter of the FindFiltered method is the collection of the filters which we retrieve if we call the IMethod’s GetFilters method and pass the method instance as a parameter.

The second parameter of the FindFiltered method is the lob system instance, which we can retrieve if we call IEntity’s GetLobSystem, and then call GetLobSystemInstance. After all this is done we can iterate over the enumerator returned and increment our record counter.

    // Execute finder method 
    IEntityInstanceEnumerator ieie = entity.FindFiltered(method.Value.GetFilters(methodInstance), entity.GetLobSystem().GetLobSystemInstances()[0].Value);

    // Count records count 
    while (ieie.MoveNext())
    {
        finderMethodRecordsCount++;
    }

8) If our iteration returns the SpecificFinder method we need to execute it in a slightly different way. This is because the SpecificFinder method is always going to be expecting at last one parameter to be passed in (which will map to the identifier)

We need to create an Identity class instance and pass it as an argument to the IEntity’s FindSpecific method. The FindSpecific method’s first parameter should be identifier, and the second parameter is the lob system instance.

When the FindSpecific method is executed it returns an IEntityInstance instance

In our example we are hardcoding the value of the Identifier we are passing in (int i = 1), and simply getting the value of the field FirstName from the EntityInstance returned.

    // Identity value 
    int i = 1;

    // Create new identity 
    Identity identity = new Identity(i);

    // Execute specific finder method and get the entity instance 
    IEntityInstance entInstance = entity.FindSpecific(identity, entity.GetLobSystem().GetLobSystemInstances()[0].Value);

    // Show the first name of the entity instance returned by specific finder 
    strFirstName = entInstance["FirstName"].ToString();

9)  When you have finished editing the code  press CTRL+F5 to deploy to your SharePoint site.

10) Edit the page of your SharePoint site, and add the Visual Web Part that we have been developing.

You can find it in Custom section.

It should display the external content type’s methods’ names, records count retrieved by the Finder method, and First Name of the employee returned by specific finder method.

BCS object model web part

<hrayr/>

RootFinder Property – BCS Search

When we were using the Business Data Catalog it was relatively straight forward to setup your Entities so that SharePoint could crawl and return them in search results. Your Entity had to implement a SpecificFinder and IDEnumerator method. With Business Connectivity Services and SharePoint 2010 there are a number of ways to accomplish this goal such as

- Finder, SpecficFinder and RootFinder property

- SpecificFinder and IDEnumerator

How the Business Data Catalog did Indexing

As we have said the SharePoint indexer made use of the SpecificFinder and IDEnumerator method to crawl your BDC data. The IDEnumerator is the first method that is executed and the job of this was simply to return the identifier values that SharePoint was to crawl. If our entity had a field that represented when the row of data was last modified you could also return this in the IDEnumerator and set the property __BdcLastModifiedTimestamp. We have a great article on our web site that explains this in more detail:

Business Data Catalog incremental crawls and how to test.

The RootFinder property

Now we are working with SharePoint 2010 and the Business Connectivity Services the RootFinder property allows you to have an External Content Type that is searchable without having to implement an IDEnumerator method. If you take a look at SharePoint Designer 2010 there is no option to create specifically an IDEnumerator method

image

However if we create an External Content Type using SharePoint Designer 2010 it is possible to setup a content source to crawl it and display it in search results. If you export the BCS model from SharePoint Designer 2010 you’ll be able to find out why. To do this:

1, Click on the External Content Types view in SharePoint Designer 2010 when you have connected to your SharePoint site

2, Right click on the External Content Type and choose Export Application Model from the menu

image

3, Give the model a name, and then select a file location to save it

If you take a look at the XML, find the Read List method and locate the MethodInstance element

<MethodInstances>
    <MethodInstance Type="Finder" ReturnParameterName="Read List" Default="true" Name="Read List" DefaultDisplayName="Products Read List">
        <Properties>
            <Property Name="UseClientCachingForSearch" Type="System.String"></Property>
            <Property Name="RootFinder" Type="System.String"></Property>
        </Properties>
        <AccessControlList>
        …………

        </AccessControlList>
    </MethodInstance>
</MethodInstances>

Notice that this method is labeled to be used as the RootFinder. This means this Finder method will be used in the same way the IDEnumerator is.

<nick/>

Connect to BdcService and GetEntities – BCS Object Model

In this walkthrough we will show you how to connect to BCS Service and retrieve basic information about BCS External Content types which have been already deployed.

We will create a visual web part with a very simple user interface, and will use BCS Object Model within that web part’s source code.

1) Open up Visual Studio 2010 and create new Visual Web Part project.

Create SharePoint project

[click the image for a larger view]

2) Edit the user control in the designer and add literal control from the toolbox. We will use this simple user interface and literal control to display some information later.

Add literal control

3) Next we need to add a reference to Microsoft.BusinessData assembly. In the solution explorer right click on the References and select Add Reference.

Add Reference to Project

4) In the Add Reference dialog, go to Browse tab and browse to C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\ISAPI. Add the Microsoft.BusinessData assembly.

Browse to the SharePoint directory

5) View the code of Visual web part’s user control (VisualWebPart1UserControl.ascx.cs) and add the following namespaces.

using Microsoft.SharePoint;
using Microsoft.SharePoint.BusinessData;
using Microsoft.SharePoint.BusinessData.SharedService;
using Microsoft.BusinessData.MetadataModel;
using Microsoft.BusinessData.Runtime;
using Microsoft.SharePoint.Administration;

6) Add the following method just under the Page_Load method.

private void GetExternalContentTypesAndLobSystems()
{
    // Get reference to BDC Service
   
BdcService service = SPFarm.Local.Services.GetValue<BdcService>();

    // Get MetaData Catalog
   
IMetadataCatalog catalog = service.GetDatabaseBackedMetadataCatalog(SPServiceContext.Current);

    // Some heading for the literal control
   
Literal1.Text = "<h1>Lob Systems and Entities ... </h1> " + "</br>";

    // Get all the external content types from the meta data catalog
 
   foreach (IEntity ect in catalog.GetEntities("*"))
    {
        // Add external content type's name and appropriate lob system name to the literal control
 
       Literal1.Text += ect.Name + "," + ect.GetLobSystem().Name + "</br>";
    }

}

We have put some comments in the code which will help you to understand what we have used to a list of external content types, but now we will explain in more details. Methods used in this sample have overloads too, but we will refer only to ones which are used in this code snippet.

First of all we need to get reference of BdcService, and we need to use SPFarm’s services for that.

BdcService service = SPFarm.Local.Services.GetValue<BdcService>();

Next, we should get the MetaData catalog which contains our deployed external content types. To do that, we have used BdcService’s GetDatabaseBackedMetadataCatalog method, this expects service context as a parameter. Cause, the code is executed within the visual web part, we can use current service context.

IMetadataCatalog catalog = service.GetDatabaseBackedMetadataCatalog(SPServiceContext.Current);

Once we have the metadata catalog reference, we can retrieve information about the deployed external content types. IMetaDataCatalog interface contains GetEntities method, which expects a wildcard parameter as an input, and based on that parameter it retrieves an enumerable collection of IEntity type objects. We have used “*” parameter to retrieve all the external content types.

foreach (IEntity ect in catalog.GetEntities("*"))

When we have an IEntity object, we can use its Name property and also call GetLobSystem() method to get the lob system of the external content type.

Literal1.Text += ect.Name + "," + ect.GetLobSystem().Name + "</br>";

7) Call the new added method from Page_Load method of the visual web part’s user control.

protected void Page_Load(object sender, EventArgs e)
{
    GetExternalContentTypesAndLobSystems();
}

8) Now, when everything is done, rebuild the project and press CTRL+F5 to deploy the visual web part.

9) Go to your SharePoint site, click on Page ribbon on the top , and then click on Edit button.

 

Edit the page

10) When the page is edited, click on Insert ribbon and then on Web Part button.

Add Web Part

11) In the categories section select the Custom group, and you’ll find VisualWebPart1 there. Add it to page.

Select the Custom group

12) When web part is added to a page, it will execute Page_Load method, which will call our GetExternalContentTypesAndLobSystems method, and appropriate external content types, lob systems names will be displayed.

BCS entities are displayed

 

In the coming posts we’ll be going into much more detail and doing some cool things in C# code with BCS data

<hrayr/>

Lightning Tools at SPTechCon

Brett Lonsdale from Lightning Tools hosted the booth at this years SPTechCon.  SPTechCon was a great success and everyone who attended commented on the quality of all the speakers and the sessions. 

Brett Lonsdale presented a class on Business Connectivity Services demonstrating the External Lists, EnterPrise Content Types, and how to build ECT's within SharePoint Designer 2010. The class lead into a presentation on Linq by Steven Fowler.

Following that Brett Lonsdale presented Building Business Data Catalog solutions.  We explored building solutions with Visual Studio Tools for Office while utilizing the Business Data Catalog Object Model, Building custom BDC web parts, and building WCF web services to host Line of Business Data.

The Lightning Tools booth was very busy within the exhibitor hall.  We presented our solutions on an overhead projector and got good feedback on DeliverPoint, The Lightning Conductor Web Part, BDC Meta Man and BCS Meta Man.  There was also huge interest in the BDC Alert Manager which allows you to configure alerts on your Line of Business data as well as SharePoint Lists and Libraries.

This was the first time Lightning Tools had sponsored SPTechCon, and is looking forward to the Boston SPTechCon in October 2010. 

How to connect SharePoint Business Data Catalog to PostgreSQL

In this walkthrough we will demonstrate how to integrate PostgreSQL with Microsoft SharePoint Business Data Catalog through ODBC and display PostgreSQL data on SharePoint page. In order to do that we will describe how to create application definition files for the Business Data Catalog by means of BDC Meta Man.

There are one articles which we are going to reference to. It describes Business Data Catalog - getting started

  1. Open BDC MetaMan and click the drop down menu “Connect to data source”.
  2. Select “ODBC - Connection String” from the drop down menu.
    Select ODBC connection string
  3. We now have a textbox to enter our ODBC connection string and advanced properties. As we are using PostgreSQL so: 
    • our connection string should be Driver={PostgreSQL ANSI};server=<server name>;port=<port number>;database=<database name>;Uid=<user login>;Pwd=<password>;Trusted_Connection=yes;  For example in our case connection string looks like Driver={PostgreSQL ANSI};server=cygnus;port=5432;database=postgres;Uid=postgres;Pwd=test;Trusted_Connection=yes;
    • left and right delimiter symbols should be double quote
    • parameter symbol should be question mark ?
    PostgreSQL connection string
  4. BDC Meta Man will now connect to your ODBC data source and display the database. Expand the database you have connected to so you can see all the tables available for you to use. All the next steps about how to display the data on SharePoint page are described in Business Data Catalog - getting started article in details. We will walkthrough briefly.
    All PostreSQL tables available to use
  5. Drag and Drop one table onto Design Surface. Upon dragging and dropping the table, the entity is created with the Finder, SpecificFinder and IdEnumerator methods.

    Drag and Drop one table onto Design Surface

  6. Open menu item Configuration->Settings in order to set the path to save our application definition file.

    Set the path to save application definition file

  7. Click “Generate” button. If everything is ok then we will see this message.

    Application definition file has been created

  8. Import our application definition file to SharePoint 2007, add Business Data List web part and configure it by selecting just imported Business Data catalog Entity (Business Data Catalog - getting started article describes in detail how to do that). Now we will be able to see PostgreSQL data on SharePoint page.

    PostgreSQL data on SharePoint page

We hope this walkthrough will be useful for you. If you have any questions feel free to email them to support@lightningtools.com.

<dmitry/>

Lightning Tools Partner Program

We are rolling out our Partner Program during 2010. We are keen to develop relationships with consultancies that have a specialism in SharePoint.

Our aim is to provide you with training, knowledge and support with our products, the BDC and the forth coming BCS. Our research has found that consultants find it very difficult to find the time to keep up to date with products that are available to them that could save them and their client’s time and money. We will provide you initially with some online training (arranged for your convenience) to get you up and running. We will back this up with ongoing access to our knowledge base allowing you to contact us if you have any queries.

We will also provide you with a partner discount. Having said this, our products are keenly priced so the main benefit will be for you to have access to our well developed and focused products.

We will be limiting the number of partners as we do not want to find ourselves too busy to give you the support you require.

If you are interested in becoming one of our partners, please send me an email to arrange a call.

We look forward to hearing from you.

Richard

richard@lightningtools.com

Create Association Method for BCS Dot Net Assembly

In our previous blog posts we have demonstrated how to build up a BCS Model with Visual Studio 2010 and define BCS methods (Finder, Specific Finder, Id Enumerator, Creator and Updater) for the AdventureWorks database Department table.

In this blog post we are going to show you how to configure association between two BCS external content types created in the Visual Studio 2010 BCS designer. In the previous articles we have used the Department table, so Employee table is be the best choice for the second external content type and we’ll create association between the Department and Employee tables. Firstly, we need to create Employee BCS external content type, so please open the project which you use for Department external content type, and using exactly the same steps create Employee external content type. You don’t need to define all the methods, Finder and Specific finder methods are enough.

1) Make sure you define a Finder and SpecificFinder method for Employee an Employee External Content Type. You can use the BCS Data List Web Part and BCS Item Web Part to check if data is being retrieved properly. Here is how it should look like in BCS diagram in the Visual Studio 2010.

The Employee table contains lots of columns, in this example we have used EmployeeID, FirstName, LastName, Title, DepartmentId.

Create External Content Types

[click images for a larger view]

2) In Visual Studio 2010 view the toolbox and then click on the “Association”.

BCS Association component

3) Create an association between Department and Employee, so after you have clicked the Association in the toolbox, click on the Department and then on the Employee.

create BCS association

4) New dialog will be shown where you can configure association methods.

configure the BCS association

5) In the first section – Identifier mapping , you can map identifiers from the source entity to the destination entity, and in the second section you can add/remove association navigator methods. In our case we will remove the EmployeeToDepartment method and will leave only DepartmentToEmployee method.

remove the other association

6) Click “OK” button and it will create association between Department(Source) and Employee(Destination) BCS external content types.

See the association created on the design surface

7) Next we need to write the C# code for association method. Open DepartmentService.cs file and there you will find DepartmentToEmployee method. Replace the body of that method with the following C# code.

DataClasses1DataContext dcontext = new DataClasses1DataContext("server=localhost;database=adventureworks2000;uid=***;pwd=***"); Security=true");
IEnumerable<Employee> records = from record in dcontext.Employees
                                                            where record.DepartmentID == departmentId
                                                            select new Employee
                                                            {
                                                                EmployeeID = record.EmployeeID,
                                                                FirstName = record.FirstName,
                                                                LastName = record.LastName,
                                                                Title = record.Title,
                                                                DepartmentId = record.DepartmentID
                                                            };

return records;

8) Rebuild and deploy the solution by pressing CTRL+F5. Go to your SharePoint site and add a BCS Data List Web Part and BCS Related Data List web parts. Choose Department as the type for BCS Data List Web Part and Employee as the type for the related list web part, then make a connection between them so the BCS List Web part should send data to the Related list web part. When everything is done, you can select a Department record in BCS List web part and it will call the association method and show appropriate Employee records in the Related List Web Part.

Test out the association with the BCS web parts

 

<hrayr/>

Lightning Storm Forums for SharePoint – Feb 2010 release

We’ve just uploaded a new release of the Lightning Storm Forums. This has a couple of new features that have come directly from customer feedback:

Easier to delete topics

If you have the permissions to do so, you can now delete topics directly from within the topic view:

image

Previously you had to go into the forum management screens to delete an entire topic – now it is much easier.

Easier to sign up to alerts

When you create a new topic or reply you’ll have a checkbox that can allow you to sign up to be alerted of new posts:

image

Much easier now to setup alerts for topics you are interested in

Performance information available

If you think your forums are a little slow in loading, you can now select the option in the web part properties to see Debug Timing information

image

When viewing a topic, at the bottom you’ll now see information about how long each method call is taking. This makes it much easier for us to support you if you do have any performance problems.

 

You can download a Free Trial of the Lightning Storm Forums from it’s home page:

Lightning Storm Forums for SharePoint

 

If you are an existing customer login to the site and checkout the downloads area.

Oracle and the Business Connectivity Services

Previously we showed you in text how to connect the BCS to Oracle using BCS Meta Man:

Business Connectivity Service and Oracle with BCS Meta Man

Now we have a video to share with you! :-)

 

Hrayr will be auditioning for the role of Dr Evil in the next Austin Power movie! :-)

Creating Limit Filters in SharePoint Designer 2010

In this walk through we are going to show you how to create Limit Filters for your Business Connectivity Services External Content Types in SharePoint Designer 2010. These filters will let limit the amount of records being returned by your back end data source which will not only improve performance, but also make your users lives easier as they have less data to work with and process.

One important thing to note is that a Limit Filter on it’s own will just limit the items returned, this means that without another filter type you can only access a subset of your data. For example if you want to limit the amount of Products returned by a query to 100, you would add a Limit Filter and add another such as a Wildcard Filter, this will mean you will get a maximum of 100 Products which match the Wildcard filter returned. For information on how to add a Comparison or Wildcard Filter check out our blog post here: Creating Comparison and Wildcard filters for BCS in SharePoint Designer 2010

Pre-requisites..

  • SharePoint Designer 2010
  • A Data Source – We will be using the ‘AdventureWorks’ Products table

How to..

  1. Open SharePoint Designer
  2. Connect to your SharePoint Site
  3. Click on ‘External Content Types’ from the Site Objects list

    View External Content Types
  4. Click ‘External Content Type’ from the ‘New’ section of the ribbon
  5. Give your External Content Type a meaning full name – You just need to click on the existing text to edit

    Give your External Content Type a good name  --> External Content Type with the name set
  6. Click the link in the External Content Type Operations section to ‘discover external data sources and define operations’

    Add a new connection
  7. Click ‘Add Connection’ and choose ’SQL Server’
  8. Enter your connection credentials and click OK

    Enter the connection details
  9. Expand the tree view to show the ‘Products’ Table

    Expand to see your tables
  10. Right Click on the Table and choose ‘New Read List Operation’
  11. Change the ‘Operation Name’ and ‘Operation Display Name’ to “All Products and Information”, Click Next
  12. You will see that SharePoint Designer gives you a warning letting you know you should add a Limit Filer

    SharePoint Designer warns you about creating a Limit Filter
  13. On the ‘Filter Parameters Configuration’ screen click ‘Add Filter Parameter’

    Add a Filter Parameter  
  14. When the properties section display’s change the ‘Data Source Element’ to ProductID and click on ‘(Click to Add)’

     Map the Data Source Element
  15. Enter the Filter Information as the following. We are going to create a Limit Filter on the Product ID. A Limit Filter lets you choose the number of rows you want returned from the database

     Create Limit Filter
  16. Click ‘OK’
  17. Change the Default Value to 100 – 100 rows will be returned from the Database

    Set the default value
  18. *As per the note at the top of the page, normally you would add another Filter Type here*
  19. Click Finish
  20. Click ‘Save’

    Save the External Content Type
  21. The ECT will be saved to the BDC Metadata Store

    External Content Type will be saved to BDC Metadata Store
  22. Once the document has been saved we can navigate to our SharePoint Site
  23. Add a ‘Business Data List’ Web Part to your page

    Add Business Data List Web Part
  24. Click on the icon to bring up the ECT Picker
  25. Select the AdventureWorks Products ECT
  26. Click ‘OK’
  27. The web part will display the Product information, if you page through the results you will notice that it will only go to item 100.

    Paging of data is limited 

 

<phill/>

BCS Meta Man Alpha 2 released

As you may have seen from the content we have been posting up on the blog over the past 24 hours – BCS Meta Man Alpha 2 has been released. We’ve been working on this release for the past 8 weeks – it was supposed to be 6 but Christmas and New Year got in the way! :-)

Here are the new features available in this release:

Ability to upgrade MOSS 2007 BDC application definition files to SP2010 BCS models

Upscaling a BCS Model created in SharePoint Designer 2010 to a Dot Net Assembly project

Business Connectivity Service Models with Oracle

Creating BCS Actions in BCS Meta Man

and finally…

Creating BCS Filters using BCS Meta Man

We have screencasts of each area of new functionality that we’ll be posting up each day next week so make sure you are subscribed to our RSS feed!

 

Please download this free Alpha release from here:

BCS Meta Man Alpha Download

 

We’d love to hear your feedback on this release, what features we need to develop further, and how you are planning on using the BCS in SharePoint 2010. Feel free to email us at anytime at support@lightningtools.com to have a chat.

<nick/>

Create BCS Filters using BCS Meta Man

In this walkthrough we will demonstrate how to define BCS filters for BCS External Content Types in BCS Meta Man. As of BCS Meta Man alpha 2 (released 22nd Jan 2010) we support filters for SQL and Oracle. In this sample we will use SQL server, but you can use the same steps for Oracle and define filters for Oracle tables as well.

1) Open up Visual Studio 2010 and create a new empty SharePoint project.

Create an Empty SharePoint Project

2) Add a new BCS Meta Man item to your project.

Step2

3) When the BCS Meta Man diagram is open, in the menu bar click on BCS Meta Man-> BCS Meta Man Data Source Explorer

Open BCS Meta Man Data Source Explorer

4) When the Data Source Explorer is shown, click on the Add SQL Connection button.

Add SQL Connection

5) In the connection dialog, set the connection parameters to your SQL database. We use the AdventureWorks database for our walkthroughs.

Enter SQL Connection properties

6) If the connection is successful it will populate the explorer treeview with our databases that you can expand to show the tables available.

Data Source Explorer with tables

7) Drag and drop any two tables you want, in this walkthrough we use Employees and Product tables; we will define a comparison filter for the Product table and a Wildcard for Employee. Your diagram should look like this.

Create two External Content Types

8) Right click on the Employee table and choose Manage Entity.

Right click and choose Manage Entity

9) In the Entity Management dialog go to Methods tab and select the Finder method.

Go to Methods tab and select Finder method

10) Click on New button in the Filter section and configure a Wildcard filter for the Employee table’s Finder method. Click on Save button, and then Save the modifications.

Create a new Wildcard Filter

11) Using the above mentioned steps, define a Comparison filter for the Product table.

Create a new Comparison Filter

12) If you open the generated service c# classes, you’ll find that c# methods have been modified to accept input parameters that will be used to filter the data being returned

13) Rebuild the project and press CTRL+F5 to deploy the solution.

14) Go to your SharePoint site, and add two BCS List web parts. Set Employee as a type for one of them and Product as a type for the other BCS List web part.

Add 2 BCS List web parts to your page

15) Try to enter some filter values to display the records.

Configure and test your External Content Types with the filters

<hrayr/>

BCS Action created in BCS Meta Man

BDC Action are very powerful and popular in MOSS 2007. They allow you to link your Business Data to external urls such as Search Engines or other Enterprise Applications. In SharePoint 2010 you can define actions for BCS External Content Types and use them in BCS web parts the same way you do in MOSS 2007. You can get more information about BDC Actions from here

BDC Actions

SharePoint Designer 2010 and Visual Studio 2010 allow you to create BCS external content types. There is no support however to define BCS  within SharePoint Designer or Visual Studio 2010. If you want to define actions for a BCS external content type, you must deploy it to the BCS service and then open the Central Administration, navigate to BCS Service and define the BCS action there.

Create BCS action in SharePoint Central Admin

If you use BCS Meta Man to create a BCS External Content Types you can easily define BCS Action within Visual Studio 2010.

The steps below walk us through how to do it…this walk through presumes you have BCS Meta Man alpha 2 (or later) installed, you can download it from here:

BCS Meta Man Download.

1) Open Visual Studio 2010 and create new empty SharePoint project.

Create Empty SharePoint project

2) Right click on the project and select “Add New Item” and choose BCS Meta Man from the dialog.

Add BCS Meta Man project item

3) When this project item type is added to your project it will automatically add a new feature and open the BCS Meta Man designer. Now, from menu bar click on BCS Meta Man - > BCS Meta Man Data Source Explorer.

Open BCS Meta Man Data Explorer

4) In the data source explorer click on “Add SQL Connection” which will pop up new dialog, where you can set up the connection to your back end SQL database.

Set connection settings

5) When the connection is configured, it will populate the treeview with available databases and tables. In this walkthrough we have used the AdventureWorks database and Product table.

Drag table onto the design surface

6) Drag and drop the “Product” table to the designer and select the methods which you want to be generated by BCS Meta Man. Right click on the top of the entity and select “Manage Entity”.

Manage your BCS Entity

7) In the Entity Management Entity Tab, set the Title column for the External Content Type, so then we can use actions in the BCS Data list web part for each record. (see Step 11).

Step7a

Now click on the “Actions” tab and click on “Add Predefined Action”.

Entity Management screen

8) In “Action Picker” dialog choose any predefined action you like. In this walkthrough we have chosen “Bing”. You can create custom actions by clicking on the “Create Custom Action” button and setting the necessary parameters for a BCS Action.

Create pre defined BCS Action

9) After you have selected an action, it will fill up the BCS Action properties. You can change those properties, and add or remove action parameters.

Set BCS Action Properties

10) We need to make Bing search with the product’s Name, so we need to remove the ProductId Action parameter and add new one – Name.

Add new Action Parameter

11) When you click on the “Save” button of the entity management dialog it will add the Action to the BCS Model. Rebuild the project and press CTRL+F5 to deploy the solution. Navigate to your SharePoint site, add a BCS List web part and choose our Product External Content Type to be displayed. When data is populated you can find a dropdown on each record’s title column (Name in this example) and you can see available Actions there.

clip_image002[12]

12) When you click on “Bing” it will open search result page in new window. A Bing search query will be done by passing the Name parameter through from our BCS record.

clip_image004

<hrayr/>

Business Connectivity Services and Oracle with BCS Meta Man

In our previous blog posts we have already introduced to you how it is easy to create Business Connectivity Service External Content Types, upscale BDC application definition files and upsize SPD 2010 generated BCS models with BCS Meta Man. All these blog posts were done based off Microsoft SQL server. In this walkthrough we’ll show you how to create a BCS External Content Type, generate C# methods, and make an association for Oracle database tables.

1) Open up Visual Studio 2010 and create a new empty SharePoint project.

Create a empty SharePoint Project

2) Right click on the project and add a new BCS Meta Man item.

Add a new BCS Meta Man project item

3) Add System.Data.OracleClient reference to your project, which is in the following location,

C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Data.OracleClient.dll.

add System.Data.OracleClient.dll

4) When the BCS Meta Man design surface is in view you will find the BCS Meta Man menu item in the menu bar. Click on BCS Meta Man - > BCS Meta Man Data Source Explorer.

Open BCS Meta Man Data Explorer

5) Click on the “Add Oracle Connection” button of the data source explorer.

Add Oracle Connection

6) In the connection dialog, setup connection to your oracle database.

enter your Oracle connection details

7) If the connection is OK the treeview will populate with Oracle tables.

Treeview populates with Oracle tables

8) Drag and drop the Departments table to the design surface. In the Entity Creation wizard click on the Next button, select to generate all the methods and then click on the Generate button.

Drag and drop an Oracle table onto the design surface

9) BCS Meta Man will add new files to the project which contain generated C# code. You’ll also see the External Content Type on the design surface.

BCS Meta Man generates lots of code for you

10) At this point we have created a BCS external content type for Departments table. Please, do the same to create External Content Type for the Employees table too.

Department and Employee tables from Oracle

11) View the Visual Studio’s toolbox and choose the association action. Create an association between Departments(Source) and Employees(Destination) External Content Types. It will pop up a dialog for identifier mapping. Select DepartmentId in both dropdown boxes.

Set association fields between content types

12) Click on OK and it will create an association between those two tables. You’ll find that it automatically adds a new association method to the Employees External Content Type.

BCS Association created

13) Rebuild the project and press CTRL+F5 to deploy the solution.

14) Go to your SharePoint site and add a new External List. Set either Departments or Employees as the External Content Type to use for the list. We want to make sure, that all the generated methods work properly.

15) When the External List is displayed, it calls the BCS Finder method to populate the records.

BCS External List with Oracle data

16) Click on the Items ribbon which is in the top. If Creator method is configured properly then it should be enabled.

Create new item

17) Click on “New Item” and insert a record.

Add record to Oracle

18) You can see the inserted record in the list.

External List updated

19) Let’s check if the specific finder method works ok. Select any record in the list and go to Items ribbon. Click on View Item button.

Test Specific Finder method

20) “View Item” should execute the specific finder method.

View Item

21) And finally, let’s make sure that updater works properly. Select any item in the list, click on Items ribbon and then click on Edit Item button.

Check updater method

22) Update the name of the selected department and click on Save button.

Update data straight to Oracle

23) When the list is re populated, you’ll see the updated record.

External List updated live

Well, we have made sure that all the generated methods(Finder, Specific Finder, Creator, Updater) work properly, but we have an association between Departments and Employees as well. So, let’s make sure it works ok too.

24) Edit the page of your SharePoint site, add add a BCS List and BCS Related List web part. Set Departments as the type for BCS list web part and Employees as the type for BCS related list web part. Connect those two web parts, so BCS List web part should send data to the Related List web part. Select any department in the list web part. This will execute the association method and populate appropriate employees in the related list web part.

Test Oracle association works

<hrayr/>

Upscale a BCS Model created in SharePoint Designer 2010

SharePoint Designer 2010 is a great tool for putting together simple External Content Types, but often you will want to create your External Content Types in Visual Studio to give you the full power of c# code. Unfortunately with the BCS tooling that comes with Visual Studio there is no way to take a model built in SharePoint Designer 2010 and upscale it to a Dot Net Assembly based model. Using BCS Meta Man however you can do exactly this. BCS Meta Man will allow you to select your BCS Model built by SharePoint Designer and then generate all the c# methods and BCS model you need to be able to then take it further and customize it any way you like.

In this blog post we will show you how to create an External Content Type with SharePoint Designer 2010 and then upsize them with BCS Meta Man.

1) Open SharePoint Designer 2010 and click on Open Site.

Open SharePoint site

2) Enter your SharePoint site’s URL. In the left side you’ll see the navigation panel, select External Content Types.

Select External Content Type

3) At the top you can find the “External Content Type” button, click on it to create a new BCS External Content Type.

Create a new External Content Type

4) Set the Name, Display name(Departments) of your new External Content Type and click on the hyperlink to discover External Systems

Set ECT properties

5) When you click on the hyperlink, a new page will be opened to set up a connection to your back end database/WCF service or .Net assembly. Click on Add Connection button.

Add a new connection

6) Select SQL Server

SQL Server connection

7) Set parameters for the connection to your database. In our walkthroughs we use Adventure Works database. Click OK.

SQL Server connection properties

8) Expand the populated treeview, select the Departments, right click on it and select Create all operations.

Create all External Content Type operations

9) Click on Finish, so SharePoint Designer will create all the methods for your BCS External Content Type.

Complete ECT method creation

10) Press CTRL+S to save our Departments External Content Type

Save External Content Type

11) Please repeat the same steps and create another external content type for Employee table of the AdventureWorks database. Name it Employees.

Export External Content Types

12) Now we need to export these two external content types to XML file so that we can upscale them in BCS Meta Man. Select both external content types, right click on them and select Export Application Model.

Export our BCS Model

13) Set the Model Name.

Set Model Name

14) Set where our application model should be exported to.

set location to save our model

Now we have a BCS application model of Departments and Employees External Content Types. Next we need to upsize it in BCS Meta Man. BCS Meta Man will generate C# code for all the methods that you have defined in SharePoint Designer and also we will create an Association between them easily.

15) Open up Visual Studio 2010 and create a new empty SharePoint project.

Create empty SharePoint project

16) Right click on the the project and add a new BCS Meta Man item to the project.

Add a BCS Meta Man project item

17) When the project item is added, BCS Meta Man’s design surface is opened. Go to menu bar and select BCS Meta Man->Import SPD generated XML file.

Import SPD generated XML file

18) File open dialog will appear. Select the BCS application model we generated from SharePoint Designer

select the BCS Model to Open

19) BCS Meta Man will now create External Content Types for Departments and Employees ECTs that we created with SPD 2010. It will add new c# files to your project so you can modify c# methods that have been generated by BCS Meta Man for each BCS method

BCS Meta Man upscales our External Content Types

20) View the toolbox and create an association between those two External Content Types.

Create a BCS association

21) Rebuild the project and press CTRL+F5 to deploy the solution.

22) Open your SharePoint site, add BCS List and BCS Related List web parts to the page. Set Departments as a type for List web part, and Employees as a type for Related List web part. Connect those two web parts so List web part should send data to the related list web part. When everything is done you can select an item in Departments list web part and see associated data in related list web part.

Display BCS data in web parts

23) Now, let’s see if Creator and Updater methods have been upsized properly. Create a new External List in your SharePoint site and set Departments as a type for that list.

You’ll see that “New Item” and “Edit Item” buttons are enabled, which means BCS Meta Man has declared(upsized) those methods properly, try to insert and update some departments

New Item and Edit Item buttons are available

<hrayr/>

Upgrade BDC application definition files to BCS

BCS Meta Man alpha 2 has a great feature that allows you to upgrade MOSS 2007 BDC application definition file to SharePoint 2010 BCS models. BCS Meta Man will automatically read in the BDC XML and create the appropriate BCS Model, BCS External Content Types and generate the necessary C# methods.

In this blog post we will show you how to upscale a BDC application definition file with BCS Meta Man.

In the first part of this blog post, we will show you how to generate a BDC application definition file with BDC Meta Man and then we will show how to upscale that application definition file with BCS Meta Man.

1) Open BDC Meta Man and connect to SQL server, use AdventureWorks database.

Open BDC Meta Man

2) Drag and Drop Department and Employee tables to the design surface, and create an association between those two tables.

Create Entities on design surface

3) Set the output file path.

Set Output file path

4) Generate the application definition file.

Generate BDC application definition file

Now the BDC application definition file is generated we need to create a SharePoint project in Visual Studio 2010, add a BCS Meta Man project item and upscale the BDC application definition file.

5) Open up Visual Studio 2010 and create new Empty SharePoint project.

Create empty SharePoint project

6) Add a BCS Meta Man project item to your project. Right click on the project, choose Add new item and select BCS Meta Man item from the dialog.

Add BCS Meta Man project item

7) When the project item is added to your project, BCS Meta Man’s design surface will be opened automatically. From the menu bar select BCS Meta Man - >Import BDC Xml File.

Select Import BDC Xml File menu option

8) From the file open dialog, choose the BDC application definition file which you have already generated

Select the application definition file to upgrade

9) BCS Meta Man will generate BCS external content types, C# methods and required files. All this information has been imported to BCS Model generated by BCS Meta Man.

BCS Meta Man upgrades our BDC XML to a BCS Model

10) Now rebuild the project and press CTRL+F5 to deploy the solution.

11) Go to your SharePoint site and add BCS List web part and BCS Related List web part to your page. Set Department as a type for List web part and Employee as a type for Related List web part, connect those two web parts together.

If you select a department in the Department List it will populate employees from that department. We’ve successfully upgraded our BDC XML to a BCS model and deployed it!

Test the upgrade by deploying model

<hrayr/>