diff --git a/portal.ejb/src/main/java/org/vamdc/portal/cookie/DisclaimerCookie.java b/portal.ejb/src/main/java/org/vamdc/portal/cookie/DisclaimerCookie.java index 3379fe3..a048993 100644 --- a/portal.ejb/src/main/java/org/vamdc/portal/cookie/DisclaimerCookie.java +++ b/portal.ejb/src/main/java/org/vamdc/portal/cookie/DisclaimerCookie.java @@ -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 ); } } diff --git a/portal.ejb/src/main/java/org/vamdc/portal/session/preview/PreviewManager.java b/portal.ejb/src/main/java/org/vamdc/portal/session/preview/PreviewManager.java index 61dc6be..2ac24b6 100644 --- a/portal.ejb/src/main/java/org/vamdc/portal/session/preview/PreviewManager.java +++ b/portal.ejb/src/main/java/org/vamdc/portal/session/preview/PreviewManager.java @@ -175,14 +175,18 @@ public void completeEvent(){ this.completeEventCalled=true; List 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); } diff --git a/portal.ejb/src/main/java/org/vamdc/portal/session/queryBuilder/formsTree/WithReactionCollisionForm.java b/portal.ejb/src/main/java/org/vamdc/portal/session/queryBuilder/formsTree/WithReactionCollisionForm.java index c6fab7b..9f10369 100644 --- a/portal.ejb/src/main/java/org/vamdc/portal/session/queryBuilder/formsTree/WithReactionCollisionForm.java +++ b/portal.ejb/src/main/java/org/vamdc/portal/session/queryBuilder/formsTree/WithReactionCollisionForm.java @@ -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 diff --git a/portal.ejb/src/main/java/org/vamdc/portal/session/security/Register.java b/portal.ejb/src/main/java/org/vamdc/portal/session/security/Register.java index c799986..6768067 100644 --- a/portal.ejb/src/main/java/org/vamdc/portal/session/security/Register.java +++ b/portal.ejb/src/main/java/org/vamdc/portal/session/security/Register.java @@ -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; @@ -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!"); @@ -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) diff --git a/portal.war/src/main/webapp/layout/header.xhtml b/portal.war/src/main/webapp/layout/header.xhtml index bc73cf9..83cffa0 100755 --- a/portal.war/src/main/webapp/layout/header.xhtml +++ b/portal.war/src/main/webapp/layout/header.xhtml @@ -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"> - - - \ No newline at end of file diff --git a/portal.war/src/main/webapp/layout/template.xhtml b/portal.war/src/main/webapp/layout/template.xhtml index 1fb8502..5160c8c 100644 --- a/portal.war/src/main/webapp/layout/template.xhtml +++ b/portal.war/src/main/webapp/layout/template.xhtml @@ -23,7 +23,11 @@ window.history.forward();
- + + +
diff --git a/portal.war/src/main/webapp/nodes.xhtml b/portal.war/src/main/webapp/nodes.xhtml index 07219da..8a64fce 100644 --- a/portal.war/src/main/webapp/nodes.xhtml +++ b/portal.war/src/main/webapp/nodes.xhtml @@ -10,7 +10,7 @@ - + diff --git a/portal.war/src/main/webapp/stylesheet/style.css b/portal.war/src/main/webapp/stylesheet/style.css index ca61ee2..f1f0312 100644 --- a/portal.war/src/main/webapp/stylesheet/style.css +++ b/portal.war/src/main/webapp/stylesheet/style.css @@ -185,3 +185,7 @@ -moz-border-radius: 10px; border-radius: 10px; } + +.nodesTable{ + width : 90%; +} diff --git a/portal.war/src/main/webapp/xhtml/disclaimer/disclaimerValidation.xhtml b/portal.war/src/main/webapp/xhtml/disclaimer/disclaimerValidation.xhtml index 71411e5..eee60f7 100644 --- a/portal.war/src/main/webapp/xhtml/disclaimer/disclaimerValidation.xhtml +++ b/portal.war/src/main/webapp/xhtml/disclaimer/disclaimerValidation.xhtml @@ -8,9 +8,9 @@ xmlns:rich="http://richfaces.org/rich">

- 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 ) :

- + @@ -20,4 +20,6 @@ + + diff --git a/portal.war/src/main/webapp/xhtml/query/formMenu.xhtml b/portal.war/src/main/webapp/xhtml/query/formMenu.xhtml index e091b3e..85a4585 100644 --- a/portal.war/src/main/webapp/xhtml/query/formMenu.xhtml +++ b/portal.war/src/main/webapp/xhtml/query/formMenu.xhtml @@ -49,7 +49,7 @@ action="#{query.addFormBranches}" /> -