How is Zvon site maintained draft: v 1.00
.........Administration of a web site or running a complex project can be a very time consuming job. This is especially true if you are going to rely on contribution from many different sources and keep up to date multilingual versions of your pages. If there are no automatic mechanisms in place which simplify your work, the project is deemed to failure
.........The Zvon homesite serves as testing ground for some ideas how to ensure seemles cooperation and information exchange in unrestricted environment. We hope that experience gained here will help us to start new projects which should harness the enormous potential of co-operating human minds.
.........Administration of this site goes in several steps. The article describes a simplified and idealized procedures. The real life is of course not so simple and some time quick hacks are necessary, but we also strive to make these hacks in such a way that they can be later reused.
.........The system has been built on a central idea, that simplicity is more important that efficiency. We tried to avoid any specialized software and strucures which require complex indexing techniques. The site can be managed just with vi or notepad. It does not use any database software. Filesystem is used as a database and id's contains information sufficent for required item localization. If anything goes amiss it should be relatively easy to reconstruct the required files from available information.
.........The site is based on XML documents which are then proccessed with XSL stylesheets and eventually modified with Perl scripts. We decided not to provide XML documents directly at this moment. XML enabled browsers are still not generaly available and it will be straightforward to transform existing XML documents to whatever it will be needed. XSL is even more premature technology. It would be therefore unwise to serve XML pages directly with XSL stylesheets when there does not exist a browser which would correctly use XSL. On the other hand the transformation part of XSL is a superb tool if you get used to it. It takes some time if you are used to other programming languages but it is very natural for transformation of XML texts. There is a superb program XT written by J. Clark which implements the latest XSL draft and which allows to make this transformations off-line.
.........XML files are fed into XT program and they are outputed as HTML file. To use XT as a stand alone application is rather unconvenient but a perl script
runXT was written which further simplifies individual steps. You input name of XML file, XSL file (which is usually automatically read from the file _defaultXSL in current or parent directory) and language version. The script then executes XT program and uses its output for futher transformation. The most important transformation is substitution of actual internal URL's for document id's which are given in source text.
.........The idea that every source file should have its unique id is very important. The real problem of larger sites is logical organization of the site. It is very difficult to have the right system at the first attempt. But if you change system of your directories, you have to relink your site. The XML sources contain in internal links only ID of reffered page. The perl looks into database of links (nothing complicated, just text files which are saved at locations given by the ID. The way the id's are constructed ensures, that there are only several id's in each file, and so you do not need any database program and perl can handle such a file in no time). If position of files changes, there is an easy solution. Just delete the directory with id's and another script makeFileDatabase.pl creates the correct one.
.........It is obvious that ensuring uniqueness of id's is of paramount importance. But as we written before, simplicity was a very important requirenment. Therefore the idea of centralized database was rejected. There fortunatelly exists a simple mechanism which ensures with very high probability, that all id's are unique. It is based on time consideration. All id's have form yearMonthDayHourMinSecMilisec, e.g. zvon19990806154502589. It is extremely improbable that two people will generate an id in exactly same millisecond. It is easy to generate id without computer, but of course
a small script is always useful.
.........The perl transformations include some more steps, but these will be described later in some other document. We will mention just one. All links are generated in such a way, that the system can be transfered to another computer or different root directory and all links should remain valid. The id's database contains absolute paths of files from the web root directory. The perl scripts look at the position of source file and prepends enough ../../.. to ensure link validity.
.........
The great strenght of SGML/XML is the possibility to automatically check the document against its DTD. We are of course using this possibility, but we soon discovered, that direct writting of DTD is far from optimal. If you are running a project like Zvon, you need many types of DTD, which often differ only in some details but share many common features. You can of course use references to other DTD in a individual DTD, but it is very easy to make things mixed up.
We therefore created
a template written in XML, from which individual DTDs are generated with help of XSL stylesheet. This approach has brought several advantages. It is very easy to recycle sooner developed tags and attributes. You just insert required new tags into template and then the script automatically include tags, which are already defined. It also enables to have multilingual set of tags. If you want your tags in another language, just define alias name for selected tags. If another tag is needed which does not have alias, original name is used.
.........We validate files individually or we are using
a small script which validates everything in current directory and its subdirectories.
.........
Zvon se snaží podpořit volnou výměnu informací. I Vy se můžete stát jejím členem. Na domovské stránce této skupiny: http://zvon.vscht.cz naleznete bližší informace.
[kodovani cestiny] | Darujte potraviny.