Re: How to use custom onSubmit handler in form tag?

2012-02-02 Thread Michael Gerzabek
Thank you Thiago and Christian, I now switched over to use an action
link scenario. With that the desired implementation is easier to obtain.


Am 31/01/2012 19:50, schrieb Thiago H. de Paula Figueiredo:
> Why don't you just add a listener to the 'submit' function of the form
> using Prototype's Element.observe() or the similar function in jQuery?
> Anyway, adding onXXX attributes to attach listeners to HTML elements
> isn't recommended at all.
>
> On Tue, 31 Jan 2012 15:51:30 -0200, Christian Köberl
>  wrote:
>
>> 2012-01-29, Michael Gerzabek:
>>> The form tag automagically renders a javascript handler for the
>>> onSubmit
>>> event [1, line 388]. It uses the same snippet that's declared for
>>> onclick handler in MarkupConstants.WAIT_FOR_PAGE
>>> <http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/MarkupConstants.html>
>>>
>>> [2] described in [3].
>>>
>>> How could I contribute my own javascript snippet to onSubmit attribute
>>> of forms? How can I override this setting?
>>
>> The problem is that this is no setting and therefore cannot be
>> overwritten.
>>
>> One solution is to override the default JavaScriptStack of Tapestry and
>> provide another implementation of the onSubmit handler:
>> 1. copy CoreJavaScriptStack
>> 2. change tapestry.js in array to a modified copy in your project
>> 3. contribute the overridden configuration
>> public static void
>> contributeJavaScriptStackSource(MappedConfiguration> JavaScriptStack> configuration)
>> {
>>   configuration.overrideInstance(InternalConstants.CORE_STACK_NAME,
>> MyCoreJavaScriptStack.class);
>> }
>>
>> Has anybody a better idea?
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>
>


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



How to use custom onSubmit handler in form tag?

2012-01-29 Thread Michael Gerzabek
The form tag automagically renders a javascript handler for the onSubmit
event [1, line 388]. It uses the same snippet that's declared for
onclick handler in MarkupConstants.WAIT_FOR_PAGE

[2] described in [3].

How could I contribute my own javascript snippet to onSubmit attribute
of forms? How can I override this setting?

[1]
http://tapestry.apache.org/current/apidocs/src-html/org/apache/tapestry5/corelib/components/Form.html
[2]
http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/MarkupConstants.html
[3] http://tapestry.apache.org/javascript.html


Re: [T5] and PayPal

2010-08-26 Thread Michael Gerzabek

 Am 25/08/2010 22:33, schrieb badluck13:

Sorry, but for now I must also hack it, because I'm out of time and deadline
is really close...
But in near future I'm interested to work with you to create module for
paypal, even components and other stuff, but right now I need solution, and
I need it fast ^_^

So if you can share your hack code, send me direct mail.

And I'm already started to work on some modules for tapestry and if you want
to know more we can talk out of list...

And tnx a lot!

Ok, I'll prepare it 'til tomorrow evening.
/M

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



Re: [T5] and PayPal

2010-08-25 Thread Michael Gerzabek
 I did, with 5.0.18 an axis 1.3. It's a kind of a hack, so not really 
proper. no bells and whistles. But if you're interested we could combine 
our efforts an produce a cleaner module together.


Am 25/08/2010 17:49, schrieb badluck13:

Did anyone integrated paypal with tapestry?

And if you did can you share a little code example... ^_^

TNX



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



Re: Tapestry Spring Security - BadCredentialsException

2010-05-27 Thread Michael Gerzabek

Thank you.
/M

Am 27/05/2010 20:28, schrieb Todd Orr:

I exported all the data access code into an independent DAO that is still
managed by Spring. Then I added a constructor to my UserDetailsService that
took the dao plus the salt and encoder:


  private final static Logger LOG =
LoggerFactory.getLogger(UserDetailsServiceImpl.class);

private final Dao dao;

private final PasswordEncoder passwordEncoder;

private final SaltSource saltSource;

/**
  * Default constructor.
  */
  public UserDetailsServiceImpl(Dao dao, PasswordEncoder encoder, SaltSource
salt) {
dao = dao;
  passwordEncoder = encoder;
saltSource = salt;
}

/**
  * Try to find the given user in the local database.
  */
  public UserDetails loadUserByUsername(String username) throws
UsernameNotFoundException {
LOG.debug("Attempting to locate user with username \"{}\"", username);

User user = dao.findUserByUsername(username);

if (user != null) {
  // encode the password
user.setPassword(passwordEncoder.encodePassword(user.getPassword(),
saltSource.getSalt(user)));
  }

LOG.debug("Located user: {}", user);

  return new User(user);
}

Then updated my module to provide the dependencies:

public static UserDetailsService buildUserDetailsService(Dao dao, @Inject
PasswordEncoder encoder,
@Inject SaltSource salt) {
  return new UserDetailsServiceImpl(dao, encoder, salt);
}



On Thu, May 27, 2010 at 1:53 PM, Michael Gerzabek
wrote:

   

Just for the records. What did you change now?

Am 27/05/2010 19:48, schrieb Todd Orr:

  I changed the code so that these are injected and now it works. I cannot
 

describe how angry this makes me. Days wasted.

Thanks for you help though!!!



   


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


 
   



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



Re: Tapestry Spring Security - BadCredentialsException

2010-05-27 Thread Michael Gerzabek

Just for the records. What did you change now?

Am 27/05/2010 19:48, schrieb Todd Orr:

I changed the code so that these are injected and now it works. I cannot
describe how angry this makes me. Days wasted.

Thanks for you help though!!!

   



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



Re: Tapestry Spring Security - BadCredentialsException

2010-05-27 Thread Michael Gerzabek
Did you debug down to the point where the compare of the credential to 
the stored pwd happens? Are they really the same?


Am 27/05/2010 19:37, schrieb Todd Orr:

My UserDetailsService is managed by Spring and as such I can't inject the
same exact instances that tapestry is using, but I do use the same types,
PlaintextPasswordEncoder and SaltSourceImpl.

UserDetailsService:


private final static Logger LOG =
LoggerFactory.getLogger(UserDetailsServiceImpl.class);

@Autowired
  private SessionFactory sessionManager;

private PasswordEncoder passwordEncoder = new PlaintextPasswordEncoder();

private SaltSource saltSource = new SaltSourceImpl();

/**
  * Default constructor.
  */
public UserDetailsServiceImpl() {
  // default
}

/**
  * Try to find the given user in the local database.
  */
@Transactional(propagation = Propagation.REQUIRED, isolation =
Isolation.READ_COMMITTED, readOnly = true)
  public UserDetails loadUserByUsername(String username) throws
UsernameNotFoundException, DataAccessException {
LOG.debug("Attempting to locate user with username \"{}\"", username);

Session session = sessionManager.getCurrentSession();

User user = (User)
session.createCriteria(User.class).add(Restrictions.eq("username",
username)).uniqueResult();

if (user != null) {
// encode the password
user.setPassword(passwordEncoder.encodePassword(user.getPassword(),
saltSource.getSalt(user)));
  }

LOG.debug("Located user: {}", user);

  return new User(user);
}

On Thu, May 27, 2010 at 1:29 PM, Michael Gerzabek
wrote:

   

What about the salt. Did you change it? You have to 'save' password with
your PasswordEncoder prior to using it.

Which Am 27/05/2010 19:20, schrieb Todd Orr:

  I've tried that way as well. It doesn't work either and I assume it's for
 

the same reason, though I cannot tell in that case because the exception
doesn't bubble out of Tapestry Spring Security.

Login code:

private final static Logger LOG = LoggerFactory.getLogger(Login.class);

@Inject
  @Value("${spring-security.check.url}")
private String checkUrl;

@Inject
private Request request;

private boolean failed = false;

public boolean isFailed() {
return failed;
}

public String getLoginCheckUrl() {
String loginCheckUrl = request.getContextPath() + checkUrl;
  LOG.debug("Returning login check url: {}", loginCheckUrl);
return loginCheckUrl;
  }

void onActivate(String extra) {
if (extra.equals("failed")) {
  failed = true;
}
}

TML:

http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";
  xmlns:p="tapestry:parameter">


  

  

  
Username and/or password was wrong!
  

Username:
  

  
Password
  

  

  





Module:

private final static Logger LOG =
LoggerFactory.getLogger(SecurityModule.class);
  public static void
contributeProviderManager(OrderedConfiguration
configuration,
  @InjectService("DaoAuthenticationProvider") AuthenticationProvider
daoAuthenticationProvider) {
LOG.debug("Received AuthenticationProvider: {}",
daoAuthenticationProvider);
  configuration.add("daoAuthenticationProvider",
daoAuthenticationProvider);
}

public static void
contributeAlias(Configuration>
configuration) {
configuration.add(AliasContribution.create(PasswordEncoder.class, new
PlaintextPasswordEncoder()));
  }

public static void
contributeApplicationDefaults(MappedConfiguration   configuration) {
  configuration.add("spring-security.failure.url", "/login/failed");
configuration.add("spring-security.accessDenied.url", "/accessdenied");
  configuration.add("spring-security.check.url",
"/j_spring_security_check");
configuration.add("spring-security.target.url", "/intranet");
  configuration.add("spring-security.afterlogout.url", "/");
configuration.add("spring-security.rememberme.key", "REMEMBERMEKEY");
  configuration.add("spring-security.loginform.url", "/login");
configuration.add("spring-security.force.ssl.login", "false");
  configuration.add("spring-security.anonymous.key", "acegi_anonymous");
configuration.add("spring-security.anonymous.attribute",
"anonymous,ROLE_ANONYMOUS");
  configuration.add("spring-security.password.salt", "DEADBEEF");
}

public static void

contributeFilterSecurityInterceptor(Configuration
configuration) {
configuration.add(new RequestInvocationDefinition("/intranet*/**",
"ROLE_ADMIN"));
  }


No redirect to the target URL occurs. It just says that "Username and/or
password was wrong!".


   


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


 
   



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



Re: Tapestry Spring Security - BadCredentialsException

2010-05-27 Thread Michael Gerzabek
What about the salt. Did you change it? You have to 'save' password with 
your PasswordEncoder prior to using it.


Which Am 27/05/2010 19:20, schrieb Todd Orr:

I've tried that way as well. It doesn't work either and I assume it's for
the same reason, though I cannot tell in that case because the exception
doesn't bubble out of Tapestry Spring Security.

Login code:

private final static Logger LOG = LoggerFactory.getLogger(Login.class);

@Inject
  @Value("${spring-security.check.url}")
private String checkUrl;

@Inject
private Request request;

private boolean failed = false;

public boolean isFailed() {
return failed;
}

public String getLoginCheckUrl() {
String loginCheckUrl = request.getContextPath() + checkUrl;
  LOG.debug("Returning login check url: {}", loginCheckUrl);
return loginCheckUrl;
  }

void onActivate(String extra) {
if (extra.equals("failed")) {
  failed = true;
}
}

TML:

http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";
  xmlns:p="tapestry:parameter">


  

  

  
Username and/or password was wrong!
  

Username:
  

  
Password
  

  

  





Module:

private final static Logger LOG =
LoggerFactory.getLogger(SecurityModule.class);
  public static void
contributeProviderManager(OrderedConfiguration
configuration,
  @InjectService("DaoAuthenticationProvider") AuthenticationProvider
daoAuthenticationProvider) {
LOG.debug("Received AuthenticationProvider: {}", daoAuthenticationProvider);
  configuration.add("daoAuthenticationProvider", daoAuthenticationProvider);
}

public static void
contributeAlias(Configuration>
configuration) {
configuration.add(AliasContribution.create(PasswordEncoder.class, new
PlaintextPasswordEncoder()));
  }

public static void contributeApplicationDefaults(MappedConfiguration  configuration) {
  configuration.add("spring-security.failure.url", "/login/failed");
configuration.add("spring-security.accessDenied.url", "/accessdenied");
  configuration.add("spring-security.check.url", "/j_spring_security_check");
configuration.add("spring-security.target.url", "/intranet");
  configuration.add("spring-security.afterlogout.url", "/");
configuration.add("spring-security.rememberme.key", "REMEMBERMEKEY");
  configuration.add("spring-security.loginform.url", "/login");
configuration.add("spring-security.force.ssl.login", "false");
  configuration.add("spring-security.anonymous.key", "acegi_anonymous");
configuration.add("spring-security.anonymous.attribute",
"anonymous,ROLE_ANONYMOUS");
  configuration.add("spring-security.password.salt", "DEADBEEF");
}

public static void
contributeFilterSecurityInterceptor(Configuration
configuration) {
configuration.add(new RequestInvocationDefinition("/intranet*/**",
"ROLE_ADMIN"));
  }


No redirect to the target URL occurs. It just says that "Username and/or
password was wrong!".
   



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



Re: Tapestry Spring Security - BadCredentialsException

2010-05-27 Thread Michael Gerzabek
Why do you try to do the work of Spring Security? Please follow the 
sample in [1]. There's no need to check the credentials on your own. You 
just need to provide your implementation of UserDetails.


[1] http://www.localhost.nu/svn/public/tapestry-spring-security-sample/

Am 27/05/2010 16:53, schrieb Todd Orr:

I am trying to integrate spring security into my Tapestry application and am
unable to get the TSS module to work correctly. I've created a login page
and am attempting to perform the authentication manually so that I can use
tap for the fields etc. I have a login page with the j_username, etc. also.
It doesn't work either. The code for my login page is:


private final static Logger LOG = LoggerFactory.getLogger(LoginPage.class);

@Inject
  private RequestGlobals requestGlobals;

@Inject
private AuthenticationManager authenticationManager;

private Class  defaultTargetUrl = Index.class;

@SuppressWarnings("unused")
  @Inject
private Request request;

@SuppressWarnings("unused")
  @Inject
private Response response;

@Persist
  @Property
private String username;

@Persist(PersistenceConstants.FLASH)
  @Property
private String password;

@Property
  @Component(id = "loginForm")
private Form loginForm;

  private Authentication authResult;

@Component(id = "password")
  private PasswordField passwordField;

@SuppressWarnings("unused")
  @Component(id = "username")
private TextField usernameField;

  public void onValidateFormFromLoginForm() {
// clean up the properties
  username = username == null ? null : username.trim();
password = password == null ? null : password.trim();

UsernamePasswordAuthenticationToken authRequest = new
UsernamePasswordAuthenticationToken(username, password);
try {
  authResult = authenticationManager.authenticate(authRequest);

} catch (BadCredentialsException e) {
  LOG.warn("Authentication failed: {}", e.getAuthentication());
loginForm.recordError(passwordField, "Invalid username or password");

} catch (AuthenticationException e) {
LOG.warn("Authentication failed: {}", e.getAuthentication());
  loginForm.recordError(passwordField, "Invalid username or password");
}

}

public Object onSuccessFromLoginForm() {

  SavedRequest savedRequest = (SavedRequest)
requestGlobals.getHTTPServletRequest().getSession().getAttribute(
AbstractProcessingFilter.SPRING_SECURITY_SAVED_REQUEST_KEY);

SecurityContextHolder.getContext().setAuthentication(authResult);

if (savedRequest != null) {

URL url = null;
try {
url = new URL(savedRequest.getRequestURL());

} catch (MalformedURLException e) {
LOG.error("malformed url:" + savedRequest.getRequestURI());
  return defaultTargetUrl;
}

return url;

}

return defaultTargetUrl;

  }

And the stdout shows the following when attempting to login:

10:49:01,733 DEBUG [UserDetailsServiceImpl] Attempting to locate user with
username "my_username"
10:49:01,782 INFO  [sqlonly] select this_.user_id as user1_0_1_,
this_.user_passwd as user2_0_1_, this_.user_username as
user3_0_1_, roles2_.u_to_p_frn_user_id as u2_3_,
roles2_.u_to_p_frn_permission_id as u1_3_,
roles2_.u_to_p_frn_permission_id as u1_1_0_, roles2_.u_to_p_frn_user_id as
u2_1_0_ from users
this_ left outer join user_to_permissions roles2_ on
this_.user_id=roles2_.u_to_p_frn_user_id
where this_.user_username='my_username'
10:49:02,063 DEBUG [UserDetailsServiceImpl] Located user:
User[username=my_username,roles=[ROLE_TEMP,
ROLE_ADMIN],authorities=[ROLE_TEMP, ROLE_ADMIN]]
10:49:02,446 WARN  [LoginPage] Authentication failed:
org.springframework.security.providers.usernamepasswordauthenticationto...@1f:
Principal: my_username; Password: [PROTECTED]; Authenticated: false;
Details: null; Not granted any authorities

I am sure that a valid user with valid authorities is being returned from my
UserDetailsService. I am sure it's password matches the password I am
providing. But no matter what, it always - ALWAYS - throws the
BadCredentialsException.

I've been beating my head against this wall since Tuesday - literally.
Please advise.

Thanks,
T

   



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



Re: [T5.1] tapestry-spring-security : overriding saltsource probleme

2010-05-07 Thread Michael Gerzabek

So finally it's fine!
I'll put your code into the 'official' documentation ..
Thank you

Am 07/05/2010 10:55, schrieb Nicolas Bouillon:

Oups, sorry i had made a mistake when trying this way. I actually worked.


 public static void contributeServiceOverride(
 MappedConfiguration  configuration) {
 configuration.add(SaltSourceService.class, new SaltSourceService()
{
 public Object getSalt(UserDetails user) {
 return "";
 }
 });
 }

 public static void contributeAlias(
 Configuration>  configuration) {
 configuration.add(AliasContribution.create(PasswordEncoder.class,
 new Md5PasswordEncoder()));
 }


Sorry for the noise, and thanks for the help.

On Thu, 06 May 2010 17:39:01 +0200, Nicolas Bouillon
wrote:
   

Unfortunately, it doesn't work.

On Thu, 06 May 2010 13:21:18 +0200, Michael Gerzabek
  wrote:
 

I'm not 100% sure here but think you have to override the SSS. In your
AppModule write something like

public static void
contributeServiceOverride(MappedConfiguration
   

configuration)
 

{
  configuration.add(SaltSourceService.class, new new
   

SaltSourceService()
 

  {
  public Object getSalt(UserDetails user) {
  return "";
  }
  });
}

Have a look at:

   
 

http://tapestry.apache.org/tapestry5.1/tapestry-ioc/cookbook/override.html
   

/M

Am 06/05/2010 11:02, schrieb Nicolas Bouillon:
   

Hi,

