Re: [OT] Wicket changed my life !

2010-02-19 Thread Leon Nieuwoudt
We just did an initial presentation to a high profile client for our first
Wicket-based app (previously we used PHP extensively), and it went well.

The entire process from getting a prototype up, doing database stuff (mostly
thanks to Hibernate), custom components, etc. went rather smoothly.

The learning curve was slightly steep once we started doing interesting UI
interactions (and also that really annoying LazyLoad exception during tests
that I still can't figure out), but it's worth the effort.

I love spaghetti, but not in my code.

Thanks guys :)

On Fri, Feb 19, 2010 at 9:42 AM, Fabio Fioretti windom.macroso...@gmail.com
 wrote:

 Peter, I completely agree with you. :-) Thanks Wicket!

 Fabio

 On Fri, Feb 19, 2010 at 9:37 AM, Peter Ertl pe...@gmx.org wrote:
  Wicket put the suck out of web development for me :-)
 
  Am 19.02.2010 um 08:14 schrieb Josh Kamau:
 
  Me too!!
 
  On Fri, Feb 19, 2010 at 9:57 AM, Ashika Umanga Umagiliya 
  auma...@biggjapan.com wrote:
 
  I love Wicket !
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




Re: Quick fix for the dreaded org.hibernate.LazyInitializationException with WicketTester

2010-02-16 Thread Leon Nieuwoudt
Yes this works when running the program in the Application Server
environment.

For JUnit testing (outside of the AS), I ran into this problem.

Is there maybe a better way to maybe wrap the OSIV Filter around Unit Tests?

On Tue, Feb 16, 2010 at 9:07 AM, Wilhelmsen Tor Iver toriv...@arrive.nowrote:


 I thought the medicine against LazyInitializationException was
 spring-hibernate's OpenSessionInViewFilter, where you leave to the filter to
 open and close the session at the beginning and end of the request?

 - Tor Iver

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




Re: Quick fix for the dreaded org.hibernate.LazyInitializationException with WicketTester

2010-02-16 Thread Leon Nieuwoudt
Hi Igor

Glad to hear there's another way.

I'm already using the Spring JUnit runner, like this:

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
public class UserTest extends . {

@Test
public void testCRUD() {
   // Code...
}
}

This what I tried:

* Adding @Transactional over testCRUD() out of desperation

* Subclassing the base tester from
AbstractTransactionalDataSourceSpringContextTests, according to the docs
this will automatically begin a transaction and rollback. It also looks like
it's for JUnit 3.x.

The above didn't work though, so I tried the attach()/detach() route to
emulate OSIV which worked fine. I therefore assume I'm missing something.

On Tue, Feb 16, 2010 at 9:18 AM, Igor Vaynberg igor.vaynb...@gmail.comwrote:

 all you have to do is start a transaction before each unit test and
 roll it back after. spring has base unit tests and test runners that
 do this for you...




Re: Quick fix for the dreaded org.hibernate.LazyInitializationException with WicketTester

2010-02-16 Thread Leon Nieuwoudt
Just an update, the quick hack failed completely when testing on an XP
system, but it worked perfectly on Ubuntu.

Any links or example on getting Spring/Hibernate/WicketTester/JUnit4 to work
will be appreciated. lmgtfy will also suffice ;)

On Tue, Feb 16, 2010 at 9:57 AM, Leon Nieuwoudt leon.nieuwo...@gmail.comwrote:

 Hi Igor

 Glad to hear there's another way.

 I'm already using the Spring JUnit runner, like this:

 @RunWith(SpringJUnit4ClassRunner.class)
 @ContextConfiguration
 public class UserTest extends . {

 @Test
 public void testCRUD() {
// Code...
 }
 }

 This what I tried:

 * Adding @Transactional over testCRUD() out of desperation

 * Subclassing the base tester from
 AbstractTransactionalDataSourceSpringContextTests, according to the docs
 this will automatically begin a transaction and rollback. It also looks like
 it's for JUnit 3.x.

 The above didn't work though, so I tried the attach()/detach() route to
 emulate OSIV which worked fine. I therefore assume I'm missing something.


 On Tue, Feb 16, 2010 at 9:18 AM, Igor Vaynberg igor.vaynb...@gmail.comwrote:

 all you have to do is start a transaction before each unit test and
 roll it back after. spring has base unit tests and test runners that
 do this for you...




Quick fix for the dreaded org.hibernate.LazyInitializationException with WicketTester

