• About Me

CMS Sky

~ All about CMS

CMS Sky

Category Archives: CMS

Install Mongo DB using PowerShell

14 Monday Nov 2016

Posted by Maulik Darji in CMS, Mongo, Mongo DB, Sitecore

≈ Leave a comment

Tags

Installation, Mongo, Power Shell, PowerShell, Sitecore

This article provides quick way to install Mongo DB using PowerShell script.

 

Most important thing you need when you start working on Sitecore is a Database. 🙂

Earlier you needed only SQL but now you need Mongo DB as well for all the Analytics data (To store user interaction on the website).

While working on the local development machine you need to install the Mongo DB.

What are the steps involved to get the Mongo up and Running?

  1. Download Mongo DB
  2. Install Mongo DB
  3. Create Data folder to store all the data of the Mongo DB
  4. Create the configuration file which tells that what is the DB Path and what is the Log path
  5. Create a Service to keep the Mongo running.
  6. Start the Service.

Once all the above steps are complete then Mongo is up and running.

This is a bit time consuming task. So I created a PowerShell script to do these tasks and without any manual interaction. This script will do all the steps from 2 to 6.

You just need to run the powershell script and it will take care of everything.

You can download the folder from below link

https://app.box.com/s/wuurfry37wo3h194tv73cc5nmny3t4op

  1. Once you download, unzip the file.
  2. Open the PowerShell as administrator
  3. Run the Powershell script – Install-MongoDB.ps1

What it does? Script installs the Mongo

Disclaimer: This is my first try at PowerShell. I am learning PowerShell scripting so the script might look like a Hard Code script. But for me and my team this is serving the purpose. Please do not use this script for Production deployment as this is not tested on any server environment.

Advertisements

Sitecore All about images : Part 2

09 Wednesday Nov 2016

Posted by Maulik Darji in CMS, Sitecore

≈ 2 Comments

Tags

Media

  1. Default Background Color  Sitecore All about images
  2. Disable upload media as file
  3. New security Hash in media (Sitecore All about images : Part 3)

Disable Upload Media as Files

We have come across a situation when Content Manager uploads the Image(s) and checks the box – Uplaod as file

The media is now uploaded as file and is not available in Database. In this situation, When we publish the Item, some time the file is not getting published on the Production environment. And it creates big issue when there are load balanced servers / multiple servers in Production.

To avoid this, Sitecore provides 2 settings

  1. Media.UploadAsFiles – Default false
  2. Media.DisableFileMedia – Default false

We tried both the options.

UploadAsFiles does not work as expected so we choose to use the DisableFileMedia. When we set that to True, checkbox for Upload as File was hidden/removed from the file upload advanced dialog box.

<!– MEDIA – DISABLE FILE MEDIA
Enables or disables storage of media as files rather than database records.
If true, user interfaces do not present options to store media as files.
All files will be stored in the database, disregarding the value of the Media.UploadAsFiles setting.

Default value: false
–>
<setting name=”Media.DisableFileMedia” value=”true”/>

upload-as-files-checkbox

What we believe, removing the checkbox will solve the issue of “Media being uploaded as file *accidentally*”

 

Uploading a whole folder with Images

  • Zip the Folder.
  • Go to the Upload files (advanced)
  •  Browse and select the Zipped folder
  • Click on the “Unpack ZIP archives”

Need a faster way?? (Fastest way to upload multiple images in Sitecore)

Just Put the folder in the “Upload” folder.

All the images in the folder will be automatically uploaded in Media Library.

 

Sitecore All about images

09 Wednesday Nov 2016

Posted by Maulik Darji in CMS, Sitecore

≈ 2 Comments

Hi Friends,

Today I am going to cover a few points at one place for Sitecore Media.

  1. Default Background Color
  2. Disable upload media as file Sitecore All about images : Part 2
  3. New security Hash in media Sitecore All about images : Part 3

Default Background color for Sitecore optimized image

When we use the Sitecore image optimizer, it adds black background when resizing the images. How to fix this?

For Sitecore 8.0/8.1 find a file named Sitecore.config in App_config/Include directory. Open the file in your favourite text editor with admin rights (Required some time).

Find the value with name “DefaultImageBackgroundColor”. Set the value as you desired.

 

Continue reading →

Sitecore Session management in SQL

11 Friday Sep 2015

