* Creating UDF items in standard record

For users to report plugin bugs and request plugin enhancements; and for authors to test new/new versions of plugins, and to discuss plugin development (in the Programming Technicalities sub-forum). If you want advice on choosing or using a plugin, please ask in General Usage or an appropriate sub-forum.
Post Reply
avatar
stanm
Platinum
Posts: 34
Joined: 02 May 2014 17:46
Family Historian: V7
Location: California, USA

Creating UDF items in standard record

Post by stanm » 29 Apr 2015 02:55

Is there a way to create custom tags in a standard record (in this case a Source record)? I attempted to use fhCreateItem() but it returns Null.

My knowledge of Lua is basic. I suspect there is some way to do this because arbitrary records can be cloned.

-Stan

User avatar
tatewise
Megastar
Posts: 27088
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Creating UDF items in standard record

Post by tatewise » 29 Apr 2015 10:58

Hi Stan.
Unfortunately, it is not possible to create non-standard custom tags via a Plugin using LUA.

There are two possible workarounds.

1) Read, Edit, Write Gedcom File
From a Plugin it is possible to open the Gedcom file.
Then read through line by line making textual changes such as inserting custom tags.
Finally write the whole file back.

2) Manually Insert Custom Tags and Clone Using Plugin
Manually edit the Gedcom file with a plain text editor and insert the custom tags in a template record.
A Plugin can then use fhCreateItem() to clone any such custom tag within the same type of record.

As a matter of interest, what is your objective for creating non-standard custom tags?
Many times I have found users ask for a solution without fully explaining the purpose.
Once the objective is clear, then often there is another solution.

BTW: I guess you know that non-standard custom tags will probably not migrate to other genealogy applications in the future.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

avatar
stanm
Platinum
Posts: 34
Joined: 02 May 2014 17:46
Family Historian: V7
Location: California, USA

Re: Creating UDF items in standard record

Post by stanm » 29 Apr 2015 18:27

Hi, Mike

Thank you for your comments and suggestions.

I'm trying to extend support for Evidence Explained style citations. With this style there are three components: source list entry, full reference note, and short reference note. This is the GEDCOM source record mapping, I'd like to use:
  • SOUR.TITL = full ref note (or footnote/endnote)
  • SOUR._BIBL = source list (or bibliography) entry
  • SOUR._SUBQ = short (or subsequent) ref note
_BIBL and _SUBQ are used by RootsMagic in the same way.

The "Customize Property Box" allows modification of the input screen to add _BIBL and _SUBQ fields, for a manually edited GEDCOM. My hope was that I could make all of this self-contained in a plugin and not have to require a GEDCOM with pre-existing tags.

I had considered using NOTE2[2] and NOTE2[3] to store these strings, but it is less clear "what is what" from the Notes and All tabs.
Stan Mitchell

User avatar
tatewise
Megastar
Posts: 27088
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Creating UDF items in standard record

Post by tatewise » 29 Apr 2015 19:05

I am not familiar with the details of Evidence Explained, but if you Search the Forums there are many discussions on that topic, at least one of which involved you.

Unless you have an alternative use for them, it is not clear to me why you cannot use Short Title (ABBR) for short ref note, and Author (AUTH) for source list / bibliography, perhaps together with Publication Information. They would appear to fulfil a similar purpose. I think other FHUG members may be better versed in Evidence Explained. Maybe if you got together, a Knowledge Base wiki entry could form a common point of reference.

The fact that RootsMagic uses some non-standard tags does not really make them any more portable.

I presume you realise that the Gedcom only has to be seeded with the non-standard tags once, and a Plugin can then reproduce them in any new records.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

avatar
stanm
Platinum
Posts: 34
Joined: 02 May 2014 17:46
Family Historian: V7
Location: California, USA

Re: Creating UDF items in standard record

Post by stanm » 29 Apr 2015 23:10

A while ago I did post the query Entering Evidence! Style citations to get some feedback. Through trial and error I found that using only TITL and ABBR fields (AUTH and PUBL blank) yielded the best results with reports. The one response I got, agreed with that approach.

To avoid breaking that which is working, it seems prudent to cloak the two additional strings in two custom tags.
tatewise wrote:I presume you realise that the Gedcom only has to be seeded with the non-standard tags once, and a Plugin can then reproduce them in any new records.
Thanks for emphasizing this. I didn't fully appreciate item#2 in your first reply.

Is there such a thing as a "template record" which is ignored by queries and reports? (Probably wishful thinking ;) )
Stan Mitchell

User avatar
tatewise
Megastar
Posts: 27088
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Creating UDF items in standard record

Post by tatewise » 30 Apr 2015 00:16

There is no special template record but a Source Record with an unusual Type and not cited by anything is unlikely to appear in Queries or Reports or could easily be excluded.

There is a standard Option in most Reports to inhibit both Author and Publication Info to get the same effect as if they were blank.

In any Report see Report > Options > Sources tab Sources Information to Include and untick Author and Publication Information.

Then you can add anything to either of those fields without any effect on Reports, you don't need a Plugin, and those fields will export to any other genealogy application that supports Gedcom correctly.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

avatar
stanm
Platinum
Posts: 34
Joined: 02 May 2014 17:46
Family Historian: V7
Location: California, USA

Re: Creating UDF items in standard record

Post by stanm » 30 Apr 2015 18:25

I would expect that using AUTH and PUBL for this purpose, would break other GEDCOM reporting tools that aren't as flexible as FH. I believe the common behavior is to concatenate these three fields in reports: [AUTH] [TITL] [PUBL], sometimes with various punctuation added. If I use those tags to carry custom information, reports depending upon standard content would be very messed up.

By the way, one GEDCOM to website generator that I have used, GED-GEN, does support the _BIBL tag to create a nice bibliography section for a static website.
Stan Mitchell

User avatar
tatewise
Megastar
Posts: 27088
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Creating UDF items in standard record

Post by tatewise » 30 Apr 2015 18:51

There appear to be various compromise decisions to be made that I am not qualified to advise upon. Is it better to use highly portable standard Gedcom tags and suffer poorly formatted external reports (that could be avoided?), or use less portable custom tags in the hope that external reports are better formatted?

May I suggest you post a topic such as Evidence Explained Notations in the General Usage Forum and ask if other FH users have any suggestions based on their own experiences.

Then, if there is a consensus, you could jointly produce tools such as Plugins to support the common approach, and a [kb]|[/kb] page created to provide advice for applying the Evidence Explained concepts.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

avatar
stanm
Platinum
Posts: 34
Joined: 02 May 2014 17:46
Family Historian: V7
Location: California, USA

Re: Creating UDF items in standard record

Post by stanm » 30 Apr 2015 22:01

I posed the question regarding EE citations in General Usage to see if there is a broader interest. I'm not sure how much interest there will be.

For now, I have a simple plugin that works using a GEDCOM primed with the UDF tags.

Thanks for your help!
Stan Mitchell

Post Reply