Re: [newbie] Wicket, Spring, Hibernate and transactions in views.

2010-03-02 Thread Pedro Sena
I don't think so.

I'd recommend you to make your transactional control in your services and
call them from your pages instead of trying to control it in your view.

Best Regards,

On Tue, Mar 2, 2010 at 1:25 PM, Colin Rogers coli...@groundsure.com wrote:

 All,



 I've got a bit of a newbie Wicket question involving Spring, Hibernate
 and transactions.



 The question that I can't seem to find an answer to;



 Can a view be a created/injected/aop'd like a spring bean so that it
 honours @Transactional methods for hibernate?



 An example;



 public class HomePage extends WebPage {



 @SpringBean // this is working fine

 private SessionFactory sessionFactory;



 public HomePage(final PageParameters parameters) {



 this.init();

  }



  @Transactional // this is not working

  public void init() {



Criteria criteria =
 sessionFactory.getCurrentSession().createCriteria(MyEntity.class);

ListMyEntity myEntities = criteria.list();

for( MyEntity myEntity : myEntities ) {



  // where subEntities is a lazy collection

  for( SubEntity subEntity : myEntity.getSubEntities() )
 {



// ...

  }

}

 }

 }



 I've been reading Wicket In Action book, various places on the net and
 of course, emails on the subject on this list and this particular
 tutorial;



 http://wicketinaction.com/2009/06/wicketspringhibernate-configuration/



 And I'm still wondering, is this something that is actually possible? I
 could full understand that it wouldn't be - i.e. that the injector only
 works for Spring injection dependency and not AOP or anything else. So
 you inject your dependencies - and they have transaction support etc.
 But that means I'll be having to force fetching of lazily fetched
 children from outside the views themselves, which is obviously very
 painful. It would be so much easier to have transaction support in the
 view itself and not have to delegate.



 Any help would be greatly appreciated.



 The error message I'm receiving is;



 Caused by: org.hibernate.HibernateException: createCriteria is not valid
 without active transaction

  at
 org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWra
 pper.invoke(ThreadLocalSessionContext.java:338)

  at $Proxy15.createCriteria(Unknown Source)

  at com.tenthart.tacs.testpres.HomePage.init(HomePage.java:39)

  at com.tenthart.tacs.testpres.HomePage.init(HomePage.java:28)

  ... 34 more



 Cheers,

 Col









 Emap delivers intelligence, inspiration and access through publications,
 events and data businesses in retail, media, the public sector and the built
 environment. www.emap.com.

 The information in or attached to this email is confidential and may be
 legally privileged. If you are not the intended recipient of this message
 any use, disclosure, copying, distribution or any action taken in reliance
 on it is prohibited and may be unlawful. If you have received this message
 in error, please notify the sender immediately by return email or by
 telephone on +44(0)207 728 5000 and delete this message and any copies from
 your computer and network. The Emap group does not warrant that this email
 and any attachments are free from viruses and accepts no liability for any
 loss resulting from infected email transmissions.

 The Emap group reserves the right to monitor all e-mail communications
 through its networks. Please note that any views expressed in this email may
 be those of the originator and do not necessarily reflect those of the Emap
 group.

 GroundSure Ltd. Company number 03421028 (England and Wales)
 Emap Limited. Company number: 0537204 (England and Wales).
 Registered Office: Greater London House, Hampstead Road, London NW1 7EJ,
 United Kingdom.
 Details of the operating companies forming part of the Emap group can be
 found at www.emap.com




-- 
/**
* Pedro Sena
* Systems Architect
* Sun Certified Java Programmer
* Sun Certified Web Component Developer
*/


Re: Announcing: visural-wicket 0.5 released - open source wicket components

2010-02-24 Thread Pedro Sena
Great Job!

I was looking for a Drop Down like that.

Thanks and keep the good work.

Regards,

On Wed, Feb 24, 2010 at 7:49 AM, Richard Nichols r...@visural.com wrote:

 Hi wicket-users,

 I'm currently the sole developer of an open-source set of Wicket components
 and utilties - visural-wicket.

 *visural-wicket is a useful set of light-weight, loosely coupled components
 and utilities for the Apache Wicket web framework.*
 *Each component is designed to be easily integrated into any existing
 Wicket
 application with minimal dependencies.*
 *Other than components, visural-wicket includes some other utilities that
 assist in the development of Wicket applications, such as an
 annotation-based mounting system, model templates and automatic form view
 mode component.*

 The project is licensed under the *Apache 2.0* licence. The download
 package
 includes full source + javadocs.

 The project page is at http://code.google.com/p/visural-wicket/ and there
 are live examples at http://visural-wicket-examples.appspot.com/

 I've been working on this project for around 4 months and it is now a
 mature
 and pretty stable set of tools for developing Wicket apps. I'm using it in
 my day-to-day work in some very large applications.

 I'd like to get some feedback and/or collaborators on the current state of
 the project, and hope that other members of the wicket community may find
 these components and utilities useful.

 cheers,
 Rich.

 --
 Richard Nichols :: http://www.visural.com/ ::
 http://www.richardnichols.net/




