Learning by Example

Von Thomas Bez für Welt
28.08.2016 11:34 neu
im Weblog PedigreeAdmin

Von Briards aus dem Barnimer Land

Example 1: Various adjustments to a change record

Every visitor of the Pedigree Database is allowed to submit changes:

  • additions of new pedigree records
  • updates to existing pedigree records
  • additions of new kennel records
  • updates to existing kennel records

For example, a user navigates to the simple pedigree view or the detail view, does changes in the update form and presses the Update button.

The changes will not be performed immediately on the Database. Rather, an e-mail is generated and sent to one of the Editors of the Database. The Editor has to do a number of sanity and data integrity checks before he he finally enters the information in the Database.

Here is an example of such e-mail. It reflects the information entered in the update form plus some information automatically added:

start
mode      : update
# name    : Ciana Blonde de Lady Fontaine la Belle
index     : 59036
# title   : 
title     : Ch. France
# colour  : 
colour    : Fauve
# regno   : 
regno     : 1BBr 104277/15210
# sire    : 
sire      : Twiny Blond de la Tour Saint Genin
# dam     : 
dam       : Toya Blonde de Lady Fontaine la Belle
# breeder : 
breeder   : monique weber-lo giaco, saint-sauveur-sur-ecole, france
# birth   : 0000-00-00
birth     : 2007-06-19
# owner   : 
owner     : poissonnet jacqueline, itteville, france
# hd      : 
hd        : B/B
# csnb    : 
csnb      : Sain OK
# note    : 
note      : n° Identification : 250269700377544; CACS Nationale Elevage France 2011; Sélection France 2011; Pontoise - 15-05-2011 - CACS,CACIB,BOB - Juge M. Jacques MEDARD-RINGUET; Angers - 27-03-2011 -CACS,CACIB,BOB -Juge Mme Jeannette LARIVE; Paris Dog Show Vincennes - 09-01-2011 -CACS,CACIB,BOB - Juge M Guy MANSENCAL; Chalette-sur-Loing - 19-07-2009-CACS,BOB - Juge M Emmanuel YANNAKIS
# source  : Propriétaire : Jacqueline POISSONNET
# email   : jacqueline.poissonnet@orange.fr
# editor  : 
# modific : 2016-08-27
# remote  : 82.121.29.3 20160827145654
end

