Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 7b8377f6 authored by Roberto Di Cosmo's avatar Roberto Di Cosmo
Browse files

Added constraints for mandatory fields in the software family entry types

parent 7b018b46
No related branches found
No related tags found
No related merge requests found
......@@ -7,11 +7,12 @@
\begin{filecontents*}{english-software.lbx}
\ProvidesFile{english-software.lbx}[2020/04/02 english with additions for software]
\InheritBibliographyExtras{english}
\NewBibliographyString{software,edited,swmodule,swversion,swexcerpt,refart,manual}
\NewBibliographyString{software,edited,swmodule,swpartof,swversion,swexcerpt,refart,manual}
\DeclareBibliographyStrings{%
inherit = {english},
software = {{[Software]}{[Software]}},
swmodule = {{[Software Module]}{[Software Module]}},
swpartof = {{part of}}{{part of}},
swversion = {{[Software Release]}{[Software Release]}},
swexcerpt = {{[Software excerpt]}{[Software excerpt]}},
edited = {{Coordinated by}{Coordinated by}},
......@@ -22,11 +23,12 @@
\begin{filecontents*}{french-software.lbx}
\ProvidesFile{french-software.lbx}[2020/04/02 french with additions for software]
\InheritBibliographyExtras{french}
\NewBibliographyString{software,edited,swmodule,swversion,swexcerpt,refart,manual}
\NewBibliographyString{software,edited,swmodule,swpartof,swversion,swexcerpt,refart,manual}
\DeclareBibliographyStrings{%
inherit = {french},
software = {{[Logiciel]}{[Logiciel]}},
swmodule = {{[Module logiciel]}{[Module logiciel]}},
swpartof = {{partie de}}{{partie de}},
swversion = {{[Version de logiciel]}{[Version de logiciel]}},
swexcerpt = {{[Fragment logiciel]}{[Fragment logiciel]}},
edited = {{Coordonn\'e par}{Coordonn\'e par}},
......@@ -65,6 +67,10 @@
hal_id,
swhid,
}
%
% Fields for software entry
%
\DeclareDatamodelEntryfields[software]{
abstract,
author,
......@@ -89,6 +95,21 @@
version,
year,
}
\DeclareDatamodelConstraints[software]{
\constraint[type=mandatory]{
\constraintfieldsor{
\constraintfield{author}
\constraintfield{editor}
}
\constraintfield{title}
\constraintfield{url}
\constraintfield{year}
}
}
%
% Fields for softwareversion entry
%
\DeclareDatamodelEntryfields[softwareversion]{
abstract,
author,
......@@ -117,6 +138,22 @@
version,
year,
}
\DeclareDatamodelConstraints[softwareversion]{
\constraint[type=mandatory]{
\constraintfieldsor{
\constraintfield{author}
\constraintfield{editor}
}
\constraintfield{title}
\constraintfield{url}
\constraintfield{version}
\constraintfield{year}
}
}
%
% Fields for softwaremodule entry
%
\DeclareDatamodelEntryfields[softwaremodule]{
abstract,
author,
......@@ -145,6 +182,18 @@
version~
year,
}
\DeclareDatamodelConstraints[softwaremodule]{
\constraint[type=mandatory]{
\constraintfield{author}
\constraintfield{subtitle}
\constraintfield{url}
\constraintfield{year}
}
}
%
% Fields for codefragment entry
%
\DeclareDatamodelEntryfields[codefragment]{
abstract,
author,
......@@ -172,12 +221,17 @@
version,
year,
}
\DeclareDatamodelConstraints[codefragment]{
\constraint[type=mandatory]{
\constraintfield{url}
}
}
%
% Formatting fields
%
% \DeclareFieldFormat[software]{title}{\mkbibquote{#1\isdot}}
\DeclareFieldFormat[softwaremodule,codefragment]{subtitle}{\mkbibquote{#1\isdot}}
\DeclareFieldFormat[software]{url}{
{\sc url: }\ifhyperref
{\href{#1}{\nolinkurl{#1}}}
......@@ -198,16 +252,41 @@
%
% Macros to format output
%
\newbibmacro*{swtitlenameauthoreditoryear}{%
\newbibmacro*{swtitleauthoreditoryear}{%
\printnames{author},%
\setunit{\addspace}%
\iffieldundef{subtitle}%
{}%
{\printfield{subtitle}%
\addspace%
{\printfield{title}\addspace}%
{\iffieldundef{title}%
{\printfield{subtitle}\addspace}%
{\printfield{subtitle}\addcomma\addspace%
\bibstring{swpartof}\addspace%
\printfield{title}%
}
}%
\printfield{title}%
\ifnameundef{editor}%
{}
{\printtext[parens]{%
\bibstring{edited}%
\setunit{\addspace}%
\printnames{editor}}}%
\setunit{\addspace}%
\addcomma%
\printfield{year}%
}
\newbibmacro*{swtitleauthoreditoryear}{%
\printnames{author},%
\setunit{\addspace}%
\iffieldundef{subtitle}%
{\printfield{title}\addspace}%
{\iffieldundef{title}%
{\printfield{subtitle}\addspace}%
{\printfield{subtitle}\addcomma\addspace%
\bibstring{swpartof}\addspace%
\printfield{title}%
}
}%
\ifnameundef{editor}%
{}
{\printtext[parens]{%
......@@ -219,6 +298,7 @@
\printfield{year}%
}
\newbibmacro*{swids}{%
\iffieldundef{doi}%
{}%
......@@ -249,7 +329,7 @@
\usebibmacro{begentry}%
\bibstring{software}%
\setunit{\addspace}%
\usebibmacro{swtitlenameauthoreditoryear}%
\usebibmacro{swtitleauthoreditoryear}%
\newunit\newblock
\usebibmacro{swids}%
\newunit\newblock
......@@ -261,7 +341,7 @@
\usebibmacro{begentry}%
\bibstring{swversion}%
\setunit{\addspace}%
\usebibmacro{swtitlenameauthoreditoryear}%
\usebibmacro{swtitleauthoreditoryear}%
\newunit\newblock
\usebibmacro{swids}%
\newunit\newblock
......@@ -273,7 +353,7 @@
\usebibmacro{begentry}%
\bibstring{swmodule}%
\setunit{\addspace}%
\usebibmacro{swtitlenameauthoreditoryear}%
\usebibmacro{swtitleauthoreditoryear}%
\newunit\newblock
\usebibmacro{swids}%
\newunit\newblock
......@@ -285,7 +365,7 @@
\usebibmacro{begentry}%
\bibstring{swexcerpt}%
\setunit{\addspace}%
\usebibmacro{swtitlenameauthoreditoryear}%
\usebibmacro{swtitleauthoreditoryear}%
\newunit\newblock
\usebibmacro{swids}%
\newunit\newblock
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment