T5: Timers/Schedulers

2009-02-27 Thread James Sherwood
Hello,

 

I know this may not be a T5 problem but I am just wondering how people are
doing this.

 

I need to use timers(schedulers) for database work.

 

Let's take for instance, every January 1st I need to reset everyone's
position on a list(EX reps for a union position as votes happen).

 

So basically let's say I have to reset everyone's 'repid' to null every
January 1st.

 

What is the best way to make this happen using T5?

 

I was thinking just run a timer off the appmodule using a flag in the
Database that it had been run once or something so it does not get run
multiple times on that day?

 

 

Thanks,

--James

 

 



RE: [OT] By boss decided

2009-02-18 Thread James Sherwood
Hi,

http://www.workingmother.comwritten in T3:)

350k/month PAGE VIEWS(1million during top 100)

--James

-Original Message-
From: Fernando Padilla [mailto:f...@alum.mit.edu] 
Sent: February-18-09 1:19 PM
To: Tapestry users
Subject: Re: [OT] By boss decided


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


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

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



Otho wrote:
 Yup, no websites in java. Googlemail doesn't count. And german Telekom and
 Postbank are totally niche companies. :)
 
 2009/2/18 Daniel Honig daniel.ho...@gmail.com
 
 Ok...very late for meHorrible post!

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


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


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

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

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

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

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

 You might want to point out that often the productivity gain is a a bit
 of
 a shell gameIn any of these languages you still need to hire good or
 great developers to get productivity.  In dynamic frameworks you can't
 keep
 a stable codebase unless you write good to great integration tests to
 verify
 your execution paths are stable and not doing something crazy from
 release
 to release.IMHO, the productiviy gains from dynamic frameworks are a
 bit
 overexaggerated..All of these frameworks have a learning
 curve.Unless your boss wants a project delivered by a bunch of PHP
 script kids?.It's a shell game

 Despite my love of grails, after working with grails for a year and a
 previous life that included lots of WO and T4 experience, I think there
 is
 no reason that a talented agile Tap X team could not keep up with the
 true
 productivity of any other framework.  Full stop ;)

 The trouble is how do you bring communicate this effectively?



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

 Hello,

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

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

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

 -Borut


 

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


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



RE: InPlaceEditor validation

2009-02-16 Thread James Sherwood
Hello,

I believe the answer lies in the return value from the server.  I could not
get it to work but there is a way you can run javascript I believe from the
return value.

--James

-Original Message-
From: MustLoveXF [mailto:neven...@gmail.com] 
Sent: February-16-09 5:27 PM
To: users@tapestry.apache.org
Subject: Re: InPlaceEditor validation


I'm wondering the same thing :confused:..
If I run into something I get back to you :-D

Cheers

James Sherwood wrote:
 
 Hello,
 
  
 
 The t5components inplaceeditor is what I am referring to:
 
 http://87.193.218.134:8080/t5c-demo/inplaceeditorpage
 
  
 
 Does anyone know a way to do validation on this?   Currently when you save
 with nothing in the text field there is a properties file that is read
 from
 and it just fills it with that text or you can just send back the regular
 text that was in the box but this does not really help the less
 intelligent
 user to understand why the change did not take.
 
  
 
 I was thinking the easiest way would be to have another component
 accompany
 this one that would accept server information and display it above however
 I
 cannot figure out a way to do this.  
 
  
 
 If anyone could point me in the right direction that would be appreciated.
 
  
 
 --James
 
 
 

-- 
View this message in context:
http://www.nabble.com/InPlaceEditor-validation-tp21576011p22046283.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: [T5] Updating Zone with Action Link using Select field value as Context

2009-02-13 Thread James Sherwood
Peter,

I created a buttonfragment component that uses a button(and could be easily
modified for an image) instead of using a radio/checkbox(sort of).  You are
welcome to have the code if you like.

--James

-Original Message-
From: Dave Greggory [mailto:davegregg...@yahoo.com] 
Sent: February-13-09 12:28 PM
To: Tapestry users
Subject: Re: [T5] Updating Zone with Action Link using Select field value as
Context


Thanks, Thiago. Appreciate your help.

I opted to go the route of using a radio buttons that trigger a form
fragment.

Peter



- Original Message 
From: Thiago H. de Paula Figueiredo thiag...@gmail.com
To: Tapestry users users@tapestry.apache.org
Sent: Thursday, February 12, 2009 2:50:21 PM
Subject: Re: [T5] Updating Zone with Action Link using Select field value as
Context

Em Thu, 12 Feb 2009 15:16:00 -0300, Dave Greggory davegregg...@yahoo.com
escreveu:

 This javascript is added to the page by Tapestry and how can modify it to
include select field value?
 
 /my-web/stuff/create.showmystufflink/ + getSelectFieldValue()

Nothing a little bit of RenderSupport and Prototype cannot do. :)
See http://wiki.apache.org/tapestry/Tapestry5AndJavaScriptExplained.

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

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


  


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


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



RE: IoC question - introducing a time delay in an ASO

2009-02-11 Thread James Sherwood
Hello,

Doesn't most dictionary style attacks create a new request each time
therefore creating a new ASO? Kind of like closing your browser and
reopening it each time?

If not this is a much better idea than mine of delaying the IP.

--James

-Original Message-
From: Thiago H. de Paula Figueiredo [mailto:thiag...@gmail.com] 
Sent: February-11-09 8:14 AM
To: Tapestry users
Subject: Re: IoC question - introducing a time delay in an ASO

On Wed, Feb 11, 2009 at 9:49 AM, Peter Stavrinides
p.stavrini...@albourne.com wrote:
 I use an ASO as a token when signing users in, I use this small method to
introduce a time delay (if there are multiple failed attempts, I increase
the delay):

Your code doesn't delay the ASO, it delays the request processing. ;)
It prevents dictionary attacks against passwords, something everyone
should do.

 I haven't tested it much, but it seems to work great, I was just a bit
worried if it would be thread safe or if I was doing something stupid.

ApplicationStateManager (the Tapestry service that handles ASOs) is
already thread-safe (it uses ConcurrentHashMap), so I guess you don't
need to worry. ;)

-- 
Thiago

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


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



RE: IoC question - introducing a time delay in an ASO

2009-02-11 Thread James Sherwood
Hello,

I am not him:)(if that makes sense:) but I am doing the same thing right
now.

I am using the database not to slow connections but block IP's that get 100
failed login attempts over 2 minutes(blocked for 1 hour).

I like your idea of a map held in memory much better.

But how do I create an application wide map(object) in T5?

Sorry for kind of hijacking your thread Peter:)

--James

-Original Message-
From: Thiago H. de Paula Figueiredo [mailto:thiag...@gmail.com] 
Sent: February-11-09 8:52 AM
To: Tapestry users
Subject: Re: IoC question - introducing a time delay in an ASO

On Wed, Feb 11, 2009 at 10:46 AM, James Sherwood
jsherw...@rgisolutions.com wrote:
 Hello,

Hi!

 Doesn't most dictionary style attacks create a new request each time
 therefore creating a new ASO? Kind of like closing your browser and
 reopening it each time?

They are done by bots (programs), not people, so I guess you're right.

 If not this is a much better idea than mine of delaying the IP.

Your code was not delaying the IP, it was delaying the session. It's
not the same. Implement it using an application-wide map ip, login
attempts instead of relying on an ASO. This has another advantage:
you don't create a session when you don't need to.

-- 
Thiago

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


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



RE: IoC question - introducing a time delay in an ASO

2009-02-11 Thread James Sherwood
Hello,

Thanks for the nudge in the right direction.
 
I created the service and I was wondering if you could have a look at how I
created it to be sure I've done it right(Everything seems to work fine but
it's my first service and I want to be sure it's done right):
 
Steps in reverse order basically:
 
Added to page:
@Inject
 private FailedLoginPrevention flp;
 
Activate it:
binder.bind(FailedLoginPrevention.class, FailedLoginPreventionImpl.class);
 
Interface:
public interface FailedLoginPrevention {
 
 int checkIP(String IP);
}
 
Implementation:
public class FailedLoginPreventionImpl implements FailedLoginPrevention {
public static MapString, FailedLoginPreventionHelper ipmap = new
HashMapString, FailedLoginPreventionHelper();  @Override  public
synchronized int checkIP(String IP) {
  if (FailedLoginPreventionImpl.ipmap.containsKey(IP)) {
   // IP is there check last failed login
   FailedLoginPreventionHelper flph = FailedLoginPreventionImpl.ipmap
 .remove(IP);
   Calendar now = Calendar.getInstance();
   if ((now.getTimeInMillis() - flph.getLastcheck().getTimeInMillis()) 
(1000 * 60 * 60 * 5)) {// 5
//last failed login was more than 5 hours ago, reset the ip's time
// hours
flph.setTime(0);
   } else {
flph.setTime(flph.getTime() * 2);
   }
   flph.setLastcheck(now);
   FailedLoginPreventionImpl.ipmap.put(IP, flph);
   return flph.getTime();
  }
  FailedLoginPreventionImpl.ipmap.put(IP, new
FailedLoginPreventionHelper());
  return 0;
 }
}

Helper Class:
public class FailedLoginPreventionHelper {
 
 private int _time = 0;
 private Calendar _lastcheck = Calendar.getInstance();
 
 
 public int getTime() {
  return _time;
 }
 public void setTime(int time) {
  this._time = time;
 }
 public Calendar getLastcheck() {
  return _lastcheck;
 }
 public void setLastcheck(Calendar lastcheck) {
  this._lastcheck = lastcheck;
 }
}

Thanks,
--James

-Original Message-
From: Thiago H. de Paula Figueiredo [mailto:thiag...@gmail.com] 
Sent: February-11-09 9:18 AM
To: Tapestry users
Subject: Re: IoC question - introducing a time delay in an ASO

On Wed, Feb 11, 2009 at 11:16 AM, Ulrich Stärk u...@spielviel.de wrote:
 Something like a singleton tapestry service with an access-synchronized
map
 inside maybe?

That's what I'd do.
James: sorry for mistaking your message as someone else's. :)

-- 
Thiago

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


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



RE: IoC question - introducing a time delay in an ASO

2009-02-11 Thread James Sherwood
Hello,

I could be wrong but worse case it would just slow down the interval, how bad 
or at all would depend on how you have your barracuda(or whatever) set up(IP's 
route to same server)? Just a shot in the dark maybe:)

--James

-Original Message-
From: Olle Hallin [mailto:olle.hal...@gmail.com] 
Sent: February-11-09 10:32 AM
To: Tapestry users
Subject: Re: IoC question - introducing a time delay in an ASO

What happens in a clustered environment?

Tapestry services aren't part of normal HTTP session clustering.

Olle



2009/2/11 Thiago H. de Paula Figueiredo thiag...@gmail.com

 On Wed, Feb 11, 2009 at 11:16 AM, Ulrich Stärk u...@spielviel.de wrote:
  Something like a singleton tapestry service with an access-synchronized
 map
  inside maybe?

 That's what I'd do.
 James: sorry for mistaking your message as someone else's. :)

 --
 Thiago

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




-- 
Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se


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



RE: Site security

2009-02-11 Thread James Sherwood
Hello,

Thanks,

The admin side is a full user/role deal but they are being very strict on
security.

The public side is a separate app so I'm good, thanks for your help.

--James

-Original Message-
From: Christian Edward Gruber [mailto:christianedwardgru...@gmail.com] 
Sent: February-11-09 1:38 PM
To: Tapestry users
Subject: Re: Site security

Well, if you have your admin side as a separate application (on the  
same app-server) than the solution I mentioned could work if the front- 
end web-server is separate.  In that case, you can link one (public)  
server against the app context of the public app, and a separate  
(internal) webserver against the context that should be inaccessible.   
In neither case can anyone access the app-server directly.

But if you have a single web-server/app-server with both things  
available, then you can't really prevent access by ip/mac address  
reliably.  You should, rather, have a user/role system in place such  
that only those users who are logged in and have role-based access to  
the admin app can even see it, let alone use it.

Christian.

On 11-Feb-09, at 07:08 , James Sherwood wrote:

 Hello,

 Thanks for the reply.

 I have a public side(anyone is allowed to access) and an admin  
 side(very
 restricted), both on the same server.  Will this still solve my  
 issue if I
 use 2 webservers or will I need 2 separate servers?

 --James

 -Original Message-
 From: Christian Edward Gruber [mailto:christianedwardgru...@gmail.com]
 Sent: February-10-09 7:45 PM
 To: Tapestry users
 Subject: Re: Site security

 The best way (and this is really not a T5 issue) is not to rely on MAC
 or IP addresses, as these can be forged.  You should set up a virtual
 private network, and only allow those within that VPN to access the
 site.  The remote users log-on to the VPN, and people inside your
 network already have access, so no one from the internet in general
 can even see the server.

 Christian.

 On 10-Feb-09, at 18:31 , James Sherwood wrote:

 Hello,



 I was wondering what would be the best way to implement this
 security(sorry
 if it is outside the scope of T5):



 I am only going to allow a certain IP range to log into the site,
 however
 some people need to use the site from laptops on the road.



 What is the best way to accomplish this?  I was thinking through the
 mac
 address of the machine maybe or something of that nature?



 Thanks,

 --James


 Christian Edward Gruber
 christianedwardgru...@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


Christian Edward Gruber
christianedwardgru...@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



Site security

2009-02-10 Thread James Sherwood
Hello,

 

I was wondering what would be the best way to implement this security(sorry
if it is outside the scope of T5):

 

I am only going to allow a certain IP range to log into the site, however
some people need to use the site from laptops on the road. 

 

What is the best way to accomplish this?  I was thinking through the mac
address of the machine maybe or something of that nature?

 

Thanks,

--James



T5: D.O.B. Date component

2009-02-09 Thread James Sherwood
Hello,

 

Just wondering what people are using for a date of birth component.

 

I tried using the built in datefield but users complained that it starts off
in the current year and you have to keep going back to far to get to their
date.  I agree(You and I know you could just choose a date then type in the
year) that it is not working for them and all I have there now is a text
field with a regexp on it.

 

Is there a better way to use the datefield component or another cleaner way
besides regexp on a text field? Or should I just build my own with drop
downs etc?

 

Thanks,

--James



RE: T5: Nice balloon error for 2 text fields possible?

2009-02-07 Thread James Sherwood
Hello,

Is there a quick way to manually produce those balloons?:)

IE by just calling a JavaScript function with the component's id and message
for instance?

Thanks,
--James

-Original Message-
From: Howard Lewis Ship [mailto:hls...@gmail.com] 
Sent: February-06-09 3:05 PM
To: Tapestry users
Subject: Re: T5: Nice balloon error for 2 text fields possible?

Not with the built in stuff. I went to a lot of trouble so that
entering one field fades out the bubbles on any other fields. It's
surprisingly tricky to get right!

On Thu, Feb 5, 2009 at 5:38 AM, James Sherwood
jsherw...@rgisolutions.com wrote:
 Hello,



 Is it possible to have the nice balloon error run across 2 password
fields?



 IE password and confirm password must equal, if not the balloon error
 shows(like a required error) instead of having to output a form error?



 Thanks,

 --James





-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

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


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



T5: Nice balloon error for 2 text fields possible?

2009-02-05 Thread James Sherwood
Hello,

 

Is it possible to have the nice balloon error run across 2 password fields?

 

IE password and confirm password must equal, if not the balloon error
shows(like a required error) instead of having to output a form error?

 

Thanks,

--James



T5: Hibernate/Session question

2009-02-05 Thread James Sherwood
Hello,

 

I have an application state object(Visit) that is storing a hibernate entity
object.

 

In a page I ask for the visit.object.getchildobject.name and receive this
error:

 

[ERROR] hibernate.LazyInitializationException could not initialize proxy -
the owning Session was closed

org.hibernate.LazyInitializationException: could not initialize proxy - the
owning Session was closed

 

 

Can I not do this from application state objects?

 

Thanks,

--James

 



RE: T5: Hibernate/Session question

2009-02-05 Thread James Sherwood
Thanks,

I do not want to have to change the actual POJOs as I generate them using
reverse eng so I think I will just do the lookup.\

Just making sure I was not doing something wrong:)

--James

-Original Message-
From: Sven Homburg [mailto:hombu...@googlemail.com] 
Sent: February-05-09 2:23 PM
To: Tapestry users
Subject: Re: T5: Hibernate/Session question

there are two possible solutions:

first: you declare the collection for childobjects read not lazy

second: you attach the parentobject to a new session and re-read the
childobjects collection


2009/2/5 James Sherwood jsherw...@rgisolutions.com

 Hello,



 I have an application state object(Visit) that is storing a hibernate
 entity
 object.



 In a page I ask for the visit.object.getchildobject.name and receive this
 error:



 [ERROR] hibernate.LazyInitializationException could not initialize proxy -
 the owning Session was closed

 org.hibernate.LazyInitializationException: could not initialize proxy -
the
 owning Session was closed





 Can I not do this from application state objects?



 Thanks,

 --James






-- 
with regards
Sven Homburg
http://www.chenillekit.org
http://tapestry5-components.googlecode.com


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



RE: T5: Hibernate/Session question

2009-02-05 Thread James Sherwood
Hello,

I used session.update(Object) and it worked, is there any difference?

--James

-Original Message-
From: Thiago H. de Paula Figueiredo [mailto:thiag...@gmail.com] 
Sent: February-05-09 4:48 PM
To: Tapestry users
Subject: Re: T5: Hibernate/Session question

Em Thu, 05 Feb 2009 15:59:53 -0300, James Sherwood  
jsherw...@rgisolutions.com escreveu:

 Thanks,

 I do not want to have to change the actual POJOs as I generate them using
 reverse eng so I think I will just do the lookup.\

One solution is to call session.lock(object, LockMode.NONE) before reading  
any property values. It associates the object with the given session, thus  
avoiding the LazyInstantiationException's. ;)

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

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


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



