Re: Default locale does not work form validation messages !?

2011-08-27 Thread Denis McCarthy
Quite possibly - add sv_SE to tapestry.supported-locales as well - we
support a number of national language variants on our site and adding them
to tapestry.supported-locales works as expected.
Denis

On Sat, Aug 27, 2011 at 10:53 AM, Gunnar Eketrapp  wrote:

> Hum .. I just saw that th swedish property files in tapestry are named **
> _sv_SE*.properties
>
> Can this be the reason that my "sv" locale does not find them ...
>
> 2011/8/27 Gunnar Eketrapp 
>
> > Hi!
> >
> > I have a question related to localization in general and validation
> > messages specifially.
> >
> > My site is swedish only . i.e.
> >
> > configuration.add(SymbolConstants.SUPPORTED_LOCALES, "sv");
> >
> > Localization works fine for pages and components where my swedish
> property
> > files are selected by T5.
> >
> > But form validation messages are in english even if I can see that T5.2.5
> > includes swedish versions.
> >
> > What am I missing ?
> >
> > Thanks in advance!
> > Gunnar Eketrapp
> >
> >
>
>
> --
> [Hem: 08-715 59 57, Mobil: 070-991 86 42]
> Allévägen 2A, 132 42 Saltsjö-Boo
>


Re: Dynamically setting tabindex for input elements in a component

2010-10-02 Thread Denis McCarthy
Perfect, thanks

On Mon, Sep 27, 2010 at 6:44 PM, Thiago H. de Paula Figueiredo <
thiag...@gmail.com> wrote:

> On Mon, 27 Sep 2010 14:09:18 -0300, Denis McCarthy <
> dmccar...@annadaletech.com> wrote:
>
>   > t:label="message:COUNTRY" tabindex="${tabIndexStart + 1}" />
>>
>
> t:label="message:COUNTRY" tabindex="${getTabIndex(1)}" />
>
> public int getTabIndex() {
>
> }
>
>
> public int getTabIndex(int skip) {
>getTabIndex() + skip;
> }
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
> and instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> http://www.arsmachina.com.br
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


-- 
Annadale Technologies Limited


Dynamically setting tabindex for input elements in a component

2010-09-27 Thread Denis McCarthy
Hi I have a pretty large component that needs to appear in one of two places
in a large form, depending on who's using the form. The dynamic placement I
can do pretty easily using delegates. However, I'm struggling with the
tabindex of the various input elements in the component. I want them to vary
(depending on where the component is actually rendered) so the user can
seamlessly tab through this large form, regardless of where this particular
component is rendered.

Now, a naive implementation would be to simply have a server side method per
tabindex, like
 