2010-02-15 Thread Leon Nieuwoudt
Hi all,

After about 5 minutes of omfg not that error again, I think I found a
quick hack to avoid org.hibernate.LazyInitializationException with
WicketTester. I've checked everywhere on the lists but didn't find a similar
solution, so apologies if someone else already posted this. There may also
be a better way to do it.

If I can explain it properly:

* I have an abstract BaseAdminApplication class that extends WebApplication,
and does the standard application configurations (mounting/stuff), but no
Spring injection configuration yet.

* Then I have a SpringAdminApplication that extends from
BaseAdminApplication. This is referenced for the normal
applicationContext.xml, and correctly configures Spring Injection.

* There is another subclass, called JUnitAdminApplication, that also extends
from BaseAdminApplication. This is referenced in the Unit Testing
application context.

* The JUnitAdminApplication mimics the OSIV pattern, inside Wicket's
WebSession.attach() and .detach() methods.

* Configure Spring Injection outside of the WebApplication. For some reason
there were odd errors when configuring during the WebApplication.init()
process.

I do hope it makes sense. Unfortunately I can't give out all the code, but
I'm sure it'll set the next person on the right track before redoing tests
with Selenium at the 11th hour. So far there are no strange surprises, yet.

---

package com.SECRETAPP.web;

import ..;

public class JUnitAdminApplication extends BaseAdminApplication {
@Autowired
SessionFactory sessionFactory;

@Override
public Session newSession(Request request, Response response) {
return new WebSession(request) {
@Override
protected void attach() {
// Do the attach magic that I don't care about right now
super.attach();

// Force the creation of a new Hibernate session using
Spring
SessionFactoryUtils.getSession(sessionFactory, true);

// Force the session to be closed only when we tell it to
// By default, the Hibernate session is closed somewhere
during
// the request cycle. Similar to OpenSessionInViewFilter
SessionFactoryUtils.initDeferredClose(sessionFactory);
}


@Override
protected void detach() {
super.detach();
// Only close the Hibernate Session now, after all rendering
is done
SessionFactoryUtils.processDeferredClose(sessionFactory);
}

};
}

// Other code...
}



In com/SECRETAPP/web/BaseTester-context.xml ..

beans.
context:component-scan base-package=com.SECRETAPP /

bean id=wicketApplication
class=com.SECRETAPP.web.JUnitAdminApplication/


!-- other stuff --
/beans



In my WicketTestBase abstract class...

public abstract class WicketTestBase {

// Stripped code

protected WicketTester createTester() {
if(tester != null) {
return tester;
}
WebApplication app = (WebApplication)
applicationContext.getBean(wicketApplication);

tester = new WicketTester(app) {

@Override
public ServletContext newServletContext(String path) {
MockServletContext servletContext = (MockServletContext)
super.newServletContext(path);


servletContext.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE,
applicationContext);
return servletContext;
}
};

app.addComponentInstantiationListener(new
SpringComponentInjector(tester.getApplication(), applicationContext, true))

// Stripped code

return tester;
}
}


AutoCompleteTextField and HTML Encoding question (1.4.4)

2010-01-21 Thread Leon Nieuwoudt
Hi :)

I'm trying to use a AutoCompleteTextField that shows a list of E-Mail
addresses. The problem I'm running into is that the  character is causing
rendering issues, for example: John Doe john . doe @ mortuary . com.

I've already bypassed the selection list rendering problem by using a custom
renderer (code below), but now when I select an entry it only copies the
first part up to the  into the textbox.

Any quick way around it?

Thanks in advance



private class KeyRenderer extends AbstractAutoCompleteTextRendererKey {
@Override
protected String getTextValue(Key object) {
return Strings.escapeMarkup(object.getName()).toString();
}
}

...

add(new AutoCompleteTextFieldKey(key, model, new KeyRenderer()) {
   @Override
protected IteratorKey getChoices(String input) {
return keyService.getPublicKeyFor(input).iterator();
   }
});




Re: [OT] wicket users around the world

2008-12-13 Thread Leon Nieuwoudt
Lagos, Nigeria

On Thu, Dec 11, 2008 at 7:57 PM, francisco treacy 
francisco.tre...@gmail.com wrote:

 to know a little bit more of our great (and vast) community, i was
 just wondering if you're keen on sharing where you come from and/or
 where you work with wicket...

 for instance, here argentinian/belgian working with wicket in antibes,
 france

 francisco

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




Re: Java BlackBelt Wicket exam

