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 | 2 Comments | Link to this post

Debugging SharePoint Custom Admin Pages

I think everyone knows about the <customErrors> tag in the web.config to enable error details to be displayed by the Runtime Error page, which you usually get when your aspx markup and related code-behind has a problem.
 
Normally this is set in the Virtual directory of the Web application along with another version of the web.config file in the Template/Layouts folder of the SharePoint HIVE.
 
But if you are developing Admin pages you need to set the RemoteOnly setting in the web.config that is found in the Template/Admin folder of the SharePoint HIVE.
 
 

Published: Oct-20-11 | 0 Comments | Link to this post

FC.MetadataExtractor 3.2 released for SharePoint 2010


On the heels of the 2.3 release (for SharePoint 2007), comes the announcement for the 3.2 release for SharePoint 2010.

All the goodies introduced in the 2.3 release have also found their way into the 3.2 release.

Of course we didn't stop there, and implemented several new features that will make it even easier for you to extract the right metadata.

The Highlights of this latest release are:
  • Better looking Thumbnails
  • Thumbnails everywhere
  • Thumbnails and Metadata Extraction for RAW, PSD, or DNG files
  • Metadata Extraction from images in folders and their subfolders
  • Full Control over all metadata extraction processes running in the background
  • Writing Metadata back to the image
  • More, and improved, Default Mappings
  • New "Standard Mappings"
  • Adding and Editing a Field Mapping - Simplified!

 

Better looking Thumbnails

This latest release has a new component called "Unified Thumbnail". One of its most prominent features is that it uses the color profile stored in the image to provide a better thumbnail quality. See for yourself:

 

SharePoint:

FC.MetadataExtractor:

 SharePoint Thumbnail  FC.MetadataExtractor Thumbnail

 

Thumbnails everywhere

By default, SharePoint does not create thumbnails in any document library other than the Assets and the Pictures library. SharePoint also does not create thumbnails whenever a file does not have the windows filetype extension in the filename.


The Unified Thumbnail enables thumbnails in all kinds of document libraries. Even in the Assets and Pictures libraries it can add value by creating thumbnails for formats not supported by SharePoint.

 

Unified Thumbnail

 

Thumbnails and Metadata Extraction for RAW, PSD, or DNG files

SharePoint only creates thumbnails for a few formats, like jpg and png. Other formats, e.g. RAW formats like CR2 or NEF, or even PSD images are not supported by SharePoint.


The Unified Thumbnail provides thumbnails for all formats for which a WIC codec has been installed. Such codecs might be available from your camera vendor, but there are also low-cost codecs available from vendors like Ardfry (PSD, DNG) and FastPictureViewer (wide range of RAW codecs).

Keep in mind that 64-bit (x64) codecs are required for use with SharePoint 2010.

 

Metadata Extraction from images in folders and their subfolders

If you have a document library with images organized in folders, the images in this library can now be processed by the FC.MetadataExtractor in one simple step: Select the top-level folders and start the "Manual Extraction". The 3.2 release will automatically parse through all folders and sub-folders to extract the thumbnail and metadata from all images in that library.

 

Full Control over all metadata extraction processes running in the background

Extracting metadata and creating thumbnails for a large number of images can be a lengthy operation. This process is conducted in the background to allow the user to continue to work. Until now, whether any such process is active and what its progress is has been somewhat invisible. This is why we introduced the "Extraction Control", which provides transparency over any such process running in the site, and also enables the site collection administrator to cancel any of these processes.


Background Extraction Processes

 

Writing Metadata back to the image

SharePoint 2010 added the functionality to some SharePoint columns to write metadata back to the image. We've tested this functionality and have slightly modified our Default Mappings to include the following columns:

  • Copyright (previously: CopyrightNotice was used)
  • Keywords
  • Author (previously: Photographer was used)
  • Date Picture Taken
  • Comments
  • Subject

 

Note: The Comments and Subject metadata is written back to the image, but not to the typical location in the file, so it might not show in your image editing application.

 

The standard SharePoint columns "Title" and "Name" also write back to the image.

 

More and Improved Default Mappings

Several Field Mappings have been added and many of the previously existing mappings have been enhanced, e.g. by explicit access to png and gif fields. For a complete list of the current Default Mappings please see the product manual which is included with the demo download from our website.

 

