Show thumbnail image of JPGs within SharePoint search results

In SharePoint 2010 it is really easy to enable the search center to include a thumbnail of JPG images. The required XSLT is already there and you only have to add the file type "jpg" within the search administration (and a full crawl of course):

 

 

 

 

 

However, it works for images within a picture library only. To enable it also for JPGs in "normal" document libraries (e.g. "PublishingImages" which is is, other than the name would indicate, not a picture library), go to your search center results.aspx, edit the page and then edit the "search core result" web part. Make sure you uncheck "Use Location Visualization" (obviously, isn't it? ;-).

Now click "XSL Editor..." and copy/paste that XSLT to modify it within your favorite editor. Look for <xsl:template match="Result">.

There you can see at the first "xsl:when" that it tests on contentclass "STS_ListItem_PictureLibrary". I've just copied the entire "xsl:when" block and modify it.

The first modification is to test if the result is a jpg. Sadly enough there is no "indexOf" in XSLT, so this one is a little bit dirty:

<xsl:when test="contains(url, '.jpg') and not(contains(url, '.jpg.'))">

The second change is where the thumbnail will be shown. I don't want to load the full big JPG so I decided to go with the really nice built-in feature of SharePoint to get a thumbnail of any image just by modifying the URL.

To get a thumbnail from a JPG stored in any SharePoint library just add "/_t/" between the library and the filename and replace the filename extension with "_jpg.jpg":

http://sp2010/DocLib/_t/Test_jpg.jpg

 

So here is the interesting part before the modification:

<div class="srch-picture2">
    <img class="srch-picture" src="{picturethumbnailurl}" alt="" />
</div>


And after the modification:

<div class="srch-picture2">
    <img class="srch-picture" alt="">
        <xsl:attribute name="src">
            <xsl:value-of select="concat(substring-before(url,title),'_t/',
translate(title,'.jpg','_jpg'),'.jpg')"
/> </xsl:attribute> </img> </div>


At the end your XSL should contain the new "xsl:when" between the existing one and the "xsl:otherwise":

 

 

 

 

 

After saving this and the entire page, you should get a nice looking result:

Search Host Controller Service in "Starting" state

On my SharePoint 2013 developer machine I had an issue with the Search Service.

On the "Services on Server" page, the "Search Host Controller Service" showed the status "Starting". After some googling on Bing, I found a post on the Microsoft Forum. Thanks to "SPJeff" here is the solution:

Copy the following script to a new .ps1 file and execute it within the SharePoint PowerShell console (run as (Farm-) Administrator):

$acl = Get-Acl HKLM:\System\CurrentControlSet\Control\ComputerName
$person = [System.Security.Principal.NTAccount]"Users"
$access = [System.Security.AccessControl.RegistryRights]::FullControl
$inheritance = [System.Security.AccessControl.InheritanceFlags]"ContainerInherit, ObjectInherit"
$propagation = [System.Security.AccessControl.PropagationFlags]::None
$type = [System.Security.AccessControl.AccessControlType]::Allow
$rule = New-Object System.Security.AccessControl.RegistryAccessRule($person, $access, $inheritance, $propagation, $type)
$acl.AddAccessRule($rule)
Set-Acl HKLM:\System\CurrentControlSet\Control\ComputerName $acl

$sh = Get-SPServiceInstance | ? {$_.TypeName -eq "Search Host Controller Service"}
$sh.Unprovision()
$sh.Provision($true)

After a reboot everything is now working as expected:

image

Install SharePoint 2013 Preview on Windows Server 2012 RTM

I’ve just tried to install SharePoint 2013 Preview on a blank Windows Server 2012. The problem: The prerequisite installer had a lot of problems.

First of all, ASP.NET 4 could not be installed. After some digging around in the log file I found that the setup failed on this line:

"C:\Windows\system32\cscript.exe" "C:\Windows\system32\iisext.vbs" /enext "ASP.NET v4.0.30319"

I had to install "IIS6 Scripting Tools" manually. Additionally I had to install "Windows Identity Foundation 3.5" manually via "Add Roles and Features" within the "Server Manager".

Now SharePoint 2013 is up and running on a dev VM.

SPSync 0.7 available

A new version of the SharePoint / Windows Explorer synchronization tool is available. It provides now a lot more robust synchronization mechanism, especially for renaming of files on the server-side.

