Friday, April 29, 2016

Major changes in Sitecore versions

Sitecore Basics

 1.      What are the major changes in Sitecore versions 7.0, 7.1, 7.2, 7.5, 8.0 and 8.1?

Sitecore 7.0
Sitecore 7.1
Introduced item bucket concept to support storage of large numbers of content items
SPEAK UI framework is introduced to accelerate custom application development
Sitecore tagging /facets for improved search experiences
The Sitecore Item Web API (previously available as a separate download) is now distributed as part of the CMS
A new Sitecore.ContentSearch namespace that contains new indexing and search APIs
Support for MVC 4, along with other fixes and improvements.
Change in the search provider architecture allowing different search engines to be swapped in to support both published site and internal CMS search




Sitecore 7.2
Sitecore 7.5
Performance improvements in publishing
Introduction of xDB (Sitecore Experience Database)
Sitecore MVC supports ASP.NET MVC 5.1
Introduction of xProfile
Multivariate testing configured per language



Sitecore 8.0
Sitecore 8.1
Redesigned cross-platform SPEAK-based Sitecore client interfaces

Redesigned Launchpad offering access to all platform applications

Introduced Federated Experience Manager (FXM)

Enhanced Experience Analytics

Versioned layouts – a different presentation set on different versions of different languages for the same item

Content testing and optimization reporting
Sitecore 8.1 provides full integration with Sitecore Commerce 8.1, ensuring the users’ purchase transaction is seamlessly integrated with the overall digital Experience.

Sitecore Detection Services—IP lookup and device detection services built into the platform—as well as rules editors. Now you can customize your users’ experiences based on their location and optimize their load times and display based on the actual device they’re using

Sitecore has packaged the product into two version(flavor’s),one for those who interested in market-leading web content management system (Sitecore Experience Management 8.1 -CMS only mode) and another those who want to use Sitecore to manage the entire customer experience (Sitecore Experience Platform 8.1)



Below link details about the sitecore versions & why upgrade to Sitecore XP 8.1
https://www.eduserv.org.uk/~/media/Files/News%20and%20Events/PDF%20files/WhyupgradeSXP81WPLTR.PDF

2. Difference between TreeList and TreelistEx?
For performance, you should use the TreelistEx field type in your data templates instead of the Treelist field type.
With a Treelist, the client renders the selection tree and the list of selected items whenever the user selects an item that contains the field.

With a TreelistEx, the client renders only the list of selected items, and does not render the selection tree until the user clicks the Edit command above the field. This is especially important for Treelists that invoke queries that can consume processing time on the server.

3. What is shared layout and final layout in Sitecore8?
    In Sitecore, you can specify shared presentation details for all versions of an item, in all    languages, and           you can specify different presentation details for each individual version of an item and for each language.
In this way, you can present a different composition of the layout depending on the version and language of the item. For example, in a multi-language solution, where you have different marketing strategies or promotional offers that are relevant only for a specific language, you are not restricted to display the same components for all languages.

For each item, you can specify the presentation details for:
The shared layout – stores the presentation details that are shared by all the versions of the item in every language. These presentation details are based on the standard values of the template that the item is based on.

The final layout – stores the combination of the presentation details on the selected version of the item and the presentation details of the shared layout. This is the layout that your visitors see on your website.
For more detail see the link https://doc.sitecore.net/sitecore_experience_platform/content_authoring/getting_started_with_content_authoring/creating_content/edit_the_layout_of_an_item

4. What is computed index fields?
Computed index fields allows you to perform additional processing before adding data to an index. For example, you may want to store the contents of a droplink field (the raw value being a GUID) as the target item's name, or a particular field value from the target item.

5. What are untokenized and tokenized indexType?
 untokenized: computed field is indexed as a single string
 tokenized: computed field is split up into separate string or phrase for display /faceting    purpose for ex: ‘Parameshwar Savale” will be split up into “Parameshwar” and “Savale”. In case of untokenized it will store it as a single string in index.
For more info please refer the blog post :
http://www.sitecore.net/learn/blogs/technical-blogs/martina-welander-sitecore-blog/posts/2013/09/sitecore-7-search-tips-computed-fields.aspx

6. What are Dynamic placeholders and need of dynamic placeholder in Sitecore?

Dynamic Placeholders for Sitecore allows you to add the same placeholder name several times. This can be across one or more renderings and even the same placeholder can be used multiple times in a single rendering.

Dynamic Placeholders simply use the rendering ID to create a unique placeholder name. If more than one dynamic placeholder with the same name is in a rendering it will also append on an incrementing number. Behind the scenes the Dynamic Placeholders extracts the placeholder name to ensure the correct allowed renderings are shown.

if we use rendering guid for unique place holder name, the problem is placeholder key won’t be user friendly, making it harder to identify which one of the dynamic placeholders was actually being used by a component.

Why – Suppose say we have two same containers on the page(i.e. container is having two placeholders “ph_left” & “ph_right”), the keys for the first container would dynamically be generated as ph_left1, ph_right1 and then for the second container ph_left2, ph_right2 and so on.

For more info please see https://pageditor.wordpress.com/2016/02/09/define-the-key-for-dynamic-placeholders/
http://fes-sitecore.blogspot.in/2015/10/dynamic-placeholders-and-tabs-in.html

7. What are data providers in Sitecore & when to implement custom data providers in Sitecore?
There are many ways of integrating external data with Sitecore but a data provider is one of the most powerful. You can get external data to display and behave as native Sitecore data -- to be browsed, rendered and related to other content within Sitecore.

Sitecore provides data providers that access the file system and the relational databases that the CMS supports, including SQL Server and Oracle. You can write data providers to support additional databases technologies;

You can also write custom data providers that access external systems to expose data in external systems as if it were native data in the CMS; for an example, the YouTube Integration Sitecore Shared Source project that represents a YouTube video library as Sitecore media items.
8. What is item rendering?
Item renderings allow items to contain information about how to render themselves when rendered in the context of another item. Refer http://www.sitecore.net/learn/blogs/technical-blogs/john-west-sitecore-blog/posts/2012/06/mvc-item-renderings-in-the-sitecore-aspnet-cms.aspx
@Html.Sitecore().ItemRendering(“id”) - renders items using the rendering set in their "Renderers" field. This enables us to create a component with different presentation for each item.
ItemRenderer:- Invokes the mvc.renderRendering pipeline once for each of the item renderings specified in the __Renderers field of an item.
Item rendering :
·         Allow you to render an item with whatever rendering has been assigned to it

·         Let you render a collection of items with differing renderings

Use Item Rendering only if you need different HTML markup for each item. If you only need different styling per item, just add a CssClass field to your carousel slider template and and use CSS rules to do your styling. – for detail http://www.matthewdresser.com/sitecore/carousel-sitecore-mvc-(part-3-item-renderings)




Tuesday, April 26, 2016

Sitecore useful links

All the Sitecore Links at one place      

I recommend 2 to 4+ year experience guys to go through this book Sitecore Experience Platform 8 Guide


Well explained xDB concepts can found here

Tools for Building wire frame and mock-ups 

Download a free trial of Axure RP, business drawing software for creating mock-ups and wire frames of application user interfaces. This easy to use software

Thursday, April 21, 2016

xDB is not storing interaction data into collection database

Check the following points if xDB doesn’t collect interaction data into collection database

1.      You need have Sitecore 7.5 or later version.
2.      If you are setting up Xdb in Sitecore XP 8.1 then you need to have a Sitecore license
file having xDB keys in it.

3.      Check for the VisitorIdentification tag in the layout/Views
In Mvc one need add @using Sitecore.Mvc.Analytics.Extensions @Html.Sitecore().VisitorIdentification() tag,  without it, it all your traffic may be treated as a 'robot' and will not get tracked.
In web form u need to add <sc:VisitorIdentification id="VisitorIdentification" runat="server" />
4.      Verifying connection to the Collection Database in ConnectionString.config file using MongoDB client i.e. Open the MongoDB client and connect to the appropriate database.

To test your connection to MongoDB, do some local visits to your website. Any visits you make to your website appear as new interactions in the collection database.

Expand the analytics database and then expand the Collections node.
You can see four new collections relating to browser and system information, interaction or contact collections appear.

5.      Change the session end default timeout setting from 20 to 1 minute
Open the web.config file and navigate to <sessionState> node make the changes <sessionState mode="InProc" cookieless="false" timeout="1">
Make a visit to your website test page then refresh MongoDB. Data should now appear in MongoDB after one minute. 

It is highly recommended that you change the default timeout setting for testing purposes only. The default setting should be restored as soon as possible.

Reference

Tuesday, April 12, 2016

Step by step guide for setting up solr 5.x in Sitecore

Getting Started

1. Installing the Solr
You will need the Java Runtime Environment (JRE) version 1.7 or higher. At a command line, check your Java version like this: $ java -version java version "1.8.0_60".

Below are the different ways of installing the solr for Sitecore
1.      Using Bitnami
2.      By following the instructions from Solr reference guide/Github.
3.      Through the Docker for windows

Through Bitnami :
1.      Go the following URL https://bitnami.com/stack/solr & download the “bitnami-solr-5.5.0-1-windows-installer.exe”.
2.      Run “bitnami-solr-5.5.0-1-windows-installer.exe” which will install solr
3.      Open the Solr admin interface by typing localhost://portno/solr (ex- http://localhost:8983/solr/#/)  in the url bar of your browser.

Now you have installed solr and the next step is to configure solr for Sitecore

2. Configure Solr
 1. Go to the path (path where you installed Bitnami) “C:\Bitnami\solr-5.5.0-1\apache- solr\solr\configsets” copy “basic_configs” folder and it paste outside the “configsets” folder i.e. C:\Bitnami\solr-5.5.0-1\apache-solr\solr\ and rename it to index name u are setting up. See the below screen shot for the same.
      

2. Next step is going to solr admin interface and create a core.

3. Generate the schema.xml file using Sitecore CMS I.e. going to Control panel in Sitecore àIndexing à Generate the Solr Schema.xml file
   
4. Copy the generated schema.xml from target location to the Sitecore website root folder.

5. Download the solr support package from https://dev.sitecore.net/Downloads/Sitecore_Experience_Platform/Sitecore_81/Sitecore_Experience_Platform_81_Update2.aspx , you can find it in the Additional Tool section.

6. The support package contains most commonly used five IOC containers such as Castle Windsor, AutoFac, Ninject, StructureMap, Unity. We need choose suitable IOC container. In this blog post I have choosen Castle Windsor Container.

7. Copy the following dll to the bin folder of Sitecore website root from the support package.

      

8. By default Sitecore uses lucene search for its search functionality. So we need disable all the lucene related config files to enable solr search functionality. In my case I’ve already disable the lucene related config files. Please refer the below screen shot.
  To Disable .config file , rename file from .config to .example/.disabled.


For Sitecore XP 8.1 you need disable/enable some extra config files. Below is the list of the config file that you need enable/disable.

Enabled the following configs:
"App_Config\Include\Sitecore.MarketingReportingRole.config",
"App_Config\Include\Sitecore.PipelineProfiling.config",
"App_Config\Include\Sitecore.Xdb.Remote.Server.config",
"App_Config\Include\Sitecore.Xdb.Remote.Server.MarketingAssets.config",
"App_Config\Include\Sitecore.PathAnalyzer.Services.RemoteServer.config",
"App_Config\Include\Sitecore.MarketingProcessingRole.config",
"App_Config\Include\Sitecore.PipelineProfiling.config",
"App_Config\Include\CES\Sitecore.CES.DeviceDetection.CheckInitialization.config",
"App_Config\Include\Sitecore.ContentSearch.Analytics.config"
"App_Config\Include\Sitecore.ContentSearch.Solr.DefaultIndexConfiguration.config",
"App_Config\Include\Sitecore.ContentSearch.Solr.Index.Analytics.config",
"App_Config\Include\ContentTesting\Sitecore.ContentTesting.Solr.IndexConfiguration.config"
Disabled the following configs:

"App_Config\Include\ContentTesting\Sitecore.ContentTesting.Lucene.IndexConfiguration.config",
"App_Config\Include\Sitecore.ContentSearch.Lucene.DefaultIndexConfiguration.config"
"App_Config\Include\Sitecore.ContentSearch.Lucene.Index.Analytics.config",
"App_Config\Include\Sitecore.ContentSearch.Lucene.Index.Core.config",
"App_Config\Include\Sitecore.ContentSearch.Lucene.Index.Master.config",
"App_Config\Include\Sitecore.ContentSearch.Lucene.Index.Web.config"
"App_Config\Include\Sitecore.Marketing.Definitions.MarketingAssets.Repositories.Lucene.Index.Master.config",
"App_Config\Include\Sitecore.Marketing.Definitions.MarketingAssets.Repositories.Lucene.Index.Web.config",
"App_Config\Include\Sitecore.Marketing.Definitions.MarketingAssets.Repositories.Lucene.IndexConfiguration.config",
"App_Config\Include\Sitecore.Marketing.Lucene.Index.Master.config",
"App_Config\Include\Sitecore.Marketing.Lucene.Index.Web.config",
"App_Config\Include\Sitecore.Marketing.Lucene.IndexConfiguration.config",
"App_Config\Include\FXM\Sitecore.FXM.Lucene.DomainsSearch.DefaultIndexConfiguration.config",
"App_Config\Include\FXM\Sitecore.FXM.Lucene.DomainsSearch.Index.Master.config",
"App_Config\Include\FXM\Sitecore.FXM.Lucene.DomainsSearch.Index.Web.config",
"App_Config\Include\ListManagement\Sitecore.ListManagement.Lucene.Index.List.config",
"App_Config\Include\ListManagement\Sitecore.ListManagement.Lucene.IndexConfiguration.config",
"App_Config\Include\Social\Sitecore.Social.Lucene.Index.Master.config",
"App_Config\Include\Social\Sitecore.Social.Lucene.Index.Web.config",
"App_Config\Include\Social\Sitecore.Social.Lucene.IndexConfiguration.config"

