Re: OAuth support in tynamos tapestry-security

2010-07-14 Thread Moritz Gmelin
Every starting point would be helpful! I'm pretty new with REST and OAuth. 
Though I do have experience with T5 since the very early 5.0.4 days.

M.

Am 14.07.2010 um 23:44 schrieb Kalle Korhonen:

> I already implemented Oauth2 for my own use, obviously utilizing
> tapestry-security, not using rest though but I imagine it'd be easy to
> add on top. The sore point right now is that it's not generalized
> since there's a few different ways to go about it, depending on
> whether you need federated user accounts or not (a combination of
> local and remote user properties) but in the general case it makes
> sense. Most of all, there needs to be some simple FederatedAccount
> interface. If I get some interested guinea pigs, I could provide an
> initial implementation which we could then refine further based on
> people's needs. WDYT?
> 
> Kalle
> 
> 
> On Wed, Jul 14, 2010 at 2:12 PM, Borut Bolčina  
> wrote:
>> That would be awesome. I am using tapestry security in two apps currently.
>> One is a 5.1 and the other T5.2. So far very smooth. I am very pleased. Keep
>> up!
>> 
>> Regards,
>> Borut
>> 
>> 2010/7/14 Moritz Gmelin 
>> 
>>> Hi,
>>> 
>>> I was wondering if there is some kind of support planned to support OAuth
>>> authentication with tynamos tapestry-security. I would love to be able to
>>> offer RESTful webservices with OAuth authentication with tapestry,
>>> tapestry-restful and tapestry-security.
>>> Any plans? Pointers?
>>> 
>>> Thanks
>>> 
>>> Moritz
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>> 
>>> 
>> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 


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



Re: Upgrading from Tapestry5.0.18 to 5.1.0.5

2010-07-14 Thread Sha Aith

Howard,

I read through some of the points mentioned in
http://tapestry.apache.org/tapestry5.1/tapestry-spring/.
I tried the 5.0 Compatibility Mode and also tried retaining the old
tapestry-spring version 5.0.18 with the rest of Tapestry 5.1.0.5. By doing
this, the original exception I reported went away but got another exception,
shown in the link https://issues.apache.org/jira/browse/TAP5-745.

Instead of using the conventional Tapestry Filter in the web.xml file, we
are using the TapestrySpringFilter so that we could inject the Spring beans
into Tapestry5 components. We are stuck with this, please let me know what
options we have to get this working.

Thanks


Howard Lewis Ship wrote:
> 
> There are upgrade notes concerning tapestry-string, please check on
> the web site.
> 
> On Wed, Jul 14, 2010 at 4:56 AM, Sha Aith 
> wrote:
>>
>> I do have the Tapestry-Spring integration package. I'm running this in an
>> OSGi environment.
>>
>>
>>
>> Juan E. Maya wrote:
>>>
>>> Hi,
>>> It seems to me like you are missing the tapestry-spring integration
>>> jar or you have the old one still somewhere.
>>>
>>> On Wed, Jul 14, 2010 at 11:36 AM, Sha Aith 
>>> wrote:

 Hi,

 I'm trying to upgrade from Tapestry 5.0.18 to 5.1.0.5. My projects
 works
 fine with 5.0.18, but when I use 5.1.0.5, I get the following
 exception.
 Please let me know how I can fix this problem.

 2010-07-14 14:11:29.498] async-delivery-thread-1
 try5.ioc.services.TapestryIOCModule.MasterObjectProvider.unknown E
 Construction of service MasterObjectProvider failed: Error invoking
 constructor
 org.apache.tapestry5.ioc.internal.services.MasterObjectProviderImpl(List,
 OperationTracker) (at MasterObjectProviderImpl.java:32) via
 org.apache.tapestry5.ioc.services.TapestryIOCModule.bind(ServiceBinder)
 (at
 TapestryIOCModule.java:43) (for service 'MasterObjectProvider'): Error
 building service proxy for service 'ApplicationContext' (at
 org.apache.tapestry5.ioc.internal.util.internalutil...@185c043):
 Service
 id
 'ApplicationContextCustomizer' is not defined by any module.

 --
 View this message in context:
 http://old.nabble.com/Upgrading-from-Tapestry5.0.18-to-5.1.0.5-tp29160065p29160065.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.


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


>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>>
>>>
>>>
>>
>> --
>> View this message in context:
>> http://old.nabble.com/Upgrading-from-Tapestry5.0.18-to-5.1.0.5-tp29160065p29161115.html
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>>
> 
> 
> 
> -- 
> Howard M. Lewis Ship
> 
> Creator of Apache Tapestry
> 
> The source for Tapestry training, mentoring and support. Contact me to
> learn how I can get you up and productive in Tapestry fast!
> 
> (971) 678-5210
> http://howardlewisship.com
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Upgrading-from-Tapestry5.0.18-to-5.1.0.5-tp29160065p29169366.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



production html whitespace compression alters rendered markup

2010-07-14 Thread Paul Stanton
Firstly, I'd like to say that tapestry does most things very well and I 
probably only comment on the things it doesn't do well. Thank you to 
those who've spent time improving the framework for making my job as a 
developer more enjoyable.


I do have an issue with the production mode Considering the following in 
your average TML:


This is my paragraph and sometimes a single word or phrase style="text-decoration:underline;">might need some special 
attention so I might do 
this, but it's still my 
paragraph.


or a shorter eg:
A B C D

In development mode, this will render unchanged:

A B C D

However in production mode, tapestry will take out some important 
whitespace:


A BC D

I know you can partially combat this by using a non-breaking space in 
the markup ( ) however, this has the expected drawback of 
disallowing line breaking where it may be required.


for example, a list of links:
1
2
3
4
5
...

becomes
123href="url4">45...


I agree that some 'compression' on html syntax is a good thing in a 
production environment, but to keep the integrity of the document I 
think tapestry should replace multiple whitespace characters with one 
whitespace character instead of removing all whitespace between tags. 
Therefore, while I know I can set "tapestry.compress-whitespace" to 
false, I would prefer to have my suggestion implemented in place of the 
existing mechanism or as an alternative.


The main issues for me:
1. Rendered markup is fundamentally different between production and 
development environments, making the most commonly used form of testing 
flawed
2. In some cases a space is the only solution to layout problems and 
tapestry won't allow it


Keen to hear other opinions...

p.

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



Re: [Tapestry Central] Everyone out of the Pool! Tapestry goes singleton!

2010-07-14 Thread Howard Lewis Ship
Read it with formatting:
http://tapestryjava.blogspot.com/2010/07/everyone-out-of-pool-tapestry-goes.html

On Wed, Jul 14, 2010 at 4:30 PM, Howard  wrote:
> Tapestry applications are inherently stateful: during and between
> requests, information in Tapestry components, value stored in fields,
> stick around. This is a great thing: it lets you program a web
> application in a sensible way, using stateful objects full of mutable
> properties and methods to operate on those properties.
> It also has its downside: Tapestry has to maintain a pool of page
> instances. And in Tapestry, page instances are big: a tree of hundreds
> or perhaps thousands of interrelated objects: the tree of Tapestry
> structural objects that forms the basic page structure, the component
> and mixin objects hanging off that tree, the binding objects that
> connect parameters of components to properties of their containing
> component, the template objects that represents elements and content
> from component templates, and many, many more that most Tapestry
> developers are kept unawares of.
> This has proven to be a problem with biggest and busiest sites
> constructed using Tapestry. Keeping a pool of those objects, checking
> them in and out, and discarded them when no longer needed is draining
> needed resources, especially heap space.
> So that seems like an irreconcilable problem eh? Removing mutable state
> from pages and components would turn Tapestry into something else
> entirely. On the other hand, allowing mutable state means that
> applications, especially big complex applications with many pages,
> become memory hogs.
> I suppose one approach would be to simply create a page instance for
> the duration of a request, and discard it at the end. However, page
> construction in Tapestry is very complicated and although some effort
> was expended in Tapestry 5.1 to reduce the cost of page construction,
> it is still present. Additionally, Tapestry is full of small
> optimizations that improve performance ... assuming a page is reused
> over time. Throwing away pages is a non-starter.
> So we're back to square one ... we can't eliminate mutable state, but
> (for large applications) we can't live with it either.
> Tapestry has already been down this route: the way persistent fields
> are handled gives the illusion that the page is kept around between
> requests. You might think that Tapestry serializes the page and stores
> the whole thing in the session. In reality, Tapestry is shuffling just
> the individual persistent field values in to and out of the HttpSessio.
> To both the end user and the Tapestry developer, it feels like the
> entire page is live between requests, but it's a bit of a shell game,
> providing an equivalent page instance that has the same values in its
> fields.
> What's going on in trunk right now is extrapolating that concept from
> persistent fields to all mutable fields. Every access to every mutable
> field in a Tapestry page is converted, as part of the class
> transformation process, into an access against a per-thread Map of keys
> and values. The end result is that a single page instance can be used
> across threads without any synchronization issues and without any
> conflicts. Each thread has its own per-thread Map.
> This idea was suggested in years past, but the APIs to accomplish it
> (as well as the necessary meta-programming savvy) just wasn't
> available. However, as a side effect of rewriting and simplifying the
> class transformation APIs in 5.2, it became very reasonable to do this.
> Let's take an important example: handling typical, mutable fields. This
> is the responsibility of the UnclaimedFieldWorker class, part of
> Tapestry component class transformation pipeline. UnclaimedFieldWorker
> finds fields that have not be "claimed" by some other part of the
> pipeline and converts them to read and write their values to the
> per-thread Map. A claimed field may store an injected service, asset or
> component, or be a component parameter.
> public class UnclaimedFieldWorker implements
> ComponentClassTransformWorker { private final PerthreadManager
> perThreadManager; private final ComponentClassCache classCache; static
> class UnclaimedFieldConduit implements FieldValueConduit { private
> final InternalComponentResources resources; private final
> PerThreadValue fieldValue; // Set prior to the
> containingPageDidLoad lifecycle event private Object fieldDefaultValue;
> private UnclaimedFieldConduit(InternalComponentResources resources,
> PerThreadValue fieldValue, Object fieldDefaultValue) {
> this.resources = resources; this.fieldValue = fieldValue;
> this.fieldDefaultValue = fieldDefaultValue; } public Object get() {
> return fieldValue.exists() ? fieldValue.get() : fieldDefaultValue; }
> public void set(Object newValue) { fieldValue.set(newValue); // This
> catches the case where the instance initializer method sets a value for
> the field. // That value is captured and used when no

[Tapestry Central] Everyone out of the Pool! Tapestry goes singleton!

2010-07-14 Thread Howard
Tapestry applications are inherently stateful: during and between
requests, information in Tapestry components, value stored in fields,
stick around. This is a great thing: it lets you program a web
application in a sensible way, using stateful objects full of mutable
properties and methods to operate on those properties.
It also has its downside: Tapestry has to maintain a pool of page
instances. And in Tapestry, page instances are big: a tree of hundreds
or perhaps thousands of interrelated objects: the tree of Tapestry
structural objects that forms the basic page structure, the component
and mixin objects hanging off that tree, the binding objects that
connect parameters of components to properties of their containing
component, the template objects that represents elements and content
from component templates, and many, many more that most Tapestry
developers are kept unawares of.
This has proven to be a problem with biggest and busiest sites
constructed using Tapestry. Keeping a pool of those objects, checking
them in and out, and discarded them when no longer needed is draining
needed resources, especially heap space.
So that seems like an irreconcilable problem eh? Removing mutable state
from pages and components would turn Tapestry into something else
entirely. On the other hand, allowing mutable state means that
applications, especially big complex applications with many pages,
become memory hogs.
I suppose one approach would be to simply create a page instance for
the duration of a request, and discard it at the end. However, page
construction in Tapestry is very complicated and although some effort
was expended in Tapestry 5.1 to reduce the cost of page construction,
it is still present. Additionally, Tapestry is full of small
optimizations that improve performance ... assuming a page is reused
over time. Throwing away pages is a non-starter.
So we're back to square one ... we can't eliminate mutable state, but
(for large applications) we can't live with it either.
Tapestry has already been down this route: the way persistent fields
are handled gives the illusion that the page is kept around between
requests. You might think that Tapestry serializes the page and stores
the whole thing in the session. In reality, Tapestry is shuffling just
the individual persistent field values in to and out of the HttpSessio.
To both the end user and the Tapestry developer, it feels like the
entire page is live between requests, but it's a bit of a shell game,
providing an equivalent page instance that has the same values in its
fields.
What's going on in trunk right now is extrapolating that concept from
persistent fields to all mutable fields. Every access to every mutable
field in a Tapestry page is converted, as part of the class
transformation process, into an access against a per-thread Map of keys
and values. The end result is that a single page instance can be used
across threads without any synchronization issues and without any
conflicts. Each thread has its own per-thread Map.
This idea was suggested in years past, but the APIs to accomplish it
(as well as the necessary meta-programming savvy) just wasn't
available. However, as a side effect of rewriting and simplifying the
class transformation APIs in 5.2, it became very reasonable to do this.
Let's take an important example: handling typical, mutable fields. This
is the responsibility of the UnclaimedFieldWorker class, part of
Tapestry component class transformation pipeline. UnclaimedFieldWorker
finds fields that have not be "claimed" by some other part of the
pipeline and converts them to read and write their values to the
per-thread Map. A claimed field may store an injected service, asset or
component, or be a component parameter.
public class UnclaimedFieldWorker implements
ComponentClassTransformWorker { private final PerthreadManager
perThreadManager; private final ComponentClassCache classCache; static
class UnclaimedFieldConduit implements FieldValueConduit { private
final InternalComponentResources resources; private final
PerThreadValue fieldValue; // Set prior to the
containingPageDidLoad lifecycle event private Object fieldDefaultValue;
private UnclaimedFieldConduit(InternalComponentResources resources,
PerThreadValue fieldValue, Object fieldDefaultValue) {
this.resources = resources; this.fieldValue = fieldValue;
this.fieldDefaultValue = fieldDefaultValue; } public Object get() {
return fieldValue.exists() ? fieldValue.get() : fieldDefaultValue; }
public void set(Object newValue) { fieldValue.set(newValue); // This
catches the case where the instance initializer method sets a value for
the field. // That value is captured and used when no specific value
has been stored. if (!resources.isLoaded()) fieldDefaultValue =
newValue; } } public UnclaimedFieldWorker(ComponentClassCache
classCache, PerthreadManager perThreadManager) { this.classCache =
classCache; this.perThreadManager = perThreadManager; } public void
transform(ClassTransformat

Re: using a js confirm to cancel an async eventlink

2010-07-14 Thread Chris Mylonas
Thanks Thiago - I've read the follow ups to this from you and Josh,  
and the "nevers" are good to know early on.
"...because of the page pooling" is a good enough reason to make it  
register.


There seems to be a shortage of "never do this" cheat sheet library in  
the 21st century :)





.java
@Property
private Date addedToJumpstart = new Date("2010-07-14");


Never initialize fields like you've done in the above snippet  
because of the page pooling. Use the activate or begin render event  
to initialize fields.


Re: OAuth support in tynamos tapestry-security

2010-07-14 Thread Kalle Korhonen
I already implemented Oauth2 for my own use, obviously utilizing
tapestry-security, not using rest though but I imagine it'd be easy to
add on top. The sore point right now is that it's not generalized
since there's a few different ways to go about it, depending on
whether you need federated user accounts or not (a combination of
local and remote user properties) but in the general case it makes
sense. Most of all, there needs to be some simple FederatedAccount
interface. If I get some interested guinea pigs, I could provide an
initial implementation which we could then refine further based on
people's needs. WDYT?

Kalle


On Wed, Jul 14, 2010 at 2:12 PM, Borut Bolčina  wrote:
> That would be awesome. I am using tapestry security in two apps currently.
> One is a 5.1 and the other T5.2. So far very smooth. I am very pleased. Keep
> up!
>
> Regards,
> Borut
>
> 2010/7/14 Moritz Gmelin 
>
>> Hi,
>>
>> I was wondering if there is some kind of support planned to support OAuth
>> authentication with tynamos tapestry-security. I would love to be able to
>> offer RESTful webservices with OAuth authentication with tapestry,
>> tapestry-restful and tapestry-security.
>> Any plans? Pointers?
>>
>> Thanks
>>
>> Moritz
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>>
>

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



Re: OAuth support in tynamos tapestry-security

2010-07-14 Thread Borut Bolčina
That would be awesome. I am using tapestry security in two apps currently.
One is a 5.1 and the other T5.2. So far very smooth. I am very pleased. Keep
up!

Regards,
Borut

2010/7/14 Moritz Gmelin 

> Hi,
>
> I was wondering if there is some kind of support planned to support OAuth
> authentication with tynamos tapestry-security. I would love to be able to
> offer RESTful webservices with OAuth authentication with tapestry,
> tapestry-restful and tapestry-security.
> Any plans? Pointers?
>
> Thanks
>
> Moritz
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


OAuth support in tynamos tapestry-security

2010-07-14 Thread Moritz Gmelin
Hi,

I was wondering if there is some kind of support planned to support OAuth 
authentication with tynamos tapestry-security. I would love to be able to offer 
RESTful webservices with OAuth authentication with tapestry, tapestry-restful 
and tapestry-security. 
Any plans? Pointers?

Thanks

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



Re: using a js confirm to cancel an async eventlink

2010-07-14 Thread Thiago H. de Paula Figueiredo
On Wed, 14 Jul 2010 15:39:11 -0300, Josh Canfield   
wrote:



HA! I guess I've been using joda-time for too long... I've always
treated Date as immutable, too bad Java 6 has to be backward
compatible with Java 1.1 or the setter methods could have been removed
a LONG time ago!


Agreed.


but I prefer to give a
short advice instead of a longer one informing the exceptions to the  
rule.


That's a valid point of view, but to say "never" without an
explanation leaves me feeling empty inside ;)


I was too lazy and busy at that time to give the full explanation. :P

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



Re: using a js confirm to cancel an async eventlink

2010-07-14 Thread Josh Canfield
HA! I guess I've been using joda-time for too long... I've always
treated Date as immutable, too bad Java 6 has to be backward
compatible with Java 1.1 or the setter methods could have been removed
a LONG time ago!

> but I prefer to give a
> short advice instead of a longer one informing the exceptions to the rule.

That's a valid point of view, but to say "never" without an
explanation leaves me feeling empty inside ;)

Josh

On Wed, Jul 14, 2010 at 11:22 AM, Thiago H. de Paula Figueiredo
 wrote:
> On Wed, 14 Jul 2010 15:13:06 -0300, Josh Canfield 
> wrote:
>
 @Property
 private Date addedToJumpstart = new Date("2010-07-14");
>>>
>>> Never initialize fields like you've done in the above snippet because of
>>> the
>>> page pooling. Use the activate or begin render event to initialize
>>> fields.
>>>
>>
>> In general that's sound advice, but if you look at the use case here
>> he's building a constant (maybe it should actually be a constant?)
>
>> safe.onstants should be declared as constants (final static). You're right
>> about initializing fields with immutable values, but I prefer to give a
>> short advice instead of a longer one informing the exceptions to the rule.
>
>> Also, Date is an immutable object so using it as an initializer is
>
> It isn't. You need to invoke deprecated methods, but it has many setXXX
> methods.
>
>> The danger with field initializers is that they'll be saved as
>> the default value for the field and modifications can be
>> unpredictable.
>
> Absolutely right. :) But this is also a huge security hole: the data store
> by one user in this object will be viewed by another user that happens to
> have a request handled by the same page object.
>
>> So, don't use mutable objects to initialize fields
>> unless you are really sure about what you are doing.
>
> Or never. :)
>
> --
> 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
>
>



-- 
--
http://www.bodylabgym.com - a private, by appointment only, one-on-one
health and fitness facility.
--
http://www.ectransition.com - Quality Electronic Cigarettes at a
reasonable price!
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.

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



Re: Ubuntu 10.04 - Error invoking service builder

2010-07-14 Thread Pablo dos Reis
HI Thiago,


Thank you.


I'll do tests in the T5.0.5 for the time being.


2010/7/14 Thiago H. de Paula Figueiredo 

> Hi, Pablo!
>
>
> On Wed, 14 Jul 2010 14:30:34 -0300, Pablo dos Reis 
> wrote:
>
>  I used the Ubuntu 9.10 and now I upgraded to 10.04.
>> Then after that I have had the error below.
>> The application use T5.2.0-SNAPSHOOT and was created with  archtype.
>>
>
> Caused by: java.lang.ClassNotFoundException:
> org.apache.tapestry5.ioc.internal.util.Defense
>
> This is not related to the operating system. Howard removed the Defense
> class in a recent commit and probably the snapshots aren't reflecting this
> yet. You've just got unlucky, I guess. :)
>
>
> --
> 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
>
>


-- 
Pablo Henrique dos Reis


Re: Expansion for Javascript

2010-07-14 Thread Thiago H. de Paula Figueiredo
On Wed, 14 Jul 2010 15:13:45 -0300, Inge Solvoll   
wrote:


And then you might say "Yeah, but something like this should be  
built-in". A lot of things should, but there aren't too many Tapestry  
committers :)


Having too many built-in features can be a problem too. Anyway, the  
recommended way of using JavaScript in Tapestry is not using 

Re: Expansion for Javascript

2010-07-14 Thread Josh Canfield
> I still had to do the escaping of the quotation marks myself

Take a look at JSONObject.quote(String string);


On Wed, Jul 14, 2010 at 10:40 AM, Tim Koop  wrote:
>  Cool!  It works!
>
> I still had to do the escaping of the quotation marks myself, but at least
> the html encoding doesn't need to be undone first.
>
>
>
> (Now if only there was outputjsstring, outputurl, outputtextarea, outputcsv,
> and outputcustom)
>
>
> Tim Koop
> t...@timkoop.com 
> www.timkoop.com 
>
> On 14/07/2010 12:30 PM, Michael Gentry wrote:
>>
>> Assuming your example is in your TML file, try:
>>
>> var name='';
>>
>> mrg
>>
>>
>> On Wed, Jul 14, 2010 at 1:27 PM, Tim Koop  wrote:
>>>
>>>  Hi everyone.
>>>
>>> I've looked through the documentation, but I can't seem to find an answer
>>> for what I'm looking for.
>>>
>>> I want to put a String into Javascript as a variable, like this:
>>>
>>> 
>>> var name = "${name}";
>>> 
>>>
>>> The problem is that if the name will have a quotation mark in it, it
>>> won't
>>> be escaped, and if it has angle brackets, they will be escaped.  So a
>>> name
>>> like: /This->"One"/ will create a variable that looks like this:
>>>
>>> 
>>> var name = "This->"One"";
>>> 
>>>
>>> There must be a simple answer for this, but I haven't found it.
>>>
>>> Thanks in advance.
>>>
>>>
>>>
>>> --
>>> Tim Koop
>>> t...@timkoop.com
>>> www.timkoop.com
>>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>>
>



-- 
--
http://www.bodylabgym.com - a private, by appointment only, one-on-one
health and fitness facility.
--
http://www.ectransition.com - Quality Electronic Cigarettes at a
reasonable price!
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.

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



Re: using a js confirm to cancel an async eventlink

2010-07-14 Thread Thiago H. de Paula Figueiredo
On Wed, 14 Jul 2010 15:13:06 -0300, Josh Canfield   
wrote:



@Property
private Date addedToJumpstart = new Date("2010-07-14");


Never initialize fields like you've done in the above snippet because  
of the
page pooling. Use the activate or begin render event to initialize  
fields.




In general that's sound advice, but if you look at the use case here
he's building a constant (maybe it should actually be a constant?)


safe.onstants should be declared as constants (final static). You're  
right about initializing fields with immutable values, but I prefer to  
give a short advice instead of a longer one informing the exceptions to  
the rule.



Also, Date is an immutable object so using it as an initializer is


It isn't. You need to invoke deprecated methods, but it has many setXXX  
methods.



The danger with field initializers is that they'll be saved as
the default value for the field and modifications can be
unpredictable.


Absolutely right. :) But this is also a huge security hole: the data store  
by one user in this object will be viewed by another user that happens to  
have a request handled by the same page object.



So, don't use mutable objects to initialize fields
unless you are really sure about what you are doing.


Or never. :)

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



Re: Ubuntu 10.04 - Error invoking service builder

2010-07-14 Thread Thiago H. de Paula Figueiredo

Hi, Pablo!

On Wed, 14 Jul 2010 14:30:34 -0300, Pablo dos Reis  
 wrote:



I used the Ubuntu 9.10 and now I upgraded to 10.04.
Then after that I have had the error below.
The application use T5.2.0-SNAPSHOOT and was created with  archtype.


Caused by: java.lang.ClassNotFoundException:  
org.apache.tapestry5.ioc.internal.util.Defense


This is not related to the operating system. Howard removed the Defense  
class in a recent commit and probably the snapshots aren't reflecting this  
yet. You've just got unlucky, I guess. :)


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



Re: Expansion for Javascript

2010-07-14 Thread Inge Solvoll
Actually, it's quite super easy to create those yourself :) Seriously, very
very easy.

Have a look at OutputRaw.java in the T5 source, and you'll get the idea.

And then you might say "Yeah, but something like this should be built-in". A
lot of things should, but there aren't too many Tapestry committers :)

Inge

On Wed, Jul 14, 2010 at 7:40 PM, Tim Koop  wrote:

>  Cool!  It works!
>
> I still had to do the escaping of the quotation marks myself, but at least
> the html encoding doesn't need to be undone first.
>
>
>
> (Now if only there was outputjsstring, outputurl, outputtextarea,
> outputcsv, and outputcustom)
>
>
>
> Tim Koop
> t...@timkoop.com 
> www.timkoop.com 
>
> On 14/07/2010 12:30 PM, Michael Gentry wrote:
>
>> Assuming your example is in your TML file, try:
>>
>> var name='';
>>
>> mrg
>>
>>
>> On Wed, Jul 14, 2010 at 1:27 PM, Tim Koop  wrote:
>>
>>>  Hi everyone.
>>>
>>> I've looked through the documentation, but I can't seem to find an answer
>>> for what I'm looking for.
>>>
>>> I want to put a String into Javascript as a variable, like this:
>>>
>>> 
>>> var name = "${name}";
>>> 
>>>
>>> The problem is that if the name will have a quotation mark in it, it
>>> won't
>>> be escaped, and if it has angle brackets, they will be escaped.  So a
>>> name
>>> like: /This->"One"/ will create a variable that looks like this:
>>>
>>> 
>>> var name = "This->"One"";
>>> 
>>>
>>> There must be a simple answer for this, but I haven't found it.
>>>
>>> Thanks in advance.
>>>
>>>
>>>
>>> --
>>> Tim Koop
>>> t...@timkoop.com
>>> www.timkoop.com
>>>
>>>  -
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>>
>>


Re: using a js confirm to cancel an async eventlink

2010-07-14 Thread Josh Canfield
>> @Property
>> private Date addedToJumpstart = new Date("2010-07-14");
>
> Never initialize fields like you've done in the above snippet because of the
> page pooling. Use the activate or begin render event to initialize fields.
>

