Beispiel #1
0
        /// <summary>
        /// Get all the key=value pairs (pins) exposed by the implementor.
        /// </summary>
        /// <param name="item">The optional item. The item with its parts
        /// can optionally be passed to this method for those parts requiring
        /// to access further data.</param>
        /// <returns>The pins: <c>tot-count</c>; a list of unique <c>author</c>
        /// <c>claimed-author</c>'s, and <c>work</c>'s (all filtered, with digits).
        /// </returns>
        public override IEnumerable <DataPin> GetDataPins(IItem item)
        {
            DataPinBuilder builder =
                new DataPinBuilder(DataPinHelper.DefaultFilter);

            builder.Set("tot", Contents?.Count ?? 0, false);

            if (Contents?.Count > 0)
            {
                foreach (MsContent content in Contents)
                {
                    builder.AddValue("author", content.Author,
                                     filter: true, filterOptions: true);

                    if (!string.IsNullOrEmpty(content.ClaimedAuthor))
                    {
                        builder.AddValue("claimed-author", content.ClaimedAuthor,
                                         filter: true, filterOptions: true);
                    }

                    builder.AddValue("work", content.Work,
                                     filter: true, filterOptions: true);
                }
            }

            return(builder.Build(this));
        }
        /// <summary>
        /// Get all the key=value pairs exposed by the implementor.
        /// </summary>
        /// <param name="item">The optional item. The item with its parts
        /// can optionally be passed to this method for those parts requiring
        /// to access further data.</param>
        /// <returns>The pins: <c>fr.tag</c>=tag if any.</returns>
        public IEnumerable <DataPin> GetDataPins(IItem item = null)
        {
            DataPinBuilder builder = new DataPinBuilder(
                new StandardDataPinTextFilter());

            // fr.tot-count
            builder.Set(PartBase.FR_PREFIX + "tot", Forms?.Count ?? 0, false);

            if (Forms?.Count > 0)
            {
                foreach (LingTaggedForm form in Forms)
                {
                    // fr.lemma
                    if (form.Lemmata?.Count > 0)
                    {
                        builder.AddValues(PartBase.FR_PREFIX + "lemma",
                                          form.Lemmata,
                                          filter: true,
                                          filterOptions: true);
                    }

                    // fr.tag
                    if (form.Tags?.Count > 0)
                    {
                        builder.AddValues(PartBase.FR_PREFIX + "tag",
                                          form.Tags.Select(t => t.Value));
                    }
                }
            }

            return(builder.Build(null));
        }
Beispiel #3
0
        /// <summary>
        /// Get all the key=value pairs (pins) exposed by the implementor.
        /// </summary>
        /// <param name="item">The optional item. The item with its parts
        /// can optionally be passed to this method for those parts requiring
        /// to access further data.</param>
        /// <returns>The pins.</returns>
        public override IEnumerable <DataPin> GetDataPins(IItem item)
        {
            DataPinBuilder builder = new DataPinBuilder(
                DataPinHelper.DefaultFilter);

            if (Subjects?.Count > 0)
            {
                builder.AddValues("subject", Subjects);
            }

            if (Date != null)
            {
                builder.AddValue("date-value", Date.GetSortValue());
            }

            if (!string.IsNullOrEmpty(Color))
            {
                builder.AddValue("color", Color, filter: true, filterOptions: true);
            }

            if (Links?.Count > 0)
            {
                builder.AddValues("target-id", Links.Select(l => l.Id));
            }

            return(builder.Build(this));
        }
Beispiel #4
0
        /// <summary>
        /// Get all the key=value pairs (pins) exposed by the implementor.
        /// </summary>
        /// <param name="item">The optional item. The item with its parts
        /// can optionally be passed to this method for those parts requiring
        /// to access further data.</param>
        /// <returns>The pins: <c>tot-count</c>, <c>dubious-count</c>,
        /// <c>lost-count</c>, and a list with <c>title</c> (filtered, with
        /// digits), <c>genre</c>, <c>language</c>.</returns>
        public override IEnumerable <DataPin> GetDataPins(IItem item)
        {
            DataPinBuilder builder = new DataPinBuilder(
                DataPinHelper.DefaultFilter);

            // tot-count
            builder.Set("tot", Works?.Count ?? 0, false);
            // dubious-count
            builder.Set("dubious", Works?.Count(w => w.IsDubious) ?? 0, false);
            // lost-count
            builder.Set("lost", Works?.Count(w => w.IsLost) ?? 0, false);

            if (Works?.Count > 0)
            {
                foreach (PersonWork work in Works)
                {
                    // title
                    builder.AddValues("title", work.Titles,
                                      filter: true, filterOptions: true);
                    // genre
                    builder.AddValue("genre", work.Genre);
                    // language
                    builder.AddValue("language", work.Language);
                }
            }

            return(builder.Build(this));
        }
