/// <summary>
        /// Builds the client report for page cached.
        /// </summary>
        /// <param name="page">The page.</param>
        /// <param name="cached">if set to <c>true</c> [cached].</param>
        /// <returns></returns>
        public virtual bool BuildClientReportForPage(UPMWebContentPage page, bool cached = false)
        {
            if (!(this.WebContentMetadata is UPWebContentMetadataClientReport))
            {
                return(true);
            }

            UPWebContentMetadataClientReport clientReport = (UPWebContentMetadataClientReport)this.WebContentMetadata;

            if (cached)
            {
                page.Invalid        = false;
                page.WebContentHtml = clientReport.CalcClientReportFromCachedResult();
                return(true);
            }

            page.Invalid = true;
            this.ApplyLoadingStatusOnPage(page);
            clientReport.StartWithRecordIdentificationLinkIdParameters(this.RecordIdentification, this.LinkId, this.FieldValueDictionary);
            return(false);
        }
        /// <summary>
        /// Calculates the signature titles.
        /// </summary>
        /// <returns></returns>
        public List <string> CalcSignatureTitles()
        {
            List <string> modTitles = new List <string>();
            UPWebContentMetadataClientReport metadataClientReport = (UPWebContentMetadataClientReport)this.WebContentMetadata;
            int    signatureCount = metadataClientReport.SignatureCount;
            string fieldGroupName = metadataClientReport.SignatureTitle;

            if (!string.IsNullOrEmpty(fieldGroupName))
            {
                FieldControl fieldControl = ConfigurationUnitStore.DefaultStore.FieldControlByNameFromGroup("List", fieldGroupName);
                string       label        = fieldControl?.FullLabelTextForFunctionName("SIGNATURETITLES");
                if (!string.IsNullOrEmpty(label))
                {
                    var  titles = label.Split(';');
                    long count  = Math.Min(titles.Length, signatureCount);
                    for (int i = 0; i < count; i++)
                    {
                        string title = titles[i];
                        title        = this.ReplaceTokensDateFormatter(title, null);
                        modTitles[i] = title;
                    }
                }
            }

            int k = 0;

            if (signatureCount > 1)
            {
                for (k = 0; k < signatureCount; k++)
                {
                    modTitles[k] = $"{LocalizedString.TextProcessSignatureTitle} {k + 1}";
                }
            }
            else if (signatureCount == 1 && k == 0)
            {
                modTitles[0] = LocalizedString.TextProcessSignatureTitle;
            }

            return(modTitles);
        }
        private IIdentifier BuildIdentifier()
        {
            IIdentifier identifier;

            if (this.WebContentMetadata is UPWebContentMetadataClientReport)
            {
                UPWebContentMetadataClientReport clientReport = (UPWebContentMetadataClientReport)this.WebContentMetadata;
                IConfigurationUnitStore          configStore  = ConfigurationUnitStore.DefaultStore;
                List <string> usedInfoAreas = new List <string>();

                foreach (UPWebContentClientReport contentClientReport in clientReport.ClientReports)
                {
                    SearchAndList searchAndList = configStore.SearchAndListByName(contentClientReport.ConfigName);
                    FieldControl  fieldControl  = configStore.FieldControlByNameFromGroup("List", searchAndList == null ? contentClientReport.ConfigName : searchAndList.FieldGroupName);

                    foreach (UPConfigFieldControlField field in fieldControl.Fields)
                    {
                        if (!usedInfoAreas.Contains(field.InfoAreaId))
                        {
                            usedInfoAreas.Add(field.InfoAreaId);
                        }
                    }
                }

                List <IIdentifier> usedIdentifiers = new List <IIdentifier>();
                usedIdentifiers.AddRange(usedInfoAreas.Select(infoArea => StringIdentifier.IdentifierWithStringId($"{infoArea}.*")));

                identifier = usedIdentifiers.Count > 0 ? new MultipleIdentifier(usedIdentifiers) : this.BuildStandartIdentifier();
            }
            else
            {
                identifier = this.BuildStandartIdentifier();
            }

            return(identifier);
        }