RE: T5: Component Suggestion/Question

2009-01-23 Thread James Sherwood
Hello,

Thanks for the help it got me in the right direction(I think:).

>Very nice! You could even contribute it to the Tapestry components  
>collection!

I would love to contribute if it was good enough, not sure how though.

>String javascript = "Event.observe($(%s), 'click',  
>this.simplify.bindAsEventListener(this));";
> renderSupport.addScript(String.format(javascript,  
>element.getClientId(), message));

 I am not sure what "this.simplify.bindAsEventListener(this)" was for or the
"message" in renderSupport.addScript(String.format(javascript,  
element.getClientId(), message));.

I looked into prototype following your lead and came up with:
String javascript = "Event.observe($('%s'),
'click',function(){$('%s').click();});";
renderSupport.addScript(String.format(javascript,
getClientId() + "Button",getClientId()));

And it works like a charm. I don't know if it is the correct way to do it or
not though.  It basically puts the observe in the Tapestry.onDOMLoad
function at the bottom of the page.

Thanks,
--James 

-Original Message-
From: Thiago H. de Paula Figueiredo [mailto:thiag...@gmail.com] 
Sent: January-22-09 10:23 PM
To: Tapestry users
Subject: Re: T5: Component Suggestion/Question

Em Thu, 22 Jan 2009 22:12:03 -0300, James Sherwood  
 escreveu:

> Thank you,

:)

> However I believe I have solved it and can still just use form fragments.
>
> Below is my class which basically just keeps the checkbox hidden and  
> fires the click from the button(I believe the reason only a checkbox or  
> radio is used is because the element itself keeps track of the state, if  
> it was a
> button they javascript would have to keep track of it).

Very nice! You could even contribute it to the Tapestry components  
collection!

> QUESTION: "onclick", "document.getElementById('" + getClientId() +
> "').click()"); Is not proper at all I believe.  Does anyone know how to  
> do this properly with tapestry?  Would just have to figure out a way to  
> fire
> the observe function with the clientid maybe?

AFAIK this is much more of a Javascript issue than a Tapestry one. We  
should then use Prototype's event handling.

You could use something like this (not tested):

Component class:

@Inject
private RenderSupport renderSupport;

@BeginRender
void begin(MarkupWriter writer) {

 ... render HTML without any onclick attributes

 // Add a Javascript code line that will bind the click event of your
 // button to function
 String javascript = "Event.observe($(%s), 'click',  
this.simplify.bindAsEventListener(this));";
 renderSupport.addScript(String.format(javascript,  
element.getClientId(), message));

}

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

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


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



Re: Authentication

2009-01-23 Thread Borut Bolčina
Ups, that was beers :-)

2009/1/23 Borut Bolčina 

> 100 bears for Ulrich!
>
> It works. You made my day. Thanks,
>
> -Borut
>
> 2009/1/23 Ulrich Stärk 
>
> Hi Borut,
>>
>> the problem was that both the OpenIdProcessingFilter and the filter used
>> for form-based authentication both were configured for the same url, namely
>> spring-security.check.url. Therefore both filters tried to process the
>> credentials entered, which had to fail. I updated the wiki article.
>> Basically it's all about introducing a new symbol,
>> spring-security.openidcheck.url with the value
>> "/j_spring_openid_security_check" and configuring the login page and the
>> OpenId processing filter to use this instead of the
>> spring-security.check.url. Then you can have to forms on your login page,
>> one for openid login and the other for form-based logins and everything
>> should work.
>>
>>
>> Cheers,
>>
>> Uli
>>
>>
>> Borut Bolčina schrieb:
>>
>>> Sure!
>>>
>>> 2008/12/12 Ulrich Stärk 
>>>
>>>  Please give me some time to have a look, atm I'm busy writing a paper
 for a
 conference in january.

 Cheers,

 Uli

 Borut Bolčina schrieb:

  Hello Ulrich,