2008-09-21 Thread Leon Nieuwoudt
For black belt, one of the questions must be to identify Martin, Eelco, Nino
and Igor from a police line-up.

On Fri, Sep 19, 2008 at 4:11 PM, James Carman [EMAIL PROTECTED]wrote:

 Perhaps it could be for a yellow belt. ;)


 On Fri, Sep 19, 2008 at 11:09 AM, Nino Saturnino Martinez Vazquez Wael
 [EMAIL PROTECTED] wrote:
  Hi
 
  It looks fairly simple, I guess it depends on the depth of the exam...
  Because it could go over a lot more, or maybe the points could specified
 to
  further detail as you write.
 
 
  Eyal Golan wrote:
 
  Hi,
  I have proposed to open a Wicket exam in JavaBlackBelt.
  Here's my proposal:
  http://www.javablackbelt.com/forum/posts/list/0/118.page#567
 
  Please check it and give your thoughts.
  I have already written several questions (to myself).
 
  Thanks
 
 
 
  --
  -Wicket for love
 
  Nino Martinez Wael
  Java Specialist @ Jayway DK
  http://www.jayway.dk
  +45 2936 7684
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: Reporting Engine on Wicket 1.3.4

2008-09-09 Thread Leon Nieuwoudt
Thanks for the advice guys

At the moment I'm not too worried about a friendly report designer...
although I just know the users will ask for one and never use it ;)

So I guess a JasperReport integration will give the most mileage.

BIRT does seem interesting, although the integration seems somewhat hacky

On Tue, Sep 9, 2008 at 8:59 AM, Martijn Dashorst [EMAIL PROTECTED]
 wrote:

 Currently the best tool is jasperreports, when you don't want
 customers define reports. Crystal reports seem like a better option if
 you have customers that need to define reports, but providing CR with
 programmatic data wasn't an option back in the day.

 So the search for the holy reporting grail continues.

 Martijn




Reporting Engine on Wicket 1.3.4

2008-09-08 Thread Leon Nieuwoudt
Hi all

I would like to know what kind of reporting engines are commonly used
for Wicket-based apps? We have the need to generate CSV, Excel, and
PDF files with graphs and pretty graphics.

We've looked at the JasperReports integration but the docs say it's not complete

Thanks in advance

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Wicket 1.3.4 Final - Incorrect resource blurbs out files in Glassfish folder

2008-07-02 Thread Leon Nieuwoudt
Hey guys

I've been following the wicket-users list for quite some time to
evaluate the community and momentum, and just want to say great job!
before I continue ;)

Now the question... I'm starting to create a new real-world app, and
something happened that a Resource sent a Glassfish folder file
listing.

The URL I typed (incorrectly) was -
http://localhost:8081/realapp-web/console/resources/com.realapp.console.web.page.AbstractConsoleWebPage/nyi

... which gave me this ...

3RD-PARTY-LICENSE.txt
addons
bin
CDDLGPLHeader.txt
CDDLv1.0.txt
config
COPYRIGHT
docs
domains
imq
javadb
jbi
lib
LICENSE.txt
LICENSE-glassfish.txt
passfile
registry.properties
registry.xml
samples
setup.xml
setup-cluster.xml
uninstall.sh
updatecenter

If i replace nyi with nyi.gif, then it gives me an exception (as expected)

Any ideas? Thanks in advance!

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Wicket 1.3.4 Final - Incorrect resource blurbs out files in Glassfish folder

2008-07-02 Thread Leon Nieuwoudt
Well that's the weird part ;)

It's a new clean application, with one abstract WebPage class and a
few subclasses.

I'm pretty sure there's no code in wicket that will do this (neither
in this new app), so right now I'm creating a new test project to
determine where it goes skew.

I'll confirm shortly with some code