RE: T5: Validation and message catalogue

2009-02-02 Thread James Sherwood
Hello,

NVM I am an idiot.  I was forgetting the t: for the id..:(

Thanks,
--James

-Original Message-
From: James Sherwood [mailto:jsherw...@rgisolutions.com] 
Sent: February-02-09 11:58 AM
To: 'Tapestry users'
Subject: RE: T5: Validation and message catalogue

Hello,

It is not a matter of the text used in the validate(I actually did try it
though), it is a matter of tapestry either a: not finding the file or b: I
am implementing it wrong

--James

-Original Message-
From: Sven Homburg [mailto:hombu...@googlemail.com] 
Sent: February-02-09 11:33 AM
To: Tapestry users
Subject: Re: T5: Validation and message catalogue

try double slashed like this

ssn-regexp=\\d{3}-\\d{2}-\\d{4}

2009/2/2 James Sherwood jsherw...@rgisolutions.com

 Hello,



 I cannot seem to get a textfield validate message to work using regexp and
 message catalogs.



 I use Tomcat/Eclipse.



 This is my .tml:

 tdbCell Phone:/b/td

 tdt:textfield id=cellPhone value=cellPhone//td



 This is my java:

 @Validate(regexp)

 public String getCellPhone(){

 return getVisit().getNstuMember().getCellphone();

 }

 public void setCellPhone(String cellPhone){
 getVisit().getNstuMember().setCellphone(cellPhone);

 }



 This is my message catalogue:

 cellPhone-regexp=\d{3}-\d{2}-\d{4}

 cellPhone-regexp-message=Invalid Number EX: (555) 555-,55



 I have tried placing it(Main.properties) everywhere and tapestry always
 throws this error:

 Render queue error in BeginRender[Main:textfield_7]: Failure reading
 parameter 'validate' of component Main:textfield_7: Validator 'regexp'
 requires a validation constraint (of type java.util.regex.Pattern) but
none
 was provided. The constraint may be provided inside the @Validator
 annotaton
 on the property, or in the associated component message catalogue as key
 'personalForm-textfield_7-regexp' or key 'textfield_7-regexp'.



 In the docs it says to use this format:

 t:textfield t:id=ssn validate=required,regexp/

 And your message catalogue can contain:



 ssn-regexp=\d{3}-\d{2}-\d{4}

 ssn-regexp-message=Social security numbers are in the format 12-34-5678.



 What am I missing?



 Thanks,

 --James








-- 
with regards
Sven Homburg
http://www.chenillekit.org
http://tapestry5-components.googlecode.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: T5: Validation and message catalogue

2009-02-02 Thread James Sherwood
Hello,

It is not a matter of the text used in the validate(I actually did try it
though), it is a matter of tapestry either a: not finding the file or b: I
am implementing it wrong

--James

-Original Message-
From: Sven Homburg [mailto:hombu...@googlemail.com] 
Sent: February-02-09 11:33 AM
To: Tapestry users
Subject: Re: T5: Validation and message catalogue

try double slashed like this

ssn-regexp=\\d{3}-\\d{2}-\\d{4}

2009/2/2 James Sherwood jsherw...@rgisolutions.com

 Hello,



 I cannot seem to get a textfield validate message to work using regexp and
 message catalogs.



 I use Tomcat/Eclipse.



 This is my .tml:

 tdbCell Phone:/b/td

 tdt:textfield id=cellPhone value=cellPhone//td



 This is my java:

 @Validate(regexp)

 public String getCellPhone(){

 return getVisit().getNstuMember().getCellphone();

 }

 public void setCellPhone(String cellPhone){
 getVisit().getNstuMember().setCellphone(cellPhone);

 }



 This is my message catalogue:

 cellPhone-regexp=\d{3}-\d{2}-\d{4}

 cellPhone-regexp-message=Invalid Number EX: (555) 555-,55



 I have tried placing it(Main.properties) everywhere and tapestry always
 throws this error:

 Render queue error in BeginRender[Main:textfield_7]: Failure reading
 parameter 'validate' of component Main:textfield_7: Validator 'regexp'
 requires a validation constraint (of type java.util.regex.Pattern) but
none
 was provided. The constraint may be provided inside the @Validator
 annotaton
 on the property, or in the associated component message catalogue as key
 'personalForm-textfield_7-regexp' or key 'textfield_7-regexp'.



 In the docs it says to use this format:

 t:textfield t:id=ssn validate=required,regexp/

 And your message catalogue can contain:



 ssn-regexp=\d{3}-\d{2}-\d{4}

 ssn-regexp-message=Social security numbers are in the format 12-34-5678.



 What am I missing?



 Thanks,

 --James








-- 
with regards
Sven Homburg
http://www.chenillekit.org
http://tapestry5-components.googlecode.com


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



RE: Palette component

2009-01-27 Thread James Sherwood
Hello,

I just ran into the same problem.

You are probably creating the available and select lists in 2 different
methods, you need to do it in the same method with the SAME object(or at
least with a list that doesn't reload when you pull your select) otherwise
you get that null error(or at least that was my problem) because you are
basically handing your palette objects in your select that do not exist in
your available.

I was using the GenericSelectModel from the JumpStart object select that you
use as both your encoder and model.

Not sure if it's the same problem that I was having but it sounds alot like
it. Posting your java may help.

--James

-Original Message-
From: Geoff Callender [mailto:geoff.callender.jumpst...@gmail.com] 
Sent: January-27-09 12:56 AM
To: Tapestry users
Subject: Re: Palette component

Does this one that works help you?
http://jumpstart.doublenegative.com.au:8080/jumpstart/examples/component/cor
einputcomponents

On 27/01/2009, at 3:32 PM, Davor Miku wrote:

 Anyone, plaese?

 On Mon, Jan 26, 2009 at 10:30 PM, Davor Miku davorm...@gmail.com  
 wrote:

public ListOptionModel getOptions() {
ListOptionModel list = new ArrayListOptionModel();
for (Category c : categories) {
list.add(new CategoryOptionModel(c));
}
return list;
}

 This method returns list of OptionModel objects. If you meant on  
 this, this
 list is not empty. I'm not sure I'm following you.

 On Mon, Jan 26, 2009 at 11:17 PM, Thiago H. de Paula Figueiredo 
 thiag...@gmail.com wrote:

 Em Tue, 27 Jan 2009 00:10:36 -0300, Davor Miku davorm...@gmail.com
 escreveu:

 Hi Thiago,


 Hi!

 Thanks for reply.
 Can you be more specific, please?


 It's 1:12 AM here in Belo Horizonte (Brazil), so please don't mind  
 if the
 answer is as clear as you need. :)

 One of the parameters of Select is model. You should pass a  
 SelectModel to
 it. Basically, a SelectModel is a list of OptionModel instances
 (SelectModel.getOptionModels()), one for each option to appear in  
 your
 select tag (and component). Select does not support null  
 OptionModel's
 returned by SelectModel.getOptionModels(), so the exception you seen
 happens.

 Summary: make sure the SelectModel returned by getCategoryModel()  
 does not
 return nulls in its getOptionModels(). ;)


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

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





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


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



Not able to save objects at a certain point

2009-01-27 Thread James Sherwood
Hello,

 

I am using the in place editor component created in the tapestry for non
believers tutorial.

http://www.infoq.com/articles/tapestry5-intro

 

In the setEdit() method in my java I am trying to do _session.save(Object)
but it will not save.  I have tried @CommitAfter as well as creating and
committing a transaction using the
session(session.beginTransaction/session.getTransaction.commit).  Is there a
reason it will not save at this point because the values are being filled in
correctly and I check after the save to see if the values are still correct
in the object and they are, the save just does not happen.

 

 

--James

 



OnActivate question

2009-01-26 Thread James Sherwood
Hello,

 

I have security through page Activate.

 

All my pages extend a page that has a method:

 

@OnEvent(activate)

Object onSecurityCheck(){

Check security if fails return Index.class

}

 

This works however any page that has its own onActivate() method, the method
still runs (the extended page runs first) but everything still works fine. 

 

Is there a way to prevent the pages onActivate() method(as some have db
calls in them) from running if the extended page's activate method returns a
page.

 

Thanks,

--James



RE: Advanced Component help

2009-01-25 Thread James Sherwood
Hello,

I it sort of working(code is below).  My 2 problems are this:

1:If I put 2 components in the page editing the 2nd, edits the first and I
assume it is because it is always running the first form/zone as the names
of the second ones have _0 after it. I do not know how to get around this.

2:I still cannot figure out how to bubble the event to the page so I can use
the value on submit(IE save the object the field is a member of)


div xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;
div t:type=Zone t:id=zone 
form t:type=form t:zone=zone t:id=form div t:type=Errors/
${value} t:ButtonFragment t:id=buttonfragment t:mixins=triggerfragment
fragment=formfragment/ t:formfragment t:id=formfragment
visible=buttonfragment  input t:type=TextField t:id=value
t:validate=required/ input type=submit value=Save/
/t:formfragment /form /div /div
 
 
public class AjaxEditor
{
@InjectComponent
private Zone zone;

@Parameter
@Property
private String _value;
@Property
private boolean _buttonfragment;

@Component(id = value)
private TextField _valueField;
@Component(id = form)
private Form _form;

@OnEvent(value = EventConstants.VALIDATE_FORM, component=form) public
Object validate() { if (_value == null ||_value.trim().equals()) {
//validation errors _form.recordError(must have a fname); return zone; }
else { return null; // let the form submission process continue } }

@OnEvent(value = EventConstants.SUCCESS, component=form) public Object
sucess() { // do whatever you want _buttonfragment = false; return zone; }



}


Thanks,
--James

-Original Message-
From: James Sherwood [mailto:jsherw...@rgisolutions.com] 
Sent: January-24-09 9:13 PM
To: 'Tapestry users'
Subject: Advanced Component help

Hello,

 

I am looking for a good tutorial(or help) on advanced components with forms
and event bubbling.

 

In particular a component that takes a value(with some paramaters) then
spits out a form with a form fragment inside a zone.  When the user clicks a
button in this component  the value parameter is to be changed and an
OnEvent caught to manipulate it.  I am not even sure if this is.

 

Below is the code I would like to turn into a single value component(it is
basically an in place editor):

 

div t:type=Zone t:id=firstNameZone 

form t:type=form t:zone=firstNameZone t:id=firstNameForm

div t:type=Errors/

${firstName} t:ButtonFragment t:id=modifyFirstName
t:mixins=triggerfragment fragment=firstNameModify/ t:formfragment
t:id=firstNameModify visible=modifyFirstName  input t:type=TextField
t:id=firstName t:validate=required/ input type=submit value=Save/
/t:formfragment

/form

/div

 

@InjectComponent

private Zone firstNameZone;

 

@Property

private String _firstName = Fname;

@Property

private boolean _modifyFirstName;

 

@Component(id = firstName)

private TextField _firstnameField;

@Component(id = firstNameForm)

private Form _firstNameForm;

 

 

@OnEvent(value = EventConstants.VALIDATE_FORM, component=firstNameForm)
public Object validate() { if (_firstName == null
||_firstName.trim().equals()) { //validation errors
_firstNameForm.recordError(must have a fname); return firstNameZone; }
else { return null; // let the form submission process continue } }

 

@OnEvent(value = EventConstants.SUCCESS, component=firstNameForm) public
Object sucess() { // do whatever you want _modifyFirstName = false; return
firstNameZone; }

 

I would like the OnEvent to bubble through to the page.

 

Any nudge in the right direction would be appreciated.

--James



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



Advanced Component help

2009-01-24 Thread James Sherwood
Hello,

 

I am looking for a good tutorial(or help) on advanced components with forms
and event bubbling.

 

In particular a component that takes a value(with some paramaters) then
spits out a form with a form fragment inside a zone.  When the user clicks a
button in this component  the value parameter is to be changed and an
OnEvent caught to manipulate it.  I am not even sure if this is.

 

Below is the code I would like to turn into a single value component(it is
basically an in place editor):

 

div t:type=Zone t:id=firstNameZone 

form t:type=form t:zone=firstNameZone t:id=firstNameForm

div t:type=Errors/

${firstName} t:ButtonFragment t:id=modifyFirstName
t:mixins=triggerfragment fragment=firstNameModify/ t:formfragment
t:id=firstNameModify visible=modifyFirstName  input t:type=TextField
t:id=firstName t:validate=required/ input type=submit value=Save/
/t:formfragment

/form

/div

 

@InjectComponent

private Zone firstNameZone;

 

@Property

private String _firstName = Fname;

@Property

private boolean _modifyFirstName;

 

@Component(id = firstName)

private TextField _firstnameField;

@Component(id = firstNameForm)

private Form _firstNameForm;

 

 

@OnEvent(value = EventConstants.VALIDATE_FORM, component=firstNameForm)
public Object validate() { if (_firstName == null
||_firstName.trim().equals()) { //validation errors
_firstNameForm.recordError(must have a fname); return firstNameZone; }
else { return null; // let the form submission process continue } }

 

@OnEvent(value = EventConstants.SUCCESS, component=firstNameForm) public
Object sucess() { // do whatever you want _modifyFirstName = false; return
firstNameZone; }

 

I would like the OnEvent to bubble through to the page.

 

Any nudge in the right direction would be appreciated.

--James



RE: T5: Component Suggestion/Question

2009-01-22 Thread James Sherwood
Thank you,

However I believe I have solved it and can still just use form fragments.

Below is my class which basically just keeps the checkbox hidden and fires
the click from the button(I believe the reason only a checkbox or radio is
used is because the element itself keeps track of the state, if it was a
button they javascript would have to keep track of it).

QUESTION: onclick, document.getElementById(' + getClientId() +
').click()); Is not proper at all I believe.  Does anyone know how to do
this properly with tapestry?  Would just have to figure out a way to fire
the observe function with the clientid maybe?


public class ButtonFragment extends AbstractField {
/**
* The value to be read or updated. If not bound, the Checkbox will attempt
* to edit a property of its container whose name matches the component's
* id.
*/
@Parameter(required = true, autoconnect = true) private boolean value;

@Inject
private Request request;

@SuppressWarnings(unused)
@Mixin
private RenderDisabled renderDisabled;

@Inject
private ComponentResources resources;

@Environmental
private ValidationTracker tracker;

@BeginRender
void begin(MarkupWriter writer) {
String asSubmitted = tracker.getInput(this);

boolean checked = asSubmitted != null ? Boolean
.parseBoolean(asSubmitted) : value;

writer.element(input, type, button,

value, Edit,

onclick, document.getElementById(' + getClientId() + ').click());

writer.end();

writer.element(input, type, checkbox,

name, getControlName(),

id, getClientId(),

class, t-invisible,

checked, checked ? checked : null);

resources.renderInformalParameters(writer);

decorateInsideField();
}

@AfterRender
void after(MarkupWriter writer) {
writer.end(); // input
}

@Override
protected void processSubmission(String elementName) { String postedValue =
request.getParameter(elementName);

// record as true or false

tracker.recordInput(this, Boolean.toString(postedValue != null));

value = postedValue != null;
}
}

Thanks,
--James

-Original Message-
From: Jonathan O'Connor [mailto:ninki...@eircom.net] 
Sent: January-22-09 5:33 AM
To: Tapestry users
Subject: Re: T5: Component Suggestion/Question

James,
I just did this yesterday. Its based on the code found in the WIKI: 
http://wiki.apache.org/tapestry/Tapestry5AndJavaScriptExplained

My Javascript code sets the class of an element to vanished that does 
display:none in my stylesheet.

// A class that hides and shows the simple and complex input elements of 
the form.
var CustomerSearchInputToggler = Class.create();
CustomerSearchInputToggler.prototype = {
 initialize: function(element, makeSimple) {
 if (makeSimple) {
 Event.observe($(element), 'click', 
this.simplify.bindAsEventListener(this));
 } else {
 Event.observe($(element), 'click', 
this.complicate.bindAsEventListener(this));
 }
 },

 hide: function(element) {
 $(element).className = 'vanished';
 },

 show: function(element) {
 $(element).className = '';
 },

 simplify: function(e) {
 this.hide('complex');
 this.hide('complex1');
 this.hide('complex2');
 this.show('simple');
 this.show('simple1');
 return true;
 },

 complicate: function(e) {
 this.show('complex');
 this.show('complex1');
 this.show('complex2');
 this.hide('simple');
 this.hide('simple1');
 return true;
 }
}

Tapestry.onDOMLoaded(function() {
 new CustomerSearchInputToggler('complex', true);
 new CustomerSearchInputToggler('simple', false);
 CustomerSearchInputToggler.prototype.simplify(null);
});

complex and simple are 2 links in the tml file, simpleX and complexX are 
paragraphs, but they could be any element that you want hidden or shown:
a id=complex href=#${message:makeSimple}/a
a id=simple href=#${message:makeComplex}/a

You also need to inject the javascript file:
 @IncludeJavaScriptLibrary(CustomerSearch.js)

This solution is not perfect, because on load hides the complex input 
fields only after they have been displayed, so the screen flashes. Now I 
could add default styles of display:none to the complexX elements, but 
if the user has Javascript turned off, then they can never see the 
complex parts of the screen. I suppose I could make the anchor links 
ActionLinks, so that when Javascript is not running, the user goes back 
to the server, which refreshes the page showing the complex parts.

What I do like about Tapestry's way of handling Javascript is, one never 
sees onclick attributes in the HTML.

Hope this helps,
Jonathan

On 22/01/2009 02:10, Thiago H. de Paula Figueiredo wrote:
 Em Wed, 21 Jan 2009 22:01:43 -0300, James Sherwood 
 jsherw...@rgisolutions.com escreveu:

 You are like our own little tapestry tutor, and its MUCH appreciated:)

 I'm just a guy who

RE: [Spam Rating:3.18] Re: Table and carriage return

2009-01-21 Thread James Sherwood
Hello,

I have not used T4 going from T3 to T5 but I assume most of the components
are the same.

If you are using the standard insert component you can just declare the raw
parameter as true so you output is changed in any way:

component id=insertText type=Insert
binding name=value expression=message/binding
static-binding name=rawTRUE/static-binding
/component


--James

-Original Message-
From: Cathy_123 [mailto:ndgt...@yahoo.com] 
Sent: January-21-09 7:30 AM
To: users@tapestry.apache.org
Subject: [Spam Rating:3.18] Re: Table and carriage return


Thank you for your answer, but I use Tapestry 4, are there another solutions
or I have to change the version ? It's a project of my company so it's
difficult to change ...

Thank you for your help

cathy



Thiago HP wrote:
 
 On Wed, Jan 21, 2009 at 8:40 AM, Cathy_123 ndgt...@yahoo.com wrote:
 
  I set these values on the java code and I try to add ' \n\r' or '\r\n'
 or
 'br' on the string but tapestry
 doesn't understand this carracters. Do you know how to do it ?
 
 HTML completely ignores newline (\n, \r) characters unless they're
 surrounded by a pre tag.
 By the way, Tapestry templates *must* be valid XML, so you should use
 br/ in your templates, not br.
 
 By default, Tapestry converts  the character in lt;,  in gt; , etc.
 The OutputRaw component

(http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5
/corelib/components/OutputRaw.html)
 does not do this conversion, so it can be a solution to your problem.
 
 And I would like that the table doesn't add automatically the carriage
 return when my string is too long like too.
 
 This is a pure HTML question, not Tapestry related. And I don't know
 the answer . . . Maybe you can try the pre tag.
 
 -- 
 Thiago
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org
 
 
 

-- 
View this message in context:
http://www.nabble.com/Table-and-carriage-return-tp21580648p21581350.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: Re: Table and carriage return

2009-01-21 Thread James Sherwood
Hello,

What is the exception you are getting?

--James

-Original Message-
From: Cathy_123 [mailto:ndgt...@yahoo.com] 
Sent: January-21-09 9:40 AM
To: users@tapestry.apache.org
Subject: [Spam Rating:3.18] RE: [Spam Rating:3.18] Re: Table and carriage
return


Thank you for this issue, It's OK for the carriage return but I have a
little
problem again 

I have to format the value of the column. Instead to do 

 component id=pagesTable type=PagesTable
binding name=source value=myDataModel/
binding name=columns value=literal:!column1,!,!column2/   
 /component

I do 

 component id=pagesTable type=PagesTable
binding name=source value=myDataModel/
binding name=columns value=literal:!column1,!,=column2Column/ 
 /component

because column2 is a List of data. So with the code java, I use
ITableColumnEvaluator and read the list and return list.get(0) + br/
+list.get(1) + br/ +list.get(2)...

so if I have a insert, I do

 component id=pagesTable type=PagesTable
binding name=source value=myDataModel/
binding name=columns value=literal:!column1,!,!columnFormat/  
 /component

  component id=columnFormatColumnValue type=Block/
  component id=columnFormat type=Insert
binding name=value
value=components.pagesTable.tableRow.column2Column/
binding name=raw value=true/
  /component

But I have an exception because of binding name=value
value=components.pagesTable.tableRow.column2Column/
How can I do to format column2 with Insert (format column2 for each line of
table) ?

thank you for your help

Cathy


James Sherwood wrote:
 
 Hello,
 
 I have not used T4 going from T3 to T5 but I assume most of the components
 are the same.
 
 If you are using the standard insert component you can just declare the
 raw
 parameter as true so you output is changed in any way:
 
 component id=insertText type=Insert
   binding name=value expression=message/binding
 static-binding name=rawTRUE/static-binding
 /component
 
 
 --James
 
 -Original Message-
 From: Cathy_123 [mailto:ndgt...@yahoo.com] 
 Sent: January-21-09 7:30 AM
 To: users@tapestry.apache.org
 Subject: [Spam Rating:3.18] Re: Table and carriage return
 
 
 Thank you for your answer, but I use Tapestry 4, are there another
 solutions
 or I have to change the version ? It's a project of my company so it's
 difficult to change ...
 
 Thank you for your help
 
 cathy
 
 
 
 Thiago HP wrote:
 
 On Wed, Jan 21, 2009 at 8:40 AM, Cathy_123 ndgt...@yahoo.com wrote:
 
  I set these values on the java code and I try to add ' \n\r' or '\r\n'
 or
 'br' on the string but tapestry
 doesn't understand this carracters. Do you know how to do it ?
 
 HTML completely ignores newline (\n, \r) characters unless they're
 surrounded by a pre tag.
 By the way, Tapestry templates *must* be valid XML, so you should use
 br/ in your templates, not br.
 
 By default, Tapestry converts  the character in lt;,  in gt; , etc.
 The OutputRaw component


(http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5
 /corelib/components/OutputRaw.html)
 does not do this conversion, so it can be a solution to your problem.
 
 And I would like that the table doesn't add automatically the carriage
 return when my string is too long like too.
 
 This is a pure HTML question, not Tapestry related. And I don't know
 the answer . . . Maybe you can try the pre tag.
 
 -- 
 Thiago
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org
 
 
 
 
 -- 
 View this message in context:
 http://www.nabble.com/Table-and-carriage-return-tp21580648p21581350.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org
 
 
 

-- 
View this message in context:
http://www.nabble.com/Table-and-carriage-return-tp21580648p21583339.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: RE: Re: Table and carriage return

2009-01-21 Thread James Sherwood
Hello,

Unfortunately I do not have T4 experience with these components.

It cannot find that property so perhaps you have the path wrong.

If you send your 3 files to my email I will look at them and see if I can
help.

--James





-Original Message-
From: Cathy_123 [mailto:ndgt...@yahoo.com] 
Sent: January-21-09 10:50 AM
To: users@tapestry.apache.org
Subject: [Spam Rating:3.18] RE: RE: Re: Table and carriage return


I get 

Unable to read OGNL expression 'parsed OGNL expression' of ..
ognl.NoSuchPropertyException

Stack Trace: 
ognl.ObjectPropertyAccessor.getProperty(ObjectPropertyAccessor.java:123) 
ognl.OgnlRuntime.getProperty(OgnlRuntime.java:1616) 
ognl.ASTProperty.getValueBody(ASTProperty.java:96) 
ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:170) 
ognl.SimpleNode.getValue(SimpleNode.java:210) 
ognl.ASTChain.getValueBody(ASTChain.java:109) 
ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:170) 
ognl.SimpleNode.getValue(SimpleNode.java:210) 
ognl.Ognl.getValue(Ognl.java:333) 
ognl.Ognl.getValue(Ognl.java:310) 
org.apache.tapestry.services.impl.ExpressionEvaluatorImpl.readCompiled(Expre
ssionEvaluatorImpl.java:91) 
$ExpressionEvaluator_11ef9a9af22.readCompiled($ExpressionEvaluator_11ef9a9af
22.java) 
org.apache.tapestry.binding.ExpressionBinding.resolveExpression(ExpressionBi
nding.java:110) 
org.apache.tapestry.binding.ExpressionBinding.getObject(ExpressionBinding.ja
va:103) 
org.apache.tapestry.binding.AbstractBinding.getObject(AbstractBinding.java:8
7) 
$Insert_6.getValue($Insert_6.java) 
org.apache.tapestry.components.Insert.renderComponent(Insert.java:42) 
org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:617) 
org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:434)

org.apache.tapestry.components.BlockRenderer.render(BlockRenderer.java:75) 
org.apache.tapestry.components.Delegator.renderComponent(Delegator.java:44) 
org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:617) 
org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:434)

org.apache.tapestry.components.Any.renderComponent(Any.java:48) 
org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:617) 
org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:434)

