[Wicket-user] Pethate - long urls

2005-12-03 Thread Mark Derricutt
Hey all, so I'm starting to play with Wicket and loving it, but I currently have a small pethate with the URL scheme used in the application.I realize the look of the URL shouldn't really matter, but I keep finding myself disliking it.
Currently my app shows a URL like: http://localhost:8081/quickstart/app?bookmarkablePage=com.theoryinpractice.testapp.pages.CommentsPage
Is there a way to get the app to resolve the above using something like: http://localhost:8081/quickstart/app/page/Podcomments
or even http://localhost:8081/quickstart/app?page=Podcomments
I guess it could be possible to say 'register' the package com.theoryinpractice.testapp.pages as a place where pages could be found and resolve the class to use instead of using the FQN all the time, this would only work in the case of unambiguous classes thou.
Or maybe theres something already in wicket for more REST like URL schemes? I notice in the basic framework there's only a BookmarkablePage extension of Page, is there something in wicket-stuff maybe?


Re: [Wicket-user] Pethate - long urls

2005-12-03 Thread Igor Vaynberg
Hi Mark,

if you are using wicket1.1 then your only choice is pretty much to use
a url rewriting filter to dress up the url. this is pretty easy to do.
there is a good filter here: http://tuckey.org/urlrewrite/

you can also add an alias to your page so it uses that in the url instead of fqn. but this is no longer supported in 1.2

if you are using wicket1.2 you have a lot more flexibility when it
comes to urls. we provide a mounting mechanism that allows you to
mount a bookmarkable page along with its parameters on a url of your
choice.

For example if you have a bookmarkable page B that takes pageparameters
contaning P1=V1 and P2=V2 and you mount it on path /page it will be
accissible through server/context/app/page/P1/V1/P2/V2

you can control how the parameter encoding happens by providing your
own implementation of IPageParametersEncoder if the above (default so
far) doesnt work for you. for examples on how to set the above up
please see the cvs HEAD of wicket-examples - niceurls.

-Igor
On 12/3/05, Mark Derricutt [EMAIL PROTECTED] wrote:
Hey all, so I'm starting to play with Wicket and loving it, but I
currently have a small pethate with the URL scheme used in the
application.I realize the look of the URL shouldn't really matter, but I keep finding myself disliking it.
Currently my app shows a URL like: 
http://localhost:8081/quickstart/app?bookmarkablePage=com.theoryinpractice.testapp.pages.CommentsPage
Is there a way to get the app to resolve the above using something like: 
http://localhost:8081/quickstart/app/page/Podcomments
or even http://localhost:8081/quickstart/app?page=Podcomments
I guess it could be possible to say 'register' the package com.theoryinpractice.testapp.pages
as a place where pages could be found and resolve the class to use
instead of using the FQN all the time, this would only work in the case
of unambiguous classes thou.
Or maybe theres something already in wicket for more REST like
URL schemes? I notice in the basic framework there's only a
BookmarkablePage extension of Page, is there something in wicket-stuff
maybe?




Re: [Wicket-user] Pethate - long urls

2005-12-03 Thread Mark Derricutt
Igor, cool - looks like that mounting option would suffice :) I just pulled out HEAD but see it uses Maven to build so I'm just gonna go install that.I assume any additional parameters passed via the traditional ?foo=barbar=foo scheme will be added to the PageParameters instance as well?
MarkOn 12/3/05, Igor Vaynberg [EMAIL PROTECTED] wrote:
set the above up
please see the cvs HEAD of wicket-examples - niceurls.



Re: [Wicket-user] Pethate - long urls

2005-12-03 Thread Eelco Hillenius
Hi, answers below


 http://localhost:8081/quickstart/app?bookmarkablePage=com.theoryinpractice.testapp.pages.CommentsPage

 Is there a way to get the app to resolve the above using something like:

   http://localhost:8081/quickstart/app/page/Podcomments

  or even

   http://localhost:8081/quickstart/app?page=Podcomments


Yep there is, but I just killed it in HEAD to do some rethinking. You
could register aliases for classes which would then be used (so
support for the second case).

The rethinking is:
- is this for pages only, or is it more general (answer is yes,
because we want to use this for packaged resources too).
- do we want the class/ alias mapping, or do we want to support other
cases like the packages you suggest.
- how are we going to name it

But it'll be in there again shortly when we have answers to those
questions... probably this week. I think in 1.1 it is called pageAlias
in Application somewhere. One of the examples uses it.

You first approach is supported in the HEAD version now.

 Or maybe theres something already in wicket for more REST like URL schemes?
 I notice in the basic framework there's only a BookmarkablePage extension of
 Page, is there something in wicket-stuff maybe?


You mean REST like encode everything that has to do with state in your
url? Well, yes and no. In head we provide the option of 'mounting'
paths to bookmarkable pages (or actually in at a lower level, you
could mount any request target you want). The example we are working
on that shows this is wicket.examples.niceurl in the wicket-examples
project, and it lets you use Wicket with URLs like

http://localhost:8080/wicket-examples/niceurl/path/to/page2/param1/value1/param2/value2

where path/to/page2 is the mount, and param1 and param2 are the page parameters.

Currently, I am also working on abstracting the session even more and
trying to defer creating an actual httpsession object (the default
store for Wicket WebApplications) until it is absolutely needed.

The interesting thing here is that as long as you have a bookmarkable
page with nothing on it that points back to that page, there shouldn't
be a need to put it in the session. So, if I pull this off, it means
that you can create completely stateless applications. Of course that
won't help you with creating the kind of applications Wicket was
targetted for in the first place, but it is a nice optimization and
extra usuability I think.

I you /do/ have call backs like forms etc, we need to store that page
in the session - at least temporarily - in order to call the
approariate methods on the target components. In that case, you
application is not REST. And personally I don't agree with the REST
thing for web applications anyway (and I'm in the web CBD/
Continuations camp for that matter), as the original concept of REST
works fine for document centric view of the web (you know, the way it
all started) and can even work for web apps that have a very direct
1-1 relationship with requests (i.e. they are relatively simple), but
not for the kind of applications that people expect to work nowadays.
And the guys from the web mvc camp... they are not exactly following
the REST approach as it was intended either. Anway, big sidestep... I
am getting almost emotional about defending against REST and
stateless-ness as it seems to be a pavlov reaction for people to think
that that is the only way to do your web applications :)

Eelco


---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37alloc_id865op=click
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Pethate - long urls

2005-12-03 Thread Igor Vaynberg
no, the additional parameters will not be added, in fact it will
probably cause an exception. this is because the part of the url after
the mount is processed by the page parameters encoder that is expecting
format (/param-name/param-value)*

its pretty easy to create an encoder that will process regular url
formatted parameters. maybe that is a better default eventhough it is
not as crawler friendly as the other one. you can also change your own
implementation to the default by calling
applicationsettings.setpageparametersencoder.

hmm, having a parameters encoder that prepends the params with a .html
can be interesting. then your mounted pages can look like
/app/page.html?param=value kinda funny

-Igor
On 12/3/05, Mark Derricutt [EMAIL PROTECTED] wrote:
Igor, cool - looks like that mounting option would suffice :) I
just pulled out HEAD but see it uses Maven to build so I'm just gonna
go install that.I assume any additional parameters passed via
the traditional ?foo=barbar=foo scheme will be added to the
PageParameters instance as well?
MarkOn 12/3/05, Igor Vaynberg 
[EMAIL PROTECTED] wrote:
set the above up
please see the cvs HEAD of wicket-examples - niceurls.