I got a problem using tapestry-spring-security (
http://www.localhost.nu/java/tapestry-spring-security/ )

I have to override the SaltSourceService because my password database
doesn't use any Salt.

I have added this code to my AppModule :

  public static void contributeAlias(
  Configuration>   configuration) {

 

configuration.add(AliasContribution.create(PasswordEncoder.class,
 

  new Md5PasswordEncoder()));

 

configuration.add(AliasContribution.create(SaltSourceService.class,
 

  new SaltSourceService() {
  public Object getSalt(UserDetails user) {
  return "";
  }
  }));
  }


The SaltSourceService seems to be set this way in the SecurityModule
class
from tapestry-spring-security :

  public static void contributeAlias(
  @SpringSecurityServices SaltSourceService saltSource,
  @SpringSecurityServices
UsernamePasswordAuthenticationProcessingFilter
authenticationProcessingFilter,
  Configuration>   configuration ) {

  configuration.add( AliasContribution.create(
SaltSourceService.class, saltSource ) );
  configuration.add( AliasContribution.create(
  UsernamePasswordAuthenticationProcessingFilter.class,
  authenticationProcessingFilter ) );
  }

  @Marker( SpringSecurityServices.class )
  public static SaltSourceService buildSaltSource(
  @Inject @Value( "${spring-security.password.salt}" ) final
String salt ) throws Exception {

  SaltSourceImpl saltSource = new SaltSourceImpl();
  saltSource.setSystemWideSalt( salt );
  saltSource.afterPropertiesSet();
  return saltSource;
  }


The problem is, from one run to another, the initialisation order is
maybe
different, and then my SaltSourceService is not used because my
 

AppModule
 

alias conflics withe the existing one :

org.apache.tapestry5.services.TapestryModule.Alias - Contribution
tapestry.services.appmodul...@fb0c124 (for type
nu.localhost.tapestry5.springsecurity.services.SaltSourceService)
conflicts
with existing contribution 
 

SaltSource(nu.localhost.tapestry5.springsecurity.services.SaltSourceService)>
   

and has been ignored.

But if i stop and run again, it may work because my alias is maybuild
built
first :

org.apache.tapestry5.services.TapestryModule.Alias - Contribution 
 

SaltSource(nu.localhost.tapestry5.springsecurity.services.SaltSourceService)>
   

(for type
nu.localhost.tapestry5.springsecurity.services.SaltSourceService)
conflicts with existing contribution
tapestry.services.appmodul...@7333fb54
and has been ignored.

Is there any possiblity to force Tapestry to use my version of the
service
?

Thanks.


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


 


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

--

Re: [T5.1] tapestry-spring-security : overriding saltsource probleme

2010-05-07 Thread Michael Gerzabek

ouch, sorry!
I don't have the time now to dig deeper but will do tomorrow ..

Am 07/05/2010 07:00, schrieb Nicolas Bouillon:

Did you tried that ?

It doesn't work, because TSS pass this value to the 
SystemWideSaltSource class from spring add calls the following 
afterPropertiesSet method :


public void afterPropertiesSet() throws Exception {
if ((this.systemWideSalt == null) || 
"".equals(this.systemWideSalt)) {
throw new IllegalArgumentException("A systemWideSalt must 
be set");

}
}



Le 06/05/2010 21:36, Michael Gerzabek a écrit :

well then the only thing you have to do is

public static void contributeApplicationDefaults(
MappedConfiguration  configuration ) {

  configuration.add( "spring-security.password.salt", "" );
  }

and everything should work out fine.

Am 06.05.2010 21:05, schrieb Nicolas Bouillon:

I use the TSS 2.1.0 with Tapestry 5.1.0.5.

I just get a login failed, because the default TSS SaltSource is 
used (with "DEADBEEF" as salt).


My database doesn't have salt for password, and setting 
spring-security.password.salt to the empty string fails (thrown 
exception from Spring SystemWideSaltSource).


The problem is, if i override the SaltSource as explained in 
http://www.localhost.nu/java/tapestry-spring-security/conf.html # 
Alias Contributions : sometimes the override works, sometime not. 
Seems to depends of initialization order.


Le 06/05/2010 20:40, Michael Gerzabek a écrit :
Which TSS version do you use? Is it 2.1.0? Which T5 version? T 
5.1.0.5? Which error do you get?



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




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




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




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



Re: [T5.1] tapestry-spring-security : overriding saltsource probleme

2010-05-06 Thread Michael Gerzabek

well then the only thing you have to do is

public static void contributeApplicationDefaults(
MappedConfiguration  configuration ) {

  configuration.add( "spring-security.password.salt", "" );
  }

and everything should work out fine.

Am 06.05.2010 21:05, schrieb Nicolas Bouillon:

I use the TSS 2.1.0 with Tapestry 5.1.0.5.

I just get a login failed, because the default TSS SaltSource is used 
(with "DEADBEEF" as salt).


My database doesn't have salt for password, and setting 
spring-security.password.salt to the empty string fails (thrown 
exception from Spring SystemWideSaltSource).


The problem is, if i override the SaltSource as explained in 
http://www.localhost.nu/java/tapestry-spring-security/conf.html # 
Alias Contributions : sometimes the override works, sometime not. 
Seems to depends of initialization order.


Le 06/05/2010 20:40, Michael Gerzabek a écrit :
Which TSS version do you use? Is it 2.1.0? Which T5 version? T 
5.1.0.5? Which error do you get?



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




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



Re: [T5.1] tapestry-spring-security : overriding saltsource probleme

2010-05-06 Thread Michael Gerzabek
Which TSS version do you use? Is it 2.1.0? Which T5 version? T 5.1.0.5? 
Which error do you get?


Am 06.05.2010 17:39, schrieb Nicolas Bouillon:

Unfortunately, it doesn't work.

On Thu, 06 May 2010 13:21:18 +0200, Michael Gerzabek
  wrote:
   

I'm not 100% sure here but think you have to override the SSS. In your
AppModule write something like

public static void
contributeServiceOverride(MappedConfiguration
 

configuration)
   

{
  configuration.add(SaltSourceService.class, new new
 

SaltSourceService()
   

  {
  public Object getSalt(UserDetails user) {
  return "";
  }
  });
}

Have a look at:

 

http://tapestry.apache.org/tapestry5.1/tapestry-ioc/cookbook/override.html
   

/M

Am 06/05/2010 11:02, schrieb Nicolas Bouillon:
 

Hi,

I got a problem using tapestry-spring-security (
http://www.localhost.nu/java/tapestry-spring-security/ )

I have to override the SaltSourceService because my password database
doesn't use any Salt.

I have added this code to my AppModule :

  public static void contributeAlias(
  Configuration>   configuration) {

   

configuration.add(AliasContribution.create(PasswordEncoder.class,
   

  new Md5PasswordEncoder()));

   

configuration.add(AliasContribution.create(SaltSourceService.class,
   

  new SaltSourceService() {
  public Object getSalt(UserDetails user) {
  return "";
  }
  }));
  }


The SaltSourceService seems to be set this way in the SecurityModule
class
from tapestry-spring-security :

  public static void contributeAlias(
  @SpringSecurityServices SaltSourceService saltSource,
  @SpringSecurityServices
UsernamePasswordAuthenticationProcessingFilter
authenticationProcessingFilter,
  Configuration>   configuration ) {

  configuration.add( AliasContribution.create(
SaltSourceService.class, saltSource ) );
  configuration.add( AliasContribution.create(
  UsernamePasswordAuthenticationProcessingFilter.class,
  authenticationProcessingFilter ) );
  }

  @Marker( SpringSecurityServices.class )
  public static SaltSourceService buildSaltSource(
  @Inject @Value( "${spring-security.password.salt}" ) final
String salt ) throws Exception {

  SaltSourceImpl saltSource = new SaltSourceImpl();
  saltSource.setSystemWideSalt( salt );
  saltSource.afterPropertiesSet();
  return saltSource;
  }


The problem is, from one run to another, the initialisation order is
maybe
different, and then my SaltSourceService is not used because my
   

AppModule
   

alias conflics withe the existing one :

org.apache.tapestry5.services.TapestryModule.Alias - Contribution
tapestry.services.appmodul...@fb0c124 (for type
nu.localhost.tapestry5.springsecurity.services.SaltSourceService)
conflicts
with existing contribution   

SaltSource(nu.localhost.tapestry5.springsecurity.services.SaltSourceService)>
   

and has been ignored.

But if i stop and run again, it may work because my alias is maybuild
built
first :

org.apache.tapestry5.services.TapestryModule.Alias - Contribution   

SaltSource(nu.localhost.tapestry5.springsecurity.services.SaltSourceService)>
   

(for type
nu.localhost.tapestry5.springsecurity.services.SaltSourceService)
conflicts with existing contribution
tapestry.services.appmodul...@7333fb54
and has been ignored.

Is there any possiblity to force Tapestry to use my version of the
service
?

Thanks.


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


   


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

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

   



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



Re: [T5.1] tapestry-spring-security : overriding saltsource probleme

2010-05-06 Thread Michael Gerzabek
I'm not 100% sure here but think you have to override the SSS. In your 
AppModule write something like


public static void contributeServiceOverride(MappedConfiguration  
configuration)
  {
configuration.add(SaltSourceService.class, new new SaltSourceService() {
public Object getSalt(UserDetails user) {
return "";
}
});
  }

Have a look at: 
http://tapestry.apache.org/tapestry5.1/tapestry-ioc/cookbook/override.html

/M

Am 06/05/2010 11:02, schrieb Nicolas Bouillon:

Hi,

I got a problem using tapestry-spring-security (
http://www.localhost.nu/java/tapestry-spring-security/ )

I have to override the SaltSourceService because my password database
doesn't use any Salt.

I have added this code to my AppModule :

 public static void contributeAlias(
 Configuration>  configuration) {
 configuration.add(AliasContribution.create(PasswordEncoder.class,
 new Md5PasswordEncoder()));
 configuration.add(AliasContribution.create(SaltSourceService.class,
 new SaltSourceService() {
 public Object getSalt(UserDetails user) {
 return "";
 }
 }));
 }


The SaltSourceService seems to be set this way in the SecurityModule class
from tapestry-spring-security :

 public static void contributeAlias(
 @SpringSecurityServices SaltSourceService saltSource,
 @SpringSecurityServices
UsernamePasswordAuthenticationProcessingFilter
authenticationProcessingFilter,
 Configuration>  configuration ) {

 configuration.add( AliasContribution.create(
SaltSourceService.class, saltSource ) );
 configuration.add( AliasContribution.create(
 UsernamePasswordAuthenticationProcessingFilter.class,
 authenticationProcessingFilter ) );
 }

 @Marker( SpringSecurityServices.class )
 public static SaltSourceService buildSaltSource(
 @Inject @Value( "${spring-security.password.salt}" ) final
String salt ) throws Exception {

 SaltSourceImpl saltSource = new SaltSourceImpl();
 saltSource.setSystemWideSalt( salt );
 saltSource.afterPropertiesSet();
 return saltSource;
 }


The problem is, from one run to another, the initialisation order is maybe
different, and then my SaltSourceService is not used because my AppModule
alias conflics withe the existing one :

org.apache.tapestry5.services.TapestryModule.Alias - Contribution
tapestry.services.appmodul...@fb0c124 (for type
nu.localhost.tapestry5.springsecurity.services.SaltSourceService) conflicts
with existing contribution
and has been ignored.

But if i stop and run again, it may work because my alias is maybuild built
first :

org.apache.tapestry5.services.TapestryModule.Alias - Contribution
(for type nu.localhost.tapestry5.springsecurity.services.SaltSourceService)
conflicts with existing contribution tapestry.services.appmodul...@7333fb54
and has been ignored.

Is there any possiblity to force Tapestry to use my version of the service
?

Thanks.


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

   



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



Re: [Tapestry Central] Next Steps for Tapestry

2009-11-07 Thread Michael Gerzabek

Carl Crowder schrieb:
Agreed: the main thing Tapestry is lacking is a book that explains not 
just the basics but also concepts that it takes months of working with 
Tapestry to discover. Things like shadow builders and so on. I don't 
care who writes one as long as there's a definitive guide!

+1

Michael Gerzabek



jose luis sanchez wrote:

Book ! Book ! Book !

El 07/11/2009, a las 19:11, Howard escribió:


I've been consciously letting Tapestry 5.1 sit and stabilize for a
while ... a time that's stretched a few months longer than I initially
intended.
This is due to a number of factors: my return to independent
consulting, my desire to write a definitive Tapestry 5 book, and
preparations for many trips and speaking engagements.
All of these factors have worked on each other: I've been improving and
extending my Tapestry Workshop training materials which can be quite
time consuming. I've also (over the last several months) been on the
road several times, talking about Tapestry or doing Tapestry training.
I do want to write a book on Tapestry but if I start writing 5.2 code,
I know I'll be sucked right in ... lots of code (that darn Spring Web
Flow integration for sure this time) and bug fixes.
In addition, I've had an embarassment of riches: two main clients, one
regular part time, and the other requesting (but not always getting)
all my remaining time. I also have additional clients and training
engagements waiting in the wings. I simply have a lot of draws on my
time.
As usual, working on real-world projects lets me experience the "rough
edges" of Tapestry and fills me with ideas on how to address those in
the next release ... often by splitting up Tapestry services into
smaller, more easily overridden chunks and carefully moving internal
services out into the public APIs.
Finally, I've been very pleased by the fact that as I've stepped back
temporarily from my normal stream of commits, the other Tapestry
developers have stepped in and filled the gap. There's been quite a bit
of activity especially from Igor that I've barely had a chance to keep
up on.
So the question is: do I wait and see if time opens up in Q1 to
actually start on a T5 book ... or do I jump into 5.2 coding and leave
books to others? It's much, much easier to write code than to write a
book ... a book is a large amount of concentrated effort. It's very
hard to accomplish anything on a book using an hour here or an evening
there ... whereas Tapestry's code base lends itself to that kind of
effort quite nicely.

--
Posted By Howard to Tapestry Central at 11/07/2009 10:11:00 AM



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



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




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



Re: Tapestry upgrading to prototype.js version 1.6.1 for IE8 compliance

2009-10-02 Thread Michael Gerzabek

But a very good one: I do all customizations that way!
I ever thought that's the proposed way to do things with T5

Howard Lewis Ship schrieb:

If that works, it's a bug!

On Thu, Oct 1, 2009 at 4:45 PM, Daniel Jones  wrote:

No idea when it will be included, probably in the next release.

If it is important to you at the moment, just copy it into
src/webapp/scriptaculous/5.1.0.5/prototype.js and it will override the
version included with tapestry (if you haven't done this already).

Regards,
Daniel


MattFish wrote:

The latest version of tapestry still comes with version 1.6.0 of the
prototype javascript framework. It isn't until version 1.6.1 that this is
compliant with IE8 and a lot of the problems with the old version and IE8
have been fixed. Does anyone have any idea when the updated library will
be included in tapestry core?


--
View this message in context: 
http://www.nabble.com/Tapestry-upgrading-to-prototype.js-version-1.6.1-for-IE8-compliance-tp25676288p25708450.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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









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



Re: Non-java External configuration in T5 -- can it be done?

2009-09-30 Thread Michael Gerzabek
You could implement your own SymbolProvider [1] that reads a properties 
file with all your runtime-stuff. You can implement a reloadable 
mechanism so that the values can be altered at runtime (or not).


In your Module you contribute this provider to the SymbolSource service. 
You can even decide at what position (there's a hirarchie of 
SymbolProviders) you want your provider at.


To retrieve configs in your services and pages you just inject 
SymbolSource and voila global access to all config info should be in place.


Total time to implement a first draft for a rather unexperienced 
programmer (like me) 10 minutes.


Regards,
Michael

[1] 
http://tapestry.apache.org/tapestry5.1/apidocs/org/apache/tapestry5/ioc/services/SymbolProvider.html



Patrick Moore schrieb:

Hi there --

I am looking to move from T4 to T5.

In T4/hivemind  configuration configuration was in xml files. This was great
because:

   1. is easily modifiable by non-Java programmers.
   2. By only allowing non-java types to change xml files, there was limited
   ways that damage could be done.
   3. Config changes did not require a rebuild/retest/redeploy cycle.
   4. non-programmer types could alter how modules were hooked together.

Moving to T5,

   1. some inner plumbing modules do make better sense to be hidden away
   from non-programmer type's fingers.
   2. For other modules, we want to allow things like directory paths and
   other text configuration to be exposed.  (properties file??)
   3. Other modules we do want to continue to leave "exposed" ala T4

Obviously, we do not want to be "fighting" T5 conventions. So what are
people's suggestions?

Is there a way to hook hivemind into T5?

Is there a standard way to read properties files and match property names to
java bean getter/setters?

Something I missed?

Patrick Moore
Amplafi
http://amplafi.com
650-207-9792
"Put your front window on your website"
corp blog : http://amplafi.com/blog
personal blog : http://www.sworddance.com/blog




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



Re: New Tapestry Website - Final review

2009-09-21 Thread Michael Gerzabek

Howard Lewis Ship schrieb:

Tapestry used to use Forrest, but it was a lot of work to get it functioning
correctly and predictably.
  
That was true for older versions. With 0.8, which is the same release 
for two years right now, it's really simple.


1. unpack the zip into some arbitrary directory
2. set path to contain FORREST_HOME\bin
3. do "forrest seed" in the directory where you want the documentation
4. and start editing with your favorite XML editor

Changing the stylesheet or project layout is a rather more complex task 
though.



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



Re: New Tapestry Website - Final review

2009-09-21 Thread Michael Gerzabek

Howard Lewis Ship schrieb:


On another front ... the organization (outside of my above thoughts) appears
pretty nice (I still haven't had a chance to look at it in more detail) but
this documentation reboot is also a chance to move away from using Maven to
generate the documentation. I've had good luck using Ant + XSLT for my
personal web sites, but I'd also be interested in looking at other options,
including non-Java based ones (Texttile & redbook & those other options).
 It's just a matter of building out the HTML and transferring it up to
Apache, it doesn't have to be Java-based ... and I think a visual refresh,
even beyond what Sebastian has accomplished, would be a good thing.
Do you know http://forrest.apache.org? I use(d) it a lot and it has 
everything in place for documentation and static websites. You could 
also write docs in docbook format, generate pdf's and write your 
documentation with forrest running in servlet mode for live page reloading.





On Mon, Sep 21, 2009 at 9:47 AM, Piero Sartini wrote:


+1 for single-click navigation!

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








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



Re: Website concept

2009-09-10 Thread Michael Gerzabek

Sebastian Hennebrueder schrieb:

I setup a quick web page to visualize the information groups and pointers
http://www.laliluna.de/tapestry/tapestry.html

Very nice. A lot of time on your side :)


It uses the current design but just edit jquery accordion 
functionality and related css.


The purpose of this is to show the structure. Colors are not aligned 
between Accordion and logo, the CSS of the information boxes is 
minimal and not made for webkit based browsers(Chrome and Safari). The 
existing styles are not aligned with the new styles.
I changed the existing font size for the menu and made it slightly 
bigger.


What do you think?
As you mentioned in your OpenOffice document. Make T5.1 most prominent. 
So when offering the downloads just offer a link the latest version. 
Then in a smaller font or maybe not so splendig color offer "older 
versions". Maybe this is also an invisible sign for everyone using older 
versions to get ready for the bleeding edge.


There is still a lot of information - kind a overwhelming - in the boxes 
at the bottom.


Is it technical possible to do something like this?

Not a pro here.

Michael

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



Re: Website concept

2009-09-10 Thread Michael Gerzabek

Ulrich Stärk schrieb:

http://tapestry.formos.com/nightly/tapestry5/guide/request.html

GREAT! Thanks for that.


BTW: http://tapestry.formos.com/nightly/tapestry5/guide/rendering.html 
is still not working. (see 
https://issues.apache.org/jira/browse/TAP5-813)

Interesting, because
http://tapestry.apache.org/tapestry5.1/guide/rendering.html
is working.

Michael


Uli

On 10.09.2009 12:00 schrieb Michael Gerzabek:
Sebastian, great job! The main point is your thesis of missing 50 to 
80 percent of potential new customers. What a waste of time and 
brainpower!!!


I completely agree in selling the stuff to new users. This could as 
you pointed out very elegantly with rather small changes in the 
structure and graphical design.


Anyway. What I see as an urgent need though are some high level 
architecture overviews like the one of the component rendering [1]. 
For example what was hard to learn for me was the concept of how the 
request ist processed. A single picture of the different cycles of 
render-request and action-request (and when what setup is important 
and how achieved) would solve a lot of problems. And I'm sure there 
are many other concepts as well.


Kudos Sebastian!

Michael

[1] http://tapestry.apache.org/tapestry5.1/guide/rendering.html

Hennebrueder schrieb:

Hello,
I have made a quick and dirty analysis of the website, defining 
roles of new and existing users, specifying the needs of those 
groups and validating if the current website fullfills these needs.

From there on, I have developed a new information concept.

Please, see this as discussion proposal and please keep in mind, 
that I haven't proof read this many times. I would appreciate your 
comments, especially have a look if I have overlooked something in 
the user modelling or requirement analysis and of course in the 
information concept.


I will set up a page, showing how a possible page could look like.

There is a task list which needs to be validated as it might be 
incomplete, wrong or conflict with infrastructure limitations we have.


I attached the analysis as OpenOffice Document and PDF.

 




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



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



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




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



Re: Website concept

2009-09-10 Thread Michael Gerzabek
Sebastian, great job! The main point is your thesis of missing 50 to 80 
percent of potential new customers. What a waste of time and brainpower!!!


I completely agree in selling the stuff to new users. This could as you 
pointed out very elegantly with rather small changes in the structure 
and graphical design.


Anyway. What I see as an urgent need though are some high level 
architecture overviews like the one of the component rendering [1]. For 
example what was hard to learn for me was the concept of how the request 
ist processed. A single picture of the different cycles of 
render-request and action-request (and when what setup is important and 
how achieved) would solve a lot of problems. And I'm sure there are many 
other concepts as well.


Kudos Sebastian!

Michael

[1] http://tapestry.apache.org/tapestry5.1/guide/rendering.html

Hennebrueder schrieb:

Hello,
I have made a quick and dirty analysis of the website, defining roles 
of new and existing users, specifying the needs of those groups and 
validating if the current website fullfills these needs.

From there on, I have developed a new information concept.

Please, see this as discussion proposal and please keep in mind, that 
I haven't proof read this many times. I would appreciate your 
comments, especially have a look if I have overlooked something in the 
user modelling or requirement analysis and of course in the 
information concept.


I will set up a page, showing how a possible page could look like.

There is a task list which needs to be validated as it might be 
incomplete, wrong or conflict with infrastructure limitations we have.


I attached the analysis as OpenOffice Document and PDF.




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



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



Re: New Tapestry tutorial -> documentation structure

2009-09-09 Thread Michael Gerzabek

Sebastian Hennebrueder schrieb:


Furthermore, do you agree that we only translate the tutorial into 
languages where at least 2 persons are ready to keep the translation 
up to date. I propose this backup for two reason. Firstly, I 
experienced this for my own tutorial where I had people willing to 
translate tutorials and this stopped after a couple of months. 
Because, it is really work and interests or available time can easily 
change. The other reason is that every translation, my English writing 
needs reviews to iron out the worst mistakes. This is our welcome 
documentation for the first user. It needs to be as smooth as 
possible. I need proof reading for my German texts as well.



I think this 2 person thing is most desireably. Maybe what's needed is 
some code of ethics that says "when you leave for whatever reason you 
will bring a backup for yourself". It seems to me that in these days 
things are changing a lot and it's quite possible that people have time 
now, say for 3 to 4 months, but won't have time in 4 months through new 
engagements or whatever.


I would volunteer for the proof reading of your German texts.

Michael


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



Re: Securing files on the classpath/webapp context (was: Re: Running Tapestry 5.0.18 on Google App Engine)

2009-08-27 Thread Michael Gerzabek
I must say I was a little bit shocked when I heard about this security 
hole and found an easy way within httpd (mod_rewrite) to circumvene this 
problem at first.


Thinking about how it should be I would prefer the 'blacklist 
everything'-approach. This way a dev never has to worry about what's 
opened up by deploying a third party jar.


Of course extra documentation is needed then to pre-answer mailing list 
questions like 'my packaged images don't show up' ...


Michael

Ulrich Stärk schrieb:
I really like to hear what the other devs (apart from Thiago) are 
thinking about this, whether there are objections against what I 
proposed or if you think there are better solutions. This really needs 
fixing ASAP.


Cheers,

Uli

On 26.08.2009 13:41 schrieb Ulrich Stärk:
> I think that's way too complicated. Keep it simple:
>
> a) blacklist everything and let the user contribute filenames, file
> extensions or paths to some whitelisting service (already having some
> reasonable defaults like .css, .js, .png, ...) which AssetSource 
queries

> before returning an Asset
> b) restrict the AssetSource to only return assets referenced in a
> component/page using @Path, @IncludeJavaScriptLibrary,
> @IncludeStylesheet and the context: and asset: binding prefixes
>
> Uli
>
> On 26.08.2009 13:19 schrieb Thiago H. de Paula Figueiredo:
>> Em Wed, 26 Aug 2009 04:12:29 -0300, Onno Scheffers 
>> escreveu:
>>
>>> @Thiago
>>> How about allowing absolutely nothing from the classpath/WEB-INF
>>> initially?
>>> Directory listing should also be disabled.
>>
>> I agree. My suggestion to TAP-815 was:
>>
>> "I would suggest to have a chain of command, each object in it
>> receiving the requested URL and responding true (ok), false (file is
>> forbidden) or null (this object doesn't handle this URL, ask the same
>> thing to the next object. This chain of command terminator would be a
>> very restrictive one."
>>
>

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




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



Re: tapestry-spring-security-2.1.0 logout issue

2009-08-12 Thread Michael Gerzabek

Norman Franke schrieb:
The demo/sample app did work fine, but my non-trivial app fails unless 
I add the explicit session.invalidate() call in my event handler. I 
have no super classes, but I do use a layout component. It's rather 
trivial, providing a menu and two-column layout. Nothing fancy. 
However, putting the event handler either in the layout component or 
in my start page both cause the error. I was just thinking the layout 
component changes how T5 processes the request, perhaps.


The stack trace is displayed in the web browser as a Tomcat exception, 
not a nice Tapestry exception.
Ok. That means you get the exception when the page already is 
redirected. Can you confirm that?


/M


Norman Franke
Answering Service for Directors, Inc.
www.myasd.com



On Aug 12, 2009, at 11:51 AM, Michael Gerzabek wrote:


So. What does this mean?

Did the sample work for you - I mean without getting an exception?

And if yes, what project layout (Layout components, super classes, 
etc.) do you use that gives the exception you mention? Where does the 
stacktrace exactly come from?


Michael


Norman Franke schrieb:

I didn't when I ran the demo. Maybe one needs a layout component?

Norman Franke
Answering Service for Directors, Inc.
www.myasd.com



On Aug 12, 2009, at 4:07 AM, Michael Gerzabek wrote:


Why do I not get the exception?

I'm testing with tapestry-spring-security-sample application at [1].

Michael

[1] http://www.localhost.nu/svn/public/tapestry-spring-security-sample

Norman Franke schrieb:

On Aug 11, 2009, at 5:20 PM, Robin Helgelin wrote:

On Tue, Aug 11, 2009 at 17:46, Norman Franke 
wrote:

The JavaDoc on org.apache.tapestry5.service.Request states that
"getSession(false)" should return NULL if the session is 
invalidated. This

is not happening, it returns the invalidated session.

I think this is because tapestry-spring-security is using the
HttpServletRequest and thus the HttpSession instead of the 
Tapestry Sesssion
in LogoutServiceImpl. Invalidating the HttpSession does NOT 
invalidate the
Tapestry session causing all sorts of issues. If I invalidate 
the Tapestry

session first, then call logoutService.logout() it seems to work.

Can this be fixed in tapestry-spring-service?


Sure, if we can work out the proper way to solve this. If I 
understand

you, the logoutService invalidates the HttpSession, which makes
Tapestry session throw an exception?

Currently the LogoutService logs out the following two cases:
 public static void contributeLogoutService(
 final OrderedConfiguration cfg,
 @InjectService("RememberMeLogoutHandler")
 final LogoutHandler rememberMeLogoutHandler) {
 cfg.add("securityContextLogoutHandler",
 new SecurityContextLogoutHandler());
 cfg.add("rememberMeLogoutHandler", rememberMeLogoutHandler);
 }

My guess is that one probably should add a tapestry logout handler,
which should invalidate the tapestry session?, but I'm not sure
whether this should be default or up to the user. But if the
LogoutService is unusable without the tapestry logout handler I 
guess

it's of use be default :)

--
 regards,
 Robin



I think it should be the default, since one is using it with 
Tapestry, after all, and invalidating the HttpSession really does 
confuse Tapestry, making logoutService rather useless.


Norman Franke
Answering Service for Directors, Inc.
www.myasd.com





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







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







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



Re: tapestry-spring-security-2.1.0 logout issue

2009-08-12 Thread Michael Gerzabek

So. What does this mean?

Did the sample work for you - I mean without getting an exception?

And if yes, what project layout (Layout components, super classes, etc.) 
do you use that gives the exception you mention? Where does the 
stacktrace exactly come from?


Michael


Norman Franke schrieb:

I didn't when I ran the demo. Maybe one needs a layout component?

Norman Franke
Answering Service for Directors, Inc.
www.myasd.com



On Aug 12, 2009, at 4:07 AM, Michael Gerzabek wrote:


Why do I not get the exception?

I'm testing with tapestry-spring-security-sample application at [1].

Michael

[1] http://www.localhost.nu/svn/public/tapestry-spring-security-sample

Norman Franke schrieb:

On Aug 11, 2009, at 5:20 PM, Robin Helgelin wrote:


On Tue, Aug 11, 2009 at 17:46, Norman Franke wrote:

The JavaDoc on org.apache.tapestry5.service.Request states that
"getSession(false)" should return NULL if the session is 
invalidated. This

is not happening, it returns the invalidated session.

I think this is because tapestry-spring-security is using the
HttpServletRequest and thus the HttpSession instead of the 
Tapestry Sesssion
in LogoutServiceImpl. Invalidating the HttpSession does NOT 
invalidate the
Tapestry session causing all sorts of issues. If I invalidate the 
Tapestry

session first, then call logoutService.logout() it seems to work.

Can this be fixed in tapestry-spring-service?


Sure, if we can work out the proper way to solve this. If I understand
you, the logoutService invalidates the HttpSession, which makes
Tapestry session throw an exception?

Currently the LogoutService logs out the following two cases:
  public static void contributeLogoutService(
  final OrderedConfiguration cfg,
  @InjectService("RememberMeLogoutHandler")
  final LogoutHandler rememberMeLogoutHandler) {
  cfg.add("securityContextLogoutHandler",
  new SecurityContextLogoutHandler());
  cfg.add("rememberMeLogoutHandler", rememberMeLogoutHandler);
  }

My guess is that one probably should add a tapestry logout handler,
which should invalidate the tapestry session?, but I'm not sure
whether this should be default or up to the user. But if the
LogoutService is unusable without the tapestry logout handler I guess
it's of use be default :)

--
  regards,
  Robin



I think it should be the default, since one is using it with 
Tapestry, after all, and invalidating the HttpSession really does 
confuse Tapestry, making logoutService rather useless.


Norman Franke
Answering Service for Directors, Inc.
www.myasd.com





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







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



Re: tapestry-spring-security-2.1.0 logout issue

2009-08-12 Thread Michael Gerzabek

Why do I not get the exception?

I'm testing with tapestry-spring-security-sample application at [1].

Michael

[1] http://www.localhost.nu/svn/public/tapestry-spring-security-sample

Norman Franke schrieb:

On Aug 11, 2009, at 5:20 PM, Robin Helgelin wrote:


On Tue, Aug 11, 2009 at 17:46, Norman Franke wrote:

The JavaDoc on org.apache.tapestry5.service.Request states that
"getSession(false)" should return NULL if the session is 
invalidated. This

is not happening, it returns the invalidated session.

I think this is because tapestry-spring-security is using the
HttpServletRequest and thus the HttpSession instead of the Tapestry 
Sesssion
in LogoutServiceImpl. Invalidating the HttpSession does NOT 
invalidate the
Tapestry session causing all sorts of issues. If I invalidate the 
Tapestry

session first, then call logoutService.logout() it seems to work.

Can this be fixed in tapestry-spring-service?


Sure, if we can work out the proper way to solve this. If I understand
you, the logoutService invalidates the HttpSession, which makes
Tapestry session throw an exception?

Currently the LogoutService logs out the following two cases:
   public static void contributeLogoutService(
   final OrderedConfiguration cfg,
   @InjectService("RememberMeLogoutHandler")
   final LogoutHandler rememberMeLogoutHandler) {
   cfg.add("securityContextLogoutHandler",
   new SecurityContextLogoutHandler());
   cfg.add("rememberMeLogoutHandler", rememberMeLogoutHandler);
   }

My guess is that one probably should add a tapestry logout handler,
which should invalidate the tapestry session?, but I'm not sure
whether this should be default or up to the user. But if the
LogoutService is unusable without the tapestry logout handler I guess
it's of use be default :)

--
   regards,
   Robin



I think it should be the default, since one is using it with Tapestry, 
after all, and invalidating the HttpSession really does confuse 
Tapestry, making logoutService rather useless.


Norman Franke
Answering Service for Directors, Inc.
www.myasd.com





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



Re: @Secured annotation handling

2009-07-23 Thread Michael Gerzabek
Don't get the point here. You secured a page? And if you want to access 
it, you get the AccessDeniedEx? This seems to be a valid case. The


[WARN] intercept.AbstractSecurityInterceptor Could not validate
configuration attributes as the ObjectDefinitionSource did not return a
ConfigAttributeDefinition collection

is a warning. It doesn't prevent TSS from functioning properly. Please 
follow the advice from the link you included with your previous mail. 
Many people got TSS working from that description


or

post your page class and your Module class so that we can see what 
happens here.


/M

Eldred Mullany schrieb:

Has anyone got come code snippets for me on integrating T5.1.0.5 and
Spring-Tapestry 2.1.0

Thanks

-Original Message-
From: Eldred Mullany 
Sent: Wednesday, July 22, 2009 1:55 PM

To: 'Tapestry users'
Subject: @Secured annotation handling 


Hi All

I am spinning my head here trying to get Spring-Tapestry-security:2.1.0
to work with Tapestry 5.1.0.5 . I have done the upgrade to 2.1.0 and
when place my @secured annotation on the top of my class name is throws
an access denied exception: 


Following that intercept.AbstractSecurityInterceptor could not validate
configuration attributes as the ObjectDefinitionSource did not return a
ConfigAttributeDefinition collection. 

Where am I supposed to configure configuration attributes if any? 


>From what I have read on
http://www.localhost.nu/java/tapestry-spring-security/conf.html. 


Is there referring to the Contributions to the
FilterSecurityInterceptor. 



Thanking you in advance 


Eldred

  



Here is my output screen:  



[WARN] intercept.AbstractSecurityInterceptor Could not validate
configuration attributes as the ObjectDefinitionSource did not return a
ConfigAttributeDefinition collection
[ERROR] billpmts.Bills Render queue error in
BeginRender[billpmts/Bills]: Access is denied
org.apache.tapestry5.ioc.internal.util.TapestryException: Access is
denied
at
org.apache.tapestry5.internal.structure.ComponentPageElementImpl.invoke(
ComponentPageElementImpl.java:948)
at
org.apache.tapestry5.internal.structure.ComponentPageElementImpl.access$
400(ComponentPageElementImpl.java:49)
at
org.apache.tapestry5.internal.structure.ComponentPageElementImpl$Abstrac
tPhase.callback(ComponentPageElementImpl.java:159)
at
org.apache.tapestry5.internal.structure.ComponentPageElementImpl$BeginRe
nderPhase.render(ComponentPageElementImpl.java:211)
at
org.apache.tapestry5.internal.services.RenderQueueImpl.run(RenderQueueIm
pl.java:74)
at
org.apache.tapestry5.internal.services.PageRenderQueueImpl.render(PageRe
nderQueueImpl.java:121)
at
$PageRenderQueue_122a244d649.render($PageRenderQueue_122a244d649.java)
at
$PageRenderQueue_122a244d62b.render($PageRenderQueue_122a244d62b.java)
at
org.apache.tapestry5.internal.services.MarkupRendererTerminator.renderMa
rkup(MarkupRendererTerminator.java:37)
at
org.apache.tapestry5.services.TapestryModule$27.renderMarkup(TapestryMod
ule.java:1748)
at
$MarkupRenderer_122a244d64b.renderMarkup($MarkupRenderer_122a244d64b.jav
a)
at
org.apache.tapestry5.services.TapestryModule$26.renderMarkup(TapestryMod
ule.java:1732)
at
$MarkupRenderer_122a244d64b.renderMarkup($MarkupRenderer_122a244d64b.jav
a)
at
org.apache.tapestry5.services.TapestryModule$25.renderMarkup(TapestryMod
ule.java:1714)
at
$MarkupRenderer_122a244d64b.renderMarkup($MarkupRenderer_122a244d64b.jav
a)
at
org.apache.tapestry5.services.TapestryModule$24.renderMarkup(TapestryMod
ule.java:1700)
at
$MarkupRenderer_122a244d64b.renderMarkup($MarkupRenderer_122a244d64b.jav
a)
at
org.apache.tapestry5.services.TapestryModule$23.renderMarkup(TapestryMod
ule.java:1681)
at
$MarkupRenderer_122a244d64b.renderMarkup($MarkupRenderer_122a244d64b.jav
a)
at
org.apache.tapestry5.services.TapestryModule$22.renderMarkup(TapestryMod
ule.java:1662)
at
$MarkupRenderer_122a244d64b.renderMarkup($MarkupRenderer_122a244d64b.jav
a)
at
$MarkupRenderer_122a244d648.renderMarkup($MarkupRenderer_122a244d648.jav
a)
at
org.apache.tapestry5.internal.services.PageMarkupRendererImpl.renderPage
Markup(PageMarkupRendererImpl.java:64)
at
$PageMarkupRenderer_122a244d645.renderPageMarkup($PageMarkupRenderer_122
a244d645.java)
at
org.apache.tapestry5.internal.services.PageResponseRendererImpl.renderPa
geResponse(PageResponseRendererImpl.java:61)
at
$PageResponseRenderer_122a244d641.renderPageResponse($PageResponseRender
er_122a244d641.java)
at
org.apache.tapestry5.internal.services.PageRenderRequestHandlerImpl.hand
le(PageRenderRequestHandlerImpl.java:63)
at
org.apache.tapestry5.services.TapestryModule$33.handle(TapestryModule.ja
va:1943)
at
$PageRenderRequestHandler_122a244d642.handle($PageRenderRequestHandler_1
22a244d642.java)
at
$PageRenderRequestHandler_122a244d634.ha

Re: t5: protecting data from public access

2009-06-10 Thread Michael Gerzabek

Hi Angelo,

you might investigate tapestry-spring-security [1]. It has everything 
you need and there is a snapshot [2] that works with T5.1.


You can secure resources and if someone requests a secured resource 
authentication is required from the framework. So, no hacking possible.


Michael

[1] http://www.localhost.nu/java/tapestry-spring-security/index.html
[2]


 nu.localhost.tapestry
 tapestry-spring-security
 2.1.0-SNAPSHOT



Chen schrieb:

Hi,

In a app that I'm going to develop, it requires users to log in before they
can browse job related info, quite a number of those are pictures,  those
photos now are stored in folders of the server, the easiest way is, link
that folder to tomcat's context, and program can refer to a particular photo
with < img> tag, problem is, once the link is obtained, user can refer to
that photo even without log in, any idea how to meet this requirement? One
way I can think of is, program will copy the photo on demand to a temp
folder, but it will slow down the rendering, any idea how to meet this
requirement with tapestry 5?

Thanks,
  



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



Re: T5.1 Question regarding BeanModel and BeanModelSource

2009-06-09 Thread Michael Gerzabek

Ok, thank you Robert!

Let me rephrase/ summarize that using the @DisplayForEdit approach you 
kindly offered.


Step 1: Create a custom annotation @DisplayForEdit for properties 
without setter that should be displayed when editing is used in 
BeanEdit/Form.


Step 2: Then a decorator would implement the logic for detecting this 
annotation and adding the corresponding property to the BeanModel.

This would be done with something like

 model.add( "display" );

in my former example. The decorator would be configured like explained 
in the ioc cookbook [1].


Now my call to modelSource.createEditModel(..) includes all read-only 
properties annotated with DisplayForEdit, as well as the editable 
properties.


"But you'd have to be careful with an approach like that because unless 
you define a custom block for displaying the property, tapestry will, by 
default, try to create an editor for the property (if you're using 
BeanEditor or BeanEditForm), and it'll complain that there's no setter 
for your property."


Ok. I use BeanEditor/Form, so this is something I've to get clear about. 
I found that the @DataType annotation makes it explicit what property 
editor to use for a specific property. So when I enhance the 
@DisplayForEdit annotation to further act like the @DataType annotation 
I could contribute a new property editor like pointed out in the 
BeanEditFormGuide [2].


So let's continue with Step 3:

I would

public static void contributeDefaultDataTypeAnalyzer(MappedConfiguration configuration) {

 configuration.add( Object.class, "display" );
}

add a property block to my AppPropertyEditBlocks and contribute this to 
the BeanBlockSource.


The PropertyEditBlocks would simply return a NOPValidator and a 
NOPTranslator. My block would look like



 
 ${display}


where I've something like @Component(..) private Object display; in my 
PropertyEditBlocks.


Is this what you suggested - what would work?

Thanks,
Michael

[1] 
http://tapestry.apache.org/tapestry5.1/tapestry-ioc/cookbook/override.html

[2] http://tapestry.apache.org/tapestry5.1/guide/beaneditform.html

Robert Zeigler schrieb:

Hm, I'm not sure I fully understand your use-case.
For instance, in the example you provide, using createDisplayModel 
would already pick up the read-only "description" property.


In any event, there are lots of ways you could go imagine handling this.
For example, you could write a custom annotation:
@DisplayForEdit

And then you could provide a service override (or a service decorator) 
of BeanModelSource that checks for properties with DisplayForEdit and 
adds them to the model. Then your call to:
modelSource.createEditModel would include all read-only properties 
annotated with DisplayForEdit, as well as the editable properties.
But you'd have to be careful with an approach like that because unless 
you define a custom block for displaying the property, tapestry will, 
by default, try to create an editor for the property (if you're using 
BeanEditor or BeanEditForm), and it'll complain that there's no setter 
for your property.


Additionally, the BeanDisplay, BeanEditor, BeanEditForm, and Grid 
components all accept "include", "exclude", "add", and "reorder" 
parameters, so you can decide what belongs in your model in a 
declarative fashion:





Robert

On Jun 8, 2009, at 6/811:39 PM , Michael Gerzabek wrote:


Thank you Robert!

To give you a way of looking at my problem.

Bean Customizing has some usual properties that are read only, like 
symbol, isDeclared, etc. but only one property that is writeable, the 
value. The read only properties provide meaning to the person 
fostering the Customizing instance.


Now there is the usual approach that I prepare a distinct page (which 
in fact I did) to collect the value for the Customizing instance. 
This page displays the rest of the bean in a verbose mode to the 
user. Straight forward, no problem.


Anyway, I'm just curious: Since I can imagine many occasions where a 
bean not only would hold data but also some semantics on the data 
that would be useful to be displayed to a person editing this bean. 
Is there a standard way to get this job done by BeanEditor/ BeanModel?


To pick up your snippet: On my concrete BeanModel for bean 
Customizing I would need something like


BeanModel getModel() {

BeanModel model = beanModelSource.createDisplayModel( 
Customizing.class, messages );

// property description is read only but contains information on how the
// fostering of this Customizing instance will influence the 
behaviour of

// the application
model.display( "description" );
return model;
}

Is there a way to get this done? Would be nice somehow.

Michael


Zeigler schrieb:

So:
 1) createDisplayModel() acts the same as 
createModel(...,false,...); and createEditModel is like 
createModel(...,true,..

Re: T5.1 Question regarding BeanModel and BeanModelSource

2009-06-08 Thread Michael Gerzabek

Thank you Robert!

To give you a way of looking at my problem.

Bean Customizing has some usual properties that are read only, like 
symbol, isDeclared, etc. but only one property that is writeable, the 
value. The read only properties provide meaning to the person fostering 
the Customizing instance.


Now there is the usual approach that I prepare a distinct page (which in 
fact I did) to collect the value for the Customizing instance. This page 
displays the rest of the bean in a verbose mode to the user. Straight 
forward, no problem.


Anyway, I'm just curious: Since I can imagine many occasions where a 
bean not only would hold data but also some semantics on the data that 
would be useful to be displayed to a person editing this bean. Is there 
a standard way to get this job done by BeanEditor/ BeanModel?


To pick up your snippet: On my concrete BeanModel for bean Customizing I 
would need something like


BeanModel getModel() {

 BeanModel model = beanModelSource.createDisplayModel( 
Customizing.class, messages );

 // property description is read only but contains information on how the
 // fostering of this Customizing instance will influence the behaviour of
 // the application
 model.display( "description" );
 return model;
}

Is there a way to get this done? Would be nice somehow.

Michael


Zeigler schrieb:

So:
  1) createDisplayModel() acts the same as createModel(...,false,...); 
and createEditModel is like createModel(...,true,...)
 So if you have your bean, the @NonVisual properties won't show up 
for editing or display.  Using createDisplayModel will add all 
properties with a getter that aren't otherwise marked as @NonVisual, 
and using createEditModel will only add the properties will getters 
and setters.  But once you have the model, you can manipulate it 
anyway you want. For example:


  BeanModel getModel() {
  BeanModel model = 
beanModelSource.createDisplayModel(MyBean.class,messages);

  model.exclude("someProp");
  return model;
  }

Robert

On Jun 8, 2009, at 6/810:38 AM , Michael Gerzabek wrote:


Hi,

BeanModelSource now has deprecated create(..) in favor of 
createDisplayModel(..) and createEditModel(..). This is a nice 
feature leaving me with one question:


I want to edit a bean that has some properties that should not be 
displayed at all (@NonVisual), some properties that should be 
displayed but not enabled for editing. Those properties can have 
setters but some also don't have setters at all. And then there are 
some properties that should be editable. How would I achive this?


Thanks for your help,
Michael


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



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




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



T5.1 Question regarding BeanModel and BeanModelSource

2009-06-08 Thread Michael Gerzabek

Hi,

BeanModelSource now has deprecated create(..) in favor of 
createDisplayModel(..) and createEditModel(..). This is a nice feature 
leaving me with one question:


I want to edit a bean that has some properties that should not be 
displayed at all (@NonVisual), some properties that should be displayed 
but not enabled for editing. Those properties can have setters but some 
also don't have setters at all. And then there are some properties that 
should be editable. How would I achive this?


Thanks for your help,
Michael


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



T5.1 Component X does not contain an embedded component with id Y

2009-06-02 Thread Michael Gerzabek

Hi,

I've created a template component that is able to load a .tml file from 
outside the context. Had to slightly change the ComponentTemplateSource 
to get this working. I know, I'm breaking with the Tapestry philosophy 
of 1 Class = 1 Template. So if this is a no! never! road, just tell me.


Now when I apply other components in these templates I get the following 
error message:


Component Buch:template does not contain an embedded component with id 
'addtocart'. Available components: (none). This only happens when a 
client side event (add to cart button) is triggered. Rendering is fine.


   * 
org.apache.tapestry5.internal.structure.ComponentPageElementImpl.getEmbeddedElement(ComponentPageElementImpl.java:841)

   * 
org.apache.tapestry5.internal.structure.PageImpl.getComponentElementByNestedId(PageImpl.java:78)

   * 
org.apache.tapestry5.internal.services.ComponentEventRequestHandlerImpl.handle(ComponentEventRequestHandlerImpl.java:71)

   * 
org.apache.tapestry5.internal.services.ImmediateActionRenderResponseFilter.handle(ImmediateActionRenderResponseFilter.java:42)

   * 
$ComponentEventRequestHandler_121a0891c50.handle($ComponentEventRequestHandler_121a0891c50.java)

   * 
org.apache.tapestry5.internal.services.AjaxFilter.handle(AjaxFilter.java:42)

   * 
$ComponentEventRequestHandler_121a0891c50.handle($ComponentEventRequestHandler_121a0891c50.java)

   * 
org.apache.tapestry5.upload.internal.services.UploadExceptionFilter.handle(UploadExceptionFilter.java:75)

   * 
$ComponentEventRequestHandler_121a0891c50.handle($ComponentEventRequestHandler_121a0891c50.java)

   * 
org.apache.tapestry5.services.TapestryModule$36.handle(TapestryModule.java:2164)

   * 
$ComponentEventRequestHandler_121a0891c50.handle($ComponentEventRequestHandler_121a0891c50.java)

   * 
$ComponentEventRequestHandler_121a0891c4d.handle($ComponentEventRequestHandler_121a0891c4d.java)

   * 
org.apache.tapestry5.internal.services.ComponentRequestHandlerTerminator.handleComponentEvent(ComponentRequestHandlerTerminator.java:43)

   * 
$ComponentRequestHandler_121a0891b80.handleComponentEvent($ComponentRequestHandler_121a0891b80.java)

   * 
org.apache.tapestry5.internal.services.ComponentEventDispatcher.dispatch(ComponentEventDispatcher.java:46)

   * $Dispatcher_121a0891b85.dispatch($Dispatcher_121a0891b85.java)
   * $Dispatcher_121a0891b79.dispatch($Dispatcher_121a0891b79.java)
   * 
org.apache.tapestry5.services.TapestryModule$RequestHandlerTerminator.service(TapestryModule.java:245)

   * 
com.flexibelinstitut.tapestry5.security.services.internal.RequestFilterWrapper$1.doFilter(RequestFilterWrapper.java:60)

My question is: Is it possible to tell the template component about 
embedded components? And how is this done?


Regards,
Michael


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



Re: tapestry-spring-security update

2009-05-30 Thread Michael Gerzabek

Hi Thiago,

yes it should. Anyway more feedback is wanted.

Thiago H. de Paula Figueiredo schrieb:

On Fri, May 29, 2009 at 3:34 PM, Robin Helgelin  wrote:

  

Hi,



Hi!

  

I've just uploaded a 2.1.0-SNAPSHOT release of
tapestry-spring-security with support for Tapestry 5.1.
We're releasing this as a SNAPSHOT so that we can see that it actually
works for everybody before we make the final release.



Thank you! Does it solve the @Secured annotation handling? It is
broken in 2.0 when used with T5.1.

--
Thiago

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

  



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



Re: tapestry-spring-security dynamic failure url

2009-05-27 Thread Michael Gerzabek

Borut Bolčina schrieb:

The solution is a three-liner:

@Inject
private AuthenticationProcessingFilter apf;

and
apf.setAuthenticationFailureUrl("acme/login/failed");

in method
void onActivate(EventContext eventContext)

Should have tried that before asking :-|

Thanks,
Borut

  
Not sure if you're done with that: What if user A requests your login 
page and user B ~at the same time~ the acme/login page? This would be a 
test case you have to double check.


Cheers,
Michael

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



Re: tapestry-spring-security dynamic failure url

2009-05-26 Thread Michael Gerzabek

Hi Borut,

Sorry, didn't have such an issue. Maybe you want browse the SS-Forum. 
There are some threads about this issue [1]. In case the searchid gets 
lost use [2] and be aware there are other threads either.


Cheers,
Michael

[1] http://forum.springsource.org/search.php?searchid=5332409
[2] 
http://forum.springsource.org/showthread.php?t=59581&highlight=dynamic+failure


Bolčina schrieb:

Hi Michael,


2009/5/26 Michael Gerzabek 

  

Borut Bolčina schrieb:



I need to configure AuthenticationProcessingFilter "on the fly".

  

Are you sure? Or do you just want different failureURLs?




I just want a different failureURL.


  

 Can I


inject the filter and call the setAuthenticationFailureUrl(failureUrl) in
my
page class? I want to have different failureUrl based on some condition.


  

Aha. Mhm. I think the easiest would be to inject the
AuthenticationProcessingFilter into your service or whereever you decide
which failureURL to serve and call setAuthenticationFailureUrl() with the
correct URL. Don't know where in the request chain you might do this though.




I have two login pages (src/main/java/com/foo/bar/Login and
src/main/java/com/foo/bar/acme/Login which extends the first one). The only
difference is a different layout component (for now), so in other words - it
looks quite different.

What I intended to do was to setAuthenticationFailureUrl(acme/login) in the
acme/Login class so if the user fails to present the correct username and
password, he/she won't be presented the wrong Login page (which is failure
url set in the contributeApplicationDefaults method). So if user fails to
login in the first Login page, he/she is presented with Login/failed and if
he/she fails on the acme/Login page he/she is presented with
acme/Login/failed failureUrl.

Cheers,
Borut


  

BUT: I cannot imagine a case where your software would act like that. Since
when authentication fails you probably might inform your user why this
happens. So a discrete page with the logic to display the results of your
role voters or similar security aspects may seem old fashioned but did the
job for me in the past.

Third possibility might be to write your own
AuthenticationProcessingFilter, you could extend it, prepare it with your
logic and ...



Cheers,
Borut

P.S. How far is tapestry-spring-security from being T5.1 compatible?



  

This is finally in the pipeline now.

Cheers,
Michael

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





  



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



Re: tapestry-spring-security dynamic failure url

2009-05-26 Thread Michael Gerzabek

Borut Bolčina schrieb:
I need to configure AuthenticationProcessingFilter "on the fly". 

Are you sure? Or do you just want different failureURLs?

Can I
inject the filter and call the setAuthenticationFailureUrl(failureUrl) in my
page class? I want to have different failureUrl based on some condition.
  
Aha. Mhm. I think the easiest would be to inject the 
AuthenticationProcessingFilter into your service or whereever you decide 
which failureURL to serve and call setAuthenticationFailureUrl() with 
the correct URL. Don't know where in the request chain you might do this 
though.


BUT: I cannot imagine a case where your software would act like that. 
Since when authentication fails you probably might inform your user why 
this happens. So a discrete page with the logic to display the results 
of your role voters or similar security aspects may seem old fashioned 
but did the job for me in the past.


Third possibility might be to write your own 
AuthenticationProcessingFilter, you could extend it, prepare it with 
your logic and ...

Cheers,
Borut

P.S. How far is tapestry-spring-security from being T5.1 compatible?

  

This is finally in the pipeline now.

Cheers,
Michael

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



Re: tapestry-spring-security logout

2009-04-10 Thread Michael Gerzabek

Hi Borut,

sounds good. On my tasklist is upgrading to newest T5.1. Don't know when 
I've the time to. This will presumably be at the end of next week.


To achieve the logoutService.logout( myURL) I'll have to take a look at 
the interface. Not sure if this signature originates in SS or in TSS. 
But there should be a way to enhance the interface anyways.


Cheers,
Michael


Bolčina schrieb:

Hi,

wouldn't it be nice if one could redirect a user after hitting the logout
link to different urls based on some condition, like:

logoutService.logout(myUrl)

instead of just

logoutService.logout()

What do you think?

Cheers,
Borut

  



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



Re: problem tapestry-spring-security plugin: UserDetailsService implementation not found

2009-03-09 Thread Michael Gerzabek
As the name says, the sample application does declare the 
UserDetailsService. Look at 
nu.localhost.tapestry5.springsecuritytest.services.TestsecurityModule 
there you'll find the build method


public static UserDetailsService buildUserDetailsService( @Inject
   PasswordEncoder encoder, @Inject
   SaltSource salt ) {

   return new MyUserDetailsService( encoder, salt );
   }

This module is in fact using the SpringSecurityModule like you'll 
probably do.


manuel aldana schrieb:

Thiago H. de Paula Figueiredo schrieb:
Em Sun, 08 Mar 2009 18:09:29 -0300, manuel aldana  
escreveu:


Exception constructing service 'RememberMeServices': Error invoking 
service builder method 
nu.localhost.tapestry5.springsecurity.services.SecurityModule.build(UserDetailsService, 
String) (at SecurityModule.java:303) (for service 
'RememberMeServices'): No service implements the interface 
org.springframework.security.userdetails.UserDetailsService.
It does not find the UserDetailsService implementation though I 
placed one inside .services.internal. Does somebody 
know how tapestry spring-security plugin looks for the implementation?


It looks it up via Tapestry-IoC. Actually, this error messages is 
given by T-IoC, not Tapestry-Spring Security yourself. Just make sure 
you declare your UserDetailsService implementation as a service in 
your AppModule class (or any other Tapestry-IoC module).
Yes, you're right adding this interface->implementation mapping to 
AppModule made it work.


But I wonder why it works in the sample application from the 
tapestry-spring-security module, which has no AppModule defined. I 
guess then some tapestry magic comes in place (maybe scanning for 
implementors of interfaces...).





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



Re: DZone's 40th Refcardz, Apache Tapestry 5.0

2009-02-05 Thread Michael Gerzabek

Awesome! Thank you Howard!


Lewis Ship schrieb:


DZone Refcardz  are a series of free cheat 
sheets for developers, written by book authors and industry experts on 
a wide range of technical topics including: Spring, Windows 
PowerShell, EJB 3, Ajax, Design Patterns, Silverlight 2 and many more. 
With new releases weekly, check them out today and download them all! 

If you think this is useful, we would be honored if you could post a 
mention about this great resource to share with your peers (feel free 
to use images in this email or from our website).


Subscribe Today! See why Refcardz have been downloaded over a quarter 
of a million times!  

--
Howard Lewis Ship
Creator: Apache Tapestry and Apache HiveMind




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



Re: Tapestry 5.0 Final Release - 5.0.18

2008-12-15 Thread Michael Gerzabek

Thank you Howard and Team!

This is really a great piece of software. In my humble opinion it's the 
best web application framework available. Development is straight 
forward, though you have to learn the Tapestry way of doing things. But 
that's also true for any other framework out in space.


Special thanks also to the list for coaching people on the usage of T5. 
This is a big help in acquiring the knowledge to use T5 effectively.


Michael

Howard Lewis Ship schrieb:

Apache Tapestry 5.0 final release (5.0.18)

After nearly three years of development, the final release of Apache
Tapestry 5.0 is now available for download.

Apache Tapestry 5 is a total rewrite of the Tapestry web application
framework, bringing forward Tapestry's core concepts: reusable
components, true encapsulation, readable templates, well thought-out
localization/internationalization, and easy management of server-side
state.

Tapestry 5 builds on top of this with a host of new features:

* True POJO component classes: no base classes to extend, no
  interfaces to implement.

* Live class reloading: no need to redeploy to see code changes.

* XML templates with namespaces.

* Minimal configuration via naming conventions and annotations.

* Integrated Ajax support, built on top of Prototype and
  Scriptaculous.

* Automatic client-side form input validation.

* High performance via pooled objects (and by avoiding the use of
  reflection).

* Automatic REST-style URLs.

* Built-in integration with Hibernate and Spring.

* Best-of-breed exception reporting.

* Built-in extensible mega-components: BeanEditForm, BeanDisplay and
  Grid (to edit and display any JavaBean or collection of JavaBeans).

Tapestry organizes your application into pages, and components within
pages; pages and components are ordinary POJOs: not singletons (like
servlets). Tapestry combines pages, page templates, components,
component templates, and other resources together for you, managing
server-side state, the creation of URLs and the dispatch of incoming
requests. You build your application in terms of the methods and
properties of your objects, not in terms of URLs or the Servlet API.

Tapestry features great exception reporting to keep you on track, and
live class reloading to keep you agile.  Tapestry templates are XML
documents, using a namespace for Tapestry-specific elements. Tapestry
is designed to be easy to develop, using any standard IDE with an XML
editor.

Tapestry is simple, sensible and fun. It keeps you productive by
freeing you from the boring, mechanical aspects of web application
development. You can stay focused on what makes your application
interesting and unique, and let Tapestry handle all the ugly plumbing.

Tapestry is made available under the Apache Software License 2.0.
Tapestry is free to download, free to use, free to redistribute and
free to modify.

Tapestry 5.0.18

* Project page: http://tapestry.apache.org/tapestry5/

* Download: http://tapestry.apache.org/download.html

* Release Notes:
  http://tapestry.apache.org/tapestry5/release-notes.html

* Upgrade Notes: http://tapestry.apache.org/tapestry5/upgrade.html

* Via Maven:


org.apache.tapestry
tapestry-core
5.0.18




  



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



Re: integrating T5 a login form with Spring Security?

2008-12-15 Thread Michael Gerzabek
You have to provide the login-processing-url to your template file. Look 
into nu.localhost.tapestry5.springsecuritytest.pages.LoginPage and the 
respective LoginPage.tml in the webapp of the sample. It's artefact is



 nu.localhost.tapestry5.springsecurity
 tapestry-spring-security-sample
 1.0.0-SNAPSHOT


There will be a final 1.0.0 later this day since Howard announced the 
final 5.0 for T5.


Further you could also use Tapestry Spring Security and exclude the 
dependency for Spring 2.0 in your pom and include your 2.5 Spring 
dependencies instead. Visit [1] for an idea about it or read the 
excellent free book "Better builds with Maven" [2].


Michael

[1] http://maven.apache.org/pom.html#Exclusions
[2] http://www.exist.com/better-build-maven

Jean Luc schrieb:

Hello,

I've been trying to integrate T5 and Spring Security (2.0.4, not the older
Acegi) but haven't succeeded in making the two work together.

The standard way to specify a form login with Spring 2.5 is like below. See
the  element which specified the login page (Login) and what URL
Spring will intercept (the standard j_security_check).

http://www.springframework.org/schema/security";




I have a typical Login.tml (labels and cosmetic stuff removed for brevity)




 



What happens is that the POST that occurs when submitting the form goes to
the Login.onSubmit() instead of j_security_check. While it is possible to
add code there to call Spring's AuthenticationManager, I would end up
duplicating what Spring Security does (the logic to redirect to different
pages if the login succeeded or not and so on). I'd like to use Spring since
it already implements this.

Is it possible to submit the login info to j_security_check instead? Or to
forward the request from within Login.onSubmit() to /j_security_check?

I went through the "Tapestry 5" book by Alexander Kolesnikov, but didn't
find this info. Also, I am aware of the tapestry5-acegi extension (
http://www.localhost.nu/java/tapestry5-acegi/) but this one seems under
development and for such a simple thing I didn't want to add a dependency on
another jar.

As you can tell, I'm new to T5. I've had some exposure to T4 and an older
version of Spring (2.0) but there things were quite different, both in
Tapestry itself and in how Acegi is configured  in Spring.

Advice is appreciated,
JL

  



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



Re: [T5] classes and templates don't reload anymore

2008-12-02 Thread Michael Gerzabek
I recently switched to 5.0.17 and everything works fine, reloading of 
pages, templates, components (no mixins yet). I use Eclipse with jetty 
plugin.



Stephane Decleire schrieb:

My app is built against Tap 5.0.17
I've tried using maven command "mvn jetty:run" or on Tomcat using
Netbeans without success.
None of the change i make on my templates or classes fired a reload.
Any idea ?

Stephane

  



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



Re: [T5] Pick up https/http from request

2008-11-26 Thread Michael Gerzabek

straight forward! Thanks for posting your solution.

Inge Solvoll schrieb:

Excellent! Thanks for thep help, everyone!! This has made my life so much
easier...

Got it working like this:

In my implementation of RequestSecurityManager:

  public boolean checkForInsecureRequest(String pageName) throws IOException
{
return false;
  }

  public String getBaseURL(Page page) {
return baseURLSource.getBaseURL(request.isSecure());
  }


In my Appmodule:

  public static void contributeAlias(Configuration
configuration, @InjectService("Request") Request request,
@InjectService("BaseURLSource") BaseURLSource baseURLSource) {
RequestSecurityManager manager = new MyRequestSecurityManager(request,
baseURLSource);
configuration.add(AliasContribution.create(RequestSecurityManager.class,
manager));
  }


On Wed, Nov 26, 2008 at 12:42 PM, Michael Gerzabek <[EMAIL PROTECTED]
  

wrote:



  

Inge Solvoll schrieb:



Thanks, I'll look into that then.

What I want to do:

1. The user accesses http://myserver.com/mypage. Should get the same
url/protocol in return.
2. The user accesses https://myserver.com/mypage. Should get the same
url/protocol in return.


  

Ok,

so then forget BaseURLSource and implement RequestSecurityManager. The code
could be something like

  public boolean checkForInsecureRequest( String pageName )
  throws IOException {

  ... copy-n-paste from T5 implementation ...
  }

  public String getBaseURL( Page page ) {

  return baseURLSource.getBaseURL( request.isSecure() );
  }

and get Request injected in your constructor.

/Michael

 As of now, the user gets a fixed protocol in return, not the protocol he


requested.



On Wed, Nov 26, 2008 at 12:29 PM, Michael Gerzabek <
[EMAIL PROTECTED]


  

wrote:





  

Inge,

not sure that I undestand fully what you are about. It sounds like you
also
want to implement RequestSecurityManager (

http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/internal/services/package-tree.html
).
This is at least what I did and it works for me.

/Michael

Inge Solvoll schrieb:

 I think I know the reason for the loop...




my getBaseURL method is only called when the requested url has a
different
protocol than specified in MetaDataConstants.SECURE_PAGE. It seems that
when
I try to write a base URL in my custom method that has a different
protocol
than SECURE_PAGE value, they start knocking each other's heades with
redirects.

Right now, it looks like this system works differently than I thought.
Is
it
not possible to override the behaviour of one page or entire application
fixed on a protocol?



On Wed, Nov 26, 2008 at 11:44 AM, Kristian Marinkovic <
[EMAIL PROTECTED]> wrote:





  

try creating the proxy manually... almost worked every time for me

constructor injection will be performed as expected

public static void contributeAlias(
 ObjectLocator locator,
  Configuration configuration ) {

 configuration.add( AliasContribution.create(
BaseURLSource.class,
 locator.proxy(BaseURLSource.class,SomeImplementation.class) );

 }

g,
kris




"Inge Solvoll" <[EMAIL PROTECTED]>
26.11.2008 11:37
Bitte antworten an
"Tapestry users" 


An
"Tapestry users" 
Kopie

Thema
Re: [T5] Pick up https/http from request






Thanks!

But this still gives me the same loop error, because I have to inject
Request (where you inject SiteServices) into the builder method to
access
the secure state of the request:

Caused by: org.apache.tapestry5.ioc.internal.OperationException:
Construction of service 'Alias' has failed due to recursion: the
service
depends on itself in some way. Please check
org.apache.tapestry5.services.TapestryModule.buildAlias(Logger, String,
AliasManager, Collection) (at TapestryModule.java:214) for references
to
another service that is itself dependent on service 'Alias'.

Inge

On Wed, Nov 26, 2008 at 11:28 AM, Michael Gerzabek
<[EMAIL PROTECTED]






wrote:
Inge,

I did it successfully for a similar purpose:

 @SuppressWarnings("unchecked")
 public static void contributeAlias(
@InjectService( "SiteBaseURLSource" )
BaseURLSource baseUrlSource,
Configuration configuration ) {

configuration.add( AliasContribution.create(
BaseURLSource.class,
baseUrlSource ) );

 }

Don't use the binder but create your own build method:

 @Marker( SiteServices.class )
 public static BaseURLSource buildSiteBaseURLSource(
@SiteServices
SiteService site ) {

return new SiteBaseURLSource( site );
 }

You can ommit the Marker annotation.

/Michael

Solvoll schrieb:

 Hi!




  

I'm really struggling here as I think I'm approaching a solution.
What






I'm


  


trying to do is to override/decorate/alias/replace the BaseURLSo

Re: [T5] Pick up https/http from request

2008-11-26 Thread Michael Gerzabek

Inge Solvoll schrieb:

Thanks, I'll look into that then.

What I want to do:

1. The user accesses http://myserver.com/mypage. Should get the same
url/protocol in return.
2. The user accesses https://myserver.com/mypage. Should get the same
url/protocol in return.
  

Ok,

so then forget BaseURLSource and implement RequestSecurityManager. The 
code could be something like


   public boolean checkForInsecureRequest( String pageName )
   throws IOException {

   ... copy-n-paste from T5 implementation ...
   }

   public String getBaseURL( Page page ) {

   return baseURLSource.getBaseURL( request.isSecure() );
   }

and get Request injected in your constructor.

/Michael

As of now, the user gets a fixed protocol in return, not the protocol he
requested.



On Wed, Nov 26, 2008 at 12:29 PM, Michael Gerzabek <[EMAIL PROTECTED]
  

wrote:



  

Inge,

not sure that I undestand fully what you are about. It sounds like you also
want to implement RequestSecurityManager (
http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/internal/services/package-tree.html).
This is at least what I did and it works for me.

/Michael

Inge Solvoll schrieb:

 I think I know the reason for the loop...


my getBaseURL method is only called when the requested url has a different
protocol than specified in MetaDataConstants.SECURE_PAGE. It seems that
when
I try to write a base URL in my custom method that has a different
protocol
than SECURE_PAGE value, they start knocking each other's heades with
redirects.

Right now, it looks like this system works differently than I thought. Is
it
not possible to override the behaviour of one page or entire application
fixed on a protocol?



On Wed, Nov 26, 2008 at 11:44 AM, Kristian Marinkovic <
[EMAIL PROTECTED]> wrote:



  

try creating the proxy manually... almost worked every time for me

constructor injection will be performed as expected

public static void contributeAlias(
  ObjectLocator locator,
   Configuration configuration ) {

  configuration.add( AliasContribution.create(
 BaseURLSource.class,
  locator.proxy(BaseURLSource.class,SomeImplementation.class) );

 }

g,
kris




"Inge Solvoll" <[EMAIL PROTECTED]>
26.11.2008 11:37
Bitte antworten an
"Tapestry users" 


An
"Tapestry users" 
Kopie

Thema
Re: [T5] Pick up https/http from request






Thanks!

But this still gives me the same loop error, because I have to inject
Request (where you inject SiteServices) into the builder method to access
the secure state of the request:

Caused by: org.apache.tapestry5.ioc.internal.OperationException:
Construction of service 'Alias' has failed due to recursion: the service
depends on itself in some way. Please check
org.apache.tapestry5.services.TapestryModule.buildAlias(Logger, String,
AliasManager, Collection) (at TapestryModule.java:214) for references to
another service that is itself dependent on service 'Alias'.

Inge

On Wed, Nov 26, 2008 at 11:28 AM, Michael Gerzabek
<[EMAIL PROTECTED]




wrote:
 Inge,

I did it successfully for a similar purpose:

 @SuppressWarnings("unchecked")
 public static void contributeAlias(
 @InjectService( "SiteBaseURLSource" )
 BaseURLSource baseUrlSource,
 Configuration configuration ) {

 configuration.add( AliasContribution.create(
 BaseURLSource.class,
 baseUrlSource ) );

 }

Don't use the binder but create your own build method:

 @Marker( SiteServices.class )
 public static BaseURLSource buildSiteBaseURLSource(
 @SiteServices
 SiteService site ) {

 return new SiteBaseURLSource( site );
 }

You can ommit the Marker annotation.

/Michael

Solvoll schrieb:

 Hi!


  

I'm really struggling here as I think I'm approaching a solution. What




I'm
  


trying to do is to override/decorate/alias/replace the BaseURLSource
  


with
  


my
  

own implementation, like this:

public class MyBaseURLSource implements BaseURLSource {

 private final Request request;

 public MyBaseURLSource(Request request) {
  this.request = request;
 }

 public String getBaseURL(boolean secure) {
  boolean secureRequest = request.isSecure();
  String baseURL = String.format("%s://%s", secureRequest ? "https" :
"http", request.getServerName());
  return baseURL;
 }

}


Essentially, I've copied the default implementation and replaced the




usage
  


of the secure parameter with the secure value of the request. My
  


problem
  


is
  

that I'm not capable of putting this code to actual work in the




framework.
  


I've tried:
  

- aliasing, but that didn't work because of circular dependency (

Re: [T5] Pick up https/http from request

2008-11-26 Thread Michael Gerzabek

Inge,

not sure that I undestand fully what you are about. It sounds like you 
also want to implement RequestSecurityManager 
(http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/internal/services/package-tree.html). 
This is at least what I did and it works for me.


/Michael

Inge Solvoll schrieb:

I think I know the reason for the loop...

my getBaseURL method is only called when the requested url has a different
protocol than specified in MetaDataConstants.SECURE_PAGE. It seems that when
I try to write a base URL in my custom method that has a different protocol
than SECURE_PAGE value, they start knocking each other's heades with
redirects.

Right now, it looks like this system works differently than I thought. Is it
not possible to override the behaviour of one page or entire application
fixed on a protocol?



On Wed, Nov 26, 2008 at 11:44 AM, Kristian Marinkovic <
[EMAIL PROTECTED]> wrote:

  

try creating the proxy manually... almost worked every time for me

constructor injection will be performed as expected

public static void contributeAlias(
   ObjectLocator locator,
Configuration configuration ) {

   configuration.add( AliasContribution.create(
  BaseURLSource.class,
   locator.proxy(BaseURLSource.class,SomeImplementation.class) );

  }

g,
kris




"Inge Solvoll" <[EMAIL PROTECTED]>
26.11.2008 11:37
Bitte antworten an
"Tapestry users" 


An
"Tapestry users" 
Kopie

Thema
Re: [T5] Pick up https/http from request






Thanks!

But this still gives me the same loop error, because I have to inject
Request (where you inject SiteServices) into the builder method to access
the secure state of the request:

Caused by: org.apache.tapestry5.ioc.internal.OperationException:
Construction of service 'Alias' has failed due to recursion: the service
depends on itself in some way. Please check
org.apache.tapestry5.services.TapestryModule.buildAlias(Logger, String,
AliasManager, Collection) (at TapestryModule.java:214) for references to
another service that is itself dependent on service 'Alias'.

Inge

On Wed, Nov 26, 2008 at 11:28 AM, Michael Gerzabek
<[EMAIL PROTECTED]


wrote:
  
Inge,


I did it successfully for a similar purpose:

  @SuppressWarnings("unchecked")
  public static void contributeAlias(
  @InjectService( "SiteBaseURLSource" )
  BaseURLSource baseUrlSource,
  Configuration configuration ) {

  configuration.add( AliasContribution.create(
  BaseURLSource.class,
  baseUrlSource ) );

  }

Don't use the binder but create your own build method:

  @Marker( SiteServices.class )
  public static BaseURLSource buildSiteBaseURLSource(
  @SiteServices
  SiteService site ) {

  return new SiteBaseURLSource( site );
  }

You can ommit the Marker annotation.

/Michael

Solvoll schrieb:

 Hi!
  

I'm really struggling here as I think I'm approaching a solution. What


I'm


trying to do is to override/decorate/alias/replace the BaseURLSource


with


my
own implementation, like this:

public class MyBaseURLSource implements BaseURLSource {

 private final Request request;

 public MyBaseURLSource(Request request) {
   this.request = request;
 }

 public String getBaseURL(boolean secure) {
   boolean secureRequest = request.isSecure();
   String baseURL = String.format("%s://%s", secureRequest ? "https" :
"http", request.getServerName());
   return baseURL;
 }

}


Essentially, I've copied the default implementation and replaced the


usage


of the secure parameter with the secure value of the request. My


problem


is
that I'm not capable of putting this code to actual work in the


framework.


I've tried:
- aliasing, but that didn't work because of circular dependency (I have


to


inject the Request)
- binder.bind(BaseURLSource.class, MyBaseURLSource.class), combinded


with


a
builder for MyBaseURLSource. Causes redirect loop.
- Decorating. Not managed to find out how I do this yet, have tried a


few


things.

I'm guessing this is rather simple, it's just a bit complicated when
you're
not experienced in IoC... Anyone who wants to point me in the right
direction?

Regards
Inge



On Wed, Nov 19, 2008 at 10:22 AM, Inge Solvoll <[EMAIL PROTECTED]


wrote:
  




I voted for this issue now.

https://issues.apache.org/jira/browse/TAP5-167

This is really a big issue for our usage of T5, T5 is now forcing us
  

to


redirect users away from http access, because we no longer can support
both
modes as long as T5 is fixed on either http or https.

Anyone who's got a working version of a BaseURLSource contribution,
  

that


actually can output a URL using the protocol from the initial 

Re: [T5] Pick up https/http from request

2008-11-26 Thread Michael Gerzabek

Inge,

I did it successfully for a similar purpose:

   @SuppressWarnings("unchecked")
   public static void contributeAlias(
   @InjectService( "SiteBaseURLSource" )
   BaseURLSource baseUrlSource,
   Configuration configuration ) {

   configuration.add( AliasContribution.create(
   BaseURLSource.class,
   baseUrlSource ) );

   }

Don't use the binder but create your own build method:

   @Marker( SiteServices.class )
   public static BaseURLSource buildSiteBaseURLSource(
   @SiteServices
   SiteService site ) {

   return new SiteBaseURLSource( site );
   }

You can ommit the Marker annotation.

/Michael

Solvoll schrieb:

Hi!

I'm really struggling here as I think I'm approaching a solution. What I'm
trying to do is to override/decorate/alias/replace the BaseURLSource with my
own implementation, like this:

public class MyBaseURLSource implements BaseURLSource {

  private final Request request;

  public MyBaseURLSource(Request request) {
this.request = request;
  }

  public String getBaseURL(boolean secure) {
boolean secureRequest = request.isSecure();
String baseURL = String.format("%s://%s", secureRequest ? "https" :
"http", request.getServerName());
return baseURL;
  }

}


Essentially, I've copied the default implementation and replaced the usage
of the secure parameter with the secure value of the request. My problem is
that I'm not capable of putting this code to actual work in the framework.

I've tried:
- aliasing, but that didn't work because of circular dependency (I have to
inject the Request)
- binder.bind(BaseURLSource.class, MyBaseURLSource.class), combinded with a
builder for MyBaseURLSource. Causes redirect loop.
- Decorating. Not managed to find out how I do this yet, have tried a few
things.

I'm guessing this is rather simple, it's just a bit complicated when you're
not experienced in IoC... Anyone who wants to point me in the right
direction?

Regards
Inge



On Wed, Nov 19, 2008 at 10:22 AM, Inge Solvoll <[EMAIL PROTECTED]>wrote:

  

I voted for this issue now.

https://issues.apache.org/jira/browse/TAP5-167

This is really a big issue for our usage of T5, T5 is now forcing us to
redirect users away from http access, because we no longer can support both
modes as long as T5 is fixed on either http or https.

Anyone who's got a working version of a BaseURLSource contribution, that
actually can output a URL using the protocol from the initial request?

Regards
Inge


On Mon, Nov 17, 2008 at 8:57 AM, Inge Solvoll <[EMAIL PROTECTED]>wrote:



I know, this isn't really a problem for regular pages, they load using the
requested protocol, when not marked as secure. But when I create eventlinks
that updates zones, these don't work when they are generated with http and
the rest of the page is generated in https...

What I would like to do is to try some more on the BaseURLSource approach.
Anyone who's got any idea why this has no effect here? I copied and pasted
the code from the T5 docs and put in my Appmodule, and the contribute method
is called on server startup. I replaced the "localhost" url with an
obviously bad url, for testing, but nothing happens, all pages just load as
always, including eventlinks and actionlinks.

Inge


On Sun, Nov 16, 2008 at 9:44 PM, Carl Crowder <[EMAIL PROTECTED]>wrote:

  

I don't know if you're aware, but if you create a href something like

href="//something.com/page"

then the current protocol is maintained. So if you were viewing the page
at https://something.com the HREF would resolve to
https://something.com/page and similarly with http. Unfortunately it
requires using absolute URLs all the time.

I'm not sure if that helps, but perhaps it could be used in fixing that
issue.

Carl

Inge Solvoll wrote:


Yes, I might. This is a major blow for us, our customers choose freely
whether they want to use http or https, so the T5 way of doing things
  

just


doesn't work for us...

On Fri, Nov 14, 2008 at 9:28 PM, Jonathan Barker <
[EMAIL PROTECTED]> wrote:

  

You might want to vote for this:

https://issues.apache.org/jira/browse/TAP5-167




-Original Message-
From: Inge Solvoll [mailto:[EMAIL PROTECTED]
Sent: Friday, November 14, 2008 15:10
To: Tapestry users
Subject: Re: [T5] Pick up https/http from request

Thanks!

I tried copying your code into my AppModule with some small
  

modifications.


But the code only runs on server startup, not when I access a
  

tapestry 5


page. I tried to add deliberate errors in the code, like naming the
  

server


lcalhost, but I never saw the results when accessing pages.

Also, when I try to add "final HttpServletRequest request" as a
  

parameter


to
the contributeAlias method, my T5.0.13 crashes complaining about
  

service


recursion.

What I need is for T5 to figure o

Re: tapestry-spring-security: don't log AccessDeniedException

2008-10-08 Thread Michael Gerzabek
I also realized this annoying thing but couldn't find the root cause 
fast enough. I put a TODO in the next steps section. ATM try to educate 
your perfectionalism to live with it ;)


/Michael


Ulrich Stärk schrieb:

Yet another tapestry-spring-security question: How do I turn of the
logging of the AccessDeniedExceptions thrown (and apparently catched) in
BeginRender when a user tries to access a page he isn't allowed to? The
user gets redirected to the loginpage (funnily not to the page specified
by spring-security.accessDenied.url) but the exception is still being
logged, polluting my logs.

TIA,

Uli


-
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] Alias building recursion exception when using tapetry-spring-security

2008-10-07 Thread Michael Gerzabek
Can you post (excerpts of) your Module class where you build your own 
SaltSource?


Thiago H. de Paula Figueiredo schrieb:

Hi!

Please help me with this exception. I've trying to find any 
information on how to figure out what's happening but, even after 
debugging through Tapestry source code, I haven't find any answer. 
I've shortened and reformatted the message for clarity.


java.lang.RuntimeException: Error invoking service builder method 
TapestryModule.buildAlias(Logger, String, AliasManager, Collection) 
(at TapestryModule.java:217) (for service 'Alias'):


Error invoking service contribution method 
SecurityModule.contributeAlias(SaltSourceService, 
AuthenticationProcessingFilter, Configuration)


Error building service proxy for service 
'RealAuthenticationProcessingFilter' (at 
SecurityModule.buildRealAuthenticationProcessingFilter(AuthenticationManager, 
RememberMeServices, String, String, String) (at 
SecurityModule.java:247)):


Error invoking service builder method 
buildRealAuthenticationProcessingFilter(AuthenticationManager, 
RememberMeServices, String, String, String) (at 
SecurityModule.java:247) (for service 
'RealAuthenticationProcessingFilter')


Exception constructing service 'ApplicationDefaults': Error invoking 
constructor 
org.apache.tapestry5.ioc.internal.services.MapSymbolProvider(Map) (at 
MapSymbolProvider.java:30) via 
org.apache.tapestry5.ioc.services.TapestryIOCModule.bind(ServiceBinder) 
(at TapestryIOCModule.java:38) (for service 'ApplicationDefaults')


Unable to instantiate class 
br.com.arsmachina.example.web.services.AppModule as a module builder: 
Exception constructing service 'Alias':


Construction of service 'Alias' has failed due to recursion: the 
service depends on itself in some way. Please check 
org.apache.tapestry5.services.TapestryModule.buildAlias(Logger, 
String, AliasManager, Collection) (at TapestryModule.java:217) for 
references to another service that is itself dependent on service 
'Alias'.


The dependency chain, as far as I know, is this:

SecurityModule.contributeAlias needs AuthenticationProcessingFilter 
(id RealAuthenticationProcessingFilter)


RealAuthenticationProcessingFilter needs ApplicationDefaults (through 
@Inject @Symbol)


ApplicationDefault is built via binder.bind(SymbolProvider.class, 
MapSymbolProvider.class).withId("ApplicationDefaults") and, 
apparently, does not have any dependencies.


I'm completely lost and any help is invaluable.

Thanks in advance.

Full stack trace:

[ERROR]Alias 2008/10/07 23:49:21,728 Construction of service Alias 
failed: Error invoking service builder method 
org.apache.tapestry5.services.TapestryModule.buildAlias(Logger, 
String, AliasManager, Collection) (at TapestryModule.java:217) (for 
service 'Alias'): Error invoking service contribution method 
nu.localhost.tapestry5.springsecurity.services.SecurityModule.contributeAlias(SaltSourceService, 
AuthenticationProcessingFilter, Configuration): Error building service 
proxy for service 'RealAuthenticationProcessingFilter' (at 
nu.localhost.tapestry5.springsecurity.services.SecurityModule.buildRealAuthenticationProcessingFilter(AuthenticationManager, 
RememberMeServices, String, String, String) (at 
SecurityModule.java:247)): Error invoking service builder method 
nu.localhost.tapestry5.springsecurity.services.SecurityModule.buildRealAuthenticationProcessingFilter(AuthenticationManager, 
RememberMeServices, String, String, String) (at 
SecurityModule.java:247) (for service 
'RealAuthenticationProcessingFilter'): Exception constructing service 
'ApplicationDefaults': Error invoking constructor 
org.apache.tapestry5.ioc.internal.services.MapSymbolProvider(Map) (at 
MapSymbolProvider.java:30) via 
org.apache.tapestry5.ioc.services.TapestryIOCModule.bind(ServiceBinder) 
(at TapestryIOCModule.java:38) (for service 'ApplicationDefaults'): 
Unable to instantiate class 
br.com.arsmachina.example.web.services.AppModule as a module builder: 
Exception constructing service 'Alias': Construction of service 
'Alias' has failed due to recursion: the service depends on itself in 
some way. Please check 
org.apache.tapestry5.services.TapestryModule.buildAlias(Logger, 
String, AliasManager, Collection) (at TapestryModule.java:217) for 
references to another service that is itself dependent on service 
'Alias'.
java.lang.RuntimeException: Error invoking service builder method 
org.apache.tapestry5.services.TapestryModule.buildAlias(Logger, 
String, AliasManager, Collection) (at TapestryModule.java:217) (for 
service 'Alias'): Error invoking service contribution method 
nu.localhost.tapestry5.springsecurity.services.SecurityModule.contributeAlias(SaltSourceService, 
AuthenticationProcessingFilter, Configuration): Error building service 
proxy for service 'RealAuthenticationProcessingFilter' (at 
nu.localhost.tapestry5.springsecurity.services.SecurityModule.buildRealAuthenticationProcessingFilter(AuthenticationManager, 
RememberMeServices, String, String, String) (

Re: tapestry-spring-security and openid

2008-10-07 Thread Michael Gerzabek

Robin Helgelin schrieb:

On Tue, Oct 7, 2008 at 10:58 PM, Jonathan Barker
<[EMAIL PROTECTED]> wrote:
  

I'm assuming this hasn't changed since tapestry5-acegi.  The IfLoggedIn
component uses the following test:

   private boolean test() {
   Principal principal =
requestGlobals.getHTTPServletRequest().getUserPrincipal();
   return principal != null && principal.getName() != "";
   }

Unfortunately, you really need to have a test based on the SecurityContext:

   Authentication currentAuth = null;
   currentAuth =
SecurityContextHolder.getContext().getAuthentication();
   return (currentAuth !=null)



Maybe this should be changed then?

  

I'm not sure. Have no time to digg the Spring Security docs. The second
approach is the one preferred by spring security.


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



Re: tapestry-spring-security and openid

2008-10-07 Thread Michael Gerzabek

Jonathan Barker schrieb:

Actually, there are two problems.  In the configuration for tapestry5-acegi
and presumably spring security, there is an AnonymousAuthenticationProvider.
  

The AnonymousAuthenticationProvider only assures that there is an
Authentication at any time. So don't take it away or all you security
leaks and you have to check for null all the time.

Did you read the Spring/ Acegi Security Reference? I've no time right
now but think to remember that the order of the filters is crucial. So
take a look at it and be sure to contribute the your filter at the right
position.


I think that should be omitted by default, but right now it will fill in the
Authentication object if your regular authentication fails.  Either omit it,
or change the test to fail for the AnonymousAuthnticationToken.



  

-Original Message-
From: Ulrich Stärk [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 07, 2008 17:14
To: Tapestry users
Subject: Re: tapestry-spring-security and openid

Thanks Jonathan, but this not the root cause. The Authentication object
stored in the
SecurityContext is an AnonymousAuthenticationToken instead of an
OpenIDAuthenticationToken. That
tells me that somehow the Authentication doesn't get stored...

Uli

Jonathan Barker schrieb:


I'm assuming this hasn't changed since tapestry5-acegi.  The IfLoggedIn
component uses the following test:

private boolean test() {
Principal principal =
requestGlobals.getHTTPServletRequest().getUserPrincipal();
return principal != null && principal.getName() != "";
}

Unfortunately, you really need to have a test based on the
  

SecurityContext:


Authentication currentAuth = null;
currentAuth =
SecurityContextHolder.getContext().getAuthentication();
return (currentAuth !=null)


Either that, or you need to populate the UserPrincipal in the
  

HttpSession.


Jonathan



  

-Original Message-
From: Ulrich Stärk [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 07, 2008 16:38
To: Tapestry users
Subject: tapestry-spring-security and openid

Hi,

I'm trying to authenticate my users against an openid provider. Spring
security provides an
OpenIDAuthenticationProcessingFilter and an


OpenIDAuthenticationProvider


for this purpose. I set up
the filter and the provider and contributed them to the
HttpServletRequestHandler service and the
ProviderManager service. Additionally I've got an UserDetailsService,


that


queries a database for
the user's role (or throws an exception if the user is not allowed to


log


in).

Logging in works fine and I get redirected to ${spring-
security.target.url} afterwards and not to
the ${spring-security.failure.url} which tells me that everything is
working. But when I place the
security/ifloggedin component on a page, the else block gets rendered,
telling me that I'm not
logged in. I also can't access pages secured with the @Secured


annotation.


When I try, I see an
AccessDeniedException and are redirected to the login page.

Here are the relevant parts of my AppModule:

public static void contributeHttpServletRequestHandler(
 OrderedConfiguration configuration,
 @InjectService("OpenIDAuthenticationProcessingFilter")
 HttpServletRequestFilter openIDAuthenticationProcessingFilter)
{
 configuration.add(
 "openIDAuthenticationProcessingFilter",
 openIDAuthenticationProcessingFilter,
 "before:springSecurityAuthenticationProcessingFilter");
}

public static OpenIDAuthenticationProcessingFilter
buildRealOpenIDAuthenticationProcessingFilter(
 @SpringSecurityServices final AuthenticationManager manager,
 @SpringSecurityServices final RememberMeServices
rememberMeServices,
 @Inject @Value("${spring-security.check.url}") final String
authUrl,
 @Inject @Value("${spring-security.target.url}") final String
targetUrl,
 @Inject @Value("${spring-security.failure.url}") final String
failureUrl) throws Exception
{
 OpenIDAuthenticationProcessingFilter filter = new
OpenIDAuthenticationProcessingFilter();

 filter.setAuthenticationManager(manager);

 filter.setAuthenticationFailureUrl(failureUrl);

 filter.setDefaultTargetUrl(targetUrl);

 filter.setFilterProcessesUrl(authUrl);

 filter.setRememberMeServices(rememberMeServices);

 filter.afterPropertiesSet();

 return filter;
}

public static HttpServletRequestFilter
buildOpenIDAuthenticationProcessingFilter(
 final OpenIDAuthenticationProcessingFilter filter)
{
 return new HttpServletRequestFilterWrapper(filter);
}

public static OpenIDAuthenticationProvider
buildOpenIDAuthenticationProvider(
 @InjectService("UserDetailsService")
 UserDetailsService userDetailsService) throws Exception
{
 OpenIDAuthenticationProvider provider = new
OpenIDAuthenticationProvider();

 provider.setUserDetail

Re: tapestry-spring-security: injecting UserDetails

2008-10-07 Thread Michael Gerzabek


In your page use

Authentication authentication = SecurityContextHolder.getContext()
   .getAuthentication();
if ( authentication.getPrincipal() instanceof User ) {
...
}

where User is you specific User object.

Hope that helps,
Michael


Ulrich Stärk schrieb:

Hi,

are the UserDetails of a logged in user somehow exposed as a service or
accessible via some service so that I can access them?

Uli


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



IoC Question with Alias

2008-09-19 Thread Michael Gerzabek

Hi,

I have a problem with the contributions to the alias service. The 
AppModule is ...


public static void bind( ServiceBinder binder ) {

   binder.bind( SiteDispatcher.class ).withId( "SiteDispatcher" );
   binder.bind( SiteServiceImpl.class ).withId( "SiteService" );
   binder.bind( HttpdRequestSecurityManager.class ).withId(
   "HttpdRequestSecurityManager" );
   binder.bind( SiteBaseURLSource.class ).withId( "SiteBaseURLSource" );
}

@SuppressWarnings( "unchecked" )
public void contributeAlias(
   Configuration configuration,
   @InjectService( "HttpdRequestSecurityManager" )
   RequestSecurityManager manager,
   @InjectService( "SiteBaseURLSource" )
   BaseURLSource baseUrlSource ) {

   configuration.add( AliasContribution.create(
   BaseURLSource.class,
   baseUrlSource ) );

   configuration.add( AliasContribution.create(
   RequestSecurityManager.class,
   manager ) );
}

The constructors of the services are ...

public SiteServiceImpl(
   RequestGlobals globals,
   ApplicationGlobals application,
   Session session,
   Logger logger,
   Collection contributions,
   SymbolSource symbols ) {

   ...
}

public HttpdRequestSecurityManager(
   Request request,
   Response response,
   MetaDataLocator locator,
   RequestPageCache requestPageCache,
   @InjectService("SiteBaseURLSource")
   BaseURLSource baseURLSource,
   SiteService site ) {

   ...
}

public SiteBaseURLSource( SiteService site ) {

   ...
}

I get the [ERROR] Alias Construction of service Alias failed: Error 
invoking service builder method 
org.apache.tapestry5.services.TapestryModule.build(Logger, String, 
AliasManager, Collection) (at TapestryModule.java:205) (for service 
'Alias'): Error invoking service contribution method 
com.flexibelinstitut.tapestry5.site.SiteModule.contributeAlias(Configuration, 
RequestSecurityManager, BaseURLSource): Error building service proxy for 
service 'HttpdRequestSecurityManager' (at 
com.flexibelinstitut.tapestry5.site.services.internal.HttpdRequestSecurityManager(Request, 
Response, MetaDataLocator, RequestPageCache, BaseURLSource, SiteService) 
(at HttpdRequestSecurityManager.java:26)): Error invoking constructor 
com.flexibelinstitut.tapestry5.site.services.internal.HttpdRequestSecurityManager(Request, 
Response, MetaDataLocator, RequestPageCache, BaseURLSource, SiteService) 
(at HttpdRequestSecurityManager.java:26) (for service 
'HttpdRequestSecurityManager'): Exception constructing service 'Alias': 
Construction of service 'Alias' has failed due to recursion: the service 
depends on itself in some way. Please check 
org.apache.tapestry5.services.TapestryModule.build(Logger, String, 
AliasManager, Collection) (at TapestryModule.java:205) for references to 
another service that is itself dependent on service 'Alias'.


And I don't even have a clue where to look. I tried a lot of different 
version with @Inject, with @InjectService("..") on the constructors the 
contributeAlias(..) method. But none of them seems to work.


Any ideas?

/M



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



Re: T5: Warning on grid reorder

2008-08-18 Thread Michael Gerzabek

guys,

I'm using 5.0.14 and experience the same problem.

[WARN] Credential EXCEPTION 
java.io.IOException: Die Syntax für den Dateinamen, Verzeichnisnamen oder
die Datenträgerbezeichnung ist falsch
...
[WARN] ResourceCache Alias request of
'file:/C:/Dokumente%20und%20Einstellungen/indi/Eigene%20Dateien/Workspaces/michaelgerzabek.com/e5-person/src/test/webapp/start.grid.columns:sort/id'
for
'file:/C:/Dokumente%20und%20Einstellungen/indi/Eigene%20Dateien/Workspaces/michaelgerzabek.com/e5-person/src/test/webapp/start.grid.columns:sort/id'

It's just a warning. Further the sorting works fine. Maybe there should be
no logging for that? Should I add a JIRA enhancement?



Stephane Decleire wrote:
> 
> Hi all,
> 
> Each time i reorder a grid by clicking on a column, i get the following 
> warning :
> 
> [WARN] ResourceCache Alias request of 
> 'file:/F:/Steph/workspace/mailings/src/main/webapp/clients.grid.columns:sort/description'
>  
> for 
> 'file:/F:/Steph/workspace/mailings/src/main/webapp/clients.grid.columns:sort/description'
> [WARN] Credential EXCEPTION
> java.io.IOException: Syntaxe du nom de fichier, de répertoire ou de 
> volume incorrecte
> at java.io.WinNTFileSystem.canonicalize0(Native Method)
> at java.io.Win32FileSystem.canonicalize(Win32FileSystem.java:396)
> at java.io.File.getCanonicalPath(File.java:559)
> at org.mortbay.util.FileResource.getAlias(FileResource.java:176)
> at org.mortbay.http.ResourceCache.getResource(ResourceCache.java:250)
> at org.mortbay.http.HttpContext.getResource(HttpContext.java:2118)
> at 
> org.mortbay.jetty.servlet.WebApplicationContext.getResource(WebApplicationContext.java:785)
> at 
> org.mortbay.jetty.servlet.ServletHandler.getResource(ServletHandler.java:735)
> at 
> org.mortbay.jetty.servlet.ServletHandler$Context.getResource(ServletHandler.java:1082)
> at 
> org.apache.tapestry.internal.services.ContextImpl.getResource(ContextImpl.java:43)
> at $Context_119ded1b2a2.getResource($Context_119ded1b2a2.java)
> at $Context_119ded1b209.getResource($Context_119ded1b209.java)
> at 
> org.apache.tapestry.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:56)
> at
> $RequestHandler_119ded1b20d.service($RequestHandler_119ded1b20d.java)
> at 
> org.apache.tapestry.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:93)
> at 
> org.apache.tapestry.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:84)
> at 
> org.apache.tapestry.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:77)
> at 
> org.apache.tapestry.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:106)
> at
> $RequestHandler_119ded1b20d.service($RequestHandler_119ded1b20d.java)
> at
> $RequestHandler_119ded1b205.service($RequestHandler_119ded1b205.java)
> at 
> org.apache.tapestry.services.TapestryModule$12.service(TapestryModule.java:935)
> at 
> org.apache.tapestry.internal.services.IgnoredPathsFilter.service(IgnoredPathsFilter.java:62)
> at 
> $HttpServletRequestFilter_119ded1b204.service($HttpServletRequestFilter_119ded1b204.java)
> at 
> $HttpServletRequestHandler_119ded1b206.service($HttpServletRequestHandler_119ded1b206.java)
> at 
> $HttpServletRequestHandler_119ded1b203.service($HttpServletRequestHandler_119ded1b203.java)
> at
> org.apache.tapestry.TapestryFilter.doFilter(TapestryFilter.java:168)
> at 
> org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821)
> at 
> org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
> at 
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
> at 
> org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821)
> at 
> org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:471)
> at 
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:568)
> at org.mortbay.http.HttpContext.handle(HttpContext.java:1530)
> at 
> org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:633)
> at org.mortbay.http.HttpContext.handle(HttpContext.java:1482)
> at org.mortbay.http.HttpServer.service(HttpServer.java:909)
> at org.mortbay.http.HttpConnection.service(HttpConnection.java:820)
> at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:986)
> at org.mortbay.http.HttpConnection.handle(HttpConnection.java:837)
> at 
> org.mortbay.http.SocketListener.handleConnection(SocketListener.java:245)
> at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
> at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
> 
> My development environment is on Vista and i use the 5.0.12 version of 
> Tapestry.
> 
> Thanks in advance for any clue 

