Re: angularjs with tapestry

2015-12-30 Thread Mark Mearing-Smith
Hi Rob,

It took a little bit of set up but we did something like this:


   - In tapestry I created a component called "AngularComponent" that has a
   few   lines in the .tml file
   (vendorJS and scriptJS) . Then I add  to any tapestry
   page where I want access to Angular.
   - I wrote all my angular bits as directives, using tapestry resteasy as
   a restapi. I also created an EmptyController. Then used  in any
   tapestry tml file.
   - I had to put the app.properties file in my angular build and put the
   vendorJs= lines in there. Using
   Grunt for my Angular build process I had to add the .properties file so it
   would replace the vendor.js line in the app.properties file to the
   generated file names.
   - Each time we do a full build we have to run npm install and bower
   install. We also have a pom file in the angular project that runs grunt
   build and then creates a war file for the angular project.
   - We then use cargo-maven2-plugin to merge the tapestry and angular war
   files.

Hope that helps. If you want any specifics on any parts or why we did it in
a certain way let me know.

Regards,

Mark

On Wed, Dec 30, 2015 at 12:10 PM Robson Pires 
wrote:

> Hi,
>
> I am trying to integrate angularjs with tapestry, any advice about it?
>
> Bests regards,
>
> Rob
>


Re: How to stay on same page

2013-05-14 Thread Mark Ashworth
Hi,

Is there a reason why the *default:* case of the switch statement is not
handled. Maybe if you raise and error here or log out the reportType that
you receive in submit() will give a clue why the beanType is not set
correctly for the passivate method.

Regards,
Mark P Ashworth


On Mon, May 13, 2013 at 9:03 PM, nhhockeyplayer nashua <
nhhockeypla...@hotmail.com> wrote:

> Thnanks jens Here is my passivate   @OnEvent(EventConstants.PASSIVATE)
>  Object[] passivate() {return new Object[] { beanType }; } but
> I toggle it when I hit submit  @OnEvent(value = "go")
>  public Object submit() {
>   logger.debug("In submit : ");  switch (reportType) {
>   case TEAM:
>beanType = Team.class;
>break;
>   case PLAYER:
>beanType = Player.class;
>break;
>   default:
>   }  beanCollection =
> TynamoUTIL.loadCollection(hibernatePersistenceService, beanType);
>
>   return this;
>  }




-- 
Mark P. Ashworth


Tapestry 5.4 alpha 3 : AjaxFormLoop t:addrowlink does not seem to fire event

2013-05-02 Thread Mark Ashworth
Hi everyone,

I am using the AjaxFormLoop component in Tapestry 5.4 but the addrowlink is
not firing any events  event though I followed the example on
http://jumpstart.doublenegative.com.au/jumpstart.

Is there a test case in the 5.4 version that I can consult to determine
what I have coded incorrectly?
\
Regards,
Mark P. Ashworth


Re: Now hotness at SX vs 5.4

2013-04-12 Thread Mark Murphy


On Mar 15, 2013, at 9:52 AM, Howard Lewis Ship wrote:

I'm very, very interested in AngularJS.  It looks like
Tapestry completely on the client, and I suspect Tapestry on the  
server

would be an ideal complement to it.



Same very interested in this.

I did not see this on my radar when I did some proof of concepts on a  
similar approach with underscore and backbone.  Now that I've found  
AngularJS, I'm going to give it a thorough review for consideration in  
future projects.


mark

*
Mark F. Murphy, Director Software Development
Tyrell Software Corp
http://www.tyrell.com
mailto:ma...@tyrell.com


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



Tapestry generated urls

2012-12-06 Thread Mark Fugmann
Greetings,

We've ran into a problem with tapestry.

One of our customers has a strong interest in SEO optimization.

