Skip to content

Commit

Permalink
Merge pull request #34 from nicolasmoreau/master
Browse files Browse the repository at this point in the history
Merge production version with dev
  • Loading branch information
nicolasmoreau committed Sep 11, 2015
2 parents b417acf + c07b89f commit aa00759
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public Boolean getValue(){
}

public void setValue(Boolean value){
// 5 years expire date
cookieHelper.setCookie(this.name, value.toString(), 5 * 365 * 24 * 60 * 60 );
// 1 year expire date
cookieHelper.setCookie(this.name, value.toString(), 365 * 24 * 60 * 60 );
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -175,14 +175,18 @@ public void completeEvent(){
this.completeEventCalled=true;
List<HttpHeadResponse> results = getNodes();
int numActive=0;
String nodeId = null;


for (HttpHeadResponse node:results){

if (node.isOk() && node.getStatus()==Response.OK)
if (node.isOk() && node.getStatus()==Response.OK){
nodeId = node.getIvoaID();
numActive++;
}
}

if (numActive==1){
consumers.updateNodeIds(nodeId);
consumers.getQueries().put(results.get(0).getFullQueryURL(), true);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public void setMaxElementCount(Integer maxElementCount) {

@Override
public String getTitle() {
return "Please, enter the number of targets and colliders you wish to add";
return "Please, enter the number of reactants and products you wish to add";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package org.vamdc.portal.session.security;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.In;
Expand Down Expand Up @@ -38,7 +41,11 @@ public void register()
new RunAsOperation() {
@Override
public void execute() {
if (!identityManager.userExists(username)){
if(password.equals(verifyPassword) == false){
throw new IdentityManagementException("Password and verification password do not match.");
}else if(isValidEmail() == false){
throw new IdentityManagementException("Email address is not valid.");
} else if (!identityManager.userExists(username)){
identityManager.createUser(username,password);
}else{
throw new IdentityManagementException("User #{register.username} already exists!");
Expand All @@ -53,6 +60,12 @@ public void execute() {
}

}

private Boolean isValidEmail(){
Pattern pattern = Pattern.compile("^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,6}$", Pattern.CASE_INSENSITIVE);
Matcher matcher = pattern.matcher(email);
return matcher.find();
}


@Observer(JpaIdentityStore.EVENT_PRE_PERSIST_USER)
Expand Down
6 changes: 0 additions & 6 deletions portal.war/src/main/webapp/layout/header.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,11 @@
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:s="http://jboss.com/products/seam/taglib"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich" styleClass="my-toolbar-header">

<h:panelGrid columns="2">
<h:outputLink value="http://vamdc.eu">
<h:graphicImage value="/img/vamdc_logo.png" alt="vamdc_logo"/>
</h:outputLink>
<a4j:region selfRendered="true">
<h:messages id="messages" globalOnly="true" styleClass="message"
errorClass="errormsg" infoClass="infomsg" warnClass="warnmsg"
rendered="#{showGlobalMessages != 'false'}" />
</a4j:region>
</h:panelGrid>
</s:span>
6 changes: 5 additions & 1 deletion portal.war/src/main/webapp/layout/template.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ window.history.forward();
<div class="header"><ui:include src="header.xhtml"/></div>
<ui:include src="menu.xhtml"/>
<div class="body">

<a:region selfRendered="true">
<h:messages id="messages" globalOnly="true" styleClass="message"
errorClass="errormsg" infoClass="infomsg" warnClass="warnmsg"
rendered="#{showGlobalMessages != 'false'}" />
</a:region>
<ui:insert name="body" />
</div>

Expand Down
2 changes: 1 addition & 1 deletion portal.war/src/main/webapp/nodes.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<ui:define name="body">

<rich:dataTable id="queryListAll" value="#{nodes.nodes}" var="node">
<rich:dataTable id="queryListAll" value="#{nodes.nodes}" var="node" styleClass="nodesTable">
<f:facet name="header">
<rich:columnGroup>
<h:column>
Expand Down
4 changes: 4 additions & 0 deletions portal.war/src/main/webapp/stylesheet/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -185,3 +185,7 @@
-moz-border-radius: 10px;
border-radius: 10px;
}

.nodesTable{
width : 90%;
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
xmlns:rich="http://richfaces.org/rich">

<p class="disclaimer">
You must accept the following disclaimer to use our services :
You must accept the following disclaimer to use our services ( this will install a cookie in your web browser ) :
</p>
<ui:include src="disclaimerText.xhtml"></ui:include>

<h:form class="disclaimer">
<!-- -->
<input type="hidden" name="sourcePage" value="#{view.viewId}" />
Expand All @@ -20,4 +20,6 @@

<h:commandButton value="Submit" action="#{disclaimerForm.validate}" />
</h:form>

<ui:include src="disclaimerText.xhtml"></ui:include>
</ui:composition>
2 changes: 1 addition & 1 deletion portal.war/src/main/webapp/xhtml/query/formMenu.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
action="#{query.addFormBranches}" />
<rich:menuItem value="Comments" reRender="formPanel"
action="#{query.addFormComments}" />
<!-- <rich:menuItem value="Asynchronous request" reRender="formPanel"
<!--<rich:menuItem value="Asynchronous request" reRender="formPanel"
action="#{query.addFormAsync}" />-->
</rich:dropDownMenu>

Expand Down

0 comments on commit aa00759

Please sign in to comment.