Skip to content

Commit

Permalink
feat: faceted search
Browse files Browse the repository at this point in the history
Signed-off-by: WoodenMaiden <[email protected]>
  • Loading branch information
WoodenMaiden committed Aug 14, 2024
1 parent c442d69 commit 13e2f8d
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 131 deletions.
16 changes: 7 additions & 9 deletions agrold-javaweb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,13 @@ Vous pourrez voir comment paramétrer votre IDE dans [la section appropriée sur

Le déploiement de l'application se fait premièrement avec des propriétés Java passées à tomcat.

| Name | Description | Valeur par défaut |
| :------------------------: | :------------------------------------------------------------------------: | :---------------------------: |
| `agrold.description` | Description affichée dans Tomcat | :x: |
| `agrold.sparql_endpoint` | Url de l'endpoint SPARQL | `http://sparql.southgreen.fr` |
| `agrold.db_connection_url` | Url de la base de données ex: `[host]:[port]/[db]?[opt]` | :x: |
| `agrold.db_username` | Utilisateur de la base de données | :x: |
| `agrold.db_password` | Mot de passe de la base de données | :x: |
| `agrold.rf_link` | Lien vers une instance de RelFinder[Reformed] | `http://rf.southgreen.fr/` |
| `agrold.instance` | Specifies the type of the instance, can either be empty or `dev` | :x: |
| Name | Description | Valeur par défaut |
| :-------------------------: | :--------------------------------------------------------------: | :-------------------------------: |
| `agrold.description` | Description affichée dans Tomcat | :x: |
| `agrold.sparql_endpoint` | Url de l'endpoint SPARQL | `http://sparql.southgreen.fr` |
| `agrold.rf_link` | Lien vers une instance de RelFinder[Reformed] | `http://rf.southgreen.fr/` |
| `agrold.faceted_search_url` | Lien vers la recherche à facettes | `http://agrold.southgreen.fr/fct` |
| `agrold.instance` | Specifies the type of the instance, can either be empty or `dev` | :x: |

Pour injecter ces variables dans tomcat, il faut déclarer les sous forme d'argument en ligne de commande sous cette forme `-Dnomdelapropriété=valeur` et les placer dans la variable d'environnement `CATALINA_OPTS`

Expand Down
23 changes: 11 additions & 12 deletions agrold-javaweb/charts/agrold-javaweb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,23 +57,22 @@ The command removes all the Kubernetes components associated with the chart and

### Agrold parameters

| Name | Description | Value |
| ------------------------------------ | -------------------------------------------- | ------------------------- |
| `agroldProperties.db_connection_url` | Database connection URL for user management. | `"someurl"` |
| `agroldProperties.db_username` | Database username for user management. | `"user"` |
| `agroldProperties.db_password` | Database password for user management. | `"password"` |
| `agroldProperties.rf_link` | Link to RelFinder **ingress**. | `"https://rf.someurl.fr"` |
| `agroldProperties.description` | Description showed in Tomcat. | `""` |
| Name | Description | Value |
| ------------------------------------- | ----------------------------------- | ---------------------------- |
| `agroldProperties.rf_link` | Link to RelFinder **ingress**. | `"https://rf.someurl.fr"` |
| `agroldProperties.description` | Description showed in Tomcat. | `""` |
| `agroldProperties.faceted_search_url` | Link to faceted search **ingress**. | `"http://someurl.fr/fct"` |
| `agroldProperties.sparql_endpoint` | Link to SPARQL endpoint. | `"http://someurl.fr/sparql"` |

> ℹ️ You can also add other parameters as [mentionned in the readme](https://github.com/SouthGreenPlatform/AgroLD_webapp/tree/master/agrold-javaweb#param%C3%A8tres)
### Global parameters

| Name | Description | Value |
| ------------------------- | ----------------------------------------------- | ----- |
| `global.imageRegistry` | Global Docker image registry | `""` |
| `global.imagePullSecrets` | Global Docker registry secret names as an array | `[]` |
| `global.storageClass` | Global StorageClass for Persistent Volume(s) | `""` |
| Name | Description | Value |
| ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
| `global.imageRegistry` | Global Docker image registry | `""` |
| `global.imagePullSecrets` | Global Docker registry secret names as an array | `[]` |
| `global.storageClass` | Global StorageClass for Persistent Volume(s) | `""` |
| `global.compatibility.openshift.adaptSecurityContext` | Adapt the securityContext sections of the deployment to make them compatible with Openshift restricted-v2 SCC: remove runAsUser, runAsGroup and fsGroup and let the platform use their allowed default IDs. Possible values: auto (apply if the detected running cluster is Openshift), force (perform the adaptation always), disabled (do not perform adaptation) | `disabled` |

### Common parameters
Expand Down
5 changes: 2 additions & 3 deletions agrold-javaweb/charts/agrold-javaweb/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@
##

agroldProperties:
db_connection_url: someurl
db_username: user
db_password: password
rf_link: https://rf.someurl.fr
faceted_search_url: http://someurl.fr/fct
sparql_endpoint: "http://someurl.fr/sparql"
description: ""

## @param global.imageRegistry Global Docker image registry
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,9 @@
*/
public class PropertiesBean {
@Getter private static final String sparqlEndpoint = System.getProperty("agrold.sparql_endpoint", "http://sparql.southgreen.fr");
@Getter private static final String DBConnectionUrl = System.getProperty("agrold.db_connection_url");
@Getter private static final String DBUsername = System.getProperty("agrold.db_username");
@Getter private static final String DBPassword = System.getProperty("agrold.db_password");
@Getter private static final String RFLink = System.getProperty("agrold.rf_link", "http://rf.southgreen.fr/");
@Getter private static final String instance = System.getProperty("agrold.instance");

@Getter private static final String APIVersion = System.getProperty("APIVersion", "undefined");

public static boolean hasDB() {
return DBConnectionUrl != null && DBUsername != null && DBPassword != null;
}

}
8 changes: 6 additions & 2 deletions agrold-javaweb/src/main/webapp/config/config.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
WEBAPPURL= "/agrold"

SPARQLENDPOINTURL= system_sparqlendpoint ?? "http://sparql.southgreen.fr";
SPARQLENDPOINTURL= system_sparqlendpoint;
//
// still in HTML form in :
// WEB-INF/Account/General/AJAX/Admin/_USER_FULL_DATA_LOADER.jsp
// WEB-INF/Account/General/AJAX/History/QuickSearchList.jsp
// /src/main/webapp/quicksearch.jsp
FACETEDURL="http://agrold.southgreen.fr/fct"; //TODO
FACETEDURL = system_faceted_search_url;
FACETEDPAGE = new URL(
`${(new URL(system_faceted_search_url)).pathname.split("/").map(_ => "..").join("/")}/fct/facet.vsp?cmd=text&sid=231`,
system_faceted_search_url
).href;

AGROLDAPIJSONURL= WEBAPPURL + "/api/openapi.json";

Expand Down
1 change: 1 addition & 0 deletions agrold-javaweb/src/main/webapp/includes.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
}
const system_sparqlendpoint = parseJsp('<%= System.getProperty("agrold.sparql_endpoint", "http://sparql.southgreen.fr") %>')
const system_faceted_search_url = parseJsp('<%= System.getProperty("agrold.faceted_search_url", "http://sparql.southgreen.fr/faceted") %>')
</script>
<script type="text/javascript" src="config/config.js"></script>

Expand Down
91 changes: 4 additions & 87 deletions agrold-javaweb/src/main/webapp/index.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,6 @@
<div class="jumbotron home">
<div class="static-j">
<div class="container">
<% if(session.getAttribute("sessionUtilisateur")== null){%>
<!--div class="alert alert-success alert-dismissible fade show" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<strong>Welcome on AgroLD</strong>. It's your first time on the portal ? <strong><a href="Login" style="color:inherit">Login</a></strong> or <strong><a href="Register" style="color:inherit">create an account</a></strong> to save and share your requests on the <strong><a href="#section1" style="color:inherit">tools</a></strong>.
</div-->
<% }%>
<div class="bug-rport-2">

<div class="primary-a col-md-12 col-lg-12 brise">
Expand All @@ -91,8 +83,7 @@
</div>
<div id="sform">
<center>
<form id="search" action="http://agrold.southgreen.fr/fct/facet.vsp?cmd=text&sid=231" method="post" target="_blank">
<!--form id="search" action="http://volvestre.cirad.fr:8890/fct/facet.vsp?cmd=text&sid=231"" method="post" target="_blank"-->
<form id="search" method="post" target="_blank">
<div class="col-lg-6">
<div class="input-group">
<!--input type="text" class="form-control" placeholder="Search for..."-->
Expand All @@ -106,67 +97,13 @@
<div class="error"></div>
<div class="success"></div>
<span style="margin-top:30px;color:red;display:none" class="message">Please enter a keword</span>
<!-- <script>
$('form#search').click(function(e){
var request=$(".keyword").val();
console.log('request'+request);
if(request==""){
$('.message').show();
e.stopPropagation();
e.preventDefault();
}else{
$('.message').hide();
saveRequest(request);
}
});
function saveRequest(keyword){
$.ajax({
type:'post',
data:'p={m:"setQuickSearch",keyword:'+keyword+'}',
url:'ToolHistory',
success:function(data){
$('.success').html(data);
}
});
}
</script>-->
</center>
</div>
<!-- <div class="primary-b col-sm-12 col-lg-6">
<div class="pre primary-b">
<p><b>Agronomic Linked Data (AgroLD)</b></br>This project was created to provide a portal for bioinformatics and domain experts to exploit the homogenized data models towards efficiently generating research hypotheses.
</p>
</div>
</div>-->
</div>
</div>
</div>

</div>
<!-- <section class="regular slider">
<div class="minified">
<div class="container">
<div class="slide-1">
<a href="advancedSearch.jsp"><img src="images/slide1.png"></a>
</div>
</div>
</div>
<div class="minified">
<div class="container">
<div class="slide-1">
<a href="relfinder.jsp"><img src="images/slide2.png"></a>
</div>
</div>
</div>
<div class="minified">
<div class="container">
<div class="slide-1">
<a href="sparqleditor.jsp"><img src="images/slide3.png"></a>
</div>
</div>
</div>
</section>-->
</div>
</div>
<div id="section1" class="fp-normal-scroll section sumaryService">
Expand Down Expand Up @@ -263,38 +200,18 @@
Change your consents
</button>
</footer>

</div>

</div>

</div>
</div>
</div>

</div>
<!-- <img class="twitter_img_icon"src="images/twitter-icon-1.png" alt="southgreen"> -->
</div>



<!-- <div id="section3" class="section introIndex">
<div class="titled-section t-s-1 container-fluid">
<img class="twitter_img" src="images/twitter_PNGsmal.png" alt="southgreen">
<img class="twitter_img"src="images/twitter-icon-1.png" alt="southgreen">
</div>
<div class="container">
<div class="tweeter">
<a class="twitter-timeline" href="https://twitter.com/agro_ld?ref_src=twsrc%5Etfw">Tweets by agro_ld</a>
<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>
</div>
</div>
</div>-->
</div>


<script type="text/javascript">
var nos = 0;
$(document).ready(function () {
$("#search").attr("action", FACETEDPAGE);
$(".regular").slick({
/*scrollOverflow: true,
slidesNavigation: true,
Expand Down
13 changes: 2 additions & 11 deletions agrold-javaweb/src/main/webapp/quicksearch.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,9 @@
</div>
<div id="sform">
<center>
<form id="search" action="http://agrold.southgreen.fr/fct/facet.vsp?cmd=text&sid=231"" method="post" target="_blank">
<!--form id="search" action="http://volvestre.cirad.fr:8890/fct/facet.vsp?cmd=text&sid=231"" method="post" target="_blank"-->
<form id="search" action="" method="post" target="_blank">
<div class="col-lg-6">
<div class="input-group">
<!--input type="text" class="form-control" placeholder="Search for..."-->
<input class="keyword form-control" name="q" type="text" placeholder="Search examples: Gene names -
'GRP2' or 'TCP12' or Keywords 'plant height'" data-step="1" data-intro="Type your expression and then ..."/>
<span class="input-group-btn">
Expand Down Expand Up @@ -101,14 +99,7 @@
</body>
<script>
$(document).ready(function () {
$.ajax({
type: 'post',
data: 'p={m:"setPageConsult",page:"quickSearch"}',
url: 'ToolHistory',
success: function (data) {
$('.success').html(data);
}
});
$("#search").attr("action", FACETEDPAGE);
});
</script>
</html>

0 comments on commit 13e2f8d

Please sign in to comment.