How to overrid configuration?

2008-09-03 Thread Jun Tsai
hi,all
  for example
 in TapestryModule

public void contribXX(MappedConfiguration config.){
  config.add(theId,locator.autobuild(XXX.class));
}

Now I want to overrid  theId Object?such as I want to override
EntityPersistentFieldStrategy  service .how to do?

thanks.



-- 
regards,
Jun Tsai


Re: editing a bean with a required password field

2008-09-03 Thread Ulrich Stärk
That still wouldn't solve the validation issue. If the user doesn't input
anything, validation will fail.

Uli

Am Di, 2.09.2008, 22:39, schrieb Carl Crowder:
 Why not just @Persist the password value in the session, only
 overwriting the value if the user submits something? That way the value
 gets kept but at the same time the clientside doesn't have the plaintext
 password.

 Thiago H. de Paula Figueiredo wrote:
 Em Tue, 02 Sep 2008 16:57:19 -0300, Martijn Brinkers
 [EMAIL PROTECTED] escreveu:
 really distrust applications that do not hash passwords. The mentioned
 problem can be solved my making a distinction between adding a new user
 (which requires a password) and editing a user (allow blank password
 indicating that the password should not be changed).

 It would be really nice if PasswordField did not set the corresponding
 property value nor validate it when the the user leaves the field empty.
 I think it would solve all (or almost all) the issues listed in this
 thread.

 Thiago

 -
 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]



T5: AjaxFormLoop parameter addRow

2008-09-03 Thread Sven Homburg
Hi there,

in one of the last tapestry commits, the parameter addRow from component
AjaxFormLoop
was changed to defaultBinding literal

makes that sense ?

-- 
with regards
Sven Homburg
http://www.chenillekit.org
http://tapestry5-components.googlecode.com


Re: Problem with aso

2008-09-03 Thread Natia Gdzelishvili
can anyone help me, what I'm doing wrong...

On Wed, Sep 3, 2008 at 11:06 AM, Natia Gdzelishvili [EMAIL PROTECTED]
 wrote:

 I'm using tapestry 5.0.14 ,i vahe problem with aso, my code is:

 public class Login {
 private String username;
 private String password;
 @Inject
 private IBusinessServicesLocator _businessServicesLocator;
 @ApplicationState
 private User currUser;
 private boolean userExists;


 public String getUsername() {
 return username;
 }

 public void setUsername(String username) {
 this.username = username;
 }

 public String getPassword() {
 return password;
 }

 public void setPassword(String password) {
 this.password = password;
 }

 @SuppressWarnings(unchecked)
 @OnEvent(value = submit, component = loginForm)
 public Object submitLoginForm() {
 Class nextPage;
 try {
 User u=getMerchantCreator().login(username, password); //*returns
 some object*
 currUser = u; /*/ currUser object cannot be resolved*
 nextPage = ViewAllMerchants.class;

 } catch (UserNotFoundException e) {
 nextPage = Login.class;
 e.printStackTrace();
 }
 return nextPage;
 }

 private IMerchantCreatorLocal getMerchantCreator() {
 return _businessServicesLocator.getMerchantCreatorLocal();
 }
 }

 i cannot access curruser...
 please help..



Re: Problem with aso

2008-09-03 Thread Sven Homburg
any exception stack ?

2008/9/3 Natia Gdzelishvili [EMAIL PROTECTED]

 I'm using tapestry 5.0.14 ,i vahe problem with aso, my code is:

 public class Login {
private String username;
private String password;
@Inject
private IBusinessServicesLocator _businessServicesLocator;
@ApplicationState
private User currUser;
private boolean userExists;


public String getUsername() {
return username;
}

public void setUsername(String username) {
this.username = username;
}

public String getPassword() {
return password;
}

public void setPassword(String password) {
this.password = password;
}

@SuppressWarnings(unchecked)
@OnEvent(value = submit, component = loginForm)
public Object submitLoginForm() {
Class nextPage;
try {
User u=getMerchantCreator().login(username, password);
 //*returns
 some object*
currUser = u; /*/ currUser object cannot be resolved*
nextPage = ViewAllMerchants.class;

} catch (UserNotFoundException e) {
nextPage = Login.class;
e.printStackTrace();
}
return nextPage;
}

private IMerchantCreatorLocal getMerchantCreator() {
return _businessServicesLocator.getMerchantCreatorLocal();
}
 }

 i cannot access curruser...
 please help..




-- 
with regards
Sven Homburg
http://www.chenillekit.org
http://tapestry5-components.googlecode.com


Re: Problem with aso

2008-09-03 Thread Natia Gdzelishvili
no

On Wed, Sep 3, 2008 at 12:52 PM, Sven Homburg [EMAIL PROTECTED]wrote:

 any exception stack ?

 2008/9/3 Natia Gdzelishvili [EMAIL PROTECTED]

  I'm using tapestry 5.0.14 ,i vahe problem with aso, my code is:
 
  public class Login {
 private String username;
 private String password;
 @Inject
 private IBusinessServicesLocator _businessServicesLocator;
 @ApplicationState
 private User currUser;
 private boolean userExists;
 
 
 public String getUsername() {
 return username;
 }
 
 public void setUsername(String username) {
 this.username = username;
 }
 
 public String getPassword() {
 return password;
 }
 
 public void setPassword(String password) {
 this.password = password;
 }
 
 @SuppressWarnings(unchecked)
 @OnEvent(value = submit, component = loginForm)
 public Object submitLoginForm() {
 Class nextPage;
 try {
 User u=getMerchantCreator().login(username, password);
  //*returns
  some object*
 currUser = u; /*/ currUser object cannot be resolved*
 nextPage = ViewAllMerchants.class;
 
 } catch (UserNotFoundException e) {
 nextPage = Login.class;
 e.printStackTrace();
 }
 return nextPage;
 }
 
 private IMerchantCreatorLocal getMerchantCreator() {
 return _businessServicesLocator.getMerchantCreatorLocal();
 }
  }
 
  i cannot access curruser...
  please help..
 



 --
 with regards
 Sven Homburg
 http://www.chenillekit.org
 http://tapestry5-components.googlecode.com



Re: Problem with aso

2008-09-03 Thread Martijn Brinkers
Just a guess,

I'm not sure, correct me if I'm wrong, but I don't think you can just
replace the ASO like you are doing.

getMerchantCreator().login probably does not return an ASO object. You
should make a shallow copy (ie copy all relevant info) from the returned
object to you ASO object.

Martijn

On Wed, 2008-09-03 at 12:56 +0400, Natia Gdzelishvili wrote:
 no
 
 On Wed, Sep 3, 2008 at 12:52 PM, Sven Homburg [EMAIL PROTECTED]wrote:
 
  any exception stack ?
 
  2008/9/3 Natia Gdzelishvili [EMAIL PROTECTED]
 
   I'm using tapestry 5.0.14 ,i vahe problem with aso, my code is:
  
   public class Login {
  private String username;
  private String password;
  @Inject
  private IBusinessServicesLocator _businessServicesLocator;
  @ApplicationState
  private User currUser;
  private boolean userExists;
  
  
  public String getUsername() {
  return username;
  }
  
  public void setUsername(String username) {
  this.username = username;
  }
  
  public String getPassword() {
  return password;
  }
  
  public void setPassword(String password) {
  this.password = password;
  }
  
  @SuppressWarnings(unchecked)
  @OnEvent(value = submit, component = loginForm)
  public Object submitLoginForm() {
  Class nextPage;
  try {
  User u=getMerchantCreator().login(username, password);
   //*returns
   some object*
  currUser = u; /*/ currUser object cannot be resolved*
  nextPage = ViewAllMerchants.class;
  
  } catch (UserNotFoundException e) {
  nextPage = Login.class;
  e.printStackTrace();
  }
  return nextPage;
  }
  
  private IMerchantCreatorLocal getMerchantCreator() {
  return _businessServicesLocator.getMerchantCreatorLocal();
  }
   }
  
   i cannot access curruser...
   please help..
  
 
 
 
  --
  with regards
  Sven Homburg
  http://www.chenillekit.org
  http://tapestry5-components.googlecode.com
 


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



Re: Problem with aso

2008-09-03 Thread Hugo Palma
When you say that you can't access currUser what exactly does that mean 
? That it's always null ?


Natia Gdzelishvili wrote:

I'm using tapestry 5.0.14 ,i vahe problem with aso, my code is:

public class Login {
private String username;
private String password;
@Inject
private IBusinessServicesLocator _businessServicesLocator;
@ApplicationState
private User currUser;
private boolean userExists;


public String getUsername() {
return username;
}

public void setUsername(String username) {
this.username = username;
}

public String getPassword() {
return password;
}

public void setPassword(String password) {
this.password = password;
}

@SuppressWarnings(unchecked)
@OnEvent(value = submit, component = loginForm)
public Object submitLoginForm() {
Class nextPage;
try {
User u=getMerchantCreator().login(username, password); //*returns
some object*
currUser = u; /*/ currUser object cannot be resolved*
nextPage = ViewAllMerchants.class;

} catch (UserNotFoundException e) {
nextPage = Login.class;
e.printStackTrace();
}
return nextPage;
}

private IMerchantCreatorLocal getMerchantCreator() {
return _businessServicesLocator.getMerchantCreatorLocal();
}
}

i cannot access curruser...
please help..

  


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



Re: Problem with aso

2008-09-03 Thread Natia Gdzelishvili
no assignment cant be done
 currUser = u;  // currUser cannot be resolved when i;m inspecting
currUser

On Wed, Sep 3, 2008 at 1:02 PM, Hugo Palma [EMAIL PROTECTED] wrote:

 When you say that you can't access currUser what exactly does that mean ?
 That it's always null ?


 Natia Gdzelishvili wrote:

 I'm using tapestry 5.0.14 ,i vahe problem with aso, my code is:

 public class Login {
private String username;
private String password;
@Inject
private IBusinessServicesLocator _businessServicesLocator;
@ApplicationState
private User currUser;
private boolean userExists;


public String getUsername() {
return username;
}

public void setUsername(String username) {
this.username = username;
}

public String getPassword() {
return password;
}

public void setPassword(String password) {
this.password = password;
}

@SuppressWarnings(unchecked)
@OnEvent(value = submit, component = loginForm)
public Object submitLoginForm() {
Class nextPage;
try {
User u=getMerchantCreator().login(username, password);
 //*returns
 some object*
currUser = u; /*/ currUser object cannot be resolved*
nextPage = ViewAllMerchants.class;

} catch (UserNotFoundException e) {
nextPage = Login.class;
e.printStackTrace();
}
return nextPage;
}

private IMerchantCreatorLocal getMerchantCreator() {
return _businessServicesLocator.getMerchantCreatorLocal();
}
 }

 i cannot access curruser...
 please help..




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




Re: Problem with aso

2008-09-03 Thread José Paumard

Natia,

I think there is a mistake in your code :

private User currUser ;
private boolean userExists ;