Beispiel #5
0
        /// <summary>
        /// Get all the key=value pairs (pins) exposed by the implementor.
        /// </summary>
        /// <param name="item">The optional item. The item with its parts
        /// can optionally be passed to this method for those parts requiring
        /// to access further data.</param>
        /// <returns>The pins: <c>tot-count</c>, <c>palimpsest</c> (true if any),
        /// and a collection of pins with these keys: <c>material</c>,
        /// <c>sheet-count</c>, <c>guard-sheet-count</c>.</returns>
        public override IEnumerable <DataPin> GetDataPins(IItem item)
        {
            DataPinBuilder builder = new DataPinBuilder();

            builder.Set("tot", Units?.Count ?? 0, false);

            if (Units?.Count > 0)
            {
                bool pal = false;
                foreach (MsUnit unit in Units)
                {
                    if (!pal && unit.Palimpsests?.Count > 0)
                    {
                        pal = true;
                    }

                    builder.AddValue("material", unit.Material);

                    if (unit.SheetCount > 0)
                    {
                        builder.AddValue("sheet-count", unit.SheetCount);
                    }

                    if (unit.GuardSheetCount > 0)
                    {
                        builder.AddValue("guard-sheet-count", unit.GuardSheetCount);
                    }
                }
                builder.AddValue("palimpsest", pal);
            }

            return(builder.Build(this));
        }
        /// <summary>
        /// Get all the key=value pairs (pins) exposed by the implementor.
        /// </summary>
        /// <param name="item">The optional item. The item with its parts
        /// can optionally be passed to this method for those parts requiring
        /// to access further data.</param>
        /// <returns>The pins: collections of unique values keyed under these
        /// IDs: <c>title</c> (filtered, including digits) and <c>date-value</c>,
        /// plus a list of participant IDs in <c>pid</c>.
        /// </returns>
        public override IEnumerable <DataPin> GetDataPins(IItem item)
        {
            DataPinBuilder builder = new DataPinBuilder(
                DataPinHelper.DefaultFilter);

            builder.Set("tot", Dedications?.Count ?? 0, false);

            foreach (LitDedication dedication in Dedications)
            {
                builder.AddValue("title",
                                 dedication.Title, filter: true, filterOptions: true);

                if (dedication.Date != null)
                {
                    builder.AddValue("date-value", dedication.Date.GetSortValue());
                }

                if (dedication.Participants?.Count > 0)
                {
                    builder.AddValues("pid",
                                      dedication.Participants.Select(p => p.Id));
                }
            }

            return(builder.Build(this));
        }
        /// <summary>
        /// Get all the key=value pairs (pins) exposed by the implementor.
        /// </summary>
        /// <param name="item">The optional item. The item with its parts
        /// can optionally be passed to this method for those parts requiring
        /// to access further data.</param>
        /// <returns>The pins: <c>tot-count</c>, and lists of pins with keys:
        /// <c>tag-TAG-count</c>, <c>library</c> (filtered, with digits),
        /// <c>city</c> (filtered).
        /// </returns>
        public override IEnumerable <DataPin> GetDataPins(IItem item)
        {
            DataPinBuilder builder = new DataPinBuilder(
                DataPinHelper.DefaultFilter);

            builder.Set("tot", Signatures?.Count ?? 0, false);

            if (Signatures?.Count > 0)
            {
                foreach (MsSignature signature in Signatures)
                {
                    builder.Increase(signature.Tag, false, "tag-");

                    if (!string.IsNullOrEmpty(signature.Library))
                    {
                        builder.AddValue("library",
                                         signature.Library, filter: true, filterOptions: true);
                    }

                    if (!string.IsNullOrEmpty(signature.City))
                    {
                        builder.AddValue("city", signature.City, filter: true);
                    }
                }
            }

            return(builder.Build(this));
        }
        /// <summary>
        /// Get all the key=value pairs exposed by the implementor.
        /// </summary>
        /// <param name="item">The optional item. The item with its parts
        /// can optionally be passed to this method for those parts requiring
        /// to access further data.</param>
        /// <returns>The pins: <c>fr.tag</c>=tag if any.</returns>
        public IEnumerable <DataPin> GetDataPins(IItem item = null)
        {
            DataPinBuilder builder = new DataPinBuilder(
                new StandardDataPinTextFilter());

            // fr-tot-count
            builder.Set(PartBase.FR_PREFIX + "tot",
                        Interpolations?.Count ?? 0, false);

            if (Interpolations?.Count > 0)
            {
                foreach (Interpolation entry in Interpolations)
                {
                    // fr-language
                    if (entry.Languages?.Length > 0)
                    {
                        builder.AddValues(PartBase.FR_PREFIX + "language",
                                          entry.Languages);
                    }
                    // fr-value
                    builder.AddValue(PartBase.FR_PREFIX + "value", entry.Value,
                                     filter: true);
                    // fr-tag
                    builder.AddValue(PartBase.FR_PREFIX + "tag", entry.Tag);
                    // fr-role
                    builder.AddValue(PartBase.FR_PREFIX + "role", entry.Role);
                }
            }

            return(builder.Build(null));
        }
Beispiel #9
0
        /// <summary>
        /// Get all the key=value pairs (pins) exposed by the implementor.
        /// </summary>
        /// <param name="item">The optional item. The item with its parts
        /// can optionally be passed to this method for those parts requiring
        /// to access further data.</param>
        /// <returns>The pins: <c>tot-count</c> and a collection of pins with
        /// these keys: <c>role</c>, <c>language</c>, <c>type</c>,
        /// <c>hand-id</c>.</returns>
        public override IEnumerable <DataPin> GetDataPins(IItem item)
        {
            DataPinBuilder builder = new DataPinBuilder();

            builder.Set("tot", Scripts?.Count ?? 0, false);

            if (Scripts?.Count > 0)
            {
                foreach (MsScript script in Scripts)
                {
                    builder.AddValue("role", script.Role);
                    if (script.Languages?.Count > 0)
                    {
                        builder.AddValues("language", script.Languages);
                    }
                    builder.AddValue("type", script.Type);
                    if (script.Hands?.Count > 0)
                    {
                        builder.AddValues("hand-id", script.Hands.Select(h => h.Id));
                    }
                }
            }

            return(builder.Build(this));
        }
        /// <summary>
        /// Get all the key=value pairs (pins) exposed by the implementor.
        /// </summary>
        /// <param name="item">The optional item. The item with its parts
        /// can optionally be passed to this method for those parts requiring
        /// to access further data.</param>
        /// <returns>The pins: <c>tot-count</c>, and a collection of pins with
        /// keys: <c>subject-X-count</c>, <c>place</c> (filtered, with digits),
        /// <c>date-value</c>.</returns>
        public override IEnumerable <DataPin> GetDataPins(IItem item)
        {
            DataPinBuilder builder = new DataPinBuilder(
                DataPinHelper.DefaultFilter);

            builder.Set("tot", Watermarks?.Count ?? 0, false);

            if (Watermarks?.Count > 0)
            {
                foreach (MsWatermark watermark in Watermarks)
                {
                    builder.Increase(watermark.Subject, false, "subject-");

                    if (!string.IsNullOrEmpty(watermark.Place))
                    {
                        builder.AddValue("place",
                                         watermark.Place, filter: true, filterOptions: true);
                    }

                    if (watermark.Date != null)
                    {
                        builder.AddValue("date-value", watermark.Date.GetSortValue());
                    }
                }
            }

            return(builder.Build(this));
        }
Beispiel #11
0
        /// <summary>
        /// Get all the key=value pairs (pins) exposed by the implementor.
        /// </summary>
        /// <param name="item">The optional item. The item with its parts
        /// can optionally be passed to this method for those parts requiring
        /// to access further data.</param>
        /// <returns>The pins.</returns>
        public override IEnumerable <DataPin> GetDataPins(IItem item)
        {
            DataPinBuilder builder = new DataPinBuilder(
                new StandardDataPinTextFilter());

            builder.AddValue("id", GraffitiId);

            if (!string.IsNullOrEmpty(Language))
            {
                builder.AddValue("language", Language);
            }

            if (!string.IsNullOrEmpty(Verse))
            {
                builder.AddValue("verse", Verse);
            }

            if (!string.IsNullOrEmpty(Author))
            {
                builder.AddValue("author", Author, filter: true, filterOptions: true);
            }

            if (Identifications?.Count > 0)
            {
                builder.AddValues("pid", Identifications.Select(i => i.Id));
            }

            if (Date != null)
            {
                builder.AddValue("date-value", Date.GetSortValue());
            }

            return(builder.Build(this));
        }
