Re: IoC Service, call a method after instantiation/realization

2015-04-12 Thread Kalle Korhonen
Also, if you are using Hibernate or JPA, you should definitely check out
http://tynamo.org/tapestry-hibernate-seedentity+guide for the entity
seeding needs.

Kalle

On Sun, Apr 12, 2015 at 3:26 AM, Charlouze m...@charlouze.com wrote:

 Hey!

 The tapestry @startup annotation is to be used in modules. The annotated
 method will be called upon application startup after the registry setup. If
 you need those methods to be called in a specific order, you should
 contribute to RegistryStartup.

 I hope it'll help you.

 Le dim 12 avr. 2015 06:30, Chris Mylonas ch...@opencsta.org a écrit :

  Hi Tapestry Users,
 
  Tapestry development is on the horizon again for me and I'm just making
  some tweaks to an app that I'm trying to load in another CMS's iframe!
 
 
  After service class instantiation, I'd like to call a method so it does
  something (e.g. create an admin user if none exist)
 
   //annotate with tapestry service initlised post runner
   @PostInjection or @Startup
   private void createAdminUser(){
   SubnetsUser u = new SubnetsUser();
   u.setRole(Role.ADMIN);
   u.setEmail(ch...@opencsta.org);
   u.setPassword(subnets);
   save(u);
   }
 
  Is this the way?  Doesn't seem to be working at the moment for me
 
  Thanks
  Chris
 
  -
  To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
  For additional commands, e-mail: users-h...@tapestry.apache.org
 
 



Re: IoC Service, call a method after instantiation/realization

2015-04-12 Thread Chris Mylonas

Thanks guys, I'll play around with @Startup in the next day or so.

Unfortunately my workflow at the moment is tapestry/hibernate at prototype  
stage then moves to EJB with JPA when things get serious!



On Sun, 12 Apr 2015 20:36:51 +1000, Kalle Korhonen  
kalle.o.korho...@gmail.com wrote:



Also, if you are using Hibernate or JPA, you should definitely check out
http://tynamo.org/tapestry-hibernate-seedentity+guide for the entity
seeding needs.

Kalle

On Sun, Apr 12, 2015 at 3:26 AM, Charlouze m...@charlouze.com wrote:


Hey!

The tapestry @startup annotation is to be used in modules. The annotated
method will be called upon application startup after the registry  
setup. If

you need those methods to be called in a specific order, you should
contribute to RegistryStartup.

I hope it'll help you.

Le dim 12 avr. 2015 06:30, Chris Mylonas ch...@opencsta.org a écrit :

 Hi Tapestry Users,

 Tapestry development is on the horizon again for me and I'm just  
making

 some tweaks to an app that I'm trying to load in another CMS's iframe!


 After service class instantiation, I'd like to call a method so it  
does

 something (e.g. create an admin user if none exist)

  //annotate with tapestry service initlised post runner
  @PostInjection or @Startup
  private void createAdminUser(){
  SubnetsUser u = new SubnetsUser();
  u.setRole(Role.ADMIN);
  u.setEmail(ch...@opencsta.org);
  u.setPassword(subnets);
  save(u);
  }

 Is this the way?  Doesn't seem to be working at the moment for me

 Thanks
 Chris

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






--
Using Opera's mail client: http://www.opera.com/mail/

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



Re: IoC Service, call a method after instantiation/realization

2015-04-12 Thread Charlouze
Hey!

The tapestry @startup annotation is to be used in modules. The annotated
method will be called upon application startup after the registry setup. If
you need those methods to be called in a specific order, you should
contribute to RegistryStartup.

I hope it'll help you.

Le dim 12 avr. 2015 06:30, Chris Mylonas ch...@opencsta.org a écrit :

 Hi Tapestry Users,

 Tapestry development is on the horizon again for me and I'm just making
 some tweaks to an app that I'm trying to load in another CMS's iframe!


 After service class instantiation, I'd like to call a method so it does
 something (e.g. create an admin user if none exist)

  //annotate with tapestry service initlised post runner
  @PostInjection or @Startup
  private void createAdminUser(){
  SubnetsUser u = new SubnetsUser();
  u.setRole(Role.ADMIN);
  u.setEmail(ch...@opencsta.org);
  u.setPassword(subnets);
  save(u);
  }

 Is this the way?  Doesn't seem to be working at the moment for me

 Thanks
 Chris

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




IoC Service, call a method after instantiation/realization

2015-04-11 Thread Chris Mylonas

Hi Tapestry Users,

Tapestry development is on the horizon again for me and I'm just making  
some tweaks to an app that I'm trying to load in another CMS's iframe!



After service class instantiation, I'd like to call a method so it does  
something (e.g. create an admin user if none exist)


//annotate with tapestry service initlised post runner
@PostInjection or @Startup
private void createAdminUser(){
SubnetsUser u = new SubnetsUser();
u.setRole(Role.ADMIN);
u.setEmail(ch...@opencsta.org);
u.setPassword(subnets);
save(u);
}

Is this the way?  Doesn't seem to be working at the moment for me

Thanks
Chris

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