This will work. However, I have 70+ input elements in this form, and adding
70+ getters like this hurts my brain. Is there some nicer way to do this? I
don't think having a single getter with side effects is going to work either
(like this:

getNextComponentTab() {
nextTab ++;
return Integer.parseInt(nextTab);
}


Because the getter is called a couple of times during page render, so I'd
end up missing numbers in the tab index order - this itself doesn't break
the tabbing of course, but it causes an overlap with subsequent elements in
following components. If there was some way I could do the arithmetic in the
tag itself, e.g.

 

Then I'd settle for that, but that isn't possible I don't think.

Any ideas greatly appreciated.
Denis


Re: contributeClasspathAssetAliasManager not contributing

2008-10-28 Thread Denis McCarthy
Figured out my problem here - the leading forward slash before the com
package on the line
configuration.add("my.js.path", "/com/myco/myapp");
was tripping me up.

On Fri, Oct 24, 2008 at 5:24 PM, Denis McCarthy
<[EMAIL PROTECTED]> wrote:
> Oops. just sent this but managed to bork the subject line! Sorry...
> Hi,
> I'm trying to implement version-specific paths for my javascript files
> (so I can have the expires header for these files in the far future).
> Looking at Tapestry's code, the appropriate way to do this is to use
> the contributeClasspathAssetAliasManager method in AppModule to give a
> version-specific alias for the javascript file in question (as long as
> the file is on the classpath, which ours is). Unfortunately for the
> life of me I can't get this to work. The code seems fairly simple: In
> AppModule.java:
>
>   public static void
> contributeFactoryDefaults(MappedConfiguration
> configuration) {
>   configuration.add("my.version", "1.0.3");
>   configuration.add("my.js", "classpath:${my.js.path}");
>   configuration.add("my.js.path", "/com/myco/myapp");
>   }
>
>
>   public static void
> contributeClasspathAssetAliasManager(MappedConfiguration String> configuration,
>
> @Symbol("my.version") String myJsVersion,
>
> @Symbol("my.js.path") String myJsPath) {
>   configuration.add(myJsVersion + "/myjs", myJsPath);
>   }
>
> Then in my DefaultLayout class, I have
> @IncludeJavaScriptLibrary("${my.js}/javascripts.js")
>
> Now, in my case, when this is rendered the javascript path is the
> assets/com/myco/myapp/javascripts.js, with not a version in sight in
> the path. I must be missing something simple here, although I've gone
> through the TapestryModule code from tapestry svn and I nothing jumps
> out at me. Any pointers would be greatly appreciated.
> Thanks
> Denis
>



-- 
Annadale Technologies Limited

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



contributeClasspathAssetAliasManager not contributing

2008-10-24 Thread Denis McCarthy
Oops. just sent this but managed to bork the subject line! Sorry...
Hi,
I'm trying to implement version-specific paths for my javascript files
(so I can have the expires header for these files in the far future).
Looking at Tapestry's code, the appropriate way to do this is to use
the contributeClasspathAssetAliasManager method in AppModule to give a
version-specific alias for the javascript file in question (as long as
the file is on the classpath, which ours is). Unfortunately for the
life of me I can't get this to work. The code seems fairly simple: In
AppModule.java:

   public static void
contributeFactoryDefaults(MappedConfiguration
configuration) {
   configuration.add("my.version", "1.0.3");
   configuration.add("my.js", "classpath:${my.js.path}");
   configuration.add("my.js.path", "/com/myco/myapp");
   }


   public static void
contributeClasspathAssetAliasManager(MappedConfiguration configuration,

@Symbol("my.version") String myJsVersion,

@Symbol("my.js.path") String myJsPath) {
   configuration.add(myJsVersion + "/myjs", myJsPath);
   }

Then in my DefaultLayout class, I have
@IncludeJavaScriptLibrary("${my.js}/javascripts.js")

Now, in my case, when this is rendered the javascript path is the
assets/com/myco/myapp/javascripts.js, with not a version in sight in
the path. I must be missing something simple here, although I've gone
through the TapestryModule code from tapestry svn and I nothing jumps
out at me. Any pointers would be greatly appreciated.
Thanks
Denis

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



On Fri, Oct 24, 2008 at 6:01 PM, Howard Lewis Ship wrote: > BTW, > > I'm actively working on the issue with URL encoding/decoding. Because > of the differences between Jetty and Tom

2008-10-24 Thread Denis McCarthy
Hi,
I'm trying to implement version-specific paths for my javascript files
(so I can have the expires header for these files in the far future).
Looking at Tapestry's code, the appropriate way to do this is to use
the contributeClasspathAssetAliasManager method in AppModule to give a
version-specific alias for the javascript file in question (as long as
the file is on the classpath, which ours is). Unfortunately for the
life of me I can't get this to work. The code seems fairly simple: In
AppModule.java:

public static void
contributeFactoryDefaults(MappedConfiguration
configuration) {
configuration.add("my.version", "1.0.3");
configuration.add("my.js", "classpath:${my.js.path}");
configuration.add("my.js.path", "/com/myco/myapp");
}


public static void
contributeClasspathAssetAliasManager(MappedConfiguration configuration,

@Symbol("my.version") String myJsVersion,

@Symbol("my.js.path") String myJsPath) {
configuration.add(myJsVersion + "/myjs", myJsPath);
}

Then in my DefaultLayout class, I have
@IncludeJavaScriptLibrary("${my.js}/javascripts.js")

Now, in my case, when this is rendered the javascript path is the
assets/com/myco/myapp/javascripts.js, with not a version in sight in
the path. I must be missing something simple here, although I've gone
through the TapestryModule code from tapestry svn and I nothing jumps
out at me. Any pointers would be greatly appreciated.
Thanks
Denis

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



Re: Creating new components on the fly in T5 using AJAX/JSON

2008-07-01 Thread Denis McCarthy
Thanks for that - we'll hopefully get a chance to do a bit of experimentation
on this over the next few days.

2008/7/1 Brian Lough <[EMAIL PROTECTED]>:
> You can.  Adding a contributer to BeanBlockSource for a given property will
> allow you to "check" if it should be displayed, and if so, generate the html
> markup to display or present the input for the given property.  IMHO, since
> most [other] framework coders just "hide" whatever property they don't want
> to change, or visa-versa, it's easier to go with the  [exclude
> what you don't want].
>
> Again, depending upon whether it's input you desire to "skip" or output,
> check out the source for Property[Edit|Display]Blocks.[java|tml].  It will
> show you how to work the markup writer that actually creates the htnl code.
> See the TapestryModule source to determine how to contribute your own
> special types based upon what you've defined via the
> Property[...]Blocks.[java|tml].
>
> The pattern expansion is basically this, for "display using
> '@DataType("hours")'", for example:
>
> AppModule.java
>  public static void
> contributeBeanBlockSource(Configuration
> configuration) { configuration.add(new
> BeanBlockContribution("hours", "ApplicationDisplayBlocks", "hours", false));
>   }
>
> *.pages.ApplicationDisplayBlocks.tml
>  xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>
>
>   
>   
>   
>
> 
>
> *.pages.ApplicationDisplayBlocks.java
>   public String getHoursFormat() {
>   Double hours = (Double) context.getPropertyValue();
>   if (null == hours || hours.isNaN()) {
>   return "";
>   }
>   return String.format("%03.2f", hours);
>   }
>
> The key items are the
>   configuration.add(new BeanBlockContribution("hours",
> "ApplicationDisplayBlocks", "hours", false));
> which adds to the new contribution to the chain for datatype "hours" using
> "hours" block id"
>   
> which provides the "hours" block id.
>
> This works for "input" as well, only the "marker" object would be used to
> generate the specific html.  Again, see the PropertyEditBlocks.[java|tml]
> for examples.
>
>
> Denis McCarthy wrote:
>>
>> Hi,
>> I'm working on a somewhat complex page at the moment. This page
>> consists of several input boxes that users
>> fill in. I've got various onblur AJAX mixins that fire on this page
>> when fields are filled in by a user. Currently, based
>> on the values that users put into these text boxes, other text boxes
>> and drop down select lists are either shown
>> or hidden (this is done by passing simple JSON back to the page in the
>> AJAX response to these blur events)
>>
>> Ideally, I'd like not to have these optional fields just hidden, but
>> instead for the optional field to be entirely absent
>> from the html markup when it's not needed, and only present when data
>> entered by the user in a different field
>> mandates it. Is this possible in T5? I don't think it is (because I
>> think that a field needs to be present in the tml
>> at page load time for the component in question to be bound to the T5
>> page class), but it would be great if
>> it was, as it would make the page considerably lighter size wise for
>> most of my users.
>> Thanks
>> Denis
>>
>> -
>> 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]



Creating new components on the fly in T5 using AJAX/JSON

2008-06-30 Thread Denis McCarthy
Hi,
I'm working on a somewhat complex page at the moment. This page
consists of several input boxes that users
fill in. I've got various onblur AJAX mixins that fire on this page
when fields are filled in by a user. Currently, based
on the values that users put into these text boxes, other text boxes
and drop down select lists are either shown
or hidden (this is done by passing simple JSON back to the page in the
AJAX response to these blur events)