Beispiel #12
0
        /// <summary>
        /// Get all the key=value pairs (pins) exposed by the implementor.
        /// </summary>
        /// <param name="item">The optional item. The item with its parts
        /// can optionally be passed to this method for those parts requiring
        /// to access further data.</param>
        /// <returns>The pins: <c>tot-count</c> and a collection of pins with
        /// these keys: <c>lid</c>, <c>lemma</c>, <c>u-lemma</c>, <c>pos</c>,
        /// <c>variant</c>, <c>u-variant</c>.</returns>
        public override IEnumerable <DataPin> GetDataPins(IItem item)
        {
            DataPinBuilder builder = new DataPinBuilder(
                DataPinHelper.DefaultFilter);

            builder.Set("tot", Forms?.Count ?? 0, false);

            if (Forms?.Count > 0)
            {
                foreach (WordForm form in Forms)
                {
                    builder.AddValue("lid", form.Lid);
                    builder.AddValue("lemma", form.Lemma,
                                     filter: true, filterOptions: true);
                    builder.AddValue("u-lemma", form.Lemma);
                    builder.AddValue("pos", form.Pos);

                    if (form.Variants?.Count > 0)
                    {
                        foreach (var v in form.Variants)
                        {
                            builder.AddValue("variant", v.Value,
                                             filter: true, filterOptions: true);
                            builder.AddValue("u-variant", v.Value);
                        }
                    }
                }
            }

            return(builder.Build(this));
        }
Beispiel #13
0
        /// <summary>
        /// Get all the key=value pairs (pins) exposed by the implementor.
        /// </summary>
        /// <param name="item">The optional item. The item with its parts
        /// can optionally be passed to this method for those parts requiring
        /// to access further data.</param>
        /// <returns>The pins: <c>tot-count</c> and a collection of pins with
        /// these keys: <c>id</c>.</returns>
        public override IEnumerable <DataPin> GetDataPins(IItem item)
        {
            DataPinBuilder builder = new DataPinBuilder();

            builder.Set("tot", Hands?.Count ?? 0, false);

            if (Hands?.Count > 0)
            {
                foreach (MsHand hand in Hands)
                {
                    if (!string.IsNullOrEmpty(hand.Id))
                    {
                        builder.AddValue("id", hand.Id);
                    }

                    if (!string.IsNullOrEmpty(hand.PersonId))
                    {
                        builder.AddValue("person-id", hand.PersonId);
                    }

                    if (hand.Types?.Count > 0)
                    {
                        foreach (string type in hand.Types)
                        {
                            builder.AddValue("type", type);
                        }
                    }
                }
            }

            return(builder.Build(this));
        }
Beispiel #14
0
        /// <summary>
        /// Get all the key=value pairs (pins) exposed by the implementor.
        /// </summary>
        /// <param name="item">The optional item. The item with its parts
        /// can optionally be passed to this method for those parts requiring
        /// to access further data.</param>
        /// <returns>The pins: a collection of pins with keys:
        /// <c>tot-count</c>=total count of exchanges in the part;
        /// <c>dubious-count</c>, <c>indirect-count</c>, <c>incoming-count</c>,
        /// <c>{TAG}-date-value</c>, <c>{TAG}-place</c> (filtered, including
        /// digits), <c>participant.ROLE</c> (filtered including digits),
        /// <c>att-TYPE-count</c>=count of attachment of type TYPE (one count
        /// for each distinct type found in the part), <c>att-tot-count</c>=
        /// total count of attachments.</returns>
        public override IEnumerable <DataPin> GetDataPins(IItem item)
        {
            DataPinBuilder builder =
                new DataPinBuilder(DataPinHelper.DefaultFilter);

            builder.Set("tot", Exchanges?.Count ?? 0, false);

            foreach (CorrExchange exchange in Exchanges)
            {
                if (exchange.IsDubious)
                {
                    builder.Increase("dubious", false);
                }
                if (exchange.IsIndirect)
                {
                    builder.Increase("indirect", false);
                }
                if (exchange.IsFromParticipant)
                {
                    builder.Increase("incoming", false);
                }

                if (exchange.Chronotopes?.Count > 0)
                {
                    foreach (Chronotope c in exchange.Chronotopes)
                    {
                        string tag = c.Tag?.ToLowerInvariant() ?? "";

                        if (c.Date != null)
                        {
                            builder.AddValue("date-value." + tag, c.Date.GetSortValue());
                        }

                        if (!string.IsNullOrEmpty(c.Place))
                        {
                            builder.AddValue("place." + tag,
                                             c.Place, filter: true, filterOptions: true);
                        }
                    }
                }

                if (exchange.Participants?.Count > 0)
                {
                    foreach (var p in exchange.Participants)
                    {
                        builder.AddValue($"participant.{p.Tag ?? ""}", p.Id,
                                         filter: true, filterOptions: true);
                    }
                }

                if (exchange.Attachments?.Count > 0)
                {
                    builder.Increase(from a in exchange.Attachments
                                     select a.Type, true, "att-");
                }
            }

            return(builder.Build(this));
        }
