Catalog

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

The general idea behind the design of Catalog is that creating a catalog
is mainly a matter of organizing objects in a structured tree. For
Catalog the objects are records in a table of the SQL database. 
The structured tree is a set of tree nodes and relations between these
nodes. The maintainer of the catalog is in charge of building the tree
and placing objects in this tree.

Here is a short list of the functions provided by Catalog:

* Display structured trees of resources.
* Display chronologically ordered resources and associated calendar.
* Display alphabetical indexes of resources.
* Allow full text search in the resources and the category names.
* Powerful HTML based administration of catalogs.
* On-Line editing of resource records.
* Handle an arbitrary number of catalogs.
* High performances using mod_perl and Apache.
* Easy customization of the user view using HTML template files.
* It is possible to define more than one view of the same catalog.
* Load and unload a thematic catalog in XML.
* Create an HTML dump of a structured tree to publish a static 

doc/catalog.texinfo  view on Meta::CPAN

The template files structure has been kept as simple as possible so that
only minimal comprehension is necessary from the HTML page designer. In 
particular it behaves well with page composer tools like Dreamweaver or
PageMill.

Here is a list of the characteristics of @code{Catalog}:
@itemize @bullet
@item
Display structured trees of resources.
@item
Display chronologically ordered resources and associated calendar.
@item
Display alphabetical indexes of resources.
@item 
Allow full text search in the resources and the category names.
@item
Powerful HTML based administration of catalogs.
@item
On-Line editing of resource records.
@item
Handle an arbitrary number of catalogs.

doc/catalog.texinfo  view on Meta::CPAN


@node Customizing chronological browsing (urldate), Customizing alphabetical browsing (urlalpha), Customizing search results (urlcatalog), Catalog management guide
@section Customizing chronological browsing (urldate)

The @strong{urldate} catalog displays the entries of the table @strong{urldemo}
in chronological order. Using the @strong{browse} link in the control panel,
you will see the following screen:

@image{images/examplecdate1,10cm,}

The default display of a chronologically ordered catalog contains a calendar.
Only the days for which at least a record exists are shown. The records 
themselves are shown in the last part of the display. The years, months and
days of the calendar are hypertext links that will only display the 
corresponding year, month or day.

The template used is @strong{cdate_default.html}. It contains two logical 
parts : the display of the calendar and the display of the records. 

@example
<html>
<body bgcolor=#ffffff>
<title>Date catalog</title>
@strong{Display the calendar}
<!-- start years -->
  <a href=_YEARLINK_>_YEARFORMATED_</a> (_COUNT_)

  <blockquote>
  <!-- start months -->
    <!-- params format => '%M' -->
    <a href=_MONTHLINK_>_MONTHFORMATED_</a> (_COUNT_)

    <ul>
    <!-- start days -->

doc/catalog.texinfo  view on Meta::CPAN

_PAGES_
<!-- end pager -->

<!-- end records -->
</html>
@end example

The part of the template that displays the records is identical to 
the @strong{cbrowse.html} or @strong{csearch.html} templates. It is 
wrapped in the @strong{records} part. If the @strong{records} part is
omitted, only the calendar will be displayed. 

The part of the template that displays the calendar contains three
nested parts : @strong{days} is included in @strong{months}, itself 
included in @strong{years}. If the chronological display is required
without specifying a specific time interval, all the records are taken
in account. Thru the use of the @strong{date} cgi-bin parameter, however, it is
possible to require that the cgi-bin only displays a given time interval.
For instance, if @strong{date} is set to @code{1999}, it will only 
consider the records of year 1999. If the @strong{date} is set to @code{199902}
it will only consider the records of February 1999. 
If the @strong{date} is set to @code{19990219}
it will only consider the records of February, 19 1999. Here is a display
for this specific day:

@image{images/examplecdate2,10cm,}

We could customize the record part and keep the calendar in this format. 
This is the simple solution if you're in a hurry. To further demonstrate
the customization of the chronological display we will show how to 
configure a different display according to the time interval. We want 
a different display when the time interval is:

@itemize @bullet
@item
unbounded (cdate_default.html).

@image{images/examplecdate3,10cm,}

doc/catalog.texinfo  view on Meta::CPAN


@item
a specific day (cdate_day.html).

@image{images/examplecdate6,10cm,}

@end itemize

As you can see on the figures above, the records are only displayed when
the time interval is limited to a specific day. In all other cases only
the calendar is shown. 
If the time interval is not bounded, only the years are displayed.
If the time interval is limited to a specific year, only the
months of the year are displayed.
If the time interval is limited to a specific month, only the
days of this month are displayed.
On top of the display, hypertext links allow to widen the time interval.

The first thing to understand is how we differentiate the templates used.
By default only @strong{cdate_default.html} is used but we want to use
four different templates for unbounded, year, month and day. This is 

doc/catalog.texinfo  view on Meta::CPAN

<!-- start years -->
<li>  <a href=_YEARLINK_&template=year>_YEARFORMATED_</a> (_COUNT_)
<!-- end years -->
</ul>
</html>
@end example

The @strong{records} part has been removed because we don't want to 
display them. The @strong{months} and @strong{days} parts of the @strong{years}
part have been removed because we don't want to go into details in this 
calendar. At this point the customization is really simple since we only
had to remove parts to get a list of years. Each year is associated
with a hypertext link (@strong{_YEARLINK_}) that leads to the chronological
display limited to the current year. We have appended the 
@strong{&template=year} parameter to this tag so that the 
@strong{cdate_year.html} is used instead of @strong{cdate_default.html}. 

Let's now configure the @strong{cdate_year.html} template. Here is the
customized template:

@example

doc/catalog.texinfo  view on Meta::CPAN


