30
Sep

Recently a client asked us if we could link the metadata for a SharePoint search result (which is the green text at the bottom of every search result) to bring the user to the document library / folder where the document is held.

clip_image002[51]

At first this looked like quite a trivial task, edit the xslt to remove everything after the last forward slash:

Turning:

http://topLevelSite/Subsite/DocumentLibrary/folderone/foldertwo/document.doc

Into:

http://topLevelSite/Subsite/DocumentLibrary/folderone/foldertwo

This unfortunately proved not to be possible. This is because SharePoint uses xsl 1.0 which doesn’t have as much functionality as xsl 2.0.

The eventual solution involved:

1) Two templates:
•    countTokens: a template used to count the number of a given symbol within a string, in this case /.

  <!– Function to count the occurences of a string within another string –>
  <xsl:template name="countTokens">
    <xsl:param name="string" />
    <xsl:param name="token" />
    <xsl:param name="result" />

    <xsl:choose>
      <xsl:when test="contains($string, $token)">
        <xsl:call-template name="countTokens">
          <xsl:with-param name="string"
select="substring-after($string, $token)" />
          <xsl:with-param name="token" select="$token"/>
          <xsl:with-param name="result" select="$result + 1"/>
        </xsl:call-template>
      </xsl:when>
      <xsl:otherwise>
        <xsl:value-of select="$result" />
      </xsl:otherwise>
    </xsl:choose>

  </xsl:template>

•    Reverse: A template to reverse a string

  <!– Function to reverse a given string –>
  <xsl:template name="reverse">
    <xsl:param name="input"/>
    <xsl:variable name="len" select="string-length($input)"/>
    <xsl:choose>
      <!– Strings of length less than 2 are trivial to reverse –>
      <xsl:when test="$len &lt; 2">
        <xsl:value-of select="$input"/>
      </xsl:when>
      <!– Strings of length 2 are also trivial to reverse –>
      <xsl:when test="$len = 2">
        <xsl:value-of select="substring($input,2,1)"/>
        <xsl:value-of select="substring($input,1,1)"/>
      </xsl:when>
      <xsl:otherwise>
        <!– Swap the recursive application of this template to
                    the first half and second half of input –>
        <xsl:variable name="mid" select="floor($len div 2)"/>
        <xsl:call-template name="reverse">
          <xsl:with-param name="input"
              select="substring($input,$mid+1,$mid+1)"/>
        </xsl:call-template>
        <xsl:call-template name="reverse">
          <xsl:with-param name="input"
              select="substring($input,1,$mid)"/>
        </xsl:call-template>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>

2) Changes to span class="srch-URL", which resides within p class="srch-Metadata"

<span class="srch-URL">

        <!– Get number of slashes in URL –>
        <xsl:variable name="numberofslashes">
          <xsl:call-template name="countTokens">
            <xsl:with-param name="string" select="$url" />
            <xsl:with-param name="token" select="string(’/')" />
            <xsl:with-param name="result" select="0" />
          </xsl:call-template>
        </xsl:variable>

        <!– Reverse the URL –>
        <xsl:variable name="reversedurl">
          <xsl:call-template name="reverse">
            <xsl:with-param name="input" select="$url" />
          </xsl:call-template>
        </xsl:variable>

        <xsl:variable name="newurl">
          <xsl:choose>

            <!– If it contains 3+ slashes, we can remove what’s left after the last one –>
            <xsl:when test="number($numberofslashes) &gt; 3">
              <xsl:call-template name="reverse">
                <xsl:with-param name="input" select="substring-after($reversedurl, ‘/’)" />
              </xsl:call-template>
            </xsl:when>

            <!– Otherwise just reverse it back –>
            <xsl:otherwise>
              <xsl:call-template name="reverse">
                <xsl:with-param name="input" select="$reversedurl" />
              </xsl:call-template>
            </xsl:otherwise>

          </xsl:choose>
        </xsl:variable>

        <a href="{$newurl}" id="{concat(’CSR_U_’,$id)}" title="{$url}" dir="ltr">
          <xsl:choose>
            <xsl:when test="hithighlightedproperties/HHUrl[. != '']">
              <xsl:call-template name="HitHighlighting">
                <xsl:with-param name="hh" select="hithighlightedproperties/HHUrl" />
              </xsl:call-template>
            </xsl:when>
            <xsl:otherwise>
              <xsl:value-of select="url"/>
            </xsl:otherwise>
          </xsl:choose>
        </a>
      </span>