Re: [T5][FAQ] How to configure a service that likely will be overriden by an AliasContribution?

2008-08-11 Thread Michael Gerzabek

Now I don't understand exactly what that means.

In my case I have two modules. Module one ships with an interface and a 
default implementation that is preconfigured. As a user of module one, 
in my module two, I contributeAlias(..) to override the preconfigured 
default implementation. The application as whole will now use the 
service configured and 'implemented' in module two.


What would be the usecase of @Local? When I have only one module and 
want to override via an AliasContribution ..? Why would I d that?



Howard Lewis Ship schrieb:

Looks good to me too.

I'm working on adding @Local which will make it easier to contribute
Alias contributions that are services from within the same module.
But often you can get by, as you did, with just an instance.

On Mon, Aug 11, 2008 at 4:06 AM, Filip S. Adamsen <[EMAIL PROTECTED]> wrote:
  

Hi,

I wouldn't use Configuration>, but rather
Configuration. Otherwise you won't be able to configure
multiple alias overrides at once.

Apart from that, everything looks fine.

-Filip

Michael Gerzabek skrev:


Usecase:
tapestry-spring-security offers integration between Tapestry 5 an Spring
Security [1]. It's implemented as a Tapestry IoC/Core module.

This module uses a PasswordEncoder shipped by Spring Security (they ship
also a couple of standard implementations of PasswordEncoder).

