Skip to content

Commit

Permalink
Merge pull request #80 from nicolasmoreau/master
Browse files Browse the repository at this point in the history
Add a tool page
  • Loading branch information
nicolasmoreau authored Mar 23, 2018
2 parents 76d8c8f + 8677b8b commit 7476d32
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,10 @@ public RadiativeForm(){
addField(wlField);
AbstractField field = new UnitConvRangeField(Restrictable.StateEnergy, "Upper state energy", new EnergyUnitConverter());
field.setPrefix("upper");
addField(field);
//addField(new RangeField("upper",Restrictable.StateEnergy,"Upper state energy"));
addField(field);;
field = new UnitConvRangeField(Restrictable.StateEnergy, "Lower state energy", new EnergyUnitConverter());
field.setPrefix("lower");
addField(field);
//addField(new RangeField("lower",Restrictable.StateEnergy,"Lower state energy"));
addField(new RangeField(Restrictable.RadTransProbabilityA,"Probability, A"));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,20 +79,18 @@ private QueryStoreResponse associateRequest(String token, String userIp) {
try {
String request = this.getRequest(token, this.getUserEmail(),
this.userIp);

// send request while no result or result is empty
while ((result == null || QueryStoreResponse.STATUS_EMPTY.equals(result.getStatus()))
&& count < Settings.QUERYSTORE_MAX_RETRY.getInt()) {
result = this.doRequest(request);
//if(result != null)
Thread.sleep(Settings.QUERYSTORE_RETRY_TIMER.getInt());
count++;
}

} catch (Exception e) {
log.debug(e);
new QueryStoreResponse(QueryStoreResponse.STATUS_ERROR, "", "Error while querying query store");

}
result = new QueryStoreResponse(QueryStoreResponse.STATUS_ERROR, "", "Error while querying query store");
}
return result;
}

Expand Down Expand Up @@ -125,17 +123,14 @@ private QueryStoreResponse doRequest(String requestString)
//SSLHandShakeException (IOException) occurs if missing certificate
HttpResponse response = httpClient.execute(request);
Integer statusCode = response.getStatusLine().getStatusCode();

if ( statusCode == 200) {
BufferedReader rd = new BufferedReader(new InputStreamReader(
response.getEntity().getContent()));

String uuid;
while ((uuid = rd.readLine()) != null) {
result.append(uuid);
}
rd.close();

} else {
// empty response
if (statusCode == 204) {
Expand All @@ -150,7 +145,6 @@ else if (statusCode >= 400 && statusCode < 500) {
return new QueryStoreResponse(QueryStoreResponse.STATUS_ERROR, "", response.getStatusLine().getReasonPhrase());
}
}

// extract uuid from json response
return QueryStoreResponseReader.parseResponse(result.toString());
}
Expand Down
2 changes: 2 additions & 0 deletions portal.war/src/main/webapp/layout/menu.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
propagation="none" />
<s:link id="menuHelp" view="/help.xhtml" value="Info"
propagation="none" />
<s:link id="menuTools" view="/tools.xhtml" value="Tools"
propagation="none" />
</rich:toolBarGroup>
<rich:toolBarGroup location="right">
<h:outputText value="Welcome, #{identity.username}!"
Expand Down
33 changes: 33 additions & 0 deletions portal.war/src/main/webapp/tools.xhtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:s="http://jboss.com/products/seam/taglib"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:rich="http://richfaces.org/rich"
template="/layout/template.xhtml">

<ui:define name="body">
<h3>The VAMDC species database</h3>
<p>
<h:outputLink value="https://species.vamdc.eu" target="_blank">Discover the content of each database in the VAMDC infrastructure</h:outputLink>
</p>
<p>
<h:outputText
value="This website centralizes the list of species of all the databases in the VAMDC infrastructure. It provides search features to quickly
discover where a given species can be found and the type of provided data." />
</p>
<h3>Hitran file display and comparison</h3>
<p>
<h:outputLink value="http://www.vamdc.org/hitran-display/" target="_blank">Plot data exported in HITRAN format</h:outputLink>
</p>
<p>
<h:outputText
value="The VAMDC Portal provides a web service to convert a XSAMS file containing spectroscopic molecular data into a file in HITRAN format.
The output of this web service can be visualized thanks to the web page above." />
</p>


</ui:define>
</ui:composition>

0 comments on commit 7476d32

Please sign in to comment.