コード例 #1
0
 private static void RenderAllPagesInWorker()
 {
     RenderWebSupport.RefreshAllAccountAndGroupTemplates(true, "AaltoGlobalImpact.OIP.Blog", "AaltoGlobalImpact.OIP.Activity", "AaltoGlobalImpact.OIP.AddressAndLocation",
                                                         "AaltoGlobalImpact.OIP.Image", "AaltoGlobalImpact.OIP.ImageGroup", "AaltoGlobalImpact.OIP.Category");
 }
コード例 #2
0
ファイル: Program.cs プロジェクト: michlG/Caloom
        static void Main(string[] args)
        {
            try
            {
                string connStr = "DefaultEndpointsProtocol=https;AccountName=theballmichael;AccountKey=CWz4Sp47JIASPy99OMQX+MCdbc82pHqI0obsTAeRNb2k++YVhssKZ1RVAal8LVvA0ekXddWKIBQ7LA3Z0P6bAA==";
                //connStr = "UseDevelopmentStorage=true";
                bool debugMode = false;

                StorageSupport.InitializeWithConnectionString(connStr, debugMode);
                InformationContext.InitializeFunctionality(3, true);
                InformationContext.Current.InitializeCloudStorageAccess(Properties.Settings.Default.CurrentActiveContainerName);

                if (DataPatcher.DoPatching())
                {
                    Console.WriteLine("DONE");
                    Console.ReadLine();
                    return;
                }

                //ProcessErrors(false);
                //return;

                string       templateLocation    = "livetemplate";
                string       privateSiteLocation = "livesite";
                string       publicSiteLocation  = "livepubsite";
                const string accountNamePart     = "oip-account\\";
                const string publicGroupNamePart = "oip-public\\";
                const string groupNamePart       = "oip-group\\";
                const string wwwNamePart         = "www-public\\";
                //DoMapData(webGroup);
                //return;
                string directory = Directory.GetCurrentDirectory();
                if (directory.EndsWith("\\") == false)
                {
                    directory = directory + "\\";
                }
                string[] allFiles =
                    Directory.GetFiles(directory, "*", SearchOption.AllDirectories).Select(
                        str => str.Substring(directory.Length)).Where(str => str.StartsWith("theball-") == false).ToArray();
                string[] groupTemplates =
                    allFiles.Where(file => file.StartsWith(accountNamePart) == false && file.StartsWith(publicGroupNamePart) == false && file.StartsWith(wwwNamePart) == false).
                    ToArray();
                string[] publicGroupTemplates =
                    allFiles.Where(file => file.StartsWith(accountNamePart) == false && file.StartsWith(groupNamePart) == false && file.StartsWith(wwwNamePart) == false).
                    ToArray();
                string[] accountTemplates =
                    allFiles.Where(file => file.StartsWith(groupNamePart) == false && file.StartsWith(publicGroupNamePart) == false && file.StartsWith(wwwNamePart) == false).
                    ToArray();
                string[] wwwTemplates =
                    allFiles.Where(file => file.StartsWith(groupNamePart) == false && file.StartsWith(publicGroupNamePart) == false && file.StartsWith(accountNamePart) == false).
                    ToArray();
                UploadAndMoveUnused(accountTemplates, groupTemplates, publicGroupTemplates, null);
                //UploadAndMoveUnused(null, null, null, wwwTemplates);
                //UploadAndMoveUnused(null, null, publicGroupTemplates, null);
                //UploadAndMoveUnused(accountTemplates, null, null);

                //DeleteAllAccountAndGroupContents(true);
                //RefreshAllAccounts();

                // TODO: The delete above needs to go through first before the refresh one below

                RenderWebSupport.RefreshAllAccountAndGroupTemplates(true, "AaltoGlobalImpact.OIP.Blog", "AaltoGlobalImpact.OIP.Activity", "AaltoGlobalImpact.OIP.AddressAndLocation",
                                                                    "AaltoGlobalImpact.OIP.Image", "AaltoGlobalImpact.OIP.ImageGroup", "AaltoGlobalImpact.OIP.Category");

                //RunTaskedQueueWorker();


                //FileSystemSupport.UploadTemplateContent(groupTemplates, webGroup, templateLocation, true);
                Console.WriteLine("Starting to sync...");
                //DoSyncs(templateLocation, privateSiteLocation, publicSiteLocation);
                //"grp/default/pub/", true);
                return;
                //doDataTest(connStr);
                //InitLandingPages();
                //Console.WriteLine("Press enter to continue...");
                //Console.ReadLine();
            }
            catch (InvalidDataException ex)
            {
                Console.WriteLine("Error exit: " + ex.ToString());
            }
        }