- doi url for dc:identifier

- readonly keywords with id for editor and submitter for edit forms
This commit is contained in:
Arno Kaimbacher 2021-06-10 16:15:01 +02:00
parent d80a8ab3f4
commit 28a38da865
6 changed files with 38 additions and 16 deletions

View File

@ -125,6 +125,7 @@ class RequestController extends Controller
$this->proc->setParameter('', 'baseURL', url('/') . $uri[0]); $this->proc->setParameter('', 'baseURL', url('/') . $uri[0]);
$this->proc->setParameter('', 'repURL', url('/')); $this->proc->setParameter('', 'repURL', url('/'));
$this->proc->setParameter('', 'downloadLink', url('/') . '/file/download/'); $this->proc->setParameter('', 'downloadLink', url('/') . '/file/download/');
$this->proc->setParameter('', 'doiLink', 'https://doi.org/');
// $resumptionPath = $this->configuration->getResumptionTokenPath(); // $resumptionPath = $this->configuration->getResumptionTokenPath();

View File

@ -386,15 +386,21 @@ class EditorController extends Controller
if (is_array($keywords) && count($keywords) > 0) { if (is_array($keywords) && count($keywords) > 0) {
foreach ($keywords as $key => $formKeyword) { foreach ($keywords as $key => $formKeyword) {
if (isset($formKeyword['id'])) { if (isset($formKeyword['id'])) {
// is readonly
$subject = Subject::findOrFail($formKeyword['id']); $subject = Subject::findOrFail($formKeyword['id']);
$subject->value = $formKeyword['value']; // $subject->value = $formKeyword['value'];
$subject->type = $formKeyword['type']; // $subject->type = $formKeyword['type'];
if ($subject->isDirty()) { // if ($subject->isDirty()) {
$subject->save(); // $subject->save();
} // }
} else { } else {
$subject = new Subject($formKeyword); // $subject = new Subject($formKeyword);
$dataset->subjects()->save($subject); // $dataset->subjects()->save($subject);
$keyword = Subject::firstOrCreate(
['value' => $formKeyword['value'], 'language' => $formKeyword['language']],
$formKeyword
);
$dataset->subjects()->attach($keyword);
} }
} }
} }

View File

@ -317,14 +317,19 @@ class SubmitController extends Controller
foreach ($keywords as $key => $formKeyword) { foreach ($keywords as $key => $formKeyword) {
if (isset($formKeyword['id'])) { if (isset($formKeyword['id'])) {
$subject = Subject::findOrFail($formKeyword['id']); $subject = Subject::findOrFail($formKeyword['id']);
$subject->value = $formKeyword['value']; // $subject->value = $formKeyword['value'];
$subject->type = $formKeyword['type']; // $subject->type = $formKeyword['type'];
if ($subject->isDirty()) { // if ($subject->isDirty()) {
$subject->save(); // $subject->save();
} // }
} else { } else {
$subject = new Subject($formKeyword); // $subject = new Subject($formKeyword);
$dataset->subjects()->save($subject); // $dataset->subjects()->save($subject);
$keyword = Subject::firstOrCreate(
['value' => $formKeyword['value'], 'language' => $formKeyword['language']],
$formKeyword
);
$dataset->subjects()->attach($keyword);
} }
} }
} }

View File

@ -24,6 +24,7 @@
<xsl:param name="repositoryName" /> <xsl:param name="repositoryName" />
<xsl:param name="repIdentifier" /> <xsl:param name="repIdentifier" />
<xsl:param name="downloadLink" /> <xsl:param name="downloadLink" />
<xsl:param name="doiLink" />
<xsl:param name="sampleIdentifier" /> <xsl:param name="sampleIdentifier" />
<xsl:param name="docId" /> <xsl:param name="docId" />
<xsl:param name="dateDelete" /> <xsl:param name="dateDelete" />
@ -370,6 +371,9 @@
<!-- <dc:format> --> <!-- <dc:format> -->
<xsl:apply-templates select="File" mode="oai_dc" /> <xsl:apply-templates select="File" mode="oai_dc" />
<!-- dc:identifier --> <!-- dc:identifier -->
<xsl:if test="Identifier">
<xsl:apply-templates select="Identifier" mode="oai_dc" />
</xsl:if>
<dc:identifier> <dc:identifier>
<xsl:value-of select="@landingpage"/> <xsl:value-of select="@landingpage"/>
</dc:identifier> </dc:identifier>
@ -561,6 +565,12 @@
</dc:identifier> </dc:identifier>
</xsl:template> </xsl:template>
<xsl:template match="Identifier" mode="oai_dc">
<dc:identifier>
<xsl:value-of select="concat($doiLink, @Value)" />
</dc:identifier>
</xsl:template>
<xsl:template match="@CreatingCorporation" mode="oai_dc"> <xsl:template match="@CreatingCorporation" mode="oai_dc">
<dc:language> <dc:language>
<xsl:value-of select="." /> <xsl:value-of select="." />

View File

@ -546,7 +546,7 @@
<td> <td>
<input v-bind:name="'subjects[' + index +'][id]'" readonly class="form-control" v-model="item.id" hidden /> <input v-bind:name="'subjects[' + index +'][id]'" readonly class="form-control" v-model="item.id" hidden />
<input v-bind:name="'subjects[' + index +'][value]'" class="form-control" <input v-bind:name="'subjects[' + index +'][value]'" :readonly="item.id != undefined" class="form-control"
placeholder="[KEYWORD VALUE]" v-model="item.value" v-validate="'required'" /> placeholder="[KEYWORD VALUE]" v-model="item.value" v-validate="'required'" />
{{-- {{ Form::text('keywords['.$keyword->id.'][value]', $keyword->value, ['class' => 'form-control', 'placeholder' => '[KEYWORD VALUE]']) }} {{-- {{ Form::text('keywords['.$keyword->id.'][value]', $keyword->value, ['class' => 'form-control', 'placeholder' => '[KEYWORD VALUE]']) }}
--}} --}}

View File

@ -542,7 +542,7 @@
<td> <td>
<input v-bind:name="'subjects[' + index +'][id]'" readonly class="form-control" v-model="item.id" hidden /> <input v-bind:name="'subjects[' + index +'][id]'" readonly class="form-control" v-model="item.id" hidden />
<input v-bind:name="'subjects[' + index +'][value]'" class="form-control" <input v-bind:name="'subjects[' + index +'][value]'" :readonly="item.id != undefined" class="form-control"
placeholder="[KEYWORD VALUE]" v-model="item.value" v-validate="'required'" /> placeholder="[KEYWORD VALUE]" v-model="item.value" v-validate="'required'" />
{{-- {{ Form::text('keywords['.$keyword->id.'][value]', $keyword->value, ['class' => 'form-control', 'placeholder' => '[KEYWORD VALUE]']) }} {{-- {{ Form::text('keywords['.$keyword->id.'][value]', $keyword->value, ['class' => 'form-control', 'placeholder' => '[KEYWORD VALUE]']) }}
--}} --}}