For the module to function correctly an implementation class of
PasswordEncoder (the service in charge) is needed. Now, there are two ways
to configure the module:

1.) gracefully: The module declares a standard service for PasswordEncoder
and assumes the main module will define an AliasContribution to override
with whatever specific instance is needed.

2.) tough: The module doesn't declare a standard service for
PasswordEncoder. It rather assumes that the user of the module will do so.
If the user of the module doesn't provide an implementation a
RuntimeException is thrown and the container won't start up.

Obviously there are arguments for both directions. In
tapestry-spring-security we wanted to follow line 1.) This leads us to the
FAQ.

[FAQ] How to configure a service that likely will be overriden by an
AliasContribution?

i. Supplier: The only thing the supplier of a module has to do is to bind
the interface (PasswordEncoder) to the default class
(PlaintextPasswordEncoder) - or provide a build method if he needs to set it
up.

public static void bind(final ServiceBinder binder) {

 binder.bind( PasswordEncoder.class,
 PlaintextPasswordEncoder.class ).withMarker(
 SpringSecurityServices.class);
}

ii. User: Now if you want to use a supplied module and you want to
override a service defined there the only thing you have to do is to
contribute to the Alias service.

public static void contributeAlias(
  Configuration> configuration ) {

  configuration.add( AliasContribution.create(
  PasswordEncoder.class,
  new ShaPasswordEncoder() ) );
}

