Re: Form field inputs automatically cleared when success reached!?

2010-11-16 Thread Fernando Padilla
I think he meant, that he opens the database transaction in the 
validation step.. then some unknown time later, he commits it within 
success.  that does sound a bit dirty to me.


On 11/16/10 11:03 AM, Howard Lewis Ship wrote:

On Mon, Nov 15, 2010 at 9:22 PM, Kalle Korhonen
kalle.o.korho...@gmail.comwrote:


That's exactly the reason why I typically save and catch the errors in
onValidateForm but commit only in onSuccess. Purists claim it's misuse
of the validate event but in practice makes sense.


Who are these purists?  That's exactly what the ValidateForm event is for.
  It's your chance to verify the form and associated behavior as a unit prior
to the determination of success and failure.



Kalle


On Mon, Nov 15, 2010 at 9:16 PM, Mihaela Pilonmihaela.pi...@gmail.com
wrote:

Hi,

I have a problem where my form field inputs are always cleared after
my success event handling.

It's all fine when I can check my inputs prior to success, such as
inside validateForm handler, but sometimes there is no error in
form, but is raised by service layer in form of exception, and I want
to catch it and stay on same page with error shown. Unfortunately in
that case form inputs are cleared. It seems that Tapestry assumes that
once the success handler is reached that everything will be fine
afterwards, whereas it doesn't have to.

How do you handle these situations folks, I'm sure this isn't something

unusual?

-MP

-
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: how to make tapestry ignore some html tags while parsing tml file

2010-11-09 Thread Fernando Padilla
I would create my own component that would output the #=   # text 
around it's body:


void beginRender( MarkupWriter writer ) {writer.raw(#= );}
void afterRender( MarkupWriter writer ) {writer.raw( #);}



then you can use that component anywhere in your templates

tr
td id=t2Col1Textt:escdata.yesterday.totalImpressions/t:esc/td
/tr



On 11/9/10 3:19 PM, Thiago H. de Paula Figueiredo wrote:

On Tue, 09 Nov 2010 20:08:04 -0200, hese 1024h...@gmail.com wrote:


Hi,


Hi!

I am using html templates in my TML file...something like the below, 
to be used with jQuery and other libraries to dynamically fill values 
easily.

tr
td id=t2Col1Text#= data.yesterday.totalImpressions #/td
/tr


Tapestry templates must be well-formed XML and it's parsed by an XML 
parser, so you need to find another solution. Maybe you'll need to use 
the OutputRaw component.


By the way, using #= inside HTML seems very, very hacky to my taste.



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



Re: DISCUSSION: Time zones and date selection

2010-08-19 Thread Fernando Padilla
 Since our apps deals with sports team schedules, timezones are 
important for us.  That's why I kept trying to suggest timezone support, 
whenever you discussed locale support.


But your main question is how to determine a client's timezone.  There 
is no http-header way to get it, and a Javascript timezone detector is 
the only thing I could come up with.  Even with Javascript timezone 
detection, you will not know a user's timezone on their first request, 
only after the timezone detector executes, calls back to the server, and 
a user's httpsession has been updated with their timezone.


Even if after you're OK with that, Javascript only gives you access to 
an offset for a particular date, but not the actual timezone Id.  To get 
the timezone Id you have to take some offset samples for a few dates, 
and back track those samples against the timezone database in Java.


What I did, was to take a few date samples ( jan, jun, today, two weeks 
from today ), and generate the offsets for those dates on the 
client-side, then compare those values against all known timezones on 
the server-side.  That will give you a short list of possible timezones 
that will all work for the user.  Then I just store that against the 
user (httpSesstion), much as you would store the user's Locale - through 
putting timezoneid in url is not an option.


If you're interested, what's the best way to give you the few files that 
would get you started?  attach to a bug?



- TimeZoneLookup.java
   - service, does the timezone database lookup, versus date offset samples
- components/common/TimeZoneDetector.java
- components/common/TimeZoneDetector.js
   - component that executes javascript to get date offset samples, and 
calls back to server for capturing

   - doesn't render if timezone has been detected already
   - we have our layout include timezone detector, so all pages include it
- pages/common/TimeZoneDetector.java
   - javascript calls back independent page (not component action)
   - because i don't want to deal with unnecessary page activation of 
pages containing the Detector




On 8/7/10 9:10 AM, Howard Lewis Ship wrote:

This is something that's been nagging me. Although there's a bunch of good
options for selecting a date (or date/time) as JavaScript components bult
into Tapestry, or available elsewhere ... none of them address the issue of
the client and the server operating in different time zones.

At the very least, these components probably should include a time zone drop
down list (or other means of selection).

I haven't been able to find a sure-fire way of determing the user's time
zone from the HttpRequest.

I'm curious what kinds of solutions the community have used to address this
issue. It would be nice to come up with a true solution for Tapestry 5.3.

One option is a bit of JavaScript that reports the client's time zone (or
just time) to the server so that the server can identify their time zone
automatically.



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



Re: Libarary core mapping not working in 5.2.0-SNAPSHOT

2010-08-19 Thread Fernando Padilla
 wait, so we can't map libraries onto the core prefix?  Can we map it 
into a  prefix?


The issue is that we leveraged that capability to essentially bring our 
libraries all under the same namespace.. To make accessing common/shared 
components easier to code against.. t:fb.time instead of 
t:fbcommon.fb.time



On 8/13/10 5:38 PM, Thiago H. de Paula Figueiredo wrote:

On Fri, 13 Aug 2010 20:09:49 -0300, raulmt rau...@gmail.com wrote:

named ViewCore inside the core package). If using the core library 
mapping will not be permited anymore, what would be the best way to 
preserve or at least redirect existing links like the previous one?


Use LinkTransformer (URL rewriting).



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



Re: DISCUSSION: Time zones and date selection

2010-08-19 Thread Fernando Padilla
 Yeah, i guess each his own.  Though the ip resolution way does seem 
cleaner in some ways, it does seem way more complicated in others.. 
and dependent on other services.. etc..


I guess we just realized that TimeZone Detector should be easily 
pluggable, to fit people's taste and requirements... :)


On 8/19/10 1:36 AM, Dmitry Gusev wrote:

I didn't use one, but I believe such service exists that resolves client
timezone by client IP.
Client IP -  Location -  TimeZone. And this all may be resolved in very
first request.

On Thu, Aug 19, 2010 at 10:43, Fernando Padillaf...@alum.mit.edu  wrote:


  Since our apps deals with sports team schedules, timezones are important
for us.  That's why I kept trying to suggest timezone support, whenever you
discussed locale support.

But your main question is how to determine a client's timezone.  There is
no http-header way to get it, and a Javascript timezone detector is the only
thing I could come up with.  Even with Javascript timezone detection, you
will not know a user's timezone on their first request, only after the
timezone detector executes, calls back to the server, and a user's
httpsession has been updated with their timezone.

Even if after you're OK with that, Javascript only gives you access to an
offset for a particular date, but not the actual timezone Id.  To get the
timezone Id you have to take some offset samples for a few dates, and back
track those samples against the timezone database in Java.

What I did, was to take a few date samples ( jan, jun, today, two weeks
from today ), and generate the offsets for those dates on the client-side,
then compare those values against all known timezones on the server-side.
  That will give you a short list of possible timezones that will all work
for the user.  Then I just store that against the user (httpSesstion), much
as you would store the user's Locale - through putting timezoneid in url is
not an option.

If you're interested, what's the best way to give you the few files that
would get you started?  attach to a bug?


- TimeZoneLookup.java
   - service, does the timezone database lookup, versus date offset samples
- components/common/TimeZoneDetector.java
- components/common/TimeZoneDetector.js
   - component that executes javascript to get date offset samples, and
calls back to server for capturing
   - doesn't render if timezone has been detected already
   - we have our layout include timezone detector, so all pages include it
- pages/common/TimeZoneDetector.java
   - javascript calls back independent page (not component action)
   - because i don't want to deal with unnecessary page activation of pages
containing the Detector




On 8/7/10 9:10 AM, Howard Lewis Ship wrote:


This is something that's been nagging me. Although there's a bunch of good
options for selecting a date (or date/time) as JavaScript components bult
into Tapestry, or available elsewhere ... none of them address the issue
of
the client and the server operating in different time zones.

At the very least, these components probably should include a time zone
drop
down list (or other means of selection).

I haven't been able to find a sure-fire way of determing the user's time
zone from the HttpRequest.

I'm curious what kinds of solutions the community have used to address
this
issue. It would be nice to come up with a true solution for Tapestry 5.3.

One option is a bit of JavaScript that reports the client's time zone (or
just time) to the server so that the server can identify their time zone
automatically.



-
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



LabJs

2010-03-24 Thread Fernando Padilla
I just learned of this neat Js library to help load Js files faster.  
Maybe Tapestry should look into leveraging it.  If the new 
JavascriptSupport, could expose script dependencies, then it could 
automatically parallelize script download.  Tapestry could then use it 
to load scripts for zones too, etc.


http://labjs.com/

Just wanted to share, to keep in the back of your mind.

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



Re: IOC Service Survey

2009-12-02 Thread Fernando Padilla
A Tapestry IoC service is just a bean.  If you read up on Spring IoC or 
Guice IoC they are all the same concepts and fulfill the same purposes.  
Each might have slightly different features mechanisms, but you get the 
idea.  So if your question is truly academic, you should be reading up 
on generic IoC concepts, sprint and guice as well.


The main design pattern used is around constructing singletons ( mostly: 
general configuration, dao access, overriding tapestry logic, and 
business logic with caching ).  But you can have the IoC container 
construct objects according to a scope, so it's not just a singleton 
pattern, but a new object per request, (business logic that has state 
specific to the current request only).



On 12/1/09 9:30 PM, Yeargan Yancey wrote:

I have a largely academic interest in Tapestry and have been following the list 
for several months. I have seen many discussions go by about the technical 
issues of implementing and using Tapestry IOC services. Recently, however, I 
began to develop a persistent and growing curiosity about the sorts of tasks 
that seasoned Tapestry developers decide to implement as IOC services; being 
especially curious about complex combinations of such services. I suspect some 
have come up with quite clever solutions and are just dying to share. Here's 
your chance. I'm asking. What is it that your IOC services do?
-
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: Tapestry-Spring in standalone mode

2009-11-13 Thread Fernando Padilla

what do your jobs do?  Why do they need anything from Tapestry?

On 11/13/09 2:54 PM, Joost Schouten (ml) wrote:
Do you mean timed java jobs (java equivalent of cron jobs)? If so, 
since you are already working with Spring, have a look at: 
http://static.springsource.org/spring/docs/2.5.x/reference/scheduling.html 



Not tapestry, but very simple too ;-)

Good luck,
Joost

Juan E. Maya wrote:

Hi, We are using Tapestry-Spring integration in our web tear without
problems but we require to have a standalone application that will
take care of the job executions. Has anybody successfully created such
 integration ? I was checking the code of the Spring SpringModuleDef
and it's highly tied to the ServletContext.

Any tips would be highly appreciated, right now i am thinking about
implementing my own  SpringModuleDef but there might be a easier that
i am not aware of.

Thanks a lot for your help

-
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: Jetty 6.16 and T5.0.13

2009-08-11 Thread Fernando Padilla
So.. read the exception stack trace fully..  If down at the bottom it 
talks about slf4j or some logging issue.. then it's because Jetty 
purposefuly hides the slf4j libraries from tapestry (because jetty ships 
with slf4j for itself ) and you have to add a particular vmarg to fix 
that.  At least this is what we do, you might be having the same issue, 
but no guarantees.



vmargs:

-Dorg.mortbay.jetty.webapp.parentLoaderPriority=true or false

(At the moment I can't get to my eclipse, so I can't remember if have to 
set to true or false)




But here are the docs for this property:

http://docs.codehaus.org/display/JETTY/Classloading
http://docs.codehaus.org/display/JETTY/SystemProperties




On 8/10/09 10:56 PM, Eldred Mullany wrote:

Hi All



I am having a strange problem with an old t5.0.13 app and jetty. When I
startup the application in Eclipse it shows that it connects to db,
starts up all services etc, however when hit a web page that contains
any component such ast:form   throws an exception
java.lang.ClassNotFoundException: caught an exception while obtaining a
class file for org.apache.tapestry5.corelib.components. I then built a
war file and deployed it under tomcat and it worked fine.



So the problem seems to be jetty, but not sure what's causing it not to
resolve classes, does anyone have any suggestions on what the cause of
this is. I checked my tapestry-core-5.0.13.jar which doesn't seem
corrupt, all classes reside in their respective packages. It would'nt
have worked in tomcat if my libraries were corrupt.



Thanks

Eldred Mullany






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



Re: T5: Include Google Analytics Code

2009-07-28 Thread Fernando Padilla
The google code doesn't HAVE to be the last thing on the page.  It will 
work anywhere on the page.  You can bring in the js file normally 
through tapestry's addScriptLink (or IncludeJavascript annotation), and 
then add the google code through addScript..


it would be something like below, but you have to learn how to deal with 
tapestry javascript and renderSupport properly. :)




renderSupport.addScriptLink(http://www.google-analytics.com/ga.js;);
renderSupport.addScript( if (typeof(_gat) == 'object') {var pageTracker 
= 
_gat._getTracker(${trackerId});pageTracker._initData();pageTracker._trackPageview();} 
);




On 7/28/09 3:27 AM, moritzgilsdorf wrote:

I tried it but it still inserts the tapestry-code after the GA code and
before the/body  tag.

Any other suggestions?



Harald Geritzer wrote:


hello,

i wrote some custom component for one of my projects. it's included just
before the closing body tag.

body
...


/body


GoogleTracker.java
==

public class GoogleTracker {

@Paramter   
private String trackerId;


public String getTrackerId() {
return trackerId;
}
}


GoogleTracker.tml
=

t:container
xmlns:t=http://tapestry.apache.org/schema/tapestry_5_1_0.xsd;
script type=text/javascript
var gaJsHost = ((https: == document.location.protocol) ? 
https://ssl.;
: http://www.;);
document.write(unescape(%3Cscript src=' + gaJsHost +
google-analytics.com/ga.js'
type='text/javascript'%3E%3C/script%3E));
/script
script type=text/javascript
if (typeof(_gat) == 'object') {
var pageTracker = _gat._getTracker(${trackerId});
pageTracker._initData();
pageTracker._trackPageview();
}
/script
/t:container

moritzgilsdorf schrieb:

Hi,

I have a problem with using Google Analytics in my project. I've added
the
GA scripts in my Layout.tml just before the closing body tag. When
rendering
the Page, Tapestry inserts between the GA scripts and the/body  the
following code:

script type=text/javascript
!--
Tapestry.onDOMLoaded(function() {
$('gene').activate();
Tapestry.init({validate:[[organism,[[required,You must provide a
value for Organism.});
});
// --

I suspect this behavior to cause GA to fail. Does anyone has a similar
problem or knows a quick workaround to solve this?

Thanks in advance!

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: t5: why always downloading these files?

2009-07-09 Thread Fernando Padilla
Not sure who depends on those files.. but they do not exist in those 
repositories..


http://mvnrepository.com/artifact/javassist/javassist

that's why it keep trying and trying to download them, but is never 
successful.  Since it's only a pom file, I suppose it doesn't break the 
build... i guess.



Angelo Chen wrote:

Hi,
every time when I run the progam, maven always displays:

Downloading:
http://snapshots.repository.codehaus.org/javassist/javassist/3.9.0.GA/javassist-3.9.0.GA.pom
Downloading:
http://repo1.maven.org/maven2/javassist/javassist/3.9.0.GA/javassist-3.9.0.GA.pom

any idea how to stop this? Thanks,

Angelo


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



Re: Java support added to Google AppEngine

2009-04-17 Thread Fernando Padilla
Don't forget right now GAE/Java is really really beta.  You are only 
allowed to have 30 cuncurrent threads?  Unless your app is only serving 
a small number of users, I can't vote to use GAE/Java for actual 
production apps, not yet..


And like someone just said, this just came out a week ago.  GAE/Java is 
not a priority feature in this landscape, not yet..


Maybe after a month, if Tapestry is still not working in GAE/Java, then 
start ratcheting up the pressure and complaints.. sorry.


So I guess if it's really really important for you, you won't be able to 
upgrade to 5.1 for a few more weeks.. sorry.


Alex Kotchnev wrote:

I'm not sure about everyone else, but for me this is a BIG issue and
is one of the reasons holding me back from moving my app to the 5.1
beta. Most likely I'll hold off on upgrading to 5.1 final if it
doesn't support GAE.

Howard was asking earlier about any showstoppers preventing 5.1 from
moving forward - this is one for me. Maybe this would be a good
feature for 5.2, who knows. Is anyone else holding off on taking up
5.1 for this reason ? Other reasons ?

Cheers,

Alex Kotchnev

On Thu, Apr 16, 2009 at 3:44 PM, Christian Köberl
tapestry.christian.koeb...@gmail.com wrote:


I grepped over the tapestry-core sources for javax.xml.stream and only
found them imported in TemplateParser and StaxTemplateParser.
Would it then be sufficient to just contribute another TemplateParser which
isn't using Woodstox (maybe the one from 5.0.1.8)?


I just tried to eliminate Woodstox and to use pure Stax API for template 
parsing. This wasn't that difficult (see 
http://derkoe.wordpress.com/2009/04/16/tapestry-51-woodstox/).

With plain Stax I still get the same error in TemplateParser. Maybe I will try 
to switch back to the 5.0.18 one when I have time.

Cheers,
Chris
--
View this message in context: 
http://n2.nabble.com/Java-support-added-to-Google-AppEngine-tp2605876p2643391.html
Sent from the Tapestry Users 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



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



Re: Java support added to Google AppEngine

2009-04-17 Thread Fernando Padilla
Cool.  I think this conversation is probably over.. as to let's wait one 
week to see what Howard comes up with..


But let me clarify what I was talking about:

I am talking about concurrent requests (which in my mind translates to # 
of request handler threads in tomcat or jetty).  And the number of 
concurrent users you can actually handle depends on how long your 
requests take to process..  Which depends on how complicated or data 
intensive your site is, etc etc..




At the bottom of http://code.google.com/appengine/docs/java/runtime.html

simultaneous dynamic requests 30 *

* An application can process around 30 active dynamic requests 
simultaneously. This means that an application whose average server-side 
request processing time is 75 milliseconds can serve up to (1000 
ms/second / 75 ms/request) * 30 = 400 requests/second without incurring 
any additional latency. Applications that are heavily CPU-bound may 
incur some additional latency in long-running requests in order to make 
room for other apps sharing the same servers. Requests for static files 
are not affected by this limit.






Christian Edward Gruber wrote:
You're not allowed to have any concurrent threads.  What do you mean?  
Concurrent requests?  There's 30 seconds max response on those.  There's 
10 cron jobs available... I'm confused.  The docs say: The total number 
of requests to the app. The per-minute quotas for application with 
billing enabled allow for up to 500 requests per second--more than one 
billion requests per month. If your application requires even higher 
quotas...  and the free daily quota for requests, divided into 
per-minute is: 7,400 requests/minute.  So I'm not sure as to what 
you're referring.


The quote info is here: http://code.google.com/appengine/docs/quotas.html

Having said all that, you're right - there's no actual requirement that 
T5.1 support a beta early look software.  The only reason I think it's 
an issue is that 5.0.x seems to work, so there's some frustration at 
play among those who have already upgraded to T5.1 who want to also be 
GAE users.  Super-awesomely-critical?  Probably not.  Just frustrating.


Christian.


On 17-Apr-09, at 12:34 , Fernando Padilla wrote:

Don't forget right now GAE/Java is really really beta.  You are only 
allowed to have 30 cuncurrent threads?  Unless your app is only 
serving a small number of users, I can't vote to use GAE/Java for 
actual production apps, not yet..


And like someone just said, this just came out a week ago.  GAE/Java 
is not a priority feature in this landscape, not yet..


Maybe after a month, if Tapestry is still not working in GAE/Java, 
then start ratcheting up the pressure and complaints.. sorry.


So I guess if it's really really important for you, you won't be able 
to upgrade to 5.1 for a few more weeks.. sorry.


Alex Kotchnev wrote:

I'm not sure about everyone else, but for me this is a BIG issue and
is one of the reasons holding me back from moving my app to the 5.1
beta. Most likely I'll hold off on upgrading to 5.1 final if it
doesn't support GAE.
Howard was asking earlier about any showstoppers preventing 5.1 from
moving forward - this is one for me. Maybe this would be a good
feature for 5.2, who knows. Is anyone else holding off on taking up
5.1 for this reason ? Other reasons ?
Cheers,
Alex Kotchnev
On Thu, Apr 16, 2009 at 3:44 PM, Christian Köberl
tapestry.christian.koeb...@gmail.com wrote:


I grepped over the tapestry-core sources for javax.xml.stream and 
only

found them imported in TemplateParser and StaxTemplateParser.
Would it then be sufficient to just contribute another 
TemplateParser which

isn't using Woodstox (maybe the one from 5.0.1.8)?


I just tried to eliminate Woodstox and to use pure Stax API for 
template parsing. This wasn't that difficult (see 
http://derkoe.wordpress.com/2009/04/16/tapestry-51-woodstox/).


With plain Stax I still get the same error in TemplateParser. Maybe 
I will try to switch back to the 5.0.18 one when I have time.


Cheers,
Chris
--
View this message in context: 
http://n2.nabble.com/Java-support-added-to-Google-AppEngine-tp2605876p2643391.html 


Sent from the Tapestry Users 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


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



Christian Edward Gruber
e-mail: christianedwardgru...@gmail.com
weblog: http://www.geekinasuit.com

Re: Java support added to Google AppEngine

2009-04-17 Thread Fernando Padilla

cool. all valid points. :) :) :)

Alex Kotchnev wrote:

Fernando,
   you're so right, I will probably have to wait a few weeks or
months. I mentioned something, as there have been a couple of
discussions on the subject on the list, and on top of that Howard
asked what the showstoppers were to releasing 5.1 . I think that this
is a good way to rephrase the question are there any showstoppers in
5.1 as what are the things stopping you from moving your 5.0 app to
5.1. In other words, 5.1 has quite a bit of nice improvements, but if
there are things holding people back on 5.0.18, then it must be
something significant.

   On the sentiment that GAE is not all that important  to complain
and put pressure (btw, I wasn't complaining or applying pressure, just
trying to start a good discussion that would be beneficial to 5.1). It
seems to me that GAE is a bit like the iPhone : it's nothing all that
new (e.g. if you wanted Java hosting you could have gotten it before
GAE, just like if you wanted a smartphone you could have gotten one
long before the iPhone). However, to a large extent it has become the
measuring stick for frameworks because of Google's visibility : if
your framework runs on GAE, it's ahead of the game, if it doesn't,
it's behind.

   On the subject of scalability and GAE : most of the apps that I
have in mind are small and probably wouldn't warrant buying hosting
for, and thus are ideal candidates for GAE . On a separate note, I see
GAE as a huge opportunity for providing services for small businesses
: e.g. getting them on Google Apps is an easy sell, then the upsell
from Google Apps to custom GAE apps is a piece of cake. Thus, the
frameworks that DO run on GAE will have an advantage in spurring
further adoption in that arena.

Cheers,

Alex Kotchnev

On Fri, Apr 17, 2009 at 12:34 PM, Fernando Padilla f...@alum.mit.edu wrote:

Don't forget right now GAE/Java is really really beta.  You are only allowed
to have 30 cuncurrent threads?  Unless your app is only serving a small
number of users, I can't vote to use GAE/Java for actual production apps,
not yet..

And like someone just said, this just came out a week ago.  GAE/Java is not
a priority feature in this landscape, not yet..

Maybe after a month, if Tapestry is still not working in GAE/Java, then
start ratcheting up the pressure and complaints.. sorry.

So I guess if it's really really important for you, you won't be able to
upgrade to 5.1 for a few more weeks.. sorry.

Alex Kotchnev wrote:

I'm not sure about everyone else, but for me this is a BIG issue and
is one of the reasons holding me back from moving my app to the 5.1
beta. Most likely I'll hold off on upgrading to 5.1 final if it
doesn't support GAE.

Howard was asking earlier about any showstoppers preventing 5.1 from
moving forward - this is one for me. Maybe this would be a good
feature for 5.2, who knows. Is anyone else holding off on taking up
5.1 for this reason ? Other reasons ?

Cheers,

Alex Kotchnev

On Thu, Apr 16, 2009 at 3:44 PM, Christian Köberl
tapestry.christian.koeb...@gmail.com wrote:

I grepped over the tapestry-core sources for javax.xml.stream and only
found them imported in TemplateParser and StaxTemplateParser.
Would it then be sufficient to just contribute another TemplateParser
which
isn't using Woodstox (maybe the one from 5.0.1.8)?


I just tried to eliminate Woodstox and to use pure Stax API for
template parsing. This wasn't that difficult (see
http://derkoe.wordpress.com/2009/04/16/tapestry-51-woodstox/).

With plain Stax I still get the same error in TemplateParser. Maybe I
will try to switch back to the 5.0.18 one when I have time.

Cheers,
Chris
--
View this message in context:
http://n2.nabble.com/Java-support-added-to-Google-AppEngine-tp2605876p2643391.html
Sent from the Tapestry Users 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


-
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: [REQUEST] Live T5 web sites, quotes, marketting

2009-04-14 Thread Fernando Padilla

We have been using Tapestry 5, it rocks.

We do so many sites using Tapestry, and mostly facebook, so here is our 
index site (not tap5):


http://www.citizensportsinc.com/

Most of the sites listed off of this site are Tapestry 5.  Except for 
Protrade.com (Tap4), and a handful of apps we bought from other startups 
(PHP).


Our flag-ship app is:

http://apps.facebook.com/citizensports/



Howard Lewis Ship wrote:

I'm putting together some new presentations about Tapestry and I could
use the help of the Tapestry community.

I need more pictures of live T5 sites.  Just send me a URL and I can
do a screen grab.  This is all about answering the question: is it
mature?

I make a number of reasonable observations about Tapestry 5, but would
love quotes to back it up:
- Fast and easy to develop
- Helps with big teams
- Great performance
- Great internationalization / localization
- Live class reloading gives almost scripting language productivity


so quotes along the lines of we were able to quickly put together
xyz or we found qrstuv much easier than our last framework or
would have been a failure without Tapestry.  Don't let me put words
in your mouth, however!



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



Re: T5 how to execute javascript after zone update?

2009-04-14 Thread Fernando Padilla
You use the normal RenderSupport.addScript(..) method.  And tapestry 
adds it to the json response, and it gets executed by loadScriptsInReply...


DH wrote:

1. If your return is Block or Zone, just put script.../script inside the 
block or zone.
2. If return is JSONObject, can do like this: 
JSONObject response = new JSONObject();
response.put(script, alert('ff');); 
return response;


Thanks,
DH


- Original Message - 
From: grabarz umrzy...@gazeta.pl

To: users@tapestry.apache.org
Sent: Wednesday, April 15, 2009 5:37 AM
Subject: T5 how to execute javascript after zone update?



is there any way to execute custom piece of javascript after zone
update? inside tapestry.js i found:

   loadScriptsInReply : function(reply, callback)

* Passed the JSON content of a Tapestry partial markup response, extracts
* the script and stylesheet information.  JavaScript libraries and 
stylesheets are loaded,
* then the callback is invoked.

and indeed it tries to evaluate passed script:

 if (reply.script) eval(reply.script);

the question is, how to inject my javascript into reply?

cheers,
m.


-
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: T5 how to execute javascript after zone update?

2009-04-14 Thread Fernando Padilla

did you try @Environmental?


DH wrote:
I remember @Inject RenderSupport is not available in ajax action request even though in latest snapshot,  I just tried several days ago and got error. 


Thanks
DH


- Original Message - 
From: Fernando Padilla 
To: Tapestry users users@tapestry.apache.org

Sent: Wednesday, April 15, 2009 10:16 AM
Subject: Re: T5 how to execute javascript after zone update?


You use the normal RenderSupport.addScript(..) method.  And tapestry 
adds it to the json response, and it gets executed by loadScriptsInReply...


DH wrote:

1. If your return is Block or Zone, just put script.../script inside the 
block or zone.
2. If return is JSONObject, can do like this: 
JSONObject response = new JSONObject();
response.put(script, alert('ff');); 
return response;


Thanks,
DH


- Original Message - 
From: grabarz umrzy...@gazeta.pl

To: users@tapestry.apache.org
Sent: Wednesday, April 15, 2009 5:37 AM
Subject: T5 how to execute javascript after zone update?



is there any way to execute custom piece of javascript after zone
update? inside tapestry.js i found:

   loadScriptsInReply : function(reply, callback)

* Passed the JSON content of a Tapestry partial markup response, extracts
* the script and stylesheet information.  JavaScript libraries and 
stylesheets are loaded,
* then the callback is invoked.

and indeed it tries to evaluate passed script:

 if (reply.script) eval(reply.script);

the question is, how to inject my javascript into reply?

cheers,
m.


-
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: Decent jetty runner for eclipse

2009-04-13 Thread Fernando Padilla

we add this to our vmargs:

-Dorg.mortbay.jetty.webapp.parentLoaderPriority=true
-Dtapestry.production-mode=false
-Xmx500m


Thiago H. de Paula Figueiredo wrote:

On Mon, Apr 13, 2009 at 2:28 PM, Sergey Didenko
sergey.dide...@gmail.com wrote:

Don't you use
webapp.setServerClasses( new String[]
{-org.mortbay.jetty.plus.jaas., org.mortbay.jetty.} );
also? As recommended on http://wiki.apache.org/tapestry/Tapestry5RunViaMain .


The line webapp.setParentLoaderPriority(true); solves the same problem
(loading of SL4J), I guess.



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



Re: Problem using many times the same component on one page

2009-04-10 Thread Fernando Padilla
Using clientId with zones can be a little bit tricky if you don't 
understand how clientIds are generated, and how they will change after 
the zone is reloaded, etc etc.  And will probably will not work when you 
try to load the zone the second time.  And using getClientId on a zone 
won't work if the zone component is not rendered ( which is the case 
here, since you're only rendering a block, not the whole page )...




I would simply have a static/literal id for your zone, it'll be more 
reliable.


t:zone id=zoneId
  a t:type=actionlink zone=zoneId.../a
/t:zone




If you're creating a zone in a loop, then you'll have to generate that 
zoneId deterministically through a property ( maybe by embedding the 
object's id that you're looping through, etc )..


t:loop source=values value=value
t:zone id=prop:zoneId
  a t:type=actionlink zone=prop:zoneId.../a
/t:zone
/t:loop

public String getZoneId() {
  return zoneId+value.getId();
}





rmkkk wrote:

Hello,

I have a component I want to inject two times in the same page. I want to
display a block when clicking on an edit button. With one component no
problem. With two components when I click on the edit button of my second
component, it's the block of the first component which is displayed.

The strange thing is that another link works fine, I can  which didn't work
before adding clientId. But with my other zone 'configZone' I can't use
clientId, I get an exception.

How can I correct that ?

I join my tml and java files.
http://www.nabble.com/file/p22988449/SportTopOdds.java SportTopOdds.java 
http://www.nabble.com/file/p22988449/SportTopOdds.tml SportTopOdds.tml 


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



access component from mixin

2009-03-31 Thread Fernando Padilla
What is the best way to get the component a mixin i applied to, from 
within the mixin?


I want to access the clientId of the component that the mixin has been 
tied to.  How would I do that?


pseudo-code:

mixin {
 afterRender {
  getComponent().getClientId();
 }
}

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



Re: [T5] Asset Url is changed via domain. Meet Problems when use Alias or AliasOverrides

2009-03-27 Thread Fernando Padilla

hmm.  Is there an AssetFactory?

Tuan wrote:
Thanks Fernando Padilla, I created AssetSourceDecorator as you said. The 
result is
   + For all assets are accessed by @includestylesheet, 
@include, It is ok.
   + For all assets are accessed in template 
${asset:tapestry_banner.gif}, it is ok when end-user go to the page in 
first time. The time after that,* it is fail, **AssetSourceDecorator is 
not called **.*  I know assetSourceImpl make cache and check whether 
cache to asset. But, T5 doesn't call AssetSourceDecorator  when cache 
for the asset is avaliable. It means that there is a class checked 
whether cache before. Do you know the class?


Actually, I met the problems (asset, asset cache ) in last month. At the 
time, I created a service AssetHelper that having a method 
getAsset(String path). When I want to access resource (css, js, image 
...), I used the service. It means that some way like that ${asset:...}, 
@inj...@path... can not be used


Now, I see my old way is not convenient. so, I try to solve the problem 
by using the ways of T5 ( ${asset:tapestry_banner.gif}, ).


This is my code:

public class AssetSourceDecorator implements AssetSource {
   ...
   private AssetSource _t5AssetSource;

   public AssetSourceDecorator(AssetSource assetSource) {  
logger.info(AssetSourceDecorator);

   *_t5AssetSource = assetSource;*
   }

   public Asset getAsset(Resource baseResource, String path, Locale 
locale) {

   logger.info(getAsset  + path );
  path = modifyPath(path);
   *return _t5AssetSource.getAsset(baseResource, path, locale);*
   }
 ...
}

public class AppModule {
   public static AssetSource decorateAssetSource(AssetSource assetSource) {
   return new AssetSourceDecorator(assetSource);
}
}





Fernando Padilla wrote:
another thing you can play with, which is sometimes easier to 
integrate, is the service decoration.


try learning about decorators.


-
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: @IncludeStylesheet and non-local CSS

2009-03-27 Thread Fernando Padilla

I vote that this is added to tapestry-core. :)

Robert Zeigler wrote:
The Chenillekit module provides a URIAssetFactory, as well; I've just 
started playing with this library, but I've been pretty pleased so far.


Robert

On Mar 26, 2009, at 3/2610:06 PM , Geoffrey Wiseman wrote:

On Thu, Mar 26, 2009 at 9:53 PM, Fernando Padilla f...@alum.mit.edu 
wrote:


that's exactly what we do.. we just named it url, instead of uri. 
:) :)