org.apache.tapestry.components.ForBean.renderComponent(ForBean.java:137) 
org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:617) 
org.apache.tapestry.BaseComponent.renderComponent(BaseComponent.java:92) 
org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:617) 
org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:434)

org.apache.tapestry.components.RenderBody.renderComponent(RenderBody.java:44
) 
 

**

James Sherwood wrote:
 
 Hello,
 
 What is the exception you are getting?
 
 --James
 
 -Original Message-
 From: Cathy_123 [mailto:ndgt...@yahoo.com] 
 Sent: January-21-09 9:40 AM
 To: users@tapestry.apache.org
 Subject: [Spam Rating:3.18] RE: [Spam Rating:3.18] Re: Table and carriage
 return
 
 
 Thank you for this issue, It's OK for the carriage return but I have a
 little
 problem again 
 
 I have to format the value of the column. Instead to do 
 
  component id=pagesTable type=PagesTable
 binding name=source value=myDataModel/
 binding name=columns value=literal:!column1,!,!column2/ 
  /component
 
 I do 
 
  component id=pagesTable type=PagesTable
 binding name=source value=myDataModel/
 binding name=columns value=literal:!column1,!,=column2Column/

  /component
 
 because column2 is a List of data. So with the code java, I use
 ITableColumnEvaluator and read the list and return list.get(0) + br/
 +list.get(1) + br/ +list.get(2)...
 
 so if I have a insert, I do
 
  component id=pagesTable type=PagesTable
 binding name=source value=myDataModel/
 binding name=columns value=literal:!column1,!,!columnFormat/

  /component
 
   component id=columnFormatColumnValue type=Block/
   component id=columnFormat type=Insert
 binding name=value
 value=components.pagesTable.tableRow.column2Column/
 binding name=raw value=true/
   /component
 
 But I have an exception because of binding name=value
 value=components.pagesTable.tableRow.column2Column/
 How can I do to format column2 with Insert (format column2 for each line
 of
 table) ?
 
 thank you for your help
 
 Cathy
 
 
 James Sherwood wrote:
 
 Hello,
 
 I have not used T4 going from T3 to T5 but I assume most of the
 components
 are the same.
 
 If you are using the standard insert component you can just declare the
 raw
 parameter as true so you output is changed in any way:
 
 component id=insertText type=Insert
  binding name=value expression=message/binding
 static-binding name=rawTRUE/static-binding
 /component
 
 
 --James
 
 -Original Message-
 From: Cathy_123 [mailto:ndgt...@yahoo.com] 
 Sent: January-21-09 7:30 AM
 To: users

T5: Component Suggestion/Question

2009-01-21 Thread James Sherwood
Hello,

 

I am trying to create an application that just has a single page basically
with many fields about a member.

 

I need this page to be dynamic whereby and admin can change fields without
refreshing the page.

 

The T5Component InPlaceEditor sort of works however there is no validation
and it is a one way connection meaning if they put invalid data in, there is
no way to let them know.

 

Can anyone suggest a component I might use(or point me in the right
direction to build one) that basically would allow the admin to make changes
to fields on the page without refreshing the page but has validation? 

 

Thanks in advance,

--James



RE: RE: Re: Table and carriage return

2009-01-21 Thread James Sherwood
Hello,

Reading your last post I think your problem is this:

component id=columnFormatColumnValue type=Block/
  component id=columnFormat type=Insert
binding name=value
value=components.pagesTable.tableRow.column2Column/
binding name=raw value=true/
  /component

Should be:

component id=columnFormatColumnValue type=Block/
  component id=columnFormat type=Insert
binding name=value
value=column2Column/
binding name=raw value=true/
  /component

Because components.pagesTable.tableRow.column2Column doesn't exist,
components.pagesTable.tableRow.column2 does.  And column2Column is just a
java method that returns components.pagesTable.tableRow.column2's list
formatted(if I follow what you say correctly)

--James

-Original Message-
From: Cathy_123 [mailto:ndgt...@yahoo.com] 
Sent: January-21-09 9:40 AM
To: users@tapestry.apache.org
Subject: [Spam Rating:3.18] RE: [Spam Rating:3.18] Re: Table and carriage
return


Thank you for this issue, It's OK for the carriage return but I have a
little
problem again 

I have to format the value of the column. Instead to do 

 component id=pagesTable type=PagesTable
binding name=source value=myDataModel/
binding name=columns value=literal:!column1,!,!column2/   
 /component

I do 

 component id=pagesTable type=PagesTable
binding name=source value=myDataModel/
binding name=columns value=literal:!column1,!,=column2Column/ 
 /component

because column2 is a List of data. So with the code java, I use
ITableColumnEvaluator and read the list and return list.get(0) + br/
+list.get(1) + br/ +list.get(2)...

so if I have a insert, I do

 component id=pagesTable type=PagesTable
binding name=source value=myDataModel/
binding name=columns value=literal:!column1,!,!columnFormat/  
 /component

  component id=columnFormatColumnValue type=Block/
  component id=columnFormat type=Insert
binding name=value
value=components.pagesTable.tableRow.column2Column/
binding name=raw value=true/
  /component

But I have an exception because of binding name=value
value=components.pagesTable.tableRow.column2Column/
How can I do to format column2 with Insert (format column2 for each line of
table) ?

thank you for your help

Cathy


James Sherwood wrote:
 
 Hello,
 
 I have not used T4 going from T3 to T5 but I assume most of the components
 are the same.
 
 If you are using the standard insert component you can just declare the
 raw
 parameter as true so you output is changed in any way:
 
 component id=insertText type=Insert
   binding name=value expression=message/binding
 static-binding name=rawTRUE/static-binding
 /component
 
 
 --James
 
 -Original Message-
 From: Cathy_123 [mailto:ndgt...@yahoo.com] 
 Sent: January-21-09 7:30 AM
 To: users@tapestry.apache.org
 Subject: [Spam Rating:3.18] Re: Table and carriage return
 
 
 Thank you for your answer, but I use Tapestry 4, are there another
 solutions
 or I have to change the version ? It's a project of my company so it's
 difficult to change ...
 
 Thank you for your help
 
 cathy
 
 
 
 Thiago HP wrote:
 
 On Wed, Jan 21, 2009 at 8:40 AM, Cathy_123 ndgt...@yahoo.com wrote:
 
  I set these values on the java code and I try to add ' \n\r' or '\r\n'
 or
 'br' on the string but tapestry
 doesn't understand this carracters. Do you know how to do it ?
 
 HTML completely ignores newline (\n, \r) characters unless they're
 surrounded by a pre tag.
 By the way, Tapestry templates *must* be valid XML, so you should use
 br/ in your templates, not br.
 
 By default, Tapestry converts  the character in lt;,  in gt; , etc.
 The OutputRaw component


(http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5
 /corelib/components/OutputRaw.html)
 does not do this conversion, so it can be a solution to your problem.
 
 And I would like that the table doesn't add automatically the carriage
 return when my string is too long like too.
 
 This is a pure HTML question, not Tapestry related. And I don't know
 the answer . . . Maybe you can try the pre tag.
 
 -- 
 Thiago
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org
 
 
 
 
 -- 
 View this message in context:
 http://www.nabble.com/Table-and-carriage-return-tp21580648p21581350.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org
 
 
 

-- 
View this message in context:
http

RE: T5: Component Suggestion/Question

2009-01-21 Thread James Sherwood
Thanks a bunch,

I was actually looking at the screen cast on Ajax and Zones as I suspected
this would be accomplished with zones.

Ideally what I would like to do is create this but have it just output the
value with a small edit button and a hidden text field.  When you click the
edit button it shows the text field and then submits the form much like the
T5Component InPlaceEditor but this would allow validation if the hide/show
part does not mess that up.

I believe it's possible but to turn it into a component may be really
tricky.


--James

-Original Message-
From: Thiago H. de Paula Figueiredo [mailto:thiag...@gmail.com] 
Sent: January-21-09 1:49 PM
To: Tapestry users
Subject: Re: T5: Component Suggestion/Question

Em Wed, 21 Jan 2009 12:20:33 -0300, James Sherwood  
jsherw...@rgisolutions.com escreveu:

 I need this page to be dynamic whereby and admin can change fields  
 without refreshing the page.

Not refreshing a page = AJAX!

Put your Form inside a Zone and submit the form through AJAX.

Something like:

div t:type=Zone t:id=zone
form t:type=form t:zone=zone t:id=form
div t:type=Errors/
.. your fields here.
/form
/div

@InjectComponent
private Zone zone;