Currently our tapestry application (tapestry 5.1) is mounted to /shop/*.
This application provides multiple eCommerce stores.
Likewise the url for our german store is /shop/de_DE/*, the austrian store
can be found at
/shop/de_AT/, and yet another store is located at /shop/en_BX/.

Now our customer would like to "turn around" the mapping, so the german
store shall be located at /de_DE/shop/ etc.
My first idea was to mount tapestry to /* but I need to keep the /shop/ part
in the url.

Most components build their URLs like /{contextpath}/{locale}/component...

Is there any "easy" way to change that? I couldn't find anything.

Mit freundlichen Grüßen
Mark Fugmann

ZYRES digital media systems GmbH
Eschersheimer Landstr. 5-7
60322 Frankfurt am Main
 
Phone +49 (0)69 98 55 99 - 23
Fax +49 (0)69 98 55 99 - 11
http://www.zyres.com

Firmensitz: Eschersheimer Landstr. 5-7 60322 Frankfurt am Main
Registergericht: Amtsgericht Frankfurt am Main, HRB 76374
Geschäftsführer: Sebastian Schirmer




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



Re: Need feedback for Eclipse WTP based Tapestry 5 visual editor

2012-02-05 Thread Mark
I agree that the ability to switch between .tml and .java would be
extremely useful. Right now issue 13 is keeping me from using it.

There used to be a plugin that only helped with this switch called
loom-t5, but the update site for that appears to be offline.

As far as a wish list, have you ever seen the old gui tools for
working with Apple WebObjects? It would show you the
objects/variables/methods from the .java page and let you navigate
through them and then click and drag a particular attribute and drop
it on a component and decide what you wanted to connect it to. It
brought some simple drag and drop capabilities to the editor that I've
always thought would be a great thing for Tapestry.

You can see some screenshots here:
https://developer.apple.com/legacy/mac/library/documentation/WebObjects/Conceptual/WO53_WOBuilderGuide/WO53_WOBuilderGuide.pdf

Page 53 & 55 explains how the editor let you navigate the objects that
were in scope for a page.  Page 60 show a drag and drop connection
taking place in the editor.

Anyway, I think something like that would be interesting and useful,
but the switching between .tml and .java, really good code completion
for components, and easy installation are obviously the things that
are going to be the most useful.

Just some thoughts. I'm looking forward to seeing what you do with the plugin!

Mark

2012/2/4 Giulio Micali :
> Hi Gavin !
>
> I'm currently using your plugin: only the CTRL+R feature indeed, but it's
> REALLY useful.
>
> but...
> I've posted a solution for the issue (13) in that feature and after several
> months...nothing, not even a post like "I will check that".
>
> I thought that the project has ended, and I'm happy to hear the opposite.
>
> Cheers,
> Giulio
>
>
>
> 2012/2/3 Chris Mylonas 
>
>> Hi Gavin,
>>
>> Great project thus far!!  A tool like that within eclipse will certainly
>> get more people looking at tapestry as a framework to use.
>> I initially thought Dmitry's comment was a little harsh and that he was
>> being a bit fussy requesting the installation through Help->Install New
>> Software
>>
>> But I have to say, there's one thing I find really unproductive - and that
>> is fixing my dev environment when it breaks.  I'm back on Helios and that
>> directory listing is a little too intimidating for me to try with the
>> current number of projects I'm mucking around with.
>>
>> Sorry I couldn't test it first-hand for you - but from the vid, it looks
>> like something people could use to learn tapestry faster than what I've
>> managed!!
>>
>> The drag and drop of components is impressive.
>>
>> Cheers
>> Chris
>>
>>
>>
>> On 03/02/2012, at 7:12 PM, Gavin Lei wrote:
>>
>> > Yeah, this is really a problem, if we want to do so, TapestryTools
>> > must keep pace with Eclipse WTP's version. I will try to contact with
>> > Eclipse WTP community and try to merge TapestryTools into WTP, if
>> > fail, i will find a way to optimize its structure and reduce its
>> > version depend things to simplify install progress.
>> >
>> > 2012/2/3 Dmitry Gusev :
>> >> Hi, Gavin!
>> >>
>> >> Thats a big step forward. But, still, I think that a huge limitation of
>> >> TapestryTools is that it can't be plugged-into existing Eclipse Java EE
>> >> installation through the Help -> Install New Software I wish this
>> will
>> >> be resolved in future releases.
>> >>
>> >> 2012/2/3 Gavin Lei 
>> >>
>> >>> Hi all,
>> >>>
>> >>> I built Eclipse WTP based Tapestry 5 visual editor - TapestryTools [1]
>> >>> as GSoC 2011 project. Now, we plan to improve this tool and keep it as
>> >>> a GSoC 2012 project, before we start real develop job, we need
>> >>> feedback from you guys. Welcome to hava a trial of it, this is the
>> >>> guide [2] about how to install it, and we also have a video about how
>> >>> to use this tool.
>> >>>
>> >>> If you have any advises about it or you need some new features, please
>> >>> let me know. Thank you.
>> >>>
>> >>> [1] http://code.google.com/p/tapestrytools/
>> >>> [2]
>> >>>
>> http://code.google.com/p/tapestrytools/wiki/TapestryTools_Install_Guide
>> >>> [3] http://tapestrytools.googlecode.com/files/tapestrytools.mov
>> >>>
>> >>> --
>> >>> -

Re: Tapestry contract opportunity

2011-12-11 Thread Mark Shead
Erol,

I run a small consulting firm our primary development focus is on
Tapestry and would be very interested in talking with you about your
project.

We have built a number of Tapestry modules that we use for our
projects. As a result, we can usually get an initial version up and
running very quickly.

We tend to be very careful who we take on as clients because our focus
is on projects where our skill set, libraries and experience will make
us the most cost effective option. But even if we aren't a good fit,
we can often make some recommendations once we are more familiar with
your needs.

You can reach me at mark.sh...@xeric.net.

You can also call me at 620-875-4909 although it might be best to give
me a heads up by email or text message as I'm going to be traveling
extensively over the next few days and may not always be where I can
take a call.

Looking forward to talking with you.

Mark


On Sun, Dec 11, 2011 at 7:18 PM, Erol Akarsu  wrote:
> I need a contractor who is expert on Tapestry,Hibernate and Spring, other
> Java tools to implement a B2B auction site.
> Can you please contact with me, ebaka...@yahoo.com ? Please send me your
> contact details so that we can discuss more details on the B2B project and
> negotiate on the contract price. This is one time project.
>
> Best Regards
>
> Erol Akarsu
>
> --
> View this message in context: 
> http://tapestry.1045711.n5.nabble.com/Tapestry-contract-opportunity-tp5066936p5066936.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>

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



Streaming Example

2011-12-11 Thread Mark Shead
http://s3.amazonaws.com/xeric_s3_test/index.html

This works now using JW Player.  When I download the files and try to
run them locally it doesn't work for some reason, but it is working on
the server and you can see all the configuration by just viewing the
source.

I don't know why it won't work locally but a couple things I found on
the web suggest it is some type of security issue when dealing with
local files.
Mark

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



Re: An Appeal To Use the Latest Betas

2011-10-25 Thread Mark
I am running into a problem getting the betas using maven and nexus.
My setup is that everything points to my instance of nexus and it in
turn points to all the other repositories.  I have setup a Release
proxy and a Snapshot proxy both pointing to:

https://repository.apache.org/content/groups/staging/

For some reason the betas are not showing up in either repository.
They are showing up when I browse the remote from within my instance
of nexus, but when I click over to browse the index they aren't there.
It is almost as if the betas are getting put in the right directory,
but the index is not being updated.  Another theory is that these
betas are being marked as a SNAPSHOT so they don't show up in the
Release index, but aren't following the Snapshot naming convention so
they don't show up there either.

Has anyone run into any similar issues or have any suggestion?

Mark

On Thu, Oct 13, 2011 at 6:16 PM, Howard Lewis Ship  wrote:
> If you've been following the discussions here and elsewhere, you may
> be aware that Tapestry 5.3 is nearly done, with big improvements to
> every aspect of Tapestry, including speed and memory utilization. Our
> goal is to deliver an upgrade that is as seamless as possible.
>
> The PMC would dearly like to get a final release out and available
> before December (that is, within one year of the release 5.2).
>
> However, we can't do it without YOU:  We need people actively using
> Tapestry to upgrade to the latest betas (5.3-beta-20 is the latest,
> but we're releasing new updates almost every day). We are looking for
> broken features or problems upgrading ... all the things that will get
> in the way of a release candidate and then a final release.
>
> Your feedback is essential ... without are community, we don't know
> for sure that Tapestry is ready to go to the next stage.  Please
> budget some time, as soon as possible, to run you application under
> 5.3 and report back here about any problems you find. Without accurate
> (and hopefully, positive) feedback, we will not be able to progress to
> a final release ... and that means we'll be delayed adding the next
> layer of amazing features in Tapestry 5.4!
>
> Please see these notes on how to make use of the latest beta preview releases:
>
> http://tapestry.apache.org/2011/08/27/tapestry-53-beta-preview.html
>
> http://tapestryjava.blogspot.com/2011/10/tapestry-53-maven-archetype.html
>
> I've been posing on twitter each time a new preview is made available:
>
> http://twitter.com/#!/search/%23tapestry5
>
> ... and note that by the time you do you upgreade, the exact version
> number may have changed (don't worry, beta-20 will still be available
> when beta-21 is made available).
>
> Your support is deeply appreciated ... now get back to coding less and
> delivering more!
>
> --
> 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: Bootstrap

2011-10-23 Thread Mark
On Wed, Oct 12, 2011 at 4:15 PM, Denis Stepanov
 wrote:
> how many of you know Bootstrap http://twitter.github.com/bootstrap/, a css 
> toolkit designed to kickstart development of webapps and sites from Twitter?
>
> I just had an idea that Tapestry could use bootstap as defaul css stylesheet. 
> It would be pretty impressive to have default components and examples have 
> such goodlookin styles. Forms, Grid, Pagination, Alerts, Buttons prettymuch 
> every component that Tapestry has.

I have played around with this a little bit and Bootstrap really looks
nice. It also has some nicely styled alerts, popovers, modal boxes,
etc. that require JQuery. If the default styling was shifted to
Bootstrap, would it make sense to switch Tapestry's built in
components to JQuery from Prototype?

Mark

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



Re: Where to store site settings?

2011-10-03 Thread Mark
On Wed, Sep 28, 2011 at 11:47 AM, Tim  wrote:

> Can someone please tell me the best way to store site settings in a
> Tapestry application?
>
>
You can set a context parameter in web.xml like this:


 registration.properties-file
 misc/registration.properties

(I'm not sure, but putting things in app.properties may do the exact same
thing, but without the XML.)

I use Apache Common's to handle the properties in situations where I want
the users to be able to update them from the webapp and the values to be
saved to the properties file. So what you see above is how I set the name of
the properties file in the first place.

Then I get the value in a service using a constructor like:

 public ConfigurationImpl(@Value("${registration.properties-file}") String
fileName)

For handling the differences between test and production, my master branch
sets the registration.properties at one location and my deployment branches
set it in a different location. Before deploying I always merge everything I
need from master to the deployment branch and deploy from there.

I'm not saying that is the best way to handle it, but that is what I'm doing
for one of my applications and it seems to be working well. In particular,
it makes it easy for me to wipe out my database during testing without
losing all the configuration data.

Mark


Re: Genesis-how to start with Tapestry?

2011-10-03 Thread Mark
Many people still use Maven and the Maven Archetype to start a project.
 Here is a video that shows some of how to get started once you have Eclipse
and M2Eclipse installed:

http://blog.markwshead.com/900/tapestry-5-10-minute-demo/

Also see the tutorial starting here:

http://tapestry.apache.org/tapestry-tutorial.html

Hope that helps.

Mark

On Sun, Oct 2, 2011 at 9:37 AM, SeleniuM  wrote:

> Hi, there.
> Few days ago, my friend got to know me with Tapestry5 framework. I was so
> delighted that I wanted to learn it by myself. Even though his level of
> Tapestry knowledge is so high, I didn't want to disgrace myself by telling
> him that I am stuck even on setting up Tap5 app. My issue is following. I
> have downloaded Eclipse EE, Gradle and Tap5.3., but that's all I have done
> so far. I wanted to check if there is some tutorial about how to link all
> this, but on official Tapestry page there was nothing about it. Only some
> Mave or something like that. So what I wanted to ask you was could you
> please give me instructions how to set up Tap5.3. and enforce the samples
> in
> directories Tap5.3. using Gradle and Eclipse. Would be so thankful if you
> do
> so.  Thanks in advance.
>
> --
> View this message in context:
> http://tapestry.1045711.n5.nabble.com/Genesis-how-to-start-with-Tapestry-tp4861995p4861995.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: OT: Strange Loop Conference in St. Louis

2011-09-12 Thread Mark
That would work for me.

Mark

On Mon, Sep 12, 2011 at 5:52 PM, Robert Zeigler
 wrote:
> Hm. So what works for you?
>
> I might be able to do Monday night, after about 9:00 pm.
>
> Robert
>
> On Sep 12, 2011, at 9/125:33 PM , Howard Lewis Ship wrote:
>
>> I think I'm going to a baseball game that night ...
>>
>> On Mon, Sep 12, 2011 at 3:25 PM, Robert Zeigler
>>  wrote:
>>> I could do Tuesday night?
>>>
>>> Robert
>>>
>>> On Sep 12, 2011, at 9/123:12 PM , Howard Lewis Ship wrote:
>>>
>>>> Terrific ... I fly in late Saturday night and fly out Wednesday morning.
>>>>
>>>> On Mon, Sep 12, 2011 at 12:18 PM, Robert Zeigler
>>>>  wrote:
>>>>> I will be unable to attend the conference due to time constraints, but I 
>>>>> live in St. Louis; it would be fun to meet other Tapestry users/devs.
>>>>>
>>>>> Robert
>>>>>
>>>>> On Sep 12, 2011, at 9/122:03 PM , Mark wrote:
>>>>>
>>>>>> The Strange Loop Conference in St. Louis is later this month. I'm
>>>>>> going and I see that Howard is doing a session. Is anyone else from
>>>>>> the Tapestry community going to be there?
>>>>>>
>>>>>> Mark
>>>>>>
>>>>>> -
>>>>>> 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
>>>>
>>>
>>>
>>> -
>>> 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
>>
>
>
> -
> 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



OT: Strange Loop Conference in St. Louis

2011-09-12 Thread Mark
The Strange Loop Conference in St. Louis is later this month. I'm
going and I see that Howard is doing a session. Is anyone else from
the Tapestry community going to be there?

Mark

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



Re: How to use ContextResourceSymbolProvider

2011-07-21 Thread Mark
On Thu, Jul 21, 2011 at 10:27 AM, Erik Fäßler  wrote:
> Goal: Being able to configure my WebApp from
> file rather than being forced to edit the code every time I change
> deployment (from test to productive for instance;

You probably already know this, but you can set these from web.xml
with something like this:

 
 tapestry.production-mode
 false
     

Mark

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



Re: 100% CPU load after hot deploy of Tapestry 5 Application on Tomcat 6

2011-07-20 Thread Mark
I've run into a few problems when using maven/cargo to deploy, but
they appear to be issues with simply running out of memory as the
deployment process seems to use a lot of memory relative to my app. In
a few cases this ended up pegging the processor, but normally it would
just lock up Tomcat.

Mark

On Wed, Jul 20, 2011 at 4:16 AM,   wrote:
> Hi All,
>
> This is a tricky question one since I do realize there are several 
> possibilities to explain the problem, not all of which are Tapestry related. 
> We have battled to understand what is going on in production for the past 
> year or so, and have tried to pinpoint where the problem lies and come up 
> short. If anyone has experienced anything similar *please share.
>
> Our environment is:
>
> Ubuntu Server
> Tapestry 5.1
> JDK 6
> Tomcat 6
> Apache in front (reverse proxy)
>
> We are deploying our Tapestry apps to Tomcat 6, and they do run great even 
> with load, and it remains very stable as the session count increases; this is 
> when a server restart is done after a deployment.
>
> The problem appears to be specific to 'Tapestry applications' and hot 
> deployment. We run several apps, both small and large and they all react the 
> same way... If we stop then undeploy any of these Tapestry apps, and 
> afterwards do a hot deploy with a newer version (without the restart), the 
> CPU usage shoots to 100% and stays there. JSP based apps pure Servlets don't 
> appear to react in the same way.
>
> Has anybody experienced something similar?
>
> Kind regards,
> Peter
>
>
>
>
>
>
>
>
> -
> 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: PageActivationContext Coercion Exceptions

2011-07-18 Thread Mark
Thanks, Kalle.  I'll check that out.

I also found that you can intercept the exceptions which I had
overlooked in the docs:
http://tapestry.apache.org/component-events.html

Mark

On Sun, Jul 17, 2011 at 10:49 PM, Kalle Korhonen
 wrote:
> I haven't tried, but using tapestry-exceptionpage
> (http://tynamo.org/tapestry-exceptionpage+guide) you should be able to
> map UnknownValueException to your 404 page.
>
> Kalle
>
>
> On Sun, Jul 17, 2011 at 8:13 PM, Mark  wrote:
>> I have an app with several pages like:
>>
>> www.app.com/itemInfo/1
>>
>> where 1 is the page activation context and gets coerced into the
>> object using Tapestry-Hibernate.  This works great, but... the graphic
>> designer accidentally added a link into the header without the http. I
>> fixed it, but not before Google indexed the site. Now the GoogleBot
>> keeps calling urls like:
>>
>> www.app.com/itemInfo/www.example.com
>>
>> Obviously www.example.com can't be turned into a Long and then into
>> the object so it gives an exception.
>>
>> Is there an easy way to globally say, "if type coercion fails, just
>> return a 404?"  If not is there a way to catch the exception?
>>
>> Mark
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

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



PageActivationContext Coercion Exceptions

2011-07-17 Thread Mark
I have an app with several pages like:

www.app.com/itemInfo/1

where 1 is the page activation context and gets coerced into the
object using Tapestry-Hibernate.  This works great, but... the graphic
designer accidentally added a link into the header without the http. I
fixed it, but not before Google indexed the site. Now the GoogleBot
keeps calling urls like:

www.app.com/itemInfo/www.example.com

Obviously www.example.com can't be turned into a Long and then into
the object so it gives an exception.

Is there an easy way to globally say, "if type coercion fails, just
return a 404?"  If not is there a way to catch the exception?

Mark

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



Re: Free J2ee hosting

2011-07-15 Thread Mark Shead
Is that to keep sessions synced across multiple load balanced instances? It
wouldn't be useful on a free single instance anyway.

Mark
On Jul 15, 2011 5:30 PM, "Paul Stanton"  wrote:


Re: Tapestry Hibernate / hibernate3-maven-plugin

2011-07-15 Thread Mark
I'm not sure if this helps, but you should be able to generate the ddl
without using the maven plugin.  So if tapestry-hibernate can talk to
the db, it should be able to create the schema.

You'll need something like:
create

or

update

in hibernate.cfg.xml

Mark

On Fri, Jul 15, 2011 at 11:31 AM, George Christman
 wrote:
> Hello, I'm not really sure if this belongs in this mailing list, but
> hopefully someone will be able to help. I'm sitting behind a firewall and
> trying to generate a ddl using hibernate3-maven-plugin. For some reason it
> tries to connect to hibernate without using proxy settings and fails. Does
> anybody happen to know how to get around this issue? Sorry if I'm posting
> this in the wrong spot.
>
> --
> View this message in context: 
> http://tapestry.1045711.n5.nabble.com/Tapestry-Hibernate-hibernate3-maven-plugin-tp4591336p4591336.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

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



Re: ajaxformloop: syncValue is never called for added rows on form submit

2011-07-14 Thread Mark
On Thu, Jul 14, 2011 at 11:06 AM, Ray Nicholus  wrote:
> I don't see how this is not a Tapestry issue.  My code is pretty simple.
>  Neither ajaxformloop nor loop sync values, for rows added after the form
> has rendered, back to the server.  All rows created during execution of the
> loop are synced.  I'm using tapestry 5.2.6.

It seems to work for other people and you have a link to a running
example where it is working, so it seems unlikely that it is a problem
with Tapestry unless I've completely misunderstood what you are
asking.

Look at this:
http://jumpstart.doublenegative.com.au/jumpstart/examples/tables/ajaxformloop1

Is that pretty much what you are doing?

Mark

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



Re: ajaxformloop: syncValue is never called for added rows on form submit

2011-07-14 Thread Mark
On Thu, Jul 14, 2011 at 8:16 AM, Ray Nicholus  wrote:
> It turns out that my encoder is not the problem.  In fact, this appears to
> be an issue with Tapestry.  I was not using the id from Hibernate and I
> verified beforehand that my encoder was properly coded.  I had a couple
> other people look into this as well, and it appears that Tapestry is not
> able to sync values to the server for form elements added via ajax (after
> the render cycle has completed) unless the page is reloaded.

I'd be pretty surprised if this is the general case.  I know this is
being used a lot in different places.  I think you can even find
examples of it in the Jumpstart tutorials:

http://jumpstart.doublenegative.com.au/jumpstart/examples/tables/ajaxformloop1

Mark

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



Re: Exception invoking function Tapestry.Initializer.validate

2011-07-14 Thread Mark
Hm.  It looks like my problem runs a bit deeper.  I added Taha's
tapestry.js to 5.2.6, but I'm still getting the same errors in my app.

Any other suggestions?

Mark

On Thu, Jul 14, 2011 at 8:54 AM, Kalle Korhonen
 wrote:
> Is there an issue open for this? Seems this could be applied with
> little side effects.
>
> Kalle
>
>
> On Thu, Jul 14, 2011 at 6:43 AM, Taha Hafeez  wrote:
>> tapestry.js got blocked sending as txt
>>
>> On Thu, Jul 14, 2011 at 7:10 PM, Taha Hafeez  
>> wrote:
>>> Hi Mark
>>>
>>> I have done a lot of work on this and even informed the mailing list
>>> about it but I don't think anybody in tapestry is using ie :)
>>>
>>> Anyways, there are a number of statements causing 'Object not found'
>>> errors in ie. You can try the attached tapestry.js. It does the trick
>>> for me.
>>>
>>> regards
>>> Taha
>>>
>>>
>>> On Thu, Jul 14, 2011 at 7:04 PM, Mark  wrote:
>>>> I'm getting an error in red at the top of my page saying:
>>>>
>>>> Exception invoking function Tapestry.Initializer.validate with
>>>> parameters [{ "firstNameOnCard
>>>>
>>>> on a page that has some fields with validation when people are using
>>>> IE 6.  I haven't had a chance to test it with other versions of IE
>>>> yet. It seems to work fine on other browsers.
>>>>
>>>> I'm getting this on Tapestry 5.2.5 and 5.2.6.
>>>>
>>>> Any suggestions? (Other than just not supporting IE) :)  Is there a
>>>> way to turn off client side js validation for a specific browser--or
>>>> just not show this particular error?
>>>>
>>>> Mark
>>>>
>>>> -
>>>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>>>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>>>
>>>>
>>>
>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

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



Exception invoking function Tapestry.Initializer.validate

2011-07-14 Thread Mark
I'm getting an error in red at the top of my page saying:

Exception invoking function Tapestry.Initializer.validate with
parameters [{ "firstNameOnCard

on a page that has some fields with validation when people are using
IE 6.  I haven't had a chance to test it with other versions of IE
yet. It seems to work fine on other browsers.

I'm getting this on Tapestry 5.2.5 and 5.2.6.

Any suggestions? (Other than just not supporting IE) :)  Is there a
way to turn off client side js validation for a specific browser--or
just not show this particular error?

Mark

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



Re: Free J2ee hosting

2011-07-13 Thread Mark
Well if for some reason it doesn't work out with them, I'm happy to host it.
I'd love to donate some cycles toward getting your examples more exposure.

Mark
On Jul 13, 2011 9:35 PM, "Taha Hafeez"  wrote:


Re: ajaxformloop: syncValue is never called for added rows on form submit

2011-07-13 Thread Mark
How is your encoder identifying the objects?  Is it using the id from
Hibernate (or whatever you are using)?  If so, the value is id is
going to be 0 so the encoder isn't going to be able to figure out
which value to retrieve. This would explain why it works for objects
that are in the db (and have an id), but not for objects outside the
db.

Also, make sure that the values are actually being persisted on the
page.  For example, if you are dealing with "people" objects and you
add a few in Ajax, you need to make sure that these (non-persistent)
objects are somehow stored in a list that is going to still be there
when you want to do something with them again.

Mark

On Wed, Jul 13, 2011 at 11:59 AM, Ray Nicholus  wrote:
> Anyone?  I'm returning a new unpersisted entity from my addrow listener,
> modifying it in the UI, then clicking submit.  Ajaxformloop never attempts
> to update the values server-side for this new row.
>
> On Tue, Jul 12, 2011 at 7:27 PM, Ray Nicholus  wrote:
>
>> Note that I am using a custom value encoder.  When I click submit, the
>> values in the rows that were rendered during form load are synced, resulting
>> in calls to getValue of my value encoder, but this does not happen for rows
>> added via the addrow event.
>

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



Re: Tapestry Tools on OS X?

2011-07-13 Thread Mark
I'll keep fiddling with it to see if I can get it to work.  Is it a
problem that I have the Dynamic Web Module at version 3.0 instead of
2.5 as is shown in the instructions?  It won't let me use Tapestry if
I use 2.5 for some reason.

Mark

2011/7/13 Gavin Lei :
> Sorry that i do not have a Mac to test it, but according to Igor's
> description, it works well in Mac OS.
>
> To Igor,
> Please help us to confirm this point. Is it really work well in Mac OS
> ? If there is something wrong, please add a issue in the project web
> site, if not, i do not know where the problem is
>
> 2011/7/14 Mark :
>> I'm pretty sure that is what I did. I get a palette--just no Tapestry
>> components.
>>
>> Mark
>>
>> 2011/7/12 Gavin Lei :
>>> Yeah, do not forget to open Eclipse *Palette* view :-)
>>>
>>> 2011/7/13 Igor Drobiazko :
>>>> Works for me. You need to open it with the WTP Web Page Editor.
>>
>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>
>
>
> --
> -
> Best Regards
> Gavin Lei (雷银)
> Email: gavingui2...@gmail.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: Free J2ee hosting

2011-07-13 Thread Mark
I'm not sure if it does everything you need, but check into
www.cloudbees.com.  On the free accounts they will suspend the app
after a certain period, but it only takes a few seconds to come back
up.  Cloudbees deployment process is very nice.  They have a maven
plugin that uploads just the diff of the war (or something like that).
 Deployment is very fast even if you are on a slow connection.

If that doesn't look like it will work, lets talk about what you need.
If I can provide what you need, I'd be happy to setup a virtual server
for you to use on a VMWare servers.

Mark

On Wed, Jul 13, 2011 at 8:54 PM, Taha Hafeez  wrote:
> Hi
>
> I was thinking of hosting working demos of Java Magic and examples
> that shared on the mailing list. Is there any free hosting available
> for such open source projects. The ones I found require a restart
> after every 4 hours which is not feasible for me.
>
> regards
> Taha
>
> -
> 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: updating a zone inside of an ajaxformloop

2011-07-13 Thread Mark
Ray,

I think the ValueEncoder is doing what you are looking for in George's
example.  When the loop is rendered the encoder helps figure out a
unique id to encode into the form so that when you make a change an
trigger the zone update, that id is handed back to the encoder and it
sets purchaseRequest back to the value it was when the form originally
rendered that iteration of the loop.

So to answer your question, no.  The purchaseRequest isn't set to the
last instance it encountered--it gets reset to whatever it was at that
particular point in time.

Does that help?

Mark

On Tue, Jul 12, 2011 at 2:24 PM, Ray Nicholus  wrote:
> When the select in your loopZone reloads after the zone update, it uses
> purchaseRequest to determine it's value.  However, after the loop has
> already executed, purchaseRequest, which you persist, points to the last
> purchaseRequest instant enountered by the ajaxformloop.  Correct?
>
> On Tue, Jul 12, 2011 at 2:14 PM, George Christman
> wrote:
>
>> I might not be understanding your question completely, so please correct me
>> if I'm misunderstanding you. The sample code I posted enables you to only
>> update the zone within the row of the select menu triggering it.  If you
>> select an option in the first select menu / first row, it will only update
>> the zone in the first row and not the last row.
>>
>> --
>> View this message in context:
>> http://tapestry.1045711.n5.nabble.com/updating-a-zone-inside-of-an-ajaxformloop-tp4575519p4579967.html
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>>
>

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



Re: Unit testing Tapestry within intellij?

2011-07-13 Thread Mark
Do you actually have a page in com.cheetah.web.pages that is called
CreateJobPosting that you can view in a web browser when the app is
running?

Mark


On Tue, Jul 12, 2011 at 12:11 PM, Julien Martin  wrote:

> *public class CreateJobPosting{
>
>    @Test
>    public void test1() {
>        String appPackage = "com.cheetah.web";
>        String appName = "app";
>        PageTester tester = new PageTester(appPackage, appName,
> "src/main/webapp");
>        Document doc = tester.renderPage("CreateJobPosting");
>    }
> }
> *
>

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



Re: Tapestry Tools on OS X?

2011-07-13 Thread Mark
I'm pretty sure that is what I did. I get a palette--just no Tapestry
components.

Mark

2011/7/12 Gavin Lei :
> Yeah, do not forget to open Eclipse *Palette* view :-)
>
> 2011/7/13 Igor Drobiazko :
>> Works for me. You need to open it with the WTP Web Page Editor.


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

Tapestry Tools on OS X?

2011-07-12 Thread Mark
Has anyone installed http://code.google.com/p/tapestrytools/ on OS X?
I tried it last night, but couldn't get the tapestry component palette
to work.  Just curious it is a problem with my system or if everyone
on OS X has the same problem.

Mark

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



Select In A Loop

2011-07-10 Thread Mark
I have a page that allows users to specify a quantity of tickets from
a number of different ticket classes.  So it looks something like
this:

Standard Tickets  [ qty ]
Premium Ticket [ qty ]

When the user types in a qty, select components appear for any options
on the tickets.  So:

Standard Tickets  [ 3 ]
 1.  Seating: [Window]
 2.  Seating: [Aisle]
 3.  Seating: [Window]
Premium Ticket [ 2 ]
 1.  Seating: [Aisle]
 2.  Seating: [Window]

When the user changes a seating option, say from Window to Aisle,
zoneUpdater handles updating the ticket object on the server.  This
works fine because I pass a context telling it which ticket class is
being updated and the index of the ticket (Tickets aren't stored in
the DB until the form is submitted).

However, when I go to submit the form, each submit component tries to
call setTicketOptionOnTicket(TicketOption to).  This obviously doesn't
work because the page doesn't know which ticket needs to be updated.
There doesn't seem to be anyway for me to identify which Ticket needs
updated with the given TicketOption.

I can get around this by setting setTicketOptionOnTicket(TicketOption
to) to do nothing--the ticket options have already been set by Ajax by
the time we submit.  But if Javascript is not present, is there anyway
to tell which select component is being updated without a context?  Is
there a way to tell Tapestry "When you get ready to call
setTicketOptionOnTicket(TicketOption to), make sure you put these
values back to what they were when getTicketOptionOnTicket() was
originally called."?

Thanks for any suggestions.

Mark

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



Re: Loop Behaviour on Null or Empty List

2011-07-08 Thread Mark
Argh I can't believe I did that.  Thank you! :)

On Fri, Jul 8, 2011 at 6:17 PM, Josh Canfield  wrote:
> Looks like a typo.
>
>> 
> This should be
>  ^^
>
> You need the namespace to tell tapestry you want it to be a component.
>
> Josh
>
> On Fri, Jul 8, 2011 at 4:04 PM, Mark  wrote:
>> 
>>        ${person.name}
>> 
>>
>>
>> If department.people is null or contains a collection with zero items,
>> I would expect ${person.name} to never be evaluated.  However, I'm
>> getting an error saying that person is null within the express
>> person.name.
>>
>> Are there any conditions that will cause the interior of the loop to
>> be evaluated even if there are no items in the collection?
>>
>> Mark
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

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



Re: Loop Behaviour on Null or Empty List

2011-07-08 Thread Mark
Hm.  This seems to fix it:


${person.name}


Is this a bug or should we expect different behavior with:


   ${person.name}


On Fri, Jul 8, 2011 at 6:04 PM, Mark  wrote:
> 
>        ${person.name}
> 
>
>
> If department.people is null or contains a collection with zero items,
> I would expect ${person.name} to never be evaluated.  However, I'm
> getting an error saying that person is null within the express
> person.name.
>
> Are there any conditions that will cause the interior of the loop to
> be evaluated even if there are no items in the collection?
>
> Mark
>

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



Loop Behaviour on Null or Empty List

2011-07-08 Thread Mark

${person.name}



If department.people is null or contains a collection with zero items,
I would expect ${person.name} to never be evaluated.  However, I'm
getting an error saying that person is null within the express
person.name.

Are there any conditions that will cause the interior of the loop to
be evaluated even if there are no items in the collection?

Mark

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



Re: Constructing a block in java

2011-07-07 Thread Mark
>
>> I was thinking that there should be a way to do it with just a string,
>> but I guess that won't work because a string will try to send the
>> browser to a new page instead of just updating the part that needs to
>> be updated.
>
> Just implement a StringRenderCommand. :)


Perhaps I misunderstood.  I can't seem to find an interface or class
called a StringRenderCommand in the JavaDocs anywhere.  Am I looking
in the wrong place?

Mark

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



Re: Constructing a block in java

2011-07-07 Thread Mark
On Thu, Jul 7, 2011 at 11:39 AM, Thiago H. de Paula Figueiredo
 wrote:
>> I was thinking that there should be a way to do it with just a string,
>> but I guess that won't work because a string will try to send the
>> browser to a new page instead of just updating the part that needs to
>> be updated.
>
> Just implement a StringRenderCommand. :)


I tried:

 return new StringRenderable("" + person.getName() + "");

But it gives me an error saying:

Ajax failure: Status 500 for
http://localhost:8080/register/register.moreinfo:showdialog/2?t:ac=1:
A component event handler method returned the value Renderable[$50
Ticket]. Return type
org.apache.tapestry5.internal.util.StringRenderable can not be
handled.

Mark

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



Re: Constructing a block in java

2011-07-07 Thread Mark
Josh,

Thats what I thought originally.  This is for a ModalDialog using
Taha's addon.  When someone clicks "more info" it pops up with a modal
dialog box and the contents are determined by this method.  If I
return a String, Tapestry tries to find a page that matches the String
and return that instead of just rendering it in the modal dialog box.

Mark



On Thu, Jul 7, 2011 at 11:43 AM, Josh Canfield  wrote:
> Have you tried returning a String? There is a built-in TypeCoercer for
> String -> Renderable
>
> This is implemented using StringRenderable which uses write(text) (not
> writeRaw) so your html will be escaped.
>
> Josh
>
> On Thu, Jul 7, 2011 at 9:35 AM, Mark  wrote:
>> On Thu, Jul 7, 2011 at 6:34 AM, Thiago H. de Paula Figueiredo
>>  wrote:
>>> On Thu, 07 Jul 2011 01:25:39 -0300, Mark  wrote:
>>>
>>>> Is there a better way to construct a block from a string in Java than
>>>> this?
>>>>
>>>>    Block onShowDialogFromMoreInfo(TicketClass ticketClass) {
>>>>        return  new RenderableAsBlock(new
>>>> StringRenderable(person.getInfo()));
>>>>    }
>>>
>>> Do you really need it to be a block? To pass it to Delegate? It doesn't need
>>> to be a block. It can also be a component or any object that implements
>>> RenderCommand. Why don't you just return a RenderCommand instance? Tapestry
>>> ultimately renders only RenderCommand's. Anything else which can be rendered
>>> implements RenderCommand (including BlockImpl) or converted to an instance
>>> of it.
>>
>> Ah ok.  So something along the lines of this?
>>
>>    Object onShowDialogFromMoreInfo(final Person person) {
>>        return new RenderCommand()
>>        {
>>            public void render(MarkupWriter writer, RenderQueue queue)
>>            {
>>                writer.writeRaw("" + person.getName() + "");
>>            }
>>        };
>>    }
>>
>> I was thinking that there should be a way to do it with just a string,
>> but I guess that won't work because a string will try to send the
>> browser to a new page instead of just updating the part that needs to
>> be updated.
>>
>> Mark
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

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



Re: Constructing a block in java

2011-07-07 Thread Mark
On Thu, Jul 7, 2011 at 6:34 AM, Thiago H. de Paula Figueiredo
 wrote:
> On Thu, 07 Jul 2011 01:25:39 -0300, Mark  wrote:
>
>> Is there a better way to construct a block from a string in Java than
>> this?
>>
>>    Block onShowDialogFromMoreInfo(TicketClass ticketClass) {
>>        return  new RenderableAsBlock(new
>> StringRenderable(person.getInfo()));
>>    }
>
> Do you really need it to be a block? To pass it to Delegate? It doesn't need
> to be a block. It can also be a component or any object that implements
> RenderCommand. Why don't you just return a RenderCommand instance? Tapestry
> ultimately renders only RenderCommand's. Anything else which can be rendered
> implements RenderCommand (including BlockImpl) or converted to an instance
> of it.

Ah ok.  So something along the lines of this?

Object onShowDialogFromMoreInfo(final Person person) {
return new RenderCommand()
{
public void render(MarkupWriter writer, RenderQueue queue)
{
writer.writeRaw("" + person.getName() + "");
}
};
}

I was thinking that there should be a way to do it with just a string,
but I guess that won't work because a string will try to send the
browser to a new page instead of just updating the part that needs to
be updated.

Mark

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



Constructing a block in java

2011-07-06 Thread Mark
Is there a better way to construct a block from a string in Java than this?

Block onShowDialogFromMoreInfo(TicketClass ticketClass) {
return  new RenderableAsBlock(new StringRenderable(person.getInfo()));
}

Mark

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



Re: t5: https and two T5 apps

2011-07-05 Thread Mark
Can't  you just deploy the first one to the root and the second one to
the /order context?  I think you'll have to setup the same SSL cert
twice--once for each app, but you should be able to use the same cert.

Mark

On Tue, Jul 5, 2011 at 9:01 PM, Angelo C.  wrote:
> Hi,
>
> I got two T5 applications, the first one:
>
> https://www.safe.sample.com:8443
>
> Now I need to add a new one, and I need to share the same ssl certificate as
> the first one, so I need to use following url:
>
> https://www.safe.sample.com:8443/order
>
> can't figure out how to do this, suggestions?
>
> Thanks,
>
> Angelo
>
> --
> View this message in context: 
> http://tapestry.1045711.n5.nabble.com/t5-https-and-two-T5-apps-tp4555456p4555456.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

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



How to get client side Ajax values into a page event

2011-07-03 Thread Mark
I am trying to integrate an image cropper with Tapestry.  Users can
select the portion of the image they want to keep and then click to
crop it--same idea as Facebook, Google Profiles, etc let you crop your
portrait when you upload it.  I'm using this:
http://www.defusion.org.uk/code/javascript-image-cropper-ui-using-prototype-scriptaculous/

My question is how do I get the variables on the client side into my
component when the user clicks submit.  In other words, when the user
selects a portion to crop they will be setting some client side
variables like:
x, y, height, width

I'd like to have a method like:
void onAction(int x, int y, int height, int width) {
   // crop the picture
}

Any suggestions or link to documentation I've overlooked would be most
appreciated.

Mark

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



Re: Cropper Module

2011-07-03 Thread Mark
Thanks for your reply.  Sorry I wasn't more specific.  I meant to
handle the user interaction for selecting the portion of an image to
crop.  So a module that makes it easy to integrate something like
this:
http://www.defusion.org.uk/code/javascript-image-cropper-ui-using-prototype-scriptaculous/

Mark

On Sun, Jul 3, 2011 at 8:28 PM, Kalle Korhonen
 wrote:
> You don't need a Tapestry module to crop images:
> BufferedImage cropped = bufferedImage.getSubimage(left, top, width, height);
>
> Kalle
>
>
> On Sun, Jul 3, 2011 at 5:09 PM, Mark  wrote:
>> Is there a Tapestry Module (or some example code) floating around
>> anywhere that allows cropping photos?
>>
>> Mark
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

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



Cropper Module

2011-07-03 Thread Mark
Is there a Tapestry Module (or some example code) floating around
anywhere that allows cropping photos?

Mark

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



Re: Palette inside a beaneditor

2011-07-01 Thread Mark
> Please use the add parameter which adds fields not present in the default
> generated BeanModel.
>  

Ah ok. I see.  I knew to add this when I was trying to show something
that wasn't present in the object, but I didn't realize I needed to do
it for things that were present, but the beaneditor didn't know how to
display.  It makes perfect sense now, but I'm embarrassed at how much
time I spent trying to figure it out. :)

Thank you!

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



Palette inside a beaneditor

2011-07-01 Thread Mark
I have a beaneditor inside an Ajax loop that is inside a form.  One of
the attributes needs to be a palette.  When I try to simply add it as
a parameter, it doesn't show up.  It looks like it would work if I
skip using the beaneditor and just add all the fields manually. Is
there a reason this doesn't seem to work or am I overlooking something
silly?

Also is there a way for me to tell Tapestry to use the Palette
automatically whenever it tries to render this particular attribute
inside of a beaneditor or beaneditorform?

Thanks for any suggestions.

Mark










remove ticket class

Add a ticket class



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



Optimal Page to List Edit and Create

2011-06-30 Thread Mark
I commonly create pages with a bean edit form followed by a list of
items each with an edit and delete link. Visiting the page will give
you a new object that you can save and clicking on the edit link for
any object in the list will load it so it can be edited and saved.
Below is an example of how I usually do this.

I was just curious if there is a better way to get the same
functionality. I'm guessing there isn't, but with Tapestry I'm amazed
at how many times there are even better ways to do things that I never
think to ask about.

Mark


public class ManageDiscounts {

@Inject
private Session session;

@Property
@PageActivationContext
private DiscountDefinition discountDefinition;


/*  Save or update. Set discountDefinition to null
 *  so a new item can be entered.  This will return a
 *  blank page activation context and the bean edit form
 *  will handle creating a new object when the page loads.
 */
