#!/usr/local/bin/perl # # Electronic notebook stub. # # This is a minimal stub for the electronic notebook, that sets configuration # variables for one or more electronic notebooks. Also, since this stub is # the only notebook component directly referenced by a Web browser, it makes # it possible to set up different access restrictions for different notebooks, # simply by restricting Web access to this stub or its directory. # # The remaining notebook routines are contained in the file 'enotelib.pl', # which is set up to be shared by all the notebook stubs. The shared notebook # library does not need to be placed in a directory visible to Web browsers, # it just needs to be visible to the Web server (and the user name and group # that the Web server runs under). # # Copyright (C) 1996 Oak Ridge National Laboratory # # Noel M. Nachtigal Al Geist # April 24, 1996 # # Version 1.10 # Integrated sketchpad into "ADD", "EDIT", and "ANNOTATE" functions # Modified TOC to return hidden objects in notebook (uploaded files) # Integrated an external control panel for buttons # Implemented "ANNOTATE" function # Implemented "NOTARIZE" function to freeze individual page to change # Placed page change history into a pull-down menu to conserve space # Extended configuration to allow read-only access # Extended configuration to allow button bar to be turned off # Made change history a pull down menu to conserve page space # Replaced line horizontal with line reload hint # # Version 1.09 # Bug fixes, no new features. # # Version 1.08 # Added fancy Javascript bells to the navigation bar buttons. # The notebook name is now passed as a regular CGI parameter, instead of # being appended to the URL as further path. # The notebook script's URL is now built dynamically, to accomodate servers # with changing host names (e.g., laptops). # # Version 1.07 # Added edits history, which changes the file format (backwards compatible). # # Version 1.06 # Added 'Edit' and 'Delete'. # Added edits history to page. # Added empty stubs for 'Annotate' and 'Notarize'. # Changed the 'Table of Contents' to numbered list. # New set of buttons. # # Version 1.05 # Added uploading of files. # Added support for multiple MIME types. # Changed the naming convention for data files. # Removed the "

" and "

" surrounding entries in the text files. # # Version 1.04 # Added support for deleted pages or objects. # Cleaned up and reorganized the code. # # Version 1.03 # Added support for multiple notebooks that use the same stub. # Highlight required information on "Add" page (Tim Strayer). # Display page title with the page (Tim Strayer). # # Version 1.02 # Broke up the notebook script into a stub and a shared library. # Moved the notebook support images into the configurable section. # # Version 1.01 # Added image dimensions for the horizontal bar. # # Version 1.0 # Initial release. # ############################################################################### use strict; ############################################################################### # # Section 1: Notebooks names, directories, and titles # Notebooks names, directories, and titles # # The notebook stub can support multiple notebooks, all of which would share # the same access restrictions and layout features. Individual notebooks are # identified by a parameter that is appended to the URL for this stub; for # example, if this notebook stub is located at # http://www.someserver.net/cgi-bin/notebook.cgi # then the URL of a notebook named 'mynotebook' would be # http://www.someserver.net/cgi-bin/notebook.cgi?nb=mynotebook # # For each notebook, specify here the directory where its entries will be put, # and its title. Notebook names must be made up of only lowercase letters and # digits. # # The "$main::nb" is the default notebook. # ############################################################################### $main::notebook{'cookbook'} = {( 'dir' => '/home/www/geist/.wwwhome/enote/cookbook/', 'title' => 'Notebook Recipes and Tips (READ ONLY)' )}; $main::nb = 'cookbook'; ############################################################################### # # Section 2: Recognized MIME types # # Notebooks accept entries with a MIME type out of a given list of acceptable # MIME type; that list is given here, in the notebook stub. The strings on # the right are MIME types, and can be either widely accepted MIME types (such # as 'text/plain' or 'image/gif') or MIME types developed specifically for a # given notebook (such as 'application/x-ornl-notebook'). The string on the # left is displayed to the user, and thus should be a layman's description of # the MIME type on the right. # # The "$main::def_type" is the default type presented to the user, and *must* # match a user description from the list (otherwise it will be ignored and a # random description from the list will be used instead). # ############################################################################### %main::mimetypes = ( 'Text, HTML' => 'text/html', 'Image, GIF' => 'image/gif', 'Image, JPEG' => 'image/jpeg', 'Image, BMP' => 'image/bmp', 'Image, TIFF' => 'image/tiff', 'Text, plain' => 'text/plain', 'PostScript' => 'application/postscript', 'MS Word' => 'application/msword', 'PowerPoint' => 'application/vnd.ms-powerpoint', 'Excel' => 'application/vnd.ms-excel', ); $main::def_type = 'Text, plain'; ############################################################################### # # Section 3: General configuration flags and variables # ############################################################################### # Set to 1 if flock() exists, to 0 otherwise (Win95/NT). $main::flock = 0; # Directory of the shared notebook library routines 'enotelib.pl'. $main::libdir = '/home/www/geist/.wwwhome/enote/'; # The relative URL for this script. $main::script = '/~geist/cgi-bin/cookbook.cgi'; # The relative URL of the directory with the GIFs. $main::gifs = '/~geist/enote/gifs'; # The relative URL of the new-gifs directory $main::newgifs = '/~geist/enote/new-gifs'; # Whether users want a button bar on top of each page (nobar = 0) # or not draw the buttons (nobar = 1) and just use Control Panel $main::nobar = 0; # Whether users wants the external control panel to appear (nopanel = 0) # or not appear (nopanel = 1) and just use button bar $main::nopanel = 1; ################# Write Access to Notebook ################################### # # Whether users are allowed to add Notebook pages (noadd = 0) # or not allowed to add pages (nodelete = 1) $main::noadd = 1; # Whether users are allowed to delete Notebook pages (nodelete = 0) # or not allowed to delete pages (nodelete = 1) $main::nodelete = 1; # Whether users are allowed to edit Notebook pages (noedit = 0) # or not allowed to edit pages (noedit = 1) $main::noedit = 1; # Whether users are allowed to annotate Notebook pages (noannotate = 0) # or not allowed to annotate pages (noannotate = 1) $main::noannotate = 1; ############################################################################### # # Section 4: Notebook support images # These are common to all notebooks served by this stub. To replace the # default buttons with a new set of buttons, replace the button GIFS with a # new set of GIFs (same names), and specify the new image sizes below. # ############################################################################### # Horizontal line. $main::linehorz = '
'; # Horizontal line view page. $main::lineview = '
'; # Notebook page background. $main::backgrnd = "$main::gifs/notebook.gif"; # The height of the buttons (all are same height). $main::btn_ht = 24; # The width of the "Add Page" button. $main::add_wd = 36; # The width of the "Annotate" button. $main::anno_wd = 70; # The width of the "Delete" button. $main::del_wd = 50; # The width of the "Edit" button. $main::edit_wd = 37; # The width of the "First" button. $main::first_wd = 41; # The width of the "Last" button. $main::last_wd = 39; # The width of the "Next" button. $main::next_wd = 42; # The width of the "Notarize" button. $main::notar_wd = 66; # The width of the "Previous" button. $main::prev_wd = 67; # The width of the "Search" button. $main::srch_wd = 57; # The width of the "Table of Contents" button. $main::toc_wd = 65; # The width of the end buttons. $main::lend_wd = 6; $main::rend_wd = 4; ############################################################################### # # Main starts here. # ############################################################################### # Load the shared notebook library. push @INC, $main::libdir; require 'enotelib.pl'; &main(); exit 0; __END__