Posted by Maulik Darji in CMS, Sitecore

≈ 2 Comments

Tags

asp.net based cms, Session, session management, Sitecore, sql, web farm, web farms

One of the most common thing we used to do in ASP.Net for Web Farm environment for session management was to setup the Session “OutProc” using either state server or SQL Server.

Sitecore also supports the OutProc Session management using SQL. Sitecore has provided a specific database and internally it is managed as well.

This configuration was done using Sitecore 8.0 (XP) or some people say (xDB)

Please find details below to configure the Sitecore Session in SQL.

Steps to do this

  1. Confirm the database named instancenameSitecore_sessions exist.
  2. Add a connection string as below
    <add name=”sharedsession” connectionString=”user id=sa;password=*******;Data Source=SQLDatabase\SQLEXPRESS;Database=instancenameSitecore_Sessions”/>
  3. In web.config make a change as below
    <sessionState mode=”Custom” cookieless=”false” timeout=”20″ customProvider=”mssql” >

<providers>

<!–<add name=”mongo” type=”Sitecore.SessionProvider.MongoDB.MongoSessionStateProvider, Sitecore.SessionProvider.MongoDB” sessionType=”Standard” connectionStringName=”session” pollingInterval=”2″ compression=”true” />–>

<add name=”mssql” type=”Sitecore.SessionProvider.Sql.SqlSessionStateProvider, Sitecore.SessionProvider.Sql” sessionType=”shared” connectionStringName=”sharedsession” pollingInterval=”2″ compression=”true” />

</providers>

</sessionState>

  1. connectionStringName should match the name with the connection string specified.
  2. Run the attached SQL file on your database after replacing your database name in Use Statement and one more place below

Attached is the Docx file which contains the SQL Script provided by Sitecore with installation.

You can find the script in the database folder where you have installed the Sitecore.

Sessions db performance boost

Sitecore and LanguageWire Translation Service

29 Wednesday Jan 2014

Posted by Maulik Darji in CMS, LanguageWire, Sitecore

≈ Leave a comment

Hi Guys,

I am back after long time.

Till now I have worked on many thing on Sitecore but first time I got a chance to work on the Language Translation Service.

We were asked integrate LanguageWire Service with Sitecore. Our client is a Multinational Organization based in Norway. The site is released in one language and now planning to add 8 more languages to the site.

Some Steps to follow before the setup.

  • Take Backup of your database
  • Get the Update files from LanguageWire. Mostly in below format
    • Codehouse.LanguageWire.TDS.Core_[version number].update.
    • Codehouse.LanguageWire.TDS.System_[version number].update

I loved the Prerequisite information provided in their Installation Guide.

  • Sitecore 6 or above.
  • Above average Sitecore knowledge.
  • Administrator access to your Sitecore.
  • Remote access to your server.
  • Translations module install files.
    • Codehouse.LanguageWire.TDS.Core_[version number].update.
    • Codehouse.LanguageWire.TDS.System_[version number].update.
  • Username, password and Customer ID to Languagewire translation service.

Sitecore User Group UK – 10 April 2013

16 Tuesday Apr 2013

Posted by Maulik Darji in CMS, Sitecore

≈ 2 Comments

Sitecore has been arranging a User meet every month in UK and other Cities. I have just heard of such meeting.

During my visit to London in April 2013, I came to know about a meet. I got the link from a Colleague – Tony Kiernan. He was Very excited to attend the event same as me. He attended the similar earlier but it was first visit for me.

Venue was Pizza Express at Holborn.

Details of the Event.

Sitecore User Group

We Reached at the Venue on time.  There were few known face whom I have met in Dreamcore 2011 in London. We sat down on a table got some pizza and a bottle of beer for my Colleague.

We were waiting for the show to begin.

And the show started.

First Session was : Justin Rowe from Fusionworkshop explained “A Content first approach to building Sitecore websites”.

Very informative. Came to know advantage of this approach. How to keep the content? How the content should be?

Second Session was : Sitecore 7 by Tim Ward from Sitecore.

Yes, That’s the one we have been waiting for. The session started with Dynamic Tim ward and his team.

Though there were a lots things to be shown in Sitecore 7, they have kept most of the items for their next session. 🙂

