Tuesday, June 25, 2013

Clicking the icon in Type column is highlighting the item instead of launching the document

In our farm we had one issue which almost all users were complaining about .

When we Click the document icon it doesnt load the document immediately as in Sharepoint 2007

We then found that it is By design and  also found a Kb article

http://support.microsoft.com/kb/2457975

which says .

Cause :

This behavior is the result of the fact that in SharePoint 2010, the list view web part has been mostly replaced with the new and customizable XSLT List View Web Part. The XSLTListViewWebPart relies on XSLT files for rendering of items in the document library. Out of the box, it depends on the files main.xsl, fldtypes.xsl and vwstyles.xsl rendering of the document library views. These XSLT files are present in the following location:
\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\template\layouts\XSL

Among these files, the fldtypes.xsl is the file responsible for certain rendering of the XSLT views. The XSLT code that facilitates the rendering of icons in the document library view is located in this file. In the OOB environment, this XSLT code does not generate a hyperlink for the icons.

Resolution :

Essentially, the solution involves using a separate xsl file with the desired rendering (including the link) for the document icons. This requires one-time implementation and the solution file should not be touched by any patches/upgrades. The following are the key points to note about this solution:

The solution is based on the fldtypes extensibility available in SharePoint 2010. This has been documented in the following link:
http://msdn.microsoft.com/en-us/library/ff606773.aspx


The solution does not involve administrative overhead after the initial implementation. In addition, it should not be affected by the application of future updates and service packs to the SharePoint 2010 environment.

STEPS:
=====================
1.       Create a text file using Notepad and copy the following XSLT code into the file.
2.       Save the file as fldtypes_docicon.xsl and copy it into the Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\template\layouts\XSL folder on your WFEs.
3.     Reset IIS and browse to the SharePoint site.