Beispiel #15
0
        /// <summary>
        /// Get all the key=value pairs (pins) exposed by the implementor.
        /// </summary>
        /// <param name="item">The optional item. The item with its parts
        /// can optionally be passed to this method for those parts requiring
        /// to access further data.</param>
        /// <returns>The pins.</returns>
        public override IEnumerable <DataPin> GetDataPins(IItem item)
        {
            DataPinBuilder builder = new DataPinBuilder(
                DataPinHelper.DefaultFilter);

            builder.AddValue("prison-id", PrisonId);
            builder.AddValue("cell", Cell);
            builder.AddValue("loc", Location);

            return(builder.Build(this));
        }
Beispiel #16
0
        /// <summary>
        /// Get all the key=value pairs (pins) exposed by the implementor.
        /// </summary>
        /// <param name="item">The optional item. The item with its parts
        /// can optionally be passed to this method for those parts requiring
        /// to access further data.</param>
        /// <returns>The pins.</returns>
        public override IEnumerable <DataPin> GetDataPins(IItem item)
        {
            DataPinBuilder builder = new DataPinBuilder(
                DataPinHelper.DefaultFilter);

            builder.AddValue("id", PrisonerId);
            builder.AddValue("prison-id", PrisonId);
            if (Sex != '\0')
            {
                builder.AddValue("sex", new string(Sex, 1));
            }
            if (Name != null)
            {
                builder.AddValue("name",
                                 DataPinHelper.DefaultFilter.Apply(Name.GetFullName(), true));
            }

            if (BirthDate != null)
            {
                builder.AddValue("birth-value", BirthDate.GetSortValue());
            }

            if (DeathDate != null)
            {
                builder.AddValue("death-value", DeathDate.GetSortValue());
            }

            if (!string.IsNullOrEmpty(Origin))
            {
                builder.AddValue("origin", Origin, filter: true, filterOptions: true);
            }

            if (!string.IsNullOrEmpty(Charge))
            {
                builder.AddValue("charge", Charge, filter: true, filterOptions: true);
            }

            if (!string.IsNullOrEmpty(Judgement))
            {
                builder.AddValue("judgement", Judgement, filter: true, filterOptions: true);
            }

            if (DetentionStart != null)
            {
                builder.AddValue("det-start-value", DetentionStart.GetSortValue());
            }

            if (DetentionEnd != null)
            {
                builder.AddValue("det-end-value", DetentionEnd.GetSortValue());
            }

            return(builder.Build(this));
        }
        /// <summary>
        /// Get all the key=value pairs exposed by the implementor.
        /// </summary>
        /// <param name="item">The optional item. The item with its parts
        /// can optionally be passed to this method for those parts requiring
        /// to access further data.</param>
        /// <returns>The pins: <c>fr.tag</c>=tag if any.</returns>
        public IEnumerable <DataPin> GetDataPins(IItem item = null)
        {
            DataPinBuilder builder = new DataPinBuilder(
                DataPinHelper.DefaultFilter);

            builder.AddValue(PartBase.FR_PREFIX + "value",
                             Value, filter: true, filterOptions: true);
            builder.AddValue(PartBase.FR_PREFIX + "u-value", Value);
            builder.AddValue(PartBase.FR_PREFIX + "n-value", NormValue);

            return(builder.Build(null));
        }
Beispiel #18
0
        /// <summary>
        /// Get all the key=value pairs (pins) exposed by the implementor.
        /// </summary>
        /// <param name="item">The optional item. The item with its parts
        /// can optionally be passed to this method for those parts requiring
        /// to access further data.</param>
        /// <returns>The pins.</returns>
        public override IEnumerable <DataPin> GetDataPins(IItem item)
        {
            DataPinBuilder builder = new DataPinBuilder(
                DataPinHelper.DefaultFilter);

            builder.AddValue("id", PrisonId);
            if (!string.IsNullOrEmpty(Place))
            {
                builder.AddValue("place", Place, filter: true, filterOptions: true);
            }

            return(builder.Build(this));
        }
        /// <summary>
        /// Get all the key=value pairs (pins) exposed by the implementor.
        /// </summary>
        /// <param name="item">The optional item. The item with its parts
        /// can optionally be passed to this method for those parts requiring
        /// to access further data.</param>
        /// <returns>The pins: <c>tot-count</c> and a collection of pins with
        /// these keys: <c>witness</c>.</returns>
        public override IEnumerable <DataPin> GetDataPins(IItem item)
        {
            DataPinBuilder builder = new DataPinBuilder();

            builder.Set("tot", Witnesses?.Count ?? 0, false);

            if (Witnesses?.Count > 0)
            {
                builder.AddValues("witness", from w in Witnesses select w.Id);
            }

            return(builder.Build(this));
        }
Beispiel #20
0
        /// <summary>
        /// Get all the key=value pairs (pins) exposed by the implementor.
        /// </summary>
        /// <param name="item">The optional item. The item with its parts
        /// can optionally be passed to this method for those parts requiring
        /// to access further data.</param>
        /// <returns>The pins: <c>sheet-count</c>, <c>guard-sheet-count</c>,
        /// <c>section-count</c>, and a list with keys: <c>section-TAG-count</c>,
        /// <c>section-label</c> (filtered, with digits),
        /// <c>section-date-value</c>, <c>guard-material</c> (filtered, with
        /// digits), <c>guard-date-value</c>.
        /// </returns>
        public override IEnumerable <DataPin> GetDataPins(IItem item)
        {
            DataPinBuilder builder =
                new DataPinBuilder(DataPinHelper.DefaultFilter);

            builder.Set("sheet", SheetCount, false);
            builder.Set("guard-sheet", GuardSheetCount, false);
            builder.Set("section", Sections?.Count ?? 0, false);

            if (GuardSheets?.Count > 0)
            {
                foreach (MsGuardSheet guard in GuardSheets)
                {
                    if (!string.IsNullOrEmpty(guard.Material))
                    {
                        builder.AddValue("guard-material", guard.Material,
                                         filter: true, filterOptions: true);
                    }

                    if (guard.Date != null)
                    {
                        builder.AddValue("guard-date-value",
                                         guard.Date.GetSortValue());
                    }
                }
            }

            if (Sections?.Count > 0)
            {
                foreach (MsSection section in Sections)
                {
                    builder.Increase(section.Tag, false, "section-");

                    if (!string.IsNullOrEmpty(section.Label))
                    {
                        builder.AddValue("section-label",
                                         section.Label, filter: true, filterOptions: true);
                    }

                    if (section.Date != null)
                    {
                        builder.AddValue("section-date-value",
                                         section.Date.GetSortValue());
                    }
                }
            }

            return(builder.Build(this));
        }
Beispiel #21
0
        /// <summary>
        /// Get all the key=value pairs (pins) exposed by the implementor.
        /// </summary>
        /// <param name="item">The optional item. The item with its parts
        /// can optionally be passed to this method for those parts requiring
        /// to access further data.</param>
        /// <returns>The pins: <c>att-TYPE-count</c>=count of attachment of
        /// type TYPE (one count for each distinct type found in the part),
        /// <c>tot-count</c>=total count of attachments; plus a list of
        /// attachment IDs with key <c>aid</c>.</returns>
        public override IEnumerable <DataPin> GetDataPins(IItem item)
        {
            DataPinBuilder builder = new DataPinBuilder();

            builder.Set("tot", Attachments?.Count ?? 0, false);

            if (Attachments.Count > 0)
            {
                builder.AddValues("aid", Attachments.Select(a => a.Id));
                builder.Increase(from a in Attachments
                                 select a.Type, false, "att-");
            }

            return(builder.Build(this));
        }
