Commit e3fb08f8 authored by Matija Obreza's avatar Matija Obreza

More info on accessions

parent 33283ea3
......@@ -28,6 +28,7 @@ import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.crophub.rest.common.model.impl.Country;
import org.crophub.rest.common.model.impl.FaoInstitute;
@Entity
......@@ -43,6 +44,7 @@ public class Accession implements java.io.Serializable {
private String acquisitionSource;
private String acquisitionDate;
private String origin;
private Country countryOfOrigin;
private String dublInst;
private String sampleStatus;
private String storage;
......@@ -131,6 +133,16 @@ public class Accession implements java.io.Serializable {
public void setOrigin(final String origin) {
this.origin = origin;
}
@ManyToOne(cascade = {}, optional = true)
@JoinColumn(name = "originId", nullable = true)
public Country getCountryOfOrigin() {
return countryOfOrigin;
}
public void setCountryOfOrigin(Country countryOfOrigin) {
this.countryOfOrigin = countryOfOrigin;
}
@Column(name = "Dubl_Inst", length = 8)
public String getDublInst() {
......
......@@ -19,13 +19,14 @@ package org.crophub.rest.common.model.genesys;
// Generated Apr 24, 2013 10:08:59 AM by Hibernate Tools 4.0.0
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
/**
* AllAccnames generated by hbm2java
*/
// @Entity
@Entity
@Table(name = "all_accnames")
public class AllAccnames implements java.io.Serializable {
......@@ -33,7 +34,7 @@ public class AllAccnames implements java.io.Serializable {
*
*/
private static final long serialVersionUID = -2785898802497223245L;
private int alisId;
private long alisId;
private String accNames;
private String otherIds;
......@@ -52,11 +53,11 @@ public class AllAccnames implements java.io.Serializable {
@Id
@Column(name = "ALIS_Id", unique = true, nullable = false)
public int getAlisId() {
public long getAlisId() {
return this.alisId;
}
public void setAlisId(final int alisId) {
public void setAlisId(final long alisId) {
this.alisId = alisId;
}
......
......@@ -19,13 +19,14 @@ package org.crophub.rest.common.model.genesys;
// Generated Apr 24, 2013 10:08:59 AM by Hibernate Tools 4.0.0
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
/**
* AllAcqBreeding generated by hbm2java
*/
// @Entity
@Entity
@Table(name = "all_acq_breeding")
public class AllAcqBreeding implements java.io.Serializable {
......@@ -33,7 +34,7 @@ public class AllAcqBreeding implements java.io.Serializable {
*
*/
private static final long serialVersionUID = 2762545036218363406L;
private int alisId;
private long alisId;
private String breederCode;
private String pedigree;
......@@ -52,11 +53,11 @@ public class AllAcqBreeding implements java.io.Serializable {
@Id
@Column(name = "ALIS_Id", unique = true, nullable = false)
public int getAlisId() {
public long getAlisId() {
return this.alisId;
}
public void setAlisId(final int alisId) {
public void setAlisId(final long alisId) {
this.alisId = alisId;
}
......
......@@ -19,13 +19,14 @@ package org.crophub.rest.common.model.genesys;
// Generated Apr 24, 2013 10:08:59 AM by Hibernate Tools 4.0.0
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
/**
* AllAcqCollect generated by hbm2java
*/
// @Entity
@Entity
@Table(name = "all_acq_collect")
public class AllAcqCollect implements java.io.Serializable {
......@@ -33,7 +34,7 @@ public class AllAcqCollect implements java.io.Serializable {
*
*/
private static final long serialVersionUID = 516402638057331415L;
private int alisId;
private long alisId;
private String collectDate;
private String collectorsNumb;
private String collectingInstitute;
......@@ -42,12 +43,11 @@ public class AllAcqCollect implements java.io.Serializable {
public AllAcqCollect() {
}
public AllAcqCollect(final int alisId) {
public AllAcqCollect(final long alisId) {
this.alisId = alisId;
}
public AllAcqCollect(final int alisId, final String collectDate, final String collectorsNumb,
final String collectingInstitute, final String collectSite) {
public AllAcqCollect(final long alisId, final String collectDate, final String collectorsNumb, final String collectingInstitute, final String collectSite) {
this.alisId = alisId;
this.collectDate = collectDate;
this.collectorsNumb = collectorsNumb;
......@@ -57,11 +57,11 @@ public class AllAcqCollect implements java.io.Serializable {
@Id
@Column(name = "ALIS_Id", unique = true, nullable = false)
public int getAlisId() {
public long getAlisId() {
return this.alisId;
}
public void setAlisId(final int alisId) {
public void setAlisId(final long alisId) {
this.alisId = alisId;
}
......
......@@ -19,13 +19,14 @@ package org.crophub.rest.common.model.genesys;
// Generated Apr 24, 2013 10:08:59 AM by Hibernate Tools 4.0.0
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
/**
* AllAcqExchange generated by hbm2java
*/
// @Entity
@Entity
@Table(name = "all_acq_exchange")
public class AllAcqExchange implements java.io.Serializable {
......@@ -33,7 +34,7 @@ public class AllAcqExchange implements java.io.Serializable {
*
*/
private static final long serialVersionUID = 2242341437805807473L;
private int alisId;
private long alisId;
private String donorInstitute;
private String accNumbDonor;
......@@ -52,11 +53,11 @@ public class AllAcqExchange implements java.io.Serializable {
@Id
@Column(name = "ALIS_Id", unique = true, nullable = false)
public int getAlisId() {
public long getAlisId() {
return this.alisId;
}
public void setAlisId(final int alisId) {
public void setAlisId(final long alisId) {
this.alisId = alisId;
}
......
/**
* Copyright 2013 Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
**/
package org.crophub.rest.common.persistence.domain;
import org.crophub.rest.common.model.genesys.AllAcqBreeding;
import org.springframework.data.jpa.repository.JpaRepository;
public interface AccessionBreedingRepository extends JpaRepository<AllAcqBreeding, Long> {
}
/**
* Copyright 2013 Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
**/
package org.crophub.rest.common.persistence.domain;
import org.crophub.rest.common.model.genesys.AllAcqCollect;
import org.springframework.data.jpa.repository.JpaRepository;
public interface AccessionCollectRepository extends JpaRepository<AllAcqCollect, Long> {
}
/**
* Copyright 2013 Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
**/
package org.crophub.rest.common.persistence.domain;
import org.crophub.rest.common.model.genesys.AllAcqExchange;
import org.springframework.data.jpa.repository.JpaRepository;
public interface AccessionExchangeRepository extends JpaRepository<AllAcqExchange, Long> {
}
/**
* Copyright 2013 Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
**/
package org.crophub.rest.common.persistence.domain;
import org.crophub.rest.common.model.genesys.AllAccnames;
import org.springframework.data.jpa.repository.JpaRepository;
public interface AccessionNameRepository extends JpaRepository<AllAccnames, Long> {
}
......@@ -3,6 +3,10 @@ package org.crophub.rest.common.service;
import java.util.List;
import org.crophub.rest.common.model.genesys.Accession;
import org.crophub.rest.common.model.genesys.AllAccnames;
import org.crophub.rest.common.model.genesys.AllAcqBreeding;
import org.crophub.rest.common.model.genesys.AllAcqCollect;
import org.crophub.rest.common.model.genesys.AllAcqExchange;
import org.crophub.rest.common.model.impl.Country;
import org.crophub.rest.common.model.impl.FaoInstitute;
import org.springframework.data.domain.Page;
......@@ -24,4 +28,12 @@ public interface GenesysService {
List<Accession> listAccessions(FaoInstitute faoInstitute, String accessionName);
AllAccnames listAccessionNames(Accession accession);
List<AllAcqExchange> listAccessionExchange(Accession accession);
List<AllAcqCollect> listAccessionCollect(Accession accession);
List<AllAcqBreeding> listAccessionBreeding(Accession accession);
}
......@@ -3,8 +3,15 @@ package org.crophub.rest.common.service.impl;
import java.util.List;
import org.crophub.rest.common.model.genesys.Accession;
import org.crophub.rest.common.model.genesys.AllAccnames;
import org.crophub.rest.common.model.genesys.AllAcqBreeding;
import org.crophub.rest.common.model.genesys.AllAcqCollect;
import org.crophub.rest.common.model.genesys.AllAcqExchange;
import org.crophub.rest.common.model.impl.Country;
import org.crophub.rest.common.model.impl.FaoInstitute;
import org.crophub.rest.common.persistence.domain.AccessionBreedingRepository;
import org.crophub.rest.common.persistence.domain.AccessionCollectRepository;
import org.crophub.rest.common.persistence.domain.AccessionNameRepository;
import org.crophub.rest.common.persistence.domain.AccessionRepository;
import org.crophub.rest.common.persistence.domain.MethodRepository;
import org.crophub.rest.common.service.GenesysService;
......@@ -22,6 +29,13 @@ public class GenesysServiceImpl implements GenesysService {
@Autowired
private AccessionRepository accessionRepository;
@Autowired
private AccessionBreedingRepository accessionBreedingRepository;
@Autowired
private AccessionCollectRepository accessionCollectRepository;
@Autowired
private AccessionNameRepository accessionNamesRepository;
@Autowired
private MethodRepository methodRepository;
......@@ -62,4 +76,27 @@ public class GenesysServiceImpl implements GenesysService {
public List<Accession> listAccessions(FaoInstitute faoInstitute, String accessionName) {
return accessionRepository.findByInstituteAndAccessionName(faoInstitute, accessionName);
}
@Override
public List<AllAcqBreeding> listAccessionBreeding(Accession accession) {
// TODO Auto-generated method stub
return null;
}
@Override
public List<AllAcqCollect> listAccessionCollect(Accession accession) {
// TODO Auto-generated method stub
return null;
}
@Override
public List<AllAcqExchange> listAccessionExchange(Accession accession) {
// TODO Auto-generated method stub
return null;
}
@Override
public AllAccnames listAccessionNames(Accession accession) {
return accessionNamesRepository.findOne(accession.getId());
}
}
......@@ -31,6 +31,10 @@ public class AccessionController extends BaseController {
throw new ResourceNotFoundException();
}
model.addAttribute("accession", accession);
model.addAttribute("accessionNames", genesysService.listAccessionNames(accession));
model.addAttribute("accessionExchange", genesysService.listAccessionExchange(accession));
model.addAttribute("accessionCollect", genesysService.listAccessionCollect(accession));
model.addAttribute("accessionBreeding", genesysService.listAccessionBreeding(accession));
return "/accession/details";
}
......
......@@ -107,6 +107,11 @@ accession.origin=Country of origin
accession.holdingInstitute=Holding institute
accession.holdingCountry=Location
accession.taxonomy=Taxonomy
accession.otherNames=Also known as
accession.inTrust=In Trust
accession.mlsStatus=MLS Status
accession.inSvalbard=Svalbardized
accession.page.profile.title=Accession profile: {0}
accession.page.resolve.title=Multiple accessions found
......
......@@ -16,7 +16,11 @@
<tbody>
<tr>
<td><spring:message code="accession.holdingInstitute" /></td>
<td><c:out value="${accession.institute.fullName}" /></td>
<td>
<a href="<c:url value="/wiews/${accession.instituteCode.toLowerCase()}" />">
<c:out value="${accession.institute.fullName}" />
</a>
</td>
</tr>
<tr>
<td><spring:message code="accession.holdingCountry" /></td>
......@@ -26,10 +30,20 @@
<td><spring:message code="accession.accessionName" /></td>
<td><c:out value="${accession.accessionName}" /></td>
</tr>
<tr>
<td><spring:message code="accession.origin" /></td>
<td><c:out value="${accession.origin}" /></td>
</tr>
<c:if test="${accession.countryOfOrigin ne null}">
<tr>
<td><spring:message code="accession.origin" /></td>
<td>
<img src="http://genesys-pgr.org/images/flags/${accession.origin.toUpperCase()}.png" />
<a href="<c:url value="/geo/${accession.origin.toLowerCase()}" />">
<c:out value="${accession.countryOfOrigin.name}" />
</a>
</td>
</tr>
</c:if>
<tr>
<td><spring:message code="taxonomy.genus" /></td>
<td><c:out value="${accession.taxonomy.genus}" /></td>
......@@ -43,6 +57,27 @@
<td><c:out value="${accession.taxonomy.taxonName}" /></td>
</tr>
<tr>
<td><spring:message code="accession.otherNames" /></td>
<td>
<c:out value="${accessionNames.accNames}" /><br />
<c:out value="${accessionNames.otherIds}" />
</td>
</tr>
<tr>
<td><spring:message code="accession.inTrust" /></td>
<td><c:out value="${accession.inTrust}" /></td>
</tr>
<tr>
<td><spring:message code="accession.inSvalbard" /></td>
<td><c:out value="${accession.inSvalbard}" /></td>
</tr>
<tr>
<td><spring:message code="accession.mlsStatus" /></td>
<td><c:out value="${accession.mlsStatus}" /></td>
</tr>
</tbody>
</table>
</body>
......
......@@ -15,9 +15,11 @@
<h1>
<spring:message code="country.accessions.from" arguments="${country.name}" />
<img class="country-flag bigger" src="http://genesys-pgr.org/images/flags/${country.code3.toUpperCase()}.png" />
</h1>
<a href="<c:url value="/geo/${country.code3.toLowerCase()}" />"><c:out value="${country.name}" /></a>
<div>
<a href="<c:url value="/geo/${country.code3.toLowerCase()}" />"><c:out value="${country.name}" /></a>
</div>
<div class="nav-header">
<spring:message code="accessions.number" arguments="${accessions.totalElements}" />
......
......@@ -11,12 +11,15 @@
<div class="alert alert-error"><spring:message code="data.error.404"/></div>
</c:if>
<h1><c:out value="${country.name}" /></h1>
<h1>
<c:out value="${country.name}" />
<img class="country-flag bigger" src="http://genesys-pgr.org/images/flags/${country.code3.toUpperCase()}.png" />
</h1>
<c:if test="${not country.current}">
<div class="alert"><spring:message code="country.page.not-current"/></div>
</c:if>
<div>
<c:out value="${country.code3}" />
</div>
......
......@@ -37,7 +37,7 @@
<c:forEach items="${accessions.content}" var="accession" varStatus="status">
<tr>
<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="/geo/${accession.origin.toLowerCase()}" />"><c:out value="${accession.origin}" /></a></td>
<td><a href="<c:url value="/geo/${accession.origin.toLowerCase()}" />"><c:out value="${accession.countryOfOrigin.name}" /></a></td>
<td><c:out value="${accession.taxonomy.taxonName}" /></td>
<td><a href="<c:url value="/wiews/${faoInstitute.code.toLowerCase()}" />"><c:out value="${faoInstitute.code}" /></a></td>
<td><a href="<c:url value="/geo/${accession.institute.country.code3.toLowerCase()}" />"><c:out value="${accession.institute.country.name}" /></a></td>
......
......@@ -14,8 +14,10 @@
</c:if> --%>
<div>
<img src="http://genesys-pgr.org/images/flags/${faoInstitute.country.code3.toUpperCase()}.png" />
<a href="<c:url value="/geo/${faoInstitute.country.code3.toLowerCase()}" />"><c:out value="${faoInstitute.country.name}" /></a>
</div>
<div>
<c:out value="${faoInstitute.code}" />
</div>
......
......@@ -54,3 +54,11 @@ td {
margin-left: 10%;
font-size: 80%;
}
img.country-flag {
float: right;
}
img.country-flag.bigger {
height: 50px;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment