RE: spring T5 integration on acegi security considerations

2008-10-07 Thread Jonathan Barker

Please note that Spring Security is the successor to Acegi Security.  My
experience is with Acegi but you should probably invest the time in learning
Spring Security.  They have definitely changed how they configure things.

With my old T4 apps, using Acegi configured via Spring, but also using my
own custom components (one of which behaved like IfRole) I had this in my
web.xml:



Acegi Filter Chain Proxy

org.acegisecurity.util.FilterToBeanProxy

targetClass

org.acegisecurity.util.FilterChainProxy



Acegi Filter Chain Proxy
/*


That was before my OpenSessionInView filter for Hibernate.  There was also a
listener:



org.acegisecurity.ui.session.HttpSessionEventPublisher



In my applicationContext-acegi.xml file, I had:




CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
PATTERN_TYPE_APACHE_ANT

/**=httpSessionContextIntegrationFilter,httpRequestIntegrationFilter




   

   

   

As well as configurations for AuthenticationProvider.

All of that configuration goes away if you use tapestry5-acegi, or to be
more accurate, most of what you need is already set up in the SecurityModule
class.  Things like the HttpSessionContextIntegrationFilter were re-written
to fit into the Tapestry processing pipeline.  Take a look at the source for
SecurityModule.


If you still want to set it up through Spring, then make sure your
FilterToBeanProxy is defined before your TapestrySpringFilter.



> -Original Message-
> From: wesley [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, October 08, 2008 00:06
> To: users@tapestry.apache.org
> Subject: RE: spring T5 integration on acegi security considerations
> 
> 
> hi jon,
> 
> since i'm integrating the spring as back end and front end as T5, the
> filter
> that i'm using is TapestrySpringFilter as outline by the wiki from t5
> homepage.
> 
> "For access to pages, you either configure a filter through Spring, or
> through annotations, or through tapestry-ioc configuration.  The filters
> will invoke the necessary authentication and authorization functions."
> 
> as outline, i'm using tapestryspringfilter; with filter that accept filter
> mapping of url pattern of /*. is there gonna be a same configuration on
> this
> filter as well? please advise and thanks
> 
> regards,
> wesley
> 
> 
> 
> Jonathan Barker wrote:
> >
> > Wesley,
> >
> > I would rather spend two hours figuring out how to use a well thought
> out
> > /
> > designed / tested tool that will pay off in the long haul than spend one
> > hour doing a one-off solution to an immediate problem.  I didn't save
> time
> > the first time I used Acegi, but I really do save time now.
> >
> > Acegi is like a well equipped toolbox.
> >
> > For password encryption, Acegi provides several classes that implement
> the
> > PasswordEncoder interface.  These include PlaintextPasswordEncoder,
> > MessageDigestPAsswordEncoder, Md5PasswordEncoder, and a few others.  You
> > would pick one of these and use it to configure your UserDetailsService,
> > and
> > you can also use it directly to encode a password to store for yourself.
> >
> > You frequently want to use a password Salt, so there is a
> > SystemWideSaltSource where everyone gets the same salt, or a
> > ReflectionSaltSource that can read a property that you would store with
> > your
> > User record.  You would configure your UserDetailsService to use a Salt
> > source.
> >
> > For access to pages, you either configure a filter through Spring, or
> > through annotations, or through tapestry-ioc configuration.  The filters
> > will invoke the necessary authentication and authorization functions.
> >
> > You don't generally override authenticate(), because you would use one
> of
> > the dozen implementations of the AuthenticationProvider interface that
> > ship
> > with Acegi.  I typically use the LDAPAuthenticationProvider and the
> > DaoAuthenticationProvider.  Of course, each of these needs to be
> > configured
> > somehow.  For example, you need to have a UserDetailsService configured
> > for
> > the DaoAuthenticationProvider.
> >
> > Jonathan
> >
> >
> >
> >
> >> -Original Message-
> >> From: wesley [mailto:[EMAIL PROTECTED]
> >> Sent: Monday, October 06, 2008 12:54
> >> To: users@tapestry.apache.org
> >> Subject: RE: spring T5 integration on acegi security considerations
> >>
> >>
> >> hi Jon,
> >>
> >> thanks much for the feedback, i assumed acegi will do all hard
> >> work/encapsulate those like password encryption login and other
> >> unauthorized
> >> access to the pages? because with normal implementation, i need to do
> one
> >> way encrypt myself to authenticate user for example. does acegi do
> that?,
> >> i
> >> mean the authenticate method

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

2008-10-07 Thread Jonathan Barker

I hit that once, but I can't remember what caused it.

Have you made sure that you don't have multiple copies of the library in
your classpath?

Can you post your AppModule?


> -Original Message-
> From: Thiago H. de Paula Figueiredo [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, October 07, 2008 23:16
> To: Tapestry users
> Subject: [T5] Alias building recursion exception when using tapetry-
> spring-security
> 
> 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(AuthenticationManag
> er,
> 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.contributeAl
> ias(SaltSourceService,
> AuthenticationProcessingFilter, Configuration): Error building service
> proxy for service 'RealAuthenticationProcessingFilter' (at
> nu.localhost.tapestry5.springsecurity.services.SecurityModule.buildRealAut
> henticationProcessingFilter(AuthenticationManager,
> RememberMeServices, String, String, String) (at SecurityModule.java:247)):
> Error invoking service builder method
> nu.localhost.tapestry5.springsecurity.services.SecurityModule.buildRealAut
> henticationProcessingFilter(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 contr

Re: Scalability of T5 : Form Wizard options

2008-10-07 Thread Renat Zubairov
Hello John,


>>
>> In this case, you wouldn't use the page activation context, as you're
>> filling the page properties yourself. As Tapestry uses redirect-after-post
>> by default (and not using it can lead to several problems), you would need
>> to @Persist("flash") the property in all pages. The single giant ASO would
>> be a better fit instead of this.
>>
>
> thanks for correction.  But the single giant ASO would not be scalable for
> us as there will tens of thousands of concurrent users.
>

You can off course disable redirect-after-post and track resubmissions
with different mechanism. In theory one could generally think about
storing data on the client side, i.e. in the hidden form fields or in
the URL. Please note that when discussing the solution we are
generally speaking of limitations/features of the Web applications in
general, you would have the same issues wherever web application you
would have, i.e. T5, Spring Web Flow, JSW, Ruby on Rails of PHP.
Stateless nature of HTTP communication is the reason, not the
technology in use.

IMHO heavy session state is generally not good, due to the overhead of
session state replication in the cluster nodes, however some load
balancing techniques (e.g. sticky sessions) could be a acceptable
solution.

In case user state is not stored in the session then it should be
stored somewhere else - e.g. on the user side. It means that you could
either encode the state in the URL (and keep in mind the limitations
of the URL length). Other possibility is hidden form and POST. You can
use/extend the Form tag to encapsulate additional fields that will
store the user state (I'm quite sure this functionality is already
exists in T5).

So basically it's only a question where to store user state - on
server (HTTP Session) or on client (and transfer it with every
GET/POST request). Server solution is considered to be not scalable
enough. However client solution is also not free from problems. For
example let's imagine we have 500 kb of the user state. In case we
will store in on client it will be attached to every client request,
so request size will really increase. What will also be increased is
the request processing time because any data sent from the client can
not be trusted, therefore apart from network latency and
deserialization time we need to consider validation/decryption
overhead. The server-side solution will generally work faster due to
the fact that most of the clusters have gigabit ethernet between nodes
:) and server-side data is protected. Some solutions like sticky
sessions will minimize the whatsoever overhead we will have.

Another good question is what is stored in the session. And here we
come to the point where development framework makes huge difference.
Tapestry have "Static structure - dynamic behavior" principle which
leads to some limitations (e.g. can't create components runtime),
however it's a huge advantage which heavily limit the HTTP Session
usage. With T5 one can write a stateless applications - i.e. HTTP
session is not used at all. Try it with JSF :)

P,S, Sorry for the long post.
-- 
Best regards,
Renat Zubairov

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



can T5 do contract first web service

2008-10-07 Thread wesley

hi all,

just wondered whether T5 can offer contract first web services like spring
2? from what i look up on the help pages, there isn't any topic on it except
Hivemind from the previous T4. any idea?

thanks
wesley
-- 
View this message in context: 
http://n2.nabble.com/can-T5-do-contract-first-web-service-tp1305736p1305736.html
Sent from the Tapestry Users mailing list archive at Nabble.com.


-
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

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: spring T5 integration on acegi security considerations

2008-10-07 Thread wesley

hi jon,

since i'm integrating the spring as back end and front end as T5, the filter
that i'm using is TapestrySpringFilter as outline by the wiki from t5
homepage.

"For access to pages, you either configure a filter through Spring, or
through annotations, or through tapestry-ioc configuration.  The filters
will invoke the necessary authentication and authorization functions."

as outline, i'm using tapestryspringfilter; with filter that accept filter
mapping of url pattern of /*. is there gonna be a same configuration on this
filter as well? please advise and thanks

regards,
wesley



Jonathan Barker wrote:
> 
> Wesley,
> 
> I would rather spend two hours figuring out how to use a well thought out
> /
> designed / tested tool that will pay off in the long haul than spend one
> hour doing a one-off solution to an immediate problem.  I didn't save time
> the first time I used Acegi, but I really do save time now.
> 
> Acegi is like a well equipped toolbox. 
> 
> For password encryption, Acegi provides several classes that implement the
> PasswordEncoder interface.  These include PlaintextPasswordEncoder,
> MessageDigestPAsswordEncoder, Md5PasswordEncoder, and a few others.  You
> would pick one of these and use it to configure your UserDetailsService,
> and
> you can also use it directly to encode a password to store for yourself.
> 
> You frequently want to use a password Salt, so there is a
> SystemWideSaltSource where everyone gets the same salt, or a
> ReflectionSaltSource that can read a property that you would store with
> your
> User record.  You would configure your UserDetailsService to use a Salt
> source.
> 
> For access to pages, you either configure a filter through Spring, or
> through annotations, or through tapestry-ioc configuration.  The filters
> will invoke the necessary authentication and authorization functions.
> 
> You don't generally override authenticate(), because you would use one of
> the dozen implementations of the AuthenticationProvider interface that
> ship
> with Acegi.  I typically use the LDAPAuthenticationProvider and the
> DaoAuthenticationProvider.  Of course, each of these needs to be
> configured
> somehow.  For example, you need to have a UserDetailsService configured
> for
> the DaoAuthenticationProvider.
> 
> Jonathan
> 
> 
> 
> 
>> -Original Message-
>> From: wesley [mailto:[EMAIL PROTECTED]
>> Sent: Monday, October 06, 2008 12:54
>> To: users@tapestry.apache.org
>> Subject: RE: spring T5 integration on acegi security considerations
>> 
>> 
>> hi Jon,
>> 
>> thanks much for the feedback, i assumed acegi will do all hard
>> work/encapsulate those like password encryption login and other
>> unauthorized
>> access to the pages? because with normal implementation, i need to do one
>> way encrypt myself to authenticate user for example. does acegi do that?,
>> i
>> mean the authenticate method; do i need to override it myself for
>> encryption
>> purposes? please advise, thanks
>> 
>> wesley
>> 
>> 
>> 
>> Jonathan Barker wrote:
>> >
>> >
>> > I remember going through the Acegi documentation the first time.  It
>> was
>> > daunting.
>> >
>> > In hindsight, it boils down to this:
>> >
>> > The central object in Acegi is the SecurityContext.  You need to store
>> and
>> > retrieve it from your HttpSession and that is done either through a
>> filter
>> > configured in web.xml (for a Spring-configured scenario), or as a part
>> of
>> > a
>> > Tapestry filter chain (for tapestry5-acegi).
>> >
>> > You need to configure at least one AuthenticationProvider using a
>> > UserDetailsService, and pass it to the AuthenticationManager.  I like
>> the
>> > InMemoryDaoImpl as the UserDetailsService for initial development, and
>> a
>> > way
>> > of embedding special administrative accounts.  Don't waste time reading
>> > about all of the options for this service.  Know that later you can add
>> > additional AuthenticationProviders to have multiple authentication
>> > methods.
>> >
>> > The AuthenticationProvider can be invoked manually (by injecting it
>> into
>> > your page, and calling methods like authenticate()), or via a specific
>> jsp
>> > page.
>> >
>> > For example, and this can be handy for testing, you can do this:
>> >
>> >@Inject
>> >private AuthenticationManager _authenticationManager;
>> >
>> > ...
>> >
>> >UsernamePasswordAuthenticationToken authRequest =
>> >new
>> > UsernamePasswordAuthenticationToken(_username,_password);
>> >Authentication authResult;
>> >
>> >try {
>> >System.out.println("username:" + _username + "
>> > password: " + _password);
>> >authResult =
>> > _authenticationManager.authenticate(authRequest);
>> >logger.info("successful login for: " + _username);
>> >} catch (BadCredentialsException failed) {
>> >_form.recordError(_passwordField, "Invalid username
>> > or password");
>> >  

Re: Tapestry 5 : The requested resource (/login) is not available. error in Tomcat

2008-10-07 Thread LakshithaS

Yeah,, I also thought that, I will contact them and find out about their
supporting Tapestry and all. Actually they only mention the Tomcat server
and JSP/Servlet support. So better to check the server logs also, ill check
with them

Thank you all for your ideas :)

Cheers


Daniel Jue wrote:
> 
> Some hosting companies that allow you to run servlets do not allow/don't
> give you resources for using higher end web frameworks, such as Tapestry,
> Spring, etc.  Some explicitly forbid apps that use Hibernate.  In these
> cases, you are stuck with very basic JSPs.
> 
> You may want to check and make sure they are giving you enough RAM, etc.
> 
> 
> On Tue, Oct 7, 2008 at 10:04 AM, Thiago H. de Paula Figueiredo <
> [EMAIL PROTECTED]> wrote:
> 
>> Em Tue, 07 Oct 2008 11:00:29 -0300, LakshithaS <[EMAIL PROTECTED]>
>> escreveu:
>>
>>  HTTP Status 404 - /login
>>>
>>> type Status report
>>>
>>> message /login
>>>
>>> description The requested resource (/login) is not available.
>>> Apache Tomcat/5.0.27
>>>
>>
>> Check your logs. It looks like your application was not started
>> successfully.
>>
>> --
>> Thiago H. de Paula Figueiredo
>> Independent Java consultant, developer, and instructor
>> Consultor, desenvolvedor e instrutor em Java
>> http://www.arsmachina.com.br/thiago
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Tapestry-5-%3A-The-requested-resource-%28-login%29-is-not-available.-error-in-Tomcat-tp19858735p19871884.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



[T5] Alias building recursion exception when using tapetry-spring-security

2008-10-07 Thread Thiago H. de Paula Figueiredo

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) (at SecurityModule.java:247)):  
Error invoking service builder method

t5: PageActivationContext and error handling?

2008-10-07 Thread Angelo Chen

Hi,

I have following class, it works, but how to handle errors like:

1. user pass a wrong usr ID: http://localhost/info/11
2. without passing id : http://localhost/info

Is there a way to use @PactActivationContext to save coding and yet can
still handle errors like the above? Thanks,

Angelo

public class Info {

@PageActivationContext
@Property
private Usr usr;

}


-- 
View this message in context: 
http://www.nabble.com/t5%3A-PageActivationContext-and-error-handling--tp19871376p19871376.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: Scalability of T5 : Form Wizard options

2008-10-07 Thread John Jimmy Dondapati
On Tue, Oct 7, 2008 at 7:11 PM, Thiago H. de Paula Figueiredo <
[EMAIL PROTECTED]> wrote:

> Em Tue, 07 Oct 2008 18:23:05 -0300, John Jimmy Dondapati <
> [EMAIL PROTECTED]> escreveu:
>
>  Here are the options with T5 (from what we could dig up) :
>>   2. Pass on the Request object between the Pages using
>>
>> Page1.java
>> Object onSubmitFromForm()
>> {
>> nextPage.setRequestObject(this.requestObject());
>> return nextPage;
>> }
>>
>
> In this case, you wouldn't use the page activation context, as you're
> filling the page properties yourself. As Tapestry uses redirect-after-post
> by default (and not using it can lead to several problems), you would need
> to @Persist("flash") the property in all pages. The single giant ASO would
> be a better fit instead of this.
>

thanks for correction.  But the single giant ASO would not be scalable for
us as there will tens of thousands of concurrent users.

>
>
>  It looks like I cannot pass my custom Classes (requestObjects) this way.
>> Are only the built-in datatype classes allowed for OnActivate() and
>> OnPassivate() e.g. String or Long ?
>>
>
> You can use String[] and List as well.
>

Cool. didnt know that.

>
>
>  We dont know if any of these would work for us coz we are looking at min
>> 10k concurrent users for this form wizard when it goes up. Are we missing
>> some other approach. Please advise. Thanks!
>>
>
> Could you use the middle ground solution of storing a temporary object in a
> database at each page, reloading it at each page and only storing the object
> in the right table in the end of the wizard? You trade database
> communication and processing for per-user memory consumption.
>

We thought about this too. But we have messaging (Webspher MQ) in the middle
and accessing the data zone for every page is gonna be really messy. I
guess, we cant have it all our way.



>
> In any case, huge forms are always a pain and I try to avoid them as much
> as I can.
>

Yes, its a real big pain. But I hear that JSF with SWF ( Spring Web Flow )
addresses all these concerns somehow. I wish Tapestry would also come up
with some components to make the wizard flow easier. This is the only major
concern for us in deciding whether or not to use tapestry in the production.
I guess we will have to wait for a while.

Any ideas on how Tapestry is compared to SWF (in regard to managing the
state)?


> --
> Thiago H. de Paula Figueiredo
> Independent Java consultant, developer, and instructor
> Consultor, desenvolvedor e instrutor em Java
> http://www.arsmachina.com.br/thiago
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Cheers,
John


Re: Scalability of T5 : Form Wizard options

2008-10-07 Thread Thiago H. de Paula Figueiredo
Em Tue, 07 Oct 2008 18:23:05 -0300, John Jimmy Dondapati  
<[EMAIL PROTECTED]> escreveu:



Here are the options with T5 (from what we could dig up) :
   2. Pass on the Request object between the Pages using

Page1.java
Object onSubmitFromForm()
{
nextPage.setRequestObject(this.requestObject());
return nextPage;
}


In this case, you wouldn't use the page activation context, as you're  
filling the page properties yourself. As Tapestry uses redirect-after-post  
by default (and not using it can lead to several problems), you would need  
to @Persist("flash") the property in all pages. The single giant ASO would  
be a better fit instead of this.



It looks like I cannot pass my custom Classes (requestObjects) this way.
Are only the built-in datatype classes allowed for OnActivate() and
OnPassivate() e.g. String or Long ?


You can use String[] and List as well.

We dont know if any of these would work for us coz we are looking at min  
10k concurrent users for this form wizard when it goes up. Are we  
missing some other approach. Please advise. Thanks!


Could you use the middle ground solution of storing a temporary object in  
a database at each page, reloading it at each page and only storing the  
object in the right table in the end of the wizard? You trade database  
communication and processing for per-user memory consumption.


In any case, huge forms are always a pain and I try to avoid them as much  
as I can.


--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
Consultor, desenvolvedor e instrutor em Java
http://www.arsmachina.com.br/thiago

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



Re: T5: How to use Quartz with T5?

2008-10-07 Thread Angelo Chen

would like to use it, how to specify chenillekit dependency in maven?



Sven Homburg wrote:
> 
> for dependencies look here
> 
> http://www.chenillekit.org/chenillekit-quartz/dependencies.html
> 
> there is no sample code, the project is in an early stage,
> 
> but working under production in 2 customer projects
> 
> 2008/10/7 Angelo Chen <[EMAIL PROTECTED]>
> 
>>
>> Thanks for the fast reply, does the Quartz module depends on some other
>> modules in the chenillekit? is there any sample project that I can try it
>> out? pom.xml will be a big help. thanks.
>>
>> Angelo
>>
>> Sven Homburg wrote:
>> >
>> > perhaps it helps you
>> >
>> > http://www.chenillekit.org/chenillekit-quartz/index.html
>> >
>> > 2008/10/7 Angelo Chen <[EMAIL PROTECTED]>
>> >
>> >>
>> >> Hi,
>> >>
>> >> I'm trying to use Quarts for some scheduled tasks and I'd like to make
>> it
>> >> a
>> >> service, at end is my simple code, AnnounceSchedulerImpl is the
>> service,
>> >>
>> >> in the AppModule I add:
>> >>
>> >> binder.bind(AnnouceScheduler.class, AnnouceSchedulerImpl.class);
>> >>
>> >> but when run the IOC will not be started, commenting out the sf = new
>> >> StdSchedulerFactory() will allow IOC to be started, any idea what I'm
>> >> missing here? Thanks.
>> >>
>> >> Angelo
>> >> p.s. any idea how to use Quartz will be welcome.
>> >>
>> >>
>> >> public class AnnouceSchedulerImpl implements AnnouceScheduler {
>> >>
>> >>final private Logger logger;
>> >>private SchedulerFactory sf;
>> >>
>> >>public AnnouceSchedulerImpl(Logger logger) {
>> >>this.logger = logger;
>> >>sf = new StdSchedulerFactory();
>> >>}
>> >>
>> >>public void addJob(JobDetail job) throws SchedulerException {
>> >>
>> >>}
>> >> }
>> >>
>> >>
>> >>
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/T5%3A-How-to-use-Quartz-with-T5--tp19859317p19859317.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]
>> >>
>> >>
>> >
>> >
>> > --
>> > with regards
>> > Sven Homburg
>> > http://www.chenillekit.org
>> > http://tapestry5-components.googlecode.com
>> >
>> >
>> > -
>> > best regards
>> > Sven
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/T5%3A-How-to-use-Quartz-with-T5--tp19859317p19859941.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]
>>
>>
> 
> 
> -- 
> with regards
> Sven Homburg
> http://www.chenillekit.org
> http://tapestry5-components.googlecode.com
> 
> 
> -
> best regards
> Sven
> 

-- 
View this message in context: 
http://www.nabble.com/T5%3A-How-to-use-Quartz-with-T5--tp19859317p19868801.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: How to use Quartz with T5?

2008-10-07 Thread Angelo Chen

looks good, how to specify chenillekit dependency in maven?



Sven Homburg wrote:
> 
> for dependencies look here
> 
> http://www.chenillekit.org/chenillekit-quartz/dependencies.html
> 
> there is no sample code, the project is in an early stage,
> 
> but working under production in 2 customer projects
> 
> 2008/10/7 Angelo Chen <[EMAIL PROTECTED]>
> 
>>
>> Thanks for the fast reply, does the Quartz module depends on some other
>> modules in the chenillekit? is there any sample project that I can try it
>> out? pom.xml will be a big help. thanks.
>>
>> Angelo
>>
>> Sven Homburg wrote:
>> >
>> > perhaps it helps you
>> >
>> > http://www.chenillekit.org/chenillekit-quartz/index.html
>> >
>> > 2008/10/7 Angelo Chen <[EMAIL PROTECTED]>
>> >
>> >>
>> >> Hi,
>> >>
>> >> I'm trying to use Quarts for some scheduled tasks and I'd like to make
>> it
>> >> a
>> >> service, at end is my simple code, AnnounceSchedulerImpl is the
>> service,
>> >>
>> >> in the AppModule I add:
>> >>
>> >> binder.bind(AnnouceScheduler.class, AnnouceSchedulerImpl.class);
>> >>
>> >> but when run the IOC will not be started, commenting out the sf = new
>> >> StdSchedulerFactory() will allow IOC to be started, any idea what I'm
>> >> missing here? Thanks.
>> >>
>> >> Angelo
>> >> p.s. any idea how to use Quartz will be welcome.
>> >>
>> >>
>> >> public class AnnouceSchedulerImpl implements AnnouceScheduler {
>> >>
>> >>final private Logger logger;
>> >>private SchedulerFactory sf;
>> >>
>> >>public AnnouceSchedulerImpl(Logger logger) {
>> >>this.logger = logger;
>> >>sf = new StdSchedulerFactory();
>> >>}
>> >>
>> >>public void addJob(JobDetail job) throws SchedulerException {
>> >>
>> >>}
>> >> }
>> >>
>> >>
>> >>
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/T5%3A-How-to-use-Quartz-with-T5--tp19859317p19859317.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]
>> >>
>> >>
>> >
>> >
>> > --
>> > with regards
>> > Sven Homburg
>> > http://www.chenillekit.org
>> > http://tapestry5-components.googlecode.com
>> >
>> >
>> > -
>> > best regards
>> > Sven
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/T5%3A-How-to-use-Quartz-with-T5--tp19859317p19859941.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]
>>
>>
> 
> 
> -- 
> with regards
> Sven Homburg
> http://www.chenillekit.org
> http://tapestry5-components.googlecode.com
> 
> 
> -
> best regards
> Sven
> 

-- 
View this message in context: 
http://www.nabble.com/T5%3A-How-to-use-Quartz-with-T5--tp19859317p19868638.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: tapestry-spring-security and openid

2008-10-07 Thread Jonathan Barker

One of my problems is that I don't know enough about the OpenId
authentication with Spring Security.

For a test, start with an unsecured page with a simple login form.  Inject
the AuthenticationManager and manually authenticate.  If that succeeds, then
it's definitely an issue of storing the Authentication object into the
HttpSession.  That could be as "simple" as how you've contributed your
filter.

Unfortunately I don't have the brainspace right now to dig in.

Jonathan





> -Original Message-
> From: Ulrich Stärk [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, October 07, 2008 17:29
> To: Tapestry users
> Subject: Re: tapestry-spring-security and openid
> 
> I already did this but this still doesn't solve the problem that there is
> no openid Authentication
> token in the SecurityContext. And I don't know why since the login seems
> to work just fine.
> 
> Uli
> 
> Jonathan Barker schrieb:
> > Actually, there are two problems.  In the configuration for tapestry5-
> acegi
> > and presumably spring security, there is an
> AnonymousAuthenticationProvider.
> >
> >
> > 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,
>   @Injec

Re: tapestry-spring-security and openid

2008-10-07 Thread Ulrich Stärk
I already did this but this still doesn't solve the problem that there is no openid Authentication 
token in the SecurityContext. And I don't know why since the login seems to work just fine.


Uli

Jonathan Barker schrieb:

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


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.setUserDetailsService(userDetailsService);

 provider.afterPropertiesSet();

 return provider;
}

public static void contributeProviderManager(
 OrderedConfiguration configuration,
 @InjectService("OpenIDAuthenticationProvider")
 AuthenticationProvider openIdAuthenticationProvider)
{
 conf

RE: tapestry-spring-security and openid

2008-10-07 Thread Jonathan Barker

I think so.  I believe that one or more of the filters will populate the
UserPrincipal as a convenience, but the test should really be using the
SecurityContext

> -Original Message-
> From: Robin Helgelin [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, October 07, 2008 17:14
> To: Tapestry users
> Subject: Re: tapestry-spring-security and openid
> 
> 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?
> 
> --
> regards,
> Robin
> 
> -
> 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: tapestry-spring-security and openid

2008-10-07 Thread Jonathan Barker
Actually, there are two problems.  In the configuration for tapestry5-acegi
and presumably spring security, there is an AnonymousAuthenticationProvider.


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.setUserDetailsS

Scalability of T5 : Form Wizard options

2008-10-07 Thread John Jimmy Dondapati
Hi,

We are evaluating Tapestry for a couple of months and are very
interested in using it in a huge project that will have a minimum of 30k
users when it goes up. Since T5 is not yet production ready we are seeking
for advice to know how scalable Tapestry forms can be.

We need a multipage form wizard that populates part of a requestObject in
each page and finally persists it to a database. The user should be able to
fill the form in parts whenever he feels like - page 1,2 today and page 3,4
next week or something like that.

Here are the options with T5 (from what we could dig up) :

   1. have a gaint ASO Request object for each user, but that is not at all
   scalable.
   2. Pass on the Request object between the Pages using

Page1.java
Object onSubmitFromForm()
{
nextPage.setRequestObject(this.requestObject());
return nextPage;
}

Page2.java

 object onPassivate(Object RequestObject)
{
return RequestObject
}

void onActivate(Object requestObject)
{
this.requestObject = requestObject;
}

It looks like I cannot pass my custom Classes (requestObjects) this way.
Are only the built-in datatype classes allowed for OnActivate() and
OnPassivate() e.g. String or Long ?


 3. Persist each part of the form in each page (database or some ASO
like Map(id, requestObject) ) and pass on the id. That way we can retrieve
the previously entered values onPrev() and onSubmit()

 4. @Persist all the form feilds between requests?

We dont know if any of these would work for us coz we are looking at min 10k
concurrent users for this form wizard when it goes up. Are we missing some
other approach. Please advise. Thanks!


-- 
Cheers,
John


Re: tapestry-spring-security and openid

2008-10-07 Thread Robin Helgelin
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?

-- 
regards,
Robin

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



Re: tapestry-spring-security and openid

2008-10-07 Thread Ulrich Stärk
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.setUserDetailsService(userDetailsService);

 provider.afterPropertiesSet();

 return provider;
}

public static void contributeProviderManager(
 OrderedConfiguration configuration,
 @InjectService("OpenIDAuthenticationProvider")
 AuthenticationProvider openIdAuthenticationProvider)
{
 configuration.add("openIDAuthenticationProvider",
openIdAuthenticationProvider);
}

public static UserDetailsService buildUserDetailsService(Logger logger,
 @InjectService("HibernateSessionManager")
 HibernateSessionManager sessionManager)
{
 return new UserDetailsServiceImpl(sessionManager, logger);
}

Thanks for any help.

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]




-
To unsubscribe, e-mail: [EMAIL PROT

RE: tapestry-spring-security and openid

2008-10-07 Thread Jonathan Barker
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.setUserDetailsService(userDetailsService);
> 
>  provider.afterPropertiesSet();
> 
>  return provider;
> }
> 
> public static void contributeProviderManager(
>  OrderedConfiguration configuration,
>  @InjectService("OpenIDAuthenticationProvider")
>  AuthenticationProvider openIdAuthenticationProvider)
> {
>  configuration.add("openIDAuthenticationProvider",
> openIdAuthenticationProvider);
> }
> 
> public static UserDetailsService buildUserDetailsService(Logger logger,
>  @InjectService("HibernateSessionManager")
>  HibernateSessionManager sessionManager)
> {
>  return new UserDetailsServiceImpl(sessionManager, logger);
> }
> 
> Thanks for any help.
> 
> 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]



tapestry-spring-security and openid

2008-10-07 Thread Ulrich Stärk

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.setUserDetailsService(userDetailsService);

provider.afterPropertiesSet();

return provider;
}

public static void contributeProviderManager(
OrderedConfiguration configuration,
@InjectService("OpenIDAuthenticationProvider")
AuthenticationProvider openIdAuthenticationProvider)
{
configuration.add("openIDAuthenticationProvider", 
openIdAuthenticationProvider);
}

public static UserDetailsService buildUserDetailsService(Logger logger,
@InjectService("HibernateSessionManager")
HibernateSessionManager sessionManager)
{
return new UserDetailsServiceImpl(sessionManager, logger);
}

Thanks for any help.

Uli

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



RE: Treating a Component Like a Form Field

2008-10-07 Thread Jonathan Barker

Yup, completely.

This is just an issue of getting @Parameter working properly then.  I defer
to Thiago.

Jonathan


> -Original Message-
> From: Keith Bottner [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, October 07, 2008 15:42
> To: Tapestry users
> Subject: Re: Treating a Component Like a Form Field
> 
> Jonathan,
> 
> Actually I use an underlying select with an Encoder, OptionModel and
> SelectionModel, I just wrap it all into a single component because it
> gets used in a number of places and it is easier to set the Encoder,
> OptionModel and SelectionModel once then to have multiple developers
> remember what to set each time they want a select control with a list
> of countries.
> 
> Make sense?
> 
> 
> On Oct 7, 2008, at 2:40 PM, Jonathan Barker wrote:
> 
> > Keith,
> >
> > Is there a particular reason that you created a custom component for
> > the
> > Country selection rather than just using the standard Select
> > component?  Is
> > it just that it gets used in a number of places, or was there another
> > reason?
> >
> > Jonathan
> >
> >
> >> -Original Message-
> >> From: Keith Bottner [mailto:[EMAIL PROTECTED]
> >> Sent: Tuesday, October 07, 2008 14:59
> >> To: Tapestry users
> >> Subject: Re: Treating a Component Like a Form Field
> >>
> >> I have used @Parameter before but never like this. I am unsure how
> >> this would work.
> >>
> >> Right now inside of my component I have a field named selection and I
> >> have a public getter and setter so that I can retrieve this value
> >> from
> >> within the page that is using the component. I also have a @Property
> >> private Country country in a page that uses the component along
> >> with a
> >> @Component( id = "country" ) private CountrySelect countrySelect.
> >> After submitting the form the only way to retrieve what the user
> >> selected in the select drop down is to do
> >> countrySelect.getSelection(). The country field that is in the field
> >> does not get field. What I would like is to be able to NOT include
> >> the
> >> CountrySelect and just use the @Property Country country like the
> >> standard form controls.
> >>
> >> With all of that said, I do not see how @Parameter will make a
> >> difference. Is there some other use then the standard use supplying a
> >> parameter in a component template?
> >>
> >> Keith
> >>
> >> On Oct 6, 2008, at 5:22 PM, Thiago H. de Paula Figueiredo wrote:
> >>
> >>> Em Mon, 06 Oct 2008 18:03:13 -0300, Keith Bottner
> >>> <[EMAIL PROTECTED]> escreveu:
> >>>
>  I created a custom component for displaying a selection list of
>  countries. However, I have found that the only way for me to
>  retrieve what the selection is from the component is to declare a
>  @Component to that particular field and then request the value
>  directly from the component. Is there no way to have a custom
>  component act like a typical text field and have it assign the
>  selection to a @Property without having to have a @Component
>  designator?
> >>>
> >>> Have you tried adding a @Parameter to your component? This way, you
> >>> could bind it to page property (or page property property and so on
> >>> recursively).
> >>>
> >>> --
> >>> Thiago H. de Paula Figueiredo
> >>> Independent Java consultant, developer, and instructor
> >>> Consultor, desenvolvedor e instrutor em Java
> >>> http://www.arsmachina.com.br/thiago
> >>>
> >>> -
> >>> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>> For additional commands, e-mail: [EMAIL PROTECTED]
> >>>
> >>
> >>
> >> -
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> 
> 
> -
> 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: October release for v5?

2008-10-07 Thread Sven Homburg
t5components project page:

http://code.google.com/p/tapestry5-components/

2008/10/7 Daniel Jue <[EMAIL PROTECTED]>

> Currently, 5.0.15 is a good one to start with.  You can get a head start on
> developing now, and when the production version comes out your changes
> should be minimal to none, depending on how deep you get into it.  It seems
> class and package name changes are done, and that was the most disruptive
> change that I've had in the last few months --it was fixed with a
> find/replace.
>
> Don't forget to look at the 3rd party libraries that are being developed
> along side T5 versions.  In particular, I make use of Sven Homburg's T5
> Components.  They may keep you from reinventing the wheel, and the
> components are a bit simpler than say, T5's Grid component.
> http://213.160.23.119:8080/t5components/
>
> Daniel
>
> On Tue, Oct 7, 2008 at 9:30 AM, Jonathan Barker <
> [EMAIL PROTECTED]
> > wrote:
>
> >
> > I've had production apps in place since 5.0.5.  Actually, I have one
> > that's
> > still running on 5.0.5.
> >
> > Anything I have in active development just follows the most current
> > release,
> > or snapshot.  Hop on the bandwagon.  If you are looking to move, there's
> no
> > time like the present.
> >
> > Jonathan
> >
> >
> > > -Original Message-
> > > From: Joel Halbert [mailto:[EMAIL PROTECTED]
> > > Sent: Tuesday, October 07, 2008 07:59
> > > To: users@tapestry.apache.org
> > > Subject: October release for v5?
> > >
> > > Hi Tapestry Community,
> > >
> > > Apologies if this question has been answered elsewhere many times, but
> I
> > > wanted to get a feel for when the final production ready release of
> > > Tapestry 5 might be available? Is this still scheduled for October?
> > > (I've been keenly anticipating Tapestry 5 since May, currently we use
> > > Wicket but I'm frustrated with the hoops that developers must jump
> > > through to build stateless pages in Wicket).
> > >
> > > I get the feeling that the current 5.0.15 is a good version to develop
> > > against for the time being? Can anyone confirm this?
> > >
> > > Thanks,
> > >
> > > Joel
> > >
> > > --
> > > SU3 Analytics Ltd
> > > 61b Oxford Gardens
> > > W10 5UJ
> > > London
> > >
> > > Tel: +44 20 8960 2634
> > > Mob: +44 75 2501 0825
> > > www.su3analytics.com
> > >
> > > SU3 Analytics Ltd is a company registered in England and Wales under
> > > company number 06639473 at registered address 61b Oxford Gardens,
> London
> > > W10 5UJ, United Kingdom.
> > >
> > >
> > >
> > > -
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>



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


Re: Treating a Component Like a Form Field

2008-10-07 Thread Keith Bottner

Jonathan,

Actually I use an underlying select with an Encoder, OptionModel and  
SelectionModel, I just wrap it all into a single component because it  
gets used in a number of places and it is easier to set the Encoder,  
OptionModel and SelectionModel once then to have multiple developers  
remember what to set each time they want a select control with a list  
of countries.


Make sense?


On Oct 7, 2008, at 2:40 PM, Jonathan Barker wrote:


Keith,

Is there a particular reason that you created a custom component for  
the
Country selection rather than just using the standard Select  
component?  Is

it just that it gets used in a number of places, or was there another
reason?

Jonathan



-Original Message-
From: Keith Bottner [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 07, 2008 14:59
To: Tapestry users
Subject: Re: Treating a Component Like a Form Field

I have used @Parameter before but never like this. I am unsure how
this would work.

Right now inside of my component I have a field named selection and I
have a public getter and setter so that I can retrieve this value  
from

within the page that is using the component. I also have a @Property
private Country country in a page that uses the component along  
with a

@Component( id = "country" ) private CountrySelect countrySelect.
After submitting the form the only way to retrieve what the user
selected in the select drop down is to do
countrySelect.getSelection(). The country field that is in the field
does not get field. What I would like is to be able to NOT include  
the

CountrySelect and just use the @Property Country country like the
standard form controls.

With all of that said, I do not see how @Parameter will make a
difference. Is there some other use then the standard use supplying a
parameter in a component template?

Keith

On Oct 6, 2008, at 5:22 PM, Thiago H. de Paula Figueiredo wrote:


Em Mon, 06 Oct 2008 18:03:13 -0300, Keith Bottner
<[EMAIL PROTECTED]> escreveu:


I created a custom component for displaying a selection list of
countries. However, I have found that the only way for me to
retrieve what the selection is from the component is to declare a
@Component to that particular field and then request the value
directly from the component. Is there no way to have a custom
component act like a typical text field and have it assign the
selection to a @Property without having to have a @Component
designator?


Have you tried adding a @Parameter to your component? This way, you
could bind it to page property (or page property property and so on
recursively).

--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
Consultor, desenvolvedor e instrutor em Java
http://www.arsmachina.com.br/thiago

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




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



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




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



RE: Treating a Component Like a Form Field

2008-10-07 Thread Jonathan Barker
Keith,

Is there a particular reason that you created a custom component for the
Country selection rather than just using the standard Select component?  Is
it just that it gets used in a number of places, or was there another
reason?

Jonathan


> -Original Message-
> From: Keith Bottner [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, October 07, 2008 14:59
> To: Tapestry users
> Subject: Re: Treating a Component Like a Form Field
> 
> I have used @Parameter before but never like this. I am unsure how
> this would work.
> 
> Right now inside of my component I have a field named selection and I
> have a public getter and setter so that I can retrieve this value from
> within the page that is using the component. I also have a @Property
> private Country country in a page that uses the component along with a
> @Component( id = "country" ) private CountrySelect countrySelect.
> After submitting the form the only way to retrieve what the user
> selected in the select drop down is to do
> countrySelect.getSelection(). The country field that is in the field
> does not get field. What I would like is to be able to NOT include the
> CountrySelect and just use the @Property Country country like the
> standard form controls.
> 
> With all of that said, I do not see how @Parameter will make a
> difference. Is there some other use then the standard use supplying a
> parameter in a component template?
> 
> Keith
> 
> On Oct 6, 2008, at 5:22 PM, Thiago H. de Paula Figueiredo wrote:
> 
> > Em Mon, 06 Oct 2008 18:03:13 -0300, Keith Bottner
> > <[EMAIL PROTECTED]> escreveu:
> >
> >> I created a custom component for displaying a selection list of
> >> countries. However, I have found that the only way for me to
> >> retrieve what the selection is from the component is to declare a
> >> @Component to that particular field and then request the value
> >> directly from the component. Is there no way to have a custom
> >> component act like a typical text field and have it assign the
> >> selection to a @Property without having to have a @Component
> >> designator?
> >
> > Have you tried adding a @Parameter to your component? This way, you
> > could bind it to page property (or page property property and so on
> > recursively).
> >
> > --
> > Thiago H. de Paula Figueiredo
> > Independent Java consultant, developer, and instructor
> > Consultor, desenvolvedor e instrutor em Java
> > http://www.arsmachina.com.br/thiago
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


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



T5: page as application/json response

2008-10-07 Thread Waldo Mendoza
Hello

Is there any way to tell tapestry to render a entire page as JSON response? 
Currently there is a support like this for blocks and components, but i tried 
the following:

@ContentType("application/json")
public class TestPage {

}

But nothing happens, i want to get a json response, with .content, .scripts 
and .script properties as a part of the json object.

I am making an Ajax request, with prototype.

Thanks you


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



Re: Details about Services

2008-10-07 Thread Keith Bottner

Thanks for the feedback, I will review the link you sent me.

And I totally agree about the comment about learning Tapestry with  
regard to Struts/Tiles. I just needed more information so I can wrap  
my head around porting things properly instead of just using a hammer  
to bang a square peg into a round whole.


BTW, after 6 years of Struts/Tiles, we are moving to Tapestry 5 and  
not looking back. We have found it to be excellent, just different  
enough that we need to wrap our ahead around the "right" way of doing  
things rather than just doing whatever works.


Thanks again!

Keith

On Oct 7, 2008, at 2:01 PM, Thiago H. de Paula Figueiredo wrote:

Em Tue, 07 Oct 2008 15:48:23 -0300, Keith Bottner  
<[EMAIL PROTECTED]> escreveu:


I have been looking for documentation that explains more detailed  
information on how Services are implemented but I have not found  
any. Does anybody know where some good documentation can be located?


Here: http://tapestry.apache.org/tapestry5/tapestry-ioc/service.html

Are Services singletons? (i.e. does everyone that uses a Service  
share the same underlying object?) Or does a new Singleton get  
created for each Page in the page pool?


By default yes, but you can have other lifecycles (scopes). See the  
above URL for more details.


Do Services exist for the lifetime of the web application or if  
nobody is using them do they eventually get garbage collected?  
(kinda of a secondary question to above)


AFAIK, for the lifetime, unless it is perthread-scoped (or having  
another scope).



Can Services use other Services?


Yes, and this happens all the time.

Do services pick up aspects of the calling Page to allow the  
injection of Messages and ASO? Or do they have to be passed into  
any methods the Page calls of the Service?


Services do not pick up aspects of the calling page, as they're page  
independent.
You can access ASOs in a service using the ApplicationStateManager  
service or the messages catalog using the Messages service.


These are just a few of my outstanding questions. It is hard to  
figure out how to port parts of my previous Struts/Tiles web  
applications when I cannot make the design decisions due to lack of  
information so if anyone can point me in more detailed design  
information of Services and/or answer the above questions I would  
appreciate it.


Advice: don't try to learn Tapestry thinking in JSP, servlets,  
Struts (argh!), or Tiles (argh!) concepts.


--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
Consultor, desenvolvedor e instrutor em Java
http://www.arsmachina.com.br/thiago

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




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



Re: October release for v5?

2008-10-07 Thread Daniel Jue
Currently, 5.0.15 is a good one to start with.  You can get a head start on
developing now, and when the production version comes out your changes
should be minimal to none, depending on how deep you get into it.  It seems
class and package name changes are done, and that was the most disruptive
change that I've had in the last few months --it was fixed with a
find/replace.

Don't forget to look at the 3rd party libraries that are being developed
along side T5 versions.  In particular, I make use of Sven Homburg's T5
Components.  They may keep you from reinventing the wheel, and the
components are a bit simpler than say, T5's Grid component.
http://213.160.23.119:8080/t5components/

Daniel

On Tue, Oct 7, 2008 at 9:30 AM, Jonathan Barker <[EMAIL PROTECTED]
> wrote:

>
> I've had production apps in place since 5.0.5.  Actually, I have one
> that's
> still running on 5.0.5.
>
> Anything I have in active development just follows the most current
> release,
> or snapshot.  Hop on the bandwagon.  If you are looking to move, there's no
> time like the present.
>
> Jonathan
>
>
> > -Original Message-
> > From: Joel Halbert [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, October 07, 2008 07:59
> > To: users@tapestry.apache.org
> > Subject: October release for v5?
> >
> > Hi Tapestry Community,
> >
> > Apologies if this question has been answered elsewhere many times, but I
> > wanted to get a feel for when the final production ready release of
> > Tapestry 5 might be available? Is this still scheduled for October?
> > (I've been keenly anticipating Tapestry 5 since May, currently we use
> > Wicket but I'm frustrated with the hoops that developers must jump
> > through to build stateless pages in Wicket).
> >
> > I get the feeling that the current 5.0.15 is a good version to develop
> > against for the time being? Can anyone confirm this?
> >
> > Thanks,
> >
> > Joel
> >
> > --
> > SU3 Analytics Ltd
> > 61b Oxford Gardens
> > W10 5UJ
> > London
> >
> > Tel: +44 20 8960 2634
> > Mob: +44 75 2501 0825
> > www.su3analytics.com
> >
> > SU3 Analytics Ltd is a company registered in England and Wales under
> > company number 06639473 at registered address 61b Oxford Gardens, London
> > W10 5UJ, United Kingdom.
> >
> >
> >
> > -
> > 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: Treating a Component Like a Form Field

2008-10-07 Thread Thiago H. de Paula Figueiredo
Em Tue, 07 Oct 2008 15:58:34 -0300, Keith Bottner <[EMAIL PROTECTED]>  
escreveu:


I have used @Parameter before but never like this. I am unsure how this  
would work.


When you set a field that is a parameter, the bound page property is also  
set. A parameter in Tapestry is not just an in parameter, it is an out  
parameter too.


--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
Consultor, desenvolvedor e instrutor em Java
http://www.arsmachina.com.br/thiago

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



Re: Details about Services

2008-10-07 Thread Thiago H. de Paula Figueiredo
Em Tue, 07 Oct 2008 15:48:23 -0300, Keith Bottner <[EMAIL PROTECTED]>  
escreveu:


I have been looking for documentation that explains more detailed  
information on how Services are implemented but I have not found any.  
Does anybody know where some good documentation can be located?


Here: http://tapestry.apache.org/tapestry5/tapestry-ioc/service.html

Are Services singletons? (i.e. does everyone that uses a Service share  
the same underlying object?) Or does a new Singleton get created for  
each Page in the page pool?


By default yes, but you can have other lifecycles (scopes). See the above  
URL for more details.


Do Services exist for the lifetime of the web application or if nobody  
is using them do they eventually get garbage collected? (kinda of a  
secondary question to above)


AFAIK, for the lifetime, unless it is perthread-scoped (or having another  
scope).



Can Services use other Services?


Yes, and this happens all the time.

Do services pick up aspects of the calling Page to allow the injection  
of Messages and ASO? Or do they have to be passed into any methods the  
Page calls of the Service?


Services do not pick up aspects of the calling page, as they're page  
independent.
You can access ASOs in a service using the ApplicationStateManager service  
or the messages catalog using the Messages service.


These are just a few of my outstanding questions. It is hard to figure  
out how to port parts of my previous Struts/Tiles web applications when  
I cannot make the design decisions due to lack of information so if  
anyone can point me in more detailed design information of Services  
and/or answer the above questions I would appreciate it.


Advice: don't try to learn Tapestry thinking in JSP, servlets, Struts  
(argh!), or Tiles (argh!) concepts.


--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
Consultor, desenvolvedor e instrutor em Java
http://www.arsmachina.com.br/thiago

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



Re: Treating a Component Like a Form Field

2008-10-07 Thread Keith Bottner
I have used @Parameter before but never like this. I am unsure how  
this would work.


Right now inside of my component I have a field named selection and I  
have a public getter and setter so that I can retrieve this value from  
within the page that is using the component. I also have a @Property  
private Country country in a page that uses the component along with a  
@Component( id = "country" ) private CountrySelect countrySelect.  
After submitting the form the only way to retrieve what the user  
selected in the select drop down is to do  
countrySelect.getSelection(). The country field that is in the field  
does not get field. What I would like is to be able to NOT include the  
CountrySelect and just use the @Property Country country like the  
standard form controls.


With all of that said, I do not see how @Parameter will make a  
difference. Is there some other use then the standard use supplying a  
parameter in a component template?


Keith

On Oct 6, 2008, at 5:22 PM, Thiago H. de Paula Figueiredo wrote:

Em Mon, 06 Oct 2008 18:03:13 -0300, Keith Bottner  
<[EMAIL PROTECTED]> escreveu:


I created a custom component for displaying a selection list of  
countries. However, I have found that the only way for me to  
retrieve what the selection is from the component is to declare a  
@Component to that particular field and then request the value  
directly from the component. Is there no way to have a custom  
component act like a typical text field and have it assign the  
selection to a @Property without having to have a @Component  
designator?


Have you tried adding a @Parameter to your component? This way, you  
could bind it to page property (or page property property and so on  
recursively).


--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
Consultor, desenvolvedor e instrutor em Java
http://www.arsmachina.com.br/thiago

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




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



Re: Triggering a partial update on a grid

2008-10-07 Thread Thiago H. de Paula Figueiredo
Em Tue, 07 Oct 2008 15:42:26 -0300, Hugo Palma <[EMAIL PROTECTED]>  
escreveu:



I thought so too, but i'm starting to think there is one.
Here's some of the code in hope someone will spot something wrong:




Maybe not related to your problem, but the zone parameter of the Form  
component must be the id of a *zone*. You're passing it the id of a  
*grid*. I would try to put the grid inside a zone and then update the  
zone. ;)


--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
Consultor, desenvolvedor e instrutor em Java
http://www.arsmachina.com.br/thiago

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



Details about Services

2008-10-07 Thread Keith Bottner
I have been looking for documentation that explains more detailed  
information on how Services are implemented but I have not found any.  
Does anybody know where some good documentation can be located?


Questions outstanding are:

Are Services singletons? (i.e. does everyone that uses a Service share  
the same underlying object?) Or does a new Singleton get created for  
each Page in the page pool?
Do Services exist for the lifetime of the web application or if nobody  
is using them do they eventually get garbage collected? (kinda of a  
secondary question to above)

Can Services use other Services?
Do services pick up aspects of the calling Page to allow the injection  
of Messages and ASO? Or do they have to be passed into any methods the  
Page calls of the Service?


These are just a few of my outstanding questions. It is hard to figure  
out how to port parts of my previous Struts/Tiles web applications  
when I cannot make the design decisions due to lack of information so  
if anyone can point me in more detailed design information of Services  
and/or answer the above questions I would appreciate it.


Thanks in advance,

Keith


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



Re: Triggering a partial update on a grid

2008-10-07 Thread Hugo Palma

I thought so too, but i'm starting to think there is one.
Here's some of the code in hope someone will spot something wrong:

template:

  
  
   submit="true"/>
   zone="processGrid">Search


   inplace="true" rowsPerPage="prop:gridRowsPerPage" row="currentProcess" 
rowClass="rowClass"
exclude="${message:proccessListExclusionColumns}" 
reorder="${message:proccessListColumnOrder}"/>

   

on the class:

@OnEvent(value = "submit", component = "filterForm")
   Grid filter() {
   processes.remove(0);
   return processGrid;
   }

   Grid linkTest() {
   processes.remove(0);
   return processGrid;
   }

If i press the eventlink eveything goes fine, if i use the submit button 
i get the exception.


Thiago H. de Paula Figueiredo wrote:
Em Tue, 07 Oct 2008 15:22:03 -0300, Hugo Palma 
<[EMAIL PROTECTED]> escreveu:


What's the difference between using the form submit with a zone and 
using an event link besides the form parameters not getting updated ?


AFAIK, none.



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



Re: Triggering a partial update on a grid

2008-10-07 Thread Thiago H. de Paula Figueiredo
Em Tue, 07 Oct 2008 15:22:03 -0300, Hugo Palma <[EMAIL PROTECTED]>  
escreveu:


What's the difference between using the form submit with a zone and  
using an event link besides the form parameters not getting updated ?


AFAIK, none.

--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
Consultor, desenvolvedor e instrutor em Java
http://www.arsmachina.com.br/thiago

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



Re: Triggering a partial update on a grid

2008-10-07 Thread Hugo Palma

I had thought of that.
But all the form parameters are persisted and i have debugged the 
application and the grid source parameter has the correct size. Only the 
grid doesn't seem to be aware of it.


I just found out that if i use an eventlink component to trigger the 
update instead of the form submit it works just fine. Obviously the form 
parameters aren't updated but i put some code on the event handler that 
filters the source anyway. No exception this way.


What's the difference between using the form submit with a zone and 
using an event link besides the form parameters not getting updated ?


Thiago H. de Paula Figueiredo wrote:
Em Tue, 07 Oct 2008 13:47:30 -0300, Hugo Palma 
<[EMAIL PROTECTED]> escreveu:



Caused by: java.lang.IndexOutOfBoundsException: Index: 10, Size: 10


Take a look at the collection returned to the Grid source parameter in 
the second request. One common error is to not @Persist the form 
parameters. Then, when you request the n+1 page, the form parameters 
are lost and the search made is not the same as the first one.




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



Re: Triggering a partial update on a grid

2008-10-07 Thread Thiago H. de Paula Figueiredo
Em Tue, 07 Oct 2008 13:47:30 -0300, Hugo Palma <[EMAIL PROTECTED]>  
escreveu:



Caused by: java.lang.IndexOutOfBoundsException: Index: 10, Size: 10


Take a look at the collection returned to the Grid source parameter in the  
second request. One common error is to not @Persist the form parameters.  
Then, when you request the n+1 page, the form parameters are lost and the  
search made is not the same as the first one.


--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
Consultor, desenvolvedor e instrutor em Java
http://www.arsmachina.com.br/thiago

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



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]



Triggering a partial update on a grid

2008-10-07 Thread Hugo Palma

I have a search form and a grid with the results.
I'd  like to submit the form and update the grid with the filtered 
results without doing a full page refresh.


My take on this is to set the form component "zone" parameter to the 
grid zone id so that the form submit it's treated "AJAX way" and the 
submission triggers the grid zone to get updated. The form submit event 
handler method filters the search results, changes the property that the 
grid uses as datasource and returns the Grid component itself.


This strangely enough only works the first time i perform the search. 
From there on i always get an exception when i click the search button, 
that seems to be related to the fact that the Grid doesn't acknowledge 
that the datasource size has changed. Here's the stack trace:


Caused by: java.lang.IndexOutOfBoundsException: Index: 10, Size: 10
   at java.util.ArrayList.RangeCheck(ArrayList.java:547)
   at java.util.ArrayList.get(ArrayList.java:322)
   at 
org.apache.tapestry5.internal.grid.CollectionGridDataSource.getRowValue(CollectionGridDataSource.java:111)
   at 
org.apache.tapestry5.corelib.components.Grid$CachingDataSource.getRowValue(Grid.java:324)
   at 
org.apache.tapestry5.corelib.components.GridRows.setupForRow(GridRows.java:238)
   at 
org.apache.tapestry5.corelib.components.GridRows$SetupForRow.execute(GridRows.java:70)
   at 
org.apache.tapestry5.corelib.components.GridRows$SetupForRow.execute(GridRows.java:57)
   at 
org.apache.tapestry5.corelib.components.Form.executeStoredActions(Form.java:447)


Any ideas would be most welcome.
Thanks.


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



Re: [T5] Using Tapestry5 on Igenko, an open source cms/eCommerce project

2008-10-07 Thread Bouiaw
Thanks a lot for this interesting link.

On Tue, Oct 7, 2008 at 2:29 AM, Thiago H. de Paula Figueiredo
<[EMAIL PROTECTED]> wrote:
> Em Mon, 06 Oct 2008 19:14:40 -0300, Bouiaw <[EMAIL PROTECTED]> escreveu:
>
>> 1) RESTful URL handling
>>
>> As I would like to manage RESTful urls like
>> (http://mywebsite.com/channel/1/content/2/ or
>> http://mywebsite.com/user/sdeleuze/), I need to implement my own URL
>> resolution and not Tapestry5 default one.
>
> I can't see why Tapestry 5's URL resolution can manage your example URLs. My
> T5 application's URLs look exactly like the ones your provided.
>
>> 2) Template storage in "database"
>> In order to bring the best of extensibility to the users, I would like
>> to allow Tapestry 5 templates (that I would store in a Widget on
>> instance stored in my database) to be created and modified by the
>> users at runtime. Is there a way to modify tapestry 5 resource
>> handling to dynamically load it from a database at runtime ?
>
> Yes, you can, and it has been done. Take a look at this thread:
> http://www.nabble.com/Web-Content-Management-Systems-to14212538.html#a14221589
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java consultant, developer, and instructor
> Consultor, desenvolvedor e instrutor em Java
> http://www.arsmachina.com.br/thiago
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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



Re: Problem injecting ApplicationStateManager into service implementing commons-upload ProgressListener

2008-10-07 Thread Pierre-Alain RIVIERE
Using your method do not solve my NPE calling ApplicationStateManager.

BUT! now I can inject HttpServletRequest in my ProgressListenerImpl
(instead of ApplicationStateManager) and get my state object using

- 
(UserData) request.getSession().getAttribute(
"aso:" + UserData.class.getName())
-

It's not a definitive, just a workaround but I can keep working on other
functionality now. Thanks :D

Note : This code doesn't work without the contribution to
RequestHandler.


On Tue, 2008-10-07 at 16:42 +0200, Francois Armand wrote:
> Francois Armand wrote:
> [...].
> 
> So, I have no idea why the bug is not always here.
> 
> But it happens that the problem was that I try to use (tapestry) Request 
> before the call to requestGlobals.storeRequestResponse(request, 
> response); was done : I'm in a RequestHandler, and this is done in the 
> terminator of requesthandler pipeline.
> 
> So, I just did :
> 
> public static RequestFilter buildSetRequestResponse(final 
> RequestGlobals requestGlobals) {
> return new RequestFilter(){
> public boolean service(Request request, Response response, 
> RequestHandler handler) throws IOException {
> requestGlobals.storeRequestResponse(request, response);
> return handler.service(request, response);
> }
> };
> }
> 
> public static void 
> contributeRequestHandler(OrderedConfiguration configuration,
> @InjectService("setRequestResponse") RequestFilter 
> setRequestResponse,
> (other handlers)) {
> configuration.add("setRequestResponse", setRequestResponse, 
> "before:*");
> ...
> }
> 
> 
> And now, everything works.
> 
> I believe it could need a bugreport, as it seems quite ok to want to use 
> the Request object (and not only the HttpRequest's one) in RequestHandler.
> 
> Hope it's really that, and that is may help other people.
> 


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



Re: October release for v5?

2008-10-07 Thread Marcelo Lotif
I agree with Jonathan. Tapestry 5 is very stable since alpha versions. The
RC is very close and we don't expect to see major changes until the final
release arrives, just some bug fixes and little improvements. If you start
now, certainly you will feel no pain on upgrading.

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

>
> I've had production apps in place since 5.0.5.  Actually, I have one
> that's
> still running on 5.0.5.
>
> Anything I have in active development just follows the most current
> release,
> or snapshot.  Hop on the bandwagon.  If you are looking to move, there's no
> time like the present.
>
> Jonathan
>
>
> > -Original Message-
> > From: Joel Halbert [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, October 07, 2008 07:59
> > To: users@tapestry.apache.org
> > Subject: October release for v5?
> >
> > Hi Tapestry Community,
> >
> > Apologies if this question has been answered elsewhere many times, but I
> > wanted to get a feel for when the final production ready release of
> > Tapestry 5 might be available? Is this still scheduled for October?
> > (I've been keenly anticipating Tapestry 5 since May, currently we use
> > Wicket but I'm frustrated with the hoops that developers must jump
> > through to build stateless pages in Wicket).
> >
> > I get the feeling that the current 5.0.15 is a good version to develop
> > against for the time being? Can anyone confirm this?
> >
> > Thanks,
> >
> > Joel
> >
> > --
> > SU3 Analytics Ltd
> > 61b Oxford Gardens
> > W10 5UJ
> > London
> >
> > Tel: +44 20 8960 2634
> > Mob: +44 75 2501 0825
> > www.su3analytics.com
> >
> > SU3 Analytics Ltd is a company registered in England and Wales under
> > company number 06639473 at registered address 61b Oxford Gardens, London
> > W10 5UJ, United Kingdom.
> >
> >
> >
> > -
> > 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]
>
>


-- 
Atenciosamente,

Marcelo Lotif
Programador Java e Tapestry
FIEC - Federação das Indústrias do Estado do Ceará
(85) 3477-5910


Re: [EMAIL PROTECTED] inside [EMAIL PROTECTED]

2008-10-07 Thread Norman Franke
You want to return the value of an OGNL expression based on your  
example, just that you want the expression to be determined at run  
time. I'd imagine you can do that in code. I've never done that, but  
it should be possible to do so. What I have done was to use HiveMind's  
PropertyUtils class to fetch a property from an object.


Again, I'm sure you can get access to an OGNL parser and then pass it  
a string to resolve, returning an Object that you can return to the  
Tapestry page.


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

On Oct 6, 2008, at 11:23 PM, sc wrote:


"Or your allProducts could call OGNL directly and
parse the expression in your .java class."

can you explain on this.. aren't this is what i did in my example  
and it does't

work?


-
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: How to use Quartz with T5?

2008-10-07 Thread Sven Homburg
for dependencies look here

http://www.chenillekit.org/chenillekit-quartz/dependencies.html

there is no sample code, the project is in an early stage,

but working under production in 2 customer projects

2008/10/7 Angelo Chen <[EMAIL PROTECTED]>

>
> Thanks for the fast reply, does the Quartz module depends on some other
> modules in the chenillekit? is there any sample project that I can try it
> out? pom.xml will be a big help. thanks.
>
> Angelo
>
> Sven Homburg wrote:
> >
> > perhaps it helps you
> >
> > http://www.chenillekit.org/chenillekit-quartz/index.html
> >
> > 2008/10/7 Angelo Chen <[EMAIL PROTECTED]>
> >
> >>
> >> Hi,
> >>
> >> I'm trying to use Quarts for some scheduled tasks and I'd like to make
> it
> >> a
> >> service, at end is my simple code, AnnounceSchedulerImpl is the service,
> >>
> >> in the AppModule I add:
> >>
> >> binder.bind(AnnouceScheduler.class, AnnouceSchedulerImpl.class);
> >>
> >> but when run the IOC will not be started, commenting out the sf = new
> >> StdSchedulerFactory() will allow IOC to be started, any idea what I'm
> >> missing here? Thanks.
> >>
> >> Angelo
> >> p.s. any idea how to use Quartz will be welcome.
> >>
> >>
> >> public class AnnouceSchedulerImpl implements AnnouceScheduler {
> >>
> >>final private Logger logger;
> >>private SchedulerFactory sf;
> >>
> >>public AnnouceSchedulerImpl(Logger logger) {
> >>this.logger = logger;
> >>sf = new StdSchedulerFactory();
> >>}
> >>
> >>public void addJob(JobDetail job) throws SchedulerException {
> >>
> >>}
> >> }
> >>
> >>
> >>
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/T5%3A-How-to-use-Quartz-with-T5--tp19859317p19859317.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]
> >>
> >>
> >
> >
> > --
> > with regards
> > Sven Homburg
> > http://www.chenillekit.org
> > http://tapestry5-components.googlecode.com
> >
> >
> > -
> > best regards
> > Sven
> >
>
> --
> View this message in context:
> http://www.nabble.com/T5%3A-How-to-use-Quartz-with-T5--tp19859317p19859941.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]
>
>


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


Client side validation problem when using absolute positioning

2008-10-07 Thread Toby Hobson
I have just encountered a problem and wanted to run it by you guys before
reporting it as a bug:

have positioned an element using css absolute positioning but the validation
"bubble" appears in the wrong place. Here is my relevant code:


  

set name 

  


css:

#newSetPanel {
width:300px;
height:100px;
border:solid 1px black;
position: absolute;
top: 50%;
left: 50%;
margin-left:-150px;
margin-top:-50px;
background-color:white;
}

Page:

@Property
@Validate(value="required")
private String setName;

The bubble appears in the top left corner of the screen, not over the
textfield as I would expect

Toby


tapestry-spring-security: injecting UserDetails

2008-10-07 Thread Ulrich Stärk
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]



Re: NPE when trying to contribute ServletContextSymbolProvider to SymbolSource (WAS: Re: Page pool hard limit and page instance usage)

2008-10-07 Thread Francois Armand

Ville Virtanen wrote:

I have no new info on this, and I think we should add ticket to get this
sorted. (If it is something we do wrong -> correct the documentation or then
it is a bug that needs a fix anyway.)
  
I search forward and find a solution that works for me, I hope it may 
help you too :
http://markmail.org/search/?q=list%3Aorg.apache.tapestry.users+problem+injecting#query:list%3Aorg.apache.tapestry.users 
problem injecting+page:1+mid:lnvawscuxr44aasv+state:results


So, basically, the problem is that the Tapestry Request and Response 
object are saved in RequestGlobal object only in the Terminator of the 
RequestHandler pipeline. But the ApplicationStateManager, and perhaps 
other services, tries to access to the (T5) Request thanks to 
RequestGlobal#getRequest(), which is null : we did not reach the 
terminator yet.


So, I just created a RequestHandler that does the same thing that the 
terminator (requestGlobals.storeRequestResponse(request, response)) and 
contribute it before all other RequestHandler.


I believe that we may have the same problem with HttpRequestHandler, as 
the RequestGlobal#storeServletRequestResponse is called in theterminator 
of  HttpRequestHandler pipeline.


Hope it will help you.


The code (copy&paste from the other email (save you a click) :

  public static RequestFilter buildSetRequestResponse(final 
RequestGlobals requestGlobals) {

  return new RequestFilter(){
  public boolean service(Request request, Response response, 
RequestHandler handler) throws IOException {

  requestGlobals.storeRequestResponse(request, response);
  return handler.service(request, response);
  }
  };
  }

  public static void 
contributeRequestHandler(OrderedConfiguration configuration,
  @InjectService("setRequestResponse") RequestFilter 
setRequestResponse,

  (other handlers)) {
  configuration.add("setRequestResponse", setRequestResponse, 
"before:*");

  ...
  }




--
Francois Armand
Etudes & Développements J2EE
Groupe Linagora - http://www.linagora.com
Tél.: +33 (0)1 58 18 68 28
---
InterLDAP - http://interldap.org 
FederID - http://www.federid.org/

Open Source identities management and federation


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



Re: T5: How to use Quartz with T5?

2008-10-07 Thread Angelo Chen

Thanks for the fast reply, does the Quartz module depends on some other
modules in the chenillekit? is there any sample project that I can try it
out? pom.xml will be a big help. thanks.

Angelo

Sven Homburg wrote:
> 
> perhaps it helps you
> 
> http://www.chenillekit.org/chenillekit-quartz/index.html
> 
> 2008/10/7 Angelo Chen <[EMAIL PROTECTED]>
> 
>>
>> Hi,
>>
>> I'm trying to use Quarts for some scheduled tasks and I'd like to make it
>> a
>> service, at end is my simple code, AnnounceSchedulerImpl is the service,
>>
>> in the AppModule I add:
>>
>> binder.bind(AnnouceScheduler.class, AnnouceSchedulerImpl.class);
>>
>> but when run the IOC will not be started, commenting out the sf = new
>> StdSchedulerFactory() will allow IOC to be started, any idea what I'm
>> missing here? Thanks.
>>
>> Angelo
>> p.s. any idea how to use Quartz will be welcome.
>>
>>
>> public class AnnouceSchedulerImpl implements AnnouceScheduler {
>>
>>final private Logger logger;
>>private SchedulerFactory sf;
>>
>>public AnnouceSchedulerImpl(Logger logger) {
>>this.logger = logger;
>>sf = new StdSchedulerFactory();
>>}
>>
>>public void addJob(JobDetail job) throws SchedulerException {
>>
>>}
>> }
>>
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/T5%3A-How-to-use-Quartz-with-T5--tp19859317p19859317.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]
>>
>>
> 
> 
> -- 
> with regards
> Sven Homburg
> http://www.chenillekit.org
> http://tapestry5-components.googlecode.com
> 
> 
> -
> best regards
> Sven
> 

-- 
View this message in context: 
http://www.nabble.com/T5%3A-How-to-use-Quartz-with-T5--tp19859317p19859941.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: How to use Quartz with T5?

2008-10-07 Thread Sven Homburg
perhaps it helps you

http://www.chenillekit.org/chenillekit-quartz/index.html

2008/10/7 Angelo Chen <[EMAIL PROTECTED]>

>
> Hi,
>
> I'm trying to use Quarts for some scheduled tasks and I'd like to make it a
> service, at end is my simple code, AnnounceSchedulerImpl is the service,
>
> in the AppModule I add:
>
> binder.bind(AnnouceScheduler.class, AnnouceSchedulerImpl.class);
>
> but when run the IOC will not be started, commenting out the sf = new
> StdSchedulerFactory() will allow IOC to be started, any idea what I'm
> missing here? Thanks.
>
> Angelo
> p.s. any idea how to use Quartz will be welcome.
>
>
> public class AnnouceSchedulerImpl implements AnnouceScheduler {
>
>final private Logger logger;
>private SchedulerFactory sf;
>
>public AnnouceSchedulerImpl(Logger logger) {
>this.logger = logger;
>sf = new StdSchedulerFactory();
>}
>
>public void addJob(JobDetail job) throws SchedulerException {
>
>}
> }
>
>
>
> --
> View this message in context:
> http://www.nabble.com/T5%3A-How-to-use-Quartz-with-T5--tp19859317p19859317.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]
>
>


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


Re: Problem injecting ApplicationStateManager into service implementing commons-upload ProgressListener

2008-10-07 Thread Francois Armand

Francois Armand wrote:
[...].

So, I have no idea why the bug is not always here.

But it happens that the problem was that I try to use (tapestry) Request 
before the call to requestGlobals.storeRequestResponse(request, 
response); was done : I'm in a RequestHandler, and this is done in the 
terminator of requesthandler pipeline.


So, I just did :

   public static RequestFilter buildSetRequestResponse(final 
RequestGlobals requestGlobals) {

   return new RequestFilter(){
   public boolean service(Request request, Response response, 
RequestHandler handler) throws IOException {

   requestGlobals.storeRequestResponse(request, response);
   return handler.service(request, response);
   }
   };
   }

   public static void 
contributeRequestHandler(OrderedConfiguration configuration,
   @InjectService("setRequestResponse") RequestFilter 
setRequestResponse,

   (other handlers)) {
   configuration.add("setRequestResponse", setRequestResponse, 
"before:*");

   ...
   }


And now, everything works.

I believe it could need a bugreport, as it seems quite ok to want to use 
the Request object (and not only the HttpRequest's one) in RequestHandler.


Hope it's really that, and that is may help other people.

--
Francois Armand
Etudes & Développements J2EE
Groupe Linagora - http://www.linagora.com
Tél.: +33 (0)1 58 18 68 28
---
InterLDAP - http://interldap.org 
FederID - http://www.federid.org/

Open Source identities management and federation


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



Re: Tapestry 5 : The requested resource (/login) is not available. error in Tomcat

2008-10-07 Thread Daniel Jue
Some hosting companies that allow you to run servlets do not allow/don't
give you resources for using higher end web frameworks, such as Tapestry,
Spring, etc.  Some explicitly forbid apps that use Hibernate.  In these
cases, you are stuck with very basic JSPs.

You may want to check and make sure they are giving you enough RAM, etc.


On Tue, Oct 7, 2008 at 10:04 AM, Thiago H. de Paula Figueiredo <
[EMAIL PROTECTED]> wrote:

> Em Tue, 07 Oct 2008 11:00:29 -0300, LakshithaS <[EMAIL PROTECTED]>
> escreveu:
>
>  HTTP Status 404 - /login
>>
>> type Status report
>>
>> message /login
>>
>> description The requested resource (/login) is not available.
>> Apache Tomcat/5.0.27
>>
>
> Check your logs. It looks like your application was not started
> successfully.
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java consultant, developer, and instructor
> Consultor, desenvolvedor e instrutor em Java
> http://www.arsmachina.com.br/thiago
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


T5: select updating in form?

2008-10-07 Thread photos


I have a select dropdown that will determine what is displayed in a  
second dropdown.  Both of these are in a form.


Am I correct in thinking that this cannot be done using Zones (I seem  
to recall a recent posting that said it was not possible if it's  
inside a form).


In that case, how can I do it?  I have looked on the wiki howtos but  
can't seem to find any examples.


thanks,
p.




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



T5: How to use Quartz with T5?

2008-10-07 Thread Angelo Chen

Hi,

I'm trying to use Quarts for some scheduled tasks and I'd like to make it a
service, at end is my simple code, AnnounceSchedulerImpl is the service,

in the AppModule I add:

binder.bind(AnnouceScheduler.class, AnnouceSchedulerImpl.class);

but when run the IOC will not be started, commenting out the sf = new
StdSchedulerFactory() will allow IOC to be started, any idea what I'm
missing here? Thanks.

Angelo
p.s. any idea how to use Quartz will be welcome.


public class AnnouceSchedulerImpl implements AnnouceScheduler {

final private Logger logger;
private SchedulerFactory sf;

public AnnouceSchedulerImpl(Logger logger) {
this.logger = logger;
sf = new StdSchedulerFactory();
}

public void addJob(JobDetail job) throws SchedulerException {

}
}



-- 
View this message in context: 
http://www.nabble.com/T5%3A-How-to-use-Quartz-with-T5--tp19859317p19859317.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: Tapestry 5 : The requested resource (/login) is not available. error in Tomcat

2008-10-07 Thread Thiago H. de Paula Figueiredo
Em Tue, 07 Oct 2008 11:00:29 -0300, LakshithaS <[EMAIL PROTECTED]>  
escreveu:



HTTP Status 404 - /login

type Status report

message /login

description The requested resource (/login) is not available.
Apache Tomcat/5.0.27


Check your logs. It looks like your application was not started  
successfully.


--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
Consultor, desenvolvedor e instrutor em Java
http://www.arsmachina.com.br/thiago

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



Tapestry 5 : The requested resource (/login) is not available. error in Tomcat

2008-10-07 Thread LakshithaS

Dear All,
I would like to mention an issue which i have recently faced and still
fighting to resolve, I have developed an application using Tapestry (5.0.10)
and finally hosted in newly purchased GoDaddy account. its a deluxe hosting
plan and supports JSP/servlet they use Tomcat 5.0.27 version. Although they
provide only WEB-INF forlder for us, i mean it's a shared tomcat server and
cannot manage the server by ourself, Tomcat will be restarted everyday by
them. Once we uploaded the content it will be available once tomcat
restarted by them. 

After uploading the my .war file, it will exploded correctly, but after
accessing the URL it reports 
As they say, after exploding the .war file it should be worked properly and
do not need any special configs

HTTP Status 404 - /login

type Status report

message /login

description The requested resource (/login) is not available.
Apache Tomcat/5.0.27

This application is works fine in localhost and other networks under same
Tomcat version.

I have attached a screen shot of my home directory's file structure and i
have not done any special configurations than Tapestry 5 default configs,
following is the web.xml file




http://java.sun.com/dtd/web-app_2_3.dtd";>

valuator Tapestry 5 Application


tapestry.app-package
com.dsm.web



app
org.apache.tapestry.TapestryFilter


app
/*



com.dsm.web.services.SessionExpirationListener



30




please help me on this issue... 

thanks a lot
-- 
View this message in context: 
http://www.nabble.com/Tapestry-5-%3A-The-requested-resource-%28-login%29-is-not-available.-error-in-Tomcat-tp19858735p19858735.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



[T5] Weird page loading exception

2008-10-07 Thread Thiago H. de Paula Figueiredo

Hi!

I'm getting this exception when trying to use one package (Tapestry CRUD)  
in another project (Example):


Base class br.com.arsmachina.tapestrycrud.base.BasePage (super class of  
br.com.arsmachina.tapestrycrud.base.BaseListPage) is not in a controlled  
package and is therefore not valid. You should try moving the class to  
package br.com.arsmachina.tapestrycrud.base.


In other words: Tapestry is telling me to move a class to its own package.  
Weird. And it worked perfectly until some time ago.

I've checked the classpath and the package is included just once.

Any suggestions?

Thanks in advance.

--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
Consultor, desenvolvedor e instrutor em Java
http://www.arsmachina.com.br/thiago

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



RE: October release for v5?

2008-10-07 Thread Jonathan Barker

I've had production apps in place since 5.0.5.  Actually, I have one that's
still running on 5.0.5.

Anything I have in active development just follows the most current release,
or snapshot.  Hop on the bandwagon.  If you are looking to move, there's no
time like the present.

Jonathan


> -Original Message-
> From: Joel Halbert [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, October 07, 2008 07:59
> To: users@tapestry.apache.org
> Subject: October release for v5?
> 
> Hi Tapestry Community,
> 
> Apologies if this question has been answered elsewhere many times, but I
> wanted to get a feel for when the final production ready release of
> Tapestry 5 might be available? Is this still scheduled for October?
> (I've been keenly anticipating Tapestry 5 since May, currently we use
> Wicket but I'm frustrated with the hoops that developers must jump
> through to build stateless pages in Wicket).
> 
> I get the feeling that the current 5.0.15 is a good version to develop
> against for the time being? Can anyone confirm this?
> 
> Thanks,
> 
> Joel
> 
> --
> SU3 Analytics Ltd
> 61b Oxford Gardens
> W10 5UJ
> London
> 
> Tel: +44 20 8960 2634
> Mob: +44 75 2501 0825
> www.su3analytics.com
> 
> SU3 Analytics Ltd is a company registered in England and Wales under
> company number 06639473 at registered address 61b Oxford Gardens, London
> W10 5UJ, United Kingdom.
> 
> 
> 
> -
> 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: type of Component

2008-10-07 Thread Thiago H. de Paula Figueiredo
Em Tue, 07 Oct 2008 09:54:34 -0300, Walid Iguer <[EMAIL PROTECTED]>  
escreveu:



Delegate Component does not suit for me. This requires me to write any
blocks on my page


It can use blocks from other pages too.


I would like the type to be implemented dynamically.

For example:




Tapestry does not allow you to do that.

--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
Consultor, desenvolvedor e instrutor em Java
http://www.arsmachina.com.br/thiago

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



Re: type of Component

2008-10-07 Thread Walid Iguer
Delegate Component does not suit for me. This requires me to write any
blocks on my page

I would like the type to be implemented dynamically.

For example:



Thanks


2008/10/7 Thiago H. de Paula Figueiredo <[EMAIL PROTECTED]>

> Em Tue, 07 Oct 2008 09:28:58 -0300, Walid Iguer <[EMAIL PROTECTED]>
> escreveu:
>
>  Hi,
>>
>> I'm looking for a way to dynamically implement a "type" of Component.
>>
>> Do you have a solution?
>>
>
> Use blocks and the Delegate component:
> http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/Delegate.html
> .
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java consultant, developer, and instructor
> Consultor, desenvolvedor e instrutor em Java
> http://www.arsmachina.com.br/thiago
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: type of Component

2008-10-07 Thread Thiago H. de Paula Figueiredo
Em Tue, 07 Oct 2008 09:28:58 -0300, Walid Iguer <[EMAIL PROTECTED]>  
escreveu:



Hi,

I'm looking for a way to dynamically implement a "type" of Component.

Do you have a solution?


Use blocks and the Delegate component:  
http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/Delegate.html.


--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
Consultor, desenvolvedor e instrutor em Java
http://www.arsmachina.com.br/thiago

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



Re: type of Component

2008-10-07 Thread Toby Hobson
What errors do you see?

2008/10/7 Walid Iguer <[EMAIL PROTECTED]>

> Hi,
>
> I'm looking for a way to dynamically implement a "type" of Component.
>
> Do you have a solution?
>
> Currently, I do this: (the method does not like me)
>
>   ...
>  
>   
>   
>
>   
>   
>   
>   
>   
>   
>   
>
>
> Thanks,
>
> Wig
>


type of Component

2008-10-07 Thread Walid Iguer
Hi,

I'm looking for a way to dynamically implement a "type" of Component.

Do you have a solution?

Currently, I do this: (the method does not like me)

   ...
  
   
   

   
   
   
   
   
   
   


Thanks,

Wig


Re: Problem injecting ApplicationStateManager into service implementing commons-upload ProgressListener

2008-10-07 Thread Francois Armand

Pierre-Alain RIVIERE wrote:

Hello,

Maybe it's related but 5.0.14 gives me the same result here. 
But the use case seems to be the same : contributing a RequestFilter

with the ApplicationStateService thrown a NPE.

And no solution or hack for now. Too bad cause my webapp is just a
simple upload manager for my own purpose.

I've also a solution using http://swfupload.org/ for upload progress but
there's some known issues using it on Linux :/

  


Hum, I'm trying to look at this problem, and find some disturbing things.
- it's not a reproductible behaviour. In our team, we are 4 
developers+an integration server, with different jvm flavour (1.5 and 
1.6), and different appserver (jetty, jetty with run jetty run plugin, 
tomcat). Not every developers have the pb, and with no specific 
configuration link between the error and the NPE ;


-  in my pc (java 5 or 6, run jetty run), the behavior depends off 
the debug level for org.apache.tapestry. In debug level, all is good, in 
info, I get the NPE. (so that I can't debug it :)


It's becoming to look like a Javassist bug...



--
Francois Armand
Etudes & Développements J2EE
Groupe Linagora - http://www.linagora.com
Tél.: +33 (0)1 58 18 68 28
---
InterLDAP - http://interldap.org 
FederID - http://www.federid.org/

Open Source identities management and federation


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



October release for v5?

2008-10-07 Thread Joel Halbert

Hi Tapestry Community,

Apologies if this question has been answered elsewhere many times, but I 
wanted to get a feel for when the final production ready release of 
Tapestry 5 might be available? Is this still scheduled for October?
(I've been keenly anticipating Tapestry 5 since May, currently we use 
Wicket but I'm frustrated with the hoops that developers must jump 
through to build stateless pages in Wicket).


I get the feeling that the current 5.0.15 is a good version to develop 
against for the time being? Can anyone confirm this?


Thanks,

Joel

--
SU3 Analytics Ltd
61b Oxford Gardens
W10 5UJ
London

Tel: +44 20 8960 2634
Mob: +44 75 2501 0825
www.su3analytics.com

SU3 Analytics Ltd is a company registered in England and Wales under company 
number 06639473 at registered address 61b Oxford Gardens, London W10 5UJ, 
United Kingdom.



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



[T5] application hangs regularly (windows, maven jetty:run)

2008-10-07 Thread Andy Pahne


Hi,

I am currently developing a T5 app. I run it with the maven jett plugin 
on a windows box. I tried T 5.0.15 and 5.0.16-SNAPSHOT.


The application hangs regularly. When I start it and then start to 
navigate the application pages, after the third or fourth page view, the 
server stops almost always. The page in question does not load 
completly, as the browser indicates that it is still loading. However, 
by that time I cannot even stop jetty cleanly anymore or load any other 
page in another browser instance.


Does anybody else experience this? Or is it my local environment?

By the way: I first thought it's the known windows file locking problem 
described here:

   http://docs.codehaus.org/display/JETTY/Files+locked+on+Windows
Anyway, the proposed fix did not change anything.


Andy

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



Re: T5: Serverpush functionality?

2008-10-07 Thread Otho
Thank you both for your tips!

Regards,
Otho

2008/10/6 Lance Java <[EMAIL PROTECTED]>

> Use dwr's reverse ajax... it's great!
> http://directwebremoting.org/dwr/reverse-ajax
>
> If you download the sample war it has examples including a chat
> application.
>
> Dwr3.0 is soon to be released with a whole lot of reverse-ajax niceness.
>
> 2008/10/6 Thiago H. de Paula Figueiredo <[EMAIL PROTECTED]>
>
> > Em Mon, 06 Oct 2008 09:19:57 -0300, Otho <[EMAIL PROTECTED]>
> escreveu:
> >
> >
> >  Hi all!
> >>
> >> I am musing about a little project where there is for example a simple
> >> chatserver in the background and a frontend built with tapestry where a
> >> small portion of the page is used as chatwindow.
> >>
> >> I don't want to use Webstart or an applet but just plain T5.
> >>
> >> Has anyone already done serverpush with T5 and would like to share the
> >> howto or could anyone direct me at some documents about how to do
> reverse
> >> ajax
> >> with Tapestry?
> >>
> >
> > Take a look at Comet: http://cometdproject.dojotoolkit.org/. As far as I
> > know, there is no ready-to-use implementation in T5, but I think it will
> be
> > more related to Javascript than to T5.
> >
> > --
> > Thiago H. de Paula Figueiredo
> > Independent Java consultant, developer, and instructor
> > Consultor, desenvolvedor e instrutor em Java
> > http://www.arsmachina.com.br/thiago
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>


Re: Zone update

2008-10-07 Thread Ulrich Stärk
That doesn't work at the moment, an issue has already been opened:
https://issues.apache.org/jira/browse/TAP5-138

You can register with JIRA and vote for it.

Uli

Am Di, 7.10.2008, 11:19, schrieb Zlatko Kuvendziski:
> Hi! Does any one know how to update a zone, but with a select component.
> I know how to make that with actionLink -->
> http://www.infoq.com/articles/tapestry5-intro , but I need to make it
> onCnange from the select component, if thats even possible...
>
> I'm using tapestry 5.0.15
>
> here's a sample code, but I think that tapestry doesn't recognizes it
> like in action link:
>
>t:value="selectedProject" t:encoder="projectEncoder"
>   t:mixins="t5components/OnEvent" event="change"
> t:context="checkList.id"
>   zone="issueListSelectZone"/>
>
> regards
> Zlatko
>
> -
> 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: Validation message defaults

2008-10-07 Thread Blower, Andy
Okay, I've raised a JIRA TAP5-253 for this.

> -Original Message-
> From: Blower, Andy
> Sent: 01 October 2008 15:04
> To: 'Tapestry users'
> Subject: T5: Validation message defaults
>
> I'm trying to set up validation for our forms and I need to customise
> the default validation messages. Unfortunately there doesn't seem to be
> a way to do this as contributing to ValidationMessagesSource just adds
> new messages for new validators. I need to change the default messages
> to what we need.
>
> I know that we can override the message for each field name in the
> message catalogs, but this is undesirable (& expensive with extra
> translations needed) because they'll all be the same. The only solution
> I've found is to override this with a properties file in the
> tapestry5.internal package but this doesn't work in every environment
> so it's not really a good solution.
>
> Can anyone help with this or is there a JIRA or something?
>
> Thanks,
>
> Andy
>
> -
> 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]



Zone update

2008-10-07 Thread Zlatko Kuvendziski
Hi! Does any one know how to update a zone, but with a select component. 
I know how to make that with actionLink --> 
http://www.infoq.com/articles/tapestry5-intro , but I need to make it 
onCnange from the select component, if thats even possible...


I'm using tapestry 5.0.15

here's a sample code, but I think that tapestry doesn't recognizes it 
like in action link:


  	t:mixins="t5components/OnEvent" event="change"  
t:context="checkList.id"

zone="issueListSelectZone"/>

regards
Zlatko

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



Re: Access the ApplicationGlobals inside the "AppModule::bind()" method

2008-10-07 Thread Ulrich Stärk
After you defined the PropertiesFileSymbolProvider, you have to contribute
it to the SymbolSource service (see the HOWTO). Afterwards you can just
@Inject @Symbol("your-symbol-name-here") final String something into your
service builder method, e.g.

public YourService buildYourService(@Inject @Symbol("mysymbol") final
String mysymbol)
{
  // do something using mysymbol
}

The symbol's value will be searched in different places (see the HOWTO),
including the PropertiesFileSymbolProvider if contributed...

Uli

Am Di, 7.10.2008, 11:07, schrieb Edouard sur edouardmercier.fr:
> Thank you for this very quick and clear answer!
>
> Does it mean that I will be able to inject the
> "PropertiesFileSymbolProvider" object inside the
> "AppModule::bind(ServiceBinder binder,
> @InjectService("PropertiesFileSymbolProvider") SymbolProvider
> propertiesFileSymbolProvider)" method this way? Or should I declare a
> "@Inject @Symbol(value="MyParam") private String myParam;" (should be
> static) inside my AppModule (after having declared the properties
> symbol provider via the "public PropertiesFileSymbolProvider
> buildPropertiesFileSymbolProvider(Logger logger)" and "public static
> void contributeSymbolSource(OrderedConfiguration
> configuration, ..." methods)?
>
> Because I need to access the property before the service is created,
> since it's implementation should depend on some property.
>
> Thank you.
> Édouard
>
> -
> 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: Access the ApplicationGlobals inside the "AppModule::bind()" method

2008-10-07 Thread Ville Virtanen

Just 

bind(@Inject @Symbol("some.identifier") String someSymbol)

I think. This initiates the construction of symbolsource, which in turn
calls the contribute in your appmodule which initiates the construction of
the PropertiesFileSymbolProvider which reads the file.

And btw, I would recommend http://www.nabble.com/Tapestry-f302.html to read
the post lists. You see both developer and user forums from that link, but
can filter either one by choosing the appropriate one from the top of the
page. (Child Forums)



Edouard sur edouardmercier.fr wrote:
> 
> Thank you for this very quick and clear answer!
> 
> Does it mean that I will be able to inject the
> "PropertiesFileSymbolProvider" object inside the
> "AppModule::bind(ServiceBinder binder,
> @InjectService("PropertiesFileSymbolProvider") SymbolProvider
> propertiesFileSymbolProvider)" method this way? Or should I declare a
> "@Inject @Symbol(value="MyParam") private String myParam;" (should be
> static) inside my AppModule (after having declared the properties
> symbol provider via the "public PropertiesFileSymbolProvider
> buildPropertiesFileSymbolProvider(Logger logger)" and "public static
> void contributeSymbolSource(OrderedConfiguration
> configuration, ..." methods)?
> 
> Because I need to access the property before the service is created,
> since it's implementation should depend on some property.
> 
> Thank you.
> Édouard
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Access-the-ApplicationGlobals-inside-the-%22AppModule%3A%3Abind%28%29%22-method-tp19853806p19854609.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: Access the ApplicationGlobals inside the "AppModule::bind()" method

2008-10-07 Thread Edouard sur edouardmercier.fr
Thank you for this very quick and clear answer!

Does it mean that I will be able to inject the
"PropertiesFileSymbolProvider" object inside the
"AppModule::bind(ServiceBinder binder,
@InjectService("PropertiesFileSymbolProvider") SymbolProvider
propertiesFileSymbolProvider)" method this way? Or should I declare a
"@Inject @Symbol(value="MyParam") private String myParam;" (should be
static) inside my AppModule (after having declared the properties
symbol provider via the "public PropertiesFileSymbolProvider
buildPropertiesFileSymbolProvider(Logger logger)" and "public static
void contributeSymbolSource(OrderedConfiguration
configuration, ..." methods)?

Because I need to access the property before the service is created,
since it's implementation should depend on some property.

Thank you.
Édouard

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



Re: How to access an ASO in a non-servlet thread

2008-10-07 Thread Ulrich Stärk
Am Di, 7.10.2008, 10:38, schrieb Edouard sur edouardmercier.fr:
> Thank you Uli.
>
> I had already taken a look at the two pointers you have provided,
> without really understanding them: I'm a bit lost on how to start
> with. I've understood that I must create a service and declare it
> inside the AppModule class. I've seen that I should declare an
> interface for such a service, and of course an implementation. I've
> seen that the "PerthreadManager" instance seems to be injected into
> the service implementation.
>
> But:
>
>  - I do not understand the exact purpose of this "PerthreadManager"
> class (since we only use its "cleanup()" method)

The PerthreadManager is used for storing per-thread data. You can put()
and get() data from it and when you call cleanup(), that data is
discarded. See here
http://tapestry.apache.org/tapestry5/apidocs/index.html?org/apache/tapestry5/corelib/components/Select.html
for the API docs.

>  - I do not know how to declare the service in the IoC (is that like
> any regular service in the "bind()" method ?)

Yes. Alternatively you can write a public static YourService
buildYourService(...) method and instantiate it there. See
http://tapestry.apache.org/tapestry5/tapestry-ioc/service.html for
details.

>
> I must also indicate that each client servlet will create its own
> notification thread, and I am afraid that a central service will not
> help...

The above mentioned URL also provides documentation about service scopes.
One scope is the perthread scope, creating an instance of your service for
every thread (i.e. every request).

Cheers,

Uli


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



Re: Access the ApplicationGlobals inside the "AppModule::bind()" method

2008-10-07 Thread Ulrich Stärk
Some of us (including me) tried to do the same thing but failed. See here
http://markmail.org/message/hdcboxjrxkrgruyy for the discussion. It seems
to come down to the order in which services are instantiated. By the time
your service is being instantiated, the ServletContext has not yet been
set in the ApplicationGlobals service and thus is null. At the moment,
there doesn't seem to be a workaround if you want to configure your
services whith init-params. You could, however, use a properties file. How
to do that is explained here:
http://wiki.apache.org/tapestry/Tapestry5HowToReadSymbolsFromPropertiesFile

HTH,

Uli

Am Di, 7.10.2008, 10:42, schrieb Edouard sur edouardmercier.fr:
> Hello again.
>
> I would like the service implementation binding (inside the
> "AppModule::bind(ServiceBinder binder)") to depend on the web.xml
> configuration file. This is the reason why I would like to access the
> ApplicationGlobal instance inside the method (in order to call as
> "globals.getServletContext().getInitParameter("MyParam")"), so as to
> provide the right implementation depending on some "context-param"
> value.
>
> Is it feasible? Is there a work-around, or another way to achieve that,
> please?
>
> Thank you so much for your help.
> Édouard
>
> -
> 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]



Access the ApplicationGlobals inside the "AppModule::bind()" method

2008-10-07 Thread Edouard sur edouardmercier.fr
Hello again.

I would like the service implementation binding (inside the
"AppModule::bind(ServiceBinder binder)") to depend on the web.xml
configuration file. This is the reason why I would like to access the
ApplicationGlobal instance inside the method (in order to call as
"globals.getServletContext().getInitParameter("MyParam")"), so as to
provide the right implementation depending on some "context-param"
value.

Is it feasible? Is there a work-around, or another way to achieve that, please?

Thank you so much for your help.
Édouard

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



Re: How to access an ASO in a non-servlet thread

2008-10-07 Thread Edouard sur edouardmercier.fr
Thank you Uli.

I had already taken a look at the two pointers you have provided,
without really understanding them: I'm a bit lost on how to start
with. I've understood that I must create a service and declare it
inside the AppModule class. I've seen that I should declare an
interface for such a service, and of course an implementation. I've
seen that the "PerthreadManager" instance seems to be injected into
the service implementation.

But:

 - I do not understand the exact purpose of this "PerthreadManager"
class (since we only use its "cleanup()" method)
 - I do not know how to declare the service in the IoC (is that like
any regular service in the "bind()" method ?)

I must also indicate that each client servlet will create its own
notification thread, and I am afraid that a central service will not
help...

Thank you for your help.
Édouard

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



Re: How to access an ASO in a non-servlet thread

2008-10-07 Thread Ulrich Stärk
You can build a Tapestry ioc service around your notification receiver
thread which manages the thread and exposes any notification received.
This service can then be injected into your pages and components and can
be queried for any received notifications.

See http://wiki.apache.org/tapestry/Tapestry5HowToRunTaskInThread and
http://wiki.apache.org/tapestry/Tapestry5HowToWorkQueue for examples.

HTH,

Uli

Am Di, 7.10.2008, 09:24, schrieb Edouard sur edouardmercier.fr:
> Hi everyone.
>
> I'm currently facing the following problem: my T5 (0.15) web
> application receive notifications in a dedicated non servlet thread
> inside some of my Tapestry components, which have an
> ApplicationStateObject attribute. I would like to update the state of
> the ASO, but the problem is that the thread that triggers some
> callback in my Tapestry component cannot thus access the AOS (since I
> guess resort to ThreadLocal attributes inside the IoC). I can bind the
> dedicated notification thread to the servlet thread that created it.
>
> Is there a way in Tapestry to work this around, please?
>
> Thank you. Cheers, Édouard
>
> -
> 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]



How to access an ASO in a non-servlet thread

2008-10-07 Thread Edouard sur edouardmercier.fr
Hi everyone.

I'm currently facing the following problem: my T5 (0.15) web
application receive notifications in a dedicated non servlet thread
inside some of my Tapestry components, which have an
ApplicationStateObject attribute. I would like to update the state of
the ASO, but the problem is that the thread that triggers some
callback in my Tapestry component cannot thus access the AOS (since I
guess resort to ThreadLocal attributes inside the IoC). I can bind the
dedicated notification thread to the servlet thread that created it.

Is there a way in Tapestry to work this around, please?

Thank you. Cheers, Édouard

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