Monday, May 26, 2014

Issue: This item could not be crawled because the repository did not respond within the specified timeout period. Try to crawl the repository at a later time, or increase the timeout value on the Proxy and Timeout page in search administration. You might also want to crawl this repository during off-peak usage times.

Issue: i have done full crawl on my content source.


But when i check my content source crawl log it is showing 0 success and 1 error.

















When i clicked on error, it was showing the following message,
"This item could not be crawled because the repository did not respond within the specified timeout period. Try to crawl the repository at a later time, or increase the timeout value on the Proxy and Timeout page in search administration. You might also want to crawl this repository during off-peak usage times."


Solutoin: Increase the timeout value on the Proxy and Timeout page in search administration. Follow the below steps
Go to central admin->Manage service Applications
Click on Search service application.
Go to farm search administration below central administration.
Click on Time out seconds.




Now increase time out here am changing to 120 seconds.


And also IE proxy settings also causes for the issues, for that follow the step

Internet Options>Connections>LAN settings. Uncheck 'Automatically detect settings'.

Now run the full crawl on content source and then check crawl log for that content source.



Monday, May 5, 2014

How to add web part to master page in SharePoint 2013

I have a question, Can we add web part to master page??
Generally we can add web parts in web part zones, But master page doesn't have web part zone.
So can we add web part to master page?


"A Web Part is a server control that provides a specific piece of SharePoint functionality, and a Web Part zone is a container that determines the layout, behavior, and other properties of the Web Parts contained in that zone."

Web Part zones are available on page layouts but not on master pages—the purpose of zones is to allow authors to modify Web Parts, and authors typically don't edit a master page.

This means we can not modify the web parts which are added in master page but we can add web part to master page.

Here my requirement, I have one custom web part, which displays date and time. Now i want to add this web part to master page.

Step 1:

Activate SharePoint publishing infrastructure feature under site collection feature.
Activate SharePoint publishing feature under manage site feature.

Step 2:

Open SharePoint site in SharePoint designer 2013 and check out master page's html page.

Now open SharePoint site in IE, Click on site actions  --> Design Manager


Step 3:

In design manager page, click on Edit Master Pages. It will show master pages, click on your master page which was checked out in previous step.




Step 4:

Click on "Snippets" in master page preview, it will open snippet gallery.


Step 5:

In Snippet Gallery, Click on Other Web parts and select your custom web part or else you can select OTB web part also. Once you select your web part, you can see code under HTML Snippet.


Copy the snippet by clicking on "Copy to clipboard".


Step 6:

I want to show this web part between site title and search box control.

Now open your master page in SharePoint designer 2013 and find "<div class="ms-tableCell ms-verticalAlignTop">
<div id="searchInputBox">" div tag.

Now add one more div tag before these two div tags.

<div class="ms-tableCell ms-verticalAlignTop"> </div>


Then page HTML snippet in this div tag.

<div class="ms-tableCell ms-verticalAlignTop">
<!--CS: Start Clock Snippet-->
<!--SPM:<%@Register Tagprefix="ac401823a"  Namespace="ClockWebPart.VisualWebPart1" Assembly="ClockWebPart, Version=1.0.0.0, Culture=neutral, PublicKeyToken=c9aa41227deb2659" %>-->
<!--MS:<ac401823a:ClockWebpart runat="server" LeftMargin="5" TopMargin="5" Description="Local clock using jQuery" ImportErrorMessage="&#60;%$Resources:core,ImportErrorMessage;%&#62;" Title="Clock" __MarkupType="vsattributemarkup" __WebPartId="{a95b03f7-6800-4eba-8457-99d8d4f6ebeb}" WebPart="true" IsClosed="false" ID="g_a95b03f7_6800_4eba_8457_99d8d4f6ebeb">-->
<!--PS: Start of READ-ONLY PREVIEW (do not modify)-->
<div id="ctl00_g_a95b03f7_6800_4eba_8457_99d8d4f6ebeb" WebPart="true" __WebPartId="{a95b03f7-6800-4eba-8457-99d8d4f6ebeb}" __MarkupType="vsattributemarkup">
</div>
<!--PE: End of READ-ONLY PREVIEW-->
<!--ME:</ac401823a:ClockWebpart>-->
<!--CE: End Clock Snippet-->
</div>


Now save your master page and click on "Preview in browser".


Step 7:

Check in the master page and publish major version then every user can able to see the changes in master page.


Thanks for snippet...  :).

Sunday, May 4, 2014

Tip: Sign in as different/another user in SharePoint 2013

In Microsoft SharePoint Server 2013, you notice that the Sign in as Different User menu option is missing.

Access the SharePoint site by using the following URL
http://ukreddy:1234/_layouts/closeconnection.aspx?loginasanotheruser=true

OR

Start Internet Explorer by using the Run as different user option, and then go to the SharePoint site.

OR

we can add "Sign in as different user" option to menu.
Please follow this link

Error: System.ArgumentException: Value does not fall within the expected range.


When i was trying to activate publishing feature in sitemanager am getting unexpected error.
When i checked log file with corelation id, i have found System.ArgumentException: Value does not fall within the expected range. And also i found dependencies for feature 'PublishingWeb'.

Publishing Feature activation failed. Exception: System.ArgumentException: Value does not fall within the expected range.

Feature Activation: Failed to ensure feature dependencies for feature 'PublishingWeb' (id: '94c94ca6-b32f-4da9-a9e3-1f3d343d7ecb'), exception thrown: System.ArgumentException: Value does not fall within the expected range.  

Then i try to activate feature using powershell command or Sharepoint Management Shell with force.

Here the commands

$siteUrl = "http://ukreddy:3456/"
$siteCollection = Get-SPSite $siteUrl
Enable-SPFeature "PublishingSite" -Url $siteCollection.Url -force
Enable-SPFeature "PublishingWeb" -Url $siteCollection.Url -force