On 7/2/08, Igor Vaynberg [EMAIL PROTECTED] wrote:
 i dont think anything in wicket generates a directory listing. are you
 sure it is wicket code?

 -igor

 On Wed, Jul 2, 2008 at 8:59 AM, Leon Nieuwoudt [EMAIL PROTECTED]
 wrote:
 Hey guys

 I've been following the wicket-users list for quite some time to
 evaluate the community and momentum, and just want to say great job!
 before I continue ;)

 Now the question... I'm starting to create a new real-world app, and
 something happened that a Resource sent a Glassfish folder file
 listing.

 The URL I typed (incorrectly) was -
 http://localhost:8081/realapp-web/console/resources/com.realapp.console.web.page.AbstractConsoleWebPage/nyi

 ... which gave me this ...

 3RD-PARTY-LICENSE.txt
 addons
 bin
 CDDLGPLHeader.txt
 CDDLv1.0.txt
 config
 COPYRIGHT
 docs
 domains
 imq
 javadb
 jbi
 lib
 LICENSE.txt
 LICENSE-glassfish.txt
 passfile
 registry.properties
 registry.xml
 samples
 setup.xml
 setup-cluster.xml
 uninstall.sh
 updatecenter

 If i replace nyi with nyi.gif, then it gives me an exception (as
 expected)

 Any ideas? Thanks in advance!

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Wicket 1.3.4 Final - Incorrect resource blurbs out files in Glassfish folder

2008-07-02 Thread Leon Nieuwoudt
Ok, just recreated the problem with a new app, but still clueless why
it happens.

My configuration is Netbeans 6.1 with Glassfish 2 UR2, Apache Wicket
1.3.4, Ubuntu Hardy.

File listing happens with -
http://localhost:8081/testproject/test/resources/me.squeeze.SqueezePage/blahblah
404 exception happens with (which is expected) -
http://localhost:8081/testproject/test/resources/me.squeeze.SqueezePage/blahblah.gif

blahblah.gif does not exist in this project, the name is arbitrary.

Here's the code:

* WebApplication

package me.squeeze;

import org.apache.wicket.protocol.http.WebApplication;

public class SqueezeApplication extends WebApplication {
@Override
protected void init() {
super.init();
}

@Override
public Class getHomePage() {
return SqueezePage.class;
}
}

* WebPage

package me.squeeze;

import org.apache.wicket.markup.html.WebPage;

public class SqueezePage extends WebPage {
public SqueezePage() {
  super();
}
}


* web.xml

?xml version=1.0 encoding=UTF-8?
web-app version=2.5 xmlns=http://java.sun.com/xml/ns/javaee;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xsi:schemaLocation=http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd;
filter
filter-nameSqueezeApplication/filter-name

filter-classorg.apache.wicket.protocol.http.WicketFilter/filter-class
init-param
param-nameapplicationClassName/param-name
param-valueme.squeeze.SqueezeApplication/param-value
/init-param
/filter
filter-mapping
filter-nameSqueezeApplication/filter-name
url-pattern/test/*/url-pattern
/filter-mapping
session-config
session-timeout
30
/session-timeout
/session-config
welcome-file-list
welcome-fileindex.jsp/welcome-file
/welcome-file-list
/web-app

* HTML

!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
html
  head
title/title
meta http-equiv=Content-Type content=text/html; charset=UTF-8
  /head
  body
  l33t html page
  /body
/html


On Wed, Jul 2, 2008 at 7:34 PM, Leon Nieuwoudt [EMAIL PROTECTED] wrote:
 Well that's the weird part ;)

 It's a new clean application, with one abstract WebPage class and a
 few subclasses.

 I'm pretty sure there's no code in wicket that will do this (neither
 in this new app), so right now I'm creating a new test project to
 determine where it goes skew.

 I'll confirm shortly with some code


 On 7/2/08, Igor Vaynberg [EMAIL PROTECTED] wrote:
 i dont think anything in wicket generates a directory listing. are you
 sure it is wicket code?

 -igor

 On Wed, Jul 2, 2008 at 8:59 AM, Leon Nieuwoudt [EMAIL PROTECTED]
 wrote:
 Hey guys

 I've been following the wicket-users list for quite some time to
 evaluate the community and momentum, and just want to say great job!
 before I continue ;)

 Now the question... I'm starting to create a new real-world app, and
 something happened that a Resource sent a Glassfish folder file
 listing.

 The URL I typed (incorrectly) was -
 http://localhost:8081/realapp-web/console/resources/com.realapp.console.web.page.AbstractConsoleWebPage/nyi

 ... which gave me this ...

 3RD-PARTY-LICENSE.txt
 addons
 bin
 CDDLGPLHeader.txt
 CDDLv1.0.txt
 config
 COPYRIGHT
 docs
 domains
 imq
 javadb
 jbi
 lib
 LICENSE.txt
 LICENSE-glassfish.txt
 passfile
 registry.properties
 registry.xml
 samples
 setup.xml
 setup-cluster.xml
 uninstall.sh
 updatecenter

 If i replace nyi with nyi.gif, then it gives me an exception (as
 expected)

 Any ideas? Thanks in advance!

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]