Menu

#13 Misc. Family.Show issues

Prior
open
nobody
None
2012-12-28
2012-12-02
No

[Transferred from Family.Show for confirmation.]

spyhunter99 wrote Jul 6, 2011 at 8:17 AM

In general, Family.Show is a great rendering engine, but it's general lack of compliance with gedcom makes it very frustrating. The best approach would have been to start with the gedcom format since it's so flexible and then build the data class structures to match it. This xml conversion process really isn't necessary. Changing to a gedcom style class structure would mean that the user interface would have to be rewritten to allow for inserting the data.

When importing, the current version ignores all data associated with marriages other than the dates. What about notes? Images?

I've also found another rendering bug which seems to happen when there are a large number of children by the same parent (that also had children of another spouse 10+). Lines are no longer drawn connecting them. I've also found an instance where children won't show up for a particular spouse (wife) when she is highlighted.

spyhunter99 wrote Jul 3, 2011 at 9:10 PM

Problem #3 turns out the root cause is GeneaologyJ. When you add a spouse, it doesn't automatically add the marriage date unless you fill out at least one element. So its not actually a problem with family.show

spyhunter99 wrote Jul 3, 2011 at 8:23 PM

Ok I think I've identified a number of bugs. I build my gedcom file from GenealogyJ and it looks like your import class makes some invalid assumptions (at least in reference to the way that GenealogyJ saves it). Fix: in GedcomImport.cs, function private static string[] GetPhotos(XmlNode node)

change code to this (explain inline)
string[] photos;
XmlNodeList list = node.SelectNodes("OBJE");

        //AO added
        //this should be a list of OBJE references to xml nodes, siblings of node, that with matching values
        /*
         *    <INDI Value="@I54@">
                <NAME Value="name" />
                <SEX Value="F" />
                <OBJE Value="@M3@" />
              </INDI>
              <OBJE Value="@M3@">
                <FILE Value="D:/My Documents/Downloads/family tree/birth/name.jpg">
                  <FORM Value="jpg" />
                  <TITL Value="" />
                </FILE>
              </OBJE>
         * */
        photos = new string[list.Count];

        for (int i = 0; i < list.Count; i++)

            photos[i] = GetFile(list[i], node.ParentNode);

        return photos;

Problem #2. when importing dates, the gedcom format allows for qualifiers such as ABT, EST, BEF, AFT, etc... in the function, private static DateTime? GetValueDate(XmlNode node, string xpath)....I change the code this.
DateTime? result = null;

        try
        {
            string value = GetValue(node, xpath);
            if (!string.IsNullOrEmpty(value))
            {
                try
                {
                    return DateTime.Parse(value, CultureInfo.InvariantCulture);
                }
                catch { }
                //forgot about date qualifiers
                try
                {
                    if (value.StartsWith("ABT") || value.StartsWith("EST") || value.StartsWith("CAL") || value.StartsWith("BEF"))
                        return DateTime.Parse(value.Substring(4, value.Length - 4), CultureInfo.InvariantCulture);
                }
                catch { }
                //could be just a year
                if (value.Trim().Length == 4)
                    try
                    {
                        return new DateTime(Int32.Parse(value), 1, 1);
                    }
                    catch { }

                string[] stuff = value.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
                if (stuff == null || stuff.Length == 0)
                    return null;
                else
                {
                    for (int i = 0; i < stuff.Length; i++)
                    {
                        if (stuff[i].Trim().Length == 4)
                        {
                            return new DateTime(Int32.Parse(stuff[i].Trim()), 1, 1);
                        }
                    }
                }
            }
        }
        catch
        {
            // The date is invalid, ignore and continue processing.
        }

        return result;

Problem #3. Gedcom does not require a date associate with a marriage. If no date is specified, Family.Show will not render it. I haven't found a solution yet

Discussion

  • Kevin Routley

    Kevin Routley - 2012-12-20

    Can't repro the "no date for marriage" issue. Attached GED works.

    Need to consider playing with GenealogyJ for other issues. http://genj.sourceforge.net/

     
  • Kevin Routley

    Kevin Routley - 2012-12-28

    "I've also found another rendering bug which seems to happen when there are a large number of children by the same parent (that also had children of another spouse 10+). Lines are no longer drawn connecting them."

    I've been unable to reproduce this issue.

     

Log in to post a comment.