Return-Path: Delivered-To: apmail-click-commits-archive@www.apache.org Received: (qmail 62247 invoked from network); 23 Jun 2010 15:11:12 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 23 Jun 2010 15:11:12 -0000 Received: (qmail 47883 invoked by uid 500); 23 Jun 2010 15:11:12 -0000 Delivered-To: apmail-click-commits-archive@click.apache.org Received: (qmail 47868 invoked by uid 500); 23 Jun 2010 15:11:12 -0000 Mailing-List: contact commits-help@click.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: click-dev@click.apache.org Delivered-To: mailing list commits@click.apache.org Received: (qmail 47843 invoked by uid 99); 23 Jun 2010 15:11:12 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Jun 2010 15:11:12 +0000 X-ASF-Spam-Status: No, hits=-1822.6 required=10.0 tests=ALL_TRUSTED,AWL X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Jun 2010 15:11:10 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 3C7982388980; Wed, 23 Jun 2010 15:10:17 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r957241 - in /click/trunk/examples/click-bench: build.xml jmeter/benchmark.jmx lib/clickclick-core-0.3.jar src/benchmark/click/repeater/ src/benchmark/click/repeater/CustomerList.java web/click/repeater/ web/click/repeater/customer-list.htm Date: Wed, 23 Jun 2010 15:10:17 -0000 To: commits@click.apache.org From: sabob@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100623151017.3C7982388980@eris.apache.org> Author: sabob Date: Wed Jun 23 15:10:16 2010 New Revision: 957241 URL: http://svn.apache.org/viewvc?rev=957241&view=rev Log: included a repeater test Added: click/trunk/examples/click-bench/lib/clickclick-core-0.3.jar (with props) click/trunk/examples/click-bench/src/benchmark/click/repeater/ click/trunk/examples/click-bench/src/benchmark/click/repeater/CustomerList.java click/trunk/examples/click-bench/web/click/repeater/ click/trunk/examples/click-bench/web/click/repeater/customer-list.htm Modified: click/trunk/examples/click-bench/build.xml click/trunk/examples/click-bench/jmeter/benchmark.jmx Modified: click/trunk/examples/click-bench/build.xml URL: http://svn.apache.org/viewvc/click/trunk/examples/click-bench/build.xml?rev=957241&r1=957240&r2=957241&view=diff ============================================================================== --- click/trunk/examples/click-bench/build.xml (original) +++ click/trunk/examples/click-bench/build.xml Wed Jun 23 15:10:16 2010 @@ -21,7 +21,7 @@ Builds, tests, and runs the project click-bench. - + Modified: click/trunk/examples/click-bench/jmeter/benchmark.jmx URL: http://svn.apache.org/viewvc/click/trunk/examples/click-bench/jmeter/benchmark.jmx?rev=957241&r1=957240&r2=957241&view=diff ============================================================================== --- click/trunk/examples/click-bench/jmeter/benchmark.jmx (original) +++ click/trunk/examples/click-bench/jmeter/benchmark.jmx Wed Jun 23 15:10:16 2010 @@ -31,7 +31,9 @@ localhost - 8080 + 9999 + + http @@ -55,6 +57,8 @@ + + /click-bench/wicket-session @@ -66,7 +70,7 @@ - false + false @@ -85,6 +89,8 @@ + + /click-bench/wicket-session/?wicket:bookmarkablePage=wicket-5%3Abenchmark.wicket.AddCustomer @@ -96,7 +102,7 @@ - false + false @@ -106,7 +112,7 @@ true - 400 + 100 @@ -115,6 +121,8 @@ + + /click-bench/click/pages/customer-list.htm @@ -126,7 +134,7 @@ - false + false @@ -145,6 +153,8 @@ + + /click-bench/click/container/customer-list.htm @@ -156,7 +166,39 @@ - false + false + + + + + + + + + true + 400 + + + + + + + + + + + + + /click-bench/click/repeater/customer-list.htm + GET + true + false + true + false + + + + false @@ -175,6 +217,8 @@ + + /click-bench/click/pages/add-customer.htm @@ -186,7 +230,7 @@ - false + false @@ -205,6 +249,8 @@ + + /click-bench/click/velocity/velocity-customer-list.htm @@ -216,7 +262,7 @@ - false + false @@ -235,6 +281,8 @@ + + /click-bench/click/jsp/jsp-customer-list.htm @@ -246,7 +294,7 @@ - false + false @@ -265,6 +313,8 @@ + + /click-bench/jsp/direct-jsp.jsp @@ -276,7 +326,7 @@ - false + false @@ -286,7 +336,7 @@ true - 400 + 100 @@ -295,6 +345,8 @@ + + /click-bench/customer-list.do @@ -306,7 +358,7 @@ - false + false @@ -316,7 +368,7 @@ true - 400 + 100 @@ -325,6 +377,8 @@ + + /click-bench/tapestry/customerlist @@ -336,7 +390,7 @@ - false + false @@ -346,7 +400,7 @@ true - 400 + 100 @@ -355,6 +409,8 @@ + + /click-bench/CustomerList.action @@ -366,12 +422,44 @@ - false + false + + false + + saveConfig + + + true + true + true + + true + true + true + true + false + true + true + false + false + true + false + false + false + false + false + 0 + true + + + + + Added: click/trunk/examples/click-bench/lib/clickclick-core-0.3.jar URL: http://svn.apache.org/viewvc/click/trunk/examples/click-bench/lib/clickclick-core-0.3.jar?rev=957241&view=auto ============================================================================== Binary file - no diff available. Propchange: click/trunk/examples/click-bench/lib/clickclick-core-0.3.jar ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: click/trunk/examples/click-bench/src/benchmark/click/repeater/CustomerList.java URL: http://svn.apache.org/viewvc/click/trunk/examples/click-bench/src/benchmark/click/repeater/CustomerList.java?rev=957241&view=auto ============================================================================== --- click/trunk/examples/click-bench/src/benchmark/click/repeater/CustomerList.java (added) +++ click/trunk/examples/click-bench/src/benchmark/click/repeater/CustomerList.java Wed Jun 23 15:10:16 2010 @@ -0,0 +1,147 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License 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. + */ +package benchmark.click.repeater; + +import benchmark.click.pages.EditCustomer; +import org.apache.click.Page; + +import benchmark.dao.CustomerDao; +import benchmark.dao.Customer; +import java.text.SimpleDateFormat; +import java.util.List; +import net.sf.clickclick.control.html.table.Cell; +import net.sf.clickclick.control.html.table.HtmlTable; +import net.sf.clickclick.control.html.table.Row; +import net.sf.clickclick.control.html.table.TableBody; +import net.sf.clickclick.control.html.table.TableHeader; +import net.sf.clickclick.control.repeater.Repeater; +import net.sf.clickclick.control.repeater.RepeaterRow; +import org.apache.click.ActionListener; +import org.apache.click.Control; +import org.apache.click.control.AbstractContainer; +import org.apache.click.control.ActionLink; +import org.apache.click.control.Container; +import org.apache.click.dataprovider.DataProvider; +import org.apache.click.util.HtmlStringBuffer; + +// 427 l +// 399 dp with index remove index +// 470 l +// 440 dp with index remove index +// +public class CustomerList extends Page { + + private HtmlTable table; + + private ActionLink editLink = new ActionLink("Edit", this, "onEditClick"); + + private ActionLink deleteLink = new ActionLink("Delete", this, "onDeleteClick"); + + private final SimpleDateFormat FORMAT = new SimpleDateFormat("MMMM d, yyyy"); + + public CustomerList() { + table = new HtmlTable("table"); + table.addStyleClass("decorated"); + + addControl(table); + addControl(editLink); + addControl(deleteLink); + + editLink.setActionListener(new ActionListener() { + + public boolean onAction(Control source) { + Integer id = editLink.getValueInteger(); + Customer customer = CustomerDao.getInstance().findById(id); + EditCustomer editPage = getContext().createPage(EditCustomer.class); + editPage.setCustomer(customer); + setForward(editPage); + return true; + } + }); + + deleteLink.setActionListener(new ActionListener() { + + public boolean onAction(Control source) { + Integer id = deleteLink.getValueInteger(); + Customer customer = CustomerDao.getInstance().findById(id); + CustomerDao.getInstance().delete(customer); + setRedirect(CustomerList.class); + return false; + } + }); + + TableHeader header = new TableHeader(); + header.setColumns("First Name", "Last Name", "State", "Birth Date", "Options"); + table.add(header); + + TableBody body = new TableBody(); + table.add(body); + + Repeater repeater = new Repeater() { + public void buildRow(final Object item, final RepeaterRow row, final int index) { + final Customer customer = (Customer) item; + + Row tableRow = new Row(); + tableRow.add(customer.getFirstName(), + customer.getLastName(), + customer.getState(), + FORMAT.format(customer.getBirthDate())); + + Cell actions = new Cell(); + + final AbstractContainer editLinkWrapper = new AbstractContainer("Edit") { + + @Override + public void render(HtmlStringBuffer buffer) { + editLink.setValueObject(customer.getId()); + editLink.render(buffer); + } + }; + + final Container deleteLinkWrapper = new AbstractContainer("Delete") { + + @Override + public void render(HtmlStringBuffer buffer) { + deleteLink.setValueObject(customer.getId()); + deleteLink.render(buffer); + } + }; + + actions.add(editLinkWrapper); + actions.setText(" | "); + actions.add(deleteLinkWrapper); + tableRow.add(actions); + + row.add(tableRow); + } + }; + + repeater.setDataProvider(new DataProvider() { + public List getData() { + return CustomerDao.getInstance().findAll(); + } + }); + + /* + List customers = CustomerDao.getInstance().findAll(); + repeater.setItems(customers);*/ + + body.add(repeater); + } +} Added: click/trunk/examples/click-bench/web/click/repeater/customer-list.htm URL: http://svn.apache.org/viewvc/click/trunk/examples/click-bench/web/click/repeater/customer-list.htm?rev=957241&view=auto ============================================================================== --- click/trunk/examples/click-bench/web/click/repeater/customer-list.htm (added) +++ click/trunk/examples/click-bench/web/click/repeater/customer-list.htm Wed Jun 23 15:10:16 2010 @@ -0,0 +1,10 @@ + + + Customer List + + + +

Customer List

+ $table + + \ No newline at end of file