In current session one important part was covered “How to handle millions of items under one node.”. Sitecore has been telling since beginning that You should not have more than 100 items under one node. Recommended this for performance. Thought there is no limit as we had 1000s of item under one node and it was not slow. Some time finding a particular item for editing from 1000s of items was a time consuming task, Searching, Displaying etc were no issue.

But using concept of “Item Bucket” this case is handled.

Third Session:

It was for ECM 2 – Email Campaign Manager V2.

It was really informative. ECM2 is a totally revamped product.

Few more Technical Details extracted from the Sessions:

  • .Net 4.5 compiled DLLs
  • Supports Parallel Processing
  • New Version of Lucene
  • Verbose logging Search
  • IFilter Support – We can use any Custom Search provider
  • Indexing Manager
  • Indexing Developer Tools
  • Item buckets
  • Content Tagging
  • Content Faceting
  • New Search :
  • Datasource : can be a query now
  • LINQ to Lucene
  • LINQ to SOLR

Few Developer Tools

  • Filldb.aspx – Can be used to add millions of data at one go. useful for testing on local / Staging
  • LinqScratchPad
  • Verbose Logging

DMS

  • Search based Data Source

There were many more good moments. Got a chance to meet many Sitecore MVPs. Discussed with Sitecore Developers.

It was Really a great event. I am lucky to be part of the such a great event.

Waiting for the Slides to be available.

Sitecore Badge Sitecore Event 1 Sitecore Event 2

Quick comparison between .Net based CMS

11 Monday Mar 2013

Posted by Maulik Darji in CMS, Sitecore, Umbraco

≈ Leave a comment

Tags

asp.net based cms, kentico, orchard, Sitecore, Umbraco

Hello Friends,

The big question asked to me no. of times.

“Which is the best CMS running on .Net Platform“

While replying on Experts-Exchange website, Recently I came across same question : “Which is the Best CMS running on .Net”

Detail question:

I am looking for some tips on a good cms that i can use for a customer that needs to easy update the site, we can implement a responsive css we got and we need to be able to add custom code for showing products from database and so on.

There were few answers. I replied with a Quick comparison between few CMS I have worked with.

My Answer:

This question has unlimited answers.
We have been working in CMS domain since many years.
We have worked on following in .Net domain

  • Sitecore
  • Umbraco
  • Kentico
  • Orchard

All 4 are very good.

  • If you want a simple site with easy updates go with Umbraco.
  • If you want a site where everything is readily available and you don’t want to work much anything then go for Kentico.
  • Looking for Pure MVC based CMS then Orchard.
  • If you need to add a lot custom code to display, Flexible, easy for editing for client, Multi Lingual Support then go for Sitecore.

All above mentioned CMS are available in MVC.
Our Experience says, Money spent on Sitecore is worth. Especially when you want to add lots of custom code to read and display.

You can add Responsive Design in any of the mentioned CMS.

The Author was looking for such quick comparison, So he liked the answer and I was rewarded 2000 Points. 500 Points for the Question * 4 (Grade A ) = 2000 Points.

Link for the Question

Some more thoughts on these CMSs.

  • Umbraco: A Simple, easy to use, Open Source CMS. Learn using Paid Video subscription. I created 5-6 pages in few hours of starting with Umbraco.
  • Kentico: Free and Paid Versions are available. Most of the Web parts are readily available OOB. Lots of settings. Sometime its confusing.
  • Orchard: MVC Based. According to news it is supported by Microsoft Employees. Growing fast with more and more people joining the Community. This CMS looks promising. (Still it will take some time to reach to a Mature CMS Level)
  • Sitecore: An Enterprise level CMS. One of the leading CMS. Extensible. Great Community Support. Great Product Support. Lots of Flexibility. Very famous for Multi Lingual Support. Also Supports Multi Device, Multi Instance, Multi Site solutions. costliest out of these 4. but still much cheaper than Tridion & SharePoint.

Planning to have a have a detailed review for all 4 CMS.

How to create Handler in Sitecore

06 Wednesday Mar 2013

Posted by Maulik Darji in CMS, Sitecore

≈ 4 Comments

Tags

CMS, Handler, Sitecore, Sitecore Context

Introduction

Creating a Handler in Sitecore is not a straight forward task, so to explain this I have taken example of Managing Robots.Txt file in the Sitecore CMS content Tree.
Task:

  • We need to store and update the Robots.txt contents in the Sitecore content tree — This is a Normal process same as creating a Page in Sitecore.
  • When robots.txt is requested then read the related Sitecore node and display the content on page. — Handler is implemented for this