@OnEvent(value = EventConstants.VALIDATE_FORM, component=form
public Object validate() {

if (form has validation errors) {
return zone;
}
else {
return null; // let the form submission process continue
}

}

@OnEvent(value = EventConstants.SUCCESS, component=form
public Object sucess() {
// do whatever you want
return zone;
}

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

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


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



RE: T5: Component Suggestion/Question

2009-01-21 Thread James Sherwood
Hello,

I have it created but I have a few questions(code is below):

1: I am using a checkbox for the modify feature but I would like to have an
image or text at the very least, is this possible?(I couldn't find a base
component to satisfy this)

2:I don't like the big red ugliness of the built in form error on submit so
I will just create another variable in the form fragment I fill(or look at
adjusting the css of that error reporting) but is it possible to mimic or
link to the validation bubble that happens on the client side?

div t:type=Zone t:id=zone 

form t:type=form t:zone=zone t:id=form

div t:type=Errors/
${firstName} t:checkbox t:id=modifyFirstName t:mixins=triggerfragment
fragment=firstNameModify/ 
t:formfragment t:id=firstNameModify visible=modifyFirstName 
input t:type=TextField t:id=firstName t:validate=required/ 
input type=submit value=Login/ 
/t:formfragment

/form

/div
 
 
@InjectComponent
private Zone zone;

@Property
private String _firstName = Fname;
@Property
private boolean _modifyFirstName;

@Component(id = firstName)
private TextField _firstnameField;
@Component(id = form)
private Form _form;


@OnEvent(value = EventConstants.VALIDATE_FORM, component=form) public
Object validate() { if (_firstName == null ||_firstName.trim().equals()) {
//validation errors _form.recordError(must have a fname); return zone; }
else { return null; // let the form submission process continue } }

@OnEvent(value = EventConstants.SUCCESS, component=form) public Object
sucess() { // do whatever you want _modifyFirstName = false; return zone; }


Thanks,
James


-Original Message-
From: Thiago H. de Paula Figueiredo [mailto:thiag...@gmail.com] 
Sent: January-21-09 2:25 PM
To: Tapestry users
Subject: Re: T5: Component Suggestion/Question

Em Wed, 21 Jan 2009 14:08:09 -0300, James Sherwood  
jsherw...@rgisolutions.com escreveu:

 Thanks a bunch,

:)

 I was actually looking at the screen cast on Ajax and Zones as I  
 suspected this would be accomplished with zones.

You can do a lot with them. Just be creative. :)

 Ideally what I would like to do is create this but have it just output  
 the value with a small edit button and a hidden text field.

It looks like the FormFragment does at least partly what you want. Its  
documentation has a good example.

 When you click the edit button it shows the text field and then submits  
 the form much like the  T5Component InPlaceEditor but this would allow  
 validation if the hide/show part does not mess that up.

How does it mess up? I use submit forms with AJAX all the time and the  
validation messages never got messed up.

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

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


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



RE: T5: Component Suggestion/Question

2009-01-21 Thread James Sherwood
You are like our own little tapestry tutor, and its MUCH appreciated:)

 I don't think this would be possible only using the built-in Tapestry
component, but I wish I am wrong. :)

Before I go looking into the code, would it be possible to build one whereby
you just click an image to change hidden/shown of the form fragment?

If so would I just start by basing it off the built in checkbox component?

Unfortunately the checkbox is such an ugly/clunky implementation of a really
awesome little component.

Thanks,
--James

-Original Message-
From: Thiago H. de Paula Figueiredo [mailto:thiag...@gmail.com] 
Sent: January-21-09 7:32 PM
To: Tapestry users
Subject: Re: T5: Component Suggestion/Question

Em Wed, 21 Jan 2009 15:36:21 -0300, James Sherwood  
jsherw...@rgisolutions.com escreveu:

 Hello,

Hi!

 1: I am using a checkbox for the modify feature but I would like to have  
 an image or text at the very least, is this possible?(I couldn't find a  
 base
 component to satisfy this)

I don't think this would be possible only using the built-in Tapestry  
component, but I wish I am wrong. :)

 2:I don't like the big red ugliness of the built in form error on submit  
 so I will just create another variable in the form fragment I fill(or  
 look at adjusting the css of that error reporting) but is it possible to  
 mimic or
 link to the validation bubble that happens on the client side?

You can add your own CSS overriding the default Errors component styling.  
This way, you can style the error messages in any way you want. By  
default, the generated div tag has class=t-error.

That's one of the Tapestry strengths: its components have their default  
style, but you can always override them using ordinary CSS techniques.

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

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


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



Inplaceeditor question.

2009-01-20 Thread James Sherwood
Hello,

 

This is for anyone that knows about the editor located here: (part of the
t5components project)

 

http://87.193.218.134:8080/t5c-demo/inplaceeditorpage

 

Is there a way to disable the editing feature or do I have to just put an
output instead of the inplaceeditor for items I do not want that particular
user to edit.

 

Thanks,

--James



RE: Inplaceeditor question.

2009-01-20 Thread James Sherwood
Hello,

I modified the component so it has a disable parameter. 

--James

-Original Message-
From: James Sherwood [mailto:jsherw...@rgisolutions.com] 
Sent: January-20-09 11:32 AM
To: 'Tapestry users'
Subject: Inplaceeditor question.

Hello,

 

This is for anyone that knows about the editor located here: (part of the
t5components project)

 

http://87.193.218.134:8080/t5c-demo/inplaceeditorpage

 

Is there a way to disable the editing feature or do I have to just put an
output instead of the inplaceeditor for items I do not want that particular
user to edit.

 

Thanks,

--James



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



InPlaceEditor validation

2009-01-20 Thread James Sherwood
Hello,

 

The t5components inplaceeditor is what I am referring to:

http://87.193.218.134:8080/t5c-demo/inplaceeditorpage

 

Does anyone know a way to do validation on this?   Currently when you save
with nothing in the text field there is a properties file that is read from
and it just fills it with that text or you can just send back the regular
text that was in the box but this does not really help the less intelligent
user to understand why the change did not take.

 

I was thinking the easiest way would be to have another component accompany
this one that would accept server information and display it above however I
cannot figure out a way to do this.  

 

If anyone could point me in the right direction that would be appreciated.

 

--James



Possible to override onActivate from an extended page?

2009-01-19 Thread James Sherwood
Hello,

 

I have a login only application and for the most part you just need to be
logged in to use it except for a couple of pages.

 

To enforce this I made a class:

 

Class SecurePage{

 

Object onActivate(){

If(!visitExists){

Return index.class;

}

Return null;

 

}

 

I just then extend my pages with this one.(which will have other various
methods common to many pages)

 

My problem:  Is there a way to override the onActivate (or a way around it)
in the page that extends SecurePage so I could perform additional security
checks?

 

Thanks,

--James



RE: Possible to override onActivate from an extended page?

2009-01-19 Thread James Sherwood
Hello,

Short answer: It is in a different package(base) so the override won't work
for a page class in the pages package(or so says my compiler:).

Not so short answer: I really like this thanks!

Long answer:  Looking into it but what is the advantage over just the more
simple 'activate'?

--James


-Original Message-
From: Thiago H. de Paula Figueiredo [mailto:thiag...@gmail.com] 
Sent: January-19-09 3:07 PM
To: Tapestry users
Subject: Re: Possible to override onActivate from an extended page?

Em Mon, 19 Jan 2009 15:02:07 -0300, James Sherwood  
jsherw...@rgisolutions.com escreveu:

 My problem:  Is there a way to override the onActivate (or a way around  
 it) in the page that extends SecurePage so I could perform additional  
 security checks?

Short answer: yes, ordinary inheritence works for Tapestry pages too.

Not so short answer: you can have more methods invoked when the page is  
requested:
@OnEvent(activate)
public Object doSomething() { ... }

Long answer: user authentication and other cross-page logic is usually  
better implemented in RequestFilters. Search this mailing list and the  
wiki for examples. :)

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

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


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



RE: T5 and hibernate slowing with more records

2009-01-16 Thread James Sherwood
Hello,

Thank you for everyone's input.

I had originally taken out the sub queries from the main method and moved
them to another method(IE check if city is there if not add it and link the
foreign key) and then moved it to a map held in memory(still putting unknown
ones in the db) so there were less calls to the db.  This didn't help but
then I moved back to the @CommitAfter(which was the original way I had
started) and it worked fine.

I like your clear idea and creating my own transactions.  I think I'll give
that a go as well.

--James

-Original Message-
From: Jonathan Barker [mailto:jonathan.theit...@gmail.com] 
Sent: January-16-09 12:31 AM
To: 'Tapestry users'
Subject: RE: T5 and hibernate slowing with more records

Been there, hit that.

You need to clear() the session.  Or, you can also evict() as you go.

Basically, every time Hibernate needs to commit something, it needs to flush
to the database, and it looks at all of the Hibernate objects that it knows
about - not just those to which you have current references.  For every
object you handle, you add one more that it needs to check to see if it
needs to have changes flushed.

The clear() gets rid of anything you are not holding a reference to.

I tend to do it every ten records or so, but I've never tried to optimize
it.

The other option, as someone suggested, is to commit a batch rather than
single records, but that can be nasty for large sets.  I'm working with an
import of about 250,000 records as I write this.

Jonathan




 -Original Message-
 From: James Sherwood [mailto:jsherw...@rgisolutions.com]
 Sent: Thursday, January 15, 2009 13:16
 To: 'Tapestry users'
 Subject: T5 and hibernate slowing with more records
 
 Hello,
 
 
 
 I am using POI to take an excel file and put it into a Mysql database
 using
 hibernate.
 
 
 
 I put a counter on the records going into the database and it starts off
 fast but then slows to over 15 seconds a record and I cannot figure out
 why.
 
 
 
 My code is basically this:
 
 
 
 Public class DatabaseDump{
 
 
 
 @Inject
 
 Private Session _session;
 
 
 
 Public void onAction(){ //they hit the go button
 
 Loop rows{
 
 
 _session.beginTransaction();
 
 Loop cells{
 
 Fill the
 object from the cells
 
 
 _session.save(Object);
 
 }
 
 
 _session.getTransaction().commit();
 
 }
 
 }
 
 
 
 Everything works fine as in the database gets filled for the rows it has
 completed but gradually slows to a crawl and at around 2700 records of
 10500
 records it's a record every 15 seconds.
 
 
 
 I run the project under eclipse using Tomcat.  The memory starts at around
 80mb and only goes up to around 110mb.
 
 
 
 What am I doing wrong?
 
 
 
 --James
 
 
 
 



-
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



T5 and hibernate slowing with more records

2009-01-15 Thread James Sherwood
Hello,

 

I am using POI to take an excel file and put it into a Mysql database using
hibernate.

 

I put a counter on the records going into the database and it starts off
fast but then slows to over 15 seconds a record and I cannot figure out why.

 

My code is basically this:

 

Public class DatabaseDump{

 

@Inject

Private Session _session;

 

Public void onAction(){ //they hit the go button

Loop rows{

_session.beginTransaction();

Loop cells{

Fill the
object from the cells

 
_session.save(Object);

}

 
_session.getTransaction().commit();

}

}

 

Everything works fine as in the database gets filled for the rows it has
completed but gradually slows to a crawl and at around 2700 records of 10500
records it's a record every 15 seconds.

 

I run the project under eclipse using Tomcat.  The memory starts at around
80mb and only goes up to around 110mb.

 

What am I doing wrong?

 

--James

 

 



RE: T5 and hibernate slowing with more records

2009-01-15 Thread James Sherwood
Hello,

I suppose I could restrict the number of records allowed however I do not
believe that I need to.  I believe there is a problem somewhere, maybe in
how I am doing the transactions or something.

Before using t5/hibernate we were using t3/torque and if that system would
have no problem with this I cannot see the newer technology having any
problem.

I guess I will ask the hibernate forums but I thought it would have
something to do with the way I use the session/transactions.

--James

-Original Message-
From: Szemere Szemere [mailto:szemereszem...@googlemail.com] 
Sent: January-15-09 6:30 PM
To: Tapestry users
Subject: Re: T5 and hibernate slowing with more records

Feels like a Hibernate question, not Tapestry.  Does your table have the
right index, do you need to have 10k transactions in a single web-request?
Szemere


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



RE: T5 and hibernate slowing with more records

2009-01-15 Thread James Sherwood
Hello,

Sorry I forgot to mention that I do not believe indexing is an issue as it
is only an 'over time' issue that it gets slow not a total number in the db
that causes the slowness.  I can have 0 records or 40k records in the db and
the transactions are still blazing fast at the start.

--James

-Original Message-
From: Szemere Szemere [mailto:szemereszem...@googlemail.com] 
Sent: January-15-09 6:30 PM
To: Tapestry users
Subject: Re: T5 and hibernate slowing with more records

Feels like a Hibernate question, not Tapestry.  Does your table have the
right index, do you need to have 10k transactions in a single web-request?
Szemere


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



RE: Re: T5 and hibernate slowing with more records

2009-01-15 Thread James Sherwood
Hello,

It took 13 seconds to create the List with 14000 objects.

At 1 hour 45 minutes I was at 8600 records committing each one.

For the service, I haven't went that far in T5 yet so I will have to look it
up.

If there was a way to save the whole list at once using the session that
might be faster as well.

--James

-Original Message-
From: Angelo Chen [mailto:angelochen...@yahoo.com.hk] 
Sent: January-15-09 9:33 PM
To: users@tapestry.apache.org
Subject: [Spam Rating:3.18] Re: T5 and hibernate slowing with more records


Hi James,

I do not see any reason why it is slow, but would suggest to do following:

1) try to put everything into a list of objects without saving to the
database, slow? 
2) use a service to accept the list from #1, beging a transaction, save,
commit, slow?


Angelo


James Sherwood wrote:
 
 Hello,
 
  
 
 I am using POI to take an excel file and put it into a Mysql database
 using
 hibernate.
 
  
 
 I put a counter on the records going into the database and it starts off
 fast but then slows to over 15 seconds a record and I cannot figure out
 why.
 
  
 
 My code is basically this:
 
  
 
 Public class DatabaseDump{
 
  
 
 @Inject
 
 Private Session _session;
 
  
 
 Public void onAction(){ //they hit the go button
 
 Loop rows{
 

 _session.beginTransaction();
 
 Loop cells{
 
 Fill the
 object from the cells
 
  
 _session.save(Object);
 
 }
 
  
 _session.getTransaction().commit();
 
 }
 
 }
 
  
 
 Everything works fine as in the database gets filled for the rows it has
 completed but gradually slows to a crawl and at around 2700 records of
 10500
 records it's a record every 15 seconds.
 
  
 
 I run the project under eclipse using Tomcat.  The memory starts at around
 80mb and only goes up to around 110mb.
 
  
 
 What am I doing wrong?
 
  
 
 --James
 
  
 
  
 
 
 

-- 
View this message in context:
http://www.nabble.com/T5-and-hibernate-slowing-with-more-records-tp21483684p
21490838.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: Tapestry 5, WAR files and deployment

2008-11-06 Thread James Sherwood
Hello,

I deploy to tomcat but war essentials should be the same.  I think the only
difference between tomcat and Jetty are Tomcats classloaders which maven
takes care of apparently.

Just create the WAR with eclipse and drop it in your deploy folder(tomcat is
the webapps directory and you don't even have to create a context) but for
Jetty you may have too. Just do a quick search on deploying war's to jetty.

This is one example that might help you(I am not familiar with Jetty):

http://markmail.org/message/csnnytlurso7b3ut

--James

-Original Message-
From: tapestryphoto [mailto:[EMAIL PROTECTED] 
Sent: November-06-08 10:19 AM
To: users@tapestry.apache.org
Subject: Tapestry 5, WAR files and deployment

Hi,

Having gone through the Tapestry tutorials, got to grips with it,  
developed a small application and have got it running well I'd like to  
actually deploy it.

I notice there are no documents, examples or tutorials (as far as I  
can see) that address how to do this. Even the Tapestry 5 book is  
pretty silent on the issue (apart from telling me what a WAR file is -  
and even I know that). Perhaps someone could whip up a Wiki entry?


I'm using Eclipse. I'd like to:

1) create a WAR from my project

2) deploy it on a server that has Jetty running.


Do I need something like the following build.xml:

project name=war_demo default=build_war
target name=build_war
   war destfile=dportal.war webxml=src/main/webapp/WEB-INF
classes dir=target/
/war
/target
/project

Is there anthing else I need to do for this Ant target?

Or do I use Maven?  And is that something like a command line call:  
mvn war:war
or are there other things I need to do first?


I then place the resulting WAR in the webapps directory under Jetty  
and start Jetty.

Correct?


p.





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


__ Information from ESET Smart Security, version of virus signature
database 3536 (20081019) __

The message was checked by ESET Smart Security.

http://www.eset.com

 

__ Information from ESET Smart Security, version of virus signature
database 3536 (20081019) __

The message was checked by ESET Smart Security.

http://www.eset.com
 


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



RE: Tapestry 5, WAR files and deployment

2008-11-06 Thread James Sherwood
Hello,

I just file/export/war in eclipse. Works fine for tomcat.

--James

-Original Message-
From: Olle Hallin [mailto:[EMAIL PROTECTED] 
Sent: November-06-08 11:15 AM
To: Tapestry users
Subject: Re: Tapestry 5, WAR files and deployment

Everyday one learns something new is a good day :D
Olle


2008/11/6 Thiago H. de Paula Figueiredo [EMAIL PROTECTED]

 Em Thu, 06 Nov 2008 12:05:50 -0300, Olle Hallin [EMAIL PROTECTED]
 escreveu:

  Hi,
 If you insist on doing it from within Eclipse, then

   1. install the m2eclipse plugin
   2. enable Maven for your project
   3. right-click pom.xml and invoke Run As - Maven package


 You can also right-click the project and invoke Run As - Maven package.
 Just a little faster than finding the pom.xml. :)

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

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




-- 
Olle Hallin M.Sc.
+46 70 6653071
[EMAIL PROTECTED]
www.hit.se



__ Information from ESET Smart Security, version of virus signature 
database 3536 (20081019) __

The message was checked by ESET Smart Security.

http://www.eset.com
 

__ Information from ESET Smart Security, version of virus signature 
database 3536 (20081019) __

The message was checked by ESET Smart Security.

http://www.eset.com
 


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



RE: Tapestry 5, WAR files and deployment

2008-11-06 Thread James Sherwood
Hello,

You need to put those dependencies in your pom.xml file.(did you check if it 
works just using the eclipse built in war exporter?)


--James

-Original Message-
From: tapestryphoto [mailto:[EMAIL PROTECTED] 
Sent: November-06-08 11:50 AM
To: users@tapestry.apache.org
Subject: Re: Tapestry 5, WAR files and deployment

Quoting Olle Hallin [EMAIL PROTECTED]:

 Does it work from the command line?
 Olle


I tried mvn war:war from the project directory.

Bizarrely it gives even more problems.  I find Maven very frustrating...


[INFO] Failed to resolve artifact.

Missing:
--
1) org.apache.maven:maven-archiver:jar:2.2

   Try downloading the file manually from the project website.

   Then, install it using the command:
   mvn install:install-file -DgroupId=org.apache.maven  
-DartifactId=maven-arc
hiver -Dversion=2.2 -Dpackaging=jar -Dfile=/path/to/file

   Alternatively, if you host your own repository you can deploy the  
file there:

   mvn deploy:deploy-file -DgroupId=org.apache.maven  
-DartifactId=maven-archi
ver -Dversion=2.2 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url]  
-DrepositoryI
d=[id]

   Path to dependency:
 1) org.apache.maven.plugins:maven-war-plugin:maven-plugin:2.1-alpha-1
 2) org.apache.maven:maven-archiver:jar:2.2