@CommitAfter
void onSuccess() {
session.saveOrUpdate(discountDefinition);
discountDefinition = null;
}


/*  Get a list of all the DiscountDefinitions to show to the user.
 */
public List getDiscountDefinitions() {
return session.createCriteria(DiscountDefinition.class).list();
}

/*  Handle the edit event when someone clicks on an item in the list.
 *  The selected discountDefinition will be set to the page context and
 *  the page will reload with it's id as the page activation context in
 *  the url.
 */
public void onEdit(DiscountDefinition discountDefinition) {
this.discountDefinition = discountDefinition;
}

@CommitAfter
public void onDelete(DiscountDefinition discountDefinition) {
session.delete(discountDefinition);
}
}

Template:





${discountDefinition.name} -
Edit -
Delete



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



Re: Java Magic has 10000+ hits

2011-06-28 Thread Mark
If I remember correctly, Wordpress.com uses javascript to count views,
so it won't count things when someone's RSS reader just checks for an
updated feed.

Mark

On Tue, Jun 28, 2011 at 6:07 PM, Taha Tapestry  wrote:
> Then may be all of these hits are really rss feeds and wordpress is keeping 
> me happy :(
>
> But it is great to know that you guys read my blog.
>
> Regards
> Taha
>
> On Jun 28, 2011, at 10:25 PM, Guerin Laurent  wrote:
>
>> Me too :-)
>>
>> Envoyé de mon iPhone
>>
>> Le 28 juin 2011 à 18:37, "Andreas Andreou"  a écrit :
>>
>>> wp stats must be wrong - i'm defitively the other one!
>>>
>>> On Tue, Jun 28, 2011 at 19:34, Inge Solvoll  wrote:
>>>> I'm the other one. Nice to meet you :)
>>>>
>>>> On Tuesday, June 28, 2011, dragan.sahpas...@gmail.com
>>>>  wrote:
>>>>> I have you on my rss reader.
>>>>> I'm I the only one?
>>>>>
>>>>> Cheers,
>>>>> Dragan Sahpaski
>>>>>
>>>>>
>>>>>
>>>>> On Tue, Jun 28, 2011 at 9:20 AM, Taha Hafeez 
>>>>> wrote:
>>>>>
>>>>>> Thank God I have only 1 :)
>>>>>>
>>>>>>
>>>>>> On Tue, Jun 28, 2011 at 12:47 PM, Chris Collins  wrote:
>>>>>>
>>>>>>> Do you know what your uniques are, were those browser or rss reader
>>>>>>> requests?  If you had 133 people who added your rss to their rss reader,
>>>>>>> assuming it only fetched from your feed once a day that would be about
>>>>>> 130
>>>>>>> people :-{
>>>>>>>
>>>>>>> Best
>>>>>>>
>>>>>>> C
>>>>>>>
>>>>>>>
>>>>>>> On Jun 27, 2011, at 11:50 PM, Taha Hafeez wrote:
>>>>>>>
>>>>>>>> Hi
>>>>>>>>
>>>>>>>> More than 1 hits in two and a half months, not bad.
>>>>>>>>
>>>>>>>> regards
>>>>>>>> Taha
>>>>>>>
>>>>>>>
>>>>>>> -
>>>>>>> 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
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Andreas Andreou - andy...@apache.org - http://blog.andyhot.gr
>>> Apache Tapestry PMC / http://chesstu.be owner
>>> Open Source / JEE Consulting
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

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



Re: Tapestry 5.2: Reloading in Production Mode.

2011-06-28 Thread Mark
You can read some of the discussion leading up to this change here:
http://markmail.org/thread/kf7jgc6oesbnjbfu

As far as I'm aware there isn't a setting that will let you turn it
back on other than running with production mode turned off.  But I
might be wrong about that.

Mark

On Mon, Jun 27, 2011 at 2:15 AM, laloluke  wrote:
> Hello,
>
> The Release Notes 5.3 says that Reloading is disabled in production mode.
> Actually we are working in a dynamic JAR loading without restarting the
> server using one of the best features of Tapestry: Reloading. Obviously, we
> prefer Tapestry rather than OSGi.
>
> The Reloading is disabled in production mode or has been permanently
> removed? Is there any way to enable it? Would be nice that can enable or
> disable (default option) Reloading in production mode.
>
> Thank you very much in advance.
>
> --
> View this message in context: 
> http://tapestry.1045711.n5.nabble.com/Tapestry-5-2-Reloading-in-Production-Mode-tp4527295p4527295.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

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



Re: RE : Eclipse IDE and TML code completion

2011-06-09 Thread Mark
TapestryTools is currently being developed as part of GSOS. I don't think
the autocomplete has been implemented yet.

Mark
On Jun 8, 2011 11:34 AM,  wrote:
> Hi
>
> Finally, get it working according to
> http://wiki.apache.org/tapestry/Tapestry5JSPEditorEclipse . I don't
> know why, but
>
> http://tapestrytools.googlecode.com/svn/trunk/TapestryTools_UpdateSite/just 
> doesn't work for me. :(
>
> Thanks
> John
>
>
> 於 2011/6/9 0:10, onj888-tapes...@yahoo.com.hk 提到:
>> thanks Mark and Laurent,
>>
>> So, I used my previous download helios
>> eclipse-reporting-helios-SR1-win32.zip to make another trial, I use the
>> updatesite
>> http://tapestrytools.googlecode.com/svn/trunk/TapestryTools_UpdateSite/
>> to install the tools, change the content type to add *.tml in jsp. I
>> openned the quick-start index.tml with jsp editor, type > ok, but >
>> Thanks
>> John.
>>
>>
>> 於 2011/6/8 22:00, Guerin Laurent 提到:
>>> Mark is right, you have to use the JSP editor.
>>> So, i have tested with Eclipse Helios and it work for me.
>>>
>>> Laurent.
>>>
>>> -Message d'origine-
>>> De : Mark [mailto:mark-li...@xeric.net]
>>> Envoyé : mercredi 8 juin 2011 15:49
>>> À : Tapestry users; onj888-tapes...@yahoo.com.hk
>>> Objet : Re: RE : Eclipse IDE and TML code completion
>>>
>>> On Tue, Jun 7, 2011 at 12:04 AM,  wrote:
>>>> it doesn't response when I type >> Make sure you are using the right editor. I can't remember if it is the
xml editor or the jsp editor that you want, but the other editors won't
work.
>>>
>>> Mark
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>>
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>>
>>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>


Re: RE : Eclipse IDE and TML code completion

2011-06-08 Thread Mark
On Tue, Jun 7, 2011 at 12:04 AM,   wrote:
>it doesn't response when I type 

catching exception from hibernate String to Long

2011-06-06 Thread Mark
I have an app that previously displayed a list of information at a URL
like this:
/author/first_last

Now I am switching it to use an ID:

/author/25/1

Where 25 is the person id and 1 is the page of the list to display.

I'm using something like:

Object onActivate(Person person, int page) {

}

When people hit the old URL with something like:
/author/john_smith

It throws an exception.  I would prefer it show a 404 or even maybe do
a lookup and redirect them.

Is there a way to catch the exception when the String gets gets turned
into a long so I can do something other than showing the user an
exception page? Alternatively is there a way to over-ride onActivate
so I can do something like:

public Object onActivate(String str) {
if(person == null) {
return new HttpError(404, "Resource Not Found");
}
return null;
}

Or is there another solution that I'm overlooking.

--Mark

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



Pagination Component

2011-06-04 Thread Mark
Short version of my question:

What is the best way to setup things from the context in a component.
I tried using:

Object onActivate(EventContext context) {
// Do stuff with context
}

But onActivate doesn't seem to get called on a component on a page. Is
there a different method to get the context from within a component on
a page?



--



Longer version of what I'm trying to accomplish, just in case I'm
overlooking some built in functionality:

I have an app that needs to display paginated data for several
different pages.  So lets say we have pages named:

/tag
/author
/category

They may be called like this:

/tag/foo/1 (the first page of a list of items assigned tag foo)
/author/25/1 (list of items authored by author with id 25)
/category/15/1 (list of items assigned to category with id 15)

The first item in the context is the ID of the author, tag or category
and the second is the page to display.

My goal was to create a pagination component that could be used on any
of these pages.  So I was going to use onActivate on the page to get
the first context item (the id) and onActivate in the component to get
the second context (the page number).  The page would handle the db
lookup and simply pass a list of all possible items to the component.
So the page would be responsible for getting the right list of items,
but all the logic for what objects to display on a particular page
would be in the component.

The two problems I've run into:

1. I can't seem to get the EventContext from within the component as
onActivate doesn't appear to be called on the component.  I could get
it in the page and simply pass it to the component, but then I have
pagination code in the page which is  what I was trying to avoid.

2. The component still needs to know page it is on and has to grab the
first context item in order to render the links to the other pages
using a page link. What I want is something that says: "Give me a link
to the current page and let me just change the last context item to
build a new page link."

Thanks for any suggestions.

Mark

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



Re: 301 vs 302

2011-06-03 Thread Mark
Perfect.  Thank you.

On Fri, Jun 3, 2011 at 12:41 PM, Josh Canfield  wrote:
>> Is there a simple way to do something similar and get a 301 permanent
>> redirect? In particular, can I modify the PageRenderLinkWithContext to
>> control the type of redirect?
>
> Tapestry eventually calls ServletResponse.sendRedirect, which is
> always a 302. If you want to send a 301 you have to do it manually.
>
> Here's some code that works in the same way as HttpError.
>
> public class PermanentRedirect {
>    private Link link;
>
>    public PermanentRedirect(Link link) {
>        this.link = link;
>    }
>
>    public Link getLink() {
>        return link;
>    }
> }
>
> // in AppModule
>    public void contributeComponentEventResultProcessor(
>            final Response response,
>            MappedConfiguration
> configuration
>    ) {
>        configuration.add(PermanentRedirect.class, new
> ComponentEventResultProcessor() {
>            public void processResultValue(PermanentRedirect value)
> throws IOException {
>                response.setHeader("Location", 
> value.getLink().toAbsoluteURI());
>                // Send error commits the response
>                response.sendError(301, "Moved Permanently");
>            }
>        });
>    }
>
> Josh
>
> On Fri, Jun 3, 2011 at 9:13 AM, Mark  wrote:
>> A have an onActivate method like this:
>>
>>    Object onActivate(EventContext context) {
>>
>>        //we have what we need to render the page
>>        if(context.getCount() == 2)  {
>>            this.keyword = context.get(String.class,0);
>>            this.page = context.get(Integer.class, 1);
>>            quotes =  quoteService.getQuotesForKeyword(keyword);
>>            return null;
>>        }
>>
>>        //Missing a context, redirect to default context
>>        if(context.getCount() == 1)  {
>>            this.keyword = context.get(String.class, 0);
>>            return
>> pageRenderLinkSource.createPageRenderLinkWithContext("keyword",
>> keyword, 1);
>>        }
>>
>>        //Not context at all, do a 404.
>>        return new HttpError(404, "Resource Not Found");
>>    }
>>
>>
>> Returning a PageRenderLinkWithContext does a 302 temporary redirect.
>>  return pageRenderLinkSource.createPageRenderLinkWithContext("keyword",
>> keyword, 1);
>>
>> Is there a simple way to do something similar and get a 301 permanent
>> redirect? In particular, can I modify the PageRenderLinkWithContext to
>> control the type of redirect?
>>
>> Mark
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

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



301 vs 302

2011-06-03 Thread Mark
A have an onActivate method like this:

Object onActivate(EventContext context) {

//we have what we need to render the page
if(context.getCount() == 2)  {
this.keyword = context.get(String.class,0);
this.page = context.get(Integer.class, 1);
quotes =  quoteService.getQuotesForKeyword(keyword);
return null;
}

//Missing a context, redirect to default context
if(context.getCount() == 1)  {
this.keyword = context.get(String.class, 0);
return
pageRenderLinkSource.createPageRenderLinkWithContext("keyword",
keyword, 1);
}

//Not context at all, do a 404.
return new HttpError(404, "Resource Not Found");
}


Returning a PageRenderLinkWithContext does a 302 temporary redirect.
 return pageRenderLinkSource.createPageRenderLinkWithContext("keyword",
keyword, 1);

Is there a simple way to do something similar and get a 301 permanent
redirect? In particular, can I modify the PageRenderLinkWithContext to
control the type of redirect?

Mark

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



Re: Clean sheet security design suggestions?

2011-06-01 Thread Mark
Keep in mind that Tynamo's security package is Apache Shiro
(http://shiro.apache.org/) with additions that make it easy to work
with Tapestry. If you want something that isn't Tapestry specific,
take a look at Shiro by itself.

If you are wanting other Tapestry options, look at:
http://code.google.com/p/tapestry-addons/
http://www.localhost.nu/java/tapestry-spring-security/

There is also Spring Security:
http://static.springsource.org/spring-security/site/

Mark



On Wed, Jun 1, 2011 at 2:40 PM, Lenny Primak  wrote:
> Thanks guys I'll definitely look at tynamo security.
> There is a lot of homegrown code in our implementation that feels like it 
> should be a part of a framework that's already been written. I guess that 
> tynamo security is that framework.
>
> Anything else I should be l should be looking at in this space?  Perhaps not 
> necessarily tapestry related?
>
>
> On Jun 1, 2011, at 2:11 PM, "Thiago H. de Paula Figueiredo" 
>  wrote:
>
>> On Wed, 01 Jun 2011 14:33:47 -0300, Lenny Primak  
>> wrote:
>>
>>> My current project is to refresh a client's web site using tapestry. The 
>>> web site currently uses JSP.  We have a JEE/web service backend that uses 
>>> JPA/EJB3.1 which we will continue to use.
>>> We now have a JEE based authorization service API based on plain method 
>>> calls now.
>>> What we want is to keep the current login scheme and add LDAP and possibly 
>>> Facebook ID and openid.
>>
>> For using Facebook ID and OpenID, check 
>> http://tynamo.org/tynamo-federatedaccounts+guide. Beyond that, I can't see 
>> why using the existing API in Tapestry would be different from your existing 
>> code, besides that Tapestry templates don't allow code (scriptlets). I'd 
>> suggest you to build some components to encapsulate common scenarios 
>> (something like a IfUserHasPermission component), maybe a couple mixins, and 
>> using the ComponentRequestFilter and/or RequestFilter pipelines for 
>> cross-page logic.
>>
>> --
>> 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
>
>

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



Re: Hibernate-Search

2011-06-01 Thread Mark
Thanks!

On Wed, Jun 1, 2011 at 1:44 PM, Sven Homburg  wrote:
> thats my solution:
>
>        /**
>         * build the full text session.
>         *
>         * @param logger                 the system logger
>         * @param sessionManager hibernate session manager
>         *
>         * @return full text session
>         */
>        @Scope(ScopeConstants.PERTHREAD)
>        public FullTextSession buildFullTextSession(Logger logger,
> HibernateSessionManager sessionManager)
>        {
>                if (logger.isInfoEnabled())
>                        logger.info("initialize FullTextSession ...");
>
>                return Search.getFullTextSession(sessionManager.getSession());
>        }
>
>
> with regards
> Sven Homburg
> Founder of the Chenille Kit Project
> http://chenillekit.codehaus.org
>
>
>
>
>
> 2011/6/1 Mark :
>> I'm working on a project where I want to user Hibernate-Search (uses
>> lucene queries and analyzers for stemming, etc.).  However, it appears
>> that the session I'm getting from tapestry-hibernate is different
>> enough that I can't use it to create a FullTextSearch.
>>
>> https://issues.apache.org/jira/browse/TAP5-1178
>>
>> Seems to indicate there is a way to get this to work, but I can't seem
>> to find any examples anywhere. Does anyone have any code or advice on
>> getting hibernate-search to work well with tapestry-hibernate?
>>
>> Mark
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

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



Hibernate-Search

2011-06-01 Thread Mark
I'm working on a project where I want to user Hibernate-Search (uses
lucene queries and analyzers for stemming, etc.).  However, it appears
that the session I'm getting from tapestry-hibernate is different
enough that I can't use it to create a FullTextSearch.

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

