The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

bin/addwn.pl - add what's new entries for specified templates

SYNOPSIS

  bin/addwn.pl [-acdh] [-f directory] [-l number]
    [-n name] [-p pattern] [-r] [-s directory]
    [-w name] [-z date] [handle1 handle2 ... handleN]

DESCRIPTION

The addwn.pl program adds templates with the specified handles to a What's New listing file. This listing file is then converted into a static HTML document which can be placed on the WWW. The Whats New file is intended to show end users what resources have just been catalogued by a subject service and/or when some aspect of a catalogued resource's template has changed.

USAGE

The ROADS software can generate lists of resource descriptions which have been entered recently or changed recently. The configuration of this is very similar to that of the resource listings. Essentially, each What's New view is specified by an HTML outline file, a file to add the new resource information to, and an internal file. The default What's New view can be found in the file config/multilingual/*/whats-new-views/Default under the top level ROADS installation directory.

The default What's New view installed by the ROADS software will be configured to create a listing file called whats-new.html in the ROADS directory on your WWW server, and use sub-directories of the ROADS installation for its outline and internal files, e.g.

  Outline-File:   whats-new/outlines/Default
  HTML-File:      whats-new.html
  Listing-File:   whats-new/Default.lst

If you create your resource description templates using the WWW based template editor, you will be given the option of entering them into a What's New list - addwn.pl will be called to do this. Alternatively, if you wish to generate these listings manually, you can run addwn.pl yourself. Use the -a option to add all your templates, e.g.

  % addwn.pl -a

If you only want to include a subset of the resource description templates in your database, addwn.pl takes a similar set of options to addsl.pl - e.g. the -p option can be used to restrict the templates which are included based on the contents of their URIs, and individual templates to include can be specified on the command line.

Note that your templates must include at least one URI attribute.

OPTIONS

A number of options are available for the addwn.pl program to control which files are used for generating the what's new listings and where configuration options are located:

-a

Process all templates in source directory.

-c

Specify that the alphabetical listing should take acount of the case of the characters. Without this option, acorn , Apple and Zebra are sorted in that order. With this flag set, they would be sorted as Apple , Zebra and acorn.

-d

specify that some (fairly copious) debugging information should be generated during the generation of the hypertext tree. This option is probably not of interest to anyone bar the developers.

-f directory

Specify the directory for views configuration files.

-h

Provide some online help outlining the options available and exit.

-l N

Specifies that only the last N resources added to the ROADS server should be used in the "What's New" listing.

-n name

Specifies the name of the database to use - defaulting to the service name which was entered when the ROADS server was created.

-p pattern

Only enter entries in the what's new listings for templates that have URI fields that match the supplied pattern. The pattern can be a full Perl regular expression and allows one to, for example, restrict entries in the what's new listings to only include UK academic sites. By default the pattern matches all URLs and so all templates are included in the hypertext lists.

-r

Specifies that any duplicates should be removed (pared down to a single entry).

-s directory

Set the absolute pathname of the directory containing the IAFA templates.

-w name

Sets the name of What's New view to use in configuring the addwn.pl script.

-z hhmmssddmmyyyy

Specifies that only resources added since this date should be included in the "What's New" listing, where the date fields are:

  hh - hours
  mm - minutes
  ss - seconds
  dd - day
  mm - month
  yyyy - year

These options are then followed by zero or more templates handles (note - not filenames). If the -a option is given, no handles need be given on the command line; all templates in the database will be added to the what's new listings.

FILES

config/whats-new/* - "What's New" view specifications

config/multilingual/*/whats-new-views/* - rendering rules for the various "What's New" views

htdocs/whats-new.html - default location of listing.

FILE FORMAT

The addwn.pl can generate a number of different what's new listings. This allows, for example, a what's new listing of UK based resources in addition to a what's new listing of all resources. The views also allow easy selection of which what's new listing a template should be added to in the mktemp.pl editor.

The view is specified by a view file. A sample file is:

  HTML-File:      /WWW/htdocs/ROADS/whats-new.html
  Listing-File:   /usr/local/ROADS/guts/whats-new/Default.lst

The various attributes currently defined in the view file are:

HTML-File:

The path to the file in which the what's new listing HTML document should be generated. This file should be accessible to the HTTP daemon that serves the ROADS documents if the HTML document is to be accessible via the World Wide Web. If the path is a relative one, it is assumed to be relative to the ROADS htdocs directory - i.e. the directory in which ROADS related WWW pages are rooted.

Listing-File:

The path to the file in which the What's New listing file should be located. This is typically located in the guts directory of the ROADS installation, which is where files needed for the internal operation of the ROADS software are kept. If the path is a relative one, it is assumed to be relative to the ROADS guts directory.

SEE ALSO

"addsl.pl" in bin, "cullsl.pl" in bin, "mkinv.pl" in bin

COPYRIGHT

Copyright (c) 1988, Martin Hamilton <martinh@gnu.org> and Jon Knight <jon@net.lut.ac.uk>. All rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

It was developed by the Department of Computer Studies at Loughborough University of Technology, as part of the ROADS project. ROADS is funded under the UK Electronic Libraries Programme (eLib), the European Commission Telematics for Research Programme, and the TERENA development programme.

AUTHOR

Jon Knight <jon@net.lut.ac.uk>