2) org.codehaus.plexus:plexus-utils:jar:1.4.7

   Try downloading the file manually from the project website.

   Then, install it using the command:
   mvn install:install-file -DgroupId=org.codehaus.plexus  
-DartifactId=plexus
-utils -Dversion=1.4.7 -Dpackaging=jar -Dfile=/path/to/file

   Alternatively, if you host your own repository you can deploy the  
file there:

   mvn deploy:deploy-file -DgroupId=org.codehaus.plexus  
-DartifactId=plexus-u
tils -Dversion=1.4.7 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url]  
-Dreposito
ryId=[id]

   Path to dependency:
 1) org.apache.maven.plugins:maven-war-plugin:maven-plugin:2.1-alpha-1
 2) org.codehaus.plexus:plexus-utils:jar:1.4.7

3) com.thoughtworks.xstream:xstream:jar:1.2.2

   Try downloading the file manually from the project website.

   Then, install it using the command:
   mvn install:install-file -DgroupId=com.thoughtworks.xstream  
-DartifactId=x
stream -Dversion=1.2.2 -Dpackaging=jar -Dfile=/path/to/file

   Alternatively, if you host your own repository you can deploy the  
file there:

   mvn deploy:deploy-file -DgroupId=com.thoughtworks.xstream  
-DartifactId=xst
ream -Dversion=1.2.2 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url]  
-Dreposito
ryId=[id]

   Path to dependency:
 1) org.apache.maven.plugins:maven-war-plugin:maven-plugin:2.1-alpha-1
 2) com.thoughtworks.xstream:xstream:jar:1.2.2

--
3 required artifacts are missing.



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


__ Information from ESET Smart Security, version of virus signature 
database 3536 (20081019) __

The message was checked by ESET Smart Security.

http://www.eset.com

 

__ Information from ESET Smart Security, version of virus signature 
database 3536 (20081019) __

The message was checked by ESET Smart Security.

http://www.eset.com
 


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



RE: [Spam Rating:3.40] Re: T5: Ajax components

2008-11-04 Thread James Sherwood
Hello,

I am just in the process of learning T5 so the 'easy' part is not so 'easy'
right now.

Is there any good tutorials on how to make components like I listed by
chance?

--James

-Original Message-
From: devilabit [mailto:[EMAIL PROTECTED] 
Sent: October-31-08 5:55 PM
To: users@tapestry.apache.org
Subject: [Spam Rating:3.40] Re: T5: Ajax components


It is easy to make custom components or create mixins in Tapestry and the
t5components you mention do look promising.  You also have the option of
using another javascript library like extjs if you need more advanced sexy
looking widgets.


James Sherwood wrote:
 
 Hello,
 
  
 
 I have been looking into some Ajax components to use in my upcoming T5
 project.
 
  
 
 Tapestry itself does not seem to have much along these lines built in and
 I
 was wondering where people are getting there Ajax components from(besides
 building them as this seems a bit above me right now)?
 
  
 
 The T5Components site seems to be the best and I am particularly
 interested
 in the in place editor:
 
  
 
 http://87.193.218.134:8080/t5c-demo/inplaceeditorpage
 
  
 
 and the tab set style of component:
 
  
 
 http://87.193.218.134:8080/t5c-demo/tabsetpage
 
  
 
 Are these the components I should be using or is there going to be built
 in
 ones at some point or am I missing something about using Ajax in T5 for
 components such as these?
 
  
 
  
 
  
 
 Thanks,
 
 --James
 
  
 
  
 
  
 
 
 

-- 
View this message in context:
http://www.nabble.com/T5%3A-Ajax-components-tp20246910p20273881.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


__ Information from ESET Smart Security, version of virus signature
database 3536 (20081019) __

The message was checked by ESET Smart Security.

http://www.eset.com

 

__ Information from ESET Smart Security, version of virus signature
database 3536 (20081019) __

The message was checked by ESET Smart Security.

http://www.eset.com
 


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



T5: How to reverse engineer Tapestry Annotations with Hibernate

2008-10-30 Thread James Sherwood
Hello,

 

I have the reverse engineering working correctly but I wish to modify it a
bit. 

Tapestry requires and @Validate(required) annotation in front of the
variables of the class that are required for global validation. (Unless
there is a way to do global validation without using @validate in the
entities class) I have to manually put these in each time I regenerate my
POJOs. Is there a way I can make this happen automatically when I generate
my POJO's? 


Currently it puts this annotation in front of required field's getters: 
@Column(name = fieldname, nullable = false, length = 100) 

Some information that may be needed: 

In the Hibernate Code Generation window: 

Tab: Main 
Reverse engineer from JDBC Connection checked 
Generate basic typed composite ids checked 
Detect optimistic lock columns checked 
Detect many-to-many tables checked 

Tab: Exporters 
Use Java 5 syntax checked 
Generate EJB3 annotations checked 
Domain code(.java) checked 


Thanks, 
--James



T5: Ajax components

2008-10-30 Thread James Sherwood
Hello,

 

I have been looking into some Ajax components to use in my upcoming T5
project.

 

Tapestry itself does not seem to have much along these lines built in and I
was wondering where people are getting there Ajax components from(besides
building them as this seems a bit above me right now)?

 

The T5Components site seems to be the best and I am particularly interested
in the in place editor:

 

http://87.193.218.134:8080/t5c-demo/inplaceeditorpage

 

and the tab set style of component:

 

http://87.193.218.134:8080/t5c-demo/tabsetpage

 

Are these the components I should be using or is there going to be built in
ones at some point or am I missing something about using Ajax in T5 for
components such as these?

 

 

 

Thanks,

--James

 

 

 



RE: T5: Using with hibernate and Mysql

2008-10-27 Thread James Sherwood
Thank you, it seems to have created all the classes with annotations
correctly!

I tried to create a beaneditform off the User class but I get the error:

Exception instantiating instance of com.james.taphib.entities.Users (for
component 'AddUser:user.editor'): Error invoking constructor
com.james.taphib.entities.Users(Occupation, String, String) (at
Users.java:35) (for service 'BeanModelSource'): No service implements the
interface com.james.taphib.entities.Occupation. [at
classpath:org/apache/tapestry5/corelib/components/BeanEditForm.tml, line 7,
column 85]

It is just a base form:

html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;
head
titleAdd User/title
/head
body
h1Adding New User/h1
t:beaneditform t:id=user/
/body
/html

And class:

public class AddUser {
@Persist
private Users user;

public Users getUser() {
return user;
}

public void setUser(Users user) {
this.user = user;
}

}

It seems to have trouble with the foreign key to occupation.  I must be
missing a getter or an inject or something.

Any help would be appreciated.

--James


-Original Message-
From: Thiago H. de Paula Figueiredo [mailto:[EMAIL PROTECTED] 
Sent: October-26-08 7:38 PM
To: Tapestry users
Subject: Re: T5: Using with hibernate and Mysql

Em Sun, 26 Oct 2008 16:23:46 -0300, James Sherwood  
[EMAIL PROTECTED] escreveu:

 Thank you,

Hi, James!

 You wouldn't have a link to a demo of the JPA generation.
 I use eclipse to generate it and cannot find such a generation type.
 The instructions I used were here:
 http://www.wikihow.com/Generate-Hibernate-Pojo-Classes-from-DB-Tables

Reading it, I'm now sure you have selected the generation of mappings  
using XML.

Take a look at this image:  
http://docs.jboss.org/tools/2.1.0.Beta1/hibernatetools/html/images/plugins/p
lugins_8.png  
 from the Hibernate Tools documentation here:  
http://docs.jboss.org/tools/2.1.0.Beta1/hibernatetools/html/plugins.html#d0e
890.

Check the Use Java syntax and Generate EJB3 annotations options to  
have your mappings done by JPA annotations. ;)

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

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


__ Information from ESET Smart Security, version of virus signature
database 3536 (20081019) __

The message was checked by ESET Smart Security.

http://www.eset.com

 

__ Information from ESET Smart Security, version of virus signature
database 3536 (20081019) __

The message was checked by ESET Smart Security.

http://www.eset.com
 


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



RE: T5: Using with hibernate and Mysql

2008-10-27 Thread James Sherwood
Thank you again:)

I used:

@OnEvent(component = userEditor, value=Form.PREPARE) public void
instantiateObject() {
user = new User();
}

This produces the form but without a dropdown of occupation.  
The user.occupation is just an occupation object and not a list so how do
you handle foreign keys in beaneditform?

--James

-Original Message-
From: Thiago H. de Paula Figueiredo [mailto:[EMAIL PROTECTED] 
Sent: October-27-08 9:27 AM
To: Tapestry users
Subject: Re: T5: Using with hibernate and Mysql

Em Mon, 27 Oct 2008 09:20:01 -0300, James Sherwood  
[EMAIL PROTECTED] escreveu:

 Thank you, it seems to have created all the classes with annotations
 correctly!

You're welcome!

 I tried to create a beaneditform off the User class but I get the error:

 Exception instantiating instance of com.james.taphib.entities.Users (for
 component 'AddUser:user.editor'): Error invoking constructor
 com.james.taphib.entities.Users(Occupation, String, String) (at
 Users.java:35) (for service 'BeanModelSource'):

When instantiating a class, BeanEditForm uses the same approach as the one  
used when you declare some service via ServiceBinder.bind(...). I suggest  
you to instantiate you class yourself before the form is rendered:

@OnEvent(component = yourBeanEditFormIdHere, value=Form.PREPARE)
public void instantiateObject() {
yourField = new Users(..);
}

The prepare event of the Form component is fired before the component is  
rendered and before the form values are set in your object(s) fields.

Another suggestions: rename your Users class to User. :)

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

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


__ Information from ESET Smart Security, version of virus signature
database 3536 (20081019) __

The message was checked by ESET Smart Security.

http://www.eset.com

 

__ Information from ESET Smart Security, version of virus signature
database 3536 (20081019) __

The message was checked by ESET Smart Security.

http://www.eset.com
 


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



RE: T5: Using with hibernate and Mysql

2008-10-27 Thread James Sherwood
Thank you for your quick responses.

I cannot figure out how to produce the SelectionModel from a list of
occupations. I am not sure if I am just being dumb and have been staring at
this too long now or what:)

My method is this:

public SelectModel getOccupationModel(){
return _session.createCriteria(Occupation.class).list();
}

Maybe there is an easier way to get the information from occupation using
hibernate that I am missing as this seems kind of clunky compared to the
advanced nature of the beaneditform.

--James

-Original Message-
From: Thiago H. de Paula Figueiredo [mailto:[EMAIL PROTECTED] 
Sent: October-27-08 9:50 AM
To: Tapestry users
Subject: Re: T5: Using with hibernate and Mysql

Em Mon, 27 Oct 2008 09:42:25 -0300, James Sherwood  
[EMAIL PROTECTED] escreveu:

 Thank you again:)

You're welcome again! :)

 I used:

 @OnEvent(component = userEditor, value=Form.PREPARE) public void
 instantiateObject() {
   user = new User();
   }

 This produces the form but without a dropdown of occupation.
 The user.occupation is just an occupation object and not a list so how do
 you handle foreign keys in beaneditform?

Inside your BeanEditForm, use something like that:

t:parameter name=occupation
select t:type=Select t:model=occupationModel .../
/t:paramater

The t:parameter tag is used by BeanEditForm to override the way some field  
is showed to the user. You can see more details at the end of  
http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/
corelib/components/BeanEditForm.html.

The Select component is just what you need to edit the occupation field  
and its documentation is here:  
http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/
corelib/components/Select.html

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

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


__ Information from ESET Smart Security, version of virus signature
database 3536 (20081019) __

The message was checked by ESET Smart Security.

http://www.eset.com

 

__ Information from ESET Smart Security, version of virus signature
database 3536 (20081019) __

The message was checked by ESET Smart Security.

http://www.eset.com
 


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



RE: T5: Using with hibernate and Mysql

2008-10-27 Thread James Sherwood
Thank you very much for your help.

Tutorials on this sort of thing are SO hard to find at the moment(and not be
outdated severely or just skim the very surface).

I am quite surprised at the chunkiness of foreign key manipulation when
using the beaneditform when you compare it to the gracefulness of what I
have learned in T5 so far. Maybe this sort of thing will be added to the
tapestry-hibernate libraries in the future though.

I found a nice component for using objects with a select at:
http://wiki.apache.org/tapestry/Tapestry5SelectObject
but could only get it to produce I think the object toString()(I know I
could override it in my class).  I am going to test it more though.

If anyone comes across a nice fairly in-depth tutorial on the whole
tapestry/hibernate scenario I would greatly appreciate it being sent my way
as I am about to start our next big project in T5 as opposed to our current
severely outdated use of T3:)

Thanks again,
--James


-Original Message-
From: Thiago H. de Paula Figueiredo [mailto:[EMAIL PROTECTED] 
Sent: October-27-08 11:13 AM
To: Tapestry users
Subject: Re: T5: Using with hibernate and Mysql

Em Mon, 27 Oct 2008 10:36:39 -0300, James Sherwood  
[EMAIL PROTECTED] escreveu:

 I cannot figure out how to produce the SelectionModel from a list of
 occupations. I am not sure if I am just being dumb and have been staring  
 at this too long now or what:)

Use an SelectModel implementation. You can build it yourself or use  
SelectModelImpl from Tapestry.
You'll need an OptionModel implementation too. You can build it yourself  
or use OptionModelImpl from Tapestry.

 My method is this:

 public SelectModel getOccupationModel(){
   return _session.createCriteria(Occupation.class).list();
   }

Your method would look like this (not tested):

public SelectModel getOccupationModel(){
ListOccupation list =
_session.createCriteria(Occupation.class).list();
ListOptionModel options = new ArrayListOptionModel();
for (Occupation occupation : list) {
options = new OptionModelImpl(occupation.getName(),
occupation.getId());
}
return new SelectModelImpl(null, options);
}


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

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


__ Information from ESET Smart Security, version of virus signature
database 3536 (20081019) __

The message was checked by ESET Smart Security.

http://www.eset.com

 

__ Information from ESET Smart Security, version of virus signature
database 3536 (20081019) __

The message was checked by ESET Smart Security.

http://www.eset.com
 


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



T5: Global entity validation not in the entity

2008-10-27 Thread James Sherwood
Hello,

 

I was wondering if there is a way to do global validation on entities
without using @validate in the entity.

 

If I have:

 

Public class user{

 

@Validate(required)

Private string username;

Private string password;

 

Getters/setters

}

 

I want to be able to replace the @Validate(required) by putting it
somewhere that it is global to the application, maybe like the .properties
file or somewhere.

 

 

The reason I would like to do this is I will be routinely over righting my
entities as I need to regenerate them from hibernate and do not want to put
the validates in that I have already put in as well I do not want to have to
put the validates in the pages each time I use the entity.

 

Thanks,

--James

 



RE: T5: Using with hibernate and Mysql

2008-10-26 Thread James Sherwood
Thanks for the information this far,

I have used hibernate-tools to reverse engineer my tables and I built a
small test database to try to work with a foreign key but so far I cannot
get it to work.

My tables are simple:
Users
Userid INTEGER
FirstName VARCHAR
LastName VARCHAR
Ocid INTEGER(The foreign key to occupation)

Occupation
Ocid INTEGER
Ocname VARCHAR

When I generate them using hibernate tools I still have to add the:
@Entity
@Table(name=occupation)
For the table and
@Id
@GeneratedValue
For the id.

The problem is, when I try to run it I get this error:
Could not determine type for: java.util.Set, for columns:
[org.hibernate.mapping.Column(userses)]

This is the foreign key so I assume it is not being generated correctly.

Any help would be appreciated.  Below is my 2 classes;

@Entity
@Table(name=users)
public class Users {

@Id
@GeneratedValue
private Integer userid;
private Occupation occupation;
private String firstName;
private String lastName;

public Users() {
}

public Users(Occupation occupation) {
this.occupation = occupation;
}

public Users(Occupation occupation, String firstName, String
lastName) {
this.occupation = occupation;
this.firstName = firstName;
this.lastName = lastName;
}

public Integer getUserid() {
return this.userid;
}

public void setUserid(Integer userid) {
this.userid = userid;
}

public Occupation getOccupation() {
return this.occupation;
}

public void setOccupation(Occupation occupation) {
this.occupation = occupation;
}

public String getFirstName() {
return this.firstName;
}

public void setFirstName(String firstName) {
this.firstName = firstName;
}

public String getLastName() {
return this.lastName;
}

public void setLastName(String lastName) {
this.lastName = lastName;
}

}

@Entity
@Table(name=occupation)
public class Occupation {

@Id
@GeneratedValue
private Integer ocid;
private String ocnamev;
private Set userses = new HashSet(0);

public Occupation() {
}

public Occupation(String ocnamev) {
this.ocnamev = ocnamev;
}

public Occupation(String ocnamev, Set userses) {
this.ocnamev = ocnamev;
this.userses = userses;
}

public Integer getOcid() {
return this.ocid;
}

public void setOcid(Integer ocid) {
this.ocid = ocid;
}

public String getOcnamev() {
return this.ocnamev;
}

public void setOcnamev(String ocnamev) {
this.ocnamev = ocnamev;
}

public Set getUserses() {
return this.userses;
}

public void setUserses(Set userses) {
this.userses = userses;
}

}




