You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Jesper Zedlitz <je...@zedlitz.de> on 2006/11/01 14:51:34 UTC

Re: tapestry-acegi questions

James Carman wrote:
> I haven't implemented form-based authentication in
> tapestry-acegi, yet.  But, I don't think it's that difficult, really.
> Your need to use the AuthenticationProcessingFilter (I don't define it
> in my hivemodule.xml, but it would be easy to do so in yours) and your
> form has to have two fields named "j_username" and "j_password" and it
> should post to "j_acegi_security_check."  The filter will pick up that
> request and handle it.  You would override the symbol
> "tapestry.acegi.authenticationProcessingFilter" to point to your
> authentication filter 
>
I have added these entries to my hivemodule.xml:

<contribution configuration-id="hivemind.ApplicationDefaults">
  <default symbol="tapestry.acegi.authenticationProcessingFilter"
           value="de.zedlitz.tapestry.acegi.FormProcessingFilter"/>
  <default symbol="tapestry.acegi.authenticationEntryPoint"
           value="de.zedlitz.tapestry.acegi.FormAuthenticationEntryPoint"/>
  <!--            ^^^^ 
             you have to adjust this text according to your module id -->
</contribution>

<service-point id="FormProcessingFilter" interface="javax.servlet.Filter">
  <invoke-factory>
    <construct
class="org.acegisecurity.ui.webapp.AuthenticationProcessingFilter"
         initialize-method="afterPropertiesSet">
      <set property="authenticationFailureUrl" value="/LoginFailed.html"/>
      <set property="defaultTargetUrl" value="/app"/>
      <set property="filterProcessesUrl" value="/j_acegi_security_check"/>
    </construct>
  </invoke-factory>
</service-point>

<service-point id="FormAuthenticationEntryPoint"  
               interface="org.acegisecurity.ui.AuthenticationEntryPoint">
  <invoke-factory>
    <construct
class="org.acegisecurity.ui.webapp.AuthenticationProcessingFilterEntryPoint">
      <set property="loginFormUrl"
           value="/app?page=Login&amp;service=page"/>
      <set property="forceHttps" value="false"/>
    </construct>
  </invoke-factory>
</service-point>

and created Login.html and Login.java according to the tutorial
http://wiki.javascud.org/display/hsa/Acegi+and+Tapestry--A+Step-by-Step+Guide

When I try to access a secured page it works fine and I get to the login
page. After submitting the login form I will be redirected
to /j_acegi_security_check 
But how do I wire this URL to Acegi?


Jesper



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


Re: Re: Re: tapestry-acegi questions

Posted by Robin Ericsson <lo...@gmail.com>.
On 11/14/06, James Carman <ja...@carmanconsulting.com> wrote:
> Oh, sorry, Robin.  I read your last email, but only through the
> "thanks, I've got it working" part. :-)  I didn't see the questions at
> the bottom.  Do you have something that will let you debug the HTTP
> traffic?  That might help you see what's going on for sure.

Ok, this time I got it :)

Safari uses keep-alive connection whilst Firefox isn't, so probably
something in Safari with cookies, etc, doesn't work over a keep-alive
connection.

I've added my own EntryPoint filter which looks like this:
public class FormAuthenticationEntryPoint extends
		AuthenticationProcessingFilterEntryPoint {
	public void commence( ServletRequest request, ServletResponse
response, AuthenticationException authException )
		throws IOException, ServletException {
		((HttpServletResponse) response).addHeader( "Connection", "close" );
		super.commence( request, response, authException );
	}
}

That takes care of the problem. It's nothing tapestry-acegi can do
about it as the original EntryPoint filter was an Acegi one, but it
would be nice for people to know I'll guess :)

-- 
        regards,
        Robin

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


Re: Tapernate Access multiple database

Posted by Chris Chiappone <ch...@gmail.com>.
I have not yet since the requirement has actually not been needed.  It
was something I thought I may need to have in the future.  I'm hoping
by then there will be a solution :0

~chris

On 11/16/06, Henry Chen <he...@gmail.com> wrote:
> Thank you. Did you come up with any solution without Tapernate?
>
>
> -----Original Message-----
> From: Chris Chiappone [mailto:chiappone@gmail.com]
> Sent: Thursday, November 16, 2006 10:57 AM
> To: Tapestry users
> Subject: Re: Tapernate Access multiple database
>
> I has asked James about this a while back.  Unfortunately i don't
> believe there is any support in Tapernate for this.
>
> On 11/16/06, Henry Chen <he...@gmail.com> wrote:
> > Hi,
> >
> > Anybody use Tapernate to access multiple databases? How can I switch to
> > another database in runtime? Thank you very much.
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>
>
> --
> ~chris
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
~chris

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


Re: Re: Tapernate Access multiple database

Posted by Jesse Kuhnert <jk...@gmail.com>.
I don't want to get into a whole "thing" about it because it doesn't
matter to me overly much in the long run but did want to make at least
a couple points. ;)  (inlined of course)

On 11/21/06, Sam Gendler <sg...@ideasculptor.com> wrote:
<snipped>
>
> Actually, Spring does so many things that hivemind doesn't (at least
> as far as I am aware), that you can't even compare them.  As for
> getting transactionality without writing code, I'd say there's no
> comparison between the single line of 'code' I have to add to an XML
> file in order to wrap a method in transaction semantics (including
> handling of rollbacks, using existing transaction or starting a new
> one) and having to manually add code to do the same thing on every
> service method, especially since I can use wildcards in the XML file
> to handle multiple methods in the same manner.  The fact that I can
> swap in and out JTA transactions, hibernate transactions, and JDBC
> transactions, again with only a single modification to an XML file, is
> a godsend as a project grows over the course of its use.  When we went
> from one database to 2, and then 3, we didn't have to do anything but
> modify a config file to use J2EE transactions instead of the built in
> hibernate ones.  There is just no comparison between the complexity of
> the application context file and the code it replaces.
>

I can think of a few ways to compare them offhand:

-) Spring bean id's / name / and bean aliases are all very
uncomfortable naming schemes for me. It would be like having to
manually create all of the unique client id's that Tapestry gives you
in an html page by hand. Bleh . Hivemind has true namespace support,
which means I can easily/cleanly segment off my various services using
"foo.bar.name" type familiar conventions without having to worry about
ID conflicts blowing up on me.

