http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageClassRegistrySpi.java ---------------------------------------------------------------------- diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageClassRegistrySpi.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageClassRegistrySpi.java deleted file mode 100644 index 6113222..0000000 --- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageClassRegistrySpi.java +++ /dev/null @@ -1,33 +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; - -import org.apache.wicket.Page; - -import org.apache.isis.viewer.wicket.model.models.PageType; - -/** - * Used by {@link PageClassList} implementations to add pages into the registry. - */ -public interface PageClassRegistrySpi { - - public void registerPage(PageType pageType, Class<? extends Page> pageClass); - -}
http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageNavigationService.java ---------------------------------------------------------------------- diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageNavigationService.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageNavigationService.java deleted file mode 100644 index 194509b..0000000 --- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageNavigationService.java +++ /dev/null @@ -1,63 +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; - -import java.io.Serializable; -import org.apache.wicket.request.mapper.parameter.PageParameters; -import org.apache.isis.viewer.wicket.model.models.PageType; - -/** - * A service helping with the navigation to pages by type - */ -public interface PageNavigationService extends Serializable { - - /** - * Schedules a page with a given {@link org.apache.isis.viewer.wicket.model.models.PageType type} - * to provide the response - * - * @param pageType The type of the page that should provide the response - */ - void navigateTo(PageType pageType); - - /** - * Schedules a page with a given {@link org.apache.isis.viewer.wicket.model.models.PageType type} - * and {@link org.apache.wicket.request.mapper.parameter.PageParameters parameters} to provide the response - * - * @param pageType The type of the page that should provide the response - * @param parameters The page parameters for the page that should provide the response - */ - void navigateTo(PageType pageType, PageParameters parameters); - - /** - * Restarts the current request cycle and schedules another page to provide the response - * - * @param pageType The type of the page that should provide the response - */ - void restartAt(PageType pageType); - - /** - * Restarts the current request cycle and schedules another page to provide the response. - * Information about the current page url and request parameters is preserved so that - * the application can return later by using {@link org.apache.wicket.Component#continueToOriginalDestination()} - * - * @param pageType The type of the page that should provide the response - */ - void interceptAndRestartAt(PageType pageType); -} http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/about/AboutPage.css ---------------------------------------------------------------------- diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/about/AboutPage.css b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/about/AboutPage.css deleted file mode 100644 index eaeea17..0000000 --- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/about/AboutPage.css +++ /dev/null @@ -1,18 +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. - */ http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/about/AboutPage.html ---------------------------------------------------------------------- diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/about/AboutPage.html b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/about/AboutPage.html deleted file mode 100644 index eb3a892..0000000 --- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/about/AboutPage.html +++ /dev/null @@ -1,44 +0,0 @@ -<?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/dtds.data/wicket-xhtml1.4-strict.dtd" - xml:lang="en" - lang="en"> - <wicket:head> - <wicket:link> - <link href="AboutPage.css" rel="stylesheet" type="text/css"/> - </wicket:link> - </wicket:head> - <body> - <wicket:extend> - <div class="aboutPage"> - <div> - <div wicket:id="bookmarks"></div> - <div class="row"> - <div class="col-xs-offset-2 col-xs-8"> - <div wicket:id="about"></div> - </div> - </div> - </div> - </div> - </wicket:extend> - </body> -</html> http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/about/AboutPage.java ---------------------------------------------------------------------- diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/about/AboutPage.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/about/AboutPage.java deleted file mode 100644 index 2fec6ac..0000000 --- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/about/AboutPage.java +++ /dev/null @@ -1,40 +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.about; - -import org.apache.wicket.request.mapper.parameter.PageParameters; - -import org.apache.isis.viewer.wicket.ui.ComponentType; -import org.apache.isis.viewer.wicket.ui.pages.PageAbstract; - -/** - * Web page representing the about page. - */ -public class AboutPage extends PageAbstract { - - private static final long serialVersionUID = 1L; - - public AboutPage(final PageParameters parameters) { - super(parameters, null, ComponentType.ABOUT); - addBookmarkedPages(); - addChildComponents(themeDiv, null); - } - -} http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/AccountConfirmationMap.java ---------------------------------------------------------------------- diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/AccountConfirmationMap.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/AccountConfirmationMap.java deleted file mode 100644 index fa7c1b1..0000000 --- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/AccountConfirmationMap.java +++ /dev/null @@ -1,154 +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.accmngt; - -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(java.util.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/d84c6609/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/AccountManagementPageAbstract.html ---------------------------------------------------------------------- diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/AccountManagementPageAbstract.html b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/AccountManagementPageAbstract.html deleted file mode 100644 index 20a0477..0000000 --- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/AccountManagementPageAbstract.html +++ /dev/null @@ -1,66 +0,0 @@ -<?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> - <img wicket:id="brandLogo"/> - </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> - <div class="javascriptInFooter"> - <wicket:container wicket:id="footerJS"/> - </div> - </body> -</html> http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/AccountManagementPageAbstract.java ---------------------------------------------------------------------- diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/AccountManagementPageAbstract.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/AccountManagementPageAbstract.java deleted file mode 100644 index 5a90b8a..0000000 --- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/AccountManagementPageAbstract.java +++ /dev/null @@ -1,145 +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.accmngt; - -import de.agilecoders.wicket.core.markup.html.bootstrap.behavior.BootstrapJavascriptBehavior; - -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.head.filter.HeaderResponseContainer; -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.components.widgets.navbar.BrandLogo; -import org.apache.isis.viewer.wicket.ui.components.widgets.navbar.BrandName; -import org.apache.isis.viewer.wicket.ui.components.widgets.navbar.Placement; -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; - -/** - * 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"; - - /** - * The name of a special cookie that is used as a temporary container for - * stateless session scoped success feedback messages. - */ - public static final String FEEDBACK_COOKIE_NAME = "isis.feedback.success"; - - /** - * {@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}. - */ - protected static ExceptionModel getAndClearExceptionModelIfAny() { - ExceptionModel exceptionModel = PageAbstract.EXCEPTION.get(); - PageAbstract.EXCEPTION.remove(); - return exceptionModel; - } - - protected 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)); - } - - add(new HeaderResponseContainer("footerJS", "footerJS")); - BootstrapJavascriptBehavior.addTo(this); - } - - private MarkupContainer addPageTitle() { - return add(new Label(ID_PAGE_TITLE, applicationName)); - } - - private void addApplicationName() { - final Placement placement = Placement.SIGNIN; - final BrandLogo brandLogo = new BrandLogo("brandLogo", placement); - final BrandName brandName = new BrandName(ID_APPLICATION_NAME, placement); - add(brandName, brandLogo); - } - - @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/d84c6609/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/AccountManagementPageAbstract.properties ---------------------------------------------------------------------- diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/AccountManagementPageAbstract.properties b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/AccountManagementPageAbstract.properties deleted file mode 100644 index 286e1ba..0000000 --- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/AccountManagementPageAbstract.properties +++ /dev/null @@ -1,52 +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. -# - -signUpHeader=Sign Up -emailLabel=Email -emailPlaceholder=Enter an email for the new account -signUpPasswordLabel=Password -passwordPlaceholder=Enter password -emailIsNotAvailable=The given email is already in use -signUpButtonLabel=Verify email -emailSentMessage=An email has been sent to '${email}' for verification. - -passwordResetHeader=Forgot password -emailPlaceholder=Enter your email -passwordLabel=Password -passwordPlaceholder=Enter your new password -confirmPasswordLabel=Confirm password -confirmPasswordPlaceholder=Type the same password again -passwordResetSubmitLabel=Submit -noSuchUserByEmail=There is no account with this email -passwordChangeSuccessful=The password has been changed successfully. You can <a class="alert-success" style="text-decoration:underline;" href="${signInUrl}">login</a> now. -passwordChangeUnsuccessful=There was a problem while updating the password. Please try again. -passwordResetExpiredOrInvalidToken=You are trying to reset the password for an expired or invalid token -noUserForAnEmailValidToken=The account seems to be either already deleted or has changed its email address. Please try again. - -registerHeader=Register -usernameLabel=Username -usernamePlaceholder=Username -emailLabel=Email -emailPlaceholder=Enter email -passwordPlaceholder=Enter password -confirmPasswordLabel=Confirm password -confirmPasswordPlaceholder=Confirm password -registerButtonLabel=Register -resetButtonLabel=Reset -usernameIsNotAvailable=The provided username is already in use http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/EmailAvailableValidator.java ---------------------------------------------------------------------- diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/EmailAvailableValidator.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/EmailAvailableValidator.java deleted file mode 100644 index 92a819b..0000000 --- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/EmailAvailableValidator.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.apache.isis.viewer.wicket.ui.pages.accmngt; - -import org.apache.wicket.validation.IValidatable; -import org.apache.wicket.validation.IValidator; -import org.apache.wicket.validation.ValidationError; -import org.apache.isis.applib.services.userreg.UserRegistrationService; -import org.apache.isis.core.runtime.system.context.IsisContext; - -/** - * Validates that an email is or is not already in use by another user - */ -public class EmailAvailableValidator implements IValidator<String> { - - public static final EmailAvailableValidator EXISTS = new EmailAvailableValidator(true, "noSuchUserByEmail"); - public static final EmailAvailableValidator DOESNT_EXIST = new EmailAvailableValidator(false, "emailIsNotAvailable"); - - private final boolean emailExists; - private final String resourceKey; - - private EmailAvailableValidator(boolean emailExists, String resourceKey) { - this.emailExists = emailExists; - this.resourceKey = resourceKey; - } - - @Override - public void validate(final IValidatable<String> validatable) { - IsisContext.doInSession(new Runnable() { - @Override - public void run() { - UserRegistrationService userRegistrationService = IsisContext.getPersistenceSession().getServicesInjector().lookupService(UserRegistrationService.class); - String email = validatable.getValue(); - boolean emailExists1 = userRegistrationService.emailExists(email); - if (emailExists1 != emailExists) { - validatable.error(new ValidationError().addKey(resourceKey)); - } - } - }); - - } -} http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/EmailVerificationUrlServiceDefault.java ---------------------------------------------------------------------- diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/EmailVerificationUrlServiceDefault.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/EmailVerificationUrlServiceDefault.java deleted file mode 100644 index 7265763..0000000 --- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/EmailVerificationUrlServiceDefault.java +++ /dev/null @@ -1,69 +0,0 @@ -package org.apache.isis.viewer.wicket.ui.pages.accmngt; - -import javax.inject.Inject; -import java.util.UUID; - -import org.apache.wicket.Application; -import org.apache.wicket.Page; -import org.apache.wicket.request.Url; -import org.apache.wicket.request.UrlRenderer; -import org.apache.wicket.request.cycle.RequestCycle; -import org.apache.wicket.request.mapper.parameter.PageParameters; -import org.apache.isis.viewer.wicket.model.models.PageType; -import org.apache.isis.viewer.wicket.ui.pages.EmailVerificationUrlService; -import org.apache.isis.viewer.wicket.ui.pages.PageClassRegistry; - -/** - * An implementation of {@link org.apache.isis.viewer.wicket.ui.pages.EmailVerificationUrlService} - * that uses Wicket's the current {@link org.apache.wicket.request.cycle.RequestCycle} to create the link and - * the special {@link org.apache.isis.viewer.wicket.ui.pages.accmngt.AccountConfirmationMap} - * stored in the {@link org.apache.wicket.Application application} as a temporary storage of - * the non-encrypted data. - */ -public class EmailVerificationUrlServiceDefault implements EmailVerificationUrlService { - - private final PageClassRegistry pageClassRegistry; - - @Inject - public EmailVerificationUrlServiceDefault(PageClassRegistry pageClassRegistry) { - this.pageClassRegistry = pageClassRegistry; - } - - /** - * Creates a url to the passed <em>pageClass</em> by encrypting the given - * <em>datum</em> as a first indexed parameter - * - * @param pageType The type of the page to link to - * @param datum The data to encrypt in the url - * @return The full url to the page with the encrypted data - */ - @Override - public String createVerificationUrl(final PageType pageType, final String datum) { - String uuid = UUID.randomUUID().toString(); - uuid = uuid.replace("-", ""); - - final AccountConfirmationMap accountConfirmationMap = getAccountConfirmationMap(); - accountConfirmationMap.put(uuid, datum); - - final PageParameters parameters = new PageParameters(); - parameters.set(0, uuid); - - final Class<? extends Page> pageClass = pageClassRegistry.getPageClass(pageType); - - final String fullUrl = fullUrlFor(pageClass, parameters); - return fullUrl; - } - - protected String fullUrlFor(final Class<? extends Page> pageClass, final PageParameters parameters) { - final RequestCycle requestCycle = RequestCycle.get(); - final CharSequence relativeUrl = requestCycle.urlFor(pageClass, parameters); - final UrlRenderer urlRenderer = requestCycle.getUrlRenderer(); - final String fullUrl = urlRenderer.renderFullUrl(Url.parse(relativeUrl)); - return fullUrl; - } - - protected AccountConfirmationMap getAccountConfirmationMap() { - return Application.get().getMetaData(AccountConfirmationMap.KEY); - } - -} http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/UsernameAvailableValidator.java ---------------------------------------------------------------------- diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/UsernameAvailableValidator.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/UsernameAvailableValidator.java deleted file mode 100644 index ad0c071..0000000 --- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/UsernameAvailableValidator.java +++ /dev/null @@ -1,34 +0,0 @@ -package org.apache.isis.viewer.wicket.ui.pages.accmngt; - -import org.apache.wicket.validation.IValidatable; -import org.apache.wicket.validation.IValidator; -import org.apache.wicket.validation.ValidationError; -import org.apache.isis.applib.services.userreg.UserRegistrationService; -import org.apache.isis.core.runtime.system.context.IsisContext; - -/** - * Validates that an username is or is not already in use by someone else - */ -public class UsernameAvailableValidator implements IValidator<String> { - - public static final UsernameAvailableValidator INSTANCE = new UsernameAvailableValidator(); - - private UsernameAvailableValidator() { - } - - @Override - public void validate(final IValidatable<String> validatable) { - IsisContext.doInSession(new Runnable() { - @Override - public void run() { - UserRegistrationService userRegistrationService = IsisContext.getPersistenceSession().getServicesInjector().lookupService(UserRegistrationService.class); - String username = validatable.getValue(); - boolean usernameExists = userRegistrationService.usernameExists(username); - if (usernameExists) { - validatable.error(new ValidationError().addKey("usernameIsNotAvailable")); - } - } - }); - - } -} http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/password_reset/PasswordResetEmailPanel.html ---------------------------------------------------------------------- diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/password_reset/PasswordResetEmailPanel.html b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/password_reset/PasswordResetEmailPanel.html deleted file mode 100644 index ca8af7d..0000000 --- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/password_reset/PasswordResetEmailPanel.html +++ /dev/null @@ -1,32 +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> - <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/d84c6609/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/password_reset/PasswordResetEmailPanel.java ---------------------------------------------------------------------- diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/password_reset/PasswordResetEmailPanel.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/password_reset/PasswordResetEmailPanel.java deleted file mode 100644 index 39f0d70..0000000 --- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/password_reset/PasswordResetEmailPanel.java +++ /dev/null @@ -1,126 +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.accmngt.password_reset; - -import java.util.HashMap; -import java.util.Map; - -import javax.inject.Inject; - -import org.apache.isis.applib.services.email.EmailService; -import org.apache.isis.applib.services.userreg.EmailNotificationService; -import org.apache.isis.applib.services.userreg.events.PasswordResetEvent; -import org.apache.isis.viewer.wicket.model.models.PageType; -import org.apache.isis.viewer.wicket.ui.components.widgets.bootstrap.FormGroup; -import org.apache.isis.viewer.wicket.ui.pages.EmailVerificationUrlService; -import org.apache.isis.viewer.wicket.ui.pages.PageNavigationService; -import org.apache.isis.viewer.wicket.ui.pages.accmngt.AccountManagementPageAbstract; -import org.apache.isis.viewer.wicket.ui.pages.accmngt.EmailAvailableValidator; -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.util.cookies.CookieUtils; -import org.apache.wicket.validation.validator.EmailAddressValidator; - -import com.google.inject.name.Named; - -/** - * A panel with a form for creation of new users - */ -public class PasswordResetEmailPanel extends Panel { - - /** - * Constructor - * - * @param id - * the component id - */ - public PasswordResetEmailPanel(final String id) { - super(id); - - 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()); - emailField.add(EmailAvailableValidator.EXISTS); - - 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 = emailVerificationUrlService.createVerificationUrl(PageType.PASSWORD_RESET, email); - - /** - * We have to init() the services here because the Isis runtime is not available to us - * (guice will have instantiated a new instance of the service). - * - * We do it this way just so that the programming model for the EmailService is similar to regular Isis-managed services. - */ - emailNotificationService.init(); - emailService.init(); - - final PasswordResetEvent passwordResetEvent = new PasswordResetEvent(email, confirmationUrl, applicationName); - boolean emailSent = emailNotificationService.send(passwordResetEvent); - 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); - - CookieUtils cookieUtils = new CookieUtils(); - cookieUtils.save(AccountManagementPageAbstract.FEEDBACK_COOKIE_NAME, emailSentMessage); - pageNavigationService.navigateTo(PageType.SIGN_IN); - } - } - }; - - form.add(signUpButton); - } - - @Inject - private EmailNotificationService emailNotificationService; - @Inject - private EmailService emailService; - - @Inject - private EmailVerificationUrlService emailVerificationUrlService; - - @Inject - private PageNavigationService pageNavigationService; - - @Inject - @Named("applicationName") - private String applicationName; - -} http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/password_reset/PasswordResetPage.css ---------------------------------------------------------------------- diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/password_reset/PasswordResetPage.css b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/password_reset/PasswordResetPage.css deleted file mode 100644 index 3727ba1..0000000 --- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/password_reset/PasswordResetPage.css +++ /dev/null @@ -1,100 +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. - */ - - -#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/d84c6609/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/password_reset/PasswordResetPage.html ---------------------------------------------------------------------- diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/password_reset/PasswordResetPage.html b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/password_reset/PasswordResetPage.html deleted file mode 100644 index 37a0a27..0000000 --- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/password_reset/PasswordResetPage.html +++ /dev/null @@ -1,37 +0,0 @@ -<?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 wicket:id="feedback"></div> - - <h2><wicket:message key="passwordResetHeader"/></h2> - <div wicket:id="passwordResetPanel"></div> - </div> - </div> - </wicket:extend> - </body> -</html> http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/password_reset/PasswordResetPage.java ---------------------------------------------------------------------- diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/password_reset/PasswordResetPage.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/password_reset/PasswordResetPage.java deleted file mode 100644 index ff5b913..0000000 --- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/password_reset/PasswordResetPage.java +++ /dev/null @@ -1,120 +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.accmngt.password_reset; - -import de.agilecoders.wicket.core.markup.html.bootstrap.common.NotificationPanel; - -import java.util.concurrent.Callable; -import org.apache.wicket.RestartResponseAtInterceptPageException; -import org.apache.wicket.request.mapper.parameter.PageParameters; -import org.apache.wicket.util.string.StringValue; -import org.apache.wicket.util.string.Strings; -import org.apache.isis.applib.services.userreg.UserRegistrationService; -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.pages.accmngt.AccountConfirmationMap; -import org.apache.isis.viewer.wicket.ui.pages.accmngt.AccountManagementPageAbstract; -import org.apache.isis.viewer.wicket.ui.pages.login.WicketSignInPage; - -/** - * A page used for resetting the password of an user. - */ -public class PasswordResetPage extends AccountManagementPageAbstract { - - private static final long serialVersionUID = 1L; - - private static final String ID_CONTENT_PANEL = "passwordResetPanel"; - - public PasswordResetPage(final PageParameters parameters) { - this(parameters, getAndClearExceptionModelIfAny()); - } - - private PasswordResetPage(final PageParameters parameters, ExceptionModel exceptionModel) { - super(parameters, exceptionModel); - - boolean suppressPasswordResetLink = getConfiguration().getBoolean(WicketSignInPage.ISIS_VIEWER_WICKET_SUPPRESS_PASSWORD_RESET, false); - if(suppressPasswordResetLink) { - throw new RestartResponseAtInterceptPageException(WicketSignInPage.class); - } - } - - @Override - protected void onInitialize() { - super.onInitialize(); - - add(new NotificationPanel("feedback")); - - StringValue uuidValue = getPageParameters().get(0); - if (uuidValue.isEmpty()) { - addPasswordResetEmailPanel(ID_CONTENT_PANEL); - } else { - String uuid = uuidValue.toString(); - - AccountConfirmationMap accountConfirmationMap = getApplication().getMetaData(AccountConfirmationMap.KEY); - final String email = accountConfirmationMap.get(uuid); - if (Strings.isEmpty(email)) { - error(getString("passwordResetExpiredOrInvalidToken")); - addOrReplace(addPasswordResetEmailPanel(ID_CONTENT_PANEL)); - } else { - Boolean emailExists = IsisContext.doInSession(new Callable<Boolean>() { - @Override - public Boolean call() throws Exception { - UserRegistrationService userRegistrationService = IsisContext.getPersistenceSession().getServicesInjector().lookupService(UserRegistrationService.class); - return userRegistrationService.emailExists(email); - } - }); - if (!emailExists) { - error(getString("noUserForAnEmailValidToken")); - addOrReplace(addPasswordResetEmailPanel(ID_CONTENT_PANEL)); - } else { - addPasswordResetPanel(ID_CONTENT_PANEL, uuid); - } - } - } - } - - /** - * Shows a panel with password reset form fields. - * - * @param id The component id - * @param uuid A unique id used to identify the email of the user whose password will be reset - * @return A panel with "password reset" form fields - */ - protected PasswordResetPanel addPasswordResetPanel(String id, String uuid) { - final PasswordResetPanel passwordResetPanel = new PasswordResetPanel(id, uuid); - addOrReplace(passwordResetPanel); - return passwordResetPanel; - } - - /** - * Shows a panel where where the user has to provide her email address. - * An email with unique url will be sent to this email address. Once clicked - * {@link #addPasswordResetPanel(String, String)} will be used to actually - * change the password - * - * @param id The component id - * @return A panel with "send email for password reset" functionality - */ - protected PasswordResetEmailPanel addPasswordResetEmailPanel(String id) { - final PasswordResetEmailPanel passwordResetEmailPanel = new PasswordResetEmailPanel(id); - addOrReplace(passwordResetEmailPanel); - return passwordResetEmailPanel; - } -} http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/password_reset/PasswordResetPanel.html ---------------------------------------------------------------------- diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/password_reset/PasswordResetPanel.html b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/password_reset/PasswordResetPanel.html deleted file mode 100644 index 8348019..0000000 --- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/password_reset/PasswordResetPanel.html +++ /dev/null @@ -1,37 +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> - <form wicket:id="passwordResetForm" role="form"> - <div class="form-group"> - <label wicket:for="password" class="control-label"><wicket:message key="passwordLabel"/></label> - <input type="password" class="form-control" wicket:id="password" wicket:message="placeholder:passwordPlaceholder"/> - </div> - - <div class="form-group"> - <label wicket:for="confirmPassword" class="control-label"><wicket:message key="confirmPasswordLabel"/></label> - <input type="password" class="form-control" wicket:id="confirmPassword" wicket:message="placeholder:confirmPasswordPlaceholder"/> - </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/d84c6609/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/password_reset/PasswordResetPanel.java ---------------------------------------------------------------------- diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/password_reset/PasswordResetPanel.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/password_reset/PasswordResetPanel.java deleted file mode 100644 index 8001c1e..0000000 --- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/password_reset/PasswordResetPanel.java +++ /dev/null @@ -1,117 +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.accmngt.password_reset; - -import de.agilecoders.wicket.core.markup.html.bootstrap.common.INotificationMessage; -import de.agilecoders.wicket.core.markup.html.bootstrap.common.NotificationMessage; - -import java.util.HashMap; -import java.util.Map; -import java.util.concurrent.Callable; -import javax.inject.Inject; -import org.apache.wicket.Page; -import org.apache.wicket.markup.html.form.Button; -import org.apache.wicket.markup.html.form.PasswordTextField; -import org.apache.wicket.markup.html.form.StatelessForm; -import org.apache.wicket.markup.html.form.validation.EqualPasswordInputValidator; -import org.apache.wicket.markup.html.panel.Panel; -import org.apache.wicket.model.Model; -import org.apache.wicket.model.ResourceModel; -import org.apache.isis.applib.services.userreg.UserRegistrationService; -import org.apache.isis.core.runtime.system.context.IsisContext; -import org.apache.isis.viewer.wicket.model.models.PageType; -import org.apache.isis.viewer.wicket.ui.pages.PageClassRegistry; -import org.apache.isis.viewer.wicket.ui.pages.accmngt.AccountConfirmationMap; - -/** - * A panel with a form for creation of new users - */ -public class PasswordResetPanel extends Panel { - - /** - * Constructor - * - * @param id The component id - * @param uuid The unique id to find the user's email address - */ - public PasswordResetPanel(final String id, final String uuid) { - super(id); - - StatelessForm<Void> form = new StatelessForm<>("passwordResetForm"); - addOrReplace(form); - - final PasswordTextField passwordField = new PasswordTextField("password", Model.of("")); - passwordField.setLabel(new ResourceModel("passwordLabel")); - form.add(passwordField); - - final PasswordTextField confirmPasswordField = new PasswordTextField("confirmPassword", Model.of("")); - confirmPasswordField.setLabel(new ResourceModel("confirmPasswordLabel")); - form.add(confirmPasswordField); - - form.add(new EqualPasswordInputValidator(passwordField, confirmPasswordField)); - - Button signUpButton = new Button("passwordResetSubmit") { - @Override - public void onSubmit() { - super.onSubmit(); - - final String password = confirmPasswordField.getModelObject(); - - final AccountConfirmationMap accountConfirmationMap = getApplication().getMetaData(AccountConfirmationMap.KEY); - - Boolean passwordUpdated = IsisContext.doInSession(new Callable<Boolean>() { - @Override - public Boolean call() throws Exception { - String email = accountConfirmationMap.get(uuid); - - UserRegistrationService userRegistrationService = IsisContext.getPersistenceSession().getServicesInjector().lookupService(UserRegistrationService.class); - return userRegistrationService.updatePasswordByEmail(email, password); - } - }); - - if (passwordUpdated) { - accountConfirmationMap.remove(uuid); - success(createPasswordChangeSuccessfulMessage()); - } else { - error(getString("passwordChangeUnsuccessful")); - } - } - }; - - form.add(signUpButton); - } - - private INotificationMessage createPasswordChangeSuccessfulMessage() { - Class<? extends Page> signInPage = pageClassRegistry.getPageClass(PageType.SIGN_IN); - CharSequence signInUrl = urlFor(signInPage, null); - Map<String, CharSequence> map = new HashMap<>(); - map.put("signInUrl", signInUrl); - String passwordChangeSuccessful = getString("passwordChangeSuccessful", Model.ofMap(map)); - NotificationMessage message = new NotificationMessage(Model.of(passwordChangeSuccessful)); - message.escapeModelStrings(false); - return message; - } - - @Inject - private PageClassRegistry pageClassRegistry; - -} - - http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/register/RegisterPage.css ---------------------------------------------------------------------- diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/register/RegisterPage.css b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/register/RegisterPage.css deleted file mode 100644 index eaeea17..0000000 --- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/register/RegisterPage.css +++ /dev/null @@ -1,18 +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. - */ http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/register/RegisterPage.html ---------------------------------------------------------------------- diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/register/RegisterPage.html b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/register/RegisterPage.html deleted file mode 100644 index 8e7aa84..0000000 --- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/register/RegisterPage.html +++ /dev/null @@ -1,38 +0,0 @@ -<?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="registerPanel col-sm-offset-4 col-sm-4"> - <div wicket:id="feedback"></div> - - <h2><wicket:message key="registerHeader">Register</wicket:message></h2> - <div wicket:id="content"></div> - </div> - </div> - </wicket:extend> - </body> - -</html> http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/register/RegisterPage.java ---------------------------------------------------------------------- diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/register/RegisterPage.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/register/RegisterPage.java deleted file mode 100644 index 781360a..0000000 --- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/register/RegisterPage.java +++ /dev/null @@ -1,91 +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.accmngt.register; - -import javax.inject.Inject; - -import org.apache.isis.applib.services.userreg.UserDetails; -import org.apache.isis.viewer.wicket.model.models.PageType; -import org.apache.isis.viewer.wicket.ui.errors.ExceptionModel; -import org.apache.isis.viewer.wicket.ui.pages.PageNavigationService; -import org.apache.isis.viewer.wicket.ui.pages.accmngt.AccountConfirmationMap; -import org.apache.isis.viewer.wicket.ui.pages.accmngt.AccountManagementPageAbstract; -import org.apache.wicket.MarkupContainer; -import org.apache.wicket.markup.html.WebMarkupContainer; -import org.apache.wicket.request.mapper.parameter.PageParameters; -import org.apache.wicket.util.string.StringValue; -import org.apache.wicket.util.string.Strings; - -import de.agilecoders.wicket.core.markup.html.bootstrap.common.NotificationPanel; - -/** - * Web page representing the about page. - */ -public class RegisterPage extends AccountManagementPageAbstract { - - private static final long serialVersionUID = 1L; - - public RegisterPage(final PageParameters parameters) { - this(parameters, getAndClearExceptionModelIfAny()); - } - - private RegisterPage(final PageParameters parameters, final ExceptionModel exceptionModel) { - super(parameters, exceptionModel); - } - - @Override - protected void onInitialize() { - super.onInitialize(); - - add(new NotificationPanel("feedback")); - - final StringValue uuidValue = getPageParameters().get(0); - if (uuidValue.isEmpty()) { - pageNavigationService.navigateTo(PageType.SIGN_IN); - } else { - String uuid = uuidValue.toString(); - - AccountConfirmationMap accountConfirmationMap = getApplication().getMetaData(AccountConfirmationMap.KEY); - final String email = accountConfirmationMap.get(uuid); - if (Strings.isEmpty(email)) { - pageNavigationService.navigateTo(PageType.SIGN_IN); - } else { - UserDetails userDetails = newUserDetails(); - addOrReplace(new RegisterPanel("content", userDetails, uuidValue.toString()) { - @Override - protected MarkupContainer newExtraFieldsContainer(String id) { - return RegisterPage.this.newExtraFieldsContainer(id); - } - }); - } - } - } - - protected UserDetails newUserDetails() { - return new UserDetails(); - } - - protected MarkupContainer newExtraFieldsContainer(final String id) { - return new WebMarkupContainer(id); - } - - @Inject - private PageNavigationService pageNavigationService; -} http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/register/RegisterPanel.html ---------------------------------------------------------------------- diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/register/RegisterPanel.html b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/register/RegisterPanel.html deleted file mode 100644 index 7abe8a6..0000000 --- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/register/RegisterPanel.html +++ /dev/null @@ -1,33 +0,0 @@ -<!DOCTYPE html> -<html xmlns:wicket="http://wicket.apache.org"> - <body> - <wicket:panel> - <form wicket:id="registerForm" role="form"> - <div class="form-group"> - <label wicket:for="email"><wicket:message key="emailLabel"/></label> - <input type="text" class="form-control" wicket:id="email" readonly tabindex="-1"/> - </div> - - <div class="form-group" wicket:id="usernameFormGroup"> - <label wicket:for="username" class="control-label"><wicket:message key="usernameLabel"/></label> - <input type="text" class="form-control" wicket:id="username" wicket:message="placeholder:usernamePlaceholder"/> - </div> - - <div class="form-group" wicket:id="passwordFormGroup"> - <label wicket:for="password" class="control-label"><wicket:message key="passwordLabel"/></label> - <input type="password" class="form-control" wicket:id="password" wicket:message="placeholder:passwordPlaceholder"/> - </div> - - <div class="form-group" wicket:id="confirmPasswordFormGroup"> - <label wicket:for="confirmPassword" class="control-label"><wicket:message key="confirmPasswordLabel"/></label> - <input type="password" class="form-control" wicket:id="confirmPassword" wicket:message="placeholder:confirmPasswordPlaceholder"/> - </div> - - <wicket:container wicket:id="extraFieldsContainer"/> - - <button type="submit" class="btn btn-primary btn-sm"><wicket:message key="registerButtonLabel"/></button> - <button type="reset" class="btn btn-default btn-sm"><wicket:message key="resetButtonLabel"/></button> - </form> - </wicket:panel> - </body> -</html> http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/register/RegisterPanel.java ---------------------------------------------------------------------- diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/register/RegisterPanel.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/register/RegisterPanel.java deleted file mode 100644 index a6da854..0000000 --- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/register/RegisterPanel.java +++ /dev/null @@ -1,176 +0,0 @@ -package org.apache.isis.viewer.wicket.ui.pages.accmngt.register; - -import org.apache.isis.applib.services.userreg.UserDetails; -import org.apache.isis.applib.services.userreg.UserRegistrationService; -import org.apache.isis.core.runtime.system.context.IsisContext; -import org.apache.isis.core.runtime.system.transaction.TransactionalClosureAbstract; -import org.apache.isis.viewer.wicket.ui.components.widgets.bootstrap.FormGroup; -import org.apache.isis.viewer.wicket.ui.pages.accmngt.AccountConfirmationMap; -import org.apache.isis.viewer.wicket.ui.pages.accmngt.UsernameAvailableValidator; -import org.apache.wicket.Component; -import org.apache.wicket.MarkupContainer; -import org.apache.wicket.authroles.authentication.AuthenticatedWebSession; -import org.apache.wicket.markup.html.form.FormComponent; -import org.apache.wicket.markup.html.form.PasswordTextField; -import org.apache.wicket.markup.html.form.RequiredTextField; -import org.apache.wicket.markup.html.form.StatelessForm; -import org.apache.wicket.markup.html.form.TextField; -import org.apache.wicket.markup.html.form.validation.EqualPasswordInputValidator; -import org.apache.wicket.markup.html.form.validation.IFormValidator; -import org.apache.wicket.markup.html.panel.GenericPanel; -import org.apache.wicket.model.CompoundPropertyModel; -import org.apache.wicket.model.Model; -import org.apache.wicket.model.ResourceModel; - -/** - * A panel with a form for self-registration of a user - */ -public abstract class RegisterPanel extends GenericPanel<UserDetails> { - - protected static final String ID_REGISTER_FORM = "registerForm"; - private static final String ID_USERNAME = "username"; - private static final String ID_USERNAME_FORM_GROUP = "usernameFormGroup"; - private static final String ID_PASSWORD = "password"; - private static final String ID_PASSWORD_FORM_GROUP = "passwordFormGroup"; - private static final String ID_CONFIRM_PASSWORD = "confirmPassword"; - private static final String ID_CONFIRM_PASSWORD_FORM_GROUP = "confirmPasswordFormGroup"; - private static final String ID_EMAIL = "email"; - - private final UserDetails userDetails; - private final String uuid; - - public RegisterPanel(final String id, final UserDetails userDetails, final String uuid) { - super(id); - this.userDetails = userDetails; - this.uuid = uuid; - } - - @Override - protected void onInitialize() { - super.onInitialize(); - - RegisterForm registerForm = new RegisterForm(ID_REGISTER_FORM, uuid, userDetails); - add(registerForm); - - Component username = newUsernameField(); - MarkupContainer password = newPasswordField(); - MarkupContainer confirmPassword = newConfirmPasswordField(); - registerForm.add(newEqualPasswordInputValidator(password, confirmPassword)); - TextField<String> emailField = newEmailField(userDetails); - - registerForm.add(username, password, confirmPassword, emailField); - - registerForm.add(newExtraFieldsContainer("extraFieldsContainer")); - } - - protected abstract MarkupContainer newExtraFieldsContainer(String id); - - - private IFormValidator newEqualPasswordInputValidator(MarkupContainer password, MarkupContainer confirmPassword) { - FormComponent passwordField = (FormComponent) password.get(ID_PASSWORD); - FormComponent confirmPasswordField = (FormComponent) confirmPassword.get(ID_CONFIRM_PASSWORD); - return new EqualPasswordInputValidator(passwordField, confirmPasswordField); - } - - /** - * Register user form. - */ - private static class RegisterForm extends StatelessForm<UserDetails> - { - private static final long serialVersionUID = 1L; - - private final String uuid; - - /** - * Constructor. - * - * @param id - * id of the form component - * @param userDetails - */ - public RegisterForm(final String id, final String uuid, UserDetails userDetails) - { - super(id, new CompoundPropertyModel<>(userDetails)); - - this.uuid = uuid; - - String email = getEmail(); - - userDetails.setEmailAddress(email); - } - - @Override - public final void onSubmit() - { - final UserDetails userDetails = getModelObject(); - - IsisContext.doInSession(new Runnable() { - @Override - public void run() { - final UserRegistrationService userRegistrationService = IsisContext.getPersistenceSession().getServicesInjector().lookupService(UserRegistrationService.class); - - IsisContext.getTransactionManager().executeWithinTransaction(new TransactionalClosureAbstract() { - @Override - public void execute() { - userRegistrationService.registerUser(userDetails); - removeAccountConfirmation(); - } - }); - } - }); - - signIn(userDetails.getUsername(), userDetails.getPassword()); - setResponsePage(getApplication().getHomePage()); - } - - private boolean signIn(String username, String password) - { - return AuthenticatedWebSession.get().signIn(username, password); - } - - private String getEmail() { - AccountConfirmationMap accountConfirmationMap = getApplication().getMetaData(AccountConfirmationMap.KEY); - return accountConfirmationMap.get(uuid); - } - - private void removeAccountConfirmation() { - AccountConfirmationMap accountConfirmationMap = getApplication().getMetaData(AccountConfirmationMap.KEY); - accountConfirmationMap.remove(uuid); - } - } - - protected TextField<String> newEmailField(final UserDetails userDetails) { - // use readonly-ish model to prevent changing the email with manual form submits - TextField<String> emailField = new TextField<>(ID_EMAIL, new Model<String>() { - @Override - public String getObject() { - return userDetails.getEmailAddress(); - } - }); - return emailField; - } - - protected MarkupContainer newConfirmPasswordField() { - PasswordTextField confirmPassword = new PasswordTextField(ID_CONFIRM_PASSWORD); - confirmPassword.setLabel(new ResourceModel("confirmPasswordLabel")); - FormGroup confirmPasswordFormGroup = new FormGroup(ID_CONFIRM_PASSWORD_FORM_GROUP, confirmPassword); - confirmPasswordFormGroup.add(confirmPassword); - return confirmPasswordFormGroup; - } - - protected MarkupContainer newPasswordField() { - PasswordTextField password = new PasswordTextField(ID_PASSWORD); - password.setLabel(new ResourceModel("passwordLabel")); - FormGroup passwordFormGroup = new FormGroup(ID_PASSWORD_FORM_GROUP, password); - passwordFormGroup.add(password); - return passwordFormGroup; - } - - protected MarkupContainer newUsernameField() { - RequiredTextField<String> username = new RequiredTextField<>(ID_USERNAME); - username.add(UsernameAvailableValidator.INSTANCE); - FormGroup usernameFormGroup = new FormGroup(ID_USERNAME_FORM_GROUP, username); - usernameFormGroup.add(username); - return usernameFormGroup; - } -} http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/signup/RegistrationFormPage.css ---------------------------------------------------------------------- diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/signup/RegistrationFormPage.css b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/signup/RegistrationFormPage.css deleted file mode 100644 index 3727ba1..0000000 --- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/signup/RegistrationFormPage.css +++ /dev/null @@ -1,100 +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. - */ - - -#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/d84c6609/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/signup/RegistrationFormPage.html ---------------------------------------------------------------------- diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/signup/RegistrationFormPage.html b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/signup/RegistrationFormPage.html deleted file mode 100644 index 01d0358..0000000 --- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/accmngt/signup/RegistrationFormPage.html +++ /dev/null @@ -1,35 +0,0 @@ -<?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="loginPanel col-sm-offset-4 col-sm-4"> - <h2><wicket:message key="signUpHeader"/></h2> - <div wicket:id="registrationFormPanel"></div> - </div> - </div> - </wicket:extend> - </body> -</html>