-- 
/**
* Pedro Sena
* Systems Architect
* Sun Certified Java Programmer
* Sun Certified Web Component Developer
*/


Re: How to store/load strings shared by many (but not all) pages?

2009-10-05 Thread Pedro Sena
I was thinking about this yesterday...

This is a very common scenario, specially for i18n messages related to
exceptions.

Thanks for the info =)


On Mon, Oct 5, 2009 at 9:52 AM, Robin Sander robin.san...@gmx.net wrote:


 Wicket uses a chain of resolvers, by default these are: (see Settings
 class)

  ComponentStringResourceLoader, PackageStringResourceLoader,
 ClassStringResourceLoader and ValidatorStringResourceLoader.

 So besides the component specific resource you may define respources per
 package (e.g. 'package_de.properties') and for the
 whole application, the latter named like your application class (e.g.
 MyApp.properties)




 On Oct 4, 2009, at 05:32, David Chang wrote:

  I am reading Wicket in Action and have this i18n/i10n-related question
 :

 Suppose that I have a string that is used on multiple (but NOT ALL) pages.
 One solution is that I can put this string in the property files for each
 page on which the string is used.

 Any other better solutions?

 Thanks for your input!




 -
 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




-- 
/**
* Pedro Sena
* Systems Architect
* Sun Certified Java Programmer
* Sun Certified Web Component Developer
*/


Re: How to list files by name in Eclipe's Package Explorer?

2009-10-05 Thread Pedro Sena
Package explorer?

At least here, Ctrl+Shift+R using wildcard (*) have replaced the Package
Explorer Tab =)

Regards,

On Mon, Oct 5, 2009 at 11:26 AM, T Ames tamesw...@gmail.com wrote:

 Your question should be Is it possible to?

 I have not found a way.  I have gotten used to it.



 On Mon, Oct 5, 2009 at 8:48 AM, David Chang david_q_zh...@yahoo.com
 wrote:

  Does anybody know the trick for this task? Thanks!
 
 
  --- On Sun, 10/4/09, David Chang david_q_zh...@yahoo.com wrote:
 
   From: David Chang david_q_zh...@yahoo.com
   Subject: How to list files by name in Eclipe's Package Explorer?
   To: users@wicket.apache.org
   Date: Sunday, October 4, 2009, 4:44 PM
   Hello,
  
   I am using Eclipse for devleopment. The files in its
   Package Explorer are listed by extensions: java files first.
   This is good for non-wicket development. Now each page's
   java and markup files are in the same directory and I hope
   to see them naturally stay together, which means making
   Package Explorer to list files by name.
  
   How to do this?
  
   Thank you!
  
  
  
  
   -
   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
 
 




-- 
/**
* Pedro Sena
* Systems Architect
* Sun Certified Java Programmer
* Sun Certified Web Component Developer
*/


Doubt with Link

2009-10-01 Thread Pedro Sena
Hi Guys,

First of all, sorry for a so newbie question, but I'm really a newbie in
Wicket.

I'm trying to add a Behaviou to my link, it works fine with
link.add(myBehaviourHere)

I'd like to know how to avoid any page redirect the link does. I left
onClick without code but it redirects to the page that I'm actually(expected
behavior)

Any tips?

Thanks in advance,

-- 
/**
* Pedro Sena
* Systems Architect
* Sun Certified Java Programmer
* Sun Certified Web Component Developer
*/


Re: Doubt with Link

2009-10-01 Thread Pedro Sena
It worked.

Thanks for the quick input.

Regards,

On Thu, Oct 1, 2009 at 5:53 PM, Pedro Santos pedros...@gmail.com wrote:

 Refresh the page is default link behavior, you may want to use AjaxLink to
 avoid it

 On Thu, Oct 1, 2009 at 5:44 PM, Pedro Sena sena.pe...@gmail.com wrote:

  Hi Guys,
 
  First of all, sorry for a so newbie question, but I'm really a newbie in
  Wicket.
 
  I'm trying to add a Behaviou to my link, it works fine with
  link.add(myBehaviourHere)
 
  I'd like to know how to avoid any page redirect the link does. I left
  onClick without code but it redirects to the page that I'm
  actually(expected
  behavior)
 
  Any tips?
 
  Thanks in advance,
 
  --
  /**
  * Pedro Sena
  * Systems Architect
  * Sun Certified Java Programmer
  * Sun Certified Web Component Developer
  */
 



 --
 Pedro Henrique Oliveira dos Santos