ADFS authentication now works regardless how long the app is running. If the authentication cookie is expired it will automatically be renewed.

There are also a lot of minor issues resolved, so download the new version now. If you have the previous version make sure that you uninstall it and install the new version manually, because there was an issue with the setup so you won’t get updated automatically.

Please update to the latest version now. DOWNLOAD HERE

To provide feedback use support (at) spsync(dot)net or the FEEDBACK button on http://spsync.net

A new version of SPSync is available

SPSync gets one step closer to a final version.

The most important thing: It can now connect to SharePoint sites by using NTLM or ADFS claims based authentication. Also SPSync now uses ClickOnce so it can start without the need for administrator permissions and updates automatically. Furthermore a lot of minor fixes are included to improve the sync capabilities.

Regarding the setup process, I will include a “standard” MSI install package for the final version to be ready for enterprise automatic software deployments.

One known issue: Only HTTPS servers are supported right now. The next version should include HTTP support also.

Please update to the latest version now. DOWNLOAD HERE

To provide feedback use support (at) spsync(dot)net or the FEEDBACK button on http://spsync.net

SPSync Beta

SPSync is now available as a public beta. You can download it here. It works now with large files. I’m currently working on integrating ADFS/Claims authentication. Currently only Windows authentication (NTLM) is supported.

I would like to know, what else you would expect from such an application. Please provide feedback via the feedback button on http://spsync.net or directly via uservoice here.

Sync SharePoint Document Libraries in Windows Explorer like Dropbox

A few weeks ago I started working on a new tool. All of you know Dropbox: It has nearly zero UI and just do what it is supposed to do.

I’m working a lot with SharePoint 2010 as it is my job and I also really like it. What I don’t like is how to work with document libraries that are mainly used as a file store. Of course, I know meta data and all these stuff what you can do with SharePoint, but sometimes you just want to synchronize a folder within Windows Explorer with a document library in SharePoint.

Microsoft already created a tool for that (or better: bought it from Groove ;-) It is now called SharePoint Workspace. It can sync document libraries and also custom lists. You then have an offline copy of an entire SharePoint site. BUT: It is somewhere “within SharePoint Workspace”. You cannot define a “normal” folder on your hard disk as the sync target.

That’s why I’ve created a new tool called SPSync which is intended to close the gap.

User Interface

The UI of SPSync mainly consists of an icon in your taskbar:

image

 


It has a context menu, where you can manage all sync configurations:

image

image

 

 

 

 

 

 

A configuration consists of a name, the local folder, the SharePoint site URL, the title of the document library, the conflict handling mode and the credentials to use. If the conflict handling mode is set to manual, a balloon will popup on any conflict and you can choose what you want to do.

That’s all for now what you can configure, but I will extend it in the next weeks/months.

Technical Details

First of all: The password is stored encrypted with the Windows Data Protection API and bound to the current user. Therefore it cannot be decrypted on any other machine or by any other user on the same machine.

The communication with SharePoint is done by the SharePoint Client Object Model (Client OM). The sync core is built from scratch and contains a meta data store to also be able to handle deleted files. SPSync checks for changes automatically every 30 minutes and also actively monitors the local folder for any changes. That means local changes are sync’d immediately to SharePoint.

Currently there are no overlay icons within the Windows Explorer (like you have it for the Dropbox folder), because those Explorer Shell Extensions require a native (C++) implementation.

How to get it?

Visit http://spsync.net to get more information.

Proxy Switcher 3.6

Proxy Switcher version 3.6 has just been released.

Together with the new version, the new web site with its own domain has officially been launched. You can find Proxy Switcher from now on directly here:

http://proxyswitcher.net

The new version includes a new network detection method which has been requested by many users: Detect the network based on the MAC address of the gateway. Also a few fixes and performance improvements are included, especially the Ping feature did not always work as expected.
You can find the change log in the download section of the new site.

Visual Studio Achievements

Viele kennen sicher diesen Blog Eintrag. Sehr lustig, und nun gibt es sie wirklich, die VS Achievements.

Dank Channel9 gibt es neben der Visual Studio Extension auch noch eine REST API und ein fertiges Widget. Meine Achievements seht ihr rechts in der Leiste. Einige sollten aber eher Minuspunkte geben... ;-)

Also ladet euch die Extension runter und sammelt fleißig Achievements.