Well, it's a trivial piece of code, so if a committer wants to run 
with it -

feel free, although you might want to check to make sure I didn't do
something inappropriate along the way, as there are pieces (e.g.
localization) that I can't easily address in this setup.

 - Geoffrey
--
Geoffrey Wiseman
http://www.geoffreywiseman.ca/



-
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: [T5] Asset Url is changed via domain. Meet Problems when use Alias or AliasOverrides

2009-03-26 Thread Fernando Padilla
another thing you can play with, which is sometimes easier to integrate, 
is the service decoration.


try learning about decorators.


On 3/26/09 12:09 AM, Tuan wrote:

Hi all,

This is my problems when I use Alias or AliasOverrides. Please help me
correct them.

_*Context: *_

IndexPage.tml
html namespace=.../
t:MyComponent/
/html

MyComponent.tml
t:container namespace=...
img src=${asset:image.gif} alt=.../
/t:container

-= url of image.gif is .../components/image.gif

In my app - business logic, theme and template are used. They are
changed via *domain*. It means above image url will change via domain. Ex:
- If end user go to my app site in domain1.com, url of image should be
/components/*domain1.com*/image.gif
- ... domain2.com,  /components/*domain2.com*/image.gif

(domain1 and domain both specify same IP)

_*My solution:*_ Override service AssetSource (trig it to change path)
MyAssetSource.java

public class MyAssetSource extends AssetSourceImpl {
...
@Override
public Asset getClasspathAsset(String path) {
path = modifyPath(path); return getClasspathAsset(path, null);
}
...
}


Then, Use MyAssetSource to override T5 AssetSource service


binder.bind(AssetSource.class, MyAssetSource.class).withId(
MyAssetSource);

public void contributeAlias(ConfigurationAliasContribution configuration,
@InjectService(MyAssetSource) AssetSource assetSource) {
configuration
.add(AliasContribution.create(AssetSource.class, assetSource));
}




_*Problem:
*_ - T5 throws error when go to index page:
No adapter from type
org.apache.tapestry5.ioc.internal.util.ClasspathResource to type
org.apache.tapestry5.services.AssetFactory is available (registered
types are (none))

_*
*_- In another way, I use contributeAliasOverrides method but I also get
some errors. Look like I don't know how to use alias and aliasOverride!
Please tell me how use Alias or contributeAliasOverrides.

Thanks.
_*

*_



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



Re: @IncludeStylesheet and non-local CSS

2009-03-26 Thread Fernando Padilla
we use YUI. We simply added a url asset factory prefix (which tapestry 
should really really add by default actually, like 10 lines of code). 
If you want it, I can attach my code easily.



And no, you should not bundle yui locally.  It already does a tonne of 
on-demand loading, dependency resolution, minimization, and grouping ( 
which tapestry does now, but you know.. it's using yahoo's CDN ).


actually, I was wondering why tapestry doesn't use google's CDN for 
prototype and scriptalicious?


http://code.google.com/apis/ajaxlibs/


Howard Lewis Ship wrote:

I think you are on to something, but is bundling YUI locally a real problem?

On Thu, Mar 26, 2009 at 10:05 AM, Geoffrey Wiseman
geoffrey.wise...@gmail.com wrote:

On Thu, Mar 26, 2009 at 12:47 PM, Geoffrey Wiseman 
geoffrey.wise...@gmail.com wrote:


If I were to build component that uses YUI, and I wanted to attach the
stylesheet from Yahoo (rather than copying it to my application), it doesn't
seem as if @IncludeStylesheet will let me do that; am I correct?


This was raised before for Javascript  (
http://markmail.org/thread/pcrp6gzkyvsm37i5) -- while rendering the
Javascript right in the body of the page seems like not a big deal, it's not
really ideal for CSS, and it doesn't buy you the duplicate-detection that
@IncludeStylesheet will.  If it's possible to use external paths, even if it
means I have to do some plumbing, I'd like to know about it.

Looks like it /might/ be able to do this with my own asset factory?

 - Geoffrey
--
Geoffrey Wiseman
http://www.geoffreywiseman.ca/







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



Re: @IncludeStylesheet and non-local CSS

2009-03-26 Thread Fernando Padilla

that's exactly what we do.. we just named it url, instead of uri. :) :)

Geoffrey Wiseman wrote:

On Thu, Mar 26, 2009 at 1:40 PM, Dave Greggory davegregg...@yahoo.comwrote:


Just use RenderSupport.

I just built my own component named asset attacher for this purpose.



And if anyone's curious what the other approach might look like:

package com.tsg.tapestry;

import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.Locale;

import org.apache.tapestry5.Asset;
import org.apache.tapestry5.ioc.Resource;
import org.apache.tapestry5.services.AssetFactory;

public class UriAssetFactory implements AssetFactory {

@Override
public Asset createAsset(Resource resource) {
return new UriAsset((UriResource) resource);
}

@Override
public Resource getRootResource() {
return new UriResource();
}

private static class UriResource implements Resource {

private String path;
private URI uri;

public UriResource() {
// root uri resource
this.path = null;
this.uri = null;
}

public UriResource(String path) {
this.path = path;
try {
this.uri = new URI(path);
} catch (URISyntaxException e) {
uri = null;
}
}

private boolean isRoot() {
return path == null;
}

@Override
public boolean exists() {
if (uri != null) {
return true;
} else {
return false;
}
}

@Override
public Resource forFile(String relativePath) {
if (isRoot()) {
return new UriResource(relativePath);
} else {
return new UriResource(this.getFolder() + '/' +
relativePath);
}
}

/**
 * URI Resources can't be localized -- at least, not in any easy
manner.
 */
@Override
public Resource forLocale(Locale locale) {
return this;
}

@Override
public String getFile() {
if (isRoot()) {
return ;
} else {
int index = path.lastIndexOf('/');
if (index == -1) {
return path;
} else {
return path.substring(index + 1);
}
}
}

@Override
public String getFolder() {
if (isRoot()) {
return ;
} else {
int index = path.lastIndexOf('/');
if (index == -1) {
return ;
} else {
return path.substring(0, index);
}
}
}

@Override
public String getPath() {
return path;
}

@Override
public InputStream openStream() throws IOException {
if (isRoot()) {
throw new IOException(Cannot open stream for root uri.);
} else if (uri == null) {
throw new IOException(Cannot open stream for malformed
uri.);
} else {
return uri.toURL().openStream();
}
}

@Override
public URL toURL() {
if (uri == null) {
try {
return uri.toURL();
} catch (MalformedURLException e) {
return null;
}
} else {
return null;
}
}

@Override
public Resource withExtension(String extension) {
if (isRoot()) {
return this;
} else {
int index = path.lastIndexOf('.');
if (index == -1) {
return new UriResource(path + '.' + extension);
} else {
return new UriResource(path.substring(0, index + 1)
+ extension);
}
}
}

}

private static class UriAsset implements Asset {

private UriResource resource;

public UriAsset(UriResource resource) {
this.resource = resource;
}

@Override
public Resource getResource() {
return resource;
}

@Override
public String toClientURL() {
return resource.getPath();
}

}

}


package com.tsg.crystal.web.services;

import org.apache.tapestry5.ioc.MappedConfiguration;
import org.apache.tapestry5.services.AssetFactory;

import com.tsg.tapestry.UriAssetFactory;

public class TapestryModule {

public static void contributeAssetSource(
MappedConfigurationString, AssetFactory configuration) {
configuration.add(uri, 

Re: How to parse and map URLs?

2009-03-26 Thread Fernando Padilla
i think we had a discussion on the mailing list a bit back, I think we 
were refering to it as virtual hosting.


Michael Prescott wrote:

This probably won't help you, but have a look at URLRewriter (
http://tuckey.org/urlrewrite/), which is a filter that does URL rewriting.
I'm not sure if you can extend it with the sort of 'manipulate the context'
behavior you're looking for, but perhaps.

The context you're manipulating, by the way, could be a Spring bean with
session scope.

But I don't know enough to help you avoid having to list asset and
asset_partner and asset_partner2 in each component that uses an asset -
that would be massively annoying.

Michael

On Thu, Mar 26, 2009 at 4:04 PM, dpark dp...@exchangesolutions.com wrote:


I'm looking for any suggestions on the below:

Business Need:
A new partner client would like to leverage our current web application but
allow for some dynamic rebranding (through images).

The application will know which brand images to show based on the format of
the URL.

For example, given the following current request A:
http://domain.com/Login.page

How can I also map the following request B, to go to the exact same page?
http://domain.com/partner/Login.page

(presumably, whatever is going to be parsing the URL will set some sort of
brand context in a session object so that assets can then query it to know
what to show)

Is this a job for a custom Service Encoder (friendly URL)?

Any suggestions are welcome...
(sadly, i think i'll be able to hear a pin drop...)

DP

--
View this message in context:
http://www.nabble.com/How-to-parse-and-map-URLs--tp22730051p22730051.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: 5.0.18 - 5.1.0.1 upgrade problems

2009-03-24 Thread Fernando Padilla
I believe for page links, there is no difference.  And you can just get 
the LinkFactory.


For EventLinks, now it starts to get different because you are 
targetting both a page and a component ( which can be on a different 
page ).  I'm still not a master on figuring this out, but I know what to 
look out for:


pagelink:

http://server/page/pagecontext

eventlink:

http://server/pagewithcomponent:component/eventcontext?t:ac=pagecontextt:cp=pagetorender



Andreas Pardeike wrote:

On 24 mar 2009, at 14.20, Robert Zeigler wrote:


I think that's ugly. :)

Consider:
componentSource
.getPage
(Index
.class).getComponentResources().createPageLink(Index.class,true);

Personally, I get suspicious of call chains nested more than about 
two-deep... smells of tight coupling.


Ultimately, componentResources.createPageLink calls into LinkSource, 
which calls into ComponentEvenLinkEncoder to create the link. *shrug*.
Why not bypass the nastiness and go straight to 
ComponentEventLinkEncoder? It /is/ a public service, after all... 
Personally, though, I wonder if it should be the other way around: 
ComponentEventLinkEncoder really exposes too much of the internal 
guts of how tapestry thinks about requests: page names, nested 
component ids, etc. (In the form of the PageRequestParameters and 
ComponentEventRequestParameters objects.  In that regard, using 
component resources is correct because it hides all of the gory 
details...


Except that it still requires an ugly rats' nest of method calls.  
Creating links to pages from within services seems like such a common 
paradigm (redirecting to the login page on authentication failure, for 
example); maybe we ought to have cleaner, public support for it...


I totally agree with Robert. Plus, what is the difference between:

componentSource.getPage(XXX.class).getComponentResources().createPageLink(XXX.class,true); 

componentSource.getPage(YYY.class).getComponentResources().createPageLink(XXX.class,true); 



Will I still get the same link? If so, why do I need to get a page in 
first place?


/Andreas

-
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: Executing javascript on ajax call return

2009-03-24 Thread Fernando Padilla
This already works.. when you do RenderSupport.addScript(), while 
rendering a zone/block, it will be executed when that zone is put into 
the page.  But I can't remember what version of tapestry this got turned 
on..


Blower, Andy wrote:

I would like to be able to add javascript to the 'script' key section that is 
returned as a partial page render. Client side events are okay, but being able 
to return some JS that runs is more flexible. It's also partially there already 
and just needs exposing I think.

At present we've resorted to returning some inline JS in the markup returned. 
Nasty, but it works. I assume we've not missed a better way of doing this?


-Original Message-
From: Howard Lewis Ship [mailto:hls...@gmail.com]
Sent: 24 March 2009 00:54
To: Tapestry users
Subject: Re: Executing javascript on ajax call return

I've been thinking for a while that there needs to be more client-side
events, so that the zone element could ire tapestry:zone:fetched,
tapestry:zone:show, etc.

On Mon, Mar 23, 2009 at 3:19 PM, Thiago H. de Paula Figueiredo
thiag...@gmail.com wrote:

Is therea JIRA for that so I can vote on it?

Em Mon, 23 Mar 2009 17:29:03 -0300, Fernando Padilla

f...@alum.mit.edu

escreveu:


Nope, there is no way to do javascript callbacks after a zone is

updated.

 Zones right now are missing lifecycle callbacks, that you can hook

into.

 They do have the show/update callbacks that the Effects hook into,

but it

could/should/hopefully will be expanded, eventually.. :)

things like:

preFetch
preShow
preUpdate
postUpdate



But if you wanted to hack up your own, then start looking at

tapestry.js:

Tapestry.ZoneManager
Tapestry.Initializer.zone
Tapestry.Initializer.linkZone



Thiago H. de Paula Figueiredo wrote:

Em Mon, 23 Mar 2009 16:20:08 -0300, Hugo Palma

hugo.m.pa...@gmail.com

escreveu:


Is there a way to execute some javascript right after a zone

update is

performed ?  I can't seem to find a place where i can register to

listen

for an ajax call return.

 Well, Prototype has a global way to provide these callbacks:
http://www.prototypejs.org/api/ajax/options. If you have more than

one zone

in a single page, I don't know how you would do that.




-

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




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

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





--
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

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





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



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



Re: Executing javascript on ajax call return

2009-03-24 Thread Fernando Padilla

Howard, since you're into doing quick fixes/enhancements. :)

could you please add a loading effect for zones? :)

since at the moment other developers in our company have added local 
hacks to get a little loading effect going (simple hour glass or 
somesuch), but I would love to rip out all of our hackish code, if 
tapestry can support it natively. :)


it would be the first motivator for more zone events. I would just add 
loading effects :)  And you can leave the show/update ones.  I would 
even add loadingEnd, showEnd, updateEnd, to allow you to chain effects 
together easier, for transitions: slide right, then fade in. or fade 
out, then slight in left, etc.





.loading {
	background-image: url( 
http://ssres.s3.amazonaws.com/img/bg/loadingCircle.gif );

background-repeat: no-repeat;
padding-top: 5px;
min-height: 20px;
}


Blower, Andy wrote:

Fantastic, might be worth removing the line Currently, the partial page content 
that is rendered may not use an Environmental services. This is expected to change 
soon. from http://tapestry.apache.org/tapestry5.1/guide/ajax.html then.


-Original Message-
From: Hugo Palma [mailto:hugo.m.pa...@gmail.com]
Sent: 24 March 2009 18:23
To: Tapestry users
Subject: Re: Executing javascript on ajax call return

I've just tried using renderSupport on a partial page render and it
worked
great. I'm using 5.1.0.2-SNASHOT.

On Tue, Mar 24, 2009 at 4:14 PM, Blower, Andy
andy.blo...@proquest.co.ukwrote:


Unfortunately this doesn't work because Environmental stuff is not
available when doing partial page renders - well for 5.0.18 at least,

maybe

it works with 5.1.0.1? This is the perfect mechanism for doing this

though.

I'll be trying 5.1 later this week so I'll try it again then.

Thanks.


-Original Message-
From: Fernando Padilla [mailto:f...@alum.mit.edu]
Sent: 24 March 2009 15:35
To: Tapestry users
Subject: Re: Executing javascript on ajax call return

This already works.. when you do RenderSupport.addScript(), while
rendering a zone/block, it will be executed when that zone is put

into

the page.  But I can't remember what version of tapestry this got
turned
on..

Blower, Andy wrote:

I would like to be able to add javascript to the 'script' key

section

that is returned as a partial page render. Client side events are

okay,

but being able to return some JS that runs is more flexible. It's

also

partially there already and just needs exposing I think.

At present we've resorted to returning some inline JS in the

markup

returned. Nasty, but it works. I assume we've not missed a better

way

of doing this?

-Original Message-
From: Howard Lewis Ship [mailto:hls...@gmail.com]
Sent: 24 March 2009 00:54
To: Tapestry users
Subject: Re: Executing javascript on ajax call return

I've been thinking for a while that there needs to be more

client-

side

events, so that the zone element could ire

tapestry:zone:fetched,

tapestry:zone:show, etc.

On Mon, Mar 23, 2009 at 3:19 PM, Thiago H. de Paula Figueiredo
thiag...@gmail.com wrote:

Is therea JIRA for that so I can vote on it?

Em Mon, 23 Mar 2009 17:29:03 -0300, Fernando Padilla

f...@alum.mit.edu

escreveu:


Nope, there is no way to do javascript callbacks after a zone

is

updated.

 Zones right now are missing lifecycle callbacks, that you can

hook

into.

 They do have the show/update callbacks that the Effects hook

into,

but it

could/should/hopefully will be expanded, eventually.. :)

things like:

preFetch
preShow
preUpdate
postUpdate



But if you wanted to hack up your own, then start looking at

tapestry.js:

Tapestry.ZoneManager
Tapestry.Initializer.zone
Tapestry.Initializer.linkZone



Thiago H. de Paula Figueiredo wrote:

Em Mon, 23 Mar 2009 16:20:08 -0300, Hugo Palma

hugo.m.pa...@gmail.com

escreveu:


Is there a way to execute some javascript right after a zone

update is

performed ?  I can't seem to find a place where i can

register

to

listen

for an ajax call return.

 Well, Prototype has a global way to provide these callbacks:
http://www.prototypejs.org/api/ajax/options. If you have more

than

one zone

in a single page, I don't know how you would do that.


--



--

-

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

h...@tapestry.apache.org


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

---



--

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




--
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind





-

To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org

Re: dialog component

2009-03-23 Thread Fernando Padilla
if someone is actually going to be doing a dialog component for 
tapestry, please just think about doing a zoneDialog component :)


In our company we created a zone.dialog backed by YUI ( since it's YUI, 
i have not submitted it to tapestry.. ).  So it's really easy, and quite 
popular.  It works just like a normal Zone, except that it pops up a 
dialog, instead of putting it inside of the page. :)


zones are already encapsulated behind the ZoneManager interface, you 
just have to create a new ZoneManager that deals with the dialog, 
instead of simply squirting the html content within a div..



Ville Virtanen wrote:

Here is an example of an confirm dialog that intercepts the users click and
displays question proceed? to the user. If that was what you are after?

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

 - Ville


Jorge Saridis wrote:

Ville, I did vote

Can you tell me how to invoke a javascript function from a server side
event? For example before the onActionFromXXX actionlink event.
Thanks in advance
Jorge

On Sun, 2009-03-22 at 02:41 -0700, Ville Virtanen wrote:


Hi,

Please vote the JIRA issue https://issues.apache.org/jira/browse/TAP5-558 


I created that because in my opinion T5 is missing real usable dialog
component currently. (It should be part of the main distribution imho.)

 - Ville


Jorge Saridis wrote:

Hi, does anybody know if there is an Ajax Dialog component for tapestry
5 like the one for tapestry 4.1?
Thanks in advance
George








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



Re: dialog component

2009-03-23 Thread Fernando Padilla

I'm just saying.. :)

I was waiting for tapestry to support pluggable javascript base.. then I 
would push/support a YUI/tapestry base, which zoneDialog would be part 
of that. :)


But actually it might not be too hard to package up the ZoneDialog/YUI 
as a stand-alone library.  Though at the moment, I don't have much free 
time, but if anyone else is intereested.


I also have a version of the autocomplete with yui too.  It supports the 
same event call back as tapestry's autocomplete mixing to execute the 
serach, but it does support client-side rendering of that (not just 
server-side).



Thiago H. de Paula Figueiredo wrote:
Em Mon, 23 Mar 2009 15:42:19 -0300, Fernando Padilla f...@alum.mit.edu 
escreveu:


if someone is actually going to be doing a dialog component for 
tapestry, please just think about doing a zoneDialog component :)


Nice idea!

In our company we created a zone.dialog backed by YUI ( since it's 
YUI, i have not submitted it to tapestry.. ).


As long as YUI license is Apache 2-compatible, I don't think this would 
be an issue. By the way, you can contribute it to Chenille Kit or host a 
new project in Tapestry 360.




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



Re: Executing javascript on ajax call return

2009-03-23 Thread Fernando Padilla
Nope, there is no way to do javascript callbacks after a zone is 
updated.  Zones right now are missing lifecycle callbacks, that you can 
hook into.  They do have the show/update callbacks that the Effects hook 
into, but it could/should/hopefully will be expanded, eventually.. :)


things like:

preFetch
preShow
preUpdate
postUpdate



But if you wanted to hack up your own, then start looking at tapestry.js:

Tapestry.ZoneManager
Tapestry.Initializer.zone
Tapestry.Initializer.linkZone



Thiago H. de Paula Figueiredo wrote:
Em Mon, 23 Mar 2009 16:20:08 -0300, Hugo Palma hugo.m.pa...@gmail.com 
escreveu:



Is there a way to execute some javascript right after a zone update is
performed ?  I can't seem to find a place where i can register to 
listen for an ajax call return.


Well, Prototype has a global way to provide these callbacks: 
http://www.prototypejs.org/api/ajax/options. If you have more than one 
zone in a single page, I don't know how you would do that.




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



Re: Tapestry4e - New free eclipse plugin for Tapestry 5

2009-03-20 Thread Fernando Padilla

huge pat on the back for tackling this! :)

Though I vote/recommend that you change the name :) because I am already 
confused.. use Tapestry4e when you want to develop Tapestry v5, but not 
Tapestry v4. :)  And there might be branding confusing as well.. 
between the Tapestry plugin and the Tapestry framework.. (probably can't 
include Tapestry in the name)..


other than that, I can't wait to try it and have it mature! :)



On 3/20/09 8:32 AM, Juan Miguel Salamanca wrote:

Hello all,

I have started the development of a new open source eclipse plugin, called
Tapestry4e. The code is licensed using GPL v3. It is hosted in this address:

http://code.google.com/p/tapestry4e/. I would like to invite all of you to
try it and send me your feedback.

The main feature of the project, is an editor for tapestry templates, that
extends eclipse WTP HTML editor, and provides content assist for components
and parameters, apart from the HTML, CSS and JS support that the WTP editor
provides. Content assist for properties is planned for Milestone 1.0. The
project also implements a builder to provide

