// Modified  by Khushbu for phase 2 task 'Allow the UI to load previously generated zip files in order to pre-populate the form'.
        // Now this function will return created SkinPackage Link.
        public string CreateSkin(PanelPreferences preferences, string skinFolderPath, string dataPath, string newFolderName)
        {
            // TODO the template path shouldn't be under the scratch path where we create
            //      the packages. For session support the scratch folder should be independent
            // remove the old update folder
            SkinManager manager = new SkinManager(skinFolderPath);
            manager.DeleteUploadFolders();
            // manager.CreateDirectoriesAndUnzipFiles(preferences.HdnSelectedLayout);
            manager.CreateDirectoriesAndUnzipFiles(preferences.HdnSelectedLayoutName); // Modified by K.G. for phase 2 task.now operation  will be performed based on Template name rather than index.

            manager.UpdateSkin(preferences, dataPath);

            manager.UpdateEmailTemplates(preferences, dataPath, newFolderName);// Added by K.G(07/12/2011) to update email template files according to user entered values.

            manager.UpdateSubstitutionFile(preferences); // Added by K.G for phase 2 task. update the sbstitution file according to user selected value .

            string SkinPackageLink = manager.CompressNewSkins(newFolderName); // Added by K.G for phase 2 task. Returned only one link for created pacakage.

            return SkinPackageLink;
        }