Beispiel #22
0
        /// <summary>
        /// Get all the key=value pairs (pins) exposed by the implementor.
        /// </summary>
        /// <param name="item">The optional item. The item with its parts
        /// can optionally be passed to this method for those parts requiring
        /// to access further data.</param>
        /// <returns>The pins: <c>tot-count</c> and a collection of pins with
        /// these keys: <c>hand-id</c>.</returns>
        public override IEnumerable <DataPin> GetDataPins(IItem item)
        {
            DataPinBuilder builder = new DataPinBuilder();

            builder.Set("tot", Features?.Count ?? 0, false);

            if (Features?.Count > 0)
            {
                foreach (MsFormalFeature feature in Features)
                {
                    builder.AddValue("hand-id", feature.HandId);
                }
            }

            return(builder.Build(this));
        }
Beispiel #23
0
        /// <summary>
        /// Get all the key=value pairs (pins) exposed by the implementor.
        /// </summary>
        /// <param name="item">The optional item. The item with its parts
        /// can optionally be passed to this method for those parts requiring
        /// to access further data.</param>
        /// <returns>The pins: <c>tot-count</c> and a collection of pins with
        /// these keys: <c>type-{TYPE}-count</c>.</returns>
        public override IEnumerable <DataPin> GetDataPins(IItem item)
        {
            DataPinBuilder builder = new DataPinBuilder();

            builder.Set("tot", Ornaments?.Count ?? 0, false);

            if (Ornaments?.Count > 0)
            {
                foreach (MsOrnament ornament in Ornaments)
                {
                    // type-X-count counts if not null, unfiltered:
                    builder.Increase(ornament.Type, false, "type-");
                }
            }

            return(builder.Build(this));
        }
Beispiel #24
0
        /// <summary>
        /// Get all the key=value pairs (pins) exposed by the implementor.
        /// </summary>
        /// <param name="item">The optional item. The item with its parts
        /// can optionally be passed to this method for those parts requiring
        /// to access further data.</param>
        /// <returns>The pins: <c>tot-count</c> and a collection of pins with
        /// these keys: <c>type-X-count</c>, <c>subject-X-count</c>,
        /// <c>color-X-count</c>, (all the keys with X are filtered, with digits),
        /// <c>artist-id</c> (filtered, with digits).
        /// </returns>
        public override IEnumerable <DataPin> GetDataPins(IItem item)
        {
            DataPinBuilder builder = new DataPinBuilder(
                DataPinHelper.DefaultFilter);

            builder.Set("tot", Decorations?.Count ?? 0, false);

            if (Decorations?.Count > 0)
            {
                foreach (MsDecoration decoration in Decorations)
                {
                    builder.Increase(
                        DataPinHelper.DefaultFilter.Apply(decoration.Type, true),
                        false, "type-");

                    if (decoration.Date != null)
                    {
                        builder.AddValue("date-value", decoration.Date.GetSortValue());
                    }

                    foreach (MsDecorationElement element in decoration?.Elements)
                    {
                        builder.Increase(
                            DataPinHelper.DefaultFilter.Apply(element.Subject, true),
                            false,
                            "subject-");

                        foreach (string color in element.Colors)
                        {
                            builder.Increase(
                                DataPinHelper.DefaultFilter.Apply(color, true),
                                false,
                                "color-");
                        }
                    }

                    if (!string.IsNullOrEmpty(decoration.Artist?.Id))
                    {
                        builder.AddValue("artist-id", decoration.Artist.Id,
                                         filter: true, filterOptions: true);
                    }
                }
            }

            return(builder.Build(this));
        }
Beispiel #25
0
        /// <summary>
        /// Get all the key=value pairs (pins) exposed by the implementor.
        /// </summary>
        /// <param name="item">The optional item. The item with its parts
        /// can optionally be passed to this method for those parts requiring
        /// to access further data.</param>
        /// <returns>The pins: <c>tot-count</c> and a collection of pins with
        /// keys: <c>pos-X-count</c>, <c>vrt-X-count</c>.</returns>
        public override IEnumerable <DataPin> GetDataPins(IItem item)
        {
            DataPinBuilder builder = new DataPinBuilder();

            builder.Set("tot", Catchwords?.Count ?? 0, false);

            if (Catchwords?.Count > 0)
            {
                foreach (MsCatchword catchword in Catchwords)
                {
                    builder.Increase(catchword.Position, false, "pos-");
                    builder.Increase(catchword.IsVertical, false, "vrt-");
                }
            }

            return(builder.Build(this));
        }