--
Crowd,

Is this correct? Do I miss something?

Regards,
Michael

[1] http://www.localhost.nu/java/tapestry5-acegi/


-
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][FAQ] How to configure a service that likely will be overriden by an AliasContribution?

2008-08-11 Thread Michael Gerzabek

Hi,

Oh, I see, you're right. In case you want to contribute a bunch of 
services to AliasService you have to ommit the type you're about to 
contribute because otherwise the compiler won't eat the code.


Thanks.

Filip S. Adamsen schrieb:

Hi,

I wouldn't use Configuration>, but 
rather Configuration. Otherwise you won't be able 
to configure multiple alias overrides at once.


Apart from that, everything looks fine.

-Filip

Michael Gerzabek skrev:

Usecase:
tapestry-spring-security offers integration between Tapestry 5 an 
Spring Security [1]. It's implemented as a Tapestry IoC/Core module.


This module uses a PasswordEncoder shipped by Spring Security (they 
ship also a couple of standard implementations of PasswordEncoder).


For the module to function correctly an implementation class of 
PasswordEncoder (the service in charge) is needed. Now, there are two 
ways to configure the module:


1.) gracefully: The module declares a standard service for 
PasswordEncoder and assumes the main module will define an 
AliasContribution to override with whatever specific instance is needed.


