Setting the Xsl property of the CoreResultsWebPart

Modifying the Xsl property of the CoreResultsWebPart using the Web Part editor is straight-forward. But doing the same thing programmatically is a nuisance. In many situations you end up with an InvalidOperation exception.
 
The reason for this trouble is the getter of the XslHash property:
 
private string XslHash
{
    get
    {
        if (this._BeforeOnInit)
        {
            throw new InvalidOperationException();
        }
Of course, the _BeforeOnInit field is "true" when you try to modify the CoreResultsWebPart using the LimitedWebPartManager.
 
The easiest way to solve this involves a bit of reflection:
 

typeof(SearchResultsBaseWebPart).GetField("_BeforeOnInit", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(wp, false);

 
After this you can set the Xsl property.
 
HTH!
 

Published: Nov-19-11 | 0 Comments | Link to this post

FC.MetadataExtractor 2.3 released

I've been looking forward to announcing this major release, as it holds a good number of new features and usability improvements.
 
The highlights for me are:
- Extended file format support
- Much improved ease of use around configuring and applying metadata mappings
- Fixing the page redirect after manually starting the extraction of metadata for images already in the library
 
Extended file format support
In addition to the existing standard image formats like JPG, TIF or GIF etc., the FC.MetadataExtractor now leverages ALL WIC-compatible codecs that are installed on the SharePoint server. This potentially allows to extract metadata from various RAW file types (e.g. CR2 and NEF), as well as PSD or even DNG files.
Be aware that some of these codecs are freely available (e.g. many camera manufacturers provide the codec for their RAW format for free), while others cost a little bit of money.
 
 
Improvements of Metadata Mappings Configuration
First off, it is now possible to change the Field definition at any time, just like the choice of the list column the metadata should be written to. (I know, we should have done it this way a looong time ago)
 
Also, it is now possible to save the Metadata Mappings configured for one library as the "Standard Mappings" for the Site Collection, after which these mappings can then be easily added to other libraries as well.
 
Then, we've updated the default mappings and columns to include Fields which have become more popular over the last months. E.g. Latitude and Longitude are now default columns.
 
Several of the default columns of type Text are now Note fields in the library rather than Single Line Text fields, as we've seen more information being stored in them. Several of our customers found out that SharePoint is not "forgiving" if you try to store excessive amounts of text into a Text column. In such case SharePoint will actually update NONE of the fields of the item.
 
We've continued improving and completing the metadata access as much as possible. E.g. this time we've added better formatting of RATIONAL values and arrays of RATIONAL. I think by now we have a very solid metadata access implementation, even on older Operating Systems like Windows 2003R2, where the WIC functionality is still very limited.
 
Also please note that Microsoft has improved their documentation on the WIC (here and here), which might be helpful for you to determine  the right access string for the metadata Field.
 
 
Fixing the page redirect
We've had that request for quite some time, but the redirect to the right page view or paged view of a folder in the library was a bit complex to implement. I am very happy that we finally got this covered as I think it is a big nuisance for a user to manually return to a specific page view of the library.
 
The demo is already up on our website, so go get it and give it a test drive.
 
The Upgrade to version 2.3 is FREE for existing customers.
Enjoy!

Published: May-02-11 | 0 Comments | Link to this post

FC.MetadataExtractor 2.2 and 3.1 released

We've just put out a couple of maintenance releases for our FC.MetadataExtractor products. The 2.2 release is for the SharePoint 2007 platform and the3.1 release is for the SharePoint 2010 platform.
 
There are subtle but valuable improvements around the handling of GPS metadata. First, we now support the Degrees Decimal-Minutes format both for display and also when reading the resource (e.g. the iPhone stores GPS data that way, instead of using the standard Degrees Minutes Decimal-Seconds).
 
If the GPS data is to be displayed as a Number, this is now also supported, showing negative values for S (outh) and W (est).
 
The 3.1 release now also supports the new MUI (Multilingual User Interface) capability. Languages available at this point are English and German
 
Of course, as always with our software, minor upgrades are free for existing customers.
 
Enjoy!

Published: Feb-03-11 | 0 Comments | Link to this post

Accessing Location metadata using WIC - Windows Imaging Components

A customer just asked me how to retrieve the "City" metadata using the WIC. It's actually straight forward to pull that out of the IPTC information in most cases, as that is where Photoshop puts it when using the IPTC tab's "Sub-Location section, or the Origin tab.
 
app13/irb/8bimiptc/iptc/City
 
The "Country" is a little bit more tricky because the name of the resource contains a forward slash: ""Country/Primary Location Name"
 
/app13/irb/8bimiptc/iptc/Country\/Primary Location Name
 
Of course, one shouldn't confuse that "City" with the creator's "City" metadata,, which can be found here:
 
/xmp/CreatorContactInfo/CiAdrCity
 
HTH!

Published: Jan-22-11 | 0 Comments | Link to this post

Change the Home page in SharePoint

 
Happy New Year to Everyone!
Wow, it's been a while that I had the time to write a blog post. I was simply swamped over the last two months. Soo much has happened!
 
Now I look forward to a good new year and I wish everyone exactly the same!
 
Back to business!
Unbelievable, but after years of working with SharePoint, for the first time, I needed to change the home page. 2 seconds thinking, 20 seconds googling - only to come up with ideas like doing this programmatically ...nuh, this had to be simpler.
 
Hey, what about SharePoint Designer? And there it was, the "Set as Home page" command! It couldn't be more simple :-)
 
Set as Home page

Published: Jan-04-11 | 0 Comments | Link to this post

Leverage the FREE Windows TIFF iFilter for OCR in SharePoint

I knew about the TIFF iFilter available in Windows 2008R2 and its OCR capabilities, but I had not had the time to try it out until very recently when it became a priority as a customer requested it.
 
The setup for it is very SIMPLE and well described in John Liu's blog post. It consists of no more than two essential steps: activating the TIFF iFilter Windows Feature and to configure the OCR Group Policy properties.
 
I might want to add a couple of things to John's description though:
 
1) You should also configure the option "Select OCR languages from a code page".
 
2) You do NOT need to restart your server: simply restart the SharePoint Search services and then execute an iisreset.
 
3) You only need to start a "Full Crawl" if you want to reindex TIFF files that are already in SharePoint. All TIFF files uploaded AFTER the iisreset will be indexed automatically.
 