Ideally, I'd like not to have these optional fields just hidden, but
instead for the optional field to be entirely absent
from the html markup when it's not needed, and only present when data
entered by the user in a different field
mandates it. Is this possible in T5? I don't think it is (because I
think that a field needs to be present in the tml
at page load time for the component in question to be bound to the T5
page class), but it would be great if
it was, as it would make the page considerably lighter size wise for
most of my users.
Thanks
Denis

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



Re: Turn off client side validation

2008-06-10 Thread Denis McCarthy
Never mind - just spotted the clientValidation boolean parameter on the Form
Component.
Thanks anyway

2008/6/10 Denis McCarthy <[EMAIL PROTECTED]>:
> Hi,
> I have a form where I don't want client side validation to fire. I
> see from the docs that it is possible to turn off client side validation
> on a form, but I can't seem to see an example for how to do this.
> Could someone tell me how to define a form on which client side
> validation is disabled?
> Thanks
> Denis
>

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



Turn off client side validation

2008-06-10 Thread Denis McCarthy
Hi,
I have a form where I don't want client side validation to fire. I
see from the docs that it is possible to turn off client side validation
on a form, but I can't seem to see an example for how to do this.
Could someone tell me how to define a form on which client side
validation is disabled?
Thanks
Denis

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



Re: T5: Using ajax to get a value for a form prior to its submission

2008-03-20 Thread Denis McCarthy
Not to worry,
I've managed to modify the autocomplete code from
tapestry-core, as well as altering the javascript in the scriptaculous
control.js file to writer a custom ajax mixin for myself.
Cheers
Denis

On 20/03/2008, Denis McCarthy <[EMAIL PROTECTED]> wrote:
> Hi,
>  I've a form that has several values for submission. One of these values
>  (a foreign currency amount) is dependent on the value input by the customer
>  in a different input box (the base currency amount). I'd like if possible to
>  use AJAX to populate the foreign amount, after the base amount field
>  has been filled in. I'd like to submit these values also, so the
>  fields in question must be in a form. Is this currently possible in
>  T5, or do I need to wait for further AJAX developments? If it is
>  possible I'd really appreciate an example.
>  Cheers
>
> Denis
>

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



T5: Using ajax to get a value for a form prior to its submission

2008-03-20 Thread Denis McCarthy
Hi,
I've a form that has several values for submission. One of these values
(a foreign currency amount) is dependent on the value input by the customer
in a different input box (the base currency amount). I'd like if possible to
use AJAX to populate the foreign amount, after the base amount field
has been filled in. I'd like to submit these values also, so the
fields in question must be in a form. Is this currently possible in
T5, or do I need to wait for further AJAX developments? If it is
possible I'd really appreciate an example.
Cheers
Denis

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



Re: Howard deserves praise

2008-02-14 Thread Denis McCarthy
Great - I'll give it a whirl.

On 14/02/2008, Howard Lewis Ship <[EMAIL PROTECTED]> wrote:
>
> That doc is out of date, the partial stuff came along a lot in 5.0.9
> and 5.0.10 and will come along further in 5.0.11.  Environmentals
> (PageRenderSupport, Heartbeat, ZoneSupport) are all working in 5.0.9
> and 5.0.10.
>
>
> On Wed, Feb 13, 2008 at 3:02 AM, Denis McCarthy
> <[EMAIL PROTECTED]> wrote:
> > We are using T5 and are really happy with it. I know this probably isn't
> the
> >  place (but it seemed as good as anywhere else to be honest) but
> >  there's one feature we'd like to see: in the T5 site docs, the section
> on
> >  AJAX says under the 'Zone Limitations' subsection that
> >
> >  'Currently, the partial page content that is rendered may *not* use an
> >  Environmental services. This is expected to change soon.'
> >
> >  Not to sound too cheeky, but is there any way of getting a more
> concrete
> >  idea as to when we will be able to inject Environmental services? Our
> >  application
> >  would benefit greatly from being able to write AJAX components using
> >  Environmental services, and it would be the missing piece in the jigsaw
> as
> >  far
> >  as we are concerned
> >
> >  Thanks again for a great framework
> >
> >  Denis
> >
>
>
>
>
> --
> Howard M. Lewis Ship
>
> Creator Apache Tapestry and Apache HiveMind
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: Howard deserves praise

2008-02-13 Thread Denis McCarthy
We are using T5 and are really happy with it. I know this probably isn't the
place (but it seemed as good as anywhere else to be honest) but
there's one feature we'd like to see: in the T5 site docs, the section on
AJAX says under the 'Zone Limitations' subsection that

'Currently, the partial page content that is rendered may *not* use an
Environmental services. This is expected to change soon.'

Not to sound too cheeky, but is there any way of getting a more concrete
idea as to when we will be able to inject Environmental services? Our
application
would benefit greatly from being able to write AJAX components using
Environmental services, and it would be the missing piece in the jigsaw as
far
as we are concerned

Thanks again for a great framework

Denis


Re: Latest snapshot breaks my contributed translator

2008-02-08 Thread Denis McCarthy
That's it - thanks

