Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Genesys Backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
46
Issues
46
List
Boards
Labels
Service Desk
Milestones
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Genesys PGR
Genesys Backend
Commits
0af852b0
Commit
0af852b0
authored
Mar 23, 2016
by
Matija Obreza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added /c/ to list all crops and included CROPNAME in Excel MCPD export
parent
459a51bf
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
80 additions
and
23 deletions
+80
-23
src/main/asciidoc/sections/api-accession.adoc
src/main/asciidoc/sections/api-accession.adoc
+1
-0
src/main/asciidoc/sections/mcpd.adoc
src/main/asciidoc/sections/mcpd.adoc
+19
-1
src/main/java/org/genesys2/server/service/impl/CropServiceImpl.java
...ava/org/genesys2/server/service/impl/CropServiceImpl.java
+6
-1
src/main/java/org/genesys2/server/service/impl/DownloadServiceImpl.java
...org/genesys2/server/service/impl/DownloadServiceImpl.java
+2
-13
src/main/java/org/genesys2/server/servlet/controller/CropController.java
...rg/genesys2/server/servlet/controller/CropController.java
+19
-8
src/main/webapp/WEB-INF/jsp/crop/list.jsp
src/main/webapp/WEB-INF/jsp/crop/list.jsp
+33
-0
No files found.
src/main/asciidoc/sections/api-accession.adoc
View file @
0af852b0
...
...
@@ -55,6 +55,7 @@ All other fields are optional.
{
"instCode": "XYZ111",
"acceNumb": "M12345",
"cropName": "banana",
"genus": "Musa",
"species": "acuminata",
"spauthor": "Colla",
...
...
src/main/asciidoc/sections/mcpd.adoc
View file @
0af852b0
...
...
@@ -61,7 +61,7 @@ consistent manner.
are allowed: `subsp.` (for subspecies); `convar.` (for convariety); `var.` (for variety); `f.` (for form); `Group` (for 'cultivar group').
|SUBTAUTHOR|Provide the subtaxon authority at the most detailed taxonomic level.
|
CROPNAME|Common name of the crop. Example: `malting barley`, `macadamia`, `maize`.
|
<<mcpd-cropname,CROPNAME>>|Common name of the crop. Example: `malting barley`, `macadamia`, `maize`.
|ACCENAME|Either a registered or other designation given to the material received, other than the donor's
accession number (DONORNUMB) or collecting number (COLLNUMB). First letter upper case.
...
...
@@ -155,6 +155,24 @@ use, the concatenation of INSTCODE, ACCENUMB, and GENUS as a globally unique ide
similar in most respects to the PUID whenever they exchange information on accessions with
third parties (e.g. `NOR017:NGB17773:ALLIUM`).
[[mcpd-cropname]]
==== Crop name
Genesys will read the CROPNAME as provided and attempt to link the name with an existing crop
record in Genesys. Genesys currently supports the following crop names:
apple, banana, barley, beans, breadfruit, cassava, chickpea, coconut, cowpea, eggplant, fababean,
fingermillet, grasspea, lentil, lettuce, maize, pearlmillet, pigeonpea, potato, rice, sorghum,
sunflower, sweetpotato, taro, tomato, wheat, yam
The up-to-date list of crops and their coded names is available at https://www.genesys-pgr.org/c/
As more data is uploaded to Genesys we will add aliases to crops, making sure that future uploads
properly link the accession with the specified crop.
You are encouraged to use the crop names listed above, but more importantly, let
helpdesk@genesys-pgr.org know if your crop is not yet listed.
[[mcpd-wiews]]
==== Institute codes in MCPD
...
...
src/main/java/org/genesys2/server/service/impl/CropServiceImpl.java
View file @
0af852b0
...
...
@@ -98,12 +98,17 @@ public class CropServiceImpl implements CropService {
@Override
public
List
<
Crop
>
listCrops
()
{
return
cropRepository
.
findAll
();
List
<
Crop
>
crops
=
cropRepository
.
findAll
();
// Fetch otherNames list
crops
.
stream
().
forEach
(
c
->
{
c
.
getOtherNames
().
size
();
});
return
crops
;
}
@Override
public
List
<
Crop
>
list
(
final
Locale
locale
)
{
final
List
<
Crop
>
crops
=
cropRepository
.
findAll
();
// Fetch otherNames list
crops
.
stream
().
forEach
(
c
->
{
c
.
getOtherNames
().
size
();
});
Collections
.
sort
(
crops
,
new
Comparator
<
Crop
>()
{
@Override
public
int
compare
(
Crop
o1
,
Crop
o2
)
{
...
...
src/main/java/org/genesys2/server/service/impl/DownloadServiceImpl.java
View file @
0af852b0
...
...
@@ -27,8 +27,6 @@ import java.util.Date;
import
java.util.HashMap
;
import
java.util.List
;
import
javax.persistence.EntityManager
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.LogFactory
;
...
...
@@ -53,7 +51,6 @@ import org.genesys2.server.model.genesys.PDCI;
import
org.genesys2.server.model.genesys.Taxonomy2
;
import
org.genesys2.server.model.impl.Country
;
import
org.genesys2.server.persistence.domain.GenesysLowlevelRepository
;
import
org.genesys2.server.persistence.domain.MethodRepository
;
import
org.genesys2.server.service.DownloadService
;
import
org.genesys2.server.service.GenesysService
;
import
org.genesys2.server.service.GenesysService.AllStuff
;
...
...
@@ -71,9 +68,6 @@ public class DownloadServiceImpl implements DownloadService {
public
static
final
Log
LOG
=
LogFactory
.
getLog
(
DownloadServiceImpl
.
class
);
@Autowired
private
EntityManager
entityManager
;
@Autowired
private
GenesysService
genesysService
;
...
...
@@ -81,12 +75,6 @@ public class DownloadServiceImpl implements DownloadService {
@Qualifier
(
"genesysLowlevelRepositoryCustomImpl"
)
private
GenesysLowlevelRepository
genesysLowlevelRepository
;
@Autowired
private
MethodRepository
methodRepository
;
@Autowired
(
required
=
false
)
private
PDCICalculator
pdciCalculator
;
@Value
(
"${base.url}"
)
private
String
baseUrl
;
...
...
@@ -226,7 +214,8 @@ public class DownloadServiceImpl implements DownloadService {
createCell
(
row
,
10
,
taxonomy
.
getSubtaxa
());
createCell
(
row
,
11
,
taxonomy
.
getSubtAuthor
());
}
createCell
(
row
,
12
,
accession
.
getCropName
());
createCell
(
row
,
14
,
accession
.
getAcquisitionDate
());
Country
origin
=
accession
.
getCountryOfOrigin
();
...
...
src/main/java/org/genesys2/server/servlet/controller/CropController.java
View file @
0af852b0
...
...
@@ -18,7 +18,11 @@ package org.genesys2.server.servlet.controller;
import
org.genesys2.server.model.impl.Crop
;
import
org.genesys2.server.model.impl.CropTaxonomy
;
import
org.genesys2.server.service.*
;
import
org.genesys2.server.service.ContentService
;
import
org.genesys2.server.service.CropService
;
import
org.genesys2.server.service.FilterConstants
;
import
org.genesys2.server.service.GenesysService
;
import
org.genesys2.server.service.TraitService
;
import
org.genesys2.server.service.impl.FilterHandler
;
import
org.genesys2.server.service.impl.FilterHandler.AppliedFilter
;
import
org.genesys2.server.service.impl.FilterHandler.AppliedFilters
;
...
...
@@ -43,13 +47,20 @@ public class CropController extends BaseController {
@Autowired
private
ContentService
contentService
;
@Autowired
private
GenesysService
genesysService
;
@Autowired
private
TraitService
traitService
;
@RequestMapping
(
value
=
"/"
,
method
=
RequestMethod
.
GET
)
public
String
index
(
ModelMap
model
)
{
_logger
.
debug
(
"Viewing all crops"
);
model
.
addAttribute
(
"crops"
,
cropService
.
list
(
getLocale
()));
return
"/crop/list"
;
}
@RequestMapping
(
"/{shortName}"
)
public
String
view
(
ModelMap
model
,
@PathVariable
(
value
=
"shortName"
)
String
shortName
)
{
_logger
.
debug
(
"Viewing crop "
+
shortName
);
...
...
@@ -67,10 +78,10 @@ public class CropController extends BaseController {
model
.
addAttribute
(
"cropTaxonomies"
,
cropService
.
getCropTaxonomies
(
crop
,
new
PageRequest
(
0
,
20
,
new
Sort
(
"taxonomy.genus"
,
"taxonomy.species"
))));
model
.
addAttribute
(
"blurp"
,
contentService
.
getArticle
(
crop
,
"blurp"
,
getLocale
()));
// model.addAttribute("statsGenus", elasticService.termStatisticsAuto(appliedFilters, FilterConstants.TAXONOMY_GENUS, 5));
// model.addAttribute("statsGenus",
// elasticService.termStatisticsAuto(appliedFilters,
// FilterConstants.TAXONOMY_GENUS, 5));
return
"/crop/index"
;
}
...
...
@@ -138,7 +149,7 @@ public class CropController extends BaseController {
return
"redirect:/explore"
;
}
@RequestMapping
(
"/{shortName}/overview"
)
public
String
viewOverview
(
ModelMap
model
,
@PathVariable
(
value
=
"shortName"
)
String
shortName
)
{
_logger
.
warn
(
"Viewing crop "
+
shortName
);
...
...
src/main/webapp/WEB-INF/jsp/crop/list.jsp
0 → 100644
View file @
0af852b0
<!DOCTYPE html>
<%@include
file=
"/WEB-INF/jsp/init.jsp"
%>
<html>
<head>
<title><spring:message
code=
"crop.croplist"
/></title>
</head>
<body>
<h1>
<spring:message
code=
"crop.croplist"
/>
</h1>
<ul
class=
"funny-list"
>
<c:forEach
items=
"
${
crops
}
"
var=
"crop"
varStatus=
"status"
>
<li
class=
"clearfix ${status.count % 2 == 0 ? 'even' : 'odd'}"
>
<div
class=
"row"
>
<div
class=
"col-xs-4"
>
<a
class=
"show pull-left"
href=
"
<c:url
value=
"/c/${crop.shortName}"
/>
"
><c:out
value=
"
${
crop
.
getName
(
pageContext
.
response
.
locale
)
}
"
/></a>
</div>
<div
class=
"col-xs-8"
>
<span
style=
"margin: 0 1em; white-space: nowrap;"
><c:out
value=
"
${
crop
.
shortName
}
"
/></span>
<c:forEach
items=
"
${
crop
.
otherNames
}
"
var=
"otherName"
>
<span
style=
"margin: 0 1em; white-space: nowrap;"
><c:out
value=
"
${
otherName
}
"
/></span>
</c:forEach>
</div>
</div>
</li>
</c:forEach>
</ul>
</body>
</html>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment