/// <summary>
        /// Builds the page.
        /// </summary>
        private void BuildPage()
        {
            IConfigurationUnitStore configStore = ConfigurationUnitStore.DefaultStore;
            UPMDataSyncPage         page        = new UPMDataSyncPage(null);

            if (ServerSession.CurrentSession == null)
            {
                return;
            }

            UPSyncManager syncManager = ServerSession.CurrentSession.SyncManager;

            page.LastSyncDate            = syncManager.LastSyncDate;
            page.CanStartIncrementalSync = true;
            this.syncMessage             = string.Empty;

            if (syncManager.FullSyncRunning)
            {
                this.syncMessage = LocalizedString.Localize(
                    LocalizationKeys.TextGroupBasic,
                    LocalizationKeys.KeyBasicSyncOrganizerFullSyncRunningMessage);

                page.CanStartIncrementalSync = false;
            }
            else if (syncManager.IncrementalSyncRunning)
            {
                this.syncMessage = LocalizedString.Localize(
                    LocalizationKeys.TextGroupBasic,
                    LocalizationKeys.KeyBasicSyncOrganizerIncrementalSyncRunningMessage);

                page.CanStartIncrementalSync = false;
            }
            else if (syncManager.UpSyncRunning)
            {
                this.syncMessage = LocalizedString.Localize(
                    LocalizationKeys.TextGroupBasic,
                    LocalizationKeys.KeyBasicSyncOrganizerUpSyncRunningMessage);

                page.CanStartIncrementalSync = false;
            }
            else if (syncManager.MetadataSyncRunning)
            {
                this.syncMessage = LocalizedString.Localize(
                    LocalizationKeys.TextGroupBasic,
                    LocalizationKeys.KeyBasicSyncOrganizerConfigurationSyncRunningMessage);

                page.CanStartIncrementalSync = false;
            }
            else if (syncManager.ResourcesSyncRunning)
            {
                this.syncMessage             = "Resources Sync is running";
                page.CanStartIncrementalSync = false;
            }

            page.CanPerformConfigurationSync = configStore.ConfigValueIsSetDefaultValue("Sync.ConfigOnOff", true);
            page.CanPerformLanguageChange    = configStore.ConfigValueIsSetDefaultValue("Sync.LanguageOnOff", true);
            page.FullSyncRequirementStatus   = syncManager.FullSyncRequirementStatus;

            switch (page.FullSyncRequirementStatus)
            {
            case FullSyncRequirementStatus.Recommended:
                DateTime blockOnlineAccessDate = DateExtensions.AddTimeSpanToUtcNow(syncManager.TimeIntervalFromNowUntilOfflineOnline());
                page.FullSyncRequirementStatusText = string.Format(
                    LocalizedString.Localize(
                        LocalizationKeys.TextGroupBasic,
                        LocalizationKeys.KeyBasicSyncOrganizerFullSyncRecommendedWarningMessage).ToDotnetStringFormatTemplate(),
                    blockOnlineAccessDate.ToString("d"));
                break;

            case FullSyncRequirementStatus.MandatoryForOnlineAccess:
                DateTime blockAccessDate = DateExtensions.AddTimeSpanToUtcNow(syncManager.TimeIntervalFromNowUntilBlock());
                page.FullSyncRequirementStatusText = string.Format(
                    LocalizedString.Localize(
                        LocalizationKeys.TextGroupBasic,
                        LocalizationKeys.KeyBasicSyncOrganizerFullSyncMandatoryForOnlineErrorMessage).ToDotnetStringFormatTemplate(),
                    blockAccessDate.ToString("d"));
                break;

            default:
                page.FullSyncRequirementStatusText = string.Empty;
                break;
            }

            this.TopLevelElement = page;
            this.BuildSyncMessage();
        }