In this walkthrough we will be using Microsoft SQL Server Stored Procedures to add a Specific Finder and IdEnumerator operations to an existing External Content Type based on Finder Stored Procedure. By adding a Specific Finder Method we will be able to use the profile view on a record as well as being able to add an Association with another External Content Type. The IdEnumerator will give us the required functionality to perform searches on our External System data.
We are going to follow on from the External Content Type based on Stored Procedure in SharePoint 2013 using Meta Man walk through.
- SharePoint Server 2013
- Meta Man (it doesn’t necessarily need to be installed on the SharePoint server but it requires .net Framework 4.5 installed on the machine where you are going to run Meta Man from)
- MS SQL server with any sample database (for this walk through we are going to use the NorthWind sample database )
- A SQL Stored Procedure for the Specific Finder Method:USE [Northwind]
CREATE PROCEDURE [dbo].[GetTerritoryByID]
SET NOCOUNT ON;
SELECT * FROM [Territories] WHERE [TerritoryID]=@tID
- A SQL Stored Procedure for the IdEnumerator Method:USE [Northwind]
CREATE PROCEDURE [dbo].[GetTerritoryIDs]
SET NOCOUNT ON;
SELECT [TerritoryID] FROM [Territories];
- Follow the External Content Type based on Stored Procedure in SharePoint 2013 using Meta Man <URL MUST BE CORRECTED> tutorial until you have a single External Content Type with a Finder Method defined
- From the Stored Procedures list drag and drop your Specific Finder Stored Procedure Method onto the existing External Content Type
- You will be prompted for a operation type. Select “Specific Finder” and click “OK”.
- For each input parameter select the appropriate identifier to map it to. Click “Create”.
- The External Content Type will update with the new Specific Finder Method
- Next drag and drop the IdEnumerator stored procedure onto the existing External Content Type
- Select “IdEnumerator” as the operation type, Click “OK”
- Click “Create” button.
- Again, the External Content Type will update with the new IdEnumerator operation
- Now we need to deploy our BDC model. First we need to set URL of where you want to deploy your model. We set this URL by going “Settings” from the title bar.
- In the model deployment URL textbox you should manually type URL of SharePoint 2013 Central Administration . Click “Save” button.
- Once you have saved the URL to deploy your BDC model file to simply click “Deploy” button and your BDC model file will get deployed.
- SharePoint 2013 will now go through and validate your BDC model file is correct, once it is done you will get a success dialog
- Browse to the site where you want to add the External List. Click “Site Contents”->”add an app”.
- Select “External List”
- Enter a name for External list and click on the icon to show the available External Content Types
- Select our generated Northwind_MetaMan.Territory External Content Type, click “OK”
- Click “Create”
- Your External System data from MS SQL database is now displayed in the SharePoint External List
- You are able to view any record. Select “View Item” menu item.
- You will be presented with the View Item page
- We do have a few extra steps to do within the SharePoint UI in order to get our Territories appearing in our Search results. At first we need to get our External Content Type to create its profile page. Open up SharePoint 2013 Central Administration, click on Manage Service Applications. In the Service Applications screen click on the Business Data Connectivity Service Application link to open up it’s administration page. Hover the mouse over our Territory ECT and from the content drop down pick “Create/Upgrade Profile Page”
- Click OK on the dialog message that shows up. Now our profile page will be created
- Now we need to set our BCS application as a Search Content Source. Go back to the Manage Service Applications page and click the Search Service Application link. In the left hand sidebar menu click the Content Sources link, then in the next page click the New Content Source link
- Give your new Content Source a name, and select it’s type to be Line of Business Data. Upon selecting this the UI will refresh and the next section down will refresh to show External Data Sources. Select BCS application you want to crawl in our case MetaManLobSystemInstance_test. Click “OK”
- Perform a full crawl now
- Once the crawl has finished you can go to your Search Center site, search for “Santa” and you’ll see a few results being returned from our Territory External Content Type.
We hope this walkthrough will be useful for you. If you have any questions feel free to email them to email@example.com