<xsl:stylesheet xmlns:x="http://www.w3.org/2001/XMLSchema" xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" version="1.0" exclude-result-prefixes="xsl msxsl ddwrt" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:SharePoint="Microsoft.SharePoint.WebControls" xmlns:ddwrt2="urn:frontpage:internal" ddwrt:oob="true">
    <xsl:output method="html" indent="no"/>
  
  <xsl:template ddwrt:dvt_mode="body" match ="FieldRef[@Name='DocIcon']" mode="Computed_DocIcon_body">
    <xsl:param name="thisNode" select="."/>
    <xsl:param name="folderUrlAdditionalQueryString" select="''"/>
    <xsl:choose>
      <xsl:when test="$thisNode/@FSObjType='1'">
        <xsl:variable name="alttext">
          <xsl:choose>
            <xsl:when test="starts-with($thisNode/@ContentTypeId, &quot;0x0120D5&quot;)">
              <xsl:value-of select="$thisNode/../@itemname_documentset"/>: <xsl:value-of select="$thisNode/@FileLeafRef"/>
            </xsl:when>
            <xsl:otherwise>
              <xsl:value-of select="$thisNode/../@listformtitle_folder"/>: <xsl:value-of select="$thisNode/@FileLeafRef"/>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:variable>
        <xsl:variable name="mapico" select="$thisNode/@HTML_x0020_File_x0020_Type.File_x0020_Type.mapico"/>
        <xsl:variable name="folderIconPath">
          <xsl:call-template name="GetFolderIconSourcePath">
            <xsl:with-param name="thisNode" select="$thisNode"/>
          </xsl:call-template>
        </xsl:variable>
        <!-- This is a folder -->
        <xsl:choose>
          <xsl:when test="$RecursiveView='1'">
            <img border="0" alt="{$alttext}" src="{$folderIconPath}" />
            <xsl:choose>
              <xsl:when test="$thisNode/@IconOverlay != ''">
                <img src="/_layouts/images/{$thisNode/@IconOverlay.mapoly}" class="ms-vb-icon-overlay" alt="" title="" />
              </xsl:when>
            </xsl:choose>
          </xsl:when>
          <xsl:otherwise>
            <xsl:variable name="FolderCTID">
              <xsl:value-of select="$PagePathFinal" />RootFolder=<xsl:value-of select="$thisNode/@FileRef.urlencode" /><xsl:value-of select="$ShowWebPart"/>&amp;FolderCTID=<xsl:value-of select="$thisNode/@ContentTypeId" />&amp;View=<xsl:value-of select="$View"/><xsl:value-of select="$folderUrlAdditionalQueryString"/>
            </xsl:variable>
            <a href="{$FolderCTID}" onmousedown ="VerifyFolderHref(this, event, '{$thisNode/@File_x0020_Type.url}','{$thisNode/@File_x0020_Type.progid}','{$XmlDefinition/List/@DefaultItemOpen}', '{$thisNode/@HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon}', '{$thisNode/@HTML_x0020_File_x0020_Type}', '{$thisNode/@serverurl.progid}')"
               onclick="return HandleFolder(this,event,&quot;{$PagePathFinal}RootFolder=&quot; + escapeProperly(&quot;{$thisNode/@FileRef}&quot;) + '{$ShowWebPart}&amp;FolderCTID={$thisNode/@ContentTypeId}&amp;View={$View}{$folderUrlAdditionalQueryString}','TRUE','FALSE','{$thisNode/@File_x0020_Type.url}','{$thisNode/@File_x0020_Type.progid}','{$XmlDefinition/List/@DefaultItemOpen}','{$thisNode/@HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon}','{$thisNode/@HTML_x0020_File_x0020_Type}','{$thisNode/@serverurl.progid}','{$thisNode/@CheckoutUser.id}','{$Userid}','{$XmlDefinition/List/@ForceCheckout}','{$thisNode/@IsCheckedoutToLocal}','{$thisNode/@PermMask}');">
              <img border="0" alt="{$alttext}" title="{$alttext}" src="{$folderIconPath}" />
              <xsl:choose>
                <xsl:when test="$thisNode/@IconOverlay != ''">
                  <img src="/_layouts/images/{$thisNode/@IconOverlay.mapoly}" class="ms-vb-icon-overlay" alt="" title="" />
                </xsl:when>
              </xsl:choose>
            </a>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:when>
      <xsl:otherwise>
        <xsl:choose>
          <xsl:when test="$IsDocLib">
            <a onfocus="OnLink(this)" href="{$thisNode/@FileRef}" onmousedown="return VerifyHref(this,event,'{$XmlDefinition/List/@DefaultItemOpen}','{$thisNode/@HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon}','{$thisNode/@serverurl.progid}')"
   onclick="return DispEx(this,event,'TRUE','FALSE','{$thisNode/@File_x0020_Type.url}','{$thisNode/@File_x0020_Type.progid}','{$XmlDefinition/List/@DefaultItemOpen}','{$thisNode/@HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon}','{$thisNode/@HTML_x0020_File_x0020_Type}','{$thisNode/@serverurl.progid}','{$thisNode/@CheckoutUser.id}','{$Userid}','{$XmlDefinition/List/@ForceCheckout}','{$thisNode/@IsCheckedoutToLocal}','{$thisNode/@PermMask}')">
              <xsl:choose>
                <xsl:when test="not ($thisNode/@IconOverlay) or $thisNode/@IconOverlay =''">
                    <xsl:choose>
                        <xsl:when test="not ($thisNode/@CheckoutUser.id) or $thisNode/@CheckoutUser.id =''">
                            <img border="0" alt="{$thisNode/@FileLeafRef}" title="{$thisNode/@FileLeafRef}" src="/_layouts/images/{$thisNode/@HTML_x0020_File_x0020_Type.File_x0020_Type.mapico}"/>
                        </xsl:when>
                        <xsl:otherwise>
                            <xsl:variable name="alttext"><xsl:value-of select="$thisNode/@FileLeafRef"/><xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&#10;</xsl:text><xsl:value-of select="$thisNode/../@managecheckedoutfiles_header_checkedoutby"/>: <xsl:value-of select="$thisNode/@CheckoutUser.title"/></xsl:variable>
                            <img border="0" alt="{$alttext}" title="{$alttext}" src="/_layouts/images/{$thisNode/@HTML_x0020_File_x0020_Type.File_x0020_Type.mapico}" />
                            <img src="/_layouts/images/checkoutoverlay.gif" class="ms-vb-icon-overlay" alt="{$alttext}" title="{$alttext}" />                            
                        </xsl:otherwise>
                    </xsl:choose>                  
                </xsl:when>
                <xsl:otherwise >
                    <img border="0" alt="{$thisNode/@FileLeafRef}" title="{$thisNode/@FileLeafRef}" src="/_layouts/images/{$thisNode/@IconOverlay.mapico}" />
                  <img src="/_layouts/images/{$thisNode/@IconOverlay.mapoly}" class="ms-vb-icon-overlay" alt="" title="" />
                </xsl:otherwise>
              </xsl:choose>
            </a>
          </xsl:when>
          <xsl:otherwise>
            <img border="0" src="/_layouts/images/{$thisNode/@HTML_x0020_File_x0020_Type.File_x0020_Type.mapico}">
              <xsl:attribute name="alt">
                <xsl:value-of select="$thisNode/@Title"/>
              </xsl:attribute>
              <xsl:attribute name="title">
                <xsl:value-of select="$thisNode/@Title"/>
              </xsl:attribute>
            </img>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>
  
</xsl:stylesheet>


 

Friday, June 21, 2013

Enable "Did you Mean" in Sharepoint 2010.

How to Enable "Did you mean" in Sharepoint 2010.

You should have full control on the site .

On your search results page select "Edit Web Part" for the Search Summary web part.

In the Miscellaneous section, check the "Show Messages" checkbox.

This will enable the display of the "Did you Mean?" messages. This checkbox is not checked by default.


Suggestions after users run queries

The Search Center provides improved "did you mean" suggestions in case keywords in a search query appear not to be what the user intended. In addition, when the search system returns results for a query, the Search Center provides suggestions for related searches.

Reference :

 http://technet.microsoft.com/en-us/library/ee667266(v=office.14).aspx#BKMK_FF_ENDUSER

