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/.travis.yml b/.travis.yml
index 5e65bfdea5..ef7326ca58 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -13,6 +13,7 @@ sudo: false
notifications:
email:
- mgrigorov@apache.org
+ - solomax@apache.org
irc:
channels:
- "chat.freenode.net##wicket"
@@ -33,7 +34,7 @@ cache:
install: true
before_script:
- - echo "MAVEN_OPTS='-Xmx2g -XX:MaxPermSize=512m'" > ~/.mavenrc
+ - echo "export MAVEN_OPTS='-Xmx2g -XX:MaxPermSize=512m ${MAVEN_OPTS}'" > ~/.mavenrc
script:
- "DEPLOY_OR_TEST=install"
diff --git a/annotation/pom.xml b/annotation/pom.xml
index 10a59bf4c7..43b99d90dd 100644
--- a/annotation/pom.xml
+++ b/annotation/pom.xml
@@ -5,7 +5,7 @@
org.wicketstuff
wicketstuff-core
- 7.4.0-SNAPSHOT
+ 7.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..e920f1c75d 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
+ 7.0-SNAPSHOT
wicketstuff-annotationeventdispatcher
diff --git a/annotationeventdispatcher-parent/pom.xml b/annotationeventdispatcher-parent/pom.xml
index 2afabfcd98..d6336b6dea 100644
--- a/annotationeventdispatcher-parent/pom.xml
+++ b/annotationeventdispatcher-parent/pom.xml
@@ -6,7 +6,7 @@
org.wicketstuff
wicketstuff-core
- 7.4.0-SNAPSHOT
+ 7.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..c6b9e22ab9 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
+ 7.0-SNAPSHOT
async-task-demo
diff --git a/async-tasks-parent/async-tasks-impl/pom.xml b/async-tasks-parent/async-tasks-impl/pom.xml
index 0a0645df32..0435db2421 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
+ 7.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 670c79df66..58093bc225 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
@@ -173,7 +173,7 @@ protected void refresh(AjaxRequestTarget target) {
private void concludeIfApplicable(AjaxRequestTarget target) {
if (!getTaskContainer().isRunning()) {
- if (target != null) {
+ if (target != null && refreshBehavior.isBinded()) {
refreshBehavior.stop(target);
}
if (getTaskContainer().isFailed()) {
@@ -199,6 +199,9 @@ public boolean isEnabled() {
}
private class RefreshBehavior extends AbstractAjaxTimerBehavior {
+
+ private boolean bound = false;
+
public RefreshBehavior(Duration updateInterval) {
super(updateInterval);
}
@@ -219,6 +222,22 @@ protected boolean shouldTrigger() {
// Again, skip the check for the component being enabled
return !isStopped() && getComponent().findParent(Page.class) != null;
}
+
+ @Override
+ protected void onBind() {
+ super.onBind();
+ bound = true;
+ }
+
+ @Override
+ protected void onUnbind() {
+ super.onUnbind();
+ bound = false;
+ }
+
+ public boolean isBinded() {
+ return bound;
+ }
}
/**
diff --git a/async-tasks-parent/pom.xml b/async-tasks-parent/pom.xml
index a66353ae8d..4d3c6773dc 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
+ 7.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..92c309cdbc 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
+ 7.0-SNAPSHOT
wicketstuff-autocomplete-tagit-examples
diff --git a/autocomplete-tagit-parent/autocomplete-tagit/pom.xml b/autocomplete-tagit-parent/autocomplete-tagit/pom.xml
index 0108a4dd6b..48ae444a1e 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
+ 7.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..6fe0cff523 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
+ 7.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..f7d49636e6 100644
--- a/closure-compiler/pom.xml
+++ b/closure-compiler/pom.xml
@@ -6,7 +6,7 @@
org.wicketstuff
wicketstuff-core
- 7.4.0-SNAPSHOT
+ 7.0-SNAPSHOT
wicketstuff-closure-compiler
@@ -24,7 +24,7 @@
org.slf4j
- slf4j-log4j12
+ slf4j-api
org.slf4j
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..78f98fa394 100644
--- a/dashboard-parent/dashboard-core/pom.xml
+++ b/dashboard-parent/dashboard-core/pom.xml
@@ -7,17 +7,13 @@
org.wicketstuff
wicketstuff-dashboard-parent
- 7.4.0-SNAPSHOT
+ 7.0-SNAPSHOT
wicketstuff-dashboard-core
jar
Wicketstuff Dashboard Core
-
- 1.4.9
-
-
@@ -31,5 +27,21 @@
xstream
${xstream.version}
+
+
+
+ junit
+ junit
+
+
+ javax.servlet
+ javax.servlet-api
+ provided
+
+
+ org.slf4j
+ slf4j-simple
+ test
+
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..e11e076673 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.
@@ -18,55 +18,56 @@
import org.apache.wicket.markup.html.panel.Panel;
/**
- * Abstract stub implementation for {@link Widget} to simplify defining of actual widgets
+ * Abstract stub implementation for {@link Widget} to simplify defining of
+ * actual widgets
+ *
* @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));
+ // getInternalSettings().put(COLLAPSED, Boolean.toString(collapsed));
}
-
+
@Override
public WidgetLocation getLocation() {
return location;
@@ -77,59 +78,59 @@ 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 int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((id == null) ? 0 : id.hashCode());
+ result = prime * result + ((title == null) ? 0 : title.hashCode());
+ return result;
+ }
+
@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 obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ AbstractWidget other = (AbstractWidget) obj;
+ if (id == null) {
+ if (other.id != null)
+ return false;
+ } else if (!id.equals(other.id))
+ return false;
+ if (title == null) {
+ if (other.title != null)
+ return false;
+ } else if (!title.equals(other.title))
+ return false;
+ return true;
+ }
}
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..de64e56576 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,18 +27,18 @@ 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
@@ -46,4 +46,7 @@ public void destroy(Application application) {
// does noting
}
+ public static DashboardContext getDashboardContext() {
+ return Application.get().getMetaData(DASHBOARD_CONTEXT_KEY);
+ }
}
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
+