Chapter 6:: Manual:: ReJump DataFile



Chapter 6


Now more complex example. We need to create favourite web-adresses storage. Every web-address has two characteristics: "name" and "address".

Data input script looks as follows:

Note, that you should fill fields "sitename" and "webaddr" in the input form.

We know how to get an access to the object with extension "addr" which contains site address (URL):
That expression returns list of objects with sites' names. You can put them into templates.

If you have an object with known URL and you want to get an object with the same name see the following expression. You need to process it. Assume "$1" is object "addr" which was transmitted to the template. Expression <&$1:sitename> returns an identifier of object which contains site name.

Template "web_tpl" contains:

Template "site_tpl" contains:
<&$1:name?Value> (<&$1?Value>)

Assume there are files
web/0.addr contains URL
web/0--addr/0.sitename contains ReJump
web/1.addr contains
web/1--addr/0.sitename contains Microsoft

The result of processing template "web_tpl" is:
ReJump (
Microsoft (

If we want to get objects with sites' names - objects with extension ".sitename".
You can do it like this:

Note, that operator ":" allows to use it not only with objects, but with lists. "data-web:addr" is the list of objects.

Template web2_tpl

Template addr2_tpl

The result is:
(ReJump; Microsoft;)

Relation between address and its name ":sitename" is link.

Physical link looks in the following way. You create folder for an object and put files with information about links there. For example, create folder "0--addr" for object "0.addr" and put there file "0.sitename". All input infirmation will store there.
It is represented in the previous example.
("." substitutes instead of "--" when the folder with links is being created)

See more complex example. Add to web-address one more characteristic - theme, and try to arrange links on themes.

Assume files which designate themes are in the folder "web". They have extension ".th". To get an access to them use expression <&data-web:th>.

Assume we have two themes.
Physically they are files "web/" and "web/", logically - objects "data-web-0--th" and "data-web-1--th". File "" has contents "Soft", file "" has contents "Web Soft".

Input field like "select" on the form you can form in the following way:

Template "theme_select":
<select name=theme>

Template "theme_item":
<option value="$1"><&$1?Value></option>

The result of template "theme_select" processing:
<select name="theme">
<option value="data-web-0--th">Soft</option>
<option value="data-web-1--th">Web Soft</option>

In template "theme_item":
$1 - name of object-theme
<&$1?Value> - name of theme

This field "select" need to be put in the script of link adding (see high on the section).

Add operator to the script:
It creates link to catenate web-address with theme.
Assume "add_webaddr" equals "data-web-1--addr". During operator
"addLink(data-web-1--addr,in,data-web-0--th)" execution; file "" with contents "@data-web-0--th" would be added to the folder "/web/1--addr".

Expression <&data-web-1--addr:in> gives us "data-web-0--th".

Backward links:
There is one more operator besides operator ":", which was used in the previous example. It's operator ".".
That operator allows to get a list of objects refers to given.

Expression <&> will return "data-web-1--addr" if only one object (above-cited)refers on the theme. Or {data-web-0--addr,data-web-1--addr} if objects "data-web-0--addr" and "data-web-1--addr" refer on the theme.

That feature's name is "backward links". They also have representation in files in folder "/web/". In the previous example they are files with extension "._in" with contents "@data-web-0--addr" and "@data-web-1--addr"correspondingly.

Here "." is similar to ":", but acts for backward links.
Write ":in" and get the theme from link. Write ".in" and get all links on the theme from it.
Backward links are created automatically during direct link creation.

If you have any questions, please, contact us via email:

© 2002-2009 Алексей Мась, ReJump