Re: [Wicket-user] Pethate - long urls

2005-12-03 Thread Igor Vaynberg
oh and btw you can specify a page parameters encoder on per mount basis as well.
-Igor
On 12/3/05, Igor Vaynberg [EMAIL PROTECTED] wrote:
no, the additional parameters will not be added, in fact it will
probably cause an exception. this is because the part of the url after
the mount is processed by the page parameters encoder that is expecting
format (/param-name/param-value)*

its pretty easy to create an encoder that will process regular url
formatted parameters. maybe that is a better default eventhough it is
not as crawler friendly as the other one. you can also change your own
implementation to the default by calling
applicationsettings.setpageparametersencoder.

hmm, having a parameters encoder that prepends the params with a .html
can be interesting. then your mounted pages can look like
/app/page.html?param=value kinda funny

-Igor
On 12/3/05, Mark Derricutt 
[EMAIL PROTECTED] wrote:
Igor, cool - looks like that mounting option would suffice :) I
just pulled out HEAD but see it uses Maven to build so I'm just gonna
go install that.I assume any additional parameters passed via
the traditional ?foo=barbar=foo scheme will be added to the
PageParameters instance as well?
MarkOn 12/3/05, Igor Vaynberg 

[EMAIL PROTECTED] wrote:
set the above up
please see the cvs HEAD of wicket-examples - niceurls.







Re: [Wicket-user] Pethate - long urls

2005-12-03 Thread Mark Derricutt
I was about to ask that actually :)On 12/3/05, Igor Vaynberg [EMAIL PROTECTED] wrote:
oh and btw you can specify a page parameters encoder on per mount basis as well.



Re: [Wicket-user] Adding Support for optgroup

2005-12-03 Thread Johan Compagner
still the same problem then i am affraid.I have to control the visibilty if toat selectoption depending on what the model object is of the Select itself. (null or something)On 12/3/05, 
Igor Vaynberg [EMAIL PROTECTED] wrote:
but a SelectOption is not in your collection - its a component. The whole point of the Select component is to have full control over the markup. All our core choice elements limit your access to markup by producing the entire select output for you including all the options. The point of Select/SelectOption is to have total control.
So for the previous example you cao do something like this:Collection smallCars=getSmallCars();Collection bigCars=getBigCars();IOptionRenderer carRenderer=new IOptionRenderer() {...}Select carSelect=new Select(carSelect).add(
RequiredValidator.getInstance());carSelect.add(new SelectOption(none, new Model(/*NULL*/));carSelect.add(new SelectOptions(small, smallCars, carRenderer));carSelect.add(new SelectOptions(big, bigCars, carRenderer));
and then in markupselect wicket:id=carSelectoption wicket:id=nonePlease Select One/optionoptgroup label=small cars span wicket:id=small/span
/optgroupoptgroup label=big cars span wicket:id=big/span/optgroup/selectpersonally i dont see what the point of select one is if a choice is required. easier to just not add one and let the box default to the first choice. sure it requires more attention on the part of the user - but thats what confirmation pages are for :)
-Igor
On 12/2/05, Johan Compagner [EMAIL PROTECTED]
 wrote:
yes then it is exactly what i say.for Choose one.. you shouldn't have to need a SelectChoice == option element in youre collectionBecause Choose one should only be there if nothing is selected and null value isn't allowed...
johanOn 12/2/05, Igor Vaynberg 

[EMAIL PROTECTED] wrote:
no, SelectChoice is a component that represents a single option element. you add that to the Select component. SelectChoices is a convinience component that draws out a bunch of option tags much like our current components.
-IgorOn 12/2/05, Johan Compagner 


[EMAIL PROTECTED] wrote:
That selectchoice is a thing you have to add to the collection of choices?then that is not that nice. Because choose one should only be there if no one is selected and null is required (or something like that)Because of that you can't add it easily to the collection because you have to know that you want to add it or not...
I like the getDefaultValue() or what is that method called of DropDown..johanOn 12/2/05, 
Igor Vaynberg 
[EMAIL PROTECTED] wrote:just checked in a fix. also the Select element does not add a choose one choice for you, you have to do it yourself by adding a SelectChoice that represents that element.
-Igor
On 12/2/05, Davide Savazzi [EMAIL PROTECTED] wrote:

On 11/30/05, Igor Vaynberg [EMAIL PROTECTED] wrote: any feedback on this yet? if not, i guess i will polish it with its current
 feature set and that will be that.
I have a Map that contains List of choices, my code is:Map choicesMap = getChoicesMap();Select select = new Select(mySelect, new PropertyModel(myModel,propertyName));IOptionRenderer renderer = new IOptionRenderer() {
public String getDisplayValue(Object selection) {return ((Selection) selection).getName();}public IModel getModel(Object selection) {return new Model(new Integer(((Selection) selection).getId()));
}};select.add(new SelectOptions(group1, new Model((Serializable)choicesMap.get(group1)), renderer));select.add(new SelectOptions(group2, new Model((Serializable)





choicesMap.get(group2)), renderer));When myModel.getPropertyName() is null I get a WicketException:09:50:07,679 ERROR [RequestCycle] Select[3:step1Form:section4Border:mySelect] contains a null model object,
must be an object of type java.lang.Object or java.util.Collection (in case of multi-valued select element)In other dropdown menu when model is null there is a entry like'Choose one', they don't throw an exception!
Am I using your extension correctly?Cheers,--Davide Savazzi---This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?Stop!Download the new AJAX search engine that makessearching your log files as easy as surfing theweb.DOWNLOAD SPLUNK!




http://ads.osdn.com/?ad_idv37alloc_id865opclick
___Wicket-user mailing listWicket-user@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/wicket-user












Re: [Wicket-user] Anonymous subclasses of Model: bad or not? Page versioning?

2005-12-03 Thread Christian Essl
On Fri, 2 Dec 2005 22:51:05 +0100, Johan Compagner [EMAIL PROTECTED] 
wrote:



Maybe we should build something that it is easier for models to version
themselfs. Like an interface IVersionable with a method Serializeable
getVersionData()
Which a model can implement. And then we don't store the complete model 
but

only that data.


If I understand right than a IModel which does not implement IVersionable 
does not get stored in the version history? I think this would be good, 
because the current situation is confusing.


Concerning DataView I'd say that when a the IDataProvider is given 
directly in the constructor. It should not be stored as the model of 
DataView but kept in an instancefield, because in nearly all cases it will 
be a pull-model. If you need versioning than you can always wrap it in a 
model.


Christian



johan


On 12/2/05, Nathan Hamblen [EMAIL PROTECTED] wrote:


