Showing posts with label BDC. Show all posts
Showing posts with label BDC. Show all posts

Tuesday, October 26, 2010

BCS Model not updated

Scenario:
I am working with a BCS Model and it is not picking up the change.

Solution:
While cache-ing is great for enterprise applications but sometime I hate it , specially during development , where we want to see the change with zero lag. Anyway I don't think so that's gonna happen. So we developers have our own tricks / steps to deal with it

Steps to Refresh BCS Model:
Assuming you are deploying using WSP package.

01. Retracted exisiting solution i.e. "myModel.wsp"
02. Navigate to BCS Service application and Deleted Model from everywhere
03. IISReset
04. Restarted "SharePoint Server Search 14" service
05. Deployed the new solution i.e. "myModel.wsp"
06. Navigate to BCS Service Application and add object permissions for your model
07. ( Optional ) Create/Upgrade the profile pages
08. Navigate to "Search Service Application" and re-crawl fully the Content Source using your Model
09. Once finished , Check the error log.
10. If all went smooth then checked the crawled properties, they should be there

Friday, October 24, 2008

BDC Sample

Scenario:
A Web service proxy class named SurveyWebServiceProxy contains the following method:

public Survey[] GetSurveys() { 
object[] results = this.Invoke("GetSurveys", null);
return ((Survey[])(results[0]));
}
You create the following method for a Survey entity in a Business Data Catalog (BDC) application definition file:
<Method Name="GetSurveys"> 
<Parameters>
<Parameter Name="Surveys" Direction="Return">
<TypeDescriptor
TypeName="SurveyWebServiceProxy.Survey[], SurveyWebService"
IsCollection="true"
Name="ArrayOfSurvey">
<TypeDescriptors>
<TypeDescriptor TypeName="SurveyWebServiceProxy.Survey, SurveyWebService"
Name="Survey">
<TypeDescriptor TypeName="System.Int32" Name="SurveyID"
IdentifierName="SurveyID"/>
<TypeDescriptor TypeName="System.String" Name="Title"/>
</TypeDescriptor>
<TypeDescriptors>
</TypeDescriptor>
</Parameter>
</Parameters>
</Method>
Now to return the default view of the Survey entity.

This configuration creates a Finder method. A Finder method is one that returns multiple entity instances. In this scenario, the method returns multiple instances of the Survey entity.
<MethodInstance 
Type="Finder"
ReturnParameterName="Surveys"
Name="GetSurveys"/>
This configuration creates a SpecificFinder method. A SpecificFinder method is one that returns a single entity instance.
<MethodInstance 
Type="SpecificFinder"
ReturnParameterName="Surveys"
Name="GetSurveys"/>
Also keep in mind that an Association element defines an association between two entities.

Friday, September 12, 2008

Business Data Catalog Sample File

<LobSystem
Type="Database"
Version="1.0.0.01"
Name="AdventureWorks"
xmlns="http://schemas.microsoft.com/office/2006/03/BusinessDataCatalog">


<AccessControlList>
<AccessControlEntry Principal="domain\you">
<Right BdcRight="Execute"/>
<Right BdcRight="Edit"/>
<Right BdcRight="SetPermissions"/>
<Right BdcRight="SelectableInClients"/>
</AccessControlEntry>
<AccessControlEntry Principal="domain\BDCUsers">
<Right BdcRight="Execute"/>
<Right BdcRight="SelectableInClients"/>
</AccessControlEntry>
</AccessControlList>


<LobSystemInstances>
<LobSystemInstance Name="AdventureWorksDB">
<Properties>
<Property Name="AuthenticationMode" Type="System.String">PassThrough</Property>
<Property Name="DatabaseAccessProvider" Type="System.String">SqlServer</Property>
<Property Name="RdbConnection Data Source" Type="System.String">SQLServerMachineName</Property>
<Property Name="RdbConnection Initial Catalog" Type="System.String">AdventureWorks</Property>
<Property Name="RdbConnection Integrated Security" Type="System.String">SSPI</Property>
</Properties>
</LobSystemInstance>
</LobSystemInstances>

<Entities>
<Entity Name="Customer">

<Properties>
<Property Name="Title" Type="System.String">Name</Property>
</Properties>

<Identifiers>
<Identifier Name="CustomerID" TypeName="System.Int32"/>
</Identifiers>


<Methods>
<Method Name ="GetCustomers">
<Properties>
<Property Name="RdbCommandText" Type="System.String">
SELECT CustomerID,LastName + ', ' + FirstName as Name,Phone, EmailAddress
FROM Sales
</Property>

<Property Name="RdbCommandType" Type="System.String">Text</Property>
</Properties>

<Parameters>
<Parameter Direction="Return" Name="Customers">
<TypeDescriptor TypeName="System.Data.IDataReader, System.Data, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" IsCollection="true" Name="CustomerDataReader">
<TypeDescriptors>
<TypeDescriptor TypeName="System.Data.IDataRecord, System.Data,Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Name="CustomerDataRecord">
<TypeDescriptors>
<TypeDescriptor TypeName="System.Int32" IdentifierName="CustomerID" Name="customerID" />
<TypeDescriptor TypeName="System.String" Name="Name" />
<TypeDescriptor TypeName="System.String" Name="Phone" />
<TypeDescriptor TypeName="System.String" Name="EmailAddress" />
</TypeDescriptors>
</TypeDescriptor>
</TypeDescriptors>
</TypeDescriptor>
</Parameter>
</Parameters>

<MethodInstances>
<MethodInstance
Name="CustomerFinderInstance" Type="Finder" ReturnParameterName="Customers" ReturnTypeDescriptorName="CustomerDataReader" />

</MethodInstances>

</Method>
</Methods>
</Entity>
</Entities>

</LobSystem>
Articles:
http://msdn.microsoft.com/en-us/office/bb251754.aspx

What is Business Data Catalog ?

Business Data Catalog, a new feature introduced in Microsoft Office SharePoint Server 2007, provides an easy way to integrate business data from back-end server applications, such as SAP or Siebel, within Office SharePoint Server 2007 without writing any code.Business Data Catalog provides built-in support for displaying data from databases and Web services. That is, you can use Business Data Catalog to display data from your SAP, Siebel, or other line-of-business (LOB) application via Web services or databases.