-) Hivemind has thread support / Factory Support / Pipeline support /
Chain of Command and probably others. All incredibly useful
programming concepts captured and available "for free".

-) Hivemind lazily initializes everything "by default".

-) Hivemind allows me to create shared configuration points that
anyone can contribute to...Whether directly within my source code or
when using my hivemind library within their own.

Those are a few off the top of my head. Not the kind of thing that
makes people swoon but definitely the kind of thing that makes me
happy when writing services.

> As far as I am aware, hivemind does a great job with dependancy
> injection, but doesn't offer the vast majority of other functionality
> available from spring - transaction management, quartz integration,
> aop integration, messaging, etc.  I suppose I could use hivemind IOC
> to instantiate all the spring framework classes that provide the
> functionality I just listed, but that just seems like an obtuse
> solution, especially when it isn't clear (to me, at least) that the
> baseline IOC/dependancy injection code itself is particularly
> superior.  They both accomplish the same tasks, and spring doesn't
> absolutely require an interface which is important when using
> libraries you don't control).  Hivemind also has a much smaller
> community of users which is significant when building a sizeable
> engineering team.
>

This is true. Hivemind doesn't try to wrap every possible concrete
service type available. To unabashedly steal a phrase I heard once -
Spring is a framework for building applications, Hivemind is a
framework for building frameworks.

To be fair though, I've done much more "enterprise" development than I
have web and happened to have implemented the following Hivemind
services not too long ago very easily without using a single library
from Spring:

-) Quartz
-) Drools
-) JMS / ActiveMQ
-) Hibernate
-) Rmi transport
-) Integrated Tapestry/Hibernate transaction management.
-) Standalone appserver bootstrapping

Maybe there are others, probably I'm forgetting everything by now. I
can say that it's all been done in an extremely large enterprise
system that is deployed nationwide in critical care areas of
hospitals. The system also interfaces (transparently thanks to
hivemind) with so many different sources of data that I know I
wouldn't be able to remember them all if I tried. It's definitely
nearing 100's at a minimum.

> And really, even if it was just moving code into a config file that
> doesn't require recompilation, there are distinct advantages in having
> just that when architecting a project with 500,000+ lines of code and
> a team of 20 engineers.  It means that I, as an architect, can manage
> transaction semantics for our entire suite of applications from a
> single location, rather than relying on 20 engineers who are 11 time
> zones and 6,000 miles away to get it right, or having to code review
> all those extra lines of code.  Instead, my engineers worry about
> making sure the service method does what it claims it will, and I make
> sure that it participates in any necessary transaction correctly from
> the app context.
>

As for xml being easy to manage vs hard coded static strings or some
other unjarring form of non configurable option I can't argue with
that statement. I can say that there's not a single thing you can do
in Xml that I can't do with annotations. (except write more xml )

Annotations have the added benefit of carrying behavior with them.
Meaning that you can apply them in unexpected places and get the same
results. Transaction demarcation is nice, but really - wouldn't it be
nice to just be able to say @Transaction(<however you want to say
PROPOGATION_REQUIRED>) on a listener method and be done with it?
Doesn't mean you can't call services and have them participate in the
same transaction. Just means that you are putting the boundary where
it belongs. All without the author of the annotation having to know
how and where you might possibly apply it.

<snipped>
>
> --sam
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Jesse Kuhnert
Tapestry/Dojo/(and a dash of TestNG), team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com

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


RE: Re: Tapernate Access multiple database

Posted by Ma...@bmw.ch.
Hm, couldn't resist to drop a few remarks on that (inline): 

> -----Original Message-----
> From: sgendler@gmail.com [mailto:sgendler@gmail.com] On 
> Behalf Of Sam Gendler
> Sent: Wednesday, November 22, 2006 2:24 AM
> To: Tapestry users
> Subject: Re: Re: Tapernate Access multiple database
 > 
> Actually, Spring does so many things that hivemind doesn't 
> (at least as far as I am aware), that you can't even compare 

Spring does support stateful services? session-per-conversation?
As far as I know, it doesn't even have service-models.

> them.  As for getting transactionality without writing code, 
> I'd say there's no comparison between the single line of 
> 'code' I have to add to an XML file in order to wrap a method 
> in transaction semantics (including handling of rollbacks, 
> using existing transaction or starting a new
> one) and having to manually add code to do the same thing on 
> every service method, especially since I can use wildcards in 

thats a bit of an odd comparison. If you can use a
Tapernate/Honeyomb-like
approach out-of-the box you need exactly ZERO lines of code per service
method
since it's just ta-per-request or per-conversation by default. Rollbacks
on Exception,
and the like is included, of course.

If you can't use it out-of-the-box, because you really need multiple 
ta-resources, the alternative is not coding ta's manually, but doing
some not really complex changes to make tapernate/honeycomb handle
these.

> the XML file to handle multiple methods in the same manner.  
> The fact that I can swap in and out JTA transactions, 
> hibernate transactions, and JDBC transactions, again with 
> only a single modification to an XML file, is a godsend as a 
> project grows over the course of its use.  When we went from 
> one database to 2, and then 3, we didn't have to do anything 
> but modify a config file to use J2EE transactions instead of 
> the built in hibernate ones.  There is just no comparison 
> between the complexity of the application context file and 
> the code it replaces.

I'd suspect, that most of that code is replaced by your container's
ta-manager, right? Spring, on it's own, does not do a lot in terms
of ta-coordination apart of letting you use it, when it's around.

> 
> As far as I am aware, hivemind does a great job with 
> dependancy injection, but doesn't offer the vast majority of 
> other functionality available from spring - transaction 
> management, quartz integration, aop integration, messaging, 
> etc.  I suppose I could use hivemind IOC to instantiate all 
> the spring framework classes that provide the functionality I 
> just listed, but that just seems like an obtuse solution, 
> especially when it isn't clear (to me, at least) that the 
> baseline IOC/dependancy injection code itself is particularly 
> superior.  They both accomplish the same tasks, and spring 
> doesn't absolutely require an interface which is important 
> when using libraries you don't control).  Hivemind also has a 