Also, I am implementing wizards to provide support for common tasks, such
as:

- Switch between a T5 class and a template
- New TML template wizard
- New Page/Component wizard

Please contact me if you are interested in helping. I hope that you find it
useful.

Kind regards,

Juan M Salamanca



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



Re: T5.1: date modified in asset cache path

2009-03-19 Thread Fernando Padilla
I myself want the assets to be cached with a MD5 signature, so I don't 
have to track explicit versions.. etc etc. (that's what we do right now 
with our own AssetFactory, but we have not upgraded to 5.1..)


On 3/19/09 9:33 AM, Jack Nuzbit wrote:

I've just upgraded an application from 5.0.18 to 5.1.0.1 (a very smooth
upgrade i might add) and I'm very impressed with the new performance
features, gzipping and the far future asset headers.

I was wondering if anyone's considered adding the facility to use an assets
date modified in the cache url so they could stay cached over multiple
application versions. I would say 99% of assets remain the same over
different application versions so this would be a big win. I tried it out by
making a change to the ContextAssetFactory and the AssetDispatcher and it
worked very nicely.

Anyone have any thoughts on this?


Jack



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



Re: T5.1: date modified in asset cache path

2009-03-19 Thread Fernando Padilla

For that we put images into S3, so we have valid perma-links :)
Since tapestry does lots of url magic, we never use relative urls.

Howard Lewis Ship wrote:

Much of the time, you will be using CSS and other assets in concert
with each other. If you created a virtual folder for the CSS based on
the DTM of the CSS, relative URLs from the CSS file to image assets
(each in a virtual folder based on DTM of the asset) would break.

On Thu, Mar 19, 2009 at 10:22 AM, Fernando Padilla f...@alum.mit.edu wrote:

I myself want the assets to be cached with a MD5 signature, so I don't have
to track explicit versions.. etc etc. (that's what we do right now with our
own AssetFactory, but we have not upgraded to 5.1..)

On 3/19/09 9:33 AM, Jack Nuzbit wrote:

I've just upgraded an application from 5.0.18 to 5.1.0.1 (a very smooth
upgrade i might add) and I'm very impressed with the new performance
features, gzipping and the far future asset headers.

I was wondering if anyone's considered adding the facility to use an
assets
date modified in the cache url so they could stay cached over multiple
application versions. I would say 99% of assets remain the same over
different application versions so this would be a big win. I tried it out
by
making a change to the ContextAssetFactory and the AssetDispatcher and it
worked very nicely.

Anyone have any thoughts on this?


Jack


-
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: t5: overriding URLEncoder

2009-03-18 Thread Fernando Padilla

oh. right. another option is to look up decoration.

So instead of whole-sale replacing it, you can decorate the default 
service with your own logic.  Pretty easy.



On 3/18/09 10:11 AM, Robert Zeigler wrote:

There are two services:
Alias
AliasOverrides.
Alias is intended for services that can be overridden. (ie, when there
might be multiple services implementing the same interface and you want
to specify, by default, which to use).
AliasOverrides is intended for when you want to override the default.
So, you should be contributing to AliasOverrides, really.

Your problem here is that your url encoder implementation apparently has
dependencies that rely on the alias service.
This is /really/ easy to hit, I've found, unfortunately.

If you're on 5.1, you could try the new ServiceOverride service; that
/might/ help you.

If you're providing your own URLEncoder implementation, then sometimes
recursion problems are helped by doing something like:

public static void contributeAliasOverrides(@Local URLEncoder encoder);

But YMMV.

Robert

On Mar 17, 2009, at 3/177:48 PM , Angelo Chen wrote:



Hi,

here is my code:
binder.bind(MyURLEncoderImpl.class, MyURLEncoderImpl.class);

public static void contributeAlias( MyURLEncoderImpl enc,
ConfigurationAliasContribution conf ) {
conf.add( AliasContribution.create( URLEncoder.class, enc ) );
}
but still get:

[ERROR] Registry Construction of service 'Alias' has failed due to
recursion: the service depends on itself in some way.


Fernando Padilla wrote:


looks like I might have had another typo?

The function is contributeAlias, not contributeAliasOverrides. Not
sure if you have already caught that.

http://tapestry.apache.org/tapestry5/guide/alias.html


but aside from that. can you put up the exact code you have?


Angelo Chen wrote:

Hi,

Thanks for the reply, I tried:
1. there is no AliasConfiguration, I replaced it with AliasContribution
2. got this error:
[ERROR] Registry Construction of service 'AliasOverrides' has failed
due
to
recursion: the service depends on itself in some way. Please check
org.apache.tapestry5.internal.services.AliasManagerImpl(Logger,
Collection)
(at AliasManagerImpl.java:32) via
org.apache.tapestry5.services.TapestryModule.bind(ServiceBinder) (at
TapestryModule.java:150) for references to another service that is
itself
dependent on service 'AliasOverrides'.

any idea?


Fernando Padilla wrote:

Sadly, this feature is aliasing, not override. So technically, you
should not step on the toes of the original service at all..


1) So do not use withId(URLEncoder), since there is already a
service with that name. Try changing that to URLEncoder2.

2) if you bind it to URLEncoder.class, like you did, then anyone
that
asks for a URLEncoder (@Inject URLEncoder enc), will fail, because
tapestry will see 2 possible matches. So i could bind it to your raw
class for now.

I think this code will work ( but untested ).


binder.bind( MyURLEncoderImpl.class, MyURLEncoderImpl.class );

public static void contributeAliasOverrides( MyURLEncoderImpl enc,
ConfigurationAliasConfiguration? conf ) {
conf.add( AliasConfiguration.create( URLEncoder.class, enc ) );
}




On 3/17/09 9:44 AM, Angelo Chen wrote:

Thanks, but can't make it work, here is my code, must be missing
something:

binder.bind(URLEncoder.class,
MyURLEncoderImpl.class).withId(URLEncoder);

public static void contributeAliasOverrides(
@InjectService(URLEncoder) URLEncoder urlencoder,
ConfigurationAliasContribution? configuration) {

configuration.add(
AliasContribution.create(
URLEncoder.class, urlencoder));
}



Ulrich Stärk wrote:

I'm sorry. It's not in the ioc documentation but in the alias
section
of
the user guide:
http://tapestry.apache.org/tapestry5/guide/alias.html

Uli

Ulrich Stärk schrieb:

Check the tapestry-ioc documentation on how to override a service.

Ui

Angelo Chen schrieb:

Hi,

I'd like to override the URLEncoder to allow '=' as part of URL,
here
is
what I did:

binder.bind(URLEncoder.class, URLEncoderImpl.class);

but I got this:
2009-03-17 23:58:13.215::WARN: failed app
ava.lang.RuntimeException: Service id 'URLEncoder' has already
been
defined
by org.apache.tapestry5.internal.services.URLEncoderImpl() (at
URLEncoderImpl.java:22) via
org.apache.tapestry5.services.TapestryModule.bind(ServiceBinder) (at

TapestryModule.java:150) and may not be redefined by
org.abx.myapp.t5.services.URLEncoderImpl() (at
URLEncoderImpl.java:22)
via
org.abx.myapp.t5.services.AppModule.bind(ServiceBinder) (at
AppModule.java:42). You should rename one of the service builder
methods.
at
org.apache.tapestry5.ioc.internal.RegistryImpl.init(RegistryImpl.java:170)




-

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

Re: t5: overriding URLEncoder

2009-03-17 Thread Fernando Padilla
Sadly, this feature is aliasing, not override.  So technically, you 
should not step on the toes of the original service at all..



1) So do not use withId(URLEncoder), since there is already a 
service with that name.  Try changing that to URLEncoder2.


2) if you bind it to URLEncoder.class, like you did, then anyone that 
asks for a URLEncoder (@Inject URLEncoder enc), will fail, because 
tapestry will see 2 possible matches.  So i could bind it to your raw 
class for now.


I think this code will work ( but untested ).


binder.bind( MyURLEncoderImpl.class, MyURLEncoderImpl.class );

public static void contributeAliasOverrides( MyURLEncoderImpl enc, 
ConfigurationAliasConfiguration? conf ) {

  conf.add( AliasConfiguration.create( URLEncoder.class, enc ) );
}




On 3/17/09 9:44 AM, Angelo Chen wrote:

Thanks, but can't make it work, here is my code, must be missing something:

   binder.bind(URLEncoder.class,
MyURLEncoderImpl.class).withId(URLEncoder);

public static void contributeAliasOverrides(
 @InjectService(URLEncoder) URLEncoder urlencoder,
 ConfigurationAliasContribution?  configuration) {

 configuration.add(
 AliasContribution.create(
 URLEncoder.class, urlencoder));
 }



Ulrich Stärk wrote:

I'm sorry. It's not in the ioc documentation but in the alias section of
the user guide:
http://tapestry.apache.org/tapestry5/guide/alias.html

Uli

Ulrich Stärk schrieb:

Check the tapestry-ioc documentation on how to override a service.

Ui

Angelo Chen schrieb:

Hi,

I'd like to override the URLEncoder to allow '=' as part of URL, here is
what I did:

  binder.bind(URLEncoder.class, URLEncoderImpl.class);

but I got this:
2009-03-17 23:58:13.215::WARN:  failed app
ava.lang.RuntimeException: Service id 'URLEncoder' has already been
defined
by org.apache.tapestry5.internal.services.URLEncoderImpl() (at
URLEncoderImpl.java:22) via
org.apache.tapestry5.services.TapestryModule.bind(ServiceBinder) (at
TapestryModule.java:150) and may not be redefined by
org.abx.myapp.t5.services.URLEncoderImpl() (at URLEncoderImpl.java:22)
via
org.abx.myapp.t5.services.AppModule.bind(ServiceBinder) (at
AppModule.java:42). You should rename one of the service builder
methods.
 at
org.apache.tapestry5.ioc.internal.RegistryImpl.init(RegistryImpl.java:170)




-
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: Spring root context and Tap 5.1

2009-03-17 Thread Fernando Padilla

No. I think you can only do one way or the other at the moment.


Inge Solvoll wrote:

Does that configuration mean that you can't inject T5 IoC services into
spring?

On Tue, Mar 17, 2009 at 3:47 PM, Anthony Schexnaildre apsch...@gmail.comwrote:


Thank you.

-Anthony


On Mar 17, 2009, at 10:36 AM, Andy Pahne wrote:



I think the reason is: the context is iniitialized twice. Once by the
filter you defined in your web.xml and once by tapestry-spring.

If you prefer tapestry-spring NOT initializing your context, then add this
to your web.xml

 !-- tapestry-spring should not initialize spring context, we have a
filter for that --
 context-param
param-nametapestry.use-external-spring-context/param-name
param-valuetrue/param-value
 /context-param




Anthony Schexnaildre schrieb:


From my reading it seems Tap 5.1 is supposed to be backwards compatible
with 5.0.18 but not quite there yet. I am running Tapestry in the same
webapp as RestEasy. I am creating a root spring context that both resteasy
and tapestry share. I just added 5.1 to try it out and I get an exception on
jetty start up.

Caused by: org.apache.tapestry5.ioc.internal.OperationException: Cannot
initialize context because there is already a root application context
present - check whether you have multiple ContextLoader* definitions in your
web.xml!
  at
org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:90)
  at
org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:68)
  at
org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:939)
  at
org.apache.tapestry5.internal.spring.SpringModuleDef$3.createObject(SpringModuleDef.java:166)
  at
org.apache.tapestry5.ioc.internal.OperationTrackingObjectCreator$1.invoke(OperationTrackingObjectCreator.java:45)
  at
org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:68)
  at
org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:68)
  at
org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:939)
  at
org.apache.tapestry5.ioc.internal.OperationTrackingObjectCreator.createObject(OperationTrackingObjectCreator.java:49)
  at
org.apache.tapestry5.ioc.internal.SingletonServiceLifecycle.createService(SingletonServiceLifecycle.java:29)
  at
org.apache.tapestry5.ioc.internal.LifecycleWrappedServiceCreator.createObject(LifecycleWrappedServiceCreator.java:52)
  at
org.apache.tapestry5.ioc.internal.AdvisorStackBuilder.createObject(AdvisorStackBuilder.java:60)
  at
org.apache.tapestry5.ioc.internal.InterceptorStackBuilder.createObject(InterceptorStackBuilder.java:52)
  at
org.apache.tapestry5.ioc.internal.RecursiveServiceCreationCheckWrapper.createObject(RecursiveServiceCreationCheckWrapper.java:60)
  at
org.apache.tapestry5.ioc.internal.OperationTrackingObjectCreator$1.invoke(OperationTrackingObjectCreator.java:45)
  at
org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:68)
  at
org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:68)
  at
org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:939)
  at
org.apache.tapestry5.ioc.internal.OperationTrackingObjectCreator.createObject(OperationTrackingObjectCreator.java:49)
  at
org.apache.tapestry5.ioc.internal.services.JustInTimeObjectCreator.createObject(JustInTimeObjectCreator.java:65)
  ... 54 more
Caused by: java.lang.IllegalStateException: Cannot initialize context
because there is already a root application context present - check whether
you have multiple ContextLoader* definitions in your web.xml!
  at
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:182)
  at
org.apache.tapestry5.internal.spring.SpringModuleDef$3$1.invoke(SpringModuleDef.java:176)
  at
org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:68)
  ... 73 more
2009-03-17 10:15:13.154::INFO:  Started selectchannelconnec...@0.0.0.0
:8080


web.xml:


web-app

  display-namePaymentObjects Webservices/display-name
  context-param
  param-nameresteasy.servlet.mapping.prefix/param-name
  param-value/ws/param-value
  /context-param

  context-param
  !--
  The only significant configuration for Tapestry 5, this informs
  Tapestry of where to look for pages, components and mixins.
  --
  param-nametapestry.app-package/param-name
  param-valuecom.paymentobjects.webservices.site/param-value
  /context-param

  context-param
  param-namecontextConfigLocation/param-name
  param-valueclasspath:webservices-client-context.xml
classpath:webservices-context.xml/param-value
  /context-param

  context-param
  param-namelocatorFactorySelector/param-name
  param-valueclasspath:rootContext.xml/param-value
  /context-param

  context-param
  param-nameparentContextKey/param-name
  

Re: t5: overriding URLEncoder

2009-03-17 Thread Fernando Padilla

looks like I might have had another typo?

The function is contributeAlias, not contributeAliasOverrides.  Not 
sure if you have already caught that.


http://tapestry.apache.org/tapestry5/guide/alias.html


but aside from that. can you put up the exact code you have?


Angelo Chen wrote:

Hi,

Thanks for the reply, I tried:
1. there is no AliasConfiguration, I replaced it with AliasContribution
2. got this error:
[ERROR] Registry Construction of service 'AliasOverrides' has failed due to
recursion: the service depends on itself in some way. Please check
org.apache.tapestry5.internal.services.AliasManagerImpl(Logger, Collection)
(at AliasManagerImpl.java:32) via
org.apache.tapestry5.services.TapestryModule.bind(ServiceBinder) (at
TapestryModule.java:150) for references to another service that is itself
dependent on service 'AliasOverrides'.

any idea?


Fernando Padilla wrote:
Sadly, this feature is aliasing, not override.  So technically, you 
should not step on the toes of the original service at all..



1) So do not use withId(URLEncoder), since there is already a 
service with that name.  Try changing that to URLEncoder2.


2) if you bind it to URLEncoder.class, like you did, then anyone that 
asks for a URLEncoder (@Inject URLEncoder enc), will fail, because 
tapestry will see 2 possible matches.  So i could bind it to your raw 
class for now.


I think this code will work ( but untested ).


binder.bind( MyURLEncoderImpl.class, MyURLEncoderImpl.class );

public static void contributeAliasOverrides( MyURLEncoderImpl enc, 
ConfigurationAliasConfiguration? conf ) {

   conf.add( AliasConfiguration.create( URLEncoder.class, enc ) );
}




On 3/17/09 9:44 AM, Angelo Chen wrote:

Thanks, but can't make it work, here is my code, must be missing
something:

   binder.bind(URLEncoder.class,
MyURLEncoderImpl.class).withId(URLEncoder);

public static void contributeAliasOverrides(
 @InjectService(URLEncoder) URLEncoder urlencoder,
 ConfigurationAliasContribution?  configuration) {

 configuration.add(
 AliasContribution.create(
 URLEncoder.class, urlencoder));
 }



Ulrich Stärk wrote:

I'm sorry. It's not in the ioc documentation but in the alias section of
the user guide:
http://tapestry.apache.org/tapestry5/guide/alias.html

Uli

Ulrich Stärk schrieb:

Check the tapestry-ioc documentation on how to override a service.

Ui

Angelo Chen schrieb:

Hi,

I'd like to override the URLEncoder to allow '=' as part of URL, here
is
what I did:

  binder.bind(URLEncoder.class, URLEncoderImpl.class);

but I got this:
2009-03-17 23:58:13.215::WARN:  failed app
ava.lang.RuntimeException: Service id 'URLEncoder' has already been
defined
by org.apache.tapestry5.internal.services.URLEncoderImpl() (at
URLEncoderImpl.java:22) via
org.apache.tapestry5.services.TapestryModule.bind(ServiceBinder) (at
TapestryModule.java:150) and may not be redefined by
org.abx.myapp.t5.services.URLEncoderImpl() (at URLEncoderImpl.java:22)
via
org.abx.myapp.t5.services.AppModule.bind(ServiceBinder) (at
AppModule.java:42). You should rename one of the service builder
methods.
 at
org.apache.tapestry5.ioc.internal.RegistryImpl.init(RegistryImpl.java:170)



-
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: Q : Could not find a coercion from type java.lang.String to type java.util.Date

2009-03-15 Thread Fernando Padilla
Though I agree that String-Date by default is a no-go.  I think 
tapestry could have a Long-Date coercion. :)



Howard Lewis Ship wrote:

Converting between strings and dates is too finicky for Tapestry to
handle automatically (without screwing it up for some people).

Instead of including the Dates as event context values,, try
converting them to long values (seconds since the epoch) and then
convert them back to usable Dates inside your event handler method.

On Sun, Mar 15, 2009 at 12:22 PM, dwi ardi irawan
penyihirke...@gmail.com wrote:

hi, could anyone help me

here's my code


@Persist(flash)
@Property
private Date twawal, twakhir;
.

public Link getDailyChart(){
   System.out.println(twawal); // OK
   System.out.println(twakhir); // OK
   return _resources.createEventLink(chart, new Object[]{400,400,
twawal, twakhir});
   }

   public StreamResponse onChart(final int width, final int height, final
Date _twawal, final Date _twakhir){

   return new StreamResponse(){
   public String getContentType(){
   return image/gif;
   }
   public InputStream getStream() throws IOException {
   BufferedImage image  =
generateDailyChart().createBufferedImage(width, height);
   ByteArrayOutputStream byteArray = new
ByteArrayOutputStream() ;
   ChartUtilities.writeBufferedImageAsPNG(byteArray, image) ;
   return new ByteArrayInputStream(byteArray.toByteArray());
   }
   public void prepareResponse(Response response){}
   };
   }




i got an error said :
Could not find a coercion from type java.lang.String to type
java.util.Date.  Available coercions: Double -- Float, Float -- Double,
Long -- Boolean, Long -- Byte, Long -- Double, Long -- Integer, Long --
Short, Number -- Long, Object -- Object[], Object -- String, Object --
java.util.List, Object[] -- java.util.List, String -- Boolean, String --
Double, String -- Long, String -- java.io.File, String --
java.math.BigDecimal, String -- java.math.BigInteger, String --
java.text.DateFormat

can anyone help me ?


--
http://www.dwiardiirawan.com
cos everyone could be extraordinary...lighten up !







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



Re: about T5 javascript

2009-03-10 Thread Fernando Padilla

https://issues.apache.org/jira/browse/TAP5-569

here, this bug has more js that you should include.  Then you can just use:

Tapestry.activateZone( vMessage, validLink );


On 3/10/09 8:03 AM, Michael Williamson wrote:

I'm having problems creating a ZoneManager.  Here are is my code.

Component tml

t:container xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;
t:zone t:id=vMessage class=errorDiv
p${message}/p
/t:zone
p  Check/p
/t:container

container java

package roa.components;

import org.apache.tapestry5.ComponentResources;
import org.apache.tapestry5.Link;
import org.apache.tapestry5.MarkupWriter;
import org.apache.tapestry5.RenderSupport;
import org.apache.tapestry5.annotations.ApplicationState;
import org.apache.tapestry5.annotations.Environmental;
import org.apache.tapestry5.annotations.InjectComponent;
import org.apache.tapestry5.annotations.Parameter;
import org.apache.tapestry5.annotations.Persist;
import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.corelib.components.Zone;
import org.apache.tapestry5.ioc.annotations.Inject;

import roa.business.AppObject;
import roa.business.AssemblyPart;
import roa.business.Validation;
import roa.data.VenderInworkAssyParts;


public class ValidateMessage
{
@Property
@Persist
private String message;

@Property
@Persist
private String currentValues;

@ApplicationState
private AppObject appObject;

@InjectComponent
private Zone vMessage;


@Inject
 private ComponentResources resources;

 @Environmental
 private RenderSupport renderSupport;

 void afterRender(MarkupWriter writer)
 {
 Link link = resources.createEventLink(actionFromCheck);
 renderSupport.addScript(var validLink =  + link);
 }

public Object onActionFromCheck()
{
this.message = New Message;

return vMessage.getBody();
}
}

JavaScript

var element = document.forms[0].all(check);
var zoneObject = Tapestry.findZoneManager(element);
zoneObject.updateFromURL(validLink);

the ZoneManager is null.  I have tried serval variations on this code based
on google search. I think I need to remove the ActionLink in the component
tml file and create a new ZoneManager from the zone element and the link but
I can't get that to work ether.


Fernando Padilla wrote:

URL = a url you would build on the serverside using something like:
resources.createEventLink(  );


Let me review the background below.. I hope I don't confuse you too much..


Normally:

t:zone id=zoneId/
  activateZone


Generates:Html:

div id=zoneId
/div

  URL activateZone


Generates:Javascript:

1) setup a ZoneManager against the div#zoneId
2) setup a click listener on the actionlink.. to fetch actionlink URL
from tapestry, (which calls the event listener which returns a Block,
and then tapestry renders block.. ), once the URL returns, it squirts
the contents of the results into the appropriate div#zoneId.

step 2 is basically what Tapestry.activateZone would replace.. so you
can do this without relying on an actionlink or form..


mwilliam...@kcp.com wrote:

I would like to use this feature but I can't figure out what url this is.

Fernando Padilla wrote:

that said, any committers want to add a simple function for people to
use?? something like this:

Tapestry.activateZone = function( zoneId, url ) {
var zoneManager = Tapestry.findZoneManagerFromId( zoneId );
zoneManager.updateFromURL( url );
}


Inge Solvoll wrote:

var zoneObject = Tapestry.findZoneManager(elementConnectedToZone);

zoneObject.updateFromURL(link);

On Fri, Mar 6, 2009 at 8:16 AM, Andrea Chiumentikium...@gmail.com
wrote:


Hi to avoid me to read all Tapestry js code, could you tell me waht
is/are the js Class and method(s) that replace a zone on a xhr call ?

Thanks,
kiuma

-
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




Quoted from:
http://www.nabble.com/about-T5-javascript-tp22367350p22400998.html


-
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: about T5 javascript

2009-03-09 Thread Fernando Padilla

URL = a url you would build on the serverside using something like:
resources.createEventLink(  );


Let me review the background below.. I hope I don't confuse you too much..


Normally:

t:zone id=zoneId/
a t:type=actionlink t:id=actionId zone=zoneIdactivateZone/a


Generates:Html:

div id=zoneId
/div

a href=URLactivateZone/a


Generates:Javascript:

1) setup a ZoneManager against the div#zoneId
2) setup a click listener on the actionlink.. to fetch actionlink URL 
from tapestry, (which calls the event listener which returns a Block, 
and then tapestry renders block.. ), once the URL returns, it squirts 
the contents of the results into the appropriate div#zoneId.


step 2 is basically what Tapestry.activateZone would replace.. so you 
can do this without relying on an actionlink or form..



mwilliam...@kcp.com wrote:
I would like to use this feature but I can't figure out what url this is.  


Fernando Padilla wrote:
that said, any committers want to add a simple function for people to 
use?? something like this:


Tapestry.activateZone = function( zoneId, url ) {
var zoneManager = Tapestry.findZoneManagerFromId( zoneId );
zoneManager.updateFromURL( url );
}


Inge Solvoll wrote:

var zoneObject = Tapestry.findZoneManager(elementConnectedToZone);

zoneObject.updateFromURL(link);

On Fri, Mar 6, 2009 at 8:16 AM, Andrea Chiumenti kium...@gmail.com
wrote:


Hi to avoid me to read all Tapestry js code, could you tell me waht
is/are the js Class and method(s) that replace a zone on a xhr call ?

Thanks,
kiuma

-
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



Quoted from: 
http://www.nabble.com/about-T5-javascript-tp22367350p22400998.html




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



Re: about T5 javascript

2009-03-08 Thread Fernando Padilla
that said, any committers want to add a simple function for people to 
use?? something like this:


Tapestry.activateZone = function( zoneId, url ) {
var zoneManager = Tapestry.findZoneManagerFromId( zoneId );
zoneManager.updateFromURL( url );
}


Inge Solvoll wrote:

var zoneObject = Tapestry.findZoneManager(elementConnectedToZone);

zoneObject.updateFromURL(link);

On Fri, Mar 6, 2009 at 8:16 AM, Andrea Chiumenti kium...@gmail.com wrote:


Hi to avoid me to read all Tapestry js code, could you tell me waht
is/are the js Class and method(s) that replace a zone on a xhr call ?

Thanks,
kiuma

-
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: Invoking a custom show javascript method for a Zone

2009-03-03 Thread Fernando Padilla
You might have already tried this, but, you know that there is a show 
operation and an update operation..


so you maybe you should set both?


Dave Greggory wrote:

Thanks for the suggestion, Igor. Unfortunately, it didn't work.

So I tried doing the following in AfterRender.

renderSupport.addScript(var Pirate = Class.create(Tapestry.ElementEffect, 
{ +
showeditorzone : 
function(element) { +
  alert('hey'); +
  
editWindow.show('editWindow'); +
  resizeWindow(500, 
500); +
  return new 
Effect.Highlight(element); +
} +
  }););

I also tried overriding the existing highlight and show methods in Tapestry.ElementEffect and leave t:zone's update and show parameters blank, but these methods just were not getting called. 



I wonder whether I should concentrate on adding some behavior to the event link 
instead.

t:eventlink t:event=editComponent t:context=editEventContext 
t:zone=editorZoneEdit/t:eventlink

Maybe I should add a script to event link's on click event so that in addition to invoking the 
editComponent event it also shows the Window. Would that interfere with the Zone from 
getting updated when the editComponent event returns?



  



-
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: [OT] By boss decided

2009-02-18 Thread Fernando Padilla

How about LinkedIn.

Otho wrote:

Yup, no websites in java. Googlemail doesn't count. And german Telekom and
Postbank are totally niche companies. :)

2009/2/18 Daniel Honig daniel.ho...@gmail.com


Ok...very late for meHorrible post!

But I do have some real points... let me bullet point


  - dynamic language frameworks offer great but often overexaggerated
  productivity ( dependent on lots of factors!)
  - PHP does not mean you can hire less than talented folks and expect a
  huge cost/productivity savings (Cake PHP has a learning curve too!)
  - Open source ecosystem in Java blows away any other environment
  - Django and Rails are great but cost of retraining is high
  - You can't argue with folks who are beat up by the mistakes of java past
  and refuse to look at the light at the end of the Java tunnel(groovy,
  grails, scala)
  - A skilled tap or wo team can likely meet or exceed the real cost/effort
  level of a django/grails/php/rails team and leave a better system in
