diff --git a/.gitignore b/.gitignore
index 9c9d927904..1d7646181e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
+.metadata
.settings
.project
target/
diff --git a/annotation/pom.xml b/annotation/pom.xml
index 10a59bf4c7..2d67e60ad9 100644
--- a/annotation/pom.xml
+++ b/annotation/pom.xml
@@ -5,7 +5,7 @@
org.wicketstuff
wicketstuff-core
- 7.4.0-SNAPSHOT
+ 8.0.0-SNAPSHOT
wicketstuff-annotation
@@ -35,18 +35,12 @@
org.slf4j
- slf4j-log4j12
- test
+ slf4j-simple
junit
junit
-
- log4j
- log4j
- test
-
diff --git a/annotationeventdispatcher-parent/annotationeventdispatcher/pom.xml b/annotationeventdispatcher-parent/annotationeventdispatcher/pom.xml
index ed425acba1..2677b68e70 100644
--- a/annotationeventdispatcher-parent/annotationeventdispatcher/pom.xml
+++ b/annotationeventdispatcher-parent/annotationeventdispatcher/pom.xml
@@ -4,7 +4,7 @@
org.wicketstuff
wicketstuff-annotationeventdispatcher-parent
- 7.4.0-SNAPSHOT
+ 8.0.0-SNAPSHOT
wicketstuff-annotationeventdispatcher
diff --git a/annotationeventdispatcher-parent/annotationeventdispatcher/src/main/java/org/wicketstuff/event/annotation/AnnotationEventSink.java b/annotationeventdispatcher-parent/annotationeventdispatcher/src/main/java/org/wicketstuff/event/annotation/AnnotationEventSink.java
index 90d4b14c46..799a098e97 100644
--- a/annotationeventdispatcher-parent/annotationeventdispatcher/src/main/java/org/wicketstuff/event/annotation/AnnotationEventSink.java
+++ b/annotationeventdispatcher-parent/annotationeventdispatcher/src/main/java/org/wicketstuff/event/annotation/AnnotationEventSink.java
@@ -29,7 +29,7 @@
import org.apache.wicket.Application;
import org.apache.wicket.Component;
import org.apache.wicket.event.IEvent;
-import org.apache.wicket.request.RequestHandlerStack.ReplaceHandlerException;
+import org.apache.wicket.request.RequestHandlerExecutor;
import org.apache.wicket.util.collections.ClassMetaCache;
import org.apache.wicket.util.visit.Visit;
@@ -135,7 +135,7 @@ private void onEvent(final Set onEventMethods, final Object sink, final
{
for (Method method : onEventMethods)
{
- if (canCallListenerInterface(sink, method))
+ if (canCallListenerInterface(sink))
{
OnEvent onEvent = method.getAnnotation(OnEvent.class);
if (isPayloadApplicableToHandler(onEvent, payload))
@@ -164,9 +164,9 @@ else if (onEvent.stop())
}
} catch (InvocationTargetException e)
{
- if (e.getCause() instanceof ReplaceHandlerException)
+ if (e.getCause() instanceof RequestHandlerExecutor.ReplaceHandlerException)
{
- throw ((ReplaceHandlerException)e.getCause());
+ throw ((RequestHandlerExecutor.ReplaceHandlerException)e.getCause());
}
else
{
@@ -178,13 +178,13 @@ else if (onEvent.stop())
}
}
- private boolean canCallListenerInterface(final Object obj, final Method method)
+ private boolean canCallListenerInterface(final Object obj)
{
boolean canCall = true;
if (obj instanceof Component)
{
Component c = (Component) obj;
- canCall = c.canCallListenerInterface(method);
+ canCall = c.canCallListener();
}
return canCall;
}
diff --git a/annotationeventdispatcher-parent/pom.xml b/annotationeventdispatcher-parent/pom.xml
index 2afabfcd98..c67fa20fcd 100644
--- a/annotationeventdispatcher-parent/pom.xml
+++ b/annotationeventdispatcher-parent/pom.xml
@@ -6,7 +6,7 @@
org.wicketstuff
wicketstuff-core
- 7.4.0-SNAPSHOT
+ 8.0.0-SNAPSHOT
wicketstuff-annotationeventdispatcher-parent
Annotation Event Dispatcher - Parent
diff --git a/async-tasks-parent/async-tasks-demo/pom.xml b/async-tasks-parent/async-tasks-demo/pom.xml
index 210d7222ac..6f7e2c1902 100644
--- a/async-tasks-parent/async-tasks-demo/pom.xml
+++ b/async-tasks-parent/async-tasks-demo/pom.xml
@@ -4,7 +4,7 @@
org.wicketstuff
async-tasks-parent
- 7.4.0-SNAPSHOT
+ 8.0.0-SNAPSHOT
async-task-demo
@@ -48,7 +48,7 @@
- org.mortbay.jetty
+ org.eclipse.jetty
jetty-maven-plugin
diff --git a/async-tasks-parent/async-tasks-impl/pom.xml b/async-tasks-parent/async-tasks-impl/pom.xml
index 0a0645df32..5aa0ceb6eb 100644
--- a/async-tasks-parent/async-tasks-impl/pom.xml
+++ b/async-tasks-parent/async-tasks-impl/pom.xml
@@ -5,7 +5,7 @@
org.wicketstuff
async-tasks-parent
- 7.4.0-SNAPSHOT
+ 8.0.0-SNAPSHOT
async-task-impl
diff --git a/async-tasks-parent/async-tasks-impl/src/main/java/org/wicketstuff/async/components/ProgressButton.java b/async-tasks-parent/async-tasks-impl/src/main/java/org/wicketstuff/async/components/ProgressButton.java
index fa05e69e2d..db762d25b1 100644
--- a/async-tasks-parent/async-tasks-impl/src/main/java/org/wicketstuff/async/components/ProgressButton.java
+++ b/async-tasks-parent/async-tasks-impl/src/main/java/org/wicketstuff/async/components/ProgressButton.java
@@ -13,11 +13,11 @@
import org.apache.wicket.util.time.Duration;
import org.wicketstuff.async.task.AbstractTaskContainer;
-import java.lang.reflect.Method;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
+import java.util.Optional;
/**
* A progress button which allows to control a {@link Runnable}. Each such button will refresh itself as given by
@@ -34,7 +34,7 @@ public class ProgressButton extends AjaxFallbackButton {
private final IRunnableFactory runnableFactory;
private final RefreshBehavior refreshBehavior;
- private IModel extends AbstractTaskContainer> taskContainerModel;
+ private volatile IModel extends AbstractTaskContainer> taskContainerModel;
public ProgressButton(String id, Form> form, IModel extends AbstractTaskContainer> taskContainerModel, Duration duration) {
this(id, null, form, taskContainerModel, null, duration);
@@ -129,32 +129,28 @@ boolean canInterrupt() {
}
@Override
- protected void onSubmit(AjaxRequestTarget target, Form> form) {
- super.onSubmit(target, form);
+ protected void onSubmit(Optional targetOptional) {
+ super.onSubmit(targetOptional);
if (canStart() || canRestart()) {
getTaskContainer().submit(runnableFactory.getRunnable());
- onTaskStart(target);
+ onTaskStart(targetOptional);
} else if (canInterrupt()) {
getTaskContainer().cancel();
} else {
return;
}
- if (target != null) {
+ targetOptional.ifPresent(target -> {
activateRefresh(target);
renderAll(target);
- }
+ });
- concludeIfApplicable(target);
+ concludeIfApplicable(targetOptional);
}
private void activateRefresh(AjaxRequestTarget target) {
- if (!getTaskContainer().isRunning()) {
- if (getBehaviors(RefreshBehavior.class).size() > 0) {
- refreshBehavior.stop(target);
- }
- } else if (getBehaviors(RefreshBehavior.class).size() == 0) {
+ if (getBehaviors(RefreshBehavior.class).size() == 0) {
add(refreshBehavior);
} else {
refreshBehavior.restart(target);
@@ -167,21 +163,21 @@ private void activateRefresh(AjaxRequestTarget target) {
* @param target The Ajax request target.
*/
protected void refresh(AjaxRequestTarget target) {
- concludeIfApplicable(target);
+ concludeIfApplicable(Optional.of(target));
renderAll(target);
}
- private void concludeIfApplicable(AjaxRequestTarget target) {
+ private void concludeIfApplicable(Optional targetOptional) {
if (!getTaskContainer().isRunning()) {
- if (target != null) {
+ targetOptional.ifPresent(target -> {
refreshBehavior.stop(target);
- }
+ });
if (getTaskContainer().isFailed()) {
- onTaskError(target);
+ onTaskError(targetOptional);
} else if (!getTaskContainer().isCancelled()) {
- onTaskSuccess(target);
+ onTaskSuccess(targetOptional);
} else {
- onTaskCancel(target);
+ onTaskCancel(targetOptional);
}
}
}
@@ -209,7 +205,7 @@ protected void onTimer(AjaxRequestTarget target) {
}
@Override
- public boolean canCallListenerInterface(Component component, Method method) {
+ public boolean canCallListener(Component component) {
// Skip check for the component being enabled
return component.isVisibleInHierarchy();
}
@@ -357,7 +353,7 @@ public void removeRefreshDependant(Component refreshDependant) {
*
* @param ajaxRequestTarget The Ajax request target. Might be {@code null}.
*/
- protected void onTaskStart(AjaxRequestTarget ajaxRequestTarget) {
+ protected void onTaskStart(Optional ajaxRequestTarget) {
}
/**
@@ -367,7 +363,7 @@ protected void onTaskStart(AjaxRequestTarget ajaxRequestTarget) {
*
* @param ajaxRequestTarget The Ajax request target.
*/
- protected void onTaskSuccess(AjaxRequestTarget ajaxRequestTarget) {
+ protected void onTaskSuccess(Optional ajaxRequestTarget) {
}
/**
@@ -377,7 +373,7 @@ protected void onTaskSuccess(AjaxRequestTarget ajaxRequestTarget) {
*
* @param ajaxRequestTarget The Ajax request target. Might be {@code null}.
*/
- protected void onTaskCancel(AjaxRequestTarget ajaxRequestTarget) {
+ protected void onTaskCancel(Optional ajaxRequestTarget) {
}
/**
@@ -387,6 +383,6 @@ protected void onTaskCancel(AjaxRequestTarget ajaxRequestTarget) {
*
* @param ajaxRequestTarget The Ajax request target.
*/
- protected void onTaskError(AjaxRequestTarget ajaxRequestTarget) {
+ protected void onTaskError(Optional ajaxRequestTarget) {
}
}
diff --git a/async-tasks-parent/async-tasks-impl/src/test/java/org/wicketstuff/async/components/ProgressButtonTest.java b/async-tasks-parent/async-tasks-impl/src/test/java/org/wicketstuff/async/components/ProgressButtonTest.java
index c008438221..7cb7babcec 100644
--- a/async-tasks-parent/async-tasks-impl/src/test/java/org/wicketstuff/async/components/ProgressButtonTest.java
+++ b/async-tasks-parent/async-tasks-impl/src/test/java/org/wicketstuff/async/components/ProgressButtonTest.java
@@ -92,9 +92,7 @@ public void testException() throws Exception {
formTester.submit("button");
assertTrue(page.isTaskStart());
-// assertFalse(page.isTaskSuccess());
assertFalse(page.isTaskCancel());
-// assertTrue(page.isTaskError());
}
@Test
diff --git a/async-tasks-parent/async-tasks-impl/src/test/java/org/wicketstuff/async/components/TestPage.java b/async-tasks-parent/async-tasks-impl/src/test/java/org/wicketstuff/async/components/TestPage.java
index dc7157fd93..33040708f9 100644
--- a/async-tasks-parent/async-tasks-impl/src/test/java/org/wicketstuff/async/components/TestPage.java
+++ b/async-tasks-parent/async-tasks-impl/src/test/java/org/wicketstuff/async/components/TestPage.java
@@ -1,5 +1,6 @@
package org.wicketstuff.async.components;
+import java.util.Optional;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
@@ -18,7 +19,7 @@ public class TestPage extends WebPage implements IRunnableFactory {
private final ProgressButton button;
private final ProgressBar bar;
private final CountDownLatch latch = new CountDownLatch(1);
- private Runnable runnable;
+ private volatile Runnable runnable;
private boolean taskStart, taskSuccess, taskCancel, taskError;
@@ -29,22 +30,22 @@ public TestPage() {
form = new Form("form");
button = new ProgressButton("button", form, Model.of(taskContainer), this, Duration.milliseconds(300L)) {
@Override
- protected void onTaskStart(AjaxRequestTarget ajaxRequestTarget) {
+ protected void onTaskStart(Optional ajaxRequestTarget) {
taskStart = true;
}
@Override
- protected void onTaskSuccess(AjaxRequestTarget ajaxRequestTarget) {
+ protected void onTaskSuccess(Optional ajaxRequestTarget) {
taskSuccess = true;
}
@Override
- protected void onTaskCancel(AjaxRequestTarget ajaxRequestTarget) {
+ protected void onTaskCancel(Optional ajaxRequestTarget) {
taskCancel = true;
}
@Override
- protected void onTaskError(AjaxRequestTarget ajaxRequestTarget) {
+ protected void onTaskError(Optional ajaxRequestTarget) {
taskError = true;
}
};
diff --git a/async-tasks-parent/pom.xml b/async-tasks-parent/pom.xml
index a66353ae8d..c7880c5f96 100644
--- a/async-tasks-parent/pom.xml
+++ b/async-tasks-parent/pom.xml
@@ -5,7 +5,7 @@
org.wicketstuff
wicketstuff-core
- 7.4.0-SNAPSHOT
+ 8.0.0-SNAPSHOT
async-tasks-parent
diff --git a/autocomplete-tagit-parent/autocomplete-tagit-examples/pom.xml b/autocomplete-tagit-parent/autocomplete-tagit-examples/pom.xml
index 063e3641d6..5d263a46a8 100644
--- a/autocomplete-tagit-parent/autocomplete-tagit-examples/pom.xml
+++ b/autocomplete-tagit-parent/autocomplete-tagit-examples/pom.xml
@@ -3,7 +3,7 @@
org.wicketstuff
wicketstuff-autocomplete-tagit-parent
- 7.4.0-SNAPSHOT
+ 8.0.0-SNAPSHOT
wicketstuff-autocomplete-tagit-examples
@@ -43,13 +43,14 @@
org.eclipse.jetty.aggregate
- jetty-all-server
+ jetty-all
+ uber
- org.mortbay.jetty
+ org.eclipse.jetty
jetty-maven-plugin
diff --git a/autocomplete-tagit-parent/autocomplete-tagit-examples/src/test/java/org/wicketstuff/tagit/example/Start.java b/autocomplete-tagit-parent/autocomplete-tagit-examples/src/test/java/org/wicketstuff/tagit/example/Start.java
index 4daf81cb3b..07fbdd013b 100644
--- a/autocomplete-tagit-parent/autocomplete-tagit-examples/src/test/java/org/wicketstuff/tagit/example/Start.java
+++ b/autocomplete-tagit-parent/autocomplete-tagit-examples/src/test/java/org/wicketstuff/tagit/example/Start.java
@@ -17,8 +17,14 @@
package org.wicketstuff.tagit.example;
import org.eclipse.jetty.server.Connector;
+import org.eclipse.jetty.server.HttpConfiguration;
+import org.eclipse.jetty.server.HttpConnectionFactory;
+import org.eclipse.jetty.server.SecureRequestCustomizer;
import org.eclipse.jetty.server.Server;
-import org.eclipse.jetty.server.bio.SocketConnector;
+import org.eclipse.jetty.server.ServerConnector;
+import org.eclipse.jetty.server.SslConnectionFactory;
+import org.eclipse.jetty.util.resource.Resource;
+import org.eclipse.jetty.util.ssl.SslContextFactory;
import org.eclipse.jetty.webapp.WebAppContext;
public class Start
@@ -26,20 +32,55 @@ public class Start
public static void main(final String[] args) throws Exception
{
- final Server server = new Server();
- final SocketConnector connector = new SocketConnector();
+ Server server = new Server();
- // Set some timeout options to make debugging easier.
- connector.setMaxIdleTime(1000 * 60 * 60);
- connector.setSoLingerTime(-1);
- connector.setPort(8080);
- server.setConnectors(new Connector[] { connector });
+ HttpConfiguration http_config = new HttpConfiguration();
+ http_config.setSecureScheme("https");
+ http_config.setSecurePort(8443);
+ http_config.setOutputBufferSize(32768);
- final WebAppContext bb = new WebAppContext();
+ ServerConnector http = new ServerConnector(server, new HttpConnectionFactory(http_config));
+ http.setPort(8080);
+ http.setIdleTimeout(1000 * 60 * 60);
+
+ server.addConnector(http);
+
+ Resource keystore = Resource.newClassPathResource("/keystore");
+ if (keystore != null && keystore.exists())
+ {
+ // if a keystore for a SSL certificate is available, start a SSL
+ // connector on port 8443.
+ // By default, the quickstart comes with a Apache Wicket Quickstart
+ // Certificate that expires about half way september 2021. Do not
+ // use this certificate anywhere important as the passwords are
+ // available in the source.
+
+ SslContextFactory sslContextFactory = new SslContextFactory();
+ sslContextFactory.setKeyStoreResource(keystore);
+ sslContextFactory.setKeyStorePassword("wicket");
+ sslContextFactory.setKeyManagerPassword("wicket");
+
+ HttpConfiguration https_config = new HttpConfiguration(http_config);
+ https_config.addCustomizer(new SecureRequestCustomizer());
+
+ ServerConnector https = new ServerConnector(server, new SslConnectionFactory(
+ sslContextFactory, "http/1.1"), new HttpConnectionFactory(https_config));
+ https.setPort(8443);
+ https.setIdleTimeout(500000);
+
+ server.addConnector(https);
+ System.out.println("SSL access to the examples has been enabled on port 8443");
+ System.out
+ .println("You can access the application using SSL on https://localhost:8443");
+ System.out.println();
+ }
+
+ WebAppContext bb = new WebAppContext();
bb.setServer(server);
bb.setContextPath("/");
bb.setWar("src/main/webapp");
+
// START JMX SERVER
// MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer();
// MBeanContainer mBeanContainer = new MBeanContainer(mBeanServer);
diff --git a/autocomplete-tagit-parent/autocomplete-tagit/pom.xml b/autocomplete-tagit-parent/autocomplete-tagit/pom.xml
index 0108a4dd6b..795315c658 100644
--- a/autocomplete-tagit-parent/autocomplete-tagit/pom.xml
+++ b/autocomplete-tagit-parent/autocomplete-tagit/pom.xml
@@ -4,7 +4,7 @@
org.wicketstuff
wicketstuff-autocomplete-tagit-parent
- 7.4.0-SNAPSHOT
+ 8.0.0-SNAPSHOT
wicketstuff-autocomplete-tagit
@@ -14,11 +14,7 @@
org.slf4j
- slf4j-log4j12
-
-
- log4j
- log4j
+ slf4j-api
diff --git a/autocomplete-tagit-parent/pom.xml b/autocomplete-tagit-parent/pom.xml
index 4d19af8759..7cfe3d84e3 100644
--- a/autocomplete-tagit-parent/pom.xml
+++ b/autocomplete-tagit-parent/pom.xml
@@ -6,7 +6,7 @@
org.wicketstuff
wicketstuff-core
- 7.4.0-SNAPSHOT
+ 8.0.0-SNAPSHOT
wicketstuff-autocomplete-tagit-parent
Autocomplete Tag It Parent
diff --git a/browserid-parent/README.md b/browserid-parent/README.md
deleted file mode 100644
index a6be2e0ffd..0000000000
--- a/browserid-parent/README.md
+++ /dev/null
@@ -1,3 +0,0 @@
-An integration between Apache Wicket and Mozilla BrowserId authentication technology.
-
-For more information see https://github.com/wicketstuff/core/wiki/BrowserId
diff --git a/browserid-parent/browserid-examples/src/main/java/org/wicketstuff/browserid/example/BrowserIdPage.html b/browserid-parent/browserid-examples/src/main/java/org/wicketstuff/browserid/example/BrowserIdPage.html
deleted file mode 100644
index 7a7fed4f15..0000000000
--- a/browserid-parent/browserid-examples/src/main/java/org/wicketstuff/browserid/example/BrowserIdPage.html
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
- BrowserId demo page
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/browserid-parent/browserid-examples/src/main/java/org/wicketstuff/browserid/example/BrowserIdPage.java b/browserid-parent/browserid-examples/src/main/java/org/wicketstuff/browserid/example/BrowserIdPage.java
deleted file mode 100644
index 426059a858..0000000000
--- a/browserid-parent/browserid-examples/src/main/java/org/wicketstuff/browserid/example/BrowserIdPage.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package org.wicketstuff.browserid.example;
-
-import org.apache.wicket.markup.html.WebPage;
-import org.apache.wicket.markup.html.panel.FeedbackPanel;
-import org.apache.wicket.request.mapper.parameter.PageParameters;
-import org.wicketstuff.browserid.BrowserIdPanel;
-import org.wicketstuff.browserid.GuestPanel.Style;
-
-/**
- * Demo page that just adds the default BrowserIdPanel and a feedback panel to show any errors
- */
-public class BrowserIdPage extends WebPage
-{
-
- private static final long serialVersionUID = 1L;
-
- public BrowserIdPage(final PageParameters parameters)
- {
- super(parameters);
-
- add(new BrowserIdPanel("browserId", Style.GREEN));
-
- add(new FeedbackPanel("feedback").setOutputMarkupId(true));
- }
-}
\ No newline at end of file
diff --git a/browserid-parent/browserid/src/main/java/org/wicketstuff/browserid/BrowserId.java b/browserid-parent/browserid/src/main/java/org/wicketstuff/browserid/BrowserId.java
deleted file mode 100644
index 143c45f6d5..0000000000
--- a/browserid-parent/browserid/src/main/java/org/wicketstuff/browserid/BrowserId.java
+++ /dev/null
@@ -1,172 +0,0 @@
-package org.wicketstuff.browserid;
-
-import java.io.Serializable;
-import java.util.Date;
-
-import org.apache.wicket.util.string.Strings;
-
-/**
- * An object representing the response from https://browserid.org
- */
-public class BrowserId implements Serializable
-{
-
- private static final long serialVersionUID = 1L;
-
- public enum Status
- {
- OK, FAIL;
-
- public static Status parse(final String t)
- {
- if ("okay".equals(t))
- {
- return OK;
- }
- else if ("failure".equals(t))
- {
- return FAIL;
- }
- else
- {
- throw new IllegalArgumentException("Unrecognized status: " + t);
- }
- }
- };
-
- private Status status;
-
- private String email;
-
- private String audience;
-
- private Date validUntil;
-
- private String issuer;
-
- private String reason;
-
- public String getReason()
- {
- return reason;
- }
-
- public void setReason(String reason)
- {
- this.reason = reason;
- }
-
- public Status getStatus()
- {
- return status;
- }
-
- public void setStatus(Status status)
- {
- this.status = status;
- }
-
- public String getEmail()
- {
- return email;
- }
-
- public void setEmail(String email)
- {
- this.email = email;
- }
-
- public String getAudience()
- {
- return audience;
- }
-
- public void setAudience(String audience)
- {
- this.audience = audience;
- }
-
- public Date getValidUntil()
- {
- return validUntil;
- }
-
- public void setValidUntil(Date validUntil)
- {
- this.validUntil = validUntil;
- }
-
- public String getIssuer()
- {
- return issuer;
- }
-
- public void setIssuer(String issuer)
- {
- this.issuer = issuer;
- }
-
- /**
- * Create {@link BrowserId} object from success or failure JSON response
- *
- * @param json
- * the response returned by https://browserid.org
- * @return a {@link BrowserId} instance with status OK if the authentication passed, or with
- * status FAIL if the authentication failed, or {@code null} if the passed JSON response
- * is invalid
- */
- public static BrowserId of(String json)
- {
- BrowserId browserId = null;
-
- if (json != null && json.startsWith("{") && json.endsWith("}"))
- {
- json = json.substring(1);
- json = json.substring(0, json.length() - 1);
-
- String[] settings = Strings.split(json, ',');
- if (settings.length > 0)
- {
- browserId = new BrowserId();
- for (String setting : settings)
- {
- String[] pair = Strings.split(setting, ':');
- pair[0] = Strings.replaceAll(pair[0], "\"", "").toString();
- pair[1] = Strings.replaceAll(pair[1], "\"", "").toString();
-
- if ("status".equals(pair[0]))
- {
- browserId.status = Status.parse(pair[1]);
- }
- else if ("email".equals(pair[0]))
- {
- browserId.email = pair[1];
- }
- else if ("audience".equals(pair[0]))
- {
- browserId.audience = pair[1];
- }
- else if ("issuer".equals(pair[0]))
- {
- browserId.issuer = pair[1];
- }
- else if ("valid-until".equals(pair[0]))
- {
- Long millis = Long.valueOf(pair[1]);
- browserId.validUntil = new Date(millis);
- }
- else if ("reason".equals(pair[0]))
- {
- browserId.reason = pair[1];
- }
- else
- {
- throw new IllegalArgumentException("Unknown setting: " + pair[0]);
- }
- }
- }
- }
-
- return browserId;
- }
-}
diff --git a/browserid-parent/browserid/src/main/java/org/wicketstuff/browserid/BrowserIdPanel.html b/browserid-parent/browserid/src/main/java/org/wicketstuff/browserid/BrowserIdPanel.html
deleted file mode 100644
index a982bd65cc..0000000000
--- a/browserid-parent/browserid/src/main/java/org/wicketstuff/browserid/BrowserIdPanel.html
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/browserid-parent/browserid/src/main/java/org/wicketstuff/browserid/BrowserIdPanel.java b/browserid-parent/browserid/src/main/java/org/wicketstuff/browserid/BrowserIdPanel.java
deleted file mode 100644
index be9005da94..0000000000
--- a/browserid-parent/browserid/src/main/java/org/wicketstuff/browserid/BrowserIdPanel.java
+++ /dev/null
@@ -1,95 +0,0 @@
-package org.wicketstuff.browserid;
-
-import org.apache.wicket.Component;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.feedback.IFeedback;
-import org.apache.wicket.markup.html.panel.Panel;
-import org.wicketstuff.browserid.GuestPanel.Style;
-
-/**
- * This is the main panel which loads specific panels depending on whether there is a logged in user
- * or not.
- */
-public class BrowserIdPanel extends Panel
-{
-
- private static final long serialVersionUID = 1L;
-
- private static final String CONTENT_ID = "content";
-
- /**
- * The style of the default "Sign In" image button provided by https://browserid.org
- */
- private final Style style;
-
- public BrowserIdPanel(String id)
- {
- this(id, Style.BLUE);
- }
-
- public BrowserIdPanel(String id, Style style)
- {
- super(id);
-
- this.style = style;
-
- setOutputMarkupId(true);
- }
-
- @Override
- protected void onConfigure()
- {
- super.onConfigure();
-
- if (SessionHelper.isLoggedIn(getSession()))
- {
- addOrReplace(getLoggedInPanel(CONTENT_ID));
- }
- else
- {
- addOrReplace(getGuestPanel(CONTENT_ID));
- }
- }
-
- protected Component getGuestPanel(String componentId)
- {
- return new GuestPanel(componentId, style)
- {
-
- private static final long serialVersionUID = 1L;
-
- @Override
- protected void onSuccess(AjaxRequestTarget target)
- {
- super.onSuccess(target);
-
- target.add(BrowserIdPanel.this);
- }
-
- @Override
- protected void onFailure(AjaxRequestTarget target, final String failureReason)
- {
- super.onFailure(target, failureReason);
-
- error("The authentication failed: " + failureReason);
- target.addChildren(getPage(), IFeedback.class);
- }
- };
- }
-
- protected Component getLoggedInPanel(String componentId)
- {
- return new LoggedInPanel(componentId)
- {
-
- private static final long serialVersionUID = 1L;
-
- @Override
- protected void onLoggedOut(AjaxRequestTarget target)
- {
- super.onLoggedOut(target);
- target.add(BrowserIdPanel.this);
- }
- };
- }
-}
diff --git a/browserid-parent/browserid/src/main/java/org/wicketstuff/browserid/GuestPanel.html b/browserid-parent/browserid/src/main/java/org/wicketstuff/browserid/GuestPanel.html
deleted file mode 100644
index 5e49ba6207..0000000000
--- a/browserid-parent/browserid/src/main/java/org/wicketstuff/browserid/GuestPanel.html
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/browserid-parent/browserid/src/main/java/org/wicketstuff/browserid/GuestPanel.java b/browserid-parent/browserid/src/main/java/org/wicketstuff/browserid/GuestPanel.java
deleted file mode 100644
index 01db725957..0000000000
--- a/browserid-parent/browserid/src/main/java/org/wicketstuff/browserid/GuestPanel.java
+++ /dev/null
@@ -1,148 +0,0 @@
-package org.wicketstuff.browserid;
-
-import org.apache.wicket.AttributeModifier;
-import org.apache.wicket.Component;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.markup.head.IHeaderResponse;
-import org.apache.wicket.markup.head.JavaScriptHeaderItem;
-import org.apache.wicket.markup.html.image.Image;
-import org.apache.wicket.markup.html.panel.Panel;
-import org.apache.wicket.request.resource.PackageResourceReference;
-import org.apache.wicket.request.resource.ResourceReference;
-
-/**
- * A panel that is used for non-authenticated users
- */
-public class GuestPanel extends Panel
-{
-
- private static final long serialVersionUID = 1L;
-
- private static final String BROWSER_ID_JS = "https://browserid.org/include.js";
-
- private static final ResourceReference RED_ICON = new PackageResourceReference(
- GuestPanel.class, "sign_in_red.png");
- private static final ResourceReference BLUE_ICON = new PackageResourceReference(
- GuestPanel.class, "sign_in_blue.png");
- private static final ResourceReference GREEN_ICON = new PackageResourceReference(
- GuestPanel.class, "sign_in_green.png");
- private static final ResourceReference ORANGE_ICON = new PackageResourceReference(
- GuestPanel.class, "sign_in_orange.png");
- private static final ResourceReference GREY_ICON = new PackageResourceReference(
- GuestPanel.class, "sign_in_grey.png");
-
- /**
- * The possible styles of the default "Sign In" image button provided by https://browserid.org
- */
- public enum Style
- {
- RED, BLUE, GREEN, ORANGE, GREY
- }
-
- private final Style style;
-
- public GuestPanel(String id, Style style)
- {
- super(id);
-
- this.style = style;
-
- Component signInImage = createSignInButton("signInImage");
- signInImage.add(new VerifyBehavior()
- {
-
- private static final long serialVersionUID = 1L;
-
- @Override
- protected void onSuccess(AjaxRequestTarget target)
- {
- GuestPanel.this.onSuccess(target);
- }
-
- @Override
- protected void onFailure(AjaxRequestTarget target, String failureReason)
- {
- GuestPanel.this.onFailure(target, failureReason);
- }
-
- });
- add(signInImage);
- }
-
- protected Component createSignInButton(String componentId)
- {
- Image image = new Image(componentId, getImage(style));
- image.add(AttributeModifier.replace("alt", "Sign In"));
- return image;
- }
-
- protected ResourceReference getImage(final Style style)
- {
- final ResourceReference imageIcon;
- switch (style)
- {
- case RED :
- imageIcon = RED_ICON;
- break;
- case GREEN :
- imageIcon = GREEN_ICON;
- break;
- case ORANGE :
- imageIcon = ORANGE_ICON;
- break;
- case GREY :
- imageIcon = GREY_ICON;
- break;
- case BLUE :
- default :
- imageIcon = BLUE_ICON;
- break;
- }
-
- return imageIcon;
- }
-
- @Override
- public void renderHead(IHeaderResponse response)
- {
- super.renderHead(response);
-
- renderBrowserIdJavaScript(response);
- }
-
- /**
- * Renders a reference for external browserid.js (loaded from browserid.org).
- * Can be overridden with local reference to browserid.js if needed.
- *
- * @param response
- * the current header response
- */
- protected void renderBrowserIdJavaScript(final IHeaderResponse response)
- {
- response.render(JavaScriptHeaderItem.forUrl(BROWSER_ID_JS));
- }
-
- /**
- * A callback called when the authentication is successful
- *
- * @param target
- * the current request target
- */
- protected void onSuccess(final AjaxRequestTarget target)
- {
-
- }
-
- /**
- * A callback called when the authentication has failed
- *
- * @param target
- * the current request target
- * @param target
- * @param failureReason
- */
- protected void onFailure(final AjaxRequestTarget target, final String failureReason)
- {
-
- }
-}
diff --git a/browserid-parent/browserid/src/main/java/org/wicketstuff/browserid/LoggedInPanel.html b/browserid-parent/browserid/src/main/java/org/wicketstuff/browserid/LoggedInPanel.html
deleted file mode 100644
index 9e246fbb05..0000000000
--- a/browserid-parent/browserid/src/main/java/org/wicketstuff/browserid/LoggedInPanel.html
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
- Hi, ! Logout.
-
-
\ No newline at end of file
diff --git a/browserid-parent/browserid/src/main/java/org/wicketstuff/browserid/LoggedInPanel.java b/browserid-parent/browserid/src/main/java/org/wicketstuff/browserid/LoggedInPanel.java
deleted file mode 100644
index 4a91ba628e..0000000000
--- a/browserid-parent/browserid/src/main/java/org/wicketstuff/browserid/LoggedInPanel.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package org.wicketstuff.browserid;
-
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.ajax.markup.html.AjaxLink;
-import org.apache.wicket.markup.html.basic.Label;
-import org.apache.wicket.markup.html.panel.Panel;
-import org.apache.wicket.model.PropertyModel;
-
-public class LoggedInPanel extends Panel
-{
-
- private static final long serialVersionUID = 1L;
-
- public LoggedInPanel(String id)
- {
- super(id);
-
- BrowserId browserId = SessionHelper.getBrowserId(getSession());
- if (browserId == null)
- {
- throw new IllegalStateException("The user must be authenticated!");
- }
-
- add(new Label("emailLabel", new PropertyModel(browserId, "email")));
- add(new AjaxLink("logoutLink")
- {
-
- private static final long serialVersionUID = 1L;
-
- @Override
- public void onClick(AjaxRequestTarget target)
- {
- SessionHelper.logOut(getSession());
- onLoggedOut(target);
- }
- });
- }
-
- protected void onLoggedOut(AjaxRequestTarget target)
- {
-
- }
-
-}
diff --git a/browserid-parent/browserid/src/main/java/org/wicketstuff/browserid/SessionHelper.java b/browserid-parent/browserid/src/main/java/org/wicketstuff/browserid/SessionHelper.java
deleted file mode 100644
index c8952da66e..0000000000
--- a/browserid-parent/browserid/src/main/java/org/wicketstuff/browserid/SessionHelper.java
+++ /dev/null
@@ -1,75 +0,0 @@
-package org.wicketstuff.browserid;
-
-import org.apache.wicket.MetaDataKey;
-import org.apache.wicket.Session;
-import org.apache.wicket.util.lang.Args;
-
-/**
- * Utility class that stores the {@link BrowserId} (authentication data) in the current web session.
- */
-public class SessionHelper
-{
-
- private static final MetaDataKey KEY = new MetaDataKey()
- {
-
- private static final long serialVersionUID = 1L;
- };
-
- /**
- * @param session
- * the current web session
- * @return the authentication data. May be {@code null}.
- */
- public static BrowserId getBrowserId(final Session session)
- {
-
- Args.notNull(session, "session");
-
- BrowserId browserId = session.getMetaData(KEY);
-
- return browserId;
- }
-
- /**
- *
- * @param session
- * the current web session
- * @return {@code true} if there is authentication data. {@code false} - otherwise.
- */
- public static boolean isLoggedIn(final Session session)
- {
- return getBrowserId(session) != null;
- }
-
- /**
- * Stores the authentication data in the current web session
- *
- * @param session
- * the current web session
- * @param browserId
- * the authentication data
- */
- public static void logIn(final Session session, final BrowserId browserId)
- {
- Args.notNull(session, "session");
- Args.notNull(browserId, "browserId");
-
- session.setMetaData(KEY, browserId);
- ;
- }
-
- /**
- * Removes the authentication data from the current web session
- *
- * @param session
- * the current web session
- */
- public static void logOut(final Session session)
- {
- Args.notNull(session, "session");
-
- session.setMetaData(KEY, null);
- ;
- }
-}
diff --git a/browserid-parent/browserid/src/main/java/org/wicketstuff/browserid/VerifyBehavior.java b/browserid-parent/browserid/src/main/java/org/wicketstuff/browserid/VerifyBehavior.java
deleted file mode 100644
index 59de48bcfa..0000000000
--- a/browserid-parent/browserid/src/main/java/org/wicketstuff/browserid/VerifyBehavior.java
+++ /dev/null
@@ -1,112 +0,0 @@
-package org.wicketstuff.browserid;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.net.URL;
-import java.net.URLConnection;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.wicket.Component;
-import org.apache.wicket.Session;
-import org.apache.wicket.ajax.AbstractDefaultAjaxBehavior;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.markup.head.IHeaderResponse;
-import org.apache.wicket.markup.head.OnDomReadyHeaderItem;
-import org.apache.wicket.request.Request;
-import org.apache.wicket.request.cycle.RequestCycle;
-import org.apache.wicket.util.io.IOUtils;
-import org.apache.wicket.util.string.StringValue;
-import org.apache.wicket.util.template.PackageTextTemplate;
-import org.apache.wicket.util.template.TextTemplate;
-import org.wicketstuff.browserid.BrowserId.Status;
-
-/**
- * The behavior that should be attached to the "Sign In" button. It cares about loading the
- * authentication window and notifying the caller via {@link #onSuccess(AjaxRequestTarget)} or
- * {@link #onFailure(AjaxRequestTarget, String)}
- */
-public abstract class VerifyBehavior extends AbstractDefaultAjaxBehavior
-{
-
- private static final long serialVersionUID = 1L;
-
- @Override
- public void renderHead(final Component component, final IHeaderResponse response)
- {
- component.setOutputMarkupId(true);
- super.renderHead(component, response);
-
- final Map variables = new HashMap();
- variables.put("componentId", component.getMarkupId());
- variables.put("callbackUrl", getCallbackUrl());
-
- final TextTemplate verifyTemplate = new PackageTextTemplate(VerifyBehavior.class,
- "verify.js.tmpl");
- String asString = verifyTemplate.asString(variables);
- response.render(OnDomReadyHeaderItem.forScript(asString));
- }
-
- @Override
- protected void respond(AjaxRequestTarget target)
- {
- RequestCycle cycle = RequestCycle.get();
- Request request = cycle.getRequest();
- StringValue assertionParam = request.getQueryParameters().getParameterValue("assertion");
- StringValue audienceParam = request.getQueryParameters().getParameterValue("audience");
-
- if (assertionParam.isEmpty() == false && audienceParam.isEmpty() == false)
- {
- String failureReason = verify(assertionParam.toString(), audienceParam.toString());
- if (failureReason == null)
- {
- onSuccess(target);
- }
- else
- {
- onFailure(target, failureReason);
- }
- }
- }
-
- private String verify(final String assertion, final String audience)
- {
- String failureReason = null;
- try
- {
- URL verifyUrl = new URL("https://browserid.org/verify");
- URLConnection urlConnection = verifyUrl.openConnection();
- urlConnection.setDoOutput(true);
- OutputStream outputStream = urlConnection.getOutputStream();
- String postParams = "assertion=" + assertion + "&audience=" + audience;
- outputStream.write(postParams.getBytes());
- outputStream.close();
-
- String response = IOUtils.toString(urlConnection.getInputStream(), "UTF-8");
-
- BrowserId browserId = BrowserId.of(response);
- if (browserId != null)
- {
- if (Status.OK.equals(browserId.getStatus()))
- {
- SessionHelper.logIn(Session.get(), browserId);
- }
- else
- {
- failureReason = browserId.getReason();
- }
- }
- }
- catch (IOException e)
- {
- failureReason = e.getMessage();
- }
-
- return failureReason;
- }
-
- protected abstract void onSuccess(AjaxRequestTarget target);
-
- protected abstract void onFailure(AjaxRequestTarget target, String failureReason);
-
-}
diff --git a/browserid-parent/browserid/src/main/java/org/wicketstuff/browserid/verify.js.tmpl b/browserid-parent/browserid/src/main/java/org/wicketstuff/browserid/verify.js.tmpl
deleted file mode 100644
index baff7519b9..0000000000
--- a/browserid-parent/browserid/src/main/java/org/wicketstuff/browserid/verify.js.tmpl
+++ /dev/null
@@ -1,31 +0,0 @@
-(function(w) {
-
- w.Event.add(window, "domready", function(event) {
-
- var gotVerifiedEmail
- , signInButton
- , callbackUrl = "${callbackUrl}";
-
- gotVerifiedEmail = function (assertion) {
-
- if (assertion) {
- if (callbackUrl.indexOf('?') > -1) {
- callbackUrl += '&';
- } else {
- callbackUrl += '?';
- }
- callbackUrl += "assertion="+assertion;
- callbackUrl += "&audience="+window.location.host;
- wicketAjaxGet(callbackUrl, null, null, function() {return true});
- }
- };
-
- signInButton = w.$("${componentId}");
- signInButton.style.cursor = "pointer";
-
- w.Event.add(signInButton, "click", function(event) {
- navigator.id.getVerifiedEmail(gotVerifiedEmail);
- });
- });
-
-})(Wicket);
\ No newline at end of file
diff --git a/browserid-parent/browserid/src/main/resources/org/wicketstuff/browserid/sign_in_blue.png b/browserid-parent/browserid/src/main/resources/org/wicketstuff/browserid/sign_in_blue.png
deleted file mode 100644
index 919a5c7a35..0000000000
Binary files a/browserid-parent/browserid/src/main/resources/org/wicketstuff/browserid/sign_in_blue.png and /dev/null differ
diff --git a/browserid-parent/browserid/src/main/resources/org/wicketstuff/browserid/sign_in_green.png b/browserid-parent/browserid/src/main/resources/org/wicketstuff/browserid/sign_in_green.png
deleted file mode 100644
index 7e84129b4a..0000000000
Binary files a/browserid-parent/browserid/src/main/resources/org/wicketstuff/browserid/sign_in_green.png and /dev/null differ
diff --git a/browserid-parent/browserid/src/main/resources/org/wicketstuff/browserid/sign_in_grey.png b/browserid-parent/browserid/src/main/resources/org/wicketstuff/browserid/sign_in_grey.png
deleted file mode 100644
index 467bde42b6..0000000000
Binary files a/browserid-parent/browserid/src/main/resources/org/wicketstuff/browserid/sign_in_grey.png and /dev/null differ
diff --git a/browserid-parent/browserid/src/main/resources/org/wicketstuff/browserid/sign_in_orange.png b/browserid-parent/browserid/src/main/resources/org/wicketstuff/browserid/sign_in_orange.png
deleted file mode 100644
index 1c7c7925d1..0000000000
Binary files a/browserid-parent/browserid/src/main/resources/org/wicketstuff/browserid/sign_in_orange.png and /dev/null differ
diff --git a/browserid-parent/browserid/src/main/resources/org/wicketstuff/browserid/sign_in_red.png b/browserid-parent/browserid/src/main/resources/org/wicketstuff/browserid/sign_in_red.png
deleted file mode 100644
index 96d1f98fde..0000000000
Binary files a/browserid-parent/browserid/src/main/resources/org/wicketstuff/browserid/sign_in_red.png and /dev/null differ
diff --git a/closure-compiler/pom.xml b/closure-compiler/pom.xml
index b535d4f449..b277e59a88 100644
--- a/closure-compiler/pom.xml
+++ b/closure-compiler/pom.xml
@@ -6,7 +6,7 @@
org.wicketstuff
wicketstuff-core
- 7.4.0-SNAPSHOT
+ 8.0.0-SNAPSHOT
wicketstuff-closure-compiler
@@ -24,7 +24,7 @@
org.slf4j
- slf4j-log4j12
+ slf4j-api
org.slf4j
@@ -32,7 +32,8 @@
org.eclipse.jetty.aggregate
- jetty-all-server
+ jetty-all
+ uber
diff --git a/closure-compiler/src/test/java/org/wicketstuff/closurecompiler/testapp/Start.java b/closure-compiler/src/test/java/org/wicketstuff/closurecompiler/testapp/Start.java
index 8bd684c19c..8cf3d442cb 100644
--- a/closure-compiler/src/test/java/org/wicketstuff/closurecompiler/testapp/Start.java
+++ b/closure-compiler/src/test/java/org/wicketstuff/closurecompiler/testapp/Start.java
@@ -1,83 +1,58 @@
package org.wicketstuff.closurecompiler.testapp;
-import java.util.EnumSet;
-import java.util.logging.Handler;
-import java.util.logging.LogManager;
-
-import org.apache.wicket.Application;
-import org.apache.wicket.RuntimeConfigurationType;
-import org.apache.wicket.protocol.http.ContextParamWebApplicationFactory;
-import org.apache.wicket.protocol.http.WicketFilter;
-import org.apache.wicket.util.lang.Bytes;
-import org.eclipse.jetty.server.Connector;
+import org.eclipse.jetty.server.HttpConfiguration;
+import org.eclipse.jetty.server.HttpConnectionFactory;
import org.eclipse.jetty.server.Server;
-import org.eclipse.jetty.server.bio.SocketConnector;
-import org.eclipse.jetty.server.session.SessionHandler;
-import org.eclipse.jetty.servlet.DefaultServlet;
-import org.eclipse.jetty.servlet.FilterHolder;
-import org.eclipse.jetty.servlet.ServletContextHandler;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.slf4j.bridge.SLF4JBridgeHandler;
-
-import javax.servlet.DispatcherType;
+import org.eclipse.jetty.server.ServerConnector;
+import org.eclipse.jetty.webapp.WebAppContext;
public class Start
{
- private static final Logger log = LoggerFactory.getLogger(Start.class);
- // private static final RuntimeConfigurationType CONFIG = RuntimeConfigurationType.DEPLOYMENT;
- private static final RuntimeConfigurationType CONFIG = RuntimeConfigurationType.DEVELOPMENT;
-
- static
- {
- // redirect jcl to slf4j
- final java.util.logging.Logger rootLogger = LogManager.getLogManager().getLogger("");
- final Handler[] handlers = rootLogger.getHandlers();
-
- for (Handler hander : handlers)
- {
- rootLogger.removeHandler(hander);
- }
-
- SLF4JBridgeHandler.install();
- }
public static void main(String[] args) throws Exception
{
+ Server server = new Server();
- final Server server = new Server();
- final SocketConnector connector = new SocketConnector();
-
- connector.setMaxIdleTime(1000 * 60 * 60);
- connector.setSoLingerTime(-1);
- connector.setPort(8080);
- server.setConnectors(new Connector[] { connector });
+ HttpConfiguration http_config = new HttpConfiguration();
+ http_config.setSecureScheme("https");
+ http_config.setSecurePort(8443);
+ http_config.setOutputBufferSize(32768);
- server.setHandler(createApp());
+ ServerConnector http = new ServerConnector(server, new HttpConnectionFactory(http_config));
+ http.setPort(8080);
+ http.setIdleTimeout(1000 * 60 * 60);
- server.start();
- log.info("server started");
- }
+ server.addConnector(http);
- private static ServletContextHandler createApp()
- {
- // servlet handler
- final ServletContextHandler root = new ServletContextHandler();
- root.setContextPath("/");
- root.setSessionHandler(new SessionHandler());
- root.setMaxFormContentSize((int)Bytes.megabytes(20).bytes());
+ WebAppContext bb = new WebAppContext();
+ bb.setServer(server);
+ bb.setContextPath("/");
+ bb.setWar("src/main/webapp");
- // servlet support
- root.addServlet(DefaultServlet.class, "/*");
+ // START JMX SERVER
+ // MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer();
+ // MBeanContainer mBeanContainer = new MBeanContainer(mBeanServer);
+ // server.getContainer().addEventListener(mBeanContainer);
+ // mBeanContainer.start();
- // wicket application
- final FilterHolder wicket = new FilterHolder(WicketFilter.class);
- wicket.setInitParameter(Application.CONFIGURATION, CONFIG.name());
- wicket.setInitParameter(ContextParamWebApplicationFactory.APP_CLASS_PARAM,
- ClosureCompilerApp.class.getName());
- wicket.setInitParameter(WicketFilter.FILTER_MAPPING_PARAM, "/*");
- root.addFilter(wicket, "/*", EnumSet.allOf(DispatcherType.class));
+ server.setHandler(bb);
- return root;
+ try
+ {
+ System.out.println(">>> STARTING EMBEDDED JETTY SERVER, PRESS ANY KEY TO STOP");
+ server.start();
+ System.in.read();
+ System.out.println(">>> STOPPING EMBEDDED JETTY SERVER");
+ // while (System.in.available() == 0) {
+ // Thread.sleep(5000);
+ // }
+ server.stop();
+ server.join();
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ System.exit(100);
+ }
}
}
diff --git a/console-parent/console-examples/pom.xml b/console-parent/console-examples/pom.xml
index 5726ce44c9..fabf3a6963 100644
--- a/console-parent/console-examples/pom.xml
+++ b/console-parent/console-examples/pom.xml
@@ -25,7 +25,7 @@
- org.mortbay.jetty
+ org.eclipse.jetty
jetty-maven-plugin
@@ -82,8 +82,8 @@
org.eclipse.jetty.aggregate
- jetty-all-server
- test
+ jetty-all
+ uber
junit
diff --git a/console-parent/console/pom.xml b/console-parent/console/pom.xml
index bed5f7d439..0a68d39ab1 100644
--- a/console-parent/console/pom.xml
+++ b/console-parent/console/pom.xml
@@ -37,7 +37,7 @@
org.slf4j
- slf4j-log4j12
+ slf4j-api
javax.servlet
diff --git a/dashboard-parent/dashboard-core/pom.xml b/dashboard-parent/dashboard-core/pom.xml
index 4a23688874..63e14c81cd 100644
--- a/dashboard-parent/dashboard-core/pom.xml
+++ b/dashboard-parent/dashboard-core/pom.xml
@@ -7,7 +7,7 @@
org.wicketstuff
wicketstuff-dashboard-parent
- 7.4.0-SNAPSHOT
+ 8.0.0-SNAPSHOT
wicketstuff-dashboard-core
diff --git a/dashboard-parent/dashboard-core/src/main/java/org/wicketstuff/dashboard/AbstractWidget.java b/dashboard-parent/dashboard-core/src/main/java/org/wicketstuff/dashboard/AbstractWidget.java
index 039e6e0e14..6f111c6a73 100644
--- a/dashboard-parent/dashboard-core/src/main/java/org/wicketstuff/dashboard/AbstractWidget.java
+++ b/dashboard-parent/dashboard-core/src/main/java/org/wicketstuff/dashboard/AbstractWidget.java
@@ -1,11 +1,11 @@
/*
* Copyright 2012 Decebal Suiu
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with
* the License. You may obtain a copy of the License in the LICENSE file, or at:
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
@@ -22,51 +22,50 @@
* @author Decebal Suiu
*/
public abstract class AbstractWidget implements Widget {
-
private static final long serialVersionUID = 1L;
-
+
protected String id;
protected String title;
protected boolean collapsed;
- protected Map settings;
- protected WidgetLocation location;
+ protected Map settings;
+ protected WidgetLocation location;
- public AbstractWidget() {
+ public AbstractWidget() {
settings = new HashMap();
location = new WidgetLocation();
}
-
- @Override
- public String getId() {
+
+ @Override
+ public String getId() {
return id;
}
- @Override
+ @Override
public void setId(String id) {
this.id = id;
}
- @Override
+ @Override
public String getTitle() {
return title;
}
- @Override
+ @Override
public void setTitle(String title) {
this.title = title;
}
- @Override
+ @Override
public boolean isCollapsed() {
return collapsed;
}
- @Override
+ @Override
public void setCollapsed(boolean collapsed) {
this.collapsed = collapsed;
// getInternalSettings().put(COLLAPSED, Boolean.toString(collapsed));
}
-
+
@Override
public WidgetLocation getLocation() {
return location;
@@ -77,59 +76,60 @@ public void setLocation(WidgetLocation location) {
this.location = location;
}
+ @Override
public void init() {
// do nothing
}
-
- @Override
+
+ @Override
public boolean hasSettings() {
return false;
}
- @Override
+ @Override
public Map getSettings() {
return settings;
}
- @Override
+ @Override
public void setSettings(Map settings) {
this.settings = settings;
}
- @Override
+ @Override
public Panel createSettingsPanel(String settingsPanelId) {
return null;
}
-
+
@Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
-
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
-
- AbstractWidget widget = (AbstractWidget) o;
-
- if (!title.equals(widget.title)) {
- return false;
- }
-
- if (!id.equals(widget.id)) {
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- int result;
- result = id.hashCode();
- result = 31 * result + title.hashCode();
- return result;
- }
-
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+
+ AbstractWidget widget = (AbstractWidget) o;
+
+ if (!title.equals(widget.title)) {
+ return false;
+ }
+
+ if (!id.equals(widget.id)) {
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int result;
+ result = id.hashCode();
+ result = 31 * result + title.hashCode();
+ return result;
+ }
+
}
diff --git a/dashboard-parent/dashboard-core/src/main/java/org/wicketstuff/dashboard/DashboardContextInitializer.java b/dashboard-parent/dashboard-core/src/main/java/org/wicketstuff/dashboard/DashboardContextInitializer.java
index f02d36b47a..c07c97f102 100644
--- a/dashboard-parent/dashboard-core/src/main/java/org/wicketstuff/dashboard/DashboardContextInitializer.java
+++ b/dashboard-parent/dashboard-core/src/main/java/org/wicketstuff/dashboard/DashboardContextInitializer.java
@@ -1,11 +1,11 @@
/*
* Copyright 2013 Decebal Suiu
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with
* the License. You may obtain a copy of the License in the LICENSE file, or at:
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
@@ -27,23 +27,22 @@ public class DashboardContextInitializer implements IInitializer {
@SuppressWarnings("serial")
public static MetaDataKey DASHBOARD_CONTEXT_KEY = new MetaDataKey() {};
-
+
@Override
public void init(Application application) {
// create dashboard context
DashboardContext dashboardContext = new DashboardContext();
-
+
// store dashboard context in application
- application.setMetaData(DASHBOARD_CONTEXT_KEY, dashboardContext);
-
- // add dashboard context injector
- DashboardContextInjector dashboardContextInjector = new DashboardContextInjector(dashboardContext);
- application.getComponentInstantiationListeners().add(dashboardContextInjector);
+ application.setMetaData(DASHBOARD_CONTEXT_KEY, dashboardContext);
+
+ // add dashboard context injector
+ DashboardContextInjector dashboardContextInjector = new DashboardContextInjector(dashboardContext);
+ application.getComponentInstantiationListeners().add(dashboardContextInjector);
}
@Override
public void destroy(Application application) {
// does noting
}
-
}
diff --git a/dashboard-parent/dashboard-core/src/main/java/org/wicketstuff/dashboard/DashboardUtils.java b/dashboard-parent/dashboard-core/src/main/java/org/wicketstuff/dashboard/DashboardUtils.java
index 6fa1628def..264e1170af 100644
--- a/dashboard-parent/dashboard-core/src/main/java/org/wicketstuff/dashboard/DashboardUtils.java
+++ b/dashboard-parent/dashboard-core/src/main/java/org/wicketstuff/dashboard/DashboardUtils.java
@@ -1,11 +1,11 @@
/*
* Copyright 2012 Decebal Suiu
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with
* the License. You may obtain a copy of the License in the LICENSE file, or at:
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
@@ -21,35 +21,35 @@
* @author Decebal Suiu
*/
public class DashboardUtils {
-
+
@SuppressWarnings("unchecked")
public static void updateWidgetLocations(Dashboard dashboard, DashboardEvent dashboardEvent) {
DashboardEvent.EventType eventType = dashboardEvent.getType();
if (DashboardEvent.EventType.WIDGET_ADDED == eventType) {
List widgets = dashboard.getWidgets(0);
- for (Widget widget : widgets) {
- widget.getLocation().incrementRow();
- }
+ for (Widget widget : widgets) {
+ widget.getLocation().incrementRow();
+ }
} else if (DashboardEvent.EventType.WIDGET_REMOVED == eventType) {
Widget widgetRemoved = (Widget) dashboardEvent.getDetail();
WidgetLocation widgetRemovedLocation = widgetRemoved.getLocation();
List widgets = dashboard.getWidgets(widgetRemovedLocation.getColumn());
- for (Widget widget : widgets) {
- WidgetLocation widgetLocation = widget.getLocation();
- if (widgetLocation.getRow() > widgetRemovedLocation.getRow()) {
- widget.getLocation().decrementRow();
- }
- }
+ for (Widget widget : widgets) {
+ WidgetLocation widgetLocation = widget.getLocation();
+ if (widgetLocation.getRow() > widgetRemovedLocation.getRow()) {
+ widget.getLocation().decrementRow();
+ }
+ }
} else if (DashboardEvent.EventType.WIDGETS_SORTED == eventType) {
Map widgetLocations = (Map) dashboardEvent.getDetail();
List widgets = dashboard.getWidgets();
- for (Widget widget : widgets) {
- String id = widget.getId();
- WidgetLocation location = widgetLocations.get(id);
- if (!location.equals(widget.getLocation())) {
- widget.setLocation(location);
- }
- }
+ for (Widget widget : widgets) {
+ String id = widget.getId();
+ WidgetLocation location = widgetLocations.get(id);
+ if (!location.equals(widget.getLocation())) {
+ widget.setLocation(location);
+ }
+ }
}
}
diff --git a/dashboard-parent/dashboard-core/src/main/java/org/wicketstuff/dashboard/DefaultDashboard.java b/dashboard-parent/dashboard-core/src/main/java/org/wicketstuff/dashboard/DefaultDashboard.java
index dd39ef66be..9c83ceeddc 100644
--- a/dashboard-parent/dashboard-core/src/main/java/org/wicketstuff/dashboard/DefaultDashboard.java
+++ b/dashboard-parent/dashboard-core/src/main/java/org/wicketstuff/dashboard/DefaultDashboard.java
@@ -1,11 +1,11 @@
/*
* Copyright 2012 Decebal Suiu
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with
* the License. You may obtain a copy of the License in the LICENSE file, or at:
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
@@ -24,12 +24,12 @@
public class DefaultDashboard implements Dashboard {
private static final long serialVersionUID = 1L;
-
+
private String id;
private String title;
private int columnCount;
private List widgets;
-
+
public DefaultDashboard(String id, String title) {
this.id = id;
this.title = title;
@@ -55,18 +55,18 @@ public void setTitle(String title) {
@Override
public int getColumnCount() {
return columnCount;
- }
+ }
@Override
public void setColumnCount(int columnCount) {
this.columnCount = columnCount;
}
-
+
@Override
public List getWidgets() {
return widgets;
}
-
+
@Override
public List getWidgets(int column) {
List columnWidgets = new ArrayList();
@@ -75,13 +75,13 @@ public List getWidgets(int column) {
columnWidgets.add(widget);
}
}
-
+
// sort widgets by row
Collections.sort(columnWidgets, new WidgetComparator());
-
+
return columnWidgets;
}
-
+
@Override
public Widget getWidget(String widgetId) {
for (Widget widget : widgets) {
@@ -89,7 +89,7 @@ public Widget getWidget(String widgetId) {
return widget;
}
}
-
+
return null;
}
@@ -101,15 +101,15 @@ public void setWidgets(List widgets) {
public void addWidget(Widget widget) {
widgets.add(widget);
}
-
+
@Override
public void deleteWidget(String widgetId) {
Widget widget = getWidget(widgetId);
if (widget != null) {
widgets.remove(widget);
}
- }
-
+ }
+
@Override
public String toString() {
StringBuffer buffer = new StringBuffer();
@@ -121,5 +121,5 @@ public String toString() {
return buffer.toString();
}
-
+
}
diff --git a/dashboard-parent/dashboard-core/src/main/java/org/wicketstuff/dashboard/WidgetAction.java b/dashboard-parent/dashboard-core/src/main/java/org/wicketstuff/dashboard/WidgetAction.java
index 8bed282959..043cbaf131 100644
--- a/dashboard-parent/dashboard-core/src/main/java/org/wicketstuff/dashboard/WidgetAction.java
+++ b/dashboard-parent/dashboard-core/src/main/java/org/wicketstuff/dashboard/WidgetAction.java
@@ -12,12 +12,11 @@
*/
package org.wicketstuff.dashboard;
-import org.apache.wicket.markup.html.image.Image;
+import java.io.Serializable;
+
import org.apache.wicket.markup.html.link.AbstractLink;
import org.apache.wicket.model.IModel;
-import java.io.Serializable;
-
/**
* Interface for actions that can be performed over a widget
* @author Decebal Suiu
@@ -26,8 +25,7 @@ public interface WidgetAction extends Serializable {
public AbstractLink getLink(String id);
- public Image getImage(String id);
+ public String getCssClass();
public IModel getTooltip();
-
}
diff --git a/dashboard-parent/dashboard-core/src/main/java/org/wicketstuff/dashboard/XStreamDashboardPersister.java b/dashboard-parent/dashboard-core/src/main/java/org/wicketstuff/dashboard/XStreamDashboardPersister.java
index 1d75fce99c..917b8b90c2 100644
--- a/dashboard-parent/dashboard-core/src/main/java/org/wicketstuff/dashboard/XStreamDashboardPersister.java
+++ b/dashboard-parent/dashboard-core/src/main/java/org/wicketstuff/dashboard/XStreamDashboardPersister.java
@@ -1,11 +1,11 @@
/*
* Copyright 2012 Decebal Suiu
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with
* the License. You may obtain a copy of the License in the LICENSE file, or at:
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
@@ -28,26 +28,26 @@
* @author Decebal Suiu
*/
public class XStreamDashboardPersister implements DashboardPersister {
-
+
private File file;
private XStream xstream;
-
+
public XStreamDashboardPersister(File file) {
this.file = file;
-
- xstream = new XStream(new DomDriver("UTF-8"));
- xstream.setMode(XStream.NO_REFERENCES);
- xstream.alias("dashboard", DefaultDashboard.class);
-// xstream.alias("textWidget", TextWidget.class);
-// xstream.alias("chartWidget", ChartWidget.class);
+
+ xstream = new XStream(new DomDriver("UTF-8"));
+ xstream.setMode(XStream.NO_REFERENCES);
+ xstream.alias("dashboard", DefaultDashboard.class);
+// xstream.alias("textWidget", TextWidget.class);
+// xstream.alias("chartWidget", ChartWidget.class);
}
-
+
@Override
public Dashboard load() {
if (!file.exists() || !file.isFile()) {
return null;
}
-
+
try {
return (Dashboard) xstream.fromXML(new FileInputStream(file));
} catch (FileNotFoundException e) {
@@ -60,7 +60,7 @@ public Dashboard load() {
public void save(Dashboard dashboard) {
// sort widgets
Collections.sort(dashboard.getWidgets(), new WidgetComparator());
-
+
try {
xstream.toXML(dashboard, new FileOutputStream(file));
} catch (FileNotFoundException e) {
diff --git a/dashboard-parent/dashboard-core/src/main/java/org/wicketstuff/dashboard/web/AbstractWidgetAction.java b/dashboard-parent/dashboard-core/src/main/java/org/wicketstuff/dashboard/web/AbstractWidgetAction.java
index df17aa677e..997cb2981f 100644
--- a/dashboard-parent/dashboard-core/src/main/java/org/wicketstuff/dashboard/web/AbstractWidgetAction.java
+++ b/dashboard-parent/dashboard-core/src/main/java/org/wicketstuff/dashboard/web/AbstractWidgetAction.java
@@ -12,11 +12,7 @@
*/
package org.wicketstuff.dashboard.web;
-import org.apache.wicket.markup.html.image.Image;
import org.apache.wicket.model.IModel;
-import org.apache.wicket.request.resource.ContextRelativeResource;
-import org.apache.wicket.request.resource.PackageResourceReference;
-import org.apache.wicket.util.lang.Args;
import org.wicketstuff.dashboard.Widget;
import org.wicketstuff.dashboard.WidgetAction;
@@ -24,58 +20,34 @@
* @author Decebal Suiu
*/
public abstract class AbstractWidgetAction implements WidgetAction {
-
- protected Widget widget;
- protected IModel tooltip;
- private Class imageScope;
- private String imageName;
-
- public AbstractWidgetAction(Widget widget) {
- this.widget = widget;
- }
-
- public Widget getWidget() {
- return widget;
- }
-
- @Override
- public IModel getTooltip() {
- return tooltip;
- }
-
- public void setTooltip(IModel tooltip) {
- this.tooltip = tooltip;
- }
-
- /**
- * If you use this method than the image name is relative to scope.
- *
- * @param scope
- * @param name
- */
- public void setImage(Class scope, String name) {
- imageScope = scope;
- imageName = name;
- }
-
- /**
- * If you use this method than the image name is relative to context.
- *
- * @param name
- */
- public void setImage(String name) {
- setImage(null, name);
- }
-
- @Override
- public Image getImage(String id) {
- Args.notNull(imageName, "imageName");
-
- if (imageScope != null) {
- return new Image(id, new PackageResourceReference(imageScope, imageName));
- }
-
- return new Image(id, new ContextRelativeResource(imageName));
- }
-
+ private static final long serialVersionUID = 1L;
+ protected Widget widget;
+ protected IModel tooltip;
+ private String cssClass;
+
+ public AbstractWidgetAction(Widget widget) {
+ this.widget = widget;
+ }
+
+ public Widget getWidget() {
+ return widget;
+ }
+
+ @Override
+ public IModel getTooltip() {
+ return tooltip;
+ }
+
+ public void setTooltip(IModel tooltip) {
+ this.tooltip = tooltip;
+ }
+
+ public void setCssClass(String cssClass) {
+ this.cssClass = cssClass;
+ }
+
+ @Override
+ public String getCssClass() {
+ return cssClass;
+ }
}
diff --git a/dashboard-parent/dashboard-core/src/main/java/org/wicketstuff/dashboard/web/DashboardColumnPanel.html b/dashboard-parent/dashboard-core/src/main/java/org/wicketstuff/dashboard/web/DashboardColumnPanel.html
index b6bad61754..9540db4713 100644
--- a/dashboard-parent/dashboard-core/src/main/java/org/wicketstuff/dashboard/web/DashboardColumnPanel.html
+++ b/dashboard-parent/dashboard-core/src/main/java/org/wicketstuff/dashboard/web/DashboardColumnPanel.html
@@ -1,10 +1,10 @@
-
+
-
\ No newline at end of file
+