On 08/02/2008, Howard Lewis Ship <[EMAIL PROTECTED]> wrote:
>
> It's early, that should be TranslatorSource and TranslatorDefaultSource.
>
> On Feb 8, 2008 6:18 AM, Howard Lewis Ship <[EMAIL PROTECTED]> wrote:
> > The ValidatorDefaultSource service has gone away.  You must make sure
> > you are contributing to the ValidatorSource service (it has "absorbed"
> > the ValidatorDefaultSource service).
> >
> >
> > On Feb 8, 2008 6:12 AM, Patrick Moriarty <[EMAIL PROTECTED]>
> wrote:
> > > We implemented getType().  For example,
> > >
> > > public Class getType() {
> > >   return BigDecimal.class;
> > >   }
> > >
> > > But we observe the same behaviour.  Looks like the lookup by type
> isn't
> > > working correctly.
> > >
> > >
> > > On 08/02/2008, Kevin Menard <[EMAIL PROTECTED]> wrote:
> > > >
> > > > It looks like the Translator interface has been changed.  There is
> now a
> > > > method with the following signature that you must implement:
> > > >
> > > > public Class getType();
> > > >
> > > > I haven't dug into why that is, but my guess is that has something
> to do
> > > > with generics and type erasure.
> > > >
> > > > --
> > > > Kevin
> > > >
> > > >
> > > > On 2/8/08 7:39 AM, in article
> > > > [EMAIL PROTECTED], "Denis
> > > > McCarthy" <[EMAIL PROTECTED]> wrote:
> > > >
> > > > > Hi,
> > > > > In my AppModule.java, I had contributed code for an Enum class
> like
> > > > this:
> > > > >
> > > > > public static void contributeTranslatorDefaultSource(
> > > > > MappedConfiguration, Translator>
> configuration)
> > > > > { ...
> > > > > configuration.add(ReleaseType.class, new Translator()
> {
> > > > >
> > > > > public ReleaseType parseClient(String clientValue,
> Messages
> > > > > messages)
> > > > > throws ValidationException {
> > > > > ...
> > > > >
> > > > > });
> > > > >
> > > > > Where ReleaseType is a java 1.5 enum I'm using. However, just
> after
> > > > updating
> > > > > to the latest snapshot, I'm getting an application
> > > > > exception saying
> > > > >
> > > > > Parameter(s) translate are required for
> > > > > org.apache.tapestry.corelib.components.TextField, but have not
> been
> > > > bound.
> > > > >
> > > > > When I navigate to the page in my app where I have a TextField
> that is
> > > > > populated with values from this enum. Obviously
> > > > > the default behaviour has changed, but I can't seem to figure out
> what
> > > > > exactly I have to do to get this working again.
> > > > > Any suggestions would be welcome
> > > > > Thanks
> > > > > Denis
> > > >
> > > >
> > > >
> > > >
> -
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > >
> > > >
> > >
> >
> >
> >
> > --
> > Howard M. Lewis Ship
> >
> > Creator Apache Tapestry and Apache HiveMind
> >
>
>
>
> --
> Howard M. Lewis Ship
>
> Creator Apache Tapestry and Apache HiveMind
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Latest snapshot breaks my contributed translator

2008-02-08 Thread Denis McCarthy
Hi,
In my AppModule.java, I had contributed code for an Enum class like this:

public static void contributeTranslatorDefaultSource(
MappedConfiguration, Translator> configuration)
{ ...
configuration.add(ReleaseType.class, new Translator() {

public ReleaseType parseClient(String clientValue, Messages
messages)
throws ValidationException {
...
});

Where ReleaseType is a java 1.5 enum I'm using. However, just after updating
to the latest snapshot, I'm getting an application
exception saying

Parameter(s) translate are required for
org.apache.tapestry.corelib.components.TextField, but have not been bound.

When I navigate to the page in my app where I have a TextField that is
populated with values from this enum. Obviously
the default behaviour has changed, but I can't seem to figure out what
exactly I have to do to get this working again.
Any suggestions would be welcome
Thanks
Denis


Re: How to load a image dynamiclly in tapestry5.0.4

2007-06-06 Thread Denis McCarthy

Hello,
I came across this thread while searching for a way to display images 
from blobs stored in a database in T5. I've been messing around with 
Assets/AssetFactories and Resources, and although I've been making 
reasonable progress I'm not sure if it's the appropriate way to approach 
the display of database-based images. Is there some other approach that 
makes more sense?

Thanks
Denis

Howard Lewis Ship wrote:

In order to answer this question, some background is needed.

If you know the product's id (whatever you use, where it's  SKU number or a
surrogate key) ... what is the exact process from going from that to a URL
suitable for an  tag?

That is ... are the images stored in the database?  Or are they on the file
system somewhere?  If they are files on the file system, are those files
mapped to a client-visible URL?

In the latter case, you can do something like:



public String getProductImageURL() {
 return "http://static.myco.com/product-images/"; + _productId + ".gif";
}



Assigning a t:id to a tag without specifying a component type creates an 
Any

component, a component that just renders whatever tag and informal
parameters you provide it.  Here wer'e linking that to some Java code in 
the

corresponding page or component that computes the URL of the product based
on an instance variable.  Probably your example is more complicated, but 
you

get the idea.

There's another approach used when the data is inside the database, but we
can dive into that if the above solution is insufficient.

Assets are useful for accessing resources inside the web application
context, or on the classpath, and includes logic related to localization 
...

but it is not always appropriate when accessing resources that are well
outside the web application itself.

On 5/19/07, Allen Guo <[EMAIL PROTECTED]> wrote:


Hi All,

I want to show the ProductDetail page with product image. It looks like
.
You know, every product has different image name,so I need to pass the
string 'p_001.jpg' to the corresponding page.
As result the img tag should look like  or
I can use Asset to do it.

But I tried to do it using the first approach, exception occured.
And I don't know how to the second approach.
Can anyone give me an idea?

Thank in advance
Allen Guo


-
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: Adding a parameter to the url for all pages

2007-05-30 Thread Denis McCarthy
Never mind - I just came across an example using the cookie source 
hivemind service to accomplish this. This is a much cleaner solution. Thanks


Denis McCarthy wrote:
That sounds like a good idea. However, I've been unable to find an 
explanation as to how to set a value explicitly in a cookie (I know that 
tapestry will implicitly set the session value in a cookie for you to 
synchronize the server state with the client using a session id) How do 
you get tapestry to store some other value in a cookie, and is there a 
way to easily access it? I'm using tap 4.1

Thanks
Denis

Jesse Kuhnert wrote:

Why don't you just store the unique machine ID in a cookie ?

On 5/29/07, Denis McCarthy <[EMAIL PROTECTED]> wrote:


Hi,
I've a custom application that runs on a set number of machines. The
application consists of a custom browser (based on xulrunner and eclipse
swt Browser class) and a tapestry application. Each machine on which the
app runs has a unique ID. Currently, when users use the application,
their information is stored in a standard tapestry visit object.
However, I'm not a huge fan of the http session, and, given my
environment, I could do away with it entirely by simply altering each
submitted URL in the custom browser to include the machine id, and keep
any session-based variables in the database.

This is simple to do via a listener in the Browser. However, I'm not
sure if this is possible on the tapestry side. Basically, each url would
be modifed from http://localhost:8080/app/myPage.sdirect to
http://localhost:8080/app/myPage.sdirect?machineId=4

or http://localhost:8080/app/myOtherPage.sdirect?sp=1
to http://localhost:8080/app/myOtherPage.sdirect?sp=1&machineId=4

Does this idea make sense? Is there a way to always get a parameter like
this out of the URL (regardless of whether it's a GET or POST?)
I've been messing around with this idea in my app, but I'm running into
problems like
'rewind of form myPage/form expected only 0 form elements, but an
additional id was requested by component myPage/null'

Is this notion I've come up with feasible, or have I been smoking too
much crack again?

Thanks
Denis

-
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: Adding a parameter to the url for all pages

2007-05-30 Thread Denis McCarthy
That sounds like a good idea. However, I've been unable to find an 
explanation as to how to set a value explicitly in a cookie (I know that 
tapestry will implicitly set the session value in a cookie for you to 
synchronize the server state with the client using a session id) How do 
you get tapestry to store some other value in a cookie, and is there a 
way to easily access it? I'm using tap 4.1

Thanks
Denis

Jesse Kuhnert wrote:

Why don't you just store the unique machine ID in a cookie ?

On 5/29/07, Denis McCarthy <[EMAIL PROTECTED]> wrote:


Hi,
I've a custom application that runs on a set number of machines. The
application consists of a custom browser (based on xulrunner and eclipse
swt Browser class) and a tapestry application. Each machine on which the
app runs has a unique ID. Currently, when users use the application,
their information is stored in a standard tapestry visit object.
However, I'm not a huge fan of the http session, and, given my
environment, I could do away with it entirely by simply altering each
submitted URL in the custom browser to include the machine id, and keep
any session-based variables in the database.

This is simple to do via a listener in the Browser. However, I'm not
sure if this is possible on the tapestry side. Basically, each url would
be modifed from http://localhost:8080/app/myPage.sdirect to
http://localhost:8080/app/myPage.sdirect?machineId=4

or http://localhost:8080/app/myOtherPage.sdirect?sp=1
to http://localhost:8080/app/myOtherPage.sdirect?sp=1&machineId=4

Does this idea make sense? Is there a way to always get a parameter like
this out of the URL (regardless of whether it's a GET or POST?)
I've been messing around with this idea in my app, but I'm running into
problems like
'rewind of form myPage/form expected only 0 form elements, but an
additional id was requested by component myPage/null'

Is this notion I've come up with feasible, or have I been smoking too
much crack again?

Thanks
Denis

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



Adding a parameter to the url for all pages

2007-05-29 Thread Denis McCarthy

Hi,
I've a custom application that runs on a set number of machines. The 
application consists of a custom browser (based on xulrunner and eclipse 
swt Browser class) and a tapestry application. Each machine on which the 
app runs has a unique ID. Currently, when users use the application, 
their information is stored in a standard tapestry visit object. 
However, I'm not a huge fan of the http session, and, given my 
environment, I could do away with it entirely by simply altering each 
submitted URL in the custom browser to include the machine id, and keep 
any session-based variables in the database.


This is simple to do via a listener in the Browser. However, I'm not 
sure if this is possible on the tapestry side. Basically, each url would 
be modifed from http://localhost:8080/app/myPage.sdirect to 
http://localhost:8080/app/myPage.sdirect?machineId=4


or http://localhost:8080/app/myOtherPage.sdirect?sp=1
to http://localhost:8080/app/myOtherPage.sdirect?sp=1&machineId=4

Does this idea make sense? Is there a way to always get a parameter like 
this out of the URL (regardless of whether it's a GET or POST?)
I've been messing around with this idea in my app, but I'm running into 
problems like
'rewind of form myPage/form expected only 0 form elements, but an 
additional id was requested by component myPage/null'


Is this notion I've come up with feasible, or have I been smoking too 
much crack again?


Thanks
Denis

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



Empty catch block in WebRequestServicerFilter implementer

2007-01-31 Thread Denis McCarthy

Hi,
I've a filter that implements WebRequestServicerFilter. As per the 
typical filter pattern, the filter's service method calls the 
WebRequestServicer's service(WebRequest, WebResponse) method. However, 
this method throws an IOException and I've noticed that on many calls to 
this service method an IOException is indeed thrown (namely when the 
filter is processing a request with a javascript (dojo) URI).


Because of this I've ended up with a try/catch around the service method 
that simply ignores all IOExceptions. This sort of code can of course be 
extremely evil. Is there some other way to distinguish between requests 
that should be service()'d, or is having such an empty try/catch block 
standard practice for web filters?

Thanks
Denis

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



Re: Aspects in tapestry pages using spring

2007-01-29 Thread Denis McCarthy
Thanks for that James - using a filter is a better approach than aspectj 
in this instance. I'm not too hot on hivemind. Is there any service 
point or extension I can use to get the current page's name? I have a 
request filter for implementing the open session in view filter in 
hibernate already, and I can get the actual URL from the 
WebRequest.getPathInfo() method, but I'm not sure how to get the page 
class name itself. Any idea for how to get this using hivemind?

Thanks a lot for your help
Denis

James Carman wrote:

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

Re: Aspects in tapestry pages using spring

2007-01-26 Thread Denis McCarthy
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]



Re: Aspects in tapestry pages using spring

2007-01-26 Thread Denis McCarthy
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:



   


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]



Aspects in tapestry pages using spring

2007-01-25 Thread Denis McCarthy

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]



Re: preventing double submit in tapestry

2006-11-15 Thread Denis McCarthy
I was looking for a sledgehammer to crack a nut. That's how I ended up 
doing it (after spending the day looking for an enterprisey solution!)

Thanks
Denis

Jesse Kuhnert wrote:

Why don't you just disable the submit buttons in question when they submit?
(set the disabled attribute to true)

On 11/15/06, Denis McCarthy <[EMAIL PROTECTED]> wrote:


Hi,
I'm encountering a problem in my app where users are double submitting a
  form, creating a hibernate exception in the back end where two
sessions are attempting to update the same collection. I've read some
posts about preventing form resubmission by using a unique token in the
form to detect a double submit.

If a double submit is detected, the second and subsequent submits wait
until the original one returns and then report the outcome of that
transaction (if I understand correctly, it's the last submit that issues
the response to the user, and the first one does the updating).

I'm wondering
a) is this indeed the right approach to stop users who are
over-enthusiastic in their button clicking from encountering errors, and
b) does anyone have an actual example of code that implements this
pattern?
Thanks very much
Denis 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]



