Re: Spring beans and ASO objects

2007-03-30 Thread James Carman

You can create your own Spring FactoryBeanI believe.

On 3/30/07, Simon Raveh <[EMAIL PROTECTED]> wrote:


Hi,

I'm developing web application using Tapestry 4.0 and Spring 2.0. I'm
using
the Tapestry-String  project to do the integration with Spring.
I need help with the Injection of Tapestry ASO object into a Spring bean.
I
saw a lot of examples  of injecting the other way from spring into
HiveMind
but not from HiveMind into spring.

Any help is welcome.

Thanks,
Simon



Re: Has anyone managed to deploy 'HILO' onto Oracle's J2EE Container successfully.

2007-03-29 Thread James Carman

Shouldn't you just filter "/*"?


On 3/29/07, Howard Lewis Ship <[EMAIL PROTECTED]> wrote:


Does /hilo/start work?

I've noticed a few oddities w.r.t. filtering "/".  Servlet containers
don't agree on this!

On 3/29/07, Jan Vissers <[EMAIL PROTECTED]> wrote:
> Hilo on Apache Tomcat (as it is buid from the Tapestry tutorial) behave
> differently when deployed onto Oracle's J2EE Container (OC4J). On Tomcat
> it works, on OC4J I get "404 Not found" for everything.
>
> http://host:port/hilo/ works on Tomcat, but 404's on OC4J.
>
> Thanks for any suggestion,
> -J.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
Howard M. Lewis Ship
TWD Consulting, Inc.
Independent J2EE / Open-Source Java Consultant
Creator and PMC Chair, Apache Tapestry
Creator, Apache HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

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




Re: T5.0.2. Deployment on OC4J 10.1.3

2007-03-28 Thread James Carman

It probably doesn't like Javassist (I'm assuming you're using Javassist,
Howard).  We had the same problems with T4 and HiveMind in general in OC4J.


On 3/28/07, Jan Vissers <[EMAIL PROTECTED]> wrote:


Hi,

Deploying the Starter application - similar to hilo from the tutoral,
but without the Maven stuff - results in the
following error message on OC4J 10.1.3:

Java.lang.RuntimeException: Unable to instantiate class
org.apache.tapestry.services.TapestryModule as builder for module
'tapestry
': Error building service proxy for service '
tapestry.ioc.PropertyShadowBuilder' (at
org.apache.tapestry.ioc.services.TapestryIOCModule
.buildPropertyShadowBuilder(PropertyAccess)): Unable to lookup class
org.apache.tapestry.ioc.services.PropertyShadowBuilder: org.apache
.tapestry.ioc.services.PropertyShadowBuilder

What could be wrong?
Thanks,
-J.


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




Re: tapestry-acegi, how does SecurityUtilsImpl.accessDecisionManager get set?

2007-03-21 Thread James Carman

No, you're looking at a different module entirely.  The tapestry-acegi
module relies upon the hivemind-acegi (usable in non-tapestry projects)
module to set up the core Acegi stuff.


On 3/21/07, Phillip C. Rhodes <[EMAIL PROTECTED]> wrote:


Wow, it's evident in that version of hivemodule.xml

For whatever reason, I must have a old copy of the tapestry-acegi project
because the hivemodule.xml that I have been looking at is very
different...

Thanks.
Phillip
- Original Message -----
From: "James Carman" <[EMAIL PROTECTED]>
To: "Tapestry users" 
Sent: Wednesday, March 21, 2007 4:05:41 PM (GMT-0500) America/New_York
Subject: Re: tapestry-acegi, how does
SecurityUtilsImpl.accessDecisionManager get set?

Sorry, I hit "Send" too quickly.  Here's the hivemodule (anonymous/anon to
login of course):


http://svn.javaforge.com/svn/hivemind/hivemind-acegi/trunk/src/main/resources/META-INF/hivemodule.xml



On 3/21/07, James Carman <[EMAIL PROTECTED]> wrote:
>
> The AccessDecisionManager is defined by the hivemind-acegi module.
>
> On 3/21/07, Phillip Rhodes <[EMAIL PROTECTED] > wrote:
> >
> > I am implementing acegi/tapestry and pulling apart the wonderful work
of
> > James Carman (preserving the copyrights!) and re-implementing for my
> > purposes.
> >
> > My @Secured annotation is erroring out in SecurityUtilsImpl when a
call
> > to the accessDecisionManager fails because it is null.  How is the
> > accessDecisionManager set in SecurityUtilsImpl?  I reviewed the
> > hivemodule.xml and do not see how it could be set...  Could someone
> > point out the magic in how the accessDecisionManager gets set?
> >
> > Thanks!
> >
> >
> >
> >
> >
> > It's for a project called authsum with is a security application that
> > integrates with acegi.  The cool part of it all is that it stores the
> > authorizations in lucene and is available via xfire.  Very enterprisy
design
> > (4 war files)  I hope I to get some interest from the tapestry
community.
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>


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




Re: tapestry-acegi, how does SecurityUtilsImpl.accessDecisionManager get set?

2007-03-21 Thread James Carman

Sorry, I hit "Send" too quickly.  Here's the hivemodule (anonymous/anon to
login of course):

http://svn.javaforge.com/svn/hivemind/hivemind-acegi/trunk/src/main/resources/META-INF/hivemodule.xml



On 3/21/07, James Carman <[EMAIL PROTECTED]> wrote:


The AccessDecisionManager is defined by the hivemind-acegi module.

On 3/21/07, Phillip Rhodes <[EMAIL PROTECTED] > wrote:
>
> I am implementing acegi/tapestry and pulling apart the wonderful work of
> James Carman (preserving the copyrights!) and re-implementing for my
> purposes.
>
> My @Secured annotation is erroring out in SecurityUtilsImpl when a call
> to the accessDecisionManager fails because it is null.  How is the
> accessDecisionManager set in SecurityUtilsImpl?  I reviewed the
> hivemodule.xml and do not see how it could be set...  Could someone
> point out the magic in how the accessDecisionManager gets set?
>
> Thanks!
>
>
>
>
>
> It's for a project called authsum with is a security application that
> integrates with acegi.  The cool part of it all is that it stores the
> authorizations in lucene and is available via xfire.  Very enterprisy design
> (4 war files)  I hope I to get some interest from the tapestry community.
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



Re: tapestry-acegi, how does SecurityUtilsImpl.accessDecisionManager get set?

2007-03-21 Thread James Carman

The AccessDecisionManager is defined by the hivemind-acegi module.

On 3/21/07, Phillip Rhodes <[EMAIL PROTECTED]> wrote:


I am implementing acegi/tapestry and pulling apart the wonderful work of
James Carman (preserving the copyrights!) and re-implementing for my
purposes.

My @Secured annotation is erroring out in SecurityUtilsImpl when a call to
the accessDecisionManager fails because it is null.  How is the
accessDecisionManager set in SecurityUtilsImpl?  I reviewed the
hivemodule.xml and do not see how it could be set...  Could someone point
out the magic in how the accessDecisionManager gets set?

Thanks!





It's for a project called authsum with is a security application that
integrates with acegi.  The cool part of it all is that it stores the
authorizations in lucene and is available via xfire.  Very enterprisy design
(4 war files)  I hope I to get some interest from the tapestry community.

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




Re: JBoss dependency causes ClassCastException

2007-03-18 Thread James Carman

The dependency should be declared as provided in
tapestry-contrib's pom.xml flie.

On 3/18/07, Andreas Andreou <[EMAIL PROTECTED]> wrote:


in your pom, where you define the dependency to tapestry-contrib,
have it exclude jboss-j2ee

On 3/18/07, Marcel Schepers <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> Last week I switched from version 4.0.2 to version 4.1.1. At first sight
> the
> upgrade went very smooth, Maven downloaded all dependencies and Maven's
> jetty:run worked like a charm. The moment I deployed my code on Jetty
> 6.1.0a ClassCastException in one of my servlet filters popped up. This
> filter
> uses JNDI to get hold of a javax.sql.Datasource instance. The datasource
> instances is provided by Commons DBCP. To make a long, very frustrating
> story short, Tapestry's contrib library version 4.1.1. has a dependency
to
> a
> jboss-j2ee that contains the javax.sql.Datasource interface. I do not
know
> if this is a Jetty issue or not. But I am puzzled that the JBoss archive
> contains javax.sql classes and interfaces that are provided by Java
1.4and
> 1.5. Why o why does JBoss bundle the java.sql package?
>
> Have a nice day,
> Marcel Schepers
>



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



Re: Cant Checkout tapestry-spring project

2007-03-18 Thread James Carman

I would definitely agree with that!  JavaForge is really getting on my
nerves.  I may just host it on my server so I don't have to worry about it.
:-)


On 3/18/07, Jesse Kuhnert <[EMAIL PROTECTED]> wrote:


You could always just move it to google code svn servers or
"honeycomb" on sf.net. (http://sourceforge.net/projects/honeycomb)
Even if you only used them for svn and still kept your http
sitesIt's looking a little ridiculous sometimes with no one
knowing how to get to things all the time..(imho)

On 3/18/07, James Carman <[EMAIL PROTECTED]> wrote:
> Someone must have changed the anonymous user's password again.  This
> happened once before.  It took me forever to find an email address to
> notify.  Anyone have an idea?
>
> On 3/17/07, Phillip Rhodes <[EMAIL PROTECTED]> wrote:
> >
> > James,
> > I was about to post a message to post a message about this very same
> > thing.
> > anonymous/anon does not work.  I tried using a browser, and subclipse,
and
> > it keeps failing to login with thse credentials.
> > Until javaforge anonymous access is fixed, would you mind making a
source
> > distribution available of your tapestry-acegi project?
> >
> > I really need to figure out why it (tapestry-acegi) is not working for
me.
> > I have a successfully working acegi project, but if I add the @Secure
> > annotation to my tapestry page file, /META-INF/hivemodule.xml, line
46,
> > column 63: Unable to initialize service
> > tapestry.acegi.BasicProcessingFilter (by invoking method
> > afterPropertiesSet on
org.acegisecurity.ui.basicauth.BasicProcessingFilter):
> > An AuthenticationManager is required
> >
> > I am not using basic or digest and was going to dig into your module
and
> > figure out what's going on.  I am using
> > tapestry-spring-1.0.0-20061122.201931-1.jar
> > tapestry-acegi-0.1-20070126.164757-10.jar
> >
> > Thanks.
> > Phillip
> >
> >
> > - Original Message -
> > From: "James Carman" <[EMAIL PROTECTED]>
> > To: "Tapestry users" 
> > Sent: Wednesday, March 14, 2007 8:41:18 PM (GMT-0500) America/New_York
> > Subject: Re: Cant Checkout tapestry-spring project
> >
> > anonymous/anon
> >
> > On 3/14/07, Miguel Angel Hernández <[EMAIL PROTECTED]> wrote:
> > >
> > > Hi all,
> > >
> > > I cant CO tapestry-spring trunk:
> > >
> > > Authentication realm: <http://svn.javaforge.com:80> Subversion
> > Repository
> > > Username:
> > > svn: PROPFIND request failed on
'/svn/tapestry/tapestry-spring/trunk'
> > > svn: PROPFIND of '/svn/tapestry/tapestry-spring/trunk':
authorization
> > > failed
> > > (http://svn.javaforge.com)
> > >
> > > does it has anonymous access?
> > >
> > > cheers,
> > >
> > > Miguel
> > >
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>


--
Jesse Kuhnert
Tapestry/Dojo team member/developer

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

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




Re: Cant Checkout tapestry-spring project

2007-03-18 Thread James Carman

Someone must have changed the anonymous user's password again.  This
happened once before.  It took me forever to find an email address to
notify.  Anyone have an idea?

On 3/17/07, Phillip Rhodes <[EMAIL PROTECTED]> wrote:


James,
I was about to post a message to post a message about this very same
thing.
anonymous/anon does not work.  I tried using a browser, and subclipse, and
it keeps failing to login with thse credentials.
Until javaforge anonymous access is fixed, would you mind making a source
distribution available of your tapestry-acegi project?

I really need to figure out why it (tapestry-acegi) is not working for me.
I have a successfully working acegi project, but if I add the @Secure
annotation to my tapestry page file, /META-INF/hivemodule.xml, line 46,
column 63: Unable to initialize service
tapestry.acegi.BasicProcessingFilter (by invoking method
afterPropertiesSet on org.acegisecurity.ui.basicauth.BasicProcessingFilter):
An AuthenticationManager is required

I am not using basic or digest and was going to dig into your module and
figure out what's going on.  I am using
tapestry-spring-1.0.0-20061122.201931-1.jar
tapestry-acegi-0.1-20070126.164757-10.jar

Thanks.
Phillip


- Original Message -----
From: "James Carman" <[EMAIL PROTECTED]>
To: "Tapestry users" 
Sent: Wednesday, March 14, 2007 8:41:18 PM (GMT-0500) America/New_York
Subject: Re: Cant Checkout tapestry-spring project

anonymous/anon

On 3/14/07, Miguel Angel Hernández <[EMAIL PROTECTED]> wrote:
>
> Hi all,
>
> I cant CO tapestry-spring trunk:
>
> Authentication realm: <http://svn.javaforge.com:80> Subversion
Repository
> Username:
> svn: PROPFIND request failed on '/svn/tapestry/tapestry-spring/trunk'
> svn: PROPFIND of '/svn/tapestry/tapestry-spring/trunk': authorization
> failed
> (http://svn.javaforge.com)
>
> does it has anonymous access?
>
> cheers,
>
> Miguel
>


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




Re: Cant Checkout tapestry-spring project

2007-03-14 Thread James Carman

anonymous/anon

On 3/14/07, Miguel Angel Hernández <[EMAIL PROTECTED]> wrote:


Hi all,

I cant CO tapestry-spring trunk:

Authentication realm:  Subversion Repository
Username:
svn: PROPFIND request failed on '/svn/tapestry/tapestry-spring/trunk'
svn: PROPFIND of '/svn/tapestry/tapestry-spring/trunk': authorization
failed
(http://svn.javaforge.com)

does it has anonymous access?

cheers,

Miguel



Re: Accessing EJB3s via annotations?

2007-03-13 Thread James Carman

I don't know.  Would the enhancement workers allow you to enhance a field
like that, though?  I can see where putting it on a method would be fairly
straight-forward, but a field might be a bit tricky.

On 3/13/07, Jesse Kuhnert <[EMAIL PROTECTED]> wrote:


It's not for the casual visitor of course, but the "integrated" way to
do it would be using the enhancement workers.


http://tapestry.apache.org/tapestry4.1/tapestry-framework/hivedoc/module/tapestry.enhance.html

On 3/8/07, Bastian Voigt <[EMAIL PROTECTED]> wrote:
> Hi *,
>
> in Suns EJB tutorials all EJB calls are made via annotations like so:
>
> @EJB private MyBeanInterface myBean;
> .
> .
> void someMethod()
> {
> myBean.callEJBMethod();
> }
> .
> .
>
>
> In Tapestry (4.0.2) Page and Component classes this annotation does not
> seem to work (NullPointerException) although it gives no compiler errors
> or anything like that. Can someone tell me why it does not work this
> way? How can I efficiently access EJB3s via their local interface from a
> tapestry application?
>
> The problem is that glassfish supports only remote interfaces when using
> JNDI lookup. But I would rather like to use local interfaces as this
> should be faster.
>
> Thank you very much for your help...
>
> Regards,
> Bastian
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


--
Jesse Kuhnert
Tapestry/Dojo team member/developer

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

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




Re: plugins for a tapestry app?

2007-03-02 Thread James Carman

Someone posted something like that a while back, I believe.  Try
searching the archives.

On 3/2/07, Steve Shucker <[EMAIL PROTECTED]> wrote:

Could one of the gurus please post some example hivemind config showing
how I can include a hivemodule.xml with my component library project so
that the library automagically registers itself with whatever
application is running?  I've thought for a while that the *.application
file was something of a leftover and I'd rather do as much of my config
as possible in hivemind instead.

-Steve

Dan Adams wrote:
> hmm. specifically for hibernate, how do you have it contribute new
> entities?
>
> On Thu, 2007-03-01 at 23:49 -0500, James Carman wrote:
>
>> Since HiveMind is already integrated with T4, I'd say use it.  It has
>> the ability to dynamically discover new modules like you're wanting.
>> I came up with a similar architecture to allow multiple modules to
>> contribute to my Hibernate configuration dynamically.  All you had to
>> do is drop in the jar, and the entities were automatically picked up
>> by the hibernate configuration.
>>
>> On 3/1/07, Dan Adams <[EMAIL PROTECTED]> wrote:
>>
>>> So I have a T4 app and I'm trying to get a sense for how hard it would
>>> be to allow the user of plugins. What I mean is that I would like to be
>>> able to write a plugin, put the jar in the WEB-INF/lib, and then have my
>>> application load it. The plugins could be either interface contributions
>>> or strictly something behind the scenes. Does anyone have any experience
>>> with doing something like this? Would hivemind be the best bet or is
>>> something like Java Plugin Framework better? I'm looking for any and all
>>> thoughts/suggestions. Thanks.
>>>
>>> - dan
>>>
>>>
>>> -
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>

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




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



Re: plugins for a tapestry app?

2007-03-02 Thread James Carman

There's a HiveMind module for that, actually.  Check out:

http://svn.javaforge.com/svn/hivemind/hivemind-hibernate3/trunk/src/main/resources/META-INF/hivemodule.xml

That's my hivemodule.xml file and it basically just sets up a
configuration point that allows any HiveMind module to contribute to
the Hibernate configuration.  It works great in our application,
allowing us to just drop in new parts of the "domain" model and they
just get added into the mix automatically.


On 3/2/07, Dan Adams <[EMAIL PROTECTED]> wrote:

hmm. specifically for hibernate, how do you have it contribute new
entities?

On Thu, 2007-03-01 at 23:49 -0500, James Carman wrote:
> Since HiveMind is already integrated with T4, I'd say use it.  It has
> the ability to dynamically discover new modules like you're wanting.
> I came up with a similar architecture to allow multiple modules to
> contribute to my Hibernate configuration dynamically.  All you had to
> do is drop in the jar, and the entities were automatically picked up
> by the hibernate configuration.
>
> On 3/1/07, Dan Adams <[EMAIL PROTECTED]> wrote:
> > So I have a T4 app and I'm trying to get a sense for how hard it would
> > be to allow the user of plugins. What I mean is that I would like to be
> > able to write a plugin, put the jar in the WEB-INF/lib, and then have my
> > application load it. The plugins could be either interface contributions
> > or strictly something behind the scenes. Does anyone have any experience
> > with doing something like this? Would hivemind be the best bet or is
> > something like Java Plugin Framework better? I'm looking for any and all
> > thoughts/suggestions. Thanks.
> >
> > - dan
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
--
Dan Adams
Senior Software Engineer
Interactive Factory
617.235.5857


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




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



Re: Write html directly from a db

2007-03-01 Thread James Carman

You can tell the @Insert component to not escape stuff...



http://tapestry.apache.org/tapestry4.1/components/general/insert.html


On 3/2/07, Hernâni Cerqueira <[EMAIL PROTECTED]> wrote:

Hello all,

I'm a newbie in wath counts to tapestry, and wath i wan't to do is the
following:

I have a table row in a db wich as some html stored in it. Then i want
to write that html code directly into a page without my <'s and >'s and
other stuff being replaced by their entities, so that the html is
correctly viewed on the rendered page.

Don't desperate if you don't understand what i mean, but english it's
not my natural language and i have some dificulties expressing myself in
technical terms.

Thank's in advance, Hernâni

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




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



Re: plugins for a tapestry app?

2007-03-01 Thread James Carman

Since HiveMind is already integrated with T4, I'd say use it.  It has
the ability to dynamically discover new modules like you're wanting.
I came up with a similar architecture to allow multiple modules to
contribute to my Hibernate configuration dynamically.  All you had to
do is drop in the jar, and the entities were automatically picked up
by the hibernate configuration.

On 3/1/07, Dan Adams <[EMAIL PROTECTED]> wrote:

So I have a T4 app and I'm trying to get a sense for how hard it would
be to allow the user of plugins. What I mean is that I would like to be
able to write a plugin, put the jar in the WEB-INF/lib, and then have my
application load it. The plugins could be either interface contributions
or strictly something behind the scenes. Does anyone have any experience
with doing something like this? Would hivemind be the best bet or is
something like Java Plugin Framework better? I'm looking for any and all
thoughts/suggestions. Thanks.

- dan


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




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



Re: T5 + Jetty + Hibernate

2007-02-26 Thread James Carman

That's not exactly a good separation of concerns, though.  Your view
layer shouldn't be talking directly to your ORM layer.  I'd put a DAO
layer in between for some encapsulation (and to help with unit
testing).


On 2/26/07, Massimo Lusetti <[EMAIL PROTECTED]> wrote:

On 2/25/07, Olivier Jacquet <[EMAIL PROTECTED]> wrote:

>
> Hi,
>
>
> Does anyone has an example of how to get tapestry, jetty and hibernate
> running together?

Having an hibernate Session injected into T5 pages is fairly easy:

public final static SessionFactory buildSessionFactory()
{
URL res = AppModule.class.getResource("/hibernate.cfg.xml");
SessionFactory sf = new AnnotationConfiguration()
.configure(res)
.buildSessionFactory();

return sf;
}


@Lifecycle("perthread")
public Session buildSession(@InjectService("SessionFactory")
SessionFactory factory)
{
return factory.getCurrentSession();
//return factory.openSession();
}


Then in you page just:

  @Inject
  private Session _session;

I think all of these is explained in the online doc.

If you need/wish more integration (like having your hibernate object
directly into your pages) you have to do some more work, this is just
a starting point.

--
Massimo
http://meridio.blogspot.com

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




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



Re: tapestry-spring lazy initialize everything?

2007-02-24 Thread James Carman

Just omit the setting.  If hibernate doesn't see
hibernate.hbm2ddl.auto, it does nothing.


On 2/24/07, Kalle Korhonen <[EMAIL PROTECTED]> wrote:

In practice, no. I would have to mark a whole bunch of beans as lazy inited,
give up on auto wiring etc. But it does help to post your thoughts. I was
close before.. I don't see hibernate.hbm2ddl.auto=false documented anywhere
(I see one(!) dodgy google result for it), but that works, and then I can
just call validation myself at a later point. This way I don't need to
fiddle with anything else, but only need to make sure that I don't do
database operations before I do the validation, which is simple enough.

Kalle

On 2/24/07, James Carman <[EMAIL PROTECTED]> wrote:
>
> Can you just mark your session factory bean as lazy init in your
> spring application context file?  Or, mark the whole xml file as lazy
> by default?
>
> On 2/24/07, Kalle Korhonen <[EMAIL PROTECTED]> wrote:
> > Using Tapestry 4.0.2 and this is much more a hivemind question really,
> but I
> > wonder if anybody has tried to lazy initialize Tapestry-Spring.
> Currently,
> > if I don't initialize Spring context at the start-up, Tapestry-Spring
> fails
> > on ClassCastException. The use case I have is that I'm using Hibernate
> and
> > I'd like to deploy a new version of the web application using
> > hibernate.hbm2ddl.auto=validate. If the validation fails I'd just show a
> > status message like "Sorry, we are down for maintenance" until the
> schema is
> > updated, which I can in principle do if I delay creating the Spring
> context
> > and (re-)initialize it at some point later. However, ApplicationServlet
> > initialization fails when it tries to construct Hivemind registry. The
> > service point SpringApplicationInitializer has been marked private so I
> > can't override it externally. What I'm trying to do is to avoid granting
> > rights to modify the schema for the webapp's normal database access
> account,
> > and only update the scema externally with a different user credentials
> (more
> > detailed post about Hibernate validation from Spring's perspective at
> > http://forum.springframework.org/showthread.php?t=35274).
> >
> > Suppose I could implement a wrapper/extension for ApplicationServlet to
> > catch the exception and make it able to re-initialize, but then I'm
> already
> > implementing a wrapper for Spring context initializer and doing some
> other
> > tricks to get Acegi filters to initialize lazily, so overall I'm
> wondering
> > if I'm just complicating the design for nothing. Maybe somebody already
> has
> > a solution with schema validation or can see some completely different,
> but
> > simpler way to get to the same end result?
> >
> > Kalle
> >
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



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



Re: tapestry-spring lazy initialize everything?

2007-02-24 Thread James Carman

Can you just mark your session factory bean as lazy init in your
spring application context file?  Or, mark the whole xml file as lazy
by default?

On 2/24/07, Kalle Korhonen <[EMAIL PROTECTED]> wrote:

Using Tapestry 4.0.2 and this is much more a hivemind question really, but I
wonder if anybody has tried to lazy initialize Tapestry-Spring. Currently,
if I don't initialize Spring context at the start-up, Tapestry-Spring fails
on ClassCastException. The use case I have is that I'm using Hibernate and
I'd like to deploy a new version of the web application using
hibernate.hbm2ddl.auto=validate. If the validation fails I'd just show a
status message like "Sorry, we are down for maintenance" until the schema is
updated, which I can in principle do if I delay creating the Spring context
and (re-)initialize it at some point later. However, ApplicationServlet
initialization fails when it tries to construct Hivemind registry. The
service point SpringApplicationInitializer has been marked private so I
can't override it externally. What I'm trying to do is to avoid granting
rights to modify the schema for the webapp's normal database access account,
and only update the scema externally with a different user credentials (more
detailed post about Hibernate validation from Spring's perspective at
http://forum.springframework.org/showthread.php?t=35274).

Suppose I could implement a wrapper/extension for ApplicationServlet to
catch the exception and make it able to re-initialize, but then I'm already
implementing a wrapper for Spring context initializer and doing some other
tricks to get Acegi filters to initialize lazily, so overall I'm wondering
if I'm just complicating the design for nothing. Maybe somebody already has
a solution with schema validation or can see some completely different, but
simpler way to get to the same end result?

Kalle



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



Re: OutOfMemoryError after serving N pages

2007-02-22 Thread James Carman

Are you disabling page/component class caching?  Of course, I think
that causes the permgen stuff as mentioned before, but it may be part
of your problem.

On 2/22/07, Joe Trewin <[EMAIL PROTECTED]> wrote:

If you're using Tomcat and have access to the startup scripts, I'd
suggest turning on JMX so that you can have a look inside the memory
heaps using jconsole.

To do this add a line to tomcat/bin/startup.sh just before the exec at
the end:

export CATALINA_OPTS="-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=9098
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false"

(Note that this assumes an internal dev box, as there's no ssl or
authentication turned on.)

You can then connect to it with jconsole (in your java install's bin
directory).

The next step would be some more automated profiling, but just visually
looking at the state of the heaps during a load test can be quite
helpful.


> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: 22 February 2007 13:22
> To: users@tapestry.apache.org
> Subject: RE: OutOfMemoryError after serving N pages
>
> Yeah, that is more sinister.
>
> Try dropping a lambdaprobe.war in your container and watching
> what happens to your app as you serve up N pages.
>
> It isn't as detailed as JProbe or anything like that, but
> you'll be up and running in 5 minutes and it may give you a
> better overview of your runtime environment and any resource
> constraints you may unknowingly have.
>
> http://www.lambdaprobe.org/d/index.htm
>
>
> Tom
>
> -Original Message-
> From: Arjan Verstoep [mailto:[EMAIL PROTECTED]
> Sent: Thursday, February 22, 2007 8:15 AM
> To: Tapestry users
> Subject: Re: OutOfMemoryError after serving N pages
>
> [EMAIL PROTECTED] wrote:
> > We had the same thing, and in our case it was related to a small
> PermGen
> > Space setting in our Tomcat container.
> >
> > My understanding of the Sun JVM is that it partitions up
> its allocated
> > memory into heap, perm gen, etc. chunks and that the Perm
> Gen space is
> > where all "meta data" about classes gets stored.  In "modern" JEE
> > programming with all the CGLIB and just-in-time abstract class
> overrides
> > & instantiation, the Perm Gen space tends to blow up quicker.
> >
> > Anyway, try throwing a -XX:MaxPermSize=256m on your JVM startup and
> see
> > if that helps.
> >
> > Note: if you're actually running out of PermGen space, you'll see a
> > reference to that in your OOME.  If you are just getting plain old
> > OOMEs, it sounds like something more sinister.
> >
> > HTH,
> > Tom
> >
> >
> My JVM is complaining about heap space, so I fear that it is
> something sinister...
>
>10:36:23,289 ERROR [MusiController4]:253 -
> Servlet.service() for servlet MusiController4 threw exception
>java.lang.OutOfMemoryError: Java heap space
>
>
> ~Arjan Verstoep
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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





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



Re: Record locking

2007-02-21 Thread James Carman

You use the session id so that you don't maintain the reference to the
actual session.  When the session listener sees that the session dies,
he removes all object locks for that session.  Now, this still doesn't
solve the problem of one user opening multiple windows and trying to
edit the same object, but if they're that stupid, then they deserve to
lose their work (kidding of course, but just wanted to point out the
issue).


On 2/21/07, Andrea Chiumenti <[EMAIL PROTECTED]> wrote:

nice to know ;)

On 2/21/07, Peter Stavrinides <[EMAIL PROTECTED]> wrote:
>
> Andrea,
> You can do this If you create a state object that has an application
> scope... you can wire your session listener to it to add and remove the
> session id's.
>
> 
>
> Andrea Chiumenti wrote:
> > But session is user specific and you want to lock the record accross the
> > application, how whould you do this ?
> >
> > On 2/21/07, Robert Zeigler <[EMAIL PROTECTED]> wrote:
> >>
> >> Actually, no, if the browser dies, the record won't stay locked.
> >> The updating happens from the edit page; if the browser crashes,
> >> there's no edit page, so no updating, so the lock expires.
> >>
> >> Cheers,
> >>
> >> Robert
> >>
> >> On Feb 21, 2007, at 2/214:03 AM , Andrea Chiumenti wrote:
> >>
> >> > ... But if the browser dies for some reason (very frequent
> >> > especially with
> >> > MS products), then the record will remain locked, the only
> >> > possibility with
> >> > this solution would be to add a locking timeout with application
> >> > scope.
> >> >
> >> > On 2/21/07, Robert Zeigler <[EMAIL PROTECTED]> wrote:
> >> >>
> >> >> In my case, it was straightforward: the user is considered to be
> >> >> "still editing" if they have a browser window open to the edit page
> >> >> for the object in question; if they navigate away from that page,
> the
> >> >> system considers their edit session over.
> >> >>
> >> >> Robert
> >> >>
> >> >>
> >> >> On Feb 21, 2007, at 2/212:47 AM , Peter Stavrinides wrote:
> >> >>
> >> >> > Hi Robert
> >> >> >
> >> >> > I like your idea, "you say that periodic ajax calls are sent to
> the
> >> >> > server to inform of the fact that the user is still editing" how
> >> >> > exactly do you track if a user is still editing?
> >> >> >
> >> >> > Robert Zeigler wrote:
> >> >> >> The main problem with using a session timeout for the lock is
> that
> >> >> >> it doesn't allow you to detect events where a user starts to edit
> >> >> >> an object, does not finish, but remains active in the webapp; the
> >> >> >> session won't die, and neither will your lock. You have to
> >> >> >> incorporate time at least to some degree. I implemented similar
> >> >> >> functionality in an application recently, but used a bit of ajax
> >> >> >> magic to ensure that the lock was held for exactly as long as it
> >> >> >> needed to be and no longer (while the user is editing the object,
> >> >> >> periodic ajax calls are sent to the server to inform of the fact
> >> >> >> that the user is still editing; if the user saves, the lock is
> >> >> >> released; if the user moves to a different portion of the webapp
> >> >> >> without saving or canceling the lock, the lock expires since
> there
> >> >> >> are no more ajax calls to keep the lock valid)
> >> >> >>
> >> >> >> Robert
> >> >> >>
> >> >> >> On Feb 21, 2007, at 2/211:56 AM , Peter Stavrinides wrote:
> >> >> >>
> >> >> >>> I don't think the benefits justify the effort involved to
> >> >> >>> maintain all those timestamps, its a bit too complex. Perhaps
> its
> >> >> >>> better to stick to a single table as well... rather write the
> >> >> >>> session id into the database to checkout a customer record.
> >> >> >>>
> >> >> >>> Allow updates to a customer record if its not checked out, and
> >> >> >>> this way you have no worries about lock expiration etc.
> >> >> >>>
> >> >> >>> You should maintain an ASO that tracks all active sessions by
> >> >> >>> session id. Once a user queries for a customer record that has
> >> >> >>> been checked out, if the session ID still exists in the ASO,
> then
> >> >> >>> refuse update access and grant only read access, simple and
> >> >> >>> elegant. Once the user saves successfully release the lock in
> the
> >> >> >>> database. if a session is interrupted for whatever reason, then
> >> >> >>> using a session timeout of 20 or 30 minutes and a session
> >> >> >>> listener you clean up removing the session ID from the ASO and
> >> >> >>> database... so you are well covered. I am no guru like some of
> >> >> >>> these other guys, but this works for me and its nice and
> >> >> >>> simple... here is a brief implementation outline:
> >> >> >>>
> >> >> >>> public class ApplicationManager {
> >> >> >>>
> >> >> >>> /** variable to store the singleton ApplicationManager */
> >> >> >>> private static final ApplicationManager
> >> >> >>> applicationManagerInstance_ = new ApplicationManager();
> >> >> >>>
> >> >> >>> /** Hashtable containing visit history objects. 
> is
> >> >> >

Re: Record locking

2007-02-21 Thread James Carman

If the browser dies, then the session will timeout.  The record will
not stay locked (if you just keep an in-memory record of who is
editing what).  You could use a "do you want to save your changes"
notification (a la GMail and others) to either save the data or send a
request to clear the lock when they leave the edit screen.


On 2/21/07, Andrea Chiumenti <[EMAIL PROTECTED]> wrote:

... But if the browser dies for some reason (very frequent especially with
MS products), then the record will remain locked, the only possibility with
this solution would be to add a locking timeout with application scope.

On 2/21/07, Robert Zeigler <[EMAIL PROTECTED]> wrote:
>
> In my case, it was straightforward: the user is considered to be
> "still editing" if they have a browser window open to the edit page
> for the object in question; if they navigate away from that page, the
> system considers their edit session over.
>
> Robert
>
>
> On Feb 21, 2007, at 2/212:47 AM , Peter Stavrinides wrote:
>
> > Hi Robert
> >
> > I like your idea, "you say that periodic ajax calls are sent to the
> > server to inform of the fact that the user is still editing" how
> > exactly do you track if a user is still editing?
> >
> > Robert Zeigler wrote:
> >> The main problem with using a session timeout for the lock is that
> >> it doesn't allow you to detect events where a user starts to edit
> >> an object, does not finish, but remains active in the webapp; the
> >> session won't die, and neither will your lock. You have to
> >> incorporate time at least to some degree. I implemented similar
> >> functionality in an application recently, but used a bit of ajax
> >> magic to ensure that the lock was held for exactly as long as it
> >> needed to be and no longer (while the user is editing the object,
> >> periodic ajax calls are sent to the server to inform of the fact
> >> that the user is still editing; if the user saves, the lock is
> >> released; if the user moves to a different portion of the webapp
> >> without saving or canceling the lock, the lock expires since there
> >> are no more ajax calls to keep the lock valid)
> >>
> >> Robert
> >>
> >> On Feb 21, 2007, at 2/211:56 AM , Peter Stavrinides wrote:
> >>
> >>> I don't think the benefits justify the effort involved to
> >>> maintain all those timestamps, its a bit too complex. Perhaps its
> >>> better to stick to a single table as well... rather write the
> >>> session id into the database to checkout a customer record.
> >>>
> >>> Allow updates to a customer record if its not checked out, and
> >>> this way you have no worries about lock expiration etc.
> >>>
> >>> You should maintain an ASO that tracks all active sessions by
> >>> session id. Once a user queries for a customer record that has
> >>> been checked out, if the session ID still exists in the ASO, then
> >>> refuse update access and grant only read access, simple and
> >>> elegant. Once the user saves successfully release the lock in the
> >>> database. if a session is interrupted for whatever reason, then
> >>> using a session timeout of 20 or 30 minutes and a session
> >>> listener you clean up removing the session ID from the ASO and
> >>> database... so you are well covered. I am no guru like some of
> >>> these other guys, but this works for me and its nice and
> >>> simple... here is a brief implementation outline:
> >>>
> >>> public class ApplicationManager {
> >>>
> >>> /** variable to store the singleton ApplicationManager */
> >>> private static final ApplicationManager
> >>> applicationManagerInstance_ = new ApplicationManager();
> >>>
> >>> /** Hashtable containing visit history objects.  is
> >>> the sessionid and the Visit Object */
> >>> private static ConcurrentHashMap visitHistory_ =
> >>> new ConcurrentHashMap();
> >>>
> >>> /** @return the ApplicationManager instance */
> >>> public synchronized static ApplicationManager getInstance(){
> >>> return applicationManagerInstance_;
> >>> }
> >>>
> >>> }
> >>>
> >>> public class SessionMonitor implements HttpSessionListener {
> >>>
> >>> /** @see javax.servlet.http.HttpSessionListener#sessionDestroyed
> >>> (javax.servlet.http.HttpSessionEvent) */
> >>> public void sessionDestroyed(HttpSessionEvent event) {
> >>> String sid = event.getSession().getId();
> >>> ApplicationManager manager = ApplicationManager.getInstance();
> >>> manager.removeUserSession(sid);
> >>> }
> >>>
> >>>
> >>> Hivemodule.xml:
> >>>
> >>> 
> >>> 
> >>> 
> >>> 
> >>> 
> >>>
> >>> 
> >>> 
> >>> 
> >>> 
> >>> 
> >>>
> >>> cheers,
> >>> Peter
> >>>
> >>> Murray Collingwood wrote:
>  Wow - what a lot of responses.
> 
>  First a little more detail - use case (for example):
> 
>  Take a customer record, a basic record has previously been
>  created and the
>  customer has completed some forms so we are now wanting to
>  complete all of the
>  details about contact information, financial details, key
>  assets, health
>  information, etc, etc.

Re: Record locking

2007-02-20 Thread James Carman

The suggestion of using the http session (its id actually) was pretty
cool I thought.  That allows you to "timeout" the checkout/lock.  You
need to make sure (as pointed out) that the locks don't get orphaned,
thereby locking everyone out of the object/record perpetually
(obviously you could write an admin screen to unlock it).

On 2/20/07, Barry Books <[EMAIL PROTECTED]> wrote:

Murray,

I also have records that need to be 'checked out' for some time and
your solution seems simple and elegant. So much so I may steal it.

I use one sequence for every primary key in the database so a table
named "lock" with

key primary key
timestamp timestamp
userid

should do it. UserId lets me know who has it.

to see if a record is locked and get lock key

select count(*) as locked, key, timestamp from lock where key = ? and
timestamp less than 20 minutes old group by key, timestamp

1 is locked 0 unlocked timestamp is the key to lock the recored

to lock a record

if key == null
insert into lock values ( key, now, userid)
else
update lock set timestamp = now, userid = ? where key = ? and timestamp = ?

if you update 1 row you've got it otherwise someone else does

to unlock

update lock set timestamp = null where key = ? and timestamp = ?

if you don't get 1 row updated something bad happened

Seems easy. Records are locked a max of 20 minutes and no races I can see.

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




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



Re: Variable numbers of rows

2007-02-20 Thread James Carman

Yes, tapestry will also use hidden fields to manage the state, but you
don't have to worry about it.

On 2/20/07, Jesse Kuhnert <[EMAIL PROTECTED]> wrote:

I think T4.1 does this sort of mundane state mgmt kind of stuff for you.

On 2/19/07, Michael Prescott <[EMAIL PROTECTED]> wrote:
> Sorry, Tapestry 4.0.
>
> -Original Message-
> From: Mark Stang [mailto:[EMAIL PROTECTED]
> Sent: February 19, 2007 4:46 PM
> To: Tapestry users; tapestry-user@jakarta.apache.org
> Subject: RE: Variable numbers of rows
>
> Which version of Tapestry are you using?
>
> Mark J. Stang
> Senior Engineer/Architect
> office: +1 303.468.2900
> mobile: +1 303.507.2833
> Ping Identity
>
>
>
> -Original Message-
> From: Michael Prescott [mailto:[EMAIL PROTECTED]
> Sent: Mon 2/19/2007 2:29 PM
> To: tapestry-user@jakarta.apache.org
> Subject: Variable numbers of rows
>
> We've got a couple of forms where users can edit a list of items, and
> also add new items to the bottom.  We're currently doing this by sending
> preset number of hidden rows, revealed as necessary by Javascript -
> although this is a little lame.
>
> It seems that components like @For are designed to handle changes in the
> backing data set that originate on the server, but not on the client.
> There are hidden fields that need maintenance, for one thing.
>
> Is there a common approach for this sort of scenario?  Off the top of my
> head, it looks like I might need to implement something like @For, but
> which has a well-known (or at least published) contract in terms of the
> hidden field maintenance that would be required.
>
> Any clues or pointers would be much appreciated.
>
> Michael
>
>
> Michael Prescott
> direct: 416.646.7062
>
> main: 416.646.7000
> fax: 416.646.7050
>
> Exchange Solutions Inc.
> 250 Yonge Street, 18th Floor
> Toronto, ON M5B 2L7
> www.exchangesolutions.com
>
>
>
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
Jesse Kuhnert
Tapestry/Dojo team member/developer

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

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




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



Re: Record locking

2007-02-20 Thread James Carman

Leaving a database connection open for that period of time (possibly
minutes/hours) isn't advisable from what I understand.


On 2/19/07, Fred Janon <[EMAIL PROTECTED]> wrote:

Yep, SELECT for UPDATE is what's behind TRANSACTION_SERIALIZABLE...

On 2/20/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> How about using  a SELECT  . . . FOR UPDATE statement to select the record
> being edited.  Once you read the record it will be locked, and as long as
> you keep the transaction open for the duration of the edit then no other
> transaction will be able to select the same record for update.  If the
> transaction times out the DB management system will release the record for
> someone else to work with.
>
> Roland.
>
> 

> "If you stand up and be counted, from time to time you may get yourself
> knocked down. But remember this: A man flattened by an opponent can get up
> again. A man flattened by conformity stays down for good." - Thomas J.
> Watson, Jr.
>
> "Fred Janon" <[EMAIL PROTECTED]> wrote on 20/02/2007 10:44:20:
>
> > Interesting question! I don't have any experience in doing this but it
> made
> > me search in one of my Websphere book. Not sure if that would fulfill
> your
> > requirements but TRANSACTION_SERIALIZABLE and
> PessimisticUpdate-Exclusive
> > might be worth investigating. I am not sure what container you use and
> if
> > JTA is available to you. I would check the JDBC driver as well, it might
> > have some extra transaction support. Writing your own is probably pretty
> > tempting when the answer is not obvious and you would know how it works.
> On
> > the other side you have an extra write (at least) each time and need to
> > manage the lock if the transaction is abandoned.
> >
> > If you have the time to investigate more, you'll probably a transaction
> guru
> > soon. We, developers, have a tendency to avoid transactions and
> isolation
> > levels like plague... Not easy development and test subjects as the lack
> of
> > answers indicates...
> >
> > Good luck and let us know what solution you end up with, I am curious.
> >
> > Fred
> >
> > On 2/20/07, Murray Collingwood <[EMAIL PROTECTED]> wrote:
> > >
> > > James Carman  carmanconsulting.com> writes:
> > > > You can use optimistic locking.  When the user submits and they have
> > > > outdated data, then you just merge the object's data with what is in
> > > > the data store and show it back to the user for them to confirm it.
> > >
> > > In an application where the user can spend 20 minutes completing the
> > > information
> > > in a row, they are not going to be happy when they find out somebody
> else
> > > has
> > > been updating this same row and the information has all been merged.
> They
> > > then
> > > spend another 10 minutes cleaning up all of the duplicated changes.
> > >
> > > Even pessimistic locking is not sufficient.
> > >
> > > I need guaranteed write-exclusive locking for the duration of the
> request.
> > > ie
> > > when I read-for-update the record should be locked against all other
> > > read-for-update requests until I save my changes and release the lock.
> > >
> > > It sounds as though I'm going to have to write my own...again.
> > >
> > > Cheers
> > > mc
> > >
> > >
> > >
> > >
> > >
> > > -
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



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



Re: Problems with Tapestry 5 and JBoss

2007-02-20 Thread James Carman

Does that package exist (com.ec.tap5.pages)?

On 2/20/07, Aslak Gronflaten <[EMAIL PROTECTED]> wrote:

On 2/18/07, James Carman <[EMAIL PROTECTED]> wrote:
> Is Javassist a part of the "shared" classpath in JBoss 4.x?


Yes, javassist is the culprit for that part of the problem. Exchanging
the one that comes with jboss with a newer one ( javassist-3.3.ga.jar
) gets me a little bit further.
But then I get this:

java.lang.RuntimeException: Error invoking service builder method
org.apache.tapestry.services.TapestryModule.buildInfrastructure(Log,
Collection) (for service 'tapestry.Infrastructure'): Error invoking
service contribution method
org.apache.tapestry.services.TapestryModule.contributeInfrastructure(Configuration,
ServiceLocator, TypeCoercer, PropertyAccess): Error building service
proxy for service 'tapestry.ApplicationStateManager' (at
org.apache.tapestry.services.TapestryModule.buildApplicationStateManager(Map,
ApplicationStatePersistenceStrategySource)): Unable to lookup class
org.apache.tapestry.services.ApplicationStateManager:
org.apache.tapestry.services.ApplicationStateManager
at 
org.apache.tapestry.ioc.internal.ServiceBuilderMethodInvoker.createObject(ServiceBuilderMethodInvoker.java:263)


which is I get when the tapestry jars are inside the war file. I can
dump them in the jboss lib to solve it (but I'm not allowed on my
webhotel), or change the jboss configuration, by setting this line

  true

in deploy/jbossweb-tomcat55.sar/META-INF/jboss-service.xml

That will allow it to actually deploy the war file without errors.
However, there's still a big problem to which I've found no solution,
and that is when actually trying to see a page,  I get this error:

java.lang.RuntimeException: java.io.FileNotFoundException:
/usr/local/jboss/server/default/tmp/deploy/tmp29557provis-exp.war/WEB-INF/classes/com/ec/tapfive/pages
(No such file or directory)

org.apache.tapestry.internal.services.ComponentClassLocatorImpl.locateComponentClassNames(ComponentClassLocatorImpl.java:63)

org.apache.tapestry.internal.services.ComponentClassResolverImpl.fillNameToClassNameMap(ComponentClassResolverImpl.java:156)

org.apache.tapestry.internal.services.ComponentClassResolverImpl.rebuild(ComponentClassResolverImpl.java:141)

org.apache.tapestry.internal.services.ComponentClassResolverImpl.rebuild(ComponentClassResolverImpl.java:124)

org.apache.tapestry.internal.services.ComponentClassResolverImpl.locate(ComponentClassResolverImpl.java:236)

org.apache.tapestry.internal.services.ComponentClassResolverImpl.resolvePageNameToClassName(ComponentClassResolverImpl.java:176)
..


This stacktrace is on osx - on windows it actually also says
(permission denied) with the FileNotFoundException.

Does anyone have any idea on how to get around this?
All these errors are replicateable with any minimal tapestry 5
application (try the tapestry-simple maven2 magic) on a standard
jboss, and thus we should try to find a solution. Also, my deadline is
tomorrow ;)

Thanks,
  Aslak

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




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



Re: Record locking

2007-02-19 Thread James Carman

Just use the session id and set up an HttpSessionListener to remove
user's locks when their session expires.


On 2/19/07, Luis Rodrigo Gallardo Cruz <[EMAIL PROTECTED]> wrote:

On Mon, Feb 19, 2007 at 08:17:02PM -0500, James Carman wrote:
> I would say just put a property on the object that says that it has
> been "checked out" or something.  That way, you can tell a user that
> tries to edit it that they can't because "so and so has this record
> checked out and is editing it."

One has to be careful with this approach, because the checkout must,
somehow, expire, otherwise you risk leaving an object permanently
uneditable if a client gets disconected/forgotten/whatever.

Just throwing random ideas about: How about making the 'checked-out'
property a weak hash, pointing to the editing user's session (or some
attribute within)? I assume the J2EE container will GC expired sessions,
thus automatically expiring the object's check-out.

--
Rodrigo Gallardo
GPG-Fingerprint: 7C81 E60C 442E 8FBC D975  2F49 0199 8318 ADC9 BC28
Zenophobia: the irrational fear of convergent sequences.

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFF2k6xAZmDGK3JvCgRAnMJAJ9TFHFOmAlciwoY2kQO+rYdMBcvxgCffRk0
tl1+WX/ZP82yNXrwuELwhcA=
=x6eX
-END PGP SIGNATURE-




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



Re: Record locking

2007-02-19 Thread James Carman

I would say just put a property on the object that says that it has
been "checked out" or something.  That way, you can tell a user that
tries to edit it that they can't because "so and so has this record
checked out and is editing it."


On 2/19/07, Kalle Korhonen <[EMAIL PROTECTED]> wrote:

Just out of curiosity, can you tell more about your use case? I just have a
hard time believing you'd need something like this for all of your tables -
rather I'd assume it's something specific to a type of a record. And if it's
the latter, I'd just implement it in the application level along the lines
you'd suggested. But I'm not sure I'd call it locking, which I understand as
a database feature for enforcing atomic transactions. It'd be fairly easy to
implement the checking and enforcing of your edit rule in a Hibernate
Interceptor. For obtaining the application level "lock" you can use
optimistic locking; this is sort of the same as doing svn lock.

Kalle

On 2/19/07, Murray Collingwood <[EMAIL PROTECTED]> wrote:
>
> James Carman  carmanconsulting.com> writes:
> > You can use optimistic locking.  When the user submits and they have
> > outdated data, then you just merge the object's data with what is in
> > the data store and show it back to the user for them to confirm it.
>
> In an application where the user can spend 20 minutes completing the
> information
> in a row, they are not going to be happy when they find out somebody else
> has
> been updating this same row and the information has all been merged.  They
> then
> spend another 10 minutes cleaning up all of the duplicated changes.
>
> Even pessimistic locking is not sufficient.
>
> I need guaranteed write-exclusive locking for the duration of the request.
> ie
> when I read-for-update the record should be locked against all other
> read-for-update requests until I save my changes and release the lock.
>
> It sounds as though I'm going to have to write my own...again.
>
> Cheers
> mc
>
>
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



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



Re: T5: Spring Integration

2007-02-19 Thread James Carman

I think what is needed, though, is something that allows you to bind
spring beans directly into your page/components.  Having to lookup
spring beans all the time can be a pain.


On 2/19/07, D&J Gredler <[EMAIL PROTECTED]> wrote:

Good catch :-)

You also have to add the following line to your web.xml:


org.springframework.web.context.ContextLoaderListener



On 2/19/07, James Carman <[EMAIL PROTECTED]> wrote:
>
> Of course, you have to set up the ContextLoaderListener, right?
>
>
> On 2/19/07, D&J Gredler <[EMAIL PROTECTED]> wrote:
> > You can just inject the following into your pages:
> >
> > @Inject
> > private ApplicationGlobals globals;
> >
> > And then use the servlet context inside the globals object to get the
> > application context via
> >
> > WebApplicationContextUtils.getRequiredWebApplicationContext
> > (servletContext);
> >
> > Once you have the application context, you just call getBean(String) to
> get
> > your managed beans.
> >
> >
> >
> > On 2/19/07, SergeEby <[EMAIL PROTECTED]> wrote:
> > >
> > >
> > > Hi,
> > >
> > > I know Spring integration will be included later in T5, but was
> wondering
> > > if
> > > someone has already figured out how to do that.
> > > I am playing around converting an existing application to T5.
> > >
> > > Thanks,
> > >
> > > /Serge
> > > --
> > > View this message in context:
> > > http://www.nabble.com/T5%3A-Spring-Integration-tf3253045.html#a9042869
> > > Sent from the Tapestry - User mailing list archive at Nabble.com.
> > >
> > >
> > > -
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



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



Re: T5: Spring Integration

2007-02-19 Thread James Carman

Of course, you have to set up the ContextLoaderListener, right?


On 2/19/07, D&J Gredler <[EMAIL PROTECTED]> wrote:

You can just inject the following into your pages:

@Inject
private ApplicationGlobals globals;

And then use the servlet context inside the globals object to get the
application context via

WebApplicationContextUtils.getRequiredWebApplicationContext
(servletContext);

Once you have the application context, you just call getBean(String) to get
your managed beans.



On 2/19/07, SergeEby <[EMAIL PROTECTED]> wrote:
>
>
> Hi,
>
> I know Spring integration will be included later in T5, but was wondering
> if
> someone has already figured out how to do that.
> I am playing around converting an existing application to T5.
>
> Thanks,
>
> /Serge
> --
> View this message in context:
> http://www.nabble.com/T5%3A-Spring-Integration-tf3253045.html#a9042869
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



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



Re: Tapestry Bamboo Site

2007-02-19 Thread James Carman

We're actually thinking of using Bamboo at work, so if you find that
this is a big issue, could you let the list (or me directly) know?  Is
it just a matter of starting the JVM with more heap memory?

On 2/19/07, Howard Lewis Ship <[EMAIL PROTECTED]> wrote:

Yep, we're still working on that.

On 2/19/07, Jiri Mares <[EMAIL PROTECTED]> wrote:
>
> Hi Howard,
>
> that's great, but if you try to view tests for Tapestry4 you get OutOfMemory 
exception :-(
>
> Howard Lewis Ship napsal(a):
> >
> > Thanks to the great folks at Formos, Tapestry now has continuous
> > integration.
> >
> > Surf on over to http://tapestry.formos.com/bamboo/ to see the current
> > status of the T5 builds.  I expect we'll be adding in the T4 builds as
> > well.
> >
> > This is a great way to see the progress of Tapestry over time and
> > track the changes that have been occuring.
> >
>
> --
> Jiří Mareš (mailto:[EMAIL PROTECTED])
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
Howard M. Lewis Ship
TWD Consulting, Inc.
Independent J2EE / Open-Source Java Consultant
Creator and PMC Chair, Apache Tapestry
Creator, Apache HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com




Re: Record locking

2007-02-19 Thread James Carman

You can use optimistic locking.  When the user submits and they have
outdated data, then you just merge the object's data with what is in
the data store and show it back to the user for them to confirm it.

On 2/19/07, Murray Collingwood <[EMAIL PROTECTED]> wrote:

Hi

Jesse Kuhnert  gmail.com> writes:
> hibernate.org

This is a rather simplistic answer, however I have been away and read the
documentation and am not convinced that this is providing a method that will
warn a user if somebody else if already updating a record.

Even this example of pessimistic locking appears to allow for previous data
changes to be overwritten:
http://forum.springframework.org/archive/index.php/t-10188.html

What would convince me?

An example of a read-for-update operation that returned a condition (or
exception) indicating that the requested object was currently locked by another
user.  I'm yet to find that in Hibernate.

Cheers
mc



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




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



Re: Problems with Tapestry 5 and JBoss

2007-02-18 Thread James Carman

Is Javassist a part of the "shared" classpath in JBoss 4.x?

On 2/18/07, Geoff Callender <[EMAIL PROTECTED]> wrote:

I've hit the same problem had the same problem with Tapestry 5 in
JBoss 4.0.5.  When I put the
Tapestry jars in the deployed file I get the stack trace below.  It
shows that tapestry ioc is loaded up but
for some reason the class loader can't find org/apache/tapestry/
services/ApplicationGlobals.

I had tapestry-ioc.jar and tapestry-core.jar in an exploded WAR's WEB-
INF/lib/, inside an exploded EAR
file.

13:34:00,549 INFO  [TomcatDeployer] deploy, ctxPath=/jumpstart5-min,
warUrl=file:/blah/blah/
jumpstart5-min/exploded/jumpstart5-min.ear/jumpstart5-min.war/
13:34:01,509 ERROR [[/jumpstart5-min]] Exception starting filter app
java.lang.RuntimeException: Error invoking service builder method
org.apache.tapestry.services.TapestryModule.buildInfrastructure(Log,
Collection) (for service
'tapestry.Infrastructure'): Error invoking service contribution method
org.apache.tapestry.services.TapestryModule.contributeInfrastructure
(Configuration, ServiceLocator,
TypeCoercer, PropertyAccess): Error building service proxy for
service 'tapestry.ApplicationGlobals' (at
org.apache.tapestry.services.TapestryModule.buildApplicationGlobals
()): Unable to create class
$ApplicationGlobals_110d2b2dad0: by java.lang.NoClassDefFoundError:
org/apache/tapestry/services/
ApplicationGlobals
 at
org.apache.tapestry.ioc.internal.ServiceBuilderMethodInvoker.createObjec
t
(ServiceBuilderMethodInvoker.java:263)
 at
org.apache.tapestry.ioc.internal.SingletonServiceLifecycle.createService
(SingletonServiceLifecycle.java:31)
 at
org.apache.tapestry.ioc.internal.LifecycleWrappedServiceCreator.createOb
ject
(LifecycleWrappedServiceCreator.java:50)
 at
org.apache.tapestry.ioc.internal.InterceptorStackBuilder.createObject
(InterceptorStackBuilder.java:55)
 at
org.apache.tapestry.ioc.internal.OneShotServiceCreator.createObject
(OneShotServiceCreator.java:56)
 at $Infrastructure_110d2b2dacd._delegate
($Infrastructure_110d2b2dacd.java)
 at $Infrastructure_110d2b2dacd.setMode
($Infrastructure_110d2b2dacd.java)
 at
org.apache.tapestry.internal.TapestryAppInitializer.setupServices
(TapestryAppInitializer.java:
118)
 at org.apache.tapestry.internal.TapestryAppInitializer.
(TapestryAppInitializer.java:69)
 at org.apache.tapestry.internal.TapestryAppInitializer.
(TapestryAppInitializer.java:56)
 at org.apache.tapestry.TapestryFilter.init
(TapestryFilter.java:70)
 at org.apache.catalina.core.ApplicationFilterConfig.getFilter
(ApplicationFilterConfig.java:223)
 at
org.apache.catalina.core.ApplicationFilterConfig.setFilterDef
(ApplicationFilterConfig.java:304)
 at org.apache.catalina.core.ApplicationFilterConfig.
(ApplicationFilterConfig.java:77)
 at org.apache.catalina.core.StandardContext.filterStart
(StandardContext.java:3634)
 at org.apache.catalina.core.StandardContext.start
(StandardContext.java:4217)
 at org.apache.catalina.core.ContainerBase.addChildInternal
(ContainerBase.java:759)
 at org.apache.catalina.core.ContainerBase.addChild
(ContainerBase.java:739)
 at org.apache.catalina.core.StandardHost.addChild
(StandardHost.java:524)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:585)
 at org.apache.commons.modeler.BaseModelMBean.invoke
(BaseModelMBean.java:503)
 at org.jboss.mx.server.RawDynamicInvoker.invoke
(RawDynamicInvoker.java:164)
 at org.jboss.mx.server.MBeanServerImpl.invoke
(MBeanServerImpl.java:659)
 at org.apache.catalina.core.StandardContext.init
(StandardContext.java:5052)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:585)
 at org.apache.commons.modeler.BaseModelMBean.invoke
(BaseModelMBean.java:503)
 at org.jboss.mx.server.RawDynamicInvoker.invoke
(RawDynamicInvoker.java:164)
 at org.jboss.mx.server.MBeanServerImpl.invoke
(MBeanServerImpl.java:659)
 at
org.jboss.web.tomcat.tc5.TomcatDeployer.performDeployInternal
(TomcatDeployer.java:297)
 at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeploy
(TomcatDeployer.java:103)
 at org.jboss.web.AbstractWebDeployer.start
(AbstractWebDeployer.java:371)
 at org.jboss.web.WebModule.startModule(WebModule.java:83)
 at org.jboss.web.WebModule.startService(WebModule.java:61)
 at org.jboss.system.Ser

Re: My crap development environment

2007-02-15 Thread James Carman

The current jetty plugin uses jetty6.

On 2/15/07, Joe Trewin <[EMAIL PROTECTED]> wrote:

If you want to use the JettyLauncher plugin for Eclipse - I think it
only works with Jetty 5, not Jetty 6.

If you want to use Jetty 6 then you can't use the plugin, but you can
launch from Eclipse easily enough just by making your own little
launcher class - for example:

import org.mortbay.jetty.Connector;
import org.mortbay.jetty.Handler;
import org.mortbay.jetty.Server;
import org.mortbay.jetty.handler.ContextHandlerCollection;
import org.mortbay.jetty.handler.DefaultHandler;
import org.mortbay.jetty.handler.HandlerCollection;
import org.mortbay.jetty.nio.SelectChannelConnector;
import org.mortbay.jetty.webapp.WebAppContext;

public class JettyLauncher {

public static void main(String[] args) throws Exception {
String path = (args.length > 0 ? args[0] : "web");
Server server = new Server();

Connector connector = new SelectChannelConnector();
connector.setPort(8080);
server.setConnectors(new Connector[] { connector });

HandlerCollection handlers = new HandlerCollection();
ContextHandlerCollection contexts = new
ContextHandlerCollection();
handlers.setHandlers(new Handler[] { contexts, new
DefaultHandler() });
server.setHandler(handlers);

new WebAppContext(contexts, path, "/");

server.setStopAtShutdown(true);
server.setSendServerVersion(true);

server.start();
server.join();
}
}


> -Original Message-
> From: Daniel Honig [mailto:[EMAIL PROTECTED]
> Sent: 15 February 2007 14:33
> To: Tapestry users
> Subject: Re: My crap development environment
>
> Murray,
>   I really enjoyed using Jetty with the Eclipse startup
> plugin on a project I did a while back.  I would highly
> reccomend abandoing tomcat for development and using Jetty
> during your development.  If you have dependencies to tomcat
> functionality you might want to mock it out
> during dev., it will definetly save you time.Get the Jetty plugin
> and I think you'll have alot of your issues resolved.
>
> best,
>  -dh
>
>
> On 2/14/07, Murray Collingwood <[EMAIL PROTECTED]> wrote:
> Hi all
> >
> > I have suffered long and hard under Eclipse and Tomcat.  Is
> it really
> > necessary for me to wait so long while a file is saved or
> an application is published???
> >
> > Saving a .java file: 15 seconds
> > Saving a .html file: 15 seconds
> > Saving a .jwc file: 28 seconds
> >
> > Stopping the tomcat server: 2 seconds (acceptable)
> Publishing to the
> > tomcat server: 45 seconds Starting the tomcat server: 54
> seconds (it
> > insists on publishing first)
> >
> > Does everybody else experience these delays or is it just me?
> >
> > It was suggested that I use maven2 - however I looked through the
> > maven2 flash presentation and it didn't mention anything
> about making
> > my development work in Eclipse faster - it was more focused
> on pulling
> > dependencies and easing the build process.  And if I were
> to install
> > maven2 would it change any of the above anyway???
> >
> > Cheers
> > mc
> >
> >
> >
> -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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





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



Re: My crap development environment

2007-02-14 Thread James Carman

You could run mvn jetty:run to fire up your application in Jetty.  It
works pretty well and it automatically picks up any changes you make
and redeploys your webapp.


On 2/14/07, Murray Collingwood <[EMAIL PROTECTED]> wrote:

Hi all

I have suffered long and hard under Eclipse and Tomcat.  Is it really necessary
for me to wait so long while a file is saved or an application is published???

Saving a .java file: 15 seconds
Saving a .html file: 15 seconds
Saving a .jwc file: 28 seconds

Stopping the tomcat server: 2 seconds (acceptable)
Publishing to the tomcat server: 45 seconds
Starting the tomcat server: 54 seconds (it insists on publishing first)

Does everybody else experience these delays or is it just me?

It was suggested that I use maven2 - however I looked through the maven2
flash presentation and it didn't mention anything about making my development
work in Eclipse faster - it was more focused on pulling dependencies and
easing the build process.  And if I were to install maven2 would it change any
of the above anyway???

Cheers
mc


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




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



Re: Tapestry 4.1 startup errors

2007-02-14 Thread James Carman

Check out:

http://maven.apache.org/

That's how Tapestry is built and a lot of projects are starting to go
that route (including most all of Apache).


On 2/14/07, Murray Collingwood <[EMAIL PROTECTED]> wrote:

James Carman  carmanconsulting.com> writes:
> Have you tried maven2?  It, along with its Jetty launcher for testing,
> might help your situation.  As for the error you're getting, are you
> using tapestry-spring?

Thanks James

Adding the tapestry-spring.jar file to the other jars solved the problem.  I
kind of assumed anything with Tapestry in the name would be downloaded in a new
version.

Next problem:

My first page now appears but I get these error messages appearing at the end:

FATAL exception raised: Could not load 'dojo.logging.Logger';
  last tried '__package__.js'
FATAL exception raised: Could not load 'dojo.logging.Logger';
  last tried '__package__.js'
FATAL exception raised: Could not load 'dojo.html.selection';
  last tried '__package__.js'

Cheers
Murray

PS What's maven2?  And if I install it what can I uninstall - or what does it
replace?





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




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



Re: Tapestry 4.1 startup errors

2007-02-14 Thread James Carman

Have you tried maven2?  It, along with its Jetty launcher for testing,
might help your situation.  As for the error you're getting, are you
using tapestry-spring?


On 2/14/07, Murray Collingwood <[EMAIL PROTECTED]> wrote:

Hi all

I'm getting this error:
 Error: An error occured processing annotation
@org.apache.tapestry.annotations.InjectObject(value=spring:userService) of
public abstract com.cabs.services.UserService
com.cabs.pages.Home.getUserService(): Property 'beanFactory' of
 is null.

I'm getting really frustrated with Eclipse.  I started by adding a user
library called Tapestry411 and placing all of the JARs in this user library.
Eclipse would say that it was publishing the application but the user library
was never copied over.

So, I moved all of the jars to the WEB-INF/lib folder in my development area,
however Eclipse doesn't recognise the WEB-INF/lib folder as a library of jars
and so it reports all of these errors that it can't find classes.  So I left all
of the jars in the WEB-INF/lib folder in my dev area and created a user library
that located the jars in the WEB-INF/lib folder (I feel like I'm jumping through
hoops because Eclipse isn't working like it should).  Finally I publish the
application and everything gets copied except for the jars.  I start tearing my
hair out at this point.

In utter frustration I then manually copy all of the jars into the WEB-INF/lib
folder of the server.

The server now starts up without any obvious errors.  When I try to use the
application the above error occurs (before the first screen is displayed).

Cheers
mc



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




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



Re: Migration to Tap4, accessing the hivemind registry without injection

2007-02-12 Thread James Carman

That's one thing that I don't understand about the Spring community.
They are very skeptical to use autowiring.  They suggest specifically
wiring up your beans (at least the experts I've heard suggest that).
Anyway, for the applications that I write, there is usually only one
service that implements a given business interface (like a DAO or
something), so it's no big deal.

On 2/11/07, Jesse Kuhnert <[EMAIL PROTECTED]> wrote:

Yeah it's a real blessing. Most of the time all I have to do is
quickly try to remember in my head if it's possible that there will be
more than one implementation of a service I want to inject..95% of the
time there isn't so no thought / looking up of service id's are
required...

Great work James, and thank you! ;)

On 2/11/07, James Carman <[EMAIL PROTECTED]> wrote:
> No problem.  I think the property "injector" code works by enhancing
> (extending) your page/component classes and implementing the
> getter/setter methods.  But, it should complain that your
> getters/setters aren't abstract, I would think (it does in other
> cases).
>
> The thing I like most about the tapestry-autowire stuff is that all
> you have to do is drop the jar file into your WEB-INF/lib director and
> it just works!  No configuration necessary.
>
>
> On 2/11/07, Numa Schmeder <[EMAIL PROTECTED]> wrote:
> > The autowire stuff is downloaded! Really great !
> > Thanks a lot
> >
> > Muma
> >
> > Le 10 févr. 07 à 21:11, James Carman a écrit :
> >
> > > Have you tried tapestry-autowire
> > > (http://svn.javaforge.com/svn/tapestry/tapestry-autowire/trunk)?  You
> > > can check out the source code (anonymous/anon login) and build it
> > > yourself since there hasn't been an official release.  Or, just
> > > upgrade to 4.1 and it'll automatically inject HiveMind services into
> > > your components/pages (because it has tapestry-autowire "baked in").
> > >
> > > On 2/9/07, Ben Dotte <[EMAIL PROTECTED]> wrote:
> > >> That's true, but then again I don't think Howard intended for the
> > >> Registry to be publicly accessible in the first place:
> > >>
> > >> http://article.gmane.org/gmane.comp.java.tapestry.user/20207/
> > >>
> > >> The "proper" way is to use injection on .page and .jwc files or
> > >> annotations, but this is obviously complicated in your situation
> > >> since you can't use annotations and (understandably) don't want to
> > >> have to inject the same service on to every single page. On the
> > >> other hand there are some alternatives to getting Tapestry
> > >> services other than using the Registry directly:
> > >>
> > >> http://article.gmane.org/gmane.comp.java.tapestry.user/21861/
> > >>
> > >> HTH
> > >>
> > >> Ben
> > >>
> > >> -Original Message-
> > >> From: Numa Schmeder [mailto:[EMAIL PROTECTED]
> > >> Sent: Friday, February 09, 2007 1:54 PM
> > >> To: Tapestry users
> > >> Subject: Re: Migration to Tap4, accessing the hivemind registry
> > >> without injection
> > >>
> > >> Thanks Ben,
> > >>
> > >> I am going to try, I find it a bit of hack.  And I find strange that
> > >> there is no access to the registry.
> > >>
> > >> Thanks
> > >>
> > >> Numa
> > >> Le 9 févr. 07 à 20:24, Ben Dotte a écrit :
> > >>
> > >> > I'm not sure if there is a more straightforward way, but one way is
> > >> > to store the servlet into the request and then pull out the
> > >> > ServletContext from that.
> > >> >
> > >> > So make a subclass of org.apache.tapestry.ApplicationServlet:
> > >> > public class MyApplicationServlet extends ApplicationServlet
> > >> > {
> > >> >   protected void doService(HttpServletRequest request,
> > >> > HttpServletResponse response) throws IOException, ServletException
> > >> >   {
> > >> >   request.setAttribute("servlet", this);
> > >> >   super.doService(request, response);
> > >> >   }
> > >> > }
> > >> >
> > >> > Set it up in web.xml:
> > >> > 
> > >> >   app
> > >> >   path.to.MyApplicationServlet
> > >> >   1
&g

Re: Migration to Tap4, accessing the hivemind registry without injection

2007-02-11 Thread James Carman

No problem.  I think the property "injector" code works by enhancing
(extending) your page/component classes and implementing the
getter/setter methods.  But, it should complain that your
getters/setters aren't abstract, I would think (it does in other
cases).

The thing I like most about the tapestry-autowire stuff is that all
you have to do is drop the jar file into your WEB-INF/lib director and
it just works!  No configuration necessary.


On 2/11/07, Numa Schmeder <[EMAIL PROTECTED]> wrote:

The autowire stuff is downloaded! Really great !
Thanks a lot

Muma

Le 10 févr. 07 à 21:11, James Carman a écrit :

> Have you tried tapestry-autowire
> (http://svn.javaforge.com/svn/tapestry/tapestry-autowire/trunk)?  You
> can check out the source code (anonymous/anon login) and build it
> yourself since there hasn't been an official release.  Or, just
> upgrade to 4.1 and it'll automatically inject HiveMind services into
> your components/pages (because it has tapestry-autowire "baked in").
>
> On 2/9/07, Ben Dotte <[EMAIL PROTECTED]> wrote:
>> That's true, but then again I don't think Howard intended for the
>> Registry to be publicly accessible in the first place:
>>
>> http://article.gmane.org/gmane.comp.java.tapestry.user/20207/
>>
>> The "proper" way is to use injection on .page and .jwc files or
>> annotations, but this is obviously complicated in your situation
>> since you can't use annotations and (understandably) don't want to
>> have to inject the same service on to every single page. On the
>> other hand there are some alternatives to getting Tapestry
>> services other than using the Registry directly:
>>
>> http://article.gmane.org/gmane.comp.java.tapestry.user/21861/
>>
>> HTH
>>
>> Ben
>>
>> -Original Message-
>> From: Numa Schmeder [mailto:[EMAIL PROTECTED]
>> Sent: Friday, February 09, 2007 1:54 PM
>> To: Tapestry users
>> Subject: Re: Migration to Tap4, accessing the hivemind registry
>> without injection
>>
>> Thanks Ben,
>>
>> I am going to try, I find it a bit of hack.  And I find strange that
>> there is no access to the registry.
>>
>> Thanks
>>
>> Numa
>> Le 9 févr. 07 à 20:24, Ben Dotte a écrit :
>>
>> > I'm not sure if there is a more straightforward way, but one way is
>> > to store the servlet into the request and then pull out the
>> > ServletContext from that.
>> >
>> > So make a subclass of org.apache.tapestry.ApplicationServlet:
>> > public class MyApplicationServlet extends ApplicationServlet
>> > {
>> >   protected void doService(HttpServletRequest request,
>> > HttpServletResponse response) throws IOException, ServletException
>> >   {
>> >   request.setAttribute("servlet", this);
>> >   super.doService(request, response);
>> >   }
>> > }
>> >
>> > Set it up in web.xml:
>> > 
>> >   app
>> >   path.to.MyApplicationServlet
>> >   1
>> > 
>> >
>> > Then pull out the registry in your base page:
>> > public Registry getRegistry()
>> > {
>> >   return (Registry) ((MyApplicationServlet) getRequestCycle
>> > ().getInfrastructure().getRequest().getAttribute
>> > ("servlet")).getServletContext().getAttribute
>> > ("org.apache.tapestry.Registry:app");
>> > }
>> >
>> > Ben
>> >
>> > -Original Message-
>> > From: Numa Schmeder [mailto:[EMAIL PROTECTED]
>> > Sent: Friday, February 09, 2007 1:08 PM
>> > To: Tapestry users
>> > Subject: Re: Migration to Tap4, accessing the hivemind registry
>> > without injection
>> >
>> > I knew that, but I don't know how to access a context from a
>> Page or
>> > from the request cycle.
>> > How can you get the servlet context?
>> >
>> > Thanks,
>> >
>> > Numa
>> > Le 9 févr. 07 à 19:49, Shing Hing Man a écrit :
>> >
>> >> A singleton has the advantage of letting you access
>> >> the registry in non-web pages.
>> >> In case you did not know,
>> >> the registry is created in the  ApplicationServlet and
>> >> stored as a context parameter.
>> >>
>> >> // context is the servlet context
>> >> Registry registry = (Registry) context
>> >>
>> >> .getAttribute(ApplicationServ

Re: Migration to Tap4, accessing the hivemind registry without injection

2007-02-11 Thread James Carman

The tapestry-autowire will look for abstract "getters" and it will
implement them for you if it can (by finding exactly one hivemind
service which matches the type).  In your case, it seems like you've
got quite a bit of work on your hands.  I'd consider putting the
abstract getter in your base page class (most people have a base
page/component class that they extend).  Then, look for all
implementations of that method and remove them.

On 2/11/07, Numa Schmeder <[EMAIL PROTECTED]> wrote:

Hello

Thanks for your answer,
But tap4.1 seems to need java 1.5 and I am restricted to java 1.4.
So any library dependant of java 1.5 can't be used.
If the service point is in module "com.mymodule" and is called
daoFactory , and if I have an abstract method getDAOFactory, it will
be autowired without any annotation or anything?  If true that would
be amazing!

Also I have faced a new problem:
I have migrated .page and .jwc to tapestry 4 DTD (using XSLT), using
the  has changed
quite a lot.  In tap 3 I used that instead of initialize() to handle
transient properties and correct initialization.
In my code I have two methods NON ABSTRACT getMyProperty and
setMyProperty and a private variable myProperty.  Those methods seems
to never be accessed?
It seems that the property binding overrides my methods definitions!!!?
Do you know how to avoid this, because initialize() method in the
page seems to be deprecated, and i don't want abstract methods.
Do I have to go through all my pages to find properties that are
defined in the .page and which are not abstract ?
What can I do ?

Thanks A lot

Numa


Le 10 févr. 07 à 21:13, James Carman a écrit :

> By the way, there has to be exactly one service point which is of the
> type that you need injected in order for it to be autowired, but
> that's traditionally the case when it comes to DAOs.
>
>
> On 2/10/07, James Carman <[EMAIL PROTECTED]> wrote:
>> Have you tried tapestry-autowire
>> (http://svn.javaforge.com/svn/tapestry/tapestry-autowire/trunk)?  You
>> can check out the source code (anonymous/anon login) and build it
>> yourself since there hasn't been an official release.  Or, just
>> upgrade to 4.1 and it'll automatically inject HiveMind services into
>> your components/pages (because it has tapestry-autowire "baked in").
>>
>> On 2/9/07, Ben Dotte <[EMAIL PROTECTED]> wrote:
>> > That's true, but then again I don't think Howard intended for
>> the Registry to be publicly accessible in the first place:
>> >
>> > http://article.gmane.org/gmane.comp.java.tapestry.user/20207/
>> >
>> > The "proper" way is to use injection on .page and .jwc files or
>> annotations, but this is obviously complicated in your situation
>> since you can't use annotations and (understandably) don't want to
>> have to inject the same service on to every single page. On the
>> other hand there are some alternatives to getting Tapestry
>> services other than using the Registry directly:
>> >
>> > http://article.gmane.org/gmane.comp.java.tapestry.user/21861/
>> >
>> > HTH
>> >
>> > Ben
>> >
>> > -Original Message-
>> > From: Numa Schmeder [mailto:[EMAIL PROTECTED]
>> > Sent: Friday, February 09, 2007 1:54 PM
>> > To: Tapestry users
>> > Subject: Re: Migration to Tap4, accessing the hivemind registry
>> without injection
>> >
>> > Thanks Ben,
>> >
>> > I am going to try, I find it a bit of hack.  And I find strange
>> that
>> > there is no access to the registry.
>> >
>> > Thanks
>> >
>> > Numa
>> > Le 9 févr. 07 à 20:24, Ben Dotte a écrit :
>> >
>> > > I'm not sure if there is a more straightforward way, but one
>> way is
>> > > to store the servlet into the request and then pull out the
>> > > ServletContext from that.
>> > >
>> > > So make a subclass of org.apache.tapestry.ApplicationServlet:
>> > > public class MyApplicationServlet extends ApplicationServlet
>> > > {
>> > >   protected void doService(HttpServletRequest request,
>> > > HttpServletResponse response) throws IOException,
>> ServletException
>> > >   {
>> > >   request.setAttribute("servlet", this);
>> > >   super.doService(request, response);
>> > >   }
>> > > }
>> > >
>> > > Set it up in web.xml:
>> > > 
>> > >   app
>> > >   path.to.MyApplicationServlet
>> &g

Re: Custom annotation

2007-02-11 Thread James Carman

What version of Tapestry?  If you're on 4.x, you can look at what I
did in tapestry-acegi, which looks for the @Secured annotation on
methods/classes.

http://svn.javaforge.com/svn/tapestry/tapestry-acegi/trunk

The login is anonymous/anon


On 2/11/07, VitalyA <[EMAIL PROTECTED]> wrote:


Hi all,
I want to add some custom method annotation.
In runtime i want to intercept page method calls and check if this method
has my custom annotation.
How can i do it? Can i implement for this Tapestry filter?
Thanks in advance, Vitaly
--
View this message in context: 
http://www.nabble.com/Custom-annotation-tf3208469.html#a8909774
Sent from the Tapestry - User mailing list archive at Nabble.com.


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




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



Re: Migration to Tap4, accessing the hivemind registry without injection

2007-02-10 Thread James Carman

By the way, there has to be exactly one service point which is of the
type that you need injected in order for it to be autowired, but
that's traditionally the case when it comes to DAOs.


On 2/10/07, James Carman <[EMAIL PROTECTED]> wrote:

Have you tried tapestry-autowire
(http://svn.javaforge.com/svn/tapestry/tapestry-autowire/trunk)?  You
can check out the source code (anonymous/anon login) and build it
yourself since there hasn't been an official release.  Or, just
upgrade to 4.1 and it'll automatically inject HiveMind services into
your components/pages (because it has tapestry-autowire "baked in").

On 2/9/07, Ben Dotte <[EMAIL PROTECTED]> wrote:
> That's true, but then again I don't think Howard intended for the Registry to 
be publicly accessible in the first place:
>
> http://article.gmane.org/gmane.comp.java.tapestry.user/20207/
>
> The "proper" way is to use injection on .page and .jwc files or annotations, 
but this is obviously complicated in your situation since you can't use annotations and 
(understandably) don't want to have to inject the same service on to every single page. On 
the other hand there are some alternatives to getting Tapestry services other than using the 
Registry directly:
>
> http://article.gmane.org/gmane.comp.java.tapestry.user/21861/
>
> HTH
>
> Ben
>
> -Original Message-
> From: Numa Schmeder [mailto:[EMAIL PROTECTED]
> Sent: Friday, February 09, 2007 1:54 PM
> To: Tapestry users
> Subject: Re: Migration to Tap4, accessing the hivemind registry without 
injection
>
> Thanks Ben,
>
> I am going to try, I find it a bit of hack.  And I find strange that
> there is no access to the registry.
>
> Thanks
>
> Numa
> Le 9 févr. 07 à 20:24, Ben Dotte a écrit :
>
> > I'm not sure if there is a more straightforward way, but one way is
> > to store the servlet into the request and then pull out the
> > ServletContext from that.
> >
> > So make a subclass of org.apache.tapestry.ApplicationServlet:
> > public class MyApplicationServlet extends ApplicationServlet
> > {
> >   protected void doService(HttpServletRequest request,
> > HttpServletResponse response) throws IOException, ServletException
> >   {
> >   request.setAttribute("servlet", this);
> >   super.doService(request, response);
> >   }
> > }
> >
> > Set it up in web.xml:
> > 
> >   app
> >   path.to.MyApplicationServlet
> >   1
> > 
> >
> > Then pull out the registry in your base page:
> > public Registry getRegistry()
> > {
> >   return (Registry) ((MyApplicationServlet) getRequestCycle
> > ().getInfrastructure().getRequest().getAttribute
> > ("servlet")).getServletContext().getAttribute
> > ("org.apache.tapestry.Registry:app");
> > }
> >
> > Ben
> >
> > -Original Message-
> > From: Numa Schmeder [mailto:[EMAIL PROTECTED]
> > Sent: Friday, February 09, 2007 1:08 PM
> > To: Tapestry users
> > Subject: Re: Migration to Tap4, accessing the hivemind registry
> > without injection
> >
> > I knew that, but I don't know how to access a context from a Page or
> > from the request cycle.
> > How can you get the servlet context?
> >
> > Thanks,
> >
> > Numa
> > Le 9 févr. 07 à 19:49, Shing Hing Man a écrit :
> >
> >> A singleton has the advantage of letting you access
> >> the registry in non-web pages.
> >> In case you did not know,
> >> the registry is created in the  ApplicationServlet and
> >> stored as a context parameter.
> >>
> >> // context is the servlet context
> >> Registry registry = (Registry) context
> >>
> >> .getAttribute(ApplicationServlet.REGISTRY_KEY_PREFIX_PUBLIC
> >> +
> >> "(the name of ApplicationServlet given in web.xml");
> >>
> >>
> >> Shing
> >>
> >>
> >> --- Numa Schmeder <[EMAIL PROTECTED]> wrote:
> >>
> >>> Nop, but isn't an easier way to just access the
> >>> registry?
> >>>
> >>> Le 9 févr. 07 à 19:33, Shing Hing Man a écrit :
> >>>
> >>>> Have you considered implementing the HiveMind
> >>> registry
> >>>> as a singleton ?
> >>>>
> >>>> The zebra-hivemind subproject in Zebra does
> >>> exactly
> >>>> that.
> >>>> http://zebra.berlios.de/
> &

Re: Migration to Tap4, accessing the hivemind registry without injection

2007-02-10 Thread James Carman

Have you tried tapestry-autowire
(http://svn.javaforge.com/svn/tapestry/tapestry-autowire/trunk)?  You
can check out the source code (anonymous/anon login) and build it
yourself since there hasn't been an official release.  Or, just
upgrade to 4.1 and it'll automatically inject HiveMind services into
your components/pages (because it has tapestry-autowire "baked in").

On 2/9/07, Ben Dotte <[EMAIL PROTECTED]> wrote:

That's true, but then again I don't think Howard intended for the Registry to 
be publicly accessible in the first place:

http://article.gmane.org/gmane.comp.java.tapestry.user/20207/

The "proper" way is to use injection on .page and .jwc files or annotations, 
but this is obviously complicated in your situation since you can't use annotations and 
(understandably) don't want to have to inject the same service on to every single page. 
On the other hand there are some alternatives to getting Tapestry services other than 
using the Registry directly:

http://article.gmane.org/gmane.comp.java.tapestry.user/21861/

HTH

Ben

-Original Message-
From: Numa Schmeder [mailto:[EMAIL PROTECTED]
Sent: Friday, February 09, 2007 1:54 PM
To: Tapestry users
Subject: Re: Migration to Tap4, accessing the hivemind registry without 
injection

Thanks Ben,

I am going to try, I find it a bit of hack.  And I find strange that
there is no access to the registry.

Thanks

Numa
Le 9 févr. 07 à 20:24, Ben Dotte a écrit :

> I'm not sure if there is a more straightforward way, but one way is
> to store the servlet into the request and then pull out the
> ServletContext from that.
>
> So make a subclass of org.apache.tapestry.ApplicationServlet:
> public class MyApplicationServlet extends ApplicationServlet
> {
>   protected void doService(HttpServletRequest request,
> HttpServletResponse response) throws IOException, ServletException
>   {
>   request.setAttribute("servlet", this);
>   super.doService(request, response);
>   }
> }
>
> Set it up in web.xml:
> 
>   app
>   path.to.MyApplicationServlet
>   1
> 
>
> Then pull out the registry in your base page:
> public Registry getRegistry()
> {
>   return (Registry) ((MyApplicationServlet) getRequestCycle
> ().getInfrastructure().getRequest().getAttribute
> ("servlet")).getServletContext().getAttribute
> ("org.apache.tapestry.Registry:app");
> }
>
> Ben
>
> -Original Message-
> From: Numa Schmeder [mailto:[EMAIL PROTECTED]
> Sent: Friday, February 09, 2007 1:08 PM
> To: Tapestry users
> Subject: Re: Migration to Tap4, accessing the hivemind registry
> without injection
>
> I knew that, but I don't know how to access a context from a Page or
> from the request cycle.
> How can you get the servlet context?
>
> Thanks,
>
> Numa
> Le 9 févr. 07 à 19:49, Shing Hing Man a écrit :
>
>> A singleton has the advantage of letting you access
>> the registry in non-web pages.
>> In case you did not know,
>> the registry is created in the  ApplicationServlet and
>> stored as a context parameter.
>>
>> // context is the servlet context
>> Registry registry = (Registry) context
>>
>> .getAttribute(ApplicationServlet.REGISTRY_KEY_PREFIX_PUBLIC
>> +
>> "(the name of ApplicationServlet given in web.xml");
>>
>>
>> Shing
>>
>>
>> --- Numa Schmeder <[EMAIL PROTECTED]> wrote:
>>
>>> Nop, but isn't an easier way to just access the
>>> registry?
>>>
>>> Le 9 févr. 07 à 19:33, Shing Hing Man a écrit :
>>>
 Have you considered implementing the HiveMind
>>> registry
 as a singleton ?

 The zebra-hivemind subproject in Zebra does
>>> exactly
 that.
 http://zebra.berlios.de/

 Shing




 --- Numa Schmeder <[EMAIL PROTECTED]> wrote:

> Hello,
>
> I am migrating an application from tap3 to tap4,
>>> I
> am hitting a lot
> of problem.
> One of those is getting a reference to the
>>> hivemind
> registry from
> java without using injection.
>
> I have a base page who used to provide a
>>> DAOFactory
> to all my
> subclassing pages, now the DAOFactory is in the
> hivemind registry.
> I don't want to go to each page specification to
> inject the DAO
> Factory and I can't use annotations.  So I would
> like to access the
> hivemind registry programmatically.
> How can I do, I have checked many docs but
>>> couldn't
> find a clue.
>
> Could someone help me please!
>
> Thanks
>
> Numa
>
>

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


 Home page :
   http://uk.geocities.com/matmsh/index.html




>>>
>> ___
 All New Yahoo! Mail - Tired of unwanted email
>>> come-ons? Let our

Re: Tapestry & Hivemind: Caching multiple method calls per request?

2007-02-09 Thread James Carman

Tapestry would have to know what's inside the method to know that it
will always return the same thing.  This method doesn't return the
same thing all the time:

public String getTimestamp()
{
 return String.valueOf( System.currentTimeMillis() );
}



On 2/9/07, Tobias Marx <[EMAIL PROTECTED]> wrote:

Indepenent of what the method looks like, why is it called more then once 
anyhow?

If there is the same method inside a page or component, I thought Tapestry retrieves all 
the data first and then "intelligently" parses all the pages and its component 
templates and notices if the same method is called several times?

Now it seems like it goes through all templates line by line and then calls the methods 
every time it encounteres them without "an eye" for the page scope?

If I define a class as threaded in Hivemind, doesnt Tapestry "know" that the 
method will always return the same result if it appears 100 times inside a page or 
component?

If there is an injected method in some components and pages that references a 
threaded Hivemind class.it is always the same call and therefore Tapestry 
would only need to call it once and use the same result for all components?


Thanks!

Toby

 Original-Nachricht ----
Datum: Fri, 9 Feb 2007 10:24:05 -0500
Von: "James Carman" <[EMAIL PROTECTED]>
An: "Tapestry users" 
CC:
Betreff: Re: Tapestry & Hivemind: Caching multiple method calls per request?

> What does the method that fetches the domain object look like?  Does
> it cache its results or does it call the IDomainSource every time?
>
> On 2/9/07, Tobias Marx <[EMAIL PROTECTED]> wrote:
> > Hi there!
> >
> > I am using Hivemind to generate a Map of Domain name related objects as
> a singleton on startup, called HibernateDomainSource.
> >
> > Then I am constructing a threaded services that uses this data
> > together with the servletRequest. This service is called DomainManager.
> >
> > I am now injecting the DomainManager into my base component in order to
> access a domain object from the HibernateDomainSource that corresponds to
> the domain name from the servlet Request.
> >
> >  interface="tm.framework.services.interfaces.IDomainSource">
> > 
> >  class="tm.framework.services.HibernateDomainSource">
> >  property="templatePersistenceService" 
service-id="TemplatePersistenceService"/>
> > 
> > 
> >
> > 
> >
> >  interface="tm.framework.services.interfaces.DomainManager">
> > 
> >  class="tm.framework.services.DomainManagerImpl">
> >  service-id="HibernateDomainSource"/>
> >  service-id="tapestry.globals.HttpServletRequest" />
> > 
> > 
> > 
> >
> > The "problem" now is, that the DomainManager method that fetches the
> domain object from the map is called several times during a single page
> request.
> >
> > Is there a way to force it to only fetch it once per page request?
> >
> > Thanks!
> >
> > Toby
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

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




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



Re: Tapestry & Hivemind: Caching multiple method calls per request?

2007-02-09 Thread James Carman

What does the method that fetches the domain object look like?  Does
it cache its results or does it call the IDomainSource every time?

On 2/9/07, Tobias Marx <[EMAIL PROTECTED]> wrote:

Hi there!

I am using Hivemind to generate a Map of Domain name related objects as a 
singleton on startup, called HibernateDomainSource.

Then I am constructing a threaded services that uses this data
together with the servletRequest. This service is called DomainManager.

I am now injecting the DomainManager into my base component in order to access 
a domain object from the HibernateDomainSource that corresponds to the domain 
name from the servlet Request.



















The "problem" now is, that the DomainManager method that fetches the domain 
object from the map is called several times during a single page request.

Is there a way to force it to only fetch it once per page request?

Thanks!

Toby

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




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



Re: [very OT] group conventions for people use testng?

2007-02-01 Thread James Carman

In IDEA, you can supply "test runner options" to TestNG.  I would
imagine that the eclipse plugin has something similar, but I have not
used it.

On 2/1/07, Howard Lewis Ship <[EMAIL PROTECTED]> wrote:

I meant from inside Eclipse, or as specified in testng.xml.

I haven't upgraded my version of the plugin, perhaps this is a feature
they've added. I also want to see if parallel works properly in a more
recent version.

On 2/1/07, James Carman <[EMAIL PROTECTED]> wrote:
> Have you tried -excludegroups ?
> I think that works.
>
> On 2/1/07, Howard Lewis Ship <[EMAIL PROTECTED]> wrote:
> > I really only structure things in two ways: fast vs. slow, aka default
> >  vs. integration.
> >
> > I think if I was building an application, I may add additional groups
> > to cover tests that need special setup to run (assuming I couldn't do
> > that myself).
> >
> > I wish TestNG had an option to exclude named groups from a run, and
> > run everything else (including those outside a group).  T5 core now
> > has 689 tests and takes nearly a minute to run. On the other hand,
> > most of that time is spent inside integration tests and without those
> > I don't really trust that the framework operates correctly so there's
> > no way to win!
> >
> > On 2/1/07, Dan Adams <[EMAIL PROTECTED]> wrote:
> > > hey guys, just wondering. if you use testng how do you normally
> > > structure your groups? Do you always specific a group for unit tests or
> > > do you not?
> > >
> > > --
> > > Dan Adams
> > > Senior Software Engineer
> > > Interactive Factory
> > > 617.235.5857
> > >
> > >
> > > -
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
> >
> > --
> > Howard M. Lewis Ship
> > TWD Consulting, Inc.
> > Independent J2EE / Open-Source Java Consultant
> > Creator and PMC Chair, Apache Tapestry
> > Creator, Apache HiveMind
> >
> > Professional Tapestry training, mentoring, support
> > and project work.  http://howardlewisship.com
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
Howard M. Lewis Ship
TWD Consulting, Inc.
Independent J2EE / Open-Source Java Consultant
Creator and PMC Chair, Apache Tapestry
Creator, Apache HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

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




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



Re: [very OT] group conventions for people use testng?

2007-02-01 Thread James Carman

Have you tried -excludegroups ?
I think that works.

On 2/1/07, Howard Lewis Ship <[EMAIL PROTECTED]> wrote:

I really only structure things in two ways: fast vs. slow, aka default
 vs. integration.

I think if I was building an application, I may add additional groups
to cover tests that need special setup to run (assuming I couldn't do
that myself).

I wish TestNG had an option to exclude named groups from a run, and
run everything else (including those outside a group).  T5 core now
has 689 tests and takes nearly a minute to run. On the other hand,
most of that time is spent inside integration tests and without those
I don't really trust that the framework operates correctly so there's
no way to win!

On 2/1/07, Dan Adams <[EMAIL PROTECTED]> wrote:
> hey guys, just wondering. if you use testng how do you normally
> structure your groups? Do you always specific a group for unit tests or
> do you not?
>
> --
> Dan Adams
> Senior Software Engineer
> Interactive Factory
> 617.235.5857
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
Howard M. Lewis Ship
TWD Consulting, Inc.
Independent J2EE / Open-Source Java Consultant
Creator and PMC Chair, Apache Tapestry
Creator, Apache HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

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




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



Re: Exception when trying to configure tapestry-acegi.jar

2007-01-30 Thread James Carman

I believe you need hivemind-utils.jar in your classpath.


On 1/30/07, jake123 <[EMAIL PROTECTED]> wrote:


Hi,
I have some problems when I try to use the tapestry-acegi.jar. My Jboss
server starts up fine without any exceptions, but as soon as I try to access
my application I get this exception:

11:07:48,750 ERROR [[/]] mycompany: ServletException
javax.servlet.ServletException: Unable to construct service
tapestry.acegi.ExceptionTranslationFilter: Error building se
rvice tapestry.acegi.ExceptionTranslationFilter: Could not load class
com.javaforge.tapestry.acegi.filter.ExceptionTrans
lationFilter from WebappClassLoader
  delegate: false
  repositories:
--> Parent Classloader:
[EMAIL PROTECTED]
: com/javaforge/hivemind/util/HiveMindService
at
org.apache.tapestry.services.impl.WebRequestServicerPipelineBridge.service(WebRequestServicerPipelineBridge.j
ava:60)...

the entire Exception is in the attached file
http://www.nabble.com/file/6115/exception.txt exception.txt

In out hivemodule.xml we have this code:
 














In our web.xml we have this:

MyCompany

org.apache.tapestry.ApplicationServlet
0



MyCompany
/index.html



MyCompany
*.html



MyCompany
*.direct


MyCompany
*.sdirect


MyCompany
*.svc


In our spring applicationContext.xml we have:

   





SELECT user_name as username, user_password as 
password, enabled as
ENABLED  FROM app_user WHERE user_name=?




SELECT user_name as username, user_role as 
authority FROM app_user_role
WHERE user_name=?


   

We are using the folloing jar files for tapestry-ageci:
tapestry-acegi-0.1-20070126.164757-10.jar
hivemind-acegi-dao-0.1-20060608.022406-1.jar
hivemind-acegi-0.1-20060607.122705-3.jar

Does anybody know what we are doing wrong?

Thanks,
Jacob



--
View this message in context: 
http://www.nabble.com/Exception-when-trying-to-configure-tapestry-acegi.jar-tf3142373.html#a8709323
Sent from the Tapestry - User mailing list archive at Nabble.com.


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




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



Re: Spindle for tapestry 4,4.1, and 5?

2007-01-29 Thread James Carman

"- project wizard that downloads all dependencies and create a ready to
run project with a module builder, a configured web.xml and a Home page.
- page creation wizard."

Can you say maven archetype?
:-)


On 1/29/07, Hugo Palma <[EMAIL PROTECTED]> wrote:

Actually, in this case less is more. T5 does need much less IDE support
then T4, but what this means is that as an IDE plugin developer i can
spend my time thinking of more ways i can improve the life of every
Tapestry developer instead of figuring out all the quirks and rules for
path resolutions and stuff like that.

At this point, i've already got:

- project wizard that downloads all dependencies and create a ready to
run project with a module builder, a configured web.xml and a Home page.
- page creation wizard.
- syntax highlighting in component templates.
- a visual palette that show all services in you module builder in a
tree and let's you inject them in a component. And it extracts the
documentation from the service class and shows it in a nice manner.

Still a lot to be done and lot's of cool ideas in my mind. The really
good news is that implementing this has been much much easier compared
with supporting T4.

Howard Lewis Ship wrote:
> That's good news that you're working on support for T5 ... what kind
> of support do you expect?  I really think T5 will need much less
> support than T4.
>
> Keep me posted on any issues you see w.r.t. to supporting of tooling.
>
> On 1/29/07, Hugo Palma <[EMAIL PROTECTED]> wrote:
>> Here's what i know about Spindle for T4. Geoff split Spindle in two
>> libraries, an IDE agnostic one that could be used by any plugin for any
>> IDEA and the Eclipse plugin itself. I started using the IDE agnostic
>> part in TapIDEA. I'd say that Geoff left about 80% of the work done. As
>> far as the Eclipse plugin is concerned, i think it's in a much earlier
>> stage of development, but i'm not really sure about this as i never
>> looked at code.
>>
>> AFAIK, the Splindle project is dead until someone comes along and picks
>> it up where Geoff left off.
>>
>> I don't want to steal the thread to TapIDEA, but just as a side note,
>> i'm implementing TapIDEA for T5 and dropped TapIdea for T4 as i feel
>> that by the time i got it right T5 would probably be out and running.
>> And by the way, TapIDEA for T5 is coming out great :o)
>>
>> So, if anyone decides to pick up on Spindle, i'll gladly share my
>> knowledge on the IDE agnostic library. In the meantime, i'll be focusing
>> on TapIDEA.
>>
>>
>> Dan Adams wrote:
>> > So I'm one of those guys who in general thinks you shouldn't need
>> > special IDE tools to work on your stuff (ala JSF) but at the same time
>> > it would be really could if I could select a block of text in a
>> template
>> > and do "Extract component" or "Extract block". I know that development
>> > on Spindle has stopped so I question is
>> >
>> > - would these kind of eclipse-refactoring-esque features be right for
>> > spindle or a whole new plugin?
>> > - what's the status of where spindle left off?
>> >
>> >
>>
>>
>
>




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



Re: Aspects in tapestry pages using spring

2007-01-26 Thread James Carman

Well, it depends on your pointcut, I guess.  If it can be woven into
your code properly, you don't need to recompile Tapestry.  However,
you might want to look into putting an interceptor on the page service
or introducing a web request servicer filter.  That's an easy way to
do cross-cutting concerns.

On 1/26/07, Denis McCarthy <[EMAIL PROTECTED]> wrote:

Thanks for that James. I've got the aspectj stuff working now. The
reason why I've been looking into aspectj is to log the length of time
users of my site spend on individual pages. I want to log when each page
is rendered for a particular user's session, giving me a record of how
long a user spent on any individual page (this information is important
to me because the application is a touch-screen application, and if any
screen is slowing down or frightening users away because of its
complexity I want to know about it)


As this is a stereotypical cross-cutting concern, I've been looking for
a nice way to log this using tapestry's own internals. However, if I
understand aop correctly I'll have to compile tapestry itself using ajc
with my aspect to weave the aspect into the tapestry code. This could be
a little over the top - I'm wondering is there some less invasive way to
record page loads per session without resorting to copying and pasting
the same code into every page to accomplish this? Is there something in
hivemind that'll allow me to record this information?

Thanks
Denis

James Carman wrote:
> You can also use AspectJ within Tapestry using hivemind-aspectj (at
> JavaForge).  You still have to make sure you weave the aspects into
> your code, but hivemind-aspectj can inject HiveMind services into your
> singleton (the default) AspectJ aspects.  That way, you can inject all
> of Tapestry's HiveMind goodies into your aspects in case you need them
> (which you probably will).  If you want more information, email me
> back and I'll see if I can give you an example (the test cases are
> quite slim, but they do show how it's used).
>
> On 1/26/07, Denis McCarthy <[EMAIL PROTECTED]> wrote:
>> Thanks for that - I'm on the right track now. I'm now looking for a
>> tapestry method to advise, one that invariably fires once and only per
>> request. Is there such a method?
>> Thanks
>> Denis
>>
>> Ivano wrote:
>> > Once you have accomplished the task (a), the task (b) can be solved as
>> > follows.
>> >
>> > You need to define the aspect as a SpringBean  (only in spring 2, of
>> > course) using something like:
>> >
>> > > >factory-method="aspectOf" lazy-init="false">
>> >
>> > 
>> >
>> > in your applicationContext.xml file.
>> >
>> > Then you need to weave your project classes with the aspect you made
>> > (e.g. configuring Eclipse to do it if you use that.).
>> > Don't forget to deploy the aspect class with your application.
>> >
>> > Denis McCarthy wrote:
>> >
>> >> Hi,
>> >> I want to log the time users spend on individual pages in tapestry to
>> >> a database. I'm thinking the best way to do this may be to define an
>> >> aspect (using aspectj) on the attach() method for each page. I'm using
>> >> spring for the business/dao layers. As the tapestry pages are not
>> >> themselves defined in the spring application context I'm having a hard
>> >> time coming up with a suitable aspect that can be
>> >> a) defined to run on all attach() methods in any class that extends
>> >> BasePage, and
>> >> b) into which I can inject the spring bean which provides an interface
>> >> to the database where the logs must be stored.
>> >> I can accomplish a) by using a simple aspectj aspect, and b) by using
>> >> a spring defined aspect, but I'm not sure how to accomplish both at
>> once.
>> >>
>> >> Am I overlooking something stupid?
>> >> Thanks
>> >> Denis
>> >>
>> >> -
>> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> >> For additional commands, e-mail: [EMAIL PROTECTED]
>> >>
>> >>
>> >>
>> > --
>> > Ivano Pagano
>> >
>> >
>> >
>> 
>> >
>> > -
>> > To unsubscribe, e-mail: [EMAIL PROTECTED]
>> > For additional commands, e-mail: [EMAIL PROTECTED]
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>

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




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



Re: Aspects in tapestry pages using spring

2007-01-26 Thread James Carman

You can also use AspectJ within Tapestry using hivemind-aspectj (at
JavaForge).  You still have to make sure you weave the aspects into
your code, but hivemind-aspectj can inject HiveMind services into your
singleton (the default) AspectJ aspects.  That way, you can inject all
of Tapestry's HiveMind goodies into your aspects in case you need them
(which you probably will).  If you want more information, email me
back and I'll see if I can give you an example (the test cases are
quite slim, but they do show how it's used).

On 1/26/07, Denis McCarthy <[EMAIL PROTECTED]> wrote:

Thanks for that - I'm on the right track now. I'm now looking for a
tapestry method to advise, one that invariably fires once and only per
request. Is there such a method?
Thanks
Denis

Ivano wrote:
> Once you have accomplished the task (a), the task (b) can be solved as
> follows.
>
> You need to define the aspect as a SpringBean  (only in spring 2, of
> course) using something like:
>
> factory-method="aspectOf" lazy-init="false">
>
> 
>
> in your applicationContext.xml file.
>
> Then you need to weave your project classes with the aspect you made
> (e.g. configuring Eclipse to do it if you use that.).
> Don't forget to deploy the aspect class with your application.
>
> Denis McCarthy wrote:
>
>> Hi,
>> I want to log the time users spend on individual pages in tapestry to
>> a database. I'm thinking the best way to do this may be to define an
>> aspect (using aspectj) on the attach() method for each page. I'm using
>> spring for the business/dao layers. As the tapestry pages are not
>> themselves defined in the spring application context I'm having a hard
>> time coming up with a suitable aspect that can be
>> a) defined to run on all attach() methods in any class that extends
>> BasePage, and
>> b) into which I can inject the spring bean which provides an interface
>> to the database where the logs must be stored.
>> I can accomplish a) by using a simple aspectj aspect, and b) by using
>> a spring defined aspect, but I'm not sure how to accomplish both at once.
>>
>> Am I overlooking something stupid?
>> Thanks
>> Denis
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>>
> --
> Ivano Pagano
>
>
> 
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

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




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



Re: Acegi and Visit object

2007-01-22 Thread James Carman

By the way, you don't *have* to implement your UserDetailsService
inside a Spring container.  You can do so, but you lose the easy
ability to have other HiveMind services automatically injected into
your implementation instance.  Since you're just implementing an
interface, I really see no need to have it as a Spring bean (I don't
use the Spring container at all in my applications, though, so I am
biased I guess).  To do it using HiveMind, you'd use the
BuilderFactory (the default) to build your implementation object
rather than the SpringLookupFactory.

On 1/22/07, Jesper Zedlitz <[EMAIL PROTECTED]> wrote:

Thiago H de Paula Figueiredo wrote:
> What do I do if I want to use tapestry-acegi leaving the acegi
> configuration in spring instead of HiveMind?
>
You have your own org.acegisecurity.userdetails.UserDetailsService and want
to use it with tapestry-acegi? No problem!

Here is an example how to do it. First we need a Spring bean for that
UserDetailsService (in your applicationContext.xml)
 

 
(That replaced the "memoryAuthenticationDao" from my example.)

We reference this bean in hivemodule.xml
  

   

  

Jesper

--
 Jesper Zedlitz   E-Mail   : [EMAIL PROTECTED]
  Homepage : http://www.zedlitz.de
  ICQ# : 23890711


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




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



Re: Acegi and Visit object

2007-01-19 Thread James Carman

The HiveDocs are online, now.  Please refer to

http://www.carmanconsulting.com/tapestry-acegi

Wow!  That hivedoc plugin is really cool!  We do need to get that
incorporated as a subproject of the HiveMind project itself.  Nice
work!  Very easy to use.



On 1/19/07, jake123 <[EMAIL PROTECTED]> wrote:




andyhot wrote:
>
> James Carman wrote:
>> This is the main reason that I wrote Tapestry-Acegi, so that you get
>> the best of both worlds.  You can get at all the good Tapestry
>> framework stuff and have the Acegi stuff too.
>
> James, it was useful for me to have the hivedocs for the tapestry.acegi
> and
> the hivemind.acegi modules... I did got them generated using Marcus new
> hivedoc-plugin and now have them all (manually) combined in one xdoc.
> D'you want them
> emailed so you can include them at
> http://www.carmanconsulting.com/tapestry-acegi ?
>
>

Could you possible email me a copy of the documentation that you talking
about. That would help me a lot...

Thanks
Jacob
--
View this message in context: 
http://www.nabble.com/Acegi-and-Visit-object-tf3025484.html#a8453882
Sent from the Tapestry - User mailing list archive at Nabble.com.


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




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



Re: Acegi and Visit object

2007-01-19 Thread James Carman

Sure, send it along.  Actually, if the plugin is available via some
maven repo, then I can just include it in my maven build and have it
in there as one of the reports.

On 1/19/07, andyhot <[EMAIL PROTECTED]> wrote:

James Carman wrote:
> This is the main reason that I wrote Tapestry-Acegi, so that you get
> the best of both worlds.  You can get at all the good Tapestry
> framework stuff and have the Acegi stuff too.

James, it was useful for me to have the hivedocs for the tapestry.acegi and
the hivemind.acegi modules... I did got them generated using Marcus new
hivedoc-plugin and now have them all (manually) combined in one xdoc.
D'you want them
emailed so you can include them at
http://www.carmanconsulting.com/tapestry-acegi ?

>
>
> On 1/19/07, andyhot <[EMAIL PROTECTED]> wrote:
>> Actually, I'm not sure that the UserDetailsService is the best option
>> for setting up visit,
>> (cause the user may not eventually have the correct password) but
>> anyway,
>> here's how it can be done using hivemind and tapestry-acegi:
>>
>> 
>>
>> > model="singleton">
>>
>>
>>> service-id="tapestry.state.ApplicationStateManager"/>
>>
>> 
>> 
>>
>> and also take a look at
>> 
http://tapestry.apache.org/tapestry4.1/tapestry-framework/apidocs/org/apache/tapestry/engine/state/ApplicationStateManager.html
>>
>>
>>
>>
>> Srinivas Yermal wrote:
>> > Hi Andreas,
>> >
>> > Thanks for the response. Does tapestry-acegi automagically fill-in the
>> > user
>> > details into the visit object? Or should I do something?
>> >
>> > I use spring for my acegi declarations and specify my
>> > UserDetailsService in
>> > the DaoAuthenticationProvider.  You mention ASO. How would I go about
>> > doing
>> > it through state objects?
>> >
>> > Regards,
>> > Srini.
>> >
>> > On 1/19/07, andyhot <[EMAIL PROTECTED]> wrote:
>> >>
>> >> i've been using tapestry-acegi, so perhaps this might not be
>> helpful in
>> >> your case...
>> >>
>> >> so, how are you declaring the UserDetailsService implementation to be
>> >> used by acegi ?
>> >>
>> >> If you could inject into hivemind's ApplicationStateManager you
>> would be
>> >> able to
>> >> access any ASO you'd like.
>> >>
>> >>
>> >
>>
>>
>> --
>> Andreas Andreou - [EMAIL PROTECTED] - http://andyhot.di.uoa.gr
>> Tapestry / Tacos developer
>> Open Source / J2EE Consulting
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
Andreas Andreou - [EMAIL PROTECTED] - http://andyhot.di.uoa.gr
Tapestry / Tacos developer
Open Source / J2EE Consulting


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




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



Re: Acegi and Visit object

2007-01-19 Thread James Carman

Basically, tapestry-acegi just allows you to glue all of the Acegi
stuff together using HiveMind, rather than Spring (it's all just
"object soup" right?).  Actually, the majority of the configuration of
the services goes on outside of tapestry-acegi itself (it's in
hivemind-acegi and hivemind-acegi-dao, so it can be used in a
generalized fashion).  The cool part of tapestry-acegi is that it lets
you use Acegi's @Secured annotation (found in the acegi-tiger jar
file) to annotate your listener methods and page classes so that you
can declaratively secure them to specific roles.  As for examples, I
don't really have one, but somebody wrote a nice Wiki page detailing
how to set it up.


On 1/19/07, jake123 <[EMAIL PROTECTED]> wrote:




James Carman wrote:
>
> This is the main reason that I wrote Tapestry-Acegi, so that you get
> the best of both worlds.  You can get at all the good Tapestry
> framework stuff and have the Acegi stuff too.
>

Hi James,
We are about to implement Acegi to our application and we are using Spring
2.0.2, Hibernate 3, Tapestry 4.02.
Are tapestry-acegi.jar a replacement for doing the Acegi mappings in Spring?
What do we need to configure to make it work? If you could give some example
that would bee really nice

Thanks a lot

Jacob
--
View this message in context: 
http://www.nabble.com/Acegi-and-Visit-object-tf3025484.html#a8449953
Sent from the Tapestry - User mailing list archive at Nabble.com.


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




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



Re: Acegi and Visit object

2007-01-19 Thread James Carman

This is the main reason that I wrote Tapestry-Acegi, so that you get
the best of both worlds.  You can get at all the good Tapestry
framework stuff and have the Acegi stuff too.


On 1/19/07, andyhot <[EMAIL PROTECTED]> wrote:

Actually, I'm not sure that the UserDetailsService is the best option
for setting up visit,
(cause the user may not eventually have the correct password) but anyway,
here's how it can be done using hivemind and tapestry-acegi:




   
   
   
   



and also take a look at
http://tapestry.apache.org/tapestry4.1/tapestry-framework/apidocs/org/apache/tapestry/engine/state/ApplicationStateManager.html



Srinivas Yermal wrote:
> Hi Andreas,
>
> Thanks for the response. Does tapestry-acegi automagically fill-in the
> user
> details into the visit object? Or should I do something?
>
> I use spring for my acegi declarations and specify my
> UserDetailsService in
> the DaoAuthenticationProvider.  You mention ASO. How would I go about
> doing
> it through state objects?
>
> Regards,
> Srini.
>
> On 1/19/07, andyhot <[EMAIL PROTECTED]> wrote:
>>
>> i've been using tapestry-acegi, so perhaps this might not be helpful in
>> your case...
>>
>> so, how are you declaring the UserDetailsService implementation to be
>> used by acegi ?
>>
>> If you could inject into hivemind's ApplicationStateManager you would be
>> able to
>> access any ASO you'd like.
>>
>>
>


--
Andreas Andreou - [EMAIL PROTECTED] - http://andyhot.di.uoa.gr
Tapestry / Tacos developer
Open Source / J2EE Consulting


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




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



Re: Page Visitor IP Address/Port

2007-01-17 Thread James Carman

You can also include tapestry-autowire.jar into your application and
have Tap automatically inject it by doing (no annotations necessary):

public abstract HttpServletRequest getServletRequest();

Also, the port is available on the request.  Try getServerPort().


On 1/17/07, Lukas Ruetz <[EMAIL PROTECTED]> wrote:

Hi!

in case you are working with java5+ you can inject the service
into your page by adding:

@InjectObject("service:tapestry.globals.HttpServletRequest")
public abstract HttpServletRequest getServletRequest();

you can retrieve the IP-address by:
String IP = getServletRequest().getRemoteAddr();

I don't know how to get the port. (And also this IP-address
may only be the one of a proxy/firewall.)

hth,
lukas


Am Mittwoch, 17. Januar 2007 16:48 schrieb Chris Davies:
> Hi,
>
> How is it possible to get the IP address and port of a visitor to a
> Page?  I've been trying to figure this out for quite a while now (so I
> can insert useful information into log messages), but to no avail.
>
> The closest (crummy) solution I've found is to use a deprecated
> function to access the HttpServletRequest and then retrieve the remote
> address/port from there.  Obviously this isn't a real solution at all
> though!  What's the -correct- way to do this in Tapestry 4.0?
>
>
> Cheers,
>
> Chris

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




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



Re: New Tapestry feature suggestion: EditForm generation

2007-01-15 Thread James Carman

That was my idea and I haven't really seen any development going on
with Trails.  I haven't spoken to Chris Nelson in a while (we live in
the same city), so he may be really busy with work or something.

On 1/15/07, D&J Gredler <[EMAIL PROTECTED]> wrote:

Are there still plans to modularize Trails a bit more so that developers who
don't have a "Trails application" can still use some of the components it
provides? I remember reading somewhere that this sort of component library
approach was being considered, but never saw it come to fruition.

On 1/14/07, Kalle Korhonen <[EMAIL PROTECTED]> wrote:
>
> And hopefully nobody's re-inventing the wheel here because Trails has a
> pretty extensive support even for the not-so-simple cases. I know Howard
> that you and Chris Nelson have talked a bit, so I hope you take a look at
> the existing Trails code and steal/borrow from it or ask for changes
> before
> you go and write the same for Tap5. I'm also (im)patiently waiting for
> Tapestry 4.1 release to upgrade Trails to use it and I'd be more than
> happy
> to assist in changes to make it easier to support Tap5.
>
> Kalle
>
> On 1/14/07, Howard Lewis Ship <[EMAIL PROTECTED]> wrote:
> >
> > BeanForm exists for Tapestry 4, and Tapestry 5 will have some kind of
> > similar support.  I've been laying the groundwork for quite a while.
> >
> > On 1/14/07, Jesse Kuhnert <[EMAIL PROTECTED]> wrote:
> > > Do you mean like http://beanform.sourceforge.net/ ?
> > >
> > > On 1/14/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> > > > What about adding "native" Tapestry support for editing (complex)
> > > > objects?
> > > >
> > > > For objects thats don't depend on other objects it would be easy (
> e.g.
> > > > simply generating text fields).
> > > >
> > > > For objects that depend on other objects, it could maybe be solved
> > using Annotations?
> > > >
> > > > E.g. One object is Car and one is Engine. If you want to edit a car,
> a
> > dropdown box with Engines would need to be displayed. As Tapestry needs
> to
> > know which field is the one to display, this could either be done by
> using
> > the getName() method, getDisplayName() method or by using Annotations
> e.h.
> > @DisplayEditField.
> > > >
> > > > This would massively speed up Tapestry projects, you would then only
> > need a single line in your page files and the rest is done by
> Tapestry
> > > >
> > > >
> > > >
> -
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > >
> > > >
> > >
> > >
> > > --
> > > Jesse Kuhnert
> > > Tapestry/Dojo team member/developer
> > >
> > > Open source based consulting work centered around
> > > dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com
> > >
> > > -
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
> >
> > --
> > Howard M. Lewis Ship
> > TWD Consulting, Inc.
> > Independent J2EE / Open-Source Java Consultant
> > Creator and PMC Chair, Apache Tapestry
> > Creator, Apache HiveMind
> >
> > Professional Tapestry training, mentoring, support
> > and project work.  http://howardlewisship.com
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>




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



Re: Recommendation...

2007-01-12 Thread James Carman

The tapestry-acegi allows you to use Acegi's @Secured annotation
(declarative security) in Tapestry without the Spring container.


On 1/12/07, Daniel Tabuenca <[EMAIL PROTECTED]> wrote:

I am very happy using Tapestry for the WEB portion of my application
and Spring 2.0 to wire up and configure my beans and do all the other
stuff spring does. I especially like using spring with the Spring
Annotations addon. There is some overlap between Tapestry and Spring
in that tapestry uses it's own IOC container called Hivemind. While
hivemind and spring share many features in the wire-your-beans up
department spring's has many additional features unrelated to bean
wiring (such as Acegi Security for example). The only thing spring
doesn't seem to have is hiveminds hierarchical configuration where you
can define configuration points that get configured differently
depending on which jar you drop in. This is kind of neat and I wish
spring did that.


On 1/12/07, Maldonado, Daniel CW2 NGCT <[EMAIL PROTECTED]> wrote:
> After playing with C# and .NET for a while our group has decided that we need
> some Java web apps to make our applicatons "enterprise" friendly and to get
> buy-in from our peers who refuse to use .NET.
>
> I was thinking about using Tapestry and Hibernate to help me with some of our
> issues.
> However, I have heard that Spring is a great framework as well.
>
> I know that I have a lot of reading to do but if someone on this list could
> give me their perspective (from experience) about which one to use I would
> really appreciate the help and possibly save me a LOT of time.
>
> Are there any benefits to using Tapestry and Spring together?
>
> Would it be easier to just stick with Tapestry and Hibernate?
>
> Thank you for your help.
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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




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



Re: Tapernate and ASO

2007-01-12 Thread James Carman

If you're referring to the persistence strategies, then you're limited
to wherever Tapestry uses the persistence strategies
(pages/components).

On 1/12/07, Stephane Decleire <[EMAIL PROTECTED]> wrote:

Am i wrong or Tapernate is limited to classes implementing IComponent ?
I mean, can i benefit of Tapernate reattach possibilities in an ASO
which is a simple POJO ?

--
Stéphane Decleire






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



Re: DojoAjaxResponseBuilder and OpenSessionInViewFilter

2007-01-12 Thread James Carman

How do you have your OpenSEssionInViewFilter mapped?  What url-mapping
are you using?


On 1/12/07, Stephane Decleire <[EMAIL PROTECTED]> wrote:

Hi,

I've got a strange behavior in my T4.1.1 application when triggering a
DirectLink with the DojoAjaxResponseBuilder :

@Component(id="selectLink", bindings={
"listener=listener:doClick",
"parameters=blockId",
"async=true" })
public abstract DirectLink getSelectLink();

When the async property is set to false, my page is displayed without
errors but when the property is set to true, i've got the awfull "lazy
initialisation exception" error when the page tries to access entity
beans managed by Hibernate.
It seems that the DojoAjaxResponseBuilder bypass the OpenSessionInView
filter declared in my web.xml file.

Is it a normal behavior for the Ajax requests ?
Any clue is welcome.

--
Stéphane Decleire






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



Re: download a file

2007-01-10 Thread James Carman

Shing's code didn't show you what you needed?


On 1/10/07, Holger Stolzenberg <[EMAIL PROTECTED]> wrote:

I am very intrested! Please share your code

-Ursprüngliche Nachricht-
Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von James Carman
Gesendet: Mittwoch, 10. Januar 2007 02:32
An: Tapestry users
Betreff: Re: download a file

Let me know if Shing's example (it looks to be pretty good) isn't enough for you.  The code I wrote 
was for a client, but there's really not much "clientness" to it, so I could probably 
share it.  All it does is take image data out of a blob in the database and stream it back.  Not 
rocket science by any means.  The hardest part of it is the "servicey" bits.

p.s. For the record, that's two phrases that I coined in the same email :-)




On 1/9/07, Robert J. Walker <[EMAIL PROTECTED]> wrote:
> James Carman wrote:
>
> > I did this by creating my own "service" in T4.
>
> Have some code to share? I'm sure we'd all love to see it.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>

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


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





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



Re: download a file

2007-01-09 Thread James Carman

Let me know if Shing's example (it looks to be pretty good) isn't
enough for you.  The code I wrote was for a client, but there's really
not much "clientness" to it, so I could probably share it.  All it
does is take image data out of a blob in the database and stream it
back.  Not rocket science by any means.  The hardest part of it is the
"servicey" bits.

p.s. For the record, that's two phrases that I coined in the same email :-)




On 1/9/07, Robert J. Walker <[EMAIL PROTECTED]> wrote:

James Carman wrote:

> I did this by creating my own "service" in T4.

Have some code to share? I'm sure we'd all love to see it.


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





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



Re: download a file

2007-01-09 Thread James Carman

I did this by creating my own "service" in T4.


On 1/9/07, Dennis Sinelnikov <[EMAIL PROTECTED]> wrote:

Robert's Tapestry 3's method works, but Tapestry 4's method might cause
some problems, at least it did when I tried it. I believe it has to do
with closing the response outputstream before rewind or the rest of
rendering is complete.  User will be able to download the file
successfully, but you'll see an error in your logs about OutputStream is
already closed (or something along those lines).  To get around this
error, I had to implement my own download engine service, as Shing
suggested.

Dennis

Robert J. Walker wrote:
> Here's a method that will do what you're asking:
>
> // Tapestry 3
> protected void download(IRequestCycle cycle, ByteArrayOutputStream content, 
String contentType, String filename) throws IOException {
> HttpServletResponse response = cycle.getRequestContext().getResponse();
> response.setHeader("Content-disposition", "attachment; filename=" + 
filename);
> response.setContentType(contentType);
> response.setContentLength(content.size());
> response.getOutputStream().write(content.toByteArray());
> response.flushBuffer();
> response.getOutputStream().close();
> }
>
> // Tapestry 4
> protected void download(IRequestCycle cycle, ByteArrayOutputStream content, 
String contentType, String filename) throws IOException {
> WebResponse response = cycle.getInfrastructure().getResponse();
> response.setHeader("Content-disposition", "attachment; filename=" + 
filename);
> response.setIntHeader("Content-Length", content.size());
> OutputStream stream = response.getOutputStream(new 
ContentType(contentType));
> stream.write(content.toByteArray());
> stream.flush();
> stream.close();
> }
>
> You should make sure that the filename you provide is compatible with the 
user's operating system, or you could run into problems. It's also advisable to 
make the file extension jive with the content type so that the user doesn't have 
to rename the file to open it. Hope this helps.
>
> Robert J. Walker
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


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




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



Re: Extending existing component and .page file

2007-01-09 Thread James Carman

What are you looking to do?  What version of Tapestry are you using?
If you're looking to automatically inject a HiveMind service into all
of your pages/components, you can either use tapestry-autowire (tap
4.0) or upgrade to tap 4.1 which has tapestry-autowire built in.
Using tapestry-autowire, it's as simple as declaring an abstract
getter of the same type as one of your services in your HM registry
(provided there is exactly one service point which supports that
service interface):

public abstract MyService getMyService();

You can declare that in your MyAbstractPage class (or whatever you
want to call it) and all subclasses will inherit the property and
it'll be injected automatically.  Hope that helps.


On 1/9/07, karthik G <[EMAIL PROTECTED]> wrote:

class X extends Y{}

If component X extends an existing component Y by providing a new template
X.html and adding additional property in X.jwc, are we required to copy the
contents of Y.jwc into X.jwc?

If I dont include it, i run into errors.

May be am missing some parameter here. How can i get a .page to extend from
another base .page?

Also , if Class X is empty do I need to create one in the first place ( am
fine with Y)?

I just need .page inheritance in addition to Java component inheritance.

thanks,
Karthik




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



Re: Tapestry/Hivemind + Terracotta

2007-01-05 Thread James Carman

I would be willing to take a look at it when I get some breathing room.


On 1/4/07, KEGan <[EMAIL PROTECTED]> wrote:

Hi,

Unfortunately,  I am no expert in Hivemind. Would anyone from the Hivemind's
contributor be willing to champion this project ?


On 1/4/07, Eugene Kuleshov <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I am one of the developers of Terracotta for Spring and will be glad
> to help anyone who want to work on Tapestry/HiveMind support for
> Terracotta.
>
> There is some architecture documentation for DSO and Terracotta for
> Spring:
>
> http://wiki.terracotta.org/confluence/display/devdocs/Architecture
>
>
> 
http://wiki.terracotta.org/confluence/display/devdocs/Terracotta+for+Spring+Architecture
>
> User documentation is also available:
>
>
>
> 
http://wiki.terracotta.org/confluence/display/docs22/Terracotta+DSO+Install+and+Setup+Guide
>
>
> 
http://wiki.terracotta.org/confluence/display/docs22/Terracotta+for+Spring+Guide
>
> As a starting point I can suggest start some wiki page either at
> terracotta.org wiki or at Tapestry's own wiki and put together some use
> cases for clustering. It would also help if you could provide some
> example of Tapestry/HiveMind application and specify what components you
> need to cluster.
>
> Please don't hesitate to ask any questions about Terracotta.
>
> regards,
> Eugene Kuleshov
> http://jroller.com/page/eu/
>
>
> > Dear Tapestrians,
> >
> > http://www.terracotta.org/ is an open source clustering for Java (with
> > heap
> > level replication) ... seems very COOL!
> >
> > I am mostly using Tapestry for all my web development needs. I am
> > wondering
> > if anyone started to use Terracotta for clustering with
> > Tapestry+Hivemind ?
> > Could Tapestry couple with Hivemind, provide transparent clustering for
> > Tapestry application ?
> >
> > What I am thinking is, we can set some configurations in
> > hivemodule.xml and
> > make certain services clustered in Terracotta transparently.
> >
> > Also, Terracotta server could be started transparently with Hivemind
> > too :)
> >
> > What are your thoughts ?
> >
> > ~KEGan
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>




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



Re: Tapestry-acegi auth

2007-01-05 Thread James Carman

Sorry, but I haven't had time to reply to this thread, but have you
looked at the Wiki page:

http://wiki.apache.org/tapestry/AcegiSpringJava5


On 1/5/07, Firas Adiler <[EMAIL PROTECTED]> wrote:

 Hi Kevin,

This exception is "thrown if an Authentication object does not hold a
required authority". "ROLE_USER" is the authority you used to secure your
pages. It seems that your Acegi configuration is not complete. I'm a
beginner myself and found this page very helpful:
http://www.tfo-eservices.eu/wb_tutorials/media/SpringAcegiTutorial/HTML/Spri
ngAcegiTutorial-1_1-html.html

Keep in mind, though, that the tutorial above uses spring-style
configuration of acegi, i.e. using application context (xml) config file.
Apparently, one could achieve the same result using tapestry-acegi and
hivemind. I couldn't get it to work though. My current (working) acegi
configuration is based on this guide:
http://forum.springframework.org/showthread.php?t=24013&highlight=tapestry


Hope this helps,



-Original Message-
From: Kevin Menard [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 04, 2007 7:21 PM
To: Tapestry users
Subject: Tapestry-acegi auth

Hi,

I'm having some difficulty using tapestry-acegi. I can secure a page fine,
but I can't figure out how to allow a user to auth.
Unfortunately, my experience with Acegi in general is practically
non-existent, so I may just be doing something dumb there.

I have a page marked @Secured("ROLE_USER"), but when I access it, all I get
is org.acegisecurity.AccessDeniedException.

My HiveMind registry contains the following:











with the UserDetailsService implementation basically being a no-op.
I've set a break point in the service and it never gets executed.

I am using both tapestry-acegi and hivemind-acegi-dao, for what it's worth.
Any help would be much appreciated.

Thanks,
Kevin


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




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



Re: how to retrieve an Application State Object (ASO) with an application scope from the ServletContext ?

2007-01-04 Thread James Carman

I don't think that'll work.  The ApplicationStateManager needs a
reference to the current web request (eventually the session).


On 1/4/07, Ben Dotte <[EMAIL PROTECTED]> wrote:

Hi,

You could do something like this:

((ApplicationStateManager) ((Registry)
context.getAttribute("org.apache.tapestry.Registry:app")).getService(App
licationStateManager.class)).get("myStateObject");

Where "myStateObject" is the name of your ASO.

HTH

Ben

-Original Message-
From: Tapestry User List [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 04, 2007 8:45 AM
To: tapestry-user@jakarta.apache.org
Subject: how to retrieve an Application State Object (ASO) with an
application scope from the ServletContext ?

Hi,

Happy new year 

I have created a class that implements ServletContextListener.
In the method public void contextDestroyed(ServletContextEvent event),
I need to retrieve an Application State Object (ASO) of tapestry 4
with an application scope (not session).

My question is how to retrieve an Application State Object (ASO) from
the ServletContext ?


public void contextDestroyed(ServletContextEvent event) {
  ServletContext context = event.getServletContext();
  // retrieve myApplicationObject here
}

In hivemodule.xml:
...





...

Thanks so much,

D.

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


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





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



Re: RE: RE: RE: HoneycombLib/Hibernate problem

2007-01-04 Thread James Carman

Actually, Marcus, you can use the text value of an XML element in your
schema.  You use the push-content rule.


On 1/4/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

Thanksgetting closer!

Now I only have to solve the id generator problem.

Error building service honeycomb.hibernate.HibernateSessionFactory: Error at 
jar:file:/C:/home/me/.m2/repository/com/javaforge/honeycomb/HoneycombHibernate/0.3.3/HoneycombHibernate-0.3.3.jar!/META-INF/hivemodule.xml,
 line 15, column 30: Unable to initialize service 
honeycomb.hibernate.HibernateSessionFactory (by invoking method init on 
com.javaforge.honeycomb.hivemind.hibernate.HibernateSessionFactory): could not 
instantiate id generator


 Original-Nachricht 
Datum: Thu, 4 Jan 2007 09:10:31 +0100
Von: [EMAIL PROTECTED]
An: users@tapestry.apache.org
Betreff: RE: RE: RE: HoneycombLib/Hibernate problem

> Oh, now I see it:
>
> Instead of
>
>   org.hibernate.dialect.MySQLDialect
>
>
> you need to write
>
> 
>
> since in HiveMind descriptors text-elements are alway treated as
> comments,
> contrary to the syntax in hibernate.cfg.xml
>
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> > Sent: Wednesday, January 03, 2007 10:01 PM
> > To: Tapestry users
> > Subject: Re: RE: RE: HoneycombLib/Hibernate problem
> >
> >  
> >   mysql-connector-java
> >   mysql-connector-java
> >   3.1.14
> > 
> >
> > (only a manual maven install worked though).
> >
> > The mysql connector is found corrctly.
> >
> >
> > The console output:
> >
> > launching Jetty webapp: / on address: domain.de:8080 using
> > dir: [C:\java\tapestry\workspace\DomainWeb\src\main\webapp]
> > 21:51:11.796 INFO   [main]
> > org.mortbay.log.LogImpl.add(LogImpl.java:109) >16> added
> > [EMAIL PROTECTED]
> > 21:51:11.765 INFO   [main]
> > org.mortbay.log.LogImpl.reset(LogImpl.java:228) >11> reset
> > 21:51:11.828 INFO   [main]
> > org.mortbay.log.LogImpl.add(LogImpl.java:109) >11> added
> > [EMAIL PROTECTED]
> > log4j:WARN No appenders could be found for logger
> > (org.mortbay.http.HttpServer).
> > log4j:WARN Please initialize the log4j system properly.
> > 21:51:11.921 INFO   [main]
> > org.mortbay.util.FileResource.(FileResource.java:60)
> > >10> Checking Resource aliases
> > 21:51:14.562 INFO   [main]
> > org.apache.tapestry.ApplicationServlet.init(ApplicationServlet
> > .java:211) >12> Initialized application servlet
> > 'HoneycombTemplateWeb': 797 millis to create HiveMind
> > Registry, 2.219 millis overall.
> > 21:51:14.578 INFO   [main]
> > org.mortbay.http.SocketListener.start(SocketListener.java:204)
> >  >06> Started SocketListener on 127.0.0.1:8080
> > 21:51:58.000 INFO   [SocketListener0-1]
> > org.hibernate.cfg.annotations.Version.(Version.java:15
> > ) >89> Hibernate Annotations 3.2.0.CR1
> > 21:51:58.015 INFO   [SocketListener0-1]
> > org.hibernate.cfg.Environment.(Environment.java:499)
> > >94> Hibernate 3.2 cr2
> > 21:51:58.015 INFO   [SocketListener0-1]
> > org.hibernate.cfg.Environment.(Environment.java:532)
> > >94> hibernate.properties not found
> > 21:51:58.015 INFO   [SocketListener0-1]
> > org.hibernate.cfg.Environment.buildBytecodeProvider(Environmen
> > t.java:666) >95> Bytecode provider name : cglib
> > 21:51:58.031 INFO   [SocketListener0-1]
> > org.hibernate.cfg.Environment.(Environment.java:583)
> > >94> using JDK 1.4 java.sql.Timestamp handling
> >
> >
> > And more from the website output:
> >
> >
> > Stack Trace:
> > java.util.Hashtable.put(Unknown Source)
> > java.util.Properties.setProperty(Unknown Source)
> > org.hibernate.cfg.Configuration.setProperty(Configuration.java:1289)
> > com.javaforge.honeycomb.hivemind.hibernate.HibernateProperty.a
> > pplyTo(HibernateProperty.java:38)
> > com.javaforge.honeycomb.hivemind.hibernate.HibernateSessionFac
> > tory.(HibernateSessionFactory.java:100)
> > sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> > Method)
> > sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown
> > Source)
> > sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unkn
> > own Source) java.lang.reflect.Constructor.newInstance(Unknown Source)
> > org.apache.hivemind.util.ConstructorUtils.invoke(ConstructorUt
> > ils.java:139)
> > org.apache.hivemind.service.impl.BuilderFactoryLogic.instantia
> > teExplicitConstructorInstance(BuilderFactoryLogic.java:135)
> > org.apache.hivemind.service.impl.BuilderFactoryLogic.instantia
> > teCoreServiceInstance(BuilderFactoryLogic.java:109)
> > org.apache.hivemind.service.impl.BuilderFactoryLogic.createSer
> > vice(BuilderFactoryLogic.java:75)
> > org.apache.hivemind.service.impl.BuilderFactory.createCoreServ
> > iceImplementation(BuilderFactory.java:42)
> > org.apache.hivemind.impl.InvokeFactoryServiceConstructor.const
> > ructCoreServiceImplementation(InvokeFactoryServiceConstructor.java:62)
> > org.apache.hivemind.impl.servicemodel.AbstractServiceModelImpl
> > .constructCoreServiceImplementation(AbstractServ

Re: Raw values in contrib:table

2007-01-03 Thread James Carman

I would think so, since the table doesn't know what you're actually
displaying in your block, so it has no idea how to sort it.

On 1/3/07, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:

Hmm, is there any chance that by in doing this, I've broken the sorting 
functionality provided by contrib:table? It doesn't seem to work anymore...


Thanks,
Greg

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 02, 2007 4:10 PM
To: users@tapestry.apache.org
Subject: RE: Raw values in contrib:table


Great, I got it going.

I read the documentation, had no idea what it was saying. Dug through the 
source code, got completely confused... then went back to the documentation, 
and then it made sense.. I just did a 3 line block element at the top of my 
HTML page, bam, it works! And they're very simple, for reference :



  



  




Thanks for the help both of you!

Greg

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 02, 2007 3:48 PM
To: users@tapestry.apache.org
Subject: RE: Raw values in contrib:table


Thanks!

I'm still digging, it's a little confusing since it's split up as a JWC for 
LocaleSelection.. trying to piece everything together. I'd rather not split 
mine into a JWC file.

-Original Message-
From: Robert Zeigler [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 02, 2007 3:41 PM
To: Tapestry users
Subject: Re: Raw values in contrib:table


Yup, you only need to override the column(s) that need the custom
rendering. All others will be rendered as they are currently.

Robert

[EMAIL PROTECTED] wrote:
> Thanks.
>
> I'm digging through workbench code to get a feel for this.. LocaleSelection.*
>
> Will I be able to override that one column only? Or will I need to override 
it, and then provide defaults for all the other columns?
>
> -Original Message-
> From: andreas a [mailto:[EMAIL PROTECTED] Behalf Of andyhot
> Sent: Tuesday, January 02, 2007 3:05 PM
> To: Tapestry users
> Subject: Re: Raw values in contrib:table
>
>
> 
http://tapestry.apache.org/tapestry4.1/tapestry-contrib/componentreference/table.html
>
> "If defined, a Block with a name that starts with the column id and ends
> with /ColumnValue/ will be used to render the column values.
> Similarly, a Block with a name that starts with the column id and ends
> with /ColumnHeader/ will be used to render the column headers. "
>
> Use that approach to customize rendering
>
>
> [EMAIL PROTECTED] wrote:
>
>>On my tableView I have
>>
>> literal:
>>  * id:getId(), englishTitle:getEnglishColumn(), 
frenchTitle:getFrenchColumn()
>>
>>
>>
>>the 2nd and 3rd columns return some html links, but they get escaped.
>>
>>How can I get these to get displayed as html? I've tried adding a raw="true" 
in the html, but it's not working... also tried
>>
>> 
>>...
>>
>>  
>>
>>But no dice.
>>
>>Anyone have any tricks?
>>
>>Thanks,
>>Greg
>>
>>-
>>To unsubscribe, e-mail: [EMAIL PROTECTED]
>>For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>>
>>
>
>
>



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


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


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


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





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



Re: ServletException with acegi tapestry

2007-01-02 Thread James Carman

Great!  I might tell the folks at work to upgrade too.  Thanks for the heads up!

On 1/2/07, Henry Chen <[EMAIL PROTECTED]> wrote:

I found out this is a serialization bug in Acegi 1.0 which is used by
tapernate. I downloaded Acegi 1.0.3 and it got fixed.


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of James
Carman
Sent: Sunday, December 31, 2006 6:46 PM
To: Tapestry users
Subject: Re: ServletException with acegi tapestry

Yeah, I've seen that before.  I was able to work around it because it
was an actual programming error in my case.  But, the whole thing is
quite brittle, as you've figured out! :-)  There needs to be better
error-handling, IMHO.

On 12/31/06, Henry Chen <[EMAIL PROTECTED]> wrote:
> I'm using tapernate and it is tapestry-acegi integration. Everything works
> fine until recently I found the following error message.
>
> It only happens when I open my application a while ago and back to click
> some link or button on the webpage. The whole web application is then
> "dead". (Tomcat is still alive.) I have to restart the application.
>
> Does anybody have this problem too? It has been really a headache now.
> Thanks advance for any help.
>
>
>
>
>

> --
>
> javax.servlet.ServletException: Transaction is already completed - do not
> call commit or rollback more than once per transaction
>
>
org.apache.tapestry.services.impl.WebRequestServicerPipelineBridge.service(W
> ebRequestServicerPipelineBridge.java:65)
>
>
$ServletRequestServicer_10fd892ca53.service($ServletRequestServicer_10fd892c
> a53.java)
>
>
org.apache.tapestry.request.DecodedRequestInjector.service(DecodedRequestInj
> ector.java:55)
>
>
$ServletRequestServicerFilter_10fd892ca4f.service($ServletRequestServicerFil
> ter_10fd892ca4f.java)
>
>
$ServletRequestServicer_10fd892ca55.service($ServletRequestServicer_10fd892c
> a55.java)
>
>
com.javaforge.tapestry.acegi.filter.FilterChainAdapter.doFilter(FilterChainA
> dapter.java:43)
>
>
org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(Ano
> nymousProcessingFilter.java:125)
> $Filter_10fd892ca4d.doFilter($Filter_10fd892ca4d.java)
>
>
com.javaforge.tapestry.acegi.filter.ServletRequestServicerFilterAdapter.serv
> ice(ServletRequestServicerFilterAdapter.java:42)
>
>
$ServletRequestServicer_10fd892ca55.service($ServletRequestServicer_10fd892c
> a55.java)
>
>
com.javaforge.tapestry.acegi.filter.FilterChainAdapter.doFilter(FilterChainA
> dapter.java:43)
>
>
org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFil
> ter.java:216)
>
$FormProcessor_10fd892ca4b.doFilter($FormProcessor_10fd892ca4b.java)
>
>
com.javaforge.tapestry.acegi.filter.ServletRequestServicerFilterAdapter.serv
> ice(ServletRequestServicerFilterAdapter.java:42)
>
>
$ServletRequestServicer_10fd892ca55.service($ServletRequestServicer_10fd892c
> a55.java)
>
>
org.apache.tapestry.multipart.MultipartDecoderFilter.service(MultipartDecode
> rFilter.java:52)
>
>
$ServletRequestServicerFilter_10fd892ca43.service($ServletRequestServicerFil
> ter_10fd892ca43.java)
>
>
$ServletRequestServicer_10fd892ca55.service($ServletRequestServicer_10fd892c
> a55.java)
>
>
org.apache.tapestry.services.impl.SetupRequestEncoding.service(SetupRequestE
> ncoding.java:53)
>
>
$ServletRequestServicerFilter_10fd892ca51.service($ServletRequestServicerFil
> ter_10fd892ca51.java)
>
>
$ServletRequestServicer_10fd892ca55.service($ServletRequestServicer_10fd892c
> a55.java)
>
>
com.javaforge.tapestry.acegi.filter.FilterChainAdapter.doFilter(FilterChainA
> dapter.java:43)
>
>
org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpS
> essionContextIntegrationFilter.java:195)
> $Filter_10fd892ca45.doFilter($Filter_10fd892ca45.java)
>
>
com.javaforge.tapestry.acegi.filter.ServletRequestServicerFilterAdapter.serv
> ice(ServletRequestServicerFilterAdapter.java:42)
>
>
$ServletRequestServicer_10fd892ca55.service($ServletRequestServicer_10fd892c
> a55.java)
>
>
$ServletRequestServicer_10fd892ca3d.service($ServletRequestServicer_10fd892c
> a3d.java)
>
>
org.apache.tapestry.ApplicationServlet.doService(ApplicationServlet.java:123
> )
>
> org.apache.tapestry.ApplicationServlet.doGet(ApplicationServlet.java:104)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>
org.apache.tapestry.RedirectFilter.doFilter(RedirectFilter.java:103)
>
>
>
>
>

-

Re: ServletException with acegi tapestry

2006-12-31 Thread James Carman

Yeah, I've seen that before.  I was able to work around it because it
was an actual programming error in my case.  But, the whole thing is
quite brittle, as you've figured out! :-)  There needs to be better
error-handling, IMHO.

On 12/31/06, Henry Chen <[EMAIL PROTECTED]> wrote:

I'm using tapernate and it is tapestry-acegi integration. Everything works
fine until recently I found the following error message.

It only happens when I open my application a while ago and back to click
some link or button on the webpage. The whole web application is then
"dead". (Tomcat is still alive.) I have to restart the application.

Does anybody have this problem too? It has been really a headache now.
Thanks advance for any help.





--

javax.servlet.ServletException: Transaction is already completed - do not
call commit or rollback more than once per transaction

org.apache.tapestry.services.impl.WebRequestServicerPipelineBridge.service(W
ebRequestServicerPipelineBridge.java:65)

$ServletRequestServicer_10fd892ca53.service($ServletRequestServicer_10fd892c
a53.java)

org.apache.tapestry.request.DecodedRequestInjector.service(DecodedRequestInj
ector.java:55)

$ServletRequestServicerFilter_10fd892ca4f.service($ServletRequestServicerFil
ter_10fd892ca4f.java)

$ServletRequestServicer_10fd892ca55.service($ServletRequestServicer_10fd892c
a55.java)

com.javaforge.tapestry.acegi.filter.FilterChainAdapter.doFilter(FilterChainA
dapter.java:43)

org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(Ano
nymousProcessingFilter.java:125)
$Filter_10fd892ca4d.doFilter($Filter_10fd892ca4d.java)

com.javaforge.tapestry.acegi.filter.ServletRequestServicerFilterAdapter.serv
ice(ServletRequestServicerFilterAdapter.java:42)

$ServletRequestServicer_10fd892ca55.service($ServletRequestServicer_10fd892c
a55.java)

com.javaforge.tapestry.acegi.filter.FilterChainAdapter.doFilter(FilterChainA
dapter.java:43)

org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFil
ter.java:216)
$FormProcessor_10fd892ca4b.doFilter($FormProcessor_10fd892ca4b.java)

com.javaforge.tapestry.acegi.filter.ServletRequestServicerFilterAdapter.serv
ice(ServletRequestServicerFilterAdapter.java:42)

$ServletRequestServicer_10fd892ca55.service($ServletRequestServicer_10fd892c
a55.java)

org.apache.tapestry.multipart.MultipartDecoderFilter.service(MultipartDecode
rFilter.java:52)

$ServletRequestServicerFilter_10fd892ca43.service($ServletRequestServicerFil
ter_10fd892ca43.java)

$ServletRequestServicer_10fd892ca55.service($ServletRequestServicer_10fd892c
a55.java)

org.apache.tapestry.services.impl.SetupRequestEncoding.service(SetupRequestE
ncoding.java:53)

$ServletRequestServicerFilter_10fd892ca51.service($ServletRequestServicerFil
ter_10fd892ca51.java)

$ServletRequestServicer_10fd892ca55.service($ServletRequestServicer_10fd892c
a55.java)

com.javaforge.tapestry.acegi.filter.FilterChainAdapter.doFilter(FilterChainA
dapter.java:43)

org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpS
essionContextIntegrationFilter.java:195)
$Filter_10fd892ca45.doFilter($Filter_10fd892ca45.java)

com.javaforge.tapestry.acegi.filter.ServletRequestServicerFilterAdapter.serv
ice(ServletRequestServicerFilterAdapter.java:42)

$ServletRequestServicer_10fd892ca55.service($ServletRequestServicer_10fd892c
a55.java)

$ServletRequestServicer_10fd892ca3d.service($ServletRequestServicer_10fd892c
a3d.java)

org.apache.tapestry.ApplicationServlet.doService(ApplicationServlet.java:123
)

org.apache.tapestry.ApplicationServlet.doGet(ApplicationServlet.java:104)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.tapestry.RedirectFilter.doFilter(RedirectFilter.java:103)







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



Re: PropertySelection populated from database

2006-12-30 Thread James Carman

There is a standard ISO code for countries.  I'd use that.


On 12/30/06, RonPiterman <[EMAIL PROTECTED]> wrote:

yes, this is the case if you use list index as value in your model. This
should only be done if you know the list will not change across
requests. If it does, use a databse primary key, and reload the entry
from the database on the translate method in the model.
Cheers and happy new year,
Ron



[EMAIL PROTECTED] wrote:
> Hi folks,
>
> I'm fetching a list of countries from a mysql database to populate a
> PropertySelection inside a form. So let's say you have:
>
> option 0 : Canada
> option 1 : US
>
> If the list of countries in the database changes before the user submits
> the form, the wrong selection may get submitted ! For example, if the user
> selected 'US', Mexico gets added, and user submits the form, 'Mexico', not
> 'US' gets submitted. The reason is that when the form submits the property
> selection gets re-populated with :
>
> option 0 : Canada
> option 1 : Mexico
> option 2 : US
>
> So "option 1" got submitted on an updated list and the wrong country is
> submitted. Is there a workaround to this ?
>
> Many thanks,
>
> galpi
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


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




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