-- 
/**
* Pedro Sena
* Systems Architect
* Sun Certified Java Programmer
* Sun Certified Web Component Developer
*/


Doubt with Maven config

2009-09-27 Thread Pedro Sena
Hi Guys,

I'm using lolite archetype but I'm having a 'problem'

I want to run my tests (JUnit) and keep the Jetty server alive after the
tests.

Every time that I run my maven tests, it creates a Jetty server that is
killed at the end of the process.

I'm trying to do the same thing as Wicket in Action, I changed the
Start.java that comes with lolite but it not helped.

I'm sure that I'm missing some detail, I'd appreciate some help with it.

Thanks in advance

-- 
/**
* Pedro Sena
* Systems Architect
* Sun Certified Java Programmer
* Sun Certified Web Component Developer
*/


Re: Starting with Wicket, Spring, Maven and JDBC

2009-09-24 Thread Pedro Sena
I'll check them

Thanks Eric,

On Wed, Sep 23, 2009 at 8:08 PM, Erik Post eriksen...@gmail.com wrote:

 Well, besides iolite, you could take a look at wicket-phonebook and
 wicketopia. They're not JDBC but they both come with Spring
 preconfigured. The phonebook has a couple of example DAO's and iBatis
 (among others) set up. You could take those as a starting point and
 'add' JDBC.

 Cheers,
 Erik


 On Wed, Sep 23, 2009 at 11:33 PM, Pedro Sena sena.pe...@gmail.com wrote:
  Hi Guys,
 
  I'm new to Wicket with Spring(I never used Spring before, just Seam). I'm
  using lolite but it comes with JPA instead of JDBC.
 
  I would like to know if there is some archetype for the setup that I
  described in the title. I already checked wicket stuff if no luck.
 
  Thanks in advance,
  --
  /**
  * Pedro Sena
  * Systems Architect
  * Sun Certified Java Programmer
  * Sun Certified Web Component Developer
  */
 

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




-- 
/**
* Pedro Sena
* Systems Architect
* Sun Certified Java Programmer
* Sun Certified Web Component Developer
*/


Re: Starting with Wicket, Spring, Maven and JDBC

2009-09-24 Thread Pedro Sena
Wow,

Exactly what I was looking for!!!

Thanks a lot !!

On Thu, Sep 24, 2009 at 7:10 AM, Muro Copenhagen copenha...@gmail.comwrote:

 Hi Pedro

 Try Appfuse-light with the desired combination:

 https://appfuse-light.dev.java.net/servlets/ProjectDocumentList?folderID=8006expandFolder=8006folderID=0

 It should be at the bottom.

 Best Regards
 Muro

 On Thu, Sep 24, 2009 at 12:04 PM, Pedro Sena sena.pe...@gmail.com wrote:

  I'll check them
 
  Thanks Eric,
 
  On Wed, Sep 23, 2009 at 8:08 PM, Erik Post eriksen...@gmail.com wrote:
 
   Well, besides iolite, you could take a look at wicket-phonebook and
   wicketopia. They're not JDBC but they both come with Spring
   preconfigured. The phonebook has a couple of example DAO's and iBatis
   (among others) set up. You could take those as a starting point and
   'add' JDBC.
  
   Cheers,
   Erik
  
  
   On Wed, Sep 23, 2009 at 11:33 PM, Pedro Sena sena.pe...@gmail.com
  wrote:
Hi Guys,
   
I'm new to Wicket with Spring(I never used Spring before, just Seam).
  I'm
using lolite but it comes with JPA instead of JDBC.
   
I would like to know if there is some archetype for the setup that I
described in the title. I already checked wicket stuff if no luck.
   
Thanks in advance,
--
/**
* Pedro Sena
* Systems Architect
* Sun Certified Java Programmer
* Sun Certified Web Component Developer
*/
   
  
   -
   To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
   For additional commands, e-mail: users-h...@wicket.apache.org
  
  
 
 
  --
  /**
  * Pedro Sena
  * Systems Architect
  * Sun Certified Java Programmer
  * Sun Certified Web Component Developer
  */
 




-- 
/**
* Pedro Sena
* Systems Architect
* Sun Certified Java Programmer
* Sun Certified Web Component Developer
*/


Starting with Wicket, Spring, Maven and JDBC

2009-09-23 Thread Pedro Sena
Hi Guys,

I'm new to Wicket with Spring(I never used Spring before, just Seam). I'm
using lolite but it comes with JPA instead of JDBC.

I would like to know if there is some archetype for the setup that I
described in the title. I already checked wicket stuff if no luck.

Thanks in advance,
-- 
/**
* Pedro Sena
* Systems Architect
* Sun Certified Java Programmer
* Sun Certified Web Component Developer
*/