preventing double submit in tapestry

2006-11-15 Thread Denis McCarthy

Hi,
I'm encountering a problem in my app where users are double submitting a 
 form, creating a hibernate exception in the back end where two 
sessions are attempting to update the same collection. I've read some 
posts about preventing form resubmission by using a unique token in the 
form to detect a double submit.


If a double submit is detected, the second and subsequent submits wait 
until the original one returns and then report the outcome of that 
transaction (if I understand correctly, it's the last submit that issues 
the response to the user, and the first one does the updating).


I'm wondering
a) is this indeed the right approach to stop users who are 
over-enthusiastic in their button clicking from encountering errors, and

b) does anyone have an actual example of code that implements this pattern?
Thanks very much
Denis Mc.

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



Re: Image localization with css

2006-11-03 Thread Denis McCarthy
Kristian, That's slightly a slightly cleaner implementation of the way I 
was doing it. Thanks.
Fred, that's the way we are doing it - the src image is a transparent 
gif and the background image (specifiable in css) is where the actual 
image is defined. The images in question will be the same size, as we're 
cooking them up ourselves.

Thanks
Denis

Kristian Marinkovic wrote:

of course you could move this @Import statement into your HTML template :)




   
 Kristian  
 Marinkovic
  [EMAIL PROTECTED]  "Tapestry users"   
 >  
 Kopie 
 03.11.2006 13:02  
 Thema 
