Sitecore

Configuration in Sitecore


Ever considered putting environment specific configuration in the Sitecore database? …well don’t.

In the official Mailing list module, Sitecore has, among others, placed the database connection string and we have nothing but grief from it. Consider moving from development to test to production, or in the latest example a customer wanted to have an internal test site nightly updated with the production database. Sigh!

Real Sitecore style, we’ve even looked into the possibility of hooking into the database connection of the mailing list module – but no:

  • All database access in the MailingList module goes through the internal class Sitecore.Modules.MailingList.Core.SqlHelper
  • This class is only accessible through the internal property SqlHelper SqlHelper in Sitecore.Modules.MailingList.Core.MailingList
  • SqlHelper opens a database connection in the protected (but not virtual) IDbConnection CreateConnection()
  • This function returns an SqlConnection if the Sitecore field “Database” contains the text “MSSQLSERVER” (*Sigh*), otherwise an OleDbConnection is opened
  • The sql server ConnectionString is read from public static string Sitecore.Modules.MailingList.Core.MailingListSettings.ConnectionString
  • This property reads the value from the field ConnectionString in the Sitecore database

As you can see there is no way of plugging in anywhere…

Standard

One thought on “Configuration in Sitecore

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s