コード例 #1
0
        public override IEnumerable <IndexFieldInfo> GetIndexFieldInfos(ContentRepository.Field snField, out string textExtract)
        {
            var data   = snField.GetData() as string ?? string.Empty;
            var titles = data.Split(new[] { WikiTools.REFERENCEDTITLESFIELDSEPARATOR }, 100000, StringSplitOptions.RemoveEmptyEntries);

            textExtract = string.Empty;

            return(CreateFieldInfo(snField.Name, titles));
        }
コード例 #2
0
        public override IEnumerable <IndexFieldInfo> GetIndexFieldInfos(ContentRepository.Field snField, out string textExtract)
        {
            textExtract = String.Empty;

            var content   = snField.Content;
            var boolValue = false;

            //check Trash
            //if (TrashBin.IsInTrash(content.ContentHandler as GenericContent))
            //    boolValue = true;

            //Do not index documents sent to the trash as system content, because when
            //restored (moved back to the original location) they will not be re-indexed
            //and would remain system content. Only the container TrashBags are system content.
            if (content.ContentHandler is TrashBag)
            {
                boolValue = true;
            }

            //check SystemFile
            if (!boolValue)
            {
                if (content.ContentHandler.NodeType.IsInstaceOfOrDerivedFrom("SystemFile"))
                {
                    boolValue = true;
                }
            }

            //check SystemFolder
            if (!boolValue)
            {
                var parent = content.ContentHandler;

                using (new SystemAccount())
                {
                    while (parent != null)
                    {
                        if (parent.NodeType.IsInstaceOfOrDerivedFrom("SystemFolder"))
                        {
                            boolValue = true;
                            break;
                        }

                        parent = parent.Parent;
                    }
                }
            }

            return(CreateFieldInfo(snField.Name, boolValue ? BooleanIndexHandler.YES : BooleanIndexHandler.NO));
        }
コード例 #3
0
ファイル: GenericContentView.cs プロジェクト: kimduquan/DMIS
        private void AddControl(ControlCollection container, ContentRepository.Field field)
        {
            var control = GenericFieldControl.CreateDefaultFieldControl(field);

            control.ID = String.Concat("Generic", _id++);

            var fv = GenericFieldControl.GetFieldVisibility(ViewMode, field);

            if (fv == FieldVisibility.Advanced && AdvancedPanel != null)
            {
                AdvancedPanel.Controls.Add(control);
            }
            else
            {
                container.Add(control);
            }
        }
コード例 #4
0
        public override IEnumerable <IndexFieldInfo> GetIndexFieldInfos(ContentRepository.Field snField, out string textExtract)
        {
            textExtract = String.Empty;

            var content   = snField.Content;
            var boolValue = false;

            //check Trash
            if (TrashBin.IsInTrash(content.ContentHandler as GenericContent))
            {
                boolValue = true;
            }

            //check SystemFile
            if (!boolValue)
            {
                if (content.ContentHandler.NodeType.IsInstaceOfOrDerivedFrom("SystemFile"))
                {
                    boolValue = true;
                }
            }

            //check SystemFolder
            if (!boolValue)
            {
                var parent = content.ContentHandler;

                using (new SystemAccount())
                {
                    while (parent != null)
                    {
                        if (parent.NodeType.IsInstaceOfOrDerivedFrom("SystemFolder"))
                        {
                            boolValue = true;
                            break;
                        }

                        parent = parent.Parent;
                    }
                }
            }

            return(CreateFieldInfo(snField.Name, boolValue ? BooleanIndexHandler.YES : BooleanIndexHandler.NO));
        }