place
  - Communicating with those who are lost in the hype of dynamic language
  frameworks is difficult.


too late...too tiredbut hope the bullet points make up for my previous
post.  i think they are all points worth discussion.

2009/2/18 Daniel Honig daniel.ho...@gmail.com


Just tell him to go check out grails before he goes off and tries to
re-invent the infrastructure in cake php.

That being said once T5 is part of my migration path once I reach the
limits of scalability from all the MOP overhead from dynamic language
frameworks.
In a perfect world, I'd write my domain in GORM and expose it to tapestry
via some lightweight service layer

But if your boss really wants to go and re-invent everything in Django or
PHP it might just be a lost cause.

You might want to point out that often the productivity gain is a a bit

of

a shell gameIn any of these languages you still need to hire good or
great developers to get productivity.  In dynamic frameworks you can't

keep

a stable codebase unless you write good to great integration tests to

verify

your execution paths are stable and not doing something crazy from

release

to release.IMHO, the productiviy gains from dynamic frameworks are a

bit

overexaggerated..All of these frameworks have a learning
curve.Unless your boss wants a project delivered by a bunch of PHP
script kids?.It's a shell game

Despite my love of grails, after working with grails for a year and a
previous life that included lots of WO and T4 experience, I think there

is

no reason that a talented agile Tap X team could not keep up with the

true

productivity of any other framework.  Full stop ;)

The trouble is how do you bring communicate this effectively?



On Wed, Feb 18, 2009 at 1:03 AM, Borut Bolčina borut.bolc...@gmail.com
wrote:


Hello,

just want to share a piece of corporate mind set with you.

My boss decided that none of the Java frameworks is productive in
comparison
to PHP, Ruby and Django and that there are no web sites written in any
Java
framework. Can you believe that? I would like to prove him wrong with
Tapestry Cayenne combo. Unfortunately I have no list of T5 success
stories.

I am sorry for spamming, but I had to let the steam out!

-Borut







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



Re: [OT] By boss decided

2009-02-18 Thread Fernando Padilla


For general Java:
How about LinkedIn? Anything with OpenSocial/Shindig ( Myspace, Hi5, 
Orkut, iGoogle, maybe even Yahoo Social ).



For Tapestry:
I would like to say my sites but they are only timid successes ( 
tapestry is not the issue, just the business :)


protrade.com
apps.facebook.com/bracket
apps.facebook.com/citizensports
apps.facebook.com/redsoxnation
...
..
.



Otho wrote:

Yup, no websites in java. Googlemail doesn't count. And german Telekom and
Postbank are totally niche companies. :)

2009/2/18 Daniel Honig daniel.ho...@gmail.com


Ok...very late for meHorrible post!

But I do have some real points... let me bullet point


  - dynamic language frameworks offer great but often overexaggerated
  productivity ( dependent on lots of factors!)
  - PHP does not mean you can hire less than talented folks and expect a
  huge cost/productivity savings (Cake PHP has a learning curve too!)
  - Open source ecosystem in Java blows away any other environment
  - Django and Rails are great but cost of retraining is high
  - You can't argue with folks who are beat up by the mistakes of java past
  and refuse to look at the light at the end of the Java tunnel(groovy,
  grails, scala)
  - A skilled tap or wo team can likely meet or exceed the real cost/effort
  level of a django/grails/php/rails team and leave a better system in
place
  - Communicating with those who are lost in the hype of dynamic language
  frameworks is difficult.


too late...too tiredbut hope the bullet points make up for my previous
post.  i think they are all points worth discussion.

2009/2/18 Daniel Honig daniel.ho...@gmail.com


Just tell him to go check out grails before he goes off and tries to
re-invent the infrastructure in cake php.

That being said once T5 is part of my migration path once I reach the
limits of scalability from all the MOP overhead from dynamic language
frameworks.
In a perfect world, I'd write my domain in GORM and expose it to tapestry
via some lightweight service layer

But if your boss really wants to go and re-invent everything in Django or
PHP it might just be a lost cause.

You might want to point out that often the productivity gain is a a bit

of

a shell gameIn any of these languages you still need to hire good or
great developers to get productivity.  In dynamic frameworks you can't

keep

a stable codebase unless you write good to great integration tests to

verify

your execution paths are stable and not doing something crazy from

release

to release.IMHO, the productiviy gains from dynamic frameworks are a

bit

overexaggerated..All of these frameworks have a learning
curve.Unless your boss wants a project delivered by a bunch of PHP
script kids?.It's a shell game

Despite my love of grails, after working with grails for a year and a
previous life that included lots of WO and T4 experience, I think there

is

no reason that a talented agile Tap X team could not keep up with the

true

productivity of any other framework.  Full stop ;)

The trouble is how do you bring communicate this effectively?



On Wed, Feb 18, 2009 at 1:03 AM, Borut Bolčina borut.bolc...@gmail.com
wrote:


Hello,

just want to share a piece of corporate mind set with you.

My boss decided that none of the Java frameworks is productive in
comparison
to PHP, Ruby and Django and that there are no web sites written in any
Java
framework. Can you believe that? I would like to prove him wrong with
Tapestry Cayenne combo. Unfortunately I have no list of T5 success
stories.

I am sorry for spamming, but I had to let the steam out!

-Borut







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



Re: [T5] Struggling With Concepts

2009-02-18 Thread Fernando Padilla
This is basically the same technique I was outlining.. just implemented 
using a Tapestry RequestFilter, instead of a normal J2EE Filter.  If 
done properly, there should be no more modifications required within 
tapestry.


Robert Zeigler wrote:

Not necessarily.
If you intercept the request via a RequestFilter, ordered early, then 
you can pull the site information out that you want, right (and store it 
someplace useful that you'll use later on when rendering; like in an ASO).
And then you can wrap the original request with a custom implementation 
that returns the site-less path that tapestry will use to determine 
which page/component to render.   The page to render isn't determined 
until control flows to the MasterDispatcher, from RequestFilter, so 
intercepting via RequestFilter should let you do this.


 From your other posts, it looks like you've already got the link 
implementation in place to add the site /back/ into any links generated 
for the next request. Between the request filter and the link 
implementation, you should be set...? (Apologies, I haven't been 
following this conversation very closely, so, if I'm missing something, 
fill me in).


Robert

On Feb 18, 2009, at 2/1811:02 AM , xfile80303 wrote:



Hi Peter,

But, if I follow you correctly, there will still need to be a class, 
even if
empty, with the desired path as its package for every site.  I'm 
trying to

make the site a dynamic configuration which does not need the addition of
more pages.

Cheers,

Levi


Peter Stavrinides wrote:



They will all use the same pages and page flow, but will key
off of the site name
Sorry but I don't get this comment? I mean what exactly are you 
trying to

do?... Tapestry uses composition, so construct components instead of
pages,, embed those components in your pages (just empty containers
really, with different settings, parameters, you duplicate nothing 
this

way), set a site parameter in your component according, whose value
corresponds with the containing page (your site /sub-section), and thats
it.

 component A (shared)
/   \
page 1 (@parameter site = A) page 2 (@parameter site=B)

cheers,
Peter



--
View this message in context: 
http://n2.nabble.com/-T5--Struggling-With-Concepts-tp2324920p2348095.html

Sent from the Tapestry Users 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



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



Re: [T5] Struggling With Concepts

2009-02-17 Thread Fernando Padilla
Ok, here is an example.. hope it's legible. :)  The meat of the code is 
the ContextFilterRequest below.  If you create a normal J2EE filter that 
determines what part of the path to rip out, then if can do:



doFilter(...) {
  String path = getCleanPath( request ); // helper method
  boolean hasVirtualHost = //does path start with virtual host//;
  if ( hasVirtualHost ) {
String virtualHostPathPart = //virtual host path from path//;
request.setAttribute( SITEINFO, virtualHostPathPart );
// most stuff to setup siteinfo //
request = new ContextFilterRequest( virtualHostPathPart, request );
  }
  chain( request, response );
}

//does path start with virtual host//
  here you would search your expected virtual host to path listing
  ( /site1, /site2 )

//virtual host path from path//
  here you capture the part of the path you want to gobble up..
  and it will be removed from path, and move to contextPath
  /site1

// most stuff to setup siteinfo //
  a simple way to tell the rest of the program what site is currently
  using, is to set a Request.attribute.  But you could come up with
  other mechanisms ( thread scoped services, etc, etc ), or other
  work you need to do to setup the site info ( load more config from
  else where, etc ).





public static String getCleanPath( HttpServletRequest request ) {
String fullpath = request.getRequestURI();
String contextPath = request.getContextPath();
String path = fullpath.substring( contextPath.length() );
return path;
}

public static class ContextFilterRequest extends HttpServletRequestWrapper {

	protected static Logger logger = Logger.getLogger( 
ContextFilterRequest.class );


private String contextPart;
private String context;
private String servletPath;

public ContextFilterRequest( String context, HttpServletRequest request 
) {
super( request );
this.contextPart = context;
this.context = super.getContextPath() + / + contextPart;
		this.servletPath = super.getServletPath().substring( 
contextPart.length() + 1 );

}

@Override
public String getContextPath() {
return context;
}

@Override
public String getServletPath() {
return servletPath;
}

@Override
public String getRealPath( String path ) {
if ( path.startsWith( / ) ) {
path = / + contextPart + path;
}
return super.getRealPath( path );
}

@Override
public RequestDispatcher getRequestDispatcher( String path ) {
if ( path.startsWith( / ) ) {
path = / + contextPart + path;
}
return super.getRequestDispatcher( path );
}
}


xfile80303 wrote:

Thanks Fernando.

I'm interested in option 2 below.  If you have code to share, please do.  :)

What I'm trying to solve for is not really virtual hosting.  I want to have
the ability to have multiple sites, sure, but these sites all use the same
pages and page structure and only differ by configuration information which
is keyed off the site name.  The sub-directory approach is certainly what I
want, but Tapestry's way of handling this would require me to duplicate
every page into a peer package structure, which is not maintainable, not
dynamic, and not an option.

Cheers,

Levi


Fernando Padilla wrote:
I'm sorry, but this is not quite what Tapestry is meant to solve for.. 
It solves nicely for state within a page.. or within a user's session, 
etc etc.


Since what you're trying to do is have your code support a form of 
virtual hosting, it might be easier if you deal with it using normal 
J2EE mechanisms.


1) As Onno suggested, if your virtual hosts can be mapped to different 
sub-domains, your code could simply look at the sub-domain to determine 
how to behave: HttpServletRequest.getHost()


2) If you want a subdirectory method:
http://host/context/typeA/
http://host/context/typeB/

We do this easily by adding a normal J2EE Filter that detects the 
typeA part and strips it out (adding it to the contextPath, and some 
request attribute for later logic).  After it's been added to the 
contextPath, then tapestry (or any filter/servlet after this filter) 
would never have to deal with the typeA part of the path, only if they 
wanted to know which type it was currently running under, it would 
look it up under a request attribute or some such ( or look it up 
through the contextPath ).  If this could serve your purposes, I could 
share some code ( really small )..




On 2/13/09 6:16 PM, xfile80303 wrote:

Hello all,

I've been struggling to understand the concepts surrounding T5 and have
reached a pinnacle of frustration while trying to implement a
(supposedly)
simple piece of functionality.  I could very much use some guidance.

What I'm trying to do

Re: [T5] Struggling With Concepts

2009-02-15 Thread Fernando Padilla
Fair, but then the knowledge of virtual host would only be within 
tapestry, and not be usable for any other filters, servlets, etc etc.. 
just get to pick your poison :)



Howard Lewis Ship wrote:

Acutally, there's no real reason Tapestry 5.1 can't support this
scheme, once we make a few more of the Link-generating and
Request-path-parsing services public and overridable.

On Sat, Feb 14, 2009 at 6:48 PM, Fernando Padilla f...@alum.mit.edu wrote:

I'm sorry, but this is not quite what Tapestry is meant to solve for.. It
solves nicely for state within a page.. or within a user's session, etc etc.

Since what you're trying to do is have your code support a form of virtual
hosting, it might be easier if you deal with it using normal J2EE
mechanisms.

1) As Onno suggested, if your virtual hosts can be mapped to different
sub-domains, your code could simply look at the sub-domain to determine how
to behave: HttpServletRequest.getHost()

2) If you want a subdirectory method:
http://host/context/typeA/
http://host/context/typeB/

We do this easily by adding a normal J2EE Filter that detects the typeA
part and strips it out (adding it to the contextPath, and some request
attribute for later logic).  After it's been added to the contextPath, then
tapestry (or any filter/servlet after this filter) would never have to deal
with the typeA part of the path, only if they wanted to know which type
it was currently running under, it would look it up under a request
attribute or some such ( or look it up through the contextPath ).  If this
could serve your purposes, I could share some code ( really small )..



On 2/13/09 6:16 PM, xfile80303 wrote:

Hello all,

I've been struggling to understand the concepts surrounding T5 and have
reached a pinnacle of frustration while trying to implement a (supposedly)
simple piece of functionality.  I could very much use some guidance.

What I'm trying to do is have a piece of information specifiable on the
URL
which will persist throughout the experience of the user.

Specifically, I am trying to create an application which will be site
aware (where site is a made-up term which implies different
configurations/access/etc.).  The site will need to be present in the
URL
in some form.  With URL re-writing I suppose it is possible to have this
as
a parameter on the URL, or some other way which can be re-written into a
Tapestry compatible form, but even so, I'm not sure what approach that
form
should take.

If it is a parameter on the URL, how will that parameter persist while the
user is browsing through the app, submitting forms, clicking links, etc?

If it is an activation context, how would /that/ persist?

Ultimately the ideal solution would be to have this site specified early
in the URL and have Tapestry keep it there (and allow me to access its
value) throughout the use of the app by a client.

Something like:

http://mysite.com/foosite/blah/blah/blah

where foosite would be any string.

As mentioned above, I suppose this could be:

http://mysite.com/blah/blah/blah?site=foosite

or

http://mysite.com/blah/blah/blah/foosite

if that makes achieving this with Tapestry any easier.

I feel that Tapestry has the potential to be very useful and a great
platform to develop on, but I'm really struggling to understand how to do
this.

Many Thanks,

Levi
---
For reference, here is a my previous thread:
http://n2.nabble.com/-T5--URL-Manipulation-tt2276010.html

-
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: [T5] Struggling With Concepts

2009-02-14 Thread Fernando Padilla
I'm sorry, but this is not quite what Tapestry is meant to solve for.. 
It solves nicely for state within a page.. or within a user's session, 
etc etc.


Since what you're trying to do is have your code support a form of 
virtual hosting, it might be easier if you deal with it using normal 
J2EE mechanisms.


1) As Onno suggested, if your virtual hosts can be mapped to different 
sub-domains, your code could simply look at the sub-domain to determine 
how to behave: HttpServletRequest.getHost()


2) If you want a subdirectory method:
http://host/context/typeA/
http://host/context/typeB/

We do this easily by adding a normal J2EE Filter that detects the 
typeA part and strips it out (adding it to the contextPath, and some 
request attribute for later logic).  After it's been added to the 
contextPath, then tapestry (or any filter/servlet after this filter) 
would never have to deal with the typeA part of the path, only if they 
wanted to know which type it was currently running under, it would 
look it up under a request attribute or some such ( or look it up 
through the contextPath ).  If this could serve your purposes, I could 
share some code ( really small )..




On 2/13/09 6:16 PM, xfile80303 wrote:

Hello all,

I've been struggling to understand the concepts surrounding T5 and have
reached a pinnacle of frustration while trying to implement a (supposedly)
simple piece of functionality.  I could very much use some guidance.

What I'm trying to do is have a piece of information specifiable on the URL
which will persist throughout the experience of the user.

Specifically, I am trying to create an application which will be site
aware (where site is a made-up term which implies different
configurations/access/etc.).  The site will need to be present in the URL
in some form.  With URL re-writing I suppose it is possible to have this as
a parameter on the URL, or some other way which can be re-written into a
Tapestry compatible form, but even so, I'm not sure what approach that form
should take.

If it is a parameter on the URL, how will that parameter persist while the
user is browsing through the app, submitting forms, clicking links, etc?

If it is an activation context, how would /that/ persist?

Ultimately the ideal solution would be to have this site specified early
in the URL and have Tapestry keep it there (and allow me to access its
value) throughout the use of the app by a client.

Something like:

http://mysite.com/foosite/blah/blah/blah

where foosite would be any string.

As mentioned above, I suppose this could be:

http://mysite.com/blah/blah/blah?site=foosite

or

http://mysite.com/blah/blah/blah/foosite

if that makes achieving this with Tapestry any easier.

I feel that Tapestry has the potential to be very useful and a great
platform to develop on, but I'm really struggling to understand how to do
this.

Many Thanks,

Levi
---
For reference, here is a my previous thread:
http://n2.nabble.com/-T5--URL-Manipulation-tt2276010.html


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



Re: [T5] Internationalizing included js

2009-02-11 Thread Fernando Padilla

Not the best option but:

Don't forget that included js files are determined using Tapestry's 
Internationalication/Localization code..


http://tapestry.apache.org/tapestry5/guide/localization.html

so:

include( my.js )

would look up the right js file using the locale of the user:

my_en.js
my_fr.js



So you could refactor your js file into two.. one for locale specific 
variables and messages, and another just for code.. Then tapestry will 
choose the correct messages js file using the user's locale...


include( mymessages.js, mycode.js )

mymessages_en.js
mymessages_fr.js
mycode.js



This won't help if you just wanted to leverage the Message bundles that 
the app is already using..  To do that, we would have to cook up some 
code and stuff to transform the js files as they are served up (no 
support for that at the moment ).





Thiago H. de Paula Figueiredo wrote:

On Wed, Feb 11, 2009 at 7:08 AM, Jonathan O'Connor ninki...@eircom.net wrote:

Alex, according to Thiago, you can have string substitution in the javascript:


Yes, if the Javascript is generated inside the page, not in an external file. ;)



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



Re: Confirm(are you sure want to delete) in LinkSubmit

2009-02-05 Thread Fernando Padilla
I would review the Form javascript.  I bet that there are already ways 
to hook into the form validation/submittion flow, so that you can add a 
listener there, and do a popup before the form submits..


Then once you figure out how to do that, I would probably create a new 
component that adds that functionality, I might call it 
ConfirmFormSubmit.  So that you encapsulate the registering of that 
form submit listener, etc etc.. ( you would have to learn how form 
fields hook into the form validation javascript, etc etc ).


t:form
 .. inputs ..
 .. submits ..
 t:confirmFormSubmit/
/t:form



zack1403 wrote:

Hey guys sorry to resurrect this issue.  I just got around to fixing this bug
:)  When I try an inline confirm with javascript on a LinkSubmit (t5)
component it will always submit the form.  I know that javascript cant
assure order of events.  Is this basically an issue that doesnt have a
solution? Or I guess the solution is no confirm with javascript?

Zack


Martijn Brinkers (List)-2 wrote:

Could you check if the Event.stop(event) works when used directly from
the onclick event handler?

So in you page tml file use something like:

input  onclick=Event.stop(event); alert('event was stopped'); /

Martijn






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



Re: How to override Tapestry's DocumentLinker ?

2009-02-02 Thread Fernando Padilla
Sorry for the wait.  I don't have the final answer for you, but I do 
have information to share.. :)


I think it'll be the same technique of overriding tapestry's document 
linker, but there are two render pipelines, so you have to find the 
correct place to contribute..



Don't forget that Tapestry has two request handling pipelines.  One for 
normal page request.  And another for component events (like form 
submits) or ajax call backs (like zones).  Most likely the code that we 
worked out before only covered normal page renders.  But somehow you're 
hitting the component event handling oversight..


The reason that i would normally not be an issue, is that component 
events normally do not do any rendering, they simply send back a 
redirect asking the client to request the full page, and then causing a 
clean page render.. (do yo understand this point?)


That is how I have it working, and probably why I did not have to deal 
with it before and give you a warning.  You probably have tapestry setup 
to render the page on the same request as the form submits ( instead of 
returning a redirect ).



Is this enough info to get you started hunting?



Dude.Checkitout wrote:

Fernando, need your expertise help!  I thought the following trick
configuration.add( CustomDocumentLinker, mydoclinker,
after:DocumentLinker,before:RenderSupport ); 
worked.  


Looks like it is not working in all conditions. It runs fine for a while,
then out of nowhere I start getting the same root html required error. 


The strange (may be for me) thing I observed is, it fails only on pages
which has Tapestry forms.
(we have read only/display version of pages - which seems to work fine in
all cases).

Once it starts giving this root html error, the whole application reports
the same error. (all pages which has tapestry form in it).   FYI, I have
more than one tapestry application running on the same JBoss server. Just
curious, if it messes up things.

I am stuck and any help would be greatly appreciated!


Fernando Padilla wrote:
yah, this is little confusing, since it will place the CustomLinker 
first in the list of filters.. :)  But they execute as they come out 
of the list.. :)


CustomLinker - DocumentLinker - RenderSupport - PAGERENDER

So as the page render unfurls, it gives control to RenderSupport to 
modify the DOM, then DocumentLinker, then CustomLinker.  And the 
document linkers really don't do anything by themselves, and require a 
RenderSupport to feed them the script/css links.  So the RenderSupport 
filter would call environment.peekRequired(DocumentLinker.class), which 
would return the deepest DocumentLinker at the moment (the default, not 
the Custom one)..


So yeah a little confusing.. :) :)


Thiago H. de Paula Figueiredo wrote:
Em Thu, 29 Jan 2009 15:14:40 -0300, Fernando Padilla f...@alum.mit.edu 
escreveu:


No.  DocumentLinker would be run first ( deeper in the markup filter 
chain ), it would be the only one that RenderSupport would bind to ( 
RenderSupport does a environment.peekRequired ).  So only that 
DocumentLinker would do it's stuff.
Even when the custom document linker is explicitly added to the 
OrderedConfiguration *before* the normal DocumentLinker? If yes, well, 
the contribution overriding mechanism in T5.1 will be extra handy . . .

:)


-
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: How to override Tapestry's DocumentLinker ?

2009-02-02 Thread Fernando Padilla

See that's the weird part..

1) render page form:
/myapp/page1
2) submit form:
/myapp/page1.form:action
3) form handles submit(fail or success),
   then returns redirect to render page:
redirect:/myapp/page1
4) page 1 is rendered once more.


So I'm a little confused.. since you mention another event?

What does your editMe event handler method return?  null?  A block? a 
page name?  It should also cause a full redirect to render the full page 
( so you should never see that url in the browser ).




Dude.Checkitout wrote:

Thanks for the reply!

I see there only two render pipelines in the TapestryModule.java.  One is
contributeMarkupRenderer and another one is contributePartialMarkupRenderer.

PartialMarkupRenderer uses PartialMarkupDocumentLinker as the Document
Linker. And PartialMarkupDocumentLinker generates output as JSON. Does not
validate against any root html nodes.

So my assumption was I shouldn't be needing to touch that part of rendering.
Correct me if I am wrong.

We do use redirect after post modal.  The page which gives errors is
invoking a specific event on the page in the URL to load the page which has
form.  

Example URL: /myapp/page1:editMe/somekeyvalue  


Is this request a action request or render request?  Which renderes will it
use? My assumption is that this is an action event request and it will just
invoked that event in the page and issue a redirect.

Am I missing any renderer? or which is the other renderer that I need to
patch up?




Fernando Padilla wrote:
Sorry for the wait.  I don't have the final answer for you, but I do 
have information to share.. :)


I think it'll be the same technique of overriding tapestry's document 
linker, but there are two render pipelines, so you have to find the 
correct place to contribute..



Don't forget that Tapestry has two request handling pipelines.  One for 
normal page request.  And another for component events (like form 
submits) or ajax call backs (like zones).  Most likely the code that we 
worked out before only covered normal page renders.  But somehow you're 
hitting the component event handling oversight..


The reason that i would normally not be an issue, is that component 
events normally do not do any rendering, they simply send back a 
redirect asking the client to request the full page, and then causing a 
clean page render.. (do yo understand this point?)


That is how I have it working, and probably why I did not have to deal 
with it before and give you a warning.  You probably have tapestry setup 
to render the page on the same request as the form submits ( instead of 
returning a redirect ).



Is this enough info to get you started hunting?



Dude.Checkitout wrote:

Fernando, need your expertise help!  I thought the following trick
configuration.add( CustomDocumentLinker, mydoclinker,
after:DocumentLinker,before:RenderSupport ); 
worked.  


Looks like it is not working in all conditions. It runs fine for a while,
then out of nowhere I start getting the same root html required error. 


The strange (may be for me) thing I observed is, it fails only on pages
which has Tapestry forms.
(we have read only/display version of pages - which seems to work fine in
all cases).

Once it starts giving this root html error, the whole application
reports
the same error. (all pages which has tapestry form in it).   FYI, I have
more than one tapestry application running on the same JBoss server. Just
curious, if it messes up things.

I am stuck and any help would be greatly appreciated!


Fernando Padilla wrote:
yah, this is little confusing, since it will place the CustomLinker 
first in the list of filters.. :)  But they execute as they come out 
of the list.. :)


CustomLinker - DocumentLinker - RenderSupport - PAGERENDER

So as the page render unfurls, it gives control to RenderSupport to 
modify the DOM, then DocumentLinker, then CustomLinker.  And the 
document linkers really don't do anything by themselves, and require a 
RenderSupport to feed them the script/css links.  So the RenderSupport 
filter would call environment.peekRequired(DocumentLinker.class), which 
would return the deepest DocumentLinker at the moment (the default, not 
the Custom one)..


So yeah a little confusing.. :) :)


Thiago H. de Paula Figueiredo wrote:

Em Thu, 29 Jan 2009 15:14:40 -0300, Fernando Padilla
f...@alum.mit.edu 
escreveu:


No.  DocumentLinker would be run first ( deeper in the markup filter 
chain ), it would be the only one that RenderSupport would bind to ( 
RenderSupport does a environment.peekRequired ).  So only that 
DocumentLinker would do it's stuff.
Even when the custom document linker is explicitly added to the 
OrderedConfiguration *before* the normal DocumentLinker? If yes, well, 
the contribution overriding mechanism in T5.1 will be extra handy . . .

:)


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

Re: Switch from Prototype to jQuery?

2009-01-30 Thread Fernando Padilla
We use YUI ourselves.  What ever happened to the concept of pluggable 
javascript implementations?


So people can choose what underlying javascript system to use?

Chris Lewis wrote:
I have a great deal of experience with prototype, and not so much with 
jQuery. From my brush with it, it seems to me that it is less than ideal 
for building front end widgets, as it's primary focus is more on easily 
navigating the DOM and affecting elements in various, insulated ways. It 
doesn't provide the type of framework for general OO modeling, which 
makes it less ideal for things like ui components. On the other hand, I 
always thought that dojo was a major overkill. Prototype balances the 
functional nature of JS with a nice platform for doing things like dojo 
does - and for me it just fits.


If I'm mistaken about the abilities of jQuery, that is just my 
inexperience with it. The question I would propose is, what's the point? 
T5 works just fine how with the current tapestry.js, why exert what 
seems to be a fruitless effort simply for the sake of changing JS badges?


Howard Lewis Ship wrote:

There's been a lot of discussion on blogs lately about the merits of
Prototype vs. jQuery.

http://tapestryjava.blogspot.com/2009/01/comparing-prototype-and-jquery.html 



I've added an issue to JIRA to discuss this.

https://issues.apache.org/jira/browse/TAP5-486

Basically, a rewrite of tapestry.js from Prototype to jQuery should
insulate most users from the changes. Advanced users who have written
their own javascript components may need to add an annotation or a
configuration value for compatiblity after upgrading.

I may start experimenting with this in a branch.

I've noticed that many of the more interesting public sites using
Tapestry are already using jQuery as well ... thus this shift
represents addresing the core concern of performance (having to
download and use just one JavaScript library, not two).

  




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



Re: How to override Tapestry's DocumentLinker ?