-Original Message-
From: BarryDev [mailto:[EMAIL PROTECTED] 
Sent: October-26-08 10:35 AM
To: users@tapestry.apache.org
Subject: RE: T5: Using with hibernate and Mysql


Oh forgot that I'd change the field's name to match the column in that
class. 
If you want to explicitly join a field to a column use the @JoinColumn(name
= whatever) annotation.
-- 
View this message in context:
http://www.nabble.com/T5%3A-Using-with-hibernate-and-Mysql-tp20166018p201735
23.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


__ Information from ESET Smart Security, version of virus signature
database 3536 (20081019) __

The message was checked by ESET Smart Security.

http://www.eset.com



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



RE: T5: Using with hibernate and Mysql

2008-10-26 Thread James Sherwood
Thank you,

You wouldn't have a link to a demo of the JPA generation.

I use eclipse to generate it and cannot find such a generation type.

The instructions I used were here:

http://www.wikihow.com/Generate-Hibernate-Pojo-Classes-from-DB-Tables

--James

-Original Message-
From: Thiago H. de Paula Figueiredo [mailto:[EMAIL PROTECTED] 
Sent: October-26-08 2:45 PM
To: Tapestry users
Subject: Re: T5: Using with hibernate and Mysql

Em Sun, 26 Oct 2008 11:31:49 -0300, James Sherwood  
[EMAIL PROTECTED] escreveu:

 The problem is, when I try to run it I get this error:
 Could not determine type for: java.util.Set, for columns:
 [org.hibernate.mapping.Column(userses)]

It seems like you chose the Hibernate Core generation type in Hibernate  
Tools. Use the JPA version next time. The error is that the usereses  
property of the Occupation class is an untyped Set. If it was declared as  
a SetUser, it would not complain about this anymore.

 @Entity
 @Table(name=occupation)
 public class Occupation {

   public Set getUserses() {
   return this.userses;
   }

   public void setUserses(Set userses) {
   this.userses = userses;
   }

 }

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

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


__ Information from ESET Smart Security, version of virus signature
database 3536 (20081019) __

The message was checked by ESET Smart Security.

http://www.eset.com

 

__ Information from ESET Smart Security, version of virus signature
database 3536 (20081019) __

The message was checked by ESET Smart Security.

http://www.eset.com
 


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



T5: Using with hibernate and Mysql

2008-10-25 Thread James Sherwood
Hello,

 

I was wondering if anyone has a good example of using Tapestry 5 with
Hibernate and Mysql or can tell me what I am doing wrong

 

I use Eclipse/Tomcat/Mysql.

 

I created a new project using Maven:

mvn archetype:create -DarchetypeGroupId=org.apache.tapestry
-DarchetypeArtifactId=quickstart -DgroupId=com.james -DartifactId=taphib
-DpackageName=com.james.taphib -Dversion=1.0.0-SNAPSHOT

 

I added this to my pom.xml

 

dependency

groupIdorg.apache.tapestry/groupId

artifactIdtapestry-hibernate/artifactId

version${tapestry-release-version}/version

  /dependency

  dependency

groupIdmysql/groupId

artifactIdmysql-connector-java/artifactId

version5.1.5/version

  /dependency

 

I created a filed called: hibernate.cfg.xml in src/main/resources

 

?xml version=1.0 encoding=UTF-8?

!DOCTYPE hibernate-configuration PUBLIC

-//Hibernate/Hibernate Configuration DTD 3.0//EN

http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd;

hibernate-configuration

session-factory

property name=hibernate.connection.driver_class

org.gjt.mm.mysql.Driver/property

property name=hibernate.connection.url
jdbc:mysql://localhost/dbname?charset=utf8/property

property name=hibernate.dialect
org.hibernate.dialect.MySQLDialect/property

property name=hibernate.connection.usernameuser/property

property name=hibernate.connection.password/property

 

!-- pool via c3p0 which knows how to reconnect to server and does it

nicely--

property name=connection.provider_class
org.hibernate.connection.C3P0ConnectionProvider/property

property name=hibernate.c3p0.acquire_increment1/property

property name=hibernate.c3p0.idle_test_period100/property !--
seconds --

property name=hibernate.c3p0.max_size10/property

property name=hibernate.c3p0.max_statements0/property

property name=hibernate.c3p0.min_size1/property

property name=hibernate.c3p0.timeout100/property !-- seconds --

 

/session-factory

/hibernate-configuration

 

 

When I try to package using mvn package so I can deploy to eclipse I get
the error: 

INFO]


[ERROR] BUILD ERROR

[INFO]


[INFO] Failed to resolve artifact.

 

Missing:

--

1) org.hibernate:hibernate-commons-annotations:jar:3.1.0.GA

 

  Try downloading the file manually from the project website.

 

  Then, install it using the command:

  mvn install:install-file -DgroupId=org.hibernate
-DartifactId=hibernate-co

mmons-annotations -Dversion=3.1.0.GA -Dpackaging=jar -Dfile=/path/to/file

 

I found a hibernate-commons-annotations.jar but I believe I am doing
something wrong to cause this error.

 

Thanks,

--James



RE: T5: Using with hibernate and Mysql

2008-10-25 Thread James Sherwood
Hello,

I got the project working by adding these to the pom:

dependency
  groupIdorg.hibernate/groupId
  artifactIdhibernate/artifactId
  version3.2.2.ga/version
/dependency
dependency
groupIdc3p0/groupId
artifactIdc3p0/artifactId
version0.9.0/version
/dependency
dependency
  groupIdgeronimo-spec/groupId
  artifactIdgeronimo-spec-jta/artifactId
  version1.0-M1/version
  scopetest/scope
/dependency

And

repository
idAgile Java/id
urlhttp://agilejava.com/maven//url
 /repository

I am not sure if this is correct or not but I can interact with the DB and
have the tutorial at
http://wiki.apache.org/tapestry/Tapestry5HowToUseTapestryHibernate
Working.

I still cannot find a good Tapestry-Hibernate tutorial though.  I have a
rather large database created and would like to generate objects from
it(this tutorial is the other way around).  I am assuming this may be a
hibernate situation and not tapestry-hibernate but any nudge in the right
direction would be appreciated.

Thanks,
--James

-Original Message-
From: James Sherwood [mailto:[EMAIL PROTECTED] 
Sent: October-25-08 2:11 PM
To: Tapestry users
Subject: T5: Using with hibernate and Mysql

Hello,

 

I was wondering if anyone has a good example of using Tapestry 5 with
Hibernate and Mysql or can tell me what I am doing wrong

 

I use Eclipse/Tomcat/Mysql.

 

I created a new project using Maven:

mvn archetype:create -DarchetypeGroupId=org.apache.tapestry
-DarchetypeArtifactId=quickstart -DgroupId=com.james -DartifactId=taphib
-DpackageName=com.james.taphib -Dversion=1.0.0-SNAPSHOT

 

I added this to my pom.xml

 

dependency

groupIdorg.apache.tapestry/groupId

artifactIdtapestry-hibernate/artifactId

version${tapestry-release-version}/version

  /dependency

  dependency

groupIdmysql/groupId

artifactIdmysql-connector-java/artifactId

version5.1.5/version

  /dependency

 

I created a filed called: hibernate.cfg.xml in src/main/resources

 

?xml version=1.0 encoding=UTF-8?

!DOCTYPE hibernate-configuration PUBLIC

-//Hibernate/Hibernate Configuration DTD 3.0//EN

http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd;

hibernate-configuration

session-factory

property name=hibernate.connection.driver_class

org.gjt.mm.mysql.Driver/property

property name=hibernate.connection.url
jdbc:mysql://localhost/dbname?charset=utf8/property

property name=hibernate.dialect
org.hibernate.dialect.MySQLDialect/property

property name=hibernate.connection.usernameuser/property

property name=hibernate.connection.password/property

 

!-- pool via c3p0 which knows how to reconnect to server and does it

nicely--

property name=connection.provider_class
org.hibernate.connection.C3P0ConnectionProvider/property

property name=hibernate.c3p0.acquire_increment1/property

property name=hibernate.c3p0.idle_test_period100/property !--
seconds --

property name=hibernate.c3p0.max_size10/property

property name=hibernate.c3p0.max_statements0/property

property name=hibernate.c3p0.min_size1/property

property name=hibernate.c3p0.timeout100/property !-- seconds --

 

/session-factory

/hibernate-configuration

 

 

When I try to package using mvn package so I can deploy to eclipse I get
the error: 

INFO]


[ERROR] BUILD ERROR

[INFO]


[INFO] Failed to resolve artifact.

 

Missing:

--

1) org.hibernate:hibernate-commons-annotations:jar:3.1.0.GA

 

  Try downloading the file manually from the project website.

 

  Then, install it using the command:

  mvn install:install-file -DgroupId=org.hibernate
-DartifactId=hibernate-co

mmons-annotations -Dversion=3.1.0.GA -Dpackaging=jar -Dfile=/path/to/file

 

I found a hibernate-commons-annotations.jar but I believe I am doing
something wrong to cause this error.

 

Thanks,

--James




__ Information from ESET Smart Security, version of virus signature
database 3536 (20081019) __

The message was checked by ESET Smart Security.

http://www.eset.com


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



T5: Grid component removing a field

2008-10-24 Thread James Sherwood
Hello,

 

Let's say I have a grid component running off a source with objects such as:

 

Id

Fname

Lname

 

How do I remove Id from the grid?

 

Remove=Id in the html of t:grid does not work.

 

Thanks,

--James



T5: BeanEditForm and Date

2008-10-24 Thread James Sherwood
Hello,

 

It seems that beaneditform does not like have a date as a field in the
object.

 

Is there a way around this?

 

--James



T5: Beaneditform and Date problem

2008-10-24 Thread James Sherwood
Hello,

 

I have an object Celebrity with the fields:

 

private long id;

private String firstName;

private String lastName;

private Date dateOfBirth;(java.util.Date)

 

When I use the tag:

 

t:beaneditform t:id=celebrity/

 

And access the page I get the console error:

 

No service implements the interface java.util.Date.

 

And a Tapestry error:

 

Render queue error in SetupRender[AddCelebrity:celebrity.editor]: Exception
instantiating instance of com.packtpub.celebrities.model.Celebrity (for
component 'AddCelebrity:celebrity.editor'): Error invoking constructor
com.packtpub.celebrities.model.Celebrity(String, String, Date, Occupation)
(at Celebrity.java:23) (for service 'BeanModelSource'): No service
implements the interface java.util.Date.

 

Any ideas what I am doing wrong?

 

Thanks,

--James



T5: Extra Component Information

2008-10-24 Thread James Sherwood
Hello,

 

I have seen components such as the Fckeditor being used but cannot figure
out how to use them.

 

The component reference docs at
http://tapestry.apache.org/tapestry5/tapestry-core/ref/ does not list them.

 

This site: http://87.193.218.134:8080/t5c-demo/editorpage lists many nice
components that do not appear to be in the main component reference site but
I cannot figure out how to make them available.

 

I believe it has something to do with when I create the project with maven
or my pom and blocks of code such as this:

 

dependency

  groupIdorg.apache.tapestry/groupId

  artifactIdt5c-contrib/artifactId

  version0.5.13/version

  /dependency

 

I just cannot seem to put it all together.

 

Can someone help me bridge the gap I am missing?

 

If it helps I use the Eclipse/Tomcat Combination with maven creation.

 

Thanks,

 

--James



T5:Submit component

2008-10-21 Thread James Sherwood
Hello,

 

I am playing around with T5 and I have a submit inside of a form component
like this:

 

TML:

input type=submit t:type=submit t:id=submitButton value=Submit/

 

Java:

@OnEvent(component = submitButton)

  void onSubmitButton() {

System.out.println(Submit button was pressed!);



  }

 

When I press the button, only the form runs not the submit. 

 

Any Ideas?

 

--James



T5: Ajax Examples/Tutorials

2008-09-22 Thread James Sherwood
Hello,

I was wondering if anyone knew of any good ajax Examples/Tutorials with T5?

Things such as text fields that do not require form submits to change data.

Thanks in advance,
--James

T5: using with maven / tomcat / eclipse

2008-06-19 Thread James Sherwood
Hello,

I like to develop in tomcat and have not used Jetty much.

I have gone through the tutorials using Jetty and have T5 running with 
hibernate under Jetty/maven/eclipse.

I have been trying to use tomcat instead of Jetty in the tutorial off the T5 
homepage but have had no luck and I cannot seem to find much resources on this.

Can anyone link me a good resource that uses Tomcat / maven / eclipse to 
develop in T5 or maybe give me a some ideas of what I could be doing wrong?

Thanks,
--James

Re: T5: using with maven / tomcat / eclipse

2008-06-19 Thread James Sherwood

Hello,

In the tutorial it uses this maven command:
mvn archetype:create
 -DarchetypeGroupId=org.apache.tapestry
 -DarchetypeArtifactId=quickstart
 -DgroupId=org.apache.tapestry
 -DartifactId=tutorial1
 -DpackageName=org.apache.tapestry5.tutorial

To first create the project.  Then I import it into eclipse.  The problem is 
the file structure does not seem to match what I am used to with T3.  Where 
do I point my context in tomcat at?  I tried the WEB-INF and it doesnt work.


Thanks,
--James

- Original Message - 
From: Daniel Jue [EMAIL PROTECTED]

To: Tapestry users users@tapestry.apache.org
Sent: Thursday, June 19, 2008 12:41 PM
Subject: Re: T5: using with maven / tomcat / eclipse


What issues are you having?  How are you attempting to run your 
application

in Tomcat? (Through Eclipse WTP, through Tomcat as a batch file/service,
through maven itself, etc?)  There are many ways to do the essentially 
same

thing.

I personally launch Tomcat through Eclipse WTP (or also Europa or 
Ganymede)
and Eclipse auto-publishes the files into a local Tomcat installation. 
For

some reason I stopped serving my app directly from my workspace, I can't
remember why.

I also manually export a war file to a testing server, and have Tomcat
unpack and serve it there.  I don't even keep a context.xml in my 
META-INF/

anymore, because I keep contextual stuff with the individual Tomcat
installations (i.e. JNDI references, flags variables for SSO and Tapestry
error pages).



On Thu, Jun 19, 2008 at 11:16 AM, James Sherwood 
[EMAIL PROTECTED]

wrote:


Hello,

I like to develop in tomcat and have not used Jetty much.

I have gone through the tutorials using Jetty and have T5 running with
hibernate under Jetty/maven/eclipse.

I have been trying to use tomcat instead of Jetty in the tutorial off the
T5 homepage but have had no luck and I cannot seem to find much resources 
on

this.

Can anyone link me a good resource that uses Tomcat / maven / eclipse to
develop in T5 or maybe give me a some ideas of what I could be doing 
wrong?


Thanks,
--James




__ Information from ESET Smart Security, version of virus 
signature database 3200 (20080619) __


The message was checked by ESET Smart Security.

http://www.eset.com




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



Re: T5: using with maven / tomcat / eclipse

2008-06-19 Thread James Sherwood
This almost gets me there.  It runs tomcat and I can use the pages but I 
cannot get the sysdeo tomcat plugin working within eclipse.


There is a web.xml created but if I point the context at it , it does not 
work, it just shows me the directory listing.


Any ideas what I am doing wrong?

Thanks,
--James

- Original Message - 
From: Andreas Andreou [EMAIL PROTECTED]

To: Tapestry users users@tapestry.apache.org
Sent: Thursday, June 19, 2008 1:00 PM
Subject: Re: T5: using with maven / tomcat / eclipse



try
mvn tomcat:run

On Thu, Jun 19, 2008 at 6:16 PM, James Sherwood
[EMAIL PROTECTED] wrote:

Hello,

I like to develop in tomcat and have not used Jetty much.

I have gone through the tutorials using Jetty and have T5 running with 
hibernate under Jetty/maven/eclipse.


I have been trying to use tomcat instead of Jetty in the tutorial off the 
T5 homepage but have had no luck and I cannot seem to find much resources 
on this.


Can anyone link me a good resource that uses Tomcat / maven / eclipse to 
develop in T5 or maybe give me a some ideas of what I could be doing 
wrong?


Thanks,
--James




--
Andreas Andreou - [EMAIL PROTECTED] - http://blog.andyhot.gr
Tapestry / Tacos developer
Open Source / JEE Consulting

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


__ Information from ESET Smart Security, version of virus 
signature database 3200 (20080619) __


The message was checked by ESET Smart Security.

http://www.eset.com





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



Re: T5: using with maven / tomcat / eclipse

2008-06-19 Thread James Sherwood

Hello,

I d/l the war file from http://www.infoq.com/articles/tapestry5-intro and 
imported it into eclipse.


The directory structure in this is much like that of T3.  I just pointed 
tomcat to the web.xml and it works fine.


Any ideas why the T5 project I created using maven only seems to work when 
running mvn tomcat:run or how I get it working?


Thanks,

--James

- Original Message - 
From: James Sherwood [EMAIL PROTECTED]

To: Tapestry users users@tapestry.apache.org
Sent: Thursday, June 19, 2008 1:35 PM
Subject: Re: T5: using with maven / tomcat / eclipse


This almost gets me there.  It runs tomcat and I can use the pages but I 
cannot get the sysdeo tomcat plugin working within eclipse.


There is a web.xml created but if I point the context at it , it does not 
work, it just shows me the directory listing.


Any ideas what I am doing wrong?

Thanks,
--James

- Original Message - 
From: Andreas Andreou [EMAIL PROTECTED]

To: Tapestry users users@tapestry.apache.org
Sent: Thursday, June 19, 2008 1:00 PM
Subject: Re: T5: using with maven / tomcat / eclipse



try
mvn tomcat:run

On Thu, Jun 19, 2008 at 6:16 PM, James Sherwood
[EMAIL PROTECTED] wrote:

Hello,

I like to develop in tomcat and have not used Jetty much.

I have gone through the tutorials using Jetty and have T5 running with 
hibernate under Jetty/maven/eclipse.


I have been trying to use tomcat instead of Jetty in the tutorial off 
the T5 homepage but have had no luck and I cannot seem to find much 
resources on this.


Can anyone link me a good resource that uses Tomcat / maven / eclipse to 
develop in T5 or maybe give me a some ideas of what I could be doing 
wrong?


Thanks,
--James




--
Andreas Andreou - [EMAIL PROTECTED] - http://blog.andyhot.gr
Tapestry / Tacos developer
Open Source / JEE Consulting

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


__ Information from ESET Smart Security, version of virus 
signature database 3200 (20080619) __


The message was checked by ESET Smart Security.

http://www.eset.com





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


__ Information from ESET Smart Security, version of virus 
signature database 3200 (20080619) __


The message was checked by ESET Smart Security.

http://www.eset.com





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



Starting T4, what database layer to use?

2008-06-12 Thread James Sherwood
Hello all,

Currently all our development is in T3(I know we are behind).

The word has come down its time to upgrade.  My question is, what technology 
works best with T4 as the layer between it and the database?

Currently we use Torque with T3(behind again I know).  I have been researching 
it and hibernate pops up everywhere but it seems like most of the posts are 
from 2006 or earlier.

So what is the best solution for us?(Is maybe T5 and something better than 
going T4 even?)  

Thanks in advance for your advice,

--James

Re: T3: Stop back button

2008-06-02 Thread James Sherwood

Zack,

1: I just posted it to the Tapestry mailing list so I am not sure how you 
view the list and why you say its in the wrong spot.
2: I did not post 2 times, I was replying to to a 'more clarification' 
question.
3: They cannot change or submit again, our client just does not want them to 
see the form when pressing the back button as on some sites you get a 
'session expired' page by pressing back.
4: I do not need basic research. I have built tons of Tapestry apps and this 
still eludes me.

5: If its so basic, why do you not just answer my problem.
6: If you don't have anything constructive towards the post, please just do 
not post...


Thanks,
--James

- Original Message - 
From: zack1403 [EMAIL PROTECTED]

To: users@tapestry.apache.org
Sent: Monday, June 02, 2008 3:01 AM
Subject: Re: T3: Stop back button




Do you really think this is the right thread for that question? Also, I 
doubt

posting the same question twice will increase your chances of having it
answered. In relation to your question, just make sure that the user cant
access or makes changes to the survey if it has already been submitted .
Don't take the back button away from users. If you need more help, I would
start another topic (but really I would just do some basic research before
posting again).

Zack


James Sherwood wrote:


Hello,

Our application submits a form then shows the results(like a survey 
form).

Problem is the users can hit the browser's back button and see the form
again and we do not want that.  Any ideas how to make it show anything 
but

the form?

--James

- Original Message - 
From: Javier Sanchez [EMAIL PROTECTED]

To: Tapestry users users@tapestry.apache.org
Sent: Friday, May 30, 2008 6:46 PM
Subject: Re: T3: Stop back button



Isn't obvious?  What exactly do you want your application to do?

On Fri, May 30, 2008 at 1:46 PM, James Sherwood
[EMAIL PROTECTED]
wrote:


Hello all,

We are using tapestry 3.  We need to make it so when a user submits a
form
and then presses the back button, it does not show them the form.

Any ideas?

--James



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






__ Information from ESET Smart Security, version of virus
signature database 3148 (20080530) __

The message was checked by ESET Smart Security.

http://www.eset.com




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





--
View this message in context: 
http://www.nabble.com/How-to-call-service-during-startup--tp17558546p17594477.html

Sent from the Tapestry - User mailing list archive at Nabble.com.


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


__ Information from ESET Smart Security, version of virus 
signature database 3150 (20080601) __


The message was checked by ESET Smart Security.

http://www.eset.com





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



Repost: T3: Stop back button view of a form

2008-06-02 Thread James Sherwood
Hello,

I was told I posted this in the wrong spot so I am sending to the list again 
and hopefully it goes in the right spot..

I am trying to stop users from submitting a form and then pressing the back 
button and seeing the form again.  I would like to either redirect them somehow 
or just show them a session expired.

Any ideas?

Thanks,
--James

Re: Repost: T3: Stop back button view of a form

2008-06-02 Thread James Sherwood

Lance,

Thanks, That is actually what we are trying right now.

We are taking the route of an onload where it just checks a service(or maybe 
a cookie we havent nailed that down) to see if they have submitted and just 
does a redirect if they have.


--James

- Original Message - 
From: Lance Java [EMAIL PROTECTED]

To: Tapestry users users@tapestry.apache.org
Sent: Monday, June 02, 2008 9:59 AM
Subject: Re: Repost: T3: Stop back button view of a form



Ok, here's a solution... use an onload script to either
a) populate a zone with the form fields
b) populate the zone with an already submitted message
This way the form will not be in the browser's cache.

If you want to redirect you'll need to use javascript since it'll be an 
ajax

request.

Cheers,
Lance.

2008/6/2 Lance Java [EMAIL PROTECTED]:


Not really possible I'm sorry, when a user hits the back button, the page
they are viewing is in their browser cache (ie not a serverside hit).
Probably the best solution is to set a flag (persistant property or in 
the
db) on first form submit then fail any subsequent submits by redirecting 
to

an error page.

Cheers,
Lance.

2008/6/2 James Sherwood [EMAIL PROTECTED]:

Hello,


I was told I posted this in the wrong spot so I am sending to the list
again and hopefully it goes in the right spot..

I am trying to stop users from submitting a form and then pressing the
back button and seeing the form again.  I would like to either redirect 
them

somehow or just show them a session expired.

Any ideas?

Thanks,
--James








__ Information from ESET Smart Security, version of virus 
signature database 3151 (20080602) __


The message was checked by ESET Smart Security.

http://www.eset.com




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



Re: REpost: T3: Stop back button view after form submits.

2008-06-02 Thread James Sherwood
disregard, im an idiot and sent it from the wrong account and didn't think 
it would go through:)


--James
- Original Message - 
From: James  Carrie [EMAIL PROTECTED]

To: Tapestry users users@tapestry.apache.org
Sent: Monday, June 02, 2008 9:26 AM
Subject: REpost: T3: Stop back button view after form submits.


Hello,

I was told I posted this in the wrong spot so I am sending to the list again 
and hopefully it goes in the right spot..


I am trying to stop users from submitting a form and then pressing the back 
button and seeing the form again.  I would like to either redirect them 
somehow or just show them a session expired.


Any ideas?

Thanks,
--James


__ Information from ESET Smart Security, version of virus signature 
database 3151 (20080602) __


The message was checked by ESET Smart Security.

http://www.eset.com


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



Re: T3: Stop back button

2008-06-01 Thread James Sherwood

Hello,

Our application submits a form then shows the results(like a survey form). 
Problem is the users can hit the browser's back button and see the form 
again and we do not want that.  Any ideas how to make it show anything but 
the form?


--James

- Original Message - 
From: Javier Sanchez [EMAIL PROTECTED]

To: Tapestry users users@tapestry.apache.org
Sent: Friday, May 30, 2008 6:46 PM
Subject: Re: T3: Stop back button



Isn't obvious?  What exactly do you want your application to do?

On Fri, May 30, 2008 at 1:46 PM, James Sherwood 
[EMAIL PROTECTED]

wrote:


Hello all,

We are using tapestry 3.  We need to make it so when a user submits a 
form

and then presses the back button, it does not show them the form.

Any ideas?

--James



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






__ Information from ESET Smart Security, version of virus 
signature database 3148 (20080530) __


The message was checked by ESET Smart Security.

http://www.eset.com




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



T3: Stop back button

2008-05-30 Thread James Sherwood

Hello all,

We are using tapestry 3.  We need to make it so when a user submits a form 
and then presses the back button, it does not show them the form.


Any ideas?

--James



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



T3: Type Block

2007-12-06 Thread James Sherwood

Hello,

I am trying to make a portal page with DIVs and ajax to fill the html in 
them.


The problem that I am running into is that currently it just puts out the 
portlets using the type Block
then tapestry renders the blocks when the page loads and I cant figure out 
how to do this without reloading a page.


Basically I want to call a URL(service) and have it return the html of a 
rendered block then just fill the DIV with it.


Is this possible?

--James 



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



Re: T3: Type Block

2007-12-06 Thread James Sherwood
Actually, is there just a way to have a service render a page and then I 
could just return the html?


--James

- Original Message - 
From: James Sherwood [EMAIL PROTECTED]

To: Tapestry users users@tapestry.apache.org
Sent: Thursday, December 06, 2007 12:51 PM
Subject: [Spam Rating:3.20] T3: Type Block



Hello,

I am trying to make a portal page with DIVs and ajax to fill the html in 
them.


The problem that I am running into is that currently it just puts out the 
portlets using the type Block
then tapestry renders the blocks when the page loads and I cant figure out 
how to do this without reloading a page.


Basically I want to call a URL(service) and have it return the html of a 
rendered block then just fill the DIV with it.


Is this possible?

--James

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


__ NOD32 2706 (20071206) Information __

This message was checked by NOD32 antivirus system.
http://www.eset.com





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



Re: T3: session length

2007-12-04 Thread James Sherwood

What is the downfall to this?

--James

- Original Message - 
From: Filip S. Adamsen [EMAIL PROTECTED]

To: Tapestry users users@tapestry.apache.org
Sent: Monday, December 03, 2007 2:23 PM
Subject: Re: T3: session length


I suppose you could set session-timeout to 0 in your web.xml, but that's 
not recommended.


-Filip

James Sherwood skrev:

Hello,

Is there a way in T3 to make your session last until the browser is 
closed?


Thanks,
--James

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




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


__ NOD32 2698 (20071203) Information __

This message was checked by NOD32 antivirus system.
http://www.eset.com





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



Re: T3: session length

2007-12-04 Thread James Sherwood

So there is no way to have it last the length of the browser being open?

I have seen tricks using JavaScript to contact images and such to keep 
sessions alive.


--James

- Original Message - 
From: Thiago HP [EMAIL PROTECTED]

To: Tapestry users users@tapestry.apache.org
Sent: Tuesday, December 04, 2007 11:57 AM
Subject: Re: T3: session length



On 12/4/07, James Sherwood [EMAIL PROTECTED] wrote:


What is the downfall to this?


Each user session will last forerever even when the user is not using the
application, leading to an always increasing server memory usage. Of 
course
you could release the session (session.invalidate()), but I don't think 
it's

your case.
Thiago



__ NOD32 2701 (20071204) Information __

This message was checked by NOD32 antivirus system.
http://www.eset.com




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



Re: T3: session length

2007-12-04 Thread James Sherwood
I think the JavaScript is the way I will go as the hidden frame refreshing 
creates a click in IE I believe.


Is there a way to do this built into the later Tapestrys?

--James

- Original Message - 
From: Richard Kirby [EMAIL PROTECTED]

To: Tapestry users users@tapestry.apache.org
Sent: Tuesday, December 04, 2007 12:43 PM
Subject: Re: T3: session length



Hi James, et al.

Opps - I answered the wrong question. As Thiago writes, you would indeed 
need to use javascript to periodically fetch something from the server, 
and in particular something that the servlet engine processes, so that it 
knows to update the last accessed timestamp on its internal HttpSession 
object mapping to that browser. A simple AJAX call would do well here - 
just ping a dummy T3 page or something. Alternatively, use a Frame 
(perhaps a hidden size 0 Frame) with a body reload - which will work even 
if the browser doesn't support javascript.


You can then leave the default servlet timeout for sessions, so that if 
the browser is closed, the session object will eventually timeout and be 
GCed.


Cheers

Richard

Thiago HP wrote:

On 12/4/07, James Sherwood [EMAIL PROTECTED] wrote:


So there is no way to have it last the length of the browser being open?



No way unless you use some Javascript hack that keeps requesting 
something
to the server. You must remember the nature of HTTP. The browser connects 
to

the server, receives the answer and the connection is closed. There is
nothing like a browser closing event notification sent to the server.
Thiago





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


__ NOD32 2701 (20071204) Information __

This message was checked by NOD32 antivirus system.
http://www.eset.com





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



T3: session length

2007-12-03 Thread James Sherwood

Hello,

Is there a way in T3 to make your session last until the browser is closed?

Thanks,
--James

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



T3 Eclipse 3.3

2007-10-17 Thread James Sherwood

Hey all,

I am trying to upgrade to the latest eclipse and was wondering what editor 
people use for Tapestry in the newer eclipses.


We used spindle but it does not work in the newer eclipses.

Any help would be appreciated,

Thanks,
--James 



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



Measuring time spent on site using tapestry

2007-07-11 Thread James Sherwood

Hello,

Is there a way to measure time spent surfing our website using tapestry 3.1.
And if not in 3.1 is there a way in later versions?

The reason for this is statistical sites are now using time spent on sites 
as a measure as much as using page views/sessions which we already track 
using tapestry.


Thanks,
James 



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



Upgrading Tapestry

2007-04-23 Thread James Sherwood

Hello,

I am starting to upgrade to Tapestry 4 from 3 and noticed that spindle only 
supports 3.


We use Eclipse/Spindle and I was wondering what people are using for 
Tapestry 4?


Thanks,
James 



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



Re: Upgrading Tapestry

2007-04-23 Thread James Sherwood

Hello,

Sorry, I said tapestry 4 and meant 4.1.

So currently we use Tapestry 3 and wish to upgrade to Tapestry 4.1.

We use spindle/eclipse and it says that spindle only works with 3 so I was 
wondering what people are using to develop Tapestry 4.1.


Thanks,
James

- Original Message - 
From: James Sherwood [EMAIL PROTECTED]

To: Tapestry users users@tapestry.apache.org
Sent: Monday, April 23, 2007 8:25 AM
Subject: Upgrading Tapestry



Hello,

I am starting to upgrade to Tapestry 4 from 3 and noticed that spindle 
only supports 3.


We use Eclipse/Spindle and I was wondering what people are using for 
Tapestry 4?


Thanks,
James

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


__ NOD32 2212 (20070423) Information __

This message was checked by NOD32 antivirus system.
http://www.eset.com





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



Re: Anybody have the FCKEditor working in IE7?

2007-04-19 Thread James Sherwood

Hello,

I start work on integrating it into tapestry today but I have it working 
fine in IE7 on Vista on my development machine outside of tapestry.


One thing Ive noticed though is that IE7 on my machine thinks its a security 
breach to accept the path to the js or the path to the editor above the 
current folder(IE ../../fckeditor.js) and shows a page cannot be displayed 
in the iframe. Dunno if this means anything to you.  Also, I am working with 
the latest version.


--James

- Original Message - 
From: jake123 [EMAIL PROTECTED]

To: users@tapestry.apache.org
Sent: Wednesday, April 18, 2007 5:24 PM
Subject: Anybody have the FCKEditor working in IE7?




Hi,
we have currently FCKEditor version 2.3.2 in our tapestry application and
that does not work in IE7.
Where the toolbar and the textarea are supposed to be displayed there is
only a big white space and we don't see any javascript errors anybody
have this working? We tried to update to FCKEditor version 2.4.2 but the
result is the same.

It works fine in Firefox...

Thanks
Jacob
--
View this message in context: 
http://www.nabble.com/Anybody-have-the-FCKEditor-working-in-IE7--tf3603233.html#a10066441

Sent from the Tapestry - User mailing list archive at Nabble.com.


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


__ NOD32 2202 (20070418) Information __

This message was checked by NOD32 antivirus system.
http://www.eset.com





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



Re: Tapestry RTE Component

2007-04-18 Thread James Sherwood

Thanks for the reply,

I actually just got Wizzywig working as a component in tapestry, i had 
messed up the code just slightly enough  not to work so i started from 
scratch again and it worked.


I am going to try fckeditor next, it is the most advanced one I have found


--James

- Original Message - 
From: Steve Shucker [EMAIL PROTECTED]

To: Tapestry users users@tapestry.apache.org
Sent: Wednesday, April 18, 2007 1:55 PM
Subject: Re: Tapestry RTE Component


My company needs one too.  We wrapped the dojo Editor2 component.  I 
helped someone get a quick demo of this working a few weeks ago, but I 
don't know if it's 100%.  If you're using version 4.1.1, you're welcome to 
use this.


-Steve

DojoEditor.java:

import java.util.HashMap;
import java.util.Map;

import org.apache.tapestry.form.AbstractFormComponent;
import org.apache.tapestry.IMarkupWriter;
import org.apache.tapestry.IRequestCycle;
import org.apache.tapestry.IScript;
import org.apache.tapestry.PageRenderSupport;
import org.apache.tapestry.TapestryUtils;
import org.apache.tapestry.annotations.ComponentClass;
import org.apache.tapestry.annotations.InjectScript;
import org.apache.tapestry.annotations.Parameter;

@ComponentClass(allowBody=true)
public abstract class DojoEditor extends AbstractFormComponent {
  @Parameter(required=true)
   public abstract String getValue();
   public abstract void setValue(String value) ;
  @InjectScript(DojoEditor.script)
   public abstract IScript getScript();
  /**
* @see 
org.apache.tapestry.form.AbstractFormComponent#renderFormComponent(org.apache.tapestry.IMarkupWriter,

*  org.apache.tapestry.IRequestCycle)
*/
   protected void renderFormComponent(IMarkupWriter writer, IRequestCycle 
cycle) {
   PageRenderSupport pageRenderSupport = 
TapestryUtils.getPageRenderSupport(cycle, this);


   MapString,Object symbols = new HashMapString,Object();
   symbols.put(id, getClientId());
   symbols.put(formId, getForm().getClientId());
   getScript().execute(this, cycle, pageRenderSupport, symbols);

   renderDelegatePrefix(writer, cycle);

   writer.begin(textArea);
   writer.attribute(style,width:700px; height:200px);
   renderIdAttribute(writer, cycle);
   writer.attribute(name, getName());
   renderInformalParameters(writer, cycle);
   renderBody(writer, cycle);
   writer.printRaw(getValue());
   writer.end();
   renderDelegateSuffix(writer, cycle);
   }

   /**
* @see 
org.apache.tapestry.form.AbstractFormComponent#rewindFormComponent(org.apache.tapestry.IMarkupWriter,

*  org.apache.tapestry.IRequestCycle)
*/
   protected void rewindFormComponent(IMarkupWriter writer, IRequestCycle 
cycle) {

   setValue(cycle.getParameter(getName()));
   }

}

DojoEditor.script:

?xml version=1.0 encoding=UTF-8?