Beispiel #26
0
        /// <summary>
        /// Get all the key=value pairs (pins) exposed by the implementor.
        /// </summary>
        /// <param name="item">The optional item. The item with its parts
        /// can optionally be passed to this method for those parts requiring
        /// to access further data.</param>
        /// <returns>The pins: <c>person-id</c>; <c>job</c> (filtered, with digits).
        /// </returns>
        public override IEnumerable <DataPin> GetDataPins(IItem item)
        {
            DataPinBuilder builder = new DataPinBuilder(
                DataPinHelper.DefaultFilter);

            if (!string.IsNullOrEmpty(PersonId))
            {
                builder.AddValue("person-id", PersonId);
            }

            if (!string.IsNullOrEmpty(Job))
            {
                builder.AddValue("job", Job, filter: true, filterOptions: true);
            }

            return(builder.Build(this));
        }
Beispiel #27
0
        /// <summary>
        /// Get all the key=value pairs (pins) exposed by the implementor.
        /// </summary>
        /// <param name="item">The optional item. The item with its parts
        /// can optionally be passed to this method for those parts requiring
        /// to access further data.</param>
        /// <returns>The pins: multiple pins with key <c>area</c>,
        /// <c>owner</c> (both filtered, with digits).</returns>
        public override IEnumerable <DataPin> GetDataPins(IItem item)
        {
            DataPinBuilder builder = new DataPinBuilder(
                new StandardDataPinTextFilter());

            if (Provenances?.Count > 0)
            {
                builder.AddValues("area", Provenances.Select(p => p.Area),
                                  filter: true, filterOptions: true);
            }

            if (Owners?.Count > 0)
            {
                builder.AddValues("owner", Owners,
                                  filter: true, filterOptions: true);
            }

            return(builder.Build(this));
        }
Beispiel #28
0
        /// <summary>
        /// Get all the key=value pairs (pins) exposed by the implementor.
        /// </summary>
        /// <param name="item">The optional item. The item with its parts
        /// can optionally be passed to this method for those parts requiring
        /// to access further data.</param>
        /// <returns>The pins: <c>tot-count</c>=total count of pseudonyms;
        /// for each pseudonym, a <c>pseudonym</c> pin with value equal to
        /// <c>+</c>=author's pseudonym or <c>-</c>=non-author pseudonym,
        /// followed by the filtered pseudonym (including digits).
        /// </returns>
        public override IEnumerable <DataPin> GetDataPins(IItem item)
        {
            DataPinBuilder builder = new DataPinBuilder(
                DataPinHelper.DefaultFilter);

            builder.Set("tot", Pseudonyms?.Count ?? 0, false);

            if (Pseudonyms?.Count > 0)
            {
                builder.AddValues("pseudonym",
                                  from p in Pseudonyms
                                  select builder.ApplyFilter(options: true,
                                                             p.IsAuthor ? "+" : "-",
                                                             true,
                                                             p.Value));
            }

            return(builder.Build(this));
        }
Beispiel #29
0
        /// <summary>
        /// Get all the key=value pairs (pins) exposed by the implementor.
        /// </summary>
        /// <param name="item">The optional item. The item with its parts
        /// can optionally be passed to this method for those parts requiring
        /// to access further data.</param>
        /// <returns>The pins.</returns>
        public override IEnumerable <DataPin> GetDataPins(IItem item)
        {
            DataPinBuilder builder = new DataPinBuilder(
                new StandardDataPinTextFilter());

            // tot-count
            builder.Set("tot", Contents?.Count ?? 0, false);

            if (Contents?.Count > 0)
            {
                foreach (var content in Contents)
                {
                    builder.AddValue("work", content.Work);
                    builder.AddValue("title", content.Title,
                                     filter: true, filterOptions: true);
                }
            }

            return(builder.Build(this));
        }
Beispiel #30
0
        /// <summary>
        /// Get all the key=value pairs (pins) exposed by the implementor.
        /// </summary>
        /// <param name="item">The optional item. The item with its parts
        /// can optionally be passed to this method for those parts requiring
        /// to access further data.</param>
        /// <returns>The pins: <c>tot-count</c> and a collection of pins with
        /// these keys: <c>sheet-count</c>.</returns>
        public override IEnumerable <DataPin> GetDataPins(IItem item)
        {
            DataPinBuilder builder = new DataPinBuilder();

            builder.Set("tot", Quires?.Count ?? 0, false);

            if (Types?.Count > 0)
            {
                builder.AddValues("type", Types);
            }

            if (Quires?.Count > 0)
            {
                builder.AddValues(
                    "sheet-count",
                    from q in Quires
                    select q.SheetCount.ToString(CultureInfo.InvariantCulture));
            }

            return(builder.Build(this));
        }