Core results web part: Raw XML property and result

I have come across situations while working with the core results web part xslt to display the results, I just want to see what property is retrieving what value. Raw xml is the best way forward!

Edit the core results web part, expand Display Properties, select the XSL Editor button. Inside the text box, copy the existing xslt out of the editor and paste the following into it:

<?xml version=”1.0″ encoding=”utf-8″?>

<xsl:stylesheet version=”1.0″ xmlns:xsl=”http://www.w3.org/1999/xsl/transform”&gt;

<xsl:output method=”xml” version=”1.0″ encoding=”utf-8″ indent=”yes”/>

    <xsl:template match=”/”>

         <xmp>

              <xsl:copy-of select=”*”/>

       </xmp>

</xsl:template>

</xsl:stylesheet>

Click OK and save the page.

Reload the page and the Raw XML will be displayed for search results!

Handy xsl 🙂

 

 

 

The file or folder name contains characters that are not permitted

This is a very misleading error message to get, especially when the cause and solution has NOTHING related to what the message is referring to.

I came across this error while attempting to deploy my site definition. I added a few things to my site definition, one of these was a aspx page referring to my master page.

The error:

<%@ Page language=”C#” MasterPageFile=~masterurl/custom.master” …../>

The fix:

<%@ Page language=”C#” MasterPageFile=”_catalogs/masterpage/custom.master” …../>

Done!

Using session state in HttpModule – SharePoint 2010

I recently created a HTTPModule for a SharePoint 2010 web application and I planned to store some values in session variables.

In my httpmodule, I am using the context_PreRequestHandlerExecute as an entry point :

void context_PreRequestHandlerExecute(object sender, EventArgs e)
{
          HttpContext ctx = ((HttpApplication)sender).Context        

          ctx.Session.Add(“Phil Lau”, “SharePoint”);
           …
}

I was expected to be able to use the Session state from the get-go, but no, it returned an null exception when attempting to use the Session state to store a value. In the Visual Studio Immediate window, ctx.Session returns null. This prevented me from storing values into the session state.

The solution 🙂 (Yes, you have to enable session state in SharePoint 2010 web applications)

 

Two things I had to do:

1) Enable Session State for the web application

a)  Open up the web.config for your web application, do a CTRL+F for sessionstate

b) When you find <pages enableSessionState=”false” enableViewState=”true” … change enableSessionState to
“true”

c)  Save web.config

2) Add the Session http module into my web.config

a) In same web.config as above, go to the httpmodules section. This section looks like this <modules runAllManagedModulesForAllRequests=”true”> <remove name=”AnonymousIdentification”/> …….

b) Locate <remove name=”Session” /> and delete it

c) Save web.config and refresh your web site

 In the Visual Studio Immediate window, ctx.Session returns null. This prevented me from storing values into the session state.

 

Done! This worked for me, I was able to access and use the session state!

Deployment error: failed to load due to invalid xml: Name cannot begin with ‘%’

The situation when I come across this error is during the deployment and activation of a master page. The problem is that I added the .masterpage file as an element manifest rather than an element file in the Feature.xml definition that deploys the master page to a site collection.

The solution:

Add the .masterpage file as an element file not as a element manifest in the Feature.xml definition!

Tag cloud for folksonomy

The Tag Cloud web part is the quickest way to view the folksonomy being created in SharePoint. You can configure this web part to show your tags or from all users.

The font size of the terms indicate how popular they are 🙂

Terms, term set, managed terms, managed keywords ! Huh?

Terms – A word/phrase that can be associated with an item in SharePoint 2010

Term set – A collection of related terms

Managed terms – Predefined terms that can only be created by users with the appropriate permissions and are often organized into a hierarchy.

Managed keywords – Words/Phrases that have been added to SharePoint 2010 items. Also known as Enterprise keywords are part of a single, non hierarchal term set called the keyword set.

Term store – A database that stores both managed terms and managed keywords

Group –  A group is a container for term sets

Lets be Social

I Like It

  •  The I Like It button is a simple button on the ribbon that enables users to tag the current item. This action will appear in the news feed for the user’s profile, allow colleagues within the organisation to view what the user has tagged as something he/she may like reading.

Ratings

  • Ratings allow users to provide quick feedback about how they rate a particular document. To enable/disable this, go to General Settings ->  Rating Settings and select from the available radio buttons

My Profile

  • My profile page provides information about the user, tagged items, connected colleagues, information about the organisation, post, associated memberships and activity feeds that display user activities in SharePoint.

  • Tags & Notes

Tags & Notes allow you to make up your own tags and apply those to SharePoint items. These tags are not predefined so the user can create as many tags as they desire to associate with items. This open taxonomy is referred as folksonomy.