0 Comments

Some personal thoughts about CMS =P (Please don't get me wrong)


There is always some arguments around what's best CMS system, Umbraco or Sitecore? It's bit unfaired to pick the best just based on comparing the upfront prince by ignoring the facts that Sitecore has more advanced features =P.

It is not denying that both of CMS are pretty good and they are existing to fit different needs. Sitecore is more suitable for Enterprise organization, whereas Umbraco is mainly for small business. As Sitecore provides more advanced features.


Presonlization (Dynamic content)

Sitecore comes with DMS (digital marketing system) which has various personlisation options built in. the rules-base segmentation is excellent, the dynamic persona generation is awesome, although Umbraco can achieve basic personlisation with 3rd party tool Spindoctor.




ECM (Email Campaign management)

ECM(email campaign management) has been fully implement in Sitecore as well. It allows user to share the content on the website in ECM which means less work for the Campaign manager. it also has the ability to perform A/B/N testing for message body. The most advanced feature for ECM is that it provide reporting dashbord which enable marketers to create and manage optimal email marketing campaigns.


Predictive Analytics by Machine learning (Forecasting)

This bringing together of the power of machine thinking combined with human context, to better understand customer behaviour and predict future trends. Using the Microsoft AzureML platform (a cloud-based service for predictive analytics), advanced business users can begin to mine the masses of data they have stored about their customers in the Sitecore Experience Database (xDB) and experiment with hypothesis against those big data sets using the power of cloud computing.


Now imagine that in the commercial world where you have millions of customer interactions that you simply can’t track or do anything with. This could be an answer; simply create the models, let the cloud do its thing and then monitor, action and test any predictions or trends that it suggests.


Workflow & version

Sitecore workflow enable the capability for use to approve the content before it goes to production. Empowered by versioning feature. content editor can create a new version of the content and publish the new version to production later on. By doing this, content editor can easily compare with the previous version and easily roll back with previous version.


Scalable

Sitecore has content database and website database separated which make it by nature easily to scale up. whereas umbraco has only one database, when handling large amount of data, it becomes a question in terms of the stability and performance

Please don't get me wrong, not saying Umbraco is not good. I like umbraco as well, as it's easy to implement. No doubt they are both great CMS and has their own values to the client. =)

0 Comments
Ditto is a great model mapper for Umbraco. It automatically map the properties to the object class properties which allows user to use strong-type object in the code. The idea behind the model mapper is to use reflection and custom attributes to map object for simple type properties (i.e. string, int etc). If you are not familiar with custom attributes, you can read a great article here. For a complex type (i.e. JObject), You can create a custom type converter to map the properties. However, the issue I was having is when converting the JObject into the class which has the custom type converter .

Issue:


I have a class with custom type converter LinkPickerTypeConverter

[TypeConverter(typeof(LinkPickerTypeConverter))]
public class LinkPicker
{
/// <summary>
/// Gets or sets the id.
/// </summary>
public int Id { get; set; }

/// <summary>
/// Gets or sets the name.
/// </summary>
public string Name { get; set; }

/// <summary>
/// Gets or sets the url.
/// </summary>
public string Url { get; set; }

/// <summary>
/// Gets or sets the target.
/// </summary>
public string Target { get; set; }
}

In LinkPickerTypeConverter,I need to covert JObject to Link Picker. So I used the ToObject method to convert. i.e. json.ToObject<LinkPicker>();

However, because NewtonJson is using Type converter which is overwritten by my custom type converter, which causing the failing when covert JObject to the class.

Solution:


For walk around the issue, I just change ToObject method with Deserialize of JavaScriptSerializer.

var serializer = new JavaScriptSerializer();

serializer.Deserialize<LinkPicker>(value.ToString());

I figured out another better solution by dynamically assigning the JsonConverter.

TypeDescriptor.AddAttributes(typeof(LinkPicker), new TypeConverterAttribute(typeof(JsonConverter)));

After this, you can use ToObject method to convert the JObject to the custom class. i.e. value.ToObject<LinkPicker>();

0 Comments
Setup Octopus

The example contains two processes:
1. Deploy
2. Send email

Follow the settings below for your Deploy process

