Re: Calling different pages depending on browser

2010-08-19 Thread Kalle Korhonen
Use the User-Agent header (e.g http://en.wikipedia.org/wiki/User_agent).

Kalle


On Thu, Aug 19, 2010 at 10:48 PM, Omar Carvajal
 wrote:
> Hey all,
>
> I wanted to know if there was a way to get my app to call different pages
> depending on the browser that is being used.
>
> For example if the application is being accessed from an iPhone, it should
> go to the page /mobile for example. And if FireFox is used, it should load
> /desktop.
>
> How could I achieve this?
>
> Thanks in advance,
>
> Omar
>
> -
> 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



Calling different pages depending on browser

2010-08-19 Thread Omar Carvajal
Hey all,

I wanted to know if there was a way to get my app to call different pages
depending on the browser that is being used.

For example if the application is being accessed from an iPhone, it should
go to the page /mobile for example. And if FireFox is used, it should load
/desktop.

How could I achieve this?

Thanks in advance,

Omar

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



Re: Query parameters

2010-08-19 Thread Dmitry Gusev
Footnotes are broken in the FAQ, see
https://cwiki.apache.org/confluence/display/TAPESTRY/Frequently+Asked+Questions#FrequentlyAskedQuestions-HowdoIaddnewcomponentstoanexistingpagedynamically%3F
there
is a footnote about POJO, but it leads to footnote about Jetty.

On Fri, Aug 20, 2010 at 01:25, Inge Solvoll  wrote:

> Loving the FAQ!!!
>
> On Thu, Aug 19, 2010 at 10:34 PM, Igor Drobiazko
> wrote:
>
> > This is really nice.
> >
> > On Thu, Aug 19, 2010 at 8:56 PM, Howard Lewis Ship 
> > wrote:
> >
> > > I'm very excited by the new process; ask a FAQ and I can update the
> > > FAQ page live and return a link to that.
> > >
> > > On Thu, Aug 19, 2010 at 11:22 AM, Michael Gentry <
> mgen...@masslight.net>
> > > wrote:
> > > > Wish I had known that one about 4 months ago ... :-)
> > > >
> > > >
> > > > On Thu, Aug 19, 2010 at 1:03 PM, Howard Lewis Ship  >
> > > wrote:
> > > >> Just added to the FAQ:
> > > >>
> > > >>
> > >
> >
> https://cwiki.apache.org/confluence/display/TAPESTRY/Frequently+Asked+Questions#FrequentlyAskedQuestions-HowdoIaddqueryparametersaPageLinkorActionLink%3F
> > > >>
> > > >>
> > > >> On Thu, Aug 19, 2010 at 3:44 AM, Davor Hrg 
> > wrote:
> > > >>> I'm posting this to user group since it is mostly usage question.
> > > >>>
> > > >>> The new query parameter binding is a welcome addition, especialy in
> > > >>> combination
> > > >>> with replacing the page pool with static instaces. All nice and
> well,
> > > but
> > > >>> how do I pass
> > > >>> query parameters through PageLink or AcionLink ?
> > > >>>
> > > >>> Best to explain it through the example I'm using it with:
> > > >>> There is a page that lists documents, and there is a search form
> with
> > > few
> > > >>> fields.
> > > >>> One field is the "year" which tells the page to limit to docs from
> > that
> > > >>> year.
> > > >>> So I changed the @Persist to @ActivationRequestParameter and after
> > > >>> submitting
> > > >>> the search form I get a nice ur: docs/list?year=2009.
> > > >>> Ok, this works well, I can have multiple tabs with different
> filters,
> > > much
> > > >>> like php which I
> > > >>> like very much and use often.
> > > >>> but there are more things that do not work:
> > > >>> 1. using PageLink from another page to jump to
> > > @ActivationRequestParameter
> > > >>> 2. using ActionLink to pass query parameters (annotated with
> > > >>> @RequestParameter)
> > > >>>
> > > >>> 3. If there are more than one such param there is no way to create
> a
> > > link to
> > > >>> it self with one of them changed
> > > >>>   for example on page: docs/list?year=2009&type=FI I can not create
> a
> > > link
> > > >>> directly to docs/list?year=2010&type=FI
> > > >>>   it would be nice to be able to write this:  > > >>> q:year="2010">2010 to get the mentioned result
> > > >>>
> > > >>> for that matter a namespace xmln:p="tapestry:parameter" or new one
> > like
> > > >>> xmlns:q="tapestry:query" would be nice
> > > >>> for the ActionLink and PageLink.
> > > >>>
> > > >>>
> > > >>> Davor Hrg
> > > >>>
> > > >>
> > > >>
> > > >>
> > > >> --
> > > >> Howard M. Lewis Ship
> > > >>
> > > >> Creator of Apache Tapestry
> > > >>
> > > >> The source for Tapestry training, mentoring and support. Contact me
> to
> > > >> learn how I can get you up and productive in Tapestry fast!
> > > >>
> > > >> (971) 678-5210
> > > >> http://howardlewisship.com
> > > >>
> > > >>
> -
> > > >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > > >> For additional commands, e-mail: users-h...@tapestry.apache.org
> > > >>
> > > >>
> > > >
> > > > -
> > > > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > > > For additional commands, e-mail: users-h...@tapestry.apache.org
> > > >
> > > >
> > >
> > >
> > >
> > > --
> > > Howard M. Lewis Ship
> > >
> > > Creator of Apache Tapestry
> > >
> > > The source for Tapestry training, mentoring and support. Contact me to
> > > learn how I can get you up and productive in Tapestry fast!
> > >
> > > (971) 678-5210
> > > http://howardlewisship.com
> > >
> > > -
> > > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > > For additional commands, e-mail: users-h...@tapestry.apache.org
> > >
> > >
> >
> >
> > --
> > Best regards,
> >
> > Igor Drobiazko
> > http://tapestry5.de
> >
>



-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: DISCUSSION: Time zones and date selection

2010-08-19 Thread Dmitry Gusev
One more thing, I've added Geonames to ping service to measure its
performance and got the following statistics:

Was made 47 requests (one for every 15 minutes) with average response time
750 ms.
During this period I got some bad responses:

{"status":{"message":"the hourly limit of 3000 credits for the IP address
72.14.192.68 has been exceeded. Please throttle your requests or use the
commercial service.","value":19}}
Its availability percent (percent of expected responses) was 93.75% for the
past 12 hours.
So its probably not a good option to use Geonames in a cloud for free... but
still an option.

On Thu, Aug 19, 2010 at 19:56, Fernando Padilla  wrote:

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


-- 

tapestry grid problem,when sorting,redirected to Start page

2010-08-19 Thread bugxiaoya

I am using Tapestry 5.1 Grid Component for data display.
the problem is: 
when click the sort icon in the table head,it is just redirected to the
Start page.
set the SymbolConstants.SUPPRESS_REDIRECT_FROM_ACTION_REQUESTS  to be "true"
in AppModule.contributeApplicationDefaults() can resolve this problem,but is
there any other way?

P.S:the same problem when click the paging label of grid component.

the source code is as follows:


${user.name}



${message:delete-label}




http://tapestry.1045711.n5.nabble.com/file/n2641788/%E6%90%9C%E7%8B%97%E6%88%AA%E5%9B%BE_2010-08-20_12-41-38.bmp
 

-- 
View this message in context: 
http://tapestry.1045711.n5.nabble.com/tapestry-grid-problem-when-sorting-redirected-to-Start-page-tp2641788p2641788.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: TextOutputStream and Selenium

2010-08-19 Thread Josh Canfield
Hmm... Let me know if you figure out the culprit. Does the page have JavaScript 
that might have errors? 

-- Josh

On Aug 19, 2010, at 4:32 PM, "Thiago H. de Paula Figueiredo" 
 wrote:

> On Thu, 19 Aug 2010 17:12:26 -0300, Josh Canfield  
> wrote:
> 
>> Ok, I can't reproduce. Here is what I've tried.
>> Have you tried cutting the content of your response down to a minimum?
> 
> I haven't tried this yet.
> 
>> Maybe there is something in the page?
> 
> With your input, I think the problem is in the my pages' HTML. My page class 
> looks like yours. Thanks for the help!
> 
> -- 
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and 
> instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> http://www.arsmachina.com.br
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 

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



Re: TextOutputStream and Selenium

2010-08-19 Thread Thiago H. de Paula Figueiredo
On Thu, 19 Aug 2010 17:12:26 -0300, Josh Canfield   
wrote:



Ok, I can't reproduce. Here is what I've tried.
Have you tried cutting the content of your response down to a minimum?


I haven't tried this yet.


Maybe there is something in the page?


With your input, I think the problem is in the my pages' HTML. My page  
class looks like yours. Thanks for the help!


--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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



Re: Restoring Live Page Class Reloading

2010-08-19 Thread Thiago H. de Paula Figueiredo

On Thu, 19 Aug 2010 19:13:43 -0300, Rich M  wrote:

Ah, great! That helped move things forward. Transformation is starting  
to take place, I was able to get one of the SubPages to Live Reload, but  
the display is wrong, part a) isn't quite complete. What is the best way  
to feed the current SubPage into the containing ModuleIndex's  
page/template?


Feed as in passing data? This can be done by putting data into the  
Environmental in the ModuleIndex and them getting them using the same  
service in the SubPages. That's how the Grid and BeanEditForm/BeanEditor  
components work.


--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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



Re: Restoring Live Page Class Reloading

2010-08-19 Thread Rich M
Ah, great! That helped move things forward. Transformation is starting 
to take place, I was able to get one of the SubPages to Live Reload, but 
the display is wrong, part a) isn't quite complete. What is the best way 
to feed the current SubPage into the containing ModuleIndex's page/template?