@cindex Browse chronological catalog
@cindex Catalog browsing
@cindex cdate

@table @samp

@item Description
Display the records associated with a date field included in the
period specified by the @strong{date} argument of the cgi-bin. 
A calendar of the period is displayed for each period that contains at
least one record and the number of records is calculated for each period.

The period used to find records to display can be different from the
period used to find entries displayed in the calendar. This is achieved
by using the @strong{index_date} and @strong{records_date} cgi-bin parameters.

To improve performances, the number of entries for each period is cached
in a temporary table. The cache is refreshed every 24h. If an immediate
refresh is necessary, the @strong{cdate_count} action may be used to flush
the cache.

@item Template files

@table @samp

doc/catalog.texinfo  view on Meta::CPAN


@example
date_<template>.html
@end example

This is typically used to differentiate templates that display years, months
and days.

@cindex parameter, date
@item date (optional)
Specify the period for both calendar and records displayed. It may have
the following forms:

@table @samp
@item YYYY
Defines the period from January 1st 00:00 to December 31 23:59
of the YYYY year.

@item YYYYMM
Defines the period from the first day of YYYYMM month 00:00h
to last day of the same month 23:59h.

doc/catalog.texinfo  view on Meta::CPAN

@end table

@cindex parameter, records_date
@item records_date
Same syntax as parameter @strong{date} but only applies to the display of
records.

@cindex parameter, index_date
@item index_date
Same syntax as parameter @strong{date} but only applies to the display of
the calendar.

@end table

@end table

@node Edit panel for a category node (cedit), Remove a category (categoryremove), Browse chronological catalog (cdate), Catalog CGI
@section Edit panel for a category node (cedit)

@image{images/entryinsert2,10cm,}

lib/Catalog.pm  view on Meta::CPAN

    # Format the record list
    #
    if(exists($template->{'children'}->{'records'})) {
	$self->cdate_records($template->{'children'}->{'records'}, $intervals{'records'});
    }
    
    return $self->stemplate_build($template);
}

#
# HTML display a data catalog calendar
#
sub cdate_index {
    my($self, $template, $interval, $spec, @specs) = @_;

#    warn("from = $interval->{'from'} => to = $interval->{'to'}");
    my($cgi) = $self->{'cgi'};
    my($name) = $cgi->param('name');
    my($catalog) = $self->cinfo()->{$name};
    my($url) = $cgi->script_name();

t/rdf/content.rdf  view on Meta::CPAN

  <d:Title>Science</d:Title>
  <link r:resource="http://www.algonet.se/~aleph/Trans/Tech/Megascale/dyson_page.html"/>
  <link r:resource="http://sandbox.xerox.com/nano/"/>
  <link r:resource="http://www.foresight.org"/>
  <link r:resource="http://www.talkorigins.org"/>
  <link r:resource="http://www.diemme.it/~luigi/alma.html"/>
  <link r:resource="http://www.chaparraltree.com/scison/"/>
  <link r:resource="http://sparky.mcmaster.ca/People/Faculty/Haykin/books.html"/>
  <link r:resource="http://www.improb.com"/>
  <link r:resource="http://www.physics.purdue.edu/~hinson/ftl/FTL_StartingPoint.html"/>
  <link r:resource="http://www.jps.net/gangale/mars/calendar.htm"/>
  <link r:resource="http://www.uilondon.org/chernidx.htm"/>
  <link r:resource="http://nano.xerox.com/nanotech/selfRepNASA.html"/>
  <link r:resource="http://www.research.ibm.com/quantuminfo/teleportation"/>
  <link r:resource="http://science.msfc.nasa.gov/newhome/headlines/essd06oct97_1.htm"/>
  <link r:resource="http://seds.lpl.arizona.edu/nodes/NODEv4n3-10.html"/>
  <link r:resource="http://seds.lpl.arizona.edu/nineplanets/nineplanets/nineplanets.html"/>
  <link r:resource="http://www.serve.com/mahood/lazar/lazarmn.htm"/>
  <link r:resource="http://www.sff.net/people/Geoffrey.Landis"/>
  <link r:resource="http://www.spacefuture.com"/>
  <link r:resource="http://www.cis.ohio-state.edu/hypertext/faq/usenet-faqs/bygroup/sci/astro/top.html"/>

t/rdf/content.rdf  view on Meta::CPAN

<ExternalPage about="http://www.improb.com">
  <d:Title>HotAIR</d:Title>
  <d:Description>Rare and well-done tidbits from the Annals of Improbable Research.</d:Description>
</ExternalPage>

<ExternalPage about="http://www.physics.purdue.edu/~hinson/ftl/FTL_StartingPoint.html">
  <d:Title>Relativity and FTL Travel</d:Title>
  <d:Description>Discussion of relativity, and its implications for faster-than-light travel, written for the layperson.</d:Description>
</ExternalPage>

<ExternalPage about="http://www.jps.net/gangale/mars/calendar.htm">
  <d:Title>Martian Time Website</d:Title>
  <d:Description>A proposed Martian calendar (the &quot;Darian&quot; calendar), and links to pages that discuss keeping time on Mars.</d:Description>
</ExternalPage>

<ExternalPage about="http://www.uilondon.org/chernidx.htm">
  <d:Title>Chernobyl</d:Title>
  <d:Description>The Accident and Progress Since 1986</d:Description>
</ExternalPage>

<ExternalPage about="http://nano.xerox.com/nanotech/selfRepNASA.html">
  <d:Title>Self Replicating Systems</d:Title>
  <d:Description>NASA and Self-Replicating Systems: Implications for Nanotechnology </d:Description>



( run in 0.639 second using v1.01-cache-2.11-cpan-5dc5da66d9d )