Settings
Value
Comment
Step NameDeploy Git-Test To Develop
Targets / Machine rolesiis7 iis8
Package / NuGet feedOctopus Server(built-in)
Package / NuGet package IDGit-Test.Dev

Custom install directory

#{Server.webroot}\#{Server.sitename.develop}i.e e:\www\demo\
Configuration variablesReplace appSettings and connectionString entries in any.config files
Configuration transforms / XML transformsAutomatically run configuration transformation files
Configuration transforms / Additional transforms#{Octopus.Environment.Name}.config
IIS WebSite / Web SiteCreate or update an IIS Web Site and Application Pool
IIS WebSite / Web Site Name#{Server.sitename.develop}(Site name in IIS) i.e. demo.dev.localhost
IIS WebSite / Relative home directory#{Server.webroot}\#{Server.sitename.develop}Website folder
IIS Application Pool/ Application Pool Name#{Server.sitename.develop}i.e. demo.dev.localhost
IIS Application Pool/ .NET CLR versionv4.0
IIS Application Pool/ IdentityNetwork Service
IIS Bindings
  • Protocol: http
  • Port: 80
  • Host: #{Server.binging.develop}
i.e. demo.dev.localhost
IIS AuthenticationEnable Anonymous authentication
Environmentsdevelop.localdev

Variables
Name
Value
Email.Notificationswalle.z.yuan@gmail.com
Server.binding.developgit-test.dev.localhost
Server.sitename.developgit-test.dev.localhost
Server.webroote:\demo\git-test

0 Comments
This Date format issue I am going to talk about is in WebForm for marketers module 2.4. for Sitecore. Recently, a client reports the date format of datepicker is incorrect.

By looking into that, I found there literally has three different issues/things we need to understand, before we can make the datepicker formatting work.

First issue
Parameters for datepicker called "DateFormat" is always overwritten when it gets initial. For example, the parameter the client configured in the form is <DateFormat>dd-MM-yyyy</DateFormat>. and then it gets overwritten as "yy-mm-dd".

Second issue
It's related to the parameters, take the above example that <DateFormat>dd-MM-yyyy</DateFormat>. Initially I thought dd-MM-yyyyis the format. However, it is not. It is the Item Name of a Date Format item in sitecore. the the format that datepicker applied is the value of that Date Format Item.

Third issue
Due to the fact that the datepicker is using JQuey datepicker, the date format is different from the standard date and time format defined by Microsoft. the Jquery datepicker format is as below

$.datepicker.formatDate( format, date, options )

Format a date into a string value with a specified format.

The format can be combinations of the following:

  • d - day of month (no leading zero)
  • dd - day of month (two digit)
  • o - day of the year (no leading zeros)
  • oo - day of the year (three digit)
  • D - day name short
  • DD - day name long
  • m - month of year (no leading zero)
  • mm - month of year (two digit)
  • M - month name short
  • MM - month name long
  • y - year (two digit)
  • yy - year (four digit)
  • @ - Unix timestamp (ms since 01/01/1970)
  • ! - Windows ticks (100ns since 01/01/0001)
  • '...' - literal text
  • '' - single quote
  • anything else - literal text

Conclusion
So, to walk around the issue that the client is having. I just update the value of the Date Format Item (as explained above, it will be always "yy-mm-dd" item) with the Jquery date format. i.e. d-mm-yy


References
1. https://api.jqueryui.com/datepicker/

0 Comments
  •   Posted in: 
  • IIS
To optimize SEO, the most common requirement is to redirect all non-www requests to www requests. i.e. redirect example.com.au to www.example.com.au. However, when you setup this 301 redirect in IIS, the querystring will be strip out. However, we can simply solve this by using IIS magic placeholder "$S$Q". For example, set the redirect destination to "www.example.com.au$S$Q".

So what $S$Q does?
IIS will replace $S with the subdirectory location i.e. /tickets and will replace $Q with querystring i.e. ?token=xyz

NOTE, you will need to tick the option "The exact URL entered above"

References:
[1] http://forums.iis.net/t/1170477.aspx?IIS7+passing+query+strings+or+URL+redirect
[2] http://www.developerfusion.com/code/4678/permanent-301-redirect-with-querystring-in-iis/