2009-01-29 Thread Fernando Padilla
I have lots of experience playing with that :)  (since we publish to 
html, fbml).  Here are some questions:


1) do your documents have a root node?  what is it?

2) do you want to change the behavior of how it includes javascript and 
css?  Or just have it work with non-html root nodes?




Dude.Checkitout wrote:

We have a requirement of tml file being delivered without html as the root
context. As I read the tapestry source, this validation is done in the
DocumentLinker.

In contributeMarkupRenderer method:
MarkupRendererFilter documentLinker = new MarkupRendererFilter()
{
public void renderMarkup(MarkupWriter writer, MarkupRenderer
renderer)
{
DocumentLinkerImpl linker = new
DocumentLinkerImpl(productionMode, scriptsAtTop);

environment.push(DocumentLinker.class, linker);

renderer.renderMarkup(writer);

environment.pop(DocumentLinker.class);

linker.updateDocument(writer.getDocument());
}
};


Is there anyway I can override my own DocumentLinker with Tapestry's
DocumentLinker?

In the Post,  http://n2.nabble.com/-T5--A-root-element-of-html
-is-needed-when-linking-JavaScript-and-stylesheet-resources.-td1470668.html#a1470762http://n2.nabble.com/-T5--A-root-element-of-html-is-needed-when-linking-JavaScript-and-stylesheet-resources.-td1470668.html#a1470762   
Howard said we can override the internal DocumentLinker.  


Can anybody suggest me on how to do?







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



Re: How to override Tapestry's DocumentLinker ?

2009-01-29 Thread Fernando Padilla

Ok cool.

with the latest version of tapestry (5.1.0.0-SNAPSHOT), they did add a 
proper way to override contributions.  Below is the code we're using for 
us to override our DocumentLinker.  Please be aware that the override 
works, but it seems to trash all of the previous relative directives ( 
before, after, declared by overridden service, or any other service 
relative to it), that's why we declared before:RenderSupport, to make 
sure the MarkupRenderer order is still correct.


public void contributeMarkupRenderer( 
OrderedConfigurationMarkupRendererFilter configuration ) {
configuration.override( DocumentLinker, new CustomDocumentLinker(), 
before:RenderSupport );

}



Dude.Checkitout wrote:

Thank you for the quick reply. We are using tapestry to generate a section of
a html page.  We can enforce the requirement of having an root node.

Basically, the requirement will be to accept the root node to be anything.
(not only html)
I created my own CustomDocumentLinker extending from the tapestry
DocumentLinker and modified the code to fit our needs. But I have no idea
how to make Tapestry to use CustomerDocumentLinker instead of its own
DocumentLinker.

Any help in this will be appreciated.



Fernando Padilla wrote:
I have lots of experience playing with that :)  (since we publish to 
html, fbml).  Here are some questions:


1) do your documents have a root node?  what is it?

2) do you want to change the behavior of how it includes javascript and 
css?  Or just have it work with non-html root nodes?




Dude.Checkitout wrote:

We have a requirement of tml file being delivered without html as the
root
context. As I read the tapestry source, this validation is done in the
DocumentLinker.

In contributeMarkupRenderer method:
MarkupRendererFilter documentLinker = new MarkupRendererFilter()
{
public void renderMarkup(MarkupWriter writer, MarkupRenderer
renderer)
{
DocumentLinkerImpl linker = new
DocumentLinkerImpl(productionMode, scriptsAtTop);

environment.push(DocumentLinker.class, linker);

renderer.renderMarkup(writer);

environment.pop(DocumentLinker.class);

linker.updateDocument(writer.getDocument());
}
};


Is there anyway I can override my own DocumentLinker with Tapestry's
DocumentLinker?

In the Post,  http://n2.nabble.com/-T5--A-root-element-of-html
-is-needed-when-linking-JavaScript-and-stylesheet-resources.-td1470668.html#a1470762http://n2.nabble.com/-T5--A-root-element-of-html-is-needed-when-linking-JavaScript-and-stylesheet-resources.-td1470668.html#a1470762   
Howard said we can override the internal DocumentLinker.  


Can anybody suggest me on how to do?






-
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: How to override Tapestry's DocumentLinker ?

2009-01-29 Thread Fernando Padilla
No.  DocumentLinker would be run first ( deeper in the markup filter 
chain ), it would be the only one that RenderSupport would bind to ( 
RenderSupport does a environment.peekRequired ).  So only that 
DocumentLinker would do it's stuff.  and the default DocumentLinker 
throws an exception if the root node is not html.. (adding an option to 
change the fail-fast, into a quiet-fail would be good)


But please be aware, like I said before, you are overriding the default 
documentLinker, so that means that your document linker would have to 
support both html root nodes, and whatever root node you want




Thiago H. de Paula Figueiredo wrote:
Em Thu, 29 Jan 2009 14:42:47 -0300, Dude.Checkitout 
dude.checkit...@gmail.com escreveu:



I created my own CustomDocumentLinker extending from the tapestry
DocumentLinker and modified the code to fit our needs. But I have no idea
how to make Tapestry to use CustomerDocumentLinker instead of its own
DocumentLinker.


Contribute you own DocumentLinker to the MarkupRenderer service. 
Something like this in your AppModule class or any other Tapestry-IoC 
module class:


public void 
contributePartialMarkupRenderer(OrderedConfigurationPartialMarkupRendererFilter 
configuration) {


configuration.add(CustomDocumentLinker, new CustomDocumentLinke(), 
before:DocumentLinker);


}

I haven't tested it, but that's what I would try. :)
By the way, a good knowledge of Tapestry-IoC is not required to use 
Tapestry, but it helps a lot. ;)




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



Re: How to override Tapestry's DocumentLinker ?

2009-01-29 Thread Fernando Padilla
To be honest, I can't remember exactly when the override came into play 
( so it might be worth double checking with eclipse, though I'm pretty 
sure it's 5.1.0.0 ).


The other option is to place your DocumentLinker in between the default 
DocumentLinker and RenderSupport.  Maybe try this:


configuration.add( CustomDocumentLinker, mydoclinker, 
after:DocumentLinker,before:RenderSupport );





Dude.Checkitout wrote:


I am using 5.0.18 version and not ready to move to 5.1 yet. Is there any way
to override the DocumentLinker in the 5.0.18 version?


Fernando Padilla wrote:

Ok cool.

with the latest version of tapestry (5.1.0.0-SNAPSHOT), they did add a 
proper way to override contributions.  Below is the code we're using for 
us to override our DocumentLinker.  Please be aware that the override 
works, but it seems to trash all of the previous relative directives ( 
before, after, declared by overridden service, or any other service 
relative to it), that's why we declared before:RenderSupport, to make 
sure the MarkupRenderer order is still correct.


public void contributeMarkupRenderer( 
OrderedConfigurationMarkupRendererFilter configuration ) {
configuration.override( DocumentLinker, new CustomDocumentLinker(), 
before:RenderSupport );

}



Dude.Checkitout wrote:

Thank you for the quick reply. We are using tapestry to generate a
section of
a html page.  We can enforce the requirement of having an root node.

Basically, the requirement will be to accept the root node to be
anything.
(not only html)
I created my own CustomDocumentLinker extending from the tapestry
DocumentLinker and modified the code to fit our needs. But I have no idea
how to make Tapestry to use CustomerDocumentLinker instead of its own
DocumentLinker.

Any help in this will be appreciated.



Fernando Padilla wrote:
I have lots of experience playing with that :)  (since we publish to 
html, fbml).  Here are some questions:


1) do your documents have a root node?  what is it?

2) do you want to change the behavior of how it includes javascript and 
css?  Or just have it work with non-html root nodes?




Dude.Checkitout wrote:

We have a requirement of tml file being delivered without html as the
root
context. As I read the tapestry source, this validation is done in the
DocumentLinker.

In contributeMarkupRenderer method:
MarkupRendererFilter documentLinker = new
MarkupRendererFilter()
{
public void renderMarkup(MarkupWriter writer,
MarkupRenderer
renderer)
{
DocumentLinkerImpl linker = new
DocumentLinkerImpl(productionMode, scriptsAtTop);

environment.push(DocumentLinker.class, linker);

renderer.renderMarkup(writer);

environment.pop(DocumentLinker.class);

linker.updateDocument(writer.getDocument());
}
};


Is there anyway I can override my own DocumentLinker with Tapestry's
DocumentLinker?

In the Post,  http://n2.nabble.com/-T5--A-root-element-of-html
-is-needed-when-linking-JavaScript-and-stylesheet-resources.-td1470668.html#a1470762http://n2.nabble.com/-T5--A-root-element-of-html-is-needed-when-linking-JavaScript-and-stylesheet-resources.-td1470668.html#a1470762   
Howard said we can override the internal DocumentLinker.  


Can anybody suggest me on how to do?






-
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: How to override Tapestry's DocumentLinker ?

2009-01-29 Thread Fernando Padilla
yah, this is little confusing, since it will place the CustomLinker 
first in the list of filters.. :)  But they execute as they come out 
of the list.. :)


CustomLinker - DocumentLinker - RenderSupport - PAGERENDER

So as the page render unfurls, it gives control to RenderSupport to 
modify the DOM, then DocumentLinker, then CustomLinker.  And the 
document linkers really don't do anything by themselves, and require a 
RenderSupport to feed them the script/css links.  So the RenderSupport 
filter would call environment.peekRequired(DocumentLinker.class), which 
would return the deepest DocumentLinker at the moment (the default, not 
the Custom one)..


So yeah a little confusing.. :) :)


Thiago H. de Paula Figueiredo wrote:
Em Thu, 29 Jan 2009 15:14:40 -0300, Fernando Padilla f...@alum.mit.edu 
escreveu:


No.  DocumentLinker would be run first ( deeper in the markup filter 
chain ), it would be the only one that RenderSupport would bind to ( 
RenderSupport does a environment.peekRequired ).  So only that 
DocumentLinker would do it's stuff.


Even when the custom document linker is explicitly added to the 
OrderedConfiguration *before* the normal DocumentLinker? If yes, well, 
the contribution overriding mechanism in T5.1 will be extra handy . . . :)




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



T5: HiddenField?

2009-01-21 Thread Fernando Padilla

So.. Is there really ho HiddenField component for Tapestry 5?
Is this just a minor oversight, or is there a different way to add 
values to be passed through form?


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



Re: T5: HiddenField?

2009-01-21 Thread Fernando Padilla

.. but yet not really..

Since if I use a form context, then I think I have to then create a 
special event listener to deal with that context right? 
onActionFromForm(context)...


I just want to add hidden fields, and have the component take care of 
serializing and deserializing the values appropriately..


thank you :)


Thiago H. de Paula Figueiredo wrote:
Em Wed, 21 Jan 2009 14:43:31 -0300, Fernando Padilla f...@alum.mit.edu 
escreveu:



So.. Is there really ho HiddenField component for Tapestry 5?
Is this just a minor oversight, or is there a different way to add 
values to be passed through form?


One option is to use Form's context parameter. AFAIK, it works exactly 
like the context parameter found in PageLink, ActionLink and EventLink.




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



Re: T5: HiddenField?

2009-01-21 Thread Fernando Padilla

thank you. :)

onSuccess would be WAY too late. :)  The whole point to have hidden 
variables is to make sure state is carried through so that we have 
something to work with.. :)


thank you for pointing out Chenillekit, maybe I'll look into it, but we 
already had to create our own HiddenField, just wondering why it's not 
there by default in Tapestry.. because I think it's a pretty valid 
usecase.. :)


later

'nando


Thiago H. de Paula Figueiredo wrote:
Em Wed, 21 Jan 2009 19:47:55 -0300, Fernando Padilla f...@alum.mit.edu 
escreveu:


Since if I use a form context, then I think I have to then create a 
special event listener to deal with that context right? 
onActionFromForm(context)...


Not right! :) It would be passed to you onSuccess method, AFAIK.

I just want to add hidden fields, and have the component take care of 
serializing and deserializing the values appropriately..


There's the Hidden component in Chenillekit: 
http://www.chenillekit.org/chenillekit-tapestry/ref/org/chenillekit/tapestry/core/components/Hidden.html. 
By the way, there are some really nice components there.



thank you :)


Gracias!



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



Re: profiling tapestry components

2009-01-16 Thread Fernando Padilla

I'm using 5.1.0.0.

But I'm sorry to confuse you all.  I'm not trying to profile Tapestry 
lowlevel code, I'm trying to profile my own component code :)


I want to know collectively how long any one of my component takes to 
render.  The reason I think this view of things would be useful, is that 
profiling at method level might not give me a clear picture of where to 
 focus on.. ( we'll see lots of setupRenders. lots of beginRenders, but 
no relationship between one component and how it depends on 
subcomponents, etc etc)


Do you understand?  So it's not profiling Tapestry code precisely, but 
profiling pages/components via the view of tapestry's component 
rendering tree..


I don't know if it would be ultimately useful, but it sounds like an 
interesting idea..



Howard Lewis Ship wrote:

Are you using Tapestry 5.0.18 or 5.1.0.0-SNAPSHOT?  I've added some
considerable performance improvements to 5.1.

I would get a copy of YourKit and start profiling to see where the
actual problems are.

Tapestry takes a hit because it renders the entire document to a kind
of light-weight DOM before it can start to stream the output; that's a
lot of churn in the JVM's eden heap space.

On Thu, Jan 15, 2009 at 8:17 PM, Thiago H. de Paula Figueiredo
thiag...@gmail.com wrote:

Em Thu, 15 Jan 2009 23:19:56 -0300, Fernando Padilla f...@alum.mit.edu
escreveu:


The database was just upgraded and io/cpu is really really low.  So that
won't be the case.

I would still check this out . . . Don't forget about one transaction
waiting for others to release locks in table rows . . .


The root cause might be the number of db requests required to render a
page, but the database it self is not the bottle neck. :) :)

A real case I found as a consultant was the lack of attention to Hibernate
mapping options, specially regarding lazy loading of collections. Instead of
using one or two selects to load an entity object and one of its lists, it
was using one for each element in the list. This absolutely kills
performance.

By the way, nice performance improvement hunting! :) Don't forget to share
your experience with us. ;)

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

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








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



profiling tapestry components

2009-01-15 Thread Fernando Padilla
I was wondering if I could create some sort of profiler, that would 
print out the render time for each component..


that way I can use that information to try to pinpoint components that 
need to be optimized..


any ideas?


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



Re: profiling tapestry components

2009-01-15 Thread Fernando Padilla
Well, we have a large app that is not performing very well.. and now I 
have to figure out how to make it more performant..


And I was just wondering if dumping component level response times, 
could maybe give me some sort of clue as to what to focus on..  It's a 
slightly different view of the code and work being done, instead of at 
method response times.. because there is no one method for rendering a 
component or page, etc..


so, just a thought.

I guess I can tweek ComponentPageElementImpl to add extra 
RenderingEvents to do this.. interesting..




Howard Lewis Ship wrote:

Acutally, check the logging documentation; there's already a service
that times how long the render takes and how many render operations
were involved.  Much of the performance improvements in 5.1 was reduce
the number of operations per component.

There isn't a good way to get output about time per component; that
time would be very short  hard to measure.

Why are you interested in component render times?

On Thu, Jan 15, 2009 at 4:35 PM, Thiago H. de Paula Figueiredo
thiag...@gmail.com wrote:

Em Thu, 15 Jan 2009 20:26:38 -0300, Fernando Padilla f...@alum.mit.edu
escreveu:


I was wondering if I could create some sort of profiler, that would print
out the render time for each component..
that way I can use that information to try to pinpoint components that
need to be optimized..

Quick and lazy :) answer: try to find the tapestry-core service that renders
components and decorate it using AspectDecorator . . .

I hope it helps . . .

By the way, AspectDecorator is absolutely awesome.

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

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








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



Re: profiling tapestry components

2009-01-15 Thread Fernando Padilla

I know that. :)

The database was just upgraded and io/cpu is really really low.  So that 
won't be the case.  The root cause might be the number of db requests 
required to render a page, but the database it self is not the bottle 
neck. :) :)


Thiago H. de Paula Figueiredo wrote:
Em Thu, 15 Jan 2009 20:57:19 -0300, Fernando Padilla f...@alum.mit.edu 
escreveu:


Well, we have a large app that is not performing very well.. and now I 
have to figure out how to make it more performant..


In my humble opinion, you're starting to performance bottleneck from the 
wrong side of the stack. Most of the time, the culprit is the database 
(or any other data storage implementation). I would start by logging the 
running time of the data access methods.




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



Re: zone enhancements?

2009-01-13 Thread Fernando Padilla
If you want to learn about how zones are implemented, this is the code 
you'll have to review:


in tapestry.js:
Tapestry.ZoneManager
Tapestry.Initializer.zone
Tapestry.Initializer.linkZone

in java:
ClientBehaviorSupport.addZone
ClientBehaviorSupport.linkZone
RenderSupport.addInit


Essentially, when you do t:zone, it calls 
ClientBehaviorSupport.addZone, which calls Tapestry.Initializer.zone, 
which ties a ZoneManager to that element.


Once you have a zone manager, that is the actual code that manages the 
update/show/geturl, etc..


when you have a form or link that use zones, they call 
ClientBehaviorSupport.linkZone, then Tapestry.Initializer.linkZone 
hijacks the submit/click events and pipe them through the zoneManager 
instead to update only the desired Zone.


So.. the ZoneManager is what would have to be enhanced.. to add more 
concepts of callbacks/effects.. etc.




As to the single click, I think it would be best to do in the client 
side. really.. why for the us tapestry developers to keep adding cruft 
around all of our action/form/events etc.. and have to deal with global 
locks/semaphores!! :)  When you can simply have the ZoneManager track a 
single variable on the client side :) :)  Of course I'm not talking 
about critical pieces of code, just for general cleanliness, and avoid 
user confusion if they click multiple times and it updates multiple 
times without them expecting it.




Lutz Hühnken wrote:

Fernando,

I agree with you, especially your suggestion (1) would be very helpful
and a welcome addition. The form/zone combination could maybe include
more callback hooks. I think I have a case of Rails envy, look at the
callbacks you can use for the remote_form_tag:


The callbacks that may be specified are (in order):
:loading:   Called when the remote document is being loaded with data by 
the browser.
:loaded:Called when the browser has finished loading the remote 
document.
:interactive:   Called when the user can interact with the remote document, 
even though it
has not finished loading.
:success:   Called when the XMLHttpRequest is completed,
and the HTTP status code is in the 2XX range.
:failure:   Called when the XMLHttpRequest is completed,
and the HTTP status code is not in the 2XX range.
:complete: Called when the XMLHttpRequest is complete (fires after 
success/failure if
they are present).

You can further refine :success and :failure by adding additional callbacks for 
specific
status codes. A status code callback overrides the success/failure handlers if 
present.

 If you for some reason or another need synchronous processing (that'll block 
the
browser while the request is happening), you can specify options[:type] = 
:synchronous.

You can customize further browser side call logic by passing in JavaScript code
snippets via some optional parameters. In their order of use these are:
:confirm:   Adds confirmation dialog.
:condition: Perform remote request conditionally by this expression.
Use this to describe browser-side conditions when request should not be 
initiated.
:before:Called before request is initiated.
:after: Called immediately after request was initiated and before :loading.
:submit:Specifies the DOM element ID that's used as the parent of the 
form elements.
By default this is the current form, but it could just as well be the ID of a 
table
row or any other DOM element.
:with:  A JavaScript expression specifying the parameters for the 
XMLHttpRequest.
Any expressions should return a valid URL query string.


With this, you could easily show a DIV with a spinner gif / busy
indicator after the click, and hide it again when on complete:

% form_remote_tag :url = { :action = search },
   :after = Element.show('loading');
Element.hide('results'),
   :update = :results,
   :complete =
Element.hide('loading'); Element.show('results') do %


Oh, I'd love to have that in Tapestry. Doesn't Rails use
script.aculo.us, just like Tapestry? Wouldn't that be easy to
implement, given the hard part is done by script.aculo.us anyway? I've
never really looked at it, but I think the Tapestry tags don't produce
script.aculo.us code directly, the library is wrapped and thereby only
a reduced functionality is available. Thinking about it.. in
script.aculo.us, you can customize the effects (like the highlight and
fade) with parameters, such as hightlight time and colour. This also
is lost in Tapestry.

Assuming I would wish to extend the script.aculo.us integration, in
order to provide all those AJAX form callbacks, and effects
parameters.. what would be the way to go? What would be a good place
to start?



About (2) - I think that could maybe be more easily handled on the
server-side, using a transaction/synchronization token, like you would
to prevent regular forms from being double-submitted.


Lutz





zone enhancements?

2009-01-12 Thread Fernando Padilla
We are starting to use zones a lot more and they are a great and simple 
concept.  I was wondering if anyone had any comments or had put any 
legwork towards these simple enhancements.



1) updatingEffects
  along the lines of the showEffect and updateEffect currently 
supported, except that this would be an effect to run while the 
zoneManager was fetching the content (ajax request).


 Could be as simple as a modal gray out, with a loading spinner...
 or completely remove previous content, and replace with Loading...


2) no outstanding updates
  if I keep clicking on a link while the zone is still fetching the new 
content, it will keep firing off ajax calls.. add a way to ignore new 
update requests, until the currently running one finishes..




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



timezone support

2009-01-09 Thread Fernando Padilla
I was just wondering if someone has put some thought into having 
tapestry support TimeZone, just as it now supports Locale?


That way we can render all dates appropriately?

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



Re: problem with t:formdata

2009-01-08 Thread Fernando Padilla
by default t:loop serializes the source list into t:formdata, so that in 
can have predictable form processing.  But if you can reconstitute the 
source list used by the loop, and understand that the form might behave 
erratic in some edge cases ( if the list changes between form render and 
form handling ).


Then just look at the volatile flag on the loop component:

http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/Loop.html



jgn wrote:

t:formdata is too big on a page that I have (5MB or more).

I have a form with only 12 fields and I display a table with 14 rows, the
problem is that if the loop component that displays the tables is inside the
form, the t:formdata becomes huge. If is not inside the form, it works just
fine :D.

The loop is throw a list of beans. Is a complex structure because that beans
have properties that are beans too and so, but what I display is not all the
info, just a couple of fields. I have all the information on memory to save
time loading from DB, etc, that is why the info is big.

The problem seems to be (or I suppose, but not sure)  that the loop
component is serializing the beans and including them on the t:formdata
field. If this is true, is there a way to tell the loop component not to
serialize the beans ?, I mean, if they are not part of the form, why
serialize them ?.

I keep the loop inside the form because at the end of the table I have a
submit component, I need to keep it there for a reason long to explain, so
to keep a short post, what can I do to keep the t:formdata smaller ? (the
response from tapestry is fast, but firefox takes a long time to display the
results, from 3 to 4 seconds, because the size of the page)

Thank you.


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



Re: spring context troubles

2009-01-03 Thread Fernando Padilla
I hope you're starting to see, this is a bigger than backward 
compatibility.  This is totally scrapping a huge piece of 
functionality.  Exposing tapestry services as beans it totally new and 
different from exposing my spring beans within tapestry.  They serve 
totally different purposes, needs and requirements.  Just because you 
have not used it, doesn't mean that it's not pivotal to most people's 
architectures now...


really.  If you turn that off, I would have to totally re-architect my 
apps (many apps)


..
.


Howard Lewis Ship wrote:

Seems like I'm faced with two evils: breaking compatibility on the one
hand, maintaining two different sets of Spring integration on the
other.

On Fri, Jan 2, 2009 at 10:50 AM, Fernando Padilla f...@alum.mit.edu wrote:

That's alright to keep them separate, but I'm just worried that the 5.0.18
will stop working at some point..

That is why I proposed that you should really have two different pacakges..
one for each direction of integration, and people can explicitly choose
which one to use.  It just seems kind of brittle saying never to upgrade
your spring package, that strategy will fail at some point, and could just
confuse people in the interim...

Howard Lewis Ship wrote:

Actually, I'm liking the idea that compatibility on this comes from
continuing to use the old version of tapestry-spring. I haven't found
a way to do both: allow injection of Tapestry services into Spring
beans and expose Spring beans as Tapestry services. The lifecycles of
the two containers do not mesh easily.

On Thu, Jan 1, 2009 at 3:23 PM, Fernando Padilla f...@alum.mit.edu
wrote:

nice work around.  but I want to make sure, this will be a temporary work
around until you get the latest spring module working as you desire, with
two-way integration??

Howard Lewis Ship wrote:

I think the best option for you is to use Tapestry 5.1, but revert
tapestry-spring to 5.0.18.  This allows you to benefit from the
improvements to tapestry-core without having any compatibility
problems with the changes to tapestry-spring. I'm adding documentation
to the web site to explain this.

On Mon, Dec 29, 2008 at 4:20 PM, Fernando Padilla f...@alum.mit.edu
wrote:

I'm sorry that I'm hammering on this code, while it's still probably a
work
in progress.. (always available through im)

but I commented out the spring ContextLoaderListener, moved the filter
up
to
be first, and this seems to initialize properly at least for Jetty
(within
eclipse).  The next issue, it looks like it did not register the spring
beans in the TapestryIoC.. so now I'm getting exceptions saying that it
can't find particular beans:



Caused by: java.lang.RuntimeException: Service id
'common-conf-properties'
is not defined by any module.  Defined services:
ActionRenderResponseGenerator, AjaxComponentEventRequestHandler,
AjaxComponentEventResultProcessor, AjaxPartialResponseRenderer, Alias,
AliasOverrides, AppSubscriptionHandler, ApplicationContext,
ApplicationDefaults, ApplicationGlobals, ApplicationInitializer,
ApplicationStateManager, ApplicationStatePersistenceStrategySource,
AspectDecorator, AssetBindingFactory, AssetObjectProvider, AssetSource,
BaseURLSource, BeanBlockOverrideSource, BeanBlockSource,
BeanModelSource,
BindingSource, ChainBuilder, ClassNameLocator,
ClasspathAssetAliasManager,
ClasspathAssetFactory, ClasspathURLConverter,
ClientPersistentFieldStorage,
ClientPersistentFieldStrategy, ComponentClassCache,
ComponentClassFactory,
ComponentClassResolver, ComponentClassTransformWorker,
ComponentClassTransformer, ComponentClassesInvalidationEventHub,
ComponentDefaultProvider, ComponentEventRequestHandler,
ComponentEventResultProcessor, ComponentInstanceResultProcessor,
ComponentInstantiatorSource, ComponentInvocationMap,
ComponentMessagesInvalidationEventHub, ComponentMessagesSource,
ComponentPageElementResourcesSource, ComponentSource,
ComponentTemplateSource, ComponentTemplatesInvalidationEventHub,
Context,
ContextAssetFactory, ContextPathEncoder, ContextValueEncoder,
CookieSink,
CookieSource, Cookies, CtClassSource, DataTypeAnalyzer,
DefaultDataTypeAnalyzer, DefaultFileItemFactory,
DefaultImplementationBuilder, EndOfRequestListenerHub, Environment,
EnvironmentalShadowBuilder, ExceptionAnalyzer, ExceptionTracker,
FacebookAuthFilterImpl, FactoryDefaults, FbForceModeFilter,
FieldTranslatorSource, FieldValidationSupport,
FieldValidatorDefaultSource,
FieldValidatorSource, FormSupport, HiddenFieldLocationRules,
HttpServletRequest, HttpServletRequestHandler, IgnoredPathsFilter,
InjectionProvider, InternalRequestGlobals, LinkCreationHub,
LinkFactory,
LocalizationSetter, LocationRenderer, LoggingDecorator, MarkupRenderer,
MarkupWriterFactory, MasterDispatcher, MasterObjectProvider,
MessageBindingFactory, MetaDataLocator, MultipartDecoder,
NullFieldStrategyBindingFactory, NullFieldStrategySource,
ObjectRenderer,
OsForceTypeFilter, PageActivationContextCollector,
PageContentTypeAnalyzer,
PageDocumentGenerator

Re: spring context troubles