You don't need interfaces, bean-services are there since 
HiveMind 1.1.1 (at least)

> much smaller community of users which is significant when 
> building a sizeable engineering team.
> 
> And really, even if it was just moving code into a config 
> file that doesn't require recompilation, there are distinct 
> advantages in having just that when architecting a project 
> with 500,000+ lines of code and a team of 20 engineers.  It 
> means that I, as an architect, can manage transaction 
> semantics for our entire suite of applications from a single 
> location, rather than relying on 20 engineers who are 11 time 
> zones and 6,000 miles away to get it right, or having to code 
> review all those extra lines of code.  Instead, my engineers 
> worry about making sure the service method does what it 
> claims it will, and I make sure that it participates in any 
> necessary transaction correctly from the app context.

That's true to exactly the same extent for HiveMind-based solutions,
of course.

> 
> Incidentally, I disagree that a single database is the minority case.
> That is true when talking about building an external facing 
> website, but not at all true when building enterprise 
> solutions.  That's the whole reason the j2ee framework 
> exists. A sizeable company may well have tens of databases 
> that need to be integrated into internal applications, and 
> pulling reports from a data warehouse isn't just common, it 
> has been a requirement on nearly every project I've worked on 
> in an enterprise context. Hell, in my current company, I've 
> got data being fed to me from 4 different sources 
> (salesforce.com, domain db, data warehouse, another 3rd party 
> service), although I combine two into a single db. It is, 
> however, probably the minority case for tapestry users, so 
> I'm not saying tapernate went in the wrong direction on that 
> point.  Most apps complex enough to want multiple dbs 
> probably aren't going to be looking at something like 
> tapernate, anyway.  I want more control than it offers me.  
> Chicken or egg, I suppose.

Ironically, Tapernate IS just a convenient wrapper around the Spring
Hibernate/TA-management stuff ... That's about the only reason I,
personally
don't use it (until James comes up with his conversation support, at
least).

Additionally, If I need to use multiple db's, I really like to map the
foreign ones into the first one via updatable remote views /
materialised views. 
That gives you the extra benefit of releasing the tight coupling, that
usually 
goes with db-integration-patterns. And you get rid of costly two
phase-commit protocols
on the app-server level. And you can tune your performance by doing the
db-coupling
asynchronously (materialized views versus plain ones).

Marcus

> 
> --sam
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 

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


Re: Re: Tapernate Access multiple database

Posted by Sam Gendler <sg...@ideasculptor.com>.
On 11/21/06, Jesse Kuhnert <jk...@gmail.com> wrote:
> I guess that depends on what you consider having to "write code" . All
> that xml is nice but seems to really have just moved the code to a new
> format that doesn't require re-compilation. I can't argue that spring
> isn't nice though, I just think hivemind is light years ahead of it.
> It's too bad that it's still in the stone ages when it comes to
> comparing them with documentation.

Actually, Spring does so many things that hivemind doesn't (at least
as far as I am aware), that you can't even compare them.  As for
getting transactionality without writing code, I'd say there's no
comparison between the single line of 'code' I have to add to an XML
file in order to wrap a method in transaction semantics (including
handling of rollbacks, using existing transaction or starting a new
one) and having to manually add code to do the same thing on every
service method, especially since I can use wildcards in the XML file
to handle multiple methods in the same manner.  The fact that I can
swap in and out JTA transactions, hibernate transactions, and JDBC
transactions, again with only a single modification to an XML file, is
a godsend as a project grows over the course of its use.  When we went
from one database to 2, and then 3, we didn't have to do anything but
modify a config file to use J2EE transactions instead of the built in
hibernate ones.  There is just no comparison between the complexity of
the application context file and the code it replaces.

As far as I am aware, hivemind does a great job with dependancy
injection, but doesn't offer the vast majority of other functionality
available from spring - transaction management, quartz integration,
aop integration, messaging, etc.  I suppose I could use hivemind IOC
to instantiate all the spring framework classes that provide the
functionality I just listed, but that just seems like an obtuse
solution, especially when it isn't clear (to me, at least) that the
baseline IOC/dependancy injection code itself is particularly
superior.  They both accomplish the same tasks, and spring doesn't
absolutely require an interface which is important when using
libraries you don't control).  Hivemind also has a much smaller
community of users which is significant when building a sizeable
engineering team.

And really, even if it was just moving code into a config file that
doesn't require recompilation, there are distinct advantages in having
just that when architecting a project with 500,000+ lines of code and
a team of 20 engineers.  It means that I, as an architect, can manage
transaction semantics for our entire suite of applications from a
single location, rather than relying on 20 engineers who are 11 time
zones and 6,000 miles away to get it right, or having to code review
all those extra lines of code.  Instead, my engineers worry about
making sure the service method does what it claims it will, and I make
sure that it participates in any necessary transaction correctly from
the app context.

Incidentally, I disagree that a single database is the minority case.
That is true when talking about building an external facing website,
but not at all true when building enterprise solutions.  That's the
whole reason the j2ee framework exists. A sizeable company may well
have tens of databases that need to be integrated into internal
applications, and pulling reports from a data warehouse isn't just
common, it has been a requirement on nearly every project I've worked
on in an enterprise context. Hell, in my current company, I've got
data being fed to me from 4 different sources (salesforce.com, domain
db, data warehouse, another 3rd party service), although I combine two
into a single db. It is, however, probably the minority case for
tapestry users, so I'm not saying tapernate went in the wrong
direction on that point.  Most apps complex enough to want multiple
dbs probably aren't going to be looking at something like tapernate,
anyway.  I want more control than it offers me.  Chicken or egg, I
suppose.

--sam

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


Re: Tapernate Access multiple database

Posted by Jesse Kuhnert <jk...@gmail.com>.
I guess that depends on what you consider having to "write code" . All
that xml is nice but seems to really have just moved the code to a new
format that doesn't require re-compilation. I can't argue that spring
isn't nice though, I just think hivemind is light years ahead of it.
It's too bad that it's still in the stone ages when it comes to
comparing them with documentation.

The new Tapestry IOC layer (that I'm assuming will find it's way into
a hivemind release in one form another) looks incredibly promising
though. No more having to look in xml files to see where things are
being used / tied ! Also has the benefit of being self documenting
with all of the tool support surrounding javadocs / etc..

On 11/20/06, Sam Gendler <sg...@ideasculptor.com> wrote:
<snipped>
> Honestly, I can't imagine a system of this complexity having a simpler
> interface since everything is done declaratively within the spring
> application context.  There's not a single line of code devoted to
> dealing with multiple databases.
>
> --sam
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Jesse Kuhnert
Tapestry/Dojo/(and a dash of TestNG), team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com

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


Re: Tapernate Access multiple database

Posted by James Carman <ja...@carmanconsulting.com>.
The majority of applications use one database, so Tapernate (actually
hivemind-hibernate3, which Tapernate is built upon) doesn't officially
support multiple databases.  Tapernate allows you to just drop jars
into your classpath, which makes it very simple to use.  It wouldn't
be so simple to set up if it had to try to keep track of multiple
databases.  I went for simplicity rather than trying to make it cover
a minority case.

On 11/20/06, Sam Gendler <sg...@ideasculptor.com> wrote:
> On 11/16/06, Henry Chen <he...@gmail.com> wrote:
> > Thank you. Did you come up with any solution without Tapernate?
> >
>
> This is relatively simple if you aren't using a framework that
> explicitly prevents it.  I use swing + hibernate to provide all the
> layers to my app underneath the web layer and it is trivial to provide
> access to multiple databases.  I can define multiple data sources in
> my application context and then provide dao beans which use the
> appropriate data sources as well as service objects which utilize
> those daos.  My web layer isn't even aware of the location of data.
> It just calls a method in the service layer, which may use DAOs from
> multiple databases to accomplish the necessary work.  And with
> spring's nice declarative transactions, it is easy, within the
> confines of a JTA transaction in a J2EE container, to have a single
> transaction span db access to multiple databases, which is really
> convenient.
>
> In my app, I have a situation where my entire domain model is provided
> via hibernate to a single domain db, but the huge volume of data that
> I need to provide access to for reporting is in 2 separate data
> warehouses.  The domain entities are all accessed via DAO's using
> spring's built in hibernate dao support classes, and I use pure JDBC
> to access the 2 separate data warehouses.  So I have about 25 DAOs
> using the hibernate data source (one for each entity), and one dao
> using one jdbc connection to the first warehouse and 3 separate DAOs
> using JDBC connections to the second warehouse.  I have service
> objects which need to pass hibernate entities to the warehouse daos so
> that they can construct the correct SQL statements for building
> reports, so many of my service objects receive a reference to several
> hibernate DAOs as well as at least one jdbc dao.  It works like a
> charm.  All transactions are declared on service object methods, so
> transactions automatically encapsulate access to every database used
> by the service method, and my daos don't need to know a thing about
> transactions.
>
> Honestly, I can't imagine a system of this complexity having a simpler
> interface since everything is done declaratively within the spring
> application context.  There's not a single line of code devoted to
> dealing with multiple databases.
>
> --sam
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

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


Re: Tapernate Access multiple database

Posted by Sam Gendler <sg...@ideasculptor.com>.
On 11/16/06, Henry Chen <he...@gmail.com> wrote:
> Thank you. Did you come up with any solution without Tapernate?
>

This is relatively simple if you aren't using a framework that
explicitly prevents it.  I use swing + hibernate to provide all the
layers to my app underneath the web layer and it is trivial to provide
access to multiple databases.  I can define multiple data sources in
my application context and then provide dao beans which use the
appropriate data sources as well as service objects which utilize
those daos.  My web layer isn't even aware of the location of data.
It just calls a method in the service layer, which may use DAOs from
multiple databases to accomplish the necessary work.  And with
spring's nice declarative transactions, it is easy, within the
confines of a JTA transaction in a J2EE container, to have a single
transaction span db access to multiple databases, which is really
convenient.

In my app, I have a situation where my entire domain model is provided
via hibernate to a single domain db, but the huge volume of data that
I need to provide access to for reporting is in 2 separate data
warehouses.  The domain entities are all accessed via DAO's using
spring's built in hibernate dao support classes, and I use pure JDBC
to access the 2 separate data warehouses.  So I have about 25 DAOs
using the hibernate data source (one for each entity), and one dao
using one jdbc connection to the first warehouse and 3 separate DAOs
using JDBC connections to the second warehouse.  I have service
objects which need to pass hibernate entities to the warehouse daos so
that they can construct the correct SQL statements for building
reports, so many of my service objects receive a reference to several
hibernate DAOs as well as at least one jdbc dao.  It works like a
charm.  All transactions are declared on service object methods, so
transactions automatically encapsulate access to every database used
by the service method, and my daos don't need to know a thing about
transactions.

Honestly, I can't imagine a system of this complexity having a simpler
interface since everything is done declaratively within the spring
application context.  There's not a single line of code devoted to
dealing with multiple databases.

--sam

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


RE: Tapernate Access multiple database

Posted by Henry Chen <he...@gmail.com>.
Thank you. Did you come up with any solution without Tapernate?


-----Original Message-----
From: Chris Chiappone [mailto:chiappone@gmail.com] 
Sent: Thursday, November 16, 2006 10:57 AM
To: Tapestry users
Subject: Re: Tapernate Access multiple database

I has asked James about this a while back.  Unfortunately i don't
believe there is any support in Tapernate for this.

On 11/16/06, Henry Chen <he...@gmail.com> wrote:
> Hi,
>
> Anybody use Tapernate to access multiple databases? How can I switch to
> another database in runtime? Thank you very much.
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
~chris

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


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


Re: Tapernate Access multiple database

Posted by Chris Chiappone <ch...@gmail.com>.
I has asked James about this a while back.  Unfortunately i don't
believe there is any support in Tapernate for this.

On 11/16/06, Henry Chen <he...@gmail.com> wrote:
> Hi,
>
> Anybody use Tapernate to access multiple databases? How can I switch to
> another database in runtime? Thank you very much.
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
~chris

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


Tapernate Access multiple database

Posted by Henry Chen <he...@gmail.com>.
Hi,

Anybody use Tapernate to access multiple databases? How can I switch to
another database in runtime? Thank you very much.




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