2.) tough: The module doesn't declare a standard service for 
PasswordEncoder. It rather assumes that the user of the module will 
do so. If the user of the module doesn't provide an implementation a 
RuntimeException is thrown and the container won't start up.


Obviously there are arguments for both directions. In 
tapestry-spring-security we wanted to follow line 1.) This leads us 
to the FAQ.


[FAQ] How to configure a service that likely will be overriden by an 
AliasContribution?


i. Supplier: The only thing the supplier of a module has to do is to 
bind the interface (PasswordEncoder) to the default class 
(PlaintextPasswordEncoder) - or provide a build method if he needs to 
set it up.


public static void bind(final ServiceBinder binder) {

 binder.bind( PasswordEncoder.class,
  PlaintextPasswordEncoder.class ).withMarker(
  SpringSecurityServices.class);
}

ii. User: Now if you want to use a supplied module and you want to 
override a service defined there the only thing you have to do is to 
contribute to the Alias service.


public static void contributeAlias(
   Configuration> configuration ) {

   configuration.add( AliasContribution.create(
   PasswordEncoder.class,
   new ShaPasswordEncoder() ) );
}

--
Crowd,

Is this correct? Do I miss something?

Regards,
Michael

[1] http://www.localhost.nu/java/tapestry5-acegi/


-
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][FAQ] How to configure a service that likely will be overriden by an AliasContribution?

2008-08-11 Thread Michael Gerzabek

Usecase:
tapestry-spring-security offers integration between Tapestry 5 an Spring 
Security [1]. It's implemented as a Tapestry IoC/Core module.


This module uses a PasswordEncoder shipped by Spring Security (they ship 
also a couple of standard implementations of PasswordEncoder).


For the module to function correctly an implementation class of 
PasswordEncoder (the service in charge) is needed. Now, there are two 
ways to configure the module:


1.) gracefully: The module declares a standard service for 
PasswordEncoder and assumes the main module will define an 
AliasContribution to override with whatever specific instance is needed.


2.) tough: The module doesn't declare a standard service for 
PasswordEncoder. It rather assumes that the user of the module will do 
so. If the user of the module doesn't provide an implementation a 
RuntimeException is thrown and the container won't start up.


Obviously there are arguments for both directions. In 
tapestry-spring-security we wanted to follow line 1.) This leads us to 
the FAQ.


[FAQ] How to configure a service that likely will be overriden by an 
AliasContribution?


i. Supplier: The only thing the supplier of a module has to do is to 
bind the interface (PasswordEncoder) to the default class 
(PlaintextPasswordEncoder) - or provide a build method if he needs to 
set it up.


public static void bind(final ServiceBinder binder) {

 binder.bind( PasswordEncoder.class,
  PlaintextPasswordEncoder.class ).withMarker(
  SpringSecurityServices.class);
}

ii. User: Now if you want to use a supplied module and you want to 
override a service defined there the only thing you have to do is to 
contribute to the Alias service.


public static void contributeAlias(
   Configuration> configuration ) {

   configuration.add( AliasContribution.create(
   PasswordEncoder.class,
   new ShaPasswordEncoder() ) );
}

--
Crowd,

Is this correct? Do I miss something?

Regards,
Michael

[1] http://www.localhost.nu/java/tapestry5-acegi/


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



Re: [T5] Spring Security 2 Integration