This came up before when I was trying to track down why reversing the
sort order of a DataView was bringing down my test application.
(http://thread.gmane.org/gmane.comp.java.wicket.user/4309) It turned out
that the page versioning code was serializing the entire view hierarchy,
recursively, because of anonymous model classes that contained pointers
back into the view.

The consensus was that you would have to turn off page versioning if you
wanted an anonymous IModel. Is this still the case? I'm just now
noticing anonymous IModels becoming sort of recommended. Does that mean
than page versioning is not recommended anymore?

I'll admit don't even understand how versioning is supposed to work.
DataView sorting seems to be one of the few things that triggers it.
I've got forms updating models all over the place and nary a version to
be seen. So, I just turn it OFF then, and anonymously subclass IModel to
my heart's content?

Nathan

Christian Essl wrote:
 On Thu, 1 Dec 2005 14:24:20 -0500, Andrew Berman [EMAIL PROTECTED]
 wrote:

 Honestly, I don't think there ever was a Spring Integration 
problem.  I

 think people were just looking for a cookie-cutter approach to using
 Spring
 within Wicket.  It's actually quite easy to do without using any of 
the

 Spring stuff that Igor and others wrote, but it's always a good thing
to
 have a common approach that everyone can follow.

 Honestly, I think Igor did a good job: It is just easier and more
 natural to write over and over again:

 new HibernateModel(obj,_dao);

 than

 new HibernateModel(obj, new Model(){
getObject(Component comp){
   return ((MyApplication)Appliation.get()).getDAO();
}
 });

 and this is not restricted to HibernateDAOs but to any bean you do not
 want to get serialized whtih your components.

 Christian






 ___ Gesendet 
von

 Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden:
 http://mail.yahoo.de



 ---
 This SF.net email is sponsored by: Splunk Inc. Do you grep through log
 files
 for problems?  Stop!  Download the new AJAX search engine that makes
 searching your log files as easy as surfing the  web.  DOWNLOAD 
SPLUNK!

 http://ads.osdn.com/?ad_id=7637alloc_id=16865op=click



---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log
files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637alloc_id=16865op=click
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user





--
Christian Essl 






___ 
Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de




---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637alloc_id=16865op=click
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Pethate - long urls

2005-12-03 Thread Johan Compagner
So pages with only bookmarkable links (and no other links) and no forms are not stored in the session?could be nice yes.Another thing i think of is having SingletonPage in the session. So that a bookmarkable link always goes to the same
page if there is already one there in the page mape (stored with the mount url instead of path=x)Then every other kind of link or form can generate the mount url als there url where the do there get/post request to.
Then the url stays the same even if you click on a link or submit a form.Of course users have to give is a hint that that page can be used that way (because this is not possible/wanted in all cases)with a marker interface or something.
johanOn 12/3/05, Eelco Hillenius [EMAIL PROTECTED] wrote:
Hi, answers below http://localhost:8081/quickstart/app?bookmarkablePage=com.theoryinpractice.testapp.pages.CommentsPage
 Is there a way to get the app to resolve the above using something like: http://localhost:8081/quickstart/app/page/Podcomments
or even http://localhost:8081/quickstart/app?page=PodcommentsYep there is, but I just killed it in HEAD to do some rethinking. You
could register aliases for classes which would then be used (sosupport for the second case).The rethinking is:- is this for pages only, or is it more general (answer is yes,because we want to use this for packaged resources too).
- do we want the class/ alias mapping, or do we want to support othercases like the packages you suggest.- how are we going to name itBut it'll be in there again shortly when we have answers to those
questions... probably this week. I think in 1.1 it is called pageAliasin Application somewhere. One of the examples uses it.You first approach is supported in the HEAD version now. Or maybe theres something already in wicket for more REST like URL schemes?
 I notice in the basic framework there's only a BookmarkablePage extension of Page, is there something in wicket-stuff maybe?You mean REST like encode everything that has to do with state in your
url? Well, yes and no. In head we provide the option of 'mounting'paths to bookmarkable pages (or actually in at a lower level, youcould mount any request target you want). The example we are workingon that shows this is 
wicket.examples.niceurl in the wicket-examplesproject, and it lets you use Wicket with URLs likehttp://localhost:8080/wicket-examples/niceurl/path/to/page2/param1/value1/param2/value2
where path/to/page2 is the mount, and param1 and param2 are the page parameters.Currently, I am also working on abstracting the session even more andtrying to defer creating an actual httpsession object (the default
store for Wicket WebApplications) until it is absolutely needed.The interesting thing here is that as long as you have a bookmarkablepage with nothing on it that points back to that page, there shouldn't
be a need to put it in the session. So, if I pull this off, it meansthat you can create completely stateless applications. Of course thatwon't help you with creating the kind of applications Wicket wastargetted for in the first place, but it is a nice optimization and
extra usuability I think.I you /do/ have call backs like forms etc, we need to store that pagein the session - at least temporarily - in order to call theapproariate methods on the target components. In that case, you
application is not REST. And personally I don't agree with the RESTthing for web applications anyway (and I'm in the web CBD/Continuations camp for that matter), as the original concept of RESTworks fine for document centric view of the web (you know, the way it
all started) and can even work for web apps that have a very direct1-1 relationship with requests (i.e. they are relatively simple), butnot for the kind of applications that people expect to work nowadays.
And the guys from the web mvc camp... they are not exactly followingthe REST approach as it was intended either. Anway, big sidestep... Iam getting almost emotional about defending against REST andstateless-ness as it seems to be a pavlov reaction for people to think
that that is the only way to do your web applications :)Eelco---This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?Stop!Download the new AJAX search engine that makessearching your log files as easy as surfing theweb.DOWNLOAD SPLUNK!http://ads.osdn.com/?ad_idv37alloc_id865opclick
___Wicket-user mailing listWicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Pethate - long urls

2005-12-03 Thread Jeff Miller
I agree. I made the suggestion last month:  http://sourceforge.net/mailarchive/message.php?msg_id=13756383I really like the architecture of Wicket although I have not used it  much yet. The long url's is the one thing about Wicket that  seemed would be a problem. It appears that the development team  is considering some improvements with simplified url's.JeffMark Derricutt [EMAIL PROTECTED] wrote:Hey  all, so I'm starting to play with Wicket and loving it, but I currently  have a small pethate with the URL scheme used in the application.I realize the look of the URL "shouldn't" really matter, but I keep finding myself disliking it.  Currently my app shows a URL like: http://localhost:8081/quickstart/app?bookmarkablePage=com.theoryinpractice.testapp.pages.CommentsPage  Is there a way to get the app to resolve the above using something like: http://localhost:8081/quickstart/app/page/Podcomments  or even http://localhost:8081/quickstart/app?page=Podcomments  I guess it could be possible to say 'register' the package com.theoryinpractice.testapp.pages  as a place where pages could be found and "resolve" the class to use  instead of using the FQN all the time, this would only work in the case  of unambiguous classes thou.  Or maybe theres something already in wicket for more REST like  URL schemes? I notice in the basic frame
 work
 there's only a  BookmarkablePage extension of Page, is there something in wicket-stuff  maybe?  Jeff Miller[EMAIL PROTECTED]
	
		Yahoo! Shopping 
Find Great Deals on Gifts at Yahoo! Shopping 

Re: [Wicket-user] Anonymous subclasses of Model: bad or not? Page versioning?

2005-12-03 Thread Igor Vaynberg
The data provider is kept as the model because that is where the
sorting state lives and that needs to be versioned. I need to refactor
that out of the dataprovider looks like.

-IgorOn 12/3/05, Christian Essl [EMAIL PROTECTED] wrote:
On Fri, 2 Dec 2005 22:51:05 +0100, Johan Compagner [EMAIL PROTECTED]wrote: Maybe we should build something that it is easier for models to version themselfs. Like an interface IVersionable with a method Serializeable
 getVersionData() Which a model can implement. And then we don't store the complete model but only that data.If I understand right than a IModel which does not implement IVersionable
does not get stored in the version history? I think this would be good,because the current situation is confusing.Concerning DataView I'd say that when a the IDataProvider is givendirectly in the constructor. It should not be stored as the model of
DataView but kept in an instancefield, because in nearly all cases it willbe a pull-model. If you need versioning than you can always wrap it in amodel.Christian johan
 On 12/2/05, Nathan Hamblen [EMAIL PROTECTED] wrote: This came up before when I was trying to track down why reversing the sort order of a DataView was bringing down my test application.
 (http://thread.gmane.org/gmane.comp.java.wicket.user/4309) It turned out that the page versioning code was serializing the entire view hierarchy,
 recursively, because of anonymous model classes that contained pointers back into the view. The consensus was that you would have to turn off page versioning if you wanted an anonymous IModel. Is this still the case? I'm just now
 noticing anonymous IModels becoming sort of recommended. Does that mean than page versioning is not recommended anymore? I'll admit don't even understand how versioning is supposed to work.
 DataView sorting seems to be one of the few things that triggers it. I've got forms updating models all over the place and nary a version to be seen. So, I just turn it OFF then, and anonymously subclass IModel to
 my heart's content? Nathan Christian Essl wrote:  On Thu, 1 Dec 2005 14:24:20 -0500, Andrew Berman [EMAIL PROTECTED]
  wrote:   Honestly, I don't think there ever was a Spring Integration problem.I  think people were just looking for a cookie-cutter approach to using
  Spring  within Wicket.It's actually quite easy to do without using any of the  Spring stuff that Igor and others wrote, but it's always a good thing
 to  have a common approach that everyone can follow.   Honestly, I think Igor did a good job: It is just easier and more  natural to write over and over again:
   new HibernateModel(obj,_dao);   than   new HibernateModel(obj, new Model(){ getObject(Component comp){
  return ((MyApplication)Appliation.get()).getDAO(); }  });   and this is not restricted to HibernateDAOs but to any bean you do not
  want to get serialized whtih your components.   Christian___ Gesendet
 von  Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden:  http://mail.yahoo.de   
  ---  This SF.net email is sponsored by: Splunk Inc. Do you grep through log  files  for problems?Stop!Download the new AJAX search engine that makes
  searching your log files as easy as surfing theweb.DOWNLOAD SPLUNK!  http://ads.osdn.com/?ad_id=7637alloc_id=16865op=click
 --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems?Stop!Download the new AJAX search engine that makes
 searching your log files as easy as surfing theweb.DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637alloc_id=16865op=click
 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net 
https://lists.sourceforge.net/lists/listinfo/wicket-user--Christian Essl___Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: 
http://mail.yahoo.de---This SF.net email is sponsored by: Splunk Inc. Do you grep through log filesfor problems?Stop!Download the new AJAX search engine that makes
searching your log files as easy as surfing theweb.DOWNLOAD SPLUNK!http://ads.osdn.com/?ad_id=7637alloc_id=16865op=click
___Wicket-user mailing listWicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Adding Support for optgroup

2005-12-03 Thread Igor Vaynberg
i dont really understand why this is a /problem/adding it yourself gives you options to add styles, your own text, etc.also most of the time i dont even want a select one message, i just want the box to default to the first choice. so when the page first renders the model is null and no options are selected. when the form is submitted the choice will default to the first option visible.
-IgorOn 12/3/05, Johan Compagner 
[EMAIL PROTECTED]
 wrote:still the same problem then i am affraid.I have to control the
visibilty if toat selectoption depending on what the model object is of
the Select itself. (null or something)On 12/3/05, 
Igor Vaynberg [EMAIL PROTECTED] wrote:


but a SelectOption is not in your collection - its a component. The
whole point of the Select component is to have full control over the
markup. All our core choice elements limit your access to markup by
producing the entire select output for you including all the
options. The point of Select/SelectOption is to have total control.
So for the previous example you cao do something like this:Collection smallCars=getSmallCars();Collection bigCars=getBigCars();IOptionRenderer carRenderer=new IOptionRenderer() {...}Select carSelect=new Select(carSelect).add(
RequiredValidator.getInstance());carSelect.add(new SelectOption(none, new Model(/*NULL*/));carSelect.add(new SelectOptions(small, smallCars, carRenderer));carSelect.add(new SelectOptions(big, bigCars, carRenderer));
and then in markupselect wicket:id=carSelectoption wicket:id=nonePlease Select One/optionoptgroup label=small cars span wicket:id=small/span
/optgroupoptgroup label=big cars span wicket:id=big/span/optgroup/selectpersonally
i dont see what the point of select one is if a choice is required.
easier to just not add one and let the box default to the first choice.
sure it requires more attention on the part of the user - but thats
what confirmation pages are for :)
-Igor
On 12/2/05, Johan Compagner [EMAIL PROTECTED]
 wrote:
yes then it is exactly what i say.for Choose one.. you shouldn't have to need a SelectChoice == option element in youre collectionBecause Choose one should only be there if nothing is selected and null value isn't allowed...
johanOn 12/2/05, Igor Vaynberg 



[EMAIL PROTECTED] wrote:no,
SelectChoice is a component that represents a single option
element. you add that to the Select component. SelectChoices is a
convinience component that draws out a bunch of option tags
much like our current components.
-IgorOn 12/2/05, Johan Compagner 




[EMAIL PROTECTED] wrote:
That selectchoice is a thing you have to add to the collection of choices?then
that is not that nice. Because choose one should only be there if no
one is selected and null is required (or something like that)Because of that you can't add it easily to the collection because you have to know that you want to add it or not...
I like the getDefaultValue() or what is that method called of DropDown..johanOn 12/2/05, 
Igor Vaynberg 
[EMAIL PROTECTED] wrote:just
checked in a fix. also the Select element does not add a choose one
choice for you, you have to do it yourself by adding a SelectChoice
that represents that element.
-Igor
On 12/2/05, Davide Savazzi [EMAIL PROTECTED] wrote:

On 11/30/05, Igor Vaynberg [EMAIL PROTECTED] wrote: any feedback on this yet? if not, i guess i will polish it with its current
 feature set and that will be that.
I have a Map that contains List of choices, my code is:Map choicesMap = getChoicesMap();Select select = new Select(mySelect, new PropertyModel(myModel,propertyName));IOptionRenderer renderer = new IOptionRenderer() {
public String getDisplayValue(Object selection) {return ((Selection) selection).getName();}public IModel getModel(Object selection) {return new Model(new Integer(((Selection) selection).getId()));
}};select.add(new SelectOptions(group1, new Model((Serializable)choicesMap.get(group1)), renderer));select.add(new SelectOptions(group2, new Model((Serializable)







choicesMap.get(group2)), renderer));When myModel.getPropertyName() is null I get a WicketException:09:50:07,679 ERROR [RequestCycle] Select[3:step1Form:section4Border:mySelect] contains a null model object,
must be an object of type java.lang.Object or java.util.Collection (in case of multi-valued select element)In other dropdown menu when model is null there is a entry like'Choose one', they don't throw an exception!
Am I using your extension correctly?Cheers,--Davide Savazzi---This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?Stop!Download the new AJAX search engine that makessearching your log files as easy as surfing theweb.DOWNLOAD SPLUNK!






http://ads.osdn.com/?ad_idv37alloc_id865opclick
___Wicket-user mailing listWicket-user@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/wicket-user















Re: [Wicket-user] Pethate - long urls

2005-12-03 Thread Eelco Hillenius
Not only considering... we build it in! :)

There's a couple of things we are working on yet, which are stated in
the TODO doc in the niceurl example package. By looking at the commit
log (Juergen did some fresh commits), these issues are getting closer
to being fixed too.

Eelco

On 12/3/05, Jeff Miller [EMAIL PROTECTED] wrote:
 I agree.  I made the suggestion last month:
 http://sourceforge.net/mailarchive/message.php?msg_id=13756383

  I really like the architecture of Wicket although I have not used it much
 yet.  The long url's is the one thing about Wicket that seemed would be a
 problem.  It appears that the development team is considering some
 improvements with simplified url's.

  Jeff

 Mark Derricutt [EMAIL PROTECTED] wrote:
 Hey all, so I'm starting to play with Wicket and loving it, but I currently
 have a small pethate with the URL scheme used in the application.

 I realize the look of the URL shouldn't really matter, but I keep finding
 myself disliking it.

 Currently my app shows a URL like:


 http://localhost:8081/quickstart/app?bookmarkablePage=com.theoryinpractice.testapp.pages.CommentsPage

 Is there a way to get the app to resolve the above using something like:

   http://localhost:8081/quickstart/app/page/Podcomments

  or even

   http://localhost:8081/quickstart/app?page=Podcomments


 I guess it could be possible to say 'register' the package
 com.theoryinpractice.testapp.pages as a place where pages
 could be found and resolve the class to use instead of using the FQN all
 the time, this would only work in the case of unambiguous classes thou.

 Or maybe theres something already in wicket for more REST like URL schemes?
 I notice in the basic frame work there's only a BookmarkablePage extension
 of Page, is there something in wicket-stuff maybe?



 Jeff Miller
 [EMAIL PROTECTED]

  
 Yahoo! Shopping
  Find Great Deals on Gifts at Yahoo! Shopping


---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37alloc_id865op=click
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Pethate - long urls

2005-12-03 Thread Gili


	I haven't taken a look at the latest code yet but I believe you simply 
renamed the parameters to fixed single-character names (which I find 
equally ugly). Is it possible for you to let us map parameter names to 
arbitrary names we want? For example, I would alias bookmarkablePage to 
page. Similar to aliasClass() you'd have aliasParameter() or something.


Gili

Eelco Hillenius wrote:

Not only considering... we build it in! :)

There's a couple of things we are working on yet, which are stated in
the TODO doc in the niceurl example package. By looking at the commit
log (Juergen did some fresh commits), these issues are getting closer
to being fixed too.

Eelco

On 12/3/05, Jeff Miller [EMAIL PROTECTED] wrote:


I agree.  I made the suggestion last month:
http://sourceforge.net/mailarchive/message.php?msg_id=13756383

I really like the architecture of Wicket although I have not used it much
yet.  The long url's is the one thing about Wicket that seemed would be a
problem.  It appears that the development team is considering some
improvements with simplified url's.

Jeff

Mark Derricutt [EMAIL PROTECTED] wrote:
Hey all, so I'm starting to play with Wicket and loving it, but I currently
have a small pethate with the URL scheme used in the application.

I realize the look of the URL shouldn't really matter, but I keep finding
myself disliking it.

Currently my app shows a URL like:


http://localhost:8081/quickstart/app?bookmarkablePage=com.theoryinpractice.testapp.pages.CommentsPage

Is there a way to get the app to resolve the above using something like:

 http://localhost:8081/quickstart/app/page/Podcomments

or even

 http://localhost:8081/quickstart/app?page=Podcomments


I guess it could be possible to say 'register' the package
com.theoryinpractice.testapp.pages as a place where pages
could be found and resolve the class to use instead of using the FQN all
the time, this would only work in the case of unambiguous classes thou.

Or maybe theres something already in wicket for more REST like URL schemes?
I notice in the basic frame work there's only a BookmarkablePage extension
of Page, is there something in wicket-stuff maybe?



Jeff Miller
[EMAIL PROTECTED]


Yahoo! Shopping
Find Great Deals on Gifts at Yahoo! Shopping




---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37alloc_id865op=click
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user



--
http://www.desktopbeautifier.com/


---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637alloc_id=16865op=click
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Pethate - long urls

2005-12-03 Thread Eelco Hillenius
 I haven't taken a look at the latest code yet

Well, please do that first before commenting :)

Eelco


---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37alloc_id865op=click
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Pethate - long urls

2005-12-03 Thread Igor Vaynberg
Perhaps next time you can be bothered to look at the code before saying that we did something ugly.-IgorOn 12/3/05, Gili 
[EMAIL PROTECTED] wrote:I haven't taken a look at the latest code yet but I believe you simply
renamed the parameters to fixed single-character names (which I findequally ugly). Is it possible for you to let us map parameter names toarbitrary names we want? For example, I would alias bookmarkablePage to
page. Similar to aliasClass() you'd have aliasParameter() or something.GiliEelco Hillenius wrote: Not only considering... we build it in! :) There's a couple of things we are working on yet, which are stated in
 the TODO doc in the niceurl example package. By looking at the commit log (Juergen did some fresh commits), these issues are getting closer to being fixed too. Eelco On 12/3/05, Jeff Miller 
[EMAIL PROTECTED] wrote:I agree.I made the suggestion last month:
http://sourceforge.net/mailarchive/message.php?msg_id=13756383 I really like the architecture of Wicket although I have not used it muchyet.The long url's is the one thing about Wicket that seemed would be a
problem.It appears that the development team is considering someimprovements with simplified url's. JeffMark Derricutt 
[EMAIL PROTECTED] wrote:Hey all, so I'm starting to play with Wicket and loving it, but I currentlyhave a small pethate with the URL scheme used in the application.I realize the look of the URL shouldn't really matter, but I keep finding
myself disliking it.Currently my app shows a URL like:
http://localhost:8081/quickstart/app?bookmarkablePage=com.theoryinpractice.testapp.pages.CommentsPageIs there a way to get the app to resolve the above using something like:
http://localhost:8081/quickstart/app/page/Podcomments or even
http://localhost:8081/quickstart/app?page=PodcommentsI guess it could be possible to say 'register' the packagecom.theoryinpractice.testapp.pages as a place where pages
could be found and resolve the class to use instead of using the FQN allthe time, this would only work in the case of unambiguous classes thou.Or maybe theres something already in wicket for more REST like URL schemes?
I notice in the basic frame work there's only a BookmarkablePage extensionof Page, is there something in wicket-stuff maybe?Jeff Miller
[EMAIL PROTECTED] Yahoo! Shopping Find Great Deals on Gifts at Yahoo! Shopping ---
 This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems?Stop!Download the new AJAX search engine that makes searching your log files as easy as surfing theweb.DOWNLOAD SPLUNK!
 http://ads.osdn.com/?ad_idv37alloc_id865op=click ___ Wicket-user mailing list
 Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
--http://www.desktopbeautifier.com/---This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?Stop!Download the new AJAX search engine that makessearching your log files as easy as surfing theweb.DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637alloc_id=16865op=click___Wicket-user mailing listWicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Pethate - long urls

2005-12-03 Thread Gili


	No problem. I was simply basing this on CVS diffs I saw on the mailing 
list, so I didn't pull this out of the air. I'll check it out now.