RE: Image localization with css
  Bitte antworten  
an 
 "Tapestry users"  
 <[EMAIL PROTECTED] 
pache.org> 
   
   





Hi,

you could generated a CSS with a @Import statement that depends on language
and style

kind of:

main.css:
/* all default rules that apply to all styles */

/* if lang=en */
@IMPORT url("lang_en.css");
/* else */
@IMPORT url("lang_default.css")
/*end */


lang_en.css:
/* just the rules that are different (background-image,) */

g,
kris




 Denis McCarthy
 <[EMAIL PROTECTED]
 letech.com>An
Tapestry users
 03.11.2006 12:52   
 Kopie

  Bitte antwortenThema
an  Image localization with css
 "Tapestry users"
 <[EMAIL PROTECTED]
pache.org>







Hi,
I need to support both localized images and images with several css
styles. For example, say I've 2 css files, CSS1 and CSS2, and need to
support 2 languages, EN and ES. What I'd like to support is 4 images
like this:

img_CSS1_EN
img_CSS1_ES
img_CSS2_EN
img_CSS2_ES

, each one appearing according to the style and locale selection

It's possible to localize the images using the @Image component, but I'm
not sure whether its possible to get this to play well with multiple
stylesheets (css doesn't seem to allow the definition of the src
attribute for img classes).

My only solution I have at the moment is the rather awkward one of
having a css file per locale per style - I'd prefer to only have a css
file per style and let tapestry look after the localization - including
the images.

Has anyone had this requirement before, and how did they solve it?
Thanks
Denis

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



Image localization with css

2006-11-03 Thread Denis McCarthy

Hi,
I need to support both localized images and images with several css 
styles. For example, say I've 2 css files, CSS1 and CSS2, and need to 
support 2 languages, EN and ES. What I'd like to support is 4 images 
like this:


img_CSS1_EN
img_CSS1_ES
img_CSS2_EN
img_CSS2_ES

, each one appearing according to the style and locale selection

It's possible to localize the images using the @Image component, but I'm 
not sure whether its possible to get this to play well with multiple 
stylesheets (css doesn't seem to allow the definition of the src 
attribute for img classes).


My only solution I have at the moment is the rather awkward one of 
having a css file per locale per style - I'd prefer to only have a css 
file per style and let tapestry look after the localization - including 
the images.


Has anyone had this requirement before, and how did they solve it?
Thanks
Denis

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



Re: tapestry-captcha/acegi integration

2006-10-05 Thread Denis McCarthy

Thanks again James.
I see what you're saying, but the fact is that I _am_ getting an NPE 
when calling a method on the LinkFactory in the CaptchaEngineService, 
and the LinkFactory within the Service is indeed null (meaning that it 
is not getting wired up, I assume). I'm sure I'm missing something in my 
app that's causing this, but I don't know what.


I'm using tap 4.1. I thought that might be the problem (as 
tapestry-captcha has 4.0 as a dependency in its pom) But I get the same 
exception in CaptchaEngineService when I try it with 4.0.


If anyone knows of any error that would cause hivemind not to wire up 
services properly I'd be more than grateful - I know this is something small

TIA
Denis

James Carman wrote:

HiveMind doesn't require you to explicitly set your properties.  It has an
"autowire" feature.  So, HiveMind will set those properties for you just
becuase it has service points defined which implement those interfaces.

Tapestry-Acegi is not very well documented currently, but it's not really
rocket science.  All I did was set up the servlet filters as HiveMind
services and create a mechanism where you can supply servlet filters as
web request servicer filters (it wraps them and plugs them into the
pipeline).  I didn't want to rewrite all of the servlet filters that Acegi
is based upon, so I came up with the bridging idea and it seems to work
out well.  I plan on doing more work, like setting up form-based
authentication and giving examples of all of the setup options.



where did you find any documentation on tapestry-acegi ?  I tried using it
breifly, but gave up as I couldn't find the source or any documentation.

