Dialog window "LINKS to photos, documents, www-pages, other trees" shows up on pressing "Links..." - one of the "quick access" buttons in the Editor. You can edit all links of the given record here (you can also use an "element by element" editing using the record's elements tree).
A link (tag OBJE) has 4 possible subelements:
- Title (tag TITL) of the document. This is a mandatory element. Users will see these titles in the list of links in the Information Window of the record.
- File (tag FILE) - a path to or an address (possibly remote) of the document. This is a mandatory element. The path can be absolute or relative. Files with absolute paths are searched in exactly these pathes, while relative paths are looked for at first in the working directory (where the tree file itself), then in media directories, then in the system document folders ("My Documents", "My Pictures", etc.). If a tree file was opened from a remote site (e.g. http://www.genealogysoft.com/en/examples/sample-en-1.rel), than the documents with a relative path will be searched on the same server where the tree file was originated from. For example, a file with "media/london.jpg" path will be searched on http://www.genealogysoft.com/ru/examples/media/london.jpg
Links can point not only to files, but also to directories. This very conveniently represents collections of documents in one link. Suppose, for example, that there are many documents related to some person. Instead of creating a link for each document, it is possible to collect all the documents related to the given person into one directory and to create only one link to this directory. Then you can add new documents to the folder, rename the files, delete them, without changing the link itself. In the Information window these links can be opened the same way as any other document, and the user will then see all documents in one file explorer window.
Attention! If you place documents on a web server, try to avoid non-ASCII symbols and spaces in file names! The codepage the server will use for non-ASCII names is often unknown and it's almost impossible to predict what codepage should be used to encode the names in HTTP requests to the server. The "Relatives" program does no speculation about server's codepages and sends all requests "as is" without any encoding. Thus the only way in this program to download a network resource with non-ASCII name and spaces is the following:
Suppose you know that the codepage the server uses to store file names with russian symbols is KOI8-R (usual for Apache web-servers). The name of you file is тест.jpeg. In this case the name in the link should look like %D4%C5%D3%D4.jpeg, where each Russian letter is replaced with a %XX sequence, where XX is a hexadecimal code of the letter in KOI8-R codepage (in usual Windows-1251 cyrillic encoding the file name will look like ФЕУФ.jpeg). The full path in a link's File element can be, for example, like this: http://genealogysoft.com/ru/examples/%D4%C5%D3%D4.jpeg (this file really exists, so you can try to download it). If there are spaces in the file name they shoul be replaced with %20 (not "+" symbol how is made in URL encoding). Hence, in the "Relatives" program file names in links should be stored already encoded.
- Format (tag FORM) or type of the document is actually its file extention ("jpg", "gif", "wav", "ged", "rel", etc.). It is an optional element. It was left for compatibility with the GEDCOM standard and other genealogic programs which can use it to find the associated software. The "Relatives" program tries to define a format of the document on its extension when you enter a name of the file, using the list of formats in Extentions.txt file. Also the user can change the format or enter his/her own.
- Note (tag NOTE) about the link. This is optional element. There can be more than one notes for a link, and they can be of both types - as a plain textual embedded note and as a reference to a shared Note record.
"LINKS..." dialog's interface:
1) The list of links' titles is placed in the top part of the window. When a title is selected by mouse other elements of the link are shown below: URL (File), Notes and Format.
2) The panel on the right has the following buttons:
Add opens the Link Editor (see below) for creating a new link;
Edit opens the selected link in the Link Editor;
Remove - removes the selected link;
"Up" and "Down" buttons allows to arrange links in the list in desired order.
3) The purpose of Save, Cancel and Help is obvious...
The "Link Editor" dialog window is intended for creting/editing of a link and has the following interface:
1) Name (Title) of the link. The length of the name can be any but it's better to limit it by 20-40 symbols due to these names will be shown in a list within Info Window.
2) URL (File) of the link. It has no limit in length. The "Browse" button shows a common Open file dialog to choose a local file.
3) An area below, outlined with a thin border is the Notes area:
- List of notes in the center shows the first 40 letters of each note if it's a plain text note and a record ID, if it's a reference to a shared Note record.
- On the right from the list is a panel with buttons which work the similar way to these buttons in "LINKS..." window - editing, removing and arranging the list.
- On the left from the list is an Add button for creating a new note. The type of the note (plain embedded or reference to record) can be specified by "Plain - Record" radio buttons.
For entering text of a plain note you will be offered a text area, and for creating a reference to a Note record you will get a list of all records of that type.
- When a note name in the list is selected by mouse the note content will be shown in a text area below. At that, if it is a reference to a Note record this record will be shown as a tree of its elements.
- When entering the address of the file the program tries to determinate the file extention and if it knows it (Extentions.txt contains it) shows it in the Format field. The user can change this format or remove it at all.
- The purpose of Save, Cancel and Help is obvious...
The program data structure