Gili

Eelco Hillenius wrote:

   I haven't taken a look at the latest code yet



Well, please do that first before commenting :)

Eelco


---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37alloc_id865op=click
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user



--
http://www.desktopbeautifier.com/


---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637alloc_id=16865op=click
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Pethate - long urls

2005-12-03 Thread Gili


There you go, this is the CVS diff I was commenting on. 
bookmarkablePage is replaced with 5.




 Original Message 
Subject: [Wicket-autocvs] wicket/src/java/wicket/protocol/http 
WebResponseWithCryptedUrl.java,1.7,1.8 
WebRequestWithCryptedUrl.java,1.10,1.11

Date: Sun, 20 Nov 2005 14:20:33 +
From: Juergen Donnerstag [EMAIL PROTECTED]
To: [EMAIL PROTECTED]

Update of /cvsroot/wicket/wicket/src/java/wicket/protocol/http
In directory 
sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5227/src/java/wicket/protocol/http


Modified Files:
WebResponseWithCryptedUrl.java WebRequestWithCryptedUrl.java
Log Message:
fixed [ 1348681 ] Crypted URLs break onSelectionChanged handling

Index: WebRequestWithCryptedUrl.java
===
RCS file: 
/cvsroot/wicket/wicket/src/java/wicket/protocol/http/WebRequestWithCryptedUrl.java,v

retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** WebRequestWithCryptedUrl.java21 Oct 2005 15:21:59 -1.10
--- WebRequestWithCryptedUrl.java20 Nov 2005 14:20:31 -1.11
***
*** 35,39 

  /**
!  * it extends WebRequest and decodes URLs encoded by
   * WebResponseWithCryptedUrl. One reason for obfuscating the URL's 
query string

   * might be, that you don't want the details to be visible to the user to
--- 35,39 

  /**
!  * It extends WebRequest and decodes URLs encoded by
   * WebResponseWithCryptedUrl. One reason for obfuscating the URL's 
query string

   * might be, that you don't want the details to be visible to the user to
***
*** 46,53 
  /** URL querystring decoded */
  private final String queryString;
!
  /** URL query parameters decoded */
  private final ValueMap parameters;
!
  /**
   * Constructor.
--- 46,53 
  /** URL querystring decoded */
  private final String queryString;
!
  /** URL query parameters decoded */
  private final ValueMap parameters;
!
  /**
   * Constructor.
***
*** 66,76 
  // Get the crypt implementation from the application
  ICrypt urlCrypt = Application.get().newCrypt();
  // Decrypt the query string
  final String queryString = urlCrypt.decrypt(secureParam);
!
  // The querystring might have been shortened (length 
reduced).

  // In that case, lengthen the query string again.
  this.queryString = rebuildUrl(queryString);
!
  // extract parameter key/value pairs from the query string
  this.parameters = analyzeQueryString(this.queryString);
--- 66,77 
  // Get the crypt implementation from the application
  ICrypt urlCrypt = Application.get().newCrypt();
+
  // Decrypt the query string
  final String queryString = urlCrypt.decrypt(secureParam);
!
  // The querystring might have been shortened (length 
reduced).

  // In that case, lengthen the query string again.
  this.queryString = rebuildUrl(queryString);
!
  // extract parameter key/value pairs from the query string
  this.parameters = analyzeQueryString(this.queryString);
***
*** 85,101 
  this.parameters = new ValueMap();
  }
!
  // If available, add POST parameters as well. They are not 
encrypted.

  // The parameters from HttpRequest
  final Enumeration paramNames = request.getParameterNames();
  // For all parameters (POST + URL query string)
  while (paramNames.hasMoreElements())
  {
!String paramName = (String)paramNames.nextElement();
!
  // Ignore the x parameter
  if (!x.equalsIgnoreCase(paramName))
  {
! String[] values = request.getParameterValues(paramName);
  // add key/value to our parameter map
  this.parameters.put(paramName, values);
--- 86,103 
  this.parameters = new ValueMap();
  }
!
  // If available, add POST parameters as well. They are not 
encrypted.

  // The parameters from HttpRequest
  final Enumeration paramNames = request.getParameterNames();
+
  // For all parameters (POST + URL query string)
  while (paramNames.hasMoreElements())
  {
! String paramName = (String)paramNames.nextElement();
!
  // Ignore the x parameter
  if (!x.equalsIgnoreCase(paramName))
  {
! String[] values = 
request.getParameterValues(paramName);

  // add key/value to our parameter map
  this.parameters.put(paramName, values);
***
*** 118,122 
  queryString = Strings.replaceAll(queryString, 3=, 
interface=);
  queryString = Strings.replaceAll(queryString, 5=, 

Re: [Wicket-user] Pethate - long urls

2005-12-03 Thread Igor Vaynberg
this is for ENCRYPTED urls and has nothing to do with what we are discussing here.-IgorOn 12/3/05, Gili 
[EMAIL PROTECTED] wrote: There you go, this is the CVS diff I was commenting on.
bookmarkablePage is replaced with 5. Original Message Subject: [Wicket-autocvs] wicket/src/java/wicket/protocol/httpWebResponseWithCryptedUrl.java,1.7,1.8WebRequestWithCryptedUrl.java
,1.10,1.11Date: Sun, 20 Nov 2005 14:20:33 +From: Juergen Donnerstag [EMAIL PROTECTED]To: 
[EMAIL PROTECTED]Update of /cvsroot/wicket/wicket/src/java/wicket/protocol/httpIn directorysc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5227/src/java/wicket/protocol/httpModified Files:
 WebResponseWithCryptedUrl.java WebRequestWithCryptedUrl.javaLog Message:fixed [ 1348681 ] Crypted URLs break onSelectionChanged handlingIndex: WebRequestWithCryptedUrl.java===
RCS file:/cvsroot/wicket/wicket/src/java/wicket/protocol/http/WebRequestWithCryptedUrl.java,vretrieving revision 1.10retrieving revision 1.11diff -C2 -d -r1.10 -r1.11*** WebRequestWithCryptedUrl.java
21 Oct 2005 15:21:59 -1.10--- WebRequestWithCryptedUrl.java20 Nov 2005 14:20:31 -1.11** 35,39  /**!* it extends WebRequest and decodes URLs encoded by
* WebResponseWithCryptedUrl. One reason for obfuscating the URL'squery string* might be, that you don't want the details to be visible to the user to--- 35,39  /**!* It extends WebRequest and decodes URLs encoded by
* WebResponseWithCryptedUrl. One reason for obfuscating the URL'squery string* might be, that you don't want the details to be visible to the user to** 46,53  /** URL querystring decoded */
 private final String queryString;! /** URL query parameters decoded */ private final ValueMap parameters;! /*** Constructor.--- 46,53  /** URL querystring decoded */
 private final String queryString;! /** URL query parameters decoded */ private final ValueMap parameters;! /*** Constructor.** 66,76 
 // Get the crypt implementation from the application ICrypt urlCrypt = Application.get().newCrypt(); // Decrypt the query string final String queryString = 
urlCrypt.decrypt(secureParam);! // The querystring might have been shortened (lengthreduced). // In that case, lengthen the query string again. this.queryString
 = rebuildUrl(queryString);! // extract parameter key/value pairs from the query string this.parameters = analyzeQueryString(this.queryString);--- 66,77  // Get the crypt implementation from the application
 ICrypt urlCrypt = Application.get().newCrypt();+ // Decrypt the query string final String queryString = urlCrypt.decrypt(secureParam);! // The querystring might have been shortened (length
reduced). // In that case, lengthen the query string again. this.queryString = rebuildUrl(queryString);! // extract parameter key/value pairs from the query string
 this.parameters = analyzeQueryString(this.queryString);** 85,101  this.parameters = new ValueMap(); }! // If available, add POST parameters as well. They are not
encrypted. // The parameters from HttpRequest final Enumeration paramNames = request.getParameterNames(); // For all parameters (POST + URL query string) while (
paramNames.hasMoreElements()) {!String paramName = (String)paramNames.nextElement();! // Ignore the x parameter if (!x.equalsIgnoreCase(paramName))
 {! String[] values = request.getParameterValues(paramName); // add key/value to our parameter map this.parameters.put(paramName, values);
--- 86,103  this.parameters = new ValueMap(); }! // If available, add POST parameters as well. They are notencrypted. // The parameters from HttpRequest
 final Enumeration paramNames = request.getParameterNames();+ // For all parameters (POST + URL query string) while (paramNames.hasMoreElements()) {! String paramName = (String)paramNames.nextElement();
! // Ignore the x parameter if (!x.equalsIgnoreCase(paramName)) {! String[] values =request.getParameterValues(paramName);
 // add key/value to our parameter map this.parameters.put(paramName, values);** 118,122  queryString = Strings.replaceAll(queryString, 3=,
interface=); queryString = Strings.replaceAll(queryString, 5=,bookmarkablePage=);! return queryString; }--- 120,124  queryString = 
Strings.replaceAll(queryString, 3=,interface=); queryString = Strings.replaceAll(queryString, 5=,bookmarkablePage=);! return queryString;
 }** 134,138  // Get a list of strings separated by the delimiter final StringList pairs = StringList.tokenize(queryString, );! // Go through each string in the list
 for (IStringIterator iterator = pairs.iterator();iterator.hasNext();)--- 136,140  // Get a list of strings separated by the delimiter final StringList pairs = StringList.tokenize
(queryString, );! // Go through each string in the list for (IStringIterator iterator = pairs.iterator();iterator.hasNext();)** 178,185 
 

Re: [Wicket-user] Anonymous subclasses of Model: bad or not? Page versioning?

2005-12-03 Thread Christian Essl



The data provider is kept as the model because that is where the sorting
state lives and that needs to be versioned. I need to refactor that out 
of

the dataprovider looks like.



I see.

Maybe an interface ISortOrderProvider which is exactly like 
ISortableDataProvider but does not extend IDataProvider. The interface 
could than be implemented by special Components directly (ie 
SortableHeader). And a DataProvider which supports sorting uses an 
instance of this interface to sort its data. I thing this would also 
decouple the sorting from DataView etc.


Christian


-Igor

On 12/3/05, Christian Essl [EMAIL PROTECTED] wrote:


On Fri, 2 Dec 2005 22:51:05 +0100, Johan Compagner 
[EMAIL PROTECTED]

wrote:

 Maybe we should build something that it is easier for models to 
version

 themselfs. Like an interface IVersionable with a method Serializeable
 getVersionData()
 Which a model can implement. And then we don't store the complete 
model

 but
 only that data.

If I understand right than a IModel which does not implement 
IVersionable

does not get stored in the version history? I think this would be good,
because the current situation is confusing.

Concerning DataView I'd say that when a the IDataProvider is given
directly in the constructor. It should not be stored as the model of
DataView but kept in an instancefield, because in nearly all cases it 
will

be a pull-model. If you need versioning than you can always wrap it in a
model.

Christian


 johan


 On 12/2/05, Nathan Hamblen [EMAIL PROTECTED] wrote:

 This came up before when I was trying to track down why reversing the
 sort order of a DataView was bringing down my test application.
 (http://thread.gmane.org/gmane.comp.java.wicket.user/4309) It turned
out
 that the page versioning code was serializing the entire view
hierarchy,
 recursively, because of anonymous model classes that contained 
pointers

 back into the view.

 The consensus was that you would have to turn off page versioning if
you
 wanted an anonymous IModel. Is this still the case? I'm just now
 noticing anonymous IModels becoming sort of recommended. Does that 
mean

 than page versioning is not recommended anymore?

 I'll admit don't even understand how versioning is supposed to work.
 DataView sorting seems to be one of the few things that triggers it.
 I've got forms updating models all over the place and nary a version 
to

 be seen. So, I just turn it OFF then, and anonymously subclass IModel
to
 my heart's content?

 Nathan

 Christian Essl wrote:
  On Thu, 1 Dec 2005 14:24:20 -0500, Andrew Berman 
[EMAIL PROTECTED]

  wrote:
 
  Honestly, I don't think there ever was a Spring Integration
 problem.  I
  think people were just looking for a cookie-cutter approach to 
using

  Spring
  within Wicket.  It's actually quite easy to do without using any 
of

 the
  Spring stuff that Igor and others wrote, but it's always a good
thing
 to
  have a common approach that everyone can follow.
 
  Honestly, I think Igor did a good job: It is just easier and more
  natural to write over and over again:
 
  new HibernateModel(obj,_dao);
 
  than
 
  new HibernateModel(obj, new Model(){
 getObject(Component comp){
return ((MyApplication)Appliation.get()).getDAO();
 }
  });
 
  and this is not restricted to HibernateDAOs but to any bean you do
not
  want to get serialized whtih your components.
 
  Christian
 
 
 
 
 
 
  ___ 
Gesendet

 von
  Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden:
  http://mail.yahoo.de
 
 
 
  ---
  This SF.net email is sponsored by: Splunk Inc. Do you grep through
log
  files
  for problems?  Stop!  Download the new AJAX search engine that 
makes

  searching your log files as easy as surfing the  web.  DOWNLOAD
 SPLUNK!
  http://ads.osdn.com/?ad_id=7637alloc_id=16865op=click



 ---
 This SF.net email is sponsored by: Splunk Inc. Do you grep through 
log

 files
 for problems?  Stop!  Download the new AJAX search engine that makes
 searching your log files as easy as surfing the  web.  DOWNLOAD 
SPLUNK!

 http://ads.osdn.com/?ad_id=7637alloc_id=16865op=click
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user




--
Christian Essl





___
Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier
anmelden: http://mail.yahoo.de



---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log
files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637alloc_id=16865op=click

Re: [Wicket-user] Pethate - long urls

2005-12-03 Thread Gili


	Where should I be looking in the new codebase for the clean URL code 
you were discussing? It's not where I was expecting it.


Gili

Igor Vaynberg wrote:
this is for ENCRYPTED urls and has nothing to do with what we are 
discussing here.


-Igor


On 12/3/05, *Gili*  [EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED] wrote:



 There you go, this is the CVS diff I was commenting on.
bookmarkablePage is replaced with 5.



 Original Message 
Subject: [Wicket-autocvs] wicket/src/java/wicket/protocol/http
WebResponseWithCryptedUrl.java,1.7,1.8
WebRequestWithCryptedUrl.java ,1.10,1.11
Date: Sun, 20 Nov 2005 14:20:33 +
From: Juergen Donnerstag [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
To: [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]

Update of /cvsroot/wicket/wicket/src/java/wicket/protocol/http
In directory
sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5227/src/java/wicket/protocol/http

Modified Files:
 WebResponseWithCryptedUrl.java WebRequestWithCryptedUrl.java
Log Message:
fixed [ 1348681 ] Crypted URLs break onSelectionChanged handling

Index: WebRequestWithCryptedUrl.java
===
RCS file:

/cvsroot/wicket/wicket/src/java/wicket/protocol/http/WebRequestWithCryptedUrl.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** WebRequestWithCryptedUrl.java 21 Oct 2005 15:21:59 -1.10
--- WebRequestWithCryptedUrl.java20 Nov 2005 14:20:31 -1.11
***
*** 35,39 

   /**
!  * it extends WebRequest and decodes URLs encoded by
* WebResponseWithCryptedUrl. One reason for obfuscating the URL's
query string
* might be, that you don't want the details to be visible to the
user to
--- 35,39 

   /**
!  * It extends WebRequest and decodes URLs encoded by
* WebResponseWithCryptedUrl. One reason for obfuscating the URL's
query string
* might be, that you don't want the details to be visible to the
user to
***
*** 46,53 
   /** URL querystring decoded */
   private final String queryString;
