Hi there,

 I've noticed that the 2.0 repository didn't have
wicket-portlet-examples.  I'm sending a patch that enables
wicket-portlet-examples in the 1.x branch to compile under Wicket2.0.
If anyone feels like adding the code to the branch (I don't have
commit rights), feel free to use/modify the patch as sees fit.

    []s Gus
Property changes on: .
___________________________________________________________________
Name: svn:ignore
   - 
target

   + target
build
dist


Index: src/main/java/wicket/examples/portlet/ExamplePortlet.java
===================================================================
--- src/main/java/wicket/examples/portlet/ExamplePortlet.java	(revision 491085)
+++ src/main/java/wicket/examples/portlet/ExamplePortlet.java	(working copy)
@@ -1,9 +1,8 @@
 package wicket.examples.portlet;
 import javax.portlet.WindowState;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
 import wicket.ResourceReference;
 import wicket.markup.html.basic.Label;
 import wicket.markup.html.form.Form;
@@ -19,7 +18,7 @@
  */
 public class ExamplePortlet extends PortletPage
 {
-	private static final Log log = LogFactory.getLog(ExamplePortlet.class);
+	private static final Logger log = LoggerFactory.getLogger(ExamplePortlet.class);
 
 	/**
 	 * 
@@ -31,12 +30,12 @@
 		PropertyModel messageModel = new PropertyModel(this, "message");
 
 		// The label displays the currently set message
-		add(new Label("msg", messageModel));
+		new Label(this, "msg", messageModel);
 
 		// Add a form to change the message. We don't need to do anything
 		// else with this form as the shared model is automatically updated
 		// on form submits
-		Form form = new Form("form")
+		Form form = new Form(this, "form")
 		{
 
 			protected void onSubmit()
@@ -46,29 +45,27 @@
 
 		};
 		
-		form.add(new TextField("msgInput", messageModel));
+		new TextField(form, "msgInput", messageModel);
 
-		add(new Link("link")
+		new Link(this, "link")
 		{
 			public void onClick()
 			{
 				log.info("link clicked");
 				message = "Link clicked!";
 			}
-		});
+		};
 
-		add(form);
-		add(new Link("link2")
+		new Link(this, "link2")
 		{
 
 			public void onClick()
 			{
 				setResponsePage(new ExamplePortlet2(ExamplePortlet.this));
 			}
-		});
+		};
 
-		add(new Image("image",new ResourceReference(ExamplePortlet.class,"wicket-logo.png")));
-
+		new Image(this, "image",new ResourceReference(ExamplePortlet.class,"wicket-logo.png"));
 	}
 
 	private String message = "[type your message to the world here]";
Index: src/main/java/wicket/examples/portlet/ExamplePortlet2.java
===================================================================
--- src/main/java/wicket/examples/portlet/ExamplePortlet2.java	(revision 491085)
+++ src/main/java/wicket/examples/portlet/ExamplePortlet2.java	(working copy)
@@ -6,10 +6,9 @@
 
 import javax.portlet.PortletMode;
 import javax.portlet.WindowState;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
 import wicket.Page;
 import wicket.ajax.AjaxRequestTarget;
 import wicket.ajax.markup.html.AjaxLink;
@@ -25,7 +24,7 @@
  */
 public class ExamplePortlet2 extends PortletPage
 {
-	private static final Log log = LogFactory.getLog(ExamplePortlet.class);
+	private static final Logger log = LoggerFactory.getLogger(ExamplePortlet2.class);
 
 	long counter = 0;
 
@@ -42,16 +41,16 @@
 	 */
 	public ExamplePortlet2(final Page page)
 	{
-		add(new Link("link")
+		new Link(this, "link")
 		{
 			public void onClick()
 			{
 				setResponsePage(page);
 			}
-		});
-		add(new Label("windowState", new PropertyModel(this, "windowState")));
-		add(new Label("portletMode", new PropertyModel(this, "portletMode")));
-		add(new Image("image", new RenderedDynamicImageResource(100, 100)
+		};
+		new Label(this, "windowState", new PropertyModel(this, "windowState"));
+		new Label(this, "portletMode", new PropertyModel(this, "portletMode"));
+		new Image(this, "image", new RenderedDynamicImageResource(100, 100)
 		{
 			protected boolean render(Graphics2D graphics)
 			{
@@ -67,20 +66,19 @@
 				graphics.drawOval(x, y, dx, dy);
 				return true;
 			}
-		}));
+		});
 
-		final Label counterValue = new Label("counter",
+		final Label counterValue = new Label(this, "counter",
 				new PropertyModel(this, "counter"));
 		counterValue.setOutputMarkupId(true);
-		add(counterValue);
-		add(new AjaxLink("counterLink")
+		new AjaxLink(this, "counterLink")
 		{
 			public void onClick(AjaxRequestTarget target)
 			{
 				counter++;
 				target.addComponent(counterValue);
 			}
-		});
+		};
 	}
 
 	protected void onSetWindowState(WindowState state)
Index: pom.xml
===================================================================
--- pom.xml	(revision 491085)
+++ pom.xml	(working copy)
@@ -22,24 +22,20 @@
 	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd";>
 
 	<modelVersion>4.0.0</modelVersion>
-	<parent>
-		<groupId>org.apache.wicket</groupId>
-		<artifactId>wicket-parent</artifactId>
-		<version>1.3-incubating-SNAPSHOT</version>
-		<relativePath>../wicket-parent</relativePath>
-	</parent>
-
+	<groupId>wicket</groupId>
 	<artifactId>wicket-portlet-examples</artifactId>
 	<packaging>war</packaging>
-
+	<version>2.0-SNAPSHOT</version>
 	<name>Wicket Portlet Examples</name>
 	<description></description>
-
 	<dependencies>
-		<dependency>
-			<groupId>org.apache.wicket</groupId>
-			<artifactId>wicket</artifactId>
-		</dependency>
+		<dependency>
+			<groupId>wicket</groupId>
+			<artifactId>wicket</artifactId>
+			<version>2.0-SNAPSHOT</version>
+			<type>jar</type>
+			<scope>compile</scope>
+		</dependency>
 	</dependencies>
 	<build>
 		<plugins>
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to