2008-08-08 Thread Michael Gerzabek
Tapestry Acegi (http://www.localhost.nu/java/tapestry5-acegi/) is 
already Tapestry Spring Security. There's just one issue with how the 
PasswordEncoder is setup. It's somehow backwards to contribute a bean 
via its class name as a string when you have a full fledged IoC container.


You can checkout the source at 
http://www.localhost.nu/svn/public/tapestry-spring-security
With a mvn install you should be in the game. Just put these 
dependencies into your pom:



 org.springframework
 spring-dao
 ${spring-release-version}

  


 nu.localhost.tapestry
 tapestry-spring-security
 2.0.0-SNAPSHOT


With TSS You can secure your pages and methods with @Secured("Role Names>"). You also can secure static resources via contributions of 
RequestInvocationDefinitions


public static void contributeFilterSecurityInterceptor(
 Configuration configuration ) {

   configuration.add( new RequestInvocationDefinition( "/ltd.pdf", 
"ROLE_ADMIN" ) );

}

If you want to secure whole filesets you can also use the ant regexp 
style for your URI definitions.


This is just a short notice for you came up with that thread. An 
official release is on the horizon.



kace schrieb:
Hi fellas, 


has anyone gotten Spring Security 2 to integrate with Tapestry 5?  I have
Spring running but it seems to be ignoring the security.xml rules

I have this in my web.xml


securityFilter
   
org.springframework.web.filter.DelegatingFilterProxy


targetBeanName
springSecurityFilterChain



securityFilter
/*


app
   
org.apache.tapestry5.spring.TapestrySpringFilter



app
/*


and this is part of the security.xml file






Instead of going to the login page it defaults to the welcome-page.  Anyone
gotten this to work?

Thanks, 


..kace
  



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



Re: Problem wuth internacionalization

2008-05-12 Thread Michael Gerzabek
It depends on how your Module is named. If you name it 
.services.StartModule then it's Start.properties 
(Start_.properties). The archetype creates an AppModule.java 
file, so the right name is App.properties.


Beginning from 5.0.6 - I suspect - you further have to put your 
templates into the webapp root or into your classpath.


Igoor schrieb:

when i make files Start.properties and Start_de.properties and put them into
WEB-INF, or when i make com.igor.bookStore.pages and put these files into
this root my application doesen't work... But when I make files
app.properties and app_de.properties into WEB-INF whit same content like
Start.properties and Start_de.properties my application work. What i need to
do in order to make my application work with Start.properties and
Start_de.properties 
  



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



Re: Question about ApplicationInitializerFilter

2008-05-05 Thread Michael Gerzabek
Interesting, espscially 
https://issues.apache.org/jira/browse/TAPESTRY-1904 and 
https://issues.apache.org/jira/browse/TAPESTRY-1679.


I've another question. Do you think there's a need for loading/ 
unloading modules? This would add a very powerful feature the Java world 
does leak in comparison to php. Think of WordPress or drupal. There you 
can add modules to your installation, activate (load) them, uninstall 
(unload) them and everything is neatly integrated into the GUI. I think 
some apps also allow for autodetection of new module versions.


I researched T5 a little and found that from many points (UI, Services, 
Configuration) it should be able to make modules loadable. But I'm an 
T5-IoC beginner and know far to less to get my hands dirty now. Though 
from user perspective I would love to see this. Dreammode: Have eclipse/ 
OSGi like T5 where I can drop a jar file and the next time I log into 
the admin area everything is loaded, could be configured and activated.


My basic questions here are
ALL: i.) Would it be of benefit to make modules loadable (deployable, etc.)?
HLS/ ALL: ii.) Where would I have to look into to get things on go?

Michael

Howard Lewis Ship schrieb:

You can see that there are a few issues in JIRA to make the IoC stuff
(even) more refactoring-safe.

On Sun, May 4, 2008 at 11:06 PM, Michael Gerzabek
<[EMAIL PROTECTED]> wrote:
  

Thank you Howard,

 It was a typo after a refactoring (DatabaseManager |->
DatabaseUpdateManager). I didn't check the update textual occurences in
eclipse.




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



Re: Question about ApplicationInitializerFilter

2008-05-04 Thread Michael Gerzabek

Thank you Howard,

It was a typo after a refactoring (DatabaseManager |-> 
DatabaseUpdateManager). I didn't check the update textual occurences in 
eclipse.



Lewis Ship schrieb:

The most common case for this is that the module class defining the
service, or the module class containing the contribution to the
service, is not being loaded.  Please refer to the docs on how to
ensure that modules are loaded.

On Tue, Apr 29, 2008 at 2:10 AM, Michael Gerzabek
<[EMAIL PROTECTED]> wrote:
  

Hi,

 I've a Service that extends ApplicationInitializerFilter:

 public interface DatabaseUpdateManager extends ApplicationInitializerFilter
{

   public void update() throws SQLException;
 }

 I made it a service because I thought then it would be easy to collect
contributions from other modules.

 In my module I declare a bulder with

   public static DatabaseUpdateManager build(
   final Logger logger,
   final Collection contributions ) {

   return new DatabaseUpdateManagerImpl( logger, contributions );
   }
  and contribute to the ApplicationInitializer with

   public static void contributeApplicationInitializer(
   OrderedConfiguration configuration,
   final DatabaseUpdateManager manager ) {

   configuration.add( "DatabaseManager", manager );
   }

 Another module tries to contribute to this class with

   public static void contributeDatabaseManager(
   Configuration configuration ) {

   System.out.println( "contributeDatabaseManager()");
 .. contributions ..
   }

 But method contributeDatabaseManager(..) is never called.

 What am I missing?

 Thanks in advance
 Michael


 -
 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: Localization of default messages

2008-04-29 Thread Michael Gerzabek

Manuel,

you simply put
org.apache.tapestry.corelib.components.Errors_es.properties (I suppose) 
in your resources. If you use the maven archetype this should be 
PROJECT_HOME/src/main/resources



Manuel Corrales schrieb:

Hi, i was checking the documentation but was not able to find how can i do
to change the default messages. For instance, when you use a beanform or a
t:errors, you get a default heading text saying something like: "You should
fix the next errors" :P or when you insert a non parseable date on a
DateField you get also an implicit validation error. How can i changes this
texts, so my application is completely localized?

Best regards and thanks in advance!

  



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



Re: page activation + components

2008-04-29 Thread Michael Gerzabek

@Retain
private String param;

Salue

János Jarecsni schrieb:

and how a component can get to know the page in which it is included? I
mean, I can't @InjectPage, as the component will be included in many kinds
of pages.

@Kristian: thx for the many ways :) I'll try these, hope that the
@Environmental stuff is scalable (I'm trying to bypass session creation as
much as possible)

Is there a doc on the various annotations available?

@Michael:
Could you include a tiny bit of example? THX!

Thx to you all
cheers
janos

2008/4/29 Chris Lewis <[EMAIL PROTECTED]>:

  

5) @InjectPage the page and call the getter

Kristian Marinkovic wrote:


hi janos,

there are several possibilities:

1) declare a component parameter and pass in the variable

2) put it in a ASO and inject the ASO in all your components (using
@ApplicationState)
the drawback is that any other page or component will be able to access
the ASO

3) put it into the Environment and read it whereever you need it in your
nested components.
be careful when you put your object in your environment. if you put it
  

in


during the action
request it will not be able in the render request (because of the page
redirect).

page:

@Inject Environment env;

@Persist("flash") whateverclass w;

onActivate(w) {  this.w= w }

setupRender() { env.push(whateverclass.class,w);}

components:

@Environmental Whateverclass var;

4) define a service that can take this variable (and saves it
  

appropriatly


so it is not
lost on a redirect:)) and inject your service in the components where
needed
to retrieve the value.

maybe there are some more possibilities :)

g,
kris




"János Jarecsni" <[EMAIL PROTECTED]>
29.04.2008 08:15
Bitte antworten an
"Tapestry users" 


An
"Tapestry users" 
Kopie

Thema
page activation + components






Hi there,

I have an activatable page, in its onActivate(String param) method I
  

save


the param to a normal instance variable of the page class (no
persistence!).
How can any component embedded within this page access this variable?

the page class:

//...
private String param;

public void onActivate(String param) {
   this.param = param;
}


public String getParam() {...}


Thx in advance!
Janos



  

--
http://thegodcode.net


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



Question about ApplicationInitializerFilter

2008-04-29 Thread Michael Gerzabek

Hi,

I've a Service that extends ApplicationInitializerFilter:

public interface DatabaseUpdateManager extends 
ApplicationInitializerFilter {


   public void update() throws SQLException;
}

I made it a service because I thought then it would be easy to collect 
contributions from other modules.


In my module I declare a bulder with

   public static DatabaseUpdateManager build(
   final Logger logger,
   final Collection contributions ) {

   return new DatabaseUpdateManagerImpl( logger, contributions );
   }
  
and contribute to the ApplicationInitializer with


   public static void contributeApplicationInitializer(
   OrderedConfiguration 
configuration,

   final DatabaseUpdateManager manager ) {

   configuration.add( "DatabaseManager", manager );
   }

Another module tries to contribute to this class with

   public static void contributeDatabaseManager(
   Configuration configuration ) {

   System.out.println( "contributeDatabaseManager()");
  
   .. contributions ..

   }

But method contributeDatabaseManager(..) is never called.

What am I missing?

Thanks in advance
Michael


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



Re: page activation + components

2008-04-29 Thread Michael Gerzabek
6) @Retain could do the job. Your String will be available until the end 
of the request.



János Jarecsni schrieb:

Hi there,

I have an activatable page, in its onActivate(String param) method I save
the param to a normal instance variable of the page class (no persistence!).
How can any component embedded within this page access this variable?

the page class:

//...
private String param;

public void onActivate(String param) {
   this.param = param;
}


public String getParam() {...}


Thx in advance!
Janos

  



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



Re: [T5.0.10] Form submission character encoding issues when using ISO-8859-1

2008-04-28 Thread Michael Gerzabek

Hi Thiago,

I use 'accept-charset="ISO-8859-1"' as well as  
'enctype="application/x-www-form-urlencoded"' on each t:form and 
t:beaneditform. This does the job for me.


Michael

Thiago HP schrieb:

Hi!

I'm working on a project that uses an already existent MySQL database.
It's using ISO-8859-1 as its character encoding and, then, I want the
full application to run in ISO-8859-1. Changing the templates and
response encoding to ISO-8859-1 was easy (as everything related to T5
:). Everything works as expected, except form submissions with
non-ASCII characters. When I submit some text field with the value
"Não" ("no" in Portuguese), the corresponding field receives a string
with 4 characters, being two for 'ã'. So I have a strong suspicion
that the form submission is being handled with UTF-8 (which uses two
characters for most, maybe all non-ASCII characters).

Could somebody give me some suggestions on how to solve this? Reading
the documentation and the mailing list archives, I could not find any
solution to this. I haven't had the time to look at the T5 sources
yet. It's easy to set the character encoding of the response, but I
couldn't find a way to set the character encoding of the request.

Thanks in advance.

  



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



Re: Tapestry and OSGi

2008-04-22 Thread Michael Gerzabek

Hi Robert,

No I've no experience in using T5 with OSGi. Sounds very interesting 
though. Recently I stepped into this topic and found Sling [1], another 
Apache incubator project that deals with OSGi. Sling is based on Felix 
[2] an OSGi implementation of ASF. It further uses Jackrabbit [3] as 
JCR. In the documentation they provide infos on how to include servlet 
filters into their framework.


I also was wondering how much effort it would be to make the T5 IoC 
mechanism OSGi conform? Would there be extra value of hot-deployment of 
modules? Is there a need for such a thing? Or what would be the value of 
getting strong interfaces on service layer? What would be the benefit at 
all?


Michael

[1] http://incubator.apache.org/sling/site/index.html
[2] http://felix.apache.org/site/index.html
[3] http://jackrabbit.apache.org/

Robert Binna schrieb:

Hi

I have a question towards using tapestry and OSGi. Has any one of you 
done something with Tapestry and OSGi till now? Does anyone know of 
some best practices, pitfalls?


Thanks a lot in advance,
Best regards, Robert

-
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 example .TML

2008-04-21 Thread Michael Gerzabek

Hi Janos,

take a look at the upgrade notes. Close to the bottom the change of the 
BeanModel signature is documented. Now you need mode.exlude(..) instead 
of model.remove(..).


Regards,
Michael

[1] http://tapestry.apache.org/tapestry5/tapestry-core/upgrade.html

János Jarecsni schrieb:

Hi,

I have upgraded from 5.0.10 to 5.0.11 and a .TML which worked before now
throws this:

An unexpected application exception has occurred.

Render queue error in SetupRender[AddCelebrity:celebrity.editor]: Exception
instantiating instance of com.packtpub.celebrities.model.Celebrity (for
component 'AddCelebrity:celebrity.editor'): Error invoking constructor
com.packtpub.celebrities.model.Celebrity(String, String, Date, Occupation)
(at Celebrity.java:18) (for service 'BeanModelSource'): No service
implements the interface java.util.Date.

The .TML code:

http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>

Celebrity Collector: Adding New Celebrity



Adding New Celebrity






  



and the model class (Celebrity):

package com.packtpub.celebrities.model;

import java.util.Date;

public class Celebrity {
private Date dateOfBirth;
// some fields omitted

public Celebrity() {
}

public Celebrity(String firstName, String lastName,
Date dateOfBirth, Occupation occupation) {
this.firstName = firstName;
this.lastName = lastName;
this.dateOfBirth = dateOfBirth;
this.occupation = occupation;
}

public Date getDateOfBirth() {
return dateOfBirth;
}

public void setDateOfBirth(Date dateOfBirth) {
this.dateOfBirth = dateOfBirth;
}
// more methods follow
}


Can you tell me what am I doing wrong?
thx
janos

  



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



Re: Page template and class location

2008-04-21 Thread Michael Gerzabek

When you contribute it via

new LibraryMapping( "mylib", "com.mycompany.package" )

you wanna browse it with http://localhost:8080/mylib/x

/M



János Jarecsni schrieb:

no :)
I tried a lot of URLs in the browser, but none worked. What URL did you use
to browse to such a page?
thx
janos


On 22/04/2008, Michael Gerzabek <[EMAIL PROTECTED]> wrote:
  

Exactly. Does it work now?

/M

János Jarecsni schrieb:



Hi Michael,

I have the following line in the manifest.mf of my T5 component library
JAR:

Tapestry-Module-Classes: hu.intellynet.mojito.tapestry.LibraryModule

Is it what you mean?

thx
Janos

On 21/04/2008, [EMAIL PROTECTED] <[EMAIL PROTECTED]>
wrote:


  

Janos,
You have to provide the full class name of your Module (in your jar
file)
in the MANIFEST.MF file which is located in the META-INF directory.
More
infos on that in the two links I added my last post.



http://www.nabble.com/T5%3A-component-libraries-to12055274.html#a12055580

http://tapestry.apache.org/tapestry5/tapestry-ioc/module.html


Michael

 Original-Nachricht 




Datum: Mon, 21 Apr 2008 13:13:45 +0200
Von: "János Jarecsni" <[EMAIL PROTECTED]>
An: "Tapestry users" 
Betreff: Re: Page template and class location


  


Hi Michael,

what did you do? I did what I wrote (yes it is a library JAR, I have
the
LibraryModule class I quoted, the library name is "mylib", and the


  

quoted




URLs do NOT work. What URL did you use?

thx a lot
Janos

On 21/04/2008, Michael Gerzabek <[EMAIL PROTECTED]> wrote:


  

Hi Janos,

if your library is in a jar file read [1], else add the method you




posted


  

in your current Module. Tested it, works like a charm ;)

[1]





http://www.nabble.com/T5%3A-component-libraries-to12055274.html#a12055580




Infos on Modules:
  

http://tapestry.apache.org/tapestry5/tapestry-ioc/module.html

János Jarecsni schrieb:





Yes, but how? :) I tried various ways, none worked. The library


  

contains

  

the


following library module:

  public static void
contributeComponentClassResolver(Configuration
configuration) {
  configuration.add(new LibraryMapping("mylib",
"com.mycompany.package"));
  }

In the "com.mycompany.package.pages" package there is the X.tml.
Pointing my browser to

http://localhost:8080/context/mylib/x
http://localhost:8080/context/mylib.x
http://localhost:8080/context/x

doesn't work either.

Thanks in advance!
Janos




  

-
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: Page template and class location

2008-04-21 Thread Michael Gerzabek

Exactly. Does it work now?

/M

János Jarecsni schrieb:

Hi Michael,

I have the following line in the manifest.mf of my T5 component library JAR:

Tapestry-Module-Classes: hu.intellynet.mojito.tapestry.LibraryModule

Is it what you mean?

thx
Janos

On 21/04/2008, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
  

Janos,
You have to provide the full class name of your Module (in your jar file)
in the MANIFEST.MF file which is located in the META-INF directory. More
infos on that in the two links I added my last post.


http://www.nabble.com/T5%3A-component-libraries-to12055274.html#a12055580

http://tapestry.apache.org/tapestry5/tapestry-ioc/module.html


Michael

 Original-Nachricht 


Datum: Mon, 21 Apr 2008 13:13:45 +0200
Von: "János Jarecsni" <[EMAIL PROTECTED]>
An: "Tapestry users" 
Betreff: Re: Page template and class location
  


Hi Michael,

what did you do? I did what I wrote (yes it is a library JAR, I have the
LibraryModule class I quoted, the library name is "mylib", and the
  

quoted


URLs do NOT work. What URL did you use?

thx a lot
Janos

On 21/04/2008, Michael Gerzabek <[EMAIL PROTECTED]> wrote:
  

Hi Janos,

if your library is in a jar file read [1], else add the method you


posted
  

in your current Module. Tested it, works like a charm ;)

[1]



http://www.nabble.com/T5%3A-component-libraries-to12055274.html#a12055580


Infos on Modules:
http://tapestry.apache.org/tapestry5/tapestry-ioc/module.html

János Jarecsni schrieb:



Yes, but how? :) I tried various ways, none worked. The library
  

contains
  

the
following library module:

   public static void
contributeComponentClassResolver(Configuration
configuration) {
   configuration.add(new LibraryMapping("mylib",
"com.mycompany.package"));
   }

In the "com.mycompany.package.pages" package there is the X.tml.
Pointing my browser to

http://localhost:8080/context/mylib/x
http://localhost:8080/context/mylib.x
http://localhost:8080/context/x

doesn't work either.

Thanks in advance!
Janos


  

-
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: Page template and class location

2008-04-21 Thread michael . gerzabek
Janos,
You have to provide the full class name of your Module (in your jar file) in 
the MANIFEST.MF file which is located in the META-INF directory. More infos on 
that in the two links I added my last post.

http://www.nabble.com/T5%3A-component-libraries-to12055274.html#a12055580
http://tapestry.apache.org/tapestry5/tapestry-ioc/module.html

Michael

 Original-Nachricht 
> Datum: Mon, 21 Apr 2008 13:13:45 +0200
> Von: "János Jarecsni" <[EMAIL PROTECTED]>
> An: "Tapestry users" 
> Betreff: Re: Page template and class location

> Hi Michael,
> 
> what did you do? I did what I wrote (yes it is a library JAR, I have the
> LibraryModule class I quoted, the library name is "mylib", and the quoted
> URLs do NOT work. What URL did you use?
> 
> thx a lot
> Janos
> 
> On 21/04/2008, Michael Gerzabek <[EMAIL PROTECTED]> wrote:
> >
> > Hi Janos,
> >
> > if your library is in a jar file read [1], else add the method you
> posted
> > in your current Module. Tested it, works like a charm ;)
> >
> > [1]
> >
> http://www.nabble.com/T5%3A-component-libraries-to12055274.html#a12055580
> > Infos on Modules:
> > http://tapestry.apache.org/tapestry5/tapestry-ioc/module.html
> >
> > János Jarecsni schrieb:
> >
> > > Yes, but how? :) I tried various ways, none worked. The library
> contains
> > > the
> > > following library module:
> > >
> > >public static void
> > > contributeComponentClassResolver(Configuration
> > > configuration) {
> > >configuration.add(new LibraryMapping("mylib",
> > > "com.mycompany.package"));
> > >}
> > >
> > > In the "com.mycompany.package.pages" package there is the X.tml.
> > > Pointing my browser to
> > >
> > > http://localhost:8080/context/mylib/x
> > > http://localhost:8080/context/mylib.x
> > > http://localhost:8080/context/x
> > >
> > > doesn't work either.
> > >
> > > Thanks in advance!
> > > Janos
> > >
> > >
> >
> >
> > -
> > 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: Page template and class location

2008-04-21 Thread Michael Gerzabek

Hi Janos,

if your library is in a jar file read [1], else add the method you 
posted in your current Module. Tested it, works like a charm ;)


[1] 
http://www.nabble.com/T5%3A-component-libraries-to12055274.html#a12055580
Infos on Modules: 
http://tapestry.apache.org/tapestry5/tapestry-ioc/module.html


János Jarecsni schrieb:

Yes, but how? :) I tried various ways, none worked. The library contains the
following library module:

public static void
contributeComponentClassResolver(Configuration
configuration) {
configuration.add(new LibraryMapping("mylib",
"com.mycompany.package"));
}

In the "com.mycompany.package.pages" package there is the X.tml.
Pointing my browser to

http://localhost:8080/context/mylib/x
http://localhost:8080/context/mylib.x
http://localhost:8080/context/x

doesn't work either.

Thanks in advance!
Janos
  



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



Re: Page template and class location

2008-04-21 Thread Michael Gerzabek

János Jarecsni schrieb:

I have a component library, x.jar. I placed a y.tml into its pages package
(some.package.pages, where some.package is declared in the library module as
the root package). I added the component jar to the web application, still I
cannot access the x.tml as a page.
  
When y.tml is in x.jar then you maybe might want to address y(.tml) in 
the browser!

Any help is welcome! :)

Cheers,
Janos



On 19/04/2008, János Jarecsni <[EMAIL PROTECTED]> wrote:
  

Hi,

can a page be contributed to the web application by a JAR file (just like
component templates)? If so, how an URL can be constructed to such a page?
Concretely, is it possible for T5 to have a forum.tml residing in the
com.foo.bar package of a forum.jar file and use it in the application?

thanks in advance,
Janos





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



Re: [T5] Sending Email from Tapestry

2008-04-19 Thread Michael Gerzabek

Sven Homburg schrieb:

a velocity service is also implemented but not documented
but use the same service interface

http://87.193.218.134:8080/t5components/t5c-contrib/
  

Oh, I will take a look at that. Thank you!
/M


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



Re: include

2008-04-19 Thread Michael Gerzabek

Hi Janos, List,

Wow, you digged into it ;) At the time there was no need for me to go so 
deep with T5. So I think I cannot help with your conrete approach.


Rather I will share what I did, when I needed to load a Component at 
runtime.


I have a checkout flow that has the opportunity to register different 
payment types. The application itself implements a handful of usual 
payment types. Beside that additional payment types can be added later. 
Payment types can be deployed via a standalone jar file. The application 
will pick it up and dispay an additional payment option for each payment 
type to the user. It's obvious that payment types need to augment the 
checkout flow to collect additional payment data.


Like in any checkout application one of the last pages is a kind of 
cofirmation page where the user can check all his order details. One of 
which of course is the payment data.


My problem with T5 was that I would know only at runtime which payment 
type was selected and that I had to delegate the rendering of the 
payment to some Component.


The answer I found on the list [1] and in the docs [2] was to use the 
 Component. This implyed to also create a  for 
each payment type. And that makes absolute sense. When you implement a 
new payment type you can easily care about how the rendering in a small 
box of a confirmation page will look like. Remember? Static structure.


So the only thing I had to 'invent' on my own was how to get hold of the 
specific block at runtime. In my case this boiled down to aggregate some 
meta-data that help me handle the stuff. The dynamic behaviour.


Here an excerpt from the checkout application:

Confirmation.tml (BTW I like the invisible instrumentation stuff :))
...

...
Confirmation.java
...
   public Object getActivePayment() {
  
   // Metadata from PaymentProviderService

   Provider provider = _paymentService.getProvider();
   // The T5 page name
   Page page = _pagePool.checkout( provider.getPaymentPageName() );
   ComponentPageElement root = page.getRootElement();
   Block block = root.getBlock( 
provider.getPaymentConfirmationBlockName() );

   _pagePool.release( page );
   return block;
   }
...

List: I'm not sure about the line

Page page = _pagePool.checkout( provider.getPaymentPageName() );

Lately I saw a different approach in RequestSecurityManagerImpl that uses

Page page = _requestPageCache.get( pageName );

Is the second one better? faster? memory optimized?

Anyway. This does the job for my confirmation page. And somehow it's a 
showcase on how to dynamically load a Component/ Block at runtime.


Hope that helps a little,
Michael

[1] 
http://www.nabble.com/T5%3A-Best-practice-for-rendering-a-dynamic-component-to10765577.html#a10775220
[2] 
http://tapestry.formos.com/nightly/tapestry5/tapestry-core/ref/org/apache/tapestry/corelib/components/Delegate.html



János Jarecsni schrieb:

Hi Michael,

PagePool cannot give out ComponentPageElements, but PageElementFactory can.
Still I have the problem :)
I can now simply describe what I'd like to achieve:

The following is a class of a component:

public class ComponentSlot {

@Parameter(required = true, defaultPrefix = "literal")
private String slotId;


@BeginRender
void renderMessage( MarkupWriter writer) {
 // iterate through a registry of components, looking for components
registered with this slot
 // embed those components here one by one
}
}

So, the ComponentSlot would be the logical "container" of some other
componenets, which would like to show up in this slot (=place holder). Could
someone tell me roughly what should I do to correctly embed another
component in the renderMessage method (if it is the right place for it)?

I'd appreciate any answers helping me get closer to the solution :)

cheers,
janos

  



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



Re: [T5] Sending Email from Tapestry

2008-04-19 Thread Michael Gerzabek

nille hammer schrieb:

Hi Michael,

I have tried your suggestion. In my environment (5.0.11) it does not work. Even with 
explicit id "Messages" provided, the ioc-container throws a RuntimeException 
complaining that Messages is not a defined service. You must have done sth. else to make 
your suggestion work in your environment. Although the RuntimeException your suggestion 
caused, helped me a lot! It shows all ids of defined services. Amongst them is 
ComponentSource, which serves my needs. So YOU helped me man, maybe not in the intended 
way, but you did ;-)
  

Fine. Don't know what's the difference. I also use 5.0.11.

Do you know http://:/ServiceStatus? It's very helpful in 
looking for the service you might need. It's part of the core services 
like ExceptionReport, PropertyDisplayBlocks and PropertyEditBlocks.

I myself (as well as obviously the ioc-container) have problems considering Messages a 
service. To me it only gets a meaning as part of a particular page/component. Thinking 
about that I was looking for methods to get a hand on that part. As it turned out in 
Tapestry the right term to look for is "resource". And this is how i have 
rewritten my build method:

public static KursConfirmationSender builConfirmationMailSender(ComponentSource 
cs ) {
  return new 
ConfirmationMaiilSenderImpl(cs.getPage("bookings/Summary").getComponentResources().getMessages());
}

"bookings/Summary" is the logical name of the page that holds the messages needed for 
assembly of the email. I am thinking about implementing a "page" ConfirmationMail that 
serves the only purpose to hold the messages. May be I will do that later.
  

Maybe you really want to look at

http://87.193.218.134:8080/t5components/t5c-contrib/howto_freemarkerservice.html

This could also help you. I personally prefer Velocity and implemented a little 
Service to send mails via Springs JavaMailSenderImpl using Velocity templates.


So thanks to Thiago, Michael and Sven for your efforts,
nillehammer

  

You're welcomed.

Michael

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



Re: [T5] Sending Email from Tapestry

2008-04-19 Thread Michael Gerzabek

PS: Get more infos on T-IOC here:
http://tapestry.apache.org/tapestry5/tapestry-ioc/service.html

Michael Gerzabek schrieb:

nille,

maybe you wanna try adding the InjectService annotation. This at least 
works for my services.


public static ConfirmationMailSender
buildConfirmationMailSender(
 @InjectService("Messages")
 Messages messages) {
 return new ConfirmationMailSender(messages);
}

good morning,
Michael


hammer schrieb:
So any one who knows how to provide a message catalogue to a service 
builder method, please do not hesitate to enlight me.
  



-
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] Sending Email from Tapestry

2008-04-19 Thread Michael Gerzabek

nille,

maybe you wanna try adding the InjectService annotation. This at least 
works for my services.


public static ConfirmationMailSender
buildConfirmationMailSender(
 @InjectService("Messages")
 Messages messages) {
 return new ConfirmationMailSender(messages);
}

good morning,
Michael


hammer schrieb:

So any one who knows how to provide a message catalogue to a service builder 
method, please do not hesitate to enlight me.
  



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



Re: AW: AW: Getting Answers on the User List

2008-04-17 Thread Michael Gerzabek
Chris only pinpointed your former offends and was so kind to translate 
the type of it with respect. He was AFAICS not digging into what you 
repeatedly post as facts to list.


So, Rob, we got your points [1-4]. Thank You.

And now would you just be so kind and leave us so we can happily close 
this long winded thread.


Regards,
Michael

Rob Smeets schrieb:

Chris,

Some of your quotes were made by me but others not by me. To make things
easier for you I've copied my previous post for you. Be bold and answer
them, ok. Don't be afraid or shy. At least I won't bite you. There we go:

I want you to take a close look at the following points I've been making and
tell me which one is a misinformation.

1. Every Tapestry major release is backward incompatible with previous
releases.
2. High profile users and commiters have fled Tapestry to other frameworks
such as Wicket. Namely, Kent Tong, Geoff Longman, the creator of Spindle,
etc. I could name some more. Should I do it?
3. Tapestry has been ditched by www.theserverside.com and replaced with
another webframework.
4. In 7 years of existense of Tapestry, Howard has only been able to train
just a 100 Tapestry users.

What is the misinformation here, Chris? Don't avoid any of them or dilute
them with anything else, please, else I would label you a big coward, which
so far hasn't crossed my mind you are.

Looking forawrd to your bold answers.

Yours friendly,

Rob

On Thu, Apr 17, 2008 at 10:59 AM, Chris Lewis <[EMAIL PROTECTED]>
wrote:

  

Francis (as Rob):


http://www.nabble.com/Re%3A-AW%3A-Getting-Answers-on-the-User-List-p16679523.html
"...not only are high profile Tapestry
users abandoning Tapestry, high profile sites which were using Tapestry
are
also ditching Tapestry..." - *FUD*


http://www.nabble.com/Re%3A-Getting-Answers-on-the-User-List-p16634215.html
"...Tapestry is now just another
dead horse, I'm sorry..." - *Misinformation*


http://www.nabble.com/Re%3A-T5-%285.0.11%29---ready-for-production-deployment-p16348763.html
"I have 2 favorite adjectives about Tapestry 5: Over-engineerd and
Volatile!!' - *FUD*

http://www.nabble.com/Re%3A-How-is-T5-tutorial--p16270907.html
"Go grab Wicket of GWT. It's better documented and questions like what you
asked won't refer you to source code but to a well documented examples.
Above all the users of those lists are far, far more friendly." - *SPAM*

http://www.nabble.com/Re%3A-How-is-T5-tutorial--p16275158.html
"There we go again, when someone raises a legitimate concern he is easily
labeled a Troll" - *Misinformation*. You have no questions, you seek to
incite anger.

"Again, this proves how arrogant
and unfriendly Tapestry mailing list members are." - *FUD +
Misinformation*

http://www.nabble.com/Tapestry-at-my-company-p16122861.html
- *FUD* - This entire situation is probably a lie. If not, validate it.
Provide links to the project company, and personally email me a
technical contact that I can privately consult and verify.

http://www.nabble.com/Newbie-Tapestry-p15893688.html
"I googled and also learnt there is Tapestry 6 in the works which
would also be a whole new beast not compatible with all previous Tapestry
versions." - *Misinformation*. You did no such thing, and you are a
despicable liar.


Rob Smeets wrote:


 This person is beyond a troll and has
gone to a concerted effort to spread FUD and mis-information



Petros,

I want you to take a close look at the following points I've been making
  

and


tell me which one is a misinformation.

1. Every Tapestry major release is backward incompatible with previous
releases.
2. High profile users and commiters have fled Tapestry to other
  

frameworks


such as Wicket. Namely, Kent Tong, Geoff Longman, etc. I could name some
more. Should I do it?
3. Tapestry has been ditched by Theserverside.com and replaced with
  

another


webframework.
4. In 7 years of existense of Tapestry Howard has only been able to
  

train


just a 100 Tapestry users.

What is the misinformation here, Petros?

Yours friendly,

Rob


  

On 17/04/2008, Petros Petrou <[EMAIL PROTECTED]> wrote:



I don't mean to be rude but really...
WHY DO YOU GUYS EVEN REPLY TO THIS GUY
Can't you see how much fun he is having.

By replying to a discussion he is part of, I feel I am his puppet and
  

my


job
is to keep entertaining him. This is what we are all doing by
  

reploying


to



him. I am sure I am going to get some "smart" reply from him after I

  

post



this BUT I will resist in getting dragged into a waste of time

  

discussion



because I am extremely busy writting code with one of the best web
frameworks out there and I have worked with JSP, Servlet, JSF, Struts,
Webworks, Spring WebFlow, Tapestry 3, Tapestry 4 .. (I am
considering T5 to be a new framework which is why I no longer worry

  

about



backwards compatibility)

Ple

Re: include

2008-04-16 Thread Michael Gerzabek

Hi János,

In your very first mail 2 days ago you say "I'm new to Tapestry 
technology and to this mailing list". I think though I played around 
with T5 quite some time I'm also new to it. So please don't take my word 
to be the final truth. I think there is a simple solution to your 
problem. Look into ComponentPageElement [1]. You can get it via PagePool 
that you Inject into your page.


I also suggest to look into the docs on the concepts of T5. They are 
quite well documented and VERY powerful. I say this because I realized 
that applying thinking patterns originated in the past (JSP, Struts, 
etc.) might not be as helpful in learning a new technology than reading 
and applying the actual docs are. Speaking from my own experiences here.


Regards,
Michael

[1] 
http://tapestry.formos.com/nightly/tapestry5/apidocs/org/apache/tapestry/internal/structure/ComponentPageElement.html


I would suggest before you go into in-depth application writing

Jarecsni schrieb:

And one really last thing :) I had a shallow look at wicket to check this
feature... There should be some common unconscious conceptual path here, as
wicket too misses this. All it has is an Include component to include
non-wicket (! :D) content. Why these frameworks are so much reluctant to
this? :)

J

On 16/04/2008, János Jarecsni <[EMAIL PROTECTED]> wrote:
  

One more thing... although Tapestry is component oriented (which is a
goood thing :)), this kind of flexibility (dynamic template generation)
which is available in JSP is an essential feature to be really flexible. A
templating framework should allow this level of redirection, or abstraction,
that the templates are dynamically produced driven by runtime conditions or
configuration. Otherwise we get a very intelligent and elegant HTML (in
terms of this kind of staticness). Sorry for the lengthy arguing, but I
think this issue is vital for Tapestry too (not just me :))

Cheers,
Janos

On 16/04/2008, János Jarecsni <[EMAIL PROTECTED]> wrote:


Yes, I felt this too :) However, this is no special usage scenario I
would say, just a bit different usage pattern that calls for a different
approach. As I see now, the Tapestry framework is well suited to sites,
where the user travels from Login to Browse items from there to Shopping
cart and so on. This from a.tml to b.tml from b.tml to c.tml.

This approach is somewhat clumsy when it comes to a portal-like scenario
where there is no longer a "browse items" "page" but rather the user is
manipulating components (like clicking on a voter component to show the
results or clicking on a "top 10 news" component to load one news into the
"workspace area"). Here the notion of a "page" is no longer really
meaningful. What you have is a few templates (which specify the layout and
design) and you'd like to manipulate (load and manage state of) components
dynamically.

I hope I could make my approach clear enough :)

Cheers,
Janos
  



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



Re: AW: Getting Answers on the User List

2008-04-15 Thread Michael Gerzabek

well if you don't have gmail you can also use

https://mail.google.com/support/bin/request.py?contact_type=abuse_phishing

Links to Program Policies and Terms of Use are included.

Michael

Davor Hrg schrieb:

did it :)

take a random post from rob and do it also if you have gamil acc.
all the posts are offensive more or less

https://gmail.google.com/support/bin/answer.py?answer=29381

Davor Hrg

On Tue, Apr 15, 2008 at 1:54 PM, Michael Gerzabek <[EMAIL PROTECTED]>
wrote:

  

+1

Chris Lewis schrieb:



I think it's about time we report this jackass to google or even the
FTC. Apart from being a bothersome embarrassment to humanity, he's most
likely in violation of google's terms of service as well as at least one
law.

Rob Smeets wrote:


  

Oh, Mr. Lewis Ship, so you're musical. All the musicians I know who
program
are forward thinking people and very talented. They don't go and do a
re-work after they've made a release. You've been violating even
CS101. I'm
very surprised.

Your friendly,

Rob




-
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: AW: Getting Answers on the User List

2008-04-15 Thread Michael Gerzabek

+1

Chris Lewis schrieb:

I think it's about time we report this jackass to google or even the
FTC. Apart from being a bothersome embarrassment to humanity, he's most
likely in violation of google's terms of service as well as at least one
law.

Rob Smeets wrote:
  

Oh, Mr. Lewis Ship, so you're musical. All the musicians I know who program
are forward thinking people and very talented. They don't go and do a
re-work after they've made a release. You've been violating even CS101. I'm
very surprised.

Your friendly,

Rob




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



Re: include

2008-04-14 Thread Michael Gerzabek

Then I was to fast too! ;-)

Michael Gerzabek schrieb:

Hi Janos,

Could you elaborate a little bit more on what you wanna do?

Have a look at the basic principles of T5 [1], especially Principle #1 
might be of interest for you.


Maybe you are just looking on how create dynamic layouts then go to 
the mailing list with keywords dynamic and static [2].


Not sure this helps,
Michael

[1] http://tapestry.apache.org/tapestry5/
[2] 
http://www.nabble.com/forum/Search.jtp?query=T5+static+dynamic&local=y&forum=340&daterange=0&startdate=&enddate= 




János Jarecsni schrieb:

Hi All,

I'm new to Tapestry technology and to this mailing list, and I have a
question. I'd like to "dynamically" create .TMLs... So instead of having
static pages (Start.tml, Login.tml), I'd like to construct Tapestry 
pages on
the fly (by including page parts, which are other .tmls). I've been 
looking
for some "include" component whatsoever, but found nothing. Except 
for the

PageLayout component, which does something similar, just the other way
around. Could you point me to some workaround or existing solution?

Cheers
Janos

  



-
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: include

2008-04-14 Thread Michael Gerzabek

Hi Janos,

Could you elaborate a little bit more on what you wanna do?

Have a look at the basic principles of T5 [1], especially Principle #1 
might be of interest for you.


Maybe you are just looking on how create dynamic layouts then go to the 
mailing list with keywords dynamic and static [2].


Not sure this helps,
Michael

[1] http://tapestry.apache.org/tapestry5/
[2] 
http://www.nabble.com/forum/Search.jtp?query=T5+static+dynamic&local=y&forum=340&daterange=0&startdate=&enddate=



János Jarecsni schrieb:

Hi All,

I'm new to Tapestry technology and to this mailing list, and I have a
question. I'd like to "dynamically" create .TMLs... So instead of having
static pages (Start.tml, Login.tml), I'd like to construct Tapestry pages on
the fly (by including page parts, which are other .tmls). I've been looking
for some "include" component whatsoever, but found nothing. Except for the
PageLayout component, which does something similar, just the other way
around. Could you point me to some workaround or existing solution?

Cheers
Janos

  



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



Re: AW: Getting Answers on the User List

2008-04-11 Thread Michael Gerzabek

Howard Lewis Ship schrieb:

The reality is that right now I'm sitting in an office at Formos and
every single person in the building is deriving their living directly
from Tapestry and the effort I've put into it over the last seven
years.  And that's just the company I work for; Over the last few
years, I've trained perhaps 100 developers at many different companies
on how to use Tapestry. I'm likely to double that number in the next
year ... and that's just the tiny tip of the iceberg of Tapestry users
I know about.  I'm excited about what I'm doing now, and I'm excited
about everything we have planned going forward.
  


And that's really a men with a vision. Kudos Howard!!!

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



Re: Getting Answers on the User List

2008-04-11 Thread Michael Gerzabek

A big hello and thanks to Rob!

Reading this post it came to my mind through Rob's playing the devils 
advocate here he is really improving this user-list's community.


And there are one personal experience and one common though to share 
with you.


1. Personal experience with Wicket

Long before I knew of Tapestry I was evaluating webframeworks. I came 
from cocoon, which in fact was and is a web-publishing-framework but 
back in 2000 nobody cared about that. Huge efforts where made to make it 
a webframework and doing simple webapps was a real PITA.


Through a collegue of mine I found Wicket and from reading the marketing 
stuff on their page - they where the first framework that had this 
comparison matrix online - I found it interesting and started to 
evaluate. Hello world was easy and also the demo application was quite 
interesting. When you have some experience with browser applications you 
usually have ideas on what you need and so I tried to make my first own 
Wicket app. Things got nasty, documentation was not present and my claim 
was to not follow another mailing list. Though Eclipse would help me 
with the Java part the concepts of Wicket haven't been connected with 
what I see as the basis - HTML. Finally I dropped it. The quickstart was 
to hard to take for me.


Compare this to Tapestry 5! You get 5 screencasts that speed you up in 
an instant. The maven quickstart where you immediately can start your 
own work. I was really impressed. Project Layout is well documented, the 
concept is HTML visible/ invisible instrumented, so 50% of the lease 
already payed!


Every Java programmer knows Beans and the IOC concept in 2007 is not 
new. Of course the deeper you step into the framework the more fancy 
things you have to learn. One ambivalent thing is this magical javassist 
stuff. On the one side - not sure if this is the technical reason - it 
helps you keep your code clean. I like @Property annotation because I 
see no intellectual challenge in generating getters and setters. The 
price is payed in debugging where paramters get set somehow invisible. 
Anyway, compared to Wicket or Struts and Cocoon I need the debugger in 
5% of the time I used to use it back then! Besides T5 notedly supports 
you in getting a clear cut between business and web logic so the tiers 
can be developed completely separate.


2. A common thought

One marketing problem of T5 as I see it is it's superb readyness. It 
really is easy to develop applications with it after you learned the 
basics - and that's easy too, thanks to the user-list (!) and the 
nightly-docs(!). Let me give you an example. I have a contact form for 
my webpage developed with Spring MVC. When I decided to switch to T5 I 
let it live side by side. Yesterday I decided to write the T5 version of 
it. I think it was done in 10 minutes. Ok, I of course reused the spring 
stuff through IoC. But isn't that cool to?


Back to the readiness. Because T5 is so ready, users usually do their 
thing with it. And it was said on the list some weeks before when an 
insult from Rob was shaking this list for the very first time. But think 
of it. We also have to market T5. Not only to our bosses or clients and 
programmer collegues but also in the huge webframework market. And to do 
that we need some flesh - this is the user stories.


So honestly Rob, thank you for your razor-sharp comments. Somehow you 
are able to awake us to make the next step for T5 in a bright future.


My 2 cents,
Michael

Onno Scheffers schrieb:

Take for example Kent Tong, the former Tapestry commiter. He has now even
written a book on
Wicket.



..and he has written yet another one on JSF after that. So clearly he must
not like Wicket very much :o)

  
regards,


Onno

  



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



Re: T5 Apache httpd + T5

2008-04-11 Thread Michael Gerzabek

Michael Gerzabek schrieb:


Is there a way to configure access logging like tomcat has for Jetty?
Yes, and it's easy. You click the Run > Open Run Dialog then select your 
Jetty App and select the checkbox Enable NCSA logging in the dialog.


There I found that the last rewrite rule had to be changed to

# All T5 apps have no .html, so we serve those from the
# servlet container
# .
RewriteRule "^(.*)" "http://localhost:$0"; [L,P]

Now everything works as supposed.

Regards,
Michael

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



Re: T5 Apache httpd + T5

2008-04-11 Thread Michael Gerzabek

Kevin,

the difference with that is that you pass every request to the servlet 
container. My config serves static files, like css, pictures etc. 
straight with httpd and let the fancy stuff do by the servlet container.


Thanks anyway!
Michael

Kevin Menard schrieb:

I've always used something akin to:

   ProxyRequests Off

   ProxyPass / http://host.servprise.office/

   
ProxyPassReverse /
   

I think this would be cleaner for you than using rewrite rules to your
servlet container.  Then again, I've never used a rewrite rule to proxy, so
I may just be talking out of my butt.

  



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



Re: T5 Apache httpd + T5

2008-04-11 Thread Michael Gerzabek

Mhm,

Robin Helgelin schrieb:

ProxyPassReverse / http://localhost:/
  


I assume your application is running on context root?
  

Yes it is.

Also, does tomcat logging show any difference between requests coming
from mod_proxy and requests coming directly to tomcat?
  
I use Jetty 5.1.12 within eclipse 3.3, so the only logs I see are in the 
Console window. This is where I pasted the [WARN]ing.


Is there a way to configure access logging like tomcat has for Jetty?

Thanks,
Michael


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



Re: T5 Apache httpd + T5

2008-04-11 Thread Michael Gerzabek
I use mod_proxy successfully since 8 years. In the old days I had 
troubles over troubles with mod_jk and since I learned how to use 
mod_proxy and mod_rewrite I did never re-evaluate mod_jk.


Ok, here my conf (it's local, not on the internet). This configuration 
is inspired by an old thread (2003 or so) on cocoon-dev [1]:




   ServerAdmin [EMAIL PROTECTED]

   DocumentRoot "C:/Dokumente und 
Einstellungen/indi/workspace/michaelgerzabek.com"


   Einstellungen/indi/workspace/michaelgerzabek.com">

   Options -Indexes -MultiViews
   AllowOverride None
   Order allow,deny
   Allow from all
   
  
   ###

   # ERROR PAGES CONFIGURATION   #
   ###
  
   ErrorDocument 502 /error/502.html

   ErrorDocument 404 /error/404.html
   ErrorDocument 500 /error/500.html

   ###
   # MOD_PROXY CONFIGURATIONS#
   ###

   # Make sure that if the servlet container specifies a "Location" HTTP
   # header during redirection starting with "http://localhost:8080/";, we
   # can handle it and return to our client the effective (not real)
   # location we want to redirect them to. This is _essential_ to handle
   # also the error returned by the backend servlet container.
   ProxyPassReverse / http://localhost:/

   # Make sure that the virtual host name is passed through to the
   # backend servlet container for virtual host support.
   ProxyPreserveHost On

   # Tell mod_mod proxy that it should not send back the body-content of
   # error pages, but be fascist and use its local error pages if the
   # remote HTTP stack is sending an HTTP 4xx or 5xx status code.
   ProxyErrorOverride On

   ###
   # MOD_REWRITE CONFIGURATIONS  #
   ###

   # The nastiness begins, let's fire up the "rewrite engine"
   RewriteEngine On
  
   # forbidden resources

   #--
   # Everything that starts with a NON-CASE-SENSITIVE match (the NC flag)
   # of "/WEB-INF" or "/WEB-INF/" is forbidden (the F flag). And again,
   # this is the last rule (the L flag), nothing will be processed by the
   # rewrite engine if this rule is matched
   RewriteRule "^/WEB-INF/(.*)" "$0" [L,F,NC]

   # static resources
   #--
   RewriteRule "^/$" "/index.html" [R=permanent]
   RewriteRule "^(.*)\.html" "$0" [L]
   RewriteRule "^(.*)\.css" "$0" [L]
   RewriteRule "^(.*)\.png" "$0" [L]
  
   # All T5 apps have no .html, so we serve those from the

   # servlet container
   # .
   RewriteRule "^/(.*)" "http://localhost:/$0"; [L,P]
  



[1] http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=104441321803644&w=2

Michael


Robin Helgelin schrieb:

On Fri, Apr 11, 2008 at 10:49 AM, Michael Gerzabek
<[EMAIL PROTECTED]> wrote:
  

Hi,

 I want to install T5 behind a httpd with mod_proxy and mod_rewrite. While
the configuration on http is straight forward, T5 seems to behave different
when it get's queried by httpd.



Would you mind posting your httpd configuration? Also, wouldn't you
rather run mod_jk instead of mod_proxy?

  


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



T5 Apache httpd + T5

2008-04-11 Thread Michael Gerzabek

Hi,

I want to install T5 behind a httpd with mod_proxy and mod_rewrite. 
While the configuration on http is straight forward, T5 seems to behave 
different when it get's queried by httpd.


Jetty direct URL: http://localhost:/contact
This works fine and as supposed. The contact page get's hosted by T5.

Apache URL: http://localhost:81/contact
When I use this url I get a 404, file not found, which originated at T5. 
The console logger shows the warning


[WARN] ResourceCache Alias request of 
'file:/C:/Dokumente%20und%20Einstellungen/indi/workspace/michaelgerzabek.shop.com/src/main/webapp/contact' 
for 
'file:/C:/Dokumente%20und%20Einstellungen/indi/workspace/michaelgerzabek.shop.com/src/main/webapp/contact'


What does this mean? Where is the difference? Has anyone had some 
experiences with httpd's mod_proxy and mod_rewrite?


Regards,
Michael

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



Re: T5 property file for enum

2008-04-10 Thread Michael Gerzabek

Great, Thanks!

Robert Zeigler schrieb:

You can put the labels in your application's global properties file.
See: 
http://tapestry.apache.org/tapestry5/tapestry-core/guide/localization.html 


In particular, note the section on the Application Message Catalog:

"Application Message Catalog

If the file WEB-INF/AppName.properties exists in the context, it will 
be used as an application-wide message catalog. The AppName is derived 
from the name of the filter inside the web.xml file. The search for 
the file is case sensitive. The properties file may be localized.


Individual pages and components can override the values defined in 
this message catalog."



Robert

On Apr 10, 2008, at 4/104:10 AM , Michael Gerzabek wrote:

Hi,

I love the new enum support for automagic selects. Thanks for that 
Howard!


I have shifted many constants to enums. The arising question is how 
to prepare Messages to those enums in most convenient way.


At the time I use one property file per Page. When I have an enum 
display a select on that Page I customize labels for the distinct 
enum values in that property file. Having the same enum on different 
Pages I ran into the usual copy'n paste practice.


Is there a way to customize labels for enums in only one file per 
locale so that those properties get read whenever the enum is used on 
a Page?


What are your best practices?

Regards,
Michael

-
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 property file for enum

2008-04-10 Thread Michael Gerzabek

sure, how could I forget.

Thanks!

nille hammer schrieb:

Hello Michael,

there is an application wide properties file which is accessable by every page and 
component within your application. It is located in  WEB-INF/.properties. 
 depends on the filter name you have chosen for the tapestry filter. As one 
usually does not change that, this would be per default WEB-INF/app.properties. If you have 
the same keys in app.properties and a specific Page.properties the value for the more 
specific page.properties is used. The app.properties feature is documented in a short 
paragraph (likely to be overread) on the following page of Tapestry 5 Manual 
(http://tapestry.apache.org/tapestry5/tapestry-core/guide/localization.html)

Cheers, nillehammer

- original Nachricht 

Betreff: T5 property file for enum
Gesendet: Do, 10. Apr 2008
Von: Michael Gerzabek<[EMAIL PROTECTED]>

  

Hi,

I love the new enum support for automagic selects. Thanks for that Howard!

I have shifted many constants to enums. The arising question is how to 
prepare Messages to those enums in most convenient way.


At the time I use one property file per Page. When I have an enum 
display a select on that Page I customize labels for the distinct enum 
values in that property file. Having the same enum on different Pages I 
ran into the usual copy'n paste practice.


Is there a way to customize labels for enums in only one file per locale 
so that those properties get read whenever the enum is used on a Page?


What are your best practices?

Regards,
Michael

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





--- original Nachricht Ende 


-
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 property file for enum

2008-04-10 Thread Michael Gerzabek

Hi,

I love the new enum support for automagic selects. Thanks for that Howard!

I have shifted many constants to enums. The arising question is how to 
prepare Messages to those enums in most convenient way.


At the time I use one property file per Page. When I have an enum 
display a select on that Page I customize labels for the distinct enum 
values in that property file. Having the same enum on different Pages I 
ran into the usual copy'n paste practice.


Is there a way to customize labels for enums in only one file per locale 
so that those properties get read whenever the enum is used on a Page?


What are your best practices?

Regards,
Michael

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



Re: T5.0.11 beanEditForm

2008-04-08 Thread Michael Gerzabek

Hi Natia,

I'm not an expert here but learning on my own.

It looks like T5 complains about the constructor of Celebrity. If you 
only use the default constructor your classes work.


I did it that way:

public class AddCelebrity {
  
   @Persist

   private Celebrity celebrity;
  
   @Inject
   private BeanModelSource _beanModelSource; // to get rid of 
attributes not needed
  
   @Inject

   private ComponentResources _resources; // to get hold of custom labels
  
   @Retain
   private BeanModel _model; // to transport it to the 
beaneditform


   void pageLoaded() {

   _model = _beanModelSource.create( Celebrity.class, true, 
_resources );

   _model.exclude( "id" ); // don't show the id column
   }
   public BeanModel getModel() {

   return _model;
   }
   public Celebrity getCelebrity() {
   return celebrity;
   }

   public void setCelebrity( Celebrity celebrity ) {
   this.celebrity = celebrity;
   }

}

Regards,
Michael

Gdzelishvili schrieb:

Can anyone help?

On Mon, Apr 7, 2008 at 1:09 PM, Natia Gdzelishvili <[EMAIL PROTECTED]>
wrote:

  

I  am using beanedit form, i have a simple code

AddCelebrity.tml


AddCelebrity.java
public class AddCelebrity {
@Persist
private Celebrity celebrity;

public Celebrity getCelebrity() {
return celebrity;
}

public void setCelebrity(Celebrity celebrity) {
this.celebrity = celebrity;
}

}

Celebrity.java
public class Celebrity {
private long id;
private String firstName;
private String lastName;
private Date dateOfBirth;
private Occupation occupation;
private String biography;
private boolean birthDateVerified;

public Celebrity() {
}

public Celebrity(String firstName, String lastName,Date dateOfBirth,
Occupation occupation) {
this.firstName = firstName;
this.lastName = lastName;
this.dateOfBirth = Formats.parseDate("12/02/1981");
this.occupation = occupation;
}

setter and getter methods
}

I  was using tapestry 5.0.10 everything worked fine, but when I upgraded
application to 5.0.11 I'm getting error:

org.apache.tapestry.internal.services.RenderQueueException Render queue
error in SetupRender[AddCelebrity:celebrity.editor]: Exception instantiating
instance of ge.bog.celebrities.entity.Celebrity (for component
'AddCelebrity:celebrity.editor'): Error invoking constructor
ge.bog.celebrities.entity.Celebrity(String, String, Date, Occupation) (at
Celebrity.java:35) (for service 'BeanModelSource'): No service implements
the interface java.util.Date.
...
java.lang.RuntimeException No service implements the interface
java.util.Date.
..

Please help
thank in advance






  



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



Re: 答复: from T5.0.11 to T5.0.6

2008-04-08 Thread Michael Gerzabek
Natia Gdzelishvili schrieb:
> can anyone help..
>   
Try this:

1. *Use T5.0.11*, it's the latest stable release, also voted beta from
dev team. There is not a single reason why you would use 5.0.6. You even
can continue using the book. There are only very few things that changed
from 5.0.6 to 5.0.11. You can find those things when you double check
the release notes [1] that are on the T5 homepage and the upgrade notes
[2] that are on the nightly builds website. Sounds a lot read but is
really fast forward.

2. use the extension .tml for your template files
3. put your templates either on your context root, which is
YOUR_PROJECT/src/main/webapp if you used the maven archetype, or put
them into your resources package, which is
YOUR_PROJECT/src/main/resources/YOUR_JAVA_PACKAGE/PAGENAME.tml. The
preferred option is to put your templates in your resources section.
More info on this can be found in the online documentation in the
section project layout [3].
4. restart jetty

now everything should be fine.
Regards,
Michael

[1] http://tapestry.apache.org/tapestry5/release-notes.html
[2] http://tapestry.formos.com/nightly/tapestry5/tapestry-core/upgrade.html
[3]
http://tapestry.formos.com/nightly/tapestry5/tapestry-core/guide/project-layout.html


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



Re: [T5] Tapestry evaluation + questions

2008-03-31 Thread Michael Gerzabek

Hi Rob or however you are!

Nice to see you spicing up this list ;)

Your comments are always very thoughtful so everybody on this list can 
feel how you from your deepest heart care about people on this list as 
well as the evolution of Tapestry. Thank you for your invaluable 
contribution!


Reading your answer to Andys post one thing came to my mind and I really 
would appreciate you answering my question:


Did you realize that Andy asked very concise questions?

He didn't ask should I or should I not use Tapestry but in fact he was 
going well beyond the surface. If you'd the mental elasticity to surpass 
your innate denial of Tapestry and come up with concrete answers to 
concrete questions I would even like your posts more.


Regards,
Michael

Rob Smeets schrieb:

Hi Andy,

Be wise and dig around the Internet to find answers to your questions and
don't turn to this list since they won't offer you a non-biased answers. For
a starter go to theserverside.com where recently a discussion  was held on
Tapestry. The link is:
http://www.theserverside.com/news/thread.tss?thread_id=48743

Personally, I won't advise you to go with Tapestry due to it's bad record on
backward compatibility.

Rob

On Sat, Mar 29, 2008 at 11:44 AM, Andy Blower <[EMAIL PROTECTED]>
wrote:

  

Hi there, I'm evaluating Tapestry (among others) for the web framework
we'll
use at my company for the next 5 years or so. We've used Struts 1 for the
last 5-6 years and it's served us well, even if it was higher maintenance
than was first apparent. I have spent over two days reading about Tapestry
history and general thoughts about past and future which has proved rather
distracting. I'm really not sure whether I should evaluate 4.1 or 5
because
the documentation and intro/tutorial material isn't ready yet for 5 and
I'm
completely new to component oriented frameworks. If I evaluated 4.1, would
that be valid for us still to go on to use 5? It's really hard to get a
handle on the differences of two things you don't yet understand!

I have three (more specific) questions:

1) What methods are known for implementing webpage templates in Tapestry
(e.g. banner, nav, sidebar, content, footer) and is there one considered
'best practice'?

2) How easy is it to add custom AJAX interactions? I'm thinking of
interactions like checking a checkbox to mark a search result, return
success and visually change the appearance.

3) Is it practical to have base classes containing common functionality,
which are extended by very terse page classes along with actual page
templates or am I thinking about this wrong?

With the only T5 examples being so trivial, it's really hard to get a
bigger
picture view at the moment, but I am very intrigued.
--
View this message in context:
http://www.nabble.com/-T5--Tapestry-evaluation-%2B-questions-tp16368331p16368331.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]





  



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



T5 acquire block from separate page [was: Re: Antwort: [T5] Dynamic Layouts]]

2008-03-03 Thread Michael Gerzabek

Hi Robert,

You clearly outlined the simple case. I'm interested in the 2nd case: The
name of my block/ component is read from the database and I have to acquire
the block/ component from another page (where the name could also be in the
database).

I found Howards repy to an earlier thread [1]. This was back in May 07. The
result then was mainly what's written in the docs [2] about the delegate
component. 

Is there a way to dynamically load a page/ component/ block today?

Thanks!
Michael

[1] T5: Best practice for rendering a dynamic component
http://www.nabble.com/T5%3A-Best-practice-for-rendering-a-dynamic-component-to10765577.html#a10775220
[2] org.apache.tapestry.corelib.components.Delegate
http://tapestry.formos.com/nightly/tapestry5/tapestry-core/ref/org/apache/tapestry/corelib/components/Delegate.html


Robert Zeigler wrote:
> 
> 
> ...
> 
> 
> 
> ...
> 
> 
> And your getLayoutComponent() method would look something like:
> public Object getLayoutComponent() {
>return _componentResources.getBlock(_layout);
> } 
> That's the simple case.  For the more complicated case of pluggable  
> layouts, you can play the same game, except that you would acquire the  
> blocks not from the current component template, but from some other  
> page (which is, in fact, legal. :)
> 
> 

-- 
View this message in context: 
http://www.nabble.com/-T5--Dynamic-Layouts--tp13707415p15799919.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]



Re: T5: BeanEditForm doesn't pick up .properties

2008-02-02 Thread Michael Gerzabek
Ok, finally I found it: Months ago I was playing around with the Label 
component. I found [1] and did a little rewrite to be able to put labels 
directly in my .tml files. Now 3 months later restarting the project I 
forgot about that.


So sorry for the noise!
Michael

[1] http://www.nabble.com/-T5--Label-tf4618003.html

Michael Gerzabek schrieb:
Ok. I packed the sources. But before I sent them I wanted to try it 
one more time on my own. I generated new .project and .classpath files 
with maven (2.0.8), created a new project in eclipse (3.2) imported 
the project built it and ...


... all the labels where there! So actually now I have what I think 2 
projects that should be the same. But they aren't. Is it possible that 
moving from T5.0.4 where I started the application some months ago to 
T5.0.9 within the same codebase is not free of side effects?


I'm switching now to the 'new' codebase and continue my work there. 
But ...???


Howard Lewis Ship schrieb:

Something odd is going on, because there are specific tests for this
stuff so I know it works in the code.  Without seeing all the code and
the full layout, there's no much more I can do.  If you can provide a
zipped up Maven project to demonstate the problem, I'm sure I can whip
up a fix.

On Feb 1, 2008 2:26 PM, Michael Gerzabek <[EMAIL PROTECTED]> 
wrote:
 

Howard Lewis Ship schrieb:
   

Havning trouble following you ... what is the name, location and
contents of your .properties file?

Does the expansion work or not work?

  

No!

the layout like in maven archetype (both get packaged):
  |
  +- JAVA/.../pages/prm/Contact.java
  +- RESOURCES/.../pages/prm/Contact.properties
  :
  /src/main/webapp/prm/Contact.tml

the contents:
-- Contact.tml --
http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>

  
Person


${person.firstName} ${person.lastName}

back to 
people





-- Contact.java --
...
METHOD-BREAKPOINT HERE:
  void pageLoaded() {

_model = _beanModelSource.create( Person.class, true, 
_resources

);
_model.remove( "id" );
_model.remove( "added" );
_model.remove( "updated" );
_model.remove( "dayOfBirth" );
_model.remove( "monthOfBirth" );
_model.remove( "affiliate" );
_model.remove( "owner" );
}
...

-- Contact.properties --
title-label=Titel/Anrede
firstName-label=Vorname
lastName-label=Familienname
middleName-label=Weitere Vornamen
eMail-label=E-Mail-Adresse
birthDay-label=Geburtstag
mobile-label=Mobiltelefon
phone-label=Telefon
fax-label=FAX
site-label=Website
pictureURL-label=Link zu Bild

As I said, when I debug the resources get picked up. But in the page
they are not expanded.

Michael


-
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: BeanEditForm doesn't pick up .properties

2008-02-02 Thread Michael Gerzabek
Ok. I packed the sources. But before I sent them I wanted to try it one 
more time on my own. I generated new .project and .classpath files with 
maven (2.0.8), created a new project in eclipse (3.2) imported the 
project built it and ...


... all the labels where there! So actually now I have what I think 2 
projects that should be the same. But they aren't. Is it possible that 
moving from T5.0.4 where I started the application some months ago to 
T5.0.9 within the same codebase is not free of side effects?


I'm switching now to the 'new' codebase and continue my work there. But 
...???


Howard Lewis Ship schrieb:

Something odd is going on, because there are specific tests for this
stuff so I know it works in the code.  Without seeing all the code and
the full layout, there's no much more I can do.  If you can provide a
zipped up Maven project to demonstate the problem, I'm sure I can whip
up a fix.

On Feb 1, 2008 2:26 PM, Michael Gerzabek <[EMAIL PROTECTED]> wrote:
  

Howard Lewis Ship schrieb:


Havning trouble following you ... what is the name, location and
contents of your .properties file?

Does the expansion work or not work?

  

No!

the layout like in maven archetype (both get packaged):
  |
  +- JAVA/.../pages/prm/Contact.java
  +- RESOURCES/.../pages/prm/Contact.properties
  :
  /src/main/webapp/prm/Contact.tml

the contents:
-- Contact.tml --
http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>

  
Person


${person.firstName} ${person.lastName}

back to people




-- Contact.java --
...
METHOD-BREAKPOINT HERE:
  void pageLoaded() {

_model = _beanModelSource.create( Person.class, true, _resources
);
_model.remove( "id" );
_model.remove( "added" );
_model.remove( "updated" );
_model.remove( "dayOfBirth" );
_model.remove( "monthOfBirth" );
_model.remove( "affiliate" );
_model.remove( "owner" );
}
...

-- Contact.properties --
title-label=Titel/Anrede
firstName-label=Vorname
lastName-label=Familienname
middleName-label=Weitere Vornamen
eMail-label=E-Mail-Adresse
birthDay-label=Geburtstag
mobile-label=Mobiltelefon
phone-label=Telefon
fax-label=FAX
site-label=Website
pictureURL-label=Link zu Bild

As I said, when I debug the resources get picked up. But in the page
they are not expanded.

Michael


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



  1   2   >