!
   /** URL query parameters decoded */
   private final ValueMap parameters;
!
   /**
* Constructor.
--- 46,53 
   /** URL querystring decoded */
   private final String queryString;
!
   /** URL query parameters decoded */
   private final ValueMap parameters;
!
   /**
* Constructor.
***
*** 66,76 
   // Get the crypt implementation from the application
   ICrypt urlCrypt = Application.get().newCrypt();
   // Decrypt the query string
   final String queryString = urlCrypt.decrypt(secureParam);
!
   // The querystring might have been shortened (length
reduced).
   // In that case, lengthen the query string again.
   this.queryString = rebuildUrl(queryString);
!
   // extract parameter key/value pairs from the query
string
   this.parameters = analyzeQueryString(this.queryString);
--- 66,77 
   // Get the crypt implementation from the application
   ICrypt urlCrypt = Application.get().newCrypt();
+
   // Decrypt the query string
   final String queryString = urlCrypt.decrypt(secureParam);
!
   // The querystring might have been shortened (length
reduced).
   // In that case, lengthen the query string again.
   this.queryString = rebuildUrl(queryString);
!
   // extract parameter key/value pairs from the query
string
   this.parameters = analyzeQueryString(this.queryString);
***
*** 85,101 
   this.parameters = new ValueMap();
   }
!
   // If available, add POST parameters as well. They are not
encrypted.
   // The parameters from HttpRequest
   final Enumeration paramNames = request.getParameterNames();
   // For all parameters (POST + URL query string)
   while ( paramNames.hasMoreElements())
   {
!String paramName = (String)paramNames.nextElement();
!
   // Ignore the x parameter
   if (!x.equalsIgnoreCase(paramName))
   {
! String[] values =
request.getParameterValues(paramName);
   // add key/value to our parameter map
   this.parameters.put(paramName, values);
--- 86,103 
   this.parameters = new ValueMap();
  

Re: [Wicket-user] Anonymous subclasses of Model: bad or not? Page versioning?

2005-12-03 Thread Igor Vaynberg
the problem im having is that something somewhere has to version this information. if i put it back into the dataprovider then we are back to square one. the problem is compounded by the fact that i want to add toolbars (like a filter toolbar). this means that the dataprovider has to be aware of different toolbars attached to the datatable. and it would be really nice if the toolbars did not keep their models so that you can add two navigation toolbars and they are sharing a model stored elsewhere.
my original thought was to let users implement a compound model object for the datatable. that way all the information that needs to be versioned is neatly in one place and all toolbars+idataprovider link to the same place. so a compound model object for the datatable might be something like this
public class DataTableModel implements ISortStateLocator, IFilterStateProvider { private MySortState state=new MySortState(); // implements ISortState private MyFilterState filterState=new MyFilterState();
 public ISortState getSortState() { return state; } public Object getFilterState() { return filterState; }}then the dataprovider can be changed toIDataProvider { iterator iterator(int first, int count, Object datatableModelObject);
 int size(Object datatableModelObject);}so that in your implementation you can do something like:iterator iterator(int first, int count, Object dtmo) { ISortState sort=((ISortStateLocator)dtmo).getSortState();
 FilterState filter=((IFilterStateLocator)dtmo).getFIlterState();}and maybe we can provide an uber-compound object that will have all toolbar models that we ship in it. it will waste a little bit of space but its easier on the user. you can always optimize later :)
I dont know how good that approach is, its where im headed right now though. If anyone has any suggestions they are welcome.-IgorOn 12/3/05, 
Christian Essl [EMAIL PROTECTED] wrote:
I dont think that you'll need to change IDataProvider. If a concreteDataProvider class would support sorting than it should just take ie inthe constructor an ISortOrderProvider. Maybe you could even keep theISortableDataProvider. It just implements IDataProvider and
ISortOderProvider and a default implementation delgates to a componentwhich implements ISortOderProvider (and which does the actual versionkeeping).However you know best what and how so I am happy to wait for your solution.
ChristianOn Sat, 3 Dec 2005 11:31:59 -0800, Igor Vaynberg [EMAIL PROTECTED]wrote: already on it. havent figured it all out yet. the problem is i think i
 will have to change IDataProvider to take extra parameters. this will break all the clients, but i dont see another way around it yet. im also modularizing datatable so that navigation/headers are toolbars that can be added or
 not. also working on a filter toolbar. should be sweet when its done, but there will be a lot of api breaks. -Igor On 12/3/05, Christian Essl 
[EMAIL PROTECTED] wrote:  The data provider is kept as the model because that is where the sorting  state lives and that needs to be versioned. I need to refactor that
 out  of  the dataprovider looks like.  I see. Maybe an interface ISortOrderProvider which is exactly like ISortableDataProvider but does not extend IDataProvider. The interface
 could than be implemented by special Components directly (ie SortableHeader). And a DataProvider which supports sorting uses an instance of this interface to sort its data. I thing this would also
 decouple the sorting from DataView etc. Christian  -Igor   On 12/3/05, Christian Essl 
[EMAIL PROTECTED] wrote:   On Fri, 2 Dec 2005 22:51:05 +0100, Johan Compagner  [EMAIL PROTECTED]
  wrote:Maybe we should build something that it is easier for models to  version   themselfs. Like an interface IVersionable with a method
 Serializeable   getVersionData()   Which a model can implement. And then we don't store the complete  model   but
   only that data.   If I understand right than a IModel which does not implement  IVersionable  does not get stored in the version history? I think this would be
 good,  because the current situation is confusing.   Concerning DataView I'd say that when a the IDataProvider is given  directly in the constructor. It should not be stored as the model of
  DataView but kept in an instancefield, because in nearly all cases it  will  be a pull-model. If you need versioning than you can always wrap it in
 a  model.   Christian  johan
   On 12/2/05, Nathan Hamblen [EMAIL PROTECTED] wrote: This came up before when I was trying to track down why reversing
 the   sort order of a DataView was bringing down my test application.   (http://thread.gmane.org/gmane.comp.java.wicket.user/4309
) It turned  out   that the page versioning code was serializing the entire view  hierarchy,   recursively, because of anonymous model classes that contained
  pointers   back into the view. The consensus was that you would have to turn off page versioning if
  you   wanted an anonymous IModel.