Skip to content

Commit

Permalink
Merge pull request #60 from nicolasmoreau/master
Browse files Browse the repository at this point in the history
Dev to prod commit
  • Loading branch information
nicolasmoreau authored May 24, 2017
2 parents 8419899 + 429c370 commit b95120c
Show file tree
Hide file tree
Showing 35 changed files with 433 additions and 320 deletions.
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

11 changes: 11 additions & 0 deletions portal.ejb/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,17 @@
<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>
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","http://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_02")
;


Expand Down
17 changes: 6 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,6 +17,8 @@
*
*/
public class EntityFacade {

private EntityFacade(){}

public static Collection<String> suggestMoleculeStoichiometricFormula(
EntityManager entityManager, String value) {
Expand All @@ -34,15 +36,6 @@ public static Collection<String> suggestMoleculeOrdinaryFormula(

return EntityQuery.suggestMoleculeStructForm(entityManager, value);
}


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

public static Collection<String> suggestMoleculeName(
EntityManager entityManager, String value) {
Expand All @@ -64,14 +57,16 @@ public static List<MoleculeInfo> loadMoleculesFromName(EntityManager em,String v

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
13 changes: 2 additions & 11 deletions portal.ejb/src/main/java/org/vamdc/portal/entity/EntityQuery.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
*
*/
class EntityQuery{

private EntityQuery(){}

@SuppressWarnings("unchecked")
static Collection<String> suggestSpeciesName(EntityManager em,
Expand Down Expand Up @@ -83,15 +85,4 @@ private static Collection<String> suggestRestrictedStructForm(EntityManager em,
.getResultList();
}

//@SuppressWarnings("unchecked")
/*static Collection<String> suggestStructForm(EntityManager em, String formula){
return em.createQuery("SELECT distinct vssf.formula from VamdcSpeciesStructFormulae vssf JOIN vssf.vamdcSpecies vs" +
"WHERE vssf.formula LIKE :formula and vssf.vamdcMarkupTypes.id=1 order by length(vssf.formula), vssf.searchPriority")
.setParameter("formula", "%"+formula+"%")
.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;

/**
* 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

0 comments on commit b95120c

Please sign in to comment.