Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Wicket 6.1.1 and wiQuery 6.0.0 #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<wicket.version>1.5-SNAPSHOT</wicket.version>
<wiquery.version>1.5-SNAPSHOT</wiquery.version>
<wicket.version>6.1.1</wicket.version>
<wiquery.version>6.0.0</wiquery.version>
<slf4j.version>[1.6,1.6.10]</slf4j.version>
<junit.version>4.10</junit.version>
<jetty.version>6.1.26</jetty.version>
Expand Down
34 changes: 20 additions & 14 deletions src/main/java/nl/topicus/wqplot/components/JQPlot.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,23 @@
import nl.topicus.wqplot.options.PlotOptions;
import nl.topicus.wqplot.options.PluginReferenceSerializer;

import org.apache.wicket.markup.html.IHeaderResponse;
import org.apache.wicket.core.request.ClientInfo;
import org.apache.wicket.markup.head.CssHeaderItem;
import org.apache.wicket.markup.head.IHeaderResponse;
import org.apache.wicket.markup.head.JavaScriptHeaderItem;
import org.apache.wicket.markup.head.OnDomReadyHeaderItem;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.model.IModel;
import org.apache.wicket.protocol.http.WebSession;
import org.apache.wicket.protocol.http.request.WebClientInfo;
import org.apache.wicket.request.ClientInfo;
import org.codehaus.jackson.JsonGenerationException;
import org.codehaus.jackson.map.JsonMappingException;
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.map.annotate.JsonSerialize;
import org.codehaus.jackson.map.annotate.JsonSerialize.Inclusion;
import org.odlabs.wiquery.core.IWiQueryPlugin;
import org.odlabs.wiquery.core.javascript.JsStatement;

public class JQPlot extends WebMarkupContainer implements IWiQueryPlugin, IPluginResolver
public class JQPlot extends WebMarkupContainer implements IPluginResolver
{
private static final long serialVersionUID = 1L;

Expand Down Expand Up @@ -89,16 +91,20 @@ public void renderHead(IHeaderResponse headerResponse)
if (webinfo.getProperties().isBrowserInternetExplorer()
&& webinfo.getProperties().getBrowserVersionMajor() < 9)
// wiQueryResourceManager.addJavaScriptResource(JQPlotExcanvasJavaScriptResourceReference.get());
headerResponse.renderJavaScriptReference(JQPlotExcanvasJavaScriptResourceReference
.get());
headerResponse.render(JavaScriptHeaderItem
.forReference(JQPlotExcanvasJavaScriptResourceReference.get()));
}

// wiQueryResourceManager.addJavaScriptResource(JQPlotJavaScriptResourceReference.get());
// wiQueryResourceManager.addCssResource(JQPlotStyleSheetResourceReference.get());
// wiQueryResourceManager.addJavaScriptResource(JQPlotCanvasTextRendererResourceReference.get());
headerResponse.renderJavaScriptReference(JQPlotJavaScriptResourceReference.get());
headerResponse.renderCSSReference(JQPlotStyleSheetResourceReference.get());
headerResponse.renderJavaScriptReference(JQPlotCanvasTextRendererResourceReference.get());
headerResponse.render(JavaScriptHeaderItem.forReference(JQPlotJavaScriptResourceReference
.get()));
headerResponse.render(CssHeaderItem.forReference(JQPlotStyleSheetResourceReference.get()));
headerResponse.render(JavaScriptHeaderItem
.forReference(JQPlotCanvasTextRendererResourceReference.get()));

headerResponse.render(OnDomReadyHeaderItem.forScript(statement().render()));

