Tuesday, 1 November 2016

Improving performance of Application startup in Sitecore 8+

Improving performance of Application startup in Sitecore 8+

Disable the precompilation of SPEAK components: 
  • Comment out this part of the
  • Website\App_Config\Include\Sitecore.Speak.config file:
  • <initialize>
    <processor type="Sitecore.Pipelines.Initialize.PrecompileSpeakViews, Sitecore.Speak.Client">
    <Paths>/sitecore/shell/client/Business Component Library</Paths>
    </processor>
    </initialize>
  • Comment out this part of the 
  • Website\App_Config\Include\ContentTesting\ Sitecore.ContentTesting.config file: <processor type="Sitecore.Pipelines.Initialize.PrecompileSpeakViews, Sitecore.Speak.Client" use="ContentTesting">
  • <Paths>/sitecore/shell/client/Applications/ContentTesting</Paths>
    </processor>

Publish Queue, History and Event Queue too big

Publish Queue, History and Event Queue too big

Existing CMS users are unable to publish content on Sitecore.
Syntax:

/* TRUNCATE History TABLE */
IF OBJECT_ID('History', 'U') IS NOT NULL
IF((SELECT COUNT(*) FROM [History]) > 1000)
BEGIN
TRUNCATE TABLE [History];
PRINT 'Truncated the History Table';
END
/* TRUNCATE EventQueue TABLE */
IF OBJECT_ID('EventQueue', 'U') IS NOT NULL
if((SELECT COUNT(*) FROM [EventQueue]) > 1000)
BEGIN
TRUNCATE TABLE [EventQueue];
PRINT 'Truncated the EventQueue Table';
END
/* TRUNCATE PublishQueue TABLE */
IF OBJECT_ID('PublishQueue', 'U') IS NOT NULL
IF((SELECT COUNT(*) FROM [PublishQueue]) > 1000)
BEGIN
TRUNCATE TABLE [PublishQueue];
PRINT 'Truncated the PublishQueue Table';
END

Enable / Disable application access to users.

Enable / Disable application access to users.
If you do not want editors to be able to access the Page Editor at all, you can restrict access to the Page Editor buttons in the core database as you would with any other item. By default, there are Page Editor buttons in the following locations:
/sitecore/content/Documents and settings/All users/Start menu/Right/Page Editor
/sitecore/content/Applications/Content Editor/Ribbons/Chunks/Publish/Page Editor
If Read access is denied on these items, they do not appear in the ribbon or Desktop menu.

Tuesday, 2 August 2016

Disable Analytics in Sitecore 8

Step 1: Disable Analytics in Config: 

Go to /App_Config/Include/Sitecore.Analytics.config and set Analytics.Enabled to false:

<setting name="Analytics.Enabled" value="false" />

Step 2: Comment out connection strings related to analytics in connectionstrings.

<add name="analytics" connectionString="mongodb://localhost/analytics" />
<add name="tracking.live" connectionString="mongodb://localhost/tracking_live" />
<add name="tracking.history" connectionString="mongodb://localhost/tracking_history" />
<add name="tracking.contact" connectionString="mongodb://localhost/tracking_contact" />
<add name="reporting" connectionString="user id=Prakash;password=patel;Data Source=(patel);Database=Sitecore_Analytics" />

Thursday, 4 February 2016

Sitecore 8.1 new features

Sitecore 8.1 new features


  • CMS only mode (xManagement) without xDB
  • Language Fallback built-in
  • Enhanced Experience Editor
  • MVC/Web Api Upgrade to 5.2.3 + MVC Areas
  • New SPEAK Components and improved SPEAK component framework (1.1 and 2.0 support)
  • New Piplines for additional extensibility
  • Sitecore section move to Sitecore.config
  • Version changes in web database - multiple versions per item in web DB
  • Fixes and improvements(7.2 update-4 and 9.0 update-1 to Update-5

Monday, 25 May 2015

Guidelines for Sitecore MVC


­
1.    Controller is supposed to control and direct, it should not have any logic (many developers forget this and it happened in Vision Web too) and should be as slim as possible.
2.    One of the main advantages of MVC is that the view (technically called as View template) is not tightly coupled with the server side. So, we can switch/add a new view (say for mobile or tablet) for an existing flow any time. In order to achieve this we should make the view as ignorant as possible of what it displays and should concentrate more towards how it displays.
3.    Try to avoid c# code in .cshtml as much as possible. Use html helpers in all situations. Create extension methods for html helpers to re-use code and constructs.
4.    Model could contain all logics and calculations and can be fat. It is good to use Model only to represent an entity and to use ViewModel to represent transit entities.
5.    Better to avoid ViewBag or ViewData for transit entities when they are present in multiple places. ViewModel instead would make the code more managable.
6.    Use IOC to decouple the connection to SiteCore. This will help in redirecting the call for test data to our own repository.
7.    Methods which are not Actions should not be public.
8.    Use TempData instead of Session when the data is needed only for the subsequent request.
9.    Use filters as and when it becomes appropriate. It will help in getting an easier control of the flow in different stages on a global scale.
1.    For enhancing reusability, use controls/partial pages as much as possible.
. ...   Exception handling mechanism and Logging framework will have to be put in place which will not require much effort from the developer every time that he has to handle it for his module.

1.  Never put an unnecessary check when some value is not intended to be there. There were many problems in Visionweb due to this. (Example of this is developers putting a check for null/empty everywhere. This habit will avoid the exception but will make the intention of the code ambiguous and will lead to loop holes in the flow. 

Thursday, 26 March 2015

Characteristics of modern web applications.

Characteristics of modern web applications.

• Cross-browser compatibility: The application experience is constant across all modern web browsers, including Google Chrome, Mozilla Firefox, Internet Explorer 9 and 10, Safari, and Opera. 

• Adaptive design: The application automatically adapts to work on many screen resolutions,from huge 30-inch monitors to tiny 3.4-inch cell phones.

• Natural user interfaces: The application accepts input from natural user interfaces (NUI) such as touch, voice, NFC, video cameras, GPS, and other sensors. Meeting this requirement means that you have not only the right software but the hardware to test how the application behaves on these devices.

• Social network integration: The application seamlessly interacts with social networks.

• Cloud-ready: The application can use cloud-based infrastructure and scales on demand,adding new servers when needed and scaling down when traffic slows.

• Resiliency: The application can adapt to challenging network conditions and, in some cases, can work in a disconnected state. The application is designed to tolerate failures of one or more subsystems and still operate at limited but acceptable capacity.

• Extensible: The application is extensible by way of RESTful APIs and its functionality can be augmented by third-party developers.

• Reliable: The application is reliable and supports multiple levels of automated and manual testing before being deployed. 

• Maintainable: The application is easy to maintain and can be upgraded frequently and seamlessly with minimal disruption of the service. 

• RESTful: The application is built on established standards and protocols, and takes advantage of network optimization appliances, load balancers, and monitoring packages.

• Secure: The application has been designed to protect itself from evolving security threats using a layered system of counter measures. If a breach occurs, only the compromised subsystems will be affected; confidential and personally identifiable information will not be exposed.

• Scalable: The application should be able to support thousands of concurrent users.