repository.pl API
The following Perl subroutines from
repository.pl
provide functionality for the publication submission
and extraction processes.
- check_submissee ($login)
- Check the submissee field has been filled in so we can email them notification of submission
- check_login ($login)
- Check the specified login is a current member of staff of a research postgraduate (i.e. their login is in the PERSONNEL table)
- check_file ($filename)
- Check specified filename exists and is readable
- check_file_extension ($filename)
- Check specified filename has an extension
- check_abstract_file_extension
- Check abstract filename has a .txt or .html file extension
- get_file_extension ($filename)
- Returns extension of given filename
- check_isbn ($isbn)
-
- check_issn ($issn)
-
- check_book_id ($book_id, $type)
- Check specified ISBN/ISSN ($type) is correct
- We can accept ids of the form:
ISBN 0 937175 64 1
- FOO BAR 0 937175 64 1
- 0 937175 64 1
- 0937175641
- 0-937175-64-1
- 0^937175^64^1
- etc.
- write_record (filename)
- Write Pseudo Bibtex record to filename specified Note that %USER_INPUT and @filled_fields are global
- check_for_duplicates (@array)
- Mainly used for checking for duplicate logins in an array
- get_filename (stem, year, publication id)
- Used for finding absolute pathnames of abstract and content filenames, based on the year and id of the publication. The stem part is normally either "content" or "abstract".
- Returns the absolute pathname of the matched stem.
- get_filesize ($filename)
- Returns size (in Kbytes) of specified file
- process_date_string ($year_string)
- Take a date string and convert to month and year.
- Date string examples:
- 1997 returns (1,1997) i.e. January
- 3.1997 returns (3,1997)
- replace_accents ($string)
- Replace Latex accent (AND GREEK) markup with HTML equivalent. Code courtesy of Richard Jones.