I dont think T5 will link userExists and currUser, currUser should be 
named user, or userExists currUserExists (please correct me if I'm wrong).


That said, what do you mean I cant access currUser, do you mean that 
the ASO is null in other classes that want to read it ? Or do you mean 
that userExists is always false (which is normal, see above).


José

Natia Gdzelishvili a écrit :

I'm using tapestry 5.0.14 ,i vahe problem with aso, my code is:

public class Login {
private String username;
private String password;
@Inject
private IBusinessServicesLocator _businessServicesLocator;
@ApplicationState
private User currUser;
private boolean userExists;


public String getUsername() {
return username;
}

public void setUsername(String username) {
this.username = username;
}

public String getPassword() {
return password;
}

public void setPassword(String password) {
this.password = password;
}

@SuppressWarnings(unchecked)
@OnEvent(value = submit, component = loginForm)
public Object submitLoginForm() {
Class nextPage;
try {
User u=getMerchantCreator().login(username, password); //*returns
some object*
currUser = u; /*/ currUser object cannot be resolved*
nextPage = ViewAllMerchants.class;

} catch (UserNotFoundException e) {
nextPage = Login.class;
e.printStackTrace();
}
return nextPage;
}

private IMerchantCreatorLocal getMerchantCreator() {
return _businessServicesLocator.getMerchantCreatorLocal();
}
}

i cannot access curruser...
please help..

  



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



Re: Problem with aso

2008-09-03 Thread Hugo Palma
You could also add the created=false parameter to the ApplicationState 
annotation if you want to keep the assignment and not have to copy every 
field to the ASO object.


Martijn Brinkers wrote:

Just a guess,

I'm not sure, correct me if I'm wrong, but I don't think you can just
replace the ASO like you are doing.

getMerchantCreator().login probably does not return an ASO object. You
should make a shallow copy (ie copy all relevant info) from the returned
object to you ASO object.

Martijn

On Wed, 2008-09-03 at 12:56 +0400, Natia Gdzelishvili wrote:
  

no

On Wed, Sep 3, 2008 at 12:52 PM, Sven Homburg [EMAIL PROTECTED]wrote:



any exception stack ?

2008/9/3 Natia Gdzelishvili [EMAIL PROTECTED]

  

I'm using tapestry 5.0.14 ,i vahe problem with aso, my code is:

public class Login {
   private String username;
   private String password;
   @Inject
   private IBusinessServicesLocator _businessServicesLocator;
   @ApplicationState
   private User currUser;
   private boolean userExists;


   public String getUsername() {
   return username;
   }

   public void setUsername(String username) {
   this.username = username;
   }

   public String getPassword() {
   return password;
   }

   public void setPassword(String password) {
   this.password = password;
   }

   @SuppressWarnings(unchecked)
   @OnEvent(value = submit, component = loginForm)
   public Object submitLoginForm() {
   Class nextPage;
   try {
   User u=getMerchantCreator().login(username, password);
//*returns
some object*
   currUser = u; /*/ currUser object cannot be resolved*
   nextPage = ViewAllMerchants.class;

   } catch (UserNotFoundException e) {
   nextPage = Login.class;
   e.printStackTrace();
   }
   return nextPage;
   }

   private IMerchantCreatorLocal getMerchantCreator() {
   return _businessServicesLocator.getMerchantCreatorLocal();
   }
}

i cannot access curruser...
please help..




--
with regards
Sven Homburg
http://www.chenillekit.org
http://tapestry5-components.googlecode.com

  



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


  


Re: Problem with aso

2008-09-03 Thread Fernando Padilla
Also, i thought you were to think of an ASO almost as a singleton or a 
service.  Tapestry will create it for you on first access.  I didn't 
know you could set it.  Even if I'm wrong, using this design pattern 
might clean things up a little.



So you should use another class to contain a reference to the current 
active user, call it UserContainer.



@AplicationState
private UserContainer currUser;


and it would have methods like:

currUser.hasUser()
currUser.setUser(User user)
currUser.getUser()


or whatever you like.



José Paumard wrote:

Natia,

I think there is a mistake in your code :

private User currUser ;
private boolean userExists ;

I dont think T5 will link userExists and currUser, currUser should be 
named user, or userExists currUserExists (please correct me if I'm wrong).


That said, what do you mean I cant access currUser, do you mean that 
the ASO is null in other classes that want to read it ? Or do you mean 
that userExists is always false (which is normal, see above).


José

Natia Gdzelishvili a écrit :

I'm using tapestry 5.0.14 ,i vahe problem with aso, my code is:

public class Login {
private String username;
private String password;
@Inject
private IBusinessServicesLocator _businessServicesLocator;
@ApplicationState
private User currUser;
private boolean userExists;


public String getUsername() {
return username;
}

public void setUsername(String username) {
this.username = username;
}

public String getPassword() {
return password;
}

public void setPassword(String password) {
this.password = password;
}

@SuppressWarnings(unchecked)
@OnEvent(value = submit, component = loginForm)
public Object submitLoginForm() {
Class nextPage;
try {
User u=getMerchantCreator().login(username, password); 
//*returns

some object*
currUser = u; /*/ currUser object cannot be resolved*
nextPage = ViewAllMerchants.class;

} catch (UserNotFoundException e) {
nextPage = Login.class;
e.printStackTrace();
}
return nextPage;
}

private IMerchantCreatorLocal getMerchantCreator() {
return _businessServicesLocator.getMerchantCreatorLocal();
}
}

i cannot access curruser...
please help..

  



-
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]



Overriding Default Styles

2008-09-03 Thread Peter Stavrinides
Hi 

I would like to know how to override Tapestry's default styles, particularly:

1. Individual styles like validation error popups
2. Component styles

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



Re: Overriding Default Styles

2008-09-03 Thread Ulrich Stärk
Tapestry's styles are included via default.css which can be found here:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/default.css?view=markup
Just include some css overriding those styles or change the configuration
symbol tapestry.default-stylesheet to your own default stylesheet.

Uli

Am Mi, 3.09.2008, 11:27, schrieb Peter Stavrinides:
 Hi

 I would like to know how to override Tapestry's default styles,
 particularly:

 1. Individual styles like validation error popups
 2. Component styles

 -
 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: Overriding Default Styles

2008-09-03 Thread Peter Stavrinides
hmmm not ideal, especially for components, I was hoping there was something 
more along the lines of:
renderSupport_.addStylesheetLink(stylesheet, media);

or even better:
renderSupport_.overrideStylesheetLink(stylesheet, media);




- Original Message -
From: Ulrich Stärk [EMAIL PROTECTED]
To: Tapestry users users@tapestry.apache.org
Sent: Wednesday, 3 September, 2008 12:44:12 PM GMT +02:00 Athens, Beirut, 
Bucharest, Istanbul
Subject: Re: Overriding Default Styles

Tapestry's styles are included via default.css which can be found here:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/default.css?view=markup
Just include some css overriding those styles or change the configuration
symbol tapestry.default-stylesheet to your own default stylesheet.

Uli

Am Mi, 3.09.2008, 11:27, schrieb Peter Stavrinides:
 Hi

 I would like to know how to override Tapestry's default styles,
 particularly:

 1. Individual styles like validation error popups
 2. Component styles

 -
 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: Overriding Default Styles

2008-09-03 Thread Ulrich Stärk
I don't quite understand. A stylesheet is an asset and we already got
RenderSupport.addStylesheetLink(asset, media)... Just write your css,
create an asset and pass it to addStylesheetLink().

Uli

Am Mi, 3.09.2008, 12:16, schrieb Peter Stavrinides:
 hmmm not ideal, especially for components, I was hoping there was
 something more along the lines of:
 renderSupport_.addStylesheetLink(stylesheet, media);

 or even better:
 renderSupport_.overrideStylesheetLink(stylesheet, media);




 - Original Message -
 From: Ulrich Stärk [EMAIL PROTECTED]
 To: Tapestry users users@tapestry.apache.org
 Sent: Wednesday, 3 September, 2008 12:44:12 PM GMT +02:00 Athens, Beirut,
 Bucharest, Istanbul
 Subject: Re: Overriding Default Styles

 Tapestry's styles are included via default.css which can be found here:
 http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/default.css?view=markup
 Just include some css overriding those styles or change the configuration
 symbol tapestry.default-stylesheet to your own default stylesheet.

 Uli

 Am Mi, 3.09.2008, 11:27, schrieb Peter Stavrinides:
 Hi

 I would like to know how to override Tapestry's default styles,
 particularly:

 1. Individual styles like validation error popups
 2. Component styles

 -
 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]





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



Re: Problem with aso

2008-09-03 Thread Natia Gdzelishvili
I'm not using userExists,
in tapestry 5.0.9 everything was working, i was doing the same

On Wed, Sep 3, 2008 at 1:24 PM, Fernando Padilla [EMAIL PROTECTED] wrote:

 Also, i thought you were to think of an ASO almost as a singleton or a
 service.  Tapestry will create it for you on first access.  I didn't know
 you could set it.  Even if I'm wrong, using this design pattern might clean
 things up a little.


 So you should use another class to contain a reference to the current
 active user, call it UserContainer.


 @AplicationState
 private UserContainer currUser;


 and it would have methods like:

 currUser.hasUser()
 currUser.setUser(User user)
 currUser.getUser()


 or whatever you like.




 José Paumard wrote:

 Natia,

 I think there is a mistake in your code :

 private User currUser ;
 private boolean userExists ;

 I dont think T5 will link userExists and currUser, currUser should be
 named user, or userExists currUserExists (please correct me if I'm wrong).

 That said, what do you mean I cant access currUser, do you mean that the
 ASO is null in other classes that want to read it ? Or do you mean that
 userExists is always false (which is normal, see above).

 José

 Natia Gdzelishvili a écrit :

 I'm using tapestry 5.0.14 ,i vahe problem with aso, my code is:

 public class Login {
private String username;
private String password;
@Inject
private IBusinessServicesLocator _businessServicesLocator;
@ApplicationState
private User currUser;
private boolean userExists;


public String getUsername() {
return username;
}

public void setUsername(String username) {
this.username = username;
}

public String getPassword() {
return password;
}

public void setPassword(String password) {
this.password = password;
}

@SuppressWarnings(unchecked)
@OnEvent(value = submit, component = loginForm)
public Object submitLoginForm() {
Class nextPage;
try {
User u=getMerchantCreator().login(username, password);
 //*returns
 some object*
currUser = u; /*/ currUser object cannot be resolved*
nextPage = ViewAllMerchants.class;

} catch (UserNotFoundException e) {
nextPage = Login.class;
e.printStackTrace();
}
return nextPage;
}

private IMerchantCreatorLocal getMerchantCreator() {
return _businessServicesLocator.getMerchantCreatorLocal();
}
 }

 i cannot access curruser...
 please help..





 -
 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: Problem with aso

2008-09-03 Thread Natia Gdzelishvili
I've tried to do this:
currUser=new User();
and then set some values but it does not work...

On Wed, Sep 3, 2008 at 2:26 PM, Natia Gdzelishvili
[EMAIL PROTECTED]wrote:

 I'm not using userExists,
 in tapestry 5.0.9 everything was working, i was doing the same


 On Wed, Sep 3, 2008 at 1:24 PM, Fernando Padilla [EMAIL PROTECTED]wrote:

 Also, i thought you were to think of an ASO almost as a singleton or a
 service.  Tapestry will create it for you on first access.  I didn't know
 you could set it.  Even if I'm wrong, using this design pattern might clean
 things up a little.


 So you should use another class to contain a reference to the current
 active user, call it UserContainer.


 @AplicationState
 private UserContainer currUser;


 and it would have methods like:

 currUser.hasUser()
 currUser.setUser(User user)
 currUser.getUser()


 or whatever you like.




 José Paumard wrote:

 Natia,

 I think there is a mistake in your code :

 private User currUser ;
 private boolean userExists ;

 I dont think T5 will link userExists and currUser, currUser should be
 named user, or userExists currUserExists (please correct me if I'm wrong).

 That said, what do you mean I cant access currUser, do you mean that
 the ASO is null in other classes that want to read it ? Or do you mean that
 userExists is always false (which is normal, see above).

 José

 Natia Gdzelishvili a écrit :

 I'm using tapestry 5.0.14 ,i vahe problem with aso, my code is:

 public class Login {
private String username;
private String password;
@Inject
private IBusinessServicesLocator _businessServicesLocator;
@ApplicationState
private User currUser;
private boolean userExists;


public String getUsername() {
return username;
}

public void setUsername(String username) {
this.username = username;
}

public String getPassword() {
return password;
}

public void setPassword(String password) {
this.password = password;
}

@SuppressWarnings(unchecked)
@OnEvent(value = submit, component = loginForm)
public Object submitLoginForm() {
Class nextPage;
try {
User u=getMerchantCreator().login(username, password);
 //*returns
 some object*
currUser = u; /*/ currUser object cannot be resolved*
nextPage = ViewAllMerchants.class;

} catch (UserNotFoundException e) {
nextPage = Login.class;
e.printStackTrace();
}
return nextPage;
}

private IMerchantCreatorLocal getMerchantCreator() {
return _businessServicesLocator.getMerchantCreatorLocal();
}
 }

 i cannot access curruser...
 please help..





 -
 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: Problem with aso

2008-09-03 Thread Sven Homburg
the aso created internal by tapestry
you should not create the object by youself

aso should used as container

2008/9/3 Natia Gdzelishvili [EMAIL PROTECTED]

 I'm not using userExists,
 in tapestry 5.0.9 everything was working, i was doing the same

 On Wed, Sep 3, 2008 at 1:24 PM, Fernando Padilla [EMAIL PROTECTED]
 wrote:

  Also, i thought you were to think of an ASO almost as a singleton or a
  service.  Tapestry will create it for you on first access.  I didn't know
  you could set it.  Even if I'm wrong, using this design pattern might
 clean
  things up a little.
 
 
  So you should use another class to contain a reference to the current
  active user, call it UserContainer.
 
 
  @AplicationState
  private UserContainer currUser;
 
 
  and it would have methods like:
 
  currUser.hasUser()
  currUser.setUser(User user)
  currUser.getUser()
 
 
  or whatever you like.
 
 
 
 
  José Paumard wrote:
 
  Natia,
 
  I think there is a mistake in your code :
 
  private User currUser ;
  private boolean userExists ;
 
  I dont think T5 will link userExists and currUser, currUser should be
  named user, or userExists currUserExists (please correct me if I'm
 wrong).
 
  That said, what do you mean I cant access currUser, do you mean that
 the
  ASO is null in other classes that want to read it ? Or do you mean that
  userExists is always false (which is normal, see above).
 
  José
 
  Natia Gdzelishvili a écrit :
 
  I'm using tapestry 5.0.14 ,i vahe problem with aso, my code is:
 
  public class Login {
 private String username;
 private String password;
 @Inject
 private IBusinessServicesLocator _businessServicesLocator;
 @ApplicationState
 private User currUser;
 private boolean userExists;
 
 
 public String getUsername() {
 return username;
 }
 
 public void setUsername(String username) {
 this.username = username;
 }
 
 public String getPassword() {
 return password;
 }
 
 public void setPassword(String password) {
 this.password = password;
 }
 
 @SuppressWarnings(unchecked)
 @OnEvent(value = submit, component = loginForm)
 public Object submitLoginForm() {
 Class nextPage;
 try {
 User u=getMerchantCreator().login(username, password);
  //*returns
  some object*
 currUser = u; /*/ currUser object cannot be resolved*
 nextPage = ViewAllMerchants.class;
 
 } catch (UserNotFoundException e) {
 nextPage = Login.class;
 e.printStackTrace();
 }
 return nextPage;
 }
 
 private IMerchantCreatorLocal getMerchantCreator() {
 return _businessServicesLocator.getMerchantCreatorLocal();
 }
  }
 
  i cannot access curruser...
  please help..
 
 
 
 
 
  -
  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]
 
 




-- 
with regards
Sven Homburg
http://www.chenillekit.org
http://tapestry5-components.googlecode.com


Re: Problem with aso

2008-09-03 Thread Sven Homburg
a short sample

public class UserASOUSER extends IUser
{
private USER userEntity;
private Logger logger;

public UserASO(final Logger logger)
{
this.logger = logger;
logger.info(UserASO created);
}

public USER getUserEntity()
{
return userEntity;
}

public void setUserEntity(USER userEntity)
{
this.userEntity = userEntity;
}

public boolean isLoggedIn()
{
return getUserEntity() != null;
}
}

public static void contributeASOs(final Logger logger,
  @InjectService(Request)Request
request,
  MappedConfigurationClass,
ApplicationStateContribution configuration)
{
ApplicationStateCreatorUserASO creator = new
ApplicationStateCreatorUserASO()
{
public UserASO create()
{
return new VisitStateObjectUser(logger);
}
};

configuration.add(UserASO.class, new
ApplicationStateContribution(session, creator));
}

@ApplicationState
private UserASO userASO;

userASO.setUser(yourUserObject);



2008/9/3 Sven Homburg [EMAIL PROTECTED]

 the aso created internal by tapestry
 you should not create the object by youself

 aso should used as container

 2008/9/3 Natia Gdzelishvili [EMAIL PROTECTED]

 I'm not using userExists,
 in tapestry 5.0.9 everything was working, i was doing the same

 On Wed, Sep 3, 2008 at 1:24 PM, Fernando Padilla [EMAIL PROTECTED]
 wrote:

  Also, i thought you were to think of an ASO almost as a singleton or a
  service.  Tapestry will create it for you on first access.  I didn't
 know
  you could set it.  Even if I'm wrong, using this design pattern might
 clean
  things up a little.
 
 
  So you should use another class to contain a reference to the current
  active user, call it UserContainer.
 
 
  @AplicationState
  private UserContainer currUser;
 
 
  and it would have methods like:
 
  currUser.hasUser()
  currUser.setUser(User user)
  currUser.getUser()
 
 
  or whatever you like.
 
 
 
 
  José Paumard wrote:
 
  Natia,
 
  I think there is a mistake in your code :
 
  private User currUser ;
  private boolean userExists ;
 
  I dont think T5 will link userExists and currUser, currUser should be
  named user, or userExists currUserExists (please correct me if I'm
 wrong).
 
  That said, what do you mean I cant access currUser, do you mean that
 the
  ASO is null in other classes that want to read it ? Or do you mean that
  userExists is always false (which is normal, see above).
 
  José
 
  Natia Gdzelishvili a écrit :
 
  I'm using tapestry 5.0.14 ,i vahe problem with aso, my code is:
 
  public class Login {
 private String username;
 private String password;
 @Inject
 private IBusinessServicesLocator _businessServicesLocator;
 @ApplicationState
 private User currUser;
 private boolean userExists;
 
 
 public String getUsername() {
 return username;
 }
 
 public void setUsername(String username) {
 this.username = username;
 }
 
 public String getPassword() {
 return password;
 }
 
 public void setPassword(String password) {
 this.password = password;
 }
 
 @SuppressWarnings(unchecked)
 @OnEvent(value = submit, component = loginForm)
 public Object submitLoginForm() {
 Class nextPage;
 try {
 User u=getMerchantCreator().login(username, password);
  //*returns
  some object*
 currUser = u; /*/ currUser object cannot be resolved*
 nextPage = ViewAllMerchants.class;
 
 } catch (UserNotFoundException e) {
 nextPage = Login.class;
 e.printStackTrace();
 }
 return nextPage;
 }
 
 private IMerchantCreatorLocal getMerchantCreator() {
 return _businessServicesLocator.getMerchantCreatorLocal();
 }
  }
 
  i cannot access curruser...
  please help..
 
 
 
 
 
  -
  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]
 
 




 --
 with regards
 Sven Homburg
 http://www.chenillekit.org
 http://tapestry5-components.googlecode.com




-- 
with regards
Sven Homburg
http://www.chenillekit.org
http://tapestry5-components.googlecode.com


Re: Problem with aso

2008-09-03 Thread Hugo Palma

You have two ways of setting the currUser DAO:

1. Copy fields from one object to another.
Just add this to your code:

currUser.setUsername(user.getUsername);
currUser.setPassword(user.getPassword);
.

You don't have to assign the currUser field. That will the done for you 
by Tapestry.


2. Declare the ASO like this:

@ApplicationState(created=false)
private User currUser;

assign the field like this:

currUser = u;

Natia Gdzelishvili wrote:

I've tried to do this:
currUser=new User();
and then set some values but it does not work...

On Wed, Sep 3, 2008 at 2:26 PM, Natia Gdzelishvili
[EMAIL PROTECTED]wrote:

  

I'm not using userExists,
in tapestry 5.0.9 everything was working, i was doing the same


On Wed, Sep 3, 2008 at 1:24 PM, Fernando Padilla [EMAIL PROTECTED]wrote:



Also, i thought you were to think of an ASO almost as a singleton or a
service.  Tapestry will create it for you on first access.  I didn't know
you could set it.  Even if I'm wrong, using this design pattern might clean
things up a little.


So you should use another class to contain a reference to the current
active user, call it UserContainer.


@AplicationState
private UserContainer currUser;


and it would have methods like:

currUser.hasUser()
currUser.setUser(User user)
currUser.getUser()


or whatever you like.




José Paumard wrote:

  

Natia,

I think there is a mistake in your code :

private User currUser ;
private boolean userExists ;

I dont think T5 will link userExists and currUser, currUser should be
named user, or userExists currUserExists (please correct me if I'm wrong).

That said, what do you mean I cant access currUser, do you mean that
the ASO is null in other classes that want to read it ? Or do you mean that
userExists is always false (which is normal, see above).

José

Natia Gdzelishvili a écrit :



I'm using tapestry 5.0.14 ,i vahe problem with aso, my code is:

public class Login {
   private String username;
   private String password;
   @Inject
   private IBusinessServicesLocator _businessServicesLocator;
   @ApplicationState
   private User currUser;
   private boolean userExists;


   public String getUsername() {
   return username;
   }

   public void setUsername(String username) {
   this.username = username;
   }

   public String getPassword() {
   return password;
   }

   public void setPassword(String password) {
   this.password = password;
   }

   @SuppressWarnings(unchecked)
   @OnEvent(value = submit, component = loginForm)
   public Object submitLoginForm() {
   Class nextPage;
   try {
   User u=getMerchantCreator().login(username, password);
//*returns
some object*
   currUser = u; /*/ currUser object cannot be resolved*
   nextPage = ViewAllMerchants.class;

   } catch (UserNotFoundException e) {
   nextPage = Login.class;
   e.printStackTrace();
   }
   return nextPage;
   }

   private IMerchantCreatorLocal getMerchantCreator() {
   return _businessServicesLocator.getMerchantCreatorLocal();
   }
}

i cannot access curruser...
please help..



  

-
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: Problem with aso - a further query

2008-09-03 Thread photos

Quoting Hugo Palma [EMAIL PROTECTED]:


You have two ways of setting the currUser DAO:

1. Copy fields from one object to another.
Just add this to your code:

currUser.setUsername(user.getUsername);
currUser.setPassword(user.getPassword);
.

You don't have to assign the currUser field. That will the done for you
by Tapestry.

2. Declare the ASO like this:

@ApplicationState(created=false)
private User currUser;

assign the field like this:

currUser = u;




In which case I am getting confused reading this thread because I have  
not done it that way and it works (unlike that for the OP):



public class Index
{

...

@ApplicationState
private User user;

...

Object onSubmitFromLoginForm()
{
Class nextPage = null;
		User authenticatedUser =  
Security.getSecurity().authenticate(userName, password, session);


if (authenticatedUser != null)
{

if (authenticatedUser.getRole() == User.Role.admin)
{
nextPage = Administration.class;
}

else
{
nextPage = UserAdministration.class;
}

user= authenticatedUser;

}
else
...


So why does this work?  Or am I getting myself confused - to me it  
looks like my code and that of the OP work in the same way, and yet I  
can see why it shouldn't work...






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



[ANN] JumpStart 3.13 for Tapestry 5.0.14

2008-09-03 Thread Geoff Callender

Hi all,

JumpStart 3.13 is now available, in an on-line demo at

http://202.177.217.122:8080/jumpstart/

and for download at

http://files.doublenegative.com.au/jumpstart .

To all experienced users of Tapestry, please scour it for inaccuracies  
and let me know here or via the links in JumpStart.


This version includes:

	* A rework of code and explanations to do with PageLinks,  
ActionLinks, and EventLinks.
	* Better use (I hope you agree) of setupRender, onActivate and  
onPassivate.
	* Examples of Storing in a Page, Sharing Across Multiple Pages,  
Sharing Across the Application, Handling a Bad Context, Easy Id  
Select, and EJB3.
	* The app now has Roles and UserRoles maintenance.  This lays the  
foundation for authorisation checking in future.
	* The business layer now has tests of all business exception classes  
and entity relationships.
	* Examples of one-to-many association, aggregation, and composition  
relationships (in the workout package of the downloadable project).


As always, comments and suggestions are encouraged.  Be helpful or  
brutal - I don't care which - because it all helps to make this stuff  
more useful.


Cheers,

Geoff

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



Re: Problem with aso

2008-09-03 Thread Marcus
Hi Natia,

Can you post ASO code?

Marcus


Re: Problem with aso

2008-09-03 Thread Carl Crowder
Is this actually a compilation error?

Natia Gdzelishvili wrote:
 in version 5.0.9 it is working
 
 I've addedvist class but still same situation _visit cannot be resolved
 
 On Wed, Sep 3, 2008 at 3:44 PM, Geoff Callender 
 [EMAIL PROTECTED] wrote:
 
 Fernando's right.  Your field curruser starts out as an ASO but if you
 reassign it (eg. curruser = u) then it becomes something else which is not
 an ASO.

 Your code looks like it's a mod of JumpStart, but JumpStart actually does
 the same kind of thing Fernando's saying:

@ApplicationState
private Visit _visit;
private boolean _visitExists;

 snipped

User user = getSecurityFinderService().authenticateUser(_loginId,
 _password);

// Store the user in the Visit

_visit.noteLogIn(user);

 and Visit then sets its fields based on the user. That way it remains an
 ASO.

public void noteLogIn(User user) {
_loggedIn = true;
_myUserId = user.getId();
_myLoginId = user.getLoginId();
}

 HTH,

 Geoff



 On 03/09/2008, at 7:24 PM, Fernando Padilla wrote:

  Also, i thought you were to think of an ASO almost as a singleton or a
 service.  Tapestry will create it for you on first access.  I didn't know
 you could set it.  Even if I'm wrong, using this design pattern might clean
 things up a little.


 So you should use another class to contain a reference to the current
 active user, call it UserContainer.


 @AplicationState
 private UserContainer currUser;


 and it would have methods like:

 currUser.hasUser()
 currUser.setUser(User user)
 currUser.getUser()


 or whatever you like.



 José Paumard wrote:

 Natia,
 I think there is a mistake in your code :
 private User currUser ;
 private boolean userExists ;
 I dont think T5 will link userExists and currUser, currUser should be
 named user, or userExists currUserExists (please correct me if I'm wrong).
 That said, what do you mean I cant access currUser, do you mean that
 the ASO is null in other classes that want to read it ? Or do you mean that
 userExists is always false (which is normal, see above).
 José
 Natia Gdzelishvili a écrit :

 I'm using tapestry 5.0.14 ,i vahe problem with aso, my code is:

 public class Login {
   private String username;
   private String password;
   @Inject
   private IBusinessServicesLocator _businessServicesLocator;
   @ApplicationState
   private User currUser;
   private boolean userExists;


   public String getUsername() {
   return username;
   }

   public void setUsername(String username) {
   this.username = username;
   }

   public String getPassword() {
   return password;
   }

   public void setPassword(String password) {
   this.password = password;
   }

   @SuppressWarnings(unchecked)
   @OnEvent(value = submit, component = loginForm)
   public Object submitLoginForm() {
   Class nextPage;
   try {
   User u=getMerchantCreator().login(username, password);
 //*returns
 some object*
   currUser = u; /*/ currUser object cannot be resolved*
   nextPage = ViewAllMerchants.class;

   } catch (UserNotFoundException e) {
   nextPage = Login.class;
   e.printStackTrace();
   }
   return nextPage;
   }

   private IMerchantCreatorLocal getMerchantCreator() {
   return _businessServicesLocator.getMerchantCreatorLocal();
   }
 }

 i cannot access curruser...
 please help..


  -
 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: Problem with aso

2008-09-03 Thread Natia Gdzelishvili
public class Visit {
// The logged in user
private boolean _loggedIn = false;
private String _myLoginId = null;

public void noteLogIn(User user) {
_loggedIn = true;
_myLoginId = user.getUserName();

}

public void noteLogOut() {
_loggedIn = false;
_myLoginId = null;
}

public boolean isLoggedIn() {
return _loggedIn;
}

public String getMyLoginId() {
return _myLoginId;
}

}



@ApplicationState
private Visit _visit;
private boolean _visitExists;

public Object submitLoginForm() {
Class nextPage;
try {
getMerchantCreator().login(username, password);
User u = null;
u = getMerchantCreator().getUser();
_visit.noteLogIn(u);
nextPage = ViewAllMerchants.class;

} catch (UserNotFoundException e) {
nextPage = Login.class;
e.printStackTrace();
}
return nextPage;
}

On Wed, Sep 3, 2008 at 4:06 PM, Carl Crowder [EMAIL PROTECTED] wrote:

 Is this actually a compilation error?

 Natia Gdzelishvili wrote:
  in version 5.0.9 it is working
 
  I've addedvist class but still same situation _visit cannot be resolved
 
  On Wed, Sep 3, 2008 at 3:44 PM, Geoff Callender 
  [EMAIL PROTECTED] wrote:
 
  Fernando's right.  Your field curruser starts out as an ASO but if you
  reassign it (eg. curruser = u) then it becomes something else which is
 not
  an ASO.
 
  Your code looks like it's a mod of JumpStart, but JumpStart actually
 does
  the same kind of thing Fernando's saying:
 
 @ApplicationState
 private Visit _visit;
 private boolean _visitExists;
 
  snipped
 
 User user = getSecurityFinderService().authenticateUser(_loginId,
  _password);
 
 // Store the user in the Visit
 
 _visit.noteLogIn(user);
 
  and Visit then sets its fields based on the user. That way it remains an
  ASO.
 
 public void noteLogIn(User user) {
 _loggedIn = true;
 _myUserId = user.getId();
 _myLoginId = user.getLoginId();
 }
 
  HTH,
 
  Geoff
 
 
 
  On 03/09/2008, at 7:24 PM, Fernando Padilla wrote:
 
   Also, i thought you were to think of an ASO almost as a singleton or a
  service.  Tapestry will create it for you on first access.  I didn't
 know
  you could set it.  Even if I'm wrong, using this design pattern might
 clean
  things up a little.
 
 
  So you should use another class to contain a reference to the current
  active user, call it UserContainer.
 
 
  @AplicationState
  private UserContainer currUser;
 
 
  and it would have methods like:
 
  currUser.hasUser()
  currUser.setUser(User user)
  currUser.getUser()
 
 
  or whatever you like.
 
 
 
  José Paumard wrote:
 
  Natia,
  I think there is a mistake in your code :
  private User currUser ;
  private boolean userExists ;
  I dont think T5 will link userExists and currUser, currUser should be
  named user, or userExists currUserExists (please correct me if I'm
 wrong).
  That said, what do you mean I cant access currUser, do you mean that
  the ASO is null in other classes that want to read it ? Or do you mean
 that
  userExists is always false (which is normal, see above).
  José
  Natia Gdzelishvili a écrit :
 
  I'm using tapestry 5.0.14 ,i vahe problem with aso, my code is:
 
  public class Login {
private String username;
private String password;
@Inject
private IBusinessServicesLocator _businessServicesLocator;
@ApplicationState
private User currUser;
private boolean userExists;
 
 
public String getUsername() {
return username;
}
 
public void setUsername(String username) {
this.username = username;
}
 
public String getPassword() {
return password;
}
 
public void setPassword(String password) {
this.password = password;
}
 
@SuppressWarnings(unchecked)
@OnEvent(value = submit, component = loginForm)
public Object submitLoginForm() {
Class nextPage;
try {
User u=getMerchantCreator().login(username, password);
  //*returns
  some object*
currUser = u; /*/ currUser object cannot be resolved*
nextPage = ViewAllMerchants.class;
 
} catch (UserNotFoundException e) {
nextPage = Login.class;
e.printStackTrace();
}
return nextPage;
}
 
private IMerchantCreatorLocal getMerchantCreator() {
return _businessServicesLocator.getMerchantCreatorLocal();
}
  }
 
  i cannot access curruser...
  please help..
 
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: 

Re: Problem with aso

2008-09-03 Thread Geoff Callender
I can't see anything obviously wrong.  Can you post the whole Login  
class - all of it.


On 03/09/2008, at 10:13 PM, Natia Gdzelishvili wrote:


public class Visit {
   // The logged in user
   private boolean _loggedIn = false;
   private String _myLoginId = null;

   public void noteLogIn(User user) {
   _loggedIn = true;
   _myLoginId = user.getUserName();

   }

   public void noteLogOut() {
   _loggedIn = false;
   _myLoginId = null;
   }

   public boolean isLoggedIn() {
   return _loggedIn;
   }

   public String getMyLoginId() {
   return _myLoginId;
   }

}



   @ApplicationState
   private Visit _visit;
   private boolean _visitExists;

public Object submitLoginForm() {
   Class nextPage;
   try {
   getMerchantCreator().login(username, password);
   User u = null;
   u = getMerchantCreator().getUser();
   _visit.noteLogIn(u);
   nextPage = ViewAllMerchants.class;

   } catch (UserNotFoundException e) {
   nextPage = Login.class;
   e.printStackTrace();
   }
   return nextPage;
   }

On Wed, Sep 3, 2008 at 4:06 PM, Carl Crowder  
[EMAIL PROTECTED] wrote:



Is this actually a compilation error?

Natia Gdzelishvili wrote:

in version 5.0.9 it is working

I've addedvist class but still same situation _visit cannot be  
resolved


On Wed, Sep 3, 2008 at 3:44 PM, Geoff Callender 
[EMAIL PROTECTED] wrote:

Fernando's right.  Your field curruser starts out as an ASO but  
if you
reassign it (eg. curruser = u) then it becomes something else  
which is

not

an ASO.

Your code looks like it's a mod of JumpStart, but JumpStart  
actually

does

the same kind of thing Fernando's saying:

  @ApplicationState
  private Visit _visit;
  private boolean _visitExists;

snipped

  User user =  
getSecurityFinderService().authenticateUser(_loginId,

_password);

  // Store the user in the Visit

  _visit.noteLogIn(user);

and Visit then sets its fields based on the user. That way it  
remains an

ASO.

  public void noteLogIn(User user) {
  _loggedIn = true;
  _myUserId = user.getId();
  _myLoginId = user.getLoginId();
  }

HTH,

Geoff



On 03/09/2008, at 7:24 PM, Fernando Padilla wrote:

Also, i thought you were to think of an ASO almost as a singleton  
or a
service.  Tapestry will create it for you on first access.  I  
didn't

know
you could set it.  Even if I'm wrong, using this design pattern  
might

clean

things up a little.


So you should use another class to contain a reference to the  
current

active user, call it UserContainer.


@AplicationState
private UserContainer currUser;


and it would have methods like:

currUser.hasUser()
currUser.setUser(User user)
currUser.getUser()


or whatever you like.



José Paumard wrote:


Natia,
I think there is a mistake in your code :
private User currUser ;
private boolean userExists ;
I dont think T5 will link userExists and currUser, currUser  
should be
named user, or userExists currUserExists (please correct me if  
I'm

wrong).
That said, what do you mean I cant access currUser, do you  
mean that
the ASO is null in other classes that want to read it ? Or do  
you mean

that

userExists is always false (which is normal, see above).
José
Natia Gdzelishvili a écrit :


I'm using tapestry 5.0.14 ,i vahe problem with aso, my code is:

public class Login {
 private String username;
 private String password;
 @Inject
 private IBusinessServicesLocator _businessServicesLocator;
 @ApplicationState
 private User currUser;
 private boolean userExists;


 public String getUsername() {
 return username;
 }

 public void setUsername(String username) {
 this.username = username;
 }

 public String getPassword() {
 return password;
 }

 public void setPassword(String password) {
 this.password = password;
 }

 @SuppressWarnings(unchecked)
 @OnEvent(value = submit, component = loginForm)
 public Object submitLoginForm() {
 Class nextPage;
 try {
 User u=getMerchantCreator().login(username, password);
//*returns
some object*
 currUser = u; /*/ currUser object cannot be resolved*
 nextPage = ViewAllMerchants.class;

 } catch (UserNotFoundException e) {
 nextPage = Login.class;
 e.printStackTrace();
 }
 return nextPage;
 }

 private IMerchantCreatorLocal getMerchantCreator() {
 return _businessServicesLocator.getMerchantCreatorLocal();
 }
}

i cannot access curruser...
please help..




-

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]

Newbie question about T5 urls

2008-09-03 Thread nick shaw
Hi

I am new to Tapestry5 and I have a question about page urls:

I have a page called admin/ManageContent which I access with
http://server/context-root/admin/manageContent.

I have now secured the page using Acegi so only admin users can access pages
that match /admin/*, so typing the above url into my browser redirects me to
the login page which is great. But is there any way a malicious user could
could bypass the acegi filter to access the page? I know it was possible to
do something like this with T4's friendlyUrls feature.

Nick


T4.0 PropertySelection + onChange

2008-09-03 Thread Leon Derks

Hello

Is it possible to catch an onchange Event for the PropertySelection 
component?


I don't want the form te be submitted, but want to update a section in 
my page.


I use tapestry 4.0.2 with Java 1.4

Leon

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



Re: Problem with aso

2008-09-03 Thread Natia Gdzelishvili
maybe i have to add some configuration in appmodule...
package ge.bog.merchants.regform.pages;

import ge.bog.merchants.exception.UserNotFoundException;
import ge.bog.merchants.model.User;
import ge.bog.merchants.regform.helper.Visit;
import ge.bog.merchants.regform.services.IBusinessServicesLocator;
import ge.bog.merchants.services.iface.IMerchantCreatorLocal;

import org.apache.tapestry5.annotations.ApplicationState;
import org.apache.tapestry5.annotations.OnEvent;
import org.apache.tapestry5.ioc.annotations.Inject;

public class Login {
private String username;
private String password;
@Inject
private IBusinessServicesLocator _businessServicesLocator;
// @ApplicationState (create=false)
// private User currUser;
// private boolean currUserExists;

@ApplicationState
private Visit _visit;
private boolean _visitExists;

Object onActivate() {
if (_visitExists) {
@SuppressWarnings(unused)
String blah = _visit.getMyLoginId();
}
//if (currUserExists){
//String blah = currUser.getUserName();
//}
return null;
}

public String getUsername() {
return username;
}

public void setUsername(String username) {
this.username = username;
}

public String getPassword() {
return password;
}

public void setPassword(String password) {
this.password = password;
}

@SuppressWarnings(unchecked)
@OnEvent(value = submit, component = loginForm)
public Object submitLoginForm() {
Class nextPage;
try {
getMerchantCreator().login(username, password);
User u = null;
u = getMerchantCreator().getUser();
// currUser.setUserName(u.getUserName());
// currUser = u;
_visit.noteLogIn(u);
nextPage = ViewAllMerchants.class;

} catch (UserNotFoundException e) {
nextPage = Login.class;
e.printStackTrace();
}
return nextPage;
}

private IMerchantCreatorLocal getMerchantCreator() {
return _businessServicesLocator.getMerchantCreatorLocal();
}



}


On Wed, Sep 3, 2008 at 4:29 PM, Geoff Callender 
[EMAIL PROTECTED] wrote:

 I can't see anything obviously wrong.  Can you post the whole Login class -
 all of it.


 On 03/09/2008, at 10:13 PM, Natia Gdzelishvili wrote:

  public class Visit {
   // The logged in user
   private boolean _loggedIn = false;
   private String _myLoginId = null;

   public void noteLogIn(User user) {
   _loggedIn = true;
   _myLoginId = user.getUserName();

   }

   public void noteLogOut() {
   _loggedIn = false;
   _myLoginId = null;
   }

   public boolean isLoggedIn() {
   return _loggedIn;
   }

   public String getMyLoginId() {
   return _myLoginId;
   }

 }



   @ApplicationState
   private Visit _visit;
   private boolean _visitExists;

 public Object submitLoginForm() {
   Class nextPage;
   try {
   getMerchantCreator().login(username, password);
   User u = null;
   u = getMerchantCreator().getUser();
   _visit.noteLogIn(u);
   nextPage = ViewAllMerchants.class;

   } catch (UserNotFoundException e) {
   nextPage = Login.class;
   e.printStackTrace();
   }
   return nextPage;
   }

 On Wed, Sep 3, 2008 at 4:06 PM, Carl Crowder [EMAIL PROTECTED]
 wrote:

  Is this actually a compilation error?

 Natia Gdzelishvili wrote:

 in version 5.0.9 it is working

 I've addedvist class but still same situation _visit cannot be resolved

 On Wed, Sep 3, 2008 at 3:44 PM, Geoff Callender 
 [EMAIL PROTECTED] wrote:

  Fernando's right.  Your field curruser starts out as an ASO but if you
 reassign it (eg. curruser = u) then it becomes something else which is

 not

 an ASO.

 Your code looks like it's a mod of JumpStart, but JumpStart actually

 does

 the same kind of thing Fernando's saying:

  @ApplicationState
  private Visit _visit;
  private boolean _visitExists;

 snipped

  User user = getSecurityFinderService().authenticateUser(_loginId,
 _password);

  // Store the user in the Visit

  _visit.noteLogIn(user);

 and Visit then sets its fields based on the user. That way it remains
 an
 ASO.

  public void noteLogIn(User user) {
  _loggedIn = true;
  _myUserId = user.getId();
  _myLoginId = user.getLoginId();
  }

 HTH,

 Geoff



 On 03/09/2008, at 7:24 PM, Fernando Padilla wrote:

 Also, i thought you were to think of an ASO almost as a singleton or a

 service.  Tapestry will create it for you on first access.  I didn't

 know

 you could set it.  Even if I'm wrong, using this design pattern might

 clean

 things up a little.


 So you should use another class to contain a reference to the current
 active user, call it UserContainer.


 @AplicationState
 private UserContainer currUser;


 

Re: Problem with aso

2008-09-03 Thread Thiago H. de Paula Figueiredo
Em Wed, 03 Sep 2008 06:24:44 -0300, Fernando Padilla [EMAIL PROTECTED]  
escreveu:


So you should use another class to contain a reference to the current  
active user, call it UserContainer.


I would call it Session, then it could be used to hold more info about  
the user session.


Thiago

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



Re: Problem with aso

2008-09-03 Thread Thiago H. de Paula Figueiredo
Em Wed, 03 Sep 2008 08:44:43 -0300, Geoff Callender  
[EMAIL PROTECTED] escreveu:



@ApplicationState
private Visit _visit;
private boolean _visitExists;


Visit? Can I guess you were a long time Tapestry 4 user? :)

Thiago

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



Re: Problem with aso

2008-09-03 Thread Geoff Callender

Yeah, old habits die hard.

On 03/09/2008, at 10:52 PM, Thiago H. de Paula Figueiredo wrote:

Em Wed, 03 Sep 2008 08:44:43 -0300, Geoff Callender [EMAIL PROTECTED] 
 escreveu:



@ApplicationState
private Visit _visit;
private boolean _visitExists;


Visit? Can I guess you were a long time Tapestry 4 user? :)

Thiago

-
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: Overriding Default Styles

2008-09-03 Thread Peter Stavrinides
Hi Ulrich,

I am not sure exactly what you didn't understand, but what I meant is this: 
Certain components such as the ones in the components project have their own 
style sheet. Overriding these styles one by one everywhere I use the component 
can be tedious, maybe I don't even want the styles to begin with! 

Since these styles are linked in by the component using 
RenderSupport.addStylesheetLink(asset, media), wouldn't it be great if I could 
simply supply my own style sheet instead of the default style sheet on a case 
by case basis? or perhaps override the style sheet in the containing page? 
(hence: renderSupport_.overrideStylesheetLink(stylesheet, media)) is this 
possible somehow at present?

cheers,
Peter



- Original Message -
From: Ulrich Stärk [EMAIL PROTECTED]
To: Tapestry users users@tapestry.apache.org
Sent: Wednesday, 3 September, 2008 1:25:24 PM GMT +02:00 Athens, Beirut, 
Bucharest, Istanbul
Subject: Re: Overriding Default Styles

I don't quite understand. A stylesheet is an asset and we already got
RenderSupport.addStylesheetLink(asset, media)... Just write your css,
create an asset and pass it to addStylesheetLink().

Uli

Am Mi, 3.09.2008, 12:16, schrieb Peter Stavrinides:
 hmmm not ideal, especially for components, I was hoping there was
 something more along the lines of:
 renderSupport_.addStylesheetLink(stylesheet, media);

 or even better:
 renderSupport_.overrideStylesheetLink(stylesheet, media);




 - Original Message -
 From: Ulrich Stärk [EMAIL PROTECTED]
 To: Tapestry users users@tapestry.apache.org
 Sent: Wednesday, 3 September, 2008 12:44:12 PM GMT +02:00 Athens, Beirut,
 Bucharest, Istanbul
 Subject: Re: Overriding Default Styles

 Tapestry's styles are included via default.css which can be found here:
 http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/default.css?view=markup
 Just include some css overriding those styles or change the configuration
 symbol tapestry.default-stylesheet to your own default stylesheet.

 Uli

 Am Mi, 3.09.2008, 11:27, schrieb Peter Stavrinides:
 Hi

 I would like to know how to override Tapestry's default styles,
 particularly:

 1. Individual styles like validation error popups
 2. Component styles

 -
 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]





-
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: Problem with aso

2008-09-03 Thread Natia Gdzelishvili
no I'm not tapestry 4 user  I'm new in tapestry
i thins there is some problem with my project, i've make new project anad
tested aso and it is working, I'll try to find out what it is
thank you

On Wed, Sep 3, 2008 at 4:59 PM, Geoff Callender 
[EMAIL PROTECTED] wrote:

 Yeah, old habits die hard.


 On 03/09/2008, at 10:52 PM, Thiago H. de Paula Figueiredo wrote:

  Em Wed, 03 Sep 2008 08:44:43 -0300, Geoff Callender 
 [EMAIL PROTECTED] escreveu:

 @ApplicationState
private Visit _visit;
private boolean _visitExists;


 Visit? Can I guess you were a long time Tapestry 4 user? :)

 Thiago

 -
 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: Problem with aso

2008-09-03 Thread Geoff Callender

I'm stumped.
When you say can't be resolved, I'm guessing you're using debug in  
an IDE.  Which IDE?
Field u is a detached entity which may have some lazy-loaded fields.  
Is the IDE showing that?  What if you print u, _visitExists and _visit  
before and after  _visit.noteLogIn(u) ?  Are they OK? Are they null?   
Do they cause LazyInitializationException?  Of course, don't print  
_visit if _visitExists is false.


On 03/09/2008, at 10:44 PM, Natia Gdzelishvili wrote:


maybe i have to add some configuration in appmodule...
package ge.bog.merchants.regform.pages;

import ge.bog.merchants.exception.UserNotFoundException;
import ge.bog.merchants.model.User;
import ge.bog.merchants.regform.helper.Visit;
import ge.bog.merchants.regform.services.IBusinessServicesLocator;
import ge.bog.merchants.services.iface.IMerchantCreatorLocal;

import org.apache.tapestry5.annotations.ApplicationState;
import org.apache.tapestry5.annotations.OnEvent;
import org.apache.tapestry5.ioc.annotations.Inject;

public class Login {
   private String username;
   private String password;
   @Inject
   private IBusinessServicesLocator _businessServicesLocator;
// @ApplicationState (create=false)
// private User currUser;
// private boolean currUserExists;

   @ApplicationState
   private Visit _visit;
   private boolean _visitExists;

   Object onActivate() {
   if (_visitExists) {
   @SuppressWarnings(unused)
   String blah = _visit.getMyLoginId();
   }
//if (currUserExists){
//String blah = currUser.getUserName();
//}
   return null;
   }

   public String getUsername() {
   return username;
   }

   public void setUsername(String username) {
   this.username = username;
   }

   public String getPassword() {
   return password;
   }

   public void setPassword(String password) {
   this.password = password;
   }

   @SuppressWarnings(unchecked)
   @OnEvent(value = submit, component = loginForm)
   public Object submitLoginForm() {
   Class nextPage;
   try {
   getMerchantCreator().login(username, password);
   User u = null;
   u = getMerchantCreator().getUser();
   // currUser.setUserName(u.getUserName());
   // currUser = u;
   _visit.noteLogIn(u);
   nextPage = ViewAllMerchants.class;

   } catch (UserNotFoundException e) {
   nextPage = Login.class;
   e.printStackTrace();
   }
   return nextPage;
   }

   private IMerchantCreatorLocal getMerchantCreator() {
   return _businessServicesLocator.getMerchantCreatorLocal();
   }



}


On Wed, Sep 3, 2008 at 4:29 PM, Geoff Callender 
[EMAIL PROTECTED] wrote:

I can't see anything obviously wrong.  Can you post the whole Login  
class -

all of it.


On 03/09/2008, at 10:13 PM, Natia Gdzelishvili wrote:

public class Visit {

 // The logged in user
 private boolean _loggedIn = false;
 private String _myLoginId = null;

 public void noteLogIn(User user) {
 _loggedIn = true;
 _myLoginId = user.getUserName();

 }

 public void noteLogOut() {
 _loggedIn = false;
 _myLoginId = null;
 }

 public boolean isLoggedIn() {
 return _loggedIn;
 }

 public String getMyLoginId() {
 return _myLoginId;
 }

}



 @ApplicationState
 private Visit _visit;
 private boolean _visitExists;

public Object submitLoginForm() {
 Class nextPage;
 try {
 getMerchantCreator().login(username, password);
 User u = null;
 u = getMerchantCreator().getUser();
 _visit.noteLogIn(u);
 nextPage = ViewAllMerchants.class;

 } catch (UserNotFoundException e) {
 nextPage = Login.class;
 e.printStackTrace();
 }
 return nextPage;
 }

On Wed, Sep 3, 2008 at 4:06 PM, Carl Crowder  
[EMAIL PROTECTED]

wrote:

Is this actually a compilation error?


Natia Gdzelishvili wrote:


in version 5.0.9 it is working

I've addedvist class but still same situation _visit cannot be  
resolved


On Wed, Sep 3, 2008 at 3:44 PM, Geoff Callender 
[EMAIL PROTECTED] wrote:

Fernando's right.  Your field curruser starts out as an ASO but  
if you
reassign it (eg. curruser = u) then it becomes something else  
which is



not



an ASO.


Your code looks like it's a mod of JumpStart, but JumpStart  
actually



does



the same kind of thing Fernando's saying:


@ApplicationState
private Visit _visit;
private boolean _visitExists;

snipped

User user =  
getSecurityFinderService().authenticateUser(_loginId,

_password);

// Store the user in the Visit

_visit.noteLogIn(user);

and Visit then sets its fields based on the user. That way it  
remains

an
ASO.

public void noteLogIn(User user) {
_loggedIn = true;
_myUserId = user.getId();
_myLoginId = user.getLoginId();
}

HTH,

Geoff



On 03/09/2008, at 7:24 PM, Fernando Padilla wrote:

Also, i thought you were to think of an ASO almost as a  
singleton or 

Re: Problem with aso

2008-09-03 Thread Geoff Callender
Crazy thought - in your old project, if you're using Eclipse, have you  
tried Project  Clean... ?


On 03/09/2008, at 11:05 PM, Natia Gdzelishvili wrote:


no I'm not tapestry 4 user  I'm new in tapestry
i thins there is some problem with my project, i've make new project  
anad

tested aso and it is working, I'll try to find out what it is
thank you

On Wed, Sep 3, 2008 at 4:59 PM, Geoff Callender 
[EMAIL PROTECTED] wrote:


Yeah, old habits die hard.


On 03/09/2008, at 10:52 PM, Thiago H. de Paula Figueiredo wrote:

Em Wed, 03 Sep 2008 08:44:43 -0300, Geoff Callender 

[EMAIL PROTECTED] escreveu:

   @ApplicationState

  private Visit _visit;
  private boolean _visitExists;



Visit? Can I guess you were a long time Tapestry 4 user? :)

Thiago

-
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: Problem with aso

2008-09-03 Thread Natia Gdzelishvili
yes i've tried many times

On Wed, Sep 3, 2008 at 5:09 PM, Geoff Callender 
[EMAIL PROTECTED] wrote:

 Crazy thought - in your old project, if you're using Eclipse, have you
 tried Project  Clean... ?


 On 03/09/2008, at 11:05 PM, Natia Gdzelishvili wrote:

  no I'm not tapestry 4 user  I'm new in tapestry
 i thins there is some problem with my project, i've make new project anad
 tested aso and it is working, I'll try to find out what it is
 thank you

 On Wed, Sep 3, 2008 at 4:59 PM, Geoff Callender 
 [EMAIL PROTECTED] wrote:

  Yeah, old habits die hard.


 On 03/09/2008, at 10:52 PM, Thiago H. de Paula Figueiredo wrote:

 Em Wed, 03 Sep 2008 08:44:43 -0300, Geoff Callender 

 [EMAIL PROTECTED] escreveu:

   @ApplicationState

  private Visit _visit;
  private boolean _visitExists;


 Visit? Can I guess you were a long time Tapestry 4 user? :)

 Thiago

 -
 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]




t5: using a non primary key field as context

2008-09-03 Thread Angelo Chen

Hi,

I like the feature that we can now pass Hibernate entity to the onActivate
and T5 automatically picks up object from database. however it assumes what
passed is the primary key, example:

1. this works.
localhost://page/1

2. this will not work:
localhost://page/myName

is there a way to tell T5 that to use a particular field to pick up the
object?

thanks,

sample code follows:

public class Page 
{ 
  private Person person; 

  void onActivate(Person person) 
  { 
this.person = person; 
  } 

  Object onPassivate() 
  { 
  return this.person; 
  } 
}


-- 
View this message in context: 
http://www.nabble.com/t5%3A-using-a-non-primary-key-field-as-context-tp19289427p19289427.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



[T5] - new client side validator

2008-09-03 Thread Mohammad Shamsi
Hi friends,

i am going to add new validator in my T5 project.
the server side validatioin is ok and i have no problem with it.
but in client side, i changed the Tapestry.js to add my validator funciton
in it.

is there any better way to avoid change Tapestry original javascripts ?

-- 
sincerely yours
M. H. Shamsi


Re: Overriding Default Styles

2008-09-03 Thread Peter Stavrinides
Yes, this much I know... and as I said before this is not ideal, and not very 
modular, it also means that I have to fiddle around with CSS inheritance which 
I loath to do as it can be time consuming, and one last point: bloating my 
pages with style sheets then more style sheets to cancel those out is not 
exactly a clean solution and it increases the size of my page.

Thanks anyway,

Peter

- Original Message -
From: Ulrich Stärk [EMAIL PROTECTED]
To: Tapestry users users@tapestry.apache.org
Sent: Wednesday, 3 September, 2008 4:40:26 PM GMT +02:00 Athens, Beirut, 
Bucharest, Istanbul
Subject: Re: Overriding Default Styles

Hi Peter,

As I said before, you can write a stylesheet that overrides the desired
styles and include this everywhere you want to have the default styles
being overriden by your custom style by including it either with
renderSupport.addStylesheetLink() or with the @IncludeStylesheet
annotation or by defining an asset and including it in your template.
There you just override the desired styles. It might be necessary to use
CSS' !important notation, though.

Cheers,

Uli

Am Mi, 3.09.2008, 15:03, schrieb Peter Stavrinides:
 Hi Ulrich,

 I am not sure exactly what you didn't understand, but what I meant is
 this: Certain components such as the ones in the components project have
 their own style sheet. Overriding these styles one by one everywhere I use
 the component can be tedious, maybe I don't even want the styles to begin
 with!

 Since these styles are linked in by the component using
 RenderSupport.addStylesheetLink(asset, media), wouldn't it be great if I
 could simply supply my own style sheet instead of the default style sheet
 on a case by case basis? or perhaps override the style sheet in the
 containing page? (hence: renderSupport_.overrideStylesheetLink(stylesheet,
 media)) is this possible somehow at present?

 cheers,
 Peter



 - Original Message -
 From: Ulrich Stärk [EMAIL PROTECTED]
 To: Tapestry users users@tapestry.apache.org
 Sent: Wednesday, 3 September, 2008 1:25:24 PM GMT +02:00 Athens, Beirut,
 Bucharest, Istanbul
 Subject: Re: Overriding Default Styles

 I don't quite understand. A stylesheet is an asset and we already got
 RenderSupport.addStylesheetLink(asset, media)... Just write your css,
 create an asset and pass it to addStylesheetLink().

 Uli

 Am Mi, 3.09.2008, 12:16, schrieb Peter Stavrinides:
 hmmm not ideal, especially for components, I was hoping there was
 something more along the lines of:
 renderSupport_.addStylesheetLink(stylesheet, media);

 or even better:
 renderSupport_.overrideStylesheetLink(stylesheet, media);




 - Original Message -
 From: Ulrich Stärk [EMAIL PROTECTED]
 To: Tapestry users users@tapestry.apache.org
 Sent: Wednesday, 3 September, 2008 12:44:12 PM GMT +02:00 Athens,
 Beirut,
 Bucharest, Istanbul
 Subject: Re: Overriding Default Styles

 Tapestry's styles are included via default.css which can be found here:
 http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/default.css?view=markup
 Just include some css overriding those styles or change the
 configuration
 symbol tapestry.default-stylesheet to your own default stylesheet.

 Uli

 Am Mi, 3.09.2008, 11:27, schrieb Peter Stavrinides:
 Hi

 I would like to know how to override Tapestry's default styles,
 particularly:

 1. Individual styles like validation error popups
 2. Component styles

 -
 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]





 -
 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]


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



RE: how to include css resource inside tapestry script file

2008-09-03 Thread Ken in nashua

Sorry... forgot...
 
T-4.1.6-SNAPSHOTBest regards Ken in nashua



From: [EMAIL PROTECTED]: [EMAIL PROTECTED]: how to include css resource inside 
tapestry script fileDate: Wed, 3 Sep 2008 10:42:22 -0400


Folks, Wanted to know if there is a mechanism whereby we can include a whole 
set of CSS definitions in a tapestry script file. There appears to be a 
mechanism for JS files. 
?xml version=1.0 encoding=UTF-8?
!DOCTYPE script PUBLIC
-//Apache Software Foundation//Tapestry Script Specification 4.0//EN
http://jakarta.apache.org/tapestry/dtd/Script_4_0.dtd;

script
include-script resource-path=/org/trails/demo/components/premixColors.js/  
What would be the best way to include these CSS definitions to a tapestry 
widget that operates script.Here is my CSS module 
style type=text/css

/* Required CSS classes: must be included in all pages using this script */

/* Apply the element you want to drag/resize */
.drsElement {
position: absolute;
border: 1px solid #333;
}

/*
The main mouse handle that moves the whole element.
You can apply to the same tag as drsElement if you want.
*/
.drsMoveHandle {
height: 20px;
background-color: #CCC;
border-bottom: 1px solid #666;
cursor: move;
}

/*
The DragResize object name is automatically applied to all generated
corner resize handles, as well as one of the individual classes below.
*/
.dragresize {
position: absolute;
width: 5px;
height: 5px;
font-size: 1px;
background: #EEE;
border: 1px solid #333;
}

/*
Individual corner classes - required for resize support.
These are based on the object name plus the handle ID.
*/
.dragresize-tl {
top: -8px;
left: -8px;
cursor: nw-resize;
}
.dragresize-tm {
top: -8px;
left: 50%;
margin-left: -4px;
cursor: n-resize;
}
.dragresize-tr {
top: -8px;
right: -8px;
cursor: ne-resize;
}

.dragresize-ml {
top: 50%;
margin-top: -4px;
left: -8px;
cursor: w-resize;
}
.dragresize-mr {
top: 50%;
margin-top: -4px;
right: -8px;
cursor: e-resize;
}

.dragresize-bl {
bottom: -8px;
left: -8px;
cursor: sw-resize;
}
.dragresize-bm {
bottom: -8px;
left: 50%;
margin-left: -4px;
cursor: s-resize;
}
.dragresize-br {
bottom: -8px;
right: -8px;
cursor: se-resize;
}
/style 

Get more out of the Web. Learn 10 hidden secrets of Windows Live. Learn Now 
_
Stay up to date on your PC, the Web, and your mobile phone with Windows Live.
http://clk.atdmt.com/MRT/go/msnnkwxp1020093185mrt/direct/01/

[T5] - another question about validators

2008-09-03 Thread Mohammad Shamsi
Hi,

is there any way to write a new validator that accept more than one
parameter ?
exampe   range (from, to)
i know that i can do it with using 2 validator instead of one (min and max).
but i want to write new validator with 2 or more parameter .

:( :)

-- 
sincerely yours
M. H. Shamsi


Re: T4.1.5 possible ognl cache problem

2008-09-03 Thread Kalle Korhonen
On the page in your production application, you wouldn't be using #this
anywhere in an OGNL expression, would you?

Kalle


On Wed, Sep 3, 2008 at 6:35 AM, denis queffeulou 
[EMAIL PROTECTED] wrote:

 I've done a simple webapp and the result is that compileExpression is
 called 18 times but this doesn't increase. So for that webapp it is Ok.
 Unfortunately, my main app still have the problem
 (org.apache.tapestry.disable-caching is not set so takes its default value).
 The last test I used is to request a single page and the number of calls to
 compileExpression is the same as the request number (minus 1). It takes
 about 16% cpu  (it depends on the complexity of the page).

 I don't know what is so different between the two webapps that the ognl
 cache (something not used directly by my code) seems not to be working.

 --
 denis


  are you sure, you have org.apache.tapestry.disable-caching set to false?
 You
 can easily check this by looking at Tapestry's exception page.

 2008/9/1 denis queffeulou [EMAIL PROTECTED]



 h,

 actually my WAR is a big application and I can't put it in Jira.
 Don't you already have pages with some OGNL expression in test case ?
 I look at the source code and see that a WeakHashMap but even with half
 memory used, the cache hits are not numerous.

 Is there any configuration to tweak ? (I'm not in debug mode).
 Perhaps it's not a bug.

 Anyway I've made a issue in Jira (2635).


  Can you attach a War-File to a an issue in Jira? If so, I promise to
 have


 a
 look at it :).

 2008/9/1 denis queffeulou [EMAIL PROTECTED]





 I've made another test with 4.1.5 which gives:

 34,2% 90528 invocations on ExpressionCache.getCompiledExpression
 25,4% 90300 invocations on Ognl.compileExpression

 The test is made of 5 pages which returns XML and has run for about 2
 hours.

 I'm not sure to be able to test with 4.1.6 in the next days.

 --
 Denis


  Jesse, could you comment on this? I haven't tried profiling my apps,
 but




 the
 repeated calls to Ognl.compileExpression are worrisome if Denis got
 his
 numbers right. Are there any ognl-related changes in 4.1.6? Denis,
 maybe
 you
 could repeat your profiling with the latest snapshot, so hopefully
 something
 could still be done for this before 4.1.6 is released.

 Kalle


 On Thu, Aug 28, 2008 at 5:08 AM, denis queffeulou 
 [EMAIL PROTECTED] wrote:







 Hi all,

 I'm making some profiling on an web app made with Tapestry 4.1.5
 which
 returns XML.
 The result are disappointing as the average access time (got with
 JMeter)
 is around 2000ms.

 In JProfiler, I found that OGNL expressions compilation uses 40% of
 processing time.
 As the JMeter script is requesting always the same page on the
 webapp,
 I'm
 wondering why the expressions are always compiled. The cache seems
 not
 to
 be
 used:

 31896 invocations on ExpressionCache.getCompiledExpression
 31140 invocations on Ognl.compileExpression

 Is there someone to give me a clue to have better performances ?

 Thanks

 PS: sorry for double posting in dev list, I had some problems to
 subscribe
 to users.
 --
 Denis Queffeulou

 -
 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]










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




Re: Problem with aso

2008-09-03 Thread Marcus
Hi Natia,
My suggestions:
- put the setter's on Visit class.
- remove methods noteLogIn() and noteLogOut() , when you want to logout just
attrib null to ASO, inside any page.

and try this approach:

@ApplicationState
private Visit _visit;

public Object submitLoginForm() {
   Class nextPage;
   try {
   getMerchantCreator().login(username, password);

   User u = getMerchantCreator().getUser();
   _visit.setLoggedIn = true;
   _visit.setMyLoginId = u.getUserName();

   nextPage = ViewAllMerchants.class;

   } catch (UserNotFoundException e) {
   nextPage = Login.class;
   e.printStackTrace();
   }
   return nextPage;
   }


Marcus


T4: How I can obtain the system path of my application?

2008-09-03 Thread Jorge Quiroga

Hello gurus:

I need to obtain the real path of my application, but I don't know in 
Tap 4.1 how to get the ServletContext or how to obtain the object that 
implements that interface. I see the real path when watching a 
cycle.getInfrastructure().getContextRoot() object while debugging, but 
the method to obtain that info isn't accessible or I don't know how to 
access it.


Thanks

Jorge Quiroga

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



RE: Problem with aso

2008-09-03 Thread Jonathan Barker

Whenever I see, It worked in 5.0.x, my first suggestion is always to make
sure that you don't have old Tapestry libraries floating around in your
classpath.



 -Original Message-
 From: Natia Gdzelishvili [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, September 03, 2008 08:14
 To: Tapestry users
 Subject: Re: Problem with aso
 
 public class Visit {
 // The logged in user
 private boolean _loggedIn = false;
 private String _myLoginId = null;
 
 public void noteLogIn(User user) {
 _loggedIn = true;
 _myLoginId = user.getUserName();
 
 }
 
 public void noteLogOut() {
 _loggedIn = false;
 _myLoginId = null;
 }
 
 public boolean isLoggedIn() {
 return _loggedIn;
 }
 
 public String getMyLoginId() {
 return _myLoginId;
 }
 
 }
 
 
 
 @ApplicationState
 private Visit _visit;
 private boolean _visitExists;
 
 public Object submitLoginForm() {
 Class nextPage;
 try {
 getMerchantCreator().login(username, password);
 User u = null;
 u = getMerchantCreator().getUser();
 _visit.noteLogIn(u);
 nextPage = ViewAllMerchants.class;
 
 } catch (UserNotFoundException e) {
 nextPage = Login.class;
 e.printStackTrace();
 }
 return nextPage;
 }
 
 On Wed, Sep 3, 2008 at 4:06 PM, Carl Crowder [EMAIL PROTECTED]
 wrote:
 
  Is this actually a compilation error?
 
  Natia Gdzelishvili wrote:
   in version 5.0.9 it is working
  
   I've addedvist class but still same situation _visit cannot be
 resolved
  
   On Wed, Sep 3, 2008 at 3:44 PM, Geoff Callender 
   [EMAIL PROTECTED] wrote:
  
   Fernando's right.  Your field curruser starts out as an ASO but if
 you
   reassign it (eg. curruser = u) then it becomes something else which
 is
  not
   an ASO.
  
   Your code looks like it's a mod of JumpStart, but JumpStart actually
  does
   the same kind of thing Fernando's saying:
  
  @ApplicationState
  private Visit _visit;
  private boolean _visitExists;
  
   snipped
  
  User user =
 getSecurityFinderService().authenticateUser(_loginId,
   _password);
  
  // Store the user in the Visit
  
  _visit.noteLogIn(user);
  
   and Visit then sets its fields based on the user. That way it remains
 an
   ASO.
  
  public void noteLogIn(User user) {
  _loggedIn = true;
  _myUserId = user.getId();
  _myLoginId = user.getLoginId();
  }
  
   HTH,
  
   Geoff
  
  
  
   On 03/09/2008, at 7:24 PM, Fernando Padilla wrote:
  
Also, i thought you were to think of an ASO almost as a singleton or
 a
   service.  Tapestry will create it for you on first access.  I didn't
  know
   you could set it.  Even if I'm wrong, using this design pattern
 might
  clean
   things up a little.
  
  
   So you should use another class to contain a reference to the
 current
   active user, call it UserContainer.
  
  
   @AplicationState
   private UserContainer currUser;
  
  
   and it would have methods like:
  
   currUser.hasUser()
   currUser.setUser(User user)
   currUser.getUser()
  
  
   or whatever you like.
  
  
  
   José Paumard wrote:
  
   Natia,
   I think there is a mistake in your code :
   private User currUser ;
   private boolean userExists ;
   I dont think T5 will link userExists and currUser, currUser should
 be
   named user, or userExists currUserExists (please correct me if I'm
  wrong).
   That said, what do you mean I cant access currUser, do you mean
 that
   the ASO is null in other classes that want to read it ? Or do you
 mean
  that
   userExists is always false (which is normal, see above).
   José
   Natia Gdzelishvili a écrit :
  
   I'm using tapestry 5.0.14 ,i vahe problem with aso, my code is:
  
   public class Login {
 private String username;
 private String password;
 @Inject
 private IBusinessServicesLocator _businessServicesLocator;
 @ApplicationState
 private User currUser;
 private boolean userExists;
  
  
 public String getUsername() {
 return username;
 }
  
 public void setUsername(String username) {
 this.username = username;
 }
  
 public String getPassword() {
 return password;
 }
  
 public void setPassword(String password) {
 this.password = password;
 }
  
 @SuppressWarnings(unchecked)
 @OnEvent(value = submit, component = loginForm)
 public Object submitLoginForm() {
 Class nextPage;
 try {
 User u=getMerchantCreator().login(username, password);
   //*returns
   some object*
 currUser = u; /*/ currUser object cannot be resolved*
 nextPage = ViewAllMerchants.class;
  
 } catch (UserNotFoundException e) {
 nextPage = Login.class;
 e.printStackTrace();
 }
 

Re: Problem with aso

2008-09-03 Thread Marcus
Hi Natia,
just correcting:

_visit.setMyLoginId(u.getUserName());

and check Jonathan's tip. (old Tapestry libraries in your classpath.)


Marcus


Re: Overriding Default Styles

2008-09-03 Thread Ulrich Stärk
That's a point, indeed. I could imagine some kind of mechanism where you 
specify a stylesheet link for every component (or override it for 
existing components) and Tapestry combines those definitions together to 
one stylesheet, omitting unused definitions. But I don't know if this 
improved cleanliness regarding unnecessary CSS definitions is worth the 
extra complexity as there is usually only a manageable amount of 
Tapestry CSS definitions per page that has to be overriden.


Cheers,

Uli

Peter Stavrinides schrieb:

Yes, this much I know... and as I said before this is not ideal, and
not very modular, it also means that I have to fiddle around with CSS
inheritance which I loath to do as it can be time consuming, and one
last point: bloating my pages with style sheets then more style
sheets to cancel those out is not exactly a clean solution and it
increases the size of my page.

Thanks anyway,

Peter

- Original Message - From: Ulrich Stärk [EMAIL PROTECTED] 
To: Tapestry users users@tapestry.apache.org Sent: Wednesday, 3

September, 2008 4:40:26 PM GMT +02:00 Athens, Beirut, Bucharest,
Istanbul Subject: Re: Overriding Default Styles

Hi Peter,

As I said before, you can write a stylesheet that overrides the
desired styles and include this everywhere you want to have the
default styles being overriden by your custom style by including it
either with renderSupport.addStylesheetLink() or with the
@IncludeStylesheet annotation or by defining an asset and including
it in your template. There you just override the desired styles. It
might be necessary to use CSS' !important notation, though.

Cheers,

Uli

Am Mi, 3.09.2008, 15:03, schrieb Peter Stavrinides:

Hi Ulrich,

I am not sure exactly what you didn't understand, but what I meant
is this: Certain components such as the ones in the components
project have their own style sheet. Overriding these styles one by
one everywhere I use the component can be tedious, maybe I don't
even want the styles to begin with!

Since these styles are linked in by the component using 
RenderSupport.addStylesheetLink(asset, media), wouldn't it be great

if I could simply supply my own style sheet instead of the default
style sheet on a case by case basis? or perhaps override the style
sheet in the containing page? (hence:
renderSupport_.overrideStylesheetLink(stylesheet, media)) is this
possible somehow at present?

cheers, Peter



- Original Message - From: Ulrich StÃ?rk
[EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org
 Sent: Wednesday, 3 September, 2008 1:25:24 PM GMT +02:00 Athens,
Beirut, Bucharest, Istanbul Subject: Re: Overriding Default Styles

I don't quite understand. A stylesheet is an asset and we already
got RenderSupport.addStylesheetLink(asset, media)... Just write
your css, create an asset and pass it to addStylesheetLink().

Uli

Am Mi, 3.09.2008, 12:16, schrieb Peter Stavrinides:

hmmm not ideal, especially for components, I was hoping there was
 something more along the lines of: 
renderSupport_.addStylesheetLink(stylesheet, media);


or even better: renderSupport_.overrideStylesheetLink(stylesheet,
media);




- Original Message - From: Ulrich StÃfÂ?rk
[EMAIL PROTECTED] To: Tapestry users
users@tapestry.apache.org Sent: Wednesday, 3 September, 2008
12:44:12 PM GMT +02:00 Athens, Beirut, Bucharest, Istanbul 
Subject: Re: Overriding Default Styles


Tapestry's styles are included via default.css which can be found
here: 
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/default.css?view=markup
 Just include some css overriding those styles or change the 
configuration symbol tapestry.default-stylesheet to your own

default stylesheet.

Uli

Am Mi, 3.09.2008, 11:27, schrieb Peter Stavrinides:

Hi

I would like to know how to override Tapestry's default styles,
 particularly:

1. Individual styles like validation error popups 2. Component
styles

-
 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]






-
 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: T5 : [ANN] The book - next steps

2008-09-03 Thread Chris Lewis
Awesome! I'll try to have a look in a couple of hours, and if I can make
the time, I'd like to contribute either in raw content and/or
collaborative editing. As for a discussion channel for the book, why not
use google-groups?

Alex Kotchnev wrote:
 I've created a new project for the proposed book at
 http://code.google.com/p/tapestry5-book , and posted the proposed table of
 contents at
 http://code.google.com/p/tapestry5-book/wiki/ProposedTableOfContents . Now
 that I'm looking at it, it's a little disappointing as the TOC doesn't
 really have anything new in it (e.g. some of it is covered in tutorials,
 other is in the project docs, etc). However, I guess that the content really
 can't be all that different - it's all about building web apps, covering the
 same materials as the other documentation. In the end, I think that the book
 will be different from the other existing documents based on its style and
 breadth of content, and not so much in the topics it covers.

 Anyway, I would like to create a mailing list and add everyone who has
 expressed an interest in contributing to the book. Unfortunately, Google
 Code doesn't have mailng lists, so I'll probably have to look around for
 that (Nabble, maybe?). Any suggestions would be welcome here.

 In terms of moving the proposed TOC forward, here are some of my next steps
 :
 1. Attribute the main sections of the project documentation into possible
 chapters in the book.
 2. Discuss feedback from this list on the content of the proposed TOC : e.g.
 any alternative ideas on how to organize the book, changes to the proposed
 chapter titles, order, etc.

 It would be great if there are any volunteers to investigate some of the
 issues that were discussed previously in the thread below, I'll probably
 post the needed tasks somewhere on the wiki as well.

 When we get our mailing list set up, I think that individuals or groups of
 individuals can claim ownership of each chapter (and thus get voting
 rights on the TOC, chapter layout, further modifications, etc.

 Cheers,

 Alex Kotchnev



 On Thu, Aug 28, 2008 at 4:59 AM, Hugo Palma [EMAIL PROTECTED] wrote:

   
 inline

 Alex Kotchnev wrote:

 
 Would there be any value to having a top-level domain for the book (e.g.
 tapestry-book.org or something like that), or can we find it a home for
 the
 book somewhere under the Tapestry namespace ?


   
 A top-level domain should brink more visibility to the effort. Also, in the
 future we could probably spend some of the monetary payback to pay for the
 domain and some hosting solution so that we could include the live version
 of the book application and other cool stuff.
 Still, for now i think we can live with a project on some project hosting
 site where we can host the book files and wiki.

 
 A note on the potential mode for governing decisions : I was thinking that
 in the next couple of days, I'll post a list of possible chapters to
 include
 in the book. Then, we can collect a first set of volunteers for people
 take
 ownership of each chapter. After the initial set of volunteers, the
 chapter
 owners will vote on addition of new chapters and giving ownership of
 chapters to new contributors (if needed).


   
 Shouldn't the outline be already created in a tapestry-book wiki ?
 We could decide on where to host it and then move the discussion to the
 dedicated list and use its wiki for the outline.

  On whether the book would cover additional libraries (e.g. chennilekit,
 
 t5components): I think that after we get to a good place where we have
 enough content on the core we can probably spend some time on those as
 well,
 possibly with contributions from the project owners. Conceptually, it
 would
 be impossible to include all 3rd party / contrib libraries in the book (or
 it will always be incomplete) . I guess my point is that I think we'd want
 to describe Tapestry and most essential additions (e.g. t5-hibernate,
 t5-spring, etc).


   
 While it's true that if we go down the line of including third party
 libraries it will always be incomplete and maybe unfair to some i think it
 would be important to cover the ones that we consider the most used. We
 could go with a voting process where each one would say the top 2 or 3 third
 party libraries in his opinion. The top 2 or 3 would get included in the
 book.

  Cheers,
 
 Alex Kotchnev

 On Tue, Aug 26, 2008 at 11:13 PM, Thiago H. de Paula Figueiredo 
 [EMAIL PROTECTED] wrote:



   
 Em Tue, 26 Aug 2008 23:30:41 -0300, Alex Kotchnev [EMAIL PROTECTED]
 escreveu:

  Here are a couple of the next steps that I think would be useful in
 moving


 
 the effort forward:



   
 Nice! I was thinking of posting a similar set of questions here . . . :)

  1. Post a rough outline of the table of contents in the book (initially,


 
 probably on the wiki).



   
 +1 I can't thing of another way of kicking off this project.
 I just suggest another 

Re: Overriding Default Styles

2008-09-03 Thread Howard Lewis Ship
Bloat is all relative.

Tapestry could dynamically assemble a virtual stylesheet for the page
from bits and pieces, somewhat like JavaScript initialization is
accomplished.

However, that would require encoding a lot of state information into
the URL for the virtual stylesheet, and that would likely prevent the
browser from caching it effectively. It also complicates the story
when Ajax partial page updates come into play.

I would rather we have a static stylesheet (and perhaps a static
override to that stylesheet) that has a far-future expires header to
encourage the browser to cache it.

As everywhere, it is a tradeoff: you may see a first page load
difference (more coming down than necessary) followed by very quick
follow on pages (due to browser cache).

If it is a top concern, you can copy the Tapestry default.css and use
some configuration to override Tapestry to use your customized
stylesheet instead of default.css.

However, the contents of default.css and tapestry.js are in flux, more
so than any other aspect of the framework, and fall into a grey area
between stable public APIs and Tapestry internals.  In other words, a
moving target.

It's very easy to lose sight of the forest for the trees; measure,
measure, measure!  Web applications have so many moving parts in so
many different locations, so they are going to perform
counter-intuitively.   I use the YSlow plugin for FireBug and I'm
working to make Tapestry applications automatically score well by
those metrics: we've seen that in terms of moving the script
elements to the bottom of the page, the removal of unnecessary
whitespace and (in forthcoming releases) the automatic GZIP
compression of replies and the minimalization of static JavaScript and
CSS.

 I would suspect that the processing in the browser associated with
CSS is relatively minor compared to the HTML, so if you can find a way
to reduce the size and complexity of your HTML it's a bigger win than
shaving a few lines of CSS.  But measure!

At Formos, we are planning to setup a performance lab to get some real
numbers and points of reference.


On Wed, Sep 3, 2008 at 9:07 AM, Blower, Andy
[EMAIL PROTECTED] wrote:
 That's a really good point Peter. I'd be interested to hear what you think 
 about this Howard?

 -Original Message-
 From: Peter Stavrinides [mailto:[EMAIL PROTECTED]
 Sent: 03 September 2008 15:40
 To: Tapestry users
 Subject: Re: Overriding Default Styles

 Yes, this much I know... and as I said before this is not ideal, and
 not very modular, it also means that I have to fiddle around with CSS
 inheritance which I loath to do as it can be time consuming, and one
 last point: bloating my pages with style sheets then more style sheets
 to cancel those out is not exactly a clean solution and it increases
 the size of my page.

 Thanks anyway,

 Peter

 - Original Message -
 From: Ulrich Stärk [EMAIL PROTECTED]
 To: Tapestry users users@tapestry.apache.org
 Sent: Wednesday, 3 September, 2008 4:40:26 PM GMT +02:00 Athens,
 Beirut, Bucharest, Istanbul
 Subject: Re: Overriding Default Styles

 Hi Peter,

 As I said before, you can write a stylesheet that overrides the desired
 styles and include this everywhere you want to have the default styles
 being overriden by your custom style by including it either with
 renderSupport.addStylesheetLink() or with the @IncludeStylesheet
 annotation or by defining an asset and including it in your template.
 There you just override the desired styles. It might be necessary to
 use
 CSS' !important notation, though.

 Cheers,

 Uli

 Am Mi, 3.09.2008, 15:03, schrieb Peter Stavrinides:
  Hi Ulrich,
 
  I am not sure exactly what you didn't understand, but what I meant is
  this: Certain components such as the ones in the components project
 have
  their own style sheet. Overriding these styles one by one everywhere
 I use
  the component can be tedious, maybe I don't even want the styles to
 begin
  with!
 
  Since these styles are linked in by the component using
  RenderSupport.addStylesheetLink(asset, media), wouldn't it be great
 if I
  could simply supply my own style sheet instead of the default style
 sheet
  on a case by case basis? or perhaps override the style sheet in the
  containing page? (hence:
 renderSupport_.overrideStylesheetLink(stylesheet,
  media)) is this possible somehow at present?
 
  cheers,
  Peter
 
 
 
  - Original Message -
  From: Ulrich Stärk [EMAIL PROTECTED]
  To: Tapestry users users@tapestry.apache.org
  Sent: Wednesday, 3 September, 2008 1:25:24 PM GMT +02:00 Athens,
 Beirut,
  Bucharest, Istanbul
  Subject: Re: Overriding Default Styles
 
  I don't quite understand. A stylesheet is an asset and we already got
  RenderSupport.addStylesheetLink(asset, media)... Just write your css,
  create an asset and pass it to addStylesheetLink().
 
  Uli
 
  Am Mi, 3.09.2008, 12:16, schrieb Peter Stavrinides:
  hmmm not ideal, especially for components, I was hoping there was
  something 

Re: T5 : [ANN] The book - next steps

2008-09-03 Thread Hugo Palma
Just an idea, maybe hosting the book on assembla 
(http://www.assembla.com) would fit this project needs better.
I've used assembla with great success in the past, it has all the things 
we need, an SVN repo, a forum, a chat room, an issue tracker, and more...



Alex Kotchnev wrote:

I've created a new project for the proposed book at
http://code.google.com/p/tapestry5-book , and posted the proposed table of
contents at
http://code.google.com/p/tapestry5-book/wiki/ProposedTableOfContents . Now
that I'm looking at it, it's a little disappointing as the TOC doesn't
really have anything new in it (e.g. some of it is covered in tutorials,
other is in the project docs, etc). However, I guess that the content really
can't be all that different - it's all about building web apps, covering the
same materials as the other documentation. In the end, I think that the book
will be different from the other existing documents based on its style and
breadth of content, and not so much in the topics it covers.

Anyway, I would like to create a mailing list and add everyone who has
expressed an interest in contributing to the book. Unfortunately, Google
Code doesn't have mailng lists, so I'll probably have to look around for
that (Nabble, maybe?). Any suggestions would be welcome here.

In terms of moving the proposed TOC forward, here are some of my next steps
:
1. Attribute the main sections of the project documentation into possible
chapters in the book.
2. Discuss feedback from this list on the content of the proposed TOC : e.g.
any alternative ideas on how to organize the book, changes to the proposed
chapter titles, order, etc.

It would be great if there are any volunteers to investigate some of the
issues that were discussed previously in the thread below, I'll probably
post the needed tasks somewhere on the wiki as well.

When we get our mailing list set up, I think that individuals or groups of
individuals can claim ownership of each chapter (and thus get voting
rights on the TOC, chapter layout, further modifications, etc.

Cheers,

Alex Kotchnev



On Thu, Aug 28, 2008 at 4:59 AM, Hugo Palma [EMAIL PROTECTED] wrote:

  

inline

Alex Kotchnev wrote:



Would there be any value to having a top-level domain for the book (e.g.
tapestry-book.org or something like that), or can we find it a home for
the
book somewhere under the Tapestry namespace ?


  

A top-level domain should brink more visibility to the effort. Also, in the
future we could probably spend some of the monetary payback to pay for the
domain and some hosting solution so that we could include the live version
of the book application and other cool stuff.
Still, for now i think we can live with a project on some project hosting
site where we can host the book files and wiki.



A note on the potential mode for governing decisions : I was thinking that
in the next couple of days, I'll post a list of possible chapters to
include
in the book. Then, we can collect a first set of volunteers for people
take
ownership of each chapter. After the initial set of volunteers, the
chapter
owners will vote on addition of new chapters and giving ownership of
chapters to new contributors (if needed).


  

Shouldn't the outline be already created in a tapestry-book wiki ?
We could decide on where to host it and then move the discussion to the
dedicated list and use its wiki for the outline.

 On whether the book would cover additional libraries (e.g. chennilekit,


t5components): I think that after we get to a good place where we have
enough content on the core we can probably spend some time on those as
well,
possibly with contributions from the project owners. Conceptually, it
would
be impossible to include all 3rd party / contrib libraries in the book (or
it will always be incomplete) . I guess my point is that I think we'd want
to describe Tapestry and most essential additions (e.g. t5-hibernate,
t5-spring, etc).


  

While it's true that if we go down the line of including third party
libraries it will always be incomplete and maybe unfair to some i think it
would be important to cover the ones that we consider the most used. We
could go with a voting process where each one would say the top 2 or 3 third
party libraries in his opinion. The top 2 or 3 would get included in the
book.

 Cheers,


Alex Kotchnev

On Tue, Aug 26, 2008 at 11:13 PM, Thiago H. de Paula Figueiredo 
[EMAIL PROTECTED] wrote:



  

Em Tue, 26 Aug 2008 23:30:41 -0300, Alex Kotchnev [EMAIL PROTECTED]
escreveu:

 Here are a couple of the next steps that I think would be useful in
moving




the effort forward:



  

Nice! I was thinking of posting a similar set of questions here . . . :)

 1. Post a rough outline of the table of contents in the book (initially,




probably on the wiki).



  

+1 I can't thing of another way of kicking off this project.
I just suggest another step: just start writing real content after

Re: T5 : [ANN] The book - next steps

2008-09-03 Thread Howard Lewis Ship
Looked at the TOC.

My thoughts on writing the book line up closely with how I've written
the Tapestry Workshop.  I can tell you that, in the Workshop, we are
using Hibernate in the first session (the Workshop consists of themed
sessions, with labs inside the session).

In other words, focus on how people *use* Tapestry.  Yes, not everyone
will be using Hibernate, but people understand the gist of it, and
regardless of solution (Cayanne, iBatis, craptaculous) people will be
moving data between the DB and the app and probably representing that
data as beans.

The Workshop largely follows the evolution of a Tapestry app, a simple
(limited) clone of Blogger. With each successive lab, we implement
more and more of the application. There's very little hand waving,
because people understand blogs and comments and such.

The Workshop has the advantage that it's a complete working
environment, with database up and running and pre-populated.

The mistake I made in Tapestry in Action was thinking too much in
terms of explaining what the framework does.   I've learned a lot
since then in terms of how to explain complex things, and part of it
is to explore different solutions to a problem before coming to a
conclusion.

On Wed, Sep 3, 2008 at 10:25 AM, Hugo Palma [EMAIL PROTECTED] wrote:
 Just an idea, maybe hosting the book on assembla (http://www.assembla.com)
 would fit this project needs better.
 I've used assembla with great success in the past, it has all the things we
 need, an SVN repo, a forum, a chat room, an issue tracker, and more...


 Alex Kotchnev wrote:

 I've created a new project for the proposed book at
 http://code.google.com/p/tapestry5-book , and posted the proposed table of
 contents at
 http://code.google.com/p/tapestry5-book/wiki/ProposedTableOfContents . Now
 that I'm looking at it, it's a little disappointing as the TOC doesn't
 really have anything new in it (e.g. some of it is covered in tutorials,
 other is in the project docs, etc). However, I guess that the content
 really
 can't be all that different - it's all about building web apps, covering
 the
 same materials as the other documentation. In the end, I think that the
 book
 will be different from the other existing documents based on its style and
 breadth of content, and not so much in the topics it covers.

 Anyway, I would like to create a mailing list and add everyone who has
 expressed an interest in contributing to the book. Unfortunately, Google
 Code doesn't have mailng lists, so I'll probably have to look around for
 that (Nabble, maybe?). Any suggestions would be welcome here.

 In terms of moving the proposed TOC forward, here are some of my next
 steps
 :
 1. Attribute the main sections of the project documentation into possible
 chapters in the book.
 2. Discuss feedback from this list on the content of the proposed TOC :
 e.g.
 any alternative ideas on how to organize the book, changes to the proposed
 chapter titles, order, etc.

 It would be great if there are any volunteers to investigate some of the
 issues that were discussed previously in the thread below, I'll probably
 post the needed tasks somewhere on the wiki as well.

 When we get our mailing list set up, I think that individuals or groups of
 individuals can claim ownership of each chapter (and thus get voting
 rights on the TOC, chapter layout, further modifications, etc.

 Cheers,

 Alex Kotchnev



 On Thu, Aug 28, 2008 at 4:59 AM, Hugo Palma [EMAIL PROTECTED]
 wrote:



 inline

 Alex Kotchnev wrote:



 Would there be any value to having a top-level domain for the book (e.g.
 tapestry-book.org or something like that), or can we find it a home for
 the
 book somewhere under the Tapestry namespace ?




 A top-level domain should brink more visibility to the effort. Also, in
 the
 future we could probably spend some of the monetary payback to pay for
 the
 domain and some hosting solution so that we could include the live
 version
 of the book application and other cool stuff.
 Still, for now i think we can live with a project on some project hosting
 site where we can host the book files and wiki.



 A note on the potential mode for governing decisions : I was thinking
 that
 in the next couple of days, I'll post a list of possible chapters to
 include
 in the book. Then, we can collect a first set of volunteers for people
 take
 ownership of each chapter. After the initial set of volunteers, the
 chapter
 owners will vote on addition of new chapters and giving ownership of
 chapters to new contributors (if needed).




 Shouldn't the outline be already created in a tapestry-book wiki ?
 We could decide on where to host it and then move the discussion to the
 dedicated list and use its wiki for the outline.

  On whether the book would cover additional libraries (e.g. chennilekit,


 t5components): I think that after we get to a good place where we have
 enough content on the core we can probably spend some time on those as
 well,
 possibly with 

Re: T5 : [ANN] The book - next steps

2008-09-03 Thread ProAdmin Dariusz Dwornikowski
I really would love to see a walkthrough on making blog application in
tapestry5+spring+hibernate. Not only the integration, but how to implement
simple blog with it, design DAOs, where to put them etc. Tapestry alone is
no use if you do not have DB. In advanced topics I would like to see ex.
acegi integration, more ajax complex examples, own components etc. I find
examples very useful and most of people learn by examples very well.
That is my suggestion.

2008/9/3 Howard Lewis Ship [EMAIL PROTECTED]

 Looked at the TOC.

 My thoughts on writing the book line up closely with how I've written
 the Tapestry Workshop.  I can tell you that, in the Workshop, we are
 using Hibernate in the first session (the Workshop consists of themed
 sessions, with labs inside the session).

 In other words, focus on how people *use* Tapestry.  Yes, not everyone
 will be using Hibernate, but people understand the gist of it, and
 regardless of solution (Cayanne, iBatis, craptaculous) people will be
 moving data between the DB and the app and probably representing that
 data as beans.

 The Workshop largely follows the evolution of a Tapestry app, a simple
 (limited) clone of Blogger. With each successive lab, we implement
 more and more of the application. There's very little hand waving,
 because people understand blogs and comments and such.

 The Workshop has the advantage that it's a complete working
 environment, with database up and running and pre-populated.

 The mistake I made in Tapestry in Action was thinking too much in
 terms of explaining what the framework does.   I've learned a lot
 since then in terms of how to explain complex things, and part of it
 is to explore different solutions to a problem before coming to a
 conclusion.

 On Wed, Sep 3, 2008 at 10:25 AM, Hugo Palma [EMAIL PROTECTED]
 wrote:
  Just an idea, maybe hosting the book on assembla (
 http://www.assembla.com)
  would fit this project needs better.
  I've used assembla with great success in the past, it has all the things
 we
  need, an SVN repo, a forum, a chat room, an issue tracker, and more...
 
 
  Alex Kotchnev wrote:
 
  I've created a new project for the proposed book at
  http://code.google.com/p/tapestry5-book , and posted the proposed table
 of
  contents at
  http://code.google.com/p/tapestry5-book/wiki/ProposedTableOfContents .
 Now
  that I'm looking at it, it's a little disappointing as the TOC doesn't
  really have anything new in it (e.g. some of it is covered in tutorials,
  other is in the project docs, etc). However, I guess that the content
  really
  can't be all that different - it's all about building web apps, covering
  the
  same materials as the other documentation. In the end, I think that the
  book
  will be different from the other existing documents based on its style
 and
  breadth of content, and not so much in the topics it covers.
 
  Anyway, I would like to create a mailing list and add everyone who has
  expressed an interest in contributing to the book. Unfortunately, Google
  Code doesn't have mailng lists, so I'll probably have to look around for
  that (Nabble, maybe?). Any suggestions would be welcome here.
 
  In terms of moving the proposed TOC forward, here are some of my next
  steps
  :
  1. Attribute the main sections of the project documentation into
 possible
  chapters in the book.
  2. Discuss feedback from this list on the content of the proposed TOC :
  e.g.
  any alternative ideas on how to organize the book, changes to the
 proposed
  chapter titles, order, etc.
 
  It would be great if there are any volunteers to investigate some of the
  issues that were discussed previously in the thread below, I'll probably
  post the needed tasks somewhere on the wiki as well.
 
  When we get our mailing list set up, I think that individuals or groups
 of
  individuals can claim ownership of each chapter (and thus get voting
  rights on the TOC, chapter layout, further modifications, etc.
 
  Cheers,
 
  Alex Kotchnev
 
 
 
  On Thu, Aug 28, 2008 at 4:59 AM, Hugo Palma [EMAIL PROTECTED]
  wrote:
 
 
 
  inline
 
  Alex Kotchnev wrote:
 
 
 
  Would there be any value to having a top-level domain for the book
 (e.g.
  tapestry-book.org or something like that), or can we find it a home
 for
  the
  book somewhere under the Tapestry namespace ?
 
 
 
 
  A top-level domain should brink more visibility to the effort. Also, in
  the
  future we could probably spend some of the monetary payback to pay for
  the
  domain and some hosting solution so that we could include the live
  version
  of the book application and other cool stuff.
  Still, for now i think we can live with a project on some project
 hosting
  site where we can host the book files and wiki.
 
 
 
  A note on the potential mode for governing decisions : I was thinking
  that
  in the next couple of days, I'll post a list of possible chapters to
  include
  in the book. Then, we can collect a first set of volunteers for people
  take
  

Re: T5 : [ANN] The book - next steps

2008-09-03 Thread Thiago H. de Paula Figueiredo
Em Wed, 03 Sep 2008 15:31:05 -0300, ProAdmin Dariusz Dwornikowski  
[EMAIL PROTECTED] escreveu:



Tapestry alone is no use if you do not have DB.


As a instructor of Java, Hibernate, Spring and other frameworks, my  
experience says that people learn way better when they're learning just  
one thing, one concept, one feature at a time. Therefore, I think the book  
must focus in Tapestry and abstract away the persistence layer. In a later  
chapter, the book would show how to integrate Tapestry and Hibernate. In  
another chapter, the book would show a complete example of Tapestry +  
Hibernate + Spring.


Thiago

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



Re: T5 : [ANN] The book - next steps

2008-09-03 Thread Patrick Moore
I would suggest that you get a way from the linear, single path flow of
writing  book.

I have stopped reading most technical books because they assume that I am a
beginner and am going to read the book in a strictly serial manner.

I would suggest that rather than be chapter focused that you be concept
focused (1-2 pages) and provide different paths through the text. So someone
who is on the beginner path will be lead through the book differently than
someone who is an intermediate.

-pat

On Wed, Sep 3, 2008 at 11:55 AM, Thiago H. de Paula Figueiredo 
[EMAIL PROTECTED] wrote:

 Em Wed, 03 Sep 2008 15:31:05 -0300, ProAdmin Dariusz Dwornikowski 
 [EMAIL PROTECTED] escreveu:

  Tapestry alone is no use if you do not have DB.


 As a instructor of Java, Hibernate, Spring and other frameworks, my
 experience says that people learn way better when they're learning just one
 thing, one concept, one feature at a time. Therefore, I think the book must
 focus in Tapestry and abstract away the persistence layer. In a later
 chapter, the book would show how to integrate Tapestry and Hibernate. In
 another chapter, the book would show a complete example of Tapestry +
 Hibernate + Spring.


 Thiago

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




Re: T5: RenderSupport in XHR requests

2008-09-03 Thread Josh Canfield
If you have a form in the block that is being rendered then I've used the
PREPARE_FOR_RENDER event from the form to inject scripts.
Subcomponents get their render methods called during a partial render, I'm
not sure why the targeted component's render methods are not called.



On Tue, Sep 2, 2008 at 12:26 PM, Chris Lewis [EMAIL PROTECTED]wrote:

 Thanks Howard. Is the availability of RenderSupport within component
 event handlers a candidate for a new feature? Without such support I'm
 not sure how an app can return JS code to be executed to the client as
 the result of an action (ie a fired component event).

 chris

 Howard Lewis Ship wrote:
  It may not work from an event handler method, as its wired into place
  for the partial page render.
 
  On Tue, Sep 2, 2008 at 7:41 AM, Chris Lewis [EMAIL PROTECTED]
 wrote:
 
  Hello,
 
  I was under the impression that the use of RenderSupport to add
  javascript to an AJAX response was supported, and that scripts added in
  such a context via addScript would be executed automatically via
  tapestry.js when the response is received. Isn't that how it should
 work?
 
  I'm using a form with a zone to implement a send link to friend
  feature over ajax, but when I try to add js to execute when the ajax
  reponse completes, a ComponentEventException is thrown saying:
 
  No object of type org.apache.tapestry5.RenderSupport is available from
  the Environment.  Available types are
  org.apache.tapestry5.ValidationTracker,
  org.apache.tapestry5.services.ComponentEventResultProcessor,
  org.apache.tapestry5.services.FormSupport,
  org.apache.tapestry5.services.Heartbeat. [at context:blog/View.tml, line
  51, column 73]
 
  I've verified in the TapestryModule#contributePartialMarkupRenderer
  method, line 1647, that a service named RenderSupport is being being
  added to the pipeline, which suggests that it should be available for
  injection.
 
  The page that's using (or want to use) it in an ajax response explicitly
  checks request.isXHR(), and then adds script code via
  renderSupport.addScript();. Have I missed something?
 
  Thanks in advance,
  chris
 
  --
  http://thegodcode.net
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 
 
 

 --
 http://thegodcode.net




-- 
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.


Re: Newbie question about T5 urls

2008-09-03 Thread Filip S. Adamsen

Nope, that's not possible anymore.

The reason it worked in T4 is that friendly URLs were just aliases for 
the real Tapestry URLs. That's not how it is in T5.


-Filip

On 2008-09-03 14:33, nick shaw wrote:

Hi

I am new to Tapestry5 and I have a question about page urls:

I have a page called admin/ManageContent which I access with
http://server/context-root/admin/manageContent.

I have now secured the page using Acegi so only admin users can access pages
that match /admin/*, so typing the above url into my browser redirects me to
the login page which is great. But is there any way a malicious user could
could bypass the acegi filter to access the page? I know it was possible to
do something like this with T4's friendlyUrls feature.

Nick



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



Re: T5: @PageActivationContext and @CommitAfter

2008-09-03 Thread Filip S. Adamsen

Hi Angelo,

Put

  this.person.view_count = this.person.view_count + 1;

in setupRender (@SetupRender) and put @CommitAfter on that.

-Filip

On 2008-09-03 15:36, Angelo Chen wrote:

Hi,

I have code like this, I updated the view_count in the onActivate

public class Page 
{ 
  private Person person; 


  @CommitAfter  
  void onActivate(Person person) 
  { 
this.person = person; 
	this.person.view_count = this.person.view_count + 1;
  } 

  Object onPassivate() 
  { 
  return this.person; 
  } 
}


Now I have this, very neat, but where can I place the @CommitAfter?

public class Page 
{ 
  @PageActivationContext 
  @Prperty 
  private Person person; 


}


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



Re: T5 : [ANN] The book - next steps

2008-09-03 Thread Timothy Sweetser
Instead of debating the book's structure first, why don't we start out
by just breaking it down into the various topics and subtopics
(excluding introductions, tutorials, and prolonged examples) and
working on them? From my perspective, the priority should be first on
compiling and organizing information, and then later on creating the
narrative structure that ties those individual topics together.

I'd think that, towards the end of the process, we'd have a select few
editors polishing the book. At some point we have to give someone that
responsibility or else it'll remain a wiki (essentially) forever, with
lots of people and lots of opinions on what direction the book should
go. The way I see it, we're responsible for providing the raw
materials, and once that snowball of information reaches critical
mass, we elect the best contributors to the job of creating the final
product. We're the researchers, providing the detailed information and
fact-checking, while the role of editor is reserved for the people who
shine the most during that researching process.

Very much an IMO, but I believe it offers the best chance for
creating a cohesive and coherent end product.

Timothy

On Wed, Sep 3, 2008 at 3:01 PM, Patrick Moore [EMAIL PROTECTED] wrote:
 I would suggest that you get a way from the linear, single path flow of
 writing  book.

 I have stopped reading most technical books because they assume that I am a
 beginner and am going to read the book in a strictly serial manner.

 I would suggest that rather than be chapter focused that you be concept
 focused (1-2 pages) and provide different paths through the text. So someone
 who is on the beginner path will be lead through the book differently than
 someone who is an intermediate.

 -pat

 On Wed, Sep 3, 2008 at 11:55 AM, Thiago H. de Paula Figueiredo 
 [EMAIL PROTECTED] wrote:

 Em Wed, 03 Sep 2008 15:31:05 -0300, ProAdmin Dariusz Dwornikowski 
 [EMAIL PROTECTED] escreveu:

  Tapestry alone is no use if you do not have DB.


 As a instructor of Java, Hibernate, Spring and other frameworks, my
 experience says that people learn way better when they're learning just one
 thing, one concept, one feature at a time. Therefore, I think the book must
 focus in Tapestry and abstract away the persistence layer. In a later
 chapter, the book would show how to integrate Tapestry and Hibernate. In
 another chapter, the book would show a complete example of Tapestry +
 Hibernate + Spring.


 Thiago

 -
 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]



Tapestry 5

2008-09-03 Thread Alex Florentino
How  to make  an complex component layout using tapestry5, I read the T5
begin tutorial and it works fine, but I need create an component layout with
big left menu and then I would like separate at my layout.tml in various tml
files such as leftmenu.tml, footer.tml etc..

how to make it ?

thanks,

Alex


Re: Tapestry 5

2008-09-03 Thread Thiago H. de Paula Figueiredo
Em Wed, 03 Sep 2008 17:42:22 -0300, Alex Florentino  
[EMAIL PROTECTED] escreveu:


How  to make  an complex component layout using tapestry5, I read the  
T5 begin tutorial and it works fine, but I need create an component  
layout with big left menu and then I would like separate at my  
layout.tml in various tml files such as leftmenu.tml, footer.tml etc..


Just think that each one will be a component by itself. In you layout  
component, just use them:


...
div t:type=LeftMenu/
...
t:body/
...
div t:type=Footer/
...

Thiago

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



Re: Tapestry 5

2008-09-03 Thread ProAdmin Dariusz Dwornikowski
http://wiki.apache.org/tapestry/Tapestry5Layoutcomponent
Look here.

2008/9/3 Alex Florentino [EMAIL PROTECTED]

 How  to make  an complex component layout using tapestry5, I read the T5
 begin tutorial and it works fine, but I need create an component layout
 with
 big left menu and then I would like separate at my layout.tml in various
 tml
 files such as leftmenu.tml, footer.tml etc..

 how to make it ?

 thanks,

 Alex




-- 
Pozdrawiam,
Dariusz Dwornikowski

ProAdmin
ul. Królowej Jadwigi 44/2
61-872 Poznań
tel: 061 623-20-92
kom: 0601 59-64-74
fax: 061 623-20-93
www.proadmin.com.pl
[EMAIL PROTECTED]


Re: T4.0 PropertySelection + onChange

2008-09-03 Thread Andreas Andreou
Hi - see the 2nd example in the docs:
http://tapestry.apache.org/tapestry4/tapestry/ComponentReference/PropertySelection.html
and change the onchange js handler the way you like


On Wed, Sep 3, 2008 at 3:39 PM, Leon Derks [EMAIL PROTECTED] wrote:
 Hello

 Is it possible to catch an onchange Event for the PropertySelection
 component?

 I don't want the form te be submitted, but want to update a section in my
 page.

 I use tapestry 4.0.2 with Java 1.4

 Leon

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





-- 
Andreas Andreou - [EMAIL PROTECTED] - http://blog.andyhot.gr
Tapestry / Tacos developer
Open Source / JEE Consulting

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



Re: Newbie question about T5 urls

2008-09-03 Thread nick shaw
Great, that puts my mind at ease!

Thanks Filip

On Wed, Sep 3, 2008 at 9:22 PM, Filip S. Adamsen [EMAIL PROTECTED] wrote:

 Nope, that's not possible anymore.

 The reason it worked in T4 is that friendly URLs were just aliases for
 the real Tapestry URLs. That's not how it is in T5.

 -Filip


 On 2008-09-03 14:33, nick shaw wrote:

 Hi

 I am new to Tapestry5 and I have a question about page urls:

 I have a page called admin/ManageContent which I access with
 http://server/context-root/admin/manageContent.

 I have now secured the page using Acegi so only admin users can access
 pages
 that match /admin/*, so typing the above url into my browser redirects me
 to
 the login page which is great. But is there any way a malicious user could
 could bypass the acegi filter to access the page? I know it was possible
 to
 do something like this with T4's friendlyUrls feature.

 Nick


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




T5 Persistence issue appears when using Firefox with YSlow

2008-09-03 Thread Daniel Jue
This is really weird and I've spend all day trying to fix it.  I believe
this started a couple days ago.

I noticed that my Tapestry-acegi interception code started asking me to
reauthenticate on every page navigation to a new page, or form submission.

Then I noticed my grid tables columns could only be sorted in ascending
order, and only once--after the first sort on that column I could not
reverse the sort.  Sorting on another column would sort that column in
ascending order, and so on.

Here is what I've tried:
I've tried stopping Tomcat and deleting all the deployed stuff, then
redeploying.

Since I have a funky custom Grid Model and Grid Source in most of my app, I
copied over the very basic Grid sample from here:
http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/Grid.html

Except instead of using a DAO, I made a method in the page class:

private ArrayListListableObject getAll() {
ArrayListListableObject lo = new ArrayListListableObject();
for (int i = 0; i  10; i++) {
lo.add(new ListableObject(i, Name + i, 5 * i, Name2 + i));
}
return lo;
}

(I also renamed the tutorial's User class to ListableObject, since I already
have a user class)



What is really strange is that I'm not getting this problem if I use the
IEtab plugin inside Firefox, which makes IE render the tab.


Update:
I seemed to have narrowed down the reason, and I can see my sanity at the
end of the tunnel!  I had the Yahoo YSlow plugin on Autorun, and that seemed
to be the cause of all this.  Now that I've disabled the Autorun feature of
YSlow, the site loads much faster and the problem instantly disappeared!

-Daniel


Re: T4: How I can obtain the system path of my application?

2008-09-03 Thread Andreas Andreou
just add an abstract getter for it (ServletContext) in your page or
component and call it.

On Wed, Sep 3, 2008 at 6:33 PM, Jorge Quiroga [EMAIL PROTECTED] wrote:
 Hello gurus:

 I need to obtain the real path of my application, but I don't know in Tap
 4.1 how to get the ServletContext or how to obtain the object that
 implements that interface. I see the real path when watching a
 cycle.getInfrastructure().getContextRoot() object while debugging, but the
 method to obtain that info isn't accessible or I don't know how to access
 it.

 Thanks

 Jorge Quiroga

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





-- 
Andreas Andreou - [EMAIL PROTECTED] - http://blog.andyhot.gr
Tapestry / Tacos developer
Open Source / JEE Consulting

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



Re: [T5] tapestry-hibernate and transactions

2008-09-03 Thread buckofive

Hi guys,

I have run into a related issue.  I am using a thrid party library which
creates transactions, commits and also performs rollbacks internally.   When
ever a transaction is rolledback in the third party library I later see a
hibernate exception in the log file:

org.hibernate.TransactionException: Transaction not successfully started
at
org.hibernate.transaction.JDBCTransaction.rollback(JDBCTransaction.java:149)
at
org.apache.tapestry5.internal.hibernate.HibernateSessionManagerImpl.threadDidCleanup(HibernateSessionManagerImpl.java:65)


ThreadDidCleanup looks like this in tapestry-hibernate:

public void threadDidCleanup()
{
transaction.rollback();

session.close();
}


The problem is because threadDidCleanup() is not checking to see if it's
internal reference has already been rolled back (somewhere else) before
calling rollback (via Transaction.wasRolledback()).  

I'm not sure if I should file a new JIRA or re-open
https://issues.apache.org/jira/browse/TAPESTRY-2454. Please advise.

thanks,
B




-- 
View this message in context: 
http://www.nabble.com/-T5--tapestry-hibernate-and-transactions-tp17767677p19300096.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



Wrong error message

2008-09-03 Thread Alex Florentino
Hi all,

I was trying make an hello world with tapestry 5, but I make mistake, sample
:

my web.xml :

context-param
param-nametapestry.app-package/param-name
param-valuemy.package.tutorial/param-value
/context-param

filter

filter-nameapp/filter-name
filter-classorg.apache.tapestry5.TapestryFilter/filter-class
/filter

filter-mapping
filter-nameapp/filter-name
url-pattern/*/url-pattern
/filter-mapping

I create very simple Index.tml but I was putting Index.java at package
my.package.tutorial(if package my.package.tutorial it works) then I get :

Caused by: java.lang.RuntimeException: Symbol 'tapestry.app-package' is not
defined.
at
org.apache.tapestry5.ioc.internal.services.SymbolSourceImpl$SymbolExpansion.expandSymbol(SymbolSourceImpl.java:136)
at
org.apache.tapestry5.ioc.internal.services.SymbolSourceImpl$SymbolExpansion.valueForSymbol(SymbolSourceImpl.java:99)
at
org.apache.tapestry5.ioc.internal.services.SymbolSourceImpl.valueForSymbol(SymbolSourceImpl.java:214)


this error message is wrong, because I had defined tapestry.app-package
parameter.

thanks,

Alex


Re: Tapestry 5

2008-09-03 Thread Alex Florentino
thanks

On Wed, Sep 3, 2008 at 6:47 PM, Carl Crowder [EMAIL PROTECTED] wrote:

 Each .tml file is basically a component or page. If you want to separate
 things into separate .tml files then you need to make separate components.

 Assuming your layout component is like this

 html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;
head ... stuff ... /head

t:leftmenu /

t:body /

t:footer /
 /html

 Then you can create a LeftMenu and Footer component in
 your.app.pakage.components and separate the bits into different .tml
 files matching those.

 I'm not sure this is what you want but I hope it helps.

 Carl

 Alex Florentino wrote:
  How  to make  an complex component layout using tapestry5, I read the
 T5
  begin tutorial and it works fine, but I need create an component layout
 with
  big left menu and then I would like separate at my layout.tml in various
 tml
  files such as leftmenu.tml, footer.tml etc..
 
  how to make it ?
 
  thanks,
 
  Alex
 


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