Skip to content

Commit

Permalink
Interface database and database-details finalized (still need some te…
Browse files Browse the repository at this point in the history
…sts)
  • Loading branch information
acheype committed May 2, 2017
1 parent 94b657e commit ba09755
Show file tree
Hide file tree
Showing 392 changed files with 48,811 additions and 31,405 deletions.
33 changes: 16 additions & 17 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,31 @@
"appPath": "src/main/webapp",
"testPath": "src/test/javascript/spec",
"dependencies": {
"angular": "1.4.5",
"angular-animate": "~1.4.8",
"angular-aria": "1.4.5",
"angular-bootstrap": "0.13.3",
"angular": "1.6.4",
"angular-animate": "1.6.4",
"angular-aria": "1.6.4",
"angular-bootstrap": "2.5.0",
"angular-cache-buster": "0.4.3",
"angular-cookies": "1.4.5",
"angular-jqcloud": "1.0.2",
"angular-cookies": "1.6.4",
"angular-jqcloud": "1.0.3",
"angular-local-storage": "0.2.2",
"angular-resource": "1.4.5",
"angular-sanitize": "1.4.5",
"angular-ui-router": "0.2.15",
"bootstrap-sass": "3.3.5",
"bootswatch": "3.3.5",
"jquery": "2.1.4",
"angular-resource": "1.6.4",
"angular-sanitize": "1.6.4",
"angular-ui-router": "0.4.2",
"angular-touch": "1.6.4",
"bootstrap-sass": "3.3.7",
"bootswatch": "3.3.7",
"json3": "3.3.2",
"modernizr": "2.8.3",
"ng-file-upload": "7.0.17",
"swagger-ui": "2.1.2"
},
"devDependencies": {
"angular-mocks": "1.4.5",
"angular-scenario": "1.4.5"
"angular-mocks": "1.6.4",
"angular-scenario": "1.6.4"
},
"resolutions": {
"angular": "1.4.5",
"angular-cookies": "1.4.5",
"jquery": "2.1.4"
"angular": "1.6.4",
"angular-cookies": "1.6.4"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public interface EthnologyRepository extends JpaRepository<Ethnology,Long> {
//Ethnology findOneWithEagerRelationships(@Param("id") Long id);

@Query("select e from Ethnology e join e.plantIngredients pi where e.publication.id = :pubId and pi.id in :piIds")
List<Ethnology> findByPublicationIdAndPlantIngredients(@Param("pubId") Long pubId, @Param("piIds") List<Long>
Ethnology findByPublicationIdAndPlantIngredients(@Param("pubId") Long pubId, @Param("piIds") List<Long>
piIds);

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import nc.ird.malariaplantdb.domain.InVitroPharmaco;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

Expand All @@ -21,4 +23,8 @@ public interface InVitroPharmacoRepository extends JpaRepository<InVitroPharmaco
// ".plantIngredients where inVitroPharmaco.id =:id")
//InVitroPharmaco findOneWithEagerRelationships(@Param("id") Long id);

@Query("select iv from InVitroPharmaco iv join iv.plantIngredients pi where iv.publication.id = :pubId and pi.id in :piIds")
List<InVitroPharmaco> findByPublicationIdAndPlantIngredients(@Param("pubId") Long pubId, @Param("piIds") List<Long>
piIds);

}
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ public interface InVivoPharmacoRepository extends JpaRepository<InVivoPharmaco,L
@Query("select iv from InVivoPharmaco iv join iv.plantIngredients pi where iv.publication.id = :pubId and pi.id in :piIds")
List<InVivoPharmaco> findByPublicationIdAndPlantIngredients(@Param("pubId") Long pubId, @Param("piIds") List<Long>
piIds);

}
Original file line number Diff line number Diff line change
Expand Up @@ -124,19 +124,23 @@ public ResponseEntity<List<Ethnology>> getEthnologiesByPublicationId(@PathVariab
}

/**
* GET /publications/:pubId/pi/:piIds/ethnologies -> get all the ethnologies with the "id" publication and the
* GET /publications/:pubId/pi/:piIds/ethnology -> get the ethnology with the "id" publication and the
* list of plant ingredient ids
*/
@RequestMapping(value = "/publications/{pubId}/pi/{piIds}/ethnologies",
@RequestMapping(value = "/publications/{pubId}/pi/{piIds}/ethnology",
method = RequestMethod.GET,
produces = MediaType.APPLICATION_JSON_VALUE)
@Timed
public ResponseEntity<List<Ethnology>> getEthnologiesByPubIdAndPiIds(@PathVariable Long pubId, @PathVariable
public ResponseEntity<Ethnology> getEthnologyByPubIdAndPiIds(@PathVariable Long pubId, @PathVariable
List<Long> piIds) {
log.debug("REST request to get the Ethnologies of the Publication : {}, and the PlantIngredient(s) : {}",
log.debug("REST request to get the Ethnologiy of the Publication : {}, and the PlantIngredient(s) : {}",
pubId, piIds.stream().map(id -> id.toString()).collect(Collectors.joining(",")));
List<Ethnology> ethnologies = ethnologyRepository.findByPublicationIdAndPlantIngredients(pubId, piIds);
return new ResponseEntity<>(ethnologies, HttpStatus.OK);

return Optional.ofNullable(ethnologyRepository.findByPublicationIdAndPlantIngredients(pubId, piIds))
.map(ethnology -> new ResponseEntity<>(
ethnology,
HttpStatus.OK))
.orElse(new ResponseEntity<>(HttpStatus.NOT_FOUND));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,24 @@ public ResponseEntity<List<InVitroPharmaco>> getInVitroPharmacosByPublicationId(
return new ResponseEntity<>(invitropharmacos, HttpStatus.OK);
}

/**
* GET /publications/:pubId/pi/:piIds/inVitroPharmacos -> get all the inVitroPharmacos with the "id" publication
* and the list of plant ingredient ids
*/
@RequestMapping(value = "/publications/{pubId}/pi/{piIds}/inVitroPharmacos",
method = RequestMethod.GET,
produces = MediaType.APPLICATION_JSON_VALUE)
@Timed
public ResponseEntity<List<InVitroPharmaco>> getInVitroPharmacosByPubIdAndPiIds(@PathVariable Long pubId,
@PathVariable
List<Long> piIds) {
log.debug("REST request to get the InVitroPharmaco of the Publication : {}, and the PlantIngredient(s) : {}",
pubId, piIds.stream().map(id -> id.toString()).collect(Collectors.joining(",")));
List<InVitroPharmaco> inVitroPharmacos = inVitroPharmacoRepository.findByPublicationIdAndPlantIngredients
(pubId, piIds);
return new ResponseEntity<>(inVitroPharmacos, HttpStatus.OK);
}

/**
* DELETE /inVitroPharmacos/:id -> delete the "id" inVitroPharmaco.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,14 @@ public ResponseEntity<List<InVivoPharmaco>> getInVivoPharmacosByPublicationId(@P
method = RequestMethod.GET,
produces = MediaType.APPLICATION_JSON_VALUE)
@Timed
public ResponseEntity<List<InVivoPharmaco>> getEthnologiesByPubIdAndPiIds(@PathVariable Long pubId, @PathVariable
public ResponseEntity<List<InVivoPharmaco>> getInVivoByPubIdAndPiIds(@PathVariable Long pubId, @PathVariable
List<Long> piIds) {
log.debug("REST request to get the InVivoPharmaco of the Publication : {}, and the PlantIngredient(s) : {}",
pubId, piIds.stream().map(id -> id.toString()).collect(Collectors.joining(",")));
List<InVivoPharmaco> inVivoPharmacos = inVivoPharmacoRepository.findByPublicationIdAndPlantIngredients(pubId, piIds);
return new ResponseEntity<>(inVivoPharmacos, HttpStatus.OK);
}


/**
* DELETE /inVivoPharmacos/:id -> delete the "id" inVivoPharmaco.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,24 @@ public ResponseEntity<Publication> getPublication(@PathVariable Long id) {
.orElse(new ResponseEntity<>(HttpStatus.NOT_FOUND));
}

/**
* GET /pubSummaries/:id -> get the "id" pubSummaries.
*/
@RequestMapping(value = "/pubSummaries/{id}",
method = RequestMethod.GET,
produces = MediaType.APPLICATION_JSON_VALUE)
@Transactional(readOnly = true)
@Timed
public ResponseEntity<PubSummaryDTO> getPubSummary(@PathVariable Long id) {
log.debug("REST request to get Publication : {}", id);
return Optional.ofNullable(publicationRepository.findOne(id))
.map(publication -> new ResponseEntity<>(
new PubSummaryDTO(publication),
HttpStatus.OK))
.orElse(new ResponseEntity<>(HttpStatus.NOT_FOUND));
}


/**
* DELETE /publications/:id -> delete the "id" publication.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public PubSummaryDTO(Publication pub) {

private String buildPlantIngredientsKey(SortedSet<PlantIngredient> plantIngredients) {
return plantIngredients.stream()
.map(pi -> pi.getSpecies().getFamily() + " " + pi.getSpecies().getSpecies() + ", " + pi.getPartUsed())
.map(pi -> pi.getSpecies().getSpecies() + ", " + pi.getPartUsed())
.collect(Collectors.joining(" / "));
}

Expand Down
76 changes: 74 additions & 2 deletions src/main/scss/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ ul#strength {
}

.pub-item {
padding: 10px 0px;
padding: 10px 10px;
margin: 0 10px 20px;
border-left: 5px solid $blue2;
background-color: #fff;
Expand All @@ -419,6 +419,10 @@ ul#strength {
margin-top: 5px;
}

.pub-url {
margin-right: 10px;
}

.ingredients-item {
padding: 5px 5px 0 5px;
margin: 2px 10px 8px 20px;
Expand Down Expand Up @@ -501,7 +505,6 @@ ul#strength {
.cat-test-tag-block{
display: block;
}

}

.cat1-test-tag {
Expand All @@ -524,10 +527,79 @@ ul#strength {
background-color: $red2;
}

h3 small {
font-size: 75%;
color: $gray-base;
}

.publication-label{
font-weight: bolder;
font-size: $font-size-small;
color : $blue2;
}

.review-label{
font-weight: bolder;
color: $blue2;
margin-top: 20px;
margin-bottom: 5px;
font-size: $font-size-large;
}

.btn-review-item{
padding: 5px 2px;
}
.nav-pills > li.btn-review-item > a {
padding: 5px 10px;
}
.nav-pills > .active.btn-review-item > a,
.nav-pills > .active.btn-review-item > a:hover,
.nav-pills > .active.btn-review-item > a:focus{
background-color: $green-super-lighter;
color: $green;
font-weight: bold;
}

.pub-item .nav-tabs > li > a {
padding: 5px 10px;
font-size: $font-size-small;
}

.cat-properties-label {
font-weight: bolder;
font-size: $font-size-small;
color: $green;
margin-top: 5px;
}

.cat-properties-item {
padding: 2px 5px 0 5px;
margin: 2px 10px 8px 20px;
}

.properties-col {
border-top: 2px solid $green-super-lighter;
}

.property-label {
font-weight: bolder;
font-size: $font-size-small;
text-align: right;
}

.nav-tabs {
border-bottom: 4px solid $green-super-lighter;
}

.top-buffer {
margin-top: 10px;
}

.top-little-buffer {
margin-top: 5px;
}

.right-buffer {
margin-right : 10px;
}
/* End of database part */
15 changes: 8 additions & 7 deletions src/main/webapp/bower_components/angular-animate/.bower.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
{
"name": "angular-animate",
"version": "1.4.8",
"version": "1.6.4",
"license": "MIT",
"main": "./angular-animate.js",
"ignore": [],
"dependencies": {
"angular": "1.4.8"
"angular": "1.6.4"
},
"homepage": "https://github.com/angular/bower-angular-animate",
"_release": "1.4.8",
"_release": "1.6.4",
"_resolution": {
"type": "version",
"tag": "v1.4.8",
"commit": "cc1d9740059f5e8fd43abf0e2e80695d43b3b6b1"
"tag": "v1.6.4",
"commit": "a6c7e14a23096348e55a342a8f671466239ed3ab"
},
"_source": "git://github.com/angular/bower-angular-animate.git",
"_target": "~1.4.8",
"_source": "https://github.com/angular/bower-angular-animate.git",
"_target": "1.6.4",
"_originalSource": "angular-animate"
}
Loading

0 comments on commit ba09755

Please sign in to comment.