> I hope you don't mind me writing you directly. I am trying to implement
> OpenID and Username/Password authentication. I read your great article
> at
> T5
> wiki.
>
> My goal: authenticate via DaoAuthenticationProvider if user inputs
> username
> and password OR authenticate via OpenIDAuthenticationProvider if user
> enters
> openid url.
>
> The problem: OpenIDAuthenticationProvider is trying to authenticate
> eventhough it is contributed as second provider.
>
> Can you please have a look at the AppModule code and suggest a
> correction?
>
> AppModule.java
> 
> import java.io.IOException;
>
> import
> nu.localhost.tapestry5.springsecurity.services.SpringSecurityServices;
> import
>
>
> nu.localhost.tapestry5.springsecurity.services.internal.HttpServletRequestFilterWrapper;
>
> import org.apache.tapestry5.SymbolConstants;
> import org.apache.tapestry5.ioc.MappedConfiguration;
> import org.apache.tapestry5.ioc.OrderedConfiguration;
> import org.apache.tapestry5.ioc.ServiceBinder;
> import org.apache.tapestry5.ioc.annotations.Inject;
> import org.apache.tapestry5.ioc.annotations.InjectService;
> import org.apache.tapestry5.ioc.annotations.Local;
> import org.apache.tapestry5.ioc.annotations.Value;
> import org.apache.tapestry5.services.HttpServletRequestFilter;
> import org.apache.tapestry5.services.Request;
> import org.apache.tapestry5.services.RequestFilter;
> import org.apache.tapestry5.services.RequestHandler;
> import org.apache.tapestry5.services.Response;
> import org.slf4j.Logger;
> import org.springframework.security.AuthenticationManager;
> import org.springframework.security.providers.AuthenticationProvider;
> import org.springframework.security.providers.dao.SaltSource;
> import org.springframework.security.providers.encoding.PasswordEncoder;
> import
>
>
> org.springframework.security.providers.openid.OpenIDAuthenticationProvider;
> import
>
>
> org.springframework.security.ui.openid.OpenIDAuthenticationProcessingFilter;
> import org.springframework.security.ui.rememberme.RememberMeServices;
> import org.springframework.security.userdetails.UserDetailsService;
>
> /**
>  * This module is automatically included as part of the Tapestry IoC
> Registry, it's a good place to configure and extend
>  * Tapestry, or to place your own service definitions.
>  */
> public class AppModule {
>   public static void bind(ServiceBinder binder) {
>   binder.bind(PersistenceManager.class,
> PersistenceManagerImpl.class);
>   }
>
>   public static void
> contributeApplicationDefaults(MappedConfiguration
> configuration) {
>   configuration.add(SymbolConstants.SUPPORTED_LOCALES,
> "sl_SI,sr,en");
>
>   // The factory default is true but during the early stages of an
> application
>   // overriding to false is a good idea. In addition, this is often
> overridden
>   // on the command line as -Dtapestry.production-mode=false
>   configuration.add(SymbolConstants.PRODUCTION_MODE, "false");
>   configuration.add(SymbolConstants.COMPRESS_WHITESPACE, "false");
>
>   configuration.add("spring-security.failure.url",
> "/login/failed");
>   // configuration.add( "spring-security.accessDenied.url",
> "/forbidden" );
>   // configuration.add(
>   // "spring-security.check.url",
>   // "/j_spring_security_check" );
>   configuration.add("spring-security.target.url", "/index");
>   // configuration.add( "spring-security.afterlogou

Re: Authentication

2009-01-23 Thread Borut Bolčina
100 bears for Ulrich!

It works. You made my day. Thanks,

-Borut

2009/1/23 Ulrich Stärk 

> Hi Borut,
>
> the problem was that both the OpenIdProcessingFilter and the filter used
> for form-based authentication both were configured for the same url, namely
> spring-security.check.url. Therefore both filters tried to process the
> credentials entered, which had to fail. I updated the wiki article.
> Basically it's all about introducing a new symbol,
> spring-security.openidcheck.url with the value
> "/j_spring_openid_security_check" and configuring the login page and the
> OpenId processing filter to use this instead of the
> spring-security.check.url. Then you can have to forms on your login page,
> one for openid login and the other for form-based logins and everything
> should work.
>
>
> Cheers,
>
> Uli
>
>
> Borut Bolčina schrieb:
>
>> Sure!
>>
>> 2008/12/12 Ulrich Stärk 
>>
>>  Please give me some time to have a look, atm I'm busy writing a paper for
>>> a
>>> conference in january.
>>>
>>> Cheers,
>>>
>>> Uli
>>>
>>> Borut Bolčina schrieb:
>>>
>>>  Hello Ulrich,
>>>
 I hope you don't mind me writing you directly. I am trying to implement
 OpenID and Username/Password authentication. I read your great article
 at
 T5
 wiki.

 My goal: authenticate via DaoAuthenticationProvider if user inputs
 username
 and password OR authenticate via OpenIDAuthenticationProvider if user
 enters
 openid url.

 The problem: OpenIDAuthenticationProvider is trying to authenticate
 eventhough it is contributed as second provider.

 Can you please have a look at the AppModule code and suggest a
 correction?

 AppModule.java
 
 import java.io.IOException;

 import
 nu.localhost.tapestry5.springsecurity.services.SpringSecurityServices;
 import


 nu.localhost.tapestry5.springsecurity.services.internal.HttpServletRequestFilterWrapper;

 import org.apache.tapestry5.SymbolConstants;
 import org.apache.tapestry5.ioc.MappedConfiguration;
 import org.apache.tapestry5.ioc.OrderedConfiguration;
 import org.apache.tapestry5.ioc.ServiceBinder;
 import org.apache.tapestry5.ioc.annotations.Inject;
 import org.apache.tapestry5.ioc.annotations.InjectService;
 import org.apache.tapestry5.ioc.annotations.Local;
 import org.apache.tapestry5.ioc.annotations.Value;
 import org.apache.tapestry5.services.HttpServletRequestFilter;
 import org.apache.tapestry5.services.Request;
 import org.apache.tapestry5.services.RequestFilter;
 import org.apache.tapestry5.services.RequestHandler;
 import org.apache.tapestry5.services.Response;
 import org.slf4j.Logger;
 import org.springframework.security.AuthenticationManager;
 import org.springframework.security.providers.AuthenticationProvider;
 import org.springframework.security.providers.dao.SaltSource;
 import org.springframework.security.providers.encoding.PasswordEncoder;
 import


 org.springframework.security.providers.openid.OpenIDAuthenticationProvider;
 import


 org.springframework.security.ui.openid.OpenIDAuthenticationProcessingFilter;
 import org.springframework.security.ui.rememberme.RememberMeServices;
 import org.springframework.security.userdetails.UserDetailsService;

 /**
  * This module is automatically included as part of the Tapestry IoC
 Registry, it's a good place to configure and extend
  * Tapestry, or to place your own service definitions.
  */
 public class AppModule {
   public static void bind(ServiceBinder binder) {
   binder.bind(PersistenceManager.class,
 PersistenceManagerImpl.class);
   }

   public static void
 contributeApplicationDefaults(MappedConfiguration
 configuration) {
   configuration.add(SymbolConstants.SUPPORTED_LOCALES,
 "sl_SI,sr,en");

   // The factory default is true but during the early stages of an
 application
   // overriding to false is a good idea. In addition, this is often
 overridden
   // on the command line as -Dtapestry.production-mode=false
   configuration.add(SymbolConstants.PRODUCTION_MODE, "false");
   configuration.add(SymbolConstants.COMPRESS_WHITESPACE, "false");

   configuration.add("spring-security.failure.url", "/login/failed");
   // configuration.add( "spring-security.accessDenied.url",
 "/forbidden" );
   // configuration.add(
   // "spring-security.check.url",
   // "/j_spring_security_check" );
   configuration.add("spring-security.target.url", "/index");
   // configuration.add( "spring-security.afterlogout.url", "/" );
   // configuration.add( "spring-security.rememberme.key",
 "REMEMBERMEKEY" );
   configuration.add("spring-security.loginform.url", "/login");
   // conf

Re: [DISCUSS] Should the quickstart archetype include tapestry-hibernate?

2009-01-23 Thread Szemere Szemere
Why not include the config needed for tapestry-hibernate in the pom, but
comment it out. That way you don't automatically get the cruft if you don't
want hibernate, but if you do it's really easy to figure out how to include
it.
Szemere


NPE when adding sortable property to model without Conduit

2009-01-23 Thread Jonathan O'Connor

Hi,
I was adding a property to a model, and I set the PropertyConduit to 
null. Then when the grid was rendering I got a big long exception stack 
trace starting with an NPE:


   * 
org.apache.tapestry5.internal.grid.CollectionGridDataSource$2.compare(CollectionGridDataSource.java:78)
   * 
org.apache.tapestry5.internal.grid.CollectionGridDataSource$3.compare(CollectionGridDataSource.java:91)
   * java.util.Arrays.mergeSort(Arrays.java:1270)
   * java.util.Arrays.mergeSort(Arrays.java:1281)
   * java.util.Arrays.sort(Arrays.java:1210)
   * java.util.Collections.sort(Collections.java:159)
   * 
org.apache.tapestry5.internal.grid.CollectionGridDataSource.prepare(CollectionGridDataSource.java:97)
   * 
org.apache.tapestry5.corelib.components.Grid$CachingDataSource.prepare(Grid.java:333)
   * org.apache.tapestry5.corelib.components.Grid.setupDataSource(Grid.java:503)
   * org.apache.tapestry5.corelib.components.Grid.setupRender(Grid.java:468)
   * org.apache.tapestry5.corelib.components.Grid.setupRender(Grid.java)
   * 
org.apache.tapestry5.internal.structure.ComponentPageElementImpl$13$1.run(ComponentPageElementImpl.java:495)
   * 
org.apache.tapestry5.internal.structure.ComponentPageElementImpl.invoke(ComponentPageElementImpl.java:917)
 ETC...

It took me awhile to figure out my problem, so I would like a nicer 
exception thrown in CollectionGridDataSource.prepare if the conduit is 
null, I want to see the name of the property causing the problem.


Should I add a issue to JIRA about this?
Ciao,
Jonathan


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



Re: T5: application/json response and GZip compression

2009-01-23 Thread Howard Lewis Ship
These all sound like issues that should be added to JIRA.  Thanks for
hanging out on the bleeding edge!

On Fri, Jan 23, 2009 at 3:38 AM, Patrick Moriarty
 wrote:
> I've resorted to returning a TextStreamResponse with
> "application/json" as the content type in order to bypass gzip
> compression.
>
> 2009/1/23 Patrick Moriarty :
>> Looks like adding "application/json" to the configuration for
>> ResponseCompressionAnalyzer doesn't quite do it because it's compared
>> directly against "application/json;charset=UTF-8".
>>
>> I could add "application/json;charset=UTF-8" but I think
>> ResponseCompressionAnalyzer should probably ignore the charset and any
>> other parameters in isCompressable()
>>
>> Patrick
>>
>>
>> 2009/1/23 Patrick Moriarty :
>>> Hi,
>>>
>>> Since the recent introduction of gzip compression returning a
>>> JSONObject from a mixin event method results in an empty responseText
>>> in Firefox.  It seems there is some problem with Content-Type:
>>> application/json and Content-Encoding: gzip headers that prevents the
>>> response from being decompressed correctly by the browser.  Has anyone
>>> come across this before?  A Google search doesn't reveal much.
>>>
>>> For now I'm disabling compression for "application/json".  Perhaps
>>> this should be the default behaviour?
>>>
>>> This seems to be the case with IE too.  I attempted to check behaviour
>>> in Opera, but the response was not gzipped since the Accept-Encoding
>>> request header sent by Opera includes a space (eg. "deflate, gzip,
>>> ..." instead of "deflate,gzip,...").
>>> IE6 also includes a space but places gzip at the beginning.  Tapestry
>>> should probably trim the spce before comparing to "gzip" in
>>> ResponseCompressionAnalyzerImpl.
>>>
>>> Thanks,
>>>
>>> Patrick
>>>
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

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



Re: [DISCUSS] Should the quickstart archetype include tapestry-hibernate?

2009-01-23 Thread Daniel Jue
I don't think Hibernate should be added in the quickstart.  Just having an
in-memory DAO is good enough, and a wiki page on adding t5-hibernate to the
vanilla (plain) quickstart can be added.

On Fri, Jan 23, 2009 at 10:16 AM, Robert, Brice <
brice.rob...@alliancebernstein.com> wrote:

> -- No -- Hibernate dependency
>
> But sample class using an annotation to access a service DAO that uses
> Mock Objects (Using Spring or Juice) would be great.
>
> I use:
> - T5 for HTML/CSS/JavaScript,
> - SmartGwt (SmartClient / GWT) for AJAX
> - Spring for DI (Using Annotations)
> - DAO Access through JPA, JMS, JAXB (used to be XmlBeans)
> - DTO Objects are copied from JPA classes or JMS result using
> BeanUtils.copyProperties
> - JPA implementation is either Hibernate or Toplink
> - JMS implementation is either ActiveMQ or WebSphere MQ
>
> Beauty is, with DAO Access I just can use whatever integration
> (data)layer I need.
>
> I am now in the process of creating a T5/GWT OSGI bundle for OSGI
> servers (springsource-DM or ServiceMix)
> Goal is to dynamically load and change the UI according to business
> needs -- total separation of concern -- and to finally use cloud/grid
> computing like Amazon and Google. So my customers don't have to waste
> money by buying hardware pretexting Java is too heavy.
>
> Brice
>
> -Original Message-
> From: Howard Lewis Ship [mailto:hls...@gmail.com]
> Sent: Thursday, January 22, 2009 7:32 PM
> To: Tapestry users
> Subject: [DISCUSS] Should the quickstart archetype include
> tapestry-hibernate?
>
> The title says it all.  It would be very easy to include
> tapestry-hibernate as a dependency, and a minimal hibernate.cfg.xml
> file as well.  Thoughts?
>
> --
> Howard M. Lewis Ship
>
> Creator Apache Tapestry and Apache HiveMind
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>
> ---
> The information contained in the linked e-mail transmission and any
> attachments may be privileged and confidential and is intended only for
> the use of the person(s) named in the linked e-mail transmission. If you
> are not the intended recipient, or an employee or agent responsible for
> delivering this message to the intended recipient, you should not
> review, disseminate, distribute or duplicate this e-mail transmission or
> any attachments. If you are not the intended recipient, please contact
> the sender immediately by reply e-mail and destroy all copies of the
> original message. We do not accept account orders and/or instructions
> related to AllianceBernstein products or services by e-mail, and
> therefore will not be responsible for carrying out such orders and/or
> instructions. The linked e-mail transmission and any attachments are
> provided for informational purposes only and should not be construed in
> any manner as any solicitation or offer to buy or sell any investment
> opportunities or any related financial instruments and should not be
> construed in any manner as a public offer of any investment
> opportunities or any related financial instruments.  If you, as the
> intended recipient of the linked e-mail transmission, the purpose of
> which is to inform and update our clients, prospects and consultants of
> developments relating to our services and products, would not like to
> receive further e-mail correspondence from the sender, please "reply"
> to the sender indicating your wishes.  Although we attempt to sweep
> e-mail and attachments for viruses, we will not be liable for any
> damages arising from the alteration of the contents of this linked e-mail
> transmission and any attachments by a third party or as a result of any
> virus being passed on. Please note: Trading instructions sent
> electronically to Bernstein shall not be deemed accepted until a
> representative of Bernstein acknowledges receipt electronically or by
> telephone. Comments in the linked e-mail transmission and any
> attachments are part of a larger body of investment analysis. For our
> research reports, which contain information that may be used to
> support investment decisions, and disclosures, see our website at
> www.bernsteinresearch.com.
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: Get the referring page

2009-01-23 Thread Peter Stavrinides
Sorry about that last post was a little trigger happy:


private Class callBackPage_;

public void setCallback(Class callback) {
callBackPage_ = callback;
}

Simply set the property before calling the page... it works well just won't 
work with external callbacks.

Peter


-- 
If you are not an intended recipient of this e-mail, please notify the sender, 
delete it and do not read, act upon, print, disclose, copy, retain or 
redistribute it. Please visit http://www.albourne.com/email.html for important 
additional terms relating to this e-mail.

- Original Message -
From: "Peter Stavrinides" 
To: "Tapestry users" 
Sent: Friday, 23 January, 2009 18:11:24 GMT +02:00 Athens, Beirut, Bucharest, 
Istanbul
Subject: Re: Get the referring page

The best way to do this last option is as follows:

-- 
If you are not an intended recipient of this e-mail, please notify the sender, 
delete it and do not read, act upon, print, disclose, copy, retain or 
redistribute it. Please visit http://www.albourne.com/email.html for important 
additional terms relating to this e-mail.

- Original Message -
From: "Marcelo Lotif" 
To: "Tapestry users" 
Sent: Friday, 23 January, 2009 15:12:35 GMT +02:00 Athens, Beirut, Bucharest, 
Istanbul
Subject: Re: Get the referring page

No... looks like it falls in the same problem.

On Fri, Jan 23, 2009 at 9:43 AM, Geoff Callender <
geoff.callender.jumpst...@gmail.com> wrote:

> Does this help?
>
>
> http://jumpstart.doublenegative.com.au:8080/jumpstart/examples/navigation/returntopage1/abc
>
>
> On 23/01/2009, at 11:20 PM, Marcelo Lotif wrote:
>
>  I'm using the last approach, and we don't have any problems.
>> I don't know if this will work if a user calls the page from 2 different
>> pages in 2 different tabs. Maybe on the returning, one of them will be
>> lost.
>> Which of these other approaches will solve this problem?
>>
>> On Fri, Jan 23, 2009 at 9:04 AM, Lance Java > >wrote:
>>
>>  1 more suggestion:
>>> A hidden "returnPage" field on each of referring pages and the referring
>>> pages POST to the multiple entry page.
>>>
>>> 2009/1/23 Peter Stavrinides 
>>>
>>>  Hi everyone,

 I have a page with multiple entry points, when a user is done editing I
 want to return them to their previous page, there are a couple of ways
 of
 doing this I guess:
 - JavaScript (not so keen on this, I prefer a server side redirect)
 - Using the HTTP referer header of the Request service (I am thinking of
 using this, not sure what the drawbacks could be?)
 - ASO (hmmm not sure about the multiple window thing)
 - onActivate (don't want the callback URL to appear in the address bar)
 - Set a property on the page before calling onActivate (this could also
 work, of course it limits me to internal URL's over the referer

>>> approach...
>>>
 but thats probably also okay though)

 I would like to know if there is any possibility that the referer might

>>> not
>>>
 be set correctly under any circumstances etc... or if there is a better

>>> way
>>>
 to call back a previous page/URL.

 Thanks,
 Peter

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



>>>
>>
>>
>> --
>> Atenciosamente,
>>
>> Marcelo Lotif
>> Programador Java e Tapestry
>> FIEC - Federação das Indústrias do Estado do Ceará
>> (85) 3421-5910
>>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


-- 
Atenciosamente,

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

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



Re: Get the referring page

2009-01-23 Thread Peter Stavrinides
The best way to do this last option is as follows:

-- 
If you are not an intended recipient of this e-mail, please notify the sender, 
delete it and do not read, act upon, print, disclose, copy, retain or 
redistribute it. Please visit http://www.albourne.com/email.html for important 
additional terms relating to this e-mail.

- Original Message -
From: "Marcelo Lotif" 
To: "Tapestry users" 
Sent: Friday, 23 January, 2009 15:12:35 GMT +02:00 Athens, Beirut, Bucharest, 
Istanbul
Subject: Re: Get the referring page

No... looks like it falls in the same problem.

On Fri, Jan 23, 2009 at 9:43 AM, Geoff Callender <
geoff.callender.jumpst...@gmail.com> wrote:

> Does this help?
>
>
> http://jumpstart.doublenegative.com.au:8080/jumpstart/examples/navigation/returntopage1/abc
>
>
> On 23/01/2009, at 11:20 PM, Marcelo Lotif wrote:
>
>  I'm using the last approach, and we don't have any problems.
>> I don't know if this will work if a user calls the page from 2 different
>> pages in 2 different tabs. Maybe on the returning, one of them will be
>> lost.
>> Which of these other approaches will solve this problem?
>>
>> On Fri, Jan 23, 2009 at 9:04 AM, Lance Java > >wrote:
>>
>>  1 more suggestion:
>>> A hidden "returnPage" field on each of referring pages and the referring
>>> pages POST to the multiple entry page.
>>>
>>> 2009/1/23 Peter Stavrinides 
>>>
>>>  Hi everyone,

 I have a page with multiple entry points, when a user is done editing I
 want to return them to their previous page, there are a couple of ways
 of
 doing this I guess:
 - JavaScript (not so keen on this, I prefer a server side redirect)
 - Using the HTTP referer header of the Request service (I am thinking of
 using this, not sure what the drawbacks could be?)
 - ASO (hmmm not sure about the multiple window thing)
 - onActivate (don't want the callback URL to appear in the address bar)
 - Set a property on the page before calling onActivate (this could also
 work, of course it limits me to internal URL's over the referer

>>> approach...
>>>
 but thats probably also okay though)

 I would like to know if there is any possibility that the referer might

>>> not
>>>
 be set correctly under any circumstances etc... or if there is a better

>>> way
>>>
 to call back a previous page/URL.

 Thanks,
 Peter

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



>>>
>>
>>
>> --
>> Atenciosamente,
>>
>> Marcelo Lotif
>> Programador Java e Tapestry
>> FIEC - Federação das Indústrias do Estado do Ceará
>> (85) 3421-5910
>>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


-- 
Atenciosamente,

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

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



RE: [DISCUSS] Should the quickstart archetype include tapestry-hibernate?

2009-01-23 Thread Robert, Brice
-- No -- Hibernate dependency 

But sample class using an annotation to access a service DAO that uses
Mock Objects (Using Spring or Juice) would be great.

I use:
- T5 for HTML/CSS/JavaScript, 
- SmartGwt (SmartClient / GWT) for AJAX
- Spring for DI (Using Annotations)
- DAO Access through JPA, JMS, JAXB (used to be XmlBeans)
- DTO Objects are copied from JPA classes or JMS result using
BeanUtils.copyProperties
- JPA implementation is either Hibernate or Toplink
- JMS implementation is either ActiveMQ or WebSphere MQ

Beauty is, with DAO Access I just can use whatever integration
(data)layer I need.

I am now in the process of creating a T5/GWT OSGI bundle for OSGI
servers (springsource-DM or ServiceMix)
Goal is to dynamically load and change the UI according to business
needs -- total separation of concern -- and to finally use cloud/grid
computing like Amazon and Google. So my customers don't have to waste
money by buying hardware pretexting Java is too heavy.

Brice

-Original Message-
From: Howard Lewis Ship [mailto:hls...@gmail.com] 
Sent: Thursday, January 22, 2009 7:32 PM
To: Tapestry users
Subject: [DISCUSS] Should the quickstart archetype include
tapestry-hibernate?

The title says it all.  It would be very easy to include
tapestry-hibernate as a dependency, and a minimal hibernate.cfg.xml
file as well.  Thoughts?

-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

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

---
The information contained in the linked e-mail transmission and any
attachments may be privileged and confidential and is intended only for
the use of the person(s) named in the linked e-mail transmission. If you
are not the intended recipient, or an employee or agent responsible for
delivering this message to the intended recipient, you should not
review, disseminate, distribute or duplicate this e-mail transmission or
any attachments. If you are not the intended recipient, please contact
the sender immediately by reply e-mail and destroy all copies of the 
original message. We do not accept account orders and/or instructions
related to AllianceBernstein products or services by e-mail, and
therefore will not be responsible for carrying out such orders and/or
instructions. The linked e-mail transmission and any attachments are
provided for informational purposes only and should not be construed in
any manner as any solicitation or offer to buy or sell any investment
opportunities or any related financial instruments and should not be
construed in any manner as a public offer of any investment
opportunities or any related financial instruments.  If you, as the
intended recipient of the linked e-mail transmission, the purpose of
which is to inform and update our clients, prospects and consultants of
developments relating to our services and products, would not like to
receive further e-mail correspondence from the sender, please "reply"
to the sender indicating your wishes.  Although we attempt to sweep 
e-mail and attachments for viruses, we will not be liable for any
damages arising from the alteration of the contents of this linked e-mail
transmission and any attachments by a third party or as a result of any
virus being passed on. Please note: Trading instructions sent
electronically to Bernstein shall not be deemed accepted until a
representative of Bernstein acknowledges receipt electronically or by
telephone. Comments in the linked e-mail transmission and any
attachments are part of a larger body of investment analysis. For our
research reports, which contain information that may be used to
support investment decisions, and disclosures, see our website at
www.bernsteinresearch.com.


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



Re: [DISCUSS] Should the quickstart archetype include tapestry-hibernate?

2009-01-23 Thread Robert Zeigler

Yuck. :)

I know hibernate is "all the rage" now, but, honestly, it's not /that/  
hard to go add a dependency.
I prefer the cleaner archetype that doesn't make assumptions about  
what technology stack you'll be using, other than tapestry.


Robert

On Jan 22, 2009, at 1/226:32 PM , Howard Lewis Ship wrote:


The title says it all.  It would be very easy to include
tapestry-hibernate as a dependency, and a minimal hibernate.cfg.xml
file as well.  Thoughts?

--
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

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



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



Re: Get the referring page

2009-01-23 Thread Marcelo Lotif
No... looks like it falls in the same problem.

On Fri, Jan 23, 2009 at 9:43 AM, Geoff Callender <
geoff.callender.jumpst...@gmail.com> wrote:

> Does this help?
>
>
> http://jumpstart.doublenegative.com.au:8080/jumpstart/examples/navigation/returntopage1/abc
>
>
> On 23/01/2009, at 11:20 PM, Marcelo Lotif wrote:
>
>  I'm using the last approach, and we don't have any problems.
>> I don't know if this will work if a user calls the page from 2 different
>> pages in 2 different tabs. Maybe on the returning, one of them will be
>> lost.
>> Which of these other approaches will solve this problem?
>>
>> On Fri, Jan 23, 2009 at 9:04 AM, Lance Java > >wrote:
>>
>>  1 more suggestion:
>>> A hidden "returnPage" field on each of referring pages and the referring
>>> pages POST to the multiple entry page.
>>>
>>> 2009/1/23 Peter Stavrinides 
>>>
>>>  Hi everyone,

 I have a page with multiple entry points, when a user is done editing I
 want to return them to their previous page, there are a couple of ways
 of
 doing this I guess:
 - JavaScript (not so keen on this, I prefer a server side redirect)
 - Using the HTTP referer header of the Request service (I am thinking of
 using this, not sure what the drawbacks could be?)
 - ASO (hmmm not sure about the multiple window thing)
 - onActivate (don't want the callback URL to appear in the address bar)
 - Set a property on the page before calling onActivate (this could also
 work, of course it limits me to internal URL's over the referer

>>> approach...
>>>
 but thats probably also okay though)

 I would like to know if there is any possibility that the referer might

>>> not
>>>
 be set correctly under any circumstances etc... or if there is a better

>>> way
>>>
 to call back a previous page/URL.

 Thanks,
 Peter

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



>>>
>>
>>
>> --
>> Atenciosamente,
>>
>> Marcelo Lotif
>> Programador Java e Tapestry
>> FIEC - Federação das Indústrias do Estado do Ceará
>> (85) 3421-5910
>>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


-- 
Atenciosamente,

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


Re: Get the referring page

2009-01-23 Thread Geoff Callender

Does this help?


http://jumpstart.doublenegative.com.au:8080/jumpstart/examples/navigation/returntopage1/abc

On 23/01/2009, at 11:20 PM, Marcelo Lotif wrote:


I'm using the last approach, and we don't have any problems.
I don't know if this will work if a user calls the page from 2  
different
pages in 2 different tabs. Maybe on the returning, one of them will  
be lost.

Which of these other approaches will solve this problem?

On Fri, Jan 23, 2009 at 9:04 AM, Lance Java  
wrote:



1 more suggestion:
A hidden "returnPage" field on each of referring pages and the  
referring

pages POST to the multiple entry page.

2009/1/23 Peter Stavrinides 


Hi everyone,

I have a page with multiple entry points, when a user is done  
editing I
want to return them to their previous page, there are a couple of  
ways of

doing this I guess:
- JavaScript (not so keen on this, I prefer a server side redirect)
- Using the HTTP referer header of the Request service (I am  
thinking of

using this, not sure what the drawbacks could be?)
- ASO (hmmm not sure about the multiple window thing)
- onActivate (don't want the callback URL to appear in the address  
bar)
- Set a property on the page before calling onActivate (this could  
also

work, of course it limits me to internal URL's over the referer

approach...

but thats probably also okay though)

I would like to know if there is any possibility that the referer  
might

not
be set correctly under any circumstances etc... or if there is a  
better

way

to call back a previous page/URL.

Thanks,
Peter

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








--
Atenciosamente,

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



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



Re: Get the referring page

2009-01-23 Thread Marcelo Lotif
I'm using the last approach, and we don't have any problems.
I don't know if this will work if a user calls the page from 2 different
pages in 2 different tabs. Maybe on the returning, one of them will be lost.
Which of these other approaches will solve this problem?

On Fri, Jan 23, 2009 at 9:04 AM, Lance Java wrote:

> 1 more suggestion:
> A hidden "returnPage" field on each of referring pages and the referring
> pages POST to the multiple entry page.
>
> 2009/1/23 Peter Stavrinides 
>
> > Hi everyone,
> >
> > I have a page with multiple entry points, when a user is done editing I
> > want to return them to their previous page, there are a couple of ways of
> > doing this I guess:
> > - JavaScript (not so keen on this, I prefer a server side redirect)
> > - Using the HTTP referer header of the Request service (I am thinking of
> > using this, not sure what the drawbacks could be?)
> > - ASO (hmmm not sure about the multiple window thing)
> > - onActivate (don't want the callback URL to appear in the address bar)
> > - Set a property on the page before calling onActivate (this could also
> > work, of course it limits me to internal URL's over the referer
> approach...
> > but thats probably also okay though)
> >
> > I would like to know if there is any possibility that the referer might
> not
> > be set correctly under any circumstances etc... or if there is a better
> way
> > to call back a previous page/URL.
> >
> > Thanks,
> > Peter
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >
> >
>



-- 
Atenciosamente,

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


Re: Get the referring page

2009-01-23 Thread Joachim Van der Auwera

I constantly use yout last solution.
However, this begs for a persistence strategt which allows you to have a 
conversation which contains the same page but with different return pages.


Joachim

Peter Stavrinides wrote:

Hi everyone,

I have a page with multiple entry points, when a user is done editing I want to 
return them to their previous page, there are a couple of ways of doing this I 
guess:
- JavaScript (not so keen on this, I prefer a server side redirect)
- Using the HTTP referer header of the Request service (I am thinking of using 
this, not sure what the drawbacks could be?)
- ASO (hmmm not sure about the multiple window thing)
- onActivate (don't want the callback URL to appear in the address bar)
- Set a property on the page before calling onActivate (this could also work, 
of course it limits me to internal URL's over the referer approach... but thats 
probably also okay though)

I would like to know if there is any possibility that the referer might not be 
set correctly under any circumstances etc... or if there is a better way to 
call back a previous page/URL.

Thanks,
Peter

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

  



--
Joachim Van der Auwera
PROGS bvba, progs.be


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



Re: Get the referring page

2009-01-23 Thread Lance Java
1 more suggestion:
A hidden "returnPage" field on each of referring pages and the referring
pages POST to the multiple entry page.

2009/1/23 Peter Stavrinides 

> Hi everyone,
>
> I have a page with multiple entry points, when a user is done editing I
> want to return them to their previous page, there are a couple of ways of
> doing this I guess:
> - JavaScript (not so keen on this, I prefer a server side redirect)
> - Using the HTTP referer header of the Request service (I am thinking of
> using this, not sure what the drawbacks could be?)
> - ASO (hmmm not sure about the multiple window thing)
> - onActivate (don't want the callback URL to appear in the address bar)
> - Set a property on the page before calling onActivate (this could also
> work, of course it limits me to internal URL's over the referer approach...
> but thats probably also okay though)
>
> I would like to know if there is any possibility that the referer might not
> be set correctly under any circumstances etc... or if there is a better way
> to call back a previous page/URL.
>
> Thanks,
> Peter
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: T5: application/json response and GZip compression

2009-01-23 Thread Patrick Moriarty
I've resorted to returning a TextStreamResponse with
"application/json" as the content type in order to bypass gzip
compression.

2009/1/23 Patrick Moriarty :
> Looks like adding "application/json" to the configuration for
> ResponseCompressionAnalyzer doesn't quite do it because it's compared
> directly against "application/json;charset=UTF-8".
>
> I could add "application/json;charset=UTF-8" but I think
> ResponseCompressionAnalyzer should probably ignore the charset and any
> other parameters in isCompressable()
>
> Patrick
>
>
> 2009/1/23 Patrick Moriarty :
>> Hi,
>>
>> Since the recent introduction of gzip compression returning a
>> JSONObject from a mixin event method results in an empty responseText
>> in Firefox.  It seems there is some problem with Content-Type:
>> application/json and Content-Encoding: gzip headers that prevents the
>> response from being decompressed correctly by the browser.  Has anyone
>> come across this before?  A Google search doesn't reveal much.
>>
>> For now I'm disabling compression for "application/json".  Perhaps
>> this should be the default behaviour?
>>
>> This seems to be the case with IE too.  I attempted to check behaviour
>> in Opera, but the response was not gzipped since the Accept-Encoding
>> request header sent by Opera includes a space (eg. "deflate, gzip,
>> ..." instead of "deflate,gzip,...").
>> IE6 also includes a space but places gzip at the beginning.  Tapestry
>> should probably trim the spce before comparing to "gzip" in
>> ResponseCompressionAnalyzerImpl.
>>
>> Thanks,
>>
>> Patrick
>>
>

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



[T.5.0.18] FormSupportAdapter question

2009-01-23 Thread Tapestry Infodea

Hi guys,
I've implemented a new component that make AJAX call on a select change 
event and update the page with the AJAX response. The Ajax response is 
the result of a Block render. The Block contains a BeanEditor.


The following is a sample code portion of what I've done and some 
questions about the implementation:


void beginRender(MarkupWriter writer) {
 Link l = resources.createEventLink("SelectChange");
 renderSupport.addScript("new FieldObserve('%s');", l.toAbsoluteURI());
 componentActions = new ComponentActionSink(logger);
 formSupport = new FormSupportAdapter(formSupport) {
 @Override
 public  void store(T component, ComponentAction action) {
componentActions.store(component, action);
 }
 @Override
 public  void storeAndExecute(T component, ComponentAction action)
 {
componentActions.store(component, action);
action.execute(component);
 }
 };
 environment.push(FormSupport.class, formSupport);
}

void afterRender(MarkupWriter writer) {
 environment.pop(FormSupport.class);
}


/*Ajax Call on select change. Returns a Block containing a BeanEditor.*/
Object onSelectChange() {
 environment.push(FormSupport.class, formSupport);
 environment.push(ValidationTracker.class, validationTracker);
 return getBlock(request.getParameter("value"));
}

The questions:

1)In the onSelectChange method the services FormSupport and 
ValidationTracker are not available in the environment's stack; 
therefore I have to add these services using two previously setted 
persisted (@Persist) variables.

Is there a better way to pass these services to my method?

2)In the method beginRender I must create a new FormSupportAdapter as 
like as FormFragment component otherwise the ComponentActionSink.store() 
method throws an IOException.

Have you any idea I have to create a FormSupportAdapter?

Grazie!

Roberto Iannone.

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



Re: [DISCUSS] Should the quickstart archetype include tapestry-hibernate?

2009-01-23 Thread Thiago HP
On Thu, Jan 22, 2009 at 10:50 PM, Howard Lewis Ship  wrote:
> I'm of the opinion that it's easier to remove unwanted stuff than add
> it in.

Tapestry-hibernate, when it is in the classpath, tries to create a
SessionFactory. So, if someone wants the Tapestry archetype without
Hibernate, at first he/she will have an exception. This has happened
in this list at least two times, as far as I can remember.

This way, I don't think the Tapestry archetype must not have
Tapestry-Hibernate. I also agree with Francois arguments.

-- 
Thiago

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



Re: Authentication

2009-01-23 Thread Ulrich Stärk

Hi Borut,

the problem was that both the OpenIdProcessingFilter and the filter used 
for form-based authentication both were configured for the same url, 
namely spring-security.check.url. Therefore both filters tried to 
process the credentials entered, which had to fail. I updated the wiki 
article. Basically it's all about introducing a new symbol, 
spring-security.openidcheck.url with the value 
"/j_spring_openid_security_check" and configuring the login page and the 
OpenId processing filter to use this instead of the 
spring-security.check.url. Then you can have to forms on your login 
page, one for openid login and the other for form-based logins and 
everything should work.


Cheers,

Uli


Borut Bolčina schrieb:

Sure!

2008/12/12 Ulrich Stärk 


Please give me some time to have a look, atm I'm busy writing a paper for a
conference in january.

Cheers,

Uli

Borut Bolčina schrieb:

 Hello Ulrich,

I hope you don't mind me writing you directly. I am trying to implement
OpenID and Username/Password authentication. I read your great article at
T5
wiki.

My goal: authenticate via DaoAuthenticationProvider if user inputs
username
and password OR authenticate via OpenIDAuthenticationProvider if user
enters
openid url.

The problem: OpenIDAuthenticationProvider is trying to authenticate
eventhough it is contributed as second provider.

Can you please have a look at the AppModule code and suggest a correction?

AppModule.java

import java.io.IOException;

import
nu.localhost.tapestry5.springsecurity.services.SpringSecurityServices;
import

nu.localhost.tapestry5.springsecurity.services.internal.HttpServletRequestFilterWrapper;

import org.apache.tapestry5.SymbolConstants;
import org.apache.tapestry5.ioc.MappedConfiguration;
import org.apache.tapestry5.ioc.OrderedConfiguration;
import org.apache.tapestry5.ioc.ServiceBinder;
import org.apache.tapestry5.ioc.annotations.Inject;
import org.apache.tapestry5.ioc.annotations.InjectService;
import org.apache.tapestry5.ioc.annotations.Local;
import org.apache.tapestry5.ioc.annotations.Value;
import org.apache.tapestry5.services.HttpServletRequestFilter;
import org.apache.tapestry5.services.Request;
import org.apache.tapestry5.services.RequestFilter;
import org.apache.tapestry5.services.RequestHandler;
import org.apache.tapestry5.services.Response;
import org.slf4j.Logger;
import org.springframework.security.AuthenticationManager;
import org.springframework.security.providers.AuthenticationProvider;
import org.springframework.security.providers.dao.SaltSource;
import org.springframework.security.providers.encoding.PasswordEncoder;
import

org.springframework.security.providers.openid.OpenIDAuthenticationProvider;
import

org.springframework.security.ui.openid.OpenIDAuthenticationProcessingFilter;
import org.springframework.security.ui.rememberme.RememberMeServices;
import org.springframework.security.userdetails.UserDetailsService;

/**
 * This module is automatically included as part of the Tapestry IoC
Registry, it's a good place to configure and extend
 * Tapestry, or to place your own service definitions.
 */
public class AppModule {
   public static void bind(ServiceBinder binder) {
   binder.bind(PersistenceManager.class,
PersistenceManagerImpl.class);
   }

   public static void
contributeApplicationDefaults(MappedConfiguration
configuration) {
   configuration.add(SymbolConstants.SUPPORTED_LOCALES,
"sl_SI,sr,en");

   // The factory default is true but during the early stages of an
application
   // overriding to false is a good idea. In addition, this is often
overridden
   // on the command line as -Dtapestry.production-mode=false
   configuration.add(SymbolConstants.PRODUCTION_MODE, "false");
   configuration.add(SymbolConstants.COMPRESS_WHITESPACE, "false");

   configuration.add("spring-security.failure.url", "/login/failed");
   // configuration.add( "spring-security.accessDenied.url",
"/forbidden" );
   // configuration.add(
   // "spring-security.check.url",
   // "/j_spring_security_check" );
   configuration.add("spring-security.target.url", "/index");
   // configuration.add( "spring-security.afterlogout.url", "/" );
   // configuration.add( "spring-security.rememberme.key",
"REMEMBERMEKEY" );
   configuration.add("spring-security.loginform.url", "/login");
   // configuration.add( "spring-security.force.ssl.login", "false" );
   // configuration.add( "spring-security.anonymous.key",
"acegi_anonymous" );
   // configuration.add(
   // "spring-security.anonymous.attribute",
   // "anonymous,ROLE_ANONYMOUS" );
   configuration.add( "spring-security.password.salt", "DEADBEEF" );
   }

   /**
* This is a service definition, the service will be named
"TimingFilter". The interface, RequestFilter, is used
* within the RequestHandler service pipeline, which is built from the
RequestHandler service configuration.
* Tapestry IoC is responsible fo

Re: BLOCK and line selected

2009-01-23 Thread Cathy_123

Finally, I found it. It's a select component

Cathy


Cathy_123 wrote:
> 
> Hi,
> 
> I would like to do a BLOCK that I can let user selecting then sorting the
> lines. Like this example:
> 
> http://picasaweb.google.com/giaotienromang2008/MonAlbum?authkey=IQT560A1HTU#5294129087453679394
> 
> Can you tell me if it's possible to do it ?
> 
> thank you for your help
> 
> Cathy
> 

-- 
View this message in context: 
http://www.nabble.com/BLOCK-and-line-selected-tp21603852p21622581.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



Re: T5: how to invalidate session on logout?

2009-01-23 Thread Kristian Marinkovic
invalidating the http session is the way to go because all the persist and
ASO objects are stored there. 

i have a LogoutService that is called when a user wants to log out. this 
service only deletes an artifact that is used to verify the successfull 
login.
in an dispatcher (see AccessController on the wiki) the artifact is 
checked
and if it does not exist the httpsession is invalidated.

g,
kris





tapestryphoto  
23.01.2009 10:22
Bitte antworten an
"Tapestry users" 


An
users@tapestry.apache.org
Kopie

Thema
T5: how to invalidate session on logout?







I need to be able to reset everything when the user logs out. 
Currently @Persist objects are still available if the user logs in 
again with the same browser instance. This isn't very optimal.

I have searched the mail archive and found some comments on this issue 
made at the end of 2007. I'm wondering if there is a standard way to 
do this. The Wiki appears to be silent on the issue - I would have 
thought this would have had more importance than it seems to have.

According to these prehistoric ;-) postings to the mailing list, one 
should inject RequestGlobals and then call invalidate() on the session.

Is this still the way to do this?  It seems rather clunky and 
non-obvious - especially for the novice T5 programmer who is shown 
numerous examples of logins and ASOs and how to use @Persist. The T5 
page about persistance strategies is also silent on the issue (apart 
from mentioning discardPersistentFieldChanges() - but that would 
require running the method on every page when logging out).

Thoughts?

p.



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




Re: T5: how to invalidate session on logout?

2009-01-23 Thread Thiago HP
I would create an EventLink (the logout link) that, when clicked,
invalidates the session.

Logout

@Inject
private Request request;

@OnEvent("logout)"
void logout() {
request.getSession().invalidate();
}

-- 
Thiago

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



Re: T5: application/json response and GZip compression

2009-01-23 Thread Patrick Moriarty
Looks like adding "application/json" to the configuration for
ResponseCompressionAnalyzer doesn't quite do it because it's compared
directly against "application/json;charset=UTF-8".

I could add "application/json;charset=UTF-8" but I think
ResponseCompressionAnalyzer should probably ignore the charset and any
other parameters in isCompressable()

Patrick


2009/1/23 Patrick Moriarty :
> Hi,
>
> Since the recent introduction of gzip compression returning a
> JSONObject from a mixin event method results in an empty responseText
> in Firefox.  It seems there is some problem with Content-Type:
> application/json and Content-Encoding: gzip headers that prevents the
> response from being decompressed correctly by the browser.  Has anyone
> come across this before?  A Google search doesn't reveal much.
>
> For now I'm disabling compression for "application/json".  Perhaps
> this should be the default behaviour?
>
> This seems to be the case with IE too.  I attempted to check behaviour
> in Opera, but the response was not gzipped since the Accept-Encoding
> request header sent by Opera includes a space (eg. "deflate, gzip,
> ..." instead of "deflate,gzip,...").
> IE6 also includes a space but places gzip at the beginning.  Tapestry
> should probably trim the spce before comparing to "gzip" in
> ResponseCompressionAnalyzerImpl.
>
> Thanks,
>
> Patrick
>

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



T5: application/json response and GZip compression

2009-01-23 Thread Patrick Moriarty
Hi,

Since the recent introduction of gzip compression returning a
JSONObject from a mixin event method results in an empty responseText
in Firefox.  It seems there is some problem with Content-Type:
application/json and Content-Encoding: gzip headers that prevents the
response from being decompressed correctly by the browser.  Has anyone
come across this before?  A Google search doesn't reveal much.

For now I'm disabling compression for "application/json".  Perhaps
this should be the default behaviour?

This seems to be the case with IE too.  I attempted to check behaviour
in Opera, but the response was not gzipped since the Accept-Encoding
request header sent by Opera includes a space (eg. "deflate, gzip,
..." instead of "deflate,gzip,...").
IE6 also includes a space but places gzip at the beginning.  Tapestry
should probably trim the spce before comparing to "gzip" in
ResponseCompressionAnalyzerImpl.

Thanks,

Patrick

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



T5: how to invalidate session on logout?

2009-01-23 Thread tapestryphoto
I need to be able to reset everything when the user logs out.  
Currently @Persist objects are still available if the user logs in  
again with the same browser instance. This isn't very optimal.


I have searched the mail archive and found some comments on this issue  
made at the end of 2007. I'm wondering if there is a standard way to  
do this. The Wiki appears to be silent on the issue - I would have  
thought this would have had more importance than it seems to have.


According to these prehistoric ;-) postings to the mailing list, one  
should inject RequestGlobals and then call invalidate() on the session.


Is this still the way to do this?  It seems rather clunky and  
non-obvious - especially for the novice T5 programmer who is shown  
numerous examples of logins and ASOs and how to use @Persist. The T5  
page about persistance strategies is also silent on the issue (apart  
from mentioning discardPersistentFieldChanges() - but that would  
require running the method on every page when logging out).


Thoughts?

p.



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



BeanModel

2009-01-23 Thread superoverdrive
A question about BeanModel again

http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry/PropertyConduit.html

It looks like "PropertyConduit" is the only way to modify a BeanModel - but 
this relies on Annotation...so adding fields that "do no exist" as metadata 
through Annotations in a class file can not be added?

Is it maybe possible to "fake annotations" and add virtual annotation metadata 
to a dummy class somehow?

Thanks!

Toby

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



Re: [DISCUSS] Should the quickstart archetype include tapestry-hibernate?

2009-01-23 Thread José Paumard
I think the archetype is fine as it is. IMHO adding the Hibernate 
support would confuse things (what to remove, what to keep), especially 
for beginners who are going to use this archetype. I'm developing my 4th 
T5 project, and I dont use the archetype any more. So maybe my point of 
view (archetype is for beginners) is biased.


BTW if you use Hibernate with annotations or through JPA you dont need 
hibernate.cfg.xml. So adding it might add to the confusion.


José

Howard Lewis Ship a écrit :

The title says it all.  It would be very easy to include
tapestry-hibernate as a dependency, and a minimal hibernate.cfg.xml
file as well.  Thoughts?

  



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



Re: Get the referring page

2009-01-23 Thread Francois Armand

Peter Stavrinides wrote:

Hi everyone,

I have a page with multiple entry points, when a user is done editing I want to 
return them to their previous page, there are a couple of ways of doing this I 
guess:
- JavaScript (not so keen on this, I prefer a server side redirect)
- Using the HTTP referer header of the Request service (I am thinking of using 
this, not sure what the drawbacks could be?)
- ASO (hmmm not sure about the multiple window thing)
- onActivate (don't want the callback URL to appear in the address bar)
- Set a property on the page before calling onActivate (this could also work, 
of course it limits me to internal URL's over the referer approach... but thats 
probably also okay though)

I would like to know if there is any possibility that the referer might not be 
set correctly under any circumstances etc... or if there is a better way to 
call back a previous page/URL.
  


It's an interesting and common need, I would be interested in the 
solution. I see one more option in your list : a web-flow support (that 
seems to be the heaviest solution, and I'm thrilling to see how a T5 
flavored one could look to...).


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

Open Source identities management and federation


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



Re: [DISCUSS] Should the quickstart archetype include tapestry-hibernate?

2009-01-23 Thread Francois Armand

Christian Edward Gruber wrote:
If you're going to do that, you should probably include a basic value 
object with a sample property and a DAO configured as a T5 service to 
allow someone to know what you're talking about.  Just wiring up 
Hibernate isn't as helpful. Though we're starting to talk about a 
jump-start-esque thing at this point.


By no means am I suggesting don't do it, but it could be more 
confusing if you did it without the last little pieces.  Really it 
sounds like a different archetype to me.




I also agree with that. For now, I never use T5-hibernate in any 
project. I'm perhaps a special case, but I dealt with a T5-LDAP project 
(no hibernate), a T5 front-end on top of a Spring-based 
busines/persistence layer (hibernate was used, but handled by spring), a 
T5-JCR project (again, hibernate wasn't in the scope of T5).


So, that's my first argument : T5-hibernate isn't a common dependency 
for every one.


Secondly, has Christian said, if all the matter is to have the 
dependency in the pom, I think it's just useless. It's kind of five 
lines to add in a file.
At contrario, if the aim is to demonstrate in the quickstart app HOW 
(simply) T5-hibernate works, the goal seems _really_ interesting: it 
demonstrates common idioms, bring best practices into ligth, etc. But in 
this case, the quickstart should be able to really demonstrate the use 
of T5-hibernate, and so comes we the full stack (a domain object, a dao 
service or the direct entity persistence strategy, and a DB). But that 
is more and more looking like a small tutorial...


So, to sum up:
- I don't see the point at ONLY having T5-hibernate in the POM ;
- I clearly see the advantage at having a full persistence example ;
- I thing, but I'm almost certainly biased here, that having 
T5-hibernate in a project is not the vast majority of T5 project, and so 
should not be in the simplest quickstart.


At this point, I'm thinking again at what I just say... And in fact, I 
use quickestart only for test / demo app, in a bigger project, I almost 
always build the app from strach, and just copy/past what part of the 
pom I need. So perhaps it just doesn't matter to have to remove 
T5-Hibernate in a really, more-than-five-minutes-spent project, and I 
may be a good plus for a demo/test (but I maintain that I would like to 
be able to really use persistence as soon the quickstart is finished)


So, it seems that I have no definitive idea on the subject... Best 
solution: 2 quickstart, a ligth and a full-stack ; but I could see why 
having only the second one is OK.


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

Open Source identities management and federation


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



Get the referring page

2009-01-23 Thread Peter Stavrinides
Hi everyone,

I have a page with multiple entry points, when a user is done editing I want to 
return them to their previous page, there are a couple of ways of doing this I 
guess:
- JavaScript (not so keen on this, I prefer a server side redirect)
- Using the HTTP referer header of the Request service (I am thinking of using 
this, not sure what the drawbacks could be?)
- ASO (hmmm not sure about the multiple window thing)
- onActivate (don't want the callback URL to appear in the address bar)
- Set a property on the page before calling onActivate (this could also work, 
of course it limits me to internal URL's over the referer approach... but thats 
probably also okay though)

I would like to know if there is any possibility that the referer might not be 
set correctly under any circumstances etc... or if there is a better way to 
call back a previous page/URL.

Thanks,
Peter

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