This code works by reversing the string original string to give the string backwards:

http://topLevelSite/Subsite/DocumentLibrary/folderone/foldertwo/document.doc

Would become:

cod.tnemucod/owtredlof/enoredlof/yrarbiLtnemucoD/etisbuS/etiSleveLpot//:ptth

If there are more than 3 forward slashes in the string, we take the substring after the first slash of the reversed string:

owtredlof/enoredlof/yrarbiLtnemucoD/etisbuS/etiSleveLpot//:ptth

and then reverse it back:

http://topLevelSite/Subsite/DocumentLibrary/folderone/foldertwo

if there are less than 3 slashes:

etiSleveLpot//:ptth

Just reverse the string back:

http://topLevelSite.

VN:F [1.7.2_963]
Rating: 0.0/10 (0 votes cast)
VN:F [1.7.2_963]
Rating: 0 (from 0 votes)
Comments Off
30
Sep

I never remember numbers and version numbers are a good example of figures I can’t keep in my head! 

I found this post on a blog which give a comprehensive list of SharePoint versions and updates. 

 http://www.sharepointdesignerstepbystep.com/Blog/Articles/How%20To%20find%20the%20SharePoint%20version.aspx

It lists all of the updates for MOSS and WSS 2007 along with what version number the update is.   Very useful for those days I can’t remember if an update had been installed or not.

VN:F [1.7.2_963]
Rating: 0.0/10 (0 votes cast)
VN:F [1.7.2_963]
Rating: 0 (from 0 votes)
Comments Off
29
Sep

Here’s an article just published in ComputerWorldUK. It’s quite interesting due to an observation that they make. Here’s an excerpt:

Microsoft SharePoint, also known as Microsoft SharePoint Products and Technologies, is a collection of products and software elements that includes, among a growing selection of components, web browser based collaboration functions, process management modules, search modules and a document-management platform. SharePoint can be used to host web sites that access shared workspaces, information stores and documents, as well as host defined applications such as wikis and blogs. All users can manipulate proprietary controls called "web parts" or interact with pieces of content such as lists and document libraries.

Despite – or maybe even because of – that nebulousness, SharePoint is a brilliant success, for a couple of reasons. In a way, it’s Microsoft’s answer to GNU/Linux: cheap and simple enough for departments to install without needing to ask permission, it has proliferated almost unnoticed through enterprises to such an extent that last year SharePoint Sales were $1.3 billion. But as well as being one of Microsoft’s few new billion-dollar hits, it has one other key characteristic, hinted at in the Wikipedia entry above: it offers an effortless way for people to put content in to the system, but makes it very hard to get it out because of its proprietary lock-in.

Proprietry lock-in? I’ve never found any real issue getting anything out of SharePoint. Lists can export to Excel and document libraries have explorer view. You have API’s and Web services as well! I’d like them to elaborate on what exactly they mean. Looking at the GoogleSites page found here, it certainly doesn’t appear to be a SharePoint contender. Is this the case of a journalist stirring the pot to get some site traffic? Looks like a few other people have responded to his claims.

VN:F [1.7.2_963]
Rating: 0.0/10 (0 votes cast)
VN:F [1.7.2_963]
Rating: 0 (from 0 votes)
Comments Off
22
Sep

Recently I had to create a fixed query page to bring back search results by department instead of searching by Document Library which wasn’t by Department.  I also set up a links web part for quick access to the fixed query results pages 

Step1

Run a full crawl

Step 2

Create a Metadata Property Mapping

Go to Shared Services Administration in Central Admin

Navigate to Search Settings – Metadata property mappings

Select New Managed Property

clip_image002

Enter the Property name

Select Include values from a single crawled property

Click on Add Mapping and select from the list an appropriate crawled property.

Select Allow this property to be used in scopes

Click OK to create the new mapped property.

Step3

Set scopes

In Search Settings select View Scopes

Select New Scope

Enter the title for the scope

Select Specify a different page for searching and enter the url

clip_image004

Click ok when complete

Find the new scope in the view scope list

Click Add Rules

clip_image006

In Scope Rule Type select Property Query

Under Property Query select the new metadata property created, then enter the value to be search

In Behaviour ensure Include – Any Item is selected

Select OK

Step 4

To create the results page