Of course you need to consider the amount of text being added to the general search index file. However, the upside of searching on all the scanned documents' text is certainly quite obvious.

Published: Sep-20-10 | 0 Comments | Link to this post

FC.MetadataExtractor released for SharePoint 2010

A few days ago we released our first product for the new SharePoint 2010 platform: FC.MetadataExtractor 3.0
 
By far the biggest improvement in SharePoint 2010, in regards to this new release of our product, is the ability to better control the asynchronous ItemAdded event receiver. Given the positive feedback at the SharePoint 2010 conference when Microsoft announced the addition of such a synchronous ItemAdded event, quite a number of people must have encountered that problem.
 
Recap: in SharePoint 2007, the ItemAdded event fires asynchonously and so does the thread that brings up the EditForm.aspx with the properties of the newly created item. This of course creates a collision if both threads then try to modify that same item. The only way out of this issue was to provide a custom EditForm.aspx page that would wait for the ItemAdded event receiver to finish before the EditForm.aspx would load and access the item.
 
In SharePoint 2010 the ItemAdded event receiver can now be configured to either fire synchronously or asynchronously and also be given a sequence number. This eliminates the need for a custom EditForm and any manual synchronization and allowed a much "cleaner" solution with the new product release.
 
On the user interface front, the Ribbon does take a bit to get used to, both for programmers and users. I do think though that accessing the Ribbon is easier for many users than having to search through several popup menus for a certain command.
 
FC.MetadataExtractor for SharePoint 2010
 
The ability to have client-side ECMAscript code and the new Notification elements in the user interface is definitely a great step forward. We made use of it for the manual metadata extraction that now happens asynchronously at the server while the user can continue to work in the browser.

Published: Jun-24-10 | 0 Comments | Link to this post

Search Server Express 2010: Trial period for this product is about to expire

...well, should Search Server Express be showing this? And, isn't that a bit harsh considering that I only installed it yesterday? :-D
 
SSX Trial Expiring
 
QA, any comments?

Published: May-14-10 | 2 Comments | Link to this post

Crawled Property problems

The SharePoint technical documentation leaves a lot to wish for in general, but Crawled Properties is probably one of the worst topics when it comes to documentation. On top of that, the functionality to implement is weak as well. Let me give you some examples:
 
