Showing posts with label Sharepoint 2013. Show all posts
Showing posts with label Sharepoint 2013. Show all posts

Wednesday, December 18, 2013

Import query suggestions in SharePoint search

In SharePoint search query suggestion allows users to enter the search terms easily by appearing the suggestion words under the search box. SharePoint automatically create the suggestions depending on the previous search history. We can create query spelling suggestions manually by exporting the query suggestions file.

We can create query suggestions by creating the new text file and adding the query spellings one word per a line.


Save the text file as .txt with UTF-8 encoding format.



To import query suggestions file in SharePoint site Navigate to Search Administration page in SharePoint central Administration (Application Management -> Manage Service Applications -> Search Service Application) and click on “Query Suggestions” link in quick launch Queries and Results section.


In Query Suggestion Settings page, , Select “Show search suggestions” check box and Select “Language for suggestion phrases” section select Language as “English”. In Always suggest phrases section click on “Import from text file” link to upload the text file. 



In “Import phrases for query suggestions” page, Text file with phrases section click on browse button to browse and add query suggestion text file created earlier, click on ok to save the settings. 



Sunday, December 15, 2013

Correlation Tokens in SharePoint workflow

Correlation tokens are unique identifiers in SharePoint that bridges to map the objects between the workflow and windows workflow environment. Windows workflow acts as a intermediate layer to communicate with other software. When incoming request arrives, runtime receives the request and determines the request and identifies the workflow instance. Then it process the request for the instance.

Windows workflow acts as a communication channel for all the workflow instances. We can have two separate correlation tokens for Workflows and task references. We cannot assign the correlation token to workflow task that used for workflow.

We have to declare the correlation token for the workflow in OnWorkflowActivated activity. We have to bind the this correlation token to  each activity in the workflow.
OnWorkflowActivated activity raises when workflow initiated  for SharePoint. This is the first event raised in workflow. Each task should have its own correlation token that provides the task related information. 

Tuesday, December 10, 2013

ViewFormPagesLockDown feature in SharePoint

In General by enabling the anonymous access in SharePoint site, anonymous users will have read-only access to the site. But when we enable anonymous access to SharePoint publishing site, we can have issues with anonymous users in SharePoint site due to ViewFormPagesLockDown feature. This feature will block users to view list view pages. Users can able to access all other web pages. Generally we can face this issue whenever users wanted to comment a blog post as anonymous in SharePoint blog site located in SharePoint publishing site collection.

We can check the ViewFormPagesLockDown feature is active or not by using following Power Shell command.

get-spfeature –site SiteURL


Here SiteURL is URL of the Site to check ViewFormPagesLockDown feature is active. By entering this command we can the list of features that are active in SharePoint site.
By disabling ViewFormPagesLockDown feature we can set anonymous users to access list view pages. to disable that we have to run following PowerShell commands

$lockdownFeature = get-spfeature viewformpageslockdown
disable-spfeature $lockdownFeature SiteURL



here SiteURL is URL of the site to disable ViewFormPagesLockDown feature. By disabling this feature anonymous users can access list view pages as usually.

Monday, December 9, 2013

Configure Web Part page security in SharePoint

In SharePoint webparts are the reusable sections in a SharePoint web page. We can add the functionality to SharePoint site by customizing webparts. We can connect the links to one WebPart to another WebPart by using WebPart connections.

We can manage the security of webparts from SharePoint central administration. To manage the security, Navigate to Security section in SharePoint central Administration, Click on Manage Web Part security link in General security section.


Select web application in Security for Web Part Pages page, Web Application section. In “Web Part Connections” section, we can specify the users to allow the connections by passing data or values from a source Web Part to target Web Part. By Selecting “Allow users to create connections between Web Parts” option we can allow people to create the connection. By Selecting “Prevents users from creating connections between Web Parts, and helps to improve security and performance”

In Online Web Part Gallery section, we can specify users to access the online Web Part gallery. By Selecting “Allow users to access the online Web Part Gallery” option we can allow users to access the online WebPart.

We can allow the scriptable webparts by specifying “allow contributors to add or edit scriptable Web Parts” option in Scriptable Web Parts section. Click on Ok to save the settings


Thursday, December 5, 2013

Content Iterator in SharePoint

In SharePoint object model while getting the data from large lists through SPQuery, we can get SPQueryThrottleException saying that “The attempted operation is prohibited because it exceeds the list view threshold enforced by the administrator”. We can get rid of this exception by using Content Iterator (CI). Content Iterator provides implementation interface for SharePoint objects to regularize the amount of data to be transferred. This will helps queries in on the lists to not put the load on database excessively. It will iterate the content in the list instead of executing the query. So that it will process each item in the list to avoid the throttling limits.

