Skip to content
Snippets Groups Projects
Commit d0d7be83 authored by Daniel Berthereau's avatar Daniel Berthereau
Browse files

Released version 3.3.0.

parent 372ca62f
No related branches found
No related tags found
No related merge requests found
...@@ -17,7 +17,7 @@ use Zend\ServiceManager\ServiceLocatorInterface; ...@@ -17,7 +17,7 @@ use Zend\ServiceManager\ServiceLocatorInterface;
use Zend\View\Renderer\PhpRenderer; use Zend\View\Renderer\PhpRenderer;
/** /**
* OaiPmhRepository plugin class. * OaiPmhRepository module class.
*/ */
class Module extends AbstractModule class Module extends AbstractModule
{ {
...@@ -85,63 +85,7 @@ SQL; ...@@ -85,63 +85,7 @@ SQL;
public function upgrade($oldVersion, $newVersion, ServiceLocatorInterface $serviceLocator) public function upgrade($oldVersion, $newVersion, ServiceLocatorInterface $serviceLocator)
{ {
$config = require __DIR__ . '/config/module.config.php'; require_once 'data/scripts/upgrade.php';
$defaultSettings = $config[strtolower(__NAMESPACE__)]['config'];
$settings = $serviceLocator->get('Omeka\Settings');
if (version_compare($oldVersion, '0.3', '<')) {
$connection = $serviceLocator->get('Omeka\Connection');
$sql = <<<'SQL'
ALTER TABLE oai_pmh_repository_token CHANGE id id INT AUTO_INCREMENT NOT NULL, CHANGE verb verb VARCHAR(190) NOT NULL, CHANGE metadata_prefix metadata_prefix VARCHAR(190) NOT NULL, CHANGE `cursor` `cursor` INT NOT NULL, CHANGE `set` `set` INT DEFAULT NULL;
DROP INDEX expiration ON oai_pmh_repository_token;
CREATE INDEX IDX_E9AC4F9524CD504D ON oai_pmh_repository_token (expiration);
SQL;
$connection->exec($sql);
$settings->set('oaipmhrepository_name', $settings->get('oaipmh_repository_name',
$settings->get('installation_title')));
$settings->set('oaipmhrepository_namespace_id', $settings->get('oaipmhrepository_namespace_id',
$this->getServerNameWithoutProtocol($serviceLocator)));
$settings->set('oaipmhrepository_expose_media', $settings->get('oaipmh_repository_namespace_expose_files',
$defaultSettings['oaipmhrepository_expose_media']));
$settings->set('oaipmhrepository_list_limit',
$defaultSettings['oaipmhrepository_list_limit']);
$settings->set('oaipmhrepository_token_expiration_time',
$defaultSettings['oaipmhrepository_token_expiration_time']);
$settings->delete('oaipmh_repository_name');
$settings->delete('oaipmh_repository_namespace_id');
$settings->delete('oaipmh_repository_namespace_expose_files');
$settings->delete('oaipmh_repository_record_limit');
$settings->delete('oaipmh_repository_list_limit');
$settings->delete('oaipmh_repository_expiration_time');
$settings->delete('oaipmh_repository_token_expiration_time');
}
if (version_compare($oldVersion, '0.3.1', '<')) {
$settings->set('oaipmhrepository_global_repository',
$defaultSettings['oaipmhrepository_global_repository']);
$settings->set('oaipmhrepository_by_site_repository', 'item_set');
$settings->set('oaipmhrepository_oai_set_format',
$defaultSettings['oaipmhrepository_oai_set_format']);
$settings->set('oaipmhrepository_human_interface',
$defaultSettings['oaipmhrepository_human_interface']);
$settings->set('oaipmhrepository_hide_empty_sets',
$defaultSettings['oaipmhrepository_hide_empty_sets']);
}
if (version_compare($oldVersion, '3.2.2', '<')) {
$connection = $serviceLocator->get('Omeka\Connection');
$sql = <<<'SQL'
ALTER TABLE oai_pmh_repository_token CHANGE `set` `set` VARCHAR(190) DEFAULT NULL;
SQL;
$connection->exec($sql);
$settings->set('oaipmhrepository_append_identifier_global',
$defaultSettings['oaipmhrepository_append_identifier_global']);
$settings->set('oaipmhrepository_append_identifier_site',
$defaultSettings['oaipmhrepository_append_identifier_site']);
}
} }
protected function manageSettings($settings, $process, $key = 'config') protected function manageSettings($settings, $process, $key = 'config')
......
OAI-PMH Repository (module for Omeka S) OAI-PMH Repository (module for Omeka S)
======================================= =======================================
[OAI-PMH Repository] is a module for [Omeka S] that implements an Open Archives Initiative Protocol for Metadata Harvesting ([OAI-PMH]) repository for Omeka S, allowing [OAI-PMH Repository] is a module for [Omeka S] that implements an Open Archives
Omeka S items, item sets, and media to be harvested by OAI-PMH harvesters. The Initiative Protocol for Metadata Harvesting ([OAI-PMH]) repository for Omeka S,
module implements version 2.0 of the protocol. allowing Omeka S items, item sets, and media to be harvested by OAI-PMH
harvesters. The module implements version 2.0 of the protocol.
This [Omeka S] module is a rewrite of the [OAI-PMH Repository plugin] for [Omeka] This [Omeka S] module is a rewrite of the [OAI-PMH Repository plugin] for [Omeka]
by [BibLibre] and intends to provide the same features as the original plugin. by [BibLibre] and intends to provide the same features as the original plugin.
...@@ -51,6 +52,10 @@ breaks the assumption that each identifier is globally unique. Best practice is ...@@ -51,6 +52,10 @@ breaks the assumption that each identifier is globally unique. Best practice is
to set this value to the domain name the Omeka server is published at, possibly to set this value to the domain name the Omeka server is published at, possibly
with a prefix like "oai." with a prefix like "oai."
### Metadata formats
Select the formats that will be available. Only `oai_dc` is required.
### Expose media ### Expose media
Whether the repository should expose direct URLs to all the files associated Whether the repository should expose direct URLs to all the files associated
...@@ -94,6 +99,11 @@ with "dc:description". For other merges, the event `oaipmhrepository.values` can ...@@ -94,6 +99,11 @@ with "dc:description". For other merges, the event `oaipmhrepository.values` can
be used. For a quick hack, the file `data/mapping/generic_dcterms.php` can be be used. For a quick hack, the file `data/mapping/generic_dcterms.php` can be
used. used.
### Metadata for mets (item and media)
Mets can use any format to describe the item and the files. The formats that are
commonly used are `dc` and `mods` (currently unavailable).
### Human interface ### Human interface
The OAI-PMH pages can be displayed and browsed with a themable responsive human The OAI-PMH pages can be displayed and browsed with a themable responsive human
......
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "964a0fdaa3ef915638fa856319b2c385",
"packages": [],
"packages-dev": [
{
"name": "biblibre/omeka-s-test-helper",
"version": "dev-master",
"source": {
"type": "git",
"url": "https://github.com/biblibre/omeka-s-test-helper.git",
"reference": "a02c8dc4259365f7de1d09626a97347ba19cbf6e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/biblibre/omeka-s-test-helper/zipball/a02c8dc4259365f7de1d09626a97347ba19cbf6e",
"reference": "a02c8dc4259365f7de1d09626a97347ba19cbf6e",
"shasum": ""
},
"require": {
"php": ">=5.5.0"
},
"type": "library",
"autoload": {
"psr-4": {
"OmekaTestHelper\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "Test helpers for Omeka S",
"homepage": "https://github.com/biblibre/omeka-s-test-helper",
"keywords": [
"omeka",
"test"
],
"time": "2016-09-22T16:40:26+00:00"
}
],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": {
"biblibre/omeka-s-test-helper": 20
},
"prefer-stable": false,
"prefer-lowest": false,
"platform": [],
"platform-dev": []
}
[info] [info]
name = "OAI-PMH Repository" name = "OAI-PMH Repository"
description = "Exposes Omeka items as an OAI-PMH repository." description = "Exposes Omeka items as an OAI-PMH repository."
tags = "share, open data, library protocol" tags = "share, open data, library protocol, dublin core, mets, mods, cdwalite"
license = "GPL-3.0" license = "GPL-3.0"
author = "BibLibre (port from Omeka Classic plugin of John Flatness), improved by Daniel Berthereau" author = "BibLibre (port from Omeka Classic plugin of John Flatness), improved by Daniel Berthereau"
author_link = "https://github.com/biblibre" author_link = "https://github.com/Daniel-KM"
module_link = "https://github.com/biblibre/omeka-s-module-OaiPmhRepository" module_link = "https://github.com/Daniel-KM/omeka-s-module-OaiPmhRepository"
support_link = "https://github.com/biblibre/omeka-s-module-OaiPmhRepository/issues" support_link = "https://github.com/Daniel-KM/omeka-s-module-OaiPmhRepository/issues"
configurable = true configurable = true
version = "3.2.2" version = "3.3.0"
omeka_version_constraint = "^1.0.0" omeka_version_constraint = "^1.0.0"
<?php
namespace OaiPmhRepository;
$services = $serviceLocator;
$settings = $services->get('Omeka\Settings');
$connection = $services->get('Omeka\Connection');
$config = require dirname(dirname(__DIR__)) . '/config/module.config.php';
$defaultSettings = $config[strtolower(__NAMESPACE__)]['config'];
if (version_compare($oldVersion, '0.3', '<')) {
$connection = $serviceLocator->get('Omeka\Connection');
$sql = <<<'SQL'
ALTER TABLE oai_pmh_repository_token CHANGE id id INT AUTO_INCREMENT NOT NULL, CHANGE verb verb VARCHAR(190) NOT NULL, CHANGE metadata_prefix metadata_prefix VARCHAR(190) NOT NULL, CHANGE `cursor` `cursor` INT NOT NULL, CHANGE `set` `set` INT DEFAULT NULL;
DROP INDEX expiration ON oai_pmh_repository_token;
CREATE INDEX IDX_E9AC4F9524CD504D ON oai_pmh_repository_token (expiration);
SQL;
$connection->exec($sql);
$settings->set('oaipmhrepository_name', $settings->get('oaipmh_repository_name',
$settings->get('installation_title')));
$settings->set('oaipmhrepository_namespace_id', $settings->get('oaipmhrepository_namespace_id',
$this->getServerNameWithoutProtocol($serviceLocator)));
$settings->set('oaipmhrepository_expose_media', $settings->get('oaipmh_repository_namespace_expose_files',
$defaultSettings['oaipmhrepository_expose_media']));
$settings->set('oaipmhrepository_list_limit',
$defaultSettings['oaipmhrepository_list_limit']);
$settings->set('oaipmhrepository_token_expiration_time',
$defaultSettings['oaipmhrepository_token_expiration_time']);
$settings->delete('oaipmh_repository_name');
$settings->delete('oaipmh_repository_namespace_id');
$settings->delete('oaipmh_repository_namespace_expose_files');
$settings->delete('oaipmh_repository_record_limit');
$settings->delete('oaipmh_repository_list_limit');
$settings->delete('oaipmh_repository_expiration_time');
$settings->delete('oaipmh_repository_token_expiration_time');
}
if (version_compare($oldVersion, '0.3.1', '<')) {
$settings->set('oaipmhrepository_global_repository',
$defaultSettings['oaipmhrepository_global_repository']);
$settings->set('oaipmhrepository_by_site_repository', 'item_set');
$settings->set('oaipmhrepository_oai_set_format',
$defaultSettings['oaipmhrepository_oai_set_format']);
$settings->set('oaipmhrepository_human_interface',
$defaultSettings['oaipmhrepository_human_interface']);
$settings->set('oaipmhrepository_hide_empty_sets',
$defaultSettings['oaipmhrepository_hide_empty_sets']);
}
if (version_compare($oldVersion, '3.2.2', '<')) {
$connection = $serviceLocator->get('Omeka\Connection');
$sql = <<<'SQL'
ALTER TABLE oai_pmh_repository_token CHANGE `set` `set` VARCHAR(190) DEFAULT NULL;
SQL;
$connection->exec($sql);
$settings->set('oaipmhrepository_append_identifier_global',
$defaultSettings['oaipmhrepository_append_identifier_global']);
$settings->set('oaipmhrepository_append_identifier_site',
$defaultSettings['oaipmhrepository_append_identifier_site']);
}
if (version_compare($oldVersion, '3.3.0', '<')) {
$settings->set('oaipmhrepository_metadata_formats',
$defaultSettings['oaipmhrepository_metadata_formats']);
$settings->set('oaipmhrepository_generic_dcterms',
$defaultSettings['oaipmhrepository_generic_dcterms']);
$settings->set('oaipmhrepository_mets_data_item',
$defaultSettings['oaipmhrepository_mets_data_item']);
$settings->set('oaipmhrepository_mets_data_media',
$defaultSettings['oaipmhrepository_mets_data_media']);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment