Changes

Jump to: navigation, search

Addon:Forms Gramplet

3,478 bytes added, 14:56, 2 October 2021
m
Improved 'Adding the gramplet' instructions
{{Third-party plugin}}
{{man notetip|Census or Form?|Please note the ''Form Addons'' are a an upgrade released in 2015 upgrade to expand the flexibilityof the orignal Census Addons. They supercede 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.
== Forms Gramplet ==
{{man warn|Before using the forms addons|you You need to define the form that describes the information contained within a source.'''<br>See: [[Form_Addons#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 menulabel|The Forms Gramplet is designed to be added to }} menu option from the bottombar {{man label|Add a gramplet}} submenu of a the [[Gramps_{{Version manualman version}}_Wiki_Manual_-_Categories_Main_Window#People_CategoryGramplet_Bar_Menu|person viewGramplet 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: [[Form_Addons#Configuration|Configuration]]}}
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|[[Form_Addons#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|[[Form_Addons#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 the {{man label|[[Form_Addons#Form_Editor|Form Editor]]}}.
[[File:If the {{man label|Forms Gramplet}} is undocked you can use the {{man button|Help}} button to see this page.png]]{{-}}
== Form Selector ==
* 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.
[[fileFile: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]]
[[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]]
[[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.
[[fileFile:Form Multiple Section.png|left]]{{-}}
===Headings tab===
{{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>").}}
[[ImageFile:Form Source.png|left]]{{-}}
=== Supported form definitions ===
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. 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 value will appear in the XML representation "<code>Type</code>" column of an 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. 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 definitionsor 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 <code>section</code> start-tag contains can specify these 3 attributes:
* <code>role</code> : The role that people in this section perform in the event. This is value will appear in the XML representation "<code>Role</code>" column of an 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>title</code> : An optional title which will be This is used to describe when displaying the sectionon 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>
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(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 and is only used in for tooltips (when you hover the mouse over the tooltips field in the editorform).* 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>
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 =Tips on debugging your form definitions === Once you have written some custom form definitions, you may wish to share them with the Gramps community. A [[Form Testing]] area is available for this purpose. See existing [[Form Definitions]] for a current list. ===Tips & Tricks===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, you need to close (like <code>NotePad++</code> and restart Gramps install the "<code>XML Tools</code>" plugin), then the editor will be able to test ittell 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 {{man button|New" & "}} and {{man button|Edit" }} buttons don't appear in the form {{man label|Forms Gramplet}} then there is a good chance that an XML syntax (or other) errorhas occurred. Unfortunately, "The {{man label|Forms" Gramplet}} will not tell you this or where the error is! Luckily , but luckily you may get a message in "<code>gramps51grampsXX.log</code>" (in the root of gramps user directory for v5.1) that may look like:
<nowiki>
_module = self.import_plugin(pdata)
...
File "C:\Users\Dennis<~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 parseFilexml.parsers.expat.ExpatError: mismatched tag: line 12, column 10</nowiki>
xml.parsers.expat.ExpatError: mismatched tag: line 12, column 10</nowiki> To speed things up and get a better error message, make sure If there are other (non-syntax) errors in the file then when you use a text editor that includes an XML mode the {{man button|New}} button and syntax check. If you use "<code>NotePad++</code>" on windowsselect the form, make sure you install the "<code>XML Tools</code>" plugin (it will tell probably fail and suggest you were as well as whyrestart Gramps, unlike the log above). Unfortunately, this plugin has poor error handling and may also die (unhandled exception) when "New" is pressed for other types of data errors in if you open the XML. The error message details first you will see some information which may give you a clue as to where the issue is (start from the bottomof the error message), the following is a cryptic an example:
<nowiki>
25285: ERROR: grampsapp.py: line 157: Unhandled exception
...
File "C:\Users\Dennis<~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>
 
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_Addons#Writing_your_own_form_definitions|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 [[Form Testing]] area is available for this purpose.
 
See existing [[Form Definitions]] for a current list.
 
==Issues==
See issues attached to the ''[https://gramps-project.org/bugs/tag_view_page.php?tag_id=257 Forms]'' tag.
<!--
===Feature Request===
* {{bug|}} :
-->
==See also==
* [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
 
* [[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.** [https://www.youtube.com/watch?v=Y5hijkAF6eE Using the Form Gramplet] - Shows an older version of the Form addon (Published on Aug 4, 2016) <!-- video Note: Video says it can be installed on the Desktop Dashboard and or the Charts page but current version cannot-->.** [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)
4,529
edits

Navigation menu