We can process the content iterator to crawl the list items. Following is the sample code will give us the detail about Content Iterator processing

public static void ProcessListItems(SPWeb site)
{ 
string iteratorName = "item iterator"; 
ContentIterator iterator = new ContentIterator(iteratorName);

iterator.ProcessLists(site.Lists,
delegate(SPList list){ 
ContentIterator.EnsureFieldIndexed(list, list.Fields.GetFieldByInternalName("Title").Id);
string query = "<Where><And><BeginsWith><FieldRef Name='Title' /><Value Type='Text'></Value>RT</BeginsWith></And></Where>"; 
ContentIterator itemsIterator = new ContentIterator(iterator);
itemsIterator.ProcessListItems(list,query,true,
delegate(SPListItemCollection items){
foreach (SPListItem item in items){
ProcessItem(item);
}
},null);
},
delegate(SPList list, Exception e)
{
OnListException(list, e);
});
}



Wednesday, December 4, 2013

Retention stages for SharePoint 2013 Document library

In SharePoint Document library retention policies we can set the retention policy for Content type and library document and folders. By applying the retention policies to document library items we can make them delete or make them records with the existing options.

To set the retention policies for library items or folder we have to navigate library settings page and click on Information management policy settings link in Permissions and Management section.


In Information Management Policy Settings page click on Change Source link in Source of retention for this library.



Select Library and Folders option in “Source of Reflection” section. We’ll see a popup with warning message by selecting that option saying that “when library and folder based integration schedules will select, all the Content types will be ignored”, Click on Ok.


We can new section with “Library Based Retention schedule” with description text box. Click on Add a retention stage link to add new retention.




We can see new dialog box specifying the Event and action details. Select the Event and Action for retention stage and click on Ok to save the settings. We can add many retention stages for the document library. Click on Ok in Library Based Retention Schedule page to save the settings.

Wednesday, November 27, 2013

Gantt view errors in SharePoint site- “Microsoft.SharePoint.SPException: This view requires at least Microsoft Internet Explorer 7.0, Mozilla FireFox 3.0, or Apple Safari 3.0.”

In SharePoint 2010, sometime we try to browse the gantt index pages, we can see the error as “Microsoft.SharePoint.SPException: This view requires at least Microsoft Internet Explorer 7.0, Mozilla Firefox 3.0, or Apple Safari 3.0.” as shown the image below.


We can get this error when user agents in SharePoint are not permitted to crawl the content in SharePoint index server. We can fix this by changing Gathering manager value in Registry. To do that Start -> Run -> Regedit


Navigate to following path,
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office Server\14.0\Search\Global\Gathering Manager


In Gathering Manager, Search for “User Agent” and edit the value. Update the value to
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.3; .NET4.0C; MS-RTC LM 8; Tablet PC 2.0)


Click on Ok Save the settings and restart the server.

Tuesday, November 26, 2013

Document information panel in SharePoint

Document information panel in SharePoint contains Meta data about document. This will enables users to enter metadata regarding the document. Documents stored in library will contain other columns to show metadata. Document information panel will display the field for each content type property or column that user can edit.
Document management panel allows users to enter metadata for Microsoft based documents that stored in SharePoint. This will not display by default with the document. We have show this by changing the settings for content type.

We can enable document information panel using the steps below,
Navigate to SharePoint Document library Settings page, Click on the content type which to enable Document Information Panel should be enabled.



Click on Document Information Panel Settings in settings section.



In Document Information Panel Templates section, we can specify the default template or custom template. Select “Always Show Document Information Panel on document open and initial save for this content type” Check-box in Show Always section, Click on OK to save the settings.



By editing the document uploaded to document library we can see the fields as shown below.



Wednesday, November 20, 2013

Difference between Cumulative updates, Service Packs and Public Updates

While applying the updates in SharePoint I have a lot of confusion every time in Cumulative Updates, Service Packs and Public updates. By going through articles in TechNet and some of blog posts, i have found the following differentiation among them.

Service Pack:
It’s an update or combination of previous updates helps to make our product more reliable. It includes new fixes, functionality additions and all fixed that released previously (means Previous Service packs, Cumulative updates). That means if MS people released a service pack recently means that contains all the list of features up to date.

