Public Knowledge Project: Open Archives Harvester'; include("include/header.inc.php"); ?> PKP Open Archives Harvester: Installation

© 2003-2004 Public Knowledge Project'; include("include/footer.inc.php"); // Show installation form function installForm($vars = array(), $error = '') { ?> Thank you for downloading the Public Knowledge Project's Open Archives Harvester v1.0.1. Before proceeding, please read the README file included with this software. For more information about the Public Knowledge Project and our software, please visit our web site. Send bug reports or technical support inquiries about the PKP OAI Harvester to harvester@pkp.ubc.ca, or visit our online bug reporting system.



Database Configuration

Hostname:
The hostname of your database server, typically localhost. If you are connecting locally over Unix domain sockets instead of TCP/IP you can leave this field blank.
Port:
The port number of your database server. You can leave this blank if your database server is running on the default port (3306 for MySQL), or if you're connecting over Unix domain sockets.
Persistent connections: /> Enable
Persistent connections are typically more efficient, but may increase system load on your database server.
Username:
Password:
Database name:
/> Database exists
/> Skip database table creation
If the database has already been created check the box above. In order to create a database, your user must have the necessary permissions. If you don't have permission to create a database, you will need to get your system administrator to create a database for you and give you a username and password with full access to the database.

Select the "Do not create database tables" option if you have already installed the harvester database and tables and only want to write the database settings file (include/db.inc.php).
 

Harvester Configuration

(Additional configuration settings can be set after installation.)

Admin username:
Admin password:
 
connect($vars['db_host'], $vars['db_port'], $vars['db_username'], $vars['db_password'], $vars['db_pconnect'])) { installForm($vars, "Error: unable to establish database connection."); return; } if(!$db->create_db($vars['db_name'])) { installForm($vars, "Error: unable to create database \"$vars[db_name]\"."); return; } } // initialize a new database connection to the database $db = new db_connection("mysql"); if(!$db->connect($vars['db_host'], $vars['db_port'], $vars['db_username'], $vars['db_password'], $vars['db_pconnect'], $vars['db_name'])) { installForm($vars, "Error: unable to establish database connection to database \"$vars[db_name]\"."); return; } if(!isset($vars['skip_tables'])) { // create database tables if(!$db->query("CREATE TABLE harvester_config ( admin_username VARCHAR(20) NOT NULL DEFAULT '', admin_password VARCHAR(32) NOT NULL DEFAULT '', long_title VARCHAR(120) NOT NULL DEFAULT '', short_title VARCHAR(60) NOT NULL DEFAULT '', contact_email VARCHAR(120) NOT NULL DEFAULT '', description TEXT NOT NULL DEFAULT '', intro TEXT NOT NULL DEFAULT '', allow_add TINYINT(1) NOT NULL DEFAULT 0, add_instructions TEXT NOT NULL DEFAULT '', add_notify TINYINT(1) NOT NULL DEFAULT 0, html_header TEXT NOT NULL DEFAULT '', html_footer TEXT NOT NULL DEFAULT '' )")) { installForm($vars, "Error: unable to create table \"harvester_config\"."); return; } if(!$db->query("INSERT INTO harvester_config (admin_username, admin_password, short_title, long_title, contact_email, description, intro, allow_add, add_instructions, add_notify, html_header, html_footer) VALUES ('$vars[admin_username]', '" . md5($vars['admin_password']) . "', 'PKP Open Archives Harvester', 'Public Knowledge Project Open Archives Metadata Harvester', 'harvester@pkp.ubc.ca', 'The Public Knowledge Project has developed a number of discipline-specific Research Support Tools (RST), which accompany individual research studies indexed from e-journal and conference paper websites covering a wide range of disciplines. The RST utilizes the study\'s metadata to search relevant open-access databases for related studies, theory, news, policies, and other resources, as well as offering access to the study\'s metadata and citation, to a personal portfolio, and to email and comment options.', '
Welcome to the Public Knowledge Project\'s metadata archive...