Thanks,
Rich

On Thu, 19 Aug 2010 17:53:56 -0300, Rich M  wrote:

Actually I spoke a little too soon about the persistent fields. I'm 
not really clear on how that is solved by a ComponentRequestFilter, 
other than it's a good place to do it. ComponentSource doesn't provide 
any means with which to clear persistent fields.


From ComponentSource you get the page instance (a Component). It has a 
getComponentResources() method. From there, you can invoke 
discardPersistentFieldChanges().


--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, 
and instructor

Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

On 08/19/2010 04:53 PM, Rich M wrote:
Actually I spoke a little too soon about the persistent fields. I'm 
not really clear on how that is solved by a ComponentRequestFilter, 
other than it's a good place to do it. ComponentSource doesn't provide 
any means with which to clear persistent fields.


I was achieving it before with

@Inject
private ComponentResources cr;

public void clearPersistentFields(){
cr.discardPersistentFieldChanges();
}

IIRC this has to be inside the component itself to work. My Tab 
components have this, but I have no way of accessing them as objects. 
It is possible to somehow cast the Component object from 
ComponentSource's getPage method to the Tab interface in order to 
access this method? I'm not sure if Tapestry links custom components 
to the Component class somehow, but my common Java sense would tell me 
this is silly.


-Rich

On 08/19/2010 04:20 PM, Rich M wrote:

Hi,

thanks for the response. So it looks like I can manage the components 
mostly through the ComponentSource service, I should be able to clear 
persistent fields this way and load the current SubPage I want. Then 
I can implement a ComponentRequestFilter to aid in the Permissions I 
wrote about.


That just leave a) which I see I did not explain well enough. By 
"directs content" I was trying to generalize the concept that the 
ModuleIndex would be including (or Injecting?) the SubPage component 
related to that current SubPage. Just like when you include any 
component in a template i.e. . I was achieving this 
through Delegate and Block before, but that was linked up to the 
@Component SubPages so it could load the right one.


Also, you mentioned not using 'mvn jetty:run', is there anything 
particularly wrong with that? That's how I run the application.


I certainly agree many things about my current implementation are not 
ideal (memory consumption, not typical way of doing things) but 
working is better than nothing, not to mention how hard it is to 
figure out what the "recommended way of doing it" is for any given 
feature without asking =/


-Rich

On 08/19/2010 03:04 PM, Thiago H. de Paula Figueiredo wrote:
On Thu, 19 Aug 2010 15:41:20 -0300, Rich M  
wrote:


a) ModuleIndex functions similar to the Layout page, it must 
contain the navigation menu and then directs content from a 
specific page of the Module (I will call these SubPages) into the 
template.


What do you mean by "directs content"?

b) The module needs to keep track of all the SubPage instances so 
it can wipe their persistent fields when navigation changes.


This can be implemented as a ComponentRequestFilter. In addition, 
Tapestry 5.2 adds one page lifecycle that my be useful this kind of 
situation: 
http://tapestry.apache.org/tapestry5.2-dev/apidocs/org/apache/tapestry5/annotations/PageReset.html 



c) The module needs to assess the target of page navigation, and 
then filter the resulting SubPage based on user permissions within 
the application.


This can be implemented as a ComponentRequestFilter. That's the 
recommended way of doing it.


d) When one of the specific SubPage classes is changed in source, 
it should be able to be live reloaded without restarting the 
application


In Eclipse, I just leave all the projects (modules) open and it 
works, as long as I'm not using Maven's jetty:run. I usually create 
a Main class that launches a Jetty instance.


ModuleIndex has a @Component for each SubPage and then maps these 
components to the activation context integers in a @SessionState Map.


In Tapestry 5.1 (page pool), this would lead to a large memory 
comsumption. In 5.2 there's no such problem.
Anyway, a good option is to use ComponentSource to get instances of 
components or pages in runtime instead of holding references to 
instances, leading to the ClassCastExceptios you're experiencing.





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

Re: JIRA TAP5_103 provide access to component parameters from within mixins

2010-08-19 Thread Shing Hing Man
Thanks!
Shing


--- On Fri, 20/8/10, Dariusz Majewski  wrote:

> From: Dariusz Majewski 
> Subject: Re: JIRA TAP5_103 provide access to component parameters from within 
> mixins
> To: "Tapestry users" 
> Date: Friday, 20 August, 2010, 5:22
> Hi,
> 
> You have to use @BindParameter annotation described here:
> http://tapestry.apache.org/tapestry5.2-dev/guide/mixins.html
> 
> Regards,
> Darek
> 
> On Thu, Aug 19, 2010 at 10:31 PM, Shing Hing Man 
> wrote:
> 
> > JIRA TAP5_103 is marked as fixed in Tap 5.2.0.
> > https://issues.apache.org/jira/browse/TAP5-103
> >
> > Does anyone know where I can find an example on
> reading a component
> > parameters from within a mixin ?
> >
> > Does it work by simply inject the component for which
> the mixin is
> > attached, in the mixin Java class ?
> > Eg
> >   �...@injectcontainer
> >    private Object container;
> >
> >
> >
> > Thanks in advance for any assistance !
> > Shing
> >
> >
> >
> >
> >
> -
> > 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: Query parameters

2010-08-19 Thread Inge Solvoll
Loving the FAQ!!!

On Thu, Aug 19, 2010 at 10:34 PM, Igor Drobiazko
wrote:

> This is really nice.
>
> On Thu, Aug 19, 2010 at 8:56 PM, Howard Lewis Ship 
> wrote:
>
> > I'm very excited by the new process; ask a FAQ and I can update the
> > FAQ page live and return a link to that.
> >
> > On Thu, Aug 19, 2010 at 11:22 AM, Michael Gentry 
> > wrote:
> > > Wish I had known that one about 4 months ago ... :-)
> > >
> > >
> > > On Thu, Aug 19, 2010 at 1:03 PM, Howard Lewis Ship 
> > wrote:
> > >> Just added to the FAQ:
> > >>
> > >>
> >
> https://cwiki.apache.org/confluence/display/TAPESTRY/Frequently+Asked+Questions#FrequentlyAskedQuestions-HowdoIaddqueryparametersaPageLinkorActionLink%3F
> > >>
> > >>
> > >> On Thu, Aug 19, 2010 at 3:44 AM, Davor Hrg 
> wrote:
> > >>> I'm posting this to user group since it is mostly usage question.
> > >>>
> > >>> The new query parameter binding is a welcome addition, especialy in
> > >>> combination
> > >>> with replacing the page pool with static instaces. All nice and well,
> > but
> > >>> how do I pass
> > >>> query parameters through PageLink or AcionLink ?
> > >>>
> > >>> Best to explain it through the example I'm using it with:
> > >>> There is a page that lists documents, and there is a search form with
> > few
> > >>> fields.
> > >>> One field is the "year" which tells the page to limit to docs from
> that
> > >>> year.
> > >>> So I changed the @Persist to @ActivationRequestParameter and after
> > >>> submitting
> > >>> the search form I get a nice ur: docs/list?year=2009.
> > >>> Ok, this works well, I can have multiple tabs with different filters,
> > much
> > >>> like php which I
> > >>> like very much and use often.
> > >>> but there are more things that do not work:
> > >>> 1. using PageLink from another page to jump to
> > @ActivationRequestParameter
> > >>> 2. using ActionLink to pass query parameters (annotated with
> > >>> @RequestParameter)
> > >>>
> > >>> 3. If there are more than one such param there is no way to create a
> > link to
> > >>> it self with one of them changed
> > >>>   for example on page: docs/list?year=2009&type=FI I can not create a
> > link
> > >>> directly to docs/list?year=2010&type=FI
> > >>>   it would be nice to be able to write this:  > >>> q:year="2010">2010 to get the mentioned result
> > >>>
> > >>> for that matter a namespace xmln:p="tapestry:parameter" or new one
> like
> > >>> xmlns:q="tapestry:query" would be nice
> > >>> for the ActionLink and PageLink.
> > >>>
> > >>>
> > >>> Davor Hrg
> > >>>
> > >>
> > >>
> > >>
> > >> --
> > >> Howard M. Lewis Ship
> > >>
> > >> Creator of Apache Tapestry
> > >>
> > >> The source for Tapestry training, mentoring and support. Contact me to
> > >> learn how I can get you up and productive in Tapestry fast!
> > >>
> > >> (971) 678-5210
> > >> http://howardlewisship.com
> > >>
> > >> -
> > >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > >> For additional commands, e-mail: users-h...@tapestry.apache.org
> > >>
> > >>
> > >
> > > -
> > > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > > For additional commands, e-mail: users-h...@tapestry.apache.org
> > >
> > >
> >
> >
> >
> > --
> > Howard M. Lewis Ship
> >
> > Creator of Apache Tapestry
> >
> > The source for Tapestry training, mentoring and support. Contact me to
> > learn how I can get you up and productive in Tapestry fast!
> >
> > (971) 678-5210
> > http://howardlewisship.com
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >
> >
>
>
> --
> Best regards,
>
> Igor Drobiazko
> http://tapestry5.de
>


