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'])) { // if (isset($data['geolocation'])) {
$formGeolocation = $request->input('geolocation'); // $formGeolocation = $request->input('geolocation');
if ($formGeolocation['xmin'] !== null && $formGeolocation['ymin'] !== null && // if ($formGeolocation['xmin'] !== null && $formGeolocation['ymin'] !== null &&
$formGeolocation['xmax'] !== null && $formGeolocation['ymax'] !== null) { // $formGeolocation['xmax'] !== null && $formGeolocation['ymax'] !== null) {
$geolocation = new GeolocationBox($formGeolocation); // $geolocation = new GeolocationBox($formGeolocation);
$dataset->geolocation()->save($geolocation); // $dataset->geolocation()->save($geolocation);
//$geolocation->dataset()->associate($dataset)->save(); // //$geolocation->dataset()->associate($dataset)->save();
} // }
} // }
if (isset($data['coverage'])) { if (isset($data['coverage'])) {
$formCoverage = $request->input('coverage'); $formCoverage = $request->input('coverage');

View File

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

View File

@ -4,6 +4,7 @@ namespace App\Library\Search;
use App\Models\Dataset; use App\Models\Dataset;
use Solarium\QueryType\Update\Query\Document\Document; use Solarium\QueryType\Update\Query\Document\Document;
use Solarium\QueryType\Update\Query\Document\DocumentInterface;
class SolariumDocument extends SolrDocumentXslt class SolariumDocument extends SolrDocumentXslt
{ {
@ -12,7 +13,7 @@ class SolariumDocument extends SolrDocumentXslt
parent::__construct($options); parent::__construct($options);
} }
public function toSolrUpdateDocument(Dataset $rdrDataset, Document $solrDoc) public function toSolrUpdateDocument(Dataset $rdrDataset, DocumentInterface $solrDoc)
{ {
if (!($solrDoc instanceof Document)) { if (!($solrDoc instanceof Document)) {
throw new \Exception('provided Solr document must be instance of Solarium Update 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\Person;
use App\Models\File; use App\Models\File;
use App\Models\GeolocationBox; use App\Models\GeolocationBox;
use App\Models\Coverage;
use App\Models\Subject; use App\Models\Subject;
/** /**
@ -64,9 +65,14 @@ trait DatasetExtension
'relation' => 'files', 'relation' => 'files',
'fetch' => 'eager' 'fetch' => 'eager'
), ),
'GeolocationBox' => array( // 'GeolocationBox' => array(
'model' => GeolocationBox::class, // 'model' => GeolocationBox::class,
'relation' => 'geolocation', // 'relation' => 'geolocation',
// 'fetch' => 'eager'
// ),
'Coverage' => array(
'model' => Coverage::class,
'relation' => 'coverage',
'fetch' => 'eager' 'fetch' => 'eager'
), ),
); );

View File

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

View File

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

100
composer.lock generated
View File

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

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,6 @@
xmlns="http://www.openarchives.org/OAI/2.0/" xmlns="http://www.openarchives.org/OAI/2.0/"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/"
xmlns:php="http://php.net/xsl"> xmlns:php="http://php.net/xsl">
@ -49,8 +48,8 @@
<xsl:text>type="text/xsl" href="xsl/oai2_style.xslt"</xsl:text> <xsl:text>type="text/xsl" href="xsl/oai2_style.xslt"</xsl:text>
</xsl:processing-instruction> </xsl:processing-instruction>
<OAI-PMH xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.openarchives.org/OAI/2.0/" <OAI-PMH xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd"> 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> <responseDate>
<xsl:value-of select="$responseDate" /> <xsl:value-of select="$responseDate" />
</responseDate> </responseDate>
@ -126,8 +125,7 @@
<xsl:text>YYYY-MM-DD</xsl:text> <xsl:text>YYYY-MM-DD</xsl:text>
</granularity> </granularity>
<description> <description>
<oai-identifier xmlns="http://www.openarchives.org/OAI/2.0/oai-identifier" <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">
xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai-identifier http://www.openarchives.org/OAI/2.0/oai-identifier.xsd">
<scheme> <scheme>
<xsl:text>oai</xsl:text> <xsl:text>oai</xsl:text>
</scheme> </scheme>
@ -182,8 +180,12 @@
<xsl:template match="Rdr_Sets"> <xsl:template match="Rdr_Sets">
<set> <set>
<setSpec><xsl:value-of select="@Type"/></setSpec> <setSpec>
<setName><xsl:value-of select="@TypeName"/></setName> <xsl:value-of select="@Type"/>
</setSpec>
<setName>
<xsl:value-of select="@TypeName"/>
</setName>
</set> </set>
</xsl:template> </xsl:template>
@ -215,9 +217,15 @@
<xsl:apply-templates select="Rdr_Dataset" /> <xsl:apply-templates select="Rdr_Dataset" />
<xsl:if test="$totalIds > 0"> <xsl:if test="$totalIds > 0">
<resumptionToken> <resumptionToken>
<xsl:attribute name="expirationDate"><xsl:value-of select="$dateDelete"/></xsl:attribute> <xsl:attribute name="expirationDate">
<xsl:attribute name="completeListSize"><xsl:value-of select="$totalIds"/></xsl:attribute> <xsl:value-of select="$dateDelete"/>
<xsl:attribute name="cursor"><xsl:value-of select="$cursor"/></xsl:attribute> </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:value-of select="$res"/>
</resumptionToken> </resumptionToken>
</xsl:if> </xsl:if>
@ -260,13 +268,17 @@
<datestamp> <datestamp>
<xsl:choose> <xsl:choose>
<xsl:when test="ServerDateModified"> <xsl:when test="ServerDateModified">
<xsl:value-of select="ServerDateModified/@Year"/>- <xsl:value-of select="ServerDateModified/@Year"/>
<xsl:value-of select="format-number(ServerDateModified/@Month,'00')"/>- -
<xsl:value-of select="format-number(ServerDateModified/@Month,'00')"/>
-
<xsl:value-of select="format-number(ServerDateModified/@Day,'00')"/> <xsl:value-of select="format-number(ServerDateModified/@Day,'00')"/>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:value-of select="ServerDatePublished/@Year"/>- <xsl:value-of select="ServerDatePublished/@Year"/>
<xsl:value-of select="format-number(ServerDatePublished/@Month,'00')"/>- -
<xsl:value-of select="format-number(ServerDatePublished/@Month,'00')"/>
-
<xsl:value-of select="format-number(ServerDatePublished/@Day,'00')"/> <xsl:value-of select="format-number(ServerDatePublished/@Day,'00')"/>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
@ -340,18 +352,44 @@
<!-- dc:rights --> <!-- dc:rights -->
<xsl:apply-templates select="Licence" mode="oai_dc" /> <xsl:apply-templates select="Licence" mode="oai_dc" />
<!-- dc:coverage --> <!-- dc:coverage -->
<xsl:apply-templates select="GeolocationBox" mode="oai_dc" /> <xsl:apply-templates select="Coverage" mode="oai_dc" />
</oai_dc:dc> </oai_dc:dc>
</xsl:template> </xsl:template>
<xsl:template match="GeolocationBox" mode="oai_dc"> <xsl:template match="Coverage" mode="oai_dc">
<dc:coverage> <dc:coverage>
<xsl:value-of select="concat( <xsl:variable name="geolocation" select="concat(
'SOUTH-BOUND LATITUDE: ', @Xmin, 'SOUTH-BOUND LATITUDE: ', @Xmin,
' * WEST-BOUND LONGITUDE: ', @Ymin, ' * WEST-BOUND LONGITUDE: ', @Ymin,
' * NORTH-BOUND LATITUDE: ', @Xmax, ' * NORTH-BOUND LATITUDE: ', @Xmax,
' * EAST-BOUND LONGITUDE: ', @Ymax ' * 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> </dc:coverage>
</xsl:template> </xsl:template>
@ -415,13 +453,19 @@
<dc:date> <dc:date>
<xsl:choose> <xsl:choose>
<xsl:when test="PublishedDate"> <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>
<xsl:when test="CompletedDate"> <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:when>
<xsl:otherwise> <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:otherwise>
</xsl:choose> </xsl:choose>
</dc:date> </dc:date>
@ -430,7 +474,9 @@
<xsl:template match="EmbargoDate" mode="oai_dc"> <xsl:template match="EmbargoDate" mode="oai_dc">
<dc:date> <dc:date>
<xsl:text>info:eu-repo/date/embargoEnd/</xsl:text> <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> </dc:date>
</xsl:template> </xsl:template>

View File

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

View File

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

View File

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

View File

@ -323,24 +323,24 @@
<legend>Geo Location</legend> <legend>Geo Location</legend>
<div class="pure-g"> <div class="pure-g">
<div class="pure-u-1 pure-u-md-1 pure-u-lg-1 pure-div"> <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>
<div class="pure-u-1 pure-u-md-1-2 pure-div"> <div class="pure-u-1 pure-u-md-1-2 pure-div">
{!! Form::label('xmin', 'xmin: ') !!} {!! 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>
<div class="pure-u-1 pure-u-md-1-2 pure-div"> <div class="pure-u-1 pure-u-md-1-2 pure-div">
{!! Form::label('ymin', 'ymin: ') !!} {!! 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>
<div class="pure-u-1 pure-u-md-1-2 pure-div"> <div class="pure-u-1 pure-u-md-1-2 pure-div">
{!! Form::label('xmax', 'xmax: ') !!} {!! 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>
<div class="pure-u-1 pure-u-md-1-2 pure-div"> <div class="pure-u-1 pure-u-md-1-2 pure-div">
{!! Form::label('ymax', 'ymax: ') !!} {!! 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>
</div> </div>
</fieldset> </fieldset>
@ -364,22 +364,21 @@
no elevation no elevation
</label> </label>
</div> </div>
<div v-show="elevation === 'absolut'" class="pure-u-1 pure-u-md-1"> <div v-show="elevation === 'absolut'" class="pure-u-1 pure-u-md-1">
{!! Form::label('elevation_absolut', 'elevation absolut: ') !!} {!! Form::label('elevation_absolut', 'elevation absolut: ') !!}
{!! Form::text('elevation_absolut', null, {!! 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' : '' " ]) !!} ['class' => 'pure-u-23-24', 'v-model' => 'dataset.coverage.elevation_absolut', 'data-vv-scope' => 'step-2', "v-validate" => "this.isElevationAbsolut ? 'required|integer' : '' " ]) !!}
</div> </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"> <div v-show="elevation === 'range'" class="pure-u-1 pure-u-md-1">
{!! Form::label('elevation_min', 'elevation min: ') !!} {!! Form::label('elevation_min', 'elevation min: ') !!}
{!! Form::text('elevation_min', null, {!! 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' : '' "]) !!} ['class' => 'pure-u-23-24', 'v-model' => 'dataset.coverage.elevation_min', 'data-vv-scope' => 'step-2', "v-validate" => "this.isElevationRange ? 'required|integer' : '' "]) !!}
</div> </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>
<div class="pure-u-1 pure-u-md-1-2"> <div class="pure-u-1 pure-u-md-1-2">
@ -399,19 +398,55 @@
</div> </div>
<div v-show="depth === 'absolut'" class="pure-u-1 pure-u-md-1"> <div v-show="depth === 'absolut'" class="pure-u-1 pure-u-md-1">
{!! Form::label('depth_absolut', 'depth absolut: ') !!} {!! Form::label('depth_absolut', 'depth absolut: ') !!} {!! Form::text('depth_absolut', null, ['class' => 'pure-u-23-24',
{!! Form::text('depth_absolut', null, 'v-model' => 'dataset.coverage.depth_absolut', 'data-vv-scope' => 'step-2', "v-validate" => "this.isDepthAbsolut
['class' => 'pure-u-23-24', 'v-model' => 'dataset.coverage.depth_absolut', 'data-vv-scope' => 'step-2', "v-validate" => "this.isDepthAbsolut ? 'required|integer' : '' " ]) !!} ? 'required|integer' : '' " ]) !!}
</div> </div>
<div v-show="depth === 'range'" class="pure-u-1 pure-u-md-1"> <div v-show="depth === 'range'" class="pure-u-1 pure-u-md-1">
{!! Form::label('depth_max', 'depth max: ') !!} {!! Form::label('depth_min', 'depth min: ') !!} {!! Form::text('depth_min', null, ['class' => 'pure-u-23-24', 'v-model' =>
{!! Form::text('depth_max', null, 'dataset.coverage.depth_min', 'data-vv-scope' => 'step-2', "v-validate" => "this.isDepthRange ? 'required|integer'
['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 v-show="depth === 'range'" class="pure-u-1 pure-u-md-1"> <div v-show="depth === 'range'" class="pure-u-1 pure-u-md-1">
{!! Form::label('depth_min', 'depth min: ') !!} {!! Form::label('depth_max', 'depth max: ') !!} {!! Form::text('depth_max', null, ['class' => 'pure-u-23-24', 'v-model' =>
{!! Form::text('depth_min', null, 'dataset.coverage.depth_max', 'data-vv-scope' => 'step-2', "v-validate" => "this.isDepthRange ? 'required|integer'
['class' => 'pure-u-23-24', 'v-model' => 'dataset.coverage.depth_min', '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> </div>