In the site Select Site Actions

In Site Actions Select Create

Under Web Pages Select Web Part Page

clip_image008

Enter the title, accept the default layout and select a document library to store the page (create a new document library for Fixed Query Results Pages)

Select create to create the new page

clip_image010

Add Paging and Search Core Results Web Part as shown above

Click Edit and Modify Shared Web Part for Search Core Results

Under the Results Query Options, select Query 2 for the Cross-Web Part Query ID

Under Fixed Keyword Query enter the managed property name and value eg DepartmentName:”Trauma and Orthopaedics”

Under Miscellaneous enter the scope : Trauma and Orthopaedics Dept

Click Apply and OK to save the changes

Step 5

To add to a links List

In Links List Click Add new link

Add the URL and a description for the link

Click OK

clip_image012

The links should now appear in the list

clip_image014

VN:F [1.7.2_963]
Rating: 10.0/10 (1 vote cast)
VN:F [1.7.2_963]
Rating: 0 (from 0 votes)
Comments Off
22
Sep

logo_microsoft_office2010

Here’s a few videos on Office 2010 covering the following:

  • Word 2010
  • Excel® 2010
  • PowerPoint® 2010
  • Outlook® 2010
  • OneNote® 2010
  • Publisher 2010
  • Access® 2010
  • InfoPath® 2010
  • Office Communicator 2007 R2
  • SharePoint Workspace 2010
  • Visio® 2010
  • Office Web Apps
  • Office Mobile

I’m particularly interested in the Office Web Apps as these seem to be a competitor to Google Docs and I’m keen to see how these fit in with SharePoint 2010. I love the video of this series – Monica Mendoza has been gallivanting around the globe using Office Web Apps to best effect, but she cleverly tells us ‘I wouldn’t give up the full capabilities of my Office Applications on my PC, but isn’t it great to know you can access your office files from anywhere?’.

Well I’m not sure where they see Office Web Apps being used, but I do think a lot of organisations would be more than happy with having thin client Office installed. I wonder if this is only available with a  purchased office install, or whether they intend to place it on the cloud?

As for the others, SharePoint Workspace 2010 is basically Groove repackaged. Outlook 2010 has a handy conversations feature whereby related conversations are grouped together. You can select a conversation and opt out of future responses and Outlook will automatically file them in the recycle bin. Could be useful in escaping the dreaded ‘added to the cc list by accident’ but also could be the cause of some problems when you make a mistake and bin a conversation that turns out to be relevant.

Word has fancy 3d text effects now, as well as the ability to collaborate on a document in real-time with others. I’m looking forward to seeing that in action.

All apps (I think) have what’s called ‘backstage’. Backstage is basically where you do all the mundane document tasks, like print, send as email and set permissions. I like the ‘stage’ analogy as it separates the tasks well and gives emphasis to the fact that your document is ‘out there, being viewed by others’.

VN:F [1.7.2_963]
Rating: 0.0/10 (0 votes cast)
VN:F [1.7.2_963]
Rating: 0 (from 0 votes)
Comments Off
22
Sep

PersonalLooks like we’ll be able to develop for the iPhone or iTouch using C#. The development environment isn’t Visual Studio though.

The benefits to SharePoint aren’t immediately obvious as you can still access SharePoint using the standard web-based approach, but a custom App could be developed that provides a better UI on the mobile pages that SharePoint provides, using SharePoint’s web services.

Here’s some more info:

"Novell has announced MonoTouch 1.0, a commercial SDK that allows developers to build iPhone apps using Microsoft’s .Net Framework instead of the Apple-designated C or Objective-C languages. The SDK leverages Novell’s Mono runtime for running Windows apps on non-Windows systems, allowing developers to utilize code and libraries written for .Net and programming languages like C#. With MonoTouch, the Mono runtime provides such developer services as garbage collection, thread management, type safety, and Web services, said Mono leader Miguel de Icaza." – Taken from slashdot.org

I’ve actually been trying to play about with this. There are a few things to note:

  • You need a Mac for development. Pain in the ass this one but I’m going to see if there’s a windows version of Leopard that can run on VMWare. Mac’s are pretty alien to me but I’m intrigued enough to venture into new territory.
  • Monotouch isn’t free. Costs are $399 1 Personal,  $999 1 Corporate,  $3,999 5 Corporate. However a trial edition does exist that permits you to develop against a simulator.
  • You need the Apple iPhone SDK. To publish on the Apple store it’s $99
VN:F [1.7.2_963]
Rating: 0.0/10 (0 votes cast)
VN:F [1.7.2_963]
Rating: 0 (from 0 votes)
Comments Off
15
Sep

speed SharePoint takes yonks to spin up, especially if you’ve deployed a workflow assembly to the GAC and you need to bounce IIS using an iisreset. It’s typically noticeable using STSADM.

I came across this post and it’s which talks about signed .Net assemblies making calls to the Certificate Revocation List. Here’s a snippet:

 

The problem is that when loading signed assemblies the .net Framework checks the Internet based Certificate Revocation List. As our servers have, like most secure environments,  no outgoing connections to the public Internet, the connection to crl.microsoft.com times out after what appears to be 30 seconds. It probably does this a couple of times in succession, causing a 2 minute wait when spinning up SharePoint.

After the timeout the assembly is still loaded and the software works as expected, though very slow every time a new signed assembly is loaded for the first time, which happens a lot. The worst thing is that no entries are written to the event log and no exceptions are thrown so you are left completely in the dark about why your application is so bloody slow.

They mention a few things, like adding crl.microsoft.com to your hosts file. I’ve yet to try this, but it may be useful in speeding up GAC deployments.

More info here:

And a few warmup scripts

VN:F [1.7.2_963]
Rating: 0.0/10 (0 votes cast)
VN:F [1.7.2_963]
Rating: 0 (from 0 votes)
Comments Off
15
Sep

image

SP2010 So I’ve been looking at how to get a development VM sorted for SharePoint 2010. Surely it’s straightforward you ask? Unfortunately no. SharePoint 2010 is all about the 64’s, namely

SharePoint Server 2010

    • will be 64-bit only.
    • will require 64-bit Windows Server 2008 or 64-bit Windows Server 2008 R2. ll
    • will require 64-bit SQL Server 2008 or 64-bit SQL Server 2005.

    Hmm. This causes a problem as I (and a lot of others) currently develop on 32bit machines using either VMware or Virtual PC under a number of OS’s, such as XP, Vista etc.

I decided to try and get a base Windows 2008 RC2 VM setup with a beta of Visual Studio 2010 and SQL Server 2008, 64bit to see how it hangs together.

VMWare Server
First off I tried VMWare Server 2.0, which is free from the VM site. All I needed to do was install it on my existing machine (a laptop, 3GB memory) and set about creating my new VM. Thing is, apparently not all host machines are capable of running it. VMWare provide a little utility that you can use to determine if your machine can support 64 bit. You can find it here:

http://www.vmware.com/download/ws/drivers_tools.html

So my laptop fortunately passed with flying colours. Next step was to install the Win2k8 R2 OS, which as it happens was painless enough. Be sure to install the VM additions to improve performance.

Speaking of which, I immediately noticed that mouse updates and screen refreshes aren’t what I’m used to with Virtual PC. Lag is definitely noticeable. It actually got worse when SQL 2008 and VS 2010 were installed, with the VM constantly sitting at 100% CPU Usage. I’ve been hitting news groups and forums to determine what I can to to remedy this but unfortunately information is scarce. I’ve actually tried this VM on both my laptop and home PC (Quad Core, 3GB ram) and it still runs very poorly.

Windows 7

Windows 7 is the new contender and it comes with it’s own variant of Virtual PC, that supports and XP mode for older applications. Thing is, Windows 7 Ultimate doesn’t support Windows 2008 RC2 64bit as a guest operating system!  That’s that then!

Virtual Server 2005 on Windows 7

So what about running Virtual Server 2005, another of Microsoft’s VM technologies. on Windows 7

Possibly onto a winner here, I thought… but I was wrong. If you look at this post:

http://aboutdev.wordpress.com/2009/05/21/virtual-server-2005-and-windows-7/

you’ll see that Windows 7 intentionally blocks Virtual Server 2005 from running, with what is known as a ‘hard block’, basically to quote Microsoft:

Hard Block:

The software must exhibit the following behaviour to qualify for a hard block:

  1. The OS is rendered unusable and unrecoverable (includes bug check).
  2. The hard block is preferable to the alternative user experience, including:

    a. The OS would be left partially functional, and no in-context guidance can be given to the user, and the hard block can provide steps to remedy the problem.

    b. An application would be left unusable and unrecoverable (can’t be repaired by uninstall or upgrade). This should be an extremely rare case, since recovering from an application installation should be possible through install/uninstall software. The vendor would need to prove that that is not an option.

    I’ve found a few more posts whereby you can run the following to get Virtual Server 2005 to work on Windows 7 but it’s not supported:

First you should block PCA. I did that by the following way: In the Group Policy go to the Computer Configuration\Administrative Templates\Windows Components\Application Compatibility\ and enable all of the Turn off xxx entries. I think if you enable only the "Turn off Application Compatibility Engine" it would be enough but I wanted to be sure and enabled everything, later we are going to restore the original settings. Then go to the Computer Configuration\Administrative Templates\System\Troubleshooting and Diagnostics\Application Compatibility Diagnostics\ area and disable all of the entries so that we don’t come across any DCOM or driver related error.

IIS have to be prepared as well. Requirements are same as in Vista take a look at this link http://blogs.msdn.com/virtual_pc_guy/archive/2006/10/10/Installing-Virtual-Server-2005-R2-on-Vista-RC1-_2F00_-RC2.aspx you can find the correct settings.
Restart your computer and then you are ready to install the Virtual Server 2005 R2 SP1. Afterwards Virtual Server (VS) should be running and you can check it by Virtual Server Administration Website.

Next restore all settings what you changed in Group Policy and restart your computer. Unfortunately Application Compatibility Engine will detect Virtual server services and block that again. So you have to go to the Virtual Server directory (Usually C:\Program Files\Microsoft Virtual Server\) and rename the vssrvc.exe to something else (example: vssrvc_newname.exe). Open the registry editor and replace all entry which contains "vssrvc.exe" to vssrvc_newname.exe (path, DCOM object details, etc)
Finally restart your computer and enjoy Virtual server 2005 at Windows 7 RC :)

    So what’s the result then?
    Not much really I’m afraid. At this point the only options are:
  • Wait for VMWare to resolve performance issues with VMWare Server & Windows 2008
  • Run Windows 2008 natively on my laptop and use Hyper-V to run guest OS’s for development. A very costly option I might add.
  • Hope that a patch is released for Windows 7, or Windows 7 Virtual PC to support Windows 2008 guests.
    Truthfully I hope it’s the latter as Windows 7 is pretty cool to use.
VN:F [1.7.2_963]
Rating: 0.0/10 (0 votes cast)
VN:F [1.7.2_963]
Rating: 0 (from 0 votes)
Comments Off
07
Sep

To configure a Search results page to return a column name in place of the document synopsis, follow the instructions below.  In this case we were required to replace the document synopsis with a custom column called DocumentSubject from the document metadata.

  • Add the column name as a mapped property.
  • Navigate to a search results page and Edit the page to access the web parts
  • In the Search Core Results Web Part select Edit and Modify the Web Part
  • In the Search Core Results settings window navigate to the Results Query Options
  • Select the Selected columns and enter the column name to be displayed, in this case <Column Name=”DocumentSubject”/> and Click OK to save the change
  • In Data View Properties click XSL Editor
  • Navigate to the section beginning  <div class=”srch-Description”>
  • To remove the synopsis from the search result, delete the section from as highlighted in the screenshot above
  • Under the tag <div class=”Srch-Description”> enter the following line for the column name to appear in the search result
    <xsl:value-of select”=documentsubject”/> </div>
  • Click Save to save the changes, click Apply and Ok the see the changes in the search results page.

The Search Result will now bring back the Document Subject for the document.

VN:F [1.7.2_963]
Rating: 0.0/10 (0 votes cast)
VN:F [1.7.2_963]
Rating: 0 (from 0 votes)
Comments Off
03
Sep

The SharePoint User Group UK, held a virtual event on Thursday 27th August 2009. 

This was a Presentation by Dux Raymond Sy, PMP  on “Best Practices in Gathering Requirements for SharePoint Projects”

Dux has posted a Webcast recording: http://go.meetdux.com/9arx 
 and Slide deck: http://go.meetdux.com/zktt 
 on the SUGUK disscussion boards: http://suguk.org/forums/20537/ShowThread.aspx#20537

Click the links to listen again

VN:F [1.7.2_963]
Rating: 0.0/10 (0 votes cast)
VN:F [1.7.2_963]
Rating: 0 (from 0 votes)
Comments Off
-->