We see:

  • Comment lines starting with a hash sign (#). They contain the information found in the database before the update ("#color:") and some information automatically added for documentation purposes but not designated for entry into the Database ("#remote: 82.121.29.3")
  • Data lines without hash sign ("title: Ch. France")
  • There was a record for Ciana before the update, indicated by "mode: update" (otherwise this would be "mode: add"). There was no further information about Ciana in the record (all current data fields empty)
  • The line "#email: jacqueline.poissonnet@orange.fr" shows who entered this information. If it was a logged-in user, this line shows the login name, otherwise the information entered by the user in the "E-Mail" form field

Now we review and correct the update record. We omit any comment lines here for better readability, however, they do not disturb if we kept them in the final Batch Language script.

We do following corrections:

  • Acceptable champion titles are only "Ch.", "Int.Ch." or "CIE". We delete the country from the given champion title. If it appears to be important, we can add this to the comments ("note: ...") section, but this is not the case here as we can see that also the selection was in France.
  • We write the colour in all lowercase letters.
  • It is a LOF stud book number. French users may not be aware that there are other studbooks outside France.
  • The breeder information is not so important because it can be found as well looking into the kennel record. That means we could even decide to delete this line completely. If we decide to keep it and if we want to be nice, we adjust the upper-/lower-case spelling. In this case, the following may have happened: The user entered the information in all upper case as usual in France. But all uppercase is very annoying in web page displays. Therefore, when an information item is entered in all uppercase, it is converted to lowercase automatically. This does not look good either, but is even better than all uppercase.
  • The same applies to the owner information and we decide to be nice here as well. And we prefer to have the first name first.

The rest is good.

start
mode      : update
# name    : Ciana Blonde de Lady Fontaine la Belle
index     : 59036
title     : Ch.
colour    : fauve
regno     : LOF 1.B.Br 104277/15210
sire      : Twiny Blond de la Tour Saint Genin
dam       : Toya Blonde de Lady Fontaine la Belle
breeder   : Monique Weber-Lo Giaco, Saint-Sauveur-sur-Ecole, FR
birth     : 2007-06-19
owner     : Jacqueline Poissonnet, Itteville, FR
hd        : B/B
csnb      : Sain OK
note      : n° Identification : 250269700377544; CACS Nationale Elevage France 2011; Sélection France 2011; Pontoise - 15-05-2011 - CACS,CACIB,BOB - Juge M. Jacques MEDARD-RINGUET; Angers - 27-03-2011 -CACS,CACIB,BOB -Juge Mme Jeannette LARIVE; Paris Dog Show Vincennes - 09-01-2011 -CACS,CACIB,BOB - Juge M Guy MANSENCAL; Chalette-sur-Loing - 19-07-2009-CACS,BOB - Juge M Emmanuel YANNAKIS
end

The next steps are:


Step 1: Enter in Batch Edit dialog box

Step 1: Paste your Batch Language sequence (one or more "begin ... end" statements) in the Batch Edit dialog box.


Step 2: Send for syntax test

Step 2: Keep the LOAD checkbox clear and push the Send button.

The result listing will show the following:

# Ciana Blonde de Lady Fontaine la Belle = *

Name of the dog and its parents (still empty here) as clickable links.

# name = "Ciana Blonde de Lady Fontaine la Belle", givenname = "", belong = "", kennel = "922", title = "", color = "", sex = "f", callname = "", sire = "0", sirename = "", dam = "0", damname = "", regno = "", country = "", breeder = "", owner = "", birth = "0000-00-00", death = "0000-00-00", reason = "", health = "", hd = "", csnb = "", eu = "", picture = "", internet = "", language = "", editor = "JPoisonnet", hpname = "", hpmail = "", flag = "1"

The current record with almost no information yet available.

update pedigree set title = "Ch.", color = "fauve", sire = "49566", sirename = "Twiny Blond de la Tour Saint Genin", dam = "62963", damname = "Toya blonde de Lady Fontaine la Belle", regno = "LOF 1.B.Br 104277/15210", breeder = "Monique Weber-Lo Giaco, Saint-Sauveur-sur-Ecole, FR", owner = "Jacqueline Poissonnet, Itteville, FR", birth = "2007-06-19", hd = "B/B", csnb = "Sain OK", comment = "n° Identification : 250269700377544; CACS Nationale Elevage France 2011; Sélection France 2011; Pontoise - 15-05-2011 - CACS,CACIB,BOB - Juge M. Jacques MEDARD-RINGUET; Angers - 27-03-2011 -CACS,CACIB,BOB -Juge Mme Jeannette LARIVE; Paris Dog Show Vincennes - 09-01-2011 -CACS,CACIB,BOB - Juge M Guy MANSENCAL; Chalette-sur-Loing - 19-07-2009-CACS,BOB - Juge M Emmanuel YANNAKIS", flag = 1 where idx = 59036;

The update statement in SQL database language. To be digested by SQL experts, not important here.

If any errors were detected or warnings raised by the syntax test, they will be shown as # Boldface Comments.


Step 3: Tick LOAD checkbox

Step 3: If no errors and no warnings (or acceptable warnings only) are flagged, tick the LOAD checkbox.


Step 4: Send for final submission

Step 4: Push the Send button. If the record has been entered successfully, the result listing says "#OKAY".

More examples with error messages and how to resolve them will follow.

Example 2: Picture uploaded

In the next example, a picture has been uploaded. It is already on the server and can be referred to by its identification "20160827_pedigree_145745423463". By the following Batch Language sequence it is linked to a Database entry. There is not much that could be wrong with this kind of entry.

start
mode: update
index: 33923
picture: 20160827_pedigree_145745423463
# source: Brigitte Winterer
# email: brigitte.winterer@gmx.de
flag: 0x0001
modification: 2016-08-27
remote: 2.163.6.186 20160827145745
end

Example 3: Comments

In the following example the comment (note) was changed. The special thing about comments is that they are accumulating. The old comment is not replaced by a new one but the new comment is appended at the end of the old comment.

start
mode      : update
# name    : Erudit Doré de la Claire Noir
index     : 65376
# note    : Slowakischer Champion; Kroatischer Show Champion; Deutsche Selektion 2015; Coation-H-3; voll zur Zucht zugelassen
note      : Deutscher Champion (VDH); Slowakischer Champion; Kroatischer Show Champion; Deutsche Selektion 2015; Coation-H-3; voll zur Zucht zugelassen
# source  : Sandra Hänßel
# email   : sandra.haenssel@t-online.de
# editor  : 
# modific : 2016-08-27
# remote  : 79.217.248.179 20160827172732
end

Therefore, we delete from the new comment everything that was already in the previous comment.

start
mode      : update
index     : 65376
# note    : Slowakischer Champion; Kroatischer Show Champion; Deutsche Selektion 2015; Coation-H-3; voll zur Zucht zugelassen
note      : Deutscher Champion (VDH)
end

Alternatively, and useful in particular if the old and the new comments are very different, we could clear the comment first and then supply the complete new comment. To clear the old comment, we prepend the Batch Language sequence by a new hand-written statement as shown below, containing a "note:#" line where instead of the comment a single hash sign appears.

start
mode      : update
index     : 65376
note: #
end

start
mode      : update
index     : 65376
note      : Deutscher Champion (VDH); Slowakischer Champion; Kroatischer Show Champion; Deutsche Selektion 2015; Coation-H-3; voll zur Zucht zugelassen
end

Example 4: Parents and descendants

In the next example we test two related changes.

start
mode      : update
# name    : Grace Hirsute Blonde de Lady Fontaine la Belle
index     : 19386
# regno   : 
regno     : LOF 1BBR 81770/12558
# sire    : 
sire      : Antaeüs de la Tour Saint Genin
# dam     : 
dam       : Chabanou da Djerba Brune de la Palomera
# breeder : 
breeder   : m mme jean-claude larive
# birth   : 1991-00-00
birth     : 1991-03-13
# owner   : 
owner     : Mme M Bernard Weber, Saint-Sauveur-sur-Ecole, France
# source  : Jacqueline Poissonnet
# email   : jacqueline.poissonnet@orange.fr
# editor  : 
# modific : 2016-08-28
# remote  : 82.121.29.3 20160828141428
end

start
name      : Chabanou da Djerba de la Palomera
colour    : noire
sex       : f
regno     : LOF 1BBr 65243/11132
sire      : Trufo du Moulin d'Eau
dam       : Volga Blonde de la Palomera
breeder   : m mme jean-claude larive
birth     : 1987-09-04
death     : 0000-00-00
owner     : M Mme Jean-Claude Larive
# source  : Jacqueline Poissonnet
# email   : JPoisonnet
# modific : 2016-08-28
# remote  : 82.121.29.3 20160828142924
end

Test 1

It shows that dam "Chabanou da Djerba Brune de la Palomera" is unknown. This is only a warning. The Database would accept it if we decided to enter it like this, however, the pedigree links would remain broken even if we entered Chabanou at a later time. Lesson: Always ensure that the parents are known to the Database before you enter a descendant.

The record of Chabanou is actually the next one but it should be entered first, before other records referring to it. Therefore, we change the sequence of both records.

We see that the name under which Chabanou shall be entered into the Database is "Chabanou da Djerba de la Palomera". However, the other record uses a longer form "Chabanou da Djerba Brune de la Palomera". Lesson: Never rely upon how users write or spell names – every detail could be wrong. We assume the longer form is the correct one and change the name for entry into the database accordingly.

And, again, we correct all appearances of the all-lowercase "m mme jean-claude larive" to "M Mme Jean-Claude Larive".

start
name      : Chabanou da Djerba Brune de la Palomera
colour    : noire
sex       : f
regno     : LOF 1BBr 65243/11132
sire      : Trufo du Moulin d'Eau
dam       : Volga Blonde de la Palomera
breeder   : M Mme Jean-Claude Larive
birth     : 1987-09-04
death     : 0000-00-00
owner     : M Mme Jean-Claude Larive
end

start
mode      : update
# name    : Grace Hirsute Blonde de Lady Fontaine la Belle
index     : 19386
regno     : LOF 1BBR 81770/12558
sire      : Antaeüs de la Tour Saint Genin
dam       : Chabanou da Djerba Brune de la Palomera
breeder   : M Mme Jean-Claude Larive
# birth   : 1991-00-00
birth     : 1991-03-13
owner     : Mme M Bernard Weber, Saint-Sauveur-sur-Ecole, France
end

Test 2

The next test again raises a warning because it was only a test run and Chabanou was not actually stored in the Database yet. If we want to be on the safe side, we test and LOAD both records separately. In this case we double-checked that the sequence of records is good and the spelling of Chabanou's name is correct. We can LOAD both records in the same run.


Load

We tick the LOAD checkbox and press the Send button again. The Database processes both records separately, one-by-one. Chabanou has been stored already and its name can be resolved when it is used in the second record.