نحوه ساختن لیست خارجی در شیرپوینت 2010

http://community.bamboosolutions.com/blogs/sharepoint-2010/archive/2011/04/27/sharepoint-2010-cookbook-how-to-create-external-list-including-database-from-sharepoint-designer-2010.aspx

Solution:

SharePoint 2010 has a new type of List called the External List which is used for displaying data that comes from Business Connectivity Services (BCS).

First, I will demonstrate how to create an External List that uses data from a SQL table through SharePoint Designer 2010.

  • Step 1: Make sure that you created a Northwind database in SQL Server.

  • Step 2: We go to SharePoint Designer to connect the database with SQL Server as follows:
    • Click on the External Content Types menu on the left pane
    • Then, select the External Content Types icon on the top.
    • You will see a Connection window appear:

  • Step 3: Click on Add Connection button

  • You will see a dialog appear to select Data Source Type as pictured below
  • Of course, we will select SQL Server

  • After selecting Data Source Type, we fill in the SQL information fully, including Database Server, Database Name, and Secure store Application ID as shown below:

  • Don't forget to enter User Name and Password when BSC Secure Store is shown:

  • Step 4: After connecting successfully, you will see Northwind database shown on Data Source Explorer as shown below.
  • We will select a Table to create in here by right-clicking Table Name and selecting Create All Operations:

  • A Parameter Configuration is shown after that; you can select any columns which you need and click the Finish button to complete:

  • Finally, don't forget to click the Save button after you're done. This is pretty important, for obvious reasons:

  • Now, we have a Northwind database as we expected:

Now, I will show you how to create an External List including a database, from SharePoint Designer. It's very easy.

  • Step 1: First, we go to SharePoint Designer 2010 to select a site for configuring

    For example: I select the http://singlemoss2010 link

  • Make sure that we have configured BDC before. Don't forget that we are getting data from BDC so we must have a database in here.

    For example: I created the Northwind database in here.

  • Next, click on the External List menu on the Ribbon to create a new list. You will see a Create External List form appear. You only need to fill in the List Name in the Name textbox as pictured below:

  • Step 2: Now, go to the site which you selected for configuring earlier. We will see a new External List created from SharePoint Designer.
  • But you may be surprised when clicking on the new list since you will not see its database in here. Don't worry about this! This only means that you have not yet assigned access privileges for the current logged-in user yet.
  • Step 4: To assign access privileges for a user, go to the Central Admin Page --> Application Management and select Manage service applications:

  • Click on the Business Data Connection Services hyperlink as shown below:

  • After clicking on BDC Services, you will see the database which you created earlier. Please click on the Database Name to expand the context menu and select Set Permissions:

  • You should add users and assign access permissions for them in here:

  • Step 5: After finishing the configurations above, you only need to go to the site and press F5 to refresh the page.
    • Now, everything is OK. You will have an External List including database in here:

Notes:

  • CAUTION: SharePoint 2010 External List throws a webpart exception when working with an external content type that was created in Visual Studio 2010.

I have created an external content type in Visual Studio which connects to a SQL 2008 database. Following is what I've covered:

  1. Created External Content types in Visual Studio 2010
  2. Wrote implementation for ReadItem, ReadList, Create and Update
  3. Deployed the content type through Visual Studio (Right click Solution name -> Deploy)
  4. Verified through SharePoint Designer 2010 that the content type has been added
  5. Added permissions for this ECT through Central Administration
  6. Created an External List using SharePoint 2010 (also created directly from browser - Web Application)

2. Mapping External List Columns to Database Columns

  • Every column in the file you want to import must be mapped to an existing column in the prospects table in the Siebel Database, or to an attribute created for this purpose. If you import response or campaign data, you can also map to response and campaign fields. For information about mapping attributes, see Adding Additional Attributes to a List.
  • CAUTION: Make sure that you map every column before launching the import.
  • To map list columns to database columns in the prospect table:
  1. Navigate to the List Management screen > Lists view.
  2. Drill down on the list name.
  3. Click the List Import view tab.
  4. Scroll down to the List Import Format list and map every column to an existing database column in the prospect table or to an attribute created for this purpose.
  5. In the List Import Format list, save the format in one of the following ways:
  6. The first time you save a format, click Save as New.
  7. Save as New allows you to retain the original format and save the modified format separately. All saved formats appear in the List Management screen's List Imports Formats view tab.
  8. Click Save to overwrite the original format.
  9. Use this save option if you make changes to the mappings and want to preserve them.
  10. After you save the List Import Format, perform the following steps to verify the columns that will be used for matching and update.
  11. In the form in the List Import view, copy the name of the List Import Format in the List Import Format field.
  12. In the List Management link bar, click List Import Formats.
  13. Query for the name that you copied in the List Import view.
  14. In the lower list, you will see the columns that you mapped from the import file.
  15. In the Exact Match Column field, check each column from the list that you want to use for the exact match.
  16. NOTE: These settings are only used when you have selected Exact match or Exact and intelligent match as the matching approach.
  17. In the Allow Field Updates field, check any fields that you want to allow to be overwritten when using the Overwrite existing record match resolution.

خطای external list

http://www.zimmergren.net/technical/sp-2010-bcs-problem-with-authenticationmode-and-reverttoself

You might receive an error message like this when trying to hook up a new External Data Source depending on your configuration:

The metadata object that has Name ‘yourName‘ has a Property with name ‘AuthenticationMode‘ and value ‘RevertToSelf‘. This value indicates that the runtime should revert to the identity of the application pool, but reverting to the application pool must be explicitly enabled for the service application by a farm administrator.

Solution

While digging around for a couple of minutes I couldn’t really find a suitable UI option for changing this behavior, so I dug into the power of PowerShell instead – which probably saved me quite some troubleshooting.

First you need to check the name of your Business Data Connectivity Service Application – a quick way is to check the UI, or you could use a PowerShell Cmdlet or use the API. I’m just using the UI for easy access:

image

Next, launch a new SharePoint 2010 Management Shell console and type in the following lines of code. Note that the name of the Service App below, is a copy of the name you took above:

$bcsServiceApp = Get-SPServiceApplication | where {$_ -match "Business Data Connectivity Service"}
$bcsServiceApp.RevertToSelfAllowed = $true;
$bcsServiceApp.Update();

This should now execute nicely (if you’ve got the appropriate permissions) and you should be able to see the RevertToSelfAllowed property be changed to true:

image

If you now would try to hook up your connections again, you should hopefully not see this message again.

Quick fix, done. Enjoy.

فعال کردن SharePoint Server Publishing Infrastructure

stsadm -o deactivatefeature -id f6924d36-2fa8-4f0b-b16d-06b7250180fa -url "http://*url of site collection*" -force

stsadm
-o activatefeature -id f6924d36-2fa8-4f0b-b16d-06b7250180fa -url "http://*url of site collection*" -force
 
 
http://sharepoint.stackexchange.com/questions/17040/cant-activate-server-publishing