Monday, 25 September 2017

Reason behind recycling IIS while development

Recycle is one of the tasks of IIS (Internet Information Services). So before going to explain let me tell you about IIS first.


sitecore-iis-error



On the IIS we do generally:

IISRESET, to start/stop www publishing services. When we do IISREST request then it applies to all applications on that are hosted on the IIS.

RESTART, to start/stop the process for particular application. Continues the services for other hosted application without any interruption.Generally, it initializes the website.

REFRESH, we generally do this process with session-oriented applications.

RECYCLE, our main focus on this because it's faster the others like RESET or RESTART. Recycle introduced from IIS6. It designed to restart only one application Pool means worker Processes

Actually When we do recycle then it creates the new process and after that HTTP.SYS dispatch the incoming request to newly created process and once all the requested got dispatched older process destroyed automatically.

Advantages of using Recycling:

  • no lost of the current application.
  • Once the process is created then older one is getting destroyed.
  • takes the guarantee of no lost of content.
  •  faster than IISRESET/RESTART.
  • Each time new data is getting stored into the worker Processes.

We can recycle the App Pool with two ways:
1. cmd> 'run AppPool/?'
2. with IIS Manager

Now come to the IIS Manager, basically, it has mainly three main components:
1. HTTP.SYS: It's kernel component, not part of w3wp.exe. It never uses virtual memory. And the main task of this component is to route the incoming request to corresponding AppPool.

2.  Worker Processes/AppPool/ w3wp.exe: It handles all the contents and also runs the dynamic contents. such as ASP.NET App.

3. IISAdmin: it manages IIS config as window services management.



Sunday, 17 September 2017

Create custom ContentEditor Field in Sitecore?

First of all, I would like to explain about Content Editor fields in Sitecore.

So let's start, while creating a template in Sitecore we require giving field type like:
SingleLine Text
Rich Text
DateTime
Droplist
Multiline Text
etc.

Now sometimes content editor ask developers for custom Content Editor Fields in Sitecore.
So with this blog, I will create custom content Editor Field by making a replica of existing field types.

 So First go to the place where all the existing content editor fields are placed in Sitecore that mean Core Database.
sitecore-field-type-tree



Now Create your own custom field Directory at /sitecore/system/Field types where will put our customfield datatype item.





After creating custom field directory now it's time to create customField Datatype item at /sitecore/system/Field types/CustomField



sitecore-custom-field-tree




and given the assembly and class name of custom FieldDatatype as above.

Here is the code snapshot where we inherited the existing Sitecore field type item

sitecore-custom-field-class



Now come back to Master Database and on template uses this custom field datatype.


sitecore custom field type


And yes we successfully created a replica of the existing field type.

sitecore-custom-field




Now it's on you which type of custom field we wanted to implement.