2009-01-02 Thread Fernando Padilla
That's alright to keep them separate, but I'm just worried that the 
5.0.18 will stop working at some point..


That is why I proposed that you should really have two different 
pacakges.. one for each direction of integration, and people can 
explicitly choose which one to use.  It just seems kind of brittle 
saying never to upgrade your spring package, that strategy will fail at 
some point, and could just confuse people in the interim...


Howard Lewis Ship wrote:

Actually, I'm liking the idea that compatibility on this comes from
continuing to use the old version of tapestry-spring. I haven't found
a way to do both: allow injection of Tapestry services into Spring
beans and expose Spring beans as Tapestry services. The lifecycles of
the two containers do not mesh easily.

On Thu, Jan 1, 2009 at 3:23 PM, Fernando Padilla f...@alum.mit.edu wrote:

nice work around.  but I want to make sure, this will be a temporary work
around until you get the latest spring module working as you desire, with
two-way integration??

Howard Lewis Ship wrote:

I think the best option for you is to use Tapestry 5.1, but revert
tapestry-spring to 5.0.18.  This allows you to benefit from the
improvements to tapestry-core without having any compatibility
problems with the changes to tapestry-spring. I'm adding documentation
to the web site to explain this.

On Mon, Dec 29, 2008 at 4:20 PM, Fernando Padilla f...@alum.mit.edu
wrote:

I'm sorry that I'm hammering on this code, while it's still probably a
work
in progress.. (always available through im)

but I commented out the spring ContextLoaderListener, moved the filter up
to
be first, and this seems to initialize properly at least for Jetty
(within
eclipse).  The next issue, it looks like it did not register the spring
beans in the TapestryIoC.. so now I'm getting exceptions saying that it
can't find particular beans:



Caused by: java.lang.RuntimeException: Service id
'common-conf-properties'
is not defined by any module.  Defined services:
ActionRenderResponseGenerator, AjaxComponentEventRequestHandler,
AjaxComponentEventResultProcessor, AjaxPartialResponseRenderer, Alias,
AliasOverrides, AppSubscriptionHandler, ApplicationContext,
ApplicationDefaults, ApplicationGlobals, ApplicationInitializer,
ApplicationStateManager, ApplicationStatePersistenceStrategySource,
AspectDecorator, AssetBindingFactory, AssetObjectProvider, AssetSource,
BaseURLSource, BeanBlockOverrideSource, BeanBlockSource, BeanModelSource,
BindingSource, ChainBuilder, ClassNameLocator,
ClasspathAssetAliasManager,
ClasspathAssetFactory, ClasspathURLConverter,
ClientPersistentFieldStorage,
ClientPersistentFieldStrategy, ComponentClassCache,
ComponentClassFactory,
ComponentClassResolver, ComponentClassTransformWorker,
ComponentClassTransformer, ComponentClassesInvalidationEventHub,
ComponentDefaultProvider, ComponentEventRequestHandler,
ComponentEventResultProcessor, ComponentInstanceResultProcessor,
ComponentInstantiatorSource, ComponentInvocationMap,
ComponentMessagesInvalidationEventHub, ComponentMessagesSource,
ComponentPageElementResourcesSource, ComponentSource,
ComponentTemplateSource, ComponentTemplatesInvalidationEventHub, Context,
ContextAssetFactory, ContextPathEncoder, ContextValueEncoder, CookieSink,
CookieSource, Cookies, CtClassSource, DataTypeAnalyzer,
DefaultDataTypeAnalyzer, DefaultFileItemFactory,
DefaultImplementationBuilder, EndOfRequestListenerHub, Environment,
EnvironmentalShadowBuilder, ExceptionAnalyzer, ExceptionTracker,
FacebookAuthFilterImpl, FactoryDefaults, FbForceModeFilter,
FieldTranslatorSource, FieldValidationSupport,
FieldValidatorDefaultSource,
FieldValidatorSource, FormSupport, HiddenFieldLocationRules,
HttpServletRequest, HttpServletRequestHandler, IgnoredPathsFilter,
InjectionProvider, InternalRequestGlobals, LinkCreationHub, LinkFactory,
LocalizationSetter, LocationRenderer, LoggingDecorator, MarkupRenderer,
MarkupWriterFactory, MasterDispatcher, MasterObjectProvider,
MessageBindingFactory, MetaDataLocator, MultipartDecoder,
NullFieldStrategyBindingFactory, NullFieldStrategySource, ObjectRenderer,
OsForceTypeFilter, PageActivationContextCollector,
PageContentTypeAnalyzer,
PageDocumentGenerator, PageElementFactory, PageLoader,
PageMarkupRenderer,
PagePool, PageRenderQueue, PageRenderRequestHandler,
PageResponseRenderer,
PageTemplateLocator, PartialMarkupRenderer, PersistentFieldManager,
PersistentLocale, PipelineBuilder, PropBindingFactory, PropertyAccess,
PropertyConduitSource, PropertyShadowBuilder, RegistryStartup,
RenderSupport, Request, RequestExceptionHandler, RequestGlobals,
RequestHandler, RequestLogFilter, RequestPageCache, RequestPathOptimizer,
RequestSecurityManager, ResourceCache, ResourceDigestGenerator,
ResourceStreamer, Response, ResponseRenderer, ServiceLifecycleSource,
ServletApplicationInitializer,
SessionApplicationStatePersistenceStrategy,
StrategyBuilder, SymbolSource, TemplateParser, ThreadLocale,
TranslateBindingFactory, TranslatorSource

Re: spring context troubles

2009-01-01 Thread Fernando Padilla
nice work around.  but I want to make sure, this will be a temporary 
work around until you get the latest spring module working as you 
desire, with two-way integration??


Howard Lewis Ship wrote:

I think the best option for you is to use Tapestry 5.1, but revert
tapestry-spring to 5.0.18.  This allows you to benefit from the
improvements to tapestry-core without having any compatibility
problems with the changes to tapestry-spring. I'm adding documentation
to the web site to explain this.

On Mon, Dec 29, 2008 at 4:20 PM, Fernando Padilla f...@alum.mit.edu wrote:

I'm sorry that I'm hammering on this code, while it's still probably a work
in progress.. (always available through im)

but I commented out the spring ContextLoaderListener, moved the filter up to
be first, and this seems to initialize properly at least for Jetty (within
eclipse).  The next issue, it looks like it did not register the spring
beans in the TapestryIoC.. so now I'm getting exceptions saying that it
can't find particular beans:



Caused by: java.lang.RuntimeException: Service id 'common-conf-properties'
is not defined by any module.  Defined services:
ActionRenderResponseGenerator, AjaxComponentEventRequestHandler,
AjaxComponentEventResultProcessor, AjaxPartialResponseRenderer, Alias,
AliasOverrides, AppSubscriptionHandler, ApplicationContext,
ApplicationDefaults, ApplicationGlobals, ApplicationInitializer,
ApplicationStateManager, ApplicationStatePersistenceStrategySource,
AspectDecorator, AssetBindingFactory, AssetObjectProvider, AssetSource,
BaseURLSource, BeanBlockOverrideSource, BeanBlockSource, BeanModelSource,
BindingSource, ChainBuilder, ClassNameLocator, ClasspathAssetAliasManager,
ClasspathAssetFactory, ClasspathURLConverter, ClientPersistentFieldStorage,
ClientPersistentFieldStrategy, ComponentClassCache, ComponentClassFactory,
ComponentClassResolver, ComponentClassTransformWorker,
ComponentClassTransformer, ComponentClassesInvalidationEventHub,
ComponentDefaultProvider, ComponentEventRequestHandler,
ComponentEventResultProcessor, ComponentInstanceResultProcessor,
ComponentInstantiatorSource, ComponentInvocationMap,
ComponentMessagesInvalidationEventHub, ComponentMessagesSource,
ComponentPageElementResourcesSource, ComponentSource,
ComponentTemplateSource, ComponentTemplatesInvalidationEventHub, Context,
ContextAssetFactory, ContextPathEncoder, ContextValueEncoder, CookieSink,
CookieSource, Cookies, CtClassSource, DataTypeAnalyzer,
DefaultDataTypeAnalyzer, DefaultFileItemFactory,
DefaultImplementationBuilder, EndOfRequestListenerHub, Environment,
EnvironmentalShadowBuilder, ExceptionAnalyzer, ExceptionTracker,
FacebookAuthFilterImpl, FactoryDefaults, FbForceModeFilter,
FieldTranslatorSource, FieldValidationSupport, FieldValidatorDefaultSource,
FieldValidatorSource, FormSupport, HiddenFieldLocationRules,
HttpServletRequest, HttpServletRequestHandler, IgnoredPathsFilter,
InjectionProvider, InternalRequestGlobals, LinkCreationHub, LinkFactory,
LocalizationSetter, LocationRenderer, LoggingDecorator, MarkupRenderer,
MarkupWriterFactory, MasterDispatcher, MasterObjectProvider,
MessageBindingFactory, MetaDataLocator, MultipartDecoder,
NullFieldStrategyBindingFactory, NullFieldStrategySource, ObjectRenderer,
OsForceTypeFilter, PageActivationContextCollector, PageContentTypeAnalyzer,
PageDocumentGenerator, PageElementFactory, PageLoader, PageMarkupRenderer,
PagePool, PageRenderQueue, PageRenderRequestHandler, PageResponseRenderer,
PageTemplateLocator, PartialMarkupRenderer, PersistentFieldManager,
PersistentLocale, PipelineBuilder, PropBindingFactory, PropertyAccess,
PropertyConduitSource, PropertyShadowBuilder, RegistryStartup,
RenderSupport, Request, RequestExceptionHandler, RequestGlobals,
RequestHandler, RequestLogFilter, RequestPageCache, RequestPathOptimizer,
RequestSecurityManager, ResourceCache, ResourceDigestGenerator,
ResourceStreamer, Response, ResponseRenderer, ServiceLifecycleSource,
ServletApplicationInitializer, SessionApplicationStatePersistenceStrategy,
StrategyBuilder, SymbolSource, TemplateParser, ThreadLocale,
TranslateBindingFactory, TranslatorSource, TypeCoercer, URLEncoder,
UpdateListenerHub, ValidateBindingFactory, ValidationConstraintGenerator,
ValidationMessagesSource, ValueEncoderSource.
   at
org.apache.tapestry5.ioc.internal.RegistryImpl.locateModuleForService(RegistryImpl.java:321)
   at
org.apache.tapestry5.ioc.internal.RegistryImpl.getService(RegistryImpl.java:288)
   at
org.apache.tapestry5.ioc.internal.ObjectLocatorImpl.getService(ObjectLocatorImpl.java:39)
   at
org.apache.tapestry5.internal.services.ServiceAnnotationObjectProvider.provide(ServiceAnnotationObjectProvider.java:35)
   at
org.apache.tapestry5.ioc.internal.services.MasterObjectProviderImpl$1.invoke(MasterObjectProviderImpl.java:50)
   at
org.apache.tapestry5.ioc.internal.InvokableToRunnable.run(InvokableToRunnable.java:36)
   at
org.apache.tapestry5.ioc.internal.OperationTrackerImpl.run

[TAP5] single letter properties not working??

2008-12-29 Thread Fernando Padilla

https://issues.apache.org/jira/browse/TAP5-425

In our code we used some single letter properties.  This used to work in 
tapestry 5.0.15 or so.. but when we upgraded to 5.1-SNAPSHOT, tapestry 
now fails at runtime with a very weird execption.  Any clues to get this 
fixed in tapestry would be appreciated.


Below is the exception, the getter we have in the page.java, and how 
it's used in the page.tml.


## exception (runtime)
Could not convert 'K' into a component parameter binding: Node 
unexpected: [...@-1,0:0='no text',-1,0:-1], resync=null (within 
expression 'K') was type invalid, but was expected to be (one of) 
IDENTIFIER, INVOKE, LIST, RANGEOP.


## .java
public boolean isK() {
return true; // if is of kicker type
}

## .tml
t:if test=K
...
/t:if




The weird thing is that this keeps failing, even if I change the tml:

t:if test=prop:K
...
/t:if


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




spring context troubles

2008-12-29 Thread Fernando Padilla
I just tried to run with the latest tapestry-trunk, and I get this 
really nasty exception :( :(


I initialize my own spring context with a ContextLoaderListener, because 
I need spring outside of tapestry.  Why is tapestry attempting to create 
a context?





2008-12-29 15:18:27,363 [main] ERROR org.apache.tapestry5.ioc.Registry - 
Cannot initialize context because there is already a root application 
context present - check whether you have multiple ContextLoader* 
definitions in your web.xml!
2008-12-29 15:18:27,363 [main] ERROR org.apache.tapestry5.ioc.Registry - 
Operations trace:
2008-12-29 15:18:27,364 [main] ERROR org.apache.tapestry5.ioc.Registry - 
[ 1] Realizing service ApplicationContext
2008-12-29 15:18:27,364 [main] ERROR org.apache.tapestry5.ioc.Registry - 
[ 2] Invoking ObjectCreator for Spring ApplicationContext
2008-12-29 15:18:27,364 [main] ERROR org.apache.tapestry5.ioc.Registry - 
[ 3] Creating Spring ApplicationContext via ContextLoader
2008-12-29 15:18:27,365 [main] ERROR Spring.ApplicationContext - 
Construction of service ApplicationContext failed: Cannot initialize 
context because there is already a root application context present - 
check whether you have multiple ContextLoader* definitions in your web.xml!
org.apache.tapestry5.ioc.internal.OperationException: Cannot initialize 
context because there is already a root application context present - 
check whether you have multiple ContextLoader* definitions in your web.xml!
	at 
org.apache.tapestry5.ioc.internal.OperationTrackerImpl.run(OperationTrackerImpl.java:74)
	at 
org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:96)
	at 
org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:68)
	at 
org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:871)
	at 
org.apache.tapestry5.internal.spring.SpringModuleDef$1$2.createObject(SpringModuleDef.java:76)
	at 
org.apache.tapestry5.ioc.internal.OperationTrackingObjectCreator$1.invoke(OperationTrackingObjectCreator.java:45)
	at 
org.apache.tapestry5.ioc.internal.InvokableToRunnable.run(InvokableToRunnable.java:36)
	at 
org.apache.tapestry5.ioc.internal.OperationTrackerImpl.run(OperationTrackerImpl.java:52)
	at 
org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:96)
	at 
org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:68)
	at 
org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:871)
	at 
org.apache.tapestry5.ioc.internal.OperationTrackingObjectCreator.createObject(OperationTrackingObjectCreator.java:49)
	at 
org.apache.tapestry5.ioc.internal.SingletonServiceLifecycle.createService(SingletonServiceLifecycle.java:29)
	at 
org.apache.tapestry5.ioc.internal.LifecycleWrappedServiceCreator.createObject(LifecycleWrappedServiceCreator.java:52)
	at 
org.apache.tapestry5.ioc.internal.InterceptorStackBuilder.createObject(InterceptorStackBuilder.java:56)
	at 
org.apache.tapestry5.ioc.internal.RecursiveServiceCreationCheckWrapper.createObject(RecursiveServiceCreationCheckWrapper.java:60)
	at 
org.apache.tapestry5.ioc.internal.OperationTrackingObjectCreator$1.invoke(OperationTrackingObjectCreator.java:45)
	at 
org.apache.tapestry5.ioc.internal.InvokableToRunnable.run(InvokableToRunnable.java:36)
	at 
org.apache.tapestry5.ioc.internal.OperationTrackerImpl.run(OperationTrackerImpl.java:52)
	at 
org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:96)
	at 
org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:68)
	at 
org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:871)
	at 
org.apache.tapestry5.ioc.internal.OperationTrackingObjectCreator.createObject(OperationTrackingObjectCreator.java:49)
	at 
org.apache.tapestry5.ioc.internal.services.JustInTimeObjectCreator.createObject(JustInTimeObjectCreator.java:65)
	at 
$ConfigurableWebApplicationContext_11e850a8929.delegate($ConfigurableWebApplicationContext_11e850a8929.java)
	at 
$ConfigurableWebApplicationContext_11e850a8929.getBeanDefinitionCount($ConfigurableWebApplicationContext_11e850a8929.java)
	at 
org.apache.tapestry5.internal.spring.SpringModule$1.initializeApplication(SpringModule.java:45)
	at 
$ApplicationInitializer_11e850a892a.initializeApplication($ApplicationInitializer_11e850a892a.java)
	at 
org.apache.tapestry5.services.TapestryModule$37.initializeApplication(TapestryModule.java:1912)
	at 
$ApplicationInitializer_11e850a892a.initializeApplication($ApplicationInitializer_11e850a892a.java)
	at 
$ApplicationInitializer_11e850a8925.initializeApplication($ApplicationInitializer_11e850a8925.java)
	at 
org.apache.tapestry5.services.TapestryModule$18.initializeApplication(TapestryModule.java:1043)
	at 
$ServletApplicationInitializer_11e850a890f.initializeApplication($ServletApplicationInitializer_11e850a890f.java)

at 

spring context troubles

2008-12-29 Thread Fernando Padilla

I just tried to run with the latest tapestry-trunk, and I get this
really nasty exception :( :(

I initialize my own spring context with a ContextLoaderListener, because
I need spring outside of tapestry.  Why is tapestry attempting to create
a context?




2008-12-29 15:18:27,363 [main] ERROR org.apache.tapestry5.ioc.Registry -
Cannot initialize context because there is already a root application
context present - check whether you have multiple ContextLoader*
definitions in your web.xml!
2008-12-29 15:18:27,363 [main] ERROR org.apache.tapestry5.ioc.Registry -
Operations trace:
2008-12-29 15:18:27,364 [main] ERROR org.apache.tapestry5.ioc.Registry -
[ 1] Realizing service ApplicationContext
2008-12-29 15:18:27,364 [main] ERROR org.apache.tapestry5.ioc.Registry -
[ 2] Invoking ObjectCreator for Spring ApplicationContext
2008-12-29 15:18:27,364 [main] ERROR org.apache.tapestry5.ioc.Registry -
[ 3] Creating Spring ApplicationContext via ContextLoader
2008-12-29 15:18:27,365 [main] ERROR Spring.ApplicationContext -
Construction of service ApplicationContext failed: Cannot initialize
context because there is already a root application context present -
check whether you have multiple ContextLoader* definitions in your web.xml!
org.apache.tapestry5.ioc.internal.OperationException: Cannot initialize
context because there is already a root application context present -
check whether you have multiple ContextLoader* definitions in your web.xml!
at
org.apache.tapestry5.ioc.internal.OperationTrackerImpl.run(OperationTrackerImpl.java:74)
at
org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:96)
at
org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:68)
at
org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:871)
at
org.apache.tapestry5.internal.spring.SpringModuleDef$1$2.createObject(SpringModuleDef.java:76)
at
org.apache.tapestry5.ioc.internal.OperationTrackingObjectCreator$1.invoke(OperationTrackingObjectCreator.java:45)
at
org.apache.tapestry5.ioc.internal.InvokableToRunnable.run(InvokableToRunnable.java:36)
at
org.apache.tapestry5.ioc.internal.OperationTrackerImpl.run(OperationTrackerImpl.java:52)
at
org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:96)
at
org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:68)
at
org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:871)
at
org.apache.tapestry5.ioc.internal.OperationTrackingObjectCreator.createObject(OperationTrackingObjectCreator.java:49)
at
org.apache.tapestry5.ioc.internal.SingletonServiceLifecycle.createService(SingletonServiceLifecycle.java:29)
at
org.apache.tapestry5.ioc.internal.LifecycleWrappedServiceCreator.createObject(LifecycleWrappedServiceCreator.java:52)
at
org.apache.tapestry5.ioc.internal.InterceptorStackBuilder.createObject(InterceptorStackBuilder.java:56)
at
org.apache.tapestry5.ioc.internal.RecursiveServiceCreationCheckWrapper.createObject(RecursiveServiceCreationCheckWrapper.java:60)
at
org.apache.tapestry5.ioc.internal.OperationTrackingObjectCreator$1.invoke(OperationTrackingObjectCreator.java:45)
at
org.apache.tapestry5.ioc.internal.InvokableToRunnable.run(InvokableToRunnable.java:36)
at
org.apache.tapestry5.ioc.internal.OperationTrackerImpl.run(OperationTrackerImpl.java:52)
at
org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:96)
at
org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:68)
at
org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:871)
at
org.apache.tapestry5.ioc.internal.OperationTrackingObjectCreator.createObject(OperationTrackingObjectCreator.java:49)
at
org.apache.tapestry5.ioc.internal.services.JustInTimeObjectCreator.createObject(JustInTimeObjectCreator.java:65)
at
$ConfigurableWebApplicationContext_11e850a8929.delegate($ConfigurableWebApplicationContext_11e850a8929.java)
at
$ConfigurableWebApplicationContext_11e850a8929.getBeanDefinitionCount($ConfigurableWebApplicationContext_11e850a8929.java)
at
org.apache.tapestry5.internal.spring.SpringModule$1.initializeApplication(SpringModule.java:45)
at
$ApplicationInitializer_11e850a892a.initializeApplication($ApplicationInitializer_11e850a892a.java)
at
org.apache.tapestry5.services.TapestryModule$37.initializeApplication(TapestryModule.java:1912)
at
$ApplicationInitializer_11e850a892a.initializeApplication($ApplicationInitializer_11e850a892a.java)
at
$ApplicationInitializer_11e850a8925.initializeApplication($ApplicationInitializer_11e850a8925.java)
at

Re: spring context troubles

2008-12-29 Thread Fernando Padilla

I just tried it, and it won't work like that :(

Like I said, I use spring outside of tapestry.  So I need a valid 
working spring context before the first request ever gets to tapestry 
filter..


Here is my exception when I comment out the normal ContextLoaderListener..



[Console output redirected to 
file:/local/fern/work/social-app-repository/trunk/fanwars/site/../../log.txt]

2008-12-29 15:58:26,140 [main] ERROR org.mortbay.log - failed OpenDS
java.lang.NullPointerException
at com.protrade.common.spring.OpenDSFilter.init(OpenDSFilter.java:28)
at com.protrade.common.web.ProtradeFilter.init(ProtradeFilter.java:37)
at org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java:97)
at 
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
	at 
org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:589)

at org.mortbay.jetty.servlet.Context.startContext(Context.java:139)
	at 
org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1216)
	at 
org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:509)

at 
org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:447)
at 
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
	at 
org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:117)

at org.mortbay.jetty.Server.doStart(Server.java:222)
at 
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
at runjettyrun.Bootstrap.main(Bootstrap.java:76)
2008-12-29 15:58:26,142 [main] ERROR org.mortbay.log - Failed startup of 
context org.mortbay.jetty.webapp.webappcont...@1961581{/,src/main/webapp}

java.lang.NullPointerException
at com.protrade.common.spring.OpenDSFilter.init(OpenDSFilter.java:28)
at com.protrade.common.web.ProtradeFilter.init(ProtradeFilter.java:37)
at org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java:97)
at 
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
	at 
org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:589)

at org.mortbay.jetty.servlet.Context.startContext(Context.java:139)
	at 
org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1216)
	at 
org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:509)

at 
org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:447)
at 
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
	at 
org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:117)

at org.mortbay.jetty.Server.doStart(Server.java:222)
at 
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
at runjettyrun.Bootstrap.main(Bootstrap.java:76)


Howard Lewis Ship wrote:

This is a change in behavior from Tapestry 5.0; it was necessary in
order to coordinate Spring and Tapestry IoC.  It is necessary to let
Tapestry initialize Spring and use Tapestry-specific subclasses of
XmlWebApplicationContext and DefaultListableBeanFactory, to hook in
the logic that allows Spring beans to use @Inject and @InjectService.

You should be fine if you just remove the ContextLoaderListener from
your web.xml.

On Mon, Dec 29, 2008 at 3:22 PM, Fernando Padilla
f...@citizensportsinc.com wrote:

I just tried to run with the latest tapestry-trunk, and I get this really
nasty exception :( :(

I initialize my own spring context with a ContextLoaderListener, because I
need spring outside of tapestry.  Why is tapestry attempting to create a
context?




2008-12-29 15:18:27,363 [main] ERROR org.apache.tapestry5.ioc.Registry -
Cannot initialize context because there is already a root application
context present - check whether you have multiple ContextLoader* definitions
in your web.xml!
2008-12-29 15:18:27,363 [main] ERROR org.apache.tapestry5.ioc.Registry -
Operations trace:
2008-12-29 15:18:27,364 [main] ERROR org.apache.tapestry5.ioc.Registry - [
1] Realizing service ApplicationContext
2008-12-29 15:18:27,364 [main] ERROR org.apache.tapestry5.ioc.Registry - [
2] Invoking ObjectCreator for Spring ApplicationContext
2008-12-29 15:18:27,364 [main] ERROR org.apache.tapestry5.ioc.Registry - [
3] Creating Spring ApplicationContext via ContextLoader
2008-12-29 15:18:27,365 [main] ERROR Spring.ApplicationContext -
Construction of service ApplicationContext failed: Cannot initialize context
because there is already a root application context present - check whether
you have multiple ContextLoader* definitions in your web.xml!
org.apache.tapestry5.ioc.internal.OperationException: Cannot initialize
context because there is already a root application context present - check
whether you have multiple ContextLoader* definitions in your web.xml!
   at
org.apache.tapestry5.ioc.internal.OperationTrackerImpl.run(OperationTrackerImpl.java:74)
   at
org.apache.tapestry5

Re: spring context troubles

2008-12-29 Thread Fernando Padilla
I was expecting you would be working on this feature, but I really don't 
want to change the way I instantiate my spring context..


Could you hook in something that allows me to turn off this new feature 
and have it be perfectly backward compatible?  Or if it finds an already 
instantiated Spring Context, use that without any of the fanciness 
you're planning?




Howard Lewis Ship wrote:

This is a change in behavior from Tapestry 5.0; it was necessary in
order to coordinate Spring and Tapestry IoC.  It is necessary to let
Tapestry initialize Spring and use Tapestry-specific subclasses of
XmlWebApplicationContext and DefaultListableBeanFactory, to hook in
the logic that allows Spring beans to use @Inject and @InjectService.

You should be fine if you just remove the ContextLoaderListener from
your web.xml.

On Mon, Dec 29, 2008 at 3:22 PM, Fernando Padilla
f...@citizensportsinc.com wrote:

I just tried to run with the latest tapestry-trunk, and I get this really
nasty exception :( :(

I initialize my own spring context with a ContextLoaderListener, because I
need spring outside of tapestry.  Why is tapestry attempting to create a
context?




2008-12-29 15:18:27,363 [main] ERROR org.apache.tapestry5.ioc.Registry -
Cannot initialize context because there is already a root application
context present - check whether you have multiple ContextLoader* definitions
in your web.xml!
2008-12-29 15:18:27,363 [main] ERROR org.apache.tapestry5.ioc.Registry -
Operations trace:
2008-12-29 15:18:27,364 [main] ERROR org.apache.tapestry5.ioc.Registry - [
1] Realizing service ApplicationContext
2008-12-29 15:18:27,364 [main] ERROR org.apache.tapestry5.ioc.Registry - [
2] Invoking ObjectCreator for Spring ApplicationContext
2008-12-29 15:18:27,364 [main] ERROR org.apache.tapestry5.ioc.Registry - [
3] Creating Spring ApplicationContext via ContextLoader
2008-12-29 15:18:27,365 [main] ERROR Spring.ApplicationContext -
Construction of service ApplicationContext failed: Cannot initialize context
because there is already a root application context present - check whether
you have multiple ContextLoader* definitions in your web.xml!
org.apache.tapestry5.ioc.internal.OperationException: Cannot initialize
context because there is already a root application context present - check
whether you have multiple ContextLoader* definitions in your web.xml!
   at
org.apache.tapestry5.ioc.internal.OperationTrackerImpl.run(OperationTrackerImpl.java:74)
   at
org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:96)
   at
org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:68)
   at
org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:871)
   at
org.apache.tapestry5.internal.spring.SpringModuleDef$1$2.createObject(SpringModuleDef.java:76)
   at
org.apache.tapestry5.ioc.internal.OperationTrackingObjectCreator$1.invoke(OperationTrackingObjectCreator.java:45)
   at
org.apache.tapestry5.ioc.internal.InvokableToRunnable.run(InvokableToRunnable.java:36)
   at
org.apache.tapestry5.ioc.internal.OperationTrackerImpl.run(OperationTrackerImpl.java:52)
   at
org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:96)
   at