Service packs will not be multilingual. We have to download and install separate service packs for each installed language. We must install service packs for specific product as soon as possible. Microsoft provides all the latest fixes and updates in Service pack. There are no prerequisites for Service pack installations because each service pack includes all the recent updates from product release. Service Packs will not release frequently.

Cumulative Update (CU):
Cumulative update is collection of all the hot-fixes up to date. Generally Office hot fixes are released for every two months in a package. It includes fixes for all the issues collected from hot-fix accepted criteria that related to customer impact or reproducible. 

Cumulative update also includes critical on-demand hot fixes and security updates. It includes all the previous cumulative updates and public updates from previous service pack release. Cumulative updates are multilingual. It includes fixes for all languages. To install CU in our machine,, we have to install recent service pack related to that product (If released). 

Generally cumulative updates are not mandatory to install. We can install them to fix any issue. While downloading CU itself we can see the applicable scenarios in KB article page. There is lot of chances to affect the system. So we have to check before installation or advised by Microsoft people support to install. Cumulative updates releases frequently for a second month like (Feb, April, June, Aug, Oct, Dec)

Public Update and Critical On Demand:
Public update includes product fixes that applicable to large number of customers. Public update also applies for multilingual. To install public update we have to install most recent service pack if released. Sometimes Public Updates may have prerequisites for Cumulative updates also.  Public Update includes security fixes and it is recommended to install ASAP.

Critical On Demand will applicable for less number of customers facing critical problem. It will applicable for a specific problem or issue. COD is not multilingual. We have install COD’s on Microsoft people recommendations only.

Monday, November 11, 2013

Work management service application in SharePoint 2013

We have a new service application in SharePoint 2013 to track the user tasks distributed across the sites/site collections/web applications. This will provide to aggregation of the tasks to a central location in SharePoint server. By using this service users can view their to-do tasks in personal site level. All the tasks will be sync into outlook. We can also see the tasks from Exchange, project server. Based on the provider model, users can sync with other systems. We can see all the tasks in my site tasks.

To view the tasks we have to check with following things,
  • We have to check each of the search service should have valid content source and it should be in Continuous crawling. If we have incremental crawls, crawl should happen in very often time intervals.
  • Application pool using for my site should have SPDataAccess SQL permissions in the content database of the web application.

Work Management Service will work on Search. If crawl was not proper, we cannot see any tasks to display. All the tasks used to store in “WmaAggregatorList_User” list in personal site of individual users.  All the tasks can be viewed tasks page of my site.  We can see the tasks in different sections as, important and Upcoming Tasks, Active Tasks, Completed Tasks.

To Create Work Management Service Application, Navigate to Application Management in SharePoint central administration, select Manage Service Application link.In Service applications page, create new Work Management Service Application, and specify the details as shown in the images below. 





This service will have dependency on User Profile Service and Search Service.
We can see the error with yellow warning triangle as “We are having trouble refreshing your tasks” error on “My Tasks” page as shown below.



We can see this error for multiple reasons,
  • Work Management service application was not created.
  • Work management service application dependent services may not running (Search service or search crawls)
  • Account using for Work Management Service Application is same as Web application or Service Account running for Work Management Service Account is not having full Permissions for User Profile service application.

We can see more details on Work Management service application in the following links

http://www.sharepointcolumn.com/work-management-service-application-in-sharepoint-2013/

Thursday, November 7, 2013

Image sliding in SharePoint using Picture Library Slideshow WebPart

We can get image sliding functionality using SharePoint inbuilt WebPart “Picture Library Slideshow WebPart” Using this in-built WebPart we can slide the images from SharePoint picture Library. We can create and display the slideshow in selected page.

We can add image slider to a page by using the following steps,

Edit SharePoint Page, Click on Insert tab from Ribbon, Select WebPart button to insert the webparts. From categories list, Select “Media and Content” group, Select “Picture Library Slideshow Web Part” and click on Add button to insert the web part.



Edit the web part to specify the images source to display images.



We have to specify the slide duration, Picture Library, Order in webparts edit pane. Click on OK.



We can see sliding images once we updated with the webparts properties.  This helps us to image sliding instead of creating custom images.

Thursday, October 31, 2013

Disabling mobile page redirection in SharePoint 2013

SharePoint 2013 is supported for mobile devices and it will detect the request from mobile devices according to the request it will changes the URL of the page automatically. Mobile view is different from the desktop view in SharePoint. SharePoint is having complete different controls for mobile pages.

We are having Microsoft.SharePoint.MobileControl namespaces for mobile pages which inherits from System.Web.UI.MobileControls namespace. Whenever mobile device request is detected, it will redirected to mobile devices optimized version pages. By default these pages will be located in “_layouts/mobile” folder. By default the team site redirects mobile home page “_layouts/mobile/mblwp.aspx”. We can customize the home page for the mobile devices.

We can restrict redirection for mobile pages, by adding the below lines in web.config file System.web for SharePoint web application

<browserCaps>
<result type="System.Web.Mobile.MobileCapabilities, System.Web.Mobile,            Version=2.0.0.0, Culture=neutral, PublicKeyToken=d04e4d2a43f43d3e"/>
<filter>isMobileDevice=false</filter>
</browserCaps>

Wednesday, October 30, 2013

SharePoint custom workflow Error – This view cannot be displayed because the number of lookup and workflow status columns exceeds the threshold”

While working with SharePoint custom coding on lists, I got an error saying that “This view cannot be displayed because the number of lookup and workflow status columns it contains exceeds the threshold..”

After googling in to the issue, I have found the solution in this post. We can see this problem due to lookup columns value exceeds the SharePoint environment configuration value. When tis error occurs, SharePoint web services will refuse to return the documents. By increasing “List View Lookup Threshold” value, we can fix this error.
We can increase the limit in SharePoint central Administration by using following steps,

Navigate to application Management in SharePoint Central Administration and click on “Manage Web Applications” link.



Select the web application to increase threshold value, Click on “Resource Throttling” in General Application Settings in the ribbon.


In List View Lookup Threshold” section we can specify the maximum number of lookup that Specify the maximum number of Lookup, Person/Group, or workflow status fields that a database query can involve at one time. Change the value to bigger and click on OK to save the settings.

Tuesday, October 29, 2013

Cache profiles in SharePoint

SharePoint adds caching mechanism with output caching that is available in ASP.Net 2.0. It contains Cache profiles that we can name and apply the pages and page items, content types and levels of scales in the development environment.

By using cache profiles we can control the quality level of the output caching in SharePoint site. It will allow or disallow site owners to choose their cache profiles. We can manage the user access permissions to SharePoint depending on the access to the site. Output cache renders the page, same way for users in same right. After creating and deploying the cache profile, any change that affects the cache profile will affects all the content access of the profile.

To enable output cache settings,
Navigate to Site Settings menu and click on Site Collection Output cache in Site Collection Administration section


In the Output Cache Settings page, check Enable output cache check box to enable output cache.



Select cache profile for anonymous from Anonymous Cache Profile list. This applies for anonymous users access for a site in Site Collection. To choose authenticated users from Authenticated Cache profile list. This will apply for authenticated users to access in a site in the Site Collection. To display additional cache information on the site collection pages that including the date and time of the page rendered earlier select Enable debug cache information on pages.

To create new caching profiles,
Navigate to Site Setting menu in SharePoint site. Click on Site collection cache profiles in Site Collection Administration.


Click on New to Create new cache profile.


Provide Title, Display Name, Description for Cache profile in Title, Display name Display Description columns. To ensure that all items in the cache are security trimmed check “Perform ACL Check” check box. To enable the cache, check “Enabled” check box. Enter Duration to specify the number of seconds to keep the cached version available. Check for changes will validates the page requests that the site has and to flush the cache. If we unchecked this system will not check for the updates on the sites.



Vary by custom parameter, Vary by HTTP Header and Vary by User Rights will specifies the values described in the ASP.Net cache policy. By selecting Vary by User Rights, we can ensure that users will have effective rights on the SharePoint site that having on the cached page. Select any value in Cacheability drop down  Select the policies to allow the authenticated users and page layout designers to apply authenticated scenarios. Check “Allow Writers to View Cached Content” to not allowing people with edit rights to cache their pages.


Thursday, October 24, 2013

SharePoint SEO and Robots.txt

Many of public sites developed in SharePoint that are configured to allow anonymous access with restriction that should not be indexed by any search engines. We can prevent that by placing robots.txt file in the root of our SharePoint site.

Robots.txt file is text file that we can place in SharePoint site root level to indicate the search engines that should not crawled or indexed. It is not a mandatory rule for search engine to follow Robots.txt instructions but generally search engines are designed to obey robots.txt commands.

Robots.txt file location should be in the main directory of site that should be easily available for search engines. Because search engines should not search for the entire site for robots.txt file.  They look main directory of site, if it is not find there, then it will assume that current site will not have any robots.txt file. So that it will index everything in the site.

