svn commit: r562438 - /wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/markup/html/form/AjaxSubmitButton.java
Author: almaw Date: Fri Aug 3 05:39:29 2007 New Revision: 562438 URL: http://svn.apache.org/viewvc?view=rev&rev=562438 Log: Make it more obvious this is deprecated. Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/markup/html/form/AjaxSubmitButton.java Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/markup/html/form/AjaxSubmitButton.java URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/markup/html/form/AjaxSubmitButton.java?view=diff&rev=562438&r1=562437&r2=562438 == --- wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/markup/html/form/AjaxSubmitButton.java (original) +++ wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/markup/html/form/AjaxSubmitButton.java Fri Aug 3 05:39:29 2007 @@ -37,6 +37,7 @@ * Construct. * * @param id +* @deprecated Use [EMAIL PROTECTED] AjaxButton} instead. */ public AjaxSubmitButton(String id) { @@ -48,6 +49,7 @@ * * @param id * @param form +* @deprecated Use [EMAIL PROTECTED] AjaxButton} instead. */ public AjaxSubmitButton(String id, final Form form) {
[jira] Created: (WICKET-814) DateTimeField minute field needs zero-padding - it should display "00" not "0"
DateTimeField minute field needs zero-padding - it should display "00" not "0" -- Key: WICKET-814 URL: https://issues.apache.org/jira/browse/WICKET-814 Project: Wicket Issue Type: Bug Components: wicket-datetime Affects Versions: 1.3.0-beta2 Reporter: Alastair Maw Assignee: Alastair Maw Fix For: 1.3.0-beta3 As summary. Times are typically represented as 9:09, not 9:9 ;-) Need to futz with converters to fix this, probably. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Resolved: (WICKET-814) DateTimeField minute field needs zero-padding - it should display "00" not "0"
[ https://issues.apache.org/jira/browse/WICKET-814?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Alastair Maw resolved WICKET-814. - Resolution: Fixed I've added a ZeroPaddingIntegerConverter to core specifically to deal with this, and plumbed it in for DateTimeField. > DateTimeField minute field needs zero-padding - it should display "00" not "0" > -- > > Key: WICKET-814 > URL: https://issues.apache.org/jira/browse/WICKET-814 > Project: Wicket > Issue Type: Bug > Components: wicket-datetime >Affects Versions: 1.3.0-beta2 >Reporter: Alastair Maw >Assignee: Alastair Maw > Fix For: 1.3.0-beta3 > > > As summary. > Times are typically represented as 9:09, not 9:9 ;-) > Need to futz with converters to fix this, probably. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Assigned: (WICKET-813) DatePicker doesn't notify component
[ https://issues.apache.org/jira/browse/WICKET-813?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Alastair Maw reassigned WICKET-813: --- Assignee: Eelco Hillenius > DatePicker doesn't notify component > --- > > Key: WICKET-813 > URL: https://issues.apache.org/jira/browse/WICKET-813 > Project: Wicket > Issue Type: Bug > Components: wicket-datetime >Affects Versions: 1.3.0-beta1, 1.3.0-beta2 >Reporter: Stefan Kanev >Assignee: Eelco Hillenius >Priority: Trivial > Fix For: 1.3.0-beta3 > > Attachments: datepicker_fix.patch > > > The datepicker doesn't notify it's component when the date is changed. > I guess this bug came in between revisions 556202 and 556194. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Created: (WICKET-813) DatePicker doesn't notify component
DatePicker doesn't notify component --- Key: WICKET-813 URL: https://issues.apache.org/jira/browse/WICKET-813 Project: Wicket Issue Type: Bug Components: wicket-datetime Affects Versions: 1.3.0-beta2, 1.3.0-beta1 Reporter: Stefan Kanev Fix For: 1.3.0-beta3 Attachments: datepicker_fix.patch The datepicker doesn't notify it's component when the date is changed. I guess this bug came in between revisions 556202 and 556194. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
svn commit: r562421 - /wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/util/convert/converters/ZeroPaddingIntegerConverter.java
Author: almaw Date: Fri Aug 3 05:08:22 2007 New Revision: 562421 URL: http://svn.apache.org/viewvc?view=rev&rev=562421 Log: Integer converter for zero-padding. Added: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/util/convert/converters/ZeroPaddingIntegerConverter.java (with props) Added: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/util/convert/converters/ZeroPaddingIntegerConverter.java URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/util/convert/converters/ZeroPaddingIntegerConverter.java?view=auto&rev=562421 == --- wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/util/convert/converters/ZeroPaddingIntegerConverter.java (added) +++ wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/util/convert/converters/ZeroPaddingIntegerConverter.java Fri Aug 3 05:08:22 2007 @@ -0,0 +1,84 @@ +/* + * 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 org.apache.wicket.util.convert.converters; + +import java.util.Locale; + +/** + * Converts from Object to Integer, adding zero-padding. + * + * @author Eelco Hillenius + * @author Jonathan Locke + * @author Al Maw + */ +public final class ZeroPaddingIntegerConverter extends AbstractIntegerConverter +{ + private static final long serialVersionUID = 1L; + + private final int zeroPadLength; + + /** +* Constructs this converter. +* +* @param zeroPadLength +*Minimum length of String to be outputted (will be +*zero-padded). +*/ + public ZeroPaddingIntegerConverter(int zeroPadLength) + { + this.zeroPadLength = zeroPadLength; + } + + /** +* @see org.apache.wicket.util.convert.converters.AbstractNumberConverter#convertToString(java.lang.Object, +* java.util.Locale) +*/ + public String convertToString(Object value, Locale locale) + { + String result = super.convertToString(value, locale); + + while (result.length() < zeroPadLength) + { + result = "0" + result; + } + + return result; + } + + /** +* @see org.apache.wicket.util.convert.IConverter#convertToObject(java.lang.String,Locale) +*/ + public Object convertToObject(final String value, Locale locale) + { + final Number number = parse(value, Integer.MIN_VALUE, Integer.MAX_VALUE, locale); + + if (number == null) + { + return null; + } + + return new Integer(number.intValue()); + } + + /** +* @see org.apache.wicket.util.convert.converters.AbstractConverter#getTargetType() +*/ + protected Class getTargetType() + { + return Integer.class; + } +} \ No newline at end of file Propchange: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/util/convert/converters/ZeroPaddingIntegerConverter.java -- svn:eol-style = native
svn commit: r562500 - in /wicket/trunk/jdk-1.4/wicket/src: main/java/org/apache/wicket/request/target/coding/MixedParamUrlCodingStrategy.java test/java/org/apache/wicket/request/target/coding/MixedPar
Author: jbq Date: Fri Aug 3 08:23:27 2007 New Revision: 562500 URL: http://svn.apache.org/viewvc?view=rev&rev=562500 Log: WICKET-739 MixedParamUrlCodingStrategy : no symmetric url encoding/decoding Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/request/target/coding/MixedParamUrlCodingStrategy.java wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/request/target/coding/MixedParamUrlCodingStrategyTest.java Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/request/target/coding/MixedParamUrlCodingStrategy.java URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/request/target/coding/MixedParamUrlCodingStrategy.java?view=diff&rev=562500&r1=562499&r2=562500 == --- wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/request/target/coding/MixedParamUrlCodingStrategy.java (original) +++ wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/request/target/coding/MixedParamUrlCodingStrategy.java Fri Aug 3 08:23:27 2007 @@ -185,7 +185,7 @@ for (int i = 0; i < pathParts.length; i++) { - params.put(parameterNames[i], pathParts[i]); + params.put(parameterNames[i], urlDecode(pathParts[i])); } } Modified: wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/request/target/coding/MixedParamUrlCodingStrategyTest.java URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/request/target/coding/MixedParamUrlCodingStrategyTest.java?view=diff&rev=562500&r1=562499&r2=562500 == --- wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/request/target/coding/MixedParamUrlCodingStrategyTest.java (original) +++ wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/request/target/coding/MixedParamUrlCodingStrategyTest.java Fri Aug 3 08:23:27 2007 @@ -213,9 +213,9 @@ urlMap.put("d", "4"); urlMap.put("e", "5"); - ValueMap parameterMap = npucs.decodeParameters("/1/2/3", urlMap); + ValueMap parameterMap = npucs.decodeParameters("/%C3%A8/2/3", urlMap); assertEquals(5, parameterMap.size()); - assertContains(parameterMap, "a", "1"); + assertContains(parameterMap, "a", "\u00e8"); assertContains(parameterMap, "b", "2"); assertContains(parameterMap, "c", "3"); assertContains(parameterMap, "d", "4");
[jira] Resolved: (WICKET-739) MixedParamUrlCodingStrategy : no symmetric url encoding/decoding
[ https://issues.apache.org/jira/browse/WICKET-739?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jean-Baptiste Quenot resolved WICKET-739. - Resolution: Fixed Assignee: Jean-Baptiste Quenot Fixed, thanks for reporting. I couldn't use the test case however, I modified the existing MixedParamUrlCodingStrategyTest instead. > MixedParamUrlCodingStrategy : no symmetric url encoding/decoding > > > Key: WICKET-739 > URL: https://issues.apache.org/jira/browse/WICKET-739 > Project: Wicket > Issue Type: Bug > Components: wicket >Affects Versions: 1.3.0-beta2 > Environment: wicket-1.3.0-incubator (from maven rep > http://wicketstuff.org/maven/repository/) >Reporter: David Bernard >Assignee: Jean-Baptiste Quenot >Priority: Minor > Fix For: 1.3.0-beta3 > > Attachments: MixedParamUrlCodingStrategyTest.java > > > I use MixedParamUrlCodingStrategy for BookmarkablePageLink where the first > parameter is a String, an human label. > And I've got a bug, bad url when I try to link something like "histoire de > l'art". > During my investigation I found that there is no symmetry between the > encoding/decoding of the urlFragment : decodeParameters doesn't decode > (urldecode) the fragment of the path. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Created: (WICKET-812) Submit button, multipart content and UploadProgressBar
Submit button, multipart content and UploadProgressBar -- Key: WICKET-812 URL: https://issues.apache.org/jira/browse/WICKET-812 Project: Wicket Issue Type: Bug Components: wicket-extensions Affects Versions: 1.3.0-beta2 Environment: windows xp, firefox 2.0.0.6 Reporter: Stanislav Dvorscak When I use UploadProgressBar, then onSubmit method of SubmitButton not function. I can not also find submit button with findSubmittingButton method of Form. I search this problem. And I find only - submit button is not in http request parameter. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Updated: (WICKET-805) upgrade to SLF4J to version 1.4.2
[ https://issues.apache.org/jira/browse/WICKET-805?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Alastair Maw updated WICKET-805: Component/s: (was: wicket-auth-roles) (was: wicket-datetime) (was: wicket-examples) (was: wicket-extensions) > upgrade to SLF4J to version 1.4.2 > - > > Key: WICKET-805 > URL: https://issues.apache.org/jira/browse/WICKET-805 > Project: Wicket > Issue Type: Improvement > Components: wicket >Affects Versions: 1.3.0-beta2 >Reporter: Sean Sullivan >Assignee: Alastair Maw >Priority: Minor > Fix For: 1.3.0-beta3 > > > SLF4J 1.4.2 was released in July 2007. Can we upgrade SLF4J in the Maven > pom? -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
svn commit: r562423 - /wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DateTimeField.java
Author: almaw Date: Fri Aug 3 05:13:00 2007 New Revision: 562423 URL: http://svn.apache.org/viewvc?view=rev&rev=562423 Log: Make DateTimeField understand minutes properly. Modified: wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DateTimeField.java Modified: wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DateTimeField.java URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DateTimeField.java?view=diff&rev=562423&r1=562422&r2=562423 == --- wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DateTimeField.java (original) +++ wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DateTimeField.java Fri Aug 3 05:13:00 2007 @@ -30,6 +30,8 @@ import org.apache.wicket.model.PropertyModel; import org.apache.wicket.protocol.http.request.WebClientInfo; import org.apache.wicket.request.ClientInfo; +import org.apache.wicket.util.convert.IConverter; +import org.apache.wicket.util.convert.converters.ZeroPaddingIntegerConverter; import org.apache.wicket.util.lang.EnumeratedType; import org.apache.wicket.validation.validator.NumberValidator; import org.joda.time.DateTimeFieldType; @@ -48,6 +50,8 @@ // systems with AM/PM, others have 24 hour systems public class DateTimeField extends FormComponentPanel { + private static final IConverter MINUTES_CONVERTER = new ZeroPaddingIntegerConverter(2); + /** * Enumerated type for different ways of handling the render part of * requests. @@ -222,8 +226,16 @@ add(hoursField = new TextField("hours", new PropertyModel(this, "hours"), Integer.class)); hoursField.add(NumberValidator.range(0, 12)); hoursField.setLabel(new Model("hours")); - add(minutesField = new TextField("minutes", new PropertyModel(this, "minutes"), - Integer.class)); +add(minutesField = new TextField("minutes", new PropertyModel(this, "minutes"), + Integer.class) + { + private static final long serialVersionUID = 1L; + + public IConverter getConverter(Class type) + { + return MINUTES_CONVERTER; + } + }); minutesField.add(NumberValidator.range(0, 59)); minutesField.setLabel(new Model("minutes")); add(amOrPmChoice = new DropDownChoice("amOrPmChoice", new PropertyModel(this, "amOrPm"),
[jira] Updated: (WICKET-813) DatePicker doesn't notify component
[ https://issues.apache.org/jira/browse/WICKET-813?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Stefan Kanev updated WICKET-813: Attachment: datepicker_fix.patch A patch that I assume fixes the bug. > DatePicker doesn't notify component > --- > > Key: WICKET-813 > URL: https://issues.apache.org/jira/browse/WICKET-813 > Project: Wicket > Issue Type: Bug > Components: wicket-datetime >Affects Versions: 1.3.0-beta1, 1.3.0-beta2 >Reporter: Stefan Kanev > Fix For: 1.3.0-beta3 > > Attachments: datepicker_fix.patch > > > The datepicker doesn't notify it's component when the date is changed. > I guess this bug came in between revisions 556202 and 556194. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Updated: (WICKET-813) DatePicker doesn't notify component
[ https://issues.apache.org/jira/browse/WICKET-813?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Stefan Kanev updated WICKET-813: Priority: Trivial (was: Major) > DatePicker doesn't notify component > --- > > Key: WICKET-813 > URL: https://issues.apache.org/jira/browse/WICKET-813 > Project: Wicket > Issue Type: Bug > Components: wicket-datetime >Affects Versions: 1.3.0-beta1, 1.3.0-beta2 >Reporter: Stefan Kanev >Priority: Trivial > Fix For: 1.3.0-beta3 > > Attachments: datepicker_fix.patch > > > The datepicker doesn't notify it's component when the date is changed. > I guess this bug came in between revisions 556202 and 556194. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
svn commit: r562525 - /wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Session.java
Author: knopp Date: Fri Aug 3 10:27:47 2007 New Revision: 562525 URL: http://svn.apache.org/viewvc?view=rev&rev=562525 Log: Pagemap prefix made configurable Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Session.java Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Session.java URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Session.java?view=diff&rev=562525&r1=562524&r2=562525 == --- wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Session.java (original) +++ wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Session.java Fri Aug 3 10:27:47 2007 @@ -16,6 +16,19 @@ */ package org.apache.wicket; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Set; +import java.util.Map.Entry; + import org.apache.wicket.application.IClassResolver; import org.apache.wicket.authorization.IAuthorizationStrategy; import org.apache.wicket.feedback.FeedbackMessage; @@ -31,10 +44,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.io.Serializable; -import java.util.*; -import java.util.Map.Entry; - /** * Holds information about a user session, including some fixed number of most @@ -372,7 +381,7 @@ */ public Session(Request request) { - this.locale = request.getLocale(); + locale = request.getLocale(); if (locale == null) { throw new IllegalArgumentException("Parameter 'locale' must not be null"); @@ -421,7 +430,7 @@ if (store.lookup(request) == null) { // explicitly create a session - this.id = store.getSessionId(request, true); + id = store.getSessionId(request, true); // bind it store.bind(request, this); @@ -499,18 +508,26 @@ */ public synchronized final String createAutoPageMapName() { - String name = "wicket-" + autoCreatePageMapCounter; + String name = getAutoPageMapNamePrefix() + autoCreatePageMapCounter; IPageMap pm = pageMapForName(name, false); while (pm != null) { autoCreatePageMapCounter++; - name = "wicket-" + autoCreatePageMapCounter; + name = getAutoPageMapNamePrefix() + autoCreatePageMapCounter; pm = pageMapForName(name, false); } return name; } /** +* @return +*/ + protected String getAutoPageMapNamePrefix() + { + return "wicket-"; + } + + /** * Registers an error feedback message for this session * * @param message @@ -562,7 +579,7 @@ { if (clientInfo == null) { - this.clientInfo = RequestCycle.get().newClientInfo(); + clientInfo = RequestCycle.get().newClientInfo(); } return clientInfo; } @@ -1120,7 +1137,7 @@ */ public final void dirty() { - this.dirty = true; + dirty = true; } /** @@ -1348,7 +1365,7 @@ if (dirty) { // State is no longer dirty - this.dirty = false; + dirty = false; // Set attribute. setAttribute(SESSION_ATTRIBUTE_NAME, this);
svn commit: r562526 - /wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/WebPage.java
Author: knopp Date: Fri Aug 3 10:28:32 2007 New Revision: 562526 URL: http://svn.apache.org/viewvc?view=rev&rev=562526 Log: window.name value should be prefixed by wicket independenly of pagemap name Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/WebPage.java Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/WebPage.java URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/WebPage.java?view=diff&rev=562526&r1=562525&r2=562526 == --- wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/WebPage.java (original) +++ wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/WebPage.java Fri Aug 3 10:28:32 2007 @@ -130,18 +130,16 @@ JavascriptUtils.writeOpenTag(response); response .write("if (window.name=='' || window.name.indexOf('wicket') > -1) { window.name=\""); - response.write(name); + response.write("wicket-" + name); response.write("\"; }"); JavascriptUtils.writeCloseTag(response); } else { // Here is our trickery to detect whether the current request - // was - // made in a new window/ tab, in which case it should go in a - // different page map so that we don't intermangle the history - // of - // those windows + // was made in a new window/ tab, in which case it should go in + // a different page map so that we don't intermangle the history + // of those windows CharSequence url = null; if (target instanceof IBookmarkablePageRequestTarget) { @@ -158,7 +156,7 @@ JavascriptUtils.writeOpenTag(response); response .write("if (window.name=='' || (window.name.indexOf('wicket') > -1 && window.name!='" + - name + "')) { window.location=\""); + "wicket-" + name + "')) { window.location=\""); response.write(url); response.write("\"; }"); JavascriptUtils.writeCloseTag(response);
[CONF] Apache Wicket: Obfuscating urls (page edited)
Page Edited : WICKET : Obfuscating urls Obfuscating urls has been edited by Doug Leeper (Aug 03, 2007). (View changes) Content: Bookmarkable Link Table of contents How to obfuscate/encrypt a wicket url Wicket 1.3 Wicket 1.2 Wicket 1.1 How to obfuscate/encrypt a wicket url From time to time users ask how to obfuscate wicket urls. Instead of myApp?component=1&version=0&interface=IRedirectListener they asked for myApp?sdf897sD879ddfD8... and myApp/sdf897sD879ddfD8 and many more. Due to varying requirements such as being Google and/or cluster compliant we decided to provide "hooks" build into the core to allow for virtually any obfuscating alogrithm to be implemented by wicket users. Hopefully users will contribute their implementations back to the project. Classes involved in encrypting and decrypting URLs are WebResponse and WebRequest. The default implementations provided by Wicket don't encrypt the URL at all, but subclasses (currently provided by core as well) like WebResponseWithCryptedUrl and WebRequestWithCryptedUrl do. In order for your application to use them you must subclass WebApplication.newWebRequest() and WebApplication.newWebResponse() like in the snippet shown below. Note, this changed slightly in Wicket 1.2 and 1.3, as can be seen by comparing the fragments below: Wicket 1.3 Wicket 1.3+ protected IRequestCycleProcessor newRequestCycleProcessor() { return new WebRequestCycleProcessor() { protected IRequestCodingStrategy newRequestCodingStrategy() { return new CryptedUrlWebRequestCodingStrategy(new WebRequestCodingStrategy()); } }; } Wicket 1.2 Wicket 1.2+ public final class SignIn2Application extends WicketExampleApplication { protected IRequestCycleProcessor newRequestCycleProcessor() { return new CompoundRequestCycleProcessor(new CryptedUrlWebRequestCodingStrategy( new WebRequestCodingStrategy()), null, null, null, null); } } Wicket 1.1 Wicket 1.1 public final class SignIn2Application extends WicketExampleApplication { /** * @see wicket.protocol.http.WebApplication#newWebRequest(javax.servlet.http.HttpServletRequest) */ protected WebRequest newWebRequest(HttpServletRequest servletRequest) { return new WebRequestWithCryptedUrl(servletRequest); } /** * @see wicket.protocol.http.WebApplication#newWebResponse(javax.servlet.http.HttpServletResponse) */ protected WebResponse newWebResponse(HttpServletResponse servletResponse) throws IOException { return new WebResponseWithCryptedUrl(servletResponse); } } Powered by Atlassian Confluence (Version: 2.2.9 Build:#527 Sep 07, 2006) - Bug/feature request Unsubscribe or edit your notifications preferences
svn commit: r562528 - /wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/request/target/coding/HybridUrlCodingStrategy.java
Author: knopp Date: Fri Aug 3 10:30:12 2007 New Revision: 562528 URL: http://svn.apache.org/viewvc?view=rev&rev=562528 Log: WICKET-30 encoding/decoding improvements Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/request/target/coding/HybridUrlCodingStrategy.java Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/request/target/coding/HybridUrlCodingStrategy.java URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/request/target/coding/HybridUrlCodingStrategy.java?view=diff&rev=562528&r1=562527&r2=562528 == --- wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/request/target/coding/HybridUrlCodingStrategy.java (original) +++ wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/request/target/coding/HybridUrlCodingStrategy.java Fri Aug 3 10:30:12 2007 @@ -44,13 +44,13 @@ * the state is preserved on refresh. * * The url with [EMAIL PROTECTED] HybridUrlCodingStrategy} looks like - * /mount/path/param1/value1|3| or /mount/path/param1/value1|3:2| where 3 is - * page Id and 2 is version number. + * /mount/path/param1/value1.3. or /mount/path/param1/value1.3.2 where 3 is page + * Id and 2 is version number. * * Also to preserve state on refresh with ajax-only pages the * [EMAIL PROTECTED] HybridUrlCodingStrategy} does an immediate redirect after hitting * bookmarkable URL, e.g. it immediately redirects from /mount/path to - * /mount/path|3| where 3 is the next page id. This preserves the page instance + * /mount/path.3 where 3 is the next page id. This preserves the page instance * on subsequent page refresh. * * @author Matej Knopp @@ -177,8 +177,9 @@ // bookmarkable page request return new HybridBookmarkablePageRequestTarget(pageMapName, (Class)pageClassRef.get(), parameters, originalUrlTrailingSlashesCount, isRedirectOnBookmarkableRequest()); -// return new BookmarkablePageRequestTarget(pageMapName, (Class)pageClassRef.get(), -// parameters); +// return new BookmarkablePageRequestTarget(pageMapName, +// (Class)pageClassRef.get(), +// parameters); } else // hybrid url @@ -471,7 +472,7 @@ lastSubstring.startsWith(getBeginSeparator()) && lastSubstring.endsWith(getEndSeparator())) { - String pageInfoString= lastSubstring.substring(getBeginSeparator().length(), // + String pageInfoString = lastSubstring.substring(getBeginSeparator().length(), // lastSubstring.length() - getEndSeparator().length()); PageInfo info = PageInfo.parsePageInfo(pageInfoString); last = info; @@ -514,11 +515,11 @@ * Possible string representation of PageInfo: * * pageId -* pageId:version -* :pageMap -* pageMap:pageId: (the first colon distingues between this and the -* previous one) -* pageMap:pageId:version +* pageId.version +* pageMap (only if pageMap starts with a letter) +* .pageMap +* pageMap.pageId.version +* pageMap.pageId (only if pageMap name starts with a letter) * * * @author Matej Knopp @@ -573,40 +574,70 @@ return pageMapName; } - private static char getPageInfoSeparator() { + private static char getPageInfoSeparator() + { return '.'; } - + + /** +* +* pageId +* pageId.version +* pageMap (only in if pagemap strats with a letter) +* .pageMap +* pageMap.pageId (only in if pageMap name starts with a letter) +* pageMap.pageId.version +* +*/ public String toString() { AppendingStringBuffer buffer = new AppendingStringBuffer(5); - - if (pageMapName != null) + final boolean pmEmpty = Strings.isEmpty(pageMapName); + final boolean pmStartsWithCharacter = !pmEmpty && + Character.isLetter(pageMapName.charAt(0)); + + + if (pageId != null && pmEmpty && versionNumber.intValue() == 0) { - if (versionNumber == null && pageId == null) - { -
svn commit: r562529 - in /wicket/trunk/jdk-1.4/wicket/src: main/java/org/apache/wicket/protocol/http/pagestore/PageWindowManager.java test/java/org/apache/wicket/protocol/http/pagestore/PageWindowMana
Author: knopp Date: Fri Aug 3 10:31:38 2007 New Revision: 562529 URL: http://svn.apache.org/viewvc?view=rev&rev=562529 Log: WICKET-736 bugfix Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/pagestore/PageWindowManager.java wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/protocol/http/pagestore/PageWindowManagerTest.java Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/pagestore/PageWindowManager.java URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/pagestore/PageWindowManager.java?view=diff&rev=562529&r1=562528&r2=562529 == --- wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/pagestore/PageWindowManager.java (original) +++ wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/pagestore/PageWindowManager.java Fri Aug 3 10:31:38 2007 @@ -54,7 +54,7 @@ } // list of PageWindowInternal objects - private List /* */windows = new ArrayList(); + private final List /* */windows = new ArrayList(); // map from page id to list of pagewindow indices (refering to the windows // list) - to improve searching speed @@ -127,7 +127,8 @@ else if (versionNumber == -1) { // we need to find last recently stored page window - that is page - // window with index closest to the left of the indexPointer or farthest + // window with index closest to the left of the indexPointer or + // farthest // to the right. for (Iterator i = indices.iterator(); i.hasNext();) { @@ -137,9 +138,9 @@ if (window.pageId == pageId) { if ((result == -1) || /**/ - (currentIndex <= indexPointer && result > indexPointer) || /**/ - (currentIndex > result && currentIndex <= indexPointer) || /**/ - (currentIndex > result && result > indexPointer)) + (currentIndex <= indexPointer && result > indexPointer) || /**/ + (currentIndex > result && currentIndex <= indexPointer) || /**/ + (currentIndex > result && result > indexPointer)) { result = currentIndex; } @@ -155,8 +156,8 @@ int currentIndex = ((Integer)i.next()).intValue(); PageWindowInternal window = (PageWindowInternal)windows.get(currentIndex); - if (window.pageId == pageId && window.versionNumber == versionNumber && - window.ajaxVersionNumber > lastAjaxVersion) + if (window.pageId == pageId && window.versionNumber == versionNumber && + window.ajaxVersionNumber > lastAjaxVersion) { result = currentIndex; lastAjaxVersion = window.ajaxVersionNumber; @@ -513,6 +514,10 @@ { windows.remove(index); totalSize -= window.filePartSize; + if (indexPointer == index) + { + --indexPointer; + } } else { Modified: wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/protocol/http/pagestore/PageWindowManagerTest.java URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/protocol/http/pagestore/PageWindowManagerTest.java?view=diff&rev=562529&r1=562528&r2=562529 == --- wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/protocol/http/pagestore/PageWindowManagerTest.java (original) +++ wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/protocol/http/pagestore/PageWindowManagerTest.java Fri Aug 3 10:31:38 2007 @@ -28,137 +28,142 @@ /** * */ - public void testAddRemove() + public void testAddRemove() { PageWindowManager manager = new PageWindowManager(300); PageWindow window; - +
svn commit: r562538 [1/3] - in /wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui: ./ assets/ assets/skins/ assets/skins/sam/ calendar/ calendar/assets/ calendar/asse
Author: ehillenius Date: Fri Aug 3 11:20:05 2007 New Revision: 562538 URL: http://svn.apache.org/viewvc?view=rev&rev=562538 Log: WICKET-811 wip Added: wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/assets/ wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/assets/skins/ wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/assets/skins/sam/ wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/assets/skins/sam/calendar.css wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/assets/skins/sam/sprite.png (with props) wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/assets/skins/ wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/assets/skins/sam/ wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/assets/skins/sam/calendar-skin.css wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/assets/skins/sam/calendar.css wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/calendar-min.js wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/dom/ wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/dom/dom-min.js wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/event/ wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/event/event-min.js wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/yahoo/ wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/yahoo/yahoo-min.js wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/yuiloader-beta.js Removed: wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/assets/calendar.css wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/calendar.js wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/dom.js wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/event.js wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/yahoo.js Modified: wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/VERSION wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DatePicker.java wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DatePicker.js wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/wicket-date.js Modified: wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/VERSION URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/VERSION?view=diff&rev=562538&r1=562537&r2=562538 == --- wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/VERSION (original) +++ wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/VERSION Fri Aug 3 11:20:05 2007 @@ -1,2 +1,2 @@ http://developer.yahoo.com/yui/ -this version: 2.2.2 +this version: 2.3.0 Added: wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/assets/skins/sam/calendar.css URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/assets/skins/sam/calendar.css?view=auto&rev=562538 == --- wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/assets/skins/sam/calendar.css (added) +++ wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/assets/skins/sam/calendar.css Fri Aug 3 11:20:05 2007 @@ -0,0 +1,7 @@ +/* +Copyright (c) 2007, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.net/yui/license.txt +version: 2.3.0 +*/ +.yui-calcontainer{position:relative;float:left;_overflow:hidden;}.yui-calcontainer iframe{position:absolute;border:none;margin:0;padding:0;z-index:0;width:100%;height:100%;left:0px;top:0px;}.yui-calcontainer iframe.fixedsize{width:50em;height:50em;top:-1px;left:-1px;}.yui-calcontainer.multi .groupcal{z-index:1;float:left;position:relative;}.yui-calcontainer .title{position:relative;z-index:1;}.yui-calcontainer .close-icon{position:absolute;z-index:1;}.yui-calendar{position:relative;}.yui
[jira] Commented: (WICKET-811) upgrade YUI to 2.3.0 and use yuiloader facilities
[ https://issues.apache.org/jira/browse/WICKET-811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12517600 ] Eelco Hillenius commented on WICKET-811: I committed a slightly tweaked version of the patch. However, it currently doesn't work in Safari and Opera (didn't test IE), though it works with FireFox/ Camino. Don't know yet what's wrong. > upgrade YUI to 2.3.0 and use yuiloader facilities > - > > Key: WICKET-811 > URL: https://issues.apache.org/jira/browse/WICKET-811 > Project: Wicket > Issue Type: Task > Components: wicket-datetime >Affects Versions: 1.3.0-beta2 >Reporter: Gerolf Seitz > Fix For: 1.3.0-beta3 > > Attachments: sprite.png, yui2.3.0-upgrade.patch > > > beside the replacement of the actual files, the yuiloader facilities should > be used to resolve dependencies -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
svn commit: r562542 - /wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DatePicker.js
Author: ehillenius Date: Fri Aug 3 11:32:14 2007 New Revision: 562542 URL: http://svn.apache.org/viewvc?view=rev&rev=562542 Log: WICKET-813 Modified: wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DatePicker.js Modified: wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DatePicker.js URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DatePicker.js?view=diff&rev=562542&r1=562541&r2=562542 == --- wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DatePicker.js (original) +++ wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DatePicker.js Fri Aug 3 11:32:14 2007 @@ -30,8 +30,9 @@ function selectHandler(type, args, cal) { YAHOO.util.Dom.get("${componentId}").value = Wicket.DateTime.substituteDate('${datePattern}', args[0][0]); + var wasVisible = YAHOO.wicket.${widgetId}DpJs.isVisible(); cal.hide(); - if (${fireChangeEvent} && YAHOO.wicket.${widgetId}DpJs.isVisible()) { + if (${fireChangeEvent} && wasVisible) { var field = YAHOO.util.Dom.get("${componentId}"); if (typeof(field.onchange) != 'undefined') field.onchange(); }
[jira] Resolved: (WICKET-813) DatePicker doesn't notify component
[ https://issues.apache.org/jira/browse/WICKET-813?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Eelco Hillenius resolved WICKET-813. Resolution: Fixed > DatePicker doesn't notify component > --- > > Key: WICKET-813 > URL: https://issues.apache.org/jira/browse/WICKET-813 > Project: Wicket > Issue Type: Bug > Components: wicket-datetime >Affects Versions: 1.3.0-beta1, 1.3.0-beta2 >Reporter: Stefan Kanev >Assignee: Eelco Hillenius >Priority: Trivial > Fix For: 1.3.0-beta3 > > Attachments: datepicker_fix.patch > > > The datepicker doesn't notify it's component when the date is changed. > I guess this bug came in between revisions 556202 and 556194. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
svn commit: r562550 - /wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/AbstractCalendar.java
Author: ehillenius Date: Fri Aug 3 12:16:14 2007 New Revision: 562550 URL: http://svn.apache.org/viewvc?view=rev&rev=562550 Log: removed AbstractCalendar as it wasn't being kept up-to-date and it doesn't help the date picker much Removed: wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/AbstractCalendar.java
[CONF] Apache Wicket: Creating a component to display a Flash movie (from a byte array) (page created)
Page Created : WICKET : Creating a component to display a Flash movie (from a byte array) Creating a component to display a Flash movie (from a byte array) has been created by Apaar Trivedi (Aug 03, 2007). Content: Although Wicket does not provide a Flash component right out of the box, it isn't hard at all to make one using some markup and a Resource. Given a byte array representing a Flash movie, all that is required is to be able to stream this back as a resource with the appropriate markup around it. The general idea is that you want to make some Component extending WebMarkupComponent and implementing IResourceListener so that it can be displayed as a component and return a flash movie as a resource to the resource stream. When You have such a class made, there a couple of things to do. One, you must implement onResourceRequested, this will write the flash bytes into the resource stream, and might look something like this: public void onResourceRequested() { getRequestCycle().setRequestTarget(new IRequestTarget() { public void respond(RequestCycle requestCycle) { requestCycle.getResponse()getOutputStream().write(getFlashBytes()); } }); } You may override onComponentTag to dynamically output the height and width of the Flash movie protected void onComponentTag(ComponentTag tag) { super.onComponentTag(tag); tag.put("width", WIDTH); tag.put("height", HEIGHT; } and finally to ensure that your markup is created correctly to display the Flash, you must override and implement onComponentTagBody as such: protected void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag) { StringBuffer flashBuffer = new StringBuffer(); // in the following, we will append all the necessary body tags of flash markup flashBufferappend("movie\" value=\""); // urlFor will provide the link that will stream the flash byte array flashBuffer.append(urlFor(IResourceListener.INTERFACE)); flashBuffer.append("\"/>"); flashBuffer.append(""); flashBuffer.append(urlFor(IResourceListener.INTERFACE)); flashBuffer.append("\" width=\""); // set our desired width flashBuffer.append(WIDTH); flashBuffer.append("\" height=\""); // set our desired width flashBuffer.append(HEIGHT); flashBuffer.append("' quality=\"high\" name=\"movie\" align=\"middle\" plug inspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\">"); replaceComponentTagBody(markupStream, openTag, flashBody); } That is all that is required of the component to provide the Flash resource, and build the body markup. Finally, you want the actual markup of whoever adds this component (.html), to look like this: "WICKET_ID_OF_COMPONENT" classid="" class="code-quote">"clsid:D27CDB6E-AE6D-11cf-96B8-44455354" codebase="" class="code-quote">"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="350" height="100" id="movie" align="middle"> And that is basically all that is required to display your flash movie that might be stored as a byte array in a database somewhere! Powered by Atlassian Confluence (Version: 2.2.9 Build:#527 Sep 07, 2006) - Bug/feature request Unsubscribe or edit your notifications preferences
[CONF] Apache Wicket: Creating a component to display a Flash movie (from a byte array) (page edited)
Page Edited : WICKET : Creating a component to display a Flash movie (from a byte array) Creating a component to display a Flash movie (from a byte array) has been edited by Apaar Trivedi (Aug 03, 2007). (View changes) Content: Although Wicket does not provide a Flash component right out of the box, it isn't hard at all to make one using some markup and a Resource. Given a byte array representing a Flash movie, all that is required is to be able to stream this back as a resource with the appropriate markup around it. The general idea is that you want to make some Component extending WebMarkupComponent and implementing IResourceListener so that it can be displayed as a component and return a flash movie as a resource to the resource stream. When You have such a class made, there a couple of things to do. One, you must implement onResourceRequested, this will write the flash bytes into the resource stream, and might look something like this: public void onResourceRequested() { getRequestCycle().setRequestTarget(new IRequestTarget() { public void respond(RequestCycle requestCycle) { requestCycle.getResponse()getOutputStream().write(getFlashBytes()); } }); } You may override onComponentTag to dynamically output the height and width of the Flash movie protected void onComponentTag(ComponentTag tag) { super.onComponentTag(tag); tag.put("width", WIDTH); tag.put("height", HEIGHT; } and finally to ensure that your markup is created correctly to display the Flash, you must override and implement onComponentTagBody as such: protected void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag) { StringBuffer flashBuffer = new StringBuffer(); // in the following, we will append all the necessary body tags of flash markup flashBufferappend("movie\" value=\""); // urlFor will provide the link that will stream the flash byte array flashBuffer.append(urlFor(IResourceListener.INTERFACE)); flashBuffer.append("\"/>"); flashBuffer.append(""); flashBuffer.append(urlFor(IResourceListener.INTERFACE)); flashBuffer.append("\" width=\""); flashBuffer.append(WIDTH); flashBuffer.append("\" height=\""); flashBuffer.append(HEIGHT); flashBuffer.append("' quality=\"high\" name=\"movie\" align=\"middle\" plug inspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\">"); replaceComponentTagBody(markupStream, openTag, flashBody); } That is all that is required of the component to provide the Flash resource, and build the body markup. Finally, you want the actual markup of whoever adds this component (.html), to look like this: "WICKET_ID_OF_COMPONENT" classid="" class="code-quote">"clsid:D27CDB6E-AE6D-11cf-96B8-44455354" codebase="" class="code-quote">"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="350" height="100" id="movie" align="middle"> And that is basically all that is required to display your flash movie that might be stored as a byte array in a database somewhere! Powered by Atlassian Confluence (Version: 2.2.9 Build:#527 Sep 07, 2006) - Bug/feature request Unsubscribe or edit your notifications preferences
svn commit: r562551 - /wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DatePicker.java
Author: ehillenius Date: Fri Aug 3 12:27:04 2007 New Revision: 562551 URL: http://svn.apache.org/viewvc?view=rev&rev=562551 Log: added yahoo-min as an explicit dependency so that at least Safari works Modified: wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DatePicker.java Modified: wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DatePicker.java URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DatePicker.java?view=diff&rev=562551&r1=562550&r2=562551 == --- wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DatePicker.java (original) +++ wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DatePicker.java Fri Aug 3 12:27:04 2007 @@ -147,6 +147,9 @@ */ public void renderHead(IHeaderResponse response) { + // TODO do we really need this? without it, Safari won't eat it + response.renderJavascriptReference(new JavascriptResourceReference(YuiLib.class, + "yahoo/yahoo-min.js")); // add YUILoader response.renderJavascriptReference(new JavascriptResourceReference(YuiLib.class, "yuiloader-beta.js"));
[CONF] Apache Wicket: Creating a component to display a Flash movie (from a byte array) (page edited)
Page Edited : WICKET : Creating a component to display a Flash movie (from a byte array) Creating a component to display a Flash movie (from a byte array) has been edited by Apaar Trivedi (Aug 03, 2007). (View changes) Content: Although Wicket does not provide a Flash component right out of the box, it isn't hard at all to make one using some markup and a Resource. Given a byte array representing a Flash movie, all that is required is to be able to stream this back as a resource with the appropriate markup around it. The general idea is that you want to make some Component extending WebMarkupComponent and implementing IResourceListener so that it can be displayed as a component and return a flash movie as a resource to the resource stream. When You have such a class made, there a couple of things to do. One, you must implement onResourceRequested, this will write the flash bytes into the resource stream, and might look something like this: public void onResourceRequested() { getRequestCycle().setRequestTarget(new IRequestTarget() { public void respond(RequestCycle requestCycle) { requestCycle.getResponse()getOutputStream().write(getFlashBytes()); } }); } You may override onComponentTag to dynamically output the height and width of the Flash movie protected void onComponentTag(ComponentTag tag) { super.onComponentTag(tag); tag.put("width", WIDTH); tag.put("height", HEIGHT; } and finally to ensure that your markup is created correctly to display the Flash, you must override and implement onComponentTagBody as such: protected void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag) { StringBuffer flashBuffer = new StringBuffer(); // in the following, we will append all the necessary body tags of flash markup flashBufferappend("movie\" value=\""); // urlFor will provide the link that will stream the flash byte array flashBuffer.append(urlFor(IResourceListener.INTERFACE)); flashBuffer.append("\"/>"); flashBuffer.append(""); flashBuffer.append(urlFor(IResourceListener.INTERFACE)); flashBuffer.append("\" width=\""); flashBuffer.append(WIDTH); flashBuffer.append("\" height=\""); flashBuffer.append(HEIGHT); flashBuffer.append("' quality=\"high\" name=\"movie\" align=\"middle\" plug inspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\">"); replaceComponentTagBody(markupStream, openTag, flashBody); } That is all that is required of the component to provide the Flash resource, and build the body markup. Finally, you want the actual markup of whoever adds this component (.html), to look like this: "WICKET_ID_OF_COMPONENT" classid="" class="code-quote">"clsid:D27CDB6E-AE6D-11cf-96B8-44455354" codebase="" class="code-quote">"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="350" height="100" id="movie" align="middle"> And that is basically all that is required to display your flash movie that might be stored as a byte array in a database somewhere! Powered by Atlassian Confluence (Version: 2.2.9 Build:#527 Sep 07, 2006) - Bug/feature request Unsubscribe or edit your notifications preferences
svn commit: r562548 - in /wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui: YuiLib.java calendar/CalendarPopup.html calendar/DatePicker.java calendar/DatePicker.js
Author: ehillenius Date: Fri Aug 3 12:15:18 2007 New Revision: 562548 URL: http://svn.apache.org/viewvc?view=rev&rev=562548 Log: simplified loading. Still doesn't work for Opera and Safari Removed: wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/CalendarPopup.html Modified: wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/YuiLib.java wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DatePicker.java wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DatePicker.js Modified: wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/YuiLib.java URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/YuiLib.java?view=diff&rev=562548&r1=562547&r2=562548 == --- wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/YuiLib.java (original) +++ wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/YuiLib.java Fri Aug 3 12:15:18 2007 @@ -25,7 +25,6 @@ */ public final class YuiLib implements IClusterable { - private static final long serialVersionUID = 1L; /** Modified: wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DatePicker.java URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DatePicker.java?view=diff&rev=562548&r1=562547&r2=562548 == --- wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DatePicker.java (original) +++ wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DatePicker.java Fri Aug 3 12:15:18 2007 @@ -16,6 +16,7 @@ */ package org.apache.wicket.extensions.yui.calendar; +import java.text.DateFormat; import java.text.DateFormatSymbols; import java.text.SimpleDateFormat; import java.util.ArrayList; @@ -83,6 +84,19 @@ } } + /** +* Format to be used when configuring YUI calendar. Can be used when using +* the "selected" property. +*/ + public static final DateFormat FORMAT_DATE = new SimpleDateFormat("MM/dd/"); + + /** +* For specifying which page (month/year) to show in the calendar, use this +* format for the date. This is to be used together with the property +* "pagedate" +*/ + public static final DateFormat FORMAT_PAGEDATE = new SimpleDateFormat("MM/"); + private static final long serialVersionUID = 1L; /** The target component. */ @@ -134,10 +148,9 @@ public void renderHead(IHeaderResponse response) { // add YUILoader - // NOTE JavascriptResourceReference takes care of stripping comments - // when in deployment (production) mode response.renderJavascriptReference(new JavascriptResourceReference(YuiLib.class, "yuiloader-beta.js")); + // variables for the initialization script Map variables = new HashMap(); String widgetId = getEscapedComponentMarkupId(); @@ -204,13 +217,6 @@ // render initialization script with the variables interpolated TextTemplateHeaderContributor.forJavaScript(DatePicker.class, "DatePicker.js", Model.valueOf(variables)).renderHead(response); - - // Initialize the calendar. - // StringBuffer initBuffer = new StringBuffer(); - // initBuffer.append("init"); - // initBuffer.append(widgetId + "DpJs"); - // initBuffer.append("();"); - // response.renderOnDomReadyJavascript(initBuffer.toString()); } /** @@ -307,8 +313,8 @@ if (modelObject instanceof Date) { Date date = (Date)modelObject; - widgetProperties.put("selected", AbstractCalendar.FORMAT_DATE.format(date)); - widgetProperties.put("pagedate", AbstractCalendar.FORMAT_PAGEDATE.format(date)); + widgetProperties.put("selected", FORMAT_DATE.format(date)); + widgetProperties.put("pagedate", FORMAT_PAGEDATE.format(date)); } } Modified: wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DatePicker.js URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DatePicker.js?view=diff
[CONF] Apache Wicket: Creating a component to display a Flash movie (from a byte array) (page edited)
Page Edited : WICKET : Creating a component to display a Flash movie (from a byte array) Creating a component to display a Flash movie (from a byte array) has been edited by Apaar Trivedi (Aug 03, 2007). (View changes) Content: Although Wicket does not provide a Flash component right out of the box, it isn't hard at all to make one using some markup and a Resource. Given a byte array representing a Flash movie, all that is required is to be able to stream this back as a resource with the appropriate markup around it. The general idea is that you want to make some Component extending WebMarkupComponent and implementing IResourceListener so that it can be displayed as a component and return a flash movie as a resource to the resource stream. When You have such a class made, there a couple of things to do. One, you must implement onResourceRequested, this will write the flash bytes into the resource stream, and might look something like this: public void onResourceRequested() { getRequestCycle().setRequestTarget(new IRequestTarget() { public void respond(RequestCycle requestCycle) { requestCycle.getResponse()getOutputStream().write(getFlashBytes()); } }); } You may override onComponentTag to dynamically output the height and width of the Flash movie protected void onComponentTag(ComponentTag tag) { super.onComponentTag(tag); tag.put("width", WIDTH); tag.put("height", HEIGHT; } and finally to ensure that your markup is created correctly to display the Flash, you must override and implement onComponentTagBody as such: protected void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag) { StringBuffer flashBuffer = new StringBuffer(); // in the following, we will append all the necessary body tags of flash markup flashBufferappend("movie\" value=\""); // urlFor will provide the link that will stream the flash byte array flashBuffer.append(urlFor(IResourceListener.INTERFACE)); flashBuffer.append("\"/>"); flashBuffer.append(""); flashBuffer.append(urlFor(IResourceListener.INTERFACE)); flashBuffer.append("\" width=\""); flashBuffer.append(WIDTH); flashBuffer.append("\" height=\""); flashBuffer.append(HEIGHT); flashBuffer.append("' quality=\"high\" name=\"movie\" align=\"middle\" plug inspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\">"); replaceComponentTagBody(markupStream, openTag, flashBody); } That is all that is required of the component to provide the Flash resource, and build the body markup. Finally, you want the actual markup of whoever adds this component (.html), to look like this: "WICKET_ID_OF_COMPONENT" classid="" class="code-quote">"clsid:D27CDB6E-AE6D-11cf-96B8-44455354" codebase="" class="code-quote">"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="350" height="100" id="movie" align="middle"> And that is basically all that is required to display your flash movie that might be stored as a byte array in a database somewhere! Powered by Atlassian Confluence (Version: 2.2.9 Build:#527 Sep 07, 2006) - Bug/feature request Unsubscribe or edit your notifications preferences
[CONF] Apache Wicket: How to display a Flash movie (from a byte array) (page edited)
Page Edited : WICKET : How to display a Flash movie (from a byte array) How to display a Flash movie (from a byte array) has been edited by Apaar Trivedi (Aug 03, 2007). (View changes) Content: Although Wicket does not provide a Flash component right out of the box, it isn't hard at all to make one using some markup and a Resource. Given a byte array representing a Flash movie, all that is required is to be able to stream this back as a resource with the appropriate markup around it. The general idea is that you want to make some Component extending WebMarkupComponent and implementing IResourceListener so that it can be displayed as a component and return a flash movie as a resource to the resource stream. When You have such a class made, there a couple of things to do. One, you must implement onResourceRequested, this will write the flash bytes into the resource stream, and might look something like this: public void onResourceRequested() { getRequestCycle().setRequestTarget(new IRequestTarget() { public void respond(RequestCycle requestCycle) { requestCycle.getResponse()getOutputStream().write(getFlashBytes()); } }); } You may override onComponentTag to dynamically output the height and width of the Flash movie protected void onComponentTag(ComponentTag tag) { super.onComponentTag(tag); tag.put("width", WIDTH); tag.put("height", HEIGHT; } and finally to ensure that your markup is created correctly to display the Flash, you must override and implement onComponentTagBody as such: protected void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag) { StringBuffer flashBuffer = new StringBuffer(); // in the following, we will append all the necessary body tags of flash markup flashBufferappend("movie\" value=\""); // urlFor will provide the link that will stream the flash byte array flashBuffer.append(urlFor(IResourceListener.INTERFACE)); flashBuffer.append("\"/>"); flashBuffer.append(""); flashBuffer.append(urlFor(IResourceListener.INTERFACE)); flashBuffer.append("\" width=\""); flashBuffer.append(WIDTH); flashBuffer.append("\" height=\""); flashBuffer.append(HEIGHT); flashBuffer.append("' quality=\"high\" name=\"movie\" align=\"middle\" plug inspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\">"); replaceComponentTagBody(markupStream, openTag, flashBody); } That is all that is required of the component to provide the Flash resource, and build the body markup. Finally, you want the actual markup of whoever adds this component (.html), to look like this: "WICKET_ID_OF_COMPONENT" classid="" class="code-quote">"clsid:D27CDB6E-AE6D-11cf-96B8-44455354" codebase="" class="code-quote">"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="350" height="100" id="movie" align="middle"> And that is basically all that is required to display your flash movie that might be stored as a byte array in a database somewhere! Powered by Atlassian Confluence (Version: 2.2.9 Build:#527 Sep 07, 2006) - Bug/feature request Unsubscribe or edit your notifications preferences
[CONF] Apache Wicket: How to display a Flash movie (from a byte array) (page edited)
Page Edited : WICKET : How to display a Flash movie (from a byte array) How to display a Flash movie (from a byte array) has been edited by Apaar Trivedi (Aug 03, 2007). (View changes) Content: Although Wicket does not provide a Flash component right out of the box, it isn't hard at all to make one using some markup and a Resource. Given a byte array representing a Flash movie, all that is required is to be able to stream this back is a resource with the appropriate markup around it. The general idea is that you want to make some Component extending WebMarkupComponent and implementing IResourceListener so that it can be displayed as a component and return a flash movie as a resource to the resource stream. When You have such a class made, there a couple of things to do. One, you must implement onResourceRequested, this will write the flash bytes into the resource stream, and might look something like this: public void onResourceRequested() { getRequestCycle().setRequestTarget(new IRequestTarget() { public void respond(RequestCycle requestCycle) { requestCycle.getResponse()getOutputStream().write(getFlashBytes()); } }); } You may override onComponentTag to dynamically output the height and width of the Flash movie protected void onComponentTag(ComponentTag tag) { super.onComponentTag(tag); tag.put("width", WIDTH); tag.put("height", HEIGHT; } and finally to ensure that your markup is created correctly to display the Flash, you must override and implement onComponentTagBody as such: protected void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag) { StringBuffer flashBuffer = new StringBuffer(); // in the following, we will append all the necessary body tags of flash markup flashBufferappend("movie\" value=\""); // urlFor will provide the link that will stream the flash byte array flashBuffer.append(urlFor(IResourceListener.INTERFACE)); flashBuffer.append("\"/>"); flashBuffer.append(""); flashBuffer.append(urlFor(IResourceListener.INTERFACE)); flashBuffer.append("\" width=\""); flashBuffer.append(WIDTH); flashBuffer.append("\" height=\""); flashBuffer.append(HEIGHT); flashBuffer.append("' quality=\"high\" name=\"movie\" align=\"middle\" plug inspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\">"); replaceComponentTagBody(markupStream, openTag, flashBody); } That is all that is required of the component to provide the Flash resource, and build the body markup. Finally, you want the actual markup of whoever adds this component (.html), to look like this: "WICKET_ID_OF_COMPONENT" classid="" class="code-quote">"clsid:D27CDB6E-AE6D-11cf-96B8-44455354" codebase="" class="code-quote">"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="350" height="100" id="movie" align="middle"> And that is basically all that is required to display your flash movie that might be stored as a byte array in a database somewhere! Powered by Atlassian Confluence (Version: 2.2.9 Build:#527 Sep 07, 2006) - Bug/feature request Unsubscribe or edit your notifications preferences
[CONF] Apache Wicket: How to display a Flash movie (from a byte array) (page edited)
Page Edited : WICKET : How to display a Flash movie (from a byte array) How to display a Flash movie (from a byte array) has been edited by Apaar Trivedi (Aug 03, 2007). (View changes) Content: Although Wicket does not provide a Flash component right out of the box, it isn't hard at all to make one using some markup and a Resource. Given a byte array representing a Flash movie, all that is required is to be able to stream this back is a resource with the appropriate markup around it. The general idea is that you want to make some Component extending WebMarkupComponent and implementing IResourceListener so that it can be displayed as a component and return a flash movie as a resource to the resource stream. When You have such a class made, there are a couple of things to do. One, you must implement onResourceRequested, this will write the flash bytes into the resource stream, and might look something like this: public void onResourceRequested() { getRequestCycle().setRequestTarget(new IRequestTarget() { public void respond(RequestCycle requestCycle) { requestCycle.getResponse()getOutputStream().write(getFlashBytes()); } }); } You may override onComponentTag to dynamically output the height and width of the Flash movie protected void onComponentTag(ComponentTag tag) { super.onComponentTag(tag); tag.put("width", WIDTH); tag.put("height", HEIGHT; } and finally to ensure that your markup is created correctly to display the Flash, you must override and implement onComponentTagBody as such: protected void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag) { StringBuffer flashBuffer = new StringBuffer(); // in the following, we will append all the necessary body tags of flash markup flashBufferappend("movie\" value=\""); // urlFor will provide the link that will stream the flash byte array flashBuffer.append(urlFor(IResourceListener.INTERFACE)); flashBuffer.append("\"/>"); flashBuffer.append(""); flashBuffer.append(urlFor(IResourceListener.INTERFACE)); flashBuffer.append("\" width=\""); flashBuffer.append(WIDTH); flashBuffer.append("\" height=\""); flashBuffer.append(HEIGHT); flashBuffer.append("' quality=\"high\" name=\"movie\" align=\"middle\" plug inspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\">"); replaceComponentTagBody(markupStream, openTag, flashBody); } That is all that is required of the component to provide the Flash resource, and build the body markup. Finally, you want the actual markup of whoever adds this component (.html), to look like this: "WICKET_ID_OF_COMPONENT" classid="" class="code-quote">"clsid:D27CDB6E-AE6D-11cf-96B8-44455354" codebase="" class="code-quote">"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="350" height="100" id="movie" align="middle"> And that is basically all that is required to display your flash movie that might be stored as a byte array in a database somewhere! Powered by Atlassian Confluence (Version: 2.2.9 Build:#527 Sep 07, 2006) - Bug/feature request Unsubscribe or edit your notifications preferences
svn commit: r562560 - /wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DatePicker.java
Author: ehillenius Date: Fri Aug 3 12:40:24 2007 New Revision: 562560 URL: http://svn.apache.org/viewvc?view=rev&rev=562560 Log: fixed date picker issues with Safari and Opera by adding the initialization script to onDomReady handler Modified: wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DatePicker.java Modified: wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DatePicker.java URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DatePicker.java?view=diff&rev=562560&r1=562559&r2=562560 == --- wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DatePicker.java (original) +++ wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DatePicker.java Fri Aug 3 12:40:24 2007 @@ -42,11 +42,11 @@ import org.apache.wicket.markup.html.IHeaderResponse; import org.apache.wicket.markup.html.form.AbstractTextComponent.ITextFormatProvider; import org.apache.wicket.markup.html.resources.JavascriptResourceReference; -import org.apache.wicket.model.Model; import org.apache.wicket.util.convert.IConverter; import org.apache.wicket.util.convert.converters.DateConverter; import org.apache.wicket.util.string.Strings; -import org.apache.wicket.util.template.TextTemplateHeaderContributor; +import org.apache.wicket.util.template.PackagedTextTemplate; +import org.apache.wicket.util.template.TextTemplate; import org.joda.time.DateTime; @@ -147,9 +147,6 @@ */ public void renderHead(IHeaderResponse response) { - // TODO do we really need this? without it, Safari won't eat it - response.renderJavascriptReference(new JavascriptResourceReference(YuiLib.class, - "yahoo/yahoo-min.js")); // add YUILoader response.renderJavascriptReference(new JavascriptResourceReference(YuiLib.class, "yuiloader-beta.js")); @@ -218,8 +215,9 @@ variables.put("calendarInit", calendarInit.toString()); // render initialization script with the variables interpolated - TextTemplateHeaderContributor.forJavaScript(DatePicker.class, "DatePicker.js", - Model.valueOf(variables)).renderHead(response); + TextTemplate datePickerJs = new PackagedTextTemplate(DatePicker.class, "DatePicker.js"); + datePickerJs.interpolate(variables); + response.renderOnDomReadyJavascript(datePickerJs.asString()); } /**
[jira] Resolved: (WICKET-811) upgrade YUI to 2.3.0 and use yuiloader facilities
[ https://issues.apache.org/jira/browse/WICKET-811?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Eelco Hillenius resolved WICKET-811. Resolution: Fixed > upgrade YUI to 2.3.0 and use yuiloader facilities > - > > Key: WICKET-811 > URL: https://issues.apache.org/jira/browse/WICKET-811 > Project: Wicket > Issue Type: Task > Components: wicket-datetime >Affects Versions: 1.3.0-beta2 >Reporter: Gerolf Seitz > Fix For: 1.3.0-beta3 > > Attachments: sprite.png, yui2.3.0-upgrade.patch > > > beside the replacement of the actual files, the yuiloader facilities should > be used to resolve dependencies -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[CONF] Apache Wicket: How to display a Flash movie (from a byte array) (page edited)
Page Edited : WICKET : How to display a Flash movie (from a byte array) How to display a Flash movie (from a byte array) has been edited by Apaar Trivedi (Aug 03, 2007). (View changes) Content: Although Wicket does not provide a Flash component right out of the box, it isn't hard at all to make one using some markup and a Resource. Given a byte array representing a Flash movie, all that is required is to be able to stream this back is a resource with the appropriate markup around it. The general idea is that you want to make some class (component) extending WebMarkupComponent and implementing IResourceListener so that it can be displayed as a component and return a flash movie as a resource to the resource stream. When you have such a class made, there are a couple of things to do. One, you must implement onResourceRequested, this will write the flash bytes into the resource stream, and might look something like this: public void onResourceRequested() { getRequestCycle().setRequestTarget(new IRequestTarget() { public void respond(RequestCycle requestCycle) { requestCycle.getResponse()getOutputStream().write(getFlashByteArray()); } }); } You may override onComponentTag to dynamically output the height and width of the Flash movie protected void onComponentTag(ComponentTag tag) { super.onComponentTag(tag); tag.put("width", WIDTH); tag.put("height", HEIGHT; } and finally to ensure that your markup is created correctly to display the Flash, you must override and implement onComponentTagBody as such: protected void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag) { StringBuffer flashBuffer = new StringBuffer(); // in the following, we will append all the necessary body tags of flash markup flashBufferappend("movie\" value=\""); // urlFor will provide the link that will stream the flash byte array flashBuffer.append(urlFor(IResourceListener.INTERFACE)); flashBuffer.append("\"/>"); flashBuffer.append(""); flashBuffer.append(urlFor(IResourceListener.INTERFACE)); flashBuffer.append("\" width=\""); flashBuffer.append(WIDTH); flashBuffer.append("\" height=\""); flashBuffer.append(HEIGHT); flashBuffer.append("' quality=\"high\" name=\"movie\" align=\"middle\" plug inspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\">"); replaceComponentTagBody(markupStream, openTag, flashBody); } That is all that is required of the component to provide the Flash resource, and build the body markup. Finally, you want the actual markup (.html) of whoever adds this component, to look like this: "WICKET_ID_OF_COMPONENT" classid="" class="code-quote">"clsid:D27CDB6E-AE6D-11cf-96B8-44455354" codebase="" class="code-quote">"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="350" height="100" id="movie" align="middle"> And that is basically all that is required to display your flash movie that might be stored as a byte array in a database somewhere! Powered by Atlassian Confluence (Version: 2.2.9 Build:#527 Sep 07, 2006) - Bug/feature request Unsubscribe or edit your notifications preferences
[CONF] Apache Wicket: How to display a Flash movie (from a byte array) (page edited)
Page Edited : WICKET : How to display a Flash movie (from a byte array) How to display a Flash movie (from a byte array) has been edited by Apaar Trivedi (Aug 03, 2007). (View changes) Content: Although Wicket does not provide a Flash component right out of the box, it isn't hard at all to make one using some markup and a Resource. Given a byte array representing a Flash movie, all that is required is to be able to stream this back is a resource with the appropriate markup around it. The general idea is that you want to make some class (component) extending WebMarkupComponent and implementing IResourceListener so that it can be displayed as a component and return a flash movie as a resource to the resource stream. When you have such a class made, there are a couple of things to do. One, you must implement onResourceRequested, this will write the flash bytes into the resource stream, and might look something like this: public void onResourceRequested() { getRequestCycle().setRequestTarget(new IRequestTarget() { public void respond(RequestCycle requestCycle) { requestCycle.getResponse()getOutputStream().write(getFlashByteArray()); } }); } You may override onComponentTag to dynamically output the height and width of the Flash movie protected void onComponentTag(ComponentTag tag) { super.onComponentTag(tag); tag.put("width", WIDTH); tag.put("height", HEIGHT; } and finally to ensure that your markup is created correctly to display the Flash, you must override and implement onComponentTagBody as such: protected void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag) { StringBuffer flashBuffer = new StringBuffer(); // in the following, we will append all the necessary body tags of flash markup flashBufferappend("movie\" value=\""); // urlFor will provide the link that will stream the flash byte array flashBuffer.append(urlFor(IResourceListener.INTERFACE)); flashBuffer.append("\"/>"); flashBuffer.append(""); flashBuffer.append(urlFor(IResourceListener.INTERFACE)); flashBuffer.append("\" width=\""); flashBuffer.append(WIDTH); flashBuffer.append("\" height=\""); flashBuffer.append(HEIGHT); flashBuffer.append("' quality=\"high\" name=\"movie\" align=\"middle\" plug inspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\">"); replaceComponentTagBody(markupStream, openTag, flashBody); } That is all that is required of the component to provide the Flash resource, and build the body markup. Finally, you want the actual markup of whoever adds this component (.html), to look like this: "WICKET_ID_OF_COMPONENT" classid="" class="code-quote">"clsid:D27CDB6E-AE6D-11cf-96B8-44455354" codebase="" class="code-quote">"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="350" height="100" id="movie" align="middle"> And that is basically all that is required to display your flash movie that might be stored as a byte array in a database somewhere! Powered by Atlassian Confluence (Version: 2.2.9 Build:#527 Sep 07, 2006) - Bug/feature request Unsubscribe or edit your notifications preferences
[jira] Commented: (WICKET-811) upgrade YUI to 2.3.0 and use yuiloader facilities
[ https://issues.apache.org/jira/browse/WICKET-811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12517627 ] Gerolf Seitz commented on WICKET-811: - works great, with one minor issue: yahoo-min.js is still loaded from yui.yahooapis.com i'll look into it > upgrade YUI to 2.3.0 and use yuiloader facilities > - > > Key: WICKET-811 > URL: https://issues.apache.org/jira/browse/WICKET-811 > Project: Wicket > Issue Type: Task > Components: wicket-datetime >Affects Versions: 1.3.0-beta2 >Reporter: Gerolf Seitz > Fix For: 1.3.0-beta3 > > Attachments: sprite.png, yui2.3.0-upgrade.patch > > > beside the replacement of the actual files, the yuiloader facilities should > be used to resolve dependencies -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-811) upgrade YUI to 2.3.0 and use yuiloader facilities
[ https://issues.apache.org/jira/browse/WICKET-811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12517629 ] Gerolf Seitz commented on WICKET-811: - got it, and i think we have a little problem here: yahoo-min.js can only be loaded from the same webserver, if YAHOO_config is properly initialized BEFORE yuiloader-beta.js is loaded. i used the following code for initilization: YAHOO_config = { load: { base: 'resources/org.apache.wicket.extensions.yui.YuiLib/' } } since this code has to be loaded before yuiloader-beta.js, this would need to go in a separate file (i named it wicket-loader.js), which would be another dependency, right? well, i'll let you take over from here, if you're ok with that, eelco > upgrade YUI to 2.3.0 and use yuiloader facilities > - > > Key: WICKET-811 > URL: https://issues.apache.org/jira/browse/WICKET-811 > Project: Wicket > Issue Type: Task > Components: wicket-datetime >Affects Versions: 1.3.0-beta2 >Reporter: Gerolf Seitz > Fix For: 1.3.0-beta3 > > Attachments: sprite.png, yui2.3.0-upgrade.patch > > > beside the replacement of the actual files, the yuiloader facilities should > be used to resolve dependencies -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Created: (WICKET-815) add setTemporary(boolean) method to AbstractBehavior class
add setTemporary(boolean) method to AbstractBehavior class -- Key: WICKET-815 URL: https://issues.apache.org/jira/browse/WICKET-815 Project: Wicket Issue Type: Improvement Components: wicket Affects Versions: 1.3.0-beta2, 1.3.0-beta1 Reporter: Sean Sullivan Priority: Minor Currently, org.apache.wicket.behavior.AbstractBehavior does not have a setTemporary(boolean) method. I'd like to see setTemporary(boolean) in this class. It would allow me to do this in my application: AttributeAppender aa = new AttributeAppender("class", new Model(CSS_CLASS_NAME), " "); aa.setTemporary(true); c.add(aa); -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-815) add setTemporary(boolean) method to AbstractBehavior class
[ https://issues.apache.org/jira/browse/WICKET-815?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12517638 ] Eelco Hillenius commented on WICKET-815: The problem with that is that it is more state. And we're using lots of behaviors in pages typically, so it makes enough of a difference to consider. The alternative to this setter is what we have today: just override the behavior and method isTemporary. Imho, this is good enough. > add setTemporary(boolean) method to AbstractBehavior class > -- > > Key: WICKET-815 > URL: https://issues.apache.org/jira/browse/WICKET-815 > Project: Wicket > Issue Type: Improvement > Components: wicket >Affects Versions: 1.3.0-beta1, 1.3.0-beta2 >Reporter: Sean Sullivan >Priority: Minor > > Currently, org.apache.wicket.behavior.AbstractBehavior does not have a > setTemporary(boolean) method. > I'd like to see setTemporary(boolean) in this class. It would allow me to > do this in my application: > AttributeAppender aa = new AttributeAppender("class", new > Model(CSS_CLASS_NAME), " "); > aa.setTemporary(true); > c.add(aa); > -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Closed: (WICKET-815) add setTemporary(boolean) method to AbstractBehavior class
[ https://issues.apache.org/jira/browse/WICKET-815?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Igor Vaynberg closed WICKET-815. Resolution: Won't Fix indeed, we are definetely not going to build this into the core abstract behavior. like eelco said, simply subclass the appended in place, or create your own subclass that has the setter. > add setTemporary(boolean) method to AbstractBehavior class > -- > > Key: WICKET-815 > URL: https://issues.apache.org/jira/browse/WICKET-815 > Project: Wicket > Issue Type: Improvement > Components: wicket >Affects Versions: 1.3.0-beta1, 1.3.0-beta2 >Reporter: Sean Sullivan >Priority: Minor > > Currently, org.apache.wicket.behavior.AbstractBehavior does not have a > setTemporary(boolean) method. > I'd like to see setTemporary(boolean) in this class. It would allow me to > do this in my application: > AttributeAppender aa = new AttributeAppender("class", new > Model(CSS_CLASS_NAME), " "); > aa.setTemporary(true); > c.add(aa); > -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
svn commit: r562605 - in /wicket/trunk/jdk-1.4/wicket-datetime/src: main/java/org/apache/wicket/extensions/yui/assets/skins/sam/ main/java/org/apache/wicket/extensions/yui/calendar/assets/skins/ test/
Author: ehillenius Date: Fri Aug 3 15:21:10 2007 New Revision: 562605 URL: http://svn.apache.org/viewvc?view=rev&rev=562605 Log: cleaned up & fixed license header test Removed: wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/assets/skins/sam/calendar.css wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/assets/skins/ Modified: wicket/trunk/jdk-1.4/wicket-datetime/src/test/java/org/apache/wicket/util/license/ApacheLicenceHeaderTest.java Modified: wicket/trunk/jdk-1.4/wicket-datetime/src/test/java/org/apache/wicket/util/license/ApacheLicenceHeaderTest.java URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket-datetime/src/test/java/org/apache/wicket/util/license/ApacheLicenceHeaderTest.java?view=diff&rev=562605&r1=562604&r2=562605 == --- wicket/trunk/jdk-1.4/wicket-datetime/src/test/java/org/apache/wicket/util/license/ApacheLicenceHeaderTest.java (original) +++ wicket/trunk/jdk-1.4/wicket-datetime/src/test/java/org/apache/wicket/util/license/ApacheLicenceHeaderTest.java Fri Aug 3 15:21:10 2007 @@ -37,16 +37,16 @@ /* * YUI lib. See NOTICE */ - cssIgnore = new String[] { "src/main/java/org/apache/wicket/extensions/yui/calendar/assets/calendar.css" }; + cssIgnore = new String[] { "src/main/java/org/apache/wicket/extensions/yui/calendar/assets/skins/sam/calendar.css" }; /* * YUI lib. See NOTICE */ javaScriptIgnore = new String[] { - "src/main/java/org/apache/wicket/extensions/yui/yahoo.js", - "src/main/java/org/apache/wicket/extensions/yui/event.js", - "src/main/java/org/apache/wicket/extensions/yui/dom.js", - "src/main/java/org/apache/wicket/extensions/yui/calendar/calendar.js", - "src/main/java/org/apache/wicket/extensions/yui/calendar/date.js" }; + "src/main/java/org/apache/wicket/extensions/yui/yuiloader-beta.js", + "src/main/java/org/apache/wicket/extensions/yui/yahoo/yahoo-min.js", + "src/main/java/org/apache/wicket/extensions/yui/event/event-min.js", + "src/main/java/org/apache/wicket/extensions/yui/dom/dom-min.js", + "src/main/java/org/apache/wicket/extensions/yui/calendar/calendar-min.js" }; } }
svn commit: r562607 - in /wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/assets/skins: ./ sam/ sam/calendar.css
Author: ehillenius Date: Fri Aug 3 15:24:57 2007 New Revision: 562607 URL: http://svn.apache.org/viewvc?view=rev&rev=562607 Log: re-added calendar css file Added: wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/assets/skins/ - copied from r562604, wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/assets/skins/ wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/assets/skins/sam/ - copied from r562604, wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/assets/skins/sam/ wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/assets/skins/sam/calendar.css - copied unchanged from r562604, wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/assets/skins/sam/calendar.css
[jira] Commented: (WICKET-811) upgrade YUI to 2.3.0 and use yuiloader facilities
[ https://issues.apache.org/jira/browse/WICKET-811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12517659 ] Eelco Hillenius commented on WICKET-811: I added that configuration line (as an option) and sent an email to the YUI list (http://tech.groups.yahoo.com/group/ydn-javascript/message/16209) in case they have a good suggestion we overlooked. > upgrade YUI to 2.3.0 and use yuiloader facilities > - > > Key: WICKET-811 > URL: https://issues.apache.org/jira/browse/WICKET-811 > Project: Wicket > Issue Type: Task > Components: wicket-datetime >Affects Versions: 1.3.0-beta2 >Reporter: Gerolf Seitz > Fix For: 1.3.0-beta3 > > Attachments: sprite.png, yui2.3.0-upgrade.patch > > > beside the replacement of the actual files, the yuiloader facilities should > be used to resolve dependencies -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
svn commit: r562614 - in /wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui: YuiLib.java calendar/DatePicker.java
Author: ehillenius Date: Fri Aug 3 16:29:06 2007 New Revision: 562614 URL: http://svn.apache.org/viewvc?view=rev&rev=562614 Log: bootstrap loading the YUI deps Modified: wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/YuiLib.java wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DatePicker.java Modified: wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/YuiLib.java URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/YuiLib.java?view=diff&rev=562614&r1=562613&r2=562614 == --- wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/YuiLib.java (original) +++ wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/YuiLib.java Fri Aug 3 16:29:06 2007 @@ -17,15 +17,40 @@ package org.apache.wicket.extensions.yui; import org.apache.wicket.IClusterable; +import org.apache.wicket.markup.html.IHeaderResponse; +import org.apache.wicket.markup.html.resources.JavascriptResourceReference; /** - * Just a trick to serve as a reference for YUI includes. + * Use the [EMAIL PROTECTED] #load(IHeaderResponse, boolean)} method to initialize the YUI + * library using the YUI loader. It is OK to call this multiple times. * * @author eelcohillenius */ public final class YuiLib implements IClusterable { private static final long serialVersionUID = 1L; + + /** +* Load the YUI loader script. After that, you can declare YUI dependencies +* using YAHOO.util.YUILoader. +* +* @param response +*header response +* @param configureBasePath +*whether to globally configure YUI's base path to be relative +*to this directory +*/ + // TODO see http://tech.groups.yahoo.com/group/ydn-javascript/message/16209 + public static void load(IHeaderResponse response, boolean configureBasePath) + { + if (configureBasePath) + { + response.renderJavascript("YAHOO_config = { load: { base: 'resources/" + + YuiLib.class.getName() + "/'} } ", "YAHOO_config"); + } + response.renderJavascriptReference(new JavascriptResourceReference(YuiLib.class, + "yuiloader-beta.js")); + } /** * Prevent construction. Modified: wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DatePicker.java URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DatePicker.java?view=diff&rev=562614&r1=562613&r2=562614 == --- wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DatePicker.java (original) +++ wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DatePicker.java Fri Aug 3 16:29:06 2007 @@ -147,9 +147,7 @@ */ public void renderHead(IHeaderResponse response) { - // add YUILoader - response.renderJavascriptReference(new JavascriptResourceReference(YuiLib.class, - "yuiloader-beta.js")); + YuiLib.load(response, getConfigureYUIBasePath()); // variables for the initialization script Map variables = new HashMap(); @@ -353,7 +351,6 @@ return (String[])l.toArray(new String[l.size()]); } - /** * Gets the id of the component that the calendar widget will get attached * to. @@ -363,6 +360,17 @@ protected final String getComponentMarkupId() { return component.getMarkupId(); + } + + + /** +* @return if true, the base path for all YUI components will be set to +* /resources/org.apache.wicket.extensions.yui.YuiLib/. True by +* default. +*/ + protected boolean getConfigureYUIBasePath() + { + return true; } /**
svn commit: r562619 - /wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/assets/skins/sam/calendar-skin.css
Author: ehillenius Date: Fri Aug 3 16:53:35 2007 New Revision: 562619 URL: http://svn.apache.org/viewvc?view=rev&rev=562619 Log: removed unused css file Removed: wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/assets/skins/sam/calendar-skin.css
svn commit: r562630 - in /wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui: YuiLib.java calendar/DatePicker.java
Author: ehillenius Date: Fri Aug 3 17:31:25 2007 New Revision: 562630 URL: http://svn.apache.org/viewvc?view=rev&rev=562630 Log: it is better to just include the yahoo-min.js dependency directly instead of setting the global base dir for YUI (which could interfere with users trying to use the YUI loader for their own purposes). Modified: wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/YuiLib.java wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DatePicker.java Modified: wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/YuiLib.java URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/YuiLib.java?view=diff&rev=562630&r1=562629&r2=562630 == --- wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/YuiLib.java (original) +++ wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/YuiLib.java Fri Aug 3 17:31:25 2007 @@ -36,18 +36,12 @@ * * @param response *header response -* @param configureBasePath -*whether to globally configure YUI's base path to be relative -*to this directory */ // TODO see http://tech.groups.yahoo.com/group/ydn-javascript/message/16209 - public static void load(IHeaderResponse response, boolean configureBasePath) + public static void load(IHeaderResponse response) { - if (configureBasePath) - { - response.renderJavascript("YAHOO_config = { load: { base: 'resources/" - + YuiLib.class.getName() + "/'} } ", "YAHOO_config"); - } + response.renderJavascriptReference(new JavascriptResourceReference(YuiLib.class, + "yahoo/yahoo-min.js")); response.renderJavascriptReference(new JavascriptResourceReference(YuiLib.class, "yuiloader-beta.js")); } Modified: wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DatePicker.java URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DatePicker.java?view=diff&rev=562630&r1=562629&r2=562630 == --- wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DatePicker.java (original) +++ wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DatePicker.java Fri Aug 3 17:31:25 2007 @@ -147,7 +147,7 @@ */ public void renderHead(IHeaderResponse response) { - YuiLib.load(response, getConfigureYUIBasePath()); + YuiLib.load(response); // variables for the initialization script Map variables = new HashMap();
[jira] Created: (WICKET-816) Component#getLocale and Component#getVariation should search their parents
Component#getLocale and Component#getVariation should search their parents -- Key: WICKET-816 URL: https://issues.apache.org/jira/browse/WICKET-816 Project: Wicket Issue Type: Bug Components: wicket Affects Versions: 1.3.0-beta2 Reporter: Eelco Hillenius Assignee: Eelco Hillenius Fix For: 1.3.0-beta3 Currently an override of either Component#getLocale or Component#getVariant only works for that specific component. I think the correct thing would be that if a component overrides any of these methods, all it's childs should automatically inherit that value. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
svn commit: r562633 - /wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Component.java
Author: ehillenius Date: Fri Aug 3 17:53:38 2007 New Revision: 562633 URL: http://svn.apache.org/viewvc?view=rev&rev=562633 Log: format + result save action from Eclipse (which seems to be configured by default for wicket now). Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Component.java Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Component.java URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Component.java?view=diff&rev=562633&r1=562632&r2=562633 == --- wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Component.java (original) +++ wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Component.java Fri Aug 3 17:53:38 2007 @@ -258,7 +258,7 @@ */ public void undo() { - setModel(this.model); + setModel(model); } } @@ -412,7 +412,7 @@ EnabledChange(final Component component) { this.component = component; - this.enabled = component.getFlag(FLAG_ENABLED); + enabled = component.getFlag(FLAG_ENABLED); } /** @@ -453,7 +453,7 @@ VisibilityChange(final Component component) { this.component = component; - this.visible = component.getFlag(FLAG_VISIBLE); + visible = component.getFlag(FLAG_VISIBLE); } /** @@ -652,13 +652,6 @@ protected static final int FLAG_RESERVED8 = 0x8; /** -* Flag that makes we are in before-render callback phase Set after -* component.onBeforeRender is invoked (right before invoking beforeRender -* on children) -*/ - static final int FLAG_PREPARED_FOR_RENDER = 0x400; - - /** * Meta data key for line precise error logging for the moment of addition. * Made package private for access in [EMAIL PROTECTED] MarkupContainer} and * [EMAIL PROTECTED] Page} @@ -677,13 +670,20 @@ private static final long serialVersionUID = 1L; }; - static final int FLAG_ATTACH_SUPER_CALL_VERIFIED = 0x1000; + static final int FLAG_ATTACHED = 0x2000; static final int FLAG_ATTACHING = 0x4000; + /** +* Flag that makes we are in before-render callback phase Set after +* component.onBeforeRender is invoked (right before invoking beforeRender +* on children) +*/ + static final int FLAG_PREPARED_FOR_RENDER = 0x400; + /** List of behaviors to be applied for this Component */ private ArrayList behaviors = null; @@ -864,36 +864,6 @@ } /** -* Prepares the component and it's children for rendering. On whole page -* render this method must be called on the page. On AJAX request, this -* method must be called on updated component. -*/ - public void prepareForRender() - { - beforeRender(); - markRendering(); - } - - /** -* Sets the RENDERING flag on component and it's children. -*/ - public final void markRendering() - { - internalMarkRendering(); - } - - boolean isPreparedForRender() - { - return getFlag(FLAG_PREPARED_FOR_RENDER); - } - - void internalMarkRendering() - { - setFlag(FLAG_PREPARED_FOR_RENDER, false); - setFlag(FLAG_RENDERING, true); - } - - /** * Redirects to any intercept page previously specified by a call to * redirectToInterceptPage. * @@ -1216,14 +1186,6 @@ attrs.makeImmutable(); return attrs; } - - /** -* @return Component's markup stream -*/ - protected MarkupStream locateMarkupStream() - { - return new MarkupFragmentFinder().find(this); - } /** * Retrieves id by which this component is represented within the markup. @@ -1280,33 +1242,6 @@ } /** -* Sets this component's markup id to a user defined value. It is up to the -* user to ensure this value is unique. -* -* The recommended way is to let wicket generate the value automatically, -* this method is here to serve as an override for that value in cases where -* a specific id must be used. -* -* If null is passed in the user defined value is cleared and markup id -* value will fall back on automatically generated value -* -* @see #getMarkupId() -* -* @par
[jira] Updated: (WICKET-816) Component#getLocale and Component#getVariation should search their parents
[ https://issues.apache.org/jira/browse/WICKET-816?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Eelco Hillenius updated WICKET-816: --- Attachment: WICKET-816.patch If no-one objects, this would be the patch for this issue. > Component#getLocale and Component#getVariation should search their parents > -- > > Key: WICKET-816 > URL: https://issues.apache.org/jira/browse/WICKET-816 > Project: Wicket > Issue Type: Bug > Components: wicket >Affects Versions: 1.3.0-beta2 >Reporter: Eelco Hillenius >Assignee: Eelco Hillenius > Fix For: 1.3.0-beta3 > > Attachments: WICKET-816.patch > > > Currently an override of either Component#getLocale or Component#getVariant > only works for that specific component. I think the correct thing would be > that if a component overrides any of these methods, all it's childs should > automatically inherit that value. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
svn commit: r562638 - /wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Component.java
Author: ehillenius Date: Fri Aug 3 18:20:13 2007 New Revision: 562638 URL: http://svn.apache.org/viewvc?view=rev&rev=562638 Log: WICKET-816 Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Component.java Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Component.java URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Component.java?view=diff&rev=562638&r1=562637&r2=562638 == --- wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Component.java (original) +++ wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Component.java Fri Aug 3 18:20:13 2007 @@ -1144,14 +1144,21 @@ } /** -* Gets the locale for the session holding this component. +* Gets the locale for this component. By default, it searches it parent for +* a locale. If no parents (it's a recursive search) returns a locale, it +* gets one from the session. * -* @return The locale for the session holding this component -* @see Component#getSession() +* @return The locale to be used for this component +* @see Session#getLocale() */ public Locale getLocale() { - return getSession().getLocale(); + Locale locale = null; + if (parent != null) + { + locale = parent.getLocale(); + } + return (locale != null) ? locale : getSession().getLocale(); } /** @@ -1555,13 +1562,18 @@ * Gets the variation string of this component that will be used to look up * markup for this component. Subclasses can override this method to define * by an instance what markup variation should be picked up. By default it -* will return null. +* will return null or the value of a parent. * * @return The variation of this component. */ public String getVariation() { - return null; + String variation = null; + if (parent != null) + { + variation = parent.getVariation(); + } + return variation; } /**
svn commit: r562641 - in /wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/datetime: DateConverter.java PatternDateConverter.java StyleDateConverter.java markup/html/basic/DateLabe
Author: ehillenius Date: Fri Aug 3 18:24:50 2007 New Revision: 562641 URL: http://svn.apache.org/viewvc?view=rev&rev=562641 Log: WICKET-817 Modified: wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/datetime/DateConverter.java wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/datetime/PatternDateConverter.java wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/datetime/StyleDateConverter.java wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/datetime/markup/html/basic/DateLabel.java wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/datetime/markup/html/form/DateTextField.java Modified: wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/datetime/DateConverter.java URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/datetime/DateConverter.java?view=diff&rev=562641&r1=562640&r2=562641 == --- wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/datetime/DateConverter.java (original) +++ wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/datetime/DateConverter.java Fri Aug 3 18:24:50 2007 @@ -21,6 +21,7 @@ import java.util.Locale; import java.util.TimeZone; +import org.apache.wicket.Component; import org.apache.wicket.Session; import org.apache.wicket.protocol.http.request.WebClientInfo; import org.apache.wicket.request.ClientInfo; @@ -52,6 +53,11 @@ private final boolean applyTimeZoneDifference; /** +* Optional component to use for determining the locale. +*/ + private Component component = null; + + /** * Construct. * * When applyTimeZoneDifference is true, the current time is applied on the @@ -73,6 +79,18 @@ } /** +* Gets the locale to use. +* +* @return the locale from either the component if that is set, or from the +* session +*/ + protected Locale getLocale() + { + Component c = getComponent(); + return (c != null) ? c.getLocale() : Session.get().getLocale(); + } + + /** * @see org.apache.wicket.util.convert.IConverter#convertToObject(java.lang.String, * java.util.Locale) */ @@ -208,5 +226,24 @@ protected DateTimeZone getTimeZone() { return DateTimeZone.getDefault(); + } + + /** +* @return optional component to use for determining the locale. +*/ + public final Component getComponent() + { + return component; + } + + /** +* Sets component for getting the locale +* +* @param component +*optional component to use for determining the locale. +*/ + public final void setComponent(Component component) + { + this.component = component; } } Modified: wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/datetime/PatternDateConverter.java URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/datetime/PatternDateConverter.java?view=diff&rev=562641&r1=562640&r2=562641 == --- wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/datetime/PatternDateConverter.java (original) +++ wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/datetime/PatternDateConverter.java Fri Aug 3 18:24:50 2007 @@ -18,7 +18,6 @@ import java.text.SimpleDateFormat; -import org.apache.wicket.Session; import org.apache.wicket.datetime.markup.html.form.DateTextField; import org.joda.time.DateTime; import org.joda.time.DateTimeZone; @@ -99,7 +98,6 @@ */ protected DateTimeFormatter getFormat() { - return DateTimeFormat.forPattern(datePattern).withLocale(Session.get().getLocale()) - .withPivotYear(2000); + return DateTimeFormat.forPattern(datePattern).withLocale(getLocale()).withPivotYear(2000); } } Modified: wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/datetime/StyleDateConverter.java URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/datetime/StyleDateConverter.java?view=diff&rev=562641&r1=562640&r2=562641 == --- wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/datetime/StyleDateConverter.java (original) +++ wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/datetime/StyleDateConverter.java Fri Aug 3 18:24:50 2007 @@ -16,7 +16,6 @@ */ package org.apache.w
[jira] Resolved: (WICKET-817) date converters should try to use any components they are coupled to get the locale
[ https://issues.apache.org/jira/browse/WICKET-817?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Eelco Hillenius resolved WICKET-817. Resolution: Fixed > date converters should try to use any components they are coupled to get the > locale > --- > > Key: WICKET-817 > URL: https://issues.apache.org/jira/browse/WICKET-817 > Project: Wicket > Issue Type: Improvement > Components: wicket-datetime >Affects Versions: 1.3.0-beta2 >Reporter: Eelco Hillenius >Assignee: Eelco Hillenius > Fix For: 1.3.0-beta3 > > > Date converters should try to use any components they are coupled to get the > locale. Without this, the dates example doesn't use the appropriate date > patterns. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Created: (WICKET-817) date converters should try to use any components they are coupled to get the locale
date converters should try to use any components they are coupled to get the locale --- Key: WICKET-817 URL: https://issues.apache.org/jira/browse/WICKET-817 Project: Wicket Issue Type: Improvement Components: wicket-datetime Affects Versions: 1.3.0-beta2 Reporter: Eelco Hillenius Assignee: Eelco Hillenius Fix For: 1.3.0-beta3 Date converters should try to use any components they are coupled to get the locale. Without this, the dates example doesn't use the appropriate date patterns. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Resolved: (WICKET-816) Component#getLocale and Component#getVariation should search their parents
[ https://issues.apache.org/jira/browse/WICKET-816?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Eelco Hillenius resolved WICKET-816. Resolution: Fixed > Component#getLocale and Component#getVariation should search their parents > -- > > Key: WICKET-816 > URL: https://issues.apache.org/jira/browse/WICKET-816 > Project: Wicket > Issue Type: Bug > Components: wicket >Affects Versions: 1.3.0-beta2 >Reporter: Eelco Hillenius >Assignee: Eelco Hillenius > Fix For: 1.3.0-beta3 > > Attachments: WICKET-816.patch > > > Currently an override of either Component#getLocale or Component#getVariant > only works for that specific component. I think the correct thing would be > that if a component overrides any of these methods, all it's childs should > automatically inherit that value. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Created: (WICKET-818) document 'criteria' parameter in IAutoCompleteRenderer
document 'criteria' parameter in IAutoCompleteRenderer -- Key: WICKET-818 URL: https://issues.apache.org/jira/browse/WICKET-818 Project: Wicket Issue Type: Improvement Components: wicket-extensions Affects Versions: 1.3.0-beta2, 1.3.0-beta1 Reporter: Sean Sullivan Priority: Minor Interface: org.apache.wicket.extensions.ajax.markup.html.autocomplete.IAutoCompleteRenderer Method: void render(Object object, Response response, String criteria) The 'criteria' parameter is not documented.I have no idea what this parameter does. Can you add some javadocs? -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Updated: (WICKET-818) add documentation for 'criteria' parameter in IAutoCompleteRenderer
[ https://issues.apache.org/jira/browse/WICKET-818?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Sean Sullivan updated WICKET-818: - Summary: add documentation for 'criteria' parameter in IAutoCompleteRenderer (was: document 'criteria' parameter in IAutoCompleteRenderer) > add documentation for 'criteria' parameter in IAutoCompleteRenderer > --- > > Key: WICKET-818 > URL: https://issues.apache.org/jira/browse/WICKET-818 > Project: Wicket > Issue Type: Improvement > Components: wicket-extensions >Affects Versions: 1.3.0-beta1, 1.3.0-beta2 >Reporter: Sean Sullivan >Priority: Minor > > Interface: > org.apache.wicket.extensions.ajax.markup.html.autocomplete.IAutoCompleteRenderer > Method: void render(Object object, Response response, String criteria) > The 'criteria' parameter is not documented.I have no idea what this > parameter does. > Can you add some javadocs? -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.