org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:68)
   at
org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:871)
   at
org.apache.tapestry5.ioc.internal.OperationTrackingObjectCreator.createObject(OperationTrackingObjectCreator.java:49)
   at
org.apache.tapestry5.ioc.internal.SingletonServiceLifecycle.createService(SingletonServiceLifecycle.java:29)
   at
org.apache.tapestry5.ioc.internal.LifecycleWrappedServiceCreator.createObject(LifecycleWrappedServiceCreator.java:52)
   at
org.apache.tapestry5.ioc.internal.InterceptorStackBuilder.createObject(InterceptorStackBuilder.java:56)
   at
org.apache.tapestry5.ioc.internal.RecursiveServiceCreationCheckWrapper.createObject(RecursiveServiceCreationCheckWrapper.java:60)
   at
org.apache.tapestry5.ioc.internal.OperationTrackingObjectCreator$1.invoke(OperationTrackingObjectCreator.java:45)
   at
org.apache.tapestry5.ioc.internal.InvokableToRunnable.run(InvokableToRunnable.java:36)
   at
org.apache.tapestry5.ioc.internal.OperationTrackerImpl.run(OperationTrackerImpl.java:52)
   at
org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:96)
   at
org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:68)
   at
org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:871)
   at
org.apache.tapestry5.ioc.internal.OperationTrackingObjectCreator.createObject(OperationTrackingObjectCreator.java:49)
   at
org.apache.tapestry5.ioc.internal.services.JustInTimeObjectCreator.createObject(JustInTimeObjectCreator.java:65

Re: spring context troubles

2008-12-29 Thread Fernando Padilla
but this seems really really flaky, undeterministic and appserver 
dependent..


If you really want to create a SpringContext/TapestryIoC love child :) 
could you create a new ContextLoaderListener to replace spring's that 
does what you want?


So that both the SpringContext and TapestryIoC are loaded properly 
before anything else (servlets, filters, etc)??


Or again, can you have the feature you're adding be backward compatible 
and not require changes to the way people load up their spring 
context... (though i know the new feature would be turned off at that 
point).


Howard Lewis Ship wrote:

We need to figure out the order that the filters are initialized, so
that the Tapestry filter can be initialized first.  I think just
listing it first in the web.xml may do the trick.

On Mon, Dec 29, 2008 at 4:00 PM, Fernando Padilla f...@alum.mit.edu wrote:

I just tried it, and it won't work like that :(

Like I said, I use spring outside of tapestry.  So I need a valid working
spring context before the first request ever gets to tapestry filter..

Here is my exception when I comment out the normal ContextLoaderListener..



[Console output redirected to
file:/local/fern/work/social-app-repository/trunk/fanwars/site/../../log.txt]
2008-12-29 15:58:26,140 [main] ERROR org.mortbay.log - failed OpenDS
java.lang.NullPointerException
   at com.protrade.common.spring.OpenDSFilter.init(OpenDSFilter.java:28)
   at
com.protrade.common.web.ProtradeFilter.init(ProtradeFilter.java:37)
   at
org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java:97)
   at
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
   at
org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:589)
   at org.mortbay.jetty.servlet.Context.startContext(Context.java:139)
   at
org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1216)
   at
org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:509)
   at
org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:447)
   at
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
   at
org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:117)
   at org.mortbay.jetty.Server.doStart(Server.java:222)
   at
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
   at runjettyrun.Bootstrap.main(Bootstrap.java:76)
2008-12-29 15:58:26,142 [main] ERROR org.mortbay.log - Failed startup of
context org.mortbay.jetty.webapp.webappcont...@1961581{/,src/main/webapp}
java.lang.NullPointerException
   at com.protrade.common.spring.OpenDSFilter.init(OpenDSFilter.java:28)
   at
com.protrade.common.web.ProtradeFilter.init(ProtradeFilter.java:37)
   at
org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java:97)
   at
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
   at
org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:589)
   at org.mortbay.jetty.servlet.Context.startContext(Context.java:139)
   at
org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1216)
   at
org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:509)
   at
org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:447)
   at
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
   at
org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:117)
   at org.mortbay.jetty.Server.doStart(Server.java:222)
   at
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
   at runjettyrun.Bootstrap.main(Bootstrap.java:76)


Howard Lewis Ship wrote:

This is a change in behavior from Tapestry 5.0; it was necessary in
order to coordinate Spring and Tapestry IoC.  It is necessary to let
Tapestry initialize Spring and use Tapestry-specific subclasses of
XmlWebApplicationContext and DefaultListableBeanFactory, to hook in
the logic that allows Spring beans to use @Inject and @InjectService.

You should be fine if you just remove the ContextLoaderListener from
your web.xml.

On Mon, Dec 29, 2008 at 3:22 PM, Fernando Padilla
f...@citizensportsinc.com wrote:

I just tried to run with the latest tapestry-trunk, and I get this really
nasty exception :( :(

I initialize my own spring context with a ContextLoaderListener, because
I
need spring outside of tapestry.  Why is tapestry attempting to create a
context?




2008-12-29 15:18:27,363 [main] ERROR org.apache.tapestry5.ioc.Registry -
Cannot initialize context because there is already a root application
context present - check whether you have multiple ContextLoader*
definitions
in your web.xml!
2008-12-29 15:18:27,363 [main] ERROR org.apache.tapestry5.ioc.Registry -
Operations trace:
2008-12-29 15:18:27,364 [main] ERROR org.apache.tapestry5.ioc.Registry -
[
1] Realizing service ApplicationContext
2008-12-29 15:18:27,364 [main] ERROR

Re: spring context troubles

2008-12-29 Thread Fernando Padilla
I'm sorry that I'm hammering on this code, while it's still probably a 
work in progress.. (always available through im)


but I commented out the spring ContextLoaderListener, moved the filter 
up to be first, and this seems to initialize properly at least for Jetty 
(within eclipse).  The next issue, it looks like it did not register the 
spring beans in the TapestryIoC.. so now I'm getting exceptions saying 
that it can't find particular beans:




Caused by: java.lang.RuntimeException: Service id 
'common-conf-properties' is not defined by any module.  Defined 
services: ActionRenderResponseGenerator, 
AjaxComponentEventRequestHandler, AjaxComponentEventResultProcessor, 
AjaxPartialResponseRenderer, Alias, AliasOverrides, 
AppSubscriptionHandler, ApplicationContext, ApplicationDefaults, 
ApplicationGlobals, ApplicationInitializer, ApplicationStateManager, 
ApplicationStatePersistenceStrategySource, AspectDecorator, 
AssetBindingFactory, AssetObjectProvider, AssetSource, BaseURLSource, 
BeanBlockOverrideSource, BeanBlockSource, BeanModelSource, 
BindingSource, ChainBuilder, ClassNameLocator, 
ClasspathAssetAliasManager, ClasspathAssetFactory, 
ClasspathURLConverter, ClientPersistentFieldStorage, 
ClientPersistentFieldStrategy, ComponentClassCache, 
ComponentClassFactory, ComponentClassResolver, 
ComponentClassTransformWorker, ComponentClassTransformer, 
ComponentClassesInvalidationEventHub, ComponentDefaultProvider, 
ComponentEventRequestHandler, ComponentEventResultProcessor, 
ComponentInstanceResultProcessor, ComponentInstantiatorSource, 
ComponentInvocationMap, ComponentMessagesInvalidationEventHub, 
ComponentMessagesSource, ComponentPageElementResourcesSource, 
ComponentSource, ComponentTemplateSource, 
ComponentTemplatesInvalidationEventHub, Context, ContextAssetFactory, 
ContextPathEncoder, ContextValueEncoder, CookieSink, CookieSource, 
Cookies, CtClassSource, DataTypeAnalyzer, DefaultDataTypeAnalyzer, 
DefaultFileItemFactory, DefaultImplementationBuilder, 
EndOfRequestListenerHub, Environment, EnvironmentalShadowBuilder, 
ExceptionAnalyzer, ExceptionTracker, FacebookAuthFilterImpl, 
FactoryDefaults, FbForceModeFilter, FieldTranslatorSource, 
FieldValidationSupport, FieldValidatorDefaultSource, 
FieldValidatorSource, FormSupport, HiddenFieldLocationRules, 
HttpServletRequest, HttpServletRequestHandler, IgnoredPathsFilter, 
InjectionProvider, InternalRequestGlobals, LinkCreationHub, LinkFactory, 
LocalizationSetter, LocationRenderer, LoggingDecorator, MarkupRenderer, 
MarkupWriterFactory, MasterDispatcher, MasterObjectProvider, 
MessageBindingFactory, MetaDataLocator, MultipartDecoder, 
NullFieldStrategyBindingFactory, NullFieldStrategySource, 
ObjectRenderer, OsForceTypeFilter, PageActivationContextCollector, 
PageContentTypeAnalyzer, PageDocumentGenerator, PageElementFactory, 
PageLoader, PageMarkupRenderer, PagePool, PageRenderQueue, 
PageRenderRequestHandler, PageResponseRenderer, PageTemplateLocator, 
PartialMarkupRenderer, PersistentFieldManager, PersistentLocale, 
PipelineBuilder, PropBindingFactory, PropertyAccess, 
PropertyConduitSource, PropertyShadowBuilder, RegistryStartup, 
RenderSupport, Request, RequestExceptionHandler, RequestGlobals, 
RequestHandler, RequestLogFilter, RequestPageCache, 
RequestPathOptimizer, RequestSecurityManager, ResourceCache, 
ResourceDigestGenerator, ResourceStreamer, Response, ResponseRenderer, 
ServiceLifecycleSource, ServletApplicationInitializer, 
SessionApplicationStatePersistenceStrategy, StrategyBuilder, 
SymbolSource, TemplateParser, ThreadLocale, TranslateBindingFactory, 
TranslatorSource, TypeCoercer, URLEncoder, UpdateListenerHub, 
ValidateBindingFactory, ValidationConstraintGenerator, 
ValidationMessagesSource, ValueEncoderSource.
	at 
org.apache.tapestry5.ioc.internal.RegistryImpl.locateModuleForService(RegistryImpl.java:321)
	at 
org.apache.tapestry5.ioc.internal.RegistryImpl.getService(RegistryImpl.java:288)
	at 
org.apache.tapestry5.ioc.internal.ObjectLocatorImpl.getService(ObjectLocatorImpl.java:39)
	at 
org.apache.tapestry5.internal.services.ServiceAnnotationObjectProvider.provide(ServiceAnnotationObjectProvider.java:35)
	at 
org.apache.tapestry5.ioc.internal.services.MasterObjectProviderImpl$1.invoke(MasterObjectProviderImpl.java:50)
	at 
org.apache.tapestry5.ioc.internal.InvokableToRunnable.run(InvokableToRunnable.java:36)
	at 
org.apache.tapestry5.ioc.internal.OperationTrackerImpl.run(OperationTrackerImpl.java:52)







Howard Lewis Ship wrote:

We need to figure out the order that the filters are initialized, so
that the Tapestry filter can be initialized first.  I think just
listing it first in the web.xml may do the trick.

On Mon, Dec 29, 2008 at 4:00 PM, Fernando Padilla f...@alum.mit.edu wrote:

I just tried it, and it won't work like that :(

Like I said, I use spring outside of tapestry.  So I need a valid working
spring context before the first request ever gets to tapestry filter..

Here is my exception when I comment out

Re: IoC Question with Alias

2008-11-23 Thread Fernando Padilla

though I have no idea what you're trying to do :)

have you considered using decorators?  Those work well in most cases 
where you want to override a default service, and it always seems 
easier to understand..


[EMAIL PROTECTED] wrote:

This happens to me in one Tapestry5 project when I start it using the Jetty 
plugin and eclipse.
If I start it up using mvn jetty:run, this does not occur - so it might be 
something with Maven or the classpath as well.


Sun, 21 Sep 2008 23:41:37 -0700

hi michael,

happened to me several times too :)

first you could try to define your services as proxy:

from:
binder.bind(HttpdRequestSecurityManager.class).withId(HttpdRequestSecurityManager);


to:
binder.bind(RequestSecurityManager.class, 
HttpdRequestSecurityManager.class).withId(HttpdRequestSecurityManager);


if this is not enough try to break the dependency cycle by 
injecting the ObjectLocator and creating the proxy manually


eg:
configuration.add( AliasContribution.create(
   RequestSecurityManager.class,
   locator.proxy(
RequestSecurityManager.class, 
HttpdRequestSecurityManager.class)) );


see also following post 
http://tapestry-user.markmail.org/search/?q=kristian+marinkovic#query:kristian%20marinkovic%20order%3Adate-backward+page:1+mid:pmmti5eoegosg2n5+state:results


g,
kris

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



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



Re: T5: call Javascript after Tapestry.init()

2008-11-21 Thread Fernando Padilla
Yeah. I saw that too.  I was wondering if the zone init stuff should 
happen before any user defined javascript as well.


Nick Davies wrote:

Hi,

Apologies if I'm being dull here, but I'm trying to trigger an AJAX call
automatically once a page has finished loading - the idea is that the
main page is cached and a small amount is re-rendered each time. 


Obviously, this needs to happen after the call to the Tapestry.init()
javascript function, which sets up the zone. I can't find a way of
getting anything to run after this - tapestry puts the init call in a
DOM loaded event listener, and anything you register with RenderSupport
runs immediately before this.

We're using Tapestry 5.0.15

Thanks,

Nick

-
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 5, WAR files and deployment

2008-11-06 Thread Fernando Padilla

This is probably because it can't download the files..

I would double check your networking, but because you're emailing us 
I'll assume it's working.


Someone I know also had issue like this, and the cause for him was he 
installed it as root on his laptop, so when he tried to build it as his 
user he didn't have permissions to actually modify the repository.  So 
it could not successfully fetch any dependencies.


Though I don't recommend it, he runs all maven with sudo.

Not sure what the best way to install it is, but I installed maven on my 
laptop simply by extracting it into a directory as my user, then adding 
the bin directory to my user's path..






tapestryphoto wrote:

Quoting Olle Hallin [EMAIL PROTECTED]:


Does it work from the command line?
Olle



I tried mvn war:war from the project directory.

Bizarrely it gives even more problems.  I find Maven very frustrating...


[INFO] Failed to resolve artifact.

Missing:
--
1) org.apache.maven:maven-archiver:jar:2.2

  Try downloading the file manually from the project website.

  Then, install it using the command:
  mvn install:install-file -DgroupId=org.apache.maven 
-DartifactId=maven-arc

hiver -Dversion=2.2 -Dpackaging=jar -Dfile=/path/to/file

  Alternatively, if you host your own repository you can deploy the file 
there:


  mvn deploy:deploy-file -DgroupId=org.apache.maven 
-DartifactId=maven-archi
ver -Dversion=2.2 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] 
-DrepositoryI

d=[id]

  Path to dependency:
1) 
org.apache.maven.plugins:maven-war-plugin:maven-plugin:2.1-alpha-1

2) org.apache.maven:maven-archiver:jar:2.2

2) org.codehaus.plexus:plexus-utils:jar:1.4.7

  Try downloading the file manually from the project website.

  Then, install it using the command:
  mvn install:install-file -DgroupId=org.codehaus.plexus 
-DartifactId=plexus

-utils -Dversion=1.4.7 -Dpackaging=jar -Dfile=/path/to/file

  Alternatively, if you host your own repository you can deploy the file 
there:


  mvn deploy:deploy-file -DgroupId=org.codehaus.plexus 
-DartifactId=plexus-u
tils -Dversion=1.4.7 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] 
-Dreposito

ryId=[id]

  Path to dependency:
1) 
org.apache.maven.plugins:maven-war-plugin:maven-plugin:2.1-alpha-1

2) org.codehaus.plexus:plexus-utils:jar:1.4.7

3) com.thoughtworks.xstream:xstream:jar:1.2.2

  Try downloading the file manually from the project website.

  Then, install it using the command:
  mvn install:install-file -DgroupId=com.thoughtworks.xstream 
-DartifactId=x

stream -Dversion=1.2.2 -Dpackaging=jar -Dfile=/path/to/file

  Alternatively, if you host your own repository you can deploy the file 
there:


  mvn deploy:deploy-file -DgroupId=com.thoughtworks.xstream 
-DartifactId=xst
ream -Dversion=1.2.2 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] 
-Dreposito

ryId=[id]

  Path to dependency:
1) 
org.apache.maven.plugins:maven-war-plugin:maven-plugin:2.1-alpha-1

2) com.thoughtworks.xstream:xstream:jar:1.2.2

--
3 required artifacts are missing.



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



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



Re: [T5] Something like GORM for Tapestry?

2008-11-06 Thread Fernando Padilla
sorry no.  But we use JDO/JPA and we have helper methods that look much 
like that, but not as concise..  but really easy to create a HQL, JDOQL, 
JPQL from a method like this:


ListBook books = dao.findByFields( Book.class, firstname, Howard 
Lewis, lastname, Ship );



Otho wrote:

Hi all,

I am just in the process of deciding which framework to use for an internal
business app.

The choices are spring rcp, tap5 and grails. The latter mainly because of
the really nifty ORM. Especially the dynamic finders are neat, since they
are readable and make daos redundant in most cases. The UI part is - for my
personal taste - much better in Tap5.

With hibernate integrarion already there. Is there something in the pipeline
which would resemble dynamic finders in GORM?

In case the concept is unknown: Entity classes in grails (groovy) are
dynamically instrumented so that I could for example just write:

def books = Book.findByAuthorFirstnameAndLastname(Howard Lewis, Ship)

and would get the List of books with a backing sql along the lines of

Select * from book key join author where author.firstname =Howard Lewis

and author.lastname=Ship

Regards,
Otho



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



aggressive flash variables?

2008-11-03 Thread Fernando Padilla

https://issues.apache.org/jira/browse/TAP5-320

So I was wondering if anyone had any thoughts on this issue?

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



flash variables being cleared too aggressively?

2008-10-31 Thread Fernando Padilla
So I have an issue, and it's that the Form.validationDelegate Flash 
variable is being cleared too soon.  I'll say that we don't have a 
normal usecase, but just wondering how you could help.  The reason for 
the modified flow is because we are embedding the site withing 
Facebook/OpenSocial.  I'm still looking at it, but it looks like Flash 
variables are being cleared from pages, whether they were actually 
rendered or not (just a guess), but the weird thing is that all of this 
was working when we were using 5.0.11.  Any help will be appreciated :) 
:) :)




NORMAL FLOW:
1) PageA is rendered with FormA
2) User submits FormA
 2a) causing ComponentEvent
 2b) we handle component Event,
 there is an error and put error state into
 ValidationDelegate
 2c) Tapestry returns a redirect to render the page
3) PageA is rendered with FormA and error
 3a) Flash variables are cleared



MY FLOW: (difference is 3,3a,4):
1) PageA is rendered with FormA
2) User submits FormA
 2a) causing ComponentEvent
 2b) we handle component Event,
 there is an error and put error state into
 ValidationDelegate
 2c) Tapestry returns a redirect to render the page
3) Tapestry is asked to render PageA, but we intercept that through a 
PageRenderRequestFilter, that returns an iframe that points back to the 
desired pageurl..  the page is NEVER RENDERED

 3a) Flash variables are cleared
 (page is NEVER RENDERED, so they are CLEARED PREMATURELY)
4) PageA is rendered with FormA and NO ERRORS

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



Re: flash variables being cleared too aggressively?

2008-10-31 Thread Fernando Padilla
So yes it looks like the Flash variables of a Page are scrubbed when the 
page is removed from the cache, no matter if it's rendered or not.  The 
stack trace is below.


I know that my example might be a bit extreme, but here are some other 
usecases that should be affected as well:


-- Page Rendering
1) render PageA (set flash variable).
2) render PageB
  a) while rendering, it loads PageA for some reason
 (RequestPageCache.get, PageLink, ActionLink, etc)
  b) while loading PageA, its flash variables are cleared
3) render PageA (flash variable is null)

-- Ajax
1) render PageA (set flash variable).
2) Ajax callback to app
  a) either hitting PageA directly, or hitting PageB that
 refers to PageA in some way
 ( PageLink, ActionLink, RequestPageCache.get )
  b) while loading PageA, its flash variables are cleared
3) render PageA (flash variable is null)






STACK TRACE:
showing that flash variables are cleared from pages once they are 
loaded, not once they are rendered, so it can be cleared way before we 
have a change to render it.


setAttribute( flash:core/Start:status.cheerform:defaultTracker, null )
	at 
org.apache.tapestry5.internal.services.SessionImpl.setAttribute(SessionImpl.java:50)
	at 
org.apache.tapestry5.internal.services.FlashPersistentFieldStrategy.didReadChange(FlashPersistentFieldStrategy.java:41)
	at 
org.apache.tapestry5.internal.services.AbstractSessionPersistentFieldStrategy.gatherFieldChanges(AbstractSessionPersistentFieldStrategy.java:65)
	at 
org.apache.tapestry5.internal.services.PersistentFieldManagerImpl.gatherChanges(PersistentFieldManagerImpl.java:65)
	at 
$PersistentFieldManager_11d5412d051.gatherChanges($PersistentFieldManager_11d5412d051.java)
	at 
org.apache.tapestry5.internal.structure.PageImpl.getFieldChange(PageImpl.java:185)
	at 
org.apache.tapestry5.internal.structure.InternalComponentResourcesImpl.getFieldChange(InternalComponentResourcesImpl.java:111)
	at 
org.apache.tapestry5.internal.structure.InternalComponentResourcesImpl.hasFieldChange(InternalComponentResourcesImpl.java:121)
	at 
com.protrade.fanwars.base.pages.Start.containingPageDidAttach(Start.java)
	at 
org.apache.tapestry5.internal.structure.ComponentPageElementImpl$2.run(ComponentPageElementImpl.java:80)
	at 
org.apache.tapestry5.internal.structure.ComponentPageElementImpl.invoke(ComponentPageElementImpl.java:912)
	at 
org.apache.tapestry5.internal.structure.ComponentPageElementImpl.containingPageDidAttach(ComponentPageElementImpl.java:726)
	at 
org.apache.tapestry5.internal.structure.PageImpl.attached(PageImpl.java:151)
	at 
org.apache.tapestry5.internal.services.RequestPageCacheImpl.get(RequestPageCacheImpl.java:55)

at $RequestPageCache_11d5412d04b.get($RequestPageCache_11d5412d04b.java)
at $RequestPageCache_11d5412d046.get($RequestPageCache_11d5412d046.java)
	at 
com.protrade.facebook.base.services.FbForceModeFilter.handle(FbForceModeFilter.java:57)

  (this is my PageRenderRequestFilter which cuts off page rendering)




Fernando Padilla wrote:
So I have an issue, and it's that the Form.validationDelegate Flash 
variable is being cleared too soon.  I'll say that we don't have a 
normal usecase, but just wondering how you could help.  The reason for 
the modified flow is because we are embedding the site withing 
Facebook/OpenSocial.  I'm still looking at it, but it looks like Flash 
variables are being cleared from pages, whether they were actually 
rendered or not (just a guess), but the weird thing is that all of this 
was working when we were using 5.0.11.  Any help will be appreciated :) 
:) :)




NORMAL FLOW:
1) PageA is rendered with FormA
2) User submits FormA
 2a) causing ComponentEvent
 2b) we handle component Event,
 there is an error and put error state into
 ValidationDelegate
 2c) Tapestry returns a redirect to render the page
3) PageA is rendered with FormA and error
 3a) Flash variables are cleared



MY FLOW: (difference is 3,3a,4):
1) PageA is rendered with FormA
2) User submits FormA
 2a) causing ComponentEvent
 2b) we handle component Event,
 there is an error and put error state into
 ValidationDelegate
 2c) Tapestry returns a redirect to render the page
3) Tapestry is asked to render PageA, but we intercept that through a 
PageRenderRequestFilter, that returns an iframe that points back to the 
desired pageurl..  the page is NEVER RENDERED

 3a) Flash variables are cleared
 (page is NEVER RENDERED, so they are CLEARED PREMATURELY)
4) PageA is rendered with FormA and NO ERRORS

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



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



Re: [T5.0.16-SNAPSHOT] type coercion does not work like before

2008-10-30 Thread Fernando Padilla
Is it failing while trying to handle a the returning url?  Or trying to 
render the link to begin with?


Can you give us the url that it generates ( before you click on it? ) if 
possible?



Andy Pahne wrote:



In my page class I build a List like this:


public List getNavigationParameters() {
List result = new ArrayList();
result.add(hotel.getId());
result.add(getItemPos());
result.add(paging.getPagesTotal());
result.add(paging.getCurrentPage());
result.add(paging.getPageSize());
return result;
}


This list is used in an ActionLink:

a href=#
class=more
t:type=PageLink
t:context=navigationParameters
t:page=accommodation/Detailsmore info.../a



public boolean onActivate(
  Long accommodationID,
  int itemPos,
  int pagesTotal,
  int currentPage,
  int pageSize) {

}



After the latest update to 5.0.16-SNAPSHOT I recieve the following error.

What makes me scratch my head is the part
For input string: img
in the stacktrace.

Is this maybe related to the recent changes for TAP-302?
https://issues.apache.org/jira/browse/TAP5-302?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12642848#action_12642848 





Thanks,
Andy





2008-10-30 17:07:40,187 ERROR (DefaultRequestExceptionHandler.java:62) - 
Processing of request failed with uncaught exception: Exception in
method 
de.net22.oos.tb.web.pages.accommodation.Details.onActivate(java.lang.Long, 
int, int, int, int) (at Details.java:103), parameter #5: C
oercion of img to type java.lang.Integer (via String -- Long, Long -- 
Integer) failed: For input string: img
org.apache.tapestry5.runtime.ComponentEventException: Exception in 
method de.net22.oos.tb.web.pages.accommodation.Details.onActivate(java.la
ng.Long, int, int, int, int) (at Details.java:103), parameter #5: 
Coercion of img to type java.lang.Integer (via String -- Long, Long -- I

nteger) failed: For input string: img
at 
org.apache.tapestry5.internal.structure.ComponentPageElementImpl.triggerContextEvent(ComponentPageElementImpl.java:1072) 

at 
org.apache.tapestry5.internal.services.PageRenderRequestHandlerImpl.handle(PageRenderRequestHandlerImpl.java:52) 

at 
org.apache.tapestry5.services.TapestryModule$33.handle(TapestryModule.java:1740) 

at 
$PageRenderRequestHandler_11d4e76ed4e.handle($PageRenderRequestHandler_11d4e76ed4e.java) 

at 
$PageRenderRequestHandler_11d4e76ed40.handle($PageRenderRequestHandler_11d4e76ed40.java) 

at 
org.apache.tapestry5.internal.services.PageRenderDispatcher.process(PageRenderDispatcher.java:92) 

at 
org.apache.tapestry5.internal.services.PageRenderDispatcher.dispatch(PageRenderDispatcher.java:71) 


at $Dispatcher_11d4e76ed47.dispatch($Dispatcher_11d4e76ed47.java)
at $Dispatcher_11d4e76ed39.dispatch($Dispatcher_11d4e76ed39.java)
at 
org.apache.tapestry5.services.TapestryModule$17.service(TapestryModule.java:1034) 

at 
org.apache.tapestry5.internal.services.LocalizationFilter.service(LocalizationFilter.java:42) 

at 
$RequestHandler_11d4e76ed3a.service($RequestHandler_11d4e76ed3a.java)
at 
org.apache.tapestry5.internal.services.RequestErrorFilter.service(RequestErrorFilter.java:26) 