Seems to indicate there is a way to get this to work, but I can't seem
to find any examples anywhere. Does anyone have any code or advice on
getting hibernate-search to work well with tapestry-hibernate?

Mark

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



Re: Clean sheet security design suggestions?

2011-06-01 Thread Mark
Definitely look at Tynamo's tapestry-security which uses Shiro and the
tynamo-federatedaccounts add on.  I believe you can have multiple
types of authentication simply by contributing different entity
realms. It has built in support for Facebook and OpenId is coming.

Mark

On Wed, Jun 1, 2011 at 12:33 PM, Lenny Primak  wrote:
> My current project is to refresh a client's web site using tapestry. The web 
> site currently uses JSP.  We have a JEE/web service backend that uses 
> JPA/EJB3.1 which we will continue to use.
>
> We now have a JEE based authorization service API based on plain method calls 
> now.
>
> What we want is to keep the current login scheme and add LDAP and possibly 
> Facebook ID and openid.
>
> Do you guys have any suggestions?
>
> Thanks.
>
>
>
> -
> 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: [Slightly OT] Jetty "manager"/deployer

2011-05-31 Thread Mark
The cargo plugin for tomcat makes it easy to redeploy from the command line.
I think it works with jetty to.
On May 31, 2011 9:35 AM, "Massimo Lusetti"  wrote:
> Hi all,
> I'm using Jetty all over the place and I'm fine with it but now I
> need to give others the possibility to deploy and redeploy at runtime
> an applications subset.
>
> Let's say I would love to have the "manager" gui from tomcat... any hints?
>
> Thanks
> --
> Massimo
> http://meridio.blogspot.com
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>


