Tuesday, April 29, 2008

Installing the PDF IFilter for SharePoint Search

The other day we were at a client installing WSS 3.0 in two server farm. We were also installing Search Server 2008 Express into the same farm. This article explains how you can upgrade the install from WSS to Search Server. That was fairly straight forward.

One of the other things we were to configure was the PDF IFilter, which allows you to perform full-text indexes of PDF files. We installed the IFilter according to the following article and where it said restart the server we assumed it meant perform an iisreset since that is what other blogs said to do. We uploaded some PDF files to both the shared folder that were having Search Server index and the WSS site we had just built. When we performed a search on text that we knew was in the PDF file, we received a hit from the folder share but not from the WSS site.

We did some research on the subject and some people said that you needed to install the IFilter on the SQL Server box since SQL Server is what performs the full-text search, so we installed it on that server as well. Tried a search on a new document that we uploaded and still no results from the WSS site. After doing some more research and trying a number of things, we were about to give up when we decided to try restarting the server.

When the server rebooted, we performed the search and received our two hits.

Lesson learned: If a Microsoft document says restart server, restart the server, even if other people say you only need to perform an iisreset.

Second lesson learned: Go back to the famous mantra, "If all else fails restart the server."

Labels: , ,

Tuesday, April 22, 2008

BlueGranite Featured in PerformancePoint Blog

BlueGranite, the company I work for, has been recognized as a leader in performance management dashboards, and was recently featured in the the BI blog. To read the full article check out the BI Blog, where you can find more information on Business Intelligence and Microsoft's offering, Performance Point.

To find out if BlueGranite can help your company with performance management dashboards, check out the BlueGranite site.

Labels: , , ,

Thursday, April 10, 2008

Presenting at Microsoft Developers of Southwest Michigan

Thursday April 24, I will be presenting at the Microsoft Developers of Southwest Michigan meeting. I will be presenting the Office Open XML standards and how to programmatically create word files using the Open XML standards. I will also be covering integration with SharePoint document libraries.

In addition to my presentation, my co-worker Warren, will be presenting on the Business Intelligence capabilities in SharePoint.

If you are in or around the Kalamazoo area and would like to join us for some dinner and the presentations, RSVP on the MDSM site, www.devmi.com.

Labels: , ,

SPLists, SPListItems, and SPFields

In the previous post we accessed the SharePoint we and site objects. Now that we are in the web we can access lists, list items, and individual fields in the list item.

The first thing to do is get a list object:

Dim objList As SPList = objWeb.Lists("CustomList")

To create a list object you can pass in the name of the list into the Lists Collection.

To filter the items that you want to access in the list you can create a CAML query.

Dim objQuery As SPQuery = New SPQuery()
objQuery.Query = "<where><gt>" & _
"<fieldref name=" & ProjectedValue & />" & _ "<value type='number'>500</value> </gt> </where>"

This query will only return rows that have a 'Projected Value' greater than 500.

To return the rows from the query you need to create a ListItemCollection.

Dim objListItemCollection As SPListItemCollection = objList.GetItems(objQuery)

You fill the ListItemCollection by calling the GetItems method of a Sharepoint List object and passing in a CAML query. Once you have the ListItemCollection you can iterate through it or grab items by ID.

Once you have a ListItem you can get access to the individual fields for that list item.

Dim objItem As SPListItem = objListItemCollection.Items(1)

Dim strItemName As String = objItem.GetFormattedValue("Name")

The GetFormattedValue returns a clean string no matter what the field type is.

You can also get field values back in this manner:

Dim strItemName As String = objItem("Name")

This is not always guaranteed to return a clean string of the value.

You can set fields for a list item in a similar manner:

objItem("Name") = "Brand New Field"

You can quickly manipulate values in a list using these objects and the methods they provide.

Labels: , , ,

Monday, April 7, 2008

The Object Model is your friend

One of the most important things to grasp as a SharePoint developer is the SharePoint object model. Once you have access to the object model you can create anything in code that you could in the user interface and even more. To gain access to the object model you need to decide first if you will be developing your code on the server that runs SharePoint or on a different machine. It is possible to develop the code on a separate machine and install the dlls on the server. Note that this requires a little more work and does not allow for debugging.

Once you have decided where you want to develop your code, you can then begin a Visual Studio project. You will need to add a reference to the Microsoft.SharePoint dll. If you are developing on a remote machine you will need to get a copy of the dll from the SharePoint server. The dll is located in C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\ISAPI. If you are developing on the SharePoint server then the dll is available under the .Net tab for references.

The first step to getting into the SharePoint object model is to grab an SPSite object:

Dim objSite As SPSite = New SPSite("http://testserver")

You create a new SPSite by passing in the URL to the site. Once you have a Site object you need to get access to an SPWeb object:

Dim objWeb As SPWeb = objSite.OpenWeb

If you make the previous call, it will grab the root web of that site. You can also open a subweb:

Dim objWeb As SPWeb = objSite.OpenWeb("/en-us")

In this instance you can give the URL of the web to open.

You can also access the web through the current context:

Dim objWeb As SPWe = SPContext.Current.Web

This will get you the current web.

Once you have access to the SPWeb object you can manipulate Lists, Libraries, Files, Pages, Columns, and Content Types.

Each one of those items has an equivalent SP object: SPList, SPDocumentLibrary, SPFile, Microsoft.SharePoint.Publishing.PublishingWeb, SPField, and SPContentType.

In the next few posts I will explain using list, library, page, field, and item objects and using the Publishing Namespace for Publishing sites.

Labels: , ,