Robots-Content-Editor

Background 
Issue
When a txt is to be handled by asp.net, we create HTTPHandler.
To achieve the same First we created a TxtHandler and mapped it in IIS. Our TxtHandler was getting the requests for Txts. This was working fine but we were not able to access the Sitecore from Handler as the Sitecore.Context was not available in the Handler. If we don’t get the Context then we can’t access the Sitecore Tree and the Robots Txt Item.

Different Solutions
One solution was to handle it from Application_BeginRequest in Global.asax. But If we let the code run till global.asax then all Sitecore Pipelines will be executed and which can create the performance overhead as we don’t need to load Layout or anything else. We were looking for option where we can skip loading the Sitecore Pipelines and reduce performance overhead.

After some analysis and R&D we got a perfect solution

The Solution  
Create a Processor by inheriting HttpRequestProcessor from Sitecore.Pipelines.HttpRequest

Get the HttpContext in the code and get the/ Current URL. If URL ends with Robots.txt then go ahead else skip the code

If URL matches with robots.txt then get the Current DB from Context.Database and get the Robots item from the Sitecore Content Tree.

Till now the task was simple. Now here is the twist. We don’t want to process anything after this Processor is executed, functionality should be similar to Handler. We wanted to display the text from RobotsTxt item and display on the screen as Plain Text. No other pipeline should be called. We thought of some code which can skip the remaining pipeline, like setting a flag (if there is any) which can skip other pipelines. But there is no such flag or code.

But we came up with much simpler method. Response.End(). And that did the trick.

Coding part is done. Let’s go to Web.config. We need to place the Processor at a location where we can get the Sitecore Context. We tried with first line in but the context was not available. Then we started moving one line below and run. According to our understanding at least SiteResolver will load the Context and we were correct. So best placed position is right below SiteResolver.

Web.config Changes
<httpRequestBegin> 

<processor type="Sitecore.Pipelines.HttpRequest.SiteResolver, Sitecore.Kernel" />

<!-- Custom Processor, The best place is after SiteResolver.   -->

<processor type="SND641.Customization.RobotsModule, SND641" /> 
Code for Processor
using System.Web; 
using Sitecore.Data;
using Sitecore.Data.Items;
using Sitecore.Pipelines.HttpRequest;
namespace SND641.Customization
{
    public class RobotsModule : HttpRequestProcessor
    {
        public override void Process(HttpRequestArgs args)
        {
            HttpContext currentContext = HttpContext.Current;
            string sRequestedURL = currentContext.Request.Url.ToString().ToLower();
            if (sRequestedURL.EndsWith("robots.txt"))
            {
                string sOutput = "";
                Database CurrDb = Sitecore.Context.Database;
                if (CurrDb != null)
                {
                    Item RobotsItem = CurrDb.GetItem("/sitecore/content/Home/RobotsTxt");

                    if (RobotsItem != null)
                    {
                        sOutput = RobotsItem["Robots Text"];
                    }
                    else
                    {
                        sOutput = "Item is not found in " + CurrDb.Name;
                    }
                }
                currentContext.Response.ContentType = "text/plain";
                currentContext.Response.Write(sOutput);
                currentContext.Response.End();
            }
        }
    } 
}  
Points of Interest 

When I googled for the Solution for this kind of issue, I didn’t find any article which can explain me what to do when I want the Sitecore Context in the Handler. Even I tried to find Sitecore Documents. but no success.

Then in a document I found code for Processor so We thought of creating a Processor which can work as a Handler.

So far this was the only way we can have functionality of Handler in Sitecore.

Other Usage
This is useful when we have to handle some custom extensions like XML (Sitemap.xml) or ICS (outlook Calendar file).

Works with  
This Code works with Single Site Instance of Sitecore. Implementation for Multi-Site Application will be similar.

Advertisements

Subscribe

  • Entries (RSS)
  • Comments (RSS)

Archives

  • November 2016
  • September 2015
  • January 2014
  • April 2013
  • March 2013

Categories

  • CMS
  • Mobile
  • Mongo
  • Mongo DB
  • Sitecore
    • LanguageWire
    • Media
    • Rich Text Editor
  • Umbraco

Meta

  • Register
  • Log in

Create a free website or blog at WordPress.com.

Cancel