Re: Updating only specific divs in Zone update

2011-05-17 Thread Mark
You probably want to build a multizone update to update just the necessary
zones.  Here is a snippet of some of my code that updates zones only if they
are visible in that particular context:

   public MultiZoneUpdate getPriceMultiZoneUpdate() {

MultiZoneUpdate update = new MultiZoneUpdate("totalPriceZone",
totalPriceZone);

if(isSubtotalVisible()) {

update = update.add("subtotalZone", subtotalZone);

}



if(isDiscountVisible()) {

update = update.add("totalDiscountsZone", totalDiscountsZone);

}



if(isSalesTaxVisible()) {

update = update.add("totalSalesTaxZone", totalSalesTaxZone);

}



if(isFulfillmentFeeVisible()) {

update = update.add("totalFulfillmentFeeZone",
totalFulfillmentFeeZone);

}


return update;




}


Re: Query string

2011-04-27 Thread Mark
On Wed, Apr 27, 2011 at 2:29 PM, Mark  wrote:

> On Wed, Apr 27, 2011 at 1:30 PM, Tim Koop  wrote:
>
>> I have some third party code that calls one of my Tapestry pages, passing
>> in some values in the query string.  From in my Tapestry page (the Java
>> class), how can I retrieve this query string?
>>
>> Sorry here it is...

Lets say you have something like:

> http://localhost:8080/app/page?value1=testValue&value2=99

>
In the page class write:

>
@ActivationRequestParameter
private String value1

@ActivationRequestParameter
private int value2

If you are using Tapestry Hibernate and the value is the id, you can do
something like:
@ActivationRequestParameter
private MyObject myObject

Mark


Re: Query string

2011-04-27 Thread Mark
On Wed, Apr 27, 2011 at 1:30 PM, Tim Koop  wrote:

> I have some third party code that calls one of my Tapestry pages, passing
> in some values in the query string.  From in my Tapestry page (the Java
> class), how can I retrieve this query string?
>
>
Lets say you have something like:
http://localhost:8080/app/page?value1=testValue&value2=99

In the page class write:

@Request


Re: testng.xml and selenium

2011-04-25 Thread Mark
Thanks Alex. I've seen this issue and I'm assuming it will be fixed when
tapestry-test switches to the 2.0 version of Selenium. But if I should be
able to just switch to Google Chrome by changing the setting in testng.xml
I'd rather just do that so I'm not relying on a modified version of the
selenium jar.

Do you know if the line

in testng.xml switch it over to using Chrome instead of Firefox?

Mark

On Mon, Apr 25, 2011 at 12:05 PM, Alex Kotchnev  wrote:

> This is likely to be a problem w/ Selenium RC itself - I know that for
> a totally unrelated project I had to edit the files in selenium RC jar
> to make it support firefox 4.0 - http://www.qaautomation.net/?p=245
>
> Cheers,
>
> Alex K
>
> On Mon, Apr 25, 2011 at 12:59 PM, Mark  wrote:
> > I've tried it with 5.2.4, 5.2.5 and 5.3.0-SNAPSHOT.  It tries to use
> Firefox
> > 4 and hangs.
> > 
> > Doesn't seem to change anything and neither does:
> >
> > 
> >
> > Mark
> >
> > On Mon, Apr 25, 2011 at 11:47 AM, Howard Lewis Ship  >wrote:
> >
> >> What version of Tapestry?  This was in flux in 5.1 and 5.2.
> >>
> >> On Mon, Apr 25, 2011 at 9:45 AM, Mark  wrote:
> >> > Selenium in tapestry-test seems to have problems with Firefox 4 on OS
> X.
> >> > I'm trying to use Google chrome instead.
> >> >
> >> > The documentation seems to imply that we can set
> >> > tapestry.browser-start-command in the testng.xml file to use a
> different
> >> > browser for selenium tests. However, the testng.xml file below still
> >> > launches firefox.
> >> >
> >> > Am I missing something in how this should work?
> >> >
> >> > Mark
> >> >
> >> > src/test/conf/testng.xml:
> >> >
> >> > http://testng.org/testng-1.0.dtd";>
> >> > 
> >> >  
> >> >
> >> > >> value="*googlechrome"/>
> >> >
> >> >  
> >> >
> >> >
> >> >  
> >> >
> >> >  
> >> > 
> >> >
> >>
> >>
> >>
> >> --
> >> 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: testng.xml and selenium

2011-04-25 Thread Mark
I've tried it with 5.2.4, 5.2.5 and 5.3.0-SNAPSHOT.  It tries to use Firefox
4 and hangs.

Doesn't seem to change anything and neither does:



Mark

On Mon, Apr 25, 2011 at 11:47 AM, Howard Lewis Ship wrote:

> What version of Tapestry?  This was in flux in 5.1 and 5.2.
>
> On Mon, Apr 25, 2011 at 9:45 AM, Mark  wrote:
> > Selenium in tapestry-test seems to have problems with Firefox 4 on OS X.
> > I'm trying to use Google chrome instead.
> >
> > The documentation seems to imply that we can set
> > tapestry.browser-start-command in the testng.xml file to use a different
> > browser for selenium tests. However, the testng.xml file below still
> > launches firefox.
> >
> > Am I missing something in how this should work?
> >
> > Mark
> >
> > src/test/conf/testng.xml:
> >
> > http://testng.org/testng-1.0.dtd";>
> > 
> >  
> >
> > value="*googlechrome"/>
> >
> >  
> >
> >
> >  
> >
> >  
> > 
> >
>
>
>
> --
> 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
>
>


testng.xml and selenium

2011-04-25 Thread Mark
Selenium in tapestry-test seems to have problems with Firefox 4 on OS X.
I'm trying to use Google chrome instead.

The documentation seems to imply that we can set
tapestry.browser-start-command in the testng.xml file to use a different
browser for selenium tests. However, the testng.xml file below still
launches firefox.

Am I missing something in how this should work?

Mark

src/test/conf/testng.xml:

http://testng.org/testng-1.0.dtd";>

  



  


  

  



Re: Link to root

2011-04-24 Thread Mark
Thanks Brian and Taha.   I know I can build what I need by combining both of
your suggestions.  I wanted to make sure there wasn't a simple way to get
what I wanted without needing to build it manually, but it doesn't sound
like there is another way to get this directly from Tapestry.

Thanks for your help.

Mark

On Sun, Apr 24, 2011 at 8:15 PM, Taha Hafeez wrote:

> Try
>
> @Inject
> private RequestGlobals requestGlobals;
>
> requestGlobals.getHttpServletRequest().getContextPath()
>
> regards
> Taha
>
>
> On Mon, Apr 25, 2011 at 6:37 AM, Bryan Lewis 
> wrote:
>
> > One way to do it:
> >
> >
> >@Inject private Request request;
> >
> >...
> >int port = request.getServerPort();
> >    String serverName = request.getServerName();
> >
> >
> >
> > On Sun, Apr 24, 2011 at 7:28 PM, Mark  wrote:
> >
> > > What is the best way to get the url of the root of a web application?
> In
> > > other words, If I'm on a page like:
> > > http://server:8080/appname/mypage?showAll=true
> > >
> > > I want to get:
> > > http://server:8080/appname
> > >
> > > I tried using:
> > > pageRenderLinkSource.createPageRenderLink("Index").toAbsoluteURI();
> > >
> > > But that seems to retain the Request Parameters.  I could use a regex
> to
> > > strop them off, but I'm guessing that I'm missing a better way to do
> it.
> > >
> > > Mark
> > >
> >
>


Link to root

2011-04-24 Thread Mark
What is the best way to get the url of the root of a web application? In
other words, If I'm on a page like:
http://server:8080/appname/mypage?showAll=true

I want to get:
http://server:8080/appname

I tried using:
pageRenderLinkSource.createPageRenderLink("Index").toAbsoluteURI();

But that seems to retain the Request Parameters.  I could use a regex to
strop them off, but I'm guessing that I'm missing a better way to do it.

Mark


Re: Live reload in production?

2011-04-21 Thread Mark
On Wed, Apr 20, 2011 at 4:07 PM, Howard Lewis Ship  wrote:

> That's my intention.  Live class reloading would be disabled in
> production, and enable in development.
>
>
I think that is reasonable, but I think it should be treated similar to
tapestry.secure-enabled.  By default it is off in development and on in
production, but you can override it to turn it on if you need to use
security in development mode. That way the majority of users can benefit
from sensible defaults while allowing the flexibility for people who need
it.

I think this type of approach is ideal for handling the paradox of choice
issue--particularly in programming frameworks.  It keeps things simple for
the majority of users, but flexible for people whose needs are a bit
different.

Mark


Re: T5: select zone update in a form

2011-04-20 Thread Mark
When you say "Validation kicks in" does this occur after a submit?  If so,
is it possible that AddressUIBean is remembering the value that was present
when the submit occurred and then on the second submit it is getting set to
null again?

At the point when you would expect an error to occur, what is the value of
the state field?  That should give you a good clue as to what is happening.

Mark

On Tue, Apr 19, 2011 at 5:11 PM, Adam Zimowski  wrote:

> I have a typical address form with street, city zip textfields and two
> dropdowns: country and state. The state dropdown is wrapped in a zone
> so that when country is selected, states are populated:
>
>  t:id="a_state" model="stateModel" validate="required"
> value="stateKode" blankOption="ALWAYS" blankLabel="literal:--Please
> Select"/>
>
> All works okay, except for a test case my business analyst found which
> I can't figure out.
>
> You fill out a form, pick a country then pick a state and suppose you
> leave city field empty which is required. Validation kicks in. While
> correcting a city error, you decide to switch a country causing state
> list to get repopulated and state be not selected again. Suppose you
> submit the form, I expect the error that state is required, but error
> is not thrown. Only if I resubmit the form a second time, state will
> be flagged in error.
>
> I am resetting state to null on country change. I have even tried
> setting form state field in error, none of which works.
>
> -- TML --
>
> 
> Address Information
>  
>   :
>   value="address.line1"/>
>  
>  
>  
>   :
>   value="address.line2"/>
>  
>  
>  
>   :
>   value="address.line3"/>
>  
>  
>  
>   :
>   value="address.city"/>
>  
>  
>  
>   :
>   value="address.zipCode"/>
>  
>  
>  
>   :
>   t:id="a_state" model="stateModel" validate="required"
> value="address.stateCode" blankOption="ALWAYS"
> blankLabel="literal:--Please Select"/>
>  
>  
>  
>   :
>   value="address.countryCode" blankOption="NEVER"
> zone="stateModelZone"/>
>  
>  
>  
>  
> 
>
>  Page class -
>
> public class Register extends BasePage {
>
>@Inject
>private Logger log;
>
>@Inject
>private UtilityServiceRemote utilityService;
>
>@Persist
>@Property
>private AddressUiBean address;
>
>@OnEvent(value=EventConstants.PREPARE)
>void initialize() {
>if(address == null) address = new AddressUiBean();
>if(contact == null) contact = new ContactUiBean();
>if(registration == null) registration = new
> RegisterUiBean();
>
>String countryCode = address.getCountryCode();
>if(countryCode == null) {
>Locale locale = getLocale();
>countryCode = locale.getCountry();
>address.setCountryCode(countryCode);
>}
>
>log.debug("address state code {}", address.getStateCode());
>}
>
>@Cached
>public Map getCountryModel() {
>Map model = new LinkedHashMap String>();
>List countries =
>utilityService.getAllCountries(getLocale());
>for(CountryBean country : countries) {
>String code = country.getCodeIsoAlpha2();
>String description = country.getShortName();
>log.debug("code: {}, description: {}", code,
> description);
>model.put(code, description);
>}
>return model;
>}
>
>@OnEvent(value=EventConstants.VALUE_CHANGED, component="a_country")
>public Object onCountrySelected(String aCountryCode) {
>log.debug("selected country: {}", aCountryCode);
>address.setStateCode(null);
>return stateModelZone.getBody();
>}
>
>@Cached
>public Map getStateModel() {
>Map model = new LinkedHashMap String>();
>String countryCode = address.getCountryCode();
>List states =
>
>  utilityService.getAllStateProvincesForCountry(countryCode, getLocale());
>for(StateProvinceBean state : states) {
>String code = state.getLookupCode();
>String name = state.getLongName();
>log.debug("code: {}, name {}", code, name);
>model.put(code, name);
>}
>return model;
>}
> }
>
> Adam
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: Live reload in production?

2011-04-20 Thread Mark
> Good point. But a similar argument can be used: enabled, so you get a faster
> development environment without tweaking options. My gosh, these decisions
> are hard. :)

Couldn't it be enabled by default in development mode and disabled by
default in production mode? Isn't that how HTTPS and some other things
are handled?

Mark

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



Re: Live reload in production?

2011-04-20 Thread Mark
> Does anyone out there rely on live class
> (template, message catalog, whatever) reloading in their live,
> production application?
>
>  and what critical benefit does this offer?

I've used live class reloading on a production system a few times, but
it always felt "wrong" to me. :)

However, keep in mind that the ease of development means some people
are going to use Tapestry for things that normally would be handled by
a scripting language. In some of those situations live class reloading
in production may make sense.

I understand the problems with giving people too many options.
However it can be really tricky to decide what should be configurable
and what need to be fixed.  I wouldn't want to use a word processor
that only allowed me to type in Times Roman because that was the only
font the developers used and they didn't see any reason others would
need to use anything different.

It seems that the real advantage of having fewer options would be when
it lets you keep the code base simpler, but in this case it isn't like
you plan to remove the live class reloading capability.  It will still
be needed for development.

But personally it wouldn't hamper any of my current projects if it
were turned off in production.

Mark

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



Re: New user and IDE issues

2011-04-04 Thread Mark
Oh and if you are using Eclipse, make sure you install loom
(http://code.google.com/p/loom-t5/).  It lets you switch quickly
between .tml and .java files and is a huge time saver.

Mark

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



Re: New user and IDE issues

2011-04-04 Thread Mark
I believe IntelliJ's code completion only works with the full paid
version.  It does work, but I think you have to tell it where your app
module is located.

I had a similar problem with Eclipse the first time I tried to set it
up.  After going back through it again and following the instructions
carefully I was able to get it to work.  I'm not sure what I missed
the first time, but you might try it again.

Mark

On Mon, Apr 4, 2011 at 12:38 PM, Grioni Stefano  wrote:
> Hello,
>
> I have just started using Tapestry (and I already love the spirit!). I 
> however have some troubles finding an IDE that suits me.. At the moment I 
> have tried 2 : IntelliJ and Eclipse.
> IntelliJ's integration of Tapestry doesn't seems to work at all (I opened a 
> thread on Jetbrain's forum and was asked to fill a bug tracker) ... so that 
> was quick
> Using Eclipse I managed to have the whole project working fine, but not to 
> get a decent Code-Completion when it comes to Components-Completion in the 
> Views. I carefully followed the following tutorial 
> (http://wiki.apache.org/tapestry/Tapestry5JSPEditorEclipse), but when I type 
> " it doesn't propose " that I am quite close to having what I need!
>
> Is there any other IDE which provides a better Tapestry integration? Or is 
> there maybe some tutorial I didn't find explaining how to configure Eclipse 
> to get everything working?
>
> Thanks for your time !
>
> Best regards,
>
> Stefano
>

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



Re: dynamically changing event link context on client side using js

2011-03-28 Thread Mark
Normally the context is going to be used to figure out the state when
the link was rendered.  This is particularly useful in a loop were you
need to figure out which eventlink was actually clicked.  It sounds
like you want to make the eventlink do different things based on some
type of ajax event on another part of the page.

If that is what you are trying to do, are you sure you even need to
use an eventlink context?  Can you just have the other Ajax event
update a persistent variable on the page and read it (instead of the
context) when the eventlink is triggered?

Mark

On Mon, Mar 28, 2011 at 1:46 PM, Joel Halbert  wrote:
> Hi,
>
> I have a typical ajax event link e.g.
>
> 
>
> I want to be able to update the context on the clientside using
> javascript, dynamically.
> (or alternatively attach a request parameter and have this submitted
> with the link).
>
> What's the easiest way to accomplish this?
>
> I can modify the link to change the url to append my context (or request
> parameter)  but it seems these post page-load modifications to the
> anchor href are ignored when the links is submitted.
>
> Thanks,
> Joel
>

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



Re: Could not synchronize database state with session

2011-03-08 Thread Mark
On Mon, Mar 7, 2011 at 7:41 PM, Thiago H. de Paula Figueiredo
 wrote:
>> org.hibernate.exception.GenericJDBCException: Could not execute JDBC
>> batch update
>
> I don't think your error is intrinsically related to Tapestry. You're having
> some SQL error. My non-existent psychic powers (ha!) tell me this is a
> primary key violation and you're using HSQLDB 1.8, which had a bug that
> prevented the specific error to be sent to the JDBC driver when executing a
> batch execution. Use HSQLDB 2.0, which I think has this problem solved.

Well that works better. Thank you Thiago! It is much easier when it
gives you an actual error message.

Mark

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



Could not synchronize database state with session

2011-03-07 Thread Mark
I'm trying to experiment with Translators and I'm running into
something I don't understand. I'm not sure if it is just a hibernate
issue or something in the way that hibernate and Tapestry are
interacting.

I have two classes:

@Entity
public class Quote {

@ManyToOne(cascade = CascadeType.ALL)
private Person person;

//getters, setters, id and other fields

}

@Entity
public class Person {

@OneToMany(cascade=CascadeType.ALL)
private List quotes = CollectionFactory.newList();

//getters, setters, id and other fields
}

I'm wanting to create a translator that lets me change the person
associated with a particular quote in a simple text field in a
BeanEditForm. If you create a quote and type the name of an existing
Person object, it should use the existing person.  If you type in the
name of a new person it should create a new person.  Here is the
relevant part of the translator:

public Person parseClient(Field field, String clientValue, String message)
throws ValidationException {
Person person = null;

//If the person already exists pull them out of the database
person = (Person)
session.createCriteria(Person.class).add(Restrictions.ilike("name",
clientValue)).uniqueResult();


//If they they don't exist create a new person with the new name
if(person == null) {
logger.info("Person is null after db call- creating new person");
person = new Person();
person.setName(clientValue);
}
return person;
}

The page that handles the BeanEditForm is very simple:

@CommitAfter
Object onSuccess() {
logger.error("person id = " + quote.getPerson().getId());
session.persist(quote);
return "admin/AdminIndex";
}

Everything works just fine when I create a new Quote.  A new person is
created and added to the database.  However, if I load up an existing
quote and type in a different name I get:


[WARN] util.JDBCExceptionReporter SQL Error: 0, SQLState: null
[ERROR] util.JDBCExceptionReporter failed batch
[ERROR] def.AbstractFlushingEventListener Could not synchronize
database state with session
org.hibernate.exception.GenericJDBCException: Could not execute JDBC
batch update
at 
org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:140)
at 
org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:128)
at 
org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)