at 
$RequestHandler_11d4e76ed3a.service($RequestHandler_11d4e76ed3a.java)
at 
org.apache.tapestry5.services.TapestryModule$3.service(TapestryModule.java:626) 

at 
$RequestHandler_11d4e76ed3a.service($RequestHandler_11d4e76ed3a.java)
at 
org.apache.tapestry5.services.TapestryModule$2.service(TapestryModule.java:616) 

at 
$RequestHandler_11d4e76ed3a.service($RequestHandler_11d4e76ed3a.java)
at 
org.apache.tapestry5.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:85) 

at 
$RequestHandler_11d4e76ed3a.service($RequestHandler_11d4e76ed3a.java)
at 
org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:93) 

at 
org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:84) 

at 
org.apache.tapestry5.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:83) 

at 
org.apache.tapestry5.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:106) 

at 
$RequestHandler_11d4e76ed3a.service($RequestHandler_11d4e76ed3a.java)
at 
$RequestHandler_11d4e76ed31.service($RequestHandler_11d4e76ed31.java)
at 
org.apache.tapestry5.services.TapestryModule$16.service(TapestryModule.java:1012) 

at 
org.apache.tapestry5.internal.services.IgnoredPathsFilter.service(IgnoredPathsFilter.java:62) 

at 
$HttpServletRequestFilter_11d4e76ed30.service($HttpServletRequestFilter_11d4e76ed30.java) 

at 

Re: new URLEncoder Service

2008-10-29 Thread Fernando Padilla

that's what I was talking about :)

And I was just wondering because we already have a mechanism to decorate 
a service (decorateService), and adding an overrideService syntax 
might be something to play with..


though as we've seen tapestry ioc contributions/configurations don't 
support overriding at all either, which is sad..


Thiago H. de Paula Figueiredo wrote:

Em Wed, 29 Oct 2008 10:08:36 -0300, Thiago H. de Paula Figueiredo
[EMAIL PROTECTED] escreveu:


It already does! The documentaton in T5's site is a little scarce and can
be found here: http://tapestry.apache.org/tapestry5/guide/alias.html.


Well, not quite. Alias and AliasContribution are part of tapestry-core,
not tapestry-ioc. Howard, is there a reason the service alias and override
support is not in Tapestry-IoC?



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



Re: new URLEncoder Service

2008-10-28 Thread Fernando Padilla
Just wondering if Tapestry-IOC will ever support something like 
override of services ( like alias )?



Howard Lewis Ship wrote:

Contribute a new implementation of URLEncoder to the Alias service
configuration and Tapestry will use the contributed one instead of the
default URLEncoder service.

Alternately, you can decorate the URLEncoder service with an
alternative implementation, or a filter depending on how much of the
existing URLEncoder service implementation you want to keep.

Could you provide some more context as to why URLEncoder is a problem?

On Tue, Oct 28, 2008 at 11:39 AM, jthompson209 [EMAIL PROTECTED] wrote:

Hello I am in need of either turning off this new service or overriding it
and having it do nothing, it is currently breaking some code that I have,
what would be the best way of doing that, also if overriding it is the
answer how would i go about doing it.

thanks so much
-jeff
--
View this message in context: 
http://n2.nabble.com/new-URLEncoder-Service-tp1389907p1389907.html
Sent from the Tapestry Users mailing list archive at Nabble.com.


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








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



Re: so much useless logging

2008-10-23 Thread Fernando Padilla
That's my proposal as well.  Simply add a prefix that is unequivocally 
owned by tapestry (t5.enhanced, etc), so that everyone (no matter what 
logging system you use), can reliably and efficiently control what gets 
logged and how.






Andy Pahne wrote:



I'd prefer a prefix like t5.enhanced. for the logging category  That 
way I'd be in full control what comes up and what doesn't.



Jonathan Barker wrote:

Let's turn this into a question.

How do we want to be able to configure Tapestry logging? 
I have found the rather verbose logging to be beneficial in figuring out

what listeners are being fired when using naming conventions rather than
explicit OnEvent configuration.  However, it has also obscured my own
logging statements so I understand your frustration.

Is it sufficient to have the Tapestry class-enhancement and event 
dispatch

logging controlled by the Tapestry SymbolConstants.PRODUCTION_MODE flag?
Should it be a separate app-wide flag?  Should it be configurable on a
class-by-class basis?  I know I would prefer to be able to toggle it 
on the

fly without a restart.

Jonathan




 

-Original Message-
From: Fernando Padilla [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 22, 2008 13:56
To: Tapestry users
Subject: Re: so much useless logging

Most people use Log4j, so I don't think suggesting Markers is a
worthwhile suggestion.

Second, though Log4j filters are an option, I really think that's an
advanced solution that again, most users never have to deal with.  Also
it's totally wasteful of cpu, having tapestry do all of this logging,
then forcing the users to run a regexp or starts with against EVERY
SINGLE log event, no matter where they came from, to discover whether to
drop the log event or not.

let me vent for a second:

Look, these suggestions for solving the problem are complicated or
advanced options, that still are not the best.  The issue is still
that a low level library ( tapestry ) is hijacking my logging category
to spit out it's own debug.  Thus it's really hard for me to figure out
who's actually logging, and control that...

Yes I can do log filters, regexps, string compares, but really?  Like
you said, as soon as tapestry changes their log messages, it breaks.
And you have to constantly discover what tapestry logs and why, and make
sure that your code doesn't log anything close to that ( false positives
).  It's just overly complicated and onerous to even suggest that to
your users...


Alright, so I think I'm done venting.  Thank you for listening! :)

But the point is.. you can always come up 10 ways to accomplish
something, and the simplest is usually the best.



Tapestry should simply change their low level log points to be TRACE, or
simply change what category they log against to be clearly marked as
being logged by Tapestry, not my code.  Simple.  Clean.  Efficient.






Lutz Hühnken wrote:
   

Hi Fernando,

 

 Sorry, I might be worked up, but really, wow this is just amazing me


how no
   

one has complained about this yet.


well, this is just not true. You will find many discussions regarding
this on this mailing list.

Workarounds have been proposed. For log4j, you might try a filter

http://www.nabble.com/T5%3A-How-to-configure-T5-not-to-display-unwanted- 

  

log-td16024408.html
   

(I used that in the past, but it doesn't seem to work anymore for me,
I haven't had the time to look into that yet.)

A probably better way would be to use markers, see
https://issues.apache.org/jira/browse/TAPESTRY-2474

Log4j 1.2.x doesn't support them, though.

hth,

Lutz

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

  

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




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

  



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



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



Re: so much useless logging

2008-10-22 Thread Fernando Padilla
Most people use Log4j, so I don't think suggesting Markers is a 
worthwhile suggestion.


Second, though Log4j filters are an option, I really think that's an 
advanced solution that again, most users never have to deal with.  Also 
it's totally wasteful of cpu, having tapestry do all of this logging, 
then forcing the users to run a regexp or starts with against EVERY 
SINGLE log event, no matter where they came from, to discover whether to 
drop the log event or not.


let me vent for a second:

Look, these suggestions for solving the problem are complicated or 
advanced options, that still are not the best.  The issue is still 
that a low level library ( tapestry ) is hijacking my logging category 
to spit out it's own debug.  Thus it's really hard for me to figure out 
who's actually logging, and control that...


Yes I can do log filters, regexps, string compares, but really?  Like 
you said, as soon as tapestry changes their log messages, it breaks. 
And you have to constantly discover what tapestry logs and why, and make 
sure that your code doesn't log anything close to that ( false positives 
).  It's just overly complicated and onerous to even suggest that to 
your users...



Alright, so I think I'm done venting.  Thank you for listening! :)

But the point is.. you can always come up 10 ways to accomplish 
something, and the simplest is usually the best.




Tapestry should simply change their low level log points to be TRACE, or 
simply change what category they log against to be clearly marked as 
being logged by Tapestry, not my code.  Simple.  Clean.  Efficient.







Lutz Hühnken wrote:

Hi Fernando,


 Sorry, I might be worked up, but really, wow this is just amazing me how no
one has complained about this yet.


well, this is just not true. You will find many discussions regarding
this on this mailing list.

Workarounds have been proposed. For log4j, you might try a filter

http://www.nabble.com/T5%3A-How-to-configure-T5-not-to-display-unwanted-log-td16024408.html

(I used that in the past, but it doesn't seem to work anymore for me,
I haven't had the time to look into that yet.)

A probably better way would be to use markers, see
https://issues.apache.org/jira/browse/TAPESTRY-2474

Log4j 1.2.x doesn't support them, though.

hth,

Lutz

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

2008-10-21 Thread Fernando Padilla

But we did put them into a component library. :)

The thing is that we had to change how a normal PageLink/EventLink works 
to be able to integrate with Facebook properly..


But in general, if I bring in a component library, but need to override 
a component, how can I do that..


without you saying, create a brand new uniquely named component. :)


 digression

in a way, it's kind of like a PageLink decorator.  I know that's what 
Mixins are for, but the the way that Mixins can get access to the 
parameters of the mixed in component is not robust enough.. random thought.




Howard Lewis Ship wrote:

Just chance.  I think it's very chancy to try to override T5's built
in components this way.  You should put them in a component library.
I'll be working on docs about how to do that shortly :-)

On Tue, Oct 21, 2008 at 2:36 PM, Tom Zurkan
[EMAIL PROTECTED] wrote:

How can I guarantee that my LibraryMapping is going to override the Tapestry
Module LibraryMapping since the contribution's ordering is random?
I am contributing a componentClassResolver LibraryMapping with the path
prefix of core so that my library will be searched first for a component.
 This worked in Tapestry 5.11 but doesn't in 5.16.  Was it just by chance
that it worked before?

Any help would be greatly appreciated.
Thanks,

Tom Zurkan

-
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: so much useless logging

2008-10-20 Thread Fernando Padilla
sorry. nope.  the log that I included did not include the generated 
class code.  And I hit my Start page a few times to make sure I wasn't 
mad either.  The log I included is being spit out for every single 
request of my Start page!



Toby Hobson wrote:

I agree that this is a little annoying but it only happens when the page is
first loaded, subsequent requests will generate cleaner debug statements

Toby

2008/10/18 Fernando Padilla [EMAIL PROTECTED]


alright, so we just upgraded from 5.0.11 to 5.0.16-SNAPSHOT, so sorry I was
not able to complain earlier..  Please help:

but tapestry is just spewing TONS of debug, that I still don't see any easy
way to turn off.  Please help, this is just ridiculous!  First the
contribution system is broken not allowing us to override defaults, then the
debug is so superfluous that it's just so bad!


below is an example of rendering my Start page.. ONE page request. REALLY!
 Sorry, I might be worked up, but really, wow this is just amazing me how no
one has complained about this yet.

And the issue is that we want debug turned on for OUR code (in development
and production), NOT low level tapestry code that we trust.  But tapestry
uses the same category as our classes, so there is NO easy way to filter
that out using log4j.properties.  I know that people said before that we can
setup fancy filter to match and filter out some log entries.  But these many
log entries are just ridiculous.  And how am I supposed to filter against
Invoking:   that's just such a broad filter term.  Users of tapestry
should not be forced to jump through so many hoops!



I want:
Tapestry MUST change the categories it logs against, so that they DO NOT
match the pages ( tapestry.site.PAGECLASS )  or it SHOULD allow me to turn
off all of this logging using a config setting..  Or I will have to maintain
our own build of tapestry to fix this ourselves.. crazy.




what do you think??  is this your pet peeve too??






---
Debug output for a single rendering of my Start page:

2008-10-17 16:48:37,802 [btpool0-2] DEBUG
com.protrade.fanwars.base.pages.Start - Dispatch event:
ComponentEvent[activate from (self)]
2008-10-17 16:48:37,802 [btpool0-2] DEBUG
com.protrade.fanwars.base.pages.Start - Invoking:
com.protrade.fanwars.base.pages.Start.setupRender() (at Start.java:42)
2008-10-17 16:48:37,806 [btpool0-2] DEBUG
com.protrade.fanwars.base.components.CanvasLayout - Invoking:
com.protrade.fanwars.base.components.CanvasLayout.beginRender() (at
CanvasLayout.java:19)
2008-10-17 16:48:37,808 [btpool0-2] DEBUG
com.protrade.unifiedsocial.tapestry.components.MakePageLinksAbsolute -
Invoking:
com.protrade.unifiedsocial.tapestry.components.MakePageLinksAbsolute.beginRender()
(at MakePageLinksAbsolute.java:25)
2008-10-17 16:48:37,808 [btpool0-2] DEBUG
com.protrade.facebook.base.components.layout.LayoutDocFlex - Invoking:
com.protrade.facebook.base.components.layout.LayoutDocFlex.setupRender() (at
LayoutDocFlex.java:25)
2008-10-17 16:48:37,808 [btpool0-2] DEBUG
com.protrade.facebook.base.components.layout.LayoutDocFlex - Invoking:
com.protrade.facebook.base.components.layout.LayoutDocBase.beginRender() (at
LayoutDocBase.java:47)
2008-10-17 16:48:37,808 [btpool0-2] DEBUG
com.protrade.tapestry5.base.components.layout.LayoutIslandAdLeader -
Invoking:
com.protrade.tapestry5.base.components.layout.LayoutIslandAdLeader.beginRender(org.apache.tapestry5.MarkupWriter)
(at LayoutIslandAdLeader.java:20)
2008-10-17 16:48:37,808 [btpool0-2] DEBUG
com.protrade.fanwars.base.components.ads.AdsFanwarsGamSlot - Invoking:
com.protrade.fanwars.base.components.ads.AdsFanwarsGamSlot.setupRender() (at
AdsFanwarsGamSlot.java:76)
2008-10-17 16:48:37,808 [btpool0-2] DEBUG
com.protrade.facebook.base.components.ads.AdsGamSlotIframe - Invoking:
com.protrade.facebook.base.components.ads.AdsGamSlotIframe.beginRender(org.apache.tapestry5.MarkupWriter)
(at AdsGamSlotIframe.java:34)
2008-10-17 16:48:37,809 [btpool0-2] DEBUG
com.protrade.facebook.base.components.ads.AdsGamSlotIframe - Invoking:
com.protrade.facebook.base.components.ads.AdsGamSlotIframe.afterRender(org.apache.tapestry5.MarkupWriter)
(at AdsGamSlotIframe.java:60)
2008-10-17 16:48:37,809 [btpool0-2] DEBUG
com.protrade.tapestry5.base.components.layout.LayoutIslandAdLeader -
Invoking:
com.protrade.tapestry5.base.components.layout.LayoutIslandAdLeader.afterRender(org.apache.tapestry5.MarkupWriter)
(at LayoutIslandAdLeader.java:30)
2008-10-17 16:48:37,813 [btpool0-2] DEBUG
com.protrade.fanwars.base.components.team.TeamLogo - Invoking:
com.protrade.fanwars.base.components.team.TeamLogo.setupRender() (at
TeamLogo.java:56)
2008-10-17 16:48:37,814 [btpool0-2] DEBUG
com.protrade.fanwars.base.components.team.TeamLogo - Invoking:
com.protrade.fanwars.base.components.team.TeamLogo.beginRender(org.apache.tapestry5.MarkupWriter)
(at TeamLogo.java:81)
2008-10-17 16:48:37,814 [btpool0-2] DEBUG
com.protrade.fanwars.base.components.team.TeamLogo - Invoking

how to override tapestry core components?

2008-10-20 Thread Fernando Padilla
I need to override the tapestry core components ( PageLink, EventLink ), 
within a library, not within an application.


I created a library that all of our facebook apps use.  We need to 
override the PageLink and EventLink components to be able to work within 
facebook properly (minimal features).  The way I did that was to 
register the library as core, so that Tapestry when tapestry searches 
for core components, it would find those within this library first.


Below is what I think is wrong.  But ignoring what I think, how do you 
think I should be able to override a Tapestry core component? like 
PageLink or EventLink, etc etc.




what I think:

This worked in 5.0.11, but in 5.0.16 it looks to not work, or worst work 
randomly.  My guess is that because of the buggy feature saying that 
the modules are loaded in an 'random' order, then I can not reliably 
override the core library components.. since I don't know if my core 
library would be loaded before or after Tapestry's core library.. just 
my guess.



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



so much useless logging

2008-10-17 Thread Fernando Padilla
alright, so we just upgraded from 5.0.11 to 5.0.16-SNAPSHOT, so sorry I 
was not able to complain earlier..  Please help:


but tapestry is just spewing TONS of debug, that I still don't see any 
easy way to turn off.  Please help, this is just ridiculous!  First the 
contribution system is broken not allowing us to override defaults, then 
the debug is so superfluous that it's just so bad!



below is an example of rendering my Start page.. ONE page request. 
REALLY!  Sorry, I might be worked up, but really, wow this is just 
amazing me how no one has complained about this yet.


And the issue is that we want debug turned on for OUR code (in 
development and production), NOT low level tapestry code that we trust. 
 But tapestry uses the same category as our classes, so there is NO 
easy way to filter that out using log4j.properties.  I know that people 
said before that we can setup fancy filter to match and filter out some 
log entries.  But these many log entries are just ridiculous.  And how 
am I supposed to filter against Invoking:   that's just such a broad 
filter term.  Users of tapestry should not be forced to jump through so 
many hoops!




I want:
Tapestry MUST change the categories it logs against, so that they DO NOT 
match the pages ( tapestry.site.PAGECLASS )  or it SHOULD allow me to 
turn off all of this logging using a config setting..  Or I will have to 
maintain our own build of tapestry to fix this ourselves.. crazy.





what do you think??  is this your pet peeve too??






---
Debug output for a single rendering of my Start page:

2008-10-17 16:48:37,802 [btpool0-2] DEBUG 
com.protrade.fanwars.base.pages.Start - Dispatch event: 
ComponentEvent[activate from (self)]
2008-10-17 16:48:37,802 [btpool0-2] DEBUG 
com.protrade.fanwars.base.pages.Start - Invoking: 
com.protrade.fanwars.base.pages.Start.setupRender() (at Start.java:42)
2008-10-17 16:48:37,806 [btpool0-2] DEBUG 
com.protrade.fanwars.base.components.CanvasLayout - Invoking: 
com.protrade.fanwars.base.components.CanvasLayout.beginRender() (at 
CanvasLayout.java:19)
2008-10-17 16:48:37,808 [btpool0-2] DEBUG 
com.protrade.unifiedsocial.tapestry.components.MakePageLinksAbsolute - 
Invoking: 
com.protrade.unifiedsocial.tapestry.components.MakePageLinksAbsolute.beginRender() 
(at MakePageLinksAbsolute.java:25)
2008-10-17 16:48:37,808 [btpool0-2] DEBUG 
com.protrade.facebook.base.components.layout.LayoutDocFlex - Invoking: 
com.protrade.facebook.base.components.layout.LayoutDocFlex.setupRender() 
(at LayoutDocFlex.java:25)
2008-10-17 16:48:37,808 [btpool0-2] DEBUG 
com.protrade.facebook.base.components.layout.LayoutDocFlex - Invoking: 
com.protrade.facebook.base.components.layout.LayoutDocBase.beginRender() 
(at LayoutDocBase.java:47)
2008-10-17 16:48:37,808 [btpool0-2] DEBUG 
com.protrade.tapestry5.base.components.layout.LayoutIslandAdLeader - 
Invoking: 
com.protrade.tapestry5.base.components.layout.LayoutIslandAdLeader.beginRender(org.apache.tapestry5.MarkupWriter) 
(at LayoutIslandAdLeader.java:20)
2008-10-17 16:48:37,808 [btpool0-2] DEBUG 
com.protrade.fanwars.base.components.ads.AdsFanwarsGamSlot - Invoking: 
com.protrade.fanwars.base.components.ads.AdsFanwarsGamSlot.setupRender() 
(at AdsFanwarsGamSlot.java:76)
2008-10-17 16:48:37,808 [btpool0-2] DEBUG 
com.protrade.facebook.base.components.ads.AdsGamSlotIframe - Invoking: 
com.protrade.facebook.base.components.ads.AdsGamSlotIframe.beginRender(org.apache.tapestry5.MarkupWriter) 
(at AdsGamSlotIframe.java:34)
2008-10-17 16:48:37,809 [btpool0-2] DEBUG 
com.protrade.facebook.base.components.ads.AdsGamSlotIframe - Invoking: 
com.protrade.facebook.base.components.ads.AdsGamSlotIframe.afterRender(org.apache.tapestry5.MarkupWriter) 
(at AdsGamSlotIframe.java:60)
2008-10-17 16:48:37,809 [btpool0-2] DEBUG 
com.protrade.tapestry5.base.components.layout.LayoutIslandAdLeader - 
Invoking: 
com.protrade.tapestry5.base.components.layout.LayoutIslandAdLeader.afterRender(org.apache.tapestry5.MarkupWriter) 
(at LayoutIslandAdLeader.java:30)
2008-10-17 16:48:37,813 [btpool0-2] DEBUG 
com.protrade.fanwars.base.components.team.TeamLogo - Invoking: 
com.protrade.fanwars.base.components.team.TeamLogo.setupRender() (at 
TeamLogo.java:56)
2008-10-17 16:48:37,814 [btpool0-2] DEBUG 
com.protrade.fanwars.base.components.team.TeamLogo - Invoking: 
com.protrade.fanwars.base.components.team.TeamLogo.beginRender(org.apache.tapestry5.MarkupWriter) 
(at TeamLogo.java:81)
2008-10-17 16:48:37,814 [btpool0-2] DEBUG 
com.protrade.fanwars.base.components.team.TeamLogo - Invoking: 
com.protrade.fanwars.base.components.team.TeamLogo.afterRender(org.apache.tapestry5.MarkupWriter) 
(at TeamLogo.java:88)
2008-10-17 16:48:37,814 [btpool0-2] DEBUG 
com.protrade.fanwars.base.components.nav.NavListFanwars - Invoking: 
com.protrade.fanwars.base.components.nav.NavListFanwars.setupRender() 
(at NavListFanwars.java:34)
2008-10-17 16:48:37,819 [btpool0-2] DEBUG 

Re: contributeMetaDataLocator ordering....

2008-10-04 Thread Fernando Padilla

We'll read up on this stuff. Thank you.  but I have more comments in line.

Filip S. Adamsen wrote:
Defaults for Symbols are easy. Just contribute your defaults to 
FactoryDefaults, and let the user override them in ApplicationDefaults:

http://tapestry.apache.org/tapestry5/tapestry-ioc/symbols.html


thank you, I will read up.


Configurations are different, and have caused quite a few people 
problems. There's been talk of adding an override method 
MappedConfiguration to allow this, see Howard's comment:

https://issues.apache.org/jira/browse/TAP5-45

You can easily code around this anyhow, it's just a matter of having an 
extra service to hold the default configuration.


1) will read up.

2) We also have usecases for overriding mapped ordered configuration. ( 
Like setting up our own RenderSupport!!)  So if someone adds overrides, 
please add them to all forms of contributions!


3) You can't easily do this for MetaData, since the MetaDataLocator 
throws an exception for non-existent meta lookups.  I guess I can wrap 
that in a helper method that will do what I want.. look for meta, and 
use it, if exception, try meta-default, etc.  But that's just not 
cool, and what if I have 2 or three layers of users, and each wants to 
set/override the meta..



thank you for giving me something to read! :)






-Filip

On 2008-10-03 20:20, Fernando Padilla wrote:

  can you tell me why you want to change the contribution?
  why not set it only once?

Alright, so maybe my response below is a little rant/flame.  But 
really, are you truly saying that Tapestry doesn't allow libraries to 
properly set defaults, then allow users of the library to override 
those defaults??



rant
This is a library!  A library needs to be able to set defaults, that 
users of the library can override for their particular purposes.  
Else, every setting becomes required for every user to set!


How does tapestry deal with Symbols?  Do we have to always set 
tapestry.production-mode, or page pooling configuration?  Or with the 
default mime-type of a page?  Would you want to force everyone to 
set the mime-type of every page to be text/html???


Tapestry MUST support a way to set defaults reliably for Symbols and 
configurations reliably, and yet allow users of those to override 
them!  I really can't see any other way.  Are you truly saying that 
this basic use case can't be supported?

/rant


-
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: contributeMetaDataLocator ordering....

2008-10-03 Thread Fernando Padilla

 can you tell me why you want to change the contribution?
 why not set it only once?

Alright, so maybe my response below is a little rant/flame.  But really, 
are you truly saying that Tapestry doesn't allow libraries to properly 
set defaults, then allow users of the library to override those defaults??



rant
This is a library!  A library needs to be able to set defaults, that 
users of the library can override for their particular purposes.  Else, 
every setting becomes required for every user to set!


How does tapestry deal with Symbols?  Do we have to always set 
tapestry.production-mode, or page pooling configuration?  Or with the 
default mime-type of a page?  Would you want to force everyone to set 
the mime-type of every page to be text/html???


Tapestry MUST support a way to set defaults reliably for Symbols and 
configurations reliably, and yet allow users of those to override them! 
 I really can't see any other way.  Are you truly saying that this 
basic use case can't be supported?

/rant




Kristian Marinkovic wrote:

hi tom,

ordering is not possible because the service does not
use a ordered configuration. overriding of contributions
is also not supported. it worked accidentally in previous
versions :) the order in which the module classes are loaded 
is not defined and usually not relevant.


can you tell me why you want to change the contribution?
why not set it only once?

g,
kris






Tom Zurkan [EMAIL PROTECTED] 
03.10.2008 02:13

Bitte antworten an
Tapestry users users@tapestry.apache.org


An
users@tapestry.apache.org
Kopie

Thema
contributeMetaDataLocator ordering







I am including the annotation SubModule In one of the sub modules  I 
call contributeMetaDataLocator and set up default values for my meta 
data.  In my AppModule, I also call contributeMetaDataLocator to 
override the default.  The problem is that my AppModule contribute is 
being called first and then the submodule.  Is there a way around this? 
It worked in Tapestry5.11.


Thanks,

Tom

-
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: Problem with aso

2008-09-03 Thread Fernando Padilla
Also, i thought you were to think of an ASO almost as a singleton or a 
service.  Tapestry will create it for you on first access.  I didn't 
know you could set it.  Even if I'm wrong, using this design pattern 
might clean things up a little.



So you should use another class to contain a reference to the current 
active user, call it UserContainer.



@AplicationState
private UserContainer currUser;


and it would have methods like:

currUser.hasUser()
currUser.setUser(User user)
currUser.getUser()


or whatever you like.



José Paumard wrote:

Natia,

I think there is a mistake in your code :

private User currUser ;
private boolean userExists ;

I dont think T5 will link userExists and currUser, currUser should be 
named user, or userExists currUserExists (please correct me if I'm wrong).


That said, what do you mean I cant access currUser, do you mean that 
the ASO is null in other classes that want to read it ? Or do you mean 
that userExists is always false (which is normal, see above).


José

Natia Gdzelishvili a écrit :

I'm using tapestry 5.0.14 ,i vahe problem with aso, my code is:

public class Login {
private String username;
private String password;
@Inject
private IBusinessServicesLocator _businessServicesLocator;
@ApplicationState
private User currUser;
private boolean userExists;


public String getUsername() {
return username;
}

public void setUsername(String username) {
this.username = username;
}

public String getPassword() {
return password;
}

public void setPassword(String password) {
this.password = password;
}

@SuppressWarnings(unchecked)
@OnEvent(value = submit, component = loginForm)
public Object submitLoginForm() {
Class nextPage;
try {
User u=getMerchantCreator().login(username, password); 
//*returns

some object*
currUser = u; /*/ currUser object cannot be resolved*
nextPage = ViewAllMerchants.class;

} catch (UserNotFoundException e) {
nextPage = Login.class;
e.printStackTrace();
}
return nextPage;
}

private IMerchantCreatorLocal getMerchantCreator() {
return _businessServicesLocator.getMerchantCreatorLocal();
}
}

i cannot access curruser...
please help..

  



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



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



  1   2   >