On 10/5/06, Denis McCarthy <[EMAIL PROTECTED]> wrote:

Thanks for the response James. The relevant part of the hivemodule.xml
in the version I downloaded looks like this:

.
.
.

 
 
 
 
 
 
 
.
.
.



As you can see there is no LinkFactory set for the CaptchaEngineService
here. When I step through the code in the CaptchaEngineService prior to
the NPE, the LinkFactory is indeed null. Am I missing some extra
configuration or something?
Thanks for your help
Denis
James Carman wrote:

Denis,

The hivemodule.xml file for Tapestry-Captcha will take care of wiring

in
the

linkFactory and imageCaptchaService.

James

-Original Message-
From: Denis McCarthy [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 04, 2006 11:08 AM
To: Tapestry users
Subject: tapestry-captcha/acegi integration

Hi,
I'm attempting to integrate James Carman's tapestry-captcha library

into

a proof of concept app I'm putting together. The acegi stuff is
redirecting correctly to a very simple captcha page just containg a
reference to the captcha component from tapestry-captcha.
Here's the .page:

   
type="captcha:CaptchaImage">



However, when the app jumps to this page, I'm getting a null pointer
exception in the getLink() method. After looking at the code in the
CaptchaEngineService class, it seems like I need to define both a
LinkFactory and an ImageCaptchaService for the component. I haven't
messed with services before, so I'd like to know how to go about
defining a linkfactory for this component?.


As I'm using Acegi, I'd like to use acegi's
CaptchaValidationProcessingFilter to process the captcha's success or
failure. This filter uses the presence of a validation parameter
(defined in the spring application context) to decide whether to
validate the request or not. Is it possible in tapestry to ensure that
the validation parameter passed back in the http request has a

specific

name, so that the filter will pick it up and validate whether the
captcha was correctly entered?
If anyone needs any further info just ask
TIA
Denis 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]




--
Ed Ross
[EMAIL PROTECTED]




James Carman, President
Carman Consulting, Inc.


-
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-captcha/acegi integration

2006-10-05 Thread Denis McCarthy
Thanks for the response James. The relevant part of the hivemodule.xml 
in the version I downloaded looks like this:


.
.
.

interface="org.apache.tapestry.engine.IEngineService">


class="com.javaforge.tapestry.captcha.service.CaptchaEngineService">
value="${tapestry.captcha.mimeType}"/>




.
.
.



As you can see there is no LinkFactory set for the CaptchaEngineService 
here. When I step through the code in the CaptchaEngineService prior to 
the NPE, the LinkFactory is indeed null. Am I missing some extra 
configuration or something?

Thanks for your help
Denis
James Carman wrote:

Denis,

The hivemodule.xml file for Tapestry-Captcha will take care of wiring in the
linkFactory and imageCaptchaService.  

James 


-Original Message-
From: Denis McCarthy [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 04, 2006 11:08 AM

To: Tapestry users
Subject: tapestry-captcha/acegi integration

Hi,
I'm attempting to integrate James Carman's tapestry-captcha library into 
a proof of concept app I'm putting together. The acegi stuff is 
redirecting correctly to a very simple captcha page just containg a 
reference to the captcha component from tapestry-captcha.

Here's the .page:

 


However, when the app jumps to this page, I'm getting a null pointer 
exception in the getLink() method. After looking at the code in the 
CaptchaEngineService class, it seems like I need to define both a 
LinkFactory and an ImageCaptchaService for the component. I haven't 
messed with services before, so I'd like to know how to go about 
defining a linkfactory for this component?.



As I'm using Acegi, I'd like to use acegi's 
CaptchaValidationProcessingFilter to process the captcha's success or 
failure. This filter uses the presence of a validation parameter 
(defined in the spring application context) to decide whether to 
validate the request or not. Is it possible in tapestry to ensure that 
the validation parameter passed back in the http request has a specific 
name, so that the filter will pick it up and validate whether the 
captcha was correctly entered?

If anyone needs any further info just ask
TIA
Denis 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]



tapestry-captcha/acegi integration

2006-10-04 Thread Denis McCarthy

Hi,
I'm attempting to integrate James Carman's tapestry-captcha library into 
a proof of concept app I'm putting together. The acegi stuff is 
redirecting correctly to a very simple captcha page just containg a 
reference to the captcha component from tapestry-captcha.

Here's the .page:

 


However, when the app jumps to this page, I'm getting a null pointer 
exception in the getLink() method. After looking at the code in the 
CaptchaEngineService class, it seems like I need to define both a 
LinkFactory and an ImageCaptchaService for the component. I haven't 
messed with services before, so I'd like to know how to go about 
defining a linkfactory for this component?.



As I'm using Acegi, I'd like to use acegi's 
CaptchaValidationProcessingFilter to process the captcha's success or 
failure. This filter uses the presence of a validation parameter 
(defined in the spring application context) to decide whether to 
validate the request or not. Is it possible in tapestry to ensure that 
the validation parameter passed back in the http request has a specific 
name, so that the filter will pick it up and validate whether the 
captcha was correctly entered?

If anyone needs any further info just ask
TIA
Denis Mc.

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



tacos maven artifact on ibiblio

2006-08-25 Thread Denis McCarthy

Hi,
I could have sworn that tacos had a maven artifact on ibiblio a week or 
two ago at http://www.ibiblio.org/maven2/net/sf/tacos. It no longer 
seems to be available, thus causing a fresh maven build of my project 
some problems. Does anyone know why it might have been removed, or am I 
smoking crack and dreaming that it was ever available?

Thanks
Denis

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



Re: Can you always have valid html with tapestry templates?

2006-08-18 Thread Denis McCarthy

That works! Thanks

andyhot wrote:

Use:

blah blah


stuff iterated over by the foreach




Denis McCarthy wrote:

Hi,
I have tables that are populated by a @ForEach component in my html.
The html template is like this

blah blah






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



Can you always have valid html with tapestry templates?

2006-08-18 Thread Denis McCarthy

