Catalog

 view release on metacpan or  search on metacpan

doc/catalog.texinfo  view on Meta::CPAN

@example
mysql -e "create database dmoz" 
@end example
If you have a database named dmoz, go to the URL
http://localhost/cgi-bin/DMOZ/dmoz?context=ccontrol_panel and a catalog named
@strong{dmoz} will automatically be created.

@itemize @bullet

@item
Load the content.rdf.gz file from http://dmoz.org/rdf.html.

@item
Run
@example
convert_dmoz -exclude '^/Adult' -what content content.rdf.gz
@end example
It prints a dot from time to time to show that it does not hang.
This script produces the following files:

@itemize @bullet
@item
 category.txt (table catalog_category_dmoz)
@item
 entry2category.txt (table catalog_entry2category_dmoz)
@item
 category2category.txt (table catalog_category2category_dmoz)
@item
 dmozrecords.txt (table dmozrecords)
@end itemize

@item
Load the files into the database using the following command
@example
convert_dmoz -load all ~/dmoz
@end example

@item
Click on @strong{browse} link in the Control Panel and check that
the catalog displays well. @strong{Warning} the first time you click
on @strong{browse} Catalog will rebuild some internal tables and it
will take some time to display. While working Catalog sends white
space characters to keep the connection busy and prevent timeouts.
These characters also tells you that Catalog is working and not hanging.
One character is printed for each category. If you have 200 000 categories
you should expect to download 200KB.

@item
Click on the @strong{count} link in the Control Panel to calculate
how many entries each category contains. It taks about the same time
to complete.
One character is printed for each category. If you have 200 000 categories
you should expect to download 200KB.

@end itemize

After a while, you will want to reload a new version of the dmoz.org
data. It can be done using the same commands. The problem is that while
you do that the catalog will be unavailable to the users. The data are
first removed and then populated. Catalog does not currently offer support
for user transparent reloading. Instead we suggest you follow these steps:

@itemize @bullet

@item
Load dmoz on another machine.

@item
Swap the MySQL database files when done.

@end itemize

@node Template files introduction, Catalog template files, External representation, Top
@chapter Template files introduction

@cindex template files 
@cindex template files definitions
The template files are the HTML files used by the cgi-bin to interact
with the user. Every interaction step is associated with the file name
of a template, the content of this file is read and analyzed by the 
cgi-bin and portions of it are replaced according to the action taken. 

@cindex simple template file

The simplest of all templates is the error template. It looks like this:

@cindex _MESSAGE_

@example
<title>Error</title>
<center><h3>
Error<p>
_MESSAGE_
</center></h3>
@end example

When an error occurs in a cgi-bin the error template is used. The
@strong{_MESSAGE_} tag is replaced by the actual error message and the
result is sent to the user.

@cindex location of template files
@cindex template files location
@cindex TEMPLATESDIR

The templates file names are located in the current directory if the
@code{TEMPLATESDIR} environment variable is not set. If it is set it
must contain a list of colon separated directories. The directories are
explored in order to find the template file. If no file is found a default
in-core version is used.

A template is often divided is parts, sometimes recursively. The general
syntax of this subdivision is as follows:

@cindex template files parts
@cindex template files subparts

@example
bla bla...
<!-- start part -->
bla bla...
<!-- start subpart -->



( run in 2.041 seconds using v1.01-cache-2.11-cpan-8f98c5d2c55 )