In general that's sound advice, but if you look at the use case here
he's building a constant (maybe it should actually be a constant?)
Also, Date is an immutable object so using it as an initializer is
safe. The danger with field initializers is that they'll be saved as
the default value for the field and modifications can be
unpredictable. So, don't use mutable objects to initialize fields
unless you are really sure about what you are doing.


Josh

On Wed, Jul 14, 2010 at 8:43 AM, Thiago H. de Paula Figueiredo
 wrote:
> On Wed, 14 Jul 2010 11:13:07 -0300, Chris Mylonas 
> wrote:
>
>> .java
>> @Property
>> private Date addedToJumpstart = new Date("2010-07-14");
>
> Never initialize fields like you've done in the above snippet because of the
> page pooling. Use the activate or begin render event to initialize fields.
>
> --
> 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
>
>



-- 
--
http://www.bodylabgym.com - a private, by appointment only, one-on-one
health and fitness facility.
--
http://www.ectransition.com - Quality Electronic Cigarettes at a
reasonable price!
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.

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



Re: Expansion for Javascript

2010-07-14 Thread Thiago H. de Paula Figueiredo

On Wed, 14 Jul 2010 14:27:07 -0300, Tim Koop  wrote:


  Hi everyone.

I've looked through the documentation, but I can't seem to find an  
answer for what I'm looking for.


I want to put a String into Javascript as a variable, like this:


var name = "${name}";



The recommended and less error-prone way of using JavaScript in Tapestry 5  
is to put the most code possible in .js files and the generate the rest  
through RenderSupport.addScript().


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



Re: Expansion for Javascript

2010-07-14 Thread Tim Koop

 Cool!  It works!

I still had to do the escaping of the quotation marks myself, but at 
least the html encoding doesn't need to be undone first.




(Now if only there was outputjsstring, outputurl, outputtextarea, 
outputcsv, and outputcustom)



Tim Koop
t...@timkoop.com 
www.timkoop.com 

On 14/07/2010 12:30 PM, Michael Gentry wrote:

Assuming your example is in your TML file, try:

var name='';

mrg


On Wed, Jul 14, 2010 at 1:27 PM, Tim Koop  wrote:

  Hi everyone.

I've looked through the documentation, but I can't seem to find an answer
for what I'm looking for.

I want to put a String into Javascript as a variable, like this:


var name = "${name}";


The problem is that if the name will have a quotation mark in it, it won't
be escaped, and if it has angle brackets, they will be escaped.  So a name
like: /This->"One"/ will create a variable that looks like this:


var name = "This->"One"";


There must be a simple answer for this, but I haven't found it.

Thanks in advance.



--
Tim Koop
t...@timkoop.com
www.timkoop.com


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




Re: Expansion for Javascript

2010-07-14 Thread Michael Gentry
Actually, that would have an issue if your name had a single quote in
it.  You might have to use a hidden form value (hopefully you have a
form?).  There is a bug in the Tapestry hidden component, though, so
you have to do some tricks.  Something like ...






Then using Prototype in your JavaScript:

$('inputs')['name'].value

mrg


On Wed, Jul 14, 2010 at 1:30 PM, Michael Gentry  wrote:
> Assuming your example is in your TML file, try:
>
> var name='';
>
> mrg
>
>
> On Wed, Jul 14, 2010 at 1:27 PM, Tim Koop  wrote:
>>  Hi everyone.
>>
>> I've looked through the documentation, but I can't seem to find an answer
>> for what I'm looking for.
>>
>> I want to put a String into Javascript as a variable, like this:
>>
>> 
>> var name = "${name}";
>> 
>>
>> The problem is that if the name will have a quotation mark in it, it won't
>> be escaped, and if it has angle brackets, they will be escaped.  So a name
>> like: /This->"One"/ will create a variable that looks like this:
>>
>> 
>> var name = "This->"One"";
>> 
>>
>> There must be a simple answer for this, but I haven't found it.
>>
>> Thanks in advance.
>>
>>
>>
>> --
>> Tim Koop
>> t...@timkoop.com 
>> www.timkoop.com 
>>
>

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



Re: Expansion for Javascript

2010-07-14 Thread Michael Gentry
Assuming your example is in your TML file, try:

var name='';

mrg


On Wed, Jul 14, 2010 at 1:27 PM, Tim Koop  wrote:
>  Hi everyone.
>
> I've looked through the documentation, but I can't seem to find an answer
> for what I'm looking for.
>
> I want to put a String into Javascript as a variable, like this:
>
> 
> var name = "${name}";
> 
>
> The problem is that if the name will have a quotation mark in it, it won't
> be escaped, and if it has angle brackets, they will be escaped.  So a name
> like: /This->"One"/ will create a variable that looks like this:
>
> 
> var name = "This->"One"";
> 
>
> There must be a simple answer for this, but I haven't found it.
>
> Thanks in advance.
>
>
>
> --
> Tim Koop
> t...@timkoop.com 
> www.timkoop.com 
>

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



Ubuntu 10.04 - Error invoking service builder

2010-07-14 Thread Pablo dos Reis
I used the Ubuntu 9.10 and now I upgraded to 10.04.
Then after that I have had the error below.

The application use T5.2.0-SNAPSHOOT and was created with  archtype.

The strange is that I have other application with the same AppModule, but
using T5.1.0.5 and it works well.




[INFO] Preparing jetty:run
[INFO] [resources:resources {execution: default-resources}]
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered
resources, i.e. build is platform dependent!
[INFO] Copying 10 resources
[INFO] [compiler:compile {execution: default-compile}]
[INFO] Nothing to compile - all classes are up to date
[INFO] [resources:testResources {execution: default-testResources}]
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered
resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO] [compiler:testCompile {execution: default-testCompile}]
[INFO] Nothing to compile - all classes are up to date
[INFO] [jetty:run {execution: default-cli}]
[INFO] Configuring Jetty for project: gsoc Tapestry 5 Application
[INFO] Webapp source directory =
/home/pablo/workspace/interno/gsoc/src/main/webapp
[INFO] web.xml file =
/home/pablo/workspace/interno/gsoc/src/main/webapp/WEB-INF/web.xml
[INFO] Classes = /home/pablo/workspace/interno/gsoc/target/classes
2010-07-14 14:08:11.865::INFO:  Logging to STDERR via
org.mortbay.log.StdErrLog
[INFO] Context path = /gsoc
[INFO] Tmp directory =  determined at runtime
[INFO] Web defaults = org/mortbay/jetty/webapp/webdefault.xml
[INFO] Web overrides =  none
[INFO] Webapp directory = /home/pablo/workspace/interno/gsoc/src/main/webapp
[INFO] Starting jetty 6.1.9 ...
2010-07-14 14:08:11.940::INFO:  jetty-6.1.9
2010-07-14 14:08:11.078::INFO:  No Transaction manager found - if your
webapp requires one, please configure one.
[INFO] ioc.RegistryBuilder Adding module definition for class
org.apache.tapestry5.ioc.services.TapestryIOCModule
[INFO] ioc.RegistryBuilder Adding module definition for class
org.apache.tapestry5.services.TapestryModule
[INFO] ioc.RegistryBuilder Adding module definition for class
org.apache.tapestry5.internal.services.InternalModule
[INFO] ioc.RegistryBuilder Adding module definition for class
com.google.gsoc.web.services.AppModule
[ERROR] ioc.Registry Error invoking service contribution method
org.apache.tapestry5.services.TapestryModule.contributeComponentClassResolver(Configuration):
org/apache/tapestry5/ioc/internal/util/Defense
[ERROR] ioc.Registry Operations trace:
[ERROR] ioc.Registry [ 1] Realizing service ComponentClassResolver
[ERROR] ioc.Registry [ 2] Invoking
org.apache.tapestry5.services.TapestryModule.buildComponentClassResolver(ComponentClassResolverImpl,
InvalidationEventHub) (at TapestryModule.java:1270)
[ERROR] ioc.Registry [ 3] Determining injection value for parameter #1
(org.apache.tapestry5.internal.services.ComponentClassResolverImpl)
[ERROR] ioc.Registry [ 4] Resolving object of type
org.apache.tapestry5.internal.services.ComponentClassResolverImpl using
MasterObjectProvider
[ERROR] ioc.Registry [ 5] Autobuilding instance of
org.apache.tapestry5.internal.services.ComponentClassResolverImpl
[ERROR] ioc.Registry [ 6] Determining injection value for parameter #6
(java.util.Collection)
[ERROR] ioc.Registry [ 7] Collecting unordered configuration for service
ComponentClassResolver
[ERROR] ioc.Registry [ 8] Invoking method
org.apache.tapestry5.services.TapestryModule.contributeComponentClassResolver(Configuration)
(at TapestryModule.java:533).
[ERROR] TapestryModule.ComponentClassResolver Construction of service
ComponentClassResolver failed: Error invoking service builder method
org.apache.tapestry5.services.TapestryModule.buildComponentClassResolver(ComponentClassResolverImpl,
InvalidationEventHub) (at TapestryModule.java:1270) (for service
'ComponentClassResolver'): Error invoking constructor
org.apache.tapestry5.internal.services.ComponentClassResolverImpl(Logger,
ComponentInstantiatorSource, ClassNameLocator, String, String, Collection)
(at ComponentClassResolverImpl.java:116) (for service
'ComponentClassResolver'): Error invoking service contribution method
org.apache.tapestry5.services.TapestryModule.contributeComponentClassResolver(Configuration):
org/apache/tapestry5/ioc/internal/util/Defense
java.lang.RuntimeException: Error invoking service builder method
org.apache.tapestry5.services.TapestryModule.buildComponentClassResolver(ComponentClassResolverImpl,
InvalidationEventHub) (at TapestryModule.java:1270) (for service
'ComponentClassResolver'): Error invoking constructor
org.apache.tapestry5.internal.services.ComponentClassResolverImpl(Logger,
ComponentInstantiatorSource, ClassNameLocator, String, String, Collection)
(at ComponentClassResolverImpl.java:116) (for service
'ComponentClassResolver'): Error invoking service contribution method
org.apache.tapestry5.services.TapestryModule.contributeComponentClassResolver(Configuration):
org/apache/tapestry5/ioc/internal/util/Defense
at
org.apache.tapestry5.io

