Difference between revisions of "Addon:Forms Gramplet"

From Gramps
Jump to: navigation, search
(Supported definitions)
m (Support forum threads)
 
(93 intermediate revisions by 7 users not shown)
Line 1: Line 1:
 
{{Third-party plugin}}
 
{{Third-party plugin}}
{{man note|Please note from Gramps 4.2.X the Form Addons are a replacement for the Census Addons.}}
+
{{man tip|Census or Form?|Please note the ''Form Addons'' are an upgrade released in 2015 to expand the flexibility of the original Census Addons. The ''Form Addons'' supersede the [[Census_Addons|Census Addons]] from Gramps 4.2.X}}
 +
[[File:Forms Gramplet.png|thumb|right|450px|Forms Gramplet - Shown Undocked from Bottombar Of People Category View]]
 +
The Form gramplet allows users to create and edit structured source data in a single form. It makes the meticulous process of recording all the discrete elements far less fussy and error-prone.
  
The Form gramplet allows users to create and edit structured source data in a single form.  
+
The {{man label|[[Addon:Forms_Gramplet#Forms_Gramplet|Form gramplet]]}} has been enhanced to handle other {{man label|[[Form_Definitions|forms]]}} such as birth, marriage and death certificates and parish register entries as well as the originally supported census forms.
  
The Form gramplet has been enhanced to handle other forms such as birth, marriage and death certificates and parish register entries.
+
Using a Form doesn't mean creating data that can only be accessed with the Form tool. You can forego using the Form Gramplet at any time but still see and edit the data that was entered. The Form gramplet merely streamlines creating Events with the [[Gramps_{{Version manual}}_Wiki_Manual_-_Entering_and_editing_data:_detailed_-_part_3#Attributes|Attributes]] to separately store elements of data from a structured source.  You ''could'' do the same process using the standard Gramps editors... it would just involve a lot more steps per Person or Event.
  
You can stop using the Form Gramplet at any time and still access the data you entered. All the Form gramplet does is create an event and attributes to store source data.  You could do this using the standard Gramps editors.
+
== Forms Gramplet ==
 +
 
 +
{{man warn|Before using the forms addons|You need to define the form that describes the information contained within a source.'''<br>See: [[Addon:Forms_Gramplet#Configuration|Configuration]]}}
 +
{{-}}
 +
=== Adding the Forms Gramplet ===
 +
[[File:AddingFormsGrampletToBottombarOfPeopleCategoryView-51.png|thumb|right|450px|Adding Forms Gramplet to bottombar of People Category (Tree) View]]
 +
The '''Forms gramplet''' is designed to be added  for the bottombar {{icon|peop}}[[Gramps_{{Version manual}}_Wiki_Manual_-_Categories#People_Category|People Category]] (''Grouped'' or ''List'') view modes of Gramps. (After [[Third-party_Addons#Installing_Addons_in_Gramps|installation]], this gramplet will be available for addition in all these locations: the [[Gramps_{{man version}}_Wiki_Manual_-_Gramplets#The_split-screen_Sidebar_.26_Bottombar|sidebar/bottombar option]] for the following views: {{icon|peop}}People, {{icon|rela}}Relationships, {{icon|ance}}Charts, and {{icon|geog}}Geography.) 
 +
 
 +
Select the {{man label|Forms}} menu option from the {{man label|Add a gramplet}} submenu of the [[Gramps_{{man version}}_Wiki_Manual_-_Main_Window#Gramplet_Bar_Menu|Gramplet selection menus]]. Accessible by pressing the {{man button|&or;}} (''Down Arrowhead'' button) in the view's sidebar or bottombar.
 +
 
 +
The blank '''Forms Gramplet''' will be shown docked as below.
 +
{{-}}
 +
[[File:FormsGrampletShownInBottombarOfPeopleCategoryView-51.png|thumb|left|450px|Forms Gramplet - Shown docked In Bottombar Of People Category View]]
 +
{{-}}
 +
=== Initial Configuration for each source ===
 +
{{man menu|Before using the forms addons you need to define the form that describes the information contained within a source. See: [[Addon:Forms_Gramplet#Configuration|Configuration]]}}
 +
 
 +
The Forms Gramplet lists all the events for the active person that can be edited using the form editor.  The listing displays the source, date and place of the event together with the role the active person performs in the event.
 +
 
 +
A new event can be created by clicking the {{man button|New}} button at the bottom of the {{man label|Forms Gramplet}} which will show you the {{man label|[[Addon:Forms_Gramplet#Form_Selector|Select Form]]}} selector dialog where you can choose the form to use. Once you select a form you will be taken to the {{man label|[[Addon:Forms_Gramplet#Form_Editor|Form Editor]]}}.
 +
 
 +
[[File:Forms Gramplet.png|thumb|right|450px|Forms Gramplet - Shown Undocked from Bottombar Of People Category View]]
 +
{{-}}
 +
<!-- [[File:Forms Gramplet showing existing event.png|thumb|right|450px|Forms Gramplet - Showing existing event]] -->
 +
 
 +
An existing event can be edited either by highlighting a row and clicking the {{man button|Edit}} button or by double-clicking on a row to bring up the {{man label|[[Addon:Forms_Gramplet#Form_Editor|Form Editor]]}}.
 +
 
 +
 
 +
If the {{man label|Forms Gramplet}} is undocked you can use the {{man button|Help}} button to see this page.
 +
{{-}}
 +
 
 +
== Form Selector ==
 +
 
 +
The form selector allows the user to select a source that has been associated with a form.  The sources are grouped by event type.
 +
 
 +
[[File:Form Selector.png|thumb|left|450px]]
 +
{{-}}
 +
{{man menu|If the {{man label|Form Selector}} list is empty then you need to define the form that describes the information contained within a source. See: [[Addon:Forms_Gramplet#Configuration|Configuration]]}}
 +
{{-}}
 +
 
 +
== Form Editor ==
 +
 
 +
The form editor is designed so that most data for an event can be entered into a single form.
 +
 
 +
* First a citation reference should be entered.  This should comprise of one or more references that uniquely identify the citation.  For example, in the case of a UK census you will need to enter the PRO reference, Piece, Folio and Page.
 +
 
 +
* The date of the event can be entered. For a census, the date is populated automatically.
 +
 
 +
* A place can be selected in the usual Gramps manner.
 +
{{-}}
 +
=== Details tab===
 +
The "{{man label|Details}}" tab provides an area which allows the user to enter data specific to individual people listed in the source. This tab can be divided into sections.  Each section consists of people performing the same role in the event.
 +
 
 +
[[File:Form Editor.png|left]]
 +
{{-}}
 +
==== Person Section ====
 +
 
 +
A person section allows information about a single person to be entered.  A new person can be created and selected by clicking the {{man button|+}} button.  A person already in Gramps can be selected by clicking the second button ({{man button|share}}).  The user is prevented from entering data until a person is selected.
 +
 
 +
[[File:Form Person Section.png|left]]
 +
{{-}}
 +
==== Family Section ====
 +
 
 +
A family section allows information about two people belonging to a family to be entered.  A new family can be created and selected by clicking the {{man button|+}} button.  A family already in Gramps can be selected by clicking the second button ({{man button|share}}).  The user is prevented from entering data until a family is selected.
 +
 
 +
[[File:Form Family Section.png|left]]
 +
{{-}}
 +
==== Multiple Person Section ====
 +
 
 +
A multiple person section allows information about multiple people to be entered.  A new person can be created and then added to the section by clicking the {{man button|+}} button.  A person already in Gramps can be added to the section by clicking the second button ({{man button|share}})A person can be removed from the section by clicking the {{man button|-}} button.  The order of people in the section can be changed by highlighting a row and then using the up {{man button|↑}} and down {{man button|↓}} arrow buttons.
 +
 
 +
[[File:Form Multiple Section.png|left]]
 +
{{-}}
 +
 
 +
===Headings tab===
 +
The {{man label|Headings}} tab provides an area which allows the user to enter data specific to the event listed in the source.
 +
 
 +
===Gallery tab===
 +
The {{man label|Gallery}} tab provides the ability to add media to the event.  This is done in the same way as in the standard Gramps editors.
  
 
==Configuration==
 
==Configuration==
Line 12: Line 92:
 
{{man menu|'''Before using the form addons, you need to define the form that describes the information contained within a source.'''}}
 
{{man menu|'''Before using the form addons, you need to define the form that describes the information contained within a source.'''}}
  
To do this you need to edit each {{man label|[[Gramps_5.0_Wiki_Manual_-_Entering_and_editing_data:_detailed_-_part_2#Editing_information_about_sources|Source]]}} and add an entry in the {{man label|"Attributes"}} tab.  The entry '''must''' have a key of "<code>Form</code>" and a value which is a {{man label|[[Form_Definitions|Code]]}} that uniquely identifies the form to be used eg: <code>UK1841</code>
+
To do this you need to edit each {{man label|[[Gramps_{{Version manual}}_Wiki_Manual_-_Entering_and_editing_data:_detailed_-_part_2#Editing_information_about_sources|Source]]}} and add an entry in the {{man label|"Attributes"}} tab.  The entry '''must''' have a key of "<code>Form</code>" and a value which is a {{man label|[[Form_Definitions|Code]]}} that uniquely identifies the form to be used eg: <code>UK1841</code>
  
 
{{man tip| Translated Gramps |2=If you are using Gramps in a language other than English, enter the translated version of the key (e.g. In French, "<code>Formulaire</code>" instead of "<code>Form</code>").}}
 
{{man tip| Translated Gramps |2=If you are using Gramps in a language other than English, enter the translated version of the key (e.g. In French, "<code>Formulaire</code>" instead of "<code>Form</code>").}}
  
[[Image:Form Source.png]]
+
[[File:Form Source.png|left]]
 
+
{{-}}
 
=== Supported form definitions ===
 
=== Supported form definitions ===
  
To see a full list of the supported {{man label|Code}}'s for definitions included with the addon that are available, See: [[Form Definitions]]
+
To see a full list of the supported {{man label|Code}}'s for definitions included with the addon that are available, See: [[Addon:Form Definitions]]
  
=== Writing your own definitions ===
+
=== Writing your own form definitions ===
  
 
{{man note|Note|Make sure that your definition file is saved using UTF-8 encoding.}}
 
{{man note|Note|Make sure that your definition file is saved using UTF-8 encoding.}}
Line 28: Line 108:
 
If a form you require is not in the list of supported [[Form Definitions|definitions]] then you can write your own.
 
If a form you require is not in the list of supported [[Form Definitions|definitions]] then you can write your own.
  
Form definitions are stored in XML files.  These are located in the Form directory beneath your plugins directory.  The file called <code>form_xx.xml</code>(where ''xx'' is a country code), is provided in the download, and contains some common definitions.  Additional files called <code>custom.xml</code> and <code>test.xml</code> will also be searched.
+
Form definitions are stored in XML files.  These are located in the Form directory beneath your [[Gramps_{{Version manual}}_Wiki_Manual_-_User_Directory|user plugins directory]].  The file called <code>form_xx.xml</code>(where ''xx'' is a country code), is provided in the download, and contains some common definitions.  Additional files called <code>custom.xml</code> and <code>test.xml</code> will also be searched.
  
 
Definition files consist of an XML declaration followed by a <code>forms</code> element.
 
Definition files consist of an XML declaration followed by a <code>forms</code> element.
Line 38: Line 118:
 
The <code>forms</code> element contains a number of <code>form</code> elements, each representing a form definition.  The form start-tag contains 4 attributes:
 
The <code>forms</code> element contains a number of <code>form</code> elements, each representing a form definition.  The form start-tag contains 4 attributes:
  
* <code>id</code> : A unique code to identify the form definition.
+
* <code>id</code> : A unique code to identify the form definition.  You will use this code in the "Form" attribute of the source.
* <code>type</code>: The type of the event created by the form editor.  This is the XML representation of an EventType.
+
* <code>type</code>: The type of the event created by the form editor.  This value will appear in the "<code>Type</code>" column of events ("EventType").  It would be wise to avoid standard ones, for example, to add death information you could specify "Death.Info" or another one you make up (Data loss is possible otherwise).
* <code>title</code> : A description of the form.
+
* <code>title</code> : A description of the form.  It should be possible to use anything here.
* <code>date</code> : An optional date in a Gramps date format.  This is only useful for census definitions.
+
* <code>date</code> : An optional date in a Gramps date format.  This is only useful for census definitions or similar events that happen on a specific date.
  
 
  <form id='UK1841' type='Census' title='1841 UK Census' date='6 Jun 1841'>
 
  <form id='UK1841' type='Census' title='1841 UK Census' date='6 Jun 1841'>
  
The form is divided into sections which describe the information that needs to be captured for people performing a given role in the event.  Each form element should contain at least one section element.  The <code>section</code> start-tag contains 3 attributes:
+
The form is divided into sections which describe the information that needs to be captured for people performing a given role in the event.  Each form element should contain at least one section element.  The <code>section</code> start-tag can specify these 3 attributes:
  
* <code>role</code> : The role that people in this section perform in the event.  This is the XML representation of an EventRoleType.
+
* <code>role</code> : The role that people in this section perform in the event.  This value will appear in the "<code>Role</code>" column of events ("EventRoleType").
 
* <code>type</code> : The type of section. This defines how a section is displayed and people are selected.  Allowed values are:  '<code>person</code>' for a single person, '<code>multi</code>' for one or more people, or '<code>family</code>' for two people selected by a family.
 
* <code>type</code> : The type of section. This defines how a section is displayed and people are selected.  Allowed values are:  '<code>person</code>' for a single person, '<code>multi</code>' for one or more people, or '<code>family</code>' for two people selected by a family.
* <code>title</code> : An optional title which will be used to describe the section.
+
* <code>title</code> : This is used when displaying the section on the form and provides the only way to visually tell multiple sections apart. In a marriage you would have a "Husband", a "Wife" and possibly others such as "Witnesses".
  
 
  <nowiki><section role='Primary' type='person' title='Child'></nowiki>
 
  <nowiki><section role='Primary' type='person' title='Child'></nowiki>
Line 57: Line 137:
 
A column element contains:
 
A column element contains:
  
* An <code>_attribute</code> element.  This contains the key used to store column information in the attributes of event reference objects within the Gramps database.  Once defined this text must not be changed.
+
* An <code>_attribute</code> element.  This contains the key used to store column information in the attributes of event reference objects within the Gramps database (The "Type" Attribute of the reference information for the event.  If you use "<code>Name</code>" then the selected person's name will be prefilled.  Once defined this text must not be changed.
* An optional <code>_longname</code> element.  This contains a fuller description of the column that is used in the tooltips in the editor.
+
* An optional <code>_longname</code> element.  This contains a fuller description of the column and is only used for tooltips (when you hover the mouse over the field in the form).
* A <code>size</code> element.  This contains the size of the column in the census report.  It is a percentage of the page width.  The sum of all size elements in a definition should total 100%.
+
* A <code>size</code> element.  This contains the size of the column in the census report.  It is a percentage of the page width.  The sum of all size elements in a definition should total 100%.  
  
 
  <column>
 
  <column>
Line 81: Line 161:
 
Although you can add your definitions to the pre-defined entries in <code>form_xx.xml</code>, it is recommended you create a separate file called <code>custom.xml</code> or <code>test.xml</code> for this purpose.
 
Although you can add your definitions to the pre-defined entries in <code>form_xx.xml</code>, it is recommended you create a separate file called <code>custom.xml</code> or <code>test.xml</code> for this purpose.
  
=== Submitting your definitions ===
+
====Tips on debugging your custom form definitions====
 
+
After creating or updating a form (in <code>custom.xml</code> or <code>test.xml</code>) to make sure your Form is correctly formatted use a text editor that includes an XML mode and syntax check, (like <code>NotePad++</code> and install the "<code>XML Tools</code>" plugin), then the editor will be able to tell you if your Form's XML code is formatted correctly.
Once you have written some custom definitions, you may wish to share them with the Gramps community.
 
 
 
A [[Form Testing]] area is available for this purpose.
 
 
 
== Forms Gramplet ==
 
 
 
{{man menu|The Forms Gramplet is designed to be added to the bottombar of a [[Gramps_5.0_Wiki_Manual_-_Categories#People_Category|person view]]}}.
 
  
The Forms Gramplet lists all the events for the active person that can be edited using the form editor. The listing displays the source, date and place of the event together with the role the active person performs in the event.
+
If the XML form check worked then start Gramps to test it and if the {{man button|New}} and {{man button|Edit}} buttons don't appear in the {{man label|Forms Gramplet}} then there is a good chance that an XML syntax (or other) error has occurred. The {{man label|Forms Gramplet}} will not tell you where the error is, but luckily you may get a message in <code>grampsXX.log</code> (in the root of gramps user directory) that may look like:
  
A new event can be created by clicking the {{man button|New}} button at the bottom of the Forms Gramplet.
+
<nowiki>
 +
Traceback (most recent call last):
 +
  File "C:\Program Files\GrampsAIO64-5.1.2\gramps\gen\plug\_manager.py", line 252, in load_plugin
 +
    _module = self.import_plugin(pdata)
 +
  ...
 +
  File "C:\Users\<~username>\AppData\Roaming\gramps\gramps51\plugins\Form\form.py", line 114, in __load_definitions
 +
    dom = xml.dom.minidom.parse(definition_file)
 +
  File "AIO/xml/dom/minidom.py", line 1958, in parse
 +
  File "AIO/xml/dom/expatbuilder.py", line 911, in parse
 +
  File "AIO/xml/dom/expatbuilder.py", line 207, in parseFile xml.parsers.expat.ExpatError: mismatched tag: line 12, column 10</nowiki>
  
An existing event can be edited either by highlighting a row and clicking the {{man button|Edit}} button or by double-clicking on a row.
+
If there are other (non-syntax) errors in the file then when you use the {{man button|New}} button and select the form, it will probably fail and suggest you restart Gramps,
 +
if you open the details first you will see some information which may give you a clue as to where the issue is (start from the bottom of the error message), the following is an example:
  
[[File:Forms Gramplet.png]]
+
<nowiki>
 +
  25285: ERROR: grampsapp.py: line 157: Unhandled exception
 +
  ...
 +
  File "C:\Users\<~username>\AppData\Roaming\gramps\gramps51\plugins\Form\editform.py", line 995, in __init__
 +
    title1, title2 = title.split('/')
 +
ValueError: not enough values to unpack (expected 2, got 1)</nowiki>
  
== Form Selector ==
+
For the example error above, the title was fine, the Forms Gramplet was reporting that one of the entries in the custom form was incorrectly typed and should be exactly like the supported [[Addon:Forms_Gramplet#Writing_your_own_form_definitions|form elements]].
  
The form selector allows the user to select a source that has been associated with a form.  The sources are grouped by event type.
+
=== Submitting your form definitions ===
  
[[Image:Form Selector.png]]
+
Once you have written some custom form definitions, you may wish to share them with the Gramps community.
  
== Form Editor ==
+
A [[Addon:Form Testing]] area is available for this purpose.
  
The form editor is designed so that most data for an event can be entered into a single form.
+
See existing [[Addon:Form Definitions]] for a current list.
  
* First a citation reference should be entered. This should comprise of one or more references that uniquely identify the citation. For example, in the case of a UK census you will need to enter the PRO reference, Piece, Folio and Page.
+
==Issues==
 +
See issues attached to the ''[https://gramps-project.org/bugs/tag_view_page.php?tag_id=257 Forms]'' tag.
 +
<!--
 +
===Feature Request===
 +
* {{bug|}} :
 +
-->
  
* The date of the event can be entered. For a census, the date is populated automatically.
+
==See also==
 +
* [https://en.wikipedia.org/wiki/Civil_registration Civil registration] From Wikipedia, the free encyclopedia
 +
* [https://en.wikipedia.org/wiki/Vital_record Vital records] From Wikipedia, the free encyclopedia
 +
* [https://en.wikipedia.org/wiki/Census Census] From Wikipedia, the free encyclopedia
  
* A place can be selected in the usual Gramps manner.
+
* [[Addon:DataEntryGramplet|Data Entry Gramplet]] addon that allows an easy method of editing previously added people, and adding new and related people in your family tree.  
  
=== Details tab===
+
===Form Tutorials===
The "{{man label|Details}}" tab provides an area which allows the user to enter data specific to individual people listed in the source. This tab can be divided into sections.  Each section consists of people performing the same role in the event.
+
* Using the Form Gramplet, By Tim Graham, Photo Restorations by Tim G.
 
+
** [https://www.youtube.com/watch?v=Y5hijkAF6eE Using the Form Gramplet] - Shows an older version of the Form addon (Published on Aug 4, 2016) Note: Video says it can be installed on the Dashboard and or the Charts page but current version cannot.
[[Image:Form Editor.png]]
+
** [https://www.youtube.com/watch?v=NQL5shB9NzQ Defining Custom Forms for the Form Gramplet] - Shows an older version of the Form addon (Published on Aug 1, 2016)
 
+
=== Support forum threads ===
==== Person Section ====
+
* [https://gramps.discourse.group/t/1950-us-federal-census/2440 1950 US Federal Census] : Includes an [https://gramps.discourse.group/t/1950-us-federal-census/2440/3 importable sample] of using the Forms Gramplet
 
 
A person section allows information about a single person to be entered.  A new person can be created and selected by clicking the "+" button.  A person already in Gramps can be selected by clicking the second button ("share").  The user is prevented from entering data until a person is selected.
 
 
 
[[Image:Form Person Section.png]]
 
 
 
==== Family Section ====
 
 
 
A family section allows information about two people belonging to a family to be entered.  A new family can be created and selected by clicking the "+" button.  A family already in Gramps can be selected by clicking the second button ("share").  The user is prevented from entering data until a family is selected.
 
 
 
[[Image:Form Family Section.png]]
 
 
 
==== Multiple Person Section ====
 
 
 
A multiple person section allows information about multiple people to be entered.  A new person can be created and then added to the section by clicking the "+" button.  A person already in Gramps can be added to the section by clicking the second button ("share").  A person can be removed from the section by clicking the "-" button.  The order of people in the section can be changed by highlighting a row and then using the up and down arrow buttons.
 
 
 
[[Image:Form Multiple Section.png]]
 
 
 
===Headings tab===
 
The {{man label|Headings}} tab provides an area which allows the user to enter data specific to the event listed in the source.
 
 
 
===Gallery tab===
 
The {{man label|Gallery}} tab provides the ability to add media to the event. This is done in the same way as in the standard Gramps editors.
 
  
 +
[[Category:Addons]]
 
[[Category:Plugins]]
 
[[Category:Plugins]]
 
[[Category:Developers/General]]
 
[[Category:Developers/General]]
 
[[Category:Gramplets]]
 
[[Category:Gramplets]]

Latest revision as of 20:49, 22 January 2024

Gramps-notes.png

Please use carefully on data that is backed up, and help make it better by reporting any comments or problems to the author, or issues to the bug tracker
Unless otherwise stated on this page, you can download this addon by following these instructions.
Please note that some Addons have prerequisites that need to be installed before they can be used.
This Addon/Plugin system is controlled by the Plugin Manager.

Tango-Dialog-information.png
Census or Form?

Please note the Form Addons are an upgrade released in 2015 to expand the flexibility of the original Census Addons. The Form Addons supersede the Census Addons from Gramps 4.2.X

Forms Gramplet - Shown Undocked from Bottombar Of People Category View

The Form gramplet allows users to create and edit structured source data in a single form. It makes the meticulous process of recording all the discrete elements far less fussy and error-prone.

The Form gramplet has been enhanced to handle other forms such as birth, marriage and death certificates and parish register entries as well as the originally supported census forms.

Using a Form doesn't mean creating data that can only be accessed with the Form tool. You can forego using the Form Gramplet at any time but still see and edit the data that was entered. The Form gramplet merely streamlines creating Events with the Attributes to separately store elements of data from a structured source. You could do the same process using the standard Gramps editors... it would just involve a lot more steps per Person or Event.

Forms Gramplet

Gnome-important.png
Before using the forms addons

You need to define the form that describes the information contained within a source.
See: Configuration


Adding the Forms Gramplet

Adding Forms Gramplet to bottombar of People Category (Tree) View

The Forms gramplet is designed to be added for the bottombar PeoplePeople Category (Grouped or List) view modes of Gramps. (After installation, this gramplet will be available for addition in all these locations: the sidebar/bottombar option for the following views: PeoplePeople, RelationshipsRelationships, ChartsCharts, and GeographyGeography.)

Select the Forms menu option from the Add a gramplet submenu of the Gramplet selection menus. Accessible by pressing the (Down Arrowhead button) in the view's sidebar or bottombar.

The blank Forms Gramplet will be shown docked as below.

Forms Gramplet - Shown docked In Bottombar Of People Category View


Initial Configuration for each source

Before using the forms addons you need to define the form that describes the information contained within a source. See: Configuration

The Forms Gramplet lists all the events for the active person that can be edited using the form editor. The listing displays the source, date and place of the event together with the role the active person performs in the event.

A new event can be created by clicking the New button at the bottom of the Forms Gramplet which will show you the Select Form selector dialog where you can choose the form to use. Once you select a form you will be taken to the Form Editor.

Forms Gramplet - Shown Undocked from Bottombar Of People Category View


An existing event can be edited either by highlighting a row and clicking the Edit button or by double-clicking on a row to bring up the Form Editor.


If the Forms Gramplet is undocked you can use the Help button to see this page.

Form Selector

The form selector allows the user to select a source that has been associated with a form. The sources are grouped by event type.

Form Selector.png


If the Form Selector list is empty then you need to define the form that describes the information contained within a source. See: Configuration

Form Editor

The form editor is designed so that most data for an event can be entered into a single form.

  • First a citation reference should be entered. This should comprise of one or more references that uniquely identify the citation. For example, in the case of a UK census you will need to enter the PRO reference, Piece, Folio and Page.
  • The date of the event can be entered. For a census, the date is populated automatically.
  • A place can be selected in the usual Gramps manner.


Details tab

The "Details" tab provides an area which allows the user to enter data specific to individual people listed in the source. This tab can be divided into sections. Each section consists of people performing the same role in the event.

Form Editor.png


Person Section

A person section allows information about a single person to be entered. A new person can be created and selected by clicking the + button. A person already in Gramps can be selected by clicking the second button (share). The user is prevented from entering data until a person is selected.

Form Person Section.png


Family Section

A family section allows information about two people belonging to a family to be entered. A new family can be created and selected by clicking the + button. A family already in Gramps can be selected by clicking the second button (share). The user is prevented from entering data until a family is selected.

Form Family Section.png


Multiple Person Section

A multiple person section allows information about multiple people to be entered. A new person can be created and then added to the section by clicking the + button. A person already in Gramps can be added to the section by clicking the second button (share). A person can be removed from the section by clicking the - button. The order of people in the section can be changed by highlighting a row and then using the up and down arrow buttons.

Form Multiple Section.png


Headings tab

The Headings tab provides an area which allows the user to enter data specific to the event listed in the source.

Gallery tab

The Gallery tab provides the ability to add media to the event. This is done in the same way as in the standard Gramps editors.

Configuration

Before using the form addons, you need to define the form that describes the information contained within a source.

To do this you need to edit each Source and add an entry in the "Attributes" tab. The entry must have a key of "Form" and a value which is a Code that uniquely identifies the form to be used eg: UK1841

Tango-Dialog-information.png
Translated Gramps

If you are using Gramps in a language other than English, enter the translated version of the key (e.g. In French, "Formulaire" instead of "Form").


Form Source.png


Supported form definitions

To see a full list of the supported Code's for definitions included with the addon that are available, See: Addon:Form Definitions

Writing your own form definitions

Gramps-notes.png
Note

Make sure that your definition file is saved using UTF-8 encoding.

If a form you require is not in the list of supported definitions then you can write your own.

Form definitions are stored in XML files. These are located in the Form directory beneath your user plugins directory. The file called form_xx.xml(where xx is a country code), is provided in the download, and contains some common definitions. Additional files called custom.xml and test.xml will also be searched.

Definition files consist of an XML declaration followed by a forms element.

<?xml version="1.0" encoding="UTF-8" ?>
<forms>
</forms>

The forms element contains a number of form elements, each representing a form definition. The form start-tag contains 4 attributes:

  • id : A unique code to identify the form definition. You will use this code in the "Form" attribute of the source.
  • type: The type of the event created by the form editor. This value will appear in the "Type" column of events ("EventType"). It would be wise to avoid standard ones, for example, to add death information you could specify "Death.Info" or another one you make up (Data loss is possible otherwise).
  • title : A description of the form. It should be possible to use anything here.
  • date : An optional date in a Gramps date format. This is only useful for census definitions or similar events that happen on a specific date.
<form id='UK1841' type='Census' title='1841 UK Census' date='6 Jun 1841'>

The form is divided into sections which describe the information that needs to be captured for people performing a given role in the event. Each form element should contain at least one section element. The section start-tag can specify these 3 attributes:

  • role : The role that people in this section perform in the event. This value will appear in the "Role" column of events ("EventRoleType").
  • type : The type of section. This defines how a section is displayed and people are selected. Allowed values are: 'person' for a single person, 'multi' for one or more people, or 'family' for two people selected by a family.
  • title : This is used when displaying the section on the form and provides the only way to visually tell multiple sections apart. In a marriage you would have a "Husband", a "Wife" and possibly others such as "Witnesses".
<section role='Primary' type='person' title='Child'>

Each section element should contain a column element for each column in the section. Column elements describe information that may be recorded for each person in the section.

A column element contains:

  • An _attribute element. This contains the key used to store column information in the attributes of event reference objects within the Gramps database (The "Type" Attribute of the reference information for the event. If you use "Name" then the selected person's name will be prefilled. Once defined this text must not be changed.
  • An optional _longname element. This contains a fuller description of the column and is only used for tooltips (when you hover the mouse over the field in the form).
  • A size element. This contains the size of the column in the census report. It is a percentage of the page width. The sum of all size elements in a definition should total 100%.
<column>
    <_attribute>At Home</_attribute>
    <_longname>Working at Home</_longname>
    <size>6</size>
</column>
Gramps-notes.png
Note

The underscore is important and indicates that the text should be translated by translators.

Each form element may optionally contain heading elements. Heading elements describe information that is recorded once for each form.

A heading element contains:

  • An _attribute element. This contains the key used to store information in the attributes of the event objects within the Gramps database.
<heading>
    <_attribute>City or Borough</_attribute>
</heading>

Although you can add your definitions to the pre-defined entries in form_xx.xml, it is recommended you create a separate file called custom.xml or test.xml for this purpose.

Tips on debugging your custom form definitions

After creating or updating a form (in custom.xml or test.xml) to make sure your Form is correctly formatted use a text editor that includes an XML mode and syntax check, (like NotePad++ and install the "XML Tools" plugin), then the editor will be able to tell you if your Form's XML code is formatted correctly.

If the XML form check worked then start Gramps to test it and if the New and Edit buttons don't appear in the Forms Gramplet then there is a good chance that an XML syntax (or other) error has occurred. The Forms Gramplet will not tell you where the error is, but luckily you may get a message in grampsXX.log (in the root of gramps user directory) that may look like:

Traceback (most recent call last):
  File "C:\Program Files\GrampsAIO64-5.1.2\gramps\gen\plug\_manager.py", line 252, in load_plugin
    _module = self.import_plugin(pdata)
  ...
  File "C:\Users\<~username>\AppData\Roaming\gramps\gramps51\plugins\Form\form.py", line 114, in __load_definitions
    dom = xml.dom.minidom.parse(definition_file)
  File "AIO/xml/dom/minidom.py", line 1958, in parse
  File "AIO/xml/dom/expatbuilder.py", line 911, in parse
  File "AIO/xml/dom/expatbuilder.py", line 207, in parseFile xml.parsers.expat.ExpatError: mismatched tag: line 12, column 10

If there are other (non-syntax) errors in the file then when you use the New button and select the form, it will probably fail and suggest you restart Gramps, if you open the details first you will see some information which may give you a clue as to where the issue is (start from the bottom of the error message), the following is an example:

  25285: ERROR: grampsapp.py: line 157: Unhandled exception 
  ...
  File "C:\Users\<~username>\AppData\Roaming\gramps\gramps51\plugins\Form\editform.py", line 995, in __init__
    title1, title2 = title.split('/')
ValueError: not enough values to unpack (expected 2, got 1)

For the example error above, the title was fine, the Forms Gramplet was reporting that one of the entries in the custom form was incorrectly typed and should be exactly like the supported form elements.

Submitting your form definitions

Once you have written some custom form definitions, you may wish to share them with the Gramps community.

A Addon:Form Testing area is available for this purpose.

See existing Addon:Form Definitions for a current list.

Issues

See issues attached to the Forms tag.

See also

  • Data Entry Gramplet addon that allows an easy method of editing previously added people, and adding new and related people in your family tree.

Form Tutorials

  • Using the Form Gramplet, By Tim Graham, Photo Restorations by Tim G.

Support forum threads