New "Standard Mappings"

Metadata mappings configured for one library can now easily be copied to other libraries in the site collection using the new commands:

 

Standard Mappings

 

Adding and Editing a Field Mapping - Simplified!

Any existing Field Mapping can now be entirely modified later on. Gone are the days when this sometimes required creating a new field mapping. Plus, a link is now provided to create a missing column in the library and several checks are performed automatically to avoid creating an invalid mapping.

 

Go Get It!

The new release is already available as a download from our website. Go give it a spin and see if you like the new and improved features!


Published: Jul-06-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

SharePoint 2010 Translation "Gem"

We'll be releasing the FC.ImageSearch for SharePoint 2010 product also in German. While testing we recognized this very innovative translation of a list column name:
 
English: "CheckedOutUserId"
 
German: "ID des Benutzers, der das Element ausgecheckt hat"
 
Perfect down to the punctuation with the comma after "Benutzers". ROTFLMAO :-D
 
Hey, whoever translated that column name, you have a career opportunity: you should switch jobs and start writing books rather than technical documentation.

Published: Oct-27-10 | 0 Comments | Link to this post

More "Site Assets" issues

Haileselassi!
 
While we're finishing the port of our FC.ImageSearch product to SharePoint 2010 we're coming across a number of flaws with the search result mechanism and especially the "Site Assets" library, which is a new feature in the commercial version of SharePoint 2010.
 
What's wrong with this picture?
 
Site Assets search result data 
 
sitename
Well, the "Site Assets" part (marked in yellow in the screenshot above) is not a sub site but in fact the name of the library. So, the real sitename should be http://2k8r2x64sp10.
 
What's worse is that if you have a search result that is stored within a folder of a library then even the folder name will be concatenated to the sitename!
 
contentclass
As written in the previous blog post, the Site Assets library has a BaseTemplate and RegistrationID of "851". Well, that lack of better naming exists in the search result as well: while the Picture library has a proper contentclass of type "STS_ListItem_PictureLibrary", the Site Assets library is of contentclass "STS_ListItem_851".
 
picturethumbnailurl
Well, as you can see there are no thumbnails available for the images in a Site Assets library. Of course, that is wrong: as you probably noted, the Site Assets library absolutely contains the usual thumbnail and web preview images in the "_t" and "_w" folders. The links just don't get carried over to the search result.
 
 

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

Site Assets library has RegistrationID 851

In case you haven't noticed: if you modify the Ribbon and think your modifications are fine by attaching to RegistrationID 101 (Document Library) then you won't have them show up for the Site Assets library, which has its own RegistrationID of 851.
 
I couldn't find the msdn entry for it. I am sure it's there as documentation is supposed to be sooo much better for SP 2010 (pun intended ;-)
 
Well, once I had the RegistrationID and did a search specifically for it I found 1 (ONE) page that had this info and also a comprehensive list for RegistrationID's: "Mike Smith's Tech Training Notes".
 
I love the SharePoint community! Otherwise half the solutions out there wouldn't exist.

Published: Oct-03-10 | 2 Comments | Link to this post

Crawled Properties not accessible from content application in SharePoint 2010

As we are in the process of porting our FC.ImageSearch product to SharePoint 2010 we came across a couple of Properties that are inaccessible if the code is running in the context of a Content Application, e.g. the AllCategories property of the schema object (more details on that here).
 
To make a long story short: Microsoft has opted to block access to certain data in the object model in order to prevent administration work to be done from a content application (instead of utilizing the central administration web application).
 
While I agree that security is always a concern I think that the current implementation is too tight.
 
One Example: In our scenario we want to give the site administrator the information which columns of the site's lists are mapped by which Managed Property's, so that he/she then knows how to configure the Advanced Search page properties accordingly. However, that's not possible as the CrawledProperty's - the "link" between columns and ManagedProperty's - are inaccessible from the content application.
 
Again, I consider it right to prevent any modifications to be made to the search' objects from a content application, but why cut off read access?
 
To solve this we implemented a custom WCF service on the central administration web application which the content application's code can talk to. While that's not bad or difficult it still doesn't feel right.
 
What do you think?

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