Re: Request to a unlocalized URL using the Locale stored on session

2010-07-14 Thread Thiago H. de Paula Figueiredo
On Wed, 14 Jul 2010 13:36:50 -0300, Adam Zimowski   
wrote:



@Persist
private String language;


You should use @SessionState instead and then use the  
ApplicationStateManager to read or set it.


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



Re: Request to a unlocalized URL using the Locale stored on session

2010-07-14 Thread Adam Zimowski
I found this thread as a solution to my problem of switching locale. I
can switch locale just fine and setting PersistentLocale works until I
strip the URL from language code. Juan's example below is exactly what
I need, however, because I'm returning to Tapestry after two years of
inactivity, I don't understand how I can access session from custom
request filter he suggested. Do I add session as parameter to the
method? If so, how do I retrieve language I've set in my Layout
component?

More specifically, what happens in my case is this: user switches
locale using a language dropdown (provided in my Layout component),
then language is saved:

@Persist
private String language;

So my language is in session, but how do I access it from request
filter? I have a getLanguage in my Layout component, that's all.

Adam



On Wed, Nov 18, 2009 at 1:44 PM, Everton Agner
 wrote:
> Thanks a lot, Juan and Thiago!
>
> We'll try to implement this idea... :)
>
>
>
>
> 
> De: Juan E. Maya 
> Para: Tapestry users 
> Enviadas: Quarta-feira, 18 de Novembro de 2009 16:25:55
> Assunto: Re: Request to a unlocalized URL using the Locale stored on session
>
> :) u r right tiago! It should a RequestFilter :) My memory betrayed me :)
>
> On Wed, Nov 18, 2009 at 7:06 PM, Thiago H. de Paula Figueiredo
>  wrote:
>> Em Wed, 18 Nov 2009 15:53:32 -0200, Juan E. Maya 
>> escreveu:
>>
>>> U can store the locale of the user in a cookie or in db (if u already
>>> have a session) and then set the desired locale in a
>>> ComponentRequestFilter. It would be something like this:
>>
>> Nice implementation, but why a ComponentRequestFilter and not a regular
>> RequestFilter?
>>
>> --
>> Thiago H. de Paula Figueiredo
>> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and
>> instructor
>> Owner, software architect and developer, 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
>>
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>
>      
> 
> Veja quais são os assuntos do momento no Yahoo! +Buscados
> http://br.maisbuscados.yahoo.com

Hi Everton,

U can store the locale of the user in a cookie or in db (if u already
have a session) and then set the desired locale in a
ComponentRequestFilter. It would be something like this:

public class LocaleComponentRenderRequestFilter implements
ComponentRequestFilter {

   private final SecurityContext securityContext;
   private final PersistentLocale persistentLocale;
   private final LocalizationSetter localizationSetter;
   private final Logger logger;

   /**
* @param securityContext
* @param persistentLocale
* @param logger
* @author jmayaalv
*/
   public LocaleComponentRenderRequestFilter(SecurityContext
securityContext, PersistentLocale persistentLocale, LocalizationSetter
localizationSetter, Logger logger) {
   super();
   this.securityContext = securityContext;
   this.persistentLocale = persistentLocale;
   this.localizationSetter = localizationSetter;
   this.logger = logger;
   }


   /**
* Changes the locale
* @author jmayaalv
*/
   private void changeLocale() {
   if (this.securityContext.isLoggedIn() &&
this.persistentLocale.get()
== null) {

   String language = GET LANGUANTE HERE FROM A
COOKIE, SESSION OR WHATEVER
   if (StringUtils.isNotBlank(language) &&
!"en".equalsIgnoreCase(language)) {

   if (logger.isDebugEnabled()) {
   logger.debug("Changing user
locale to '{}'", user.getLanguage());
   }

this.localizationSetter.setLocaleFromLocaleName(language);
   }
   }

   }

   @Override
   public void handleComponentEvent(ComponentEventRequestParameters
parameters, ComponentRequestHandler handler) throws IOException {
   changeLocale();
   handler.handleComponentEvent(parameters);

   }

   @Override
   public void handlePageRender(PageRenderRequestParameters parameters,
ComponentRequestHandler handler) throws IOException {
   changeLocale();
   handler.handlePageRender(parameters);

   }
}

After this u just need to contribute the chain in ur module:
public static void
contributeComponentRequestHandler(OrderedConfiguration
configuration,
   

Re: Upgrading from Tapestry5.0.18 to 5.1.0.5

2010-07-14 Thread Howard Lewis Ship
There are upgrade notes concerning tapestry-string, please check on
the web site.

On Wed, Jul 14, 2010 at 4:56 AM, Sha Aith  wrote:
>
> I do have the Tapestry-Spring integration package. I'm running this in an
> OSGi environment.
>
>
>
> Juan E. Maya wrote:
>>
>> Hi,
>> It seems to me like you are missing the tapestry-spring integration
>> jar or you have the old one still somewhere.
>>
>> On Wed, Jul 14, 2010 at 11:36 AM, Sha Aith 
>> wrote:
>>>
>>> Hi,
>>>
>>> I'm trying to upgrade from Tapestry 5.0.18 to 5.1.0.5. My projects works
>>> fine with 5.0.18, but when I use 5.1.0.5, I get the following exception.
>>> Please let me know how I can fix this problem.
>>>
>>> 2010-07-14 14:11:29.498] async-delivery-thread-1
>>> try5.ioc.services.TapestryIOCModule.MasterObjectProvider.unknown E
>>> Construction of service MasterObjectProvider failed: Error invoking
>>> constructor
>>> org.apache.tapestry5.ioc.internal.services.MasterObjectProviderImpl(List,
>>> OperationTracker) (at MasterObjectProviderImpl.java:32) via
>>> org.apache.tapestry5.ioc.services.TapestryIOCModule.bind(ServiceBinder)
>>> (at
>>> TapestryIOCModule.java:43) (for service 'MasterObjectProvider'): Error
>>> building service proxy for service 'ApplicationContext' (at
>>> org.apache.tapestry5.ioc.internal.util.internalutil...@185c043): Service
>>> id
>>> 'ApplicationContextCustomizer' is not defined by any module.
>>>
>>> --
>>> View this message in context:
>>> http://old.nabble.com/Upgrading-from-Tapestry5.0.18-to-5.1.0.5-tp29160065p29160065.html
>>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>>
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>>
>>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>>
>>
>
> --
> View this message in context: 
> http://old.nabble.com/Upgrading-from-Tapestry5.0.18-to-5.1.0.5-tp29160065p29161115.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

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



Re: using a js confirm to cancel an async eventlink

2010-07-14 Thread Thiago H. de Paula Figueiredo
On Wed, 14 Jul 2010 11:13:07 -0300, Chris Mylonas   
wrote:



.java
@Property
private Date addedToJumpstart = new Date("2010-07-14");


Never initialize fields like you've done in the above snippet because of  
the page pooling. Use the activate or begin render event to initialize  
fields.


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



Re: using a js confirm to cancel an async eventlink

2010-07-14 Thread Chris Mylonas

jeez, some people are never pleased are they...

ideally, if all the tapestry devs that came before me would have just  
built a drag and drop tapestry gui builder in html5, geoff wouldn't  
have had to build and maintain jumpstart


/ducks

***Thanks for all that came before me on this list***

Cheers
Chris



On 15/07/2010, at 12:23 AM, Erick Erickson wrote:

Making the enough-but-not-overwhelming decision is always a tough  
one. What
*I* want is an example that shows only and exactly what I want to  
see at the
moment I'm looking. Oh, and I want it to come up first on whatever  
vaguely

related terms I put in a Google search.

I almost forgot; I also want the Jumpstart examples to be cut-n- 
pasteable
into whatever code I'm working on... And don't forget to include the  
test

cases. Also cut-n-pasteable.

Do you think you'll have time to get around to that soon ...

H, sounds like what I *really* want is a Tapestry lackey who  
works for

free that I can subcontract my work to while I go sailing.

Seriously though, thanks much for your efforts, they've helped me
enormously.

Best
Erick

On Wed, Jul 14, 2010 at 9:47 AM, Geoff Callender <
geoff.callender.jumpst...@gmail.com> wrote:


Chris,

Hmmm, I'm always tossing up between keeping the examples simple and  
making
them complete. Your request is pretty compelling so I'll consider  
it for the
next release. In the meantime, here's what I use in simple  
entities...


  private java.sql.Timestamp createdAt;
  private java.sql.Timestamp modifiedAt;

  @PrePersist
  public void prePersist() throws ValidationException {
  validate();
  createdAt = new
java.sql.Timestamp(System.currentTimeMillis());
  modifiedAt = createdAt;
  }

  @PreUpdate
  public void preUpdate() throws ValidationException {
  validate();
  modifiedAt = new
java.sql.Timestamp(System.currentTimeMillis());
  }

instead of...

  @PrePersist
  @PreUpdate
  public void validate() throws ValidationException {
  // etc...
  }

For entities that have more complex state changes than just create,  
change,

and delete this isn't enough, but that's another story.

HTH,

Geoff

On 14/07/2010, at 10:47 PM, Chris Mylonas wrote:


Geoff that's a great example of some more advanced layout/theme

possibilities.


Sorry to hijack the thread somewhat,
Any chance of adding to jumpstart a "Date added" and/or "Last  
modified"

section to each example?



Cheers
Chris

On 14/07/2010, at 7:01 AM, Geoff Callender wrote:

Can't stop to consider the difference right now (maybe later  
today) but

