LPS-47954 Get ddmTemplateKey from portlet preferences if it is not defin...

If ddmTemplateKey is empty, we should check if a ddmTemplateKey had been set in portletPreferences.