Re: Re: Re: tapestry-acegi questions

Posted by Robin Ericsson <lo...@gmail.com>.
On 11/14/06, Robin Ericsson <lo...@gmail.com> wrote:
> Hmm, no, never though of that, might be a good idea though. I'll see
> if I have time to try this today.

Ok, debugged and problem found. Safari seems to like to cache the
result of the first query to the protected page.

I was using a proxy called Charles (really good app btw) and when
disable caching the result to the browser contained header "Expires:
0". Probably it's just that easy to add that header manually when
redirecting from protected page to login page, I'll try that another
time.

-- 
        regards,
        Robin

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


Re: Re: tapestry-acegi questions

Posted by Robin Ericsson <lo...@gmail.com>.
On 11/14/06, James Carman <ja...@carmanconsulting.com> wrote:
> Oh, sorry, Robin.  I read your last email, but only through the
> "thanks, I've got it working" part. :-)  I didn't see the questions at
> the bottom.  Do you have something that will let you debug the HTTP
> traffic?  That might help you see what's going on for sure.

Hmm, no, never though of that, might be a good idea though. I'll see
if I have time to try this today.

-- 
        regards,
        Robin

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


Re: Re: tapestry-acegi questions

Posted by James Carman <ja...@carmanconsulting.com>.
Oh, sorry, Robin.  I read your last email, but only through the
"thanks, I've got it working" part. :-)  I didn't see the questions at
the bottom.  Do you have something that will let you debug the HTTP
traffic?  That might help you see what's going on for sure.


On 11/14/06, Robin Ericsson <lo...@gmail.com> wrote:
> On 11/12/06, Robin Ericsson <lo...@gmail.com> wrote:
> > Thanks to James again :), I have a working solution that redirects
> > after successful login. However, on Firefox it works like a charm, but
> > on Safari it doesn't work as it seems it doesn't process cookies or
> > something the same way.
>
> Maybe I should take this to Acegi directly instead?
>
> --
>         regards,
>         Robin
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

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


Re: Re: tapestry-acegi questions

Posted by Robin Ericsson <lo...@gmail.com>.
On 11/12/06, Robin Ericsson <lo...@gmail.com> wrote:
> Thanks to James again :), I have a working solution that redirects
> after successful login. However, on Firefox it works like a charm, but
> on Safari it doesn't work as it seems it doesn't process cookies or
> something the same way.

Maybe I should take this to Acegi directly instead?

-- 
        regards,
        Robin

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


Re: Re: tapestry-acegi questions

Posted by Robin Ericsson <lo...@gmail.com>.
On 11/10/06, James Carman <ja...@carmanconsulting.com> wrote:
> You could use a callback somehow to do that, I would think.  But, you
> would probably have to implement the auto-redirect-to-login-page logic
> yourself, so that you could save the callback into the session or set
> it on the login page as a property or something.

Thanks to James again :), I have a working solution that redirects
after successful login. However, on Firefox it works like a charm, but
on Safari it doesn't work as it seems it doesn't process cookies or
something the same way.

Firefox:
anon: securedpage -> login redirect
anon: login successful -> securepage redirect
loggedin: securepage

Safari
anon: securedpage -> login redirect
anon: login successful -> securepage redirect
still anon: securepage -> login redirect
loggedin: when landing on login page

My authenticationProcessingFilter looks like this.
http://pastebin.com/822425

The attemptAuthentication(String, String) is called from my tapestry
listener. Maybe I need to flush the http response or something? Or
maybe I need to tell tapestry to step processing?


-- 
        regards,
        Robin

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


Re: tapestry-acegi questions

Posted by James Carman <ja...@carmanconsulting.com>.
You could use a callback somehow to do that, I would think.  But, you
would probably have to implement the auto-redirect-to-login-page logic
yourself, so that you could save the callback into the session or set
it on the login page as a property or something.


On 11/10/06, Robin Ericsson <lo...@gmail.com> wrote:
> On 11/3/06, James Carman <ja...@carmanconsulting.com> wrote:
> > Maybe you could just create your own Tapestry form (just like you do
> > for any other page) and submit it.  Within the form's processing, you
> > could use the Acegi API
> > (SecurityContextHolder.getContext().setAuthentication() maybe?) to set
> > up the security context, authenticating however you want.  The
> > HttpSessionContextIntegrationFilter will take care of storing it in
> > the session for you so that each subsequent request will be
> > authenticated.  I should maybe look at integrating the "remember me"
> > stuff into the pipeline.  I could create a special module called
> > tapestry-acegi-rememberme or something so that you could just drop in
> > a jar to allow "remember me" services.
>
> I came around to the same thing after looking at the Acegi basic auth
> code. I'm doing something like this.
>
> @InjectObject("service:hivemind.acegi.AuthenticationManager")
> public abstract AuthenticationManager getAuthenticationManager();
>
> public void doLogin()
> {
>   UsernamePasswordAuthenticationToken authRequest = new
> UsernamePasswordAuthenticationToken( getEmail(), getPassword() );
>   Authentication authResult;
>
>   try {
>     authResult = getAuthenticationMananger().authenticate( authRequest );
>   } catch( AuthenticationException failed ) {
>     SecurityContextHolder.getContext().setAuthentication( null );
>     return;
>   }
>
>   SecurityContextHolder.getContext().setAuthentication( authResult );
> }
>
> The only think I have left is to figure out how to redirect back to
> the original page where the user was at the time the authentication
> was wanted. Is that saved somewhere or do I need to find out that for
> my self?
>
> --
>         regards,
>         Robin
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

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


Re: tapestry-acegi questions

Posted by Robin Ericsson <lo...@gmail.com>.
On 11/3/06, James Carman <ja...@carmanconsulting.com> wrote:
> Maybe you could just create your own Tapestry form (just like you do
> for any other page) and submit it.  Within the form's processing, you
> could use the Acegi API
> (SecurityContextHolder.getContext().setAuthentication() maybe?) to set
> up the security context, authenticating however you want.  The
> HttpSessionContextIntegrationFilter will take care of storing it in
> the session for you so that each subsequent request will be
> authenticated.  I should maybe look at integrating the "remember me"
> stuff into the pipeline.  I could create a special module called
> tapestry-acegi-rememberme or something so that you could just drop in
> a jar to allow "remember me" services.

I came around to the same thing after looking at the Acegi basic auth
code. I'm doing something like this.

@InjectObject("service:hivemind.acegi.AuthenticationManager")
public abstract AuthenticationManager getAuthenticationManager();

public void doLogin()
{
  UsernamePasswordAuthenticationToken authRequest = new
UsernamePasswordAuthenticationToken( getEmail(), getPassword() );
  Authentication authResult;

  try {
    authResult = getAuthenticationMananger().authenticate( authRequest );
  } catch( AuthenticationException failed ) {
    SecurityContextHolder.getContext().setAuthentication( null );
    return;
  }

  SecurityContextHolder.getContext().setAuthentication( authResult );
}

The only think I have left is to figure out how to redirect back to
the original page where the user was at the time the authentication
was wanted. Is that saved somewhere or do I need to find out that for
my self?

-- 
        regards,
        Robin

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


Re: tapestry-acegi questions

Posted by James Carman <ja...@carmanconsulting.com>.
Maybe you could just create your own Tapestry form (just like you do
for any other page) and submit it.  Within the form's processing, you
could use the Acegi API
(SecurityContextHolder.getContext().setAuthentication() maybe?) to set
up the security context, authenticating however you want.  The
HttpSessionContextIntegrationFilter will take care of storing it in
the session for you so that each subsequent request will be
authenticated.  I should maybe look at integrating the "remember me"
stuff into the pipeline.  I could create a special module called
tapestry-acegi-rememberme or something so that you could just drop in
a jar to allow "remember me" services.


On 11/3/06, James Carman <ja...@carmanconsulting.com> wrote:
> Maybe the form-based security should declare its own dummy engine
> service?  That might be the way to go.  I don't know.  I'd have to
> play around with it some.
>
>
> On 11/3/06, Jesper Zedlitz <jz...@freenet.de> wrote:
> > James Carman wrote:
> > > What URL mapping are you using for your Tapestry application servlet?
> > >
> > This is my mapping without my Acegi experiments:
> > <filter>
> >   <filter-name>redirect</filter-name>
> >   <filter-class>org.apache.tapestry.RedirectFilter</filter-class>
> > </filter>
> > <servlet>
> >   <servlet-name>tapestry-acegi</servlet-name>
> >   <servlet-class>org.apache.tapestry.ApplicationServlet</servlet-class>
> >   <load-on-startup>0</load-on-startup>
> > </servlet>
> > <filter-mapping>
> >   <filter-name>redirect</filter-name>
> >   <url-pattern>/</url-pattern>
> > </filter-mapping>
> > <servlet-mapping>
> >   <servlet-name>tapestry-acegi</servlet-name>
> >   <url-pattern>/app</url-pattern>
> > </servlet-mapping>
> >
> > For Acegi I have added this mapping:
> > <filter>
> >   <filter-name>AcegiFilter</filter-name>
> >   <filter-class>org.acegisecurity.util.FilterToBeanProxy</filter-class>
> >   <init-param>
> >     <param-name>targetClass</param-name>
> > <param-value>org.acegisecurity.ui.webapp.AuthenticationProcessingFilter</param-value>
> >   </init-param>
> > </filter>
> > <filter-mapping>
> >   <filter-name>Acegi Filter Chain Proxy</filter-name>
> >   <url-pattern>/j_acegi_security_check</url-pattern>
> > </filter-mapping>
> >
> > Jesper
> >
> > --
> >  Jesper Zedlitz   E-Mail   : jesper@zedlitz.de
> >                   Homepage : http://www.zedlitz.de
> >                   ICQ#     : 23890711
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>

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


Re: tapestry-acegi questions

Posted by James Carman <ja...@carmanconsulting.com>.
Maybe the form-based security should declare its own dummy engine
service?  That might be the way to go.  I don't know.  I'd have to
play around with it some.


On 11/3/06, Jesper Zedlitz <jz...@freenet.de> wrote:
> James Carman wrote:
> > What URL mapping are you using for your Tapestry application servlet?
> >
> This is my mapping without my Acegi experiments:
> <filter>
>   <filter-name>redirect</filter-name>
>   <filter-class>org.apache.tapestry.RedirectFilter</filter-class>
> </filter>
> <servlet>
>   <servlet-name>tapestry-acegi</servlet-name>
>   <servlet-class>org.apache.tapestry.ApplicationServlet</servlet-class>
>   <load-on-startup>0</load-on-startup>
> </servlet>
> <filter-mapping>
>   <filter-name>redirect</filter-name>
>   <url-pattern>/</url-pattern>
> </filter-mapping>
> <servlet-mapping>
>   <servlet-name>tapestry-acegi</servlet-name>
>   <url-pattern>/app</url-pattern>
> </servlet-mapping>
>
> For Acegi I have added this mapping:
> <filter>
>   <filter-name>AcegiFilter</filter-name>
>   <filter-class>org.acegisecurity.util.FilterToBeanProxy</filter-class>
>   <init-param>
>     <param-name>targetClass</param-name>
> <param-value>org.acegisecurity.ui.webapp.AuthenticationProcessingFilter</param-value>
>   </init-param>
> </filter>
> <filter-mapping>
>   <filter-name>Acegi Filter Chain Proxy</filter-name>
>   <url-pattern>/j_acegi_security_check</url-pattern>
> </filter-mapping>
>
> Jesper
>
> --
>  Jesper Zedlitz   E-Mail   : jesper@zedlitz.de
>                   Homepage : http://www.zedlitz.de
>                   ICQ#     : 23890711
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

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


Re: tapestry-acegi questions

Posted by Jesper Zedlitz <jz...@freenet.de>.
James Carman wrote:
> What URL mapping are you using for your Tapestry application servlet?
> 
This is my mapping without my Acegi experiments:
<filter>
  <filter-name>redirect</filter-name>
  <filter-class>org.apache.tapestry.RedirectFilter</filter-class>
</filter>
<servlet>
  <servlet-name>tapestry-acegi</servlet-name>
  <servlet-class>org.apache.tapestry.ApplicationServlet</servlet-class>
  <load-on-startup>0</load-on-startup>