you can see it working in this example:




http://jumpstart.doublenegative.com.au/jumpstart/examples/ajaxcomponentscrud


HTH,

Geoff

On 13/07/2010, at 10:04 PM, Paul Stanton wrote:


thanks geoff,

your last post where you put the confirm mixin on a   
within the

 is interesting .. wouldn't that be rendered as the equivalent of:


text

or at least the prototypesque version of this:

text
Event.observe($("spanId"), 'click', function(e){if (!confirm('?'))

e.stop();});


i have tried both of these approaches but neither cancel the  
event on

the ... if yours works what is the fundamental difference?


regards, p.

Geoff Callender wrote:



http://tapestry-users.832.n2.nabble.com/Confirm-mixin-won-t-cancel-when-in-zone-td5048950.html#a5048950


On 13/07/2010, at 12:31 PM, Paul Stanton wrote:



Hi all,

I was hoping to be able to use a simple js confirm in order to

(conditionally) cancel the callback from an async event link:



zone="myZone" onclick="return confirm('sure?');">delete


Unfortunately, even when 'Cancel' is clicked, the callback is

executed.


What is the simplest way to add one stage of logic to this  
process?


Thanks, Paul.

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





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






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




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







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



Re: using a js confirm to cancel an async eventlink

2010-07-14 Thread Geoff Callender
Ah, I should have realised that's what you meant. Yep, worth considering.

Thanks,

Geoff

On 15/07/2010, at 12:13 AM, Chris Mylonas wrote:

> Thanks for the reply Geoff,
> 
> Safe to ignore my request/suggestion :)
> 
> I meant moreso when the example "exercise/tutorial"  was added to jumpstart.
> E.g. you've added more AJAX examples in the past couple of months, but the 
> onActivate/onPassivate example would be a couple of years old.
> 
> and I think I found what I wanted here: 
> http://jumpstart.doublenegative.com.au/bugs_enhancements.html
> 
> 
> I was thinking of an on-the-page easy-to-find property like this:
> 
> .java
> @Property
> private Date addedToJumpstart = new Date("2010-07-14");
> 
> .tml
> This example was added to jumpstart at version ${addedJumpstartVersion} on 
> ${addedJumpstartDate}
> 
> ;)
> 
> Cheers
> Chris
> 
> 
> On 14/07/2010, at 11:47 PM, Geoff Callender wrote:
> 
>> Chris,
>> 
>> Hmmm, I'm always tossing up between keeping the examples simple and making 
>> them complete. Your request is pretty compelling so I'll consider it for the 
>> next release. In the meantime, here's what I use in simple entities...
>> 
>>  private java.sql.Timestamp createdAt;
>>  private java.sql.Timestamp modifiedAt;
>> 
>>  @PrePersist
>>  public void prePersist() throws ValidationException {
>>  validate();
>>  createdAt = new java.sql.Timestamp(System.currentTimeMillis());
>>  modifiedAt = createdAt;
>>  }
>> 
>>  @PreUpdate
>>  public void preUpdate() throws ValidationException {
>>  validate();
>>  modifiedAt = new java.sql.Timestamp(System.currentTimeMillis());
>>  }
>> 
>> instead of...
>> 
>>  @PrePersist
>>  @PreUpdate
>>  public void validate() throws ValidationException {
>>  // etc...
>>  }
>> 
>> For entities that have more complex state changes than just create, change, 
>> and delete this isn't enough, but that's another story.
>> 
>> HTH,
>> 
>> Geoff
>> 
>> On 14/07/2010, at 10:47 PM, Chris Mylonas wrote:
>> 
>>> Geoff that's a great example of some more advanced layout/theme 
>>> possibilities.
>>> 
>>> Sorry to hijack the thread somewhat,
>>> Any chance of adding to jumpstart a "Date added" and/or "Last modified" 
>>> section to each example?
>>> 
>>> 
>>> Cheers
>>> Chris
>>> 
>>> On 14/07/2010, at 7:01 AM, Geoff Callender wrote:
>>> 
 Can't stop to consider the difference right now (maybe later today) but 
 you can see it working in this example:
 

 http://jumpstart.doublenegative.com.au/jumpstart/examples/ajaxcomponentscrud
 
 HTH,
 
 Geoff
 
 On 13/07/2010, at 10:04 PM, Paul Stanton wrote:
 
> thanks geoff,
> 
> your last post where you put the confirm mixin on a  within the  
> is interesting .. wouldn't that be rendered as the equivalent of:
> 
> text
> 
> or at least the prototypesque version of this:
> 
> text
> Event.observe($("spanId"), 'click', function(e){if (!confirm('?')) 
> e.stop();});
> 
> i have tried both of these approaches but neither cancel the event on the 
> ... if yours works what is the fundamental difference?
> 
> regards, p.
> 
> Geoff Callender wrote:
>> http://tapestry-users.832.n2.nabble.com/Confirm-mixin-won-t-cancel-when-in-zone-td5048950.html#a5048950
>> 
>> On 13/07/2010, at 12:31 PM, Paul Stanton wrote:
>> 
>> 
>>> Hi all,
>>> 
>>> I was hoping to be able to use a simple js confirm in order to 
>>> (conditionally) cancel the callback from an async event link:
>>> 
>>> >> zone="myZone" onclick="return confirm('sure?');">delete
>>> 
>>> Unfortunately, even when 'Cancel' is clicked, the callback is executed.
>>> 
>>> What is the simplest way to add one stage of logic to this process?
>>> 
>>> Thanks, Paul.
>>> 
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>> 
>>> 
>> 
>> 
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>> 
>> 
>> 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org
 
>>> 
>>> 
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>> 
>> 
> 
> 
> -
> To uns

Re: using a js confirm to cancel an async eventlink

2010-07-14 Thread Erick Erickson
Making the enough-but-not-overwhelming decision is always a tough one. What
*I* want is an example that shows only and exactly what I want to see at the
moment I'm looking. Oh, and I want it to come up first on whatever vaguely
related terms I put in a Google search.

I almost forgot; I also want the Jumpstart examples to be cut-n-pasteable
into whatever code I'm working on... And don't forget to include the test
cases. Also cut-n-pasteable.

Do you think you'll have time to get around to that soon ...

H, sounds like what I *really* want is a Tapestry lackey who works for
free that I can subcontract my work to while I go sailing.

Seriously though, thanks much for your efforts, they've helped me
enormously.

Best
Erick

On Wed, Jul 14, 2010 at 9:47 AM, Geoff Callender <
geoff.callender.jumpst...@gmail.com> wrote:

