Report Configuration Settings (Config.xml)
Each report skin must have a file named config.xml. The file config.xml
contains configuration information for the report generator, such as the
parameters and the sequence of HTML/RTF templates to feed to the report
generator. The XML configuration does define what
object(s) to bind to each HTML templates, and the name of the output files. The
following is a typical configuration file.
<Skin Name="Generic Report" Language="EN">
<Version>1.0</Version>
<DateCreation>1-Jan-2005</DateCreation>
<DateLastModified>1-Jan-2005</DateLastModified>
<SizeKB/>
<Url Preview="" Download="" />
<Authors>
<Author Name="GenoPro" DateFirstModified="Aug-2004" DateLastModified="2005"
Contact="https://www.genopro.com/" Comment="Creation" />
</Authors>
<ReportGenerator ScriptLanguage="VBScript">
<Parameters _PathPictures="http://www.yourwebsite.com/pictures/" />
<Report Template="init.htm" />
<Report Template="home.htm" />
<Report Template="index.names.htm" />
<Report Template="individual.htm" OutputFile="{id}.htm"
For="Individuals" LoopItemName="i" SortBy="name.last, name.first" />
<Report Template="family.htm" OutputFile="{id}.htm"
For="Families" LoopItemName="f" />
<Report Template="PictureAlbum.htm" />
<ExtraFiles
FamilyTree.gno="FamilyTree.gno"
FamilyTree.xml="FamilyTree.xml"
FamilyTree.ged="FamilyTree.ged" />
<StartPage>default.htm</StartPage>
</ReportGenerator>
</Skin>
This is the root node of the configuration file as required by the XML
standard. GenoPro assumes UTF-8 (Unicode) if the encoding is not specified in
the file.
Name:
The name of the skin is analogous to the name of a file. The reason why GenoPro
does not use the filename as the skin name is because some skins may contain
long names with special characters not supported by the filesystem. In the
future, skins will be downloadable from the web, and the only method to preserve
the skin name is to store it in its configuration file.
The choice of the skin name depends on what the skin does. If your skin
generates a phone directory, you may name the skin "Phone Directory". You may
have other names such as "Picture Album" or "Generic Report". It is recommended
to name the skin in your native language, like "Répertoire
Téléphonique" or "Album de Photos" for a French
skin.
Language:
GenoPro uses the language code to group skins by language in the
Report Generator dialog. The language code is also used by the
report engine to load the appropriate language dictionary
to translate text in the selected language.
Version:
This field is for your own reference and also for users downloading your
skin. If you make modifications to your skin, increment the version number and
also update the
DateLastModified . It is up to you to
decide whatever a modification is minor or major. Eventually GenoPro will
display all the skins in a table (similar to the
Table Layout) and the version number will
appear there. When downloading a skin from the web, the version number will be
compared against the version installed. If the value differ, the version number
will be displayed in bold to indicate an upgrade is available. (this
feature is not yet implemented).
DateCreation:
This is a rough estimate of the date the skin was created. This field is
informative to the user (or to yourself) when the skin got created.
DateLastModified:
This is the date of the last modification of the skin. It is recommend to
update this value for any change you make, even for the slightest typo. GenoPro
will use this value to determine if there is a new skin available for download.
SizeKB:
This is the size, in kilobytes, of the skin. This gives an idea of the size of
the skin to download.
Preview URL:
Before downloading a skin or generating a report, it may be useful to preview a
sample generated report. For each skin available for download from GenoPro, a
sample report will be available for preview. Of course, if you are editing your
own skin, you should put the URL of the homepage of your report.
Download URL:
Where the skin can be downloaded. Each downloaded skin is packaged in a
single .skn file. The .skn file is similar to a .zip file.
<Authors>
Brief history of each author having modified the skin. The purpose of this list
is to give credit to the contributor(s) and provide a method to communicate with
them if necessary. If you modify a skin, add your name at the end of the list.
If you are writing a new skin from scratch, remove "GenoPro" from the author
list.
Author Name:
Name of the author having modified the skin. This could be your given name, your
alias or the name of your corporation. GenoPro will display the last entry in
the author list as the author of the skin.
DateFirstModified and DateLastModified:
A rough idea when the author started modifying the skin as well as the last time
he/she modified the skin. Those values may overlap as multiple authors may
modify the same skin. There may be gaps where nobody modified the skin. In the
future, GenoPro may display those values, but in the meantime those values are
purely informative to the people editing skins.
Author Contact:
Contact information of the author. It is recommend not to use your email address
because of spam, and the likelihood your email address will become invalid. It
is better to include your home page as contact information because you can
include your email address on your website. Other contact information may be
your street address if you really want to. If you wish to retain your privacy,
leave this field blank.
Author Comment:
This is a comment describing what was modified on the skin. The comment may be
something as simple as "fixed a typo" to a more complex modification such as
"added a picture album".
This section relates to the report generator. The other part of the
configuration file is mostly informative to the user and ignored by the report
engine.
ScriptLanguage:
Define what script language to use for the report engine. Valid values are
VBScript , JScript and PerlScript . You may also
use a ClassID of the script engine if you want to use another script engine. For
instance, the ClassID
{B54F3741-5B07-11CF-A4B0-00AA004A55E8} is the same as the script language
VBScript .
<ReportGenerator ScriptLanguage="{B54F3741-5B07-11CF-A4B0-00AA004A55E8}">
Parameters:
The parameters allow you to pass additional information to the report generator.
To get the value of a given parameter, use the property
Report.Parameters . One
reserved parameter name is
_PathPictures .
Each Report tag designates a template to feed to the report
generator.
Template:
The
Template tag is the only mandatory attribute for the for the Report
tag. If this attribute is missing, then the report generator will display an
error. The template is the HTML file to feed to the report generator.
OutputFile:
Name of the file to write in the destination report. If this attribute is
omitted, then the name of the template will be used. If multiple reports are
generated using the same template, then the output filename may include
formatting information to assign a unique filename for each generated HTML page.
GenoPro does make sure each output file is unique. If there is a collision (two
files with identical name), GenoPro will modify the filename by appending a
unique number to it. The output file may contain a sub-folder.
<Report Template="individual.htm" OutputFile="Individuals/{name.last}.htm" For="Individuals" />
In this example, all the individuals will be stored in the sub-folder
"Individuals". The formatting of "{name.last}" will include the
last name of the individual in the output file name. In other words, the report
will generate a list of files of last names. If two (or more) individuals have
the same last name (very likely), GenoPro will assign a unique number to it.
You can get the name of the output file within your script by using the
property Report.FileOutput .
For:
Collection of objects (items) for which the report generator will apply the
template. The For attribute is the equivalent of a "For Loop" on a
given collection. You can get a
complete description of the looping, such as the total count of items using the
properties Report.LoopItemCount , Report.LoopIndex ,
Report.LoopItem , Report.LoopCollectionName .
LoopItemName:
The LoopItemName is the name of a global variable to access an
object within the collection. This name is typically a single letter of the
alphabet, such as i for an individual, f for a family
and p for a picture. The other alternative of using the global
variable, is using
Report.LoopItem
as below:
Report.Write i.Birth.Date ' Write the date of birth of the current individual
Report.Write Report.LoopItem.Birth.Date ' Same thing as above
The attribute LoopItemName is valid only when the For
attribute is present. If this attribute is omitted, GenoPro will use the first
letter of the collection specified in the For attribute.
SortBy:
Sort the collection by a given sort key(s). By default, the collections are
sorted by Permanent IDs, however you may wish to sort differently. For
instance, if you are generating a picture album, you may wish to sort by date
and then by name. For more details visit
Collection.SortBy .
ExtraFiles:
Additional files to include to the report. Those files are written after the
report has been fully generated. If you do not wish a file to appear, just
delete its corresponding attribute. You can access the XML file within your
script using the method
ReportGenerator.Document.GetTextXML .
|