Template:PublicationCheck

From Pestinfo-Wiki
Jump to: navigation, search

Template for checking the data in the Publication form. The template takes 18 parameters (some of which may be blank):

|1= 
The 'Year or date' field (this field is always required).
|2= 
The 'Journal or series' field.
|3= 
The 'Volume (issue)' field.
|4= 
The 'First page' field.
|5= 
The 'Last page' field.
|6= 
The 'Note' field.
|7= 
The 'URL' field.
|8= 
The 'DOI number' field.
|9= 
The 'Author page(s)' field.
|10= 
The 'Research topic (pests)' field.
|11= 
The '2nd Research topic (pests)' field.
|12= 
The 'Research topic (beneficials)' field.
|13= 
The '2nd Research topic (beneficials)' field.
|14= 
The 'Authors' field.
|15= 
The 'Abstract' field.
|16= 
The 'Is book' field.
|17= 
The 'SelArticle' field.
|18= 
The 'Image' field.

Technical Documentation

The following checks are provided with the above parameters depending on which parameters provided:

  • Checking the year or publication date format (parameter 1). This should be at least 4 digits, between 1700 and current year. -> Template:CheckYear
  • Is the format of the Volume (issue) field (parameter 3) optimal for the journal (parameter 2) used? -> Template:CheckVolume
  • Is the first page (parameter 4) larger than the last page (parameter 5)? -> Template:CheckPages1
  • Is the last page (parameter 5) provided while the first page (parameter 4) is missing? -> Template:CheckPages3
  • If no journal is provided, has the 'Note' field been completed? -> Template:CheckNote
  • Checking the URL field, parameter 7 (does it start with 'http://'? -> Template:CheckURL
  • Checking the DOI field, parameter 8 (does it start with '10.'? -> Template:CheckDOI
  • Checking the Author page(s) field (parameter 9) for the signs (;) and (:), as well as the word 'and'. -> Template:CheckAuthors2
  • Checking the research topic fields (parameters 10 to 13). -> Template:CheckResearchTopics
  • Checking the author's field (parameter 14) for the signs (;) and (:). -> Template:CheckAuthors3
  • Generates an information box if no abstract (parameter 15) has been provided. -> Template:CheckAbstract
  • Generates an information box if the 'Is book' parameter (16) is set to Yes, but the 'Journal or series' field is not blank. -> Template:CheckBook
  • Generates an information box if the 'SelArticle' parameter (17) is set. -> Template:SelectedArticle

The template should be called as:

{{PublicationCheck
|1=<!-- Year or date -->
|2=<!-- Journal or series -->
|3=<!-- Volume (issue) -->
|4=<!-- First page -->
|5=<!-- Last page -->
|6=<!-- Note -->
|7=<!-- URL -->
|8=<!-- DOI number -->
|9=<!-- Author page(s) -->
|10=<!-- Research topic (pests) -->
|11=<!-- 2nd Research topic (pests) -->
|12=<!-- Research topic (beneficials) -->
|13=<!-- 2nd Research topic (beneficials) -->
|14=<!-- Authors -->
|15=<!-- Abstract -->
|16=<!-- Is book -->
|17=<!-- SelArticle -->
|18=<!-- Image -->
}}

Depending on the analyses the template can produce message boxes indicating errors, warnings and or other information presented by:

The template has the following structure:

1. Defining the variables "Error", "Warning" and "Info"
{{#vardefine:Error|}}{{#vardefine:Warning|}}{{#vardefine:Info|}}
2. Check the year (parameter 1)
{{#vardefine:Error|
   {{CheckYear|{{#var:Error}}|{{{1}}} }}
}}
3. Check whether the first page (parameter 4)
   is smaller than the last page (parameter 5)
{{#if:{{{4}}}|
   {{#if:{{{5}}}|
      {{#vardefine:Error|
         {{CheckPages1|{{#var:Error}}|{{{4}}}|{{{5}}} }}
      }}
   }}
}}
4. Check whether the last page (parameter 5) is provided 
   while the first page (parameter 4) is missing
{{#vardefine:Error|
   {{CheckPages3|{{#var:Error}}|{{{4}}}|{{{5}}} }}
}}
5. Check the string for the authors pages (parameter 9)
{{#if:{{{9}}}|
   {{#vardefine:Error|
      {{CheckAuthors2|{{#var:Error}}|{{{9}}} }}
   }}
}}
6. Check the URL string (parameter 7)
{{#if:{{{7}}}|
   {{#vardefine:Error|
      {{CheckURL|{{#var:Error}}|{{{7}}} }}
   }}
}}
7. Check the DOI string (parameter 8)
{{#if:{{{8}}}|
   {{#vardefine:Error|
      {{CheckDOI|{{#var:Error}}|{{{8}}} }}
   }}
}}
8. Check the strings Volume (issue) (parameter 3) and journal (parameter 2) 
{{#if:{{{2}}}|
   {{#vardefine:Info|
      {{CheckVolume|{{#var:Info}}|{{{2}}}|{{{3}}} }}
   }}
}}
9. Check that a note (parameter 6) is provided for articles
   without journals (parameter 2)
{{#vardefine:Warning|
   {{CheckNote|{{#var:Warning}}|{{{6}}}|{{{2}}} }}
}}
10. Check that at least 1 research topic is provided (parameters 10 to 13)
{{#vardefine:Warning|
   {{CheckResearchTopics|{{#var:Warning}}|{{{10}}}|{{{11}}}|{{{12}}}|{{{13}}} }}
}}
11. Check authors (parameter 14)
{{#vardefine:Info|{{CheckAuthors3|{{#var:Info}}|{{{14}}} }} }}
12. Check for the abstract (parameter 15)
{{#vardefine:Info|{{CheckAbstract|{{#var:Info}}|{{{15}}} }} }}
13. Check 'Is book' (parameter 16)
{{#vardefine:Info|{{CheckBook|{{#var:Info}}|{{{16}}}|{{{2}}} }} }}
14. Print an error box
{{#if:{{#var:Error}}|
   {{ErrorBox|{{#var:Error}} }}
}}
15. Print a warning box
{{#if:{{#var:Warning}}|
   {{WarningBox|{{#var:Warning}} }}
}}
16. Print an information box
{{#if:{{#var:Info}}|
   {{InformationBox|{{#var:Info}} }}
}}
17. Print a box for selected articles and assignment to properties <SelArticle> and <image>
{{#if:{{{17}}}|{{SelectedArticle}}[[SelArticle::{{{17}}}|]]{{#if:{{{18}}}|[[Image::{{{18}}}|]]}}}}

Dependencies