Re: JIRA TAP5_103 provide access to component parameters from within mixins

2010-08-19 Thread Dariusz Majewski
Hi,

You have to use @BindParameter annotation described here:
http://tapestry.apache.org/tapestry5.2-dev/guide/mixins.html

Regards,
Darek

On Thu, Aug 19, 2010 at 10:31 PM, Shing Hing Man  wrote:

> JIRA TAP5_103 is marked as fixed in Tap 5.2.0.
> https://issues.apache.org/jira/browse/TAP5-103
>
> Does anyone know where I can find an example on reading a component
> parameters from within a mixin ?
>
> Does it work by simply inject the component for which the mixin is
> attached, in the mixin Java class ?
> Eg
> @InjectContainer
>private Object container;
>
>
>
> Thanks in advance for any assistance !
> Shing
>
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: Restoring Live Page Class Reloading

2010-08-19 Thread Thiago H. de Paula Figueiredo

On Thu, 19 Aug 2010 17:53:56 -0300, Rich M  wrote:

Actually I spoke a little too soon about the persistent fields. I'm not  
really clear on how that is solved by a ComponentRequestFilter, other  
than it's a good place to do it. ComponentSource doesn't provide any  
means with which to clear persistent fields.


From ComponentSource you get the page instance (a Component). It has a  
getComponentResources() method. From there, you can invoke  
discardPersistentFieldChanges().


--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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



Re: Events and multizone update

2010-08-19 Thread Elin

Thx a lot. Thats all i needed :)
-- 
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Events-and-multizone-update-tp2641385p2641538.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: Restoring Live Page Class Reloading

2010-08-19 Thread Rich M
Actually I spoke a little too soon about the persistent fields. I'm not 
really clear on how that is solved by a ComponentRequestFilter, other 
than it's a good place to do it. ComponentSource doesn't provide any 
means with which to clear persistent fields.


I was achieving it before with

@Inject
private ComponentResources cr;

public void clearPersistentFields(){
cr.discardPersistentFieldChanges();
}

IIRC this has to be inside the component itself to work. My Tab 
components have this, but I have no way of accessing them as objects. It 
is possible to somehow cast the Component object from ComponentSource's 
getPage method to the Tab interface in order to access this method? I'm 
not sure if Tapestry links custom components to the Component class 
somehow, but my common Java sense would tell me this is silly.


-Rich

On 08/19/2010 04:20 PM, Rich M wrote:

Hi,

thanks for the response. So it looks like I can manage the components 
mostly through the ComponentSource service, I should be able to clear 
persistent fields this way and load the current SubPage I want. Then I 
can implement a ComponentRequestFilter to aid in the Permissions I 
wrote about.


That just leave a) which I see I did not explain well enough. By 
"directs content" I was trying to generalize the concept that the 
ModuleIndex would be including (or Injecting?) the SubPage component 
related to that current SubPage. Just like when you include any 
component in a template i.e. . I was achieving this 
through Delegate and Block before, but that was linked up to the 
@Component SubPages so it could load the right one.


Also, you mentioned not using 'mvn jetty:run', is there anything 
particularly wrong with that? That's how I run the application.


I certainly agree many things about my current implementation are not 
ideal (memory consumption, not typical way of doing things) but 
working is better than nothing, not to mention how hard it is to 
figure out what the "recommended way of doing it" is for any given 
feature without asking =/


-Rich

On 08/19/2010 03:04 PM, Thiago H. de Paula Figueiredo wrote:
On Thu, 19 Aug 2010 15:41:20 -0300, Rich M  
wrote:


a) ModuleIndex functions similar to the Layout page, it must contain 
the navigation menu and then directs content from a specific page of 
the Module (I will call these SubPages) into the template.


What do you mean by "directs content"?

b) The module needs to keep track of all the SubPage instances so it 
can wipe their persistent fields when navigation changes.


This can be implemented as a ComponentRequestFilter. In addition, 
Tapestry 5.2 adds one page lifecycle that my be useful this kind of 
situation: 
http://tapestry.apache.org/tapestry5.2-dev/apidocs/org/apache/tapestry5/annotations/PageReset.html 



c) The module needs to assess the target of page navigation, and 
then filter the resulting SubPage based on user permissions within 
the application.


This can be implemented as a ComponentRequestFilter. That's the 
recommended way of doing it.


d) When one of the specific SubPage classes is changed in source, it 
should be able to be live reloaded without restarting the application


In Eclipse, I just leave all the projects (modules) open and it 
works, as long as I'm not using Maven's jetty:run. I usually create a 
Main class that launches a Jetty instance.


ModuleIndex has a @Component for each SubPage and then maps these 
components to the activation context integers in a @SessionState Map.


In Tapestry 5.1 (page pool), this would lead to a large memory 
comsumption. In 5.2 there's no such problem.
Anyway, a good option is to use ComponentSource to get instances of 
components or pages in runtime instead of holding references to 
instances, leading to the ClassCastExceptios you're experiencing.





-
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: Query parameters

2010-08-19 Thread Igor Drobiazko
This is really nice.

On Thu, Aug 19, 2010 at 8:56 PM, Howard Lewis Ship  wrote:

> I'm very excited by the new process; ask a FAQ and I can update the
> FAQ page live and return a link to that.
>
> On Thu, Aug 19, 2010 at 11:22 AM, Michael Gentry 
> wrote:
> > Wish I had known that one about 4 months ago ... :-)
> >
> >
> > On Thu, Aug 19, 2010 at 1:03 PM, Howard Lewis Ship 
> wrote:
> >> Just added to the FAQ:
> >>
> >>
> https://cwiki.apache.org/confluence/display/TAPESTRY/Frequently+Asked+Questions#FrequentlyAskedQuestions-HowdoIaddqueryparametersaPageLinkorActionLink%3F
> >>
> >>
> >> On Thu, Aug 19, 2010 at 3:44 AM, Davor Hrg  wrote:
> >>> I'm posting this to user group since it is mostly usage question.
> >>>
> >>> The new query parameter binding is a welcome addition, especialy in
> >>> combination
> >>> with replacing the page pool with static instaces. All nice and well,
> but
> >>> how do I pass
> >>> query parameters through PageLink or AcionLink ?
> >>>
> >>> Best to explain it through the example I'm using it with:
> >>> There is a page that lists documents, and there is a search form with
> few
> >>> fields.
> >>> One field is the "year" which tells the page to limit to docs from that
> >>> year.
> >>> So I changed the @Persist to @ActivationRequestParameter and after
> >>> submitting
> >>> the search form I get a nice ur: docs/list?year=2009.
> >>> Ok, this works well, I can have multiple tabs with different filters,
> much
> >>> like php which I
> >>> like very much and use often.
> >>> but there are more things that do not work:
> >>> 1. using PageLink from another page to jump to
> @ActivationRequestParameter
> >>> 2. using ActionLink to pass query parameters (annotated with
> >>> @RequestParameter)
> >>>
> >>> 3. If there are more than one such param there is no way to create a
> link to
> >>> it self with one of them changed
> >>>   for example on page: docs/list?year=2009&type=FI I can not create a
> link
> >>> directly to docs/list?year=2010&type=FI
> >>>   it would be nice to be able to write this:  >>> q:year="2010">2010 to get the mentioned result
> >>>
> >>> for that matter a namespace xmln:p="tapestry:parameter" or new one like
> >>> xmlns:q="tapestry:query" would be nice
> >>> for the ActionLink and PageLink.
> >>>
> >>>
> >>> Davor Hrg
> >>>
> >>
> >>
> >>
> >> --
> >> Howard M. Lewis Ship
> >>
> >> Creator of Apache Tapestry
> >>
> >> The source for Tapestry training, mentoring and support. Contact me to
> >> learn how I can get you up and productive in Tapestry fast!
> >>
> >> (971) 678-5210
> >> http://howardlewisship.com
> >>
> >> -
> >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> >> For additional commands, e-mail: users-h...@tapestry.apache.org
> >>
> >>
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >
> >
>
>
>
> --
> Howard M. Lewis Ship
>
> Creator of Apache Tapestry
>
> The source for Tapestry training, mentoring and support. Contact me to
> learn how I can get you up and productive in Tapestry fast!
>
> (971) 678-5210
> http://howardlewisship.com
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


-- 
Best regards,

Igor Drobiazko
http://tapestry5.de


JIRA TAP5_103 provide access to component parameters from within mixins

2010-08-19 Thread Shing Hing Man
JIRA TAP5_103 is marked as fixed in Tap 5.2.0.
https://issues.apache.org/jira/browse/TAP5-103

Does anyone know where I can find an example on reading a component parameters 
from within a mixin ?

Does it work by simply inject the component for which the mixin is attached, in 
the mixin Java class ?
Eg   
 @InjectContainer
private Object container;



Thanks in advance for any assistance !
Shing 




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



Re: Events and multizone update

2010-08-19 Thread Josh Canfield
> - Since "onRemoveRow" event can only return void (cant return a
> multizoneupdate), would be possible to capture when i delete a row and
> update several zones from it?

You can only return a multizoneupdate if you are inside of an ajax
request. If you are using an eventlink/actionlink then you need to add
the zone parameter with the client id of one of the zones you are
going to update (has to be a zone that exists on the page for the link
to get setup properly on the client)


${now}



${last}


Rotate


MultiZoneUpdate onRotate() {
_last = _now;
_now = new Date();
return new MultiZoneUpdate("zone1",
_zone1.getBody()).add("zone2", _zone2.getBody());
}


Josh

On Thu, Aug 19, 2010 at 11:49 AM, Elin  wrote:
>
> I have a custom component based on an "ajaxformloop" that displays rows with
> a delete buttom for them.
>
> I need to update several zones afer deleting a row from the ajaxformloop and
> cant find a way to do it. From here i have some questions about events (im
> sorry im starting with tapestry and im a bit newbie)
>
>
> - Since "onRemoveRow" event can only return void (cant return a
> multizoneupdate), would be possible to capture when i delete a row and
> update several zones from it?
>
> - Is it possible to generate custom events on my custom components so i can
> capture them into the pages i insert them into?
>
> If you link me examples where i can see this and analize them it would be
> enough. I couldnt find any by myself.
>
> Thx in advance.
> --
> View this message in context: 
> http://tapestry.1045711.n5.nabble.com/Events-and-multizone-update-tp2641385p2641385.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
>
>



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

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



Re: Events and multizone update

2010-08-19 Thread zozul


Elin wrote:
> 
> I need to update several zones afer deleting a row from the ajaxformloop
> and cant find a way to do it. 
> 
> - Since "onRemoveRow" event can only return void (cant return a
> multizoneupdate), would be possible to capture when i delete a row and
> update several zones from it?
> 

Use an actionlink inside ajaxformloop, at least i would do this this way.

Example:



delete


And in java class:

public Object onActionFromDelete(Integer id) {
/*do delete here*/
return new MultiZoneUpdate("zone1", zone1).add("zone2", zone2);
}


Elin wrote:
> 
> - Is it possible to generate custom events on my custom components so i
> can capture them into the pages i insert them into?
> 

ZoneUpdater mixin is easiest way to go. With adding few words to the .tml
you can get great results, and it is great basis to extend it to your needs.
Some examplar usage of this is:



in java:
public Object onChangeOfItem(String value) {
/*any server action here*/
return zone1.getBody();
}

and you get ajax select

Hope it helps
-- 
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Events-and-multizone-update-tp2641385p2641498.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: Restoring Live Page Class Reloading

2010-08-19 Thread Rich M

Hi,

thanks for the response. So it looks like I can manage the components 
mostly through the ComponentSource service, I should be able to clear 
persistent fields this way and load the current SubPage I want. Then I 
can implement a ComponentRequestFilter to aid in the Permissions I wrote 
about.


That just leave a) which I see I did not explain well enough. By 
"directs content" I was trying to generalize the concept that the 
ModuleIndex would be including (or Injecting?) the SubPage component 
related to that current SubPage. Just like when you include any 
component in a template i.e. . I was achieving this through 
Delegate and Block before, but that was linked up to the @Component 
SubPages so it could load the right one.


Also, you mentioned not using 'mvn jetty:run', is there anything 
particularly wrong with that? That's how I run the application.


I certainly agree many things about my current implementation are not 
ideal (memory consumption, not typical way of doing things) but working 
is better than nothing, not to mention how hard it is to figure out what 
the "recommended way of doing it" is for any given feature without asking =/


-Rich

On 08/19/2010 03:04 PM, Thiago H. de Paula Figueiredo wrote:

On Thu, 19 Aug 2010 15:41:20 -0300, Rich M  wrote:

a) ModuleIndex functions similar to the Layout page, it must contain 
the navigation menu and then directs content from a specific page of 
the Module (I will call these SubPages) into the template.


What do you mean by "directs content"?

b) The module needs to keep track of all the SubPage instances so it 
can wipe their persistent fields when navigation changes.


This can be implemented as a ComponentRequestFilter. In addition, 
Tapestry 5.2 adds one page lifecycle that my be useful this kind of 
situation: 
http://tapestry.apache.org/tapestry5.2-dev/apidocs/org/apache/tapestry5/annotations/PageReset.html 



c) The module needs to assess the target of page navigation, and then 
filter the resulting SubPage based on user permissions within the 
application.


This can be implemented as a ComponentRequestFilter. That's the 
recommended way of doing it.


d) When one of the specific SubPage classes is changed in source, it 
should be able to be live reloaded without restarting the application


In Eclipse, I just leave all the projects (modules) open and it works, 
as long as I'm not using Maven's jetty:run. I usually create a Main 
class that launches a Jetty instance.


ModuleIndex has a @Component for each SubPage and then maps these 
components to the activation context integers in a @SessionState Map.


In Tapestry 5.1 (page pool), this would lead to a large memory 
comsumption. In 5.2 there's no such problem.
Anyway, a good option is to use ComponentSource to get instances of 
components or pages in runtime instead of holding references to 
instances, leading to the ClassCastExceptios you're experiencing.





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



Re: TextOutputStream and Selenium

2010-08-19 Thread Josh Canfield
Ok, I can't reproduce. Here is what I've tried.

public class TextStreamPage {

private String _content = "nothing";

@Inject
private LinkSource _linkSource;

void onActivate(String content) {
_content = content;
}

TextStreamResponse onActivate() {
final String link =
_linkSource.createPageRenderLink("TextStreamPage",
true, "clicked").toAbsoluteURI();
return new TextStreamResponse("text/html",
"Content:" +
"" + _content + "" +
"click" +
"");
}
}
and this test:

   @Test
public class TextStreamTest extends AbstractIntegrationTestSuite {

@Test
public void testPageLoad() {
open("/");
open("/textstreampage/test");
assertText("content", "test");
click("link");
waitForPageToLoad("2000");
assertText("content", "clicked");
}
}

Have you tried cutting the content of your response down to a minimum?
Maybe there is something in the page?

-- Josh

On Aug 19, 2010, at 8:42 AM, "Thiago H. de Paula Figueiredo"
 wrote:

> On Thu, 19 Aug 2010 12:07:29 -0300, Josh Canfield  
> wrote:
>
>> This is the code I wanted to see. Do you get the same result with 
>> clickandwait (dropping the waitforpage of course)
>
> I forgot to mention that even selenium.open() in that page timesout after the 
> launched Firefox instance shows the page. I guess somehow JavaScript isn't 
> running in that page. Thanks for the tips, Josh!
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and 
> instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> http://www.arsmachina.com.br
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>

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



Re: Restoring Live Page Class Reloading

2010-08-19 Thread Thiago H. de Paula Figueiredo

On Thu, 19 Aug 2010 15:41:20 -0300, Rich M  wrote:

a) ModuleIndex functions similar to the Layout page, it must contain the  
navigation menu and then directs content from a specific page of the  
Module (I will call these SubPages) into the template.


What do you mean by "directs content"?

b) The module needs to keep track of all the SubPage instances so it can  
wipe their persistent fields when navigation changes.


This can be implemented as a ComponentRequestFilter. In addition, Tapestry  
5.2 adds one page lifecycle that my be useful this kind of situation:  
http://tapestry.apache.org/tapestry5.2-dev/apidocs/org/apache/tapestry5/annotations/PageReset.html


c) The module needs to assess the target of page navigation, and then  
filter the resulting SubPage based on user permissions within the  
application.


This can be implemented as a ComponentRequestFilter. That's the  
recommended way of doing it.


d) When one of the specific SubPage classes is changed in source, it  
should be able to be live reloaded without restarting the application


In Eclipse, I just leave all the projects (modules) open and it works, as  
long as I'm not using Maven's jetty:run. I usually create a Main class  
that launches a Jetty instance.


ModuleIndex has a @Component for each SubPage and then maps these  
components to the activation context integers in a @SessionState Map.


In Tapestry 5.1 (page pool), this would lead to a large memory  
comsumption. In 5.2 there's no such problem.
Anyway, a good option is to use ComponentSource to get instances of  
components or pages in runtime instead of holding references to instances,  
leading to the ClassCastExceptios you're experiencing.


--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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



Re: Query parameters

2010-08-19 Thread Howard Lewis Ship
I'm very excited by the new process; ask a FAQ and I can update the
FAQ page live and return a link to that.

On Thu, Aug 19, 2010 at 11:22 AM, Michael Gentry  wrote:
> Wish I had known that one about 4 months ago ... :-)
>
>
> On Thu, Aug 19, 2010 at 1:03 PM, Howard Lewis Ship  wrote:
>> Just added to the FAQ:
>>
>> https://cwiki.apache.org/confluence/display/TAPESTRY/Frequently+Asked+Questions#FrequentlyAskedQuestions-HowdoIaddqueryparametersaPageLinkorActionLink%3F
>>
>>
>> On Thu, Aug 19, 2010 at 3:44 AM, Davor Hrg  wrote:
>>> I'm posting this to user group since it is mostly usage question.
>>>
>>> The new query parameter binding is a welcome addition, especialy in
>>> combination
>>> with replacing the page pool with static instaces. All nice and well, but
>>> how do I pass
>>> query parameters through PageLink or AcionLink ?
>>>
>>> Best to explain it through the example I'm using it with:
>>> There is a page that lists documents, and there is a search form with few
>>> fields.
>>> One field is the "year" which tells the page to limit to docs from that
>>> year.
>>> So I changed the @Persist to @ActivationRequestParameter and after
>>> submitting
>>> the search form I get a nice ur: docs/list?year=2009.
>>> Ok, this works well, I can have multiple tabs with different filters, much
>>> like php which I
>>> like very much and use often.
>>> but there are more things that do not work:
>>> 1. using PageLink from another page to jump to @ActivationRequestParameter
>>> 2. using ActionLink to pass query parameters (annotated with
>>> @RequestParameter)
>>>
>>> 3. If there are more than one such param there is no way to create a link to
>>> it self with one of them changed
>>>   for example on page: docs/list?year=2009&type=FI I can not create a link
>>> directly to docs/list?year=2010&type=FI
>>>   it would be nice to be able to write this: >> q:year="2010">2010 to get the mentioned result
>>>
>>> for that matter a namespace xmln:p="tapestry:parameter" or new one like
>>> xmlns:q="tapestry:query" would be nice
>>> for the ActionLink and PageLink.
>>>
>>>
>>> Davor Hrg
>>>
>>
>>
>>
>> --
>> Howard M. Lewis Ship
>>
>> Creator of Apache Tapestry
>>
>> The source for Tapestry training, mentoring and support. Contact me to
>> learn how I can get you up and productive in Tapestry fast!
>>
>> (971) 678-5210
>> http://howardlewisship.com
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

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

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

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



Events and multizone update

2010-08-19 Thread Elin

I have a custom component based on an "ajaxformloop" that displays rows with
a delete buttom for them.

I need to update several zones afer deleting a row from the ajaxformloop and
cant find a way to do it. From here i have some questions about events (im
sorry im starting with tapestry and im a bit newbie)


- Since "onRemoveRow" event can only return void (cant return a
multizoneupdate), would be possible to capture when i delete a row and
update several zones from it?

- Is it possible to generate custom events on my custom components so i can
capture them into the pages i insert them into?

If you link me examples where i can see this and analize them it would be
enough. I couldnt find any by myself.

Thx in advance.
-- 
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Events-and-multizone-update-tp2641385p2641385.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



Restoring Live Page Class Reloading

2010-08-19 Thread Rich M

Hi,

a couple months back I was attempting to solve this issue, but since it 
is more an issue of agility than functionality it got pushed back in my 
development priorities. I've got some free development time now and I'd 
really like to fix this once and for all.


I'll try to break this down into two sections (1) What I need (2) What I 
have (3) Thoughts


(1)
My webapp is divided into a few distinct modules (not in the Tapestry 
sense) one for each type of user entity in the system (admins, 
merchants, customers).


Each of these modules uses a main page class, lets call it ModuleIndex.

a) ModuleIndex functions similar to the Layout page, it must contain the 
navigation menu and then directs content from a specific page of the 
Module (I will call these SubPages) into the template.


b) The module needs to keep track of all the SubPage instances so it can 
wipe their persistent fields when navigation changes.


c) The module needs to assess the target of page navigation, and then 
filter the resulting SubPage based on user permissions within the 
application.


d) When one of the specific SubPage classes is changed in source, it 
should be able to be live reloaded without restarting the application


(2)
ModuleIndex uses a delegate and block structure to load the content from 
a SubPage of the Module into the template.


The delegate destination begins to be resolved from the Activation 
context, which maps to a static integer that is mapped to a given 
SubPage component.


ModuleIndex has a @Component for each SubPage and then maps these 
components to the activation context integers in a @SessionState Map.


On navigation, the activation context triggers the new SubPage integer. 
The delegate function checks the permissions of the new SubPage. It then 
clears the persisted fields of the last SubPage. It then returns the new 
SubPage from the Map.


SubPages all extend the TabImpl class, which in turn implements the Tab 
inferface. TabImpl and Tab are in the package com.myapp.base.


(3)
So my solution currently provides resolutions for concerns a, b, and c, 
but breaks at d. I'm pretty sure the issue is that I have @Component 
fields for each of the SubPages and furthermore they are being 
referenced in a Map. Thus the ModuleIndex can be holding a stale version 
of the class when the class is changed and reloaded, resulting in a 
ClassCastException.


I use the Map, because as far as I can figure, I need the page object to 
invoke clearPersistentFields(). I use the @Component fields, probably 
mostly because I wrote this months ago when I was first learning 
Tapestry and had a minor understanding.


I could foresee a means of making ModuleIndex more like Layout, in terms 
of loading the SubPage content into the template. Allow the t:type to be 
ModuleIndex for the html element and use @InjectPage or a related form 
of page navigation to move about.


I could foresee moving the Map of SubPages out of the ModuleIndex to a 
service or something, but I'm not able to imagine that solving the Live 
Class Reloading issues, especially since I am using 5.1.0.5.


Sorry if this has seemed long-winded, but I do believe help is a lot 
better provided when you aren't vague. I can provide code for any of my 
implementations if necessary. At this point I don't want to make this 
e-mail too long.


Thanks,
Rich


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



Re: Query parameters

2010-08-19 Thread Michael Gentry
Wish I had known that one about 4 months ago ... :-)


On Thu, Aug 19, 2010 at 1:03 PM, Howard Lewis Ship  wrote:
> Just added to the FAQ:
>
> https://cwiki.apache.org/confluence/display/TAPESTRY/Frequently+Asked+Questions#FrequentlyAskedQuestions-HowdoIaddqueryparametersaPageLinkorActionLink%3F
>
>
> On Thu, Aug 19, 2010 at 3:44 AM, Davor Hrg  wrote:
>> I'm posting this to user group since it is mostly usage question.
>>
>> The new query parameter binding is a welcome addition, especialy in
>> combination
>> with replacing the page pool with static instaces. All nice and well, but
>> how do I pass
>> query parameters through PageLink or AcionLink ?
>>
>> Best to explain it through the example I'm using it with:
>> There is a page that lists documents, and there is a search form with few
>> fields.
>> One field is the "year" which tells the page to limit to docs from that
>> year.
>> So I changed the @Persist to @ActivationRequestParameter and after
>> submitting
>> the search form I get a nice ur: docs/list?year=2009.
>> Ok, this works well, I can have multiple tabs with different filters, much
>> like php which I
>> like very much and use often.
>> but there are more things that do not work:
>> 1. using PageLink from another page to jump to @ActivationRequestParameter
>> 2. using ActionLink to pass query parameters (annotated with
>> @RequestParameter)
>>
>> 3. If there are more than one such param there is no way to create a link to
>> it self with one of them changed
>>   for example on page: docs/list?year=2009&type=FI I can not create a link
>> directly to docs/list?year=2010&type=FI
>>   it would be nice to be able to write this: > q:year="2010">2010 to get the mentioned result
>>
>> for that matter a namespace xmln:p="tapestry:parameter" or new one like
>> xmlns:q="tapestry:query" would be nice
>> for the ActionLink and PageLink.
>>
>>
>> Davor Hrg
>>
>
>
>
> --
> Howard M. Lewis Ship
>
> Creator of Apache Tapestry
>
> The source for Tapestry training, mentoring and support. Contact me to
> learn how I can get you up and productive in Tapestry fast!
>
> (971) 678-5210
> http://howardlewisship.com
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

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



Re: Query parameters

2010-08-19 Thread Howard Lewis Ship
Just added to the FAQ:

https://cwiki.apache.org/confluence/display/TAPESTRY/Frequently+Asked+Questions#FrequentlyAskedQuestions-HowdoIaddqueryparametersaPageLinkorActionLink%3F


On Thu, Aug 19, 2010 at 3:44 AM, Davor Hrg  wrote:
> I'm posting this to user group since it is mostly usage question.
>
> The new query parameter binding is a welcome addition, especialy in
> combination
> with replacing the page pool with static instaces. All nice and well, but
> how do I pass
> query parameters through PageLink or AcionLink ?
>
> Best to explain it through the example I'm using it with:
> There is a page that lists documents, and there is a search form with few
> fields.
> One field is the "year" which tells the page to limit to docs from that
> year.
> So I changed the @Persist to @ActivationRequestParameter and after
> submitting
> the search form I get a nice ur: docs/list?year=2009.
> Ok, this works well, I can have multiple tabs with different filters, much
> like php which I
> like very much and use often.
> but there are more things that do not work:
> 1. using PageLink from another page to jump to @ActivationRequestParameter
> 2. using ActionLink to pass query parameters (annotated with
> @RequestParameter)
>
> 3. If there are more than one such param there is no way to create a link to
> it self with one of them changed
>   for example on page: docs/list?year=2009&type=FI I can not create a link
> directly to docs/list?year=2010&type=FI
>   it would be nice to be able to write this:  q:year="2010">2010 to get the mentioned result
>
> for that matter a namespace xmln:p="tapestry:parameter" or new one like
> xmlns:q="tapestry:query" would be nice
> for the ActionLink and PageLink.
>
>
> Davor Hrg
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

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

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

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



Re: 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 Padilla  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



Re: TextOutputStream and Selenium

2010-08-19 Thread Thiago H. de Paula Figueiredo
On Thu, 19 Aug 2010 12:07:29 -0300, Josh Canfield   
wrote:


This is the code I wanted to see. Do you get the same result with  
clickandwait (dropping the waitforpage of course)


I forgot to mention that even selenium.open() in that page timesout after  
the launched Firefox instance shows the page. I guess somehow JavaScript  
isn't running in that page. Thanks for the tips, Josh!


--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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



Re: TextOutputStream and Selenium

2010-08-19 Thread Thiago H. de Paula Figueiredo
On Thu, 19 Aug 2010 12:07:29 -0300, Josh Canfield   
wrote:



selenium.click(locator);
s.waitForPageToLoad("30");


This is the code I wanted to see. Do you get the same result with  
clickandwait (dropping the waitforpage of course)


Yes.


Is the locator pointing at a plain link?


Yes. The mind boggles . . .

--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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



Re: Custom Validation Bubbles

2010-08-19 Thread Josh Canfield
> I'm curious though, how did you know about the FieldToTracker map and the 
> control name?

Whenever it's not obvious what's happening I step into the code with a 
debugger. Set a breakpoint before you call recordError and you can step through 
the whole process. Then you can set a breakpoint in the validation decorator 
and step through the code to see why it doesn't think there is an error.

I saw that it was depending on the control name, tracked down where it was set, 
and there you have it!


-- Josh

On Aug 19, 2010, at 7:27 AM, Rich M  wrote:

