add depth to coverage model

This commit is contained in:
Arno Kaimbacher 2019-03-29 18:29:20 +01:00
parent 52b166601c
commit 2f930457d1
13 changed files with 306 additions and 187 deletions

View File

@ -410,15 +410,15 @@ class IndexController extends Controller
}
}
if (isset($data['geolocation'])) {
$formGeolocation = $request->input('geolocation');
if ($formGeolocation['xmin'] !== null && $formGeolocation['ymin'] !== null &&
$formGeolocation['xmax'] !== null && $formGeolocation['ymax'] !== null) {
$geolocation = new GeolocationBox($formGeolocation);
$dataset->geolocation()->save($geolocation);
//$geolocation->dataset()->associate($dataset)->save();
}
}
// if (isset($data['geolocation'])) {
// $formGeolocation = $request->input('geolocation');
// if ($formGeolocation['xmin'] !== null && $formGeolocation['ymin'] !== null &&
// $formGeolocation['xmax'] !== null && $formGeolocation['ymax'] !== null) {
// $geolocation = new GeolocationBox($formGeolocation);
// $dataset->geolocation()->save($geolocation);
// //$geolocation->dataset()->associate($dataset)->save();
// }
// }
if (isset($data['coverage'])) {
$formCoverage = $request->input('coverage');

View File

@ -64,7 +64,8 @@ class SolariumAdapter
$update = $this->client->createUpdate();
$updateDocs = array_map(function ($rdrDoc) use ($builder, $update) {
return $builder->toSolrUpdateDocument($rdrDoc, $update->createDocument());
$solarium_document = $update->createDocument();
return $builder->toSolrUpdateDocument($rdrDoc, $solarium_document);
}, $slice);
// adding the document to the update query
@ -129,7 +130,8 @@ class SolariumAdapter
//}
// $filter = $parameters->getFilter();//"aa"
// if ( $filter instanceof Opus_Search_Solr_Filter_Raw || $filter instanceof Opus_Search_Solr_Solarium_Filter_Complex ) {
// if ( $filter instanceof Opus_Search_Solr_Filter_Raw
// || $filter instanceof Opus_Search_Solr_Solarium_Filter_Complex ) {
// if ( !$query->getQuery() || !$preferOriginalQuery ) {
// $compiled = $filter->compile( $query );
// if ( $compiled !== null ) {

View File

@ -4,6 +4,7 @@ namespace App\Library\Search;
use App\Models\Dataset;
use Solarium\QueryType\Update\Query\Document\Document;
use Solarium\QueryType\Update\Query\Document\DocumentInterface;
class SolariumDocument extends SolrDocumentXslt
{
@ -12,7 +13,7 @@ class SolariumDocument extends SolrDocumentXslt
parent::__construct($options);
}
public function toSolrUpdateDocument(Dataset $rdrDataset, Document $solrDoc)
public function toSolrUpdateDocument(Dataset $rdrDataset, DocumentInterface $solrDoc)
{
if (!($solrDoc instanceof Document)) {
throw new \Exception('provided Solr document must be instance of Solarium Update Document');

View File

@ -7,6 +7,7 @@ use App\Models\License;
use App\Models\Person;
use App\Models\File;
use App\Models\GeolocationBox;
use App\Models\Coverage;
use App\Models\Subject;
/**
@ -64,9 +65,14 @@ trait DatasetExtension
'relation' => 'files',
'fetch' => 'eager'
),
'GeolocationBox' => array(
'model' => GeolocationBox::class,
'relation' => 'geolocation',
// 'GeolocationBox' => array(
// 'model' => GeolocationBox::class,
// 'relation' => 'geolocation',
// 'fetch' => 'eager'
// ),
'Coverage' => array(
'model' => Coverage::class,
'relation' => 'coverage',
'fetch' => 'eager'
),
);

View File

@ -15,7 +15,11 @@ class Coverage extends Model
'elevation_absolut',
'depth_min',
'depth_max',
'depth_absolut'
'depth_absolut',
'time_min',
'time_max',
'time_absolut',
'xmin', 'xmax', 'ymin', 'ymax'
];
public function dataset()

View File

@ -65,10 +65,10 @@ class Dataset extends Model
/**
* Get the geolocation that owns the dataset.
*/
public function geolocation()
{
return $this->hasOne(GeolocationBox::class, 'dataset_id', 'id');
}
// public function geolocation()
// {
// return $this->hasOne(GeolocationBox::class, 'dataset_id', 'id');
// }
/**
* Get the coverage that owns the dataset.

100
composer.lock generated
View File

@ -2256,16 +2256,16 @@
},
{
"name": "symfony/polyfill-ctype",
"version": "v1.10.0",
"version": "v1.11.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git",
"reference": "e3d826245268269cd66f8326bd8bc066687b4a19"
"reference": "82ebae02209c21113908c229e9883c419720738a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19",
"reference": "e3d826245268269cd66f8326bd8bc066687b4a19",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/82ebae02209c21113908c229e9883c419720738a",
"reference": "82ebae02209c21113908c229e9883c419720738a",
"shasum": ""
},
"require": {
@ -2277,7 +2277,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.9-dev"
"dev-master": "1.11-dev"
}
},
"autoload": {
@ -2299,7 +2299,7 @@
},
{
"name": "Gert de Pagter",
"email": "BackEndTea@gmail.com"
"email": "backendtea@gmail.com"
}
],
"description": "Symfony polyfill for ctype functions",
@ -2310,20 +2310,20 @@
"polyfill",
"portable"
],
"time": "2018-08-06T14:22:27+00:00"
"time": "2019-02-06T07:57:58+00:00"
},
{
"name": "symfony/polyfill-iconv",
"version": "v1.10.0",
"version": "v1.11.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-iconv.git",
"reference": "97001cfc283484c9691769f51cdf25259037eba2"
"reference": "f037ea22acfaee983e271dd9c3b8bb4150bd8ad7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/97001cfc283484c9691769f51cdf25259037eba2",
"reference": "97001cfc283484c9691769f51cdf25259037eba2",
"url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/f037ea22acfaee983e271dd9c3b8bb4150bd8ad7",
"reference": "f037ea22acfaee983e271dd9c3b8bb4150bd8ad7",
"shasum": ""
},
"require": {
@ -2335,7 +2335,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.9-dev"
"dev-master": "1.11-dev"
}
},
"autoload": {
@ -2369,20 +2369,20 @@
"portable",
"shim"
],
"time": "2018-09-21T06:26:08+00:00"
"time": "2019-02-06T07:57:58+00:00"
},
{
"name": "symfony/polyfill-intl-idn",
"version": "v1.10.0",
"version": "v1.11.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-intl-idn.git",
"reference": "89de1d44f2c059b266f22c9cc9124ddc4cd0987a"
"reference": "c766e95bec706cdd89903b1eda8afab7d7a6b7af"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/89de1d44f2c059b266f22c9cc9124ddc4cd0987a",
"reference": "89de1d44f2c059b266f22c9cc9124ddc4cd0987a",
"url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/c766e95bec706cdd89903b1eda8afab7d7a6b7af",
"reference": "c766e95bec706cdd89903b1eda8afab7d7a6b7af",
"shasum": ""
},
"require": {
@ -2431,20 +2431,20 @@
"portable",
"shim"
],
"time": "2018-09-30T16:36:12+00:00"
"time": "2019-03-04T13:44:35+00:00"
},
{
"name": "symfony/polyfill-mbstring",
"version": "v1.10.0",
"version": "v1.11.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
"reference": "c79c051f5b3a46be09205c73b80b346e4153e494"
"reference": "fe5e94c604826c35a32fa832f35bd036b6799609"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/c79c051f5b3a46be09205c73b80b346e4153e494",
"reference": "c79c051f5b3a46be09205c73b80b346e4153e494",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fe5e94c604826c35a32fa832f35bd036b6799609",
"reference": "fe5e94c604826c35a32fa832f35bd036b6799609",
"shasum": ""
},
"require": {
@ -2456,7 +2456,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.9-dev"
"dev-master": "1.11-dev"
}
},
"autoload": {
@ -2490,20 +2490,20 @@
"portable",
"shim"
],
"time": "2018-09-21T13:07:52+00:00"
"time": "2019-02-06T07:57:58+00:00"
},
{
"name": "symfony/polyfill-php72",
"version": "v1.10.0",
"version": "v1.11.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php72.git",
"reference": "9050816e2ca34a8e916c3a0ae8b9c2fccf68b631"
"reference": "ab50dcf166d5f577978419edd37aa2bb8eabce0c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/9050816e2ca34a8e916c3a0ae8b9c2fccf68b631",
"reference": "9050816e2ca34a8e916c3a0ae8b9c2fccf68b631",
"url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/ab50dcf166d5f577978419edd37aa2bb8eabce0c",
"reference": "ab50dcf166d5f577978419edd37aa2bb8eabce0c",
"shasum": ""
},
"require": {
@ -2512,7 +2512,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.9-dev"
"dev-master": "1.11-dev"
}
},
"autoload": {
@ -2545,7 +2545,7 @@
"portable",
"shim"
],
"time": "2018-09-21T13:07:52+00:00"
"time": "2019-02-06T07:57:58+00:00"
},
{
"name": "symfony/process",
@ -2922,16 +2922,16 @@
},
{
"name": "yajra/laravel-datatables-oracle",
"version": "v8.13.5",
"version": "v8.13.6",
"source": {
"type": "git",
"url": "https://github.com/yajra/laravel-datatables.git",
"reference": "a97a173a52f2b60075f310dac39932faa377fb4f"
"reference": "0b6f9c0653499d73d051dc46275511fc4c9dd7f1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/yajra/laravel-datatables/zipball/a97a173a52f2b60075f310dac39932faa377fb4f",
"reference": "a97a173a52f2b60075f310dac39932faa377fb4f",
"url": "https://api.github.com/repos/yajra/laravel-datatables/zipball/0b6f9c0653499d73d051dc46275511fc4c9dd7f1",
"reference": "0b6f9c0653499d73d051dc46275511fc4c9dd7f1",
"shasum": ""
},
"require": {
@ -2989,7 +2989,7 @@
"jquery",
"laravel"
],
"time": "2019-02-13T01:34:34+00:00"
"time": "2019-03-26T05:01:51+00:00"
},
{
"name": "zizaco/entrust",
@ -3073,27 +3073,29 @@
"packages-dev": [
{
"name": "doctrine/instantiator",
"version": "1.1.0",
"version": "1.2.0",
"source": {
"type": "git",
"url": "https://github.com/doctrine/instantiator.git",
"reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda"
"reference": "a2c590166b2133a4633738648b6b064edae0814a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda",
"reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda",
"url": "https://api.github.com/repos/doctrine/instantiator/zipball/a2c590166b2133a4633738648b6b064edae0814a",
"reference": "a2c590166b2133a4633738648b6b064edae0814a",
"shasum": ""
},
"require": {
"php": "^7.1"
},
"require-dev": {
"athletic/athletic": "~0.1.8",
"doctrine/coding-standard": "^6.0",
"ext-pdo": "*",
"ext-phar": "*",
"phpunit/phpunit": "^6.2.3",
"squizlabs/php_codesniffer": "^3.0.2"
"phpbench/phpbench": "^0.13",
"phpstan/phpstan-phpunit": "^0.11",
"phpstan/phpstan-shim": "^0.11",
"phpunit/phpunit": "^7.0"
},
"type": "library",
"extra": {
@ -3118,12 +3120,12 @@
}
],
"description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
"homepage": "https://github.com/doctrine/instantiator",
"homepage": "https://www.doctrine-project.org/projects/instantiator.html",
"keywords": [
"constructor",
"instantiate"
],
"time": "2017-07-22T11:58:36+00:00"
"time": "2019-03-17T17:37:11+00:00"
},
{
"name": "fzaninotto/faker",
@ -3794,16 +3796,16 @@
},
{
"name": "phpunit/phpunit",
"version": "7.5.7",
"version": "7.5.8",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "eb343b86753d26de07ecba7868fa983104361948"
"reference": "c29c0525cf4572c11efe1db49a8b8aee9dfac58a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/eb343b86753d26de07ecba7868fa983104361948",
"reference": "eb343b86753d26de07ecba7868fa983104361948",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c29c0525cf4572c11efe1db49a8b8aee9dfac58a",
"reference": "c29c0525cf4572c11efe1db49a8b8aee9dfac58a",
"shasum": ""
},
"require": {
@ -3874,7 +3876,7 @@
"testing",
"xunit"
],
"time": "2019-03-16T07:31:17+00:00"
"time": "2019-03-26T13:23:54+00:00"
},
{
"name": "sebastian/code-unit-reverse-lookup",

File diff suppressed because one or more lines are too long

View File

@ -1,18 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns="http://www.openarchives.org/OAI/2.0/"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.openarchives.org/OAI/2.0/"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/"
xmlns:php="http://php.net/xsl">
xmlns:php="http://php.net/xsl">
<!--<xsl:param name="urnResolverUrl" />-->
<!-- add include here for each new metadata format -->
<xsl:include href="prefixes/oai_datacite.xslt" />
<!-- add include here for each new metadata format -->
<xsl:include href="prefixes/oai_datacite.xslt" />
<xsl:output method="xml" indent="yes" encoding="utf-8" />
@ -49,8 +48,8 @@
<xsl:text>type="text/xsl" href="xsl/oai2_style.xslt"</xsl:text>
</xsl:processing-instruction>
<OAI-PMH xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.openarchives.org/OAI/2.0/"
xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd">
<OAI-PMH xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.openarchives.org/OAI/2.0/" xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd">
<responseDate>
<xsl:value-of select="$responseDate" />
</responseDate>
@ -126,8 +125,7 @@
<xsl:text>YYYY-MM-DD</xsl:text>
</granularity>
<description>
<oai-identifier xmlns="http://www.openarchives.org/OAI/2.0/oai-identifier"
xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai-identifier http://www.openarchives.org/OAI/2.0/oai-identifier.xsd">
<oai-identifier xmlns="http://www.openarchives.org/OAI/2.0/oai-identifier" xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai-identifier http://www.openarchives.org/OAI/2.0/oai-identifier.xsd">
<scheme>
<xsl:text>oai</xsl:text>
</scheme>
@ -181,10 +179,14 @@
</xsl:template>
<xsl:template match="Rdr_Sets">
<set>
<setSpec><xsl:value-of select="@Type"/></setSpec>
<setName><xsl:value-of select="@TypeName"/></setName>
</set>
<set>
<setSpec>
<xsl:value-of select="@Type"/>
</setSpec>
<setName>
<xsl:value-of select="@TypeName"/>
</setName>
</set>
</xsl:template>
<xsl:template match="Datasets" mode="ListIdentifiers">
@ -215,10 +217,16 @@
<xsl:apply-templates select="Rdr_Dataset" />
<xsl:if test="$totalIds > 0">
<resumptionToken>
<xsl:attribute name="expirationDate"><xsl:value-of select="$dateDelete"/></xsl:attribute>
<xsl:attribute name="completeListSize"><xsl:value-of select="$totalIds"/></xsl:attribute>
<xsl:attribute name="cursor"><xsl:value-of select="$cursor"/></xsl:attribute>
<xsl:value-of select="$res"/>
<xsl:attribute name="expirationDate">
<xsl:value-of select="$dateDelete"/>
</xsl:attribute>
<xsl:attribute name="completeListSize">
<xsl:value-of select="$totalIds"/>
</xsl:attribute>
<xsl:attribute name="cursor">
<xsl:value-of select="$cursor"/>
</xsl:attribute>
<xsl:value-of select="$res"/>
</resumptionToken>
</xsl:if>
</ListRecords>
@ -226,9 +234,9 @@
</xsl:template>
<xsl:template match="Datasets" mode="GetRecord">
<GetRecord>
<xsl:apply-templates select="Rdr_Dataset" />
</GetRecord>
<GetRecord>
<xsl:apply-templates select="Rdr_Dataset" />
</GetRecord>
</xsl:template>
<xsl:template match="Rdr_Dataset">
@ -260,13 +268,17 @@
<datestamp>
<xsl:choose>
<xsl:when test="ServerDateModified">
<xsl:value-of select="ServerDateModified/@Year"/>-
<xsl:value-of select="format-number(ServerDateModified/@Month,'00')"/>-
<xsl:value-of select="ServerDateModified/@Year"/>
-
<xsl:value-of select="format-number(ServerDateModified/@Month,'00')"/>
-
<xsl:value-of select="format-number(ServerDateModified/@Day,'00')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="ServerDatePublished/@Year"/>-
<xsl:value-of select="format-number(ServerDatePublished/@Month,'00')"/>-
<xsl:value-of select="ServerDatePublished/@Year"/>
-
<xsl:value-of select="format-number(ServerDatePublished/@Month,'00')"/>
-
<xsl:value-of select="format-number(ServerDatePublished/@Day,'00')"/>
</xsl:otherwise>
</xsl:choose>
@ -315,9 +327,9 @@
<xsl:apply-templates select="PersonAuthor" mode="oai_dc" />
</xsl:when>
<xsl:when test="@CreatingCorporation">
<dc:creator>
<xsl:value-of select="@CreatingCorporation" />
</dc:creator>
<dc:creator>
<xsl:value-of select="@CreatingCorporation" />
</dc:creator>
</xsl:when>
</xsl:choose>
<!-- dc:contributor -->
@ -340,18 +352,44 @@
<!-- dc:rights -->
<xsl:apply-templates select="Licence" mode="oai_dc" />
<!-- dc:coverage -->
<xsl:apply-templates select="GeolocationBox" mode="oai_dc" />
<xsl:apply-templates select="Coverage" mode="oai_dc" />
</oai_dc:dc>
</xsl:template>
<xsl:template match="GeolocationBox" mode="oai_dc">
<xsl:template match="Coverage" mode="oai_dc">
<dc:coverage>
<xsl:value-of select="concat(
'SOUTH-BOUND LATITUDE: ', @Xmin,
' * WEST-BOUND LONGITUDE: ', @Ymin,
' * NORTH-BOUND LATITUDE: ', @Xmax,
' * EAST-BOUND LONGITUDE: ', @Ymax
)" />
<xsl:variable name="geolocation" select="concat(
'SOUTH-BOUND LATITUDE: ', @Xmin,
' * WEST-BOUND LONGITUDE: ', @Ymin,
' * NORTH-BOUND LATITUDE: ', @Xmax,
' * EAST-BOUND LONGITUDE: ', @Ymax
)" />
<xsl:value-of select="$geolocation" />
<xsl:text>&#xA;</xsl:text>
<xsl:if test="@ElevationMin != '' and @ElevationMax != ''">
<xsl:value-of select="concat(' *ELEVATION MIN: ', @ElevationMin, ' *ELEVATION MAX: ', @ElevationMax)" />
</xsl:if>
<xsl:if test="@ElevationAbsolut != ''">
<xsl:value-of select="concat(' *ELEVATION ABSOLUT: ', @ElevationAbsolut)" />
</xsl:if>
<xsl:text>&#xA;</xsl:text>
<xsl:if test="@DepthMin != '' and @DepthMax != ''">
<xsl:value-of select="concat(' *DEPTH MIN: ', @DepthMin, ' *DEPTH MAX: ', @DepthMax)" />
</xsl:if>
<xsl:if test="@DepthAbsolut != ''">
<xsl:value-of select="concat(' *DEPTH ABSOLUT: ', @DepthAbsolut)" />
</xsl:if>
<xsl:text>&#xA;</xsl:text>
<xsl:if test="@TimeMin != '' and @TimeMax != ''">
<xsl:value-of select="concat(' *TIME MIN: ', @TimeMin, ' *TIME MAX: ', @TimeMax)" />
</xsl:if>
<xsl:if test="@TimeAbsolut != ''">
<xsl:value-of select="concat(' *TIME ABSOLUT: ', @TimeAbsolut)" />
</xsl:if>
</dc:coverage>
</xsl:template>
@ -371,24 +409,24 @@
</xsl:template>
<xsl:template match="Subject" mode="oai_dc">
<dc:subject>
<xsl:if test="@language != ''">
<xsl:attribute name="xml:lang">
<xsl:value-of select="php:functionString('Oai_Model_Language::getLanguageCode', @Language, 'part1')" />
</xsl:attribute>
</xsl:if>
<xsl:value-of select="@Value" />
</dc:subject>
</xsl:template>
<dc:subject>
<xsl:if test="@language != ''">
<xsl:attribute name="xml:lang">
<xsl:value-of select="php:functionString('Oai_Model_Language::getLanguageCode', @Language, 'part1')" />
</xsl:attribute>
</xsl:if>
<xsl:value-of select="@Value" />
</dc:subject>
</xsl:template>
<!-- <xsl:template match="PersonAuthor|PersonEditor" mode="oai_dc">
<dc:creator>
<xsl:value-of select="@LastName" />
<xsl:if test="@FirstName != ''" >
<xsl:if test="@FirstName != ''">
<xsl:text>, </xsl:text>
</xsl:if>
<xsl:value-of select="@FirstName" />
<xsl:if test="@AcademicTitle != ''" >
<xsl:if test="@AcademicTitle != ''">
<xsl:text> (</xsl:text>
<xsl:value-of select="@AcademicTitle" />
<xsl:text>)</xsl:text>
@ -399,11 +437,11 @@
<xsl:template match="PersonContributor" mode="oai_dc">
<dc:contributor>
<xsl:value-of select="@LastName" />
<xsl:if test="@FirstName != ''" >
<xsl:if test="@FirstName != ''">
<xsl:text>, </xsl:text>
</xsl:if>
<xsl:value-of select="@FirstName" />
<xsl:if test="@AcademicTitle != ''" >
<xsl:if test="@AcademicTitle != ''">
<xsl:text> (</xsl:text>
<xsl:value-of select="@AcademicTitle" />
<xsl:text>)</xsl:text>
@ -415,13 +453,19 @@
<dc:date>
<xsl:choose>
<xsl:when test="PublishedDate">
<xsl:value-of select="PublishedDate/@Year"/>-<xsl:value-of select="format-number(PublishedDate/@Month,'00')"/>-<xsl:value-of select="format-number(PublishedDate/@Day,'00')"/>
<xsl:value-of select="PublishedDate/@Year"/>
- <xsl:value-of select="format-number(PublishedDate/@Month,'00')"/>
- <xsl:value-of select="format-number(PublishedDate/@Day,'00')"/>
</xsl:when>
<xsl:when test="CompletedDate">
<xsl:value-of select="CompletedDate/@Year"/>-<xsl:value-of select="format-number(CompletedDate/@Month,'00')"/>-<xsl:value-of select="format-number(CompletedDate/@Day,'00')"/>
<xsl:value-of select="CompletedDate/@Year"/>
- <xsl:value-of select="format-number(CompletedDate/@Month,'00')"/>
- <xsl:value-of select="format-number(CompletedDate/@Day,'00')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="ServerDatePublished/@Year"/>-<xsl:value-of select="format-number(ServerDatePublished/@Month,'00')"/>-<xsl:value-of select="format-number(ServerDatePublished/@Day,'00')"/>
<xsl:value-of select="ServerDatePublished/@Year"/>
- <xsl:value-of select="format-number(ServerDatePublished/@Month,'00')"/>
- <xsl:value-of select="format-number(ServerDatePublished/@Day,'00')"/>
</xsl:otherwise>
</xsl:choose>
</dc:date>
@ -430,12 +474,14 @@
<xsl:template match="EmbargoDate" mode="oai_dc">
<dc:date>
<xsl:text>info:eu-repo/date/embargoEnd/</xsl:text>
<xsl:value-of select="./@Year"/>-<xsl:value-of select="format-number(./@Month,'00')"/>-<xsl:value-of select="format-number(./@Day,'00')"/>
<xsl:value-of select="./@Year"/>
- <xsl:value-of select="format-number(./@Month,'00')"/>
- <xsl:value-of select="format-number(./@Day,'00')"/>
</dc:date>
</xsl:template>
<!-- für ListRecords -->
<!-- für ListRecords -->
<xsl:template match="@Type" mode="oai_dc">
<dc:type>
<xsl:value-of select="." />

View File

@ -88,7 +88,7 @@
<xsl:apply-templates select="TitleAbstract" mode="oai_datacite" />
</descriptions>
<geoLocations>
<xsl:apply-templates select="GeolocationBox" mode="oai_datacite" />
<xsl:apply-templates select="Coverage" mode="oai_datacite" />
<!-- <geoLocation>
<geoLocationBox>
<westBoundLongitude>6.58987</westBoundLongitude>
@ -101,7 +101,7 @@
</resource>
</xsl:template>
<xsl:template match="GeolocationBox" mode="oai_datacite">
<xsl:template match="Coverage" mode="oai_datacite">
<geoLocation>
<geoLocationBox>
<westBoundLongitude>

View File

@ -22,19 +22,26 @@ function initialState() {
value: "",
language: ""
},
geolocation: {
// geolocation: {
// xmin: "",
// ymin: "",
// xmax: "",
// ymax: ""
// },
coverage: {
xmin: "",
ymin: "",
xmax: "",
ymax: ""
},
coverage: {
ymax: "",
elevation_min: "",
elevation_max: "",
elevation_absolut: "",
depth_min: "",
depth_max: "",
depth_absolut: ""
depth_absolut: "",
time_min: "",
time_max: "",
time_absolut: ""
},
checkedAuthors: [],
checkedLicenses: [], // [],

View File

@ -63,6 +63,7 @@ const app = new Vue({
dataset: dataset,
elevation: "no_elevation",
depth: "no_depth",
time: "no_time",
// dataset: {
// type: '',
// state: '',
@ -143,6 +144,12 @@ const app = new Vue({
},
isDepthRange() {
return this.depth === "range";
},
isTimeAbsolut() {
return this.time === "absolut";
},
isTimeRange() {
return this.time === "range";
}
},
methods: {
@ -216,10 +223,13 @@ const app = new Vue({
formData.append('abstract_main[value]', this.dataset.abstract_main.value);
formData.append('abstract_main[language]', this.dataset.abstract_main.language);
formData.append('geolocation[xmin]', this.dataset.geolocation.xmin);
formData.append('geolocation[ymin]', this.dataset.geolocation.ymin);
formData.append('geolocation[xmax]', this.dataset.geolocation.xmax);
formData.append('geolocation[ymax]', this.dataset.geolocation.ymax);
if (this.dataset.coverage.xmin !== "" && this.dataset.coverage.ymin != '' &&
this.dataset.coverage.xmax !== '' && this.dataset.coverage.ymax !== '') {
formData.append('coverage[xmin]', this.dataset.coverage.xmin);
formData.append('coverage[ymin]', this.dataset.coverage.ymin);
formData.append('coverage[xmax]', this.dataset.coverage.xmax);
formData.append('coverage[ymax]', this.dataset.coverage.ymax);
}
if (this.isElevationAbsolut) {
formData.append('coverage[elevation_absolut]', this.dataset.coverage.elevation_absolut);
@ -235,7 +245,13 @@ const app = new Vue({
formData.append('coverage[depth_min]', this.dataset.coverage.depth_min);
formData.append('coverage[depth_max]', this.dataset.coverage.depth_max);
}
if (this.isTimeAbsolut) {
formData.append('coverage[time_absolut]', this.dataset.coverage.time_absolut);
}
else if (this.isTimeRange) {
formData.append('coverage[time_min]', this.dataset.coverage.time_min);
formData.append('coverage[time_max]', this.dataset.coverage.time_max);
}
for (var i = 0; i < this.dataset.checkedLicenses.length; i++) {

View File

@ -323,24 +323,24 @@
<legend>Geo Location</legend>
<div class="pure-g">
<div class="pure-u-1 pure-u-md-1 pure-u-lg-1 pure-div">
<locations-map v-bind:geolocation="dataset.geolocation"></locations-map>
<locations-map v-bind:geolocation="dataset.coverage"></locations-map>
</div>
<div class="pure-u-1 pure-u-md-1-2 pure-div">
{!! Form::label('xmin', 'xmin: ') !!}
{!! Form::text('xmin', null, ['class' => 'pure-u-23-24', 'v-model' => 'dataset.geolocation.xmin', 'readonly']) !!}
{!! Form::text('xmin', null, ['class' => 'pure-u-23-24', 'v-model' => 'dataset.coverage.xmin', 'readonly']) !!}
</div>
<div class="pure-u-1 pure-u-md-1-2 pure-div">
{!! Form::label('ymin', 'ymin: ') !!}
{!! Form::text('ymin', null, ['class' => 'pure-u-23-24', 'v-model' => 'dataset.geolocation.ymin', 'readonly']) !!}
{!! Form::text('ymin', null, ['class' => 'pure-u-23-24', 'v-model' => 'dataset.coverage.ymin', 'readonly']) !!}
</div>
<div class="pure-u-1 pure-u-md-1-2 pure-div">
{!! Form::label('xmax', 'xmax: ') !!}
{!! Form::text('xmax', null, ['class' => 'pure-u-23-24', 'v-model' => 'dataset.geolocation.xmax', 'readonly']) !!}
{!! Form::text('xmax', null, ['class' => 'pure-u-23-24', 'v-model' => 'dataset.coverage.xmax', 'readonly']) !!}
</div>
<div class="pure-u-1 pure-u-md-1-2 pure-div">
{!! Form::label('ymax', 'ymax: ') !!}
{!! Form::text('ymax', null, ['class' => 'pure-u-23-24', 'v-model' => 'dataset.geolocation.ymax', 'readonly']) !!}
{!! Form::text('ymax', null, ['class' => 'pure-u-23-24', 'v-model' => 'dataset.coverage.ymax', 'readonly']) !!}
</div>
</div>
</fieldset>
@ -364,57 +364,92 @@
no elevation
</label>
</div>
<div v-show="elevation === 'absolut'" class="pure-u-1 pure-u-md-1">
{!! Form::label('elevation_absolut', 'elevation absolut: ') !!}
{!! Form::text('elevation_absolut', null,
['class' => 'pure-u-23-24', 'v-model' => 'dataset.coverage.elevation_absolut', 'data-vv-scope' => 'step-2', "v-validate" => "this.isElevationAbsolut ? 'required|integer' : '' " ]) !!}
</div>
<div v-show="elevation === 'range'" class="pure-u-1 pure-u-md-1">
{!! Form::label('elevation_max', 'elevation max: ') !!}
{!! Form::text('elevation_max', null,
['class' => 'pure-u-23-24', 'v-model' => 'dataset.coverage.elevation_max', 'data-vv-scope' => 'step-2', "v-validate" => "this.isElevationRange ? 'required|integer' : '' "]) !!}
</div>
<div v-show="elevation === 'range'" class="pure-u-1 pure-u-md-1">
{!! Form::label('elevation_min', 'elevation min: ') !!}
{!! Form::text('elevation_min', null,
['class' => 'pure-u-23-24', 'v-model' => 'dataset.coverage.elevation_min', 'data-vv-scope' => 'step-2', "v-validate" => "this.isElevationRange ? 'required|integer' : '' "]) !!}
</div>
<div v-show="elevation === 'range'" class="pure-u-1 pure-u-md-1">
{!! Form::label('elevation_max', 'elevation max: ') !!}
{!! Form::text('elevation_max', null,
['class' => 'pure-u-23-24', 'v-model' => 'dataset.coverage.elevation_max', 'data-vv-scope' => 'step-2', "v-validate" => "this.isElevationRange ? 'required|integer' : '' "]) !!}
</div>
</div>
<div class="pure-u-1 pure-u-md-1-2">
<div class="pure-u-1 pure-u-md-1">
<label for="depth-option-one" class="pure-radio">
<input id="depth-option-one" type="radio" v-model="depth" value="absolut">
absolut depth
</label>
<label for="depth-option-two" class="pure-radio">
<input id="depth-option-two" type="radio" v-model="depth" value="range">
depth range
</label>
<label for="depth-option-three" class="pure-radio">
<input id="depth-option-three" type="radio" v-model="depth" value="no_depth">
no depth
</label>
</div>
<div v-show="depth === 'absolut'" class="pure-u-1 pure-u-md-1">
{!! Form::label('depth_absolut', 'depth absolut: ') !!}
{!! Form::text('depth_absolut', null,
['class' => 'pure-u-23-24', 'v-model' => 'dataset.coverage.depth_absolut', 'data-vv-scope' => 'step-2', "v-validate" => "this.isDepthAbsolut ? 'required|integer' : '' " ]) !!}
</div>
<div v-show="depth === 'range'" class="pure-u-1 pure-u-md-1">
{!! Form::label('depth_max', 'depth max: ') !!}
{!! Form::text('depth_max', null,
['class' => 'pure-u-23-24', 'v-model' => 'dataset.coverage.depth_max', 'data-vv-scope' => 'step-2', "v-validate" => "this.isDepthRange ? 'required|integer' : '' "]) !!}
</div>
<div v-show="depth === 'range'" class="pure-u-1 pure-u-md-1">
{!! Form::label('depth_min', 'depth min: ') !!}
{!! Form::text('depth_min', null,
['class' => 'pure-u-23-24', 'v-model' => 'dataset.coverage.depth_min', 'data-vv-scope' => 'step-2', "v-validate" => "this.isDepthRange ? 'required|integer' : '' "]) !!}
</div>
<div class="pure-u-1 pure-u-md-1">
<label for="depth-option-one" class="pure-radio">
<input id="depth-option-one" type="radio" v-model="depth" value="absolut">
absolut depth
</label>
<label for="depth-option-two" class="pure-radio">
<input id="depth-option-two" type="radio" v-model="depth" value="range">
depth range
</label>
<label for="depth-option-three" class="pure-radio">
<input id="depth-option-three" type="radio" v-model="depth" value="no_depth">
no depth
</label>
</div>
<div v-show="depth === 'absolut'" class="pure-u-1 pure-u-md-1">
{!! Form::label('depth_absolut', 'depth absolut: ') !!} {!! Form::text('depth_absolut', null, ['class' => 'pure-u-23-24',
'v-model' => 'dataset.coverage.depth_absolut', 'data-vv-scope' => 'step-2', "v-validate" => "this.isDepthAbsolut
? 'required|integer' : '' " ]) !!}
</div>
<div v-show="depth === 'range'" class="pure-u-1 pure-u-md-1">
{!! Form::label('depth_min', 'depth min: ') !!} {!! Form::text('depth_min', null, ['class' => 'pure-u-23-24', 'v-model' =>
'dataset.coverage.depth_min', 'data-vv-scope' => 'step-2', "v-validate" => "this.isDepthRange ? 'required|integer'
: '' "]) !!}
</div>
<div v-show="depth === 'range'" class="pure-u-1 pure-u-md-1">
{!! Form::label('depth_max', 'depth max: ') !!} {!! Form::text('depth_max', null, ['class' => 'pure-u-23-24', 'v-model' =>
'dataset.coverage.depth_max', 'data-vv-scope' => 'step-2', "v-validate" => "this.isDepthRange ? 'required|integer'
: '' "]) !!}
</div>
</div>
<div class="pure-u-1 pure-u-md-1-2">
<div class="pure-u-1 pure-u-md-1">
<label for="time-option-one" class="pure-radio">
<input id="time-option-one" type="radio" v-model="time" value="absolut">
absolut time
</label>
<label for="time-option-two" class="pure-radio">
<input id="time-option-two" type="radio" v-model="time" value="range">
time range
</label>
<label for="time-option-three" class="pure-radio">
<input id="time-option-three" type="radio" v-model="time" value="no_time">
no time
</label>
</div>
<div v-show="time === 'absolut'" class="pure-u-1 pure-u-md-1">
{!! Form::label('time_absolut', 'time absolut: ') !!}
{!! Form::date('time_absolut', null, ['class' => 'pure-u-23-24',
'v-model' => 'dataset.coverage.time_absolut', 'data-vv-scope' => 'step-2',
"v-validate" => "this.isTimeAbsolut ? 'required' : '' " ]) !!}
</div>
<div v-show="time === 'range'" class="pure-u-1 pure-u-md-1">
{!! Form::label('time_min', 'time min: ') !!}
{!! Form::date('time_min', null, ['class' => 'pure-u-23-24',
'v-model' => 'dataset.coverage.time_min', 'data-vv-scope' => 'step-2',
"v-validate" => "this.isTimeRange ? 'required' : '' "]) !!}
</div>
<div v-show="time === 'range'" class="pure-u-1 pure-u-md-1">
{!! Form::label('timemax', 'time max: ') !!}
{!! Form::date('time_max', null, ['class' => 'pure-u-23-24',
'v-model' => 'dataset.coverage.time_max', 'data-vv-scope' => 'step-2',
"v-validate" => "this.isTimeRange ? 'required' : '' "]) !!}
</div>
</div>
</div>
</fieldset>