You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by mg...@apache.org on 2014/12/29 21:13:47 UTC
[5/6] isis git commit: ISIS-987 Provide some sort of mechanism to
allow users to self-register for an Isis application.
ISIS-987 Provide some sort of mechanism to allow users to self-register for an Isis application.
Extract an abstract page for all account management related pages - AccountManagementPageAbstract.
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/92e4db6a
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/92e4db6a
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/92e4db6a
Branch: refs/heads/ISIS-987
Commit: 92e4db6a96b0bb145676612eb58f5b0221c4fff1
Parents: a51a1fd
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Mon Dec 29 21:31:28 2014 +0200
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Mon Dec 29 22:13:14 2014 +0200
----------------------------------------------------------------------
.../wicket/viewer/IsisWicketApplication.java | 4 +-
.../registries/pages/PageClassListDefault.java | 7 +-
.../viewer/wicket/model/models/PageType.java | 2 +-
.../ui/pages/AccountManagementPageAbstract.html | 62 ++++++++
.../ui/pages/AccountManagementPageAbstract.java | 126 +++++++++++++++
.../wicket/ui/pages/login/IsisSignInPanel.html | 2 +-
.../wicket/ui/pages/login/IsisSignInPanel.java | 9 ++
.../wicket/ui/pages/login/WicketSignInPage.html | 43 +-----
.../wicket/ui/pages/login/WicketSignInPage.java | 97 +-----------
.../signup/AccountConfirmationMap.java | 153 +++++++++++++++++++
.../password_reset/signup/PasswordResetPage.css | 100 ++++++++++++
.../signup/PasswordResetPage.html | 39 +++++
.../signup/PasswordResetPage.java | 53 +++++++
.../signup/PasswordResetPage.properties | 26 ++++
.../signup/PasswordResetPanel.html | 34 +++++
.../signup/PasswordResetPanel.java | 113 ++++++++++++++
.../wicket/ui/pages/register/RegisterPage.java | 109 +------------
.../ui/pages/signup/RegistrationFormPage.java | 105 ++-----------
.../ui/pages/signup/RegistrationFormPanel.html | 34 +++++
.../ui/pages/signup/RegistrationFormPanel.java | 113 ++++++++++++++
.../wicket/ui/pages/signup/SignUpPanel.html | 34 -----
.../wicket/ui/pages/signup/SignUpPanel.java | 113 --------------
22 files changed, 900 insertions(+), 478 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/92e4db6a/component/viewer/wicket/impl/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/impl/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java b/component/viewer/wicket/impl/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java
index ebb1590..3779d13 100644
--- a/component/viewer/wicket/impl/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java
+++ b/component/viewer/wicket/impl/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java
@@ -563,7 +563,7 @@ public class IsisWicketApplication extends AuthenticatedWebApplication implement
mountPage("/signin", PageType.SIGN_IN);
mountPage("/signup", PageType.SIGN_UP);
mountPage("/signup/verify", PageType.SIGN_UP_VERIFY);
- mountPage("/password/recovery", PageType.FORGOT_PASSWORD);
+ mountPage("/password/reset", PageType.PASSWORD_RESET);
mountPage("/entity/${objectOid}", PageType.ENTITY);
@@ -769,7 +769,7 @@ public class IsisWicketApplication extends AuthenticatedWebApplication implement
*/
@SuppressWarnings("unchecked")
public Class<? extends WebPage> getForgotPasswordPageClass() {
- return (Class<? extends WebPage>) getPageClassRegistry().getPageClass(PageType.FORGOT_PASSWORD);
+ return (Class<? extends WebPage>) getPageClassRegistry().getPageClass(PageType.PASSWORD_RESET);
}
http://git-wip-us.apache.org/repos/asf/isis/blob/92e4db6a/component/viewer/wicket/impl/src/main/java/org/apache/isis/viewer/wicket/viewer/registries/pages/PageClassListDefault.java
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/impl/src/main/java/org/apache/isis/viewer/wicket/viewer/registries/pages/PageClassListDefault.java b/component/viewer/wicket/impl/src/main/java/org/apache/isis/viewer/wicket/viewer/registries/pages/PageClassListDefault.java
index 7e91d1f..508c183 100644
--- a/component/viewer/wicket/impl/src/main/java/org/apache/isis/viewer/wicket/viewer/registries/pages/PageClassListDefault.java
+++ b/component/viewer/wicket/impl/src/main/java/org/apache/isis/viewer/wicket/viewer/registries/pages/PageClassListDefault.java
@@ -31,6 +31,7 @@ import org.apache.isis.viewer.wicket.ui.pages.actionprompt.ActionPromptPage;
import org.apache.isis.viewer.wicket.ui.pages.entity.EntityPage;
import org.apache.isis.viewer.wicket.ui.pages.home.HomePage;
import org.apache.isis.viewer.wicket.ui.pages.login.WicketSignInPage;
+import org.apache.isis.viewer.wicket.ui.pages.password_reset.signup.PasswordResetPage;
import org.apache.isis.viewer.wicket.ui.pages.register.RegisterPage;
import org.apache.isis.viewer.wicket.ui.pages.signup.RegistrationFormPage;
import org.apache.isis.viewer.wicket.ui.pages.standalonecollection.StandaloneCollectionPage;
@@ -51,7 +52,7 @@ public class PageClassListDefault implements PageClassList {
pageRegistry.registerPage(PageType.SIGN_IN, getSignInPageClass());
pageRegistry.registerPage(PageType.SIGN_UP, getSignUpPageClass());
pageRegistry.registerPage(PageType.SIGN_UP_VERIFY, getSignUpVerifyPageClass());
- pageRegistry.registerPage(PageType.FORGOT_PASSWORD, getForgotPasswordPageClass());
+ pageRegistry.registerPage(PageType.PASSWORD_RESET, getPasswordResetPageClass());
pageRegistry.registerPage(PageType.ABOUT, getAboutPageClass());
pageRegistry.registerPage(PageType.ENTITY, getEntityPageClass());
pageRegistry.registerPage(PageType.HOME, getHomePageClass());
@@ -120,8 +121,8 @@ public class PageClassListDefault implements PageClassList {
/**
* For subclassing if required.
*/
- protected Class<? extends Page> getForgotPasswordPageClass() {
- return RegistrationFormPage.class;
+ protected Class<? extends Page> getPasswordResetPageClass() {
+ return PasswordResetPage.class;
}
/**
http://git-wip-us.apache.org/repos/asf/isis/blob/92e4db6a/component/viewer/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/models/PageType.java
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/models/PageType.java b/component/viewer/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/models/PageType.java
index 10d081f..f23b506 100644
--- a/component/viewer/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/models/PageType.java
+++ b/component/viewer/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/models/PageType.java
@@ -33,7 +33,7 @@ public enum PageType {
SIGN_IN,
SIGN_UP,
SIGN_UP_VERIFY,
- FORGOT_PASSWORD,
+ PASSWORD_RESET,
HOME,
ABOUT,
ENTITY,
http://git-wip-us.apache.org/repos/asf/isis/blob/92e4db6a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/AccountManagementPageAbstract.html
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/AccountManagementPageAbstract.html b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/AccountManagementPageAbstract.html
new file mode 100644
index 0000000..b59b636
--- /dev/null
+++ b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/AccountManagementPageAbstract.html
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:wicket="http://wicket.apache.org"
+ xml:lang="en"
+ lang="en">
+ <head>
+ <wicket:header-items/>
+ <title wicket:id="pageTitle"></title>
+ </head>
+ <body>
+ <div class="accountManagementPanel container-fluid">
+ <div class="jumbotron" style="background-color: transparent">
+
+ <div class="row">
+ <div class="col-sm-12"> </div>
+ </div>
+ <div class="row">
+ <div class="col-sm-12"> </div>
+ </div>
+ <div class="row">
+ <div class="col-sm-12"> </div>
+ </div>
+
+ <div class="row">
+ <div class="headerContainer col-sm-offset-4 col-sm-4">
+ <h1 wicket:id="applicationName" class="applicationName">[application name]</h1>
+ </div>
+ </div>
+
+ <div class="row">
+ <div class="col-sm-12"> </div>
+ </div>
+ <div class="row">
+ <div class="col-sm-12"> </div>
+ </div>
+
+ <wicket:child/>
+
+ </div>
+ <div wicket:id="exceptionStackTrace" class="exceptionStackTrace"></div>
+ </div>
+ </body>
+</html>
http://git-wip-us.apache.org/repos/asf/isis/blob/92e4db6a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/AccountManagementPageAbstract.java
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/AccountManagementPageAbstract.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/AccountManagementPageAbstract.java
new file mode 100644
index 0000000..ac5cc42
--- /dev/null
+++ b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/AccountManagementPageAbstract.java
@@ -0,0 +1,126 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.isis.viewer.wicket.ui.pages;
+
+import com.google.inject.Inject;
+import com.google.inject.name.Named;
+import org.apache.wicket.Application;
+import org.apache.wicket.MarkupContainer;
+import org.apache.wicket.markup.head.CssReferenceHeaderItem;
+import org.apache.wicket.markup.head.IHeaderResponse;
+import org.apache.wicket.markup.head.JavaScriptHeaderItem;
+import org.apache.wicket.markup.head.JavaScriptReferenceHeaderItem;
+import org.apache.wicket.markup.head.PriorityHeaderItem;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.WebPage;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+import org.apache.isis.core.commons.config.IsisConfiguration;
+import org.apache.isis.core.runtime.system.context.IsisContext;
+import org.apache.isis.viewer.wicket.ui.errors.ExceptionModel;
+import org.apache.isis.viewer.wicket.ui.errors.ExceptionStackTracePanel;
+
+/**
+ * Boilerplate, pick up our HTML and CSS.
+ */
+public class AccountManagementPageAbstract extends WebPage {
+
+ private static final long serialVersionUID = 1L;
+
+ private static final String ID_PAGE_TITLE = "pageTitle";
+ private static final String ID_APPLICATION_NAME = "applicationName";
+
+ private static final String ID_EXCEPTION_STACK_TRACE = "exceptionStackTrace";
+
+ /**
+ * {@link com.google.inject.Inject}ed when {@link #init() initialized}.
+ */
+ @Inject
+ @Named("applicationName")
+ private String applicationName;
+
+ /**
+ * {@link com.google.inject.Inject}ed when {@link #init() initialized}.
+ */
+ @Inject
+ @Named("applicationCss")
+ private String applicationCss;
+
+ /**
+ * {@link com.google.inject.Inject}ed when {@link #init() initialized}.
+ */
+ @Inject
+ @Named("applicationJs")
+ private String applicationJs;
+
+ /**
+ * If set by {@link PageAbstract}.
+ */
+ protected static ExceptionModel getAndClearExceptionModelIfAny() {
+ ExceptionModel exceptionModel = PageAbstract.EXCEPTION.get();
+ PageAbstract.EXCEPTION.remove();
+ return exceptionModel;
+ }
+
+ public AccountManagementPageAbstract(final PageParameters parameters, final ExceptionModel exceptionModel) {
+ super(parameters);
+
+ addPageTitle();
+ addApplicationName();
+
+ if(exceptionModel != null) {
+ add(new ExceptionStackTracePanel(ID_EXCEPTION_STACK_TRACE, exceptionModel));
+ } else {
+ add(new WebMarkupContainer(ID_EXCEPTION_STACK_TRACE).setVisible(false));
+ }
+ }
+
+ private MarkupContainer addPageTitle() {
+ return add(new Label(ID_PAGE_TITLE, applicationName));
+ }
+
+ private void addApplicationName() {
+ add(new Label(ID_APPLICATION_NAME, applicationName));
+ }
+
+ @Override
+ public void renderHead(IHeaderResponse response) {
+ super.renderHead(response);
+ response.render(new PriorityHeaderItem(JavaScriptHeaderItem.forReference(Application.get().getJavaScriptLibrarySettings().getJQueryReference())));
+
+ if(applicationCss != null) {
+ response.render(CssReferenceHeaderItem.forUrl(applicationCss));
+ }
+ if(applicationJs != null) {
+ response.render(JavaScriptReferenceHeaderItem.forUrl(applicationJs));
+ }
+ }
+
+
+
+ // ///////////////////////////////////////////////////
+ // System components
+ // ///////////////////////////////////////////////////
+
+ protected IsisConfiguration getConfiguration() {
+ return IsisContext.getConfiguration();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/92e4db6a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/login/IsisSignInPanel.html
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/login/IsisSignInPanel.html b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/login/IsisSignInPanel.html
index b521539..ed94df4 100644
--- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/login/IsisSignInPanel.html
+++ b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/login/IsisSignInPanel.html
@@ -39,7 +39,7 @@
<button type="reset" class="btn btn-default"><wicket:message key="resetButtonLabel"/></button>
<div class="form-group">
- <button type="button" class="btn btn-block btn-link"><wicket:message key="forgotPasswordLinkLabel"/></button>
+ <a wicket:id="passwdResetLink" class="btn btn-block btn-link"><wicket:message key="forgotPasswordLinkLabel"/></a>
</div>
<div class="form-group" wicket:enclosure="signUpLink">
http://git-wip-us.apache.org/repos/asf/isis/blob/92e4db6a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/login/IsisSignInPanel.java
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/login/IsisSignInPanel.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/login/IsisSignInPanel.java
index b9695f2..981e1e4 100644
--- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/login/IsisSignInPanel.java
+++ b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/login/IsisSignInPanel.java
@@ -67,11 +67,20 @@ public class IsisSignInPanel extends SignInPanel {
protected void onInitialize() {
super.onInitialize();
+ addPasswdResetLink("passwdResetLink");
+
addSignUpLink("signUpLink");
addNotificationPanel("feedback");
}
+ private void addPasswdResetLink(String id) {
+ Class<? extends Page> passwdResetPageClass = pageClassRegistry.getPageClass(PageType.PASSWORD_RESET);
+ BookmarkablePageLink<Void> passwdResetLink = new BookmarkablePageLink<>(id, passwdResetPageClass);
+
+ getSignInForm().addOrReplace(passwdResetLink);
+ }
+
protected void addNotificationPanel(String id) {
addOrReplace(new NotificationPanel(id));
}
http://git-wip-us.apache.org/repos/asf/isis/blob/92e4db6a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/login/WicketSignInPage.html
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/login/WicketSignInPage.html b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/login/WicketSignInPage.html
index 1348d57..75aff05 100644
--- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/login/WicketSignInPage.html
+++ b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/login/WicketSignInPage.html
@@ -22,45 +22,14 @@
xmlns:wicket="http://wicket.apache.org"
xml:lang="en"
lang="en">
- <head>
- <wicket:header-items/>
- <title wicket:id="pageTitle"></title>
- </head>
<body>
- <div id="container" class="wicketSignInPanel container-fluid">
- <div class="jumbotron" style="background-color: transparent">
-
- <div class="row">
- <div class="col-sm-12"> </div>
- </div>
- <div class="row">
- <div class="col-sm-12"> </div>
- </div>
- <div class="row">
- <div class="col-sm-12"> </div>
- </div>
-
- <div class="row">
- <div class="headerContainer col-sm-offset-4 col-sm-4">
- <h1 wicket:id="applicationName" class="applicationName">[application name]</h1>
- </div>
- </div>
-
- <div class="row">
- <div class="col-sm-12"> </div>
- </div>
- <div class="row">
- <div class="col-sm-12"> </div>
- </div>
-
- <div class="row">
- <div class="loginPanel col-sm-offset-4 col-sm-4">
- <h2><wicket:message key="loginHeader">Login</wicket:message></h2>
- <div wicket:id="signInPanel"></div>
- </div>
+ <wicket:extend>
+ <div class="row">
+ <div class="loginPanel col-sm-offset-4 col-sm-4">
+ <h2><wicket:message key="loginHeader">Login</wicket:message></h2>
+ <div wicket:id="signInPanel"></div>
</div>
</div>
- <div wicket:id="exceptionStackTrace" class="exceptionStackTrace"></div>
- </div>
+ </wicket:extend>
</body>
</html>
http://git-wip-us.apache.org/repos/asf/isis/blob/92e4db6a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/login/WicketSignInPage.java
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/login/WicketSignInPage.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/login/WicketSignInPage.java
index a2d9a17..6439b6f 100644
--- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/login/WicketSignInPage.java
+++ b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/login/WicketSignInPage.java
@@ -19,90 +19,31 @@
package org.apache.isis.viewer.wicket.ui.pages.login;
-import com.google.inject.Inject;
-import com.google.inject.name.Named;
-import org.apache.wicket.Application;
-import org.apache.wicket.MarkupContainer;
import org.apache.wicket.authroles.authentication.panel.SignInPanel;
-import org.apache.wicket.markup.head.*;
-import org.apache.wicket.markup.html.WebMarkupContainer;
-import org.apache.wicket.markup.html.WebPage;
-import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.request.mapper.parameter.PageParameters;
-import org.apache.isis.core.commons.config.IsisConfiguration;
-import org.apache.isis.core.runtime.system.context.IsisContext;
import org.apache.isis.viewer.wicket.ui.errors.ExceptionModel;
-import org.apache.isis.viewer.wicket.ui.errors.ExceptionStackTracePanel;
-import org.apache.isis.viewer.wicket.ui.pages.PageAbstract;
+import org.apache.isis.viewer.wicket.ui.pages.AccountManagementPageAbstract;
/**
* Boilerplate, pick up our HTML and CSS.
*/
-public class WicketSignInPage extends WebPage {
+public class WicketSignInPage extends AccountManagementPageAbstract {
private static final long serialVersionUID = 1L;
- private static final String ID_PAGE_TITLE = "pageTitle";
- private static final String ID_APPLICATION_NAME = "applicationName";
-
- private static final String ID_EXCEPTION_STACK_TRACE = "exceptionStackTrace";
-
- /**
- * {@link Inject}ed when {@link #init() initialized}.
- */
- @Inject
- @Named("applicationName")
- private String applicationName;
-
- /**
- * {@link Inject}ed when {@link #init() initialized}.
- */
- @Inject
- @Named("applicationCss")
- private String applicationCss;
-
- /**
- * {@link Inject}ed when {@link #init() initialized}.
- */
- @Inject
- @Named("applicationJs")
- private String applicationJs;
-
- /**
- * If set by {@link PageAbstract}.
- */
- private static ExceptionModel getAndClearExceptionModelIfAny() {
- ExceptionModel exceptionModel = PageAbstract.EXCEPTION.get();
- PageAbstract.EXCEPTION.remove();
- return exceptionModel;
- }
-
- public WicketSignInPage() {
- this(null);
- }
-
public WicketSignInPage(final PageParameters parameters) {
this(parameters, getAndClearExceptionModelIfAny());
}
public WicketSignInPage(final PageParameters parameters, ExceptionModel exceptionModel) {
- addPageTitle();
- addApplicationName();
- addSignInPanel();
-
- if(exceptionModel != null) {
- add(new ExceptionStackTracePanel(ID_EXCEPTION_STACK_TRACE, exceptionModel));
- } else {
- add(new WebMarkupContainer(ID_EXCEPTION_STACK_TRACE).setVisible(false));
- }
+ super(parameters, exceptionModel);
}
- private MarkupContainer addPageTitle() {
- return add(new Label(ID_PAGE_TITLE, applicationName));
- }
+ @Override
+ protected void onInitialize() {
+ super.onInitialize();
- private void addApplicationName() {
- add(new Label(ID_APPLICATION_NAME, applicationName));
+ addSignInPanel();
}
protected SignInPanel addSignInPanel() {
@@ -123,28 +64,4 @@ public class WicketSignInPage extends WebPage {
add(signInPanel);
return signInPanel;
}
-
- @Override
- public void renderHead(IHeaderResponse response) {
- super.renderHead(response);
- response.render(new PriorityHeaderItem(JavaScriptHeaderItem.forReference(Application.get().getJavaScriptLibrarySettings().getJQueryReference())));
-
- if(applicationCss != null) {
- response.render(CssReferenceHeaderItem.forUrl(applicationCss));
- }
- if(applicationJs != null) {
- response.render(JavaScriptReferenceHeaderItem.forUrl(applicationJs));
- }
- }
-
-
-
- // ///////////////////////////////////////////////////
- // System components
- // ///////////////////////////////////////////////////
-
- protected IsisConfiguration getConfiguration() {
- return IsisContext.getConfiguration();
- }
-
}
http://git-wip-us.apache.org/repos/asf/isis/blob/92e4db6a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/password_reset/signup/AccountConfirmationMap.java
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/password_reset/signup/AccountConfirmationMap.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/password_reset/signup/AccountConfirmationMap.java
new file mode 100644
index 0000000..72dfd64
--- /dev/null
+++ b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/password_reset/signup/AccountConfirmationMap.java
@@ -0,0 +1,153 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.isis.viewer.wicket.ui.pages.password_reset.signup;
+
+import java.util.Map;
+import org.apache.wicket.MetaDataKey;
+import org.apache.wicket.util.collections.MostRecentlyUsedMap;
+import org.apache.wicket.util.time.Duration;
+import org.apache.wicket.util.time.Time;
+
+/**
+ * A map that contains the emails to be verified. It has a constraint on the maximum entries that it
+ * can contain, and a constraint on the duration of time an entry is considered valid/non-expired
+ */
+public class AccountConfirmationMap extends MostRecentlyUsedMap<String, Object>
+{
+ private static final long serialVersionUID = 1L;
+
+ public static final MetaDataKey<AccountConfirmationMap> KEY = new MetaDataKey<AccountConfirmationMap>() {
+ };
+
+ /**
+ * The actual object that is stored as a value of the map. It wraps the email and
+ * assigns it a creation time.
+ */
+ private static class Value
+ {
+ /** the original email to store */
+ private String email;
+
+ /** the time when this email is stored */
+ private Time creationTime;
+ }
+
+ /**
+ * The duration of time before a {@link Value} is considered as expired
+ */
+ private final Duration lifetime;
+
+ /**
+ * Construct.
+ *
+ * @param maxEntries
+ * how much entries this map can contain
+ * @param lifetime
+ * the duration of time to keep an entry in the map before considering it expired
+ */
+ public AccountConfirmationMap(int maxEntries, Duration lifetime)
+ {
+ super(maxEntries);
+
+ this.lifetime = lifetime;
+ }
+
+ @Override
+ protected synchronized boolean removeEldestEntry(Map.Entry<String, Object> eldest)
+ {
+ boolean removed = super.removeEldestEntry(eldest);
+ if (removed == false)
+ {
+ Value value = (Value)eldest.getValue();
+ if (value != null)
+ {
+ Duration elapsedTime = Time.now().subtract(value.creationTime);
+ if (lifetime.lessThanOrEqual(elapsedTime))
+ {
+ removedValue = value.email;
+ removed = true;
+ }
+ }
+ }
+ return removed;
+ }
+
+ @Override
+ public String put(String key, Object email)
+ {
+ if (!(email instanceof String))
+ {
+ throw new IllegalArgumentException(AccountConfirmationMap.class.getSimpleName() +
+ " can store only instances of " + String.class.getSimpleName() + ": " + email);
+ }
+
+ Value value = new Value();
+ value.creationTime = Time.now();
+ value.email = (String)email;
+
+ Value oldValue;
+ synchronized (this)
+ {
+ oldValue = (Value)super.put(key, value);
+ }
+
+ return oldValue != null ? oldValue.email : null;
+ }
+
+ @Override
+ public String get(Object key)
+ {
+ String result = null;
+ Value value;
+ synchronized (this)
+ {
+ value = (Value)super.get(key);
+ }
+ if (value != null)
+ {
+ Duration elapsedTime = Time.now().subtract(value.creationTime);
+ if (lifetime.greaterThan(elapsedTime))
+ {
+ result = value.email;
+ }
+ else
+ {
+ // expired, remove it
+ remove(key);
+ }
+ }
+ return result;
+ }
+
+ @Override
+ public String remove(Object key)
+ {
+ Value removedValue;
+ synchronized (this)
+ {
+ removedValue = (Value)super.remove(key);
+ }
+
+ return removedValue != null ? removedValue.email : null;
+ }
+
+ @Override
+ public void putAll(Map<? extends String, ?> m)
+ {
+ throw new UnsupportedOperationException();
+ }
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/92e4db6a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/password_reset/signup/PasswordResetPage.css
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/password_reset/signup/PasswordResetPage.css b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/password_reset/signup/PasswordResetPage.css
new file mode 100644
index 0000000..3727ba1
--- /dev/null
+++ b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/password_reset/signup/PasswordResetPage.css
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+
+#header .applicationName {
+ display:none;
+}
+
+ .loginPanel {
+ width:310px;
+ background-color:#FFFFFF;
+ padding:20px;
+ border-radius:4px;
+ -moz-border-radius:4px;
+ -webkit-border-radius:4px;
+ margin-bottom:1%;
+ position:absolute;
+ clear:both;
+ height:200px;
+ left:50%;
+ top:50%;
+ margin-left:-175px;
+ margin-top:-100px;
+ }
+
+ .loginPanel h2 {
+ color:#423D37;
+ font-size:1.6em;
+ letter-spacing:0px;
+ line-height:150%;
+ margin-bottom:10px;
+ }
+
+ .loginPanel table {
+ width:100%;
+}
+
+.loginPanel table tr td {
+ padding:5px 0px;
+ text-align:left !important;
+}
+
+.loginPanel form input[type=text],
+.loginPanel form input[type=password] {
+ border-radius:4px;
+ -moz-borer-radius:4px;
+ -webkit-border-radius:4px;
+ padding:6px;
+ background-color:#F0EFEA;
+ border:1px solid #F0EFEA;
+ border-top:1px solid #CCCBC7;
+}
+
+
+.loginPanel form input[type=submit] {
+ background-color: #20B5C2;
+ border: 0 none;
+ border-radius: 4px 4px 4px 4px;
+ color: #FFFFFF;
+ cursor: pointer;
+ display: inline-block;
+ font-size: 0.9em;
+ padding: 5px 10px;
+}
+
+.loginPanel form input[type=reset] {
+ background-color: #E4E4DB;
+ border: 0 none;
+ border-radius: 4px 4px 4px 4px;
+ color: #46423C;
+ cursor: pointer;
+ display: inline-block;
+ font-size: 0.9em;
+ padding: 5px 10px;
+ text-transform: uppercase;
+}
+
+.loginPanel table tr td {
+ color:#46423C;
+}
+
+.wicketSignInPanel .mainMessage {
+ margin-top: 550px;
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/92e4db6a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/password_reset/signup/PasswordResetPage.html
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/password_reset/signup/PasswordResetPage.html b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/password_reset/signup/PasswordResetPage.html
new file mode 100644
index 0000000..053ee47
--- /dev/null
+++ b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/password_reset/signup/PasswordResetPage.html
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:wicket="http://wicket.apache.org"
+ xml:lang="en"
+ lang="en">
+ <body>
+ <wicket:extend>
+ <div class="row">
+ <div class="passwordResetPanel col-sm-offset-4 col-sm-4">
+ <div class="panel panel-default">
+ <div class="panel-heading">
+ <div class="panel-title"><wicket:message key="passwordResetHeader"/></div>
+ </div>
+ <div class="panel-body" wicket:id="passwordResetPanel"></div>
+ </div>
+ </div>
+ </div>
+ </wicket:extend>
+ </body>
+</html>
http://git-wip-us.apache.org/repos/asf/isis/blob/92e4db6a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/password_reset/signup/PasswordResetPage.java
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/password_reset/signup/PasswordResetPage.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/password_reset/signup/PasswordResetPage.java
new file mode 100644
index 0000000..1c619c1
--- /dev/null
+++ b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/password_reset/signup/PasswordResetPage.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.isis.viewer.wicket.ui.pages.password_reset.signup;
+
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+import org.apache.isis.viewer.wicket.ui.errors.ExceptionModel;
+import org.apache.isis.viewer.wicket.ui.pages.AccountManagementPageAbstract;
+
+/**
+ * Boilerplate, pick up our HTML and CSS.
+ */
+public class PasswordResetPage extends AccountManagementPageAbstract {
+
+ private static final long serialVersionUID = 1L;
+
+ public PasswordResetPage(final PageParameters parameters) {
+ this(parameters, getAndClearExceptionModelIfAny());
+ }
+
+ public PasswordResetPage(final PageParameters parameters, ExceptionModel exceptionModel) {
+ super(parameters, exceptionModel);
+ }
+
+ @Override
+ protected void onInitialize() {
+ super.onInitialize();
+
+ addPasswordResetPanel();
+ }
+
+ protected PasswordResetPanel addPasswordResetPanel() {
+ final PasswordResetPanel passwordResetPanel = new PasswordResetPanel("passwordResetPanel");
+ addOrReplace(passwordResetPanel);
+ return passwordResetPanel;
+ }
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/92e4db6a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/password_reset/signup/PasswordResetPage.properties
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/password_reset/signup/PasswordResetPage.properties b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/password_reset/signup/PasswordResetPage.properties
new file mode 100644
index 0000000..9891fcd
--- /dev/null
+++ b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/password_reset/signup/PasswordResetPage.properties
@@ -0,0 +1,26 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+passwordResetHeader=Forgot password
+emailLabel=Email
+emailPlaceholder=Enter your email address
+signUpPasswordLabel=Password
+passwordPlaceholder=Enter password
+passwordResetSubmitLabel=Submit
+emailSentMessage=An automatic email has been sent to '${email}' for verification.
http://git-wip-us.apache.org/repos/asf/isis/blob/92e4db6a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/password_reset/signup/PasswordResetPanel.html
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/password_reset/signup/PasswordResetPanel.html b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/password_reset/signup/PasswordResetPanel.html
new file mode 100644
index 0000000..b536773
--- /dev/null
+++ b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/password_reset/signup/PasswordResetPanel.html
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<html xmlns:wicket="http://wicket.apache.org">
+ <body>
+ <wicket:panel>
+ <span wicket:id="feedback"></span>
+
+ <form wicket:id="signUpForm" role="form">
+ <div class="form-group" wicket:id="formGroup">
+ <label wicket:for="email" class="control-label"><wicket:message key="emailLabel"/></label>
+ <input type="text" class="form-control" wicket:id="email" wicket:message="placeholder:emailPlaceholder"/>
+ </div>
+
+ <button type="submit" wicket:id="passwordResetSubmit" class="btn btn-primary"><wicket:message key="passwordResetSubmitLabel"/></button>
+ </form>
+
+ </wicket:panel>
+ </body>
+</html>
http://git-wip-us.apache.org/repos/asf/isis/blob/92e4db6a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/password_reset/signup/PasswordResetPanel.java
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/password_reset/signup/PasswordResetPanel.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/password_reset/signup/PasswordResetPanel.java
new file mode 100644
index 0000000..f588066
--- /dev/null
+++ b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/password_reset/signup/PasswordResetPanel.java
@@ -0,0 +1,113 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.isis.viewer.wicket.ui.pages.password_reset.signup;
+
+import de.agilecoders.wicket.core.markup.html.bootstrap.common.NotificationPanel;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+import javax.inject.Inject;
+import org.apache.wicket.markup.html.form.Button;
+import org.apache.wicket.markup.html.form.RequiredTextField;
+import org.apache.wicket.markup.html.form.StatelessForm;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.ResourceModel;
+import org.apache.wicket.request.Url;
+import org.apache.wicket.request.UrlRenderer;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+import org.apache.wicket.validation.validator.EmailAddressValidator;
+import org.apache.isis.applib.services.email.EmailNotificationService;
+import org.apache.isis.applib.services.email.events.EmailRegistrationEvent;
+import org.apache.isis.viewer.wicket.ui.components.widgets.bootstrap.FormGroup;
+import org.apache.isis.viewer.wicket.ui.pages.register.RegisterPage;
+
+/**
+ * A panel with a form for creation of new users
+ */
+public class PasswordResetPanel extends Panel {
+
+ /**
+ * Constructor
+ *
+ * @param id
+ * the component id
+ */
+ public PasswordResetPanel(final String id) {
+ super(id);
+
+ addOrReplace(new NotificationPanel("feedback"));
+
+ StatelessForm<Void> form = new StatelessForm<>("signUpForm");
+ addOrReplace(form);
+
+ final RequiredTextField<String> emailField = new RequiredTextField<>("email", Model.of(""));
+ emailField.setLabel(new ResourceModel("emailLabel"));
+ emailField.add(EmailAddressValidator.getInstance());
+
+ FormGroup formGroup = new FormGroup("formGroup", emailField);
+ form.add(formGroup);
+
+ formGroup.add(emailField);
+
+ Button signUpButton = new Button("passwordResetSubmit") {
+ @Override
+ public void onSubmit() {
+ super.onSubmit();
+
+ String email = emailField.getModelObject();
+ String confirmationUrl = createUrl(email);
+
+ boolean emailSent = emailService.send(new EmailRegistrationEvent(email, confirmationUrl));
+ if (emailSent) {
+ Map<String, String> map = new HashMap<>();
+ map.put("email", email);
+ IModel<Map<String, String>> model = Model.ofMap(map);
+ String emailSentMessage = getString("emailSentMessage", model);
+ success(emailSentMessage);
+ }
+ }
+ };
+
+ form.add(signUpButton);
+ }
+
+ private String createUrl(String email) {
+ String uuid = UUID.randomUUID().toString();
+ uuid = uuid.replace("-", "");
+
+ // TODO mgrigorov: either improve the API or use a DB table for this
+ AccountConfirmationMap accountConfirmationMap = getApplication().getMetaData(AccountConfirmationMap.KEY);
+ accountConfirmationMap.put(uuid, email);
+
+ PageParameters parameters = new PageParameters();
+ parameters.set(0, uuid);
+ CharSequence relativeUrl = urlFor(PasswordResetPage.class, parameters);
+ UrlRenderer urlRenderer = getRequestCycle().getUrlRenderer();
+ String fullUrl = urlRenderer.renderFullUrl(Url.parse(relativeUrl));
+
+ return fullUrl;
+ }
+
+ @Inject
+ private EmailNotificationService emailService;
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/92e4db6a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/register/RegisterPage.java
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/register/RegisterPage.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/register/RegisterPage.java
index 1b77911..71ee993 100644
--- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/register/RegisterPage.java
+++ b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/register/RegisterPage.java
@@ -19,130 +19,37 @@
package org.apache.isis.viewer.wicket.ui.pages.register;
-import com.google.inject.Inject;
-import com.google.inject.name.Named;
-import org.apache.wicket.Application;
-import org.apache.wicket.MarkupContainer;
-import org.apache.wicket.markup.head.CssReferenceHeaderItem;
-import org.apache.wicket.markup.head.IHeaderResponse;
-import org.apache.wicket.markup.head.JavaScriptHeaderItem;
-import org.apache.wicket.markup.head.JavaScriptReferenceHeaderItem;
-import org.apache.wicket.markup.head.PriorityHeaderItem;
import org.apache.wicket.markup.html.WebMarkupContainer;
-import org.apache.wicket.markup.html.WebPage;
-import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.request.mapper.parameter.PageParameters;
import org.apache.wicket.util.string.StringValue;
-import org.apache.isis.core.commons.config.IsisConfiguration;
-import org.apache.isis.core.runtime.system.context.IsisContext;
import org.apache.isis.viewer.wicket.ui.errors.ExceptionModel;
-import org.apache.isis.viewer.wicket.ui.errors.ExceptionStackTracePanel;
-import org.apache.isis.viewer.wicket.ui.pages.PageAbstract;
+import org.apache.isis.viewer.wicket.ui.pages.AccountManagementPageAbstract;
/**
* Web page representing the about page.
*/
-public class RegisterPage extends WebPage {
+public class RegisterPage extends AccountManagementPageAbstract {
private static final long serialVersionUID = 1L;
- private static final String ID_PAGE_TITLE = "pageTitle";
- private static final String ID_APPLICATION_NAME = "applicationName";
-
- private static final String ID_EXCEPTION_STACK_TRACE = "exceptionStackTrace";
-
- /**
- * {@link com.google.inject.Inject}ed when {@link #init() initialized}.
- */
- @Inject
- @Named("applicationName")
- private String applicationName;
-
- /**
- * {@link Inject}ed when {@link #init() initialized}.
- */
- @Inject
- @Named("applicationCss")
- private String applicationCss;
-
- /**
- * {@link Inject}ed when {@link #init() initialized}.
- */
- @Inject
- @Named("applicationJs")
- private String applicationJs;
-
-
- /**
- * If set by {@link org.apache.isis.viewer.wicket.ui.pages.PageAbstract}.
- */
- private static ExceptionModel getAndClearExceptionModelIfAny() {
- ExceptionModel exceptionModel = PageAbstract.EXCEPTION.get();
- PageAbstract.EXCEPTION.remove();
- return exceptionModel;
- }
-
-
- public RegisterPage() {
- this(new PageParameters());
- }
-
public RegisterPage(final PageParameters parameters) {
this(parameters, getAndClearExceptionModelIfAny());
}
public RegisterPage(final PageParameters parameters, ExceptionModel exceptionModel) {
+ super(parameters, exceptionModel);
+ }
- addPageTitle();
- addApplicationName();
+ @Override
+ protected void onInitialize() {
+ super.onInitialize();
- final StringValue uuidValue = parameters.get(0);
+ final StringValue uuidValue = getPageParameters().get(0);
if (uuidValue.isEmpty()) {
// TODO ISIS-987 Add feedback explaining why there is no form
addOrReplace(new WebMarkupContainer("content"));
} else {
addOrReplace(new RegisterPanel("content", uuidValue.toString()));
}
-
- if(exceptionModel != null) {
- add(new ExceptionStackTracePanel(ID_EXCEPTION_STACK_TRACE, exceptionModel));
- } else {
- add(new WebMarkupContainer(ID_EXCEPTION_STACK_TRACE).setVisible(false));
- }
-
}
-
-
- private MarkupContainer addPageTitle() {
- return add(new Label(ID_PAGE_TITLE, applicationName));
- }
-
- private void addApplicationName() {
- add(new Label(ID_APPLICATION_NAME, applicationName));
- }
-
-
- @Override
- public void renderHead(IHeaderResponse response) {
- super.renderHead(response);
- response.render(new PriorityHeaderItem(JavaScriptHeaderItem.forReference(Application.get().getJavaScriptLibrarySettings().getJQueryReference())));
-
- if(applicationCss != null) {
- response.render(CssReferenceHeaderItem.forUrl(applicationCss));
- }
- if(applicationJs != null) {
- response.render(JavaScriptReferenceHeaderItem.forUrl(applicationJs));
- }
- }
-
-
-
- // ///////////////////////////////////////////////////
- // System components
- // ///////////////////////////////////////////////////
-
- protected IsisConfiguration getConfiguration() {
- return IsisContext.getConfiguration();
- }
-
}
http://git-wip-us.apache.org/repos/asf/isis/blob/92e4db6a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/signup/RegistrationFormPage.java
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/signup/RegistrationFormPage.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/signup/RegistrationFormPage.java
index bb31c4a..2717062 100644
--- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/signup/RegistrationFormPage.java
+++ b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/signup/RegistrationFormPage.java
@@ -19,122 +19,35 @@
package org.apache.isis.viewer.wicket.ui.pages.signup;
-import com.google.inject.Inject;
-import com.google.inject.name.Named;
-import org.apache.wicket.Application;
-import org.apache.wicket.MarkupContainer;
-import org.apache.wicket.markup.head.CssReferenceHeaderItem;
-import org.apache.wicket.markup.head.IHeaderResponse;
-import org.apache.wicket.markup.head.JavaScriptHeaderItem;
-import org.apache.wicket.markup.head.JavaScriptReferenceHeaderItem;
-import org.apache.wicket.markup.head.PriorityHeaderItem;
-import org.apache.wicket.markup.html.WebMarkupContainer;
-import org.apache.wicket.markup.html.WebPage;
-import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.request.mapper.parameter.PageParameters;
-import org.apache.isis.core.commons.config.IsisConfiguration;
-import org.apache.isis.core.runtime.system.context.IsisContext;
import org.apache.isis.viewer.wicket.ui.errors.ExceptionModel;
-import org.apache.isis.viewer.wicket.ui.errors.ExceptionStackTracePanel;
-import org.apache.isis.viewer.wicket.ui.pages.PageAbstract;
+import org.apache.isis.viewer.wicket.ui.pages.AccountManagementPageAbstract;
/**
* Boilerplate, pick up our HTML and CSS.
*/
-public class RegistrationFormPage extends WebPage {
+public class RegistrationFormPage extends AccountManagementPageAbstract {
private static final long serialVersionUID = 1L;
- private static final String ID_PAGE_TITLE = "pageTitle";
- private static final String ID_APPLICATION_NAME = "applicationName";
-
- private static final String ID_EXCEPTION_STACK_TRACE = "exceptionStackTrace";
-
- /**
- * {@link com.google.inject.Inject}ed when {@link #init() initialized}.
- */
- @Inject
- @Named("applicationName")
- private String applicationName;
-
- /**
- * {@link com.google.inject.Inject}ed when {@link #init() initialized}.
- */
- @Inject
- @Named("applicationCss")
- private String applicationCss;
-
- /**
- * {@link com.google.inject.Inject}ed when {@link #init() initialized}.
- */
- @Inject
- @Named("applicationJs")
- private String applicationJs;
-
- /**
- * If set by {@link org.apache.isis.viewer.wicket.ui.pages.PageAbstract}.
- */
- private static ExceptionModel getAndClearExceptionModelIfAny() {
- ExceptionModel exceptionModel = PageAbstract.EXCEPTION.get();
- PageAbstract.EXCEPTION.remove();
- return exceptionModel;
- }
-
- public RegistrationFormPage() {
- this(null);
- }
-
public RegistrationFormPage(final PageParameters parameters) {
this(parameters, getAndClearExceptionModelIfAny());
}
public RegistrationFormPage(final PageParameters parameters, ExceptionModel exceptionModel) {
- addPageTitle();
- addApplicationName();
- addSignInPanel();
-
- if(exceptionModel != null) {
- add(new ExceptionStackTracePanel(ID_EXCEPTION_STACK_TRACE, exceptionModel));
- } else {
- add(new WebMarkupContainer(ID_EXCEPTION_STACK_TRACE).setVisible(false));
- }
+ super(parameters, exceptionModel);
}
- private MarkupContainer addPageTitle() {
- return add(new Label(ID_PAGE_TITLE, applicationName));
- }
+ @Override
+ protected void onInitialize() {
+ super.onInitialize();
- private void addApplicationName() {
- add(new Label(ID_APPLICATION_NAME, applicationName));
+ addSignInPanel();
}
- protected SignUpPanel addSignInPanel() {
- final SignUpPanel signInPanel = new SignUpPanel("signUpPanel");
+ protected RegistrationFormPanel addSignInPanel() {
+ final RegistrationFormPanel signInPanel = new RegistrationFormPanel("signUpPanel");
add(signInPanel);
return signInPanel;
}
-
- @Override
- public void renderHead(IHeaderResponse response) {
- super.renderHead(response);
- response.render(new PriorityHeaderItem(JavaScriptHeaderItem.forReference(Application.get().getJavaScriptLibrarySettings().getJQueryReference())));
-
- if(applicationCss != null) {
- response.render(CssReferenceHeaderItem.forUrl(applicationCss));
- }
- if(applicationJs != null) {
- response.render(JavaScriptReferenceHeaderItem.forUrl(applicationJs));
- }
- }
-
-
-
- // ///////////////////////////////////////////////////
- // System components
- // ///////////////////////////////////////////////////
-
- protected IsisConfiguration getConfiguration() {
- return IsisContext.getConfiguration();
- }
-
}
http://git-wip-us.apache.org/repos/asf/isis/blob/92e4db6a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/signup/RegistrationFormPanel.html
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/signup/RegistrationFormPanel.html b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/signup/RegistrationFormPanel.html
new file mode 100644
index 0000000..4914da8
--- /dev/null
+++ b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/signup/RegistrationFormPanel.html
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<html xmlns:wicket="http://wicket.apache.org">
+ <body>
+ <wicket:panel>
+ <span wicket:id="feedback"></span>
+
+ <form wicket:id="signUpForm" role="form">
+ <div class="form-group" wicket:id="formGroup">
+ <label wicket:for="email" class="control-label"><wicket:message key="emailLabel"/></label>
+ <input type="text" class="form-control" wicket:id="email" wicket:message="placeholder:emailPlaceholder"/>
+ </div>
+
+ <button type="submit" wicket:id="signUp" class="btn btn-primary"><wicket:message key="signUpButtonLabel"/></button>
+ </form>
+
+ </wicket:panel>
+ </body>
+</html>
http://git-wip-us.apache.org/repos/asf/isis/blob/92e4db6a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/signup/RegistrationFormPanel.java
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/signup/RegistrationFormPanel.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/signup/RegistrationFormPanel.java
new file mode 100644
index 0000000..38e49bf
--- /dev/null
+++ b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/signup/RegistrationFormPanel.java
@@ -0,0 +1,113 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.isis.viewer.wicket.ui.pages.signup;
+
+import de.agilecoders.wicket.core.markup.html.bootstrap.common.NotificationPanel;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+import javax.inject.Inject;
+import org.apache.wicket.markup.html.form.Button;
+import org.apache.wicket.markup.html.form.RequiredTextField;
+import org.apache.wicket.markup.html.form.StatelessForm;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.ResourceModel;
+import org.apache.wicket.request.Url;
+import org.apache.wicket.request.UrlRenderer;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+import org.apache.wicket.validation.validator.EmailAddressValidator;
+import org.apache.isis.applib.services.email.EmailNotificationService;
+import org.apache.isis.applib.services.email.events.EmailRegistrationEvent;
+import org.apache.isis.viewer.wicket.ui.components.widgets.bootstrap.FormGroup;
+import org.apache.isis.viewer.wicket.ui.pages.register.RegisterPage;
+
+/**
+ * A panel with a form for creation of new users
+ */
+public class RegistrationFormPanel extends Panel {
+
+ /**
+ * Constructor
+ *
+ * @param id
+ * the component id
+ */
+ public RegistrationFormPanel(final String id) {
+ super(id);
+
+ addOrReplace(new NotificationPanel("feedback"));
+
+ StatelessForm<Void> form = new StatelessForm<>("signUpForm");
+ addOrReplace(form);
+
+ final RequiredTextField<String> emailField = new RequiredTextField<>("email", Model.of(""));
+ emailField.setLabel(new ResourceModel("emailLabel"));
+ emailField.add(EmailAddressValidator.getInstance());
+
+ FormGroup formGroup = new FormGroup("formGroup", emailField);
+ form.add(formGroup);
+
+ formGroup.add(emailField);
+
+ Button signUpButton = new Button("signUp") {
+ @Override
+ public void onSubmit() {
+ super.onSubmit();
+
+ String email = emailField.getModelObject();
+ String confirmationUrl = createUrl(email);
+
+ boolean emailSent = emailService.send(new EmailRegistrationEvent(email, confirmationUrl));
+ if (emailSent) {
+ Map<String, String> map = new HashMap<>();
+ map.put("email", email);
+ IModel<Map<String, String>> model = Model.ofMap(map);
+ String emailSentMessage = getString("emailSentMessage", model);
+ success(emailSentMessage);
+ }
+ }
+ };
+
+ form.add(signUpButton);
+ }
+
+ private String createUrl(String email) {
+ String uuid = UUID.randomUUID().toString();
+ uuid = uuid.replace("-", "");
+
+ // TODO mgrigorov: either improve the API or use a DB table for this
+ AccountConfirmationMap accountConfirmationMap = getApplication().getMetaData(AccountConfirmationMap.KEY);
+ accountConfirmationMap.put(uuid, email);
+
+ PageParameters parameters = new PageParameters();
+ parameters.set(0, uuid);
+ CharSequence relativeUrl = urlFor(RegisterPage.class, parameters);
+ UrlRenderer urlRenderer = getRequestCycle().getUrlRenderer();
+ String fullUrl = urlRenderer.renderFullUrl(Url.parse(relativeUrl));
+
+ return fullUrl;
+ }
+
+ @Inject
+ private EmailNotificationService emailService;
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/92e4db6a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/signup/SignUpPanel.html
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/signup/SignUpPanel.html b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/signup/SignUpPanel.html
deleted file mode 100644
index 4914da8..0000000
--- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/signup/SignUpPanel.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<html xmlns:wicket="http://wicket.apache.org">
- <body>
- <wicket:panel>
- <span wicket:id="feedback"></span>
-
- <form wicket:id="signUpForm" role="form">
- <div class="form-group" wicket:id="formGroup">
- <label wicket:for="email" class="control-label"><wicket:message key="emailLabel"/></label>
- <input type="text" class="form-control" wicket:id="email" wicket:message="placeholder:emailPlaceholder"/>
- </div>
-
- <button type="submit" wicket:id="signUp" class="btn btn-primary"><wicket:message key="signUpButtonLabel"/></button>
- </form>
-
- </wicket:panel>
- </body>
-</html>
http://git-wip-us.apache.org/repos/asf/isis/blob/92e4db6a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/signup/SignUpPanel.java
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/signup/SignUpPanel.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/signup/SignUpPanel.java
deleted file mode 100644
index fa72ccc..0000000
--- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/signup/SignUpPanel.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.viewer.wicket.ui.pages.signup;
-
-import de.agilecoders.wicket.core.markup.html.bootstrap.common.NotificationPanel;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.UUID;
-import javax.inject.Inject;
-import org.apache.wicket.markup.html.form.Button;
-import org.apache.wicket.markup.html.form.RequiredTextField;
-import org.apache.wicket.markup.html.form.StatelessForm;
-import org.apache.wicket.markup.html.panel.Panel;
-import org.apache.wicket.model.IModel;
-import org.apache.wicket.model.Model;
-import org.apache.wicket.model.ResourceModel;
-import org.apache.wicket.request.Url;
-import org.apache.wicket.request.UrlRenderer;
-import org.apache.wicket.request.mapper.parameter.PageParameters;
-import org.apache.wicket.validation.validator.EmailAddressValidator;
-import org.apache.isis.applib.services.email.EmailNotificationService;
-import org.apache.isis.applib.services.email.events.EmailRegistrationEvent;
-import org.apache.isis.viewer.wicket.ui.components.widgets.bootstrap.FormGroup;
-import org.apache.isis.viewer.wicket.ui.pages.register.RegisterPage;
-
-/**
- * A panel with a form for creation of new users
- */
-public class SignUpPanel extends Panel {
-
- /**
- * Constructor
- *
- * @param id
- * the component id
- */
- public SignUpPanel(final String id) {
- super(id);
-
- addOrReplace(new NotificationPanel("feedback"));
-
- StatelessForm<Void> form = new StatelessForm<>("signUpForm");
- addOrReplace(form);
-
- final RequiredTextField<String> emailField = new RequiredTextField<>("email", Model.of(""));
- emailField.setLabel(new ResourceModel("emailLabel"));
- emailField.add(EmailAddressValidator.getInstance());
-
- FormGroup formGroup = new FormGroup("formGroup", emailField);
- form.add(formGroup);
-
- formGroup.add(emailField);
-
- Button signUpButton = new Button("signUp") {
- @Override
- public void onSubmit() {
- super.onSubmit();
-
- String email = emailField.getModelObject();
- String confirmationUrl = createUrl(email);
-
- boolean emailSent = emailService.send(new EmailRegistrationEvent(email, confirmationUrl));
- if (emailSent) {
- Map<String, String> map = new HashMap<>();
- map.put("email", email);
- IModel<Map<String, String>> model = Model.ofMap(map);
- String emailSentMessage = getString("emailSentMessage", model);
- success(emailSentMessage);
- }
- }
- };
-
- form.add(signUpButton);
- }
-
- private String createUrl(String email) {
- String uuid = UUID.randomUUID().toString();
- uuid = uuid.replace("-", "");
-
- // TODO mgrigorov: either improve the API or use a DB table for this
- AccountConfirmationMap accountConfirmationMap = getApplication().getMetaData(AccountConfirmationMap.KEY);
- accountConfirmationMap.put(uuid, email);
-
- PageParameters parameters = new PageParameters();
- parameters.set(0, uuid);
- CharSequence relativeUrl = urlFor(RegisterPage.class, parameters);
- UrlRenderer urlRenderer = getRequestCycle().getUrlRenderer();
- String fullUrl = urlRenderer.renderFullUrl(Url.parse(relativeUrl));
-
- return fullUrl;
- }
-
- @Inject
- private EmailNotificationService emailService;
-}