Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #24

Open
wants to merge 70 commits into
base: master
Choose a base branch
from
Open

Dev #24

Show file tree
Hide file tree
Changes from 39 commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
5227092
rename 'next' buttons in guided query interface
nicolasmoreau Oct 20, 2015
3a5ef6c
consumer service choice is inside the result table
nicolasmoreau Oct 22, 2015
fd3395e
simplifies xsams processor choice in result table
nicolasmoreau Oct 28, 2015
92d42ee
removes refresh call to asyncform, as it is not active
nicolasmoreau Oct 28, 2015
3b8acc4
- Improves portal presentation with CSS modifications
nicolasmoreau Nov 3, 2015
d68debf
add library
nicolasmoreau Nov 3, 2015
b46f2ff
use an older version of sfl4j
nicolasmoreau Nov 3, 2015
ab5d84c
add missing . at end of sentence
nicolasmoreau Nov 3, 2015
cdaea87
link to nodes on home page
nicolasmoreau Nov 4, 2015
c7d7fbb
improve position of elements in advanced query page, solves problems …
nicolasmoreau Nov 4, 2015
87da7d8
changes tables width, removes useless css directive
nicolasmoreau Nov 4, 2015
dfd4986
enlarge the page for very long node names
nicolasmoreau Nov 4, 2015
716ac1a
add citation policy page
nicolasmoreau Nov 18, 2015
9e0f1b9
remove list of inactive nodes until the registry has been cleaned
nicolasmoreau Nov 18, 2015
1a27164
reduces width of login form to match new page size
nicolasmoreau Dec 4, 2015
16b94d8
bug correction : problem when displaying saved results for a request …
nicolasmoreau Dec 14, 2015
ae82136
type correction
nicolasmoreau Dec 14, 2015
a1f3934
Remove "Remove form" link from forms
nicolasmoreau Dec 14, 2015
33316a1
reduces and changes position of european logo
nicolasmoreau Dec 16, 2015
b6e4ba8
changes img size in footer
nicolasmoreau Dec 16, 2015
c76e605
displays only Molecules in Molecule search form suggestion
nicolasmoreau Dec 17, 2015
c76dbdf
corrections in sql requests
nicolasmoreau Jan 4, 2016
a959b3f
removes duplicated code
nicolasmoreau Jan 4, 2016
3bc1411
add base class for collisional forms
nicolasmoreau Jan 4, 2016
cb28f10
uses renamed methods
nicolasmoreau Jan 4, 2016
9edf50f
solves problem on Remove form functionality
nicolasmoreau Jan 7, 2016
d431678
Adds tests for QueryTreeController
nicolasmoreau Jan 7, 2016
f938729
correction in clear function call in formtitle form
nicolasmoreau Jan 11, 2016
0a0a16a
adapt java entities to new species database
nicolasmoreau Apr 8, 2016
dd88fd0
remove automatic opening of a popup when processor is called
nicolasmoreau Feb 13, 2017
cd25d48
New version of portal
nicolasmoreau Feb 27, 2017
6b76c35
Remove trailing System.out
nicolasmoreau Feb 27, 2017
7e8e9c2
close BufferedReader in QueryStore class
nicolasmoreau Feb 28, 2017
8b74e42
remove comments
nicolasmoreau Feb 28, 2017
e4d6020
- Do not open a blank tab when downloading a XSAMS file
nicolasmoreau Mar 9, 2017
429c370
Link to download xsams files replaced by a button, enabled only when …
nicolasmoreau Apr 4, 2017
11bc2e2
change entity annotation to point on prod database instead of dev
nicolasmoreau May 24, 2017
b0379bf
query querystore with https
nicolasmoreau Jun 9, 2017
10d364f
update user agent value
nicolasmoreau Jun 12, 2017
7bda3ae
parameter not renamed in api
nicolasmoreau Jun 12, 2017
87c6ed1
improve code with Misha's remarks
nicolasmoreau Jun 13, 2017
5032b91
fix problem :
nicolasmoreau Jun 13, 2017
ceebeff
improves concurrent execution of processors in multiple nodes
nicolasmoreau Jun 14, 2017
080f67f
Fix problems caused by concurrent execution of multiple query store r…
nicolasmoreau Jun 16, 2017
f74ebef
add missinig package
nicolasmoreau Jun 16, 2017
3aec723
improve error message display
nicolasmoreau Jun 16, 2017
83e79ee
improves error message display in result table
nicolasmoreau Jun 16, 2017
89285b1
update display of saved requests page by removing stats column ( beca…
nicolasmoreau Jun 19, 2017
db205f8
Explicitely instanciate logger in class that are not Seam component
nicolasmoreau Jun 27, 2017
bfa2379
change text position on query save page
nicolasmoreau Jun 27, 2017
f4cb4c0
Merge branch 'dev'
nicolasmoreau Jun 28, 2017
9b5a8b1
remove comments
nicolasmoreau Jun 28, 2017
359d749
Species search selected by default in guided query mode
nicolasmoreau Jun 28, 2017
6582121
improve display of forms
nicolasmoreau Jun 30, 2017
4b9df13
When converting unit of a wavelength, result is converted to integer …
nicolasmoreau Jun 30, 2017
9fcb42a
Add unit test for WavelengthUnitConverter
nicolasmoreau Jul 3, 2017
0db74fd
Search by species is default option in guided query mode
nicolasmoreau Jul 3, 2017
fb89e38
Display "number of atoms / molecules" form in columns instead of lines
nicolasmoreau Jul 3, 2017
0d2214f
Merge branch 'dev'
nicolasmoreau Jul 3, 2017
c93356f
When a request is sent to the querystore, its ip address is found in …
nicolasmoreau Jan 12, 2018
adf429e
corrections of db name for dev version
nicolasmoreau Jan 12, 2018
10ed816
Add a new Tools page and an entry in the main menu.
nicolasmoreau Mar 23, 2018
97a6a3f
Modification in PreviewThread and PreviewManager classes to handle qu…
nicolasmoreau Jun 13, 2018
596de8b
Takes into account HEAD request returned with a status = 204 but valu…
nicolasmoreau Jul 12, 2018
f2a849e
Add a privacy policy page
nicolasmoreau Oct 4, 2019
06623f3
mark not recommended processor explicitely instead of using **
nicolasmoreau May 17, 2022
2252b72
urlencode parameter value in request
nicolasmoreau May 17, 2022
23aaa8b
https in request to node mirros
nicolasmoreau May 17, 2022
b717e7f
Modifications in portal to query https services, required a change in…
nicolasmoreau May 18, 2022
2874c7b
removes duplicated artifact
nicolasmoreau May 18, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions notes
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
03/04/2017:
Problème avec le clic sur les liens vers les fichiers xsams pour declencher l'association des requêtes dans le querystore.
Le javascript rafraichissant la page ne fonctionnait pas sous firefox. Les liens ont été remplacés par des boutons.


13/02/2017:
SEAM retourne des erreurs d'exécution lorsqu'il est lancé avec java8 :
Could not instantiate Seam component: registration

Le fichier ~/.mavenrc a été édité pour que JAVA_HOME pointe sur java7
JAVA_HOME est défini dans deploy.sh pour que jboss utilise java7

Utilise JSF en version 1.x

2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<jaxb.version>2.2.11</jaxb.version>
<jaxws.version>2.2.10</jaxws.version>
<hibernate-commons-annotations.version>3.3.0.ga</hibernate-commons-annotations.version>
<registry-client.version>12.07r2-SNAPSHOT</registry-client.version>
<registry-client.version>12.07r3-SNAPSHOT</registry-client.version>
<query-parser.version>12.07</query-parser.version>
<dictionary.version>12.07r2-SNAPSHOT</dictionary.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
24 changes: 18 additions & 6 deletions portal.ejb/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,7 @@
<groupId>javax.ejb</groupId>
<artifactId>ejb-api</artifactId>
<scope>provided</scope>
</dependency>




</dependency>
<dependency>
<groupId>javax.measure</groupId>
<artifactId>jsr-275</artifactId>
Expand Down Expand Up @@ -110,7 +106,23 @@
<artifactId>servlet-api</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.4.2</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.json/json -->
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20160810</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
Expand Down
3 changes: 3 additions & 0 deletions portal.ejb/src/main/java/org/vamdc/portal/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,13 @@ public enum Settings {
HTTP_DATA_TIMEOUT("HTTPDataTimeout","30000"),
REGISTRY_URL("registryURL","http://registry.vamdc.eu/registry-12.07/services/RegistryQueryv1_0"),
REGISTRY_UPDATE_INTERVAL("registryUpdateInterval","300000"),
QUERYSTORE_ASSOCIATION_URL("querystoreAssociationUrl","https://querystore.vamdc.eu/PortalAssociationService?"),
AVAILABILITY_MONITOR_INTERVAL("availabilityMonitorInterval","300000"),
REGISTRY_RETRY_INTERVAL("registryRetryInterval","10000"),
HTTP_HEAD_TIMEOUT("HTTPHeadTimeout","60000"),
PDL_SERVER_URL("pdlServerURL", "http://vm-euhoutestc62.obspm.fr/vamdc/OnlineCode?"),
PORTAL_USER_AGENT("userAgent", "VAMDC Portal Dev"),
PORTAL_VERSION("version", "2017_06")
;


Expand Down
26 changes: 15 additions & 11 deletions portal.ejb/src/main/java/org/vamdc/portal/entity/EntityFacade.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,52 +17,56 @@
*
*/
public class EntityFacade {

private EntityFacade(){}

public static Collection<String> suggestStoichiometricFormula(
public static Collection<String> suggestMoleculeStoichiometricFormula(
EntityManager entityManager, String value) {
if (!checkValue(value) || entityManager==null)
return Collections.emptyList();

return EntityQuery.suggestStoichForm(entityManager, value.trim());
return EntityQuery.suggestMoleculeStoichForm(entityManager, value.trim());
}


public static Collection<String> suggestOrdinaryFormula(
public static Collection<String> suggestMoleculeOrdinaryFormula(
EntityManager entityManager, String value) {
if (!checkValue(value) || entityManager==null)
return Collections.emptyList();

return EntityQuery.suggestStructForm(entityManager, value);
return EntityQuery.suggestMoleculeStructForm(entityManager, value);
}


public static Collection<String> suggestChemicalName(

public static Collection<String> suggestMoleculeName(
EntityManager entityManager, String value) {
if (!checkValue(value) || entityManager==null)
return Collections.emptyList();

return EntityQuery.suggestSpeciesName(entityManager, value.trim());
return EntityQuery.suggestMoleculeName(entityManager, value.trim());
}


public static List<MoleculeInfo> loadMoleculesFromName(EntityManager em,String value){
String query = "SELECT distinct vs FROM VamdcSpecies vs " +
"INNER JOIN vs.vamdcSpeciesNameses vsn " +
"WHERE vsn.name = :Value";
"WHERE vsn.name = :Value " +
"AND vs.speciesType = 2 ";
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to avoid using magic numbers? Like, replace 2 by a named constant...

return loadElements(em,query,value);
}


public static List<MoleculeInfo> loadMoleculesFromStoichForm(EntityManager em,String value){
String query = "SELECT distinct vs FROM VamdcSpecies vs " +
"WHERE vs.stoichiometricFormula = :Value";
"WHERE vs.stoichiometricFormula = :Value " +
"AND vs.speciesType = 2";
return loadElements(em,query,value);
}

public static List<MoleculeInfo> loadMoleculesFromOrdForm(EntityManager em, String value) {
String query = "SELECT distinct vs FROM VamdcSpecies vs " +
"INNER JOIN vs.vamdcSpeciesStructFormulaes vsf " +
"WHERE vsf.formula = :Value";
"WHERE vsf.formula = :Value " +
"AND vs.speciesType = 2";
return loadElements(em,query,value);
}

Expand Down
52 changes: 48 additions & 4 deletions portal.ejb/src/main/java/org/vamdc/portal/entity/EntityQuery.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.vamdc.portal.entity;

import java.util.Collection;

import javax.persistence.EntityManager;

/**
Expand All @@ -10,6 +9,8 @@
*
*/
class EntityQuery{

private EntityQuery(){}

@SuppressWarnings("unchecked")
static Collection<String> suggestSpeciesName(EntityManager em,
Expand All @@ -21,7 +22,31 @@ static Collection<String> suggestSpeciesName(EntityManager em,
.getResultList();

}

static Collection<String> suggestAtomName(EntityManager em,
String name) {
return suggestRestrictedSpeciesName(em, name, 1);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment about magic numbers & constants


}

static Collection<String> suggestMoleculeName(EntityManager em,
String name) {
return suggestRestrictedSpeciesName(em, name, 2);
}

@SuppressWarnings("unchecked")
private static Collection<String> suggestRestrictedSpeciesName(EntityManager em,
String name, Integer speciesType) {
return em.createQuery("SELECT DISTINCT vsn.name from VamdcSpeciesNames vsn JOIN vsn.vamdcSpecies vsp " +
"WHERE vsn.name LIKE :speciesName and vsn.vamdcMarkupTypes.id=1 and vsp.speciesType=:speciesType "
+ " order by length(vsn.name), vsn.searchPriority")
.setParameter("speciesName", "%"+name+"%")
.setParameter("speciesType", speciesType)
.setMaxResults(20)
.getResultList();

}

@SuppressWarnings("unchecked")
static Collection<String> suggestStoichForm(EntityManager em, String formula){
return em.createQuery("SELECT distinct vs.stoichiometricFormula from VamdcSpecies vs " +
Expand All @@ -31,14 +56,33 @@ static Collection<String> suggestStoichForm(EntityManager em, String formula){
.getResultList();
}


static Collection<String> suggestMoleculeStoichForm(EntityManager em, String formula){
return suggestRestrictedStoichForm(em, formula, 2);
}

@SuppressWarnings("unchecked")
static Collection<String> suggestStructForm(EntityManager em, String formula){
return em.createQuery("SELECT distinct vssf.formula from VamdcSpeciesStructFormulae vssf " +
"WHERE vssf.formula LIKE :formula and vssf.vamdcMarkupTypes.id=1 order by length(vssf.formula), vssf.searchPriority")
private static Collection<String> suggestRestrictedStoichForm(EntityManager em, String formula, Integer speciesType){
return em.createQuery("SELECT distinct vs.stoichiometricFormula from VamdcSpecies vs " +
"WHERE vs.stoichiometricFormula LIKE :formula AND vs.speciesType=:speciesType order by length(vs.stoichiometricFormula)")
.setParameter("formula", "%"+formula+"%")
.setParameter("speciesType", speciesType)
.setMaxResults(20)
.getResultList();
}

static Collection<String> suggestMoleculeStructForm(EntityManager em, String formula){
return suggestRestrictedStructForm(em, formula, 2);
}

@SuppressWarnings("unchecked")
private static Collection<String> suggestRestrictedStructForm(EntityManager em, String formula, Integer speciesType){
return em.createQuery("SELECT distinct vssf.formula from VamdcSpeciesStructFormulae vssf JOIN vssf.vamdcSpecies vs " +
"WHERE vssf.formula LIKE :formula and vssf.vamdcMarkupTypes.id=1 and vs.speciesType=:speciesType order by length(vssf.formula), vssf.searchPriority")
.setParameter("formula", "%"+formula+"%")
.setParameter("speciesType", speciesType)
.setMaxResults(20)
.getResultList();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public String getDescription(){
private Response status;
private Date lastmodified;
private Query query;
private String requestToken;

private Integer recordID;

Expand Down Expand Up @@ -76,6 +77,7 @@ private void retrieveHeaders(HttpURLConnection connection) {
processes = collisions+radiative+nonRadiative;
truncated = getTruncatedValue(connection,"VAMDC-TRUNCATED");
lastmodified = extractLastModified(connection);
requestToken = connection.getHeaderField("VAMDC-REQUEST-TOKEN");
}

private Date extractLastModified(HttpURLConnection connection) {
Expand Down Expand Up @@ -152,6 +154,8 @@ public boolean isLastModSet(){
public int getRadiative() { return radiative; }
public int getNonRadiative() { return nonRadiative; }
public int getCollisions() { return collisions; }
public String getRequestToken(){ return requestToken; }

@Transient
public int getTruncated() { return truncated; }

Expand All @@ -161,7 +165,7 @@ public boolean isLastModSet(){
public void setRadiative(int radiative) { this.radiative = radiative; }
public void setNonRadiative(int nonRadiative) { this.nonRadiative = nonRadiative; }
public void setCollisions(int collisions) { this.collisions = collisions; }

public void setRequestToken(String token){ this.requestToken = token; }

@Lob
public String getFullQueryURL() { return fullQueryURL; }
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,22 @@
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.validator.NotNull;
import org.vamdc.portal.Settings;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you need this import here?


/**
* VamdcInchikeyExceptions generated by hbm2java
*/
@Entity
@Table(name = "vamdc_inchikey_exceptions", catalog = "vamdc_species")
@Table(name = "vamdc_inchikey_exceptions", catalog = "vamdc_species_dev")
public class VamdcInchikeyExceptions implements java.io.Serializable {

private Integer id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* VamdcMarkupTypes generated by hbm2java
*/
@Entity
@Table(name = "vamdc_markup_types", catalog = "vamdc_species")
@Table(name = "vamdc_markup_types", catalog = "vamdc_species_dev")
public class VamdcMarkupTypes implements java.io.Serializable {

private int id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* VamdcMemberDatabaseIdentifiers generated by hbm2java
*/
@Entity
@Table(name = "vamdc_member_database_identifiers", catalog = "vamdc_species", uniqueConstraints = @UniqueConstraint(columnNames = {
@Table(name = "vamdc_node_species", catalog = "vamdc_species_dev", uniqueConstraints = @UniqueConstraint(columnNames = {
"species_id", "database_species_id", "member_database_id" }))
public class VamdcMemberDatabaseIdentifiers implements java.io.Serializable {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* VamdcMemberDatabases generated by hbm2java
*/
@Entity
@Table(name = "vamdc_member_databases", catalog = "vamdc_species")
@Table(name = "vamdc_nodes", catalog = "vamdc_species_dev")
public class VamdcMemberDatabases implements java.io.Serializable {

private Integer id;
Expand Down
Loading