Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Genesys PGR
Genesys Backend
Commits
42d0186b
Commit
42d0186b
authored
Sep 16, 2013
by
Matija Obreza
Browse files
Display accession's crop in details, removed hyperlinks in lists
parent
b12242b0
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/crophub/rest/common/persistence/domain/CropTaxonomyRepository.java
View file @
42d0186b
...
...
@@ -32,7 +32,7 @@ public interface CropTaxonomyRepository extends JpaRepository<CropTaxonomy, Long
@Query
(
"select distinct t from CropTaxonomy ct inner join ct.taxonomy t where ct.crop = ?1"
)
List
<
Taxonomy
>
findTaxonomiesByCrop
(
Crop
crop
);
@Query
(
"select ct from CropTaxonomy ct where ct.taxonomy= ?1 and ct.crop.language = ?2"
)
@Query
(
"select ct
.crop
from CropTaxonomy ct where ct.taxonomy= ?1 and ct.crop.language = ?2"
)
Crop
findByTaxonomyAndLanguage
(
Taxonomy
taxonomy
,
String
language
);
@Modifying
...
...
src/main/java/org/crophub/rest/servlet/controller/AccessionController.java
View file @
42d0186b
...
...
@@ -23,6 +23,7 @@ import java.util.List;
import
org.crophub.rest.common.model.genesys.Accession
;
import
org.crophub.rest.common.model.genesys.Taxonomy
;
import
org.crophub.rest.common.model.impl.FaoInstitute
;
import
org.crophub.rest.common.service.CropService
;
import
org.crophub.rest.common.service.GenesysService
;
import
org.crophub.rest.common.service.InstituteService
;
import
org.crophub.rest.common.service.TaxonomyService
;
...
...
@@ -55,6 +56,9 @@ public class AccessionController extends BaseController {
@Autowired
private
TaxonomyService
taxonomyService
;
@Autowired
private
CropService
cropService
;
@RequestMapping
(
"/id/{accessionId}"
)
public
String
view
(
ModelMap
model
,
@PathVariable
(
value
=
"accessionId"
)
long
accessionId
)
{
_logger
.
debug
(
"Viewing ACN "
+
accessionId
);
...
...
@@ -72,6 +76,8 @@ public class AccessionController extends BaseController {
model
.
addAttribute
(
"metadatas"
,
genesysService
.
listMetadata
(
accession
));
model
.
addAttribute
(
"methods"
,
genesysService
.
listMethods
(
accession
));
model
.
addAttribute
(
"methodValues"
,
genesysService
.
getAccessionTraitValues
(
accession
));
model
.
addAttribute
(
"crop"
,
cropService
.
getCrop
(
getLocale
(),
accession
.
getTaxonomy
()));
model
.
addAttribute
(
"selection"
,
selectionBean
);
...
...
src/main/resources/content/language.properties
View file @
42d0186b
...
...
@@ -142,6 +142,7 @@ accession.origin=Country of origin
accession.holdingInstitute
=
Holding institute
accession.holdingCountry
=
Location
accession.taxonomy
=
Taxonomy
accession.crop
=
Crop
accession.otherNames
=
Also known as
accession.inTrust
=
In Trust
accession.mlsStatus
=
MLS Status
...
...
src/main/webapp/WEB-INF/jsp/accession/data.jsp
View file @
42d0186b
...
...
@@ -77,8 +77,10 @@
<td
class=
"sel ${selection.containsId(accession.id) ? 'picked' : ''}"
x-aid=
"${accession.id}"
></td>
</c:if>
<td><a
href=
"
<c:url
value=
"/acn/id/${accession.id}"
/>
"
><b><c:out
value=
"
${
accession
.
accessionName
}
"
/></b></a></td>
<td><a
href=
"
<c:url
value=
"/acn/t/${accession.taxonomy.genus}/${accession.taxonomy.species}"
/>
"
><c:out
value=
"
${
accession
.
taxonomy
.
taxonName
}
"
/></a></td>
<td
class=
"notimportant"
><a
href=
"
<c:url
value=
"/geo/${accession.origin.toLowerCase()}"
/>
"
><c:out
value=
"
${
accession
.
countryOfOrigin
.
name
}
"
/></a></td>
<%-- <td><a href="<c:url value="/acn/t/${accession.taxonomy.genus}/${accession.taxonomy.species}" />"><c:out value="${accession.taxonomy.taxonName}" /></a></td> --%>
<td><c:out
value=
"
${
accession
.
taxonomy
.
taxonName
}
"
/></td>
<%-- <td class="notimportant"><a href="<c:url value="/geo/${accession.origin.toLowerCase()}" />"><c:out value="${accession.countryOfOrigin.name}" /></a></td> --%>
<td
class=
"notimportant"
><c:out
value=
"
${
accession
.
countryOfOrigin
.
name
}
"
/></td>
<td
class=
"notimportant"
><a
href=
"
<c:url
value=
"/wiews/${accession.institute.code.toLowerCase()}"
/>
"
><c:out
value=
"
${
accession
.
institute
.
code
}
"
/></a></td>
<%-- <td><a href="<c:url value="/geo/${accession.institute.country.code3.toLowerCase()}" />"><c:out value="${accession.institute.country.name}" /></a></td>
--%>
...
...
src/main/webapp/WEB-INF/jsp/accession/details.jsp
View file @
42d0186b
...
...
@@ -55,6 +55,12 @@
<td><c:out
value=
"
${
accession
.
accessionName
}
"
/></td>
</tr>
<c:if
test=
"
${
crop
ne
null
}
"
>
<tr>
<td><spring:message
code=
"accession.crop"
/></td>
<td><a
href=
"
<c:url
value=
"/c/${crop.shortName}"
/>
"
><c:out
value=
"
${
crop
.
name
}
"
/></a></td>
</tr>
</c:if>
<c:if
test=
"
${
accession
.
countryOfOrigin
ne
null
}
"
>
<tr>
...
...
src/main/webapp/WEB-INF/jsp/selection/index.jsp
View file @
42d0186b
...
...
@@ -34,10 +34,10 @@
<td
/>
</c:if>
<td><spring:message
code=
"accession.accessionName"
/></td>
<td
class=
"notimportant"
><spring:message
code=
"accession.origin"
/></td>
<td><spring:message
code=
"accession.taxonomy"
/></td>
<td
class=
"notimportant"
><spring:message
code=
"accession.origin"
/></td>
<td
class=
"notimportant"
><spring:message
code=
"accession.holdingInstitute"
/></td>
<td
class=
"notimportant"
><spring:message
code=
"accession.holdingCountry"
/></td>
<%--
<td class="notimportant"><spring:message code="accession.holdingCountry" /></td>
--%>
</tr>
</thead>
<tbody>
...
...
@@ -48,10 +48,10 @@
<td
class=
"sel ${selection.containsId(accession.id) ? 'picked' : ''}"
x-aid=
"${accession.id}"
></td>
</c:if>
<td><a
href=
"
<c:url
value=
"/acn/id/${accession.id}"
/>
"
><b><c:out
value=
"
${
accession
.
accessionName
}
"
/></b></a></td>
<td
class=
"notimportant"
><c:out
value=
"
${
accession
.
countryOfOrigin
.
name
}
"
/></td>
<td><c:out
value=
"
${
accession
.
taxonomy
.
taxonName
}
"
/></td>
<td
class=
"notimportant"
><c:out
value=
"
${
accession
.
countryOfOrigin
.
name
}
"
/></td>
<td
class=
"notimportant"
><a
href=
"
<c:url
value=
"/wiews/${accession.institute.code.toLowerCase()}"
/>
"
><c:out
value=
"
${
accession
.
institute
.
code
}
"
/></a></td>
<td
class=
"notimportant"
><a
href=
"
<c:url
value=
"/geo/${accession.institute.country.code3.toLowerCase()}"
/>
"
><c:out
value=
"
${
accession
.
institute
.
country
.
name
}
"
/></a></td>
<%--
<td class="notimportant"><a href="<c:url value="/geo/${accession.institute.country.code3.toLowerCase()}" />"><c:out value="${accession.institute.country.name}" /></a></td>
--%>
</tr>
</c:forEach>
</tbody>
...
...
Write
Preview
Supports
Markdown
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