9. It is also necessary to download the Castle.Core and Castle.Windsor dlls from
and https://www.nuget.org/api/v2/package/castle.core/3.1.0 Extract both the package & copy the dll from “lib\net40-client” and paste it in the bin folder of Sitecore website.

10. Make the following changes in the global.asax file
<%@ Application Language='C#' Inherits="Sitecore.ContentSearch.SolrProvider.CastleWindsorIntegration.WindsorApplication" %>

11. To check whether solr is properly configured or not, browse the solr admin interface & Sitecore instance. You should be able to browse your website without any error.

Reference

Saturday, April 9, 2016

Setting up external membership provider in Sitecore

Steps to enable asp.net Membership in Sitecore using Switching Providers

     1. Create a asp.net membership db by running command aspnet_regsql.exe  in command prompt or you can run aspnet_regsql.exe located in C:\windows\Microsoft.NET\Framework\v2.0.50727

Reference Links:

       2. Add a connection string for ExtranetUser Membership Database in Connectionstrings.config.

     3. Make the following Configuration changes in web.config
a.       Add an element /configuration->system.web->membership->providers->add to web.config that exposes your membership provider class.

            b. Change the value of the realProviderName attribute of the                           /configuration/system.web/membership/providers/add element in web.config with a name attribute containing the value sitecore to switcher.

           c. Within the /configuration/sitecore/switchingProviders/membership element in web.config, add the following <provider> element, where the value of the providerName attribute containing the value sitecore to switcher.

(If step 3 is not clear )
Web.config:
In membership section,
·         change realProviderName to "switcher"
·         copy "sql" node and change name and connectionStringName to "external"
In switchingProviders section,
·         add "external" node with domains "external" )

<system.web>
<membership defaultProvider="sitecore" hashAlgorithmType="SHA1">
<Providers>

<! -- change realProviderName to "switcher" -->
<add name="sitecore" type="Sitecore.Security.SitecoreMembershipProvider, Sitecore.Kernel" realProviderName="switcher" providerWildcard="%" raiseEvents="true" />

<add name="sql" type="System.Web.Security.SqlMembershipProvider" connectionStringName="core" applicationName="sitecore" minRequiredPasswordLength="1" minRequiredNonalphanumericCharacters="0" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="256" />
<add name="switcher" type="Sitecore.Security.SwitchingMembershipProvider, Sitecore.Kernel" applicationName="sitecore" mappings="switchingProviders/membership" />

<! -- Copy "sql" node and change name and connectionStringName -->

 <add name="myProvider" type="System.Web.Security.SqlMembershipProvider" applicationName="sitecore" connectionStringName="ExternalMemberShipProvider"  minRequiredPasswordLength="1"  minRequiredNonalphanumericCharacters="0" requiresQuestionAndAnswer="false"  requiresUniqueEmail="false"  maxInvalidPasswordAttempts="10" />
</providers> </membership>
    
  d. Within the /configuration/sitecore/switchingProviders/membership element in web.config, add the       following <provider> element, where the value of the providerName attribute matches the value         of the name attribute of the <add> element created previously

   <switchingProviders>  <Membership>
      <provider providerName="sql" storeFullNames="true" wildcard="%" domains="*" />
      <provider providerName="myprovider" storeFullNames="false" wildcard="%"                               domains="extranet"/>
</membership>

e. Under <system.web><roleManagerdefaultProvider="sitecore" enabled="true">
     <roleManager> tag add the following element
<add name="myProvider" type="System.Web.Security.SqlRoleProvider" applicationName="sitecore"  connectionStringName="ExternalMemberShipProvider" /> 
 And within <switchingProviders>
<provider providerName="AmetekRoleProvider" domains="extranet" storeFullNames="false" wildcard="%" />

f. Under <system.web> <profile> tag add the following element
<add name="myprovider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ExternalMemberShipProvider" applicationName="sitecore" /> and within <switchingProviders>
<provider providerName="AmetekProfileProvider" domains="extranet" storeFullNames="false" wildcard="%" />
     4. Create a role specific to site with extranet domain in CMS.

References