When you google for "SharePoint CrawledProperty" you get a whopping 1500 search results (I'm not sarcastic, just comparing Google to Bing, read on!) and on Bing you find 122 results on the same search, with the majority being people asking for help, I'd say.
 
Anne Stenberg provides a few clues on her blog about how to "interpret" the Crawled Properties. Let me quote:
 
"Property Set ID - A GUID that identifies the property set for the crawled property. Doing a search for the GUID B725F130-47EF-101A-A5F1-02608C9EEBAC and filtering the results for the Property Name of 12 yields several links to related content. One such link, on MSDN, provides a tremendous amount of information. This tells us that this property set is a System property and the propID of 12 is the file size"

While helpful to know, for me it simply shows how awkward the whole naming system is around Crawled Properties. But let's move on and get productive. We want to make things work here...

 

I'll use a real-world scenario to describe a typical problem around Crawled properties and how to solve it: assume you want to search on the "Date Picture Taken" column of the Picture library. After you put a fresh MOSS installation on a server, you can look up in the Search Administration of the Central Administration what Managed Property is available for that kind of search (only Managed Properties can be used in the search!). You'll find one entry:

 
Initial DatePictureTaken Mapping
 
A Managed Property (DatePictureTaken) already exists and has a mapped Crawled property called "ows_Image_x0020_CreateDate". While this looks good at first glance it will actually not help us at all. Why? Because the internal name for the "Date Picture Taken" column in the Picture library is "ImageCreateDate", so the CrawledProperty we'd need would be "ows_ImageCreateDate".
 
Just a quick explanation on the Crawled property naming convention: Crawled Properties are created automatically by the search crawler when it detects new columns that have a value. SharePoint columns always start with "ows_" (probably stands from "Office web server") concatenated with the internal name of the column.
 
So, let's have a look if there is another Crawled Property available with the right name. Under the Crawled Properties section we find this:
 
Initial ImageCreateDate Crawled Properties
 
Hmm, there are even three such Crawled Properties: two with the same, wrong name (including the text/hex version of a blank in the name) and one with the right name... but it's got the wrong type: we need a DateTime field, not a Text field!
 
OK, time to upload some images that include metadata for the "Date Picture Taken" column. A (shameless ;-) plug for our FC.MetadataExtractor product here: it extracts that DatePictureTaken metadata (and more) by default, and puts it in the right column. After that, starting a Crawl will "nudge" the search crawler to recognize the Date Picture Taken column in the Picture library, because it now has data. And voila, we have the "Date Picture Taken" column linked to the right Crawled Property and in turn we can go ahead and link this Crawled Property to the existing "DatePictureTaken" Managed Property (done in the following screenshot with our FC.ImageSearch product, but you can also do that in the Search Administration section of the Central Administration).
 
The right DatePictureTaken Crawled Property
 
But we're still not done: if we'd do a search now we'd get a really unfriendly error from the search service:
 
SearchService Error with Property
 
This is because we now have two Crawled Properties mapped to the Managed Property, but it can only take input from one at a time, so we need to change another setting for the Managed Property to "include values from a single crawled property...":
 
Single Crawled Property mapped
 
Yet another full crawl will help to push the Crawled Property data on to the newly linked Managed Property.
 
Now comes the fun! In the Search Configuration page of the FC.ImageSearch you can simply add the DatePictureTaken Managed Property that is now linked to the library's "Date Picture Taken" column and add it to the properties for the Advanced Search page:
 
Add DatePictureTaken to Advanced Search

 
Now, in the Advanced Search page you can select the "All Images" scope of the FC.ImageSearch solution and then choose from its Managed Properties the DatePictureTaken property:
 

DatePictureTaken search

 
...and that will get the successful search on our "Date Picture Taken" column:
 

DatePictureTaken search result 

 
Well, I still wonder why there are - out of the box - three ambiguous ImageCreateDate Crawled Properties. And what's more, deleting Crawled Properties is not possible in SharePoint, so you'll just have to ignore them.
 
But at least we got the search to work!


Published: May-12-10 | 4 Comments | Link to this post

SearchBox ignores custom scope search result page

Another one out of the "weird" series: now, our FC.ImageSearch solution includes an "All Images" custom scope that has an "ImageSearch.aspx" result page attached to it and usually, when the user selects this scope in the Search Dropdown menu, the search result is shown in the before-mentioned result page. But NOT always!
 
A search with this configuration:
 
SearchBox With All Images Scope
 
...resulted in the dreaded OSSSearchResults page on one of our MOSS test servers:
 
The dreaded OSSSearchResultsPage
 
Hmm, if this was the SearchBox on the landing page of the Search center, you could simply go into its Web Part properties and fix the problem there but, unfortunately, this is the SearchBox on the master page, so you can't simply call "Edit page" for it. What's worse, messing around with the control on the masterpage wouldn't necessarily help much either, as that's only a Delegate control.
 
Well, there's still an easy way to solve this: simply open up the "\12\TEMPLATE\FEATURES\OSearchEnhancedFeature\SearchArea.xml" file and add the following property, which is selected in the screenshot below:
 
SearchBox with added property
Close and save the file, do an "iisreset", refresh your page, re-issue the query and you should see the search result page of the custom scope come up:
 
Correct Search Result page after property modification
 
Easy to solve but still annoying that the default setting of the SearchBox would ignore the result page of the custom scope. If I were the product manager I'd call that a bug, Microsoft probably calls it a feature. ;-)

Published: May-11-10 | 4 Comments | Link to this post
 Next >>