sharepointking

Just another WordPress.com site

Monthly Archives: February 2009

MOSS Federate Search : renders the results from the external repository

My case: i want to search on sql server database that is actully used for other application. I want to search some employee related information from that sql db into my sharepoint portal server. I have follow steps mention on below link and go success.

1. Download source code to go for federate search in sharepoint for sql server follow : http://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=moss2007sdksamples&ReleaseId=1305

download .aspx/.cs and change the sql server connection string into .cs file and also change select query mention in .cs file to search data as per your requirement and put both files on C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\FederatedConnectorSample

2. Now follow steps mention in below link to test federate search for sql server:

http://msdn.microsoft.com/en-us/library/cc806280.aspx

3. No go to your sharepoint search site and enter word: e.g. in my case i have enter last name “Jain”. it shows me below result:

BDC(Business Data Catalog) : in ADF(Application Definition File) SQL Connectivity fail thru sql credential?? – Possible Solution is here

My problem: I hav created sample Application Definition file(ADF) for BDC to connect external database located on another server. I am just able to access that database thru sql credential (NO WINDOWS CREDENTIAL). I have created ADF file but faild during “Executing” Instance but was not able to execute it and getting error “could not connect to LOB”. I have done some R & D modify my ADF file slightly which are like mention below.

Solution: Change your ADF file from below figure 2 .
figure 1

Maximize below image of modification in ADF file to fix the problem
figure 2

Enjoy!!

Activate CAML Intellisense to reduce development efforts

Item Level Security : Document Library Limitations : WSS Custom Event

After long time i came to know that item level security is not supported on document library as it is supported only on custom sharepoint list: refer below link to implement item level security on document library :
My project requirement was: Current logged in user can view all documents but delete only its own document and i have done it thru below programming for event handler where i have changed some of code as per my requirement.

Step 1: We will start by opening our Microsoft Visual Studio 2005 and create a new SharePoint Empty Project.

Step 2:Subsequently, we will add an Event Receiver item to our project. To do this right-click the project in the Solution Explorer > Add > New Item. In the Add new Item dialog box, select Event Receiver, name it CustomEvent, and then click Add. A Create Event Receiver dialog box will be displayed.

Stpe 3:Since we will customize a Document Library, select Document Library from the drop-down list in the Create Event Receiver dialog box, and then click Add. A CustomEvent folder with ItemEventReceiver.cs, ItemEventReceiver.xml, ListEventReceiver.cs, and ListEventReceiver.xml files will automatically be added to our project.

Step 4: Now it is time for us to write few lines of code. Let us open the ItemEventReceiver.cs file. Uncomment the ItemDeleting event, and then write the code below:
public override void ItemDeleting(SPItemEventProperties properties)
{
if (properties.ListTitle == “Custom Events”)
{
properties.ErrorMessage = “For demonstration purposes, deleting is not allowed.”;
properties.Cancel = true;
}
}

Step 5: To automate the deployment process, let us set the Start Action of our project. To do this, click Project > Project Name Properties. In the Project Properties page, select Debug tab. And in the Start Action section, select Start Browser with URL option, and then write http://sharepointking/

Step 6: Finally, let us build and deploy our project. To do this, click Build > Debug Project Name. If successful, click Build > Deploy Project Name.

Step 7: Upon successful deployment, let us open our SharePoint Web application, navigate to our Custom Events Document Library, add a document, then attempt to delete such document, and you would expect retention of the document with an error message