> Thanks again Josh. That was simple. I'm curious though, how did you know 
> about the FieldToTracker map and the control name? I gave a shot at looking 
> through the Tapestry source code to try and see if I could figure something 
> out by that, but I felt a bit lost and reading the Errors class mislead me a 
> bit.
> 
> Thanks,
> Rich
> 
> On 08/18/2010 06:33 PM, Josh Canfield wrote:
>> Sooo...
>> 
>> When you set an error on a field before it's been rendered then the
>> error goes into the list of errors (so you see it in t:errors) but the
>> connection between the field and the error is lost. The reason is that
>> the fieldToTracker map is keyed on the fields control name which isn't
>> allocated until the field's setupRender phase. You could
>> 
>> So, how do you get on the other side of the field's setupRender phase?
>> How about a mixin! ;)
>> 
>> @MixinAfter
>> public class AttachError {
>> @Parameter(required = true, allowNull = true)
>> private String message;
>> 
>> @Environmental
>> private ValidationTracker tracker;
>> 
>> @InjectContainer
>> private Field field;
>> 
>> void setupRender() {
>> if (message != null)
>> tracker.recordError(field, message);
>> }
>> }
>> 
>> And use it like so:
>> 
>> @Component(parameters = {"AttachError.message=fieldError"})
>> @Mixins("AttachError")
>> private TextField _textField;
>> 
>> 
>> Josh
>> 
>> 
>> 
>> On Wed, Aug 18, 2010 at 2:16 PM, Rich M  wrote:
>>   
>>> Hi,
>>> 
>>> I'm still having a hard time grasping this. I tried thinking of a way to
>>> trigger an event in the CustomerLogin component to resubmit so the errors
>>> would show, no go. I tried using the onActivate of the container Page to
>>> load things in the CustomerLogin component and then resubmit the page, no
>>> go. I tried using RenderSupport like in the ValidationDecorator to add the
>>> error script, but RenderSupport isn't available inside the component before
>>> the render cycle and it's too late at setupRender phase or after.
>>> 
>>> Strangely enough, if I include  in the form of CustomerLogin, it
>>> actually displays the error, which really suprised me when I did a sanity
>>> check. I'm not sure why that gets triggered and not the AJAX bubbles from
>>> the ValidationDecorator that works in other places after form submit.
>>> 
>>> At this point if you couldn't tell I'm trying any half-baked alternative
>>> strategy I can imagine to try and make progress. There's got to be something
>>> I'm missing no?
>>> 
>>> Included below is some related code, this is all triggered by the activation
>>> URL
>>> 
>>> Thanks,
>>> Rich
>>> 
>>> CustomerLogin
>>> 
>>> public class CustomerLogin {
>>>/**
>>> * Customer Log-In Form */
>>> 
>>>@Parameter(defaultPrefix = BindingConstants.LITERAL)
>>>private String expired;
>>> 
>>>@Inject
>>>private Logger log;
>>> 
>>>@InjectPage
>>>private CaiIndex caiIndex;
>>> 
>>>@Property
>>>private Customer custLog;
>>> 
>>>@Property @Persist("flash")
>>>private String custId;
>>>@Property @Persist("flash")
>>>private String custPw;
>>> 
>>>@Component(id="custPw")
>>>private PasswordField custPwField;
>>> 
>>>@Component
>>>private Form custLoginForm;
>>> 
>>>@Inject
>>>private CustomerDAO cdao;
>>> 
>>>@Inject
>>>private CustSession custSession;
>>> 
>>>@Environmental
>>>private RenderSupport _renderSupport;
>>> 
>>> 
>>>public void setExpired(){
>>>log.debug("In setExpired of CustomerLogin");
>>> 
>>>if ("expired".equals(expired)){
>>>log.debug("Setting recordError in setupRender for expired
>>> customer session" +
>>>"\n" + " custPwField: " + custPwField);
>>>custLoginForm.recordError(custPwField, "Session expired. Please
>>> login again.");
>>> 
>>>ValidationTracker vt = custLoginForm.getDefaultTracker();
>>>log.debug("Is custPwField in error?" + vt.inError(custPwField));
>>> 
>>>//
>>>  
>>> _renderSupport.addScript("$('%s').getFieldEventManager().showValidationMessage('%s');",
>>>  //  custPwField.getClientId(), vt.getError(custPwField));
>>>}
>>>}
>>> 
>>>public void setupRender(){
>>>//log.debug("In onActivate of CustomerLogin");
>>>//
>>>//if ("expired".equals

Re: TextOutputStream and Selenium

2010-08-19 Thread Josh Canfield
> selenium.click(locator);
> s.waitForPageToLoad("30");

This is the code I wanted to see. Do you get the same result with clickandwait 
(dropping the waitforpage of course)

Is the locator pointing at a plain link?

-- Josh

On Aug 19, 2010, at 6:53 AM, "Thiago H. de Paula Figueiredo" 
 wrote:

> On Wed, 18 Aug 2010 22:48:18 -0300, Josh Canfield  
> wrote:
> 
>> Can you show the code you're using to open the page?
> 
> Not really, but it's pretty common:
> 
> selenium.click(locator);
> s.waitForPageToLoad("30");
> 
>> Are you calling waitForPageToLoad directly? Do you need to?
> 
> Yes, as otherwise the following test would run in the previous page.
> 
> -- 
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and 
> instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> http://www.arsmachina.com.br
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 

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



Re: Custom Validation Bubbles

2010-08-19 Thread Rich M
Thanks again Josh. That was simple. I'm curious though, how did you know 
about the FieldToTracker map and the control name? I gave a shot at 
looking through the Tapestry source code to try and see if I could 
figure something out by that, but I felt a bit lost and reading the 
Errors class mislead me a bit.


Thanks,
Rich

On 08/18/2010 06:33 PM, Josh Canfield wrote:

Sooo...

When you set an error on a field before it's been rendered then the
error goes into the list of errors (so you see it in t:errors) but the
connection between the field and the error is lost. The reason is that
the fieldToTracker map is keyed on the fields control name which isn't
allocated until the field's setupRender phase. You could

So, how do you get on the other side of the field's setupRender phase?
How about a mixin! ;)

@MixinAfter
public class AttachError {
 @Parameter(required = true, allowNull = true)
 private String message;

 @Environmental
 private ValidationTracker tracker;

 @InjectContainer
 private Field field;

 void setupRender() {
 if (message != null)
 tracker.recordError(field, message);
 }
}

And use it like so:

 @Component(parameters = {"AttachError.message=fieldError"})
 @Mixins("AttachError")
 private TextField _textField;


Josh



On Wed, Aug 18, 2010 at 2:16 PM, Rich M  wrote:
   

Hi,

I'm still having a hard time grasping this. I tried thinking of a way to
trigger an event in the CustomerLogin component to resubmit so the errors
would show, no go. I tried using the onActivate of the container Page to
load things in the CustomerLogin component and then resubmit the page, no
go. I tried using RenderSupport like in the ValidationDecorator to add the
error script, but RenderSupport isn't available inside the component before
the render cycle and it's too late at setupRender phase or after.

Strangely enough, if I include  in the form of CustomerLogin, it
actually displays the error, which really suprised me when I did a sanity
check. I'm not sure why that gets triggered and not the AJAX bubbles from
the ValidationDecorator that works in other places after form submit.

At this point if you couldn't tell I'm trying any half-baked alternative
strategy I can imagine to try and make progress. There's got to be something
I'm missing no?

Included below is some related code, this is all triggered by the activation
URL

Thanks,
Rich

CustomerLogin

public class CustomerLogin {
/**
 * Customer Log-In Form */

@Parameter(defaultPrefix = BindingConstants.LITERAL)
private String expired;

@Inject
private Logger log;

@InjectPage
private CaiIndex caiIndex;

@Property
private Customer custLog;

@Property @Persist("flash")
private String custId;
@Property @Persist("flash")
private String custPw;

@Component(id="custPw")
private PasswordField custPwField;

@Component
private Form custLoginForm;

@Inject
private CustomerDAO cdao;

@Inject
private CustSession custSession;

@Environmental
private RenderSupport _renderSupport;


public void setExpired(){
log.debug("In setExpired of CustomerLogin");

if ("expired".equals(expired)){
log.debug("Setting recordError in setupRender for expired
customer session" +
"\n" + " custPwField: " + custPwField);
custLoginForm.recordError(custPwField, "Session expired. Please
login again.");

ValidationTracker vt = custLoginForm.getDefaultTracker();
log.debug("Is custPwField in error?" + vt.inError(custPwField));

//
  
_renderSupport.addScript("$('%s').getFieldEventManager().showValidationMessage('%s');",
  //  custPwField.getClientId(), vt.getError(custPwField));
}
}

public void setupRender(){
//log.debug("In onActivate of CustomerLogin");
//
//if ("expired".equals(expired)){
//log.debug("Setting recordError in setupRender for expired
customer session" +
//"\n" + " custPwField: " + custPwField);
//custLoginForm.recordError(custPwField, "Session expired. Please
login again.");

//ValidationTracker vt = custLoginForm.getDefaultTracker();
//log.debug("Is custPwField in error?" +
vt.inError(custPwField));

//
  
_renderSupport.addScript("$('%s').getFieldEventManager().showValidationMessage('%s');",
 //   custPwField.getClientId(), vt.getError(custPwField));
//}
}

Object onSuccessFromCustLoginForm(){
log.debug("In onSuccessFromCustLoginForm, going to see if customer is
valid then go to index");

if(!cdao.validate(custId, custPw)){
custLoginForm.recordError(custPwField, "Invalid user name or
password");
log.error("User failed validation on login page");
return this;
}

log.

Re: TextOutputStream and Selenium

2010-08-19 Thread Thiago H. de Paula Figueiredo
On Wed, 18 Aug 2010 22:48:18 -0300, Josh Canfield   
wrote:



Can you show the code you're using to open the page?


Not really, but it's pretty common:

selenium.click(locator);
s.waitForPageToLoad("30");


Are you calling waitForPageToLoad directly? Do you need to?


Yes, as otherwise the following test would run in the previous page.

--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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



LinkSubmit component bug (TAP5-1180)

2010-08-19 Thread Kai Weber
Hi,

we are hit by the bug described in TAP5-1180 (the same as TAP5-930,
which was closed "Incomplete"). The findings the reporter of the bug
Paul Stanton made are the same we suspect to be the problem.

How do other people on this list solve this problem? Does anybody use
the LinkSubmit component?

Regards, Kai

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



Query parameters

2010-08-19 Thread Davor Hrg
I'm posting this to user group since it is mostly usage question.

The new query parameter binding is a welcome addition, especialy in
combination
with replacing the page pool with static instaces. All nice and well, but
how do I pass
query parameters through PageLink or AcionLink ?

Best to explain it through the example I'm using it with:
There is a page that lists documents, and there is a search form with few
fields.
One field is the "year" which tells the page to limit to docs from that
year.
So I changed the @Persist to @ActivationRequestParameter and after
submitting
the search form I get a nice ur: docs/list?year=2009.
Ok, this works well, I can have multiple tabs with different filters, much
like php which I
like very much and use often.
but there are more things that do not work:
1. using PageLink from another page to jump to @ActivationRequestParameter
2. using ActionLink to pass query parameters (annotated with
@RequestParameter)

3. If there are more than one such param there is no way to create a link to
it self with one of them changed
   for example on page: docs/list?year=2009&type=FI I can not create a link
directly to docs/list?year=2010&type=FI
   it would be nice to be able to write this: 2010 to get the mentioned result

for that matter a namespace xmln:p="tapestry:parameter" or new one like
xmlns:q="tapestry:query" would be nice
for the ActionLink and PageLink.


Davor Hrg


Re: IntelliJIDEA vs Eclipse

2010-08-19 Thread Michal Gruca

Ok, thtat was easy :) Thanks, it was one of most annoying things for me. I
have a keymap on wall behind monitor, but it figures that i was using wrong
alt :P
My guess is probably after couple of months i will get used to differences.
Intellij is ok. I'm slowly getting used to new keymap and way in which some
features works different.

Best regards
Michał Gruca
-- 
View this message in context: 
http://tapestry-users.832.n2.nabble.com/IntelliJIDEA-vs-Eclipse-tp5437089p5439558.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



Re: DISCUSSION: Time zones and date selection

2010-08-19 Thread Dmitry Gusev
Here's the service description:
http://www.geonames.org/export/web-services.html#timezone

And JSON example
for ping-service (XML is service also there):

http://ws.geonames.org/timezoneJSON?lat=37.41&lng=-122.05

{"time":"2010-08-19 01:56","countryName":"United
States","sunset":"2010-08-19
19:55","rawOffset":-8,"dstOffset":-7,"countryCode":"US","gmtOffset":-8,"lng":-122.05,"sunrise":"2010-08-19
06:27","timezoneId":"America/Los_Angeles","lat":37.41}

On Thu, Aug 19, 2010 at 12:49, Dmitry Gusev  wrote:

> In addition to my previous message:
>
>
> http://stackoverflow.com/questions/41504/timezone-lookup-from-latitude-longitude
>
> I will probably use this approach to determine initial client timezone
> since I'm already use URL/IP to location functionality there:
>
> http://github.com/dmitrygusev/ping-service/blob/master/ping-service/src/dmitrygusev/ping/services/IPUtils.java
>
> (FYI this class uses http://ip-whois.net to resolve locations.)
>
> In current implementation I'm using UTC time by default in ping-service
> (GAE's default timezone), but user may specify its timezone in profile.
>
> On Thu, Aug 19, 2010 at 12:36, 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 Padilla 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
>>>
>>>
>>
>>
>> --
>> Dmitry Gusev
>>
>> AnjLab Team
>> http://a

Re: DISCUSSION: Time zones and date selection

2010-08-19 Thread Dmitry Gusev
In addition to my previous message:

http://stackoverflow.com/questions/41504/timezone-lookup-from-latitude-longitude

I will probably use this approach to determine initial client timezone since
I'm already use URL/IP to location functionality there:
http://github.com/dmitrygusev/ping-service/blob/master/ping-service/src/dmitrygusev/ping/services/IPUtils.java

(FYI this class uses http://ip-whois.net to resolve locations.)

In current implementation I'm using UTC time by default in ping-service
(GAE's default timezone), but user may specify its timezone in profile.

On Thu, Aug 19, 2010 at 12:36, 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 Padilla  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
>>
>>
>
>
> --
> Dmitry Gusev
>
> AnjLab Team
> http://anjlab.com
>



-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: DISCUSSION: Time zones and date selection

2010-08-19 Thread Dmitry Gusev
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 Padilla  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
>
>


-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: Tynamo on T5:conversation.moderator component doesn't work with IE7.

2010-08-19 Thread cleverpig
Hi,all!

I worked out this issue!
这是由于IE的cache造成的,因为每次ajax
request的url和参数均相同,因此IE会将cache中response作为回应,而不是去访问service。
因此修改conversation组件的ConversationModerator.js文件,在每次ajax
request的url中加上date参数(当前时间),来防止缓存。
Tynamo's conversation moderator component will send ajax request in
some interval to conversationManager Service,so the conversation id
can be keeping.

since IE has a complete & big cache mechanism,after moderator
component sent first request to service.
then this component will resent with the same url and parameters,this
time IE will treat cached response as response to it,instead of
sending real request.so after a little time past,our conversation will
out of time.

solution:
modify ConversationModerator.js,with add a date parameter to make url
differently every time:
...
var date = new Date();
new Ajax.Request(this.baseURI + "checkidle" +
this.defaultURIparameters + this.keepAlive + '&warn=' +
this.warnBeforeSeconds+'&date='+date.getTime(), {
method: 'get',
evalJSON:true,
onSuccess: this.handleIdleCheckResult.bind(this)
});

On Fri, Aug 13, 2010 at 6:37 PM, cleverpig  wrote:
> hi, all!
>
> I found conversation.moderator seem like doesn't work with IE7.I'd
> tested conversation moderator component,it work well at chrome.
> my tapestry version:5.2.0-20100208,when I use this component in page
> with IE browser,it never send ajax request to server after page
> loaded.
> but with chrome,everything is fine.
>
> my code is seem like tynamo offical guide
> example:http://tynamo.codehaus.org/tapestry-conversations+guide
>
> Page class:
> Public class MyPage{
>
>        ...
>       �...@inject
>        private ConversationManager conversationManager;
>        private String conversationId;
>
>        private Object createConversation(){
>                
> conversationId=conversationManager.createConversation(resources.getPageName(),60*60*2);
>                return this;
>        }
>
>        Object onActivate(){
>                if (paging==null)
>                        return createConversation();
>                else
>                        return null;
>        }
>
>        Object onActivate(String conversationId){
>                if(!conversationManager.isActiveConversation(conversationId)){
>                        return createConversation();
>                }
>
>                this.conversationId=conversationId;
>                return null;
>        }
>
>        String onPassivate(){
>                return conversationId;
>        }
>        ...
> }
>
> tml:
> ...
> 
> ...
>
>
> --
> cleverpig(Dan)
> Location: Beijing
> Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China
> Zipcode: 100031
> MSN: great_liu...@hotmail.com
> QQ: 149291732
> Skype: cleverpigatmatrix
> Facebook ID:cleverpig
> Blog: cleverpig.name/dan/
> Tags: del.icio.us/cleverpig
> Twitter: twitter.com/cleverpig
> 新浪微博: t.sina.com.cn/cleverpig
> Organization: www.beijing-open-party.org
> or...@facebook: http://www.facebook.com/group.php?gid=8159558294
>



-- 
cleverpig(Dan)
Location: Beijing
Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China
Zipcode: 100031
MSN: great_liu...@hotmail.com
QQ: 149291732
Skype: cleverpigatmatrix
Facebook ID:cleverpig
Blog: cleverpig.name/dan/
Tags: del.icio.us/cleverpig
Twitter: twitter.com/cleverpig
新浪微博: t.sina.com.cn/cleverpig
Organization: www.beijing-open-party.org
or...@facebook: http://www.facebook.com/group.php?gid=8159558294

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



Re: IntelliJIDEA vs Eclipse

2010-08-19 Thread Sven Homburg
> to use mouse. Could any one tell me is there a keyboard shortcut to call red
> bulb actions? (e.g. when i write function that does not exist and want to

alt-enter

with regards
Sven Homburg
Founder of the Chenille Kit Project
http://chenillekit.codehaus.org





2010/8/19 Michal Gruca :
>
>
> Sven Homburg wrote:
>>
>> And, i hope that i dont lie, IntelliJ's refactoring is unbeatable.
>>
> And that's the reason why i love eclipse. I prefere it refactoring and code
> generation features. Also I'm used to using keyboard and in Intellij i had
> to use mouse. Could any one tell me is there a keyboard shortcut to call red
> bulb actions? (e.g. when i write function that does not exist and want to
> generate it i swing with mouse all over the screen waiting for red bulb to
> show up. In eclipse it is part of quick fix actions under ctrl+1).
> But imo it just proves that one should use tools that fits him best.
>
> Regards
> Michał Gruca
> --
> View this message in context: 
> http://tapestry-users.832.n2.nabble.com/IntelliJIDEA-vs-Eclipse-tp5437089p5439098.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



Problem with comma and Integer in textfield

2010-08-19 Thread Cucchietti Denis
Hi !!

First sorry for my poor english ;-). I have decided to ask some help for a
problem of comma in textfield.


I have an attribute "budget" :

 private Integer budget;

In TML, i have :

 ${message:budget-label} :
 

So i have a regexp because i just want an integer :

budget-regexp=^[0-9]{1,9}$

It works but it is always possible to insert a comma in the textfield !!

How can i do to forbid this comma? (because in France if you insert a comma
is for a float)

If someone has an idea :-)

Thanks 

Denis CUCCHIETTI
Responsable d'application
Business Unit Public Santé Transport
Atos Worldline - Lyon
Mail : denis.cucchie...@atosorigin.com
Tel : +33 (0)4 78 17 87 86
www.atosworldline.comhttp://www.atosworldline.com>
Atos Worldline est une société du groupe Atos Origin : 
www.atosorigin.comhttp://www.atosorigin.com>





Ce message et les pièces jointes sont confidentiels et réservés à l'usage 
exclusif de ses destinataires. Il peut également être protégé par le secret 
professionnel. Si vous recevez ce message par erreur, merci d'en avertir 
immédiatement l'expéditeur et de le détruire. L'intégrité du message ne pouvant 
être assurée sur Internet, la responsabilité du groupe Atos Origin ne pourra 
être recherchée quant au contenu de ce message. Bien que les meilleurs efforts 
soient faits pour maintenir cette transmission exempte de tout virus, 
l'expéditeur ne donne aucune garantie à cet égard et sa responsabilité ne 
saurait être recherchée pour tout dommage résultant d'un virus transmis.

This e-mail and the documents attached are confidential and intended solely for 
the addressee; it may also be privileged. If you receive this e-mail in error, 
please notify the sender immediately and destroy it. As its integrity cannot be 
secured on the Internet, the Atos Origin group liability cannot be triggered 
for the message content. Although the sender endeavours to maintain a computer 
virus-free network, the sender does not warrant that this transmission is 
virus-free and will not be liable for any damages resulting from any virus 
transmitted.


Re: repo?.maven.org/.../tapestry*/5.2.0 ?!?!

2010-08-19 Thread Michal Gruca

That helped. Thanks :)
Anyway I still stick to my opinion that archetype should be fixed


Andreas Andreou-2 wrote:
> 
> Michal, edit the last few lines of pom.xml so that it sets
> tapestry-release-version to 5.2.0
> and then rerun mcn jetty:run
> 

-- 
View this message in context: 
http://tapestry-users.832.n2.nabble.com/repo-maven-org-tapestry-5-2-0-tp5437148p5439212.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