!DOCTYPE script PUBLIC
   -//Apache Software Foundation//Tapestry Script Specification 3.0//EN
   http://jakarta.apache.org/tapestry/dtd/Script_3_0.dtd;

script
   input-symbol key=id class=java.lang.String required=yes/
   input-symbol key=formId class=java.lang.String required=yes/
   body
   unique
   dojo.require(dojo.widget.Editor2);
   dojo.require(dojo.widget.Editor2Plugin.DialogCommands);
   dojo.require(dojo.widget.Editor2Plugin.ColorPicker);
   /unique
   /body
   initialization
   dojo.widget.createWidget(Editor2, {id: ${id}_widget}, 
dojo.byId('${id}'));
   dojo.event.connect(dojo.byId('${formId}'), onsubmit, function () 
{
   dojo.byId('${id}').value = 
dojo.widget.getWidgetById(${id}_widget).getEditorContent()

   })
   /initialization
/script



Nick Westgate wrote:

Hi James.

I haven't used it, but perhaps:
http://www.tapestrycomponents.org/Tassel/app?service=external/ViewComponentsp=SHtmlArea

There are also several for T4 on Tassel.

Cheers,
Nick.


James Sherwood wrote:

Hello,

I am looking for a Rich Text Editor component for tapestry that is 
compatable with (or maybe i could modify) Tapestry 3 and all large 
browsers.


If someone could point me in the right direction that would be great.

I have tried creating my own and have been successfull in everything 
except getting the information from the RTE to come out in the form 
submit, it is always null.


Any help would be greatly appreciated.

--James

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






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



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


__ NOD32 2202 (20070418) Information __

This message was checked by NOD32 antivirus system.
http://www.eset.com

Tapestry RTE Component

2007-04-17 Thread James Sherwood

Hello,

I am looking for a Rich Text Editor component for tapestry that is 
compatable with (or maybe i could modify) Tapestry 3 and all large browsers.


If someone could point me in the right direction that would be great.

I have tried creating my own and have been successfull in everything except 
getting the information from the RTE to come out in the form submit, it is 
always null.


Any help would be greatly appreciated.

--James 



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



Session

2007-03-20 Thread James Sherwood

Hello,

We have an admin side with a user login etc.

The problem is, the session times out after soo many minutes(we run under 
tomcat) of being idle and they user has to log back in.


Is there any way to make this indefinate and if so, is there any impact on 
resources etc?


Thanks,
James 



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



Re: Page Validation

2007-02-26 Thread James Sherwood

Hello,

I tried implementing it exactly as you suggested but I still get to see the 
first page.  Once I refresh or try to go somewhere it sends me to the login 
page.


The funny thing is, the PageRedirectException IS being thrown, its just not 
going to the login page.


Any ideas?

--James

- Original Message - 
From: Nikla Ratinen [EMAIL PROTECTED]

To: Tapestry users users@tapestry.apache.org
Sent: Friday, February 23, 2007 1:02 PM
Subject: Re: Page Validation




Hi,

As an alternate approach you may override the default page source with an 
implementation
that checks security constraints just before giving out the page 
instance - this basically has the

added benefit that secured page instances may not be obtained even through
(accidental) malicious code in non-secure pages or services.


-- Overridden engine
public class MyEngine extends BaseEngine
{
   protected IPageSource createPageSource(RequestContext context)
   {
   return new ProtectedPageSource(this);
   }
}

-- Overridden page source
public class ProtectedPageSource extends PageSource
{
   public ProtectedPageSource(IEngine engine)
   {
   super(engine);
   }
  public IPage getPage(IRequestCycle cycle, String pageName, IMonitor 
monitor)

   {
   IPage page = super.getPage(cycle, pageName, monitor);
 if (page != null  page instanceof ProtectedPage)
   {
   Visit visit = (Visit) cycle.getEngine().getVisit();
if (visit == null || visit.getUser() == null)
throw new PageRedirectException(Login);  }
  return page;
   }
}

-- A protected page

public class ProtectedPage
   extends BasePage
{
}


Something along those lines ;)

Cheers,
-- Nikla



Mark Stang wrote:

Hi,
This seems to work for us.

public class ValidatePage
extends BasePage
implements PageValidateListener
{
public void pageValidate(PageEvent event)
{
Mediator mediator = MgmtFactory.getMediator();
if (!mediator.isConsole())
{
IPage messagePage = 
getRequestCycle().getPage(nonAdminConsole);

throw new PageRedirectException(messagePage);
}
else
{
// If there is no visit object or the user isn't auth'd ship
// them off to the login page
Visit visit = (Visit)getVisit();
if (visit == null || !visit.isUserAuthenticated())
{
Login login = (Login)getRequestCycle().getPage(login);
throw new PageRedirectException(login);
}
}
}
}

I tried a couple of different experiments.  The first was to log in and 
copy a link then close the browser.  I wasn't able to get to the page via 
the direct link.  If I logout and try and access the page via a direct 
link, I don't get access.  If I log in and copy a link and then surf off 
to another page, then I can come back via the direct link.  All of this 
is based on my use of a session and the visit object.  So, reviewing you 
code, I would think you need to have to check more than if the visit 
exists.  You need to store a flag saying they they have been 
authenticated.


regards,

Mark

Mark J. Stang
Senior Engineer/Architect
office: +1 303.468.2900
mobile: +1 303.507.2833
Ping Identity



-Original Message-
From: James Sherwood [mailto:[EMAIL PROTECTED]
Sent: Fri 2/23/2007 6:34 AM
To: Tapestry users
Subject: Page Validation
 Hello,

We use Tapestry 3.2

I have security (login) using PageValidateListener.

The secure page in the site is called ISOPage which extends BasePage.

I add the page validation using:
public ISOPage(){
super();
addPageValidateListener(new PageValidationListener());
}

The PageValidationListener class implements PageValidateListener and does 
security like this:


if(visit.getUser() == null){
throw new PageRedirectException(UserLogin);
}

This all works fine it seems unless a direct is involved.

If I copy a directlink then try to access it without loggin in it shows 
me the page the directlink java code is on.


The PageRedirectException does happen and if I refresh or try to go 
anywhere it sends me to the login but it still shows that page first.


Any ideas?
Thanks,
James

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







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


__ NOD32 2077 (20070223) Information __

This message was checked by NOD32 antivirus system.
http://www.eset.com





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



Re: Page Validation

2007-02-26 Thread James Sherwood

I think I have solved it.

Our way was fine, it was basically the page with the page validate way 
except we added it in the page.


The problem I beleive is that our cycle.activate's are in try/catches and 
its catching the error and not actually throwing the page redirect 
exception.


Still testing atm, will keep advised.

--James
- Original Message - 
From: Mark Stang [EMAIL PROTECTED]
To: Tapestry users users@tapestry.apache.org; Tapestry users 
users@tapestry.apache.org

Sent: Monday, February 26, 2007 3:29 PM
Subject: RE: Page Validation


James,
You said, I tried implementing it exactly as you suggested, which method 
there were two?  It would help to post your code.


regards,

Mark

Mark J. Stang
Senior Engineer/Architect
office: +1 303.468.2900
mobile: +1 303.507.2833
Ping Identity



-Original Message-
From: James Sherwood [mailto:[EMAIL PROTECTED]
Sent: Mon 2/26/2007 12:21 PM
To: Tapestry users
Subject: Re: Page Validation

Hello,

I tried implementing it exactly as you suggested but I still get to see the
first page.  Once I refresh or try to go somewhere it sends me to the login
page.

The funny thing is, the PageRedirectException IS being thrown, its just not
going to the login page.

Any ideas?

--James

- Original Message - 
From: Nikla Ratinen [EMAIL PROTECTED]

To: Tapestry users users@tapestry.apache.org
Sent: Friday, February 23, 2007 1:02 PM
Subject: Re: Page Validation




Hi,

As an alternate approach you may override the default page source with an
implementation
that checks security constraints just before giving out the page
instance - this basically has the
added benefit that secured page instances may not be obtained even through
(accidental) malicious code in non-secure pages or services.


-- Overridden engine
public class MyEngine extends BaseEngine
{
   protected IPageSource createPageSource(RequestContext context)
   {
   return new ProtectedPageSource(this);
   }
}

-- Overridden page source
public class ProtectedPageSource extends PageSource
{
   public ProtectedPageSource(IEngine engine)
   {
   super(engine);
   }
  public IPage getPage(IRequestCycle cycle, String pageName, IMonitor
monitor)
   {
   IPage page = super.getPage(cycle, pageName, monitor);
 if (page != null  page instanceof ProtectedPage)
   {
   Visit visit = (Visit) cycle.getEngine().getVisit();
if (visit == null || visit.getUser() == null)
throw new PageRedirectException(Login);  }
  return page;
   }
}

-- A protected page

public class ProtectedPage
   extends BasePage
{
}


Something along those lines ;)

Cheers,
-- Nikla



Mark Stang wrote:

Hi,
This seems to work for us.

public class ValidatePage
extends BasePage
implements PageValidateListener
{
public void pageValidate(PageEvent event)
{
Mediator mediator = MgmtFactory.getMediator();
if (!mediator.isConsole())
{
IPage messagePage =
getRequestCycle().getPage(nonAdminConsole);
throw new PageRedirectException(messagePage);
}
else
{
// If there is no visit object or the user isn't auth'd ship
// them off to the login page
Visit visit = (Visit)getVisit();
if (visit == null || !visit.isUserAuthenticated())
{
Login login = (Login)getRequestCycle().getPage(login);
throw new PageRedirectException(login);
}
}
}
}

I tried a couple of different experiments.  The first was to log in and
copy a link then close the browser.  I wasn't able to get to the page via
the direct link.  If I logout and try and access the page via a direct
link, I don't get access.  If I log in and copy a link and then surf off
to another page, then I can come back via the direct link.  All of this
is based on my use of a session and the visit object.  So, reviewing you
code, I would think you need to have to check more than if the visit
exists.  You need to store a flag saying they they have been
authenticated.

regards,

Mark

Mark J. Stang
Senior Engineer/Architect
office: +1 303.468.2900
mobile: +1 303.507.2833
Ping Identity



-Original Message-
From: James Sherwood [mailto:[EMAIL PROTECTED]
Sent: Fri 2/23/2007 6:34 AM
To: Tapestry users
Subject: Page Validation
 Hello,

We use Tapestry 3.2

I have security (login) using PageValidateListener.

The secure page in the site is called ISOPage which extends BasePage.

I add the page validation using:
public ISOPage(){
super();
addPageValidateListener(new PageValidationListener());
}

The PageValidationListener class implements PageValidateListener and does
security like this:

if(visit.getUser() == null){
throw new PageRedirectException(UserLogin);
}

This all works fine it seems unless a direct is involved.

If I copy a directlink then try to access it without loggin in it shows
me the page the directlink java code

Page Validation

2007-02-23 Thread James Sherwood

Hello,

We use Tapestry 3.2

I have security (login) using PageValidateListener.

The secure page in the site is called ISOPage which extends BasePage.

I add the page validation using:
public ISOPage(){
super();
addPageValidateListener(new PageValidationListener());
}

The PageValidationListener class implements PageValidateListener and does 
security like this:


if(visit.getUser() == null){
throw new PageRedirectException(UserLogin);
}

This all works fine it seems unless a direct is involved.

If I copy a directlink then try to access it without loggin in it shows me 
the page the directlink java code is on.


The PageRedirectException does happen and if I refresh or try to go anywhere 
it sends me to the login but it still shows that page first.


Any ideas?
Thanks,
James 



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



Open new window on a form submit?

2006-10-11 Thread James Sherwood

Hello,

Is it possible to use a component of type Form and have the form submit 
listner open the page in a new window?


I am thinking it might have something to do with cycle.encodeURL() in the 
listener.


Thanks in advance,
James 



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



Keep your visit going to https?

2006-09-22 Thread James Sherwood

Hello,

We have a shopping cart site built and the actuall site is not secure until 
you go to the checkout phase.


The checkout button sends you to the checkout page and everything worked 
fine untill we made that page secure.


As soon as we made it secure we lose our visit.  I assume it is because we 
have to send them to a different url(same page same site just accessing it 
through a secure url).


Is there a way to keep our visit acrost this jump?

Thanks,
James 



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



Possible to make any page your homepage?

2006-08-15 Thread James Sherwood
We have designed a robust platform that lets them select any page they have 
created as their homepage.


Currently the way we do it is the homepage is simply a javascript redirect 
to the page they choose.


The problem is, when we do it this way thier hompage has a 
www.theirurl.com?service=vpage/1 style url.


Is there any way around this to make the url just www.theirurl.com when they 
first hit thier homepage?


Thanks,
James 



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



Can dynamic tapestry be done?

2006-06-13 Thread James Sherwood

This is the situation:

I would like to create a page in such a way that the jwcid's in the html are 
standard but I can produce the html any way I wish.


To do this there would have to be a way to pass tapestry the html of a page 
from a database for instance.


Something to the effect of a jwc id=insertTapestry/ in a page which 
inserts the html and tapestry tags but the html tags and tapestry tags that 
are inserted are still rendered by the engine.


Is this possible?

Thanks,
James 



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



Re: Can dynamic tapestry be done?

2006-06-13 Thread James Sherwood
I dont have to keep track of the components as they are always the same, I 
just want to change where they are in the html and the html itself to give 
the page a different look according to which site layout they choose.



James

- Original Message - 
From: Jesse Kuhnert [EMAIL PROTECTED]

To: Tapestry users users@tapestry.apache.org
Sent: Tuesday, June 13, 2006 6:10 PM
Subject: Re: Can dynamic tapestry be done?



Wouldn't it be easier to do something like this by changing the stylesheet
on the fly instead?

Even if you did have dynamic component stuff somehow I still wouldn't want
to maintain something like thator maybe it's a requirement you don't
have a choice in ?

On 6/13/06, James Sherwood [EMAIL PROTECTED] wrote:


Thanks for the feedback,

This does, however, pose a problem for me.

I am building a site and I wish to make it diverse enough to change its
appearance with the 'flick of a switch'.

Is is possible then to create several border components and call a
different
one according to which site layout you have designated without using the
idea of:

jwc id=checklayout1
jwc id=insertBorderComponent1/
/jwc

but instead, using the idea:

jwc id=insertBorder/

where the insertBorder component used a different component dependant on
the
site layout?

Thanks,
James


- Original Message -
From: Howard Lewis Ship [EMAIL PROTECTED]
To: Tapestry users users@tapestry.apache.org
Sent: Tuesday, June 13, 2006 5:39 PM
Subject: Re: Can dynamic tapestry be done?


 This goes against the grain of Tapestry.

 Here's some copy from the new Tapestry 5 web site (not yet available)
that
 conveys the reasoning behind this:

 Tapestry is designed to be extremely scalable in several dimensions:

   - Tapestry applications may contain many pages and many custom
   components.
   - Tapestry applications may contain very complex functionality.
   - Tapestry applications may be created by large, diverse teams.
   - Tapestry applications can service large numbers of concurrent 
 users.


 One core architecture decision in Tapestry exists to service many of 
 the
 above goals (and others that are harder to describe). *Static 
 Structure,

 Dynamic Behavior*

 In Tapestry, the structure of any particular page is *static*. This is
 necessary for several reasons, most importantly because Tapestry pages
are
 *
 pooled*. Creating and Tapestry page is an involved process, because the
 page
 object is simply the root of a large tree of other objects including
user
 provided components, many kinds of structural objects, template 
 objects,

 and
 others. Creating a new page instance for each request is simply not *
 scalable*.

 Instead, Tapestry *pools* pages. Once created, a page instance will be
 stored in a pool for that particular type of page, and reused in later
 requests. An incoming request, the result of a user clicking a link or
 submitting a form, will be processed by *some* server within a cluster,
 and
 will use *some* page instance within the page pool. Because page
instances
 are static and uniform across instances and servers, Tapestry can use
any
 available page instance, or create a new one as needed.

 Tapestry does not need to store page instances inside the HttpSession.
At
 most, it stores a smattering of *persistent properties* of the page in
the
 session, but not the entire page instance. This lean use of the
 HttpSession
 is key to Tapestry's very high scalability, especially in a clustered
 configuration.

 In some Tapestry-like frameworks, such as Faces and Wicket, the page
 structure is more dynamic, at the cost of storing much, much more data
in
 the HttpSession.

 This static structure is not so limiting as you might think. With
 different
 kinds of conditional and looping components, and the ability to jump
out
 of
 the flow and render components in an arbitrary order, you will not 
 find

 Tapestry to be rigid ... anything but!




 On 6/13/06, James Sherwood [EMAIL PROTECTED] wrote:

 This is the situation:

 I would like to create a page in such a way that the jwcid's in the
html
 are
 standard but I can produce the html any way I wish.

 To do this there would have to be a way to pass tapestry the html of a
 page
 from a database for instance.

 Something to the effect of a jwc id=insertTapestry/ in a page 
 which

 inserts the html and tapestry tags but the html tags and tapestry tags
 that
 are inserted are still rendered by the engine.

 Is this possible?

 Thanks,
 James


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




 --
 Howard M. Lewis Ship
 Independent J2EE / Open-Source Java Consultant
 Creator and PMC Chair, Apache Tapestry
 Creator, Jakarta HiveMind

 Professional Tapestry training, mentoring, support
 and project work.  http://howardlewisship.com



-
To unsubscribe, e-mail

Connection to mssql server on windows slow

2006-06-02 Thread James Sherwood

Hello,

For a few of our sites we use a MSSQL server 2000 database running on a 
win2003 server and connect to it from our linux box.  Everything was fine 
until a few days ago when we added a router/firewall to the win2003 server.


Now when we try to access those sites, sometimes they work great, sometimes 
the connection is VERY slow, so slow sometimes the page just wont come up 
and hangs.


We use Tapestry with Torque.

Anyone have ANY ideas as to what it might be or how to debug it as we have 
tried everything we can think of?


Thanks in advance,
James 



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