Tuesday, December 30, 2014

As all of us in the Sitecore community are aware, one of the major changes in Sitecore 7.5 and 8 is MongoDB, the new architectural component in Sitecore’s xDB.

If you are starting to work with these newer versions of Sitecore, you will be asked by your clients about the options to consider when deploying and supporting MongoDB.

We at Arke have had tremendous success implemented MongoDB using Rackspace’s ObjectRocket platform. There are however a few tricks to get it configured that I will cover in this post.

The post assumes that you already have an ObjectRocket account. If you don't, go ahead and sign up for their 30 day trial.

Creating a New Instance

Click on the "Add Instance" button within your account's "Instances" dashboard, and then give your instance a name. Make sure that "MongoDB" is selected as the engine, and select the plan that suits your needs.

Adding an Instance User

After your newly created instance is up and running, go ahead and create a new instance user by clicking on the "Actions" button and then "Add User" link.

Note

Something to keep in mind is that we will be using the same credentials that we set up for our instance user, for our Sitecore databases. So once you create the user, keep the username and password handy.

Making the Connection

Within the Instance Details view, you will see that you have a couple of connection strings and an API key. We obviously want to have a secure connection, so we will be using the SSL Connect String.

ConnectionStrings.config

The next thing you want to do is set up the connection strings to point to your new instance. So you want to crack open your ConnectionString.config file, and add the necessary information.

Looking at the strings above, mongouser and mongopassword represent the credentials that you set up for your instance user. The port and url (iad-mongos2.objectrocket.com:xxxx) come from your instance's SSL Connect String.

Cranking up the Databases

At this point, we are ready to fire up Sitecore, and let it auto-provision the necessary MongoDB databases.

When Sitecore has finished "booting up", you will notice that the databases have been created in your instance, but they are empty. That's because you need to create a user account for each of the databases, so that Sitecore can start dumping data into them:

Creating Database Users

The final step is to add a user to each of the newly created databases that has the same credentials that we set up for our instance user in the Adding an Instance User step.

Simply click on the various database names on your instance details page, and then click the "Add User" button located in the user's section of the database details page.

Mongo Likey!

After you have added the users to each of the Mongo databases, you will notice that the collections will be created and that the data will start getting populated.

Troubleshooting

If your databases don't get created, or data doesn't start getting populated in them, make sure that you check your Sitecore logs as they will reveal any errors while trying to connect to the ObjectRocket instance.

Monday, December 22, 2014

We made the decision to upgrade one of our current projects from Sitecore 7.5 to the newly released 8. As the architect, it was my job to make sure that all that we had built so far, transitioned smoothly over to the new version.

All of our code and serialized Sitecore items were safely within our Git Repository in the VisualStudio.com cloud.

These are the steps that I took in our upgrade process:

Uninstalled Sitecore 7.5

Deleted the leftover files in my 7.5 instance location in wwwroot

Downloaded and installed 8.0 from dev.sitecore.net (it's not actually on SDN, which was interesting). I gave my 8.0 instance the same name as my 7.5, just to make things easier when syncing things back up using Team Development for Sitecore (TDS).

Downloaded and installed the modules that we are using. In this case, I downloaded and installed the Commerce Connect 7.5 module.

Updated our Sitecore referenced assemblies to the new versions. We use a hosted NuGet server, so I created a new Sitecore 8 references package and then updated my packages.config files within my solution's projects.

Synced up my Sitecore instance using the TDS projects and did a build to my instance.

Everything seems to be working like a champ! I did notice that the new version took an abnormally long time to start up for the first time.

Experience / Page Editor Changes

So after getting one of my test pages loaded up within the Experience Editor, I noticed that my inline editing didn't seem to be working when I clicked the Edit button.

While exploring the newly designed ribbon, I noticed an "Editing" checkbox in the "View" tab that is turned off by default. Checking this box, made my experience editor come to life, and I was a happy camper!

Saturday, December 20, 2014

Introduction

We recently started work on a Sitecore 7.5 commerce solution
for a large client of ours where we would implement the shiny, new Commerce
Connect 7.5 (Connect) module.

As a good architect / developer, I consulted with the powers
of Google but couldn’t really find a whole lot of good information out there about
how to get started. So, this blog series will report what I
learned when implementing the module. In this article, I’ll explore the setup process and how to perform a simple test to make sure I can add and retrieve products from the product repository.

It’s not free

It is important to note that unlike its predecessors Sitecore
E-Commerce Fundamentals Edition (SEFE) and Sitecore E-Commerce Services (SES), Connect
is not free. I am not sure of the actual pricing; you would need to contact a Sitecore sales representative to get the details.

Installation

After downloading Connect 7.5, I went ahead and installed it
on my local 7.5 development instance.

The 3 major steps include:

Creating a repository using the Templates/Branches/CommerceConnect/Products/Product
Repository branch. I set mine up at the following path:/sitecore/content/Data/Product
Repository/Products

Updating the search Source for the Manufacturer
and ProductType fields of the Product template

Modifying the necessary settings in the config
files to let the module know where my new repository is located in the
content tree. Files and locations to update include:Sitecore.Commerce.Products.config

Sitecore.Commerce.Products.Lucene.Index.Master.config AND Sitecore.Commerce.Products.Lucene.Index.Web.configs

With that behind me, I needed to go ahead and sync my product repository bucket before using it for the first time:

Pulling out a product

Ok, so according to the documentation, I should be ready to
roll and can start throwing products into my repository where I can access
them using the Sitecore search API.

In the final solution, I want to pull a product out of the repo by product name, because I intend to have a MVC route that will have the product name hanging off the end. Something like this: running/mens/running-shoes/support/wave-inspire-11
With that being said, let me write some code and give it a test.

POCO

The first thing that I need to do is create a POCO that is consumable by the LINQ layer within Sitecore. I have to make sure that I inherit from SearchResultItem:

GetProduct Method

Next, I want a method that will take a product name as a parameter, and return the actual Sitecore item from my repository. In my case, I am using Glass Mapper as my ORM of choice. If you are still writing your classes by hand, or are using Custom Item Generator to generate your template based classes, I highly recommend that you look into using Glass.