This happens regardless of whether I type in the name of a new person
or one that is already in the database.

I looked at the hibernate debug statements and at first I thought that
when adding a new Person it might be trying to update the Quote before
the new Person was saved.  I tried explicitly saving the new Person
first, but that didn't help.  Also, I get the same error when trying
to use the name of a person that is already in the database.  I can
see from the debugging that it grabs the right person out of the
database, but I get the same error right after it shows the SQL that
will update the PERSON_QUOTE table that links the id of a person to
the id of the quote they made.

I have spent several hours going through the Hibernate forums trying
the solutions for everything similar, but nothing seems like an exact
match and none of the suggestions seemed to work.  Is there something
I'm overlooking about how Tapestry handles things that might be
causing this?

Mark

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



Re: Translator to and From a List

2011-03-07 Thread Mark
> Why don't you implement Translator directly, without subclassing
> AbstractTranslator? It's a very, very short class with no logic at all.

Ah ok.  That makes sense.  I was following the example and didn't
think about just skiping the AbstractTranslator.

Thanks!

Mark

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



Translator to and From a List

2011-03-07 Thread Mark
I am trying to create a translator that will let me create and edit a
list of topics in a space separated text field.  I want a string of
space separated words to be translated to and from a list of
List.  So a text field that might look something like:

Topics: apples oranges bananas

Each topic is a separate object stored in the database.  If you change
an item in the list the translator will try to find it in the
database.  If it doesn't exist, it will create a new topic with the
requested name. I am creating a translator like this:

public class TopicsTranslator extends AbstractTranslator>{

Session session;
public TopicsTranslator(Session session) {
super("topics", List.class, "topics-format-exception");
this.session = session;
}


My problem seems to be with this line:

super("topics", List.class, "topics-format-exception");

The error I'm getting is:
The constructor AbstractTranslator>(String, Class,
String) is undefined

You can't parameterize a .class so this doesn't work:

super("topics", List.class, "topics-format-exception");

Is there  a way to call the constructor on AbstractTranslator in a way
that tells it to use a parameterized class type? If not, what other
ways are there to achieve this?  Is an unparamterized list my only
option?

Mark

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



Re: [ANN] Tapestry AWS Services

2011-03-03 Thread Mark
Sounds great, but did you forget the github url? :)

Mark

On Thu, Mar 3, 2011 at 6:34 AM, Barry Books  wrote:
> Now that I figured out GitHub I'm posting another library I use all
> the time. This is really just a AppModule that makes the AWS java
> library work as a set of Tapestry Services. Then you can do things
> like
>
> public class S3Index {
>        @Inject
>        private AmazonS3 amazonS3;
>
>        @Property
>        private List buckets;
>
>        @BeginRender
>        void beginRender() {
>                buckets = amazonS3.listBuckets();
>        }
> }
>
> S3Index.tml
>
> 
>
>
> There is also service that uses a javax.mail.Session to send email via
> SES so it's easy to convert existing emails to SES.
>
> See
> http://aws.amazon.com/sdkforjava/
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

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



Re: Tapestry 5

2011-02-26 Thread Mark
On Sat, Feb 26, 2011 at 6:07 AM, Dang Ngoc Son
 wrote:
>   1. Tapestry 5 component show rss feed. Show info of user twitter in RSS
> format: ex: http://twitter.com/statuses/user_timeline/14717608.rss

If you want to read RSS feeds, you might want to look at Rome or
something similar.  If there is an existing component to read RSS
feeds, I'm not aware of it, but you should be albe to use pretty much
anything.

>   2. Using Spring security to create mechanisms login/logout in Tapestry 5.

You might check here:
http://tapestry.apache.org/spring-security.html

Also I'd recommend looking at Tynamo's security component. I've been
very happy with it:
http://tynamo.org/tapestry-security+guide

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



Re: session id

2011-02-25 Thread Mark
Ah ok.  That explains why I see it sometimes and not others.  This is
what I ended up doing:

Link link = pageRenderLinkSource.createPageRenderLinkWithContext("page",
context);
link.removeParameter("jsessionid");
return link;

Any problems with that?

Mark

On Fri, Feb 25, 2011 at 4:28 PM, Josh Canfield  wrote:
>> Any idea on how to prevent these session ids from being part of the
>> links created in this manner?
>
> You'll get a session id if you try to persist anything into the
> session, for instance if you use @ApplicationState as a page securing
> mechanisms might do.
>
> Tapestry calls encodeRedirectURL when you get the url out of the Link,
> if your application container uses url rewriting then it will append
> the jsessionid if the app server hasn't seen that cookies work.
>
> You could configure your app server to not do url rewriting, which may
> lead to things not working for users that don't want your cookies.
> or
> You could write a PageRenderLinkTransformer which returns a
> StatelessLink (copy LinkImpl and rename it) which never calls the
> encodeRedirectURL..
> or
> something else that isn't fresh off the top of my head!
>
> Good luck!
> Josh
>
> On Fri, Feb 25, 2011 at 1:24 PM, Mark  wrote:
>> I am using:
>>
>> Link link = pageRenderLinkSource.createPageRenderLinkWithContext("PageName",
>> pageContext);
>>
>> To get a link to a page with a particular context that ties into a
>> Facebook share component.  This has worked well, but now I'm
>> occasionally seeing it rendered with a jsessionid.  Which of course I
>> do not want in order to share it on facebook.
>>
>> It appears that that jsessionid started showing up once I started
>> securing certain pages of the application, but I'm not sure if that is
>> what is causing it.
>>
>> Any idea on how to prevent these session ids from being part of the
>> links created in this manner?
>>
>> Mark
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

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



session id

2011-02-25 Thread Mark
I am using:

Link link = pageRenderLinkSource.createPageRenderLinkWithContext("PageName",
pageContext);

To get a link to a page with a particular context that ties into a
Facebook share component.  This has worked well, but now I'm
occasionally seeing it rendered with a jsessionid.  Which of course I
do not want in order to share it on facebook.

It appears that that jsessionid started showing up once I started
securing certain pages of the application, but I'm not sure if that is
what is causing it.

Any idea on how to prevent these session ids from being part of the
links created in this manner?

Mark

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



Update symbols outside of App Module

2011-02-24 Thread Mark
I'm using ChenilleKitMail and I want to let end users update the SMTP
settings from the application.

So right now my AppModule has a contributeApplicationDefaults that
hard code all the values like:

// Email Setup
configuration.add(ChenilleKitMailConstants.SMTP_HOST, "smtp.a.com");
configuration.add(ChenilleKitMailConstants.SMTP_PORT, "25");
configuration.add(ChenilleKitMailConstants.SMTP_DEBUG, "true");
configuration.add(ChenilleKitMailConstants.SMTP_USER, "a...@a.com");
configuration.add(ChenilleKitMailConstants.SMTP_PASSWORD, "*");
configuration.add(ChenilleKitMailConstants.SMTP_SSL, "true");
configuration.add(ChenilleKitMailConstants.SMTP_SSLPORT, "465");
configuration.add(ChenilleKitMailConstants.SMTP_TLS, "true");


I want to be able to update these to different settings from a page
class. I'm assuming I can inject something into the page class to
update these symbols, but I'm not sure what to use.

Mark

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



Re: EventLink URI and loop component

2011-02-24 Thread Mark
An eventLink tells the application to do something.  The context says
what you want to do it to.

When you aren't in a loop it is easy to figure out what to do things
to and you don't need a context because the thing you are doing the
action to is the same for the entire rendering of the page. However,
when you are in a loop the thing the action is performed on changes
with each iteration.

The behavior of the loop is a bit more expecte when you think about
how a framework can handle a loop.

There are two ways for the framework to solve this (that I'm aware
of).  One way is the way WebObjects does it.  It keeps track of the
state of all the variables at the moment each link is rendered.  If
you click on a link it goes back to that point in time to figure out
how things were when that particular link was rendered.

The second way is the way Tapestry does it.  You have to tell it what
object or objects are important for performing the action.  These are
specified in the context and then the object is passed to the event
handler. If you are using Hibernate, Tapestry takes care of just using
the IDs in the link and then pulling the entire object out of the
database to give to the event handler when it is invoked.

The downside of course is that you have to tell the component what
objects are important for the action.  The upside is that it requires
much less memory because the application doesn't have to remember the
state of ever iteration of every loop.  Also the Tapestry approach
means that the page doesn't have to rely on a a session.  The links
can still be good even after the session goes away because they
contain everything necessary to still fire off the event on the proper
object.

As far as the documentation, the EventLink docs show how it is used in a loop:
http://tapestry.apache.org/tapestry5.2-dev/tapestry-core/ref/org/apache/tapestry5/corelib/components/EventLink.html

It might be a bit confusing because the context is specified in the
java class in an annotation instead of in the component, but it does
demonstrate how it works.

Mark

On Tue, Feb 22, 2011 at 2:57 AM, Erik Fäßler  wrote:
>  Thank you all for your answers. This behaviour of the loop is actually
> unexpected. I see that I'll have to stick with a more static structure or to
> rewrite the components in question. For the moment, I will pospone these
> things and come back to them later.
>
> And no, I havn't found anything about this in the docs either :)
>
> Best,
>
>    Erik
>
>
> Am 18.02.2011 19:38, schrieb Rich M:
>>
>> On 02/18/2011 12:59 PM, Thiago H. de Paula Figueiredo wrote:
>>>
>>> On Fri, 18 Feb 2011 15:45:54 -0200, Rich M  wrote:
>>>
>>>> The challenge in your case is I don't believe you can dynamically assign
>>>> a component ID. I double checked myself just now, and t:id only took a
>>>> discrete ID (in 5.1.0.5), and was not happy pulling it from a property or
>>>> other dynamic means.
>>>
>>> Static structure is not possible with dynamic component ids. I think the
>>> issue here is forgetting the event instance and relying only on passing
>>> information to the event handler method (in this case, using the context).
>>>
>> I fully agree, my answer was convoluted in attempts to reference the
>> broader scope of challenges faced when dealing with the static structure of
>> a component enclosed within a loop. The concept of static structure, given a
>> full understanding, makes the proper use of components in a Loop clear.
>>
>> However, I still think for someone coming to Tapestry it is likely to
>> think of loops in the Java sense where each iteration is fresh
>> (loop-declared objects/variables are unique between iterations, etc). It
>> would be worthwhile to clarify the implications of static structure in loops
>> where users are most likely to confuse a need for dynamic behavior with
>> dynamic structure based on prior experiences with loops. Perhaps I haven't
>> found the right documentation page, but I can't readily find much
>> explanation of static structure and its implications in the Tapestry site
>> documentation on pages where I might expect it.
>>
>> Regards,
>> Rich
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

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



Re: Default Ordering for BeanEditForm

2011-02-21 Thread Mark
Josh,

But it is documented--at least for normal beans. The notes section
paragraph of the BeanEditForm documentation discusses the reorder
parameter and then says:

>You can accomplish the same thing by changing the order of the getter methods 
>in the bean class. The default order for properties is not alphabetical, it is 
>the order of the getter methods.

I understand that this doesn't necessarily mean it is going to work in
transformed or injected classes, but the idea of ordering things by
the getter method is covered in the documentation.

Mark


On Mon, Feb 21, 2011 at 1:02 PM, Josh Canfield  wrote:
>> Acutally, Tapestry 5.2 uses Javassist to get at attribute information
>> for the methods, including the line numbers where available.
>
> The getMethods in CtClass is not documented as being ordered, so I
> peeked at the code and unless I'm looking at the wrong spot it comes
> from an un-ordered HashMap.
>
>  public CtMethod[] getMethods() {
>        HashMap h = new HashMap();
>        getMethods0(h, this);
>        return (CtMethod[])h.values().toArray(new CtMethod[h.size()]);
>    }
>
> I haven't tried to chase down what Tapestry is doing in transformed
> classes, but I'm pretty sure counting on the undocumented ordering of
> methods is a bad idea.
>
> Josh
>
> On Mon, Feb 21, 2011 at 10:14 AM, Howard Lewis Ship  wrote:
>> Acutally, Tapestry 5.2 uses Javassist to get at attribute information
>> for the methods, including the line numbers where available. However,
>> I'm honestly not sure what happens in a transformed component class.
>> Certainly, if the @Property annotation is used, there is no line
>> number information to be had.
>>
>> On Mon, Feb 21, 2011 at 10:03 AM, Josh Canfield  
>> wrote:
>>> http://download.oracle.com/javase/6/docs/api/java/lang/Class.html#getDeclaredMethods()
>>>
>>> "The elements in the array returned are not sorted and are not in any
>>> particular order."
>>>
>>> Java's reflection mechanism doesn't guarantee the order of methods
>>> returned so it would be hard for Tapestry to do much about that given
>>> the current architecture. It's possible that the behavior you were
>>> seeing previously was particular to a specific JVM implementation.
>>>
>>> Josh
>>>
>>> On Sun, Feb 20, 2011 at 2:06 PM, Mark  wrote:
>>>> On Sun, Feb 20, 2011 at 9:33 AM, Ulrich Stärk  wrote:
>>>>> I'm just guessing, but Tapestry might reorder accessor methods 
>>>>> alphabetically when enhancing the
>>>>> page class.
>>>>
>>>> Hm. I'm also seeing this behavior on Java Beans now if they implement
>>>> an interface and are Injected into the page.  Should I file this as a
>>>> bug or is it intentional.
>>>>
>>>> Mark
>>>>
>>>> -
>>>> 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
>>
>>
>
> -
> 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: Default Ordering for BeanEditForm

2011-02-21 Thread Mark
This wasn't using the @Property annotations.  I was using getters and setters.

The ordering isn't working when using a bean that is injected either.

