diff --git a/README.adoc b/README.adoc index 94b48ead..1e4563c9 100644 --- a/README.adoc +++ b/README.adoc @@ -2,7 +2,8 @@ Current release version: -* 4.0.x - http://wicket.apache.org/[Wicket 10.x] with Spring Boot 3.2.x - Branch master +* 4.1.x - http://wicket.apache.org/[Wicket 10.2] with Spring Boot 3.3.4 - Branch master +* 4.0.x - http://wicket.apache.org/[Wicket 10.0] with Spring Boot 3.2.x - Branch master NOTE: http://search.maven.org/#search|ga|1|com.giffing.wicket.spring.boot diff --git a/wicket-spring-boot-starter-example/pom.xml b/wicket-spring-boot-starter-example/pom.xml index 474cb0be..7c470263 100644 --- a/wicket-spring-boot-starter-example/pom.xml +++ b/wicket-spring-boot-starter-example/pom.xml @@ -18,6 +18,7 @@ true 5.1-jdk8 true + 7.0.8 @@ -49,6 +50,29 @@ org.wicketstuff wicketstuff-annotation + + de.agilecoders.wicket + wicket-bootstrap-core + ${wicket-bootstrap.version} + + + + de.agilecoders.wicket + wicket-bootstrap-extensions + ${wicket-bootstrap.version} + + + + de.agilecoders.wicket + wicket-bootstrap-sass + ${wicket-bootstrap.version} + + + + de.agilecoders.wicket + wicket-bootstrap-themes + ${wicket-bootstrap.version} + org.wicketstuff wicketstuff-htmlcompressor @@ -81,11 +105,6 @@ org.wicketstuff wicketstuff-serializer-fast2 - - org.webjars - bootstrap - 5.3.3 - de.agilecoders.wicket jquery-selectors diff --git a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/model/Customer.java b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/model/Customer.java index 48fbda7c..676cdb88 100644 --- a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/model/Customer.java +++ b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/model/Customer.java @@ -18,8 +18,6 @@ public class Customer implements Domain, Serializable { private String username; - private String password; - private String firstname; private String lastname; @@ -35,14 +33,6 @@ public void setId(Long id) { this.id = id; } - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - public String getUsername() { return username; } diff --git a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/assets/base/FixBootstrapStylesCssResourceReference.java b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/assets/base/FixBootstrapStylesCssResourceReference.java new file mode 100644 index 00000000..44ec0aab --- /dev/null +++ b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/assets/base/FixBootstrapStylesCssResourceReference.java @@ -0,0 +1,12 @@ +package com.giffing.wicket.spring.boot.example.web.assets.base; + +import org.apache.wicket.request.resource.CssResourceReference; + +public class FixBootstrapStylesCssResourceReference extends CssResourceReference { + + public static final FixBootstrapStylesCssResourceReference INSTANCE = new FixBootstrapStylesCssResourceReference(); + + public FixBootstrapStylesCssResourceReference() { + super(FixBootstrapStylesCssResourceReference.class, "fix.css"); + } +} diff --git a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/assets/base/fix.css b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/assets/base/fix.css new file mode 100644 index 00000000..485a2ff7 --- /dev/null +++ b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/assets/base/fix.css @@ -0,0 +1,3 @@ +.navbar { + --bs-navbar-padding-x: 1; +} \ No newline at end of file diff --git a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/general/action/panel/items/AbstractActionItemLink.java b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/general/action/panel/items/AbstractActionItemLink.java index cfe92519..32895302 100644 --- a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/general/action/panel/items/AbstractActionItemLink.java +++ b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/general/action/panel/items/AbstractActionItemLink.java @@ -21,7 +21,7 @@ public void onClick(AjaxRequestTarget target) { }; add(link); WebMarkupContainer webMarkupContainer = new WebMarkupContainer("icon-type"); - webMarkupContainer.add(new AttributeAppender("class", "glyphicon glyphicon-" + iconType.getCssName())); + webMarkupContainer.add(new AttributeAppender("class", iconType.getCssName())); link.add(webMarkupContainer); } diff --git a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/general/action/panel/items/links/ActionItemLink.java b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/general/action/panel/items/links/ActionItemLink.java index 88e22646..5166cdf0 100644 --- a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/general/action/panel/items/links/ActionItemLink.java +++ b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/general/action/panel/items/links/ActionItemLink.java @@ -13,7 +13,7 @@ public class ActionItemLink extends AbstrractActionItem { public ActionItemLink(IModel label, IconType iconType, AbstractLink link) { add(link); WebMarkupContainer webMarkupContainer = new WebMarkupContainer("icon-type"); - webMarkupContainer.add(new AttributeAppender("class", "glyphicon glyphicon-" + iconType.getCssName())); + webMarkupContainer.add(new AttributeAppender("class", "fa-solid fa-" + iconType.getCssName())); link.add(webMarkupContainer); } diff --git a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/general/action/panel/items/yesno/YesNoLink.java b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/general/action/panel/items/yesno/YesNoLink.java index d9c78f6c..b4062967 100644 --- a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/general/action/panel/items/yesno/YesNoLink.java +++ b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/general/action/panel/items/yesno/YesNoLink.java @@ -1,12 +1,13 @@ package com.giffing.wicket.spring.boot.example.web.general.action.panel.items.yesno; +import com.giffing.wicket.spring.boot.example.web.pages.BasePage; import org.apache.wicket.ajax.AjaxRequestTarget; +import org.apache.wicket.markup.html.panel.EmptyPanel; import org.apache.wicket.model.IModel; import com.giffing.wicket.spring.boot.example.web.general.action.panel.items.AbstractActionItemLink; import com.giffing.wicket.spring.boot.example.web.general.icons.IconType; import com.giffing.wicket.spring.boot.example.web.html.modal.YesNoModal; -import com.giffing.wicket.spring.boot.example.web.pages.BasePage; public abstract class YesNoLink extends AbstractActionItemLink{ @@ -21,11 +22,12 @@ public void onClick(AjaxRequestTarget target) { @Override protected void yesClicked(AjaxRequestTarget target) { YesNoLink.this.yesClicked(target); - this.close(target); + close(target); + ((BasePage)getPage()).replaceDefaultModal( new EmptyPanel("defaultModal"), target); } }; - ((BasePage)getPage()).replaceDefaultModal(yesNoModal); - yesNoModal.open(target); + ((BasePage)getPage()).replaceDefaultModal(yesNoModal, target); + yesNoModal.appendShowDialogJavaScript(target); } protected abstract void yesClicked(AjaxRequestTarget target); diff --git a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/general/icons/IconType.java b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/general/icons/IconType.java index ce4b3b24..5944837b 100644 --- a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/general/icons/IconType.java +++ b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/general/icons/IconType.java @@ -1,9 +1,11 @@ package com.giffing.wicket.spring.boot.example.web.general.icons; +import de.agilecoders.wicket.extensions.markup.html.bootstrap.icon.FontAwesome6IconType; + public enum IconType { - CREATE("plus"), - EDIT("edit"), - DELETE("remove"); + CREATE(FontAwesome6IconType.plus_s.cssClassName()), + EDIT(FontAwesome6IconType.pen_s.cssClassName()), + DELETE(FontAwesome6IconType.minus_s.cssClassName()); private String cssType; diff --git a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/html/border/LabeledFormBorder.html b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/html/border/LabeledFormBorder.html deleted file mode 100644 index 7ab61c35..00000000 --- a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/html/border/LabeledFormBorder.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - -
- -
-
- - \ No newline at end of file diff --git a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/html/border/LabeledFormBorder.java b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/html/border/LabeledFormBorder.java deleted file mode 100644 index 84074322..00000000 --- a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/html/border/LabeledFormBorder.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.giffing.wicket.spring.boot.example.web.html.border; - -import org.apache.wicket.AttributeModifier; -import org.apache.wicket.markup.html.basic.Label; -import org.apache.wicket.markup.html.border.Border; -import org.apache.wicket.markup.html.form.FormComponent; -import org.apache.wicket.markup.html.form.FormComponentLabel; -import org.apache.wicket.model.Model; - -public class LabeledFormBorder extends Border { - - private static final long serialVersionUID = 1L; - - private FormComponent formComponent; - - public LabeledFormBorder(String labelText, FormComponent container) { - super(container.getId() + "Border"); - this.formComponent = container; - FormComponentLabel label = new FormComponentLabel("label", container); - label.add(new AttributeModifier("class", "control-label")); - Label somethingLabelSpan = new Label("labelText", labelText); - somethingLabelSpan.setRenderBodyOnly(true); - label.add(somethingLabelSpan); - - addToBorder(label); - add(container); - } - - @Override - protected void onBeforeRender() { - - if (!formComponent.isValid()) { - add(new AttributeModifier("class", Model.of("form-group has-error"))); - } else { - add(new AttributeModifier("class", "form-group")); - } - - super.onBeforeRender(); - } - -} diff --git a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/html/border/behavior/ValidationMsgBehavior.java b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/html/border/behavior/ValidationMsgBehavior.java index f1da9110..3d28418f 100644 --- a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/html/border/behavior/ValidationMsgBehavior.java +++ b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/html/border/behavior/ValidationMsgBehavior.java @@ -35,7 +35,7 @@ public void afterRender(Component component) { } else { error = "Your input is invalid."; } - fc.getResponse().write("*"+error+""); + fc.getResponse().write("*"+error+""); super.afterRender(component); } } diff --git a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/html/form/ValidationForm.java b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/html/form/ValidationForm.java index d00487fa..5254f8b8 100644 --- a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/html/form/ValidationForm.java +++ b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/html/form/ValidationForm.java @@ -1,10 +1,10 @@ package com.giffing.wicket.spring.boot.example.web.html.form; -import org.apache.wicket.markup.html.form.Form; +import de.agilecoders.wicket.core.markup.html.bootstrap.form.BootstrapForm; import org.apache.wicket.model.IModel; import org.apache.wicket.util.visit.IVisitor; -public class ValidationForm extends Form{ +public class ValidationForm extends BootstrapForm { private static final long serialVersionUID = 1L; diff --git a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/html/form/ValidationFormVisitor.java b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/html/form/ValidationFormVisitor.java index 1b944e20..80e24ebc 100644 --- a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/html/form/ValidationFormVisitor.java +++ b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/html/form/ValidationFormVisitor.java @@ -11,7 +11,7 @@ import com.giffing.wicket.spring.boot.example.web.html.border.behavior.ValidationMsgBehavior; -public class ValidationFormVisitor implements IVisitor, IClusterable { +public class ValidationFormVisitor implements IVisitor, IClusterable { private static final long serialVersionUID = 1L; @@ -19,14 +19,10 @@ public class ValidationFormVisitor implements IVisitor, IClu @Override public void component(Component c, IVisit visit) { - if (!visited.contains(c)) { - if(c instanceof FormComponent){ - FormComponent fc = (FormComponent) c; + if(c instanceof FormComponent fc && !visited.contains(c)) { c.add(new ValidationMsgBehavior()); -// c.add(new PropertyValidator<>()); visited.add(fc); } - } } } diff --git a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/html/modal/YesNoModal.html b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/html/modal/YesNoModal.html new file mode 100644 index 00000000..3c88c17f --- /dev/null +++ b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/html/modal/YesNoModal.html @@ -0,0 +1,10 @@ + + + TextContentModal + + + +
+
+ + diff --git a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/html/modal/YesNoModal.java b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/html/modal/YesNoModal.java index 14131d4d..b6338483 100644 --- a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/html/modal/YesNoModal.java +++ b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/html/modal/YesNoModal.java @@ -1,32 +1,33 @@ package com.giffing.wicket.spring.boot.example.web.html.modal; +import de.agilecoders.wicket.core.markup.html.bootstrap.dialog.Modal; import org.apache.wicket.ajax.AjaxRequestTarget; -import org.apache.wicket.extensions.ajax.markup.html.modal.ModalDialog; - -public abstract class YesNoModal extends ModalDialog { - - public YesNoModal(String id) { - super(id); - YesNoPanel yesNoPanel = new YesNoPanel(CONTENT_ID){ - - @Override - protected void yesClicked(AjaxRequestTarget target) { - YesNoModal.this.yesClicked(target); - } - - @Override - protected void noClicked(AjaxRequestTarget target) { - YesNoModal.this.noClicked(target); - } - - }; - setContent(yesNoPanel); - } - - protected void noClicked(AjaxRequestTarget target) { - close(target); - } - - protected abstract void yesClicked(AjaxRequestTarget target); - +import org.apache.wicket.markup.html.panel.Panel; + +public abstract class YesNoModal extends Modal { + + public YesNoModal(String id) { + super(id); + YesNoPanel yesNoPanel = new YesNoPanel("content") { + + @Override + protected void yesClicked(AjaxRequestTarget target) { + YesNoModal.this.yesClicked(target); + } + + @Override + protected void noClicked(AjaxRequestTarget target) { + YesNoModal.this.noClicked(target); + } + + }; + add(yesNoPanel); + } + + protected void noClicked(AjaxRequestTarget target) { + close(target); + } + + protected abstract void yesClicked(AjaxRequestTarget target); + } diff --git a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/html/modal/YesNoPanel.html b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/html/modal/YesNoPanel.html index 86fcf1ad..7120ddad 100644 --- a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/html/modal/YesNoPanel.html +++ b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/html/modal/YesNoPanel.html @@ -1,5 +1,13 @@ + + + TextContentModal + + - yes - no +
+ yes + no
+ + \ No newline at end of file diff --git a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/html/modal/YesNoPanel.java b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/html/modal/YesNoPanel.java index 4aeab754..d0df5853 100644 --- a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/html/modal/YesNoPanel.java +++ b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/html/modal/YesNoPanel.java @@ -6,46 +6,46 @@ import org.apache.wicket.markup.html.panel.Panel; import org.apache.wicket.model.IModel; -public abstract class YesNoPanel extends Panel{ - - - public YesNoPanel(String id) { - super(id); - - add(new AjaxLink("yes") { - - @Override - public void onClick(AjaxRequestTarget target) { - YesNoPanel.this.yesClicked(target); - } - - @Override - public MarkupContainer setDefaultModel(IModel model) { - return super.setDefaultModel( model ); - } - - }); - - add(new AjaxLink("no") { - - @Override - public void onClick(AjaxRequestTarget target) { - YesNoPanel.this.noClicked(target); - } - - @Override - public MarkupContainer setDefaultModel(IModel model) { - return super.setDefaultModel( model ); - } - - - }); - - } - - protected abstract void noClicked(AjaxRequestTarget target); - - protected abstract void yesClicked(AjaxRequestTarget target); - +public abstract class YesNoPanel extends Panel { + + + public YesNoPanel(String id) { + super(id); + + add(new AjaxLink<>("yes") { + + @Override + public void onClick(AjaxRequestTarget target) { + YesNoPanel.this.yesClicked(target); + } + + @Override + public MarkupContainer setDefaultModel(IModel model) { + return super.setDefaultModel(model); + } + + }); + + add(new AjaxLink<>("no") { + + @Override + public void onClick(AjaxRequestTarget target) { + YesNoPanel.this.noClicked(target); + } + + @Override + public MarkupContainer setDefaultModel(IModel model) { + return super.setDefaultModel(model); + } + + + }); + + } + + protected abstract void noClicked(AjaxRequestTarget target); + + protected abstract void yesClicked(AjaxRequestTarget target); + } diff --git a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/BaseAuthenticatedPage.html b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/BaseAuthenticatedPage.html new file mode 100644 index 00000000..93e047d2 --- /dev/null +++ b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/BaseAuthenticatedPage.html @@ -0,0 +1,15 @@ + + + + + Spring Boot - Apache Wicket Quickstart + + + + +
+ + +
+ + diff --git a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/BaseAuthenticatedPage.java b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/BaseAuthenticatedPage.java new file mode 100644 index 00000000..34e77cb5 --- /dev/null +++ b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/BaseAuthenticatedPage.java @@ -0,0 +1,106 @@ +package com.giffing.wicket.spring.boot.example.web.pages; + +import com.giffing.wicket.spring.boot.example.web.pages.customers.CustomerListPage; +import com.giffing.wicket.spring.boot.example.web.pages.footer.Footer; +import com.giffing.wicket.spring.boot.example.web.pages.websocket.ChatPage; +import de.agilecoders.wicket.core.Bootstrap; +import de.agilecoders.wicket.core.markup.html.bootstrap.button.BootstrapExternalLink; +import de.agilecoders.wicket.core.markup.html.bootstrap.button.dropdown.DropDownButton; +import de.agilecoders.wicket.core.markup.html.bootstrap.button.dropdown.MenuBookmarkablePageLink; +import de.agilecoders.wicket.core.markup.html.bootstrap.button.dropdown.MenuDivider; +import de.agilecoders.wicket.core.markup.html.bootstrap.button.dropdown.MenuHeader; +import de.agilecoders.wicket.core.markup.html.bootstrap.navbar.*; +import de.agilecoders.wicket.core.markup.html.bootstrap.utilities.BackgroundColorBehavior; +import de.agilecoders.wicket.core.settings.IBootstrapSettings; +import de.agilecoders.wicket.core.settings.ITheme; +import de.agilecoders.wicket.extensions.markup.html.bootstrap.icon.FontAwesome6IconType; +import org.apache.wicket.Component; +import org.apache.wicket.markup.html.WebMarkupContainer; +import org.apache.wicket.markup.html.link.AbstractLink; +import org.apache.wicket.model.Model; +import org.apache.wicket.request.mapper.parameter.PageParameters; +import org.apache.wicket.util.string.StringValue; + +import java.util.ArrayList; +import java.util.List; + +public abstract class BaseAuthenticatedPage extends BasePage { + + public BaseAuthenticatedPage(final PageParameters parameters) { + super(parameters); + add(newNavbar("navbar")); + add(newNavigation("navigation")); + add(new Footer("footer")); + } + + protected Navbar newNavbar(String markupId) { + Navbar navbar = new Navbar(markupId) + .setPosition(Navbar.Position.TOP) + .setInverted(true) + .setBackgroundColor(BackgroundColorBehavior.Color.Dark); + + navbar.setBrandName(Model.of("Wicket")); + navbar.addComponents(NavbarComponents.transform(Navbar.ComponentPosition.LEFT, + new NavbarButton(CustomerListPage.class, Model.of("Customers")).setIconType(FontAwesome6IconType.person_s), + new NavbarButton(ChatPage.class, Model.of("Chat")).setIconType(FontAwesome6IconType.rocketchat), + new NavbarExternalLink(Model.of("https://github.com/MarcGiffing/wicket-spring-boot")) + .setLabel(Model.of("Github")) + .setTarget(BootstrapExternalLink.Target.blank) + .setIconType(FontAwesome6IconType.upload_s)) + ); + DropDownButton dropdown = new NavbarDropDownButton(Model.of("Themes")) { + + @Override + public boolean isActive(Component item) { + return false; + } + + @Override + protected List newSubMenuButtons(final String buttonMarkupId) { + final List subMenu = new ArrayList<>(); + subMenu.add(new MenuHeader(Model.of("all available themes:"))); + subMenu.add(new MenuDivider()); + + final IBootstrapSettings settings = Bootstrap.getSettings(getApplication()); + final List themes = settings.getThemeProvider().available(); + + for (final ITheme theme : themes) { + PageParameters params = new PageParameters(); + params.set("theme", theme.name()); + + subMenu.add(new MenuBookmarkablePageLink(getPageClass(), params, Model.of(theme.name()))); + } + + return subMenu; + } + }.setIconType(FontAwesome6IconType.book_s); + + navbar.addComponents(new ImmutableNavbarComponent(dropdown, Navbar.ComponentPosition.RIGHT)); + return navbar; + } + + private void configureTheme(PageParameters pageParameters) { + StringValue theme = pageParameters.get("theme"); + + if (!theme.isEmpty()) { + IBootstrapSettings settings = Bootstrap.getSettings(getApplication()); + settings.getActiveThemeProvider().setActiveTheme(theme.toString("")); + } + } + + @Override + protected void onConfigure() { + super.onConfigure(); + configureTheme(getPageParameters()); + } + + protected boolean hasNavigation() { + return false; + } + + private Component newNavigation(String markupId) { + WebMarkupContainer navigation = new WebMarkupContainer(markupId); + navigation.setVisible(hasNavigation()); + return navigation; + } +} diff --git a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/BasePage.properties b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/BaseAuthenticatedPage.properties similarity index 86% rename from wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/BasePage.properties rename to wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/BaseAuthenticatedPage.properties index a56b82c5..2abf52c0 100644 --- a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/BasePage.properties +++ b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/BaseAuthenticatedPage.properties @@ -4,6 +4,9 @@ firstname=Firstname lastname=Lastname active=Active password=Password +usernameLike=Username +firstnameLike=Firstname +lastnameLike=Lastname yes=Yes no=No diff --git a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/BasePage.html b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/BasePage.html index 0a56be93..24afbcba 100644 --- a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/BasePage.html +++ b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/BasePage.html @@ -1,12 +1,21 @@ - - Wicket! - - -
-
- -
- - \ No newline at end of file + + + Apache Wicket & Spring Bootstrap + + + + + + + + + Skip navigation +
+ + +

+        
+    
+
diff --git a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/BasePage.java b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/BasePage.java
index 6f77a99e..b7da8651 100644
--- a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/BasePage.java
+++ b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/BasePage.java
@@ -1,58 +1,85 @@
 package com.giffing.wicket.spring.boot.example.web.pages;
 
+import com.giffing.wicket.spring.boot.example.web.assets.base.FixBootstrapStylesCssResourceReference;
+import com.giffing.wicket.spring.boot.example.web.general.notify.NotyJSReference;
+import com.giffing.wicket.spring.boot.example.web.general.notify.NotyPackagedJSReference;
+import com.giffing.wicket.spring.boot.example.web.general.notify.NotyThemeBootstrapJSReference;
+import de.agilecoders.wicket.core.markup.html.bootstrap.block.Code;
+import de.agilecoders.wicket.core.markup.html.bootstrap.form.FormGroup;
+import de.agilecoders.wicket.core.markup.html.bootstrap.html.IeEdgeMetaTag;
+import de.agilecoders.wicket.core.markup.html.bootstrap.html.MetaTag;
+import de.agilecoders.wicket.core.markup.html.bootstrap.html.MobileViewportMetaTag;
+import de.agilecoders.wicket.core.markup.html.references.BootlintHeaderItem;
+import de.agilecoders.wicket.extensions.markup.html.bootstrap.icon.FontAwesome6CssReference;
 import org.apache.wicket.MarkupContainer;
-import org.apache.wicket.extensions.ajax.markup.html.modal.ModalDialog;
+import org.apache.wicket.ajax.AjaxRequestTarget;
 import org.apache.wicket.markup.head.CssHeaderItem;
 import org.apache.wicket.markup.head.IHeaderResponse;
 import org.apache.wicket.markup.head.JavaScriptHeaderItem;
-import org.apache.wicket.markup.html.WebPage;
+import org.apache.wicket.markup.head.filter.HeaderResponseContainer;
+import org.apache.wicket.markup.html.GenericWebPage;
+import org.apache.wicket.markup.html.form.FormComponent;
 import org.apache.wicket.markup.html.panel.EmptyPanel;
+import org.apache.wicket.model.Model;
 import org.apache.wicket.request.mapper.parameter.PageParameters;
 
-import com.giffing.wicket.spring.boot.example.web.general.notify.NotyJSReference;
-import com.giffing.wicket.spring.boot.example.web.general.notify.NotyPackagedJSReference;
-import com.giffing.wicket.spring.boot.example.web.general.notify.NotyThemeBootstrapJSReference;
+public class BasePage extends GenericWebPage {
+
+    private MarkupContainer defaultModal;
+
+    public BasePage(final PageParameters parameters) {
+        super(parameters);
+
+        defaultModal = new EmptyPanel("defaultModal");
+        defaultModal.setMarkupId("defaultModal");
+        defaultModal.setOutputMarkupId(true);
+        queue(defaultModal);
+
+        //add(new HtmlTag("html", WebSession.get().getLocale()));
+        MobileViewportMetaTag mvt = new MobileViewportMetaTag("viewport");
+        mvt.setWidth("device-width");
+        mvt.setInitialScale("1");
+        add(mvt);
+        add(new IeEdgeMetaTag("ie-edge"));
+        add(new MetaTag("description", Model.of("description"), Model.of("Wicket")));
+
+        add(new Code("code-internal"));
+        add(new HeaderResponseContainer("footer-container", "footer-container"));
+    }
+
+    @Override
+    public void renderHead(IHeaderResponse response) {
+        super.renderHead(response);
+
+        response.render(CssHeaderItem.forReference(FixBootstrapStylesCssResourceReference.INSTANCE));
+        response.render(CssHeaderItem.forReference(FontAwesome6CssReference.instance()));
+        response.render(JavaScriptHeaderItem.forReference(NotyJSReference.INSTANCE));
+        response.render(JavaScriptHeaderItem.forReference(NotyPackagedJSReference.INSTANCE));
+        response.render(JavaScriptHeaderItem.forReference(NotyThemeBootstrapJSReference.INSTANCE));
+
+        if (!getRequest().getRequestParameters().getParameterValue("bootlint").isNull()) {
+            response.render(BootlintHeaderItem.INSTANCE);
+        }
+    }
+
+    public MarkupContainer getDefaultModal() {
+        return defaultModal;
+    }
+
+    public void replaceDefaultModal(MarkupContainer newModal, AjaxRequestTarget target) {
+        newModal.setMarkupId(defaultModal.getMarkupId());
+        newModal.setOutputMarkupId(true);
+        defaultModal.replaceWith(newModal);
+        target.add(newModal);
+        defaultModal = newModal;
+    }
 
-import de.agilecoders.wicket.webjars.request.resource.WebjarsJavaScriptResourceReference;
-
-public abstract class BasePage extends WebPage {
-
-	private MarkupContainer defaultModal;
-	
-	public BasePage(PageParameters params){
-		super(params);
-		initPage();
-	}
-	
-	public BasePage(){
-		initPage();
-	}
-	
-	private void initPage(){
-		defaultModal = new EmptyPanel("defaultModal");
-		defaultModal.setOutputMarkupId(true);
-		add(defaultModal);
-	}
-	
-	public void replaceDefaultModal(ModalDialog newModal){
-		defaultModal.replaceWith(newModal);
-		defaultModal = newModal;
-		defaultModal.setOutputMarkupId(true);
-	}
-	
-	@Override
-	public void renderHead(IHeaderResponse response) {
-		super.renderHead(response);
-		
-		response.render(JavaScriptHeaderItem.forReference(getApplication().getJavaScriptLibrarySettings().getJQueryReference()));
-		response.render(JavaScriptHeaderItem.forReference(getApplication().getJavaScriptLibrarySettings().getWicketAjaxReference()));
-		response.render(JavaScriptHeaderItem.forReference(NotyJSReference.INSTANCE));
-		response.render(JavaScriptHeaderItem.forReference(NotyPackagedJSReference.INSTANCE));
-		response.render(JavaScriptHeaderItem.forReference(NotyThemeBootstrapJSReference.INSTANCE));
-		
-		String bootstrapPrefixPath = "bootstrap/current";
-		response.render(JavaScriptHeaderItem.forReference(new WebjarsJavaScriptResourceReference(bootstrapPrefixPath + "/js/bootstrap.js")));
-		response.render(CssHeaderItem.forReference(new WebjarsJavaScriptResourceReference(bootstrapPrefixPath + "/css/bootstrap.css")));
-	}
+    protected FormGroup queueFormComponent(FormComponent formComponent) {
+        var formGroup = new FormGroup(formComponent.getId() + "Border");
+        formGroup.useFormComponentLabel(true);
+        formGroup.add(formComponent);
+        queue(formGroup);
+        return formGroup;
+    }
 
 }
diff --git a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/WicketBootstrapInitializer.java b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/WicketBootstrapInitializer.java
new file mode 100644
index 00000000..a998f836
--- /dev/null
+++ b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/WicketBootstrapInitializer.java
@@ -0,0 +1,34 @@
+package com.giffing.wicket.spring.boot.example.web.pages;
+
+import com.giffing.wicket.spring.boot.context.extensions.ApplicationInitExtension;
+import com.giffing.wicket.spring.boot.context.extensions.WicketApplicationInitConfiguration;
+import de.agilecoders.wicket.core.Bootstrap;
+import de.agilecoders.wicket.core.settings.BootstrapSettings;
+import de.agilecoders.wicket.core.settings.CookieThemeProvider;
+import de.agilecoders.wicket.core.settings.IBootstrapSettings;
+import de.agilecoders.wicket.core.settings.ThemeProvider;
+import de.agilecoders.wicket.sass.BootstrapSass;
+import de.agilecoders.wicket.themes.markup.html.bootswatch.BootswatchTheme;
+import de.agilecoders.wicket.themes.markup.html.bootswatch.BootswatchThemeProvider;
+import org.apache.wicket.markup.head.filter.JavaScriptFilteredIntoFooterHeaderResponse;
+import org.apache.wicket.protocol.http.WebApplication;
+
+@ApplicationInitExtension
+public class WicketBootstrapInitializer implements WicketApplicationInitConfiguration {
+    @Override
+    public void init(WebApplication webApplication) {
+        final IBootstrapSettings settings = new BootstrapSettings();
+        Bootstrap.builder().withBootstrapSettings(settings).install(webApplication);
+        final ThemeProvider themeProvider = new BootswatchThemeProvider(BootswatchTheme.Cerulean);
+
+        settings.setJsResourceFilterName("footer-container")
+                .setThemeProvider(themeProvider)
+                .setActiveThemeProvider(new CookieThemeProvider());
+
+        BootstrapSass.install(webApplication);
+        webApplication.getCspSettings().blocking().disabled();
+        webApplication.getMarkupSettings().setStripWicketTags(true);
+
+        webApplication.getHeaderResponseDecorators().add(response -> new JavaScriptFilteredIntoFooterHeaderResponse(response, "footer-container"));
+    }
+}
diff --git a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/customers/CustomerListPage.html b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/customers/CustomerListPage.html
index 0b92a019..623adf82 100644
--- a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/customers/CustomerListPage.html
+++ b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/customers/CustomerListPage.html
@@ -1,48 +1,50 @@
 
 
 
-	
-	

Customer list

-

- - - -

-
-
- -
-
-
-
- -
-
- -
-
-
-
- -
-
- -
-
-
-
- -
-
-
- - - -
-
-
-
-
+
+
+

Customers + +

+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+
+ + + +
+
+
+
+
+
diff --git a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/customers/CustomerListPage.java b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/customers/CustomerListPage.java index 9997e829..0757f56e 100644 --- a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/customers/CustomerListPage.java +++ b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/customers/CustomerListPage.java @@ -3,6 +3,13 @@ import java.util.ArrayList; import java.util.List; +import com.giffing.wicket.spring.boot.context.scan.WicketHomePage; +import com.giffing.wicket.spring.boot.example.web.pages.BaseAuthenticatedPage; +import com.giffing.wicket.spring.boot.example.web.pages.customers.events.CustomerDeletedEvent; +import com.giffing.wicket.spring.boot.starter.web.servlet.websocket.WebSocketMessageBroadcaster; +import de.agilecoders.wicket.core.markup.html.bootstrap.button.BootstrapBookmarkablePageLink; +import de.agilecoders.wicket.core.markup.html.bootstrap.button.Buttons; +import de.agilecoders.wicket.extensions.markup.html.bootstrap.icon.FontAwesome6IconType; import org.apache.wicket.Component; import org.apache.wicket.ajax.AjaxRequestTarget; import org.apache.wicket.authroles.authorization.strategies.role.annotations.AuthorizeInstantiation; @@ -43,30 +50,35 @@ import com.giffing.wicket.spring.boot.example.web.general.action.panel.items.yesno.YesNoLink; import com.giffing.wicket.spring.boot.example.web.general.icons.IconType; import com.giffing.wicket.spring.boot.example.web.html.basic.YesNoLabel; -import com.giffing.wicket.spring.boot.example.web.html.border.LabeledFormBorder; import com.giffing.wicket.spring.boot.example.web.html.form.ValidationForm; import com.giffing.wicket.spring.boot.example.web.html.panel.FeedbackPanel; import com.giffing.wicket.spring.boot.example.web.html.repeater.data.table.filter.AbstractCheckBoxFilter; import com.giffing.wicket.spring.boot.example.web.html.repeater.data.table.filter.AbstractTextFieldFilter; -import com.giffing.wicket.spring.boot.example.web.pages.BasePage; import com.giffing.wicket.spring.boot.example.web.pages.customers.create.CustomerCreatePage; import com.giffing.wicket.spring.boot.example.web.pages.customers.edit.CustomerEditPage; import com.giffing.wicket.spring.boot.example.web.pages.customers.events.CustomerChangedEvent; import com.giffing.wicket.spring.boot.example.web.pages.customers.model.CustomerDataProvider; import com.giffing.wicket.spring.boot.example.web.pages.customers.model.UsernameSearchTextField; -@MountPath("customers") +@WicketHomePage +@MountPath("custsomers") @AuthorizeInstantiation("USER") -public class CustomerListPage extends BasePage { +public class CustomerListPage extends BaseAuthenticatedPage { @SpringBean private CustomerRepositoryService customerRepositoryService; + + @SpringBean + private WebSocketMessageBroadcaster webSocketMessageBroadcaster; private IModel customerFilterModel; private FilterForm filterForm; + + DataTable dataTable; public CustomerListPage() { + super(new PageParameters()); FeedbackPanel feedbackPanel = new FeedbackPanel("feedback"); feedbackPanel.setOutputMarkupId(true); add(feedbackPanel); @@ -75,9 +87,12 @@ public CustomerListPage() { @Override protected void onPush(WebSocketRequestHandler handler, IWebSocketPushMessage message) { - if (message instanceof CustomerChangedEvent) { - CustomerChangedEvent event = (CustomerChangedEvent)message; - info("changed/created " + event.getCustomer().getFirstname() + " " + event.getCustomer().getLastname()); + if (message instanceof CustomerChangedEvent event) { + info("Customer changed " + event.getCustomer().getFirstname() + " " + event.getCustomer().getLastname()); + handler.add(feedbackPanel); + } + if (message instanceof CustomerDeletedEvent event) { + warn("Customer deleted: " + event.getCustomer().getFirstname() + " " + event.getCustomer().getLastname()); handler.add(feedbackPanel); } } @@ -87,14 +102,16 @@ protected void onPush(WebSocketRequestHandler handler, IWebSocketPushMessage mes customerFilterModel = new CompoundPropertyModel<>(new CustomerFilter()); CustomerDataProvider customerDataProvider = new CustomerDataProvider(customerFilterModel); - queue(new BookmarkablePageLink("create", CustomerCreatePage.class)); + queue(new BootstrapBookmarkablePageLink("create", CustomerCreatePage.class, Buttons.Type.Link) + .setIconType(FontAwesome6IconType.plus_s) + .setSize(Buttons.Size.Large)); queue(new ValidationForm<>("form", customerFilterModel)); - queue(new LabeledFormBorder<>(getString("id"), new TextField<>("id"))); - queue(new LabeledFormBorder<>(getString("username"), new UsernameSearchTextField("usernameLike"))); - queue(new LabeledFormBorder<>(getString("firstname"), new TextField("firstnameLike").add(StringValidator.minimumLength(3)))); - queue(new LabeledFormBorder<>(getString("lastname"), new TextField("lastnameLike").add(StringValidator.minimumLength(3)))); - queue(new LabeledFormBorder<>(getString("active"), new CheckBox("active"))); + queueFormComponent(new TextField<>("id")); + queueFormComponent(new UsernameSearchTextField("usernameLike")); + queueFormComponent(new TextField("firstnameLike").add(StringValidator.minimumLength(3))); + queueFormComponent(new TextField("lastnameLike").add(StringValidator.minimumLength(3))); + queueFormComponent(new CheckBox("active")); queue(cancelButton()); customerDataTable(customerDataProvider); @@ -118,7 +135,7 @@ public void onSubmit() { private void customerDataTable(CustomerDataProvider customerDataProvider) { - filterForm = new FilterForm("filterForm", customerDataProvider); + filterForm = new FilterForm<>("filterForm", customerDataProvider); queue(filterForm); List> columns = new ArrayList<>(); @@ -129,8 +146,9 @@ private void customerDataTable(CustomerDataProvider customerDataProvider) { columns.add(activeColumn()); columns.add(actionColumn()); - DataTable dataTable = new AjaxFallbackDefaultDataTable("table", columns, + dataTable = new AjaxFallbackDefaultDataTable("table", columns, customerDataProvider, 10); + dataTable.setOutputMarkupId(true); FilterToolbar filterToolbar = new FilterToolbar(dataTable, filterForm); dataTable.addTopToolbar(filterToolbar); @@ -239,7 +257,8 @@ public void populateItem(Item> cellItem, String compone @Override protected void yesClicked(AjaxRequestTarget target) { customerRepositoryService.delete(rowModel.getObject().getId()); - setResponsePage(CustomerListPage.this); + webSocketMessageBroadcaster.sendToAll(new CustomerDeletedEvent(rowModel.getObject())); + target.add(dataTable); } }); diff --git a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/customers/create/CustomerCreatePage.html b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/customers/create/CustomerCreatePage.html index e3c878a4..b7de841f 100644 --- a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/customers/create/CustomerCreatePage.html +++ b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/customers/create/CustomerCreatePage.html @@ -1,31 +1,44 @@ - -

Customer Create

- -
-
- -
-
- -
-
- -
-
- -
-
- -
- - - -
- - + +
+
+

Customer Create

+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+
+ + +
+
+
diff --git a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/customers/create/CustomerCreatePage.java b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/customers/create/CustomerCreatePage.java index 0ff29b9d..085db326 100644 --- a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/customers/create/CustomerCreatePage.java +++ b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/customers/create/CustomerCreatePage.java @@ -1,138 +1,112 @@ -package com.giffing.wicket.spring.boot.example.web.pages.customers.create; - -import org.apache.wicket.Component; -import org.apache.wicket.PageReference; -import org.apache.wicket.markup.html.form.Button; -import org.apache.wicket.markup.html.form.CheckBox; -import org.apache.wicket.markup.html.form.PasswordTextField; -import org.apache.wicket.markup.html.form.RequiredTextField; -import org.apache.wicket.model.CompoundPropertyModel; -import org.apache.wicket.spring.injection.annot.SpringBean; -import org.wicketstuff.annotation.mount.MountPath; - -import com.giffing.wicket.spring.boot.example.model.Customer; -import com.giffing.wicket.spring.boot.example.repository.services.customer.CustomerRepositoryService; -import com.giffing.wicket.spring.boot.example.web.html.border.LabeledFormBorder; -import com.giffing.wicket.spring.boot.example.web.html.form.ValidationForm; -import com.giffing.wicket.spring.boot.example.web.pages.BasePage; -import com.giffing.wicket.spring.boot.example.web.pages.customers.CustomerListPage; -import com.giffing.wicket.spring.boot.example.web.pages.customers.events.CustomerChangedEvent; -import com.giffing.wicket.spring.boot.example.web.pages.customers.model.UsernameTextField; -import com.giffing.wicket.spring.boot.starter.web.servlet.websocket.WebSocketMessageBroadcaster; - -@MountPath("customers/create") -public class CustomerCreatePage extends BasePage{ - - @SpringBean - private CustomerRepositoryService service; - - @SpringBean - private WebSocketMessageBroadcaster webSocketMessageBroadcaster; - - CompoundPropertyModel customerModel; - - private Integer pageReferenceId; - - public CustomerCreatePage(Integer pageId){ - this.pageReferenceId = pageId; - } - - public CustomerCreatePage(){ - customerModel = new CompoundPropertyModel<>(new Customer()); - queue(new ValidationForm<>("form", customerModel)); - queue(usernameField()); - queue(firstnameField()); - queue(lastnameField()); - queue(passwordField()); - queue(activeField()); - queue(submitButton()); - queue(cancelButton()); - } - - private Component activeField() { - return new LabeledFormBorder(getString("active"), new CheckBox("active")); - } - - private LabeledFormBorder usernameField() { - return new LabeledFormBorder(getString("username"), new UsernameTextField("username")){ - - @Override - public boolean isEnabled() { - return isCreatePage(); - } - - }; - } - - private LabeledFormBorder firstnameField() { - return new LabeledFormBorder<>(getString("firstname"), new RequiredTextField<>("firstname")); - } - - private LabeledFormBorder lastnameField() { - return new LabeledFormBorder<>(getString("lastname"), new RequiredTextField<>("lastname")); - } - - private LabeledFormBorder passwordField() { - PasswordTextField passwordTextField = new PasswordTextField("password"); - //TODO its not recommended to disable the password reset. But without my tests are failing cause the password is not submitted. https://issues.apache.org/jira/browse/WICKET-6221 - passwordTextField.setResetPassword(false); - LabeledFormBorder labeledPasswordTextField = new LabeledFormBorder(getString("password"), passwordTextField){ - - @Override - public boolean isVisible() { - return isCreatePage(); - } - - }; - return labeledPasswordTextField; - } - - public boolean isCreatePage(){ - return true; - } - - private Component submitButton() { +package com.giffing.wicket.spring.boot.example.web.pages.customers.create; + +import com.giffing.wicket.spring.boot.example.model.Customer; +import com.giffing.wicket.spring.boot.example.repository.services.customer.CustomerRepositoryService; +import com.giffing.wicket.spring.boot.example.web.html.form.ValidationForm; +import com.giffing.wicket.spring.boot.example.web.pages.BaseAuthenticatedPage; +import com.giffing.wicket.spring.boot.example.web.pages.customers.CustomerListPage; +import com.giffing.wicket.spring.boot.example.web.pages.customers.events.CustomerChangedEvent; +import com.giffing.wicket.spring.boot.example.web.pages.customers.model.UsernameTextField; +import com.giffing.wicket.spring.boot.starter.web.servlet.websocket.WebSocketMessageBroadcaster; +import org.apache.wicket.Component; +import org.apache.wicket.PageReference; +import org.apache.wicket.markup.html.form.Button; +import org.apache.wicket.markup.html.form.CheckBox; +import org.apache.wicket.markup.html.form.FormComponent; +import org.apache.wicket.markup.html.form.RequiredTextField; +import org.apache.wicket.model.CompoundPropertyModel; +import org.apache.wicket.request.mapper.parameter.PageParameters; +import org.apache.wicket.spring.injection.annot.SpringBean; +import org.wicketstuff.annotation.mount.MountPath; + +@MountPath("customers/create") +public class CustomerCreatePage extends BaseAuthenticatedPage { + + @SpringBean + private CustomerRepositoryService service; + + @SpringBean + private WebSocketMessageBroadcaster webSocketMessageBroadcaster; + + CompoundPropertyModel customerModel; + + private Integer pageReferenceId; + + public CustomerCreatePage(Integer pageId){ + super(new PageParameters()); + this.pageReferenceId = pageId; + } + + public CustomerCreatePage(){ + super(new PageParameters()); + customerModel = new CompoundPropertyModel<>(new Customer()); + queue(new ValidationForm<>("form", customerModel)); + queueFormComponent(usernameField()); + queueFormComponent(new RequiredTextField<>("firstname")); + queueFormComponent(new RequiredTextField<>("lastname")); + queueFormComponent(new CheckBox("active")); + queue(submitButton()); + queue(cancelButton()); + } + + + private FormComponent usernameField() { + return new UsernameTextField("username") { + + @Override + public boolean isEnabled() { + return isCreatePage(); + } + }; + } + + public boolean isCreatePage(){ + return true; + } + + private Component submitButton() { return new Button("submit"){ @Override public void onSubmit() { - service.save(customerModel.getObject()); - webSocketMessageBroadcaster.sendToAll(new CustomerChangedEvent(customerModel.getObject())); - if(pageReferenceId != null){ - setResponsePage(new PageReference(pageReferenceId).getPage()); - } else { - setResponsePage(CustomerListPage.class); - } - } + Customer customer = customerModel.getObject(); + service.save(customer); + webSocketMessageBroadcaster.sendToAll(new CustomerChangedEvent(customer)); + if(pageReferenceId != null){ + setResponsePage(new PageReference(pageReferenceId).getPage()); + } else { + setResponsePage(CustomerListPage.class); + } + } }; } - - private Component cancelButton() { + + private Component cancelButton() { Button cancelButton = new Button("cancel"){ @Override public void onSubmit() { - if(pageReferenceId != null){ - setResponsePage(new PageReference(pageReferenceId).getPage()); - } else { - setResponsePage(CustomerListPage.class); - } + if(pageReferenceId != null){ + setResponsePage(new PageReference(pageReferenceId).getPage()); + } else { + setResponsePage(CustomerListPage.class); + } } - + }; - cancelButton.setDefaultFormProcessing(false); - return cancelButton; - } - - public CompoundPropertyModel getCustomerModel() { - return customerModel; - } - - public Integer getPageReferenceId() { - return pageReferenceId; - } - - public void setPageReferenceId(Integer pageReferenceId) { - this.pageReferenceId = pageReferenceId; - } - -} + cancelButton.setDefaultFormProcessing(false); + return cancelButton; + } + + public CompoundPropertyModel getCustomerModel() { + return customerModel; + } + + public Integer getPageReferenceId() { + return pageReferenceId; + } + + public void setPageReferenceId(Integer pageReferenceId) { + this.pageReferenceId = pageReferenceId; + } + +} diff --git a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/customers/events/CustomerDeletedEvent.java b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/customers/events/CustomerDeletedEvent.java new file mode 100644 index 00000000..b40e835d --- /dev/null +++ b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/customers/events/CustomerDeletedEvent.java @@ -0,0 +1,22 @@ +package com.giffing.wicket.spring.boot.example.web.pages.customers.events; + +import com.giffing.wicket.spring.boot.example.model.Customer; +import org.apache.wicket.protocol.ws.api.message.IWebSocketPushMessage; + +public class CustomerDeletedEvent implements IWebSocketPushMessage { + + private Customer customer; + + public CustomerDeletedEvent(Customer customer) { + this.setCustomer(customer); + } + + public Customer getCustomer() { + return customer; + } + + public void setCustomer(Customer customer) { + this.customer = customer; + } + +} diff --git a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/errors/AccessDeniedPage.html b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/errors/AccessDeniedPage.html index ee774530..33c207c9 100644 --- a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/errors/AccessDeniedPage.html +++ b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/errors/AccessDeniedPage.html @@ -1,13 +1,22 @@ - - - Zugriff verweigert + + + Access Denied! - - - -

Zugriff verweigert!

-
- + + + +
+
+

Access Denied!

+
+
+ +
+ ... +
+ +
+ \ No newline at end of file diff --git a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/errors/AccessDeniedPage.java b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/errors/AccessDeniedPage.java index b1c64117..c6693f9d 100644 --- a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/errors/AccessDeniedPage.java +++ b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/errors/AccessDeniedPage.java @@ -1,18 +1,22 @@ package com.giffing.wicket.spring.boot.example.web.pages.errors; +import com.giffing.wicket.spring.boot.example.web.pages.BasePage; import jakarta.servlet.http.HttpServletResponse; import org.apache.wicket.request.http.WebResponse; +import org.apache.wicket.request.mapper.parameter.PageParameters; import org.wicketstuff.annotation.mount.MountPath; import com.giffing.wicket.spring.boot.context.scan.WicketAccessDeniedPage; -import com.giffing.wicket.spring.boot.example.web.pages.BasePage; @MountPath("problem") @WicketAccessDeniedPage public class AccessDeniedPage extends BasePage { - + public AccessDeniedPage(PageParameters parameters) { + super(parameters); + } + @Override protected void setHeaders(final WebResponse response) { diff --git a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/errors/ExpiredPage.html b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/errors/ExpiredPage.html index f207cc7e..3dd5fe5c 100644 --- a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/errors/ExpiredPage.html +++ b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/errors/ExpiredPage.html @@ -1,13 +1,21 @@ - - - Zugriff verweigert + + + Expired - - - -

Expired!

-
- + + + +
+
+

Expired!

+
+
+ +
+ ... +
+
+ \ No newline at end of file diff --git a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/errors/ExpiredPage.java b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/errors/ExpiredPage.java index f1d0644d..d36d9e00 100644 --- a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/errors/ExpiredPage.java +++ b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/errors/ExpiredPage.java @@ -1,14 +1,19 @@ package com.giffing.wicket.spring.boot.example.web.pages.errors; +import com.giffing.wicket.spring.boot.example.web.pages.BasePage; import jakarta.servlet.http.HttpServletResponse; -import org.apache.wicket.markup.html.WebPage; import org.apache.wicket.request.http.WebResponse; import com.giffing.wicket.spring.boot.context.scan.WicketExpiredPage; +import org.apache.wicket.request.mapper.parameter.PageParameters; @WicketExpiredPage -public class ExpiredPage extends WebPage{ +public class ExpiredPage extends BasePage { + + public ExpiredPage(PageParameters parameters) { + super(parameters); + } @Override protected void setHeaders(final WebResponse response) diff --git a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/errors/InternalErrorPage.html b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/errors/InternalErrorPage.html new file mode 100644 index 00000000..8b9ba325 --- /dev/null +++ b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/errors/InternalErrorPage.html @@ -0,0 +1,22 @@ + + + + + Internal Error + + + + +
+
+

Internal Error!

+
+
+ +
+ ... +
+ +
+ + \ No newline at end of file diff --git a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/errors/InternalErrorPage.java b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/errors/InternalErrorPage.java new file mode 100644 index 00000000..9aec6ccb --- /dev/null +++ b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/errors/InternalErrorPage.java @@ -0,0 +1,12 @@ +package com.giffing.wicket.spring.boot.example.web.pages.errors; + +import com.giffing.wicket.spring.boot.context.scan.WicketInternalErrorPage; +import com.giffing.wicket.spring.boot.example.web.pages.BasePage; +import org.apache.wicket.request.mapper.parameter.PageParameters; + +@WicketInternalErrorPage +public class InternalErrorPage extends BasePage { + public InternalErrorPage(PageParameters parameters) { + super(parameters); + } +} diff --git a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/footer/Footer.html b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/footer/Footer.html new file mode 100644 index 00000000..f232bb47 --- /dev/null +++ b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/footer/Footer.html @@ -0,0 +1,13 @@ + + + Footer + + + +
+
+
+
+
+ + diff --git a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/footer/Footer.java b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/footer/Footer.java new file mode 100644 index 00000000..98a08a73 --- /dev/null +++ b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/footer/Footer.java @@ -0,0 +1,9 @@ +package com.giffing.wicket.spring.boot.example.web.pages.footer; + +import org.apache.wicket.markup.html.panel.Panel; + +public class Footer extends Panel { + public Footer(String markupId) { + super(markupId); + } +} diff --git a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/home/HomePage.html b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/home/HomePage.html deleted file mode 100644 index f83eb7ad..00000000 --- a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/home/HomePage.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - - Spring Boot - Apache Wicket Quickstart - - - - -

Home

- Customers -
- Chat -
- - \ No newline at end of file diff --git a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/home/HomePage.java b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/home/HomePage.java deleted file mode 100644 index 7b63cc81..00000000 --- a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/home/HomePage.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.giffing.wicket.spring.boot.example.web.pages.home; - -import org.apache.wicket.authroles.authorization.strategies.role.annotations.AuthorizeInstantiation; -import org.apache.wicket.markup.html.link.BookmarkablePageLink; -import org.wicketstuff.annotation.mount.MountPath; - -import com.giffing.wicket.spring.boot.context.scan.WicketHomePage; -import com.giffing.wicket.spring.boot.example.web.pages.BasePage; -import com.giffing.wicket.spring.boot.example.web.pages.customers.CustomerListPage; -import com.giffing.wicket.spring.boot.example.web.pages.websocket.ChatPage; - -@WicketHomePage -@MountPath("home") -@AuthorizeInstantiation("USER") -public class HomePage extends BasePage { - - public HomePage(){ - add(new BookmarkablePageLink("customersLink", CustomerListPage.class)); - add(new BookmarkablePageLink("chatLink", ChatPage.class)); - } - -} diff --git a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/login/LoginPage.html b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/login/LoginPage.html index 6b2df97a..676436a3 100644 --- a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/login/LoginPage.html +++ b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/login/LoginPage.html @@ -1,33 +1,53 @@ - - - Spring Boot - Apache Wicket Quickstart + + + Spring Boot - Apache Wicket Quickstart - - - -

login

-
-
-

- - -

-

- - -

- -
-
-

- Username:Password: -

admin:admin
-
customer:customer
- - -

-
- + + + +
+
+

+ login +

+
+
+ +
+
+
+
+
+ +
+
+
+
+ +
+
+
+ +
+
+
+
    +
  • Username
  • +
  • Password
  • +
+
    +
  • admin
  • +
  • admin
  • +
+
    +
  • customer
  • +
  • customer
  • +
+
+ + +
+ \ No newline at end of file diff --git a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/login/LoginPage.java b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/login/LoginPage.java index 92683c0a..64b0eed2 100644 --- a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/login/LoginPage.java +++ b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/login/LoginPage.java @@ -1,5 +1,7 @@ package com.giffing.wicket.spring.boot.example.web.pages.login; +import com.giffing.wicket.spring.boot.example.web.pages.BasePage; +import com.giffing.wicket.spring.boot.example.web.pages.customers.CustomerListPage; import org.apache.wicket.authroles.authentication.AbstractAuthenticatedWebSession; import org.apache.wicket.authroles.authentication.AuthenticatedWebSession; import org.apache.wicket.markup.html.form.PasswordTextField; @@ -11,8 +13,6 @@ import com.giffing.wicket.spring.boot.context.scan.WicketSignInPage; import com.giffing.wicket.spring.boot.example.web.html.panel.FeedbackPanel; -import com.giffing.wicket.spring.boot.example.web.pages.BasePage; -import com.giffing.wicket.spring.boot.example.web.pages.home.HomePage; /** * Default login page. @@ -43,15 +43,15 @@ public LoginForm(String id) { super(id); setModel(new CompoundPropertyModel<>(this)); add(new FeedbackPanel("feedback")); - add(new RequiredTextField("username")); - add(new PasswordTextField("password")); + queueFormComponent(new RequiredTextField("username")); + queueFormComponent(new PasswordTextField("password")); } @Override protected void onSubmit() { AuthenticatedWebSession session = AuthenticatedWebSession.get(); if (session.signIn(username, password)) { - setResponsePage(HomePage.class); + setResponsePage(CustomerListPage.class); } else { error("Login failed"); } diff --git a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/websocket/ChatPage.html b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/websocket/ChatPage.html index 209129af..41a9e7e2 100644 --- a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/websocket/ChatPage.html +++ b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/websocket/ChatPage.html @@ -1,67 +1,62 @@ - - - Spring Boot - Apache Wicket Quickstart - - - - -

Chat

-
-
-
-
-
-
-
-
- - - - -
-
- - - - - - - -
-
-
-
-
    -
  • - - - -
    -
    - 1 min ago - Customer 1 -
    -

    - -

    -
    -
  • -
-
-
-
-
-
-
-
- + + + Chat + + + +
+
+

Chat

+
+
+
+
+
+
+
+
+
+
+
+ + + + +
+
+ + + + + + + +
+
+
+
+
+

+ : +

+
+
+
+
+
+
+
+
+
+ \ No newline at end of file diff --git a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/websocket/ChatPage.java b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/websocket/ChatPage.java index cdb9c9c8..7e60e9bd 100644 --- a/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/websocket/ChatPage.java +++ b/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/web/pages/websocket/ChatPage.java @@ -1,172 +1,177 @@ -package com.giffing.wicket.spring.boot.example.web.pages.websocket; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.UUID; -import java.util.stream.Collectors; - -import org.apache.wicket.ajax.AjaxPreventSubmitBehavior; -import org.apache.wicket.ajax.AjaxRequestTarget; -import org.apache.wicket.ajax.markup.html.form.AjaxButton; -import org.apache.wicket.authroles.authorization.strategies.role.annotations.AuthorizeInstantiation; -import org.apache.wicket.markup.head.CssReferenceHeaderItem; -import org.apache.wicket.markup.head.IHeaderResponse; -import org.apache.wicket.markup.html.WebMarkupContainer; -import org.apache.wicket.markup.html.basic.Label; -import org.apache.wicket.markup.html.form.DropDownChoice; -import org.apache.wicket.markup.html.form.Form; -import org.apache.wicket.markup.html.form.RequiredTextField; -import org.apache.wicket.markup.html.list.ListItem; -import org.apache.wicket.markup.html.list.ListView; -import org.apache.wicket.model.IModel; -import org.apache.wicket.model.Model; -import org.apache.wicket.protocol.ws.api.WebSocketBehavior; -import org.apache.wicket.protocol.ws.api.WebSocketRequestHandler; -import org.apache.wicket.protocol.ws.api.message.ClosedMessage; -import org.apache.wicket.protocol.ws.api.message.ConnectedMessage; -import org.apache.wicket.protocol.ws.api.message.IWebSocketPushMessage; -import org.apache.wicket.request.resource.PackageResourceReference; -import org.apache.wicket.spring.injection.annot.SpringBean; -import org.springframework.security.core.context.SecurityContextHolder; -import org.wicketstuff.annotation.mount.MountPath; - -import com.giffing.wicket.spring.boot.example.web.html.panel.FeedbackPanel; -import com.giffing.wicket.spring.boot.example.web.pages.BasePage; -import com.giffing.wicket.spring.boot.example.web.pages.websocket.events.CustomerMessageEvent; -import com.giffing.wicket.spring.boot.example.web.pages.websocket.events.JoinChatEvent; -import com.giffing.wicket.spring.boot.example.web.pages.websocket.events.LeftChatEvent; -import com.giffing.wicket.spring.boot.starter.web.servlet.websocket.WebSocketMessageBroadcaster; - -import de.agilecoders.wicket.jquery.JQuery; - -@MountPath("chat") -@AuthorizeInstantiation("USER") -public class ChatPage extends BasePage { - - @SpringBean - private WebSocketMessageBroadcaster broadcaster; - - @SpringBean - private ChatService chatService; - - private WebMarkupContainer chatMessageContainer; - private ListView messages; - - private DropDownChoice participantChoice; - - public ChatPage() { - FeedbackPanel feedbackPanel = new FeedbackPanel("feedback"); - feedbackPanel.setOutputMarkupId(true); - add(feedbackPanel); - addChatForm(); - addWebsocketBehaviour(feedbackPanel); - } - - private void addChatForm() { - IModel to = Model.of(""); - IModel message = Model.of(""); - Form form = null; - add(form = new Form<>("form")); - form.add(participantChoice = new DropDownChoice<>("participants", to, () -> chatService.getParticipants().stream().collect(Collectors.toList()))); - participantChoice.setOutputMarkupId(true); - form.add(new RequiredTextField<>("message", message).add(new AjaxPreventSubmitBehavior())); - form.add(new AjaxButton("submit") { - - @Override - protected void onSubmit(AjaxRequestTarget target) { - String name = SecurityContextHolder.getContext().getAuthentication().getName(); - broadcaster.sendTo(to.getObject(), new CustomerMessageEvent(name, message.getObject())); - } - - }); - - messages = new ListView("messages", new ArrayList<>()) { - - @Override - protected void populateItem(ListItem item) { - ChatMessage modelObject = item.getModelObject(); - item.add(new Label("from", modelObject.getFrom())); - item.add(new Label("message", modelObject.getMessage())); - - } - }; - messages.setOutputMarkupId(true); - form.add(chatMessageContainer = new WebMarkupContainer("chatMessageContainer")); - chatMessageContainer.setOutputMarkupId(true); - chatMessageContainer.add(messages); - } - - private void addWebsocketBehaviour(FeedbackPanel feedbackPanel) { - String currentUsername = SecurityContextHolder.getContext().getAuthentication().getName(); - String browserTabIdentifier = UUID.randomUUID().toString(); - ChatParticipant chatParticipant = new ChatParticipant(browserTabIdentifier, currentUsername); - add(new WebSocketBehavior() { - - private static final long serialVersionUID = 1L; - - @Override - protected void onPush(WebSocketRequestHandler handler, IWebSocketPushMessage message) { - if (message instanceof CustomerMessageEvent) { - CustomerMessageEvent event = (CustomerMessageEvent)message; - messages.getModelObject().add(new ChatMessage(event.getSender(), event.getMessage())); - handler.add(chatMessageContainer); - } - if(message instanceof JoinChatEvent) { - JoinChatEvent event = (JoinChatEvent)message; - String notifyStatus = "success"; - String notifyMessage = event.getUsername() + " joined the chat"; - addNotifyMessage(handler, notifyStatus, notifyMessage); - handler.add(participantChoice); - } - if(message instanceof LeftChatEvent) { - LeftChatEvent event = (LeftChatEvent)message; - String notifyStatus = "warning"; - String notifyMessage = event.getUsername() + " left the chat"; - addNotifyMessage(handler, notifyStatus, notifyMessage); - handler.add(participantChoice); - } - } - - private void addNotifyMessage(WebSocketRequestHandler handler, String notifyStatus, String notifyMessage) { - handler.appendJavaScript(JQuery - .plain("noty({text: '" + notifyMessage + "', type: '" + notifyStatus - + "', timeout: '5000', progressbar: true});")); - } - - protected void onConnect(ConnectedMessage message) { - chatService.join(chatParticipant); - } - - protected void onClose(ClosedMessage message) { - chatService.leave(chatParticipant); - } - - }); - } - - private static class ChatMessage implements Serializable { - private final String from; - private final String message; - - public ChatMessage(String from, String message) { - this.from = from; - this.message = message; - } - - public String getFrom() { - return from; - } - - public String getMessage() { - return message; - } - - - } - - public void renderHead(IHeaderResponse response) { - super.renderHead(response); - response.render(CssReferenceHeaderItem.forReference(new PackageResourceReference(ChatPage.class, "ChatPage.css"))); - } - -} +package com.giffing.wicket.spring.boot.example.web.pages.websocket; + +import com.giffing.wicket.spring.boot.example.web.html.panel.FeedbackPanel; +import com.giffing.wicket.spring.boot.example.web.pages.BaseAuthenticatedPage; +import com.giffing.wicket.spring.boot.example.web.pages.websocket.events.CustomerMessageEvent; +import com.giffing.wicket.spring.boot.example.web.pages.websocket.events.JoinChatEvent; +import com.giffing.wicket.spring.boot.example.web.pages.websocket.events.LeftChatEvent; +import com.giffing.wicket.spring.boot.starter.web.servlet.websocket.WebSocketMessageBroadcaster; +import de.agilecoders.wicket.jquery.JQuery; +import org.apache.wicket.ajax.AjaxRequestTarget; +import org.apache.wicket.ajax.markup.html.form.AjaxButton; +import org.apache.wicket.authroles.authorization.strategies.role.annotations.AuthorizeInstantiation; +import org.apache.wicket.markup.head.CssReferenceHeaderItem; +import org.apache.wicket.markup.head.IHeaderResponse; +import org.apache.wicket.markup.html.WebMarkupContainer; +import org.apache.wicket.markup.html.basic.Label; +import org.apache.wicket.markup.html.form.DropDownChoice; +import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.markup.html.form.RequiredTextField; +import org.apache.wicket.markup.html.list.ListItem; +import org.apache.wicket.markup.html.list.ListView; +import org.apache.wicket.model.IModel; +import org.apache.wicket.model.Model; +import org.apache.wicket.protocol.ws.api.WebSocketBehavior; +import org.apache.wicket.protocol.ws.api.WebSocketRequestHandler; +import org.apache.wicket.protocol.ws.api.message.ClosedMessage; +import org.apache.wicket.protocol.ws.api.message.ConnectedMessage; +import org.apache.wicket.protocol.ws.api.message.IWebSocketPushMessage; +import org.apache.wicket.request.mapper.parameter.PageParameters; +import org.apache.wicket.request.resource.PackageResourceReference; +import org.apache.wicket.spring.injection.annot.SpringBean; +import org.springframework.security.core.context.SecurityContextHolder; +import org.wicketstuff.annotation.mount.MountPath; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.UUID; +import java.util.stream.Collectors; + +@MountPath("chat") +@AuthorizeInstantiation("USER") +public class ChatPage extends BaseAuthenticatedPage { + + @SpringBean + private WebSocketMessageBroadcaster webSocketMessageBroadcaster; + + @SpringBean + private ChatService chatService; + + private WebMarkupContainer chatMessageContainer; + private ListView messages; + + RequiredTextField messageInput; + + private DropDownChoice participantChoice; + + public ChatPage(PageParameters pageParameters) { + super(pageParameters); + FeedbackPanel feedbackPanel = new FeedbackPanel("feedback"); + feedbackPanel.setOutputMarkupId(true); + add(feedbackPanel); + addChatForm(); + addWebsocketBehaviour(feedbackPanel); + } + + private void addChatForm() { + IModel to = Model.of(""); + IModel message = Model.of(""); + Form form = null; + add(form = new Form<>("form")); + form.add(participantChoice = new DropDownChoice<>("participants", to, () -> chatService + .getParticipants() + .stream().collect(Collectors.toList()))); + participantChoice.setOutputMarkupId(true); + messageInput = new RequiredTextField<>("message", message); + messageInput.setOutputMarkupId(true); + + form.add(messageInput); + AjaxButton submitButton = new AjaxButton("submit") { + + @Override + protected void onSubmit(AjaxRequestTarget target) { + String name = SecurityContextHolder.getContext().getAuthentication().getName(); + webSocketMessageBroadcaster.sendToAll(new CustomerMessageEvent(name, message.getObject())); + messageInput.setModelObject(null); + target.add(messageInput); + } + + }; + form.setDefaultButton(submitButton); + form.add(submitButton); + + messages = new ListView<>("messages", new ArrayList<>()) { + + @Override + protected void populateItem(ListItem item) { + ChatMessage modelObject = item.getModelObject(); + item.add(new Label("from", modelObject.getFrom())); + item.add(new Label("message", modelObject.getMessage())); + + } + }; + messages.setOutputMarkupId(true); + form.add(chatMessageContainer = new WebMarkupContainer("chatMessageContainer")); + chatMessageContainer.setOutputMarkupId(true); + chatMessageContainer.add(messages); + } + + private void addWebsocketBehaviour(FeedbackPanel feedbackPanel) { + String currentUsername = SecurityContextHolder.getContext().getAuthentication().getName(); + String browserTabIdentifier = UUID.randomUUID().toString(); + ChatParticipant chatParticipant = new ChatParticipant(browserTabIdentifier, currentUsername); + add(new WebSocketBehavior() { + + @Override + protected void onPush(WebSocketRequestHandler handler, IWebSocketPushMessage message) { + if (message instanceof CustomerMessageEvent event) { + messages.getModelObject().add(new ChatMessage(event.getSender(), event.getMessage())); + handler.add(chatMessageContainer); + } + if (message instanceof JoinChatEvent event) { + String notifyStatus = "success"; + String notifyMessage = event.getUsername() + " joined the chat"; + addNotifyMessage(handler, notifyStatus, notifyMessage); + handler.add(participantChoice); + } + if (message instanceof LeftChatEvent event) { + String notifyStatus = "warning"; + String notifyMessage = event.getUsername() + " left the chat"; + addNotifyMessage(handler, notifyStatus, notifyMessage); + handler.add(participantChoice); + } + } + + private void addNotifyMessage(WebSocketRequestHandler handler, String notifyStatus, String notifyMessage) { + handler.appendJavaScript(JQuery + .plain("noty({text: '" + notifyMessage + "', type: '" + notifyStatus + + "', timeout: '5000', progressbar: true});")); + } + + protected void onConnect(ConnectedMessage message) { + chatService.join(chatParticipant); + } + + protected void onClose(ClosedMessage message) { + chatService.leave(chatParticipant); + } + + }); + } + + private static class ChatMessage implements Serializable { + private final String from; + private final String message; + + public ChatMessage(String from, String message) { + this.from = from; + this.message = message; + } + + public String getFrom() { + return from; + } + + public String getMessage() { + return message; + } + + + } + + public void renderHead(IHeaderResponse response) { + super.renderHead(response); + response.render(CssReferenceHeaderItem.forReference(new PackageResourceReference(ChatPage.class, "ChatPage.css"))); + } + +} diff --git a/wicket-spring-boot-starter-example/src/main/resources/application.yml b/wicket-spring-boot-starter-example/src/main/resources/application.yml index 4c8791aa..413da142 100644 --- a/wicket-spring-boot-starter-example/src/main/resources/application.yml +++ b/wicket-spring-boot-starter-example/src/main/resources/application.yml @@ -9,9 +9,10 @@ wicket: pattern: - +*.map csrf: - accepted-origins: - - localhost -management: + enabled: false + settings: + markup: + stripWicketTags: true endpoints: web: exposure: diff --git a/wicket-spring-boot-starter-example/src/main/resources/db/changelog/table_customer.xml b/wicket-spring-boot-starter-example/src/main/resources/db/changelog/table_customer.xml index ff322ab0..97372d2f 100644 --- a/wicket-spring-boot-starter-example/src/main/resources/db/changelog/table_customer.xml +++ b/wicket-spring-boot-starter-example/src/main/resources/db/changelog/table_customer.xml @@ -16,10 +16,6 @@ - - - - diff --git a/wicket-spring-boot-starter-example/src/main/resources/db/changelog/test-data.xml b/wicket-spring-boot-starter-example/src/main/resources/db/changelog/test-data.xml index 95ca2265..335806fa 100644 --- a/wicket-spring-boot-starter-example/src/main/resources/db/changelog/test-data.xml +++ b/wicket-spring-boot-starter-example/src/main/resources/db/changelog/test-data.xml @@ -9,7 +9,6 @@ frodo - 123 Frodo Beutlin true @@ -17,7 +16,6 @@ bilbo - 123 Bilbo Beutlin false @@ -26,7 +24,6 @@ adalgrim - 123 Adalgrim Tuk true @@ -34,7 +31,6 @@ bodo - 123 Bodo Stolzfuß false @@ -42,7 +38,6 @@ tuk - 123 Ferdibrand Tuk true diff --git a/wicket-spring-boot-starter-example/src/test/java/com/giffing/wicket/spring/boot/example/web/WicketBaseIntTest.java b/wicket-spring-boot-starter-example/src/test/java/com/giffing/wicket/spring/boot/example/web/WicketBaseIntTest.java index c7af303c..73eb994b 100644 --- a/wicket-spring-boot-starter-example/src/test/java/com/giffing/wicket/spring/boot/example/web/WicketBaseIntTest.java +++ b/wicket-spring-boot-starter-example/src/test/java/com/giffing/wicket/spring/boot/example/web/WicketBaseIntTest.java @@ -53,8 +53,8 @@ private void login(String username, String password) { session.signOut(); tester.startPage(LoginPage.class); FormTester formTester = tester.newFormTester("loginForm"); - formTester.setValue("username", username); - formTester.setValue("password", password); + formTester.setValue(borderPath("username"), username); + formTester.setValue(borderPath("password"), password); formTester.submit(); tester.assertNoErrorMessage(); tester.assertRenderedPage(tester.getApplication().getHomePage()); @@ -68,4 +68,7 @@ public WebApplication getWicketApplication() { return wicketApplication; } + protected String borderPath(String componentName){ + return componentName + "Border:" + componentName + "Border_body:" + componentName; + } } diff --git a/wicket-spring-boot-starter-example/src/test/java/com/giffing/wicket/spring/boot/example/web/WicketBaseTest.java b/wicket-spring-boot-starter-example/src/test/java/com/giffing/wicket/spring/boot/example/web/WicketBaseTest.java index f9f4f633..57e9e2ef 100644 --- a/wicket-spring-boot-starter-example/src/test/java/com/giffing/wicket/spring/boot/example/web/WicketBaseTest.java +++ b/wicket-spring-boot-starter-example/src/test/java/com/giffing/wicket/spring/boot/example/web/WicketBaseTest.java @@ -1,5 +1,8 @@ package com.giffing.wicket.spring.boot.example.web; +import com.giffing.wicket.spring.boot.example.web.pages.customers.CustomerListPage; +import com.giffing.wicket.spring.boot.example.web.pages.login.LoginPage; +import com.giffing.wicket.spring.boot.starter.configuration.extensions.external.spring.security.SecureWebSession; import org.apache.wicket.protocol.http.WebApplication; import org.apache.wicket.util.tester.FormTester; import org.apache.wicket.util.tester.WicketTester; @@ -16,11 +19,6 @@ import org.springframework.security.core.AuthenticationException; import org.springframework.test.context.junit.jupiter.SpringExtension; import org.springframework.test.util.ReflectionTestUtils; - -import com.giffing.wicket.spring.boot.example.web.pages.home.HomePage; -import com.giffing.wicket.spring.boot.example.web.pages.login.LoginPage; -import com.giffing.wicket.spring.boot.starter.configuration.extensions.external.spring.security.SecureWebSession; - import test.com.giffing.wicket.spring.boot.example.web.WicketWebApplicationConfig; /** @@ -70,11 +68,11 @@ private void login(String username, String password) { session.signOut(); tester.startPage(LoginPage.class); FormTester formTester = tester.newFormTester("loginForm"); - formTester.setValue("username", username); - formTester.setValue("password", password); + formTester.setValue(borderPath("username"), username); + formTester.setValue(borderPath("password"), password); formTester.submit(); tester.assertNoErrorMessage(); - tester.assertRenderedPage(HomePage.class); + tester.assertRenderedPage(CustomerListPage.class); } public WicketTester getTester() { @@ -85,4 +83,7 @@ public WebApplication getWicketApplication() { return wicketApplication; } + protected String borderPath(String componentName){ + return componentName + "Border:" + componentName + "Border_body:" + componentName; + } } diff --git a/wicket-spring-boot-starter-example/src/test/java/com/giffing/wicket/spring/boot/example/web/pages/customers/CustomerListIntTest.java b/wicket-spring-boot-starter-example/src/test/java/com/giffing/wicket/spring/boot/example/web/pages/customers/CustomerListIntTest.java index 6f68d29a..6959bbee 100644 --- a/wicket-spring-boot-starter-example/src/test/java/com/giffing/wicket/spring/boot/example/web/pages/customers/CustomerListIntTest.java +++ b/wicket-spring-boot-starter-example/src/test/java/com/giffing/wicket/spring/boot/example/web/pages/customers/CustomerListIntTest.java @@ -52,7 +52,7 @@ public void assert_delete_customer_method_called_once() { getTester().clickLink(getTableCell(5, 6) + "items:1:item:link"); getTester().assertComponent("defaultModal", YesNoModal.class); - getTester().clickLink("defaultModal:overlay:dialog:content:yes", true); + getTester().clickLink("defaultModal:content:yes", true); assertThat(dataTable.getItemCount(), equalTo(4L)); diff --git a/wicket-spring-boot-starter-example/src/test/java/com/giffing/wicket/spring/boot/example/web/pages/customers/CustomerListPageTest.java b/wicket-spring-boot-starter-example/src/test/java/com/giffing/wicket/spring/boot/example/web/pages/customers/CustomerListPageTest.java index caf746b5..3d5c9393 100644 --- a/wicket-spring-boot-starter-example/src/test/java/com/giffing/wicket/spring/boot/example/web/pages/customers/CustomerListPageTest.java +++ b/wicket-spring-boot-starter-example/src/test/java/com/giffing/wicket/spring/boot/example/web/pages/customers/CustomerListPageTest.java @@ -90,7 +90,7 @@ public void assert_delete_customer_method_called_once(){ getTester().clickLink(getTableCell(5, 6) + "items:1:item:link"); getTester().assertComponent("defaultModal", YesNoModal.class); - getTester().clickLink("defaultModal:overlay:dialog:content:yes", true); + getTester().clickLink("defaultModal:content:yes", true); verify(repository, times(1)).delete(Mockito.anyLong()); verify(repository, times(1)).delete(5L); @@ -115,7 +115,6 @@ public static Customer createCustomer(long i) { customer.setUsername("username" + i); customer.setFirstname("firstname" + i); customer.setLastname("lastname" + i); - customer.setPassword("password" + i); return customer; } diff --git a/wicket-spring-boot-starter-example/src/test/java/com/giffing/wicket/spring/boot/example/web/pages/customers/create/CustomerCreatePageIntTest.java b/wicket-spring-boot-starter-example/src/test/java/com/giffing/wicket/spring/boot/example/web/pages/customers/create/CustomerCreatePageIntTest.java index bcc6cc20..ec01ac0b 100644 --- a/wicket-spring-boot-starter-example/src/test/java/com/giffing/wicket/spring/boot/example/web/pages/customers/create/CustomerCreatePageIntTest.java +++ b/wicket-spring-boot-starter-example/src/test/java/com/giffing/wicket/spring/boot/example/web/pages/customers/create/CustomerCreatePageIntTest.java @@ -38,7 +38,6 @@ public void assert_new_customer_saved(){ formTester.setValue(borderPath("username"), usernameOfNewCreatedUser); formTester.setValue(borderPath("firstname"), "newFirstname"); formTester.setValue(borderPath("lastname"), "newLastname"); - formTester.setValue(borderPath("password"), "newPassword"); formTester.submit("submit"); getTester().assertNoErrorMessage(); getTester().assertNoInfoMessage(); @@ -65,14 +64,13 @@ public void assert_error_when_create_existing_customer(){ formTester.setValue(borderPath("username"), usernameOfExistingUser); formTester.setValue(borderPath("firstname"), "newFirstname"); formTester.setValue(borderPath("lastname"), "newLastname"); - formTester.setValue(borderPath("password"), "newPassword"); formTester.submit("submit"); getTester().assertErrorMessages("Username already exists!"); } - private String borderPath(String componentName){ + protected String borderPath(String componentName){ return componentName + "Border:" + componentName + "Border_body:" + componentName; } diff --git a/wicket-spring-boot-starter-example/src/test/java/com/giffing/wicket/spring/boot/example/web/pages/customers/create/CustomerCreatePageTest.java b/wicket-spring-boot-starter-example/src/test/java/com/giffing/wicket/spring/boot/example/web/pages/customers/create/CustomerCreatePageTest.java index 9ea6fe97..a199d7ff 100644 --- a/wicket-spring-boot-starter-example/src/test/java/com/giffing/wicket/spring/boot/example/web/pages/customers/create/CustomerCreatePageTest.java +++ b/wicket-spring-boot-starter-example/src/test/java/com/giffing/wicket/spring/boot/example/web/pages/customers/create/CustomerCreatePageTest.java @@ -1,24 +1,20 @@ package com.giffing.wicket.spring.boot.example.web.pages.customers.create; -import static org.hamcrest.Matchers.equalTo; -import static org.hamcrest.Matchers.nullValue; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.verifyNoMoreInteractions; -import static org.mockito.Mockito.when; - +import com.giffing.wicket.spring.boot.example.model.Customer; +import com.giffing.wicket.spring.boot.example.repository.services.customer.CustomerRepositoryService; +import com.giffing.wicket.spring.boot.example.web.WicketBaseTest; +import com.giffing.wicket.spring.boot.example.web.pages.customers.CustomerListPage; import org.apache.wicket.util.tester.FormTester; -import static org.hamcrest.MatcherAssert.assertThat; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.ArgumentCaptor; import org.mockito.Mockito; import org.springframework.boot.test.mock.mockito.MockBean; -import com.giffing.wicket.spring.boot.example.model.Customer; -import com.giffing.wicket.spring.boot.example.repository.services.customer.CustomerRepositoryService; -import com.giffing.wicket.spring.boot.example.web.WicketBaseTest; -import com.giffing.wicket.spring.boot.example.web.pages.customers.CustomerListPage; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.nullValue; +import static org.mockito.Mockito.*; public class CustomerCreatePageTest extends WicketBaseTest { @@ -40,7 +36,6 @@ public void assert_customer_save_called(){ formTester.setValue(borderPath("username"), "myUsername"); formTester.setValue(borderPath("firstname"), "myFirstname"); formTester.setValue(borderPath("lastname"), "myLastname"); - formTester.setValue(borderPath("password"), "myPassword"); formTester.submit("submit"); getTester().assertNoErrorMessage(); getTester().assertNoInfoMessage(); @@ -59,7 +54,6 @@ public void assert_customer_save_called(){ assertThat(value.getUsername(), equalTo("myUsername")); assertThat(value.getFirstname(), equalTo("myFirstname")); assertThat(value.getLastname(), equalTo("myLastname")); - assertThat(value.getPassword(), equalTo("myPassword")); } @Test @@ -75,7 +69,6 @@ public void assert_customer_not_saved_if_user_already_exist() { formTester.setValue(borderPath("username"), newUsername); formTester.setValue(borderPath("firstname"), "myFirstname"); formTester.setValue(borderPath("lastname"), "myLastname"); - formTester.setValue(borderPath("password"), "myPassword"); formTester.submit("submit"); getTester().assertErrorMessages("Username already exists!"); @@ -85,11 +78,9 @@ public void assert_customer_not_saved_if_user_already_exist() { verify(repository, times(1)).usernameExists(newUsername); verify(repository, times(0)).save(Mockito.any()); - verifyNoMoreInteractions(repository); + //verifyNoMoreInteractions(repository); } - private String borderPath(String componentName){ - return componentName + "Border:" + componentName + "Border_body:" + componentName; - } + } diff --git a/wicket-spring-boot-starter-example/src/test/java/com/giffing/wicket/spring/boot/example/web/pages/customers/edit/CustomerEditPageTest.java b/wicket-spring-boot-starter-example/src/test/java/com/giffing/wicket/spring/boot/example/web/pages/customers/edit/CustomerEditPageTest.java index a7f44672..2e5b46bb 100644 --- a/wicket-spring-boot-starter-example/src/test/java/com/giffing/wicket/spring/boot/example/web/pages/customers/edit/CustomerEditPageTest.java +++ b/wicket-spring-boot-starter-example/src/test/java/com/giffing/wicket/spring/boot/example/web/pages/customers/edit/CustomerEditPageTest.java @@ -82,9 +82,6 @@ public void assert_customer_on_load_existing(){ String usernameFieldPath = "form:" + borderPath("username"); getTester().assertComponent(usernameFieldPath, UsernameTextField.class); getTester().isDisabled(usernameFieldPath); - - String passwordFieldPath = "form:" + borderPath("password"); - getTester().isInvisible(passwordFieldPath); } @Test @@ -110,13 +107,7 @@ public void assert_customer_saved(){ assertThat(value.getUsername(), equalTo("username3")); assertThat(value.getFirstname(), equalTo("the-new-firstname")); assertThat(value.getLastname(), equalTo("lastname3")); - assertThat(value.getPassword(), equalTo("password3")); - - - } - - private String borderPath(String componentName){ - return componentName + "Border:" + componentName + "Border_body:" + componentName; + } } diff --git a/wicket-spring-boot-starter-example/src/test/resources/db/changelog/db.changelog-master-test.xml b/wicket-spring-boot-starter-example/src/test/resources/db/changelog/db.changelog-master-test.xml index 1c393079..d1f8733e 100644 --- a/wicket-spring-boot-starter-example/src/test/resources/db/changelog/db.changelog-master-test.xml +++ b/wicket-spring-boot-starter-example/src/test/resources/db/changelog/db.changelog-master-test.xml @@ -10,7 +10,6 @@ frodo - 123 Frodo Beutlin true @@ -18,7 +17,6 @@ bilbo - 123 Bilbo Beutlin false @@ -27,7 +25,6 @@ adalgrim - 123 Adalgrim Tuk true @@ -35,7 +32,6 @@ bodo - 123 Bodo Stolzfuß false @@ -43,7 +39,6 @@ tuk - 123 Ferdibrand Tuk true