示例#1
0
文件: Program.cs 项目: michlG/Caloom
 private static void Preprocessor(BlobStorageContent content)
 {
     if (content.FileName.EndsWith("_DefaultView.html"))
     {
         ReplaceHtmlExtensionWithPHtml(content);
     }
     if (content.FileName.EndsWith("oip-layout-landing.html"))
     {
         ReplaceHtmlExtensionWithPHtml(content);
     }
 }
示例#2
0
文件: Program.cs 项目: michlG/Caloom
        private static bool ContentFilterer(BlobStorageContent content)
        {
            string fileName = content.FileName;

            if (fileName.EndsWith("readme.txt"))
            {
                return(false);
            }
            if (fileName.Contains("_DefaultView.phtml"))
            {
                bool isBlogDefaultView     = fileName.EndsWith(".Blog_DefaultView.phtml");
                bool isActivityDefaultView = fileName.EndsWith(".Activity_DefaultView.phtml");
                if (isBlogDefaultView == false && isActivityDefaultView == false)
                {
                    return(false);
                }
            }
            return(true);
        }
示例#3
0
文件: Program.cs 项目: michlG/Caloom
        private static string InformationTypeResolver(BlobStorageContent content)
        {
            string webtemplatePath = content.FileName;
            string blobInformationType;

            if (webtemplatePath.EndsWith(".phtml"))
            {
                //if (webtemplatePath.Contains("/oip-viewtemplate/"))
                if (webtemplatePath.EndsWith("_DefaultView.phtml"))
                {
                    blobInformationType = StorageSupport.InformationType_RuntimeWebTemplateValue;
                }
                else
                {
                    blobInformationType = StorageSupport.InformationType_WebTemplateValue;
                }
            }
            else if (webtemplatePath.EndsWith(".html"))
            {
                string htmlContent    = Encoding.UTF8.GetString(content.BinaryContent);
                bool   containsMarkup = htmlContent.Contains("THEBALL-CONTEXT");
                if (containsMarkup == false)
                {
                    blobInformationType = StorageSupport.InformationType_GenericContentValue;
                }
                else
                {
                    blobInformationType = webtemplatePath.EndsWith("_DefaultView.html")
                                              ? StorageSupport.InformationType_RuntimeWebTemplateValue
                                              : StorageSupport.InformationType_WebTemplateValue;
                }
            }
            else
            {
                blobInformationType = StorageSupport.InformationType_GenericContentValue;
            }
            return(blobInformationType);
        }
示例#4
0
文件: Program.cs 项目: michlG/Caloom
 private static void ReplaceHtmlExtensionWithPHtml(BlobStorageContent content)
 {
     content.FileName = content.FileName.Substring(0, content.FileName.LastIndexOf(".html")) + ".phtml";
 }