Suggestions while typing search queries - Sharepoint 2010

As a user types keywords in the Search box, the Search Center provides suggestions to help complete the query. These suggestions are based on past queries from other users.

SP 2010 and Search Server 2010 Express Have a new feature for search called Search Suggestions.
This is the same thing as we get in google .

The Suggestions database is automatically built based on what search results are clicked on.

It takes 6 clicks within a year for SharePoint to add a suggestion If an administrator needs to add a suggestion manually this can be done using PowerShell.

The commands below will add the suggestion, "Suggestion" to the first Search Service Application and run the Prepare Query Suggestions timer job now. The Prepare Query Suggestions timer job is set to run daily between 1AM and 11PM local server time so this will speed up the time before the suggestion will appear in the search query suggestions list.

$ssa=Get-SPEnterpriseSearchServiceApplication
New-SPEnterpriseSearchLanguageResourcePhrase -SearchApplication $ssa -Language en-US -Type QuerySuggestionAlwaysSuggest -Name "Suggestion"
$timer=Get-SPTimerJob|? {$_.Name -eq "Prepare Query Suggestions"}
$timer.RunNow()

After the above commands have been run and the timer job has been run, the suggestion and other suggestions in a Search Service Application can be listed by running the following command from the SharePoint 2010 Management Console.

Get-SPEnterpriseSearchQuerySuggestionCandidates -SearchApp $ssa

To remove the suggestion, run the following command.

Remove-SPEnterpriseSearchLanguageResourcePhrase -SearchApplication $ssa -Language En-Us -Type QuerySuggestionAlwaysSuggest -Identity "Suggestion"


Reference : Manage query suggestions

http://technet.microsoft.com/en-us/library/hh148698(v=office.14).aspx

Friday, June 14, 2013

How to Learn Sharepoint ? . A lot of Share point Videos Shared

Hi Readers ,

A lot of readers do mail me or call me to know how to learn sharepoint . Please check the link i am sending it will surely help .

http://list.ly/list/5IC-sharepoint-videos
 

Wednesday, June 12, 2013

How to setup Alerts In Sharepoint 2010 ?

To setup Alerts in Sharepoint

We need to navigate to the List or Library on which we need to setup alerts .

1. Click on the Library tab under Library Tools .
2. Below in the ribbon you will see an option alert me .
3. when you hover you will see 2 options
               a. set alert on this Library
               b. manage my alerts
4. you can now set alerts on this library
5. Send alerts to has your name by default.
6. Delivery method can be set to SMS or Email .
7. The other options are understandable

1. change type
2. send alerts for these changes
3. when to send alerts

Click ok and you are done .

You can also setup alerts on item Level file level .

You just need to hoever the mouse on the file you will find a drop down when you click on the drop down
You will find a option to set Alerts .

Other options are the same .

Can I setup Alerts for my Team members ?

Yes you can setup alerts for your team members .

When you setup alerts like in the earlier post

http://sharepointdirect.blogspot.in/2013/06/how-to-setup-alerts-in-sharepoint-2010.html

By default your name will be reflected over there Change it to the name of the member or the group to which we need to setup alerts .

You can also Convert a Outlook DL into a Security group and send alerts to the DL .

Note : All nested DL`s also should be converted into a security group to be resolved in sharepoint

What are Alerts In Sharepoint ?

Alerts are an e-mail and Short Message Service (SMS) notification service in SharePoint . Users can create alerts to notify them of changes to list items (item-level alerts), documents, lists (list-level alerts), or document libraries.

Alerts in SharePoint Foundationare quite flexible; when you create an alert you have options such as
when to be notified and what kind of changes trigger the alert.

 You can also select whether the alert for a particular list, item, or library will be sent by e-mail or by SMS message. Users and administrators can manage alerts, and developers can customize alerts.

Friday, June 7, 2013

Error while making permission level changes in the Advanced settings . Sharepoint 2010

After the export to excel issue .

User wanted to make some permission level changes on the survey . so that Users can read or edit only their surveys .

We went to the advanced settings . tried to change it to





we got an error

"Cannot change item-level permissions because this list or document library contains a column that enforces unique values"

we then tried researching and then found that one column "Title"
had that option set to yes as below

We tried to make some changes in the same column from choice to single line of text and enforce Unique values to no
However we got one more error .

 "The type of this column cannot be changed because it is currently being indexed "

Ahhh .. Now we first took a backup of the survey list .

We then created a new column which worked fine . then deleted the Title Column

And we were able to make the changes .

We were able to now make the changes in the advanced settings . As there was only one column which had that option checked .

Export to excel missing from Actions In the Sharepoint 2010 Survey list .

One of my client came in saying i cannot take a export of surveys the users have filled (completed)

It was a Very silly problem

I found that yes really there was no option to take an export and atlast found that it was related to the view .

You need to be in the Overview View only then you get the option under actions
Export to excel .

Ahhh The issue was resolved .

Users cannot see the checked out files in the folder/ library

I Came across a Issue today wherein the user opened a ticket for the below issue Issue : Users cannot see the checked out files in the fo...