Sitecore Experience Editor with different Site context

Challenge:

In Multi-Site Sitecore solution we allow user to load any site in Experience Editor with any Sitecore Site URL. We also provide an option to the user to create Sites on the fly. The problem we were facing was during Experience Editor. In Experience Editor you can make use of query string and get the Item based on sc_itemid. That was working absolutely fine. Now we provided an option to a user in Ribbon to change the color. Every Custom Site that user creates on the fly – each have their own fields to change the color.  We were not getting the correct site because Webutil was providing the below information.

Sitecore.Web.WebUtil.GetRawUrl(): “/-/speak/request/v1/expeditor/ExperienceEditor.GenerateFieldUrl”

Speak Request URL: http://sc8.com:80/-/speak/request/v1/expeditor/ExperienceEditor.GenerateFieldUrl

Now in this request you don’t get sc_itemid – we wanted to get the actual item id (sc_itemid) based on the current Site which user has loaded in Experience Editor, so that we can show/load the correct option to change the color.

Read More

Sitecore – CopyTo() not working?

Are you getting the below error while copying Sitecore Media Item(s) from one node to another. For example – from Canada Site to Australia Site?
13664 19:28:32 ERROR Project.WCMS.Extension.Shell.Applications.CopyProductData.SitecoreExtensions.CopyField: Error while saving copiedMediaItem in Copy Product Data Wizard [System.InvalidOperationException: An instance of Sitecore.Data.Items.Item was null. Additional information: Failed to find the root item "/".
at Sitecore.Diagnostics.Assert.IsNotNull(Object value, String message)
at Sitecore.Web.UI.HtmlControls.DataContext.GetState(Item& root, Item& folder, Item[]& selected)
at Sitecore.Web.UI.HtmlControls.DataContext.GetState(Item& root, Item& folder)
at Sitecore.Web.UI.HtmlControls.DataContext.ItemCreatedNotification(Object sender, ItemCreatedEventArgs args)
at Sitecore.Data.Events.ItemCreatedDelegate.Invoke(Object sender, ItemCreatedEventArgs args)
at Sitecore.Events.Event.RaiseItemCreated(Object sender, ItemCreatedEventArgs args)
at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
at Sitecore.Data.Engines.DataEngine.RaiseCreated(EventHandler`1 handlers, Item item, SafeDictionary`2 visited)
at Sitecore.Data.Engines.DataEngine.DataEngine_CopiedItem(Object sender, ExecutedEventArgs`1 e)
at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
at Sitecore.Data.Engines.EngineCommand`2.RaiseEvent[TArgs](EventHandler`1 handlers, Func`2 argsCreator)
at Sitecore.Data.Engines.DataCommands.CopyItemCommand.Executed()
at Sitecore.Data.Engines.EngineCommand`2.Execute()
at Sitecore.Data.Engines.DataEngine.CopyItem(Item source, Item destination, Boolean deep, String copyName, ID copyId)
at Sitecore.Data.Managers.ItemProvider.CopyItem(Item source, Item destination, Boolean deep, String copyName, ID copyId)
at Sitecore.Data.Managers.ItemManager.CopyItem(Item source, Item destination, Boolean deep, String copyName, ID copyId)
at Project.WCMS.Extension.Shell.Applications.CopyProductData.SitecoreExtensions.CopyField(Item item, Field sourceField) in \Project.WCMS.Extension\Shell\Applications\CopyProductData\CopyProductDataWizard.cs:line 982]

Read More

Sitecore Executive Dashboard Error: An error occurred while loading report data. Please try again or contact your administrator.

Are you getting the below exception in Executive Insight Dashboard then this post is for you.

1. Error

Executive Insight Dashboard isn’t loading data at all. This was happening with us when we were accessing production analytics data. There was no any message in Logs. It was very confusing for us because you have no clue what is happening without logs.  Read More

Working with lac users in Sitecore

Challenge:

Recently we were working on a Project which includes lac of users. Our application includes Login/Logout Mechanism – which is the base for any Ecommerce Application. Yes it is an Ecommerce Application.

 

Initially while developing a Project we were having few records around 2000. So Sitecore was performing pretty well. But as we went Live with 300000 records. Sitecore went down. It took roughly 4+ Minutes to GetAllUsers. And 5 Minutes to process all the records, compare Custom Property which was needed in our case. So it was taking around 10 Minutes to Login. It was very critical time for us to get the things done as soon as possible. With the help of Sitecore – We came to know that only best approach in this case is to go with SQL Query. And Yes – Stored Procedure did our Job. We created a Stored Procedure that does the processing which we were doing via Code. So that reduced time to less than 6 Seconds – Hurray! (Refer: https://sitecorebasics.wordpress.com/2015/11/21/sitecore-login-time-from-10-minutes-to-seconds/ for more details on this.)
Sitecore internally uses the Membership Object of Asp.Net.

Read More

My First Sitecore Module – Google Product Feed

Hello Folks,I have been working on Google Product Feed in one of the Project.

What is Google Product Feed?

It is a feed in XML Format which we can submit to google for listing the products in Google Shopping Tab.

A google product feed xml file has list of product which use groupings of attributes that define each product in a unique way. Attributes, such as ‘condition’ and ‘availability’, can have standardized values, or accepted “answers,” or attributes can be open to fill with your own choice of value, such as ‘id’ or ‘title’. Accurately describing items using these attributes allows users to search and find your items more easily.
Read More

Migrate Visual Studio Solution from SVN to TFS

I love to work on Microsoft Technologies and while working with them recently we got a challenge to migrate our project from SVN to TFS. So I would be discussing about:
1) How to migrate visual studio solution from SVN to TFS.
2) Different approaches for migration
3) Challenges faced during migrating our solution.
As it is our basic approach to first always search on google and do some analysis and research before doing any such task, similar way we did and found two approaches – Manual and Automated.
SVN2TFS.EXE – (Automated) we didn’t dig much also read few comments by which we got unhappy.

Read More