Пример #1
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Ensures all of the project components are valid.
        /// </summary>
        /// <param name="cache">The cache.</param>
        /// <param name="existingProgressDlg">The existing progress dialog.</param>
        /// ------------------------------------------------------------------------------------
        public static void EnsureProjectComponentsValid(FdoCache cache, IAdvInd4 existingProgressDlg)
        {
            EnsureProjectValid(cache, existingProgressDlg);

            // TE-8621: Don't try to upgrade the database unless we're the project server and no one is connected
            if (!MiscUtils.IsServerLocal(cache.ServerName) || cache.GetNumberOfRemoteClients() > 0)
            {
                return;
            }

            ILangProject lp = cache.LangProject;

            TePublicationsInit.EnsureFactoryPublications(lp, existingProgressDlg);
            TeStylesXmlAccessor.EnsureCurrentStylesheet(lp, existingProgressDlg);
            TeScrNoteCategoriesInit.EnsureCurrentScrNoteCategories(lp, existingProgressDlg);
            TeKeyTermsInit.EnsureCurrentKeyTerms(lp, existingProgressDlg);
            cache.Save();
        }
Пример #2
0
        /// --------------------------------------------------------------------------------
        /// <summary>
        /// Ensures all of the project components are valid.
        /// </summary>
        /// --------------------------------------------------------------------------------
        public static void EnsureProjectComponentsValid(FdoCache cache, FwApp app,
                                                        IThreadedProgress existingProgressDlg)
        {
            EnsureProjectValid(cache, app, existingProgressDlg);

            // TE-8621: Don't try to upgrade the database unless we're the project server and no one is connected
            if (!cache.ProjectId.IsLocal || cache.NumberOfRemoteClients > 0)
            {
                return;
            }

            ILangProject lp = cache.LangProject;

            TeScrBookRefsInit.EnsureFactoryScrBookRefs(cache, existingProgressDlg);
            TePublicationsInit.EnsureFactoryPublications(lp, existingProgressDlg);
            TeStylesXmlAccessor.EnsureCurrentStylesheet(cache, existingProgressDlg, app);
            TeScrNoteCategoriesInit.EnsureCurrentScrNoteCategories(lp, existingProgressDlg);
            TeKeyTermsInit.EnsureCurrentKeyTerms(lp, app, existingProgressDlg);
        }