To create a robots.txt file, create a text file with following kind of text,
User-Agent: *
Disallow: /_Layouts/
Disallow: /SiteAssets/
Disallow: /Lists/
Disallow: /_catalogs/
Disallow: /WorkflowTasks/

Here “User-agent” means the section that applies all robots and “Disallow” tells robot that should not index in the site. Save the file as “robots.txt” .Add file in root of the site by using SharePoint designer. Open designer and add the file in All files tab. By adding the file in All files tabs robots.txt file will be located in root site.


To add robots.txt file to the site, navigate to Application Management in SharePoint central Administration, Define managed path for the web application to configure.
In the Path text box, provide the URL as “/robots.txt” and type as Explicit inclusion. Click on Ok to save the settings.


Do IISRESET. If we have permissions problem, Provide read permissions for “Everyone” to robots.txt file.
We can add robots.txt file to a site using following Power Shell commands.

$file = [system.io.file]::ReadAllBytes("robots.txt full path");                                          
$siteToAddFile = Get-SPSite "Site to add the robots.txt"; 
$siteToAddFile .RootWeb.Files.Add("robots.txt", $ file, $true);  

Wednesday, October 23, 2013

Sharing with Everyone in SharePoint 2013

Sharing with everyone option will help users to share without depending on permissions. That will be applicable for “All authenticated users” and “all users in tenant” in the sense “Everyone” and “Everyone excluding external users”.

By default sharing option will be available for SharePoint 2013 site created using existing template. But when we create a site using site template or a solution, try to share the site we’ll get an error saying that “This web template required that certain features be installed, activated and licensed. The following problems are blocking application of the template:” 

After googling some time i have found the solution from office blog URL. All authenticate users is now Everyone. So these settings will not be automatically updated. We have to activate a feature to fix the issue. To activate the feature we need to run the Power Shell commands below,

$siteURL= “URL Of the Site Collection to activate the feature” 
$site = Get-SPSite $ siteURL$site.Features.Add([System.Guid]"10F73B29-5779-46b3-85A8-4817A6E9A6C2")


Here 10F73B29-5779-46b3-85A8-4817A6E9A6C2 is the GUID of the feature to activate.

Tuesday, October 22, 2013

Suggested Content Browser Locations in SharePoint 2013

In SharePoint Site collection, we can configure “Suggested Content Browser Locations” to access the directories easily. When we configure these locations, we can see them as drop down to the users when we select the content SharePoint. To view this link, we need to activate the publishing feature.

We can configure suggested content browser location at site collection level. To configure suggested content browser locations, navigate to Site Settings, in the Site Collection Administration section, click on “Suggested Content Browser Locations” link.


We can see the list. Click on new item to create new suggested location link.













Enter Display Name, URL and Description in the list item.



To check the suggested content browser location navigates to any page, edit the page. Select Insert option.



In the Select Asset dialog, We can see the Suggested link drop down as shown the image below.



So that we can access the suggested location easily by configuring the Suggested Content Browser location.

Friday, October 18, 2013

Get SharePoint feature ID using IE developer tool bar

We can get many errors in SharePoint referring the feature GUID. It is not possible to check quickly what associated feature with that GUID is. We can get the feature GUID using IE developer tool bar.
To get the GUID, navigate to site collection features page (Site Settings -> Site Collection features)



Press F12 button, we can see the IE developer tool bar. Select the feature ‘Activate’ button on any feature that we want to check. We can see “ID” value in HTML as shown in the image. That is features GUID.



To check the current GUID is correct or not, Open SharePoint Management shell and enter following PowerShell command.

Get-SPFeature |  Where-Object {$_.Id -eq “GUID“}

Here GUID is id of the feature. We can see feature display name, ID and Compatibility Level as shown the image below.


Thursday, October 17, 2013

Enable auto approval in SharePoint community site

We can enable auto approval in SharePoint community site to get access automatically without request approval. We can enable the auto approval for only community site; it will not apply membership for any group. Generally auto approval is suitable for open communities without having restrictions.  So whenever we want to configure auto approval, we have to manage the permissions. If we have auto approval in SharePoint community site, whenever new user clicks on Join button, we can get an email. We can manage the permissions of the user in People and Groups settings on Site settings page

To enable auto approval, Click on Community Settings link Community site home page, Community tools WebPart.



We can see “Enable auto-approval” check box (We can see this option only for root site collections. This will not be available for sub sites)



Click on ok to save the settings.