To improve the accuracy of searching within the PKP System, authors have been asked to index their work, where applicable, by discipline(s), topics, genre, method, coverage, and sample. This allows you to search for \"empirical\" versus \"historical\" studies, for example, under \"index terms.\" You can also view a document\'s index terms by selecting the complete record from among the search results.', '1', 'To ensure that the archive that is accumulating in your Public Knowledge Project system forms part of a globally distributed archive of research databases, register your website with our Public Knowledge Project metadata \"harvester\" that regularly gathers metadata on the research documents in your system\'s database.', '1', '\"Public', '© 2003-2004 Public Knowledge Project')")) { installForm($vars, "Error: unable to insert into table \"harvester_config\"."); return; } if(!$db->query("CREATE TABLE archives ( id INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(255) NOT NULL, repositoryname VARCHAR(255) NOT NULL DEFAULT '', email VARCHAR(60) NOT NULL DEFAULT '', url VARCHAR(255) NOT NULL, oai VARCHAR(255) NOT NULL, protocol VARCHAR(12) NOT NULL DEFAULT '', description TEXT NOT NULL DEFAULT '', rst VARCHAR(32) NOT NULL DEFAULT '', index_method VARCHAR(1) NOT NULL DEFAULT 'R', num_records INT NOT NULL DEFAULT 0, datestamp datetime NOT NULL, UNIQUE(oai) )")) { installForm($vars, "Error: unable to create table \"archives\"."); return; } if(!$db->query("CREATE TABLE metadata ( id INT AUTO_INCREMENT PRIMARY KEY, archive INT NOT NULL, oai_identifier VARCHAR(255) NOT NULL DEFAULT '', identifier VARCHAR(255) NOT NULL DEFAULT '', datestamp DATE NOT NULL, author VARCHAR(90) NOT NULL DEFAULT '', email VARCHAR(60) NOT NULL DEFAULT '', affiliation VARCHAR(60) NOT NULL DEFAULT '', add_authors TEXT NOT NULL DEFAULT '', add_emails TEXT NOT NULL DEFAULT '', add_affiliations TEXT NOT NULL DEFAULT '', title VARCHAR(255) NOT NULL DEFAULT '', abstract TEXT NOT NULL DEFAULT '', discipline VARCHAR(255) NOT NULL DEFAULT '', topic VARCHAR(255) NOT NULL DEFAULT '', publisher VARCHAR(255) NOT NULL DEFAULT '', contributors VARCHAR(255) NOT NULL DEFAULT '', date DATE, type VARCHAR(255) NOT NULL DEFAULT '', approach VARCHAR(255) NOT NULL DEFAULT '', format VARCHAR(255) NOT NULL DEFAULT '', source VARCHAR(255) NOT NULL DEFAULT '', language VARCHAR(30) NOT NULL DEFAULT '', relation VARCHAR(255) NOT NULL DEFAULT '', coverage VARCHAR(255) NOT NULL DEFAULT '', rights TEXT NOT NULL DEFAULT '', fulltext(title), fulltext(author, add_authors), fulltext(affiliation, add_affiliations), fulltext(author, add_authors, affiliation, add_affiliations), fulltext(abstract), fulltext(discipline), fulltext(topic), fulltext(approach), fulltext(coverage), fulltext(discipline, topic, publisher, contributors, approach, format, source, language, relation, coverage), UNIQUE(archive, oai_identifier) )")) { installForm($vars, "Error: unable to create table \"metadata\"."); return; } if(!$db->query("CREATE TABLE links ( id INT AUTO_INCREMENT PRIMARY KEY, title VARCHAR(90) NOT NULL DEFAULT '', url VARCHAR(255) NOT NULL DEFAULT '', annotation TEXT NOT NULL DEFAULT '' )")) { installForm($vars, "Error: unable to create table \"links\"."); return; } if(!$db->query("INSERT INTO links (title, url, annotation) VALUES ('Public Knowledge Project', 'http://www.pkp.ubc.ca/', 'Sponsor of this and other research systems, including Open Journal Systems, Open Conference Systems, the Research Support Tool, and the UBC ETD.')")) { installForm($vars, "Error: unable to insert into table \"links\"."); return; } if(!$db->query("CREATE TABLE oai_resumption_tokens ( token VARCHAR(32) PRIMARY KEY, expiration_date BIGINT NOT NULL DEFAULT 0, record_offset INT NOT NULL DEFAULT 0, params TEXT NOT NULL DEFAULT '' )")) { installForm($vars, "Error: unable to create table \"oai_resumption_tokens\"."); return; } } else { if(!$db->query("UPDATE harvester_config SET admin_username = '$vars[admin_username]', admin_password = '" . md5($vars['admin_password']) . "'")) { installForm($vars, "Error: unable to update table \"harvester_config\"."); return; } } // read current database configuration file $db_file = join("", file("include/db.inc.php")); // values to replace in configuration file $db_config = array( "type" => 'mysql', "name" => $vars['db_name'], "host" => $vars['db_host'], "port" => $vars['db_port'], "uname" => $vars['db_username'], "password" => $vars['db_password'] ); // replace values foreach($db_config as $k => $v) { $db_file = preg_replace('/\$db_config\[\'' . $k . '\'\] = "[^\r\n]*";/', "\$db_config['$k'] = \"$v\";", $db_file); } // replace pconnect value $db_file = preg_replace('/\$db_config\[\'pconnect\'\] = \d+;/', "\$db_config['pconnect'] = " . (int) $vars[pconnect] . ";", $db_file); if(is_writeable("include/db.inc.php")) { // write the new database configuration file $fp = fopen("include/db.inc.php", "w"); if($fp) { fwrite($fp, $db_file); fclose($fp); $db_written = 1; } } ?> The PKP OAI Harvester has been installed successfully.

You can login to the harvester admin to finish configuration of the system.

Sorry, the installer was unable to write to the database configuration file. Please open the file include/db.inc.php of your harvester installation with a text editor and replace the text in that file with the text in the field below. You must do this before you will be able to use the system.