> Chris,
>
> Hmmm, I'm always tossing up between keeping the examples simple and making
> them complete. Your request is pretty compelling so I'll consider it for the
> next release. In the meantime, here's what I use in simple entities...
>
>private java.sql.Timestamp createdAt;
>private java.sql.Timestamp modifiedAt;
>
>@PrePersist
>public void prePersist() throws ValidationException {
>validate();
>createdAt = new
> java.sql.Timestamp(System.currentTimeMillis());
>modifiedAt = createdAt;
>}
>
>@PreUpdate
>public void preUpdate() throws ValidationException {
>validate();
>modifiedAt = new
> java.sql.Timestamp(System.currentTimeMillis());
>}
>
> instead of...
>
>@PrePersist
>@PreUpdate
>public void validate() throws ValidationException {
>// etc...
>}
>
> For entities that have more complex state changes than just create, change,
> and delete this isn't enough, but that's another story.
>
> HTH,
>
> Geoff
>
> On 14/07/2010, at 10:47 PM, Chris Mylonas wrote:
>
> > Geoff that's a great example of some more advanced layout/theme
> possibilities.
> >
> > Sorry to hijack the thread somewhat,
> > Any chance of adding to jumpstart a "Date added" and/or "Last modified"
> section to each example?
> >
> >
> > Cheers
> > Chris
> >
> > On 14/07/2010, at 7:01 AM, Geoff Callender wrote:
> >
> >> Can't stop to consider the difference right now (maybe later today) but
> you can see it working in this example:
> >>
> >>
> http://jumpstart.doublenegative.com.au/jumpstart/examples/ajaxcomponentscrud
> >>
> >> HTH,
> >>
> >> Geoff
> >>
> >> On 13/07/2010, at 10:04 PM, Paul Stanton wrote:
> >>
> >>> thanks geoff,
> >>>
> >>> your last post where you put the confirm mixin on a  within the
>  is interesting .. wouldn't that be rendered as the equivalent of:
> >>>
> >>> text
> >>>
> >>> or at least the prototypesque version of this:
> >>>
> >>> text
> >>> Event.observe($("spanId"), 'click', function(e){if (!confirm('?'))
> e.stop();});
> >>>
> >>> i have tried both of these approaches but neither cancel the event on
> the ... if yours works what is the fundamental difference?
> >>>
> >>> regards, p.
> >>>
> >>> Geoff Callender wrote:
> 
> http://tapestry-users.832.n2.nabble.com/Confirm-mixin-won-t-cancel-when-in-zone-td5048950.html#a5048950
> 
>  On 13/07/2010, at 12:31 PM, Paul Stanton wrote:
> 
> 
> > Hi all,
> >
> > I was hoping to be able to use a simple js confirm in order to
> (conditionally) cancel the callback from an async event link:
> >
> >  zone="myZone" onclick="return confirm('sure?');">delete
> >
> > Unfortunately, even when 'Cancel' is clicked, the callback is
> executed.
> >
> > What is the simplest way to add one stage of logic to this process?
> >
> > Thanks, Paul.
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >
> >
> 
> 
>  -
>  To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>  For additional commands, e-mail: users-h...@tapestry.apache.org
> 
> 
> 
> >>
> >>
> >> -
> >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> >> For additional commands, e-mail: users-h...@tapestry.apache.org
> >>
> >
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >
>
>


Re: using a js confirm to cancel an async eventlink

2010-07-14 Thread Chris Mylonas

Thanks for the reply Geoff,

Safe to ignore my request/suggestion :)

I meant moreso when the example "exercise/tutorial"  was added to  
jumpstart.
E.g. you've added more AJAX examples in the past couple of months, but  
the onActivate/onPassivate example would be a couple of years old.


and I think I found what I wanted here: 
http://jumpstart.doublenegative.com.au/bugs_enhancements.html


I was thinking of an on-the-page easy-to-find property like this:

.java
@Property
private Date addedToJumpstart = new Date("2010-07-14");

.tml
This example was added to jumpstart at version $ 
{addedJumpstartVersion} on ${addedJumpstartDate}


;)

Cheers
Chris


On 14/07/2010, at 11:47 PM, Geoff Callender wrote:


Chris,

Hmmm, I'm always tossing up between keeping the examples simple and  
making them complete. Your request is pretty compelling so I'll  
consider it for the next release. In the meantime, here's what I use  
in simple entities...


private java.sql.Timestamp createdAt;
private java.sql.Timestamp modifiedAt;

@PrePersist
public void prePersist() throws ValidationException {
validate();
createdAt = new java.sql.Timestamp(System.currentTimeMillis());
modifiedAt = createdAt;
}

@PreUpdate
public void preUpdate() throws ValidationException {
validate();
modifiedAt = new java.sql.Timestamp(System.currentTimeMillis());
}

instead of...

@PrePersist
@PreUpdate
public void validate() throws ValidationException {
// etc...
}

For entities that have more complex state changes than just create,  
change, and delete this isn't enough, but that's another story.


HTH,

Geoff

On 14/07/2010, at 10:47 PM, Chris Mylonas wrote:

Geoff that's a great example of some more advanced layout/theme  
possibilities.


Sorry to hijack the thread somewhat,
Any chance of adding to jumpstart a "Date added" and/or "Last  
modified" section to each example?



Cheers
Chris

On 14/07/2010, at 7:01 AM, Geoff Callender wrote:

Can't stop to consider the difference right now (maybe later  
today) but you can see it working in this example:



http://jumpstart.doublenegative.com.au/jumpstart/examples/ajaxcomponentscrud

HTH,

Geoff

On 13/07/2010, at 10:04 PM, Paul Stanton wrote:


thanks geoff,

your last post where you put the confirm mixin on a  within  
the  is interesting .. wouldn't that be rendered as the  
equivalent of:


text

or at least the prototypesque version of this:

text
Event.observe($("spanId"), 'click', function(e){if (! 
confirm('?')) e.stop();});


i have tried both of these approaches but neither cancel the  
event on the ... if yours works what is the fundamental  
difference?


regards, p.

Geoff Callender wrote:

http://tapestry-users.832.n2.nabble.com/Confirm-mixin-won-t-cancel-when-in-zone-td5048950.html#a5048950

On 13/07/2010, at 12:31 PM, Paul Stanton wrote:



Hi all,

I was hoping to be able to use a simple js confirm in order to  
(conditionally) cancel the callback from an async event link:


zone="myZone" onclick="return confirm('sure?');">delete


Unfortunately, even when 'Cancel' is clicked, the callback is  
executed.


What is the simplest way to add one stage of logic to this  
process?


Thanks, Paul.

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





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






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




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






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



Re: using a js confirm to cancel an async eventlink

2010-07-14 Thread Geoff Callender
Chris,

Hmmm, I'm always tossing up between keeping the examples simple and making them 
complete. Your request is pretty compelling so I'll consider it for the next 
release. In the meantime, here's what I use in simple entities...

private java.sql.Timestamp createdAt;
private java.sql.Timestamp modifiedAt;

@PrePersist
public void prePersist() throws ValidationException {
validate();
createdAt = new java.sql.Timestamp(System.currentTimeMillis());
modifiedAt = createdAt;
}

@PreUpdate
public void preUpdate() throws ValidationException {
validate();
modifiedAt = new java.sql.Timestamp(System.currentTimeMillis());
}

instead of...

@PrePersist
@PreUpdate
public void validate() throws ValidationException {
// etc...
}

For entities that have more complex state changes than just create, change, and 
delete this isn't enough, but that's another story.

HTH,

Geoff

On 14/07/2010, at 10:47 PM, Chris Mylonas wrote:

> Geoff that's a great example of some more advanced layout/theme possibilities.
> 
> Sorry to hijack the thread somewhat,
> Any chance of adding to jumpstart a "Date added" and/or "Last modified" 
> section to each example?
> 
> 
> Cheers
> Chris
> 
> On 14/07/2010, at 7:01 AM, Geoff Callender wrote:
> 
>> Can't stop to consider the difference right now (maybe later today) but you 
>> can see it working in this example:
>> 
>>  
>> http://jumpstart.doublenegative.com.au/jumpstart/examples/ajaxcomponentscrud
>> 
>> HTH,
>> 
>> Geoff
>> 
>> On 13/07/2010, at 10:04 PM, Paul Stanton wrote:
>> 
>>> thanks geoff,
>>> 
>>> your last post where you put the confirm mixin on a  within the  
>>> is interesting .. wouldn't that be rendered as the equivalent of:
>>> 
>>> text
>>> 
>>> or at least the prototypesque version of this:
>>> 
>>> text
>>> Event.observe($("spanId"), 'click', function(e){if (!confirm('?')) 
>>> e.stop();});
>>> 
>>> i have tried both of these approaches but neither cancel the event on the 
>>> ... if yours works what is the fundamental difference?
>>> 
>>> regards, p.
>>> 
>>> Geoff Callender wrote:
 http://tapestry-users.832.n2.nabble.com/Confirm-mixin-won-t-cancel-when-in-zone-td5048950.html#a5048950
 
 On 13/07/2010, at 12:31 PM, Paul Stanton wrote:
 
 
> Hi all,
> 
> I was hoping to be able to use a simple js confirm in order to 
> (conditionally) cancel the callback from an async event link:
> 
>  zone="myZone" onclick="return confirm('sure?');">delete
> 
> Unfortunately, even when 'Cancel' is clicked, the callback is executed.
> 
> What is the simplest way to add one stage of logic to this process?
> 
> Thanks, Paul.
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 
> 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org
 
 
 
>> 
>> 
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>> 
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 



Binding component parameter of type byte[]

2010-07-14 Thread Borut Bolčina
Hi,

I am having problem binding a parameter of type byte[]. It is not bound for
some reason while imageTitle works as expected. The page template looks
like:



DynaImage is my custom component which displays image from byte[], or so it
should :-)

In my page class:

@Property
private String imageTitle;

@Property
private byte[] imageBytes;

void onActivate(Game game) {
this.game = game;
this.imageBytes = game.getImage();
this.imageTitle = "Hello";
logger.info("image size: " + this.imageBytes.length); // correctly
displays image size (cca 200kbytes)
}

And here is the component class:

public class DynaImage {

@Inject
private Logger logger;

@Inject
private ComponentResources componentResources;

@Parameter(name = "imageBytes", required = false)
private byte[] imageBytes;

@Parameter(name = "title", required = false)
private String title;

@BeginRender
protected boolean beginRender(MarkupWriter writer) throws SQLException {
if (!componentResources.isBound("title")) {
logger.warn("title not bound.");
} else {
logger.info("title: " + title);
}
if (!componentResources.isBound("imageBytes")) {
logger.warn("imageBytes not bound.");
return true;
}

ImageIcon image = null;

image = new ImageIcon(imageBytes);

// Write an action link for this photo
final Link link = componentResources.createEventLink("photo", new
Object[] { 999 });
writer.element("img", "src", link, "title", title, "alt", "Loading "
+ title, "height",
image.getIconHeight(), "width", image.getIconWidth());
componentResources.renderInformalParameters(writer);

writer.end();
return true;
}


Any help appreciated,
Borut


Re: using a js confirm to cancel an async eventlink

2010-07-14 Thread Chris Mylonas
Geoff that's a great example of some more advanced layout/theme  
possibilities.


Sorry to hijack the thread somewhat,
Any chance of adding to jumpstart a "Date added" and/or "Last  
modified" section to each example?



Cheers
Chris

On 14/07/2010, at 7:01 AM, Geoff Callender wrote:

Can't stop to consider the difference right now (maybe later today)  
but you can see it working in this example:



http://jumpstart.doublenegative.com.au/jumpstart/examples/ajaxcomponentscrud

HTH,

Geoff

On 13/07/2010, at 10:04 PM, Paul Stanton wrote:


thanks geoff,

your last post where you put the confirm mixin on a  within  
the  is interesting .. wouldn't that be rendered as the  
equivalent of:


text

or at least the prototypesque version of this:

text
Event.observe($("spanId"), 'click', function(e){if (!confirm('?'))  
e.stop();});


i have tried both of these approaches but neither cancel the event  
on the ... if yours works what is the fundamental difference?


regards, p.

Geoff Callender wrote:

http://tapestry-users.832.n2.nabble.com/Confirm-mixin-won-t-cancel-when-in-zone-td5048950.html#a5048950

On 13/07/2010, at 12:31 PM, Paul Stanton wrote:



Hi all,

I was hoping to be able to use a simple js confirm in order to  
(conditionally) cancel the callback from an async event link:


zone="myZone" onclick="return confirm('sure?');">delete


Unfortunately, even when 'Cancel' is clicked, the callback is  
executed.


What is the simplest way to add one stage of logic to this process?

Thanks, Paul.

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





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






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




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



Re: Upgrading from Tapestry5.0.18 to 5.1.0.5

2010-07-14 Thread Sha Aith

I do have the Tapestry-Spring integration package. I'm running this in an
OSGi environment.



Juan E. Maya wrote:
> 
> Hi,
> It seems to me like you are missing the tapestry-spring integration
> jar or you have the old one still somewhere.
> 
> On Wed, Jul 14, 2010 at 11:36 AM, Sha Aith 
> wrote:
>>
>> Hi,
>>
>> I'm trying to upgrade from Tapestry 5.0.18 to 5.1.0.5. My projects works
>> fine with 5.0.18, but when I use 5.1.0.5, I get the following exception.
>> Please let me know how I can fix this problem.
>>
>> 2010-07-14 14:11:29.498] async-delivery-thread-1
>> try5.ioc.services.TapestryIOCModule.MasterObjectProvider.unknown E
>> Construction of service MasterObjectProvider failed: Error invoking
>> constructor
>> org.apache.tapestry5.ioc.internal.services.MasterObjectProviderImpl(List,
>> OperationTracker) (at MasterObjectProviderImpl.java:32) via
>> org.apache.tapestry5.ioc.services.TapestryIOCModule.bind(ServiceBinder)
>> (at
>> TapestryIOCModule.java:43) (for service 'MasterObjectProvider'): Error
>> building service proxy for service 'ApplicationContext' (at
>> org.apache.tapestry5.ioc.internal.util.internalutil...@185c043): Service
>> id
>> 'ApplicationContextCustomizer' is not defined by any module.
>>
>> --
>> View this message in context:
>> http://old.nabble.com/Upgrading-from-Tapestry5.0.18-to-5.1.0.5-tp29160065p29160065.html
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>>
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Upgrading-from-Tapestry5.0.18-to-5.1.0.5-tp29160065p29161115.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



Re: Upgrading from Tapestry5.0.18 to 5.1.0.5

2010-07-14 Thread Juan E. Maya
Hi,
It seems to me like you are missing the tapestry-spring integration
jar or you have the old one still somewhere.

On Wed, Jul 14, 2010 at 11:36 AM, Sha Aith  wrote:
>
> Hi,
>
> I'm trying to upgrade from Tapestry 5.0.18 to 5.1.0.5. My projects works
> fine with 5.0.18, but when I use 5.1.0.5, I get the following exception.
> Please let me know how I can fix this problem.
>
> 2010-07-14 14:11:29.498] async-delivery-thread-1
> try5.ioc.services.TapestryIOCModule.MasterObjectProvider.unknown E
> Construction of service MasterObjectProvider failed: Error invoking
> constructor
> org.apache.tapestry5.ioc.internal.services.MasterObjectProviderImpl(List,
> OperationTracker) (at MasterObjectProviderImpl.java:32) via
> org.apache.tapestry5.ioc.services.TapestryIOCModule.bind(ServiceBinder) (at
> TapestryIOCModule.java:43) (for service 'MasterObjectProvider'): Error
> building service proxy for service 'ApplicationContext' (at
> org.apache.tapestry5.ioc.internal.util.internalutil...@185c043): Service id
> 'ApplicationContextCustomizer' is not defined by any module.
>
> --
> View this message in context: 
> http://old.nabble.com/Upgrading-from-Tapestry5.0.18-to-5.1.0.5-tp29160065p29160065.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

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



Re: using a js confirm to cancel an async eventlink

2010-07-14 Thread Paul Stanton

thanks josh, and geoff.

Josh Canfield wrote:

i have tried both of these approaches but neither cancel the event on the
... if yours works what is the fundamental difference?



when you click on the text only one click event is created and it
bubbles up through the dom.  So it first is triggered on the span and
then bubbles up to the a and so on. You need to actually cancel the
event if you want it to stop bubbling. In prototype you can use the
Event.stop() function.

Observed

$('link').observe("click", function(e) {alert("You clicked a link!");});
$('linkSpan').observe("click", function(e) { if ( confirm('stop span
click event?') ) { Event.stop(e); return false; }});


Hope that helps!

Josh

On Tue, Jul 13, 2010 at 5:04 AM, Paul Stanton  wrote:
  

thanks geoff,

your last post where you put the confirm mixin on a  within the  is
interesting .. wouldn't that be rendered as the equivalent of:

text

or at least the prototypesque version of this:

text
Event.observe($("spanId"), 'click', function(e){if (!confirm('?'))
e.stop();});

i have tried both of these approaches but neither cancel the event on the
... if yours works what is the fundamental difference?

regards, p.

Geoff Callender wrote:


http://tapestry-users.832.n2.nabble.com/Confirm-mixin-won-t-cancel-when-in-zone-td5048950.html#a5048950

On 13/07/2010, at 12:31 PM, Paul Stanton wrote:


  

Hi all,

I was hoping to be able to use a simple js confirm in order to
(conditionally) cancel the callback from an async event link:

delete

Unfortunately, even when 'Cancel' is clicked, the callback is executed.

What is the simplest way to add one stage of logic to this process?

Thanks, Paul.

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




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



  




  


Upgrading from Tapestry5.0.18 to 5.1.0.5

2010-07-14 Thread Sha Aith

Hi,

I'm trying to upgrade from Tapestry 5.0.18 to 5.1.0.5. My projects works
fine with 5.0.18, but when I use 5.1.0.5, I get the following exception.
Please let me know how I can fix this problem.

2010-07-14 14:11:29.498] async-delivery-thread-1 
try5.ioc.services.TapestryIOCModule.MasterObjectProvider.unknown E
Construction of service MasterObjectProvider failed: Error invoking
constructor
org.apache.tapestry5.ioc.internal.services.MasterObjectProviderImpl(List,
OperationTracker) (at MasterObjectProviderImpl.java:32) via
org.apache.tapestry5.ioc.services.TapestryIOCModule.bind(ServiceBinder) (at
TapestryIOCModule.java:43) (for service 'MasterObjectProvider'): Error
building service proxy for service 'ApplicationContext' (at
org.apache.tapestry5.ioc.internal.util.internalutil...@185c043): Service id
'ApplicationContextCustomizer' is not defined by any module. 

-- 
View this message in context: 
http://old.nabble.com/Upgrading-from-Tapestry5.0.18-to-5.1.0.5-tp29160065p29160065.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



RE: Conditional class for body

2010-07-14 Thread Jim O'Callaghan
Thiago, Pablo,

Thanks for the replies.  I'll try one of those methods.

Regards,
Jim.

-Original Message-
From: Thiago H. de Paula Figueiredo [mailto:thiag...@gmail.com] 
Sent: 13 July 2010 17:11
To: Tapestry users
Subject: Re: Conditional class for body

On Tue, 13 Jul 2010 13:01:35 -0300, Jim O'Callaghan  
 wrote:

> Thanks for the quick response Michael.  The reason the CSS class name  
> needs to be present in the tml is that I am not in control of the CSS /  
> overall
> look of the app, and some of the CSS / front-end people may not  
> necessarily know where to look within the java code.  I guess if no  
> other solutions are apparent I can use the property approach.

Just make your Java method look for the class name in some appropriate  
place (properties file, etc).

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



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