</servlet>
<filter-mapping>
  <filter-name>redirect</filter-name>
  <url-pattern>/</url-pattern>
</filter-mapping>
<servlet-mapping>
  <servlet-name>tapestry-acegi</servlet-name>
  <url-pattern>/app</url-pattern>
</servlet-mapping>

For Acegi I have added this mapping:
<filter>
  <filter-name>AcegiFilter</filter-name>
  <filter-class>org.acegisecurity.util.FilterToBeanProxy</filter-class>
  <init-param>
    <param-name>targetClass</param-name>
<param-value>org.acegisecurity.ui.webapp.AuthenticationProcessingFilter</param-value>
  </init-param>
</filter>
<filter-mapping>
  <filter-name>Acegi Filter Chain Proxy</filter-name>
  <url-pattern>/j_acegi_security_check</url-pattern>
</filter-mapping>

Jesper

-- 
 Jesper Zedlitz   E-Mail   : jesper@zedlitz.de
                  Homepage : http://www.zedlitz.de
                  ICQ#     : 23890711


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


Re: tapestry-acegi questions

Posted by James Carman <ja...@carmanconsulting.com>.
What URL mapping are you using for your Tapestry application servlet?


On 11/3/06, Jesper Zedlitz <jz...@freenet.de> wrote:
> James Carman wrote:
> > Then you're not really using tapestry-acegi.  You don't need Spring at
> > all to use tapestry-acegi.
> >
> But how do I wire "/j_acegi_security_check" to Acegi?
>
> Here is a short summary what I tried until now:
> * Login page forwards to "/j_acegi_security_check?...".
> * add a filter that maps "/j_acegi_security_check" to Acegi => need Spring
> to create a AuthenticationProcessingFilter bean
> * After creating a couple of Spring beans Acegi will authenticate the user.
> But somehow the content of ACEGI_SECURITY_CONTEXT (in the session) gets
> lost.
>
> Jesper
>
> --
>  Jesper Zedlitz   E-Mail   : jesper@zedlitz.de
>                   Homepage : http://www.zedlitz.de
>                   ICQ#     : 23890711
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

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


Re: tapestry-acegi questions

Posted by Jesper Zedlitz <jz...@freenet.de>.
James Carman wrote:
> Then you're not really using tapestry-acegi.  You don't need Spring at
> all to use tapestry-acegi.
> 
But how do I wire "/j_acegi_security_check" to Acegi? 

Here is a short summary what I tried until now:
* Login page forwards to "/j_acegi_security_check?...". 
* add a filter that maps "/j_acegi_security_check" to Acegi => need Spring
to create a AuthenticationProcessingFilter bean
* After creating a couple of Spring beans Acegi will authenticate the user.
But somehow the content of ACEGI_SECURITY_CONTEXT (in the session) gets
lost.

Jesper

-- 
 Jesper Zedlitz   E-Mail   : jesper@zedlitz.de
                  Homepage : http://www.zedlitz.de
                  ICQ#     : 23890711


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


Re: tapestry-acegi questions

Posted by James Carman <ja...@carmanconsulting.com>.
Then you're not really using tapestry-acegi.  You don't need Spring at
all to use tapestry-acegi.


On 11/2/06, Jesper Zedlitz <jz...@freenet.de> wrote:
> > You're switching to using Spring instead of HiveMind?
> >
> The web application does not start if I do not create a Spring bean:
> Bean context must contain at least one bean of type
> org.acegisecurity.ui.webapp.AuthenticationProcessingFilter
>
> Jesper
>
> --
>  Jesper Zedlitz   E-Mail   : jesper@zedlitz.de
>                   Homepage : http://www.zedlitz.de
>                   ICQ#     : 23890711
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

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


Re: tapestry-acegi questions

Posted by Jesper Zedlitz <jz...@freenet.de>.
> You're switching to using Spring instead of HiveMind?
> 
The web application does not start if I do not create a Spring bean:
Bean context must contain at least one bean of type
org.acegisecurity.ui.webapp.AuthenticationProcessingFilter

Jesper

-- 
 Jesper Zedlitz   E-Mail   : jesper@zedlitz.de
                  Homepage : http://www.zedlitz.de
                  ICQ#     : 23890711


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


Re: tapestry-acegi questions

Posted by James Carman <ja...@carmanconsulting.com>.
You're switching to using Spring instead of HiveMind?


On 11/2/06, Jesper Zedlitz <jz...@freenet.de> wrote:
> Jesper Zedlitz wrote:
> > When I try to access a secured page it works fine and I get to the login
> > page. After submitting the login form I will be redirected
> > to /j_acegi_security_check
> > But how do I wire this URL to Acegi?
> >
> I suppose I need a filter that processes the URL starting with
> "/j_acegi_security_check". So I added this filter and filter-mapping to the
> web.xml:
> <filter>
>    <filter-name>AcegiFilter</filter-name>
>    <filter-class>org.acegisecurity.util.FilterToBeanProxy</filter-class>
>    <init-param>
>      <param-name>targetClass</param-name>
> <param-value>org.acegisecurity.ui.webapp.AuthenticationProcessingFilter</param-value>
>    </init-param>
> </filter>
> <filter-mapping>
>   <filter-name>AcegiFilter</filter-name>
>   <url-pattern>/j_acegi_security_check</url-pattern>
> </filter-mapping>
>
> To create an instance of AuthenticationProcessingFilter I declared this bean
> in Spring's applicationContext.xml:
> <bean id="authenticationProcessingFilter"
>       class="org.acegisecurity.ui.webapp.AuthenticationProcessingFilter">
>   <property name="authenticationManager" ref="authenticationManager"/>
>   <property name="authenticationFailureUrl value="/LoginFailed.html"/>
>   <property name="defaultTargetUrl" />
>   <property name="filterProcessesUrl" value="/j_acegi_security_check"/>
> </bean>
>
> But there is still something missing: the AuthenticationProcessingFilter
> needs an AuthenticationManager. Any ideas how to configure that?
>
> Or is an AuthenticationProcessingFilter the wrong filter?
>
> Jesper
>
>
> --
>  Jesper Zedlitz   E-Mail   : jesper@zedlitz.de
>                   Homepage : http://www.zedlitz.de
>                   ICQ#     : 23890711
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

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