Re: ServletContextListener equivalent in Tapestry

2006-12-28 Thread James Carman

No, it should be set up by just implementing the method/interface on
your implementation class.  I wonder if the Tapestry code isn't
calling shutdown method on the registry.


On 12/28/06, Josh Joy <[EMAIL PROTECTED]> wrote:

Hi James,

I created a class and had it implement
org.apache.hivemind.events.RegistryShutdownListener
interface and also
implemented the method public void
registryDidShutdown(); For the
method, I just had it print a debug statement my
standard out log.

However, when I redeploy my app, I don't see any
messages being printed
indicating that the shutdown method is being called. I
do though see
that my startup code is being executed. Do I need to
update the
hivemind.xml or another config file?

Thanks for your help,
Josh

James Carman wrote:
> Have your implementation class implement
> org.apache.hivemind.events.RegistryShutdownListener
interface and it
> will automatically be registered for the events by
HiveMind (as long
> as you're not using the threaded service model).
>
>
>
> On 12/26/06, Josh Joy <[EMAIL PROTECTED]> wrote:
>> Hi All,
>>
>> I was able to implement the below for
>> hivemind.startup...however is
>> there such a thing as hivemind.shutdown? I'm
looking
>> for the equivalent
>> of contextDestroyed?
>>
>> Thanks,
>> Josh
>>
>> James Carman wrote:
>> > You let HiveMind inject stuff into your service
that
>> runs at startup:
>> >
>> > public class MyStartupClass implements Runnable
>> > {
>> >  private MyService myService;
>> >
>> >  public void setMyService( MyService myService )
>> >  {
>> >this.myService = myService;
>> >  }
>> >
>> >  public void run()
>> >  {
>> >myService.doSomethingThatMyServiceDoes();
>> >  }
>> > }
>> >
>> > HiveMind will "autowire" the MyService object
into
>> your MyStartupClass
>> > object (unless there is more than one service
point
>> within your HiveMind
>> > registry which implements the MyService
interface).
>> Then, declare your
>> > service point in the HiveMind module:
>> >
>> > > interface="java.lang.Runnable">
>> >  
>> >> class="com.myco.somepackage.MyStartupClass" />
>> >  
>> > 
>> >
>> > Then, register your service with the startup
>> configuration point:
>> >
>> > 
>> >  
>> > 
>> >
>> > That's it!  Your Runnable class will now run upon
>> registry startup
>> > (creation), which happens in a Tapestry
application
>> when the application
>> > servlet starts up.
>> >
>> > On 10/28/06, KEGan <[EMAIL PROTECTED]>
wrote:
>> >>
>> >> Hi,
>> >>
>> >> I have tried both approches. However, inside my
>> code, I am trying to
>> >> access
>> >> Hivemind services, and it didnt work.
>> >>
>> >> Example, in my custom "ApplicationInitializer",
I
>> use:
>> >>
>> >> Registry registry =
>> RegistryBuilder.constructDefaultRegistry();
>> >> MyService myservice =
>> (MyService)registry.getService("
>> >> com.project.myService",
>> >> MyService.class);
>> >>
>> >> And all I get is a null.
>> >>
>> >> I suspect using the
>> "RegistryBuilder.constructDefaultRegistry()" is not
>> >> the
>> >> correct way to get access into Hivemind
registry,
>> when Tapestry is
>> >> starting
>> >> up.
>> >>
>> >> So, how do I get access to Hivemind registry ...
>> whether it is from
>> >> inside
>> >> "
>> >> hivemind.Startup" or
>> "tapestry.init.ApplicationInitializers".
>> >>
>> >>
>> >>
>> >> On 10/24/06, James Carman
>> <[EMAIL PROTECTED]> wrote:
>> >> >
>> >> > There is a configuration point called
>> "hivemind.Startup" where you can
>> >> > register Runnable objects to be run at HM
>> registry startup time (which
>> >> is
>> >> > the same as Tapestry startup time).
>> >> >
>> >> > On 10/22/06, KEGan <[EMAIL PROTECTED]>
>> wrote:
>> >> > >
>> >> > > Hi,
>> >> > >
>> >> > > I need to do some tasks when my Servlet web

Re: ServletContextListener equivalent in Tapestry

2006-12-27 Thread James Carman

Have your implementation class implement
org.apache.hivemind.events.RegistryShutdownListener interface and it
will automatically be registered for the events by HiveMind (as long
as you're not using the threaded service model).



On 12/26/06, Josh Joy <[EMAIL PROTECTED]> wrote:

Hi All,

I was able to implement the below for
hivemind.startup...however is
there such a thing as hivemind.shutdown? I'm looking
for the equivalent
of contextDestroyed?

Thanks,
Josh

James Carman wrote:
> You let HiveMind inject stuff into your service that
runs at startup:
>
> public class MyStartupClass implements Runnable
> {
>  private MyService myService;
>
>  public void setMyService( MyService myService )
>  {
>this.myService = myService;
>  }
>
>  public void run()
>  {
>myService.doSomethingThatMyServiceDoes();
>  }
> }
>
> HiveMind will "autowire" the MyService object into
your MyStartupClass
> object (unless there is more than one service point
within your HiveMind
> registry which implements the MyService interface).
Then, declare your
> service point in the HiveMind module:
>
> 
>  
>
>  
> 
>
> Then, register your service with the startup
configuration point:
>
> 
>  
> 
>
> That's it!  Your Runnable class will now run upon
registry startup
> (creation), which happens in a Tapestry application
when the application
> servlet starts up.
>
> On 10/28/06, KEGan <[EMAIL PROTECTED]> wrote:
>>
>> Hi,
>>
>> I have tried both approches. However, inside my
code, I am trying to
>> access
>> Hivemind services, and it didnt work.
>>
>> Example, in my custom "ApplicationInitializer", I
use:
>>
>> Registry registry =
RegistryBuilder.constructDefaultRegistry();
>> MyService myservice =
(MyService)registry.getService("
>> com.project.myService",
>> MyService.class);
>>
>> And all I get is a null.
>>
>> I suspect using the
"RegistryBuilder.constructDefaultRegistry()" is not
>> the
>> correct way to get access into Hivemind registry,
when Tapestry is
>> starting
>> up.
>>
>> So, how do I get access to Hivemind registry ...
whether it is from
>> inside
>> "
>> hivemind.Startup" or
"tapestry.init.ApplicationInitializers".
>>
>>
>>
>> On 10/24/06, James Carman
<[EMAIL PROTECTED]> wrote:
>> >
>> > There is a configuration point called
"hivemind.Startup" where you can
>> > register Runnable objects to be run at HM
registry startup time (which
>> is
>> > the same as Tapestry startup time).
>> >
>> > On 10/22/06, KEGan <[EMAIL PROTECTED]>
wrote:
>> > >
>> > > Hi,
>> > >
>> > > I need to do some tasks when my Servlet web
application is
>> initialized.
>> > In
>> > > this, I can use ServletContextListener.
>> > >
>> > > Now, I am using Tapestry ... and I want to
achieve the same
>> thing. Of
>> > > course, I can still use ServletContextListener,
but with this, I
>> cannot
>> > > use
>> > > all the TapestryAnnotation Hivemind goodness
(autowiring, etc) that
>> > comes
>> > > with Tapestry. So is there a
ServletContextListener equivalent in
>> > > Tapestry?
>> > > The idea is that I can run some tasks (only
once) when Tapestry is
>> first
>> > > initialized, and I want to do this with all the
Tapestry Annontation
>> and
>> > > Hivemind goodness.
>> > >
>> > > Thanks.
>> > >
>> > > ~KEGan
>> > >
>> > >
>> >
>> >
>>
>>
>


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




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



Re: tapestry-acegi and tapestry 4.1

2006-12-26 Thread James Carman

I haven't tried it, but it should work as far as I know.  You can
override the dependency in your own pom file


On 12/26/06, Robert Binna <[EMAIL PROTECTED]> wrote:

Hi

I justed wanted to use tapestry-acegi on a project of mine that uses
tapestry 4.1. Has someone get it working because the current pom file is
for tapestry 4.0?

Kind regards,
 Robert

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




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



Re: hook into T4's page creation process

2006-12-23 Thread James Carman

The tapestry-acegi library does exactly this.  When it sees an Acegi
@Secured annotation on a class/method, it uses a worker to enhance the
class.  So, you can either use what I've already created or refer to
the source to see how to do what you want.  If you have any questions
about the code, don't hesitate to ask.  Hope that helps.

On 12/22/06, RonPiterman <[EMAIL PROTECTED]> wrote:

yes, workers are part of 4.0.2 - and the code is very clear, and one can
learn alot from it - howard has a *very* nice programming style, so its
worth taking a look.

I would look at the wiki, but I don't know if there are any
tutorials/docu around for this. It is quite advanced staff, but its not
that hard.

Cheers,
Ron



karthik G wrote:
> thanks Ron. Currently am with going the way (subclassing a securedpage) as
> suggested by Dennis. Its simple and works.
> But am interested in the workers that you mention. Is looking at the source
> code the only option at this point to write some workers?. Are there any
> docs somewhere?
> Btw are workers part of 4.0.2
>
> thanks,
> Karthik
>
>
> On 12/21/06, Ron Piterman <[EMAIL PROTECTED]> wrote:
>>
>> yes, there is a configurable annotation workers, so you can
>> create/extend/override page methods when tapestry is preparing the
>> page/component class.
>>
>> You can create your own class worker which will add the needed logic to
>> the mentioned attach event.
>>
>> Take a look at the annotations module code and hivemind configuration.
>>
>> Cheers,
>> Ron
>>
>>
>>
>> karthik G wrote:
>> > I just want to add an annotation on the page and then take some action
>> when
>> > the page is being bound to a request from the page pool.
>> >
>> > @SecuredPage
>> > abstract class MyPage extends BasePage{
>> >
>> > }
>> >
>> > Is there anyways i can hook into T4's page creation process and then
>> > depending upon the annotation take some action? For e.g in the above
>> > case, I
>> > just want to be able to check for a user object in the session and
>> redirect
>> > to login page.
>> >
>> > I looked at PageAttachListener and it looks nice. But I dont want to
>> > implement that in my page but would like to attach a listener to T4
>> itself.
>> >
>> > thanks,
>> > Karthik
>> >
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>


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




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



Re: Can you comment on this?

2006-12-21 Thread James Carman

Can you please take this off-line?  The rest of us Tapestry users
don't need to hear this, IMHO.


On 12/21/06, D&J Gredler <[EMAIL PROTECTED]> wrote:

LOL. Francis == Emmanuel?

On 12/21/06, Francis Amanfo <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> Seems like you've missed some pasta today. I urge you to get yourself some
> Italian pasta and after that come back and make some sensible arguments.
>
> Emmanuel
>
> On 12/21/06, Angelo Turetta < [EMAIL PROTECTED]> wrote:
> >
> > Emmanuel Sowah wrote:
> > > Sorry, but I like fair discussions.
> >
> > Oh, do you?
> >
> > I don't know who you are, and I've been subscribed to this mailing list
> > for very few months, so maybe I'm wrong: but the only thing I've seen
> > you do (more than once) is desperately trying to start some idiotic
> > flame-war. That's quite the opposite of 'fair discussion'.
> > This list is intended for Tapestry users peer discussion: if you don't
> > use (or like) Tapestry, you are wasting your time here, and ours too.
> >
> > Angelo Turetta
> > Modena - Italy
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> --
> Beware of bugs in the above code;
> I have only proved it correct, not tried it.
> -Donald Knuth
> I don't make predictions. I never have,
> and I never will.
> -Tony Blair
>
>




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



Re: T-Acegi: An AuthenticationManager is required

2006-12-18 Thread James Carman

  No, I'm not using tapestry-spring.


Well, HiveMind needs to know how to find the Spring objects.  So, just
drop tapestry-spring.jar into your WEB-INF/lib dir and see if that
fixes it (as long as your spring config file is named/located
appropriately).



What is the alternative way to configure acegi?


You use HiveMind to instantiate/configure your acegi objects.

On 12/18/06, Firas Adiler <[EMAIL PROTECTED]> wrote:


> Are you using tapestry-spring?
  No, I'm not using tapestry-spring. It turns out that I got it to work
correctly using only spring's ContextLoaderListener approach. And as you may
have guessed, it doesn't work when dropping tapestry-acegi into the
classpath. The exception I get is the same, "An AuthenticationManager is
required" (please see my initial post).

> I didn't use Spring to set up my stuff...
  What is the alternative way to configure acegi? Does it offer the same
fine-grained control as spring's config xml?

Thanks for your time!




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




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



Re: Proper way to get ApplicationStateManager?

2006-12-15 Thread James Carman

Hey, I just submit the code patches, not the documentation ;-)


On 12/15/06, Ron Piterman <[EMAIL PROTECTED]> wrote:

:( some new feature are failing on the marketing - I also didn't have an
idee about the new auto injection... lucky I read the list :)

Cheers,
Ron

[EMAIL PROTECTED] wrote:
> That's awesome. Was I supposed to be able to find this out somehow with 
documentation? I'd like to think I've been scouring it really hard and never came 
across this :( Or it might just come with understanding HiveMind+Tap?
>
>
> Greg
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of James
> Carman
> Sent: Thursday, December 14, 2006 10:53 PM
> To: Tapestry users
> Subject: Re: Proper way to get ApplicationStateManager?
>
>
> And, the coolest thing is that this sort of thing *can* be inherited
> without using annotations (by putting it in a common superclass).
> Otherwise, you have to use XML in your spec files to inject stuff into
> all of your subclasses.
>
>
> On 12/14/06, Jesse Kuhnert <[EMAIL PROTECTED]> wrote:
>
>>Yes. Any/all hivemind services that don't have more than one
>>definition for the same class interface will be automatically wired
>>into your components/pages just by declaring the abstract getter or
>>setter. That's it.
>>
>>On 12/14/06, [EMAIL PROTECTED]
>><[EMAIL PROTECTED]> wrote:
>>
>>>This sounds promising, and I am now on 4.1.1-SNAPSHOT...
>>>
>>>public abstract ApplicationStateManager getASM();
>>>
>>>
>>>As easy as declaring this in a BasePage subclass???
>>>
>>>
>>>-Greg
>>>
>>>-Original Message-
>>>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of James
>>>Carman
>>>Sent: Thursday, December 14, 2006 3:08 PM
>>>To: Tapestry users
>>>Subject: Re: Proper way to get ApplicationStateManager?
>>>
>>>
>>>What version of Tapestry are you using?  4.1?  If so, then it can
>>>autowire stuff for you out of the HiveMind registry.  Just declare an
>>>abstract getter that returns an ApplicationStateManager.  If you're on
>>>4.0, you can download the tapestry-autowire source and build it (via
>>>SVN http://svn.javaforge.com/svn/tapestry/tapestry-autowire/trunk/,
>>>username/password anonymous/anon).  Just drop it into your classpath
>>>and it will do the same thing as 4.1.
>>>
>>>On 12/14/06, [EMAIL PROTECTED]
>>><[EMAIL PROTECTED]> wrote:
>>>
>>>>I'm replacing the old getVisit() object.
>>>>
>>>>So most of my pages have a call to getVisit(), which returns my AdminVisit 
object, which has the information about if they are logged in, what permissions they have 
etc.
>>>>
>>>>Almost every page calls getVisit(), my Border also calls getVisit() to determine if 
it's showing a simple "Login" link on the left, or if it's showing a full menu because they 
are logged in.
>>>>
>>>>I'm close to wrapping up day 3 trying to get things working! So far the end 
is not in sight.
>>>>
>>>>What I've been able to gather is that I *think* I need to store 
ApplicationStateManager somewhere as a singleton, and then retrieve my visit object or 
store it as needed from there.
>>>>
>>>>I've implemented this method (obviously doesn't work) in hopes that it will 
work someday, I think the idea is correct?
>>>>
>>>>protected AdminVisit getAdminVisit()
>>>>  {
>>>>   AdminVisit aVisit = (AdminVisit) 
PCTAdminApplicationServlet.asm.get("adminVisit");
>>>>
>>>>   if (aVisit == null){
>>>> aVisit = new AdminVisit();
>>>>
>>>>   PCTAdminApplicationServlet.asm.store("adminVisit", aVisit);
>>>>   }
>>>>   return aVisit;
>>>>  }
>>>>
>>>>
>>>>Thanks,
>>>>Greg
>>>>
>>>>-Original Message-
>>>>From: news [mailto:[EMAIL PROTECTED] Behalf Of Ron Piterman
>>>>Sent: Thursday, December 14, 2006 2:23 PM
>>>>To: users@tapestry.apache.org
>>>>Subject: Re: Proper way to get ApplicationStateManager?
>>>>
>>>>
>>>>Tell us when do you need it and why... *maybe* we can tell you how...
>>>>Cheers,
>>>>Ron
>>>>
>>>>
>>>>
>>>>[EMAI

Re: T-Acegi: An AuthenticationManager is required

2006-12-15 Thread James Carman

I didn't use Spring to set up my stuff, but in theory that should
work.  Are you using tapestry-spring?


On 12/15/06, Firas Adiler <[EMAIL PROTECTED]> wrote:

Hello James,

>> The tapestry-acegi library works...
I don't doubt it

>> ...and it's been working flawlessly
I had it working that way too...until the problem, described erlier, cropped
up.

A qouple of questions:
Do you use JdbcDaoImpl or InMemoryDaoImpl?
Did you set up tapestry-acegi exactly as it described on the wiki
page?

Me, and others reading this archive, will appreciate your help.

Thanks,



P.S. My platform - Java 6, Tomcat 5.5.17, Tapestry 4.0.2





-Original Message-
On 12/14/06, Firas Adiler <[EMAIL PROTECTED]> wrote:
> Hello,
>
> Following steps in this thread
> http://forum.springframework.org/showthread.php?t=24013 I managed to
> get acegi working using JdbcDaoImpl. Now I get an
> ApplicationRuntimeException as soon as I call the webapp url.
> Unfortunatly, I can't rollback the changes that affected this
> misbehavior, since I'm not aware of the modification(s) that caused it.
>
> -
> Unable to initialize service tapestry.acegi.BasicProcessingFilter (by
> invoking method afterPropertiesSet on
> org.acegisecurity.ui.basicauth.BasicProcessingFilter): An
> AuthenticationManager is required
> [jar:file:/path/to/tapestry-acegi.jar!/META-INF/hivemodule.xml, line
> 44, column 25] ...
> -
>
> Any ideas for what causing this exception?
>
> Thanks for your time!
>
> 
>
> P.S. The information on the Wiki
>  9>
> pages is incorrect/outdated
>
>


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




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



Re: Proper way to get ApplicationStateManager?

2006-12-14 Thread James Carman

And, the coolest thing is that this sort of thing *can* be inherited
without using annotations (by putting it in a common superclass).
Otherwise, you have to use XML in your spec files to inject stuff into
all of your subclasses.


On 12/14/06, Jesse Kuhnert <[EMAIL PROTECTED]> wrote:

Yes. Any/all hivemind services that don't have more than one
definition for the same class interface will be automatically wired
into your components/pages just by declaring the abstract getter or
setter. That's it.

On 12/14/06, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
> This sounds promising, and I am now on 4.1.1-SNAPSHOT...
>
> public abstract ApplicationStateManager getASM();
>
>
> As easy as declaring this in a BasePage subclass???
>
>
> -Greg
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of James
> Carman
> Sent: Thursday, December 14, 2006 3:08 PM
> To: Tapestry users
> Subject: Re: Proper way to get ApplicationStateManager?
>
>
> What version of Tapestry are you using?  4.1?  If so, then it can
> autowire stuff for you out of the HiveMind registry.  Just declare an
> abstract getter that returns an ApplicationStateManager.  If you're on
> 4.0, you can download the tapestry-autowire source and build it (via
> SVN http://svn.javaforge.com/svn/tapestry/tapestry-autowire/trunk/,
> username/password anonymous/anon).  Just drop it into your classpath
> and it will do the same thing as 4.1.
>
> On 12/14/06, [EMAIL PROTECTED]
> <[EMAIL PROTECTED]> wrote:
> > I'm replacing the old getVisit() object.
> >
> > So most of my pages have a call to getVisit(), which returns my AdminVisit 
object, which has the information about if they are logged in, what permissions they 
have etc.
> >
> > Almost every page calls getVisit(), my Border also calls getVisit() to determine if 
it's showing a simple "Login" link on the left, or if it's showing a full menu 
because they are logged in.
> >
> > I'm close to wrapping up day 3 trying to get things working! So far the end 
is not in sight.
> >
> > What I've been able to gather is that I *think* I need to store 
ApplicationStateManager somewhere as a singleton, and then retrieve my visit object 
or store it as needed from there.
> >
> > I've implemented this method (obviously doesn't work) in hopes that it will 
work someday, I think the idea is correct?
> >
> > protected AdminVisit getAdminVisit()
> >   {
> >AdminVisit aVisit = (AdminVisit) 
PCTAdminApplicationServlet.asm.get("adminVisit");
> >
> >if (aVisit == null){
> >  aVisit = new AdminVisit();
> >
> >PCTAdminApplicationServlet.asm.store("adminVisit", aVisit);
> >}
> >return aVisit;
> >   }
> >
> >
> > Thanks,
> > Greg
> >
> > -Original Message-
> > From: news [mailto:[EMAIL PROTECTED] Behalf Of Ron Piterman
> > Sent: Thursday, December 14, 2006 2:23 PM
> > To: users@tapestry.apache.org
> > Subject: Re: Proper way to get ApplicationStateManager?
> >
> >
> > Tell us when do you need it and why... *maybe* we can tell you how...
> > Cheers,
> > Ron
> >
> >
> >
> > [EMAIL PROTECTED] wrote:
> > > Thanks Dennis - I'm not sure I understand how to go about fixing the 
problem if it's null at the times I need it :)
> > >
> > > Greg
> > >
> > >
> > >
> > >>
> > > Greg,
> > >
> > > You can do what you described before, but pull your visit object in your
> > > SomePage.java classes where you need it.  As Ron pointed out, ASM uses
> > > other service where WebRequest is required.  When you're using it, it's
> > > still null.
> > >
> > > -Dennis
> > >
> > >
> > > -
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> > > -
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> > ---

Re: Proper way to get ApplicationStateManager?

2006-12-14 Thread James Carman

What version of Tapestry are you using?  4.1?  If so, then it can
autowire stuff for you out of the HiveMind registry.  Just declare an
abstract getter that returns an ApplicationStateManager.  If you're on
4.0, you can download the tapestry-autowire source and build it (via
SVN http://svn.javaforge.com/svn/tapestry/tapestry-autowire/trunk/,
username/password anonymous/anon).  Just drop it into your classpath
and it will do the same thing as 4.1.

On 12/14/06, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:

I'm replacing the old getVisit() object.

So most of my pages have a call to getVisit(), which returns my AdminVisit 
object, which has the information about if they are logged in, what permissions 
they have etc.

Almost every page calls getVisit(), my Border also calls getVisit() to determine if it's 
showing a simple "Login" link on the left, or if it's showing a full menu 
because they are logged in.

I'm close to wrapping up day 3 trying to get things working! So far the end is 
not in sight.

What I've been able to gather is that I *think* I need to store 
ApplicationStateManager somewhere as a singleton, and then retrieve my visit 
object or store it as needed from there.

I've implemented this method (obviously doesn't work) in hopes that it will 
work someday, I think the idea is correct?

protected AdminVisit getAdminVisit()
  {
   AdminVisit aVisit = (AdminVisit) 
PCTAdminApplicationServlet.asm.get("adminVisit");

   if (aVisit == null){
 aVisit = new AdminVisit();

   PCTAdminApplicationServlet.asm.store("adminVisit", aVisit);
   }
   return aVisit;
  }


Thanks,
Greg

-Original Message-
From: news [mailto:[EMAIL PROTECTED] Behalf Of Ron Piterman
Sent: Thursday, December 14, 2006 2:23 PM
To: users@tapestry.apache.org
Subject: Re: Proper way to get ApplicationStateManager?


Tell us when do you need it and why... *maybe* we can tell you how...
Cheers,
Ron



[EMAIL PROTECTED] wrote:
> Thanks Dennis - I'm not sure I understand how to go about fixing the problem 
if it's null at the times I need it :)
>
> Greg
>
>
>
>>
> Greg,
>
> You can do what you described before, but pull your visit object in your
> SomePage.java classes where you need it.  As Ron pointed out, ASM uses
> other service where WebRequest is required.  When you're using it, it's
> still null.
>
> -Dennis
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


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


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





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



Re: T-Acegi: An AuthenticationManager is required

2006-12-14 Thread James Carman

The tapestry-acegi library works (we use it at work currently and it's
been working flawlessly).  I don't know about the wiki page, but it
appears to be quite well written.  I'm glad someone took the time to
document my work for me. :-)



On 12/14/06, Firas Adiler <[EMAIL PROTECTED]> wrote:

Hello,

Following steps in this thread
http://forum.springframework.org/showthread.php?t=24013 I managed to get
acegi working using JdbcDaoImpl. Now I get an ApplicationRuntimeException as
soon as I call the webapp url. Unfortunatly, I can't rollback the changes
that affected this misbehavior, since I'm not aware of the modification(s)
that caused it.

-
Unable to initialize service tapestry.acegi.BasicProcessingFilter (by
invoking method afterPropertiesSet on
org.acegisecurity.ui.basicauth.BasicProcessingFilter): An
AuthenticationManager is required
[jar:file:/path/to/tapestry-acegi.jar!/META-INF/hivemodule.xml, line 44,
column 25]
...
-

Any ideas for what causing this exception?

Thanks for your time!



P.S. The information on the Wiki

pages is incorrect/outdated




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



Re: Hivemind and EJB access

2006-12-13 Thread James Carman

You would lookup the Home object using JNDI.


On 12/13/06, Cyrille37 <[EMAIL PROTECTED]> wrote:

James Carman a écrit :
> Well, I was answering the question of whether HiveMind's
> EJBProxyFactory supports stateful session beans and it does not (the
> reason is that the create method requires params).  If you want to use
> a stateless session bean, then check EJBProxyFactory's documentation
> on how to set it up in your hivemodule.xml file.  Basically, you use
> EJBProxyFactory rather than BuilderFactory to construct your
> implementation object.
Thanks James, but ...

I understand that I could not use StateFull Bean with Hivemind.
But how to use StateFull Bean from a Tapestry page ?
Is something like this possible :
ApplicationContext.getBean("TheStateFullOne");

I think the Application Server has to create the SateFullBean, but I've
no idea on how it can make the link between the AppServer's session and
Tapestry's session...

I'm a lost a little 

Cyrille.

>
>
> On 12/13/06, Cyrille37 <[EMAIL PROTECTED]> wrote:
>> James Carman a écrit :
>> > No, because typically with SFSBs, you have to pass in a paramter to
>> > the create method and there's no way to set up the proxy to do that
>> > for you automatically.  With SLSBs, there is no parameter to the
>> > create method.
>> Hello James,
>> Thank you for your response, but I'm afraid to do not understand it ;-(
>>
>> Perhaps I have to reformulate my question :
>>
>> When Tapestry runs in an Application Server (Glassfish,JBoss), how to
>> access EJB (Stateless and Statefull) from a Tapestry page ??
>>
>> Cyrille.
>>
>>
>> >
>> >
>> > On 12/13/06, Cyrille37 <[EMAIL PROTECTED]> wrote:
>> >> Hello,
>> >>
>> >> After had some pratices with Tapestry running on Tomcat with and
>> without
>> >> Spring, I'm looking for running Tapestry under an Application Server
>> >> like Glassfish.
>> >> I've read in Hivemind documentation about the EJBProxyFactory that it
>> >> could only delegates to Stateless session bean. Is it true ? Is there
>> >> another fashion for Hivemind to delegate to other kind of EJB
>> >> (Statefull, Message driven) ?
>> >>
>> >> Thanks for your knowledge sharing,
>> >> Cyrillle
>> >>
>> >
>>
>



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





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



Re: Hivemind and EJB access

2006-12-13 Thread James Carman

Well, I was answering the question of whether HiveMind's
EJBProxyFactory supports stateful session beans and it does not (the
reason is that the create method requires params).  If you want to use
a stateless session bean, then check EJBProxyFactory's documentation
on how to set it up in your hivemodule.xml file.  Basically, you use
EJBProxyFactory rather than BuilderFactory to construct your
implementation object.


On 12/13/06, Cyrille37 <[EMAIL PROTECTED]> wrote:

James Carman a écrit :
> No, because typically with SFSBs, you have to pass in a paramter to
> the create method and there's no way to set up the proxy to do that
> for you automatically.  With SLSBs, there is no parameter to the
> create method.
Hello James,
Thank you for your response, but I'm afraid to do not understand it ;-(

Perhaps I have to reformulate my question :

When Tapestry runs in an Application Server (Glassfish,JBoss), how to
access EJB (Stateless and Statefull) from a Tapestry page ??

Cyrille.


>
>
> On 12/13/06, Cyrille37 <[EMAIL PROTECTED]> wrote:
>> Hello,
>>
>> After had some pratices with Tapestry running on Tomcat with and without
>> Spring, I'm looking for running Tapestry under an Application Server
>> like Glassfish.
>> I've read in Hivemind documentation about the EJBProxyFactory that it
>> could only delegates to Stateless session bean. Is it true ? Is there
>> another fashion for Hivemind to delegate to other kind of EJB
>> (Statefull, Message driven) ?
>>
>> Thanks for your knowledge sharing,
>> Cyrillle
>>
>



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





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



Re: Hivemind and EJB access

2006-12-13 Thread James Carman

No, because typically with SFSBs, you have to pass in a paramter to
the create method and there's no way to set up the proxy to do that
for you automatically.  With SLSBs, there is no parameter to the
create method.


On 12/13/06, Cyrille37 <[EMAIL PROTECTED]> wrote:

Hello,

After had some pratices with Tapestry running on Tomcat with and without
Spring, I'm looking for running Tapestry under an Application Server
like Glassfish.
I've read in Hivemind documentation about the EJBProxyFactory that it
could only delegates to Stateless session bean. Is it true ? Is there
another fashion for Hivemind to delegate to other kind of EJB
(Statefull, Message driven) ?

Thanks for your knowledge sharing,
Cyrillle

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




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



Re: @Secured from tapestry-acegi

2006-11-29 Thread James Carman

If you want to use a DAO-based (where you get auth information from a
db or something) authentication manager, you can drop in the
hivemind-acegi-dao.jar file into your classpath.  Then, you have to
provide an implementation for the
hivemind.acegi.dao.UserDetailsService service point:


 
   
 


There are some pre-defined implementations of UserDetailsService, but
to get the idea working you can provide a dummy implementation just to
make sure everything is pieced together correctly.


On 11/29/06, Cyrille37 <[EMAIL PROTECTED]> wrote:

James Carman a écrit :
> Ahh yes.  You do need to tell Acegi how you want to authenticate, so
> you need to have an implementation defined for the
> AuthenticationManager service point I define.
Hello James,

Could you please give me a little example, or write a little howto
somewhere (tapestry's wiki ?).

Thanks
cyrille.
>
>
> On 11/28/06, Cyrille37 <[EMAIL PROTECTED]> wrote:
>> James Carman a écrit :
>> > You don't need spring at all.  You would use your own hivemodule.xml.
>> > I believe you can just drop in the jar and the BASIC HTTP
>> > authentication will work.  There are customization points you can use
>> > (like the name of your "realm" and stuff), but it should work "out of
>> > the box."
>> Hi James,
>>
>> I've remove all stuff about acegi form my project.
>> Just added tapestry-acegi.jar in the Tomcat lib folder.
>>
>> When starting Tomcat, the following exception is throwed. It claims "An
>> AuthenticationManager".
>>
>> ERROR [[Catalina].[localhost].[/Tapestry03].[tapestry03AppServlet]]
>> "Servlet.service()" pour la servlet tapestry03AppServlet a généré une
>> exception
>> org.apache.hivemind.ApplicationRuntimeException: Unable to construct
>> service tapestry.acegi.BasicProcessingFilter: Error building service
>> tapestry.acegi.BasicProcessingFilter: Error at
>> 
jar:file:/D:/tomcat-5.5.17/common/lib/tapestry-acegi-0.1-20060609.153634-9.jar!/META-INF/hivemodule.xml,
>>
>> line 46, column 63: Unable to initialize service
>> tapestry.acegi.BasicProcessingFilter (by invoking method
>> afterPropertiesSet on
>> org.acegisecurity.ui.basicauth.BasicProcessingFilter): An
>> AuthenticationManager is required
>> 
[jar:file:/D:/tomcat-5.5.17/common/lib/tapestry-acegi-0.1-20060609.153634-9.jar!/META-INF/hivemodule.xml,
>>
>> line 44, column 25]
>> at
>> 
org.apache.hivemind.impl.servicemodel.AbstractServiceModelImpl.constructNewServiceImplementation(AbstractServiceModelImpl.java:165)
>>
>> at
>> 
org.apache.hivemind.impl.servicemodel.AbstractServiceModelImpl.constructServiceImplementation(AbstractServiceModelImpl.java:139)
>>
>> at
>> 
org.apache.hivemind.impl.servicemodel.SingletonServiceModel.getActualServiceImplementation(SingletonServiceModel.java:68)
>>
>> at $Filter_10f30d59ebf._service($Filter_10f30d59ebf.java)
>> at $Filter_10f30d59ebf.doFilter($Filter_10f30d59ebf.java)
>> at $Filter_10f30d59ebe.doFilter($Filter_10f30d59ebe.java)
>> at
>> 
com.javaforge.tapestry.acegi.filter.ServletRequestServicerFilterAdapter.service(ServletRequestServicerFilterAdapter.java:42)
>>
>> at
>> 
$ServletRequestServicer_10f30d59ec8.service($ServletRequestServicer_10f30d59ec8.java)
>>
>> at
>> 
org.apache.tapestry.multipart.MultipartDecoderFilter.service(MultipartDecoderFilter.java:52)
>>
>> at
>> 
$ServletRequestServicerFilter_10f30d59eb7.service($ServletRequestServicerFilter_10f30d59eb7.java)
>>
>> at
>> 
$ServletRequestServicerFilter_10f30d59eb6.service($ServletRequestServicerFilter_10f30d59eb6.java)
>>
>> at
>> 
$ServletRequestServicer_10f30d59ec8.service($ServletRequestServicer_10f30d59ec8.java)
>>
>> at
>> 
org.apache.tapestry.services.impl.SetupRequestEncoding.service(SetupRequestEncoding.java:53)
>>
>> at
>> 
$ServletRequestServicerFilter_10f30d59ec5.service($ServletRequestServicerFilter_10f30d59ec5.java)
>>
>> at
>> 
$ServletRequestServicerFilter_10f30d59ec4.service($ServletRequestServicerFilter_10f30d59ec4.java)
>>
>> at
>> 
$ServletRequestServicer_10f30d59ec8.service($ServletRequestServicer_10f30d59ec8.java)
>>
>> at
>> 
com.javaforge.tapestry.acegi.filter.FilterChainAdapter.doFilter(FilterChainAdapter.java:43)
>>
>> >
>> >
>> > On 11/28/06, Cyrille37 <[EMAIL PROTECTED]> wrote:
>> >> James Carman a écrit :
>> >> > The @Secured annotation is from the Acegi library (you have to
>&g

Re: @Secured from tapestry-acegi

2006-11-28 Thread James Carman

Ahh yes.  You do need to tell Acegi how you want to authenticate, so
you need to have an implementation defined for the
AuthenticationManager service point I define.


On 11/28/06, Cyrille37 <[EMAIL PROTECTED]> wrote:

James Carman a écrit :
> You don't need spring at all.  You would use your own hivemodule.xml.
> I believe you can just drop in the jar and the BASIC HTTP
> authentication will work.  There are customization points you can use
> (like the name of your "realm" and stuff), but it should work "out of
> the box."
Hi James,

I've remove all stuff about acegi form my project.
Just added tapestry-acegi.jar in the Tomcat lib folder.

When starting Tomcat, the following exception is throwed. It claims "An
AuthenticationManager".

ERROR [[Catalina].[localhost].[/Tapestry03].[tapestry03AppServlet]]
"Servlet.service()" pour la servlet tapestry03AppServlet a généré une
exception
org.apache.hivemind.ApplicationRuntimeException: Unable to construct
service tapestry.acegi.BasicProcessingFilter: Error building service
tapestry.acegi.BasicProcessingFilter: Error at
jar:file:/D:/tomcat-5.5.17/common/lib/tapestry-acegi-0.1-20060609.153634-9.jar!/META-INF/hivemodule.xml,
line 46, column 63: Unable to initialize service
tapestry.acegi.BasicProcessingFilter (by invoking method
afterPropertiesSet on
org.acegisecurity.ui.basicauth.BasicProcessingFilter): An
AuthenticationManager is required
[jar:file:/D:/tomcat-5.5.17/common/lib/tapestry-acegi-0.1-20060609.153634-9.jar!/META-INF/hivemodule.xml,
line 44, column 25]
at
org.apache.hivemind.impl.servicemodel.AbstractServiceModelImpl.constructNewServiceImplementation(AbstractServiceModelImpl.java:165)
at
org.apache.hivemind.impl.servicemodel.AbstractServiceModelImpl.constructServiceImplementation(AbstractServiceModelImpl.java:139)
at
org.apache.hivemind.impl.servicemodel.SingletonServiceModel.getActualServiceImplementation(SingletonServiceModel.java:68)
at $Filter_10f30d59ebf._service($Filter_10f30d59ebf.java)
at $Filter_10f30d59ebf.doFilter($Filter_10f30d59ebf.java)
at $Filter_10f30d59ebe.doFilter($Filter_10f30d59ebe.java)
at
com.javaforge.tapestry.acegi.filter.ServletRequestServicerFilterAdapter.service(ServletRequestServicerFilterAdapter.java:42)
at
$ServletRequestServicer_10f30d59ec8.service($ServletRequestServicer_10f30d59ec8.java)
at
org.apache.tapestry.multipart.MultipartDecoderFilter.service(MultipartDecoderFilter.java:52)
at
$ServletRequestServicerFilter_10f30d59eb7.service($ServletRequestServicerFilter_10f30d59eb7.java)
at
$ServletRequestServicerFilter_10f30d59eb6.service($ServletRequestServicerFilter_10f30d59eb6.java)
at
$ServletRequestServicer_10f30d59ec8.service($ServletRequestServicer_10f30d59ec8.java)
at
org.apache.tapestry.services.impl.SetupRequestEncoding.service(SetupRequestEncoding.java:53)
at
$ServletRequestServicerFilter_10f30d59ec5.service($ServletRequestServicerFilter_10f30d59ec5.java)
at
$ServletRequestServicerFilter_10f30d59ec4.service($ServletRequestServicerFilter_10f30d59ec4.java)
at
$ServletRequestServicer_10f30d59ec8.service($ServletRequestServicer_10f30d59ec8.java)
at
com.javaforge.tapestry.acegi.filter.FilterChainAdapter.doFilter(FilterChainAdapter.java:43)
>
>
> On 11/28/06, Cyrille37 <[EMAIL PROTECTED]> wrote:
>> James Carman a écrit :
>> > The @Secured annotation is from the Acegi library (you have to get the
>> > "tiger" jar).
>> Thanks a lot. I'm a beginner ...
>>
>> Are directives in the hivemodule.xml from tapestry-acegi.jar are
>> sufficients, or we need to put some more directives in web.xml or spring
>> 's applicationContext-security.xml ?
>>
>> Cyrille
>> >
>> > On 11/28/06, Cyrille37 <[EMAIL PROTECTED]> wrote:
>> >> Hello,
>> >>
>> >> I'm trying to integrate Acegi by using tapestry-acegi from
>> >> carmanconsulting.com.
>> >>
>> >> I've imported com.javaforge.tapestry.acegi.enhance.* but Java do not
>> >> recognize the @Secured decoration.
>> >>
>> >> import com.javaforge.tapestry.acegi.*;
>> >> import com.javaforge.tapestry.acegi.enhance.*;
>> >> @Secured("ROLE_USER")
>> >> public abstract class UserForm extends BasePage implements
>> >> PageBeginRenderListener
>> >> {
>> >> ...
>> >>
>> >> Have you got an idea ?
>> >> Thanks
>> >> cyrille
>>



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





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



Re: @Secured from tapestry-acegi

2006-11-28 Thread James Carman

You don't need spring at all.  You would use your own hivemodule.xml.
I believe you can just drop in the jar and the BASIC HTTP
authentication will work.  There are customization points you can use
(like the name of your "realm" and stuff), but it should work "out of
the box."


On 11/28/06, Cyrille37 <[EMAIL PROTECTED]> wrote:

James Carman a écrit :
> The @Secured annotation is from the Acegi library (you have to get the
> "tiger" jar).
Thanks a lot. I'm a beginner ...

Are directives in the hivemodule.xml from tapestry-acegi.jar are
sufficients, or we need to put some more directives in web.xml or spring
's applicationContext-security.xml ?

Cyrille
>
> On 11/28/06, Cyrille37 <[EMAIL PROTECTED]> wrote:
>> Hello,
>>
>> I'm trying to integrate Acegi by using tapestry-acegi from
>> carmanconsulting.com.
>>
>> I've imported com.javaforge.tapestry.acegi.enhance.* but Java do not
>> recognize the @Secured decoration.
>>
>> import com.javaforge.tapestry.acegi.*;
>> import com.javaforge.tapestry.acegi.enhance.*;
>> @Secured("ROLE_USER")
>> public abstract class UserForm extends BasePage implements
>> PageBeginRenderListener
>> {
>> ...
>>
>> Have you got an idea ?
>> Thanks
>> cyrille



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





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



Re: @Secured from tapestry-acegi

2006-11-28 Thread James Carman

The @Secured annotation is from the Acegi library (you have to get the
"tiger" jar).

On 11/28/06, Cyrille37 <[EMAIL PROTECTED]> wrote:

Hello,

I'm trying to integrate Acegi by using tapestry-acegi from
carmanconsulting.com.

I've imported com.javaforge.tapestry.acegi.enhance.* but Java do not
recognize the @Secured decoration.

import com.javaforge.tapestry.acegi.*;
import com.javaforge.tapestry.acegi.enhance.*;
@Secured("ROLE_USER")
public abstract class UserForm extends BasePage implements
PageBeginRenderListener
{
...

Have you got an idea ?
Thanks
cyrille


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




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



Re: binary for tapestry-spring

2006-11-22 Thread James Carman

Use anonymous/anon.


On 11/22/06, Cyrille37 <[EMAIL PROTECTED]> wrote:

Hello,
It is always the little newbie...

Where can I found a binary version (.jar) of tapestry-spring ?
I have tried to checkout from
http://svn.javaforge.com/svn/tapestry/tapestry-spring/trunk but the
server ask for username and password...

Thanks
cyrille

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




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



Re: Tapernate Access multiple database

2006-11-21 Thread James Carman

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 <[EMAIL PROTECTED]> wrote:

On 11/16/06, Henry Chen <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




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



Re: How to share hivemind registry between HiveMindFilter an ApplicationServlet?

2006-11-16 Thread James Carman

They didn't use our filter because they load a whole bunch of
different hivemodule files from non-standard locations.

On 11/16/06, Jean-Francois Poilpret <[EMAIL PROTECTED]> wrote:

Hi Nick,

Although I don't know much about Tapestry way to create the Registry and
give access to it, what you might possibly do with hiveremoting.caucho is to
subclass net.sourceforge.hiveremoting.caucho. CauchoRemotingServlet and
override its getRegistry method to whatever is suitable with Tapestry.

As far as I understand, it seems that in Tapestry, the Registry is created
by the servlet (ApplicationServlet), what would be interesting to find out
is when it is created (is it at init, or at first request?). If at init,
then find a way to access the Registry in a static way (if available), you
might also need to subclass Tapestry's ApplicationServlet to make its
Registry accessible.

But you are right: it looks strange that tapestry 4 does not use "HiveMind's
way" to create the Registry, ie through the HiveMindFilter.

Hope this helps

Jean-Francois


-Original Message-
From: Nick Evgeniev [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 14, 2006 6:38 PM
To: users@tapestry.apache.org
Subject: How to share hivemind registry between HiveMindFilter an
ApplicationServlet?


Hi,

I've found recently that very simple usecase for hivemind + tapestry is
lacking of any docs. Here it goes
1. I have tapestry application rooted by ApplicationServlet
2. In the same web application I want my services to be accessed via remote
api. Hence I've downloaded hivetranse (hiveremoting package) + hessian as
adhoc solution.

The problem is that hiveremoting depends on HiveMindeFilter to create
hivemind registry while tapestry (for nonundestandable reason) does things
by their own. Hence I'm having two copy of registries containig duplicate
instances of all of my services.

Is there any way to share the registry? I've read in the docs that tapestry4
has perfect integration with hivemind (compared to tapestry3), but
unfortunatelly documentation does not go beyond this statement. :(

It would be really strange if this is impossible, as tapestry is able to
share spring registry whith no effort at all..

--
View this message in context:
http://www.nabble.com/How-to-share-hivemind-registry-between-HiveMindFilter-
an-ApplicationServlet--tf2628912.html#a7335935
Sent from the Tapestry - User mailing list archive at Nabble.com.


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







___
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions !
Profitez des connaissances, des opinions et des expériences des internautes sur 
Yahoo! Questions/Réponses
http://fr.answers.yahoo.com

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




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



Re: Re: tapestry-acegi questions

2006-11-14 Thread James Carman

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 <[EMAIL PROTECTED]> wrote:

On 11/12/06, Robin Ericsson <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




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



Re: object injection and class cast

2006-11-11 Thread James Carman

The object you get is actually a proxy to the actual service
implementation.  The dynamic proxy only knows that it needs to support
the javax.servlet.Filter interface, so that's all it supports.  You
can't downcast it to the implementation class.  What you can do is
come up with your own service interface which extends
javax.servlet.Filter and your implementation class can implement that.
You'd have to use that interface to "talk to" your service object.

p.s. Alternatively, there is such a thing as bean services (the
service interface is the bean class), but I don't suggest using them.
It's better to front your services with an interface (which is what we
have to fabricate at runtime via Javassist to support bean services).


On 11/11/06, Robin Ericsson <[EMAIL PROTECTED]> wrote:

Hi,

This is really a hivemind question, but it's my tapestry usage that
probably is wrong :)

My service looks like this:










I inject it in tapestry like this:
@InjectObject("service:bwatch.FormProcessingFilter")
public abstract Filter getProcessingFilter();

But when I cast it to my class which I know it is, I get a ClassCastException.
FormProcessingFilter filter = (FormProcessingFilter) getProcessingFilter();

What am I doing wrong and how should I solve it? :)

--
regards,
Robin

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




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



Re: tapestry-acegi questions

2006-11-10 Thread James Carman

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 <[EMAIL PROTECTED]> wrote:

On 11/3/06, James Carman <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




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



Re: Stale Sessions

2006-11-07 Thread James Carman

You can use an InfrastructureOverride for that:


 


On 11/7/06, Peter Stavrinides <[EMAIL PROTECTED]> wrote:

As far as I can tell from googling a bit it no longer works like that. I
think you need to implement some sort of Infrastructure override service
in the hivemodule.xml

Regards,
Peter

Lennart Benoot wrote:
> In the old days, it happed like this:
>
> Define in your *.application:
>
>  specification-path="tapestry/page/StaleSession.page"/>
>
>
> Not sure however wether this has changed in de newer versions of
> tapestry.
>
> There is one issue I still have: It works with a directlink, but
> apparently
> not with a page link.
>
> Regards,
> Lennart
>
>
> 2006/11/7, Peter Stavrinides <[EMAIL PROTECTED]>:
>>
>> Hi,
>>
>> I want to create a custom page to handle stale sessions, can anyone
>> point me to some documentation on how do this.
>>
>> Thanks
>> Peter
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>
>
>

--
Peter Stavrinides
Albourne Partners (Cyprus) Ltd
Tel: +357 22 750652

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.



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




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



Re: Question regarding Block/RenderBlock

2006-11-07 Thread James Carman

You can create a page that has a bunch of @Blocks in it and you can
use those blocks in other pages.  We do that in Trails and it works
quite nicely.  Check out the org.apache.tapestry.util.ComponentAddress
class.  It allows you to "look up" components on other pages.  So, you
can use it this way...

public Block getReusableBlockFromAnotherPage()
{
 ComponentAddress addr = new ComponentAddress(
"MyReusableBlocksPage", "myReusableBlock" );
 return ( Block )addr.findComponent(getRequestCycle());
}

In your page, you'd do this:



This is off the top of my head, so the syntax might not be exactly
correct, but you get the general idea I hope.  Hope that helps!

On 11/6/06, Karthik N <[EMAIL PROTECTED]> wrote:

Hello,

"RenderBlock does not mandate that the Block being rendered be contained
within the page being rendered"

I have seen this statement at so many places - but I am looking for an
example/explanation of how to do it.

Any pointers?

Thanks, Karthik




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



Re: Need help getting started

2006-11-06 Thread James Carman

It may not be solved yet, but we should really look into it.  I can't
remember off the top of my head what the "official" minimum JDK
requirement is for HM.  We may have just said that it requires 1.4.

On 11/6/06, Brooks, Aiyana [CIB-IT] <[EMAIL PROTECTED]> wrote:

The issue this user reported is exactly the same as the one I am facing.
I guess WSAD is only using 1.4 for the JRE but still using the 1.3 JDK.
I didn't see a thread indicating how the HiveMind JDK 1.3 issue was
resolved.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of James
Carman
Sent: Monday, November 06, 2006 1:22 PM
To: Tapestry users
Subject: Re: Need help getting started

That issue just says HM isn't JDK1.3 compliant.  But, if you're not
running a 1.3 JDK, then all should be okay.



On 11/6/06, Brooks, Aiyana [CIB-IT] <[EMAIL PROTECTED]> wrote:
> I am using WSAD v5.1.1 with the following configurations:
>
> java version "1.4.2_05"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04)
> Java HotSpot(TM) Client VM (build 1.4.2_05-b04, mixed mode)
>
> In a separate project I was able to run
>
> StringBuffer a = new StringBuffer("1");
> StringBuffer b = new StringBuffer("2");
> a.append( b );
> So the problem seems to be something related to Tapestry not WSAD.
>
> The following link indicates that the problem may be something related

> to HiveMind.
>
> http://mail-archives.apache.org/mod_mbox/jakarta-hivemind-dev/200512.m
> bo x/[EMAIL PROTECTED]
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of
> James Carman
> Sent: Monday, November 06, 2006 11:51 AM
> To: Tapestry users
> Subject: Re: Need help getting started
>
> What version of WSAD?  There's an "Interim Fix 008 for WebSphere
> Application Developer v5.1.2" that has something in the release notes
> about "This fixes a problem where the
> StringBuffer.append(StringBuffer) method is not found on JDK 1.3."
>
> On 11/6/06, Brooks, Aiyana [CIB-IT] <[EMAIL PROTECTED]>
wrote:
> > I am using WebSphere v5.1.1.
> > I have the JDK Compiler compliance level set to 1.4.
> >
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of
> > James Carman
> > Sent: Monday, November 06, 2006 10:52 AM
> > To: Tapestry users
> > Subject: Re: Need help getting started
> >
> > I would double check that JDK version again.  Tapestry can't cause
> > there not to be a method in StringBuffer.
> >
> > On 11/6/06, Brooks, Aiyana [CIB-IT] <[EMAIL PROTECTED]>
> wrote:
> > > Tapestry v. 4
> > >
> > > -Original Message-
> > > From: Andreas Andreou [mailto:[EMAIL PROTECTED]
> > > Sent: Monday, November 06, 2006 11:32 AM
> > > To: Tapestry users
> > > Subject: Re: Need help getting started
> > >
> > > Which version of Tapestry?
> > >
> > > Brooks, Aiyana [CIB-IT] wrote:
> > > > Thanks Andy. The app server uses jdk 1.4. Also I am able to
> > > > reference StringBuffer from other projects so I know it is
> > > > available
> >
> > > > in the libraries referenced by my workbench. The problem only
> > > > arrises when I try to use tapestry.
> > > >
> > > > -Original Message-
> > > > From: andyhot [mailto:[EMAIL PROTECTED]
> > > > Sent: Saturday, November 04, 2006 6:13 AM
> > > > To: Tapestry users
> > > > Subject: Re: Need help getting started
> > > >
> > > > Brooks, Aiyana [CIB-IT] wrote:
> > > >
> > > >> Hi,
> > > >>
> > > >> I am new to Tapestry and am having some trouble getting the
> > > >> basic
>
> > > >> (nothing dynamic) "Hello World" application to run. Whenever I
> > > >> run the
> > > >>
> > > >
> > > >
> > > >> application I get the following error:
> > > >>
> > > >> Unable to process client request: Failure enhancing class
> > > >> org.apache.tapestry.html.BasePage: java.lang.StringBuffer:
> > > >> method
>
> > > >> append(Ljava/lang/StringBuffer;)Ljava/lang/StringBuffer; not
> > > >> found
> > > >>
> > > >>
> > > >
> > > >
> > > > Check the app-servers configured jdk...
> > > > The method missing was intr

Re: Need help getting started

2006-11-06 Thread James Carman

That issue just says HM isn't JDK1.3 compliant.  But, if you're not
running a 1.3 JDK, then all should be okay.



On 11/6/06, Brooks, Aiyana [CIB-IT] <[EMAIL PROTECTED]> wrote:

I am using WSAD v5.1.1 with the following configurations:

java version "1.4.2_05"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04)
Java HotSpot(TM) Client VM (build 1.4.2_05-b04, mixed mode)

In a separate project I was able to run

StringBuffer a = new StringBuffer("1");
StringBuffer b = new StringBuffer("2");
a.append( b );
So the problem seems to be something related to Tapestry not WSAD.

The following link indicates that the problem may be something related
to HiveMind.

http://mail-archives.apache.org/mod_mbox/jakarta-hivemind-dev/200512.mbo
x/[EMAIL PROTECTED]

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of James
Carman
Sent: Monday, November 06, 2006 11:51 AM
To: Tapestry users
Subject: Re: Need help getting started

What version of WSAD?  There's an "Interim Fix 008 for WebSphere
Application Developer v5.1.2" that has something in the release notes
about "This fixes a problem where the
StringBuffer.append(StringBuffer) method is not found on JDK 1.3."

On 11/6/06, Brooks, Aiyana [CIB-IT] <[EMAIL PROTECTED]> wrote:
> I am using WebSphere v5.1.1.
> I have the JDK Compiler compliance level set to 1.4.
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of
> James Carman
> Sent: Monday, November 06, 2006 10:52 AM
> To: Tapestry users
> Subject: Re: Need help getting started
>
> I would double check that JDK version again.  Tapestry can't cause
> there not to be a method in StringBuffer.
>
> On 11/6/06, Brooks, Aiyana [CIB-IT] <[EMAIL PROTECTED]>
wrote:
> > Tapestry v. 4
> >
> > -Original Message-
> > From: Andreas Andreou [mailto:[EMAIL PROTECTED]
> > Sent: Monday, November 06, 2006 11:32 AM
> > To: Tapestry users
> > Subject: Re: Need help getting started
> >
> > Which version of Tapestry?
> >
> > Brooks, Aiyana [CIB-IT] wrote:
> > > Thanks Andy. The app server uses jdk 1.4. Also I am able to
> > > reference StringBuffer from other projects so I know it is
> > > available
>
> > > in the libraries referenced by my workbench. The problem only
> > > arrises when I try to use tapestry.
> > >
> > > -Original Message-
> > > From: andyhot [mailto:[EMAIL PROTECTED]
> > > Sent: Saturday, November 04, 2006 6:13 AM
> > > To: Tapestry users
> > > Subject: Re: Need help getting started
> > >
> > > Brooks, Aiyana [CIB-IT] wrote:
> > >
> > >> Hi,
> > >>
> > >> I am new to Tapestry and am having some trouble getting the basic

> > >> (nothing dynamic) "Hello World" application to run. Whenever I
> > >> run the
> > >>
> > >
> > >
> > >> application I get the following error:
> > >>
> > >> Unable to process client request: Failure enhancing class
> > >> org.apache.tapestry.html.BasePage: java.lang.StringBuffer: method

> > >> append(Ljava/lang/StringBuffer;)Ljava/lang/StringBuffer; not
> > >> found
> > >>
> > >>
> > >
> > >
> > > Check the app-servers configured jdk...
> > > The method missing was introduced in jdk 1.4
> > >
> > >
> > >> I am using WSAD 5.1 and I have the latest jdk and Tapestry
> > >> versions
>
> > >> installed. Is there a configuration file that I might be missing?
> > >> Can
> >
> > >> anyone suggest how to fix this error? Below are the main files
> > >> created
> > >>
> > >
> > >
> > >> for this application.
> > >>
> > >> Thanks and regards,
> > >>
> > >> ==
> > >> web.xml
> > >> ==
> > >>
> > >>   > >> "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
> > >> "http://java.sun.com/dtd/web-app_2_3.dtd";>
> > >> 
> > >>  HelloWorld
> > >>  
> > >>  HelloWorld
> > >>  ApplicationServlet
> > >>
> > >>
> org.apache.tapestry.ApplicationServlet
> > >>  1
> > >>  
> > >>  
> > >>  HelloWorld
> > >>  /app
&

  1   2   3   4   5   >