Hi,
I have tables that are populated by a @ForEach component in my html. The 
html template is like this


blah blah


TIA
Denis



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



RE: Best pratice - CRUD Security - Tapestry 4.0

2006-05-16 Thread Denis McCarthy
Good point Jesse - but wouldn't you then be required
to have all your queries wrapped in procedures? I'm interested to
know because I'd consider using oracle standard for a new project
if we could do something FGAC-esque with Oracle standard (or even express).

-Original Message-
From: Jesse Kuhnert [mailto:[EMAIL PROTECTED]
Sent: 16 May 2006 17:19
To: Tapestry users
Subject: Re: Best pratice - CRUD Security - Tapestry 4.0


You don't need oracle fine grained access control to do the same thing.

As long as your DB supports the notion of stored procs / global (transaction
bound) variables you can do the same exact thing without it.

On 5/16/06, Carl Pelletier <[EMAIL PROTECTED]> wrote:
>
> Unfortunetly, I'm using PostgreSQL.
>
> Thanks
>
> Denis McCarthy wrote:
> > If you happen to be using oracle enterprise edition I'd highly recommend
> > using Acegi in conjunction with Oracle Fine Grained Access Control
> (FGAC)
> > for database access checking.
> > We've got a simple subclass of a datasource that overrides
> getConnection()
> > and sets the users Oracle context. This keeps the jdbc/hibernate code
> very
> > clean and ensures that the same security code is enforced even if
> someone
> > logs in via sql*plus, toad or any other tool.
> > Nice.
> >
> > -Original Message-
> > From: Andreas Bulling [mailto:[EMAIL PROTECTED] Behalf Of
> > Andreas Bulling
> > Sent: 16 May 2006 16:57
> > To: Tapestry users
> > Subject: Re: Best pratice - CRUD Security - Tapestry 4.0
> >
> >
> > On 16. Mai 2006 - 10:45:45, Brian K. Wallace wrote:
> > | This is where I stick with ACEGI being unobtrusive. Not discounting
> any
> > | other method of doing it at all, but I found that with ACEGI I add a
> > | hook into "login/logout" pages and there's no other intrusion into my
> > | Tapestry applications outside the configuration file (aka: no
> > | "isUserInRole("...")" of any kind.
> >
> > But how is further access for example to the database checked?
> >
> > Andreas
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > **
> > This email and any files transmitted with it are confidential and/or
> privileged and intended solely for the use of the individual or entity to
> whom they are addressed. If you are not the intended recipient(s) please
> note that any review, distribution, dissemination, disclosure, alteration,
> printing, copying, transmission or use of this email and/or any file
> transmitted or the information therein is prohibited and may be unlawful. If
> you have received this email and any file transmitted with it in error
> please notify us by email at [EMAIL PROTECTED] or by telephone at +353
> 66 97 61258 and then delete the email and all copies of it from your system
> and destroy any hard copies of the email.
> > Please note that any views, opinions or advice contained in this
> communication are those of the sending individual and not necessarily those
> of FEXCO. Email may be susceptible to data corruption, interception and
> unauthorised amendment, and we do not accept liability for any such
> corruption, interception or amendment or the consequences thereof.
> > FEXCO and each legal entity in the FEXCO group of companies or business
> units of FEXCO reserve the right to monitor all email communications through
> its networks. This footnote also confirms that this email message has been
> swept for viruses.
> > www.FEXCO.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]
>
>


-- 
Jesse Kuhnert
Tacos/Tapestry, team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. 
**
This email and any files transmitted with it are confidential and/or privileged 
and intended solely for the use of the individual or entity to whom they are 
addressed. If you are not the intended recipient(s) please note that any 
review, distribution, dissemination, disclosure, alteration, printing, copying, 
trans

RE: Best pratice - CRUD Security - Tapestry 4.0

2006-05-16 Thread Denis McCarthy
If you happen to be using oracle enterprise edition I'd highly recommend 
using Acegi in conjunction with Oracle Fine Grained Access Control (FGAC)
for database access checking. 
We've got a simple subclass of a datasource that overrides getConnection()
and sets the users Oracle context. This keeps the jdbc/hibernate code very
clean and ensures that the same security code is enforced even if someone
logs in via sql*plus, toad or any other tool.
Nice.

-Original Message-
From: Andreas Bulling [mailto:[EMAIL PROTECTED] Behalf Of
Andreas Bulling
Sent: 16 May 2006 16:57
To: Tapestry users
Subject: Re: Best pratice - CRUD Security - Tapestry 4.0


On 16. Mai 2006 - 10:45:45, Brian K. Wallace wrote:
| This is where I stick with ACEGI being unobtrusive. Not discounting any
| other method of doing it at all, but I found that with ACEGI I add a
| hook into "login/logout" pages and there's no other intrusion into my
| Tapestry applications outside the configuration file (aka: no
| "isUserInRole("...")" of any kind.

But how is further access for example to the database checked?

Andreas

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED] 
**
This email and any files transmitted with it are confidential and/or privileged 
and intended solely for the use of the individual or entity to whom they are 
addressed. If you are not the intended recipient(s) please note that any 
review, distribution, dissemination, disclosure, alteration, printing, copying, 
transmission or use of this email and/or any file transmitted or the 
information therein is prohibited and may be unlawful. If you have received 
this email and any file transmitted with it in error please notify us by email 
at [EMAIL PROTECTED] or by telephone at +353 66 97 61258 and then delete the 
email and all copies of it from your system and destroy any hard copies of the 
email.
Please note that any views, opinions or advice contained in this communication 
are those of the sending individual and not necessarily those of FEXCO. Email 
may be susceptible to data corruption, interception and unauthorised amendment, 
and we do not accept liability for any such corruption, interception or 
amendment or the consequences thereof.
FEXCO and each legal entity in the FEXCO group of companies or business units 
of FEXCO reserve the right to monitor all email communications through its 
networks. This footnote also confirms that this email message has been swept 
for viruses.
www.FEXCO.com
**

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