Re: tapestry-acegi questions

Posted by Jesper Zedlitz <jz...@freenet.de>.
Jesper Zedlitz wrote:
> When I try to access a secured page it works fine and I get to the login
> page. After submitting the login form I will be redirected
> to /j_acegi_security_check
> But how do I wire this URL to Acegi?
> 
I suppose I need a filter that processes the URL starting with
"/j_acegi_security_check". So I added this filter and filter-mapping to the
web.xml:
<filter>
   <filter-name>AcegiFilter</filter-name>
   <filter-class>org.acegisecurity.util.FilterToBeanProxy</filter-class>
   <init-param>
     <param-name>targetClass</param-name>
<param-value>org.acegisecurity.ui.webapp.AuthenticationProcessingFilter</param-value>
   </init-param>
</filter>
<filter-mapping>
  <filter-name>AcegiFilter</filter-name>
  <url-pattern>/j_acegi_security_check</url-pattern>
</filter-mapping>

To create an instance of AuthenticationProcessingFilter I declared this bean
in Spring's applicationContext.xml:
<bean id="authenticationProcessingFilter"
      class="org.acegisecurity.ui.webapp.AuthenticationProcessingFilter">
  <property name="authenticationManager" ref="authenticationManager"/>
  <property name="authenticationFailureUrl value="/LoginFailed.html"/>
  <property name="defaultTargetUrl" />
  <property name="filterProcessesUrl" value="/j_acegi_security_check"/>
</bean>   

But there is still something missing: the AuthenticationProcessingFilter
needs an AuthenticationManager. Any ideas how to configure that?

Or is an AuthenticationProcessingFilter the wrong filter?

Jesper


-- 
 Jesper Zedlitz   E-Mail   : jesper@zedlitz.de
                  Homepage : http://www.zedlitz.de
                  ICQ#     : 23890711


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


Re: tapestry-acegi questions

Posted by Robin Ericsson <lo...@gmail.com>.
On 11/1/06, Jesper Zedlitz <je...@zedlitz.de> wrote:
> When I try to access a secured page it works fine and I get to the login
> page. After submitting the login form I will be redirected
> to /j_acegi_security_check
> But how do I wire this URL to Acegi?

This is where I am too. I was thinking of inject the
AuthenticationManager (defined in hivemind-acege) and plug it directly
into that.

-- 
        regards,
        Robin

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


Re: direct link question

Posted by Paul Cooley <pe...@gmail.com>.
Can you use a <a href="
http://tapestry.apache.org/tapestry4.1/components/link/servicelink.html
">ServiceLink</a>?

On 11/1/06, James Sherwood <js...@rgisolutions.com> wrote:
>
> Hello all,
>
> Is there a way in a directlink to send the user to a service instead of a
> page.  IE can I MAKE a url and send them to it from a direct kind of the
> same way as you do cycle.activate("Pagename"); ?
>
> Thanks,
> James
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Gotta find my destiny, before it gets too late.-- Ian Curtis

direct link question

Posted by James Sherwood <js...@rgisolutions.com>.
Hello all,

Is there a way in a directlink to send the user to a service instead of a 
page.  IE can I MAKE a url and send them to it from a direct kind of the 
same way as you do cycle.activate("Pagename"); ?

Thanks,
James 


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


Re: tapestry-acegi questions

Posted by James Carman <ja...@carmanconsulting.com>.
The value you gave for the symbol
"de.zedlitz.tapestry.acegi.FormProcessingFilter", is that a service id
or a class name (I guess it could be both)?  It definitely needs to be
a service id, though.

On 11/1/06, Jesper Zedlitz <je...@zedlitz.de> wrote:
> James Carman wrote:
> > I haven't implemented form-based authentication in
> > tapestry-acegi, yet.  But, I don't think it's that difficult, really.
> > Your need to use the AuthenticationProcessingFilter (I don't define it
> > in my hivemodule.xml, but it would be easy to do so in yours) and your
> > form has to have two fields named "j_username" and "j_password" and it
> > should post to "j_acegi_security_check."  The filter will pick up that
> > request and handle it.  You would override the symbol
> > "tapestry.acegi.authenticationProcessingFilter" to point to your
> > authentication filter
> >
> I have added these entries to my hivemodule.xml:
>
> <contribution configuration-id="hivemind.ApplicationDefaults">
>   <default symbol="tapestry.acegi.authenticationProcessingFilter"
>            value="de.zedlitz.tapestry.acegi.FormProcessingFilter"/>
>   <default symbol="tapestry.acegi.authenticationEntryPoint"
>            value="de.zedlitz.tapestry.acegi.FormAuthenticationEntryPoint"/>
>   <!--            ^^^^
>              you have to adjust this text according to your module id -->
> </contribution>
>
> <service-point id="FormProcessingFilter" interface="javax.servlet.Filter">
>   <invoke-factory>
>     <construct
> class="org.acegisecurity.ui.webapp.AuthenticationProcessingFilter"
>          initialize-method="afterPropertiesSet">
>       <set property="authenticationFailureUrl" value="/LoginFailed.html"/>
>       <set property="defaultTargetUrl" value="/app"/>
>       <set property="filterProcessesUrl" value="/j_acegi_security_check"/>
>     </construct>
>   </invoke-factory>
> </service-point>
>
> <service-point id="FormAuthenticationEntryPoint"
>                interface="org.acegisecurity.ui.AuthenticationEntryPoint">
>   <invoke-factory>
>     <construct
> class="org.acegisecurity.ui.webapp.AuthenticationProcessingFilterEntryPoint">
>       <set property="loginFormUrl"
>            value="/app?page=Login&amp;service=page"/>
>       <set property="forceHttps" value="false"/>
>     </construct>
>   </invoke-factory>
> </service-point>
>
> and created Login.html and Login.java according to the tutorial
> http://wiki.javascud.org/display/hsa/Acegi+and+Tapestry--A+Step-by-Step+Guide
>
> When I try to access a secured page it works fine and I get to the login
> page. After submitting the login form I will be redirected
> to /j_acegi_security_check
> But how do I wire this URL to Acegi?
>
>
> Jesper
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

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