try
{
Expand Down Expand Up @@ -154,8 +160,8 @@ private void addPlugin(IHeaderResponse headerResponse, String plugin)
if (plugins.containsKey(plugin))
{
// wiQueryResourceManager.addJavaScriptResource(getPlugin(plugin).getJavaScriptResourceReference());
headerResponse.renderJavaScriptReference(getPlugin(plugin)
.getJavaScriptResourceReference());
headerResponse.render(JavaScriptHeaderItem.forReference(getPlugin(plugin)
.getJavaScriptResourceReference()));
return;
}

Expand All @@ -165,7 +171,8 @@ private void addPlugin(IHeaderResponse headerResponse, String plugin)
if (iPlugin != null)
{
// wiQueryResourceManager.addJavaScriptResource(iPlugin.getJavaScriptResourceReference());
headerResponse.renderJavaScriptReference(iPlugin.getJavaScriptResourceReference());
headerResponse.render(JavaScriptHeaderItem.forReference(iPlugin
.getJavaScriptResourceReference()));
return;
}
}
Expand Down Expand Up @@ -207,11 +214,10 @@ public IPlugin getPlugin(String name)
return plugins.get(name);
}

@Override
public JsStatement statement()
{
ObjectMapper mapper = new ObjectMapper();
mapper.getSerializationConfig().setSerializationInclusion(Inclusion.NON_NULL);
mapper.setSerializationInclusion(Inclusion.NON_NULL);
String optionsStr = "{}";
String plotDataStr = "[]";
try
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package nl.topicus.wqplot.components;

import org.odlabs.wiquery.core.resources.WiQueryJavaScriptResourceReference;
import org.apache.wicket.request.resource.JavaScriptResourceReference;

/**
* Special javascript for when the User Agent is Internet Explorer.
*
* @author hielkehoeve
*/
public class JQPlotExcanvasJavaScriptResourceReference extends WiQueryJavaScriptResourceReference
public class JQPlotExcanvasJavaScriptResourceReference extends JavaScriptResourceReference
{
private static final long serialVersionUID = -4771815414204892357L;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package nl.topicus.wqplot.components;

import org.odlabs.wiquery.core.resources.WiQueryJavaScriptResourceReference;
import org.apache.wicket.request.resource.JavaScriptResourceReference;

public class JQPlotJavaScriptResourceReference extends WiQueryJavaScriptResourceReference
public class JQPlotJavaScriptResourceReference extends JavaScriptResourceReference
{
private static final long serialVersionUID = -4771815414204892357L;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package nl.topicus.wqplot.components;

import org.odlabs.wiquery.core.resources.WiQueryStyleSheetResourceReference;
import org.apache.wicket.request.resource.CssResourceReference;

public class JQPlotStyleSheetResourceReference extends WiQueryStyleSheetResourceReference
public class JQPlotStyleSheetResourceReference extends CssResourceReference
{
private static final long serialVersionUID = -4771815414204892357L;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import java.io.Serializable;

import org.odlabs.wiquery.core.resources.WiQueryJavaScriptResourceReference;
import org.apache.wicket.request.resource.JavaScriptResourceReference;

/**
* @author Ernesto Reinaldo Barreiro
Expand All @@ -18,6 +18,6 @@ public interface IPlugin extends Serializable
/**
* The resource reference for the JavaScript file implementing the plugin.
*/
WiQueryJavaScriptResourceReference getJavaScriptResourceReference();
JavaScriptResourceReference getJavaScriptResourceReference();

}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package nl.topicus.wqplot.components.plugins;

import org.odlabs.wiquery.core.resources.WiQueryJavaScriptResourceReference;
import org.apache.wicket.request.resource.JavaScriptResourceReference;

public class JQPlotBarRendererResourceReference extends WiQueryJavaScriptResourceReference
public class JQPlotBarRendererResourceReference extends JavaScriptResourceReference
{
private static final long serialVersionUID = -4771815414204892357L;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package nl.topicus.wqplot.components.plugins;

import org.odlabs.wiquery.core.resources.WiQueryJavaScriptResourceReference;
import org.apache.wicket.request.resource.JavaScriptResourceReference;

public class JQPlotBezierCurveRendererResourceReference extends WiQueryJavaScriptResourceReference
public class JQPlotBezierCurveRendererResourceReference extends JavaScriptResourceReference
{
private static final long serialVersionUID = -4771815414204892357L;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package nl.topicus.wqplot.components.plugins;

import org.odlabs.wiquery.core.resources.WiQueryJavaScriptResourceReference;
import org.apache.wicket.request.resource.JavaScriptResourceReference;

public class JQPlotBlockRendererResourceReference extends WiQueryJavaScriptResourceReference
public class JQPlotBlockRendererResourceReference extends JavaScriptResourceReference
{
private static final long serialVersionUID = -4771815414204892357L;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package nl.topicus.wqplot.components.plugins;

import org.odlabs.wiquery.core.resources.WiQueryJavaScriptResourceReference;
import org.apache.wicket.request.resource.JavaScriptResourceReference;

public class JQPlotBubbleRendererResourceReference extends WiQueryJavaScriptResourceReference
public class JQPlotBubbleRendererResourceReference extends JavaScriptResourceReference
{
private static final long serialVersionUID = -4771815414204892357L;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package nl.topicus.wqplot.components.plugins;

import org.odlabs.wiquery.core.resources.WiQueryJavaScriptResourceReference;
import org.apache.wicket.request.resource.JavaScriptResourceReference;

public class JQPlotCanvasAxisLabelRendererResourceReference extends
WiQueryJavaScriptResourceReference
public class JQPlotCanvasAxisLabelRendererResourceReference extends JavaScriptResourceReference
{
private static final long serialVersionUID = -4771815414204892357L;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package nl.topicus.wqplot.components.plugins;

import org.odlabs.wiquery.core.resources.WiQueryJavaScriptResourceReference;
import org.apache.wicket.request.resource.JavaScriptResourceReference;

public class JQPlotCanvasAxisTickRendererResourceReference extends
WiQueryJavaScriptResourceReference
public class JQPlotCanvasAxisTickRendererResourceReference extends JavaScriptResourceReference
{
private static final long serialVersionUID = -4771815414204892357L;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package nl.topicus.wqplot.components.plugins;

import org.odlabs.wiquery.core.resources.WiQueryJavaScriptResourceReference;
import org.apache.wicket.request.resource.JavaScriptResourceReference;

public class JQPlotCanvasTextRendererResourceReference extends WiQueryJavaScriptResourceReference
public class JQPlotCanvasTextRendererResourceReference extends JavaScriptResourceReference
{
private static final long serialVersionUID = -4771815414204892357L;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package nl.topicus.wqplot.components.plugins;

import org.odlabs.wiquery.core.resources.WiQueryJavaScriptResourceReference;
import org.apache.wicket.request.resource.JavaScriptResourceReference;

public class JQPlotCategoryAxisRendererResourceReference extends WiQueryJavaScriptResourceReference
public class JQPlotCategoryAxisRendererResourceReference extends JavaScriptResourceReference
{
private static final long serialVersionUID = -4771815414204892357L;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package nl.topicus.wqplot.components.plugins;

import org.odlabs.wiquery.core.resources.WiQueryJavaScriptResourceReference;
import org.apache.wicket.request.resource.JavaScriptResourceReference;

public class JQPlotCursorResourceReference extends WiQueryJavaScriptResourceReference
public class JQPlotCursorResourceReference extends JavaScriptResourceReference
{
private static final long serialVersionUID = -4771815414204892357L;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package nl.topicus.wqplot.components.plugins;

import org.odlabs.wiquery.core.resources.WiQueryJavaScriptResourceReference;
import org.apache.wicket.request.resource.JavaScriptResourceReference;

public class JQPlotDateAxisRendererResourceReference extends WiQueryJavaScriptResourceReference
public class JQPlotDateAxisRendererResourceReference extends JavaScriptResourceReference
{
private static final long serialVersionUID = -4771815414204892357L;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package nl.topicus.wqplot.components.plugins;

import org.odlabs.wiquery.core.resources.WiQueryJavaScriptResourceReference;
import org.apache.wicket.request.resource.JavaScriptResourceReference;

public class JQPlotEnhancedLegendRendererResourceReference extends
WiQueryJavaScriptResourceReference
public class JQPlotEnhancedLegendRendererResourceReference extends JavaScriptResourceReference
{
private static final long serialVersionUID = -4771815414204892357L;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package nl.topicus.wqplot.components.plugins;

import org.odlabs.wiquery.core.resources.WiQueryJavaScriptResourceReference;
import org.apache.wicket.request.resource.JavaScriptResourceReference;

public class JQPlotHighlighterResourceReference extends WiQueryJavaScriptResourceReference
public class JQPlotHighlighterResourceReference extends JavaScriptResourceReference
{
private static final long serialVersionUID = -4771815414204892357L;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package nl.topicus.wqplot.components.plugins;

import org.odlabs.wiquery.core.resources.WiQueryJavaScriptResourceReference;
import org.apache.wicket.request.resource.JavaScriptResourceReference;

public class JQPlotLogAxisRendererResourceReference extends WiQueryJavaScriptResourceReference
public class JQPlotLogAxisRendererResourceReference extends JavaScriptResourceReference
{
private static final long serialVersionUID = -4771815414204892357L;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package nl.topicus.wqplot.components.plugins;

import org.odlabs.wiquery.core.resources.WiQueryJavaScriptResourceReference;
import org.apache.wicket.request.resource.JavaScriptResourceReference;

public class JQPlotPieRendererResourceReference extends WiQueryJavaScriptResourceReference
public class JQPlotPieRendererResourceReference extends JavaScriptResourceReference
{
private static final long serialVersionUID = -4771815414204892357L;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package nl.topicus.wqplot.components.plugins;

import org.odlabs.wiquery.core.resources.WiQueryJavaScriptResourceReference;
import org.apache.wicket.request.resource.JavaScriptResourceReference;

public class JQPlotPointLabelsResourceReference extends WiQueryJavaScriptResourceReference
public class JQPlotPointLabelsResourceReference extends JavaScriptResourceReference
{
private static final long serialVersionUID = -4771815414204892357L;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package nl.topicus.wqplot.components.plugins;

import org.odlabs.wiquery.core.resources.WiQueryJavaScriptResourceReference;
import org.apache.wicket.request.resource.JavaScriptResourceReference;

/**
* @author Ernesto Reinaldo Barreiro
Expand All @@ -12,9 +12,9 @@ public class Plugin implements IPlugin

private String name;

private WiQueryJavaScriptResourceReference javaScriptResourceReference;
private JavaScriptResourceReference javaScriptResourceReference;

protected Plugin(String name, WiQueryJavaScriptResourceReference javaScriptResourceReference)
protected Plugin(String name, JavaScriptResourceReference javaScriptResourceReference)
{
this.name = name;
this.javaScriptResourceReference = javaScriptResourceReference;
Expand All @@ -27,7 +27,7 @@ public String getName()
}

@Override
public WiQueryJavaScriptResourceReference getJavaScriptResourceReference()
public JavaScriptResourceReference getJavaScriptResourceReference()
{
return javaScriptResourceReference;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package nl.topicus.wqplot.components.plugins;

import org.odlabs.wiquery.core.resources.WiQueryJavaScriptResourceReference;
import org.apache.wicket.request.resource.JavaScriptResourceReference;

/**
* @author Ernesto Reinaldo Barreiro
Expand All @@ -9,7 +9,7 @@ public class Renderer extends Plugin implements IRenderer
{
private static final long serialVersionUID = 1L;

protected Renderer(String name, WiQueryJavaScriptResourceReference javaScriptResourceReference)
protected Renderer(String name, JavaScriptResourceReference javaScriptResourceReference)
{
super(name, javaScriptResourceReference);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import org.codehaus.jackson.JsonGenerator;
import org.codehaus.jackson.JsonNode;
import org.codehaus.jackson.map.SerializerProvider;
import org.codehaus.jackson.map.ser.SerializerBase;
import org.codehaus.jackson.map.ser.std.SerializerBase;

public class PluginReferenceSerializer extends SerializerBase<Object>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ private void addPlot1()
chart1O.setTitle("Google, Inc.");

Button button = new Button("button1");
button.add(new AttributeModifier("onclick", true, new Model<String>(chart1.getMarkupId()
button.add(new AttributeModifier("onclick", new Model<String>(chart1.getMarkupId()
+ ".resetZoom()")));
add(button);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
*/
public class DateAxisTestPage extends WebPage
{
private static final long serialVersionUID = 1L;

/**
*
Expand Down