Re: tapestry-simple Archetype

2007-02-21 Thread Borut Bolčina

Hello,

this is my console output

C:\Documents and Settings\Borut\Desktop\work>mvn archetype:create
-DarchetypeGroupId=org.apache.tapestry -DarchetypeArti
factId=tapestry-simple -DarchetypeVersion=5.0.1
-DgroupId=org.example-DartifactId=myapp -DpackageName=
org.example.myapp
-Dversion=1.0.0-SNAPSHOT
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'archetype'.
[INFO]

[INFO] Building Maven Default Project
[INFO]task-segment: [archetype:create] (aggregator-style)
[INFO]

[INFO] Setting property: classpath.resource.loader.class => '
org.codehaus.plexus.velocity.ContextClassLoaderResourceLoad
er'.
[INFO] Setting property: resource.loader => 'classpath'.
[INFO] **
[INFO] Starting Jakarta Velocity v1.4
[INFO] RuntimeInstance initializing.
[INFO] Default Properties File:
org\apache\velocity\runtime\defaults\velocity.properties
[INFO] Default ResourceManager initializing. (class
org.apache.velocity.runtime.resource.ResourceManagerImpl)
[INFO] Resource Loader Instantiated:
org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader
[INFO] ClasspathResourceLoader : initialization starting.
[INFO] ClasspathResourceLoader : initialization complete.
[INFO] ResourceCache : initialized. (class
org.apache.velocity.runtime.resource.ResourceCacheImpl)
[INFO] Default ResourceManager initialization complete.
[INFO] Loaded System Directive:
org.apache.velocity.runtime.directive.Literal
[INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Macro
[INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Parse
[INFO] Loaded System Directive:
org.apache.velocity.runtime.directive.Include
[INFO] Loaded System Directive:
org.apache.velocity.runtime.directive.Foreach
[INFO] Created: 20 parsers.
[INFO] Velocimacro : initialization starting.
[INFO] Velocimacro : adding VMs from VM library template :
VM_global_library.vm
[ERROR] ResourceManager : unable to find resource 'VM_global_library.vm' in
any resource loader.
[INFO] Velocimacro : error using  VM library template VM_global_library.vm :
org.apache.velocity.exception.ResourceNotFo
undException: Unable to find resource 'VM_global_library.vm'
[INFO] Velocimacro :  VM library template macro registration complete.
[INFO] Velocimacro : allowInline = true : VMs can be defined inline in
templates
[INFO] Velocimacro : allowInlineToOverride = false : VMs defined inline may
NOT replace previous VM definitions
[INFO] Velocimacro : allowInlineLocal = false : VMs defined inline will be
global in scope if allowed.
[INFO] Velocimacro : messages on  : VM system will output logging messages
[INFO] Velocimacro : autoload off  : VM system will not automatically reload
global library macros
[INFO] Velocimacro : initialization complete.
[INFO] Velocity successfully started.
[INFO] [archetype:create]
[INFO]

[INFO] Using following parameters for creating Archetype: tapestry-simple:
5.0.1
[INFO]

[INFO] Parameter: groupId, Value: org.example
[INFO] Parameter: outputDirectory, Value: C:\Documents and
Settings\Borut\Desktop\work\myapp
[INFO] Parameter: packageName, Value: org.example.myapp
[INFO] Parameter: package, Value: org.example.myapp
[INFO] Parameter: version, Value: 1.0.0-SNAPSHOT
[INFO] Parameter: artifactId, Value: myapp
[INFO] ResourceManager : found archetype-resources/pom.xml with loader
org.codehaus.plexus.velocity.ContextClassLoaderRe
sourceLoader
[INFO] * End of debug info from resources from generated
POM ***
[INFO] ResourceManager : found
archetype-resources/src/main/java/pages/Start.java with loader
org.codehaus.plexus.veloci
ty.ContextClassLoaderResourceLoader
[INFO] ResourceManager : found
archetype-resources/src/main/java/services/AppModule.java with loader
org.codehaus.plexus
.velocity.ContextClassLoaderResourceLoader
[INFO] ResourceManager : found archetype-resources/.classpath with loader
org.codehaus.plexus.velocity.ContextClassLoade
rResourceLoader
[INFO] ResourceManager : found archetype-resources/.project with loader
org.codehaus.plexus.velocity.ContextClassLoaderR
esourceLoader
[INFO] ResourceManager : found
archetype-resources/src/main/webapp/index.html with loader
org.codehaus.plexus.velocity.C
ontextClassLoaderResourceLoader
[INFO] ResourceManager : found
archetype-resources/src/main/webapp/WEB-INF/web.xml with loader
org.codehaus.plexus.veloc
ity.ContextClassLoaderResourceLoader
[INFO] ResourceManager : found
archetype-resources/src/main/webapp/WEB-INF/Start.html with loader
org.codehaus.plexus.ve
locity.ContextClassLoaderResourceLoader
[WARNING] org.apache.velocity.runtime.exception.ReferenceException:
ref

Request character encoding

2007-02-21 Thread wong wayne
Dear all

I'm developing a system with multi-languages using
Tapestry 4.0. Checked with official web, default http
request would be UTF-8 but I found some problem when
Simplified Chinese input. All the data changed into
???. Below are my coding and configuration.

application file:
meta key="org.apache.tapestry.messages-encoding"
value="UTF-8"/>
meta key="org.apache.tapestry.messages-encoding_zh_TW"
value="Big5"/>  
meta key="org.apache.tapestry.messages-encoding_zh_CN"
value="UTF-8"/>
meta key="org.apache.tapestry.output-encoding"
value="UTF-8"/>
meta key="org.apache.tapestry.template-encoding"
value="UTF-8"/> 
meta key="org.apache.tapestry.page-class-packages"
value="com.hket.etbcsurvey.page"/>

page file:
component id="_validField_chnName" type="TextField">
   binding name="value" value="chnName"/>
/component> 

java file:
chnName = new
String(getChnName().getBytes("ISO-8859-1"),"UTF-8");

Any help would be appreciate, thanks.

regards

wayne



 

Looking for earth-friendly autos? 
Browse Top Cars by "Green Rating" at Yahoo! Autos' Green Center.
http://autos.yahoo.com/green_center/

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



Re: T5 BeanEditForm screencast

2007-02-21 Thread Jiri Mares

Very good design ...

Howard Lewis Ship napsal(a):
> The code that builds up the field validation is pluggable; originally
> I was thinking in terms of Hibernate/EJB3 annotations, but it should
> be reasonble to handle all kinds of approaches.  This part of the code
> and design is still very alpha (in flux).
> 
> On 2/21/07, Jiri Mares <[EMAIL PROTECTED]> wrote:
>>
>> Hi Howard,
>>
>> T5 looks very good. I would like to ask about the screencast #4 where
>> you presented BeanEditForm component. For
>> validation there is the annotation, which causes me problems.
>>
>> I don't want to annotade my business objects with tapestry annotation
>> (they start to depend on tapestry). At the moment
>> we are using OVal (oval.sf.net) for the Design by Contract and the
>> oval annotations carry the same information as the
>> tapestry validate annotation.
>>
>> So will it be easy to use for validation these annotations (instead of
>> the tapestry one)? Meaning if you are thinking
>> about some kind of pluggable validation framework ... or at least
>> pluggable validation definition framework.
>>
>> Thanks
>>
>> -- 
>> Jiří Mareš (mailto:[EMAIL PROTECTED])
>> ČSAD SVT Praha, s.r.o. (http://www.svt.cz)
>> Czech Republic
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 

-- 
Jiří Mareš (mailto:[EMAIL PROTECTED])
ČSAD SVT Praha, s.r.o. (http://www.svt.cz)
Czech Republic

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



Re: Problem with Number Translator in Tapestry 4.1.2 Snapshot

2007-02-21 Thread Julian Wood
I've just updated an app from 4.0.2 to 4.1.2-SNAPSHOT, current as of  
Feb 23rd, and can confirm that this is still a problem.


Previously (in 4.0.2) if you left a text field (say it was a score)  
empty, the field would take on the value of 0 (can't imagine why you  
would ever want this, but that's what it does).
If you set the omitZero parameter on the NumberTranslator on this  
field to true, then, it would remain null (desired behaviour) when  
empty.


In 4.1.2-SNAPSHOT, it always converts to 0, regardless of the value  
of the omitZero parameter (bad).


J

On 8-Jan-07, at 9:56 AM, Jesse Kuhnert wrote:


This was a jira issue "fixed" recently. I'm not sure I understand what
the expected->actual results are that are questionable.

On 1/8/07, Patrick Klein <[EMAIL PROTECTED]> wrote:

Hi!

After a little testing:
The behaviour of the NumberTranslater is persistent in version 4.1.1.
Switching back to 4.0.2 for now, which is nothing i want to do as i'd
like to use the ajax functionality of tap 4.1.x ...

Regards,
Patrick
> Hi!
>
> I just recognized that the NumberTranslator does not seem to work
> correctly. OmitZero=true results in no value shown in the form- 
field

> after a rewind but the value "0" is stored inside the corresponding
> Long- (or Integer / BigDecimal / ...) variable. OmitZero=false  
shows

> the stored "0" in the form-field.
>
> Has anyone recognized this behaviour, too and if yes is there a
> workaround (except writing your own NumberTranslator)? Or is this
> Problem maybe allready known and fixed...?
>
> I'm using this mornings (GMT+1) Tapestry 4.1.2 Snapshot from
> mvn-snapshot.
>
> Regards,
>Patrick


--
Julian Wood <[EMAIL PROTECTED]>

Software Engineer
Teaching & Learning Centre
University of Calgary

http://tlc.ucalgary.ca




Re: tapestry-simple Archetype

2007-02-21 Thread Howard Lewis Ship

Well, I didn't have the right codec on my Mac, so all I get is the
sound of keys clicking!

Here I tried it at the command line:

$ mvn archetype:create -DarchetypeGroupId=org.apache.tapestry
-DarchetypeArtifactId=tapestry-simple -DarchetypeVersion=5.0.1
-DgroupId=org.example -DartifactId=itworks
-DpackageName=org.example.itworks -Dversion=1.0.0-SNAPSHOT
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'archetype'.
[INFO] 

[INFO] Building Maven Default Project
[INFO]task-segment: [archetype:create] (aggregator-style)
[INFO] 

[INFO] Setting property: classpath.resource.loader.class =>
'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'.
[INFO] Setting property: velocimacro.messages.on => 'false'.
[INFO] Setting property: resource.loader => 'classpath'.
[INFO] Setting property: resource.manager.logwhenfound => 'false'.
[INFO] **
[INFO] Starting Jakarta Velocity v1.4
[INFO] RuntimeInstance initializing.
[INFO] Default Properties File:
org/apache/velocity/runtime/defaults/velocity.properties
[INFO] Default ResourceManager initializing. (class
org.apache.velocity.runtime.resource.ResourceManagerImpl)
[INFO] Resource Loader Instantiated:
org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader
[INFO] ClasspathResourceLoader : initialization starting.
[INFO] ClasspathResourceLoader : initialization complete.
[INFO] ResourceCache : initialized. (class
org.apache.velocity.runtime.resource.ResourceCacheImpl)
[INFO] Default ResourceManager initialization complete.
[INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Literal
[INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Macro
[INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Parse
[INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Include
[INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Foreach
[INFO] Created: 20 parsers.
[INFO] Velocimacro : initialization starting.
[INFO] Velocimacro : adding VMs from VM library template : VM_global_library.vm
[ERROR] ResourceManager : unable to find resource
'VM_global_library.vm' in any resource loader.
[INFO] Velocimacro : error using  VM library template
VM_global_library.vm :
org.apache.velocity.exception.ResourceNotFoundException: Unable to
find resource 'VM_global_library.vm'
[INFO] Velocimacro :  VM library template macro registration complete.
[INFO] Velocimacro : allowInline = true : VMs can be defined inline in templates
[INFO] Velocimacro : allowInlineToOverride = false : VMs defined
inline may NOT replace previous VM definitions
[INFO] Velocimacro : allowInlineLocal = false : VMs defined inline
will be  global in scope if allowed.
[INFO] Velocimacro : initialization complete.
[INFO] Velocity successfully started.
[INFO] [archetype:create]
Downloading: 
http://repo1.maven.org/maven2/org/apache/tapestry/tapestry-simple/5.0.1/tapestry-simple-5.0.1.jar
9K downloaded
[INFO] 

[INFO] Using following parameters for creating Archetype: tapestry-simple:5.0.1
[INFO] 

[INFO] Parameter: groupId, Value: org.example
[INFO] Parameter: packageName, Value: org.example.itworks
[INFO] Parameter: basedir, Value: /Users/Howard/work
[INFO] Parameter: package, Value: org.example.itworks
[INFO] Parameter: version, Value: 1.0.0-SNAPSHOT
[INFO] Parameter: artifactId, Value: itworks
[INFO] * End of debug info from resources from
generated POM ***
[WARNING] org.apache.velocity.runtime.exception.ReferenceException:
reference : template =
archetype-resources/src/main/webapp/WEB-INF/Start.html [line 11,column
34] : ${currentTime} is not a valid reference.
[INFO] Archetype created in dir: /Users/Howard/work/itworks
[INFO] 
[INFO] BUILD SUCCESSFUL
[INFO] 
[INFO] Total time: 2 seconds
[INFO] Finished at: Wed Feb 21 15:27:57 PST 2007
[INFO] Final Memory: 4M/8M
[INFO] 
~/work
$ find itworks
itworks
itworks/.classpath
itworks/.project
itworks/pom.xml
itworks/src
itworks/src/main
itworks/src/main/java
itworks/src/main/java/org
itworks/src/main/java/org/example
itworks/src/main/java/org/example/itworks
itworks/src/main/java/org/example/itworks/pages
itworks/src/main/java/org/example/itworks/pages/Start.java
itworks/src/main/java/org/example/itworks/services
itworks/src/main/java/org/example/itworks/services/AppModule.java
itworks/src/main/resources
itworks/src/main/resources/log4j.properties

Re: State Application Object ( Session ) from constructor method

2007-02-21 Thread Bruno Mignoni

Tks. It´s a live. ;-)



On 2/21/07, Howard Lewis Ship <[EMAIL PROTECTED]> wrote:


You can't.  The page is not fully "baked" at the time the constructor
is invoked.

What you want is a PageLoadListener.  Just implement the interface and
the pageDidLoad() method and Tapestry will invoke it.  That's where
you can do the initialization you want.

On 2/21/07, Bruno Mignoni <[EMAIL PROTECTED]> wrote:
> I am use Tapestry 4.02 and Tomcat 5.
>
> How access a state Application Object ( Session ) from de constructor
> method?
>
> package com.unicred.tapestry.ib.pages;
>
> import java.sql.SQLException;
>
> import org.apache.tapestry.annotations.InjectState;
>
> import com.unicred.tapestry.ib.InternetBankingBasePage;
> import com.unicred.tapestry.ib.sistema.Procuracao;
>
> public abstract class Home extends InternetBankingBasePage {
>
> public Home() throws SQLException, Exception {
>
> System.out.println(getProcuracao().getNomeUsuario());
>
>
> }
>
> @InjectState("procuracao")
> public abstract Procuracao getProcuracao();
>
>
>
> }
>
> Don't work System.out.println(getProcuracao().getNomeUsuario());
>
> Need to use PageAttachListener (
> http://tapestry.apache.org/tapestry4/UsersGuide/events.html )? How do
it?
>
> Tks
> <
http://tapestry.apache.org/tapestry4/tapestry/apidocs/org/apache/tapestry/event/PageAttachListener.html
>--
>
> __
> Bruno Mignoni
> [EMAIL PROTECTED]
>


--
Howard M. Lewis Ship
TWD Consulting, Inc.
Independent J2EE / Open-Source Java Consultant
Creator and PMC Chair, Apache Tapestry
Creator, Apache HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

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





--
__
Bruno Mignoni
[EMAIL PROTECTED]


Re: Foreach, iterate over several collections at once

2007-02-21 Thread Darío Vasconcelos

Wow!

OK, now I get it. Yes, I'm using T3.x. I never thought about that use
for the index parameter, I had used only to display the current row's
number. Your solution is very attractive because it will be trivial to
add new columns to the table in case I need to, which was a major
problem with the solution I was devising. It was only a matter of
thinking about OGNL expressions in a different way than I always use
them.

Thanks a lot, Mark.

Regards,

Dario


On 2/21/07, Mark Stang <[EMAIL PROTECTED]> wrote:

Dario,
The Foreach component T3.x, which I presume you are using (If you are not,check the 
components for your version), contains a parameter named "index".

index   int out no  Used to store the index of the current 
value within the stream of elements provided by the source parameter. The index 
parameter is explicitly updated before the value parameter.

If you set it:

index="ognl:currentIndex"

Then as Tapestry iterates over the list that was passed to the "Foreach" it will call 
"setCurrentIndex" with the current index.  This happens at the top of the loop.  So, in the body of the 
Foreach for a particular  you can call getList1().  Since you are not passing in a value/parameter to 
getList1(), how does it know what item in the list to return?  Inside the method, you use "currentIndex" 
to pick the item in the list to return.

Basically, the Foreach knows what iteration it is on.  You can have it pass 
that value back to your Java Class with a setter. Whenever you call any of the 
getList methods, they use the value passed in by the Foreach.

HTH,

Mark

Mark J. Stang
Senior Engineer/Architect
office: +1 303.468.2900
mobile: +1 303.507.2833
Ping Identity



-Original Message-
From: Darío Vasconcelos [mailto:[EMAIL PROTECTED]
Sent: Wed 2/21/2007 3:06 PM
To: Tapestry users
Subject: Re: Foreach, iterate over several collections at once

Sorry Mark,

I didn't quite understand what you're saying, although it sounds very
interesting. I can't imagine how I could make Foreach update the
current value for each list, using only one Foreach. Or could I use
nested Foreachs? If you would be so kind as to give me a small
example, I would be very grateful...

Dario.

On 2/21/07, Mark Stang <[EMAIL PROTECTED]> wrote:
> Hi,
> The Foreach can call your class with the "current" index and set it.  The "getters" use 
that value to return the "current" value for each list.
>
> HTH,
>
> Mark
>
> Mark J. Stang
> Senior Engineer/Architect
> office: +1 303.468.2900
> mobile: +1 303.507.2833
> Ping Identity
>
>
>
> -Original Message-
> From: Darío Vasconcelos [mailto:[EMAIL PROTECTED]
> Sent: Wed 2/21/2007 2:43 PM
> To: Tapestry users
> Subject: Foreach, iterate over several collections at once
>
> Hi,
>
> I'm trying to solve a problem that might be trivial in JSP, but I
> can't find a way to do it in Tapestry without some collection munching
> in Java.
>
> My problem is that I have three ArrayLists that hold very similar
> information, and need to be displayed inside the same table. To
> explain this better, let me draw a simple diagram:
>
> HeaderRow1   list1 list2   list3
> HeaderRow2   list2 list2   list3
> HeaderRow3   list3 list2   list3
>
> That is, List1 contains a HashMap with two elements: HeaderRow1 and
> the value for List1. List2 contains also a HashMap with twoelements,
> HeaderRow1 and list2. The same applies to List3.
>
> I'm thinking on using a Foreach for this, but it will only iterate
> over one of the lists, and I **really** need this data to be in the
> same table. Of course, more than just one column per list needs to be
> displayed, my example is a simplification.
>
> The obvious solution is to create a getJoinedTable() method and join
> the three collections into one big ArrayList, but the code isn't nice,
> and since I need to do this for several other pages, the picture is
> not very nice.
>
> What puzzles me is that the solution to this problem in JSP would be
> s simple!! There has to be a "Tapestried" way to do it...
>
> Regards,
>
> Dario
>
>
> --
> A zygote is a gamete's way of producing more gametes. This may be the
> purpose of the universe.
>  - Robert A. Heinlein
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>


--
A zygote is a gamete's way of producing more gametes. This may be the
purpose of the universe.
 - Robert A. Heinlein

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






--
A zygote is a gamete's way of producing more gametes. This may be the
purpose of the universe.
- Robert A. Heinlein

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

RE: Foreach, iterate over several collections at once

2007-02-21 Thread Mark Stang
Dario,
The Foreach component T3.x, which I presume you are using (If you are not,check 
the components for your version), contains a parameter named "index".

index   int out no  Used to store the index of the current 
value within the stream of elements provided by the source parameter. The index 
parameter is explicitly updated before the value parameter.

If you set it:

index="ognl:currentIndex"

Then as Tapestry iterates over the list that was passed to the "Foreach" it 
will call "setCurrentIndex" with the current index.  This happens at the top of 
the loop.  So, in the body of the Foreach for a particular  you can call 
getList1().  Since you are not passing in a value/parameter to getList1(), how 
does it know what item in the list to return?  Inside the method, you use 
"currentIndex" to pick the item in the list to return.

Basically, the Foreach knows what iteration it is on.  You can have it pass 
that value back to your Java Class with a setter. Whenever you call any of the 
getList methods, they use the value passed in by the Foreach.

HTH,

Mark

Mark J. Stang
Senior Engineer/Architect
office: +1 303.468.2900
mobile: +1 303.507.2833
Ping Identity



-Original Message-
From: Darío Vasconcelos [mailto:[EMAIL PROTECTED]
Sent: Wed 2/21/2007 3:06 PM
To: Tapestry users
Subject: Re: Foreach, iterate over several collections at once
 
Sorry Mark,

I didn't quite understand what you're saying, although it sounds very
interesting. I can't imagine how I could make Foreach update the
current value for each list, using only one Foreach. Or could I use
nested Foreachs? If you would be so kind as to give me a small
example, I would be very grateful...

Dario.

On 2/21/07, Mark Stang <[EMAIL PROTECTED]> wrote:
> Hi,
> The Foreach can call your class with the "current" index and set it.  The 
> "getters" use that value to return the "current" value for each list.
>
> HTH,
>
> Mark
>
> Mark J. Stang
> Senior Engineer/Architect
> office: +1 303.468.2900
> mobile: +1 303.507.2833
> Ping Identity
>
>
>
> -Original Message-
> From: Darío Vasconcelos [mailto:[EMAIL PROTECTED]
> Sent: Wed 2/21/2007 2:43 PM
> To: Tapestry users
> Subject: Foreach, iterate over several collections at once
>
> Hi,
>
> I'm trying to solve a problem that might be trivial in JSP, but I
> can't find a way to do it in Tapestry without some collection munching
> in Java.
>
> My problem is that I have three ArrayLists that hold very similar
> information, and need to be displayed inside the same table. To
> explain this better, let me draw a simple diagram:
>
> HeaderRow1   list1 list2   list3
> HeaderRow2   list2 list2   list3
> HeaderRow3   list3 list2   list3
>
> That is, List1 contains a HashMap with two elements: HeaderRow1 and
> the value for List1. List2 contains also a HashMap with twoelements,
> HeaderRow1 and list2. The same applies to List3.
>
> I'm thinking on using a Foreach for this, but it will only iterate
> over one of the lists, and I **really** need this data to be in the
> same table. Of course, more than just one column per list needs to be
> displayed, my example is a simplification.
>
> The obvious solution is to create a getJoinedTable() method and join
> the three collections into one big ArrayList, but the code isn't nice,
> and since I need to do this for several other pages, the picture is
> not very nice.
>
> What puzzles me is that the solution to this problem in JSP would be
> s simple!! There has to be a "Tapestried" way to do it...
>
> Regards,
>
> Dario
>
>
> --
> A zygote is a gamete's way of producing more gametes. This may be the
> purpose of the universe.
>  - Robert A. Heinlein
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>


-- 
A zygote is a gamete's way of producing more gametes. This may be the
purpose of the universe.
 - Robert A. Heinlein

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




Re: tapestry-simple Archetype

2007-02-21 Thread Borut Bolčina

Here is a 3.7 MB screencast on a slow connection
http://svarog.homeip.net/screencast/archetype.avi


2007/2/21, Howard Lewis Ship <[EMAIL PROTECTED]>:


Could you carefully double check this.

I haven't tried this using the maven plugin (in fact, I'm using 0.0.9
which may not even have that feature).  I've tested this from the
command line.



On 2/21/07, Borut Bolčina <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I think there is an error in creating package names in this archetype.
When
> running
>
> mvn archetype:create
> -DarchetypeGroupId=
org.apache.tapestry-DarchetypeArtifactId=tapestry-simple
> -DarchetypeVersion=
> 5.0.1 -DgroupId=*org.example* -DartifactId=*myapp* -DpackageName=*
> org.example.myapp* -Dversion=*1.0.0-SNAPSHOT*
>
>
> the following directory structure gets created
>
> work\myapp\src\main\java\pages\org\example\myapp
>
> but the java class Start.java in that directory has
> package org.example.myapp.pages;
>
> so one must move the class into the right package which is with one
click in
> Eclipse, but still...
>
> The same goes for services directory.
>
> I am using http://m2eclipse.codehaus.org/ version 0.0.10
>
> Cheers,
> Borut
>


--
Howard M. Lewis Ship
TWD Consulting, Inc.
Independent J2EE / Open-Source Java Consultant
Creator and PMC Chair, Apache Tapestry
Creator, Apache HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com



Re: Foreach, iterate over several collections at once

2007-02-21 Thread Darío Vasconcelos

Sorry Mark,

I didn't quite understand what you're saying, although it sounds very
interesting. I can't imagine how I could make Foreach update the
current value for each list, using only one Foreach. Or could I use
nested Foreachs? If you would be so kind as to give me a small
example, I would be very grateful...

Dario.

On 2/21/07, Mark Stang <[EMAIL PROTECTED]> wrote:

Hi,
The Foreach can call your class with the "current" index and set it.  The "getters" use 
that value to return the "current" value for each list.

HTH,

Mark

Mark J. Stang
Senior Engineer/Architect
office: +1 303.468.2900
mobile: +1 303.507.2833
Ping Identity



-Original Message-
From: Darío Vasconcelos [mailto:[EMAIL PROTECTED]
Sent: Wed 2/21/2007 2:43 PM
To: Tapestry users
Subject: Foreach, iterate over several collections at once

Hi,

I'm trying to solve a problem that might be trivial in JSP, but I
can't find a way to do it in Tapestry without some collection munching
in Java.

My problem is that I have three ArrayLists that hold very similar
information, and need to be displayed inside the same table. To
explain this better, let me draw a simple diagram:

HeaderRow1   list1 list2   list3
HeaderRow2   list2 list2   list3
HeaderRow3   list3 list2   list3

That is, List1 contains a HashMap with two elements: HeaderRow1 and
the value for List1. List2 contains also a HashMap with twoelements,
HeaderRow1 and list2. The same applies to List3.

I'm thinking on using a Foreach for this, but it will only iterate
over one of the lists, and I **really** need this data to be in the
same table. Of course, more than just one column per list needs to be
displayed, my example is a simplification.

The obvious solution is to create a getJoinedTable() method and join
the three collections into one big ArrayList, but the code isn't nice,
and since I need to do this for several other pages, the picture is
not very nice.

What puzzles me is that the solution to this problem in JSP would be
s simple!! There has to be a "Tapestried" way to do it...

Regards,

Dario


--
A zygote is a gamete's way of producing more gametes. This may be the
purpose of the universe.
 - Robert A. Heinlein

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






--
A zygote is a gamete's way of producing more gametes. This may be the
purpose of the universe.
- Robert A. Heinlein

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



RE: Foreach, iterate over several collections at once

2007-02-21 Thread Mark Stang
Hi,
The Foreach can call your class with the "current" index and set it.  The 
"getters" use that value to return the "current" value for each list.

HTH,

Mark

Mark J. Stang
Senior Engineer/Architect
office: +1 303.468.2900
mobile: +1 303.507.2833
Ping Identity



-Original Message-
From: Darío Vasconcelos [mailto:[EMAIL PROTECTED]
Sent: Wed 2/21/2007 2:43 PM
To: Tapestry users
Subject: Foreach, iterate over several collections at once
 
Hi,

I'm trying to solve a problem that might be trivial in JSP, but I
can't find a way to do it in Tapestry without some collection munching
in Java.

My problem is that I have three ArrayLists that hold very similar
information, and need to be displayed inside the same table. To
explain this better, let me draw a simple diagram:

HeaderRow1   list1 list2   list3
HeaderRow2   list2 list2   list3
HeaderRow3   list3 list2   list3

That is, List1 contains a HashMap with two elements: HeaderRow1 and
the value for List1. List2 contains also a HashMap with twoelements,
HeaderRow1 and list2. The same applies to List3.

I'm thinking on using a Foreach for this, but it will only iterate
over one of the lists, and I **really** need this data to be in the
same table. Of course, more than just one column per list needs to be
displayed, my example is a simplification.

The obvious solution is to create a getJoinedTable() method and join
the three collections into one big ArrayList, but the code isn't nice,
and since I need to do this for several other pages, the picture is
not very nice.

What puzzles me is that the solution to this problem in JSP would be
s simple!! There has to be a "Tapestried" way to do it...

Regards,

Dario


-- 
A zygote is a gamete's way of producing more gametes. This may be the
purpose of the universe.
 - Robert A. Heinlein

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




Foreach, iterate over several collections at once

2007-02-21 Thread Darío Vasconcelos

Hi,

I'm trying to solve a problem that might be trivial in JSP, but I
can't find a way to do it in Tapestry without some collection munching
in Java.

My problem is that I have three ArrayLists that hold very similar
information, and need to be displayed inside the same table. To
explain this better, let me draw a simple diagram:

HeaderRow1   list1 list2   list3
HeaderRow2   list2 list2   list3
HeaderRow3   list3 list2   list3

That is, List1 contains a HashMap with two elements: HeaderRow1 and
the value for List1. List2 contains also a HashMap with twoelements,
HeaderRow1 and list2. The same applies to List3.

I'm thinking on using a Foreach for this, but it will only iterate
over one of the lists, and I **really** need this data to be in the
same table. Of course, more than just one column per list needs to be
displayed, my example is a simplification.

The obvious solution is to create a getJoinedTable() method and join
the three collections into one big ArrayList, but the code isn't nice,
and since I need to do this for several other pages, the picture is
not very nice.

What puzzles me is that the solution to this problem in JSP would be
s simple!! There has to be a "Tapestried" way to do it...

Regards,

Dario


--
A zygote is a gamete's way of producing more gametes. This may be the
purpose of the universe.
- Robert A. Heinlein

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



Re: My crap development environment

2007-02-21 Thread Markus Eberle
hi,

as you are using windows, there are some new options what can slow down
your system.
We have expirience such slow downs, when using tortoisesvn and an
on-access virus-scanner. It is always a good thing trying to disable
these scanners if there are performance issues with saving files.

Cheers,
Markus

Murray Collingwood schrieb:
> Hi all
> 
> Does anybody else find this hellishly confusing?  It makes me want to throw
> everything out and go back to a nice simple DOS system and a Turbo C 
> compiler! 
> How much simpler it was back then...
> 
> Okay, I downloaded the latest Eclipse system, copied my project into a fresh
> workspace.  Saving a file was back to a sub-second response.  Actually I tried
> saving a second file to make sure it wasn't a fluke the first time.  There was
> definitely a problem somewhere and it has now gone away.
> 
> Okay, now the second part of the problem.
> 
> Tomcat or Jetty???
> 
> I don't want to package every time I make a small change to a config file or
> HTML, so I want the servlet engine to use my files from my development area.  
> My
> previous frustrations with restarting tomcat have encouraged me down the Jetty
> track - I downloaded Jetty 6 yesterday and the test system was working in 
> about
> 5 minutes, pretty good.  I then added a context.xml for my application and now
> when I start Jetty it simple crashes and refuses to start the application.  I
> get an error like:  'No class for Servlet or Filter'
> 
> I haven't been able to find any help on this error.
> 
> I did find information on a Jetty-Maven-Plugin but form my reading this is all
> about packaging the application - I don't want to go there.  I also found a
> number of recent comments about Maven2 saying it was still quite buggy.
> 
> Do I press ahead trying to solve the Jetty stuff or do I revert back to a 
> Tomcat
> system???
> 
> I'm developing in a Windows XP environment so this may limit me from some of 
> the
> options suggested here.
> 
> PS Thanks to everybody who has contributed so far - I really appreciate your
> ideas and suggestions.  You really are a very friendly bunch of people.
> 
> PPS My computer is an Intel 2.8ghz processor with 1gb ram and 80gb harddrive. 
> It's not slow with other stuff.
> 
> Cheers
> Murray
> 
> Some of my understandings:
> Sysdeo-tomcat-plugin - packages app and restarts Tomcat
> WTP - packages app and restarts Tomcat
> Web Standard Tools - I was using this
> AJDT - never used it
> Jetty6 plugin - is this the Jetty-maven-plugin referred above of different?

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



Putting hivemind configuration files outside the WAR

2007-02-21 Thread Tapestry User List

Hi,

I have configuration data (hivemind.xml) which may change reasonably often,
and which I'd like to be able to change without rebuilding the war file.
What's the best way to make this available to HiveMind in Tapestry?

Is there a easy way to do that or do I have to subclass ApplicationServlet
and overrid the constructRegistry() method ?

D.


Re: Tapestry 5 NPE in PageTester

2007-02-21 Thread Howard Lewis Ship

Oh, and from memory, I'm guessing this has something to do with the
code that adds the default Tapstry stylesheet to rendered pages.

On 2/21/07, Howard Lewis Ship <[EMAIL PROTECTED]> wrote:

Nope, you tend to backtrack to the chunk of code that dynamically
built the Javassist class.  Here, I'd start looking at line 78 and see
what's going on there.

On 2/21/07, Matt Ayres <[EMAIL PROTECTED]> wrote:
> I'm running into a NullPointerException in PageTester if a 
> element exists in the page template. Here's a snippet of the stack
> trace:
>
> Exception in thread "main" java.lang.NullPointerException
> at $Request_110d9536317.getContextPath($Request_110d9536317.java)
> at $Request_110d95362e3.getContextPath($Request_110d95362e3.java)
> at
> org.apache.tapestry.internal.services.ClasspathAssetAliasManagerImpl.toC
> lientURL(ClasspathAssetAliasManagerImpl.java:78)
>
> There's a little more info at
> https://issues.apache.org/jira/browse/TAPESTRY-1279
>
> Is there a good way to debug a Javassist manipulated class?
>
> -Matt
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
Howard M. Lewis Ship
TWD Consulting, Inc.
Independent J2EE / Open-Source Java Consultant
Creator and PMC Chair, Apache Tapestry
Creator, Apache HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com




--
Howard M. Lewis Ship
TWD Consulting, Inc.
Independent J2EE / Open-Source Java Consultant
Creator and PMC Chair, Apache Tapestry
Creator, Apache HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

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



Re: [WARNING] Tap 5 redirect after onActivate

2007-02-21 Thread Howard Lewis Ship

Just checked in the changes to SVN.

On 2/20/07, bueggers <[EMAIL PROTECTED]> wrote:


ok, thanks


Howard Lewis Ship wrote:
>
> Your snippet is what I have in mind, but I haven't had a chance to
> implement it, yet.
>
> I suspect a 5.0.2 is around the corner, but I'm fighting some fires right
> now!
>
> On 2/20/07, bueggers <[EMAIL PROTECTED]> wrote:
>>
>> It basically works when I do the following.
>>
>> try {
>> response.sendRedirect("../Error");
>>  } catch (IOException e1) {
>> e1.printStackTrace();
>>  }
>>
>> But this is quite dirty.
>> In the above snippet I can show the error page. But I need to set an
>> error
>> message to the error page.
>> This makes me manually do url encoding.
>> I expect the framework to do all that for me.
>>
>> I would expect to be able to do something like the following:
>>
>> @InjectPage
>> private Error errorPage;
>>
>> @SetupRender
>> private Object loadDetails(){
>> 
>> //id not found
>> errorPage.setErrorMessage("No valid id " + id);
>> return errorPage;
>> }
>>
>>
>>
>>
>> Massimo Lusetti wrote:
>> >
>> > On 2/20/07, bueggers <[EMAIL PROTECTED]> wrote:
>> >
>> >> But where to do the redirection to an error page in Tap 5?
>> >> The onActivate method detects the error but how to display other page
>> >> then?
>> >
>> > Isn't as simple as injecting infrastructure:Response and then use
>> > sendRedirect ?
>> >
>> > --
>> > Massimo
>> > http://meridio.blogspot.com
>> >
>> > -
>> > To unsubscribe, e-mail: [EMAIL PROTECTED]
>> > For additional commands, e-mail: [EMAIL PROTECTED]
>> >
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Tap-5-redirect-after-onActivate-tf3260344.html#a9076144
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
>
> --
> Howard M. Lewis Ship
> TWD Consulting, Inc.
> Independent J2EE / Open-Source Java Consultant
> Creator and PMC Chair, Apache Tapestry
> Creator, Apache HiveMind
>
> Professional Tapestry training, mentoring, support
> and project work.  http://howardlewisship.com
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>

--
View this message in context: 
http://www.nabble.com/Tap-5-redirect-after-onActivate-tf3260344.html#a9076245
Sent from the Tapestry - User mailing list archive at Nabble.com.


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





--
Howard M. Lewis Ship
TWD Consulting, Inc.
Independent J2EE / Open-Source Java Consultant
Creator and PMC Chair, Apache Tapestry
Creator, Apache HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

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



Re: Tapestry 5 NPE in PageTester

2007-02-21 Thread Howard Lewis Ship

Nope, you tend to backtrack to the chunk of code that dynamically
built the Javassist class.  Here, I'd start looking at line 78 and see
what's going on there.

On 2/21/07, Matt Ayres <[EMAIL PROTECTED]> wrote:

I'm running into a NullPointerException in PageTester if a 
element exists in the page template. Here's a snippet of the stack
trace:

Exception in thread "main" java.lang.NullPointerException
at $Request_110d9536317.getContextPath($Request_110d9536317.java)
at $Request_110d95362e3.getContextPath($Request_110d95362e3.java)
at
org.apache.tapestry.internal.services.ClasspathAssetAliasManagerImpl.toC
lientURL(ClasspathAssetAliasManagerImpl.java:78)

There's a little more info at
https://issues.apache.org/jira/browse/TAPESTRY-1279

Is there a good way to debug a Javassist manipulated class?

-Matt


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





--
Howard M. Lewis Ship
TWD Consulting, Inc.
Independent J2EE / Open-Source Java Consultant
Creator and PMC Chair, Apache Tapestry
Creator, Apache HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

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



Re: T5 BeanEditForm screencast

2007-02-21 Thread Howard Lewis Ship

The code that builds up the field validation is pluggable; originally
I was thinking in terms of Hibernate/EJB3 annotations, but it should
be reasonble to handle all kinds of approaches.  This part of the code
and design is still very alpha (in flux).

On 2/21/07, Jiri Mares <[EMAIL PROTECTED]> wrote:


Hi Howard,

T5 looks very good. I would like to ask about the screencast #4 where you 
presented BeanEditForm component. For
validation there is the annotation, which causes me problems.

I don't want to annotade my business objects with tapestry annotation (they 
start to depend on tapestry). At the moment
we are using OVal (oval.sf.net) for the Design by Contract and the oval 
annotations carry the same information as the
tapestry validate annotation.

So will it be easy to use for validation these annotations (instead of the 
tapestry one)? Meaning if you are thinking
about some kind of pluggable validation framework ... or at least pluggable 
validation definition framework.

Thanks

--
Jiří Mareš (mailto:[EMAIL PROTECTED])
ČSAD SVT Praha, s.r.o. (http://www.svt.cz)
Czech Republic

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





--
Howard M. Lewis Ship
TWD Consulting, Inc.
Independent J2EE / Open-Source Java Consultant
Creator and PMC Chair, Apache Tapestry
Creator, Apache HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com


Re: State Application Object ( Session ) from constructor method

2007-02-21 Thread Howard Lewis Ship

You can't.  The page is not fully "baked" at the time the constructor
is invoked.

What you want is a PageLoadListener.  Just implement the interface and
the pageDidLoad() method and Tapestry will invoke it.  That's where
you can do the initialization you want.

On 2/21/07, Bruno Mignoni <[EMAIL PROTECTED]> wrote:

I am use Tapestry 4.02 and Tomcat 5.

How access a state Application Object ( Session ) from de constructor
method?

package com.unicred.tapestry.ib.pages;

import java.sql.SQLException;

import org.apache.tapestry.annotations.InjectState;

import com.unicred.tapestry.ib.InternetBankingBasePage;
import com.unicred.tapestry.ib.sistema.Procuracao;

public abstract class Home extends InternetBankingBasePage {

public Home() throws SQLException, Exception {

System.out.println(getProcuracao().getNomeUsuario());


}

@InjectState("procuracao")
public abstract Procuracao getProcuracao();



}

Don't work System.out.println(getProcuracao().getNomeUsuario());

Need to use PageAttachListener (
http://tapestry.apache.org/tapestry4/UsersGuide/events.html )? How do it?

Tks
--

__
Bruno Mignoni
[EMAIL PROTECTED]




--
Howard M. Lewis Ship
TWD Consulting, Inc.
Independent J2EE / Open-Source Java Consultant
Creator and PMC Chair, Apache Tapestry
Creator, Apache HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

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



Re: My crap development environment

2007-02-21 Thread Richard Clark

Nobody asked one of the more obvious questions:

How much free RAM do you have? How full and/or fragmented is your
drive? Heavy and/or ineffcient swapping could also slow you down.

(Also, what kind of machine? Some Java implementations are faster than others.)

...R


On 2/14/07, Murray Collingwood <[EMAIL PROTECTED]> wrote:

Hi all

I have suffered long and hard under Eclipse and Tomcat.  Is it really necessary
for me to wait so long while a file is saved or an application is published???

Saving a .java file: 15 seconds
Saving a .html file: 15 seconds
Saving a .jwc file: 28 seconds

Stopping the tomcat server: 2 seconds (acceptable)
Publishing to the tomcat server: 45 seconds
Starting the tomcat server: 54 seconds (it insists on publishing first)


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



Re: tapestry-simple Archetype

2007-02-21 Thread Howard Lewis Ship

Could you carefully double check this.

I haven't tried this using the maven plugin (in fact, I'm using 0.0.9
which may not even have that feature).  I've tested this from the
command line.



On 2/21/07, Borut Bolčina <[EMAIL PROTECTED]> wrote:

Hello,

I think there is an error in creating package names in this archetype. When
running

mvn archetype:create
-DarchetypeGroupId=org.apache.tapestry-DarchetypeArtifactId=tapestry-simple
-DarchetypeVersion=
5.0.1 -DgroupId=*org.example* -DartifactId=*myapp* -DpackageName=*
org.example.myapp* -Dversion=*1.0.0-SNAPSHOT*


the following directory structure gets created

work\myapp\src\main\java\pages\org\example\myapp

but the java class Start.java in that directory has
package org.example.myapp.pages;

so one must move the class into the right package which is with one click in
Eclipse, but still...

The same goes for services directory.

I am using http://m2eclipse.codehaus.org/ version 0.0.10

Cheers,
Borut




--
Howard M. Lewis Ship
TWD Consulting, Inc.
Independent J2EE / Open-Source Java Consultant
Creator and PMC Chair, Apache Tapestry
Creator, Apache HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com


tapestry-simple Archetype

2007-02-21 Thread Borut Bolčina

Hello,

I think there is an error in creating package names in this archetype. When
running

mvn archetype:create
-DarchetypeGroupId=org.apache.tapestry-DarchetypeArtifactId=tapestry-simple
-DarchetypeVersion=
5.0.1 -DgroupId=*org.example* -DartifactId=*myapp* -DpackageName=*
org.example.myapp* -Dversion=*1.0.0-SNAPSHOT*


the following directory structure gets created

work\myapp\src\main\java\pages\org\example\myapp

but the java class Start.java in that directory has
package org.example.myapp.pages;

so one must move the class into the right package which is with one click in
Eclipse, but still...

The same goes for services directory.

I am using http://m2eclipse.codehaus.org/ version 0.0.10

Cheers,
Borut


Using EventListener to submit unknown form

2007-02-21 Thread Daniel Tabuenca

I have a component that is meant to be used inside a form. I would
like to have an eventListener that submits the enclosing form but I
have no way of knowing what the name of the form component will be. Is
there any way to have eventListener submit the enclosing form rather
than specifying a form component by name?

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



State Application Object ( Session ) from constructor method

2007-02-21 Thread Bruno Mignoni

I am use Tapestry 4.02 and Tomcat 5.

How access a state Application Object ( Session ) from de constructor
method?

package com.unicred.tapestry.ib.pages;

import java.sql.SQLException;

import org.apache.tapestry.annotations.InjectState;

import com.unicred.tapestry.ib.InternetBankingBasePage;
import com.unicred.tapestry.ib.sistema.Procuracao;

public abstract class Home extends InternetBankingBasePage {

   public Home() throws SQLException, Exception {

   System.out.println(getProcuracao().getNomeUsuario());


   }

   @InjectState("procuracao")
   public abstract Procuracao getProcuracao();



}

Don't work System.out.println(getProcuracao().getNomeUsuario());

Need to use PageAttachListener (
http://tapestry.apache.org/tapestry4/UsersGuide/events.html )? How do it?

Tks
--

__
Bruno Mignoni
[EMAIL PROTECTED]


client side interception of responce to 'updateComponent()'

2007-02-21 Thread Alexander Haritonov
i'd like to trigger a javascript-function after a Tapestry-component is updated
with 'cycle.getResponseBuilder().updateComponent()'
Does somebody know, how one can do it?


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



Re: Record locking

2007-02-21 Thread James Carman

You use the session id so that you don't maintain the reference to the
actual session.  When the session listener sees that the session dies,
he removes all object locks for that session.  Now, this still doesn't
solve the problem of one user opening multiple windows and trying to
edit the same object, but if they're that stupid, then they deserve to
lose their work (kidding of course, but just wanted to point out the
issue).


On 2/21/07, Andrea Chiumenti <[EMAIL PROTECTED]> wrote:

nice to know ;)

On 2/21/07, Peter Stavrinides <[EMAIL PROTECTED]> wrote:
>
> Andrea,
> You can do this If you create a state object that has an application
> scope... you can wire your session listener to it to add and remove the
> session id's.
>
> 
>
> Andrea Chiumenti wrote:
> > But session is user specific and you want to lock the record accross the
> > application, how whould you do this ?
> >
> > On 2/21/07, Robert Zeigler <[EMAIL PROTECTED]> wrote:
> >>
> >> Actually, no, if the browser dies, the record won't stay locked.
> >> The updating happens from the edit page; if the browser crashes,
> >> there's no edit page, so no updating, so the lock expires.
> >>
> >> Cheers,
> >>
> >> Robert
> >>
> >> On Feb 21, 2007, at 2/214:03 AM , Andrea Chiumenti wrote:
> >>
> >> > ... But if the browser dies for some reason (very frequent
> >> > especially with
> >> > MS products), then the record will remain locked, the only
> >> > possibility with
> >> > this solution would be to add a locking timeout with application
> >> > scope.
> >> >
> >> > On 2/21/07, Robert Zeigler <[EMAIL PROTECTED]> wrote:
> >> >>
> >> >> In my case, it was straightforward: the user is considered to be
> >> >> "still editing" if they have a browser window open to the edit page
> >> >> for the object in question; if they navigate away from that page,
> the
> >> >> system considers their edit session over.
> >> >>
> >> >> Robert
> >> >>
> >> >>
> >> >> On Feb 21, 2007, at 2/212:47 AM , Peter Stavrinides wrote:
> >> >>
> >> >> > Hi Robert
> >> >> >
> >> >> > I like your idea, "you say that periodic ajax calls are sent to
> the
> >> >> > server to inform of the fact that the user is still editing" how
> >> >> > exactly do you track if a user is still editing?
> >> >> >
> >> >> > Robert Zeigler wrote:
> >> >> >> The main problem with using a session timeout for the lock is
> that
> >> >> >> it doesn't allow you to detect events where a user starts to edit
> >> >> >> an object, does not finish, but remains active in the webapp; the
> >> >> >> session won't die, and neither will your lock. You have to
> >> >> >> incorporate time at least to some degree. I implemented similar
> >> >> >> functionality in an application recently, but used a bit of ajax
> >> >> >> magic to ensure that the lock was held for exactly as long as it
> >> >> >> needed to be and no longer (while the user is editing the object,
> >> >> >> periodic ajax calls are sent to the server to inform of the fact
> >> >> >> that the user is still editing; if the user saves, the lock is
> >> >> >> released; if the user moves to a different portion of the webapp
> >> >> >> without saving or canceling the lock, the lock expires since
> there
> >> >> >> are no more ajax calls to keep the lock valid)
> >> >> >>
> >> >> >> Robert
> >> >> >>
> >> >> >> On Feb 21, 2007, at 2/211:56 AM , Peter Stavrinides wrote:
> >> >> >>
> >> >> >>> I don't think the benefits justify the effort involved to
> >> >> >>> maintain all those timestamps, its a bit too complex. Perhaps
> its
> >> >> >>> better to stick to a single table as well... rather write the
> >> >> >>> session id into the database to checkout a customer record.
> >> >> >>>
> >> >> >>> Allow updates to a customer record if its not checked out, and
> >> >> >>> this way you have no worries about lock expiration etc.
> >> >> >>>
> >> >> >>> You should maintain an ASO that tracks all active sessions by
> >> >> >>> session id. Once a user queries for a customer record that has
> >> >> >>> been checked out, if the session ID still exists in the ASO,
> then
> >> >> >>> refuse update access and grant only read access, simple and
> >> >> >>> elegant. Once the user saves successfully release the lock in
> the
> >> >> >>> database. if a session is interrupted for whatever reason, then
> >> >> >>> using a session timeout of 20 or 30 minutes and a session
> >> >> >>> listener you clean up removing the session ID from the ASO and
> >> >> >>> database... so you are well covered. I am no guru like some of
> >> >> >>> these other guys, but this works for me and its nice and
> >> >> >>> simple... here is a brief implementation outline:
> >> >> >>>
> >> >> >>> public class ApplicationManager {
> >> >> >>>
> >> >> >>> /** variable to store the singleton ApplicationManager */
> >> >> >>> private static final ApplicationManager
> >> >> >>> applicationManagerInstance_ = new ApplicationManager();
> >> >> >>>
> >> >> >>> /** Hashtable containing visit history objects. 
> is
> >> >> >

Re: Problem with including static javascript file

2007-02-21 Thread Kristian Marinkovic
ok sometimes you just need to leave your computer for a while

the easiest way to use  is to put the static .js file
into the classpath, lets say "/common/js". The resource-path
attribute then requires an ABSOLUTE classpath to this resource,
like"/common/js/static.js".

if the .script is located at "WEB-INF/web" and the resource-path
attribute is "static.js". Tapestry will generate "gp/WEB-INF/web/static.js"
for the scripts url which will not work.







   
 Kristian  
 Marinkovic
Kopie 
   
 21.02.2007 13:55Thema 
Problem with including static  
javascript file
  Bitte antworten  
an 
 "Tapestry users"  
 <[EMAIL PROTECTED] 
pache.org> 
   
   





hi all,

i'm not able to include a static javascript file into
my page. could someone point me the right way

how can i include a static javascript file into my page
when using the @Body and @Shell component?

thats what i have so far:

.script file located at WEB-INF/web:

  
  
  
  
myinit();
  


static.js is located :
WEB-INF/web/static.js

the rendered page has following url:


i even tried to put into the classpath but with no success.
the path of static.js always gets the "web" prefix (folder
of my .script file )

thanks
kris


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




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



Re: [WARNING] ASO auto-startup (Tap 4)

2007-02-21 Thread Renat Zubairov

You can also consider registeing tapestry ApplicationInitializer

See hivemodule of the tapestry.init

http://tapestry.apache.org/tapestry4/tapestry/hivedocs/config/tapestry.init.ApplicationInitializers.html

http://tapestry.apache.org/tapestry4/tapestry/hivedocs/module/tapestry.init.html


On 21/02/07, Gurps <[EMAIL PROTECTED]> wrote:


ok, what if I have a daemon class that polls something in the database every
now and then. However, on tapestry startup it must be already initialized.
Would i use a runnable class and then just use hivemind.Startup? Is this the
best practise?

Thanks


Howard Lewis Ship wrote:
>
> An "ASO" that exists at start is, ipso facto, a shared across all users
> object.
>
> In that case, a HiveMind service is appropriate, rather than an ASO.
>
> On 2/18/07, Gurps <[EMAIL PROTECTED]> wrote:
>>
>> Hi
>>
>> I have created an ASO and i'd like it to startup when everything
>> initialises:
>>
>> 
>> 
>> > configuration-id="tapestry.state.ApplicationObjects">
>> 
>> 
>> 
>> 
>>
>> 
>> 
>>   
>> 
>>
>>
>> It seems "hivemind.Startup" is not recognised. How do I do this in
>> tapestry
>> ???
>>
>> Cheers,
>> --
>> View this message in context:
>> http://www.nabble.com/ASO-auto-startup-%28Tap-4%29-tf3250438.html#a9035803
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
>
> --
> Howard M. Lewis Ship
> TWD Consulting, Inc.
> Independent J2EE / Open-Source Java Consultant
> Creator and PMC Chair, Apache Tapestry
> Creator, Apache HiveMind
>
> Professional Tapestry training, mentoring, support
> and project work.  http://howardlewisship.com
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>

--
View this message in context: 
http://www.nabble.com/ASO-auto-startup-%28Tap-4%29-tf3250438.html#a9072401
Sent from the Tapestry - User mailing list archive at Nabble.com.


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





--
Best regards,
Renat Zubairov

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



Re: Record locking

2007-02-21 Thread Andrea Chiumenti

nice to know ;)

On 2/21/07, Peter Stavrinides <[EMAIL PROTECTED]> wrote:


Andrea,
You can do this If you create a state object that has an application
scope... you can wire your session listener to it to add and remove the
session id's.



Andrea Chiumenti wrote:
> But session is user specific and you want to lock the record accross the
> application, how whould you do this ?
>
> On 2/21/07, Robert Zeigler <[EMAIL PROTECTED]> wrote:
>>
>> Actually, no, if the browser dies, the record won't stay locked.
>> The updating happens from the edit page; if the browser crashes,
>> there's no edit page, so no updating, so the lock expires.
>>
>> Cheers,
>>
>> Robert
>>
>> On Feb 21, 2007, at 2/214:03 AM , Andrea Chiumenti wrote:
>>
>> > ... But if the browser dies for some reason (very frequent
>> > especially with
>> > MS products), then the record will remain locked, the only
>> > possibility with
>> > this solution would be to add a locking timeout with application
>> > scope.
>> >
>> > On 2/21/07, Robert Zeigler <[EMAIL PROTECTED]> wrote:
>> >>
>> >> In my case, it was straightforward: the user is considered to be
>> >> "still editing" if they have a browser window open to the edit page
>> >> for the object in question; if they navigate away from that page,
the
>> >> system considers their edit session over.
>> >>
>> >> Robert
>> >>
>> >>
>> >> On Feb 21, 2007, at 2/212:47 AM , Peter Stavrinides wrote:
>> >>
>> >> > Hi Robert
>> >> >
>> >> > I like your idea, "you say that periodic ajax calls are sent to
the
>> >> > server to inform of the fact that the user is still editing" how
>> >> > exactly do you track if a user is still editing?
>> >> >
>> >> > Robert Zeigler wrote:
>> >> >> The main problem with using a session timeout for the lock is
that
>> >> >> it doesn't allow you to detect events where a user starts to edit
>> >> >> an object, does not finish, but remains active in the webapp; the
>> >> >> session won't die, and neither will your lock. You have to
>> >> >> incorporate time at least to some degree. I implemented similar
>> >> >> functionality in an application recently, but used a bit of ajax
>> >> >> magic to ensure that the lock was held for exactly as long as it
>> >> >> needed to be and no longer (while the user is editing the object,
>> >> >> periodic ajax calls are sent to the server to inform of the fact
>> >> >> that the user is still editing; if the user saves, the lock is
>> >> >> released; if the user moves to a different portion of the webapp
>> >> >> without saving or canceling the lock, the lock expires since
there
>> >> >> are no more ajax calls to keep the lock valid)
>> >> >>
>> >> >> Robert
>> >> >>
>> >> >> On Feb 21, 2007, at 2/211:56 AM , Peter Stavrinides wrote:
>> >> >>
>> >> >>> I don't think the benefits justify the effort involved to
>> >> >>> maintain all those timestamps, its a bit too complex. Perhaps
its
>> >> >>> better to stick to a single table as well... rather write the
>> >> >>> session id into the database to checkout a customer record.
>> >> >>>
>> >> >>> Allow updates to a customer record if its not checked out, and
>> >> >>> this way you have no worries about lock expiration etc.
>> >> >>>
>> >> >>> You should maintain an ASO that tracks all active sessions by
>> >> >>> session id. Once a user queries for a customer record that has
>> >> >>> been checked out, if the session ID still exists in the ASO,
then
>> >> >>> refuse update access and grant only read access, simple and
>> >> >>> elegant. Once the user saves successfully release the lock in
the
>> >> >>> database. if a session is interrupted for whatever reason, then
>> >> >>> using a session timeout of 20 or 30 minutes and a session
>> >> >>> listener you clean up removing the session ID from the ASO and
>> >> >>> database... so you are well covered. I am no guru like some of
>> >> >>> these other guys, but this works for me and its nice and
>> >> >>> simple... here is a brief implementation outline:
>> >> >>>
>> >> >>> public class ApplicationManager {
>> >> >>>
>> >> >>> /** variable to store the singleton ApplicationManager */
>> >> >>> private static final ApplicationManager
>> >> >>> applicationManagerInstance_ = new ApplicationManager();
>> >> >>>
>> >> >>> /** Hashtable containing visit history objects. 
is
>> >> >>> the sessionid and the Visit Object */
>> >> >>> private static ConcurrentHashMap visitHistory_ =
>> >> >>> new ConcurrentHashMap();
>> >> >>>
>> >> >>> /** @return the ApplicationManager instance */
>> >> >>> public synchronized static ApplicationManager getInstance(){
>> >> >>> return applicationManagerInstance_;
>> >> >>> }
>> >> >>>
>> >> >>> }
>> >> >>>
>> >> >>> public class SessionMonitor implements HttpSessionListener {
>> >> >>>
>> >> >>> /** @see javax.servlet.http.HttpSessionListener#sessionDestroyed
>> >> >>> (javax.servlet.http.HttpSessionEvent) */
>> >> >>> public void sessionDestroyed(HttpSessionEvent event) {
>> >> >>> String sid = event.getSession().getId();
>> >> >

Re: Record locking

2007-02-21 Thread Peter Stavrinides

Andrea,
You can do this If you create a state object that has an application 
scope... you can wire your session listener to it to add and remove the 
session id's.




Andrea Chiumenti wrote:

But session is user specific and you want to lock the record accross the
application, how whould you do this ?

On 2/21/07, Robert Zeigler <[EMAIL PROTECTED]> wrote:


Actually, no, if the browser dies, the record won't stay locked.
The updating happens from the edit page; if the browser crashes,
there's no edit page, so no updating, so the lock expires.

Cheers,

Robert

On Feb 21, 2007, at 2/214:03 AM , Andrea Chiumenti wrote:

> ... But if the browser dies for some reason (very frequent
> especially with
> MS products), then the record will remain locked, the only
> possibility with
> this solution would be to add a locking timeout with application
> scope.
>
> On 2/21/07, Robert Zeigler <[EMAIL PROTECTED]> wrote:
>>
>> In my case, it was straightforward: the user is considered to be
>> "still editing" if they have a browser window open to the edit page
>> for the object in question; if they navigate away from that page, the
>> system considers their edit session over.
>>
>> Robert
>>
>>
>> On Feb 21, 2007, at 2/212:47 AM , Peter Stavrinides wrote:
>>
>> > Hi Robert
>> >
>> > I like your idea, "you say that periodic ajax calls are sent to the
>> > server to inform of the fact that the user is still editing" how
>> > exactly do you track if a user is still editing?
>> >
>> > Robert Zeigler wrote:
>> >> The main problem with using a session timeout for the lock is that
>> >> it doesn't allow you to detect events where a user starts to edit
>> >> an object, does not finish, but remains active in the webapp; the
>> >> session won't die, and neither will your lock. You have to
>> >> incorporate time at least to some degree. I implemented similar
>> >> functionality in an application recently, but used a bit of ajax
>> >> magic to ensure that the lock was held for exactly as long as it
>> >> needed to be and no longer (while the user is editing the object,
>> >> periodic ajax calls are sent to the server to inform of the fact
>> >> that the user is still editing; if the user saves, the lock is
>> >> released; if the user moves to a different portion of the webapp
>> >> without saving or canceling the lock, the lock expires since there
>> >> are no more ajax calls to keep the lock valid)
>> >>
>> >> Robert
>> >>
>> >> On Feb 21, 2007, at 2/211:56 AM , Peter Stavrinides wrote:
>> >>
>> >>> I don't think the benefits justify the effort involved to
>> >>> maintain all those timestamps, its a bit too complex. Perhaps its
>> >>> better to stick to a single table as well... rather write the
>> >>> session id into the database to checkout a customer record.
>> >>>
>> >>> Allow updates to a customer record if its not checked out, and
>> >>> this way you have no worries about lock expiration etc.
>> >>>
>> >>> You should maintain an ASO that tracks all active sessions by
>> >>> session id. Once a user queries for a customer record that has
>> >>> been checked out, if the session ID still exists in the ASO, then
>> >>> refuse update access and grant only read access, simple and
>> >>> elegant. Once the user saves successfully release the lock in the
>> >>> database. if a session is interrupted for whatever reason, then
>> >>> using a session timeout of 20 or 30 minutes and a session
>> >>> listener you clean up removing the session ID from the ASO and
>> >>> database... so you are well covered. I am no guru like some of
>> >>> these other guys, but this works for me and its nice and
>> >>> simple... here is a brief implementation outline:
>> >>>
>> >>> public class ApplicationManager {
>> >>>
>> >>> /** variable to store the singleton ApplicationManager */
>> >>> private static final ApplicationManager
>> >>> applicationManagerInstance_ = new ApplicationManager();
>> >>>
>> >>> /** Hashtable containing visit history objects.  is
>> >>> the sessionid and the Visit Object */
>> >>> private static ConcurrentHashMap visitHistory_ =
>> >>> new ConcurrentHashMap();
>> >>>
>> >>> /** @return the ApplicationManager instance */
>> >>> public synchronized static ApplicationManager getInstance(){
>> >>> return applicationManagerInstance_;
>> >>> }
>> >>>
>> >>> }
>> >>>
>> >>> public class SessionMonitor implements HttpSessionListener {
>> >>>
>> >>> /** @see javax.servlet.http.HttpSessionListener#sessionDestroyed
>> >>> (javax.servlet.http.HttpSessionEvent) */
>> >>> public void sessionDestroyed(HttpSessionEvent event) {
>> >>> String sid = event.getSession().getId();
>> >>> ApplicationManager manager = ApplicationManager.getInstance();
>> >>> manager.removeUserSession(sid);
>> >>> }
>> >>>
>> >>>
>> >>> Hivemodule.xml:
>> >>>
>> >>> > id="tapestry.state.ApplicationObjects">
>> >>> 
>> >>> 
>> >>> 
>> >>> 
>> >>>
>> >>> > id="tapestry.state.ApplicationObjects">
>> >>> 
>> >>> 
>> >>> 
>> >>> 
>> >>>
>> >>> cheers,
>> >>> Peter
>> >>>
>> >

Problem with including static javascript file

2007-02-21 Thread Kristian Marinkovic

hi all,

i'm not able to include a static javascript file into
my page. could someone point me the right way

how can i include a static javascript file into my page
when using the @Body and @Shell component?

thats what i have so far:

.script file located at WEB-INF/web:

  
  
  
  
myinit();
  


static.js is located :
WEB-INF/web/static.js

the rendered page has following url:


i even tried to put into the classpath but with no success.
the path of static.js always gets the "web" prefix (folder
of my .script file )

thanks
kris


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



OT: sourceforge svn browse

2007-02-21 Thread Andrea Chiumenti

Hello, I'm currently in a condition where I'm not able to get files from the
sf.ne svn of my project.

Is any tools out there that can download files from svn browse of sf.net ?

kiuma


Re: Record locking

2007-02-21 Thread Andrea Chiumenti

But session is user specific and you want to lock the record accross the
application, how whould you do this ?

On 2/21/07, Robert Zeigler <[EMAIL PROTECTED]> wrote:


Actually, no, if the browser dies, the record won't stay locked.
The updating happens from the edit page; if the browser crashes,
there's no edit page, so no updating, so the lock expires.

Cheers,

Robert

On Feb 21, 2007, at 2/214:03 AM , Andrea Chiumenti wrote:

> ... But if the browser dies for some reason (very frequent
> especially with
> MS products), then the record will remain locked, the only
> possibility with
> this solution would be to add a locking timeout with application
> scope.
>
> On 2/21/07, Robert Zeigler <[EMAIL PROTECTED]> wrote:
>>
>> In my case, it was straightforward: the user is considered to be
>> "still editing" if they have a browser window open to the edit page
>> for the object in question; if they navigate away from that page, the
>> system considers their edit session over.
>>
>> Robert
>>
>>
>> On Feb 21, 2007, at 2/212:47 AM , Peter Stavrinides wrote:
>>
>> > Hi Robert
>> >
>> > I like your idea, "you say that periodic ajax calls are sent to the
>> > server to inform of the fact that the user is still editing" how
>> > exactly do you track if a user is still editing?
>> >
>> > Robert Zeigler wrote:
>> >> The main problem with using a session timeout for the lock is that
>> >> it doesn't allow you to detect events where a user starts to edit
>> >> an object, does not finish, but remains active in the webapp; the
>> >> session won't die, and neither will your lock. You have to
>> >> incorporate time at least to some degree. I implemented similar
>> >> functionality in an application recently, but used a bit of ajax
>> >> magic to ensure that the lock was held for exactly as long as it
>> >> needed to be and no longer (while the user is editing the object,
>> >> periodic ajax calls are sent to the server to inform of the fact
>> >> that the user is still editing; if the user saves, the lock is
>> >> released; if the user moves to a different portion of the webapp
>> >> without saving or canceling the lock, the lock expires since there
>> >> are no more ajax calls to keep the lock valid)
>> >>
>> >> Robert
>> >>
>> >> On Feb 21, 2007, at 2/211:56 AM , Peter Stavrinides wrote:
>> >>
>> >>> I don't think the benefits justify the effort involved to
>> >>> maintain all those timestamps, its a bit too complex. Perhaps its
>> >>> better to stick to a single table as well... rather write the
>> >>> session id into the database to checkout a customer record.
>> >>>
>> >>> Allow updates to a customer record if its not checked out, and
>> >>> this way you have no worries about lock expiration etc.
>> >>>
>> >>> You should maintain an ASO that tracks all active sessions by
>> >>> session id. Once a user queries for a customer record that has
>> >>> been checked out, if the session ID still exists in the ASO, then
>> >>> refuse update access and grant only read access, simple and
>> >>> elegant. Once the user saves successfully release the lock in the
>> >>> database. if a session is interrupted for whatever reason, then
>> >>> using a session timeout of 20 or 30 minutes and a session
>> >>> listener you clean up removing the session ID from the ASO and
>> >>> database... so you are well covered. I am no guru like some of
>> >>> these other guys, but this works for me and its nice and
>> >>> simple... here is a brief implementation outline:
>> >>>
>> >>> public class ApplicationManager {
>> >>>
>> >>> /** variable to store the singleton ApplicationManager */
>> >>> private static final ApplicationManager
>> >>> applicationManagerInstance_ = new ApplicationManager();
>> >>>
>> >>> /** Hashtable containing visit history objects.  is
>> >>> the sessionid and the Visit Object */
>> >>> private static ConcurrentHashMap visitHistory_ =
>> >>> new ConcurrentHashMap();
>> >>>
>> >>> /** @return the ApplicationManager instance */
>> >>> public synchronized static ApplicationManager getInstance(){
>> >>> return applicationManagerInstance_;
>> >>> }
>> >>>
>> >>> }
>> >>>
>> >>> public class SessionMonitor implements HttpSessionListener {
>> >>>
>> >>> /** @see javax.servlet.http.HttpSessionListener#sessionDestroyed
>> >>> (javax.servlet.http.HttpSessionEvent) */
>> >>> public void sessionDestroyed(HttpSessionEvent event) {
>> >>> String sid = event.getSession().getId();
>> >>> ApplicationManager manager = ApplicationManager.getInstance();
>> >>> manager.removeUserSession(sid);
>> >>> }
>> >>>
>> >>>
>> >>> Hivemodule.xml:
>> >>>
>> >>> > id="tapestry.state.ApplicationObjects">
>> >>> 
>> >>> 
>> >>> 
>> >>> 
>> >>>
>> >>> > id="tapestry.state.ApplicationObjects">
>> >>> 
>> >>> 
>> >>> 
>> >>> 
>> >>>
>> >>> cheers,
>> >>> Peter
>> >>>
>> >>> Murray Collingwood wrote:
>>  Wow - what a lot of responses.
>> 
>>  First a little more detail - use case (for example):
>> 
>>  Take a customer record, a basic record ha

Re: Record locking

2007-02-21 Thread Robert Zeigler
To clarify, by "updating" I'm referring to the ajax notifications  
that the user is still editing the object.


Robert

On Feb 21, 2007, at 2/215:50 AM , Robert Zeigler wrote:


Actually, no, if the browser dies, the record won't stay locked.
The updating happens from the edit page; if the browser crashes,  
there's no edit page, so no updating, so the lock expires.


Cheers,

Robert

On Feb 21, 2007, at 2/214:03 AM , Andrea Chiumenti wrote:

... But if the browser dies for some reason (very frequent  
especially with
MS products), then the record will remain locked, the only  
possibility with
this solution would be to add a locking timeout with application  
scope.


On 2/21/07, Robert Zeigler <[EMAIL PROTECTED]> wrote:


In my case, it was straightforward: the user is considered to be
"still editing" if they have a browser window open to the edit page
for the object in question; if they navigate away from that page,  
the

system considers their edit session over.

Robert


On Feb 21, 2007, at 2/212:47 AM , Peter Stavrinides wrote:

> Hi Robert
>
> I like your idea, "you say that periodic ajax calls are sent to  
the

> server to inform of the fact that the user is still editing" how
> exactly do you track if a user is still editing?
>
> Robert Zeigler wrote:
>> The main problem with using a session timeout for the lock is  
that

>> it doesn't allow you to detect events where a user starts to edit
>> an object, does not finish, but remains active in the webapp; the
>> session won't die, and neither will your lock. You have to
>> incorporate time at least to some degree. I implemented similar
>> functionality in an application recently, but used a bit of ajax
>> magic to ensure that the lock was held for exactly as long as it
>> needed to be and no longer (while the user is editing the object,
>> periodic ajax calls are sent to the server to inform of the fact
>> that the user is still editing; if the user saves, the lock is
>> released; if the user moves to a different portion of the webapp
>> without saving or canceling the lock, the lock expires since  
there

>> are no more ajax calls to keep the lock valid)
>>
>> Robert
>>
>> On Feb 21, 2007, at 2/211:56 AM , Peter Stavrinides wrote:
>>
>>> I don't think the benefits justify the effort involved to
>>> maintain all those timestamps, its a bit too complex. Perhaps  
its

>>> better to stick to a single table as well... rather write the
>>> session id into the database to checkout a customer record.
>>>
>>> Allow updates to a customer record if its not checked out, and
>>> this way you have no worries about lock expiration etc.
>>>
>>> You should maintain an ASO that tracks all active sessions by
>>> session id. Once a user queries for a customer record that has
>>> been checked out, if the session ID still exists in the ASO,  
then

>>> refuse update access and grant only read access, simple and
>>> elegant. Once the user saves successfully release the lock in  
the

>>> database. if a session is interrupted for whatever reason, then
>>> using a session timeout of 20 or 30 minutes and a session
>>> listener you clean up removing the session ID from the ASO and
>>> database... so you are well covered. I am no guru like some of
>>> these other guys, but this works for me and its nice and
>>> simple... here is a brief implementation outline:
>>>
>>> public class ApplicationManager {
>>>
>>> /** variable to store the singleton ApplicationManager */
>>> private static final ApplicationManager
>>> applicationManagerInstance_ = new ApplicationManager();
>>>
>>> /** Hashtable containing visit history objects.  
 is

>>> the sessionid and the Visit Object */
>>> private static ConcurrentHashMap visitHistory_ =
>>> new ConcurrentHashMap();
>>>
>>> /** @return the ApplicationManager instance */
>>> public synchronized static ApplicationManager getInstance(){
>>> return applicationManagerInstance_;
>>> }
>>>
>>> }
>>>
>>> public class SessionMonitor implements HttpSessionListener {
>>>
>>> /** @see javax.servlet.http.HttpSessionListener#sessionDestroyed
>>> (javax.servlet.http.HttpSessionEvent) */
>>> public void sessionDestroyed(HttpSessionEvent event) {
>>> String sid = event.getSession().getId();
>>> ApplicationManager manager = ApplicationManager.getInstance();
>>> manager.removeUserSession(sid);
>>> }
>>>
>>>
>>> Hivemodule.xml:
>>>
>>> id="tapestry.state.ApplicationObjects">

>>> 
>>> 
>>> 
>>> 
>>>
>>> id="tapestry.state.ApplicationObjects">

>>> 
>>> 
>>> 
>>> 
>>>
>>> cheers,
>>> Peter
>>>
>>> Murray Collingwood wrote:
 Wow - what a lot of responses.

 First a little more detail - use case (for example):

 Take a customer record, a basic record has previously been
 created and the
 customer has completed some forms so we are now wanting to
 complete all of the
 details about contact information, financial details, key
 assets, health
 information, etc, etc. The system relies on a number of
 classification

Re: Record locking

2007-02-21 Thread Robert Zeigler

Actually, no, if the browser dies, the record won't stay locked.
The updating happens from the edit page; if the browser crashes,  
there's no edit page, so no updating, so the lock expires.


Cheers,

Robert

On Feb 21, 2007, at 2/214:03 AM , Andrea Chiumenti wrote:

... But if the browser dies for some reason (very frequent  
especially with
MS products), then the record will remain locked, the only  
possibility with
this solution would be to add a locking timeout with application  
scope.


On 2/21/07, Robert Zeigler <[EMAIL PROTECTED]> wrote:


In my case, it was straightforward: the user is considered to be
"still editing" if they have a browser window open to the edit page
for the object in question; if they navigate away from that page, the
system considers their edit session over.

Robert


On Feb 21, 2007, at 2/212:47 AM , Peter Stavrinides wrote:

> Hi Robert
>
> I like your idea, "you say that periodic ajax calls are sent to the
> server to inform of the fact that the user is still editing" how
> exactly do you track if a user is still editing?
>
> Robert Zeigler wrote:
>> The main problem with using a session timeout for the lock is that
>> it doesn't allow you to detect events where a user starts to edit
>> an object, does not finish, but remains active in the webapp; the
>> session won't die, and neither will your lock. You have to
>> incorporate time at least to some degree. I implemented similar
>> functionality in an application recently, but used a bit of ajax
>> magic to ensure that the lock was held for exactly as long as it
>> needed to be and no longer (while the user is editing the object,
>> periodic ajax calls are sent to the server to inform of the fact
>> that the user is still editing; if the user saves, the lock is
>> released; if the user moves to a different portion of the webapp
>> without saving or canceling the lock, the lock expires since there
>> are no more ajax calls to keep the lock valid)
>>
>> Robert
>>
>> On Feb 21, 2007, at 2/211:56 AM , Peter Stavrinides wrote:
>>
>>> I don't think the benefits justify the effort involved to
>>> maintain all those timestamps, its a bit too complex. Perhaps its
>>> better to stick to a single table as well... rather write the
>>> session id into the database to checkout a customer record.
>>>
>>> Allow updates to a customer record if its not checked out, and
>>> this way you have no worries about lock expiration etc.
>>>
>>> You should maintain an ASO that tracks all active sessions by
>>> session id. Once a user queries for a customer record that has
>>> been checked out, if the session ID still exists in the ASO, then
>>> refuse update access and grant only read access, simple and
>>> elegant. Once the user saves successfully release the lock in the
>>> database. if a session is interrupted for whatever reason, then
>>> using a session timeout of 20 or 30 minutes and a session
>>> listener you clean up removing the session ID from the ASO and
>>> database... so you are well covered. I am no guru like some of
>>> these other guys, but this works for me and its nice and
>>> simple... here is a brief implementation outline:
>>>
>>> public class ApplicationManager {
>>>
>>> /** variable to store the singleton ApplicationManager */
>>> private static final ApplicationManager
>>> applicationManagerInstance_ = new ApplicationManager();
>>>
>>> /** Hashtable containing visit history objects.  is
>>> the sessionid and the Visit Object */
>>> private static ConcurrentHashMap visitHistory_ =
>>> new ConcurrentHashMap();
>>>
>>> /** @return the ApplicationManager instance */
>>> public synchronized static ApplicationManager getInstance(){
>>> return applicationManagerInstance_;
>>> }
>>>
>>> }
>>>
>>> public class SessionMonitor implements HttpSessionListener {
>>>
>>> /** @see javax.servlet.http.HttpSessionListener#sessionDestroyed
>>> (javax.servlet.http.HttpSessionEvent) */
>>> public void sessionDestroyed(HttpSessionEvent event) {
>>> String sid = event.getSession().getId();
>>> ApplicationManager manager = ApplicationManager.getInstance();
>>> manager.removeUserSession(sid);
>>> }
>>>
>>>
>>> Hivemodule.xml:
>>>
>>> id="tapestry.state.ApplicationObjects">

>>> 
>>> 
>>> 
>>> 
>>>
>>> id="tapestry.state.ApplicationObjects">

>>> 
>>> 
>>> 
>>> 
>>>
>>> cheers,
>>> Peter
>>>
>>> Murray Collingwood wrote:
 Wow - what a lot of responses.

 First a little more detail - use case (for example):

 Take a customer record, a basic record has previously been
 created and the
 customer has completed some forms so we are now wanting to
 complete all of the
 details about contact information, financial details, key
 assets, health
 information, etc, etc. The system relies on a number of
 classifications which
 need to be looked up, anyways, editing this record can take upto
 20 minutes. The size of this record certainly justifies breaking
 it up into a number of
 smaller records store

Re: Record locking

2007-02-21 Thread James Carman

If the browser dies, then the session will timeout.  The record will
not stay locked (if you just keep an in-memory record of who is
editing what).  You could use a "do you want to save your changes"
notification (a la GMail and others) to either save the data or send a
request to clear the lock when they leave the edit screen.


On 2/21/07, Andrea Chiumenti <[EMAIL PROTECTED]> wrote:

... But if the browser dies for some reason (very frequent especially with
MS products), then the record will remain locked, the only possibility with
this solution would be to add a locking timeout with application scope.

On 2/21/07, Robert Zeigler <[EMAIL PROTECTED]> wrote:
>
> In my case, it was straightforward: the user is considered to be
> "still editing" if they have a browser window open to the edit page
> for the object in question; if they navigate away from that page, the
> system considers their edit session over.
>
> Robert
>
>
> On Feb 21, 2007, at 2/212:47 AM , Peter Stavrinides wrote:
>
> > Hi Robert
> >
> > I like your idea, "you say that periodic ajax calls are sent to the
> > server to inform of the fact that the user is still editing" how
> > exactly do you track if a user is still editing?
> >
> > Robert Zeigler wrote:
> >> The main problem with using a session timeout for the lock is that
> >> it doesn't allow you to detect events where a user starts to edit
> >> an object, does not finish, but remains active in the webapp; the
> >> session won't die, and neither will your lock. You have to
> >> incorporate time at least to some degree. I implemented similar
> >> functionality in an application recently, but used a bit of ajax
> >> magic to ensure that the lock was held for exactly as long as it
> >> needed to be and no longer (while the user is editing the object,
> >> periodic ajax calls are sent to the server to inform of the fact
> >> that the user is still editing; if the user saves, the lock is
> >> released; if the user moves to a different portion of the webapp
> >> without saving or canceling the lock, the lock expires since there
> >> are no more ajax calls to keep the lock valid)
> >>
> >> Robert
> >>
> >> On Feb 21, 2007, at 2/211:56 AM , Peter Stavrinides wrote:
> >>
> >>> I don't think the benefits justify the effort involved to
> >>> maintain all those timestamps, its a bit too complex. Perhaps its
> >>> better to stick to a single table as well... rather write the
> >>> session id into the database to checkout a customer record.
> >>>
> >>> Allow updates to a customer record if its not checked out, and
> >>> this way you have no worries about lock expiration etc.
> >>>
> >>> You should maintain an ASO that tracks all active sessions by
> >>> session id. Once a user queries for a customer record that has
> >>> been checked out, if the session ID still exists in the ASO, then
> >>> refuse update access and grant only read access, simple and
> >>> elegant. Once the user saves successfully release the lock in the
> >>> database. if a session is interrupted for whatever reason, then
> >>> using a session timeout of 20 or 30 minutes and a session
> >>> listener you clean up removing the session ID from the ASO and
> >>> database... so you are well covered. I am no guru like some of
> >>> these other guys, but this works for me and its nice and
> >>> simple... here is a brief implementation outline:
> >>>
> >>> public class ApplicationManager {
> >>>
> >>> /** variable to store the singleton ApplicationManager */
> >>> private static final ApplicationManager
> >>> applicationManagerInstance_ = new ApplicationManager();
> >>>
> >>> /** Hashtable containing visit history objects.  is
> >>> the sessionid and the Visit Object */
> >>> private static ConcurrentHashMap visitHistory_ =
> >>> new ConcurrentHashMap();
> >>>
> >>> /** @return the ApplicationManager instance */
> >>> public synchronized static ApplicationManager getInstance(){
> >>> return applicationManagerInstance_;
> >>> }
> >>>
> >>> }
> >>>
> >>> public class SessionMonitor implements HttpSessionListener {
> >>>
> >>> /** @see javax.servlet.http.HttpSessionListener#sessionDestroyed
> >>> (javax.servlet.http.HttpSessionEvent) */
> >>> public void sessionDestroyed(HttpSessionEvent event) {
> >>> String sid = event.getSession().getId();
> >>> ApplicationManager manager = ApplicationManager.getInstance();
> >>> manager.removeUserSession(sid);
> >>> }
> >>>
> >>>
> >>> Hivemodule.xml:
> >>>
> >>> 
> >>> 
> >>> 
> >>> 
> >>> 
> >>>
> >>> 
> >>> 
> >>> 
> >>> 
> >>> 
> >>>
> >>> cheers,
> >>> Peter
> >>>
> >>> Murray Collingwood wrote:
>  Wow - what a lot of responses.
> 
>  First a little more detail - use case (for example):
> 
>  Take a customer record, a basic record has previously been
>  created and the
>  customer has completed some forms so we are now wanting to
>  complete all of the
>  details about contact information, financial details, key
>  assets, health
>  information, etc, etc.

T5 BeanEditForm screencast

2007-02-21 Thread Jiri Mares

Hi Howard,

T5 looks very good. I would like to ask about the screencast #4 where you 
presented BeanEditForm component. For
validation there is the annotation, which causes me problems.

I don't want to annotade my business objects with tapestry annotation (they 
start to depend on tapestry). At the moment
we are using OVal (oval.sf.net) for the Design by Contract and the oval 
annotations carry the same information as the
tapestry validate annotation.

So will it be easy to use for validation these annotations (instead of the 
tapestry one)? Meaning if you are thinking
about some kind of pluggable validation framework ... or at least pluggable 
validation definition framework.

Thanks

-- 
Jiří Mareš (mailto:[EMAIL PROTECTED])
ČSAD SVT Praha, s.r.o. (http://www.svt.cz)
Czech Republic

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



Re: Where am I going wrong ?

2007-02-21 Thread Peter Stavrinides

Brilliant... thanks Shing!

Shing Hing Man wrote:
Try removing  in 


org.apache.tapestry.ApplicationServlet
 1
 
   myParam
   777
 
 
 
And add the following to Web.xml.



  myParam
  


Shing 



--- Peter Stavrinides <[EMAIL PROTECTED]>
wrote:

  

In Web.xml I have defined an initialization
parameter,


IRM
   



org.apache.tapestry.ApplicationServlet
  

1

  myParam
  777



I tried to get to it with the following:




@InjectObject("service:tapestry.globals.ServletContext")
  

public abstract ServletContext getServletContext();

getServletContext().getInitParameter("myParam");

but its always null, what am I missing?

Thanks
Peter







--
Peter Stavrinides
Albourne Partners (Cyprus) Ltd
Tel: +357 22 750652 


If you are not an intended recipient of this e-mail,
please notify the sender, delete it and do not read,
act upon, print, disclose, copy, retain or
redistribute it. Please visit
http://www.albourne.com/email.html for important
additional terms relating to this e-mail. 







Home page :
  http://uk.geocities.com/matmsh/index.html



___ 
Copy addresses and emails from any email account to Yahoo! Mail - quick, easy and free. http://uk.docs.yahoo.com/trueswitch2.html


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

  


--
Peter Stavrinides
Albourne Partners (Cyprus) Ltd
Tel: +357 22 750652 

If you are not an intended recipient of this e-mail, please notify the sender, delete it and do not read, act upon, print, disclose, copy, retain or redistribute it. Please visit http://www.albourne.com/email.html for important additional terms relating to this e-mail. 




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



Re: Where am I going wrong ?

2007-02-21 Thread Shing Hing Man
Try removing  in 

org.apache.tapestry.ApplicationServlet
 1
 
   myParam
   777
 
 
 
And add the following to Web.xml.


  myParam
  


Shing 


--- Peter Stavrinides <[EMAIL PROTECTED]>
wrote:

> In Web.xml I have defined an initialization
> parameter,
> 
> 
> IRM
>
>
org.apache.tapestry.ApplicationServlet
> 1
> 
>   myParam
>   777
> 
> 
> 
> I tried to get to it with the following:
> 
>
@InjectObject("service:tapestry.globals.ServletContext")
> public abstract ServletContext getServletContext();
> 
> getServletContext().getInitParameter("myParam");
> 
> but its always null, what am I missing?
> 
> Thanks
> Peter
> 
> 
> 
> 
> 
> 
> 
> -- 
> Peter Stavrinides
> Albourne Partners (Cyprus) Ltd
> Tel: +357 22 750652 
> 
> If you are not an intended recipient of this e-mail,
> please notify the sender, delete it and do not read,
> act upon, print, disclose, copy, retain or
> redistribute it. Please visit
> http://www.albourne.com/email.html for important
> additional terms relating to this e-mail. 
> 
> 


Home page :
  http://uk.geocities.com/matmsh/index.html



___ 
Copy addresses and emails from any email account to Yahoo! Mail - quick, easy 
and free. http://uk.docs.yahoo.com/trueswitch2.html

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



Re: Record locking

2007-02-21 Thread Andrea Chiumenti

... But if the browser dies for some reason (very frequent especially with
MS products), then the record will remain locked, the only possibility with
this solution would be to add a locking timeout with application scope.

On 2/21/07, Robert Zeigler <[EMAIL PROTECTED]> wrote:


In my case, it was straightforward: the user is considered to be
"still editing" if they have a browser window open to the edit page
for the object in question; if they navigate away from that page, the
system considers their edit session over.

Robert


On Feb 21, 2007, at 2/212:47 AM , Peter Stavrinides wrote:

> Hi Robert
>
> I like your idea, "you say that periodic ajax calls are sent to the
> server to inform of the fact that the user is still editing" how
> exactly do you track if a user is still editing?
>
> Robert Zeigler wrote:
>> The main problem with using a session timeout for the lock is that
>> it doesn't allow you to detect events where a user starts to edit
>> an object, does not finish, but remains active in the webapp; the
>> session won't die, and neither will your lock. You have to
>> incorporate time at least to some degree. I implemented similar
>> functionality in an application recently, but used a bit of ajax
>> magic to ensure that the lock was held for exactly as long as it
>> needed to be and no longer (while the user is editing the object,
>> periodic ajax calls are sent to the server to inform of the fact
>> that the user is still editing; if the user saves, the lock is
>> released; if the user moves to a different portion of the webapp
>> without saving or canceling the lock, the lock expires since there
>> are no more ajax calls to keep the lock valid)
>>
>> Robert
>>
>> On Feb 21, 2007, at 2/211:56 AM , Peter Stavrinides wrote:
>>
>>> I don't think the benefits justify the effort involved to
>>> maintain all those timestamps, its a bit too complex. Perhaps its
>>> better to stick to a single table as well... rather write the
>>> session id into the database to checkout a customer record.
>>>
>>> Allow updates to a customer record if its not checked out, and
>>> this way you have no worries about lock expiration etc.
>>>
>>> You should maintain an ASO that tracks all active sessions by
>>> session id. Once a user queries for a customer record that has
>>> been checked out, if the session ID still exists in the ASO, then
>>> refuse update access and grant only read access, simple and
>>> elegant. Once the user saves successfully release the lock in the
>>> database. if a session is interrupted for whatever reason, then
>>> using a session timeout of 20 or 30 minutes and a session
>>> listener you clean up removing the session ID from the ASO and
>>> database... so you are well covered. I am no guru like some of
>>> these other guys, but this works for me and its nice and
>>> simple... here is a brief implementation outline:
>>>
>>> public class ApplicationManager {
>>>
>>> /** variable to store the singleton ApplicationManager */
>>> private static final ApplicationManager
>>> applicationManagerInstance_ = new ApplicationManager();
>>>
>>> /** Hashtable containing visit history objects.  is
>>> the sessionid and the Visit Object */
>>> private static ConcurrentHashMap visitHistory_ =
>>> new ConcurrentHashMap();
>>>
>>> /** @return the ApplicationManager instance */
>>> public synchronized static ApplicationManager getInstance(){
>>> return applicationManagerInstance_;
>>> }
>>>
>>> }
>>>
>>> public class SessionMonitor implements HttpSessionListener {
>>>
>>> /** @see javax.servlet.http.HttpSessionListener#sessionDestroyed
>>> (javax.servlet.http.HttpSessionEvent) */
>>> public void sessionDestroyed(HttpSessionEvent event) {
>>> String sid = event.getSession().getId();
>>> ApplicationManager manager = ApplicationManager.getInstance();
>>> manager.removeUserSession(sid);
>>> }
>>>
>>>
>>> Hivemodule.xml:
>>>
>>> 
>>> 
>>> 
>>> 
>>> 
>>>
>>> 
>>> 
>>> 
>>> 
>>> 
>>>
>>> cheers,
>>> Peter
>>>
>>> Murray Collingwood wrote:
 Wow - what a lot of responses.

 First a little more detail - use case (for example):

 Take a customer record, a basic record has previously been
 created and the
 customer has completed some forms so we are now wanting to
 complete all of the
 details about contact information, financial details, key
 assets, health
 information, etc, etc. The system relies on a number of
 classifications which
 need to be looked up, anyways, editing this record can take upto
 20 minutes. The size of this record certainly justifies breaking
 it up into a number of
 smaller records stored in separate tables, however the same
 problem remains
 because the user wants to see all of this information on 1
 (scrollable) web
 page, we are still holding a lock on the information for the
 duration of the
 request.

 Potentially there are maybe 700 people who could be editing this
 record for
 different rea

Tapestry 5 NPE in PageTester

2007-02-21 Thread Matt Ayres
I'm running into a NullPointerException in PageTester if a 
element exists in the page template. Here's a snippet of the stack
trace:

Exception in thread "main" java.lang.NullPointerException
at $Request_110d9536317.getContextPath($Request_110d9536317.java)
at $Request_110d95362e3.getContextPath($Request_110d95362e3.java)
at
org.apache.tapestry.internal.services.ClasspathAssetAliasManagerImpl.toC
lientURL(ClasspathAssetAliasManagerImpl.java:78)

There's a little more info at
https://issues.apache.org/jira/browse/TAPESTRY-1279

Is there a good way to debug a Javassist manipulated class?

-Matt


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



Re: Record locking

2007-02-21 Thread Robert Zeigler
In my case, it was straightforward: the user is considered to be  
"still editing" if they have a browser window open to the edit page  
for the object in question; if they navigate away from that page, the  
system considers their edit session over.


Robert


On Feb 21, 2007, at 2/212:47 AM , Peter Stavrinides wrote:


Hi Robert

I like your idea, "you say that periodic ajax calls are sent to the  
server to inform of the fact that the user is still editing" how  
exactly do you track if a user is still editing?


Robert Zeigler wrote:
The main problem with using a session timeout for the lock is that  
it doesn't allow you to detect events where a user starts to edit  
an object, does not finish, but remains active in the webapp; the  
session won't die, and neither will your lock. You have to  
incorporate time at least to some degree. I implemented similar  
functionality in an application recently, but used a bit of ajax  
magic to ensure that the lock was held for exactly as long as it  
needed to be and no longer (while the user is editing the object,  
periodic ajax calls are sent to the server to inform of the fact  
that the user is still editing; if the user saves, the lock is  
released; if the user moves to a different portion of the webapp  
without saving or canceling the lock, the lock expires since there  
are no more ajax calls to keep the lock valid)


Robert

On Feb 21, 2007, at 2/211:56 AM , Peter Stavrinides wrote:

I don't think the benefits justify the effort involved to  
maintain all those timestamps, its a bit too complex. Perhaps its  
better to stick to a single table as well... rather write the  
session id into the database to checkout a customer record.


Allow updates to a customer record if its not checked out, and  
this way you have no worries about lock expiration etc.


You should maintain an ASO that tracks all active sessions by  
session id. Once a user queries for a customer record that has  
been checked out, if the session ID still exists in the ASO, then  
refuse update access and grant only read access, simple and  
elegant. Once the user saves successfully release the lock in the  
database. if a session is interrupted for whatever reason, then  
using a session timeout of 20 or 30 minutes and a session  
listener you clean up removing the session ID from the ASO and  
database... so you are well covered. I am no guru like some of  
these other guys, but this works for me and its nice and  
simple... here is a brief implementation outline:


public class ApplicationManager {

/** variable to store the singleton ApplicationManager */
private static final ApplicationManager  
applicationManagerInstance_ = new ApplicationManager();


/** Hashtable containing visit history objects.  is  
the sessionid and the Visit Object */
private static ConcurrentHashMap visitHistory_ =  
new ConcurrentHashMap();


/** @return the ApplicationManager instance */
public synchronized static ApplicationManager getInstance(){
return applicationManagerInstance_;
}

}

public class SessionMonitor implements HttpSessionListener {

/** @see javax.servlet.http.HttpSessionListener#sessionDestroyed 
(javax.servlet.http.HttpSessionEvent) */

public void sessionDestroyed(HttpSessionEvent event) {
String sid = event.getSession().getId();
ApplicationManager manager = ApplicationManager.getInstance();
manager.removeUserSession(sid);
}


Hivemodule.xml:













cheers,
Peter

Murray Collingwood wrote:

Wow - what a lot of responses.

First a little more detail - use case (for example):

Take a customer record, a basic record has previously been  
created and the
customer has completed some forms so we are now wanting to  
complete all of the
details about contact information, financial details, key  
assets, health
information, etc, etc. The system relies on a number of  
classifications which
need to be looked up, anyways, editing this record can take upto  
20 minutes. The size of this record certainly justifies breaking  
it up into a number of
smaller records stored in separate tables, however the same  
problem remains
because the user wants to see all of this information on 1  
(scrollable) web
page, we are still holding a lock on the information for the  
duration of the

request.

Potentially there are maybe 700 people who could be editing this  
record for
different reasons. Accuracy of the information is critical - we  
don't want

personal details being sent to a neighbour.

The nature of the application means that users will be reviewing  
a record each
year, and if any changes are made they are often made to the  
same record around
the same time of the year - increasing the possibility of two  
people wanting to

edit the record at the same time.

Besides all of the above, the user has asked for exclusive  
editing of a record -
such that other users can still read the existing record but  
nobody else can
update the record while it is locked. The user understands the  
conce

Re: New line in properties file

2007-02-21 Thread Shing Hing Man
A backslash \ ?

Shing 

--- Peter Dawn <[EMAIL PROTECTED]> wrote:

> guys,
> 
> within my properties file, there is certain text
> which i want to flow
> over onto multiple lines. so how can i specify a new
> line (aka enter)
> within the properties file, so that the text breaks
> up there and
> starts at the next line when its displayed.
> 
> thanks.
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 


Home page :
  http://uk.geocities.com/matmsh/index.html



___ 
All New Yahoo! Mail – Tired of unwanted email come-ons? Let our SpamGuard 
protect you. http://uk.docs.yahoo.com/nowyoucan.html

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



Programmatic DirectLink with updateComponents and parameter

2007-02-21 Thread Andreas Pardeike

Hi,

I've seen some examples on how to generate a DirectLink programmatic but
so far, I couldn't get it to work. Especially because I need it to  
update

a component via ajax.

Quick overview: I parse external static html text with fake links and
replace those links with the correct versions. One of them is a [Buy]  
button
and it needs to call a listener to add the item to the database and  
then it

refreshes the view on the page via ajax.

On my normal Tapestry pages, this looks like:


  
  

  
  


and this works fine. Now, on my "content" page which will read in a  
specific
html page via a given name, I do a search/replace sweep and there, I  
need to

do the same (the basket component is in my Border).

What I have done is to have a fake_buy component similar to the one  
above in
my content page and a property 'item_id' which is referred by  
fake_by. I was

able to do this:

setItem_id(linkParam);
DirectLink fakeBuy = (DirectLink)getComponent("fake_buy");
ILink fakeBuyLink = fakeBuy.getLink(getPage().getRequestCycle());
link = fakeBuyLink.getURL();

But I am not sure if this is the right way to do it because I fear side
effects.

Andreas Pardeike

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



Re: Record locking

2007-02-21 Thread Peter Stavrinides

Hi Robert

I like your idea, "you say that periodic ajax calls are sent to the 
server to inform of the fact that the user is still editing" how exactly 
do you track if a user is still editing?


Robert Zeigler wrote:
The main problem with using a session timeout for the lock is that it 
doesn't allow you to detect events where a user starts to edit an 
object, does not finish, but remains active in the webapp; the session 
won't die, and neither will your lock. You have to incorporate time at 
least to some degree. I implemented similar functionality in an 
application recently, but used a bit of ajax magic to ensure that the 
lock was held for exactly as long as it needed to be and no longer 
(while the user is editing the object, periodic ajax calls are sent to 
the server to inform of the fact that the user is still editing; if 
the user saves, the lock is released; if the user moves to a different 
portion of the webapp without saving or canceling the lock, the lock 
expires since there are no more ajax calls to keep the lock valid)


Robert

On Feb 21, 2007, at 2/211:56 AM , Peter Stavrinides wrote:

I don't think the benefits justify the effort involved to maintain 
all those timestamps, its a bit too complex. Perhaps its better to 
stick to a single table as well... rather write the session id into 
the database to checkout a customer record.


Allow updates to a customer record if its not checked out, and this 
way you have no worries about lock expiration etc.


You should maintain an ASO that tracks all active sessions by session 
id. Once a user queries for a customer record that has been checked 
out, if the session ID still exists in the ASO, then refuse update 
access and grant only read access, simple and elegant. Once the user 
saves successfully release the lock in the database. if a session is 
interrupted for whatever reason, then using a session timeout of 20 
or 30 minutes and a session listener you clean up removing the 
session ID from the ASO and database... so you are well covered. I am 
no guru like some of these other guys, but this works for me and its 
nice and simple... here is a brief implementation outline:


public class ApplicationManager {

/** variable to store the singleton ApplicationManager */
private static final ApplicationManager applicationManagerInstance_ = 
new ApplicationManager();


/** Hashtable containing visit history objects.  is the 
sessionid and the Visit Object */
private static ConcurrentHashMap visitHistory_ = new 
ConcurrentHashMap();


/** @return the ApplicationManager instance */
public synchronized static ApplicationManager getInstance(){
return applicationManagerInstance_;
}

}

public class SessionMonitor implements HttpSessionListener {

/** @see 
javax.servlet.http.HttpSessionListener#sessionDestroyed(javax.servlet.http.HttpSessionEvent) 
*/

public void sessionDestroyed(HttpSessionEvent event) {
String sid = event.getSession().getId();
ApplicationManager manager = ApplicationManager.getInstance();
manager.removeUserSession(sid);
}


Hivemodule.xml:













cheers,
Peter

Murray Collingwood wrote:

Wow - what a lot of responses.

First a little more detail - use case (for example):

Take a customer record, a basic record has previously been created 
and the
customer has completed some forms so we are now wanting to complete 
all of the
details about contact information, financial details, key assets, 
health
information, etc, etc. The system relies on a number of 
classifications which
need to be looked up, anyways, editing this record can take upto 20 
minutes. The size of this record certainly justifies breaking it up 
into a number of
smaller records stored in separate tables, however the same problem 
remains
because the user wants to see all of this information on 1 
(scrollable) web
page, we are still holding a lock on the information for the 
duration of the

request.

Potentially there are maybe 700 people who could be editing this 
record for
different reasons. Accuracy of the information is critical - we 
don't want

personal details being sent to a neighbour.

The nature of the application means that users will be reviewing a 
record each
year, and if any changes are made they are often made to the same 
record around
the same time of the year - increasing the possibility of two people 
wanting to

edit the record at the same time.

Besides all of the above, the user has asked for exclusive editing 
of a record -
such that other users can still read the existing record but nobody 
else can
update the record while it is locked. The user understands the 
concept of
networks issues and broken connections and therefore accepts a 
timeout condition

on the lock of say 20 minutes.

Next, how I will do this:

1. To establish a lock:
a. I need a LOCK table: foreign-key, timestamp, userid
b. In my Session I need a collection of timestamps
c. Create a timestamp value - add it to my collection of timestamps
d. Add a record to the LOC

Re: Record locking

2007-02-21 Thread Robert Zeigler
The main problem with using a session timeout for the lock is that it  
doesn't allow you to detect events where a user starts to edit an  
object, does not finish, but remains active in the webapp; the  
session won't die, and neither will your lock. You have to  
incorporate time at least to some degree.  I implemented similar  
functionality in an application recently, but used a bit of ajax  
magic to ensure that the lock was held for exactly as long as it  
needed to be and no longer (while the user is editing the object,  
periodic ajax calls are sent to the server to inform of the fact that  
the user is still editing; if the user saves, the lock is released;  
if the user moves to a different portion of the webapp without saving  
or canceling the lock, the lock expires since there are no more ajax  
calls to keep the lock valid)


Robert

On Feb 21, 2007, at 2/211:56 AM , Peter Stavrinides wrote:

I don't think the benefits justify the effort involved to maintain  
all those timestamps, its a bit too complex. Perhaps its better to  
stick to a single table as well... rather write the session id into  
the database to checkout a customer record.


Allow updates to a customer record if its not checked out, and this  
way you have no worries about lock expiration etc.


You should maintain an ASO that tracks all active sessions by  
session id. Once a user queries for a customer record that has been  
checked out, if the session ID still exists in the ASO, then refuse  
update access and grant only read access, simple and elegant. Once  
the user saves successfully release the lock in the database. if a  
session is interrupted for whatever reason, then using a session  
timeout of 20 or 30 minutes and a session listener you clean up  
removing the session ID from the ASO and database... so you are  
well covered. I am no guru like some of these other guys, but this  
works for me and its nice and simple... here is a brief  
implementation outline:


public class ApplicationManager {

/** variable to store the singleton ApplicationManager */
private static final ApplicationManager applicationManagerInstance_  
= new ApplicationManager();


/** Hashtable containing visit history objects.  is  
the sessionid and the Visit Object */
private static ConcurrentHashMap visitHistory_ = new  
ConcurrentHashMap();


/** @return the ApplicationManager instance */
public synchronized static ApplicationManager getInstance(){
return applicationManagerInstance_;
}

}

public class SessionMonitor implements HttpSessionListener {

/** @see javax.servlet.http.HttpSessionListener#sessionDestroyed 
(javax.servlet.http.HttpSessionEvent) */

public void sessionDestroyed(HttpSessionEvent event) {
String sid = event.getSession().getId();
ApplicationManager manager = ApplicationManager.getInstance();
manager.removeUserSession(sid);
}


Hivemodule.xml:













cheers,
Peter

Murray Collingwood wrote:

Wow - what a lot of responses.

First a little more detail - use case (for example):

Take a customer record, a basic record has previously been created  
and the
customer has completed some forms so we are now wanting to  
complete all of the
details about contact information, financial details, key assets,  
health
information, etc, etc.  The system relies on a number of  
classifications which
need to be looked up, anyways, editing this record can take upto  
20 minutes. The size of this record certainly justifies breaking  
it up into a number of
smaller records stored in separate tables, however the same  
problem remains
because the user wants to see all of this information on 1  
(scrollable) web
page, we are still holding a lock on the information for the  
duration of the

request.

Potentially there are maybe 700 people who could be editing this  
record for
different reasons.  Accuracy of the information is critical - we  
don't want

personal details being sent to a neighbour.

The nature of the application means that users will be reviewing a  
record each
year, and if any changes are made they are often made to the same  
record around
the same time of the year - increasing the possibility of two  
people wanting to

edit the record at the same time.

Besides all of the above, the user has asked for exclusive editing  
of a record -
such that other users can still read the existing record but  
nobody else can
update the record while it is locked.  The user understands the  
concept of
networks issues and broken connections and therefore accepts a  
timeout condition

on the lock of say 20 minutes.

Next, how I will do this:

1. To establish a lock:
 a. I need a LOCK table: foreign-key, timestamp, userid
 b. In my Session I need a collection of timestamps
 c. Create a timestamp value - add it to my collection of timestamps
 d. Add a record to the LOCK table using my timestamp value
 e. Select from the lock table by foreign-key - if mine is the  
only record then

read the record and begin editing, the lock was

Where am I going wrong ?

2007-02-21 Thread Peter Stavrinides

In Web.xml I have defined an initialization parameter,


   IRM
   org.apache.tapestry.ApplicationServlet
   1
   
 myParam
 777
   


I tried to get to it with the following:

@InjectObject("service:tapestry.globals.ServletContext")
public abstract ServletContext getServletContext();

getServletContext().getInitParameter("myParam");

but its always null, what am I missing?

Thanks
Peter







--
Peter Stavrinides
Albourne Partners (Cyprus) Ltd
Tel: +357 22 750652 

If you are not an intended recipient of this e-mail, please notify the sender, delete it and do not read, act upon, print, disclose, copy, retain or redistribute it. Please visit http://www.albourne.com/email.html for important additional terms relating to this e-mail. 



Re: is there a way to programatically add the declaration of a components library ?

2007-02-21 Thread Tapestry User List

ok kiuma, I will have a look. Thanks. D.

2007/2/20, Andrea Chiumenti <[EMAIL PROTECTED]>:

Ok I think that what you need is here www.jfly.org.

ciao,
kiuma

On 2/20/07, Tapestry User List <[EMAIL PROTECTED]> wrote:
>
> Let me explain why I need that:
> I'm developing web application with the notion of plugin. A plugin is
> a set of tapestry pages which can refers components from a components
> library which is also in the plugin.
> I implemented the ITemplateSourceDelegate interface to find templates
> from the plugin.
> I also implemented the ISpecificationResolverDelegate interface to
> find specification pages from the plugin. It works pretty good.
>
> Now, when a new plugin is installed in my web application, if the
> plugin contains a components library, I need to declare it in the
> application xml file. The problem is I can't mofify the application
> xml file because it is in a war file. So I would like to add the
> component library either dynamically or by externalizing the
> application xml file outside the war file and link it.
>
> Hope it helps to understand my problem.
>
> D.
>
> 2007/2/20, Tapestry User List <[EMAIL PROTECTED]>:
> > A way to resolve my problem would be to externalize the application
> > xml file. Is there a way to link an application xml file outside the
> > war ? So that I will be able to edit this file.
> >
> > Redeploy the war is not a issue if the application xml file is changed.
> >
> > D.
> >
> > 2007/2/20, Tapestry User List <[EMAIL PROTECTED]>:
> > > Hi !
> > >
> > > I'm developing a Tapestry application. For adding a component library,
> > > I need to edit the application xml file. I need to add dynamically a
> > > library at the start of the web application. Is there a way to do that
> > > programatically without editing the application xml file?
> > >
> > > 
> > >  > > "-//Apache Software Foundation//Tapestry Specification 4.0//EN"
> > > "http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd";>
> > > 
> > >
> > >  > >
> specification-path="classpath:/org/apache/tapestry/contrib/Contrib.library"/>
> > >  specification-path="/net/sf/tacos/Tacos.library"/>
> > >
> > > 
> > >
> > > 
> > >
> > >
> > > Thanks so much.
> > >
> > > D.
> > >
> >
>
> -
> 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]