I'm not sure if this is a bug or if it is just something where it is
impossible to get the information for ordering.

Mark

On Mon, Feb 21, 2011 at 12:14 PM, Howard Lewis Ship  wrote:
> Acutally, Tapestry 5.2 uses Javassist to get at attribute information
> for the methods, including the line numbers where available. However,
> I'm honestly not sure what happens in a transformed component class.
> Certainly, if the @Property annotation is used, there is no line
> number information to be had.
>
> On Mon, Feb 21, 2011 at 10:03 AM, Josh Canfield  
> wrote:
>> http://download.oracle.com/javase/6/docs/api/java/lang/Class.html#getDeclaredMethods()
>>
>> "The elements in the array returned are not sorted and are not in any
>> particular order."
>>
>> Java's reflection mechanism doesn't guarantee the order of methods
>> returned so it would be hard for Tapestry to do much about that given
>> the current architecture. It's possible that the behavior you were
>> seeing previously was particular to a specific JVM implementation.
>>
>> Josh
>>
>> On Sun, Feb 20, 2011 at 2:06 PM, Mark  wrote:
>>> On Sun, Feb 20, 2011 at 9:33 AM, Ulrich Stärk  wrote:
>>>> I'm just guessing, but Tapestry might reorder accessor methods 
>>>> alphabetically when enhancing the
>>>> page class.
>>>
>>> Hm. I'm also seeing this behavior on Java Beans now if they implement
>>> an interface and are Injected into the page.  Should I file this as a
>>> bug or is it intentional.
>>>
>>> Mark
>>>
>>> -
>>> 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
>
>

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



Re: 10 Minute Web Application Demo

2011-02-21 Thread Mark
Thanks, and I appreciate your suggestions.

There is probably a big difference between the pacing necessary to
actually teach Tapestry (what this mailing list audience may be more
interested in) and the pacing to get people interested in learning
Tapestry (what this video was really designed for). Obviously there is
a need for both.

Mark

On Sat, Feb 19, 2011 at 11:53 AM, Kalle Korhonen
 wrote:
> Mark, I linked to your screencast from "Getting Started" and
> "Presentations" pages of Tapestry's official documentation. I linked
> to your blog rather than the YouTube clip directly, I assume that's
> how you wanted it. I wouldn't worry too much about fixing every little
> issue people have reported. I know how long it takes to make one short
> video if you want to do a decent job. There are always things you can
> improve but it doesn't matter too much in a demo like this. I thought
> the pace is good, instead of explaining every little detail, it's good
> to leave some for the audience to discover themselves. Likewise, if
> you are making more of these, I would advise against making them any
> longer. The net crowd just doesn't have the attention span anymore :)
> Plus, if you make more shorter ones, you'll get more hits and it's
> likely better marketing for Tapestry overall.
>
> Kalle
>
>
> On Mon, Feb 14, 2011 at 8:24 PM, Mark  wrote:
>> If anyone is interested, I made a short screencast showing the
>> building of a ten minute demo application with Tapestry.
>>
>> http://blog.markwshead.com/900/tapestry-5-10-minute-demo/
>>
>> The text is a bit smaller than I would have liked, but I think you can
>> still get a general idea of what is going on.
>>
>> Mark
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

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



Re: Default Ordering for BeanEditForm

2011-02-20 Thread Mark
On Sun, Feb 20, 2011 at 9:33 AM, Ulrich Stärk  wrote:
> I'm just guessing, but Tapestry might reorder accessor methods alphabetically 
> when enhancing the
> page class.

Hm. I'm also seeing this behavior on Java Beans now if they implement
an interface and are Injected into the page.  Should I file this as a
bug or is it intentional.

Mark

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



Re: Default Ordering for BeanEditForm

2011-02-20 Thread Mark
On Sun, Feb 20, 2011 at 5:32 AM, Ulrich Stärk  wrote:
> Use BeanEditForms reorder property. The argument is a comma-separated list of 
> property names that
> will be displayed in the given order. Omitted properties will be appended 
> automatically to this
> list, in alphabetical order.

I know I can use the reorder properties, but the Tapestry
documentation says that the order should follow the order of the
getter methods in the bean.  This works with a bean that is not a page
class. Is there a reason this isn't true if the bean is also a page
class or is this a bug?

Mark

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



Re: Configuration Data

2011-02-20 Thread Mark
On Sun, Feb 20, 2011 at 6:34 AM, Vangel V. Ajanovski  wrote:
> If you already use a database in the project and if the project is depending
> on the operation of the database, than I would say that there is no reason
> that is sufficient to justify the use of a property file beside the
> database. Especially when you have many users which are all configuring
> their stuff.
>
> Reinventing a wheel in such case would be to NOT use the database (you will
> have the problems of multi-user concurent access and file-locking,
> versioning, ACID transactions).
>
> I would also add that you shouldn't split the user profile personal data
> from the user profile configuration data - they are both user personal data
> and according to privacy-related laws should be
> protected. If you split it, than you will have two separate locations to
> deal with and protect (database and file).
>
> Most web applications I have seen that have a lot of user configuration
> data, store it in a single table that will mimic the property file, that has
> a composite key like this:
> (#userid, #property-key, value)
>
> Is this what you're currently doing? Because from what I read, it sounded
> like you are creating separate entity classes for separate properties.

Originally I was using Entity classes which was making things more
complicated than they needed to be and that prompted my original
question. The single table that mimics the property file is what I'm
doing now and I wanted to make sure there weren't any built in
facilities for reading and writing these files or the keys to a
database that I was overlooking.  I started experimenting with Apache
Commons Configuration an it lets me use a properties file, XML or a
database. Changes from the web interface get written to the file and
changes to the file get immediately read back into the web
application.

Thanks for your suggestions!

Mark

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



Re: Configuration Data

2011-02-20 Thread Mark
On Sun, Feb 20, 2011 at 5:34 AM, Ulrich Stärk  wrote:
> There is a SymbolProvider for properties files in the non-public parts of the 
> API. Have a look at that.

I'm using those in a few places where I need to set a value once
before the app is started.  However, I was wanting something that
would handle automatically writing the values back to the the config
file for configuration data that the end user needs to change.

Is there a way to save changes back to a file using SymbolProvider?

Mark

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



DynaBeans and BeanEditForm

2011-02-19 Thread Mark
Is there anyway to (easily) use DynaBeans (or something similar) in a
BeanEditForm?  I'm looking for an easy way to edit a properties file
from within the application where the properties won't be known ahead
of time.

Mark

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



Default Ordering for BeanEditForm

2011-02-19 Thread Mark
I have a configuration page that I want to edit using a BeanEditForm.
I have created getter/setter methods on the page itself and I'm
creating the BeanEditForm using:



This works, but the properties are not listed in the order of the
getters. Instead they are in alphabetical order.

Is this a bug in 5.2.4 or is there something about using a page as the
bean that is causing the order to be wrong?

Mark

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



Re: Configuration Data

2011-02-19 Thread Mark
Ok thats what I've started  using, but I wanted to make sure there wasn't
some built in Tapestry capability to write back to properties files.  I'd
rather not re-invent the wheel when I don't have to.

Thanks!

Mark

On Sat, Feb 19, 2011 at 2:11 PM, Werner Keil  wrote:

> It's non trivial, but Apache Commons Config worked for us in another
> project (With Selenium2, not Tapestry, but it should work for the web
> container just as well as the Functional Web Test[?])
>


Configuration Data

2011-02-19 Thread Mark
I have an application that requires a great deal of configuration data
after the app is running and needs to be configurable by the end user
from within the application  This includes things like Facebook admin
id, Twitter account info, Mailchimp api key, etc.

So far I've been just creating objects, storying them in the database
and then accessing them using Hibernate. However this is getting a bit
cumbersome and I'd prefer to use some type of properties file that I
can configure by hand or have the end user update from within the
application.  So it needs to be something where:

1. If the property is changed it gets saved back to the file.
2. Changes can be made at run time without reloading the application.

I like the way you can inject values from Tapestry Symbols, but I
didn't see an easy way to load and save the symbols to/from a
properties file.

My plan was to use the Apache Common's Configuration for this, but I
wanted to make sure I didn't overlook some built in capability and
re-invent the wheel.

Does anyone have any suggestions?

Mark

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



Re: Best way to create a simple database display application?

2011-02-18 Thread Mark
> What i am really looking for is to display/edit a JDBC ResultSet on a web page
> What do you think is the best way to do this?

So basically you want to create something like PHPMyAdmin in Tapestry?

Mark

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



Re: 10 Minute Web Application Demo

2011-02-17 Thread Mark
THanks for the suggestion. I was thinking about doing the same demo
program again, but this time spending more time explaining what is
going on.  It would be much longer though, so I wasn't sure if people
would actually watch it. :)

Mark

On Thu, Feb 17, 2011 at 8:39 AM, Inge Solvoll  wrote:
> Nice work, Mark!
>
> I have some feedback for you here:
>
> Tapestry is great because it enables me to work tiny iterations. These tiny
> iteratinos are enabled by live reloading and excellent error reporting. I
> use this to work in a TDD way (without actually doing TDD), adding one bit
> at a time and verifying its behaviour in the browser before continuing.
> Being used to that, I was a bit overwhelmed by your speed in this tutorial,
> adding lots of things before reloading in the browser. That approach might
> work very well for you, but probably not for beginners.
>
> I believe a lot of people out there are used to quite long development
> cycles. They are used to coding lots of lines before restarting the server
> and checking the GUI. Upon arrival in the T5 world, it might be hard to
> adjust quickly. Sure, everyone loves live class reloading and it works
> instantly. But do they understand how to get the full power out of it? I'll
> give a (hopefully understandable) example:  If you ask your grandmother to
> send you an email, she might print it, put it in an envelope and go for a
> walk to the post office. Not what you intended when you provided her with
> the very effective tools necessary :)
>
> Don't get me wrong, I love this tutorial! Just wanted to write a few words
> about how I feel T5 could gain more popularity.  Highly efficient tools
> aren't enought, we should also focus on showing a set of simple and
> simplifying techniques that makes it very hard to fail and very much fun to
> be a T5 programmer. Also for newbies :)
>
> On Thu, Feb 17, 2011 at 9:46 AM, Peter Stavrinides <
> p.stavrini...@albourne.com> wrote:
>
>> :) Excellent Mark! I know the feeling... does she also give the blank
>> expression?
>>
>> - Original Message -
>> From: "Mark" 
>> To: "Tapestry users" 
>> Sent: Wednesday, 16 February, 2011 23:25:47 GMT +02:00 Athens, Beirut,
>> Bucharest, Istanbul
>> Subject: Re: 10 Minute Web Application Demo
>>
>> I keep showing my wife, but she doesn't ever seem to get very excited
>> about it. :)
>>
>> On Wed, Feb 16, 2011 at 2:27 PM, Michael Gentry 
>> wrote:
>> > Sure, but I don't general show people Tapestry 5 at home.  I'll bet
>> > most of us don't do that, either.  :-)
>> >
>> > mrg
>> >
>> >
>> > On Wed, Feb 16, 2011 at 2:28 PM, Christian Riedel
>> >  wrote:
>> >> don't you have internet at home? :p
>> >>
>> >>
>> >> Am 16.02.2011 um 19:54 schrieb Michael Gentry:
>> >>
>> >>> That's not an option for some of us, either.  :-)
>> >>>
>> >>>
>> >>> On Wed, Feb 16, 2011 at 1:48 PM, Lenny Primak 
>> wrote:
>> >>>> That's what the your mobile device is for :)
>> >>>>
>> >>>> On Feb 16, 2011, at 1:47 PM, Michael Gentry wrote:
>> >>>>
>> >>>>> Hi Mark,
>> >>>>>
>> >>>>> Keep in mind that a lot of companies block YouTube access (and other
>> >>>>> media sites), so putting it on YouTube might actually restrict access
>> >>>>> more than you intended.
>> >>>>>
>> >>>>> mrg
>> >>>>
>> >>>>
>> >>>> -
>> >>>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> >>>> For additional commands, e-mail: users-h...@tapestry.apache.org
>> >>>>
>> >>>>
>> >>>
>> >>> -
>> >>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> >>> For additional commands, e-mail: users-h...@tapestry.apache.org
>> >>>
>> >>
>> >>
>> >> -
>> >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> >> For additional commands, e-mail: users-h...@tapestry.apache.org
>> >>
>> >>
>> >
>> > -
>> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> > For additional commands, e-mail: users-h...@tapestry.apache.org
>> >
>> >
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>>
>> -
>> 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: 10 Minute Web Application Demo

2011-02-16 Thread Mark
I keep showing my wife, but she doesn't ever seem to get very excited
about it. :)

On Wed, Feb 16, 2011 at 2:27 PM, Michael Gentry  wrote:
> Sure, but I don't general show people Tapestry 5 at home.  I'll bet
> most of us don't do that, either.  :-)
>
> mrg
>
>
> On Wed, Feb 16, 2011 at 2:28 PM, Christian Riedel
>  wrote:
>> don't you have internet at home? :p
>>
>>
>> Am 16.02.2011 um 19:54 schrieb Michael Gentry:
>>
>>> That's not an option for some of us, either.  :-)
>>>
>>>
>>> On Wed, Feb 16, 2011 at 1:48 PM, Lenny Primak  
>>> wrote:
>>>> That's what the your mobile device is for :)
>>>>
>>>> On Feb 16, 2011, at 1:47 PM, Michael Gentry wrote:
>>>>
>>>>> Hi Mark,
>>>>>
>>>>> Keep in mind that a lot of companies block YouTube access (and other
>>>>> media sites), so putting it on YouTube might actually restrict access
>>>>> more than you intended.
>>>>>
>>>>> mrg
>>>>
>>>>
>>>> -
>>>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>>>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>>>
>>>>
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>>
>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

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



  1   2   3   4   5   >