Re: T5.2 Need Advice on JDBC and Transaction Mgmt

2011-01-11 Thread Yohan Yudanara
I've try it and it's working. Thank you very much.
Now I can use JdbcTemplate and declarative transaction on my Tapestry
Service, so I can take advantage of T 5.2 service reload feature.
This is improving productivity a lot.

Thanks...

Best regards,
Yohan Yudanara



On Mon, Dec 13, 2010 at 8:32 AM, Yohan Yudanara yohan.yudan...@gmail.comwrote:

 Thank you very much for your explanation and code sample, Mr. Christian
 Köberl
 I will try it.

 On Sun, Dec 12, 2010 at 10:34 PM, Christian Köberl
 tapestry.christian.koeb...@gmail.com wrote:
 
 
  Yohan Yudanara-2 wrote:
 
  So, in my conclusion (CMIIW), if I'm using JDBC instead of Hibernate,
  I'd better stick with service/dao in spring bean. Because in spring
  bean, I can use spring declarative transaction and also JdbcTemplate.
  If I want to use tapestry service instead of spring bean, I need to
  write code for accessing database (using JDBC) and managing
  transaction from scratch.
 
 
  No, that's not really true. You could use the advise out of my first post
 on
  this thread and apply that to all your Tapestry services accessing the
  database. You could do this by searching for an annotation - you can even
  use the Spring @Transacational annotation but it's probably better to
 have
  your own (since semantics won't be completely the same).
 
  Here's how the advisor could look like (see other post for
  TransactionalAdvise).
 
  public interface TransactionAdvisor
  {
 void addTransactionAdvice(MethodAdviceReceiver receiver);
  }
 
  public class TransactionAdvisorImpl implements TransactionAdvisor
  {
 private final PlatformTransactionManager manager; // this is the
 Spring
  transaction manager
 
 private final MapPropagation, MethodAdvice transactionalAdvises;
 
 public TransactionAdvisorImpl (PlatformTransactionManager manager)
 {
 this.manager = manager;
 
 transactionalAdvises = new HashMapPropagation, MethodAdvice();
 for (Propagation propagation : Propagation.values())
 {
 transactionalAdvises.put(propagation, new
  TransactionalAdvise(manager, propagation.value()));
 }
 }
 
 public void addTransactionAdvice(MethodAdviceReceiver receiver)
 {
 for (Method m : receiver.getInterface().getMethods())
 {
 Transactional txAnnotation =
  m.getAnnotation(Transactional.class);
 
 if (txAnnotation != null)
 {
 receiver.adviseMethod(m,
  transactionalAdvises.get(txAnnotation.propagation()));
 }
 }
 }
  }
 
  In your module you have to bind the services and advise your DAOs:
 @Match(*DAO)
 public static void adviseTransactions(TransactionAdvisor advisor,
  MethodAdviceReceiver receiver)
 {
 advisor.addTransactionAdvice(receiver);
 }
 
  This advice method is configured to match against any service whose id
 ends
  with DAO, such as PersonDAO.
  --
  View this message in context:
 http://tapestry-users.832.n2.nabble.com/T5-2-Need-Advice-on-JDBC-and-Transaction-Mgmt-tp5825768p5828294.html
  Sent from the Tapestry Users mailing list archive at Nabble.com.
 
  -
  To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
  For additional commands, e-mail: users-h...@tapestry.apache.org
 
 



Re: translators in 5.2+

2011-01-11 Thread Paul Stanton

ah that's better :)

and i now have arithmetic support in my text fields .. jeez 
shunting-yard/rpn/infix/postfix blah blah is a pain and now that i have 
a method that works i hope i never have to look at it all again!!!


p.

On 11/01/2011 9:15 AM, Josh Canfield wrote:

Have you tried :

configuration.override(BigDecimal.class, new BigDecimalTranslator());

Josh

On Mon, Jan 10, 2011 at 2:01 PM, Paul Stantonp...@mapshed.com.au  wrote:

can someone shed some light on how to override or supply new translators to
tapestry 5.2+ ?

jumpstart is written for 5.1
http://jumpstart.doublenegative.com.au/jumpstart/examples/input/creatingtranslators1

and no longer works.

i've tried adding:

public static void
contributeTranslatorSource(MappedConfigurationClass?, Translator?
configuration)
{
configuration.add(BigDecimal.class, new BigDecimalTranslator());
}

to AppModule, but i get:

Caused by: java.lang.IllegalArgumentException: Service contribution (to
service 'TranslatorSource') conflicts with existing contribution (by
package.AppModule.contributeTranslatorSource(MappedConfiguration) (at
AppModule.java)).
at
org.apache.tapestry5.ioc.internal.ValidatingMappedConfigurationWrapper.add(ValidatingMappedConfigurationWrapper.java:83)
at
org.apache.tapestry5.services.TapestryModule.contributeTranslatorSource(TapestryModule.java:1044)

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



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




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



Re: Building a multizone update in a loop

2011-01-11 Thread Paul Stanton

have a read of this... you might find it useful.

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

On 11/01/2011 5:10 PM, Mark wrote:

Thank you. That makes sense now.

On Mon, Jan 10, 2011 at 11:44 PM, Josh Canfieldjoshcanfi...@gmail.com  wrote:

MultiZoneUpdate is confusing for sure.

public MultiZoneUpdate add(String zoneId, Object renderer)
{
return new MultiZoneUpdate(zoneId, renderer, this);
}

See how it returns a new instance of the update when you call add?

You can change your code like this and it should get things working:

MultiZoneUpdate update =  MultiZoneUpdate(totalPriceZone,totalPriceZone)
for(Item item : getItems) {
  update = update.add(itemZone- +item.getId(), itemZone);
}
return update;

There are some recent defects filed to get this interface fixed,
hopefully someone will get some time to look at it for the 5.3
release.

Josh

On Mon, Jan 10, 2011 at 9:32 PM, Markmark-li...@xeric.net  wrote:

I have a zone that is rendered in a loop.  It has a text field that
can be changed and it updates the cost for that row and the total cost
at the bottom of the page.  This all works fine regardless of how many
items are in the row. A user change to the qty in a row will update
that row's total and the total at the bottom of the page.

My code looked something like:
return new MultiZoneUpdate(totalPriceZone,totalPriceZone).add(itemZone-
+item.getId(), itemZone);

That works fine.

Now the requirements changed and I need to update the total on rows
other than the row that was changed.  My first through was something
like this:
MultiZoneUpdate update =  MultiZoneUpdate(totalPriceZone,totalPriceZone)
for(Item item : getItems) {
   update.add(itemZone- +item.getId(), itemZone);
}
return update;

But that doesn't work.  It only updates the totalPriceZone.  So I
tried going back to what I had before, but this time creating the
Update on one line and then adding the itemZone on the next like this:

MultiZoneUpdate update =  MultiZoneUpdate(totalPriceZone,totalPriceZone)
update.add(itemZone- +item.getId(), itemZone);
return update;

I expected the code above to have the same result as my original code,
but it doesn't.  It only updates the totalPriceZone.

Should I expect the first piece of code and the last to do the same
thing or is there some reason that you can't call add on the
MultiZoneUpdate after it is constructed?

Any other suggestions on how to create a multizone update when the
number of zones to add vary at runtime?

Mark

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



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



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




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



Tapestry5 and pop-up parameters

2011-01-11 Thread Argo Vilberg
hi,

How to add parameters into Tapetstry page java object if i open page with
 javascript pop-up windows ?


Argo


Re: Tapestry5 + Tomcat5 + Apache2

2011-01-11 Thread LLTYK

I think apache just isn't expecting urls to be in the js and isn't replacing
it. I wonder if Chenillekit should be using toAbsoluteURI, wouldn't a
relative path work just fine? 

As for the solution, well make your own copy of the mixin and fix it (I'd
make it use a relative path instead).
-- 
View this message in context: 
http://tapestry-users.832.n2.nabble.com/Tapestry5-Tomcat5-Apache2-tp5908721p5910560.html
Sent from the Tapestry Users mailing list archive at Nabble.com.

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



Use shiro's session object instead of SSO(ASO)

2011-01-11 Thread Ronald Luke
Hello, list,

I am using shiro(tapestry-security) in my tapestry project. and since there is 
a 
session object in shiro, I am considering using this session object to store 
user specific data instead of SSO(ASO), but I am not sure if this is a good 
practice.

Please shed some light on this,

Thanks,

Ron



  

Re: chenillekit-tapestry 1.3.0 Unable to resolve 'chenillekit/TabSet'

2011-01-11 Thread Borut Bolčina
Just not to leave this hanging...

The problem has nothing to do with ChenilleKit nor with Tapestry - it is
Jetty related. I run the application in the command line (mvn jetty:run) in
Friday and forgot about it. Then I ran another instance within Eclipse, but
the browser was still responding to the first instance.

Can Jetty (or Jetty maven plugin) be configured not to start if the port
(8080) is already in use? It is easy to start more than one instance of web
app with Jetty on the same port. I am developing on Windows.

-Borut

2011/1/10 Borut Bolčina borut.bolc...@gmail.com

 Hi,

 just now I tried to use the TabSet component from chenillekit-tapestry
 1.3.0 with Tapestry 5.2.4. I am getting this

 Unable to resolve 'chenillekit/TabSet' to a component class name.

 When my application starts, it prints the available components and TabSet
 is one of them:
 chenillekit/TabSet: org.chenillekit.tapestry.core.components.TabSet
 and
 ck/TabSet: org.chenillekit.tapestry.core.components.TabSet

 I even looked inside the manifest of the chenillekit-tapestry jar and it
 seems ok.

 The error page however does not list the ck components:

 org.apache.tapestry5.ioc.util.UnknownValueException
 Unable to resolve 'chenillekit/TabSet' to a component class name.
 availableValues

 Component types:

- ActionLink
- AddRowLink
- AjaxFormLoop
- Any
- BeanDisplay
- BeanEditForm
- BeanEditor
- Checkbox
- DateField
- Delegate
- Error
- Errors
- EventLink
- ExceptionDisplay
- Form
- FormFragment
- FormInjector
- Grid
- GridCell
- GridColumns
- GridPager
- GridRows
- Hidden
- If
- Label
- Layout
- LinkSubmit
- Loop
- Output
- OutputRaw
- PageLink
- Palette
- PasswordField
- ProgressiveDisplay
- PropertyDisplay
- PropertyEditor
- Radio
- RadioGroup
- RemoveRowLink
- RenderObject
- Select
- Submit
- SubmitNotifier
- TextArea
- TextField
- TextOutput
- Trigger
- Unless
- Zone
- cay/EntityField
- cay/Select
- cay/ToManyViewer
- cay/ToOneEditor


 I am including the component library like:

 dependency
 groupIdorg.chenillekit/groupId
 artifactIdchenillekit-tapestry/artifactId
 version1.3.0/version
 /dependency

 Any ideas?

 Regards,
 Borut



How to hide a component ?

2011-01-11 Thread Taha Hafeez
Hi

Can I hide a component in code. Say I have

class Page {

@Component
private Select select;

}

Now I want to hide select in code(not in template using t:if), how can i
do that ?

regards
Taha


Re: Tapestry5 and pop-up parameters

2011-01-11 Thread Josh Canfield
There isn't much information in your request so I'm not going to write
a book guessing every possible thing you might be talking about.

If you know the parameters that you want to pass when you are
rendering the page that opens the popup then you can use something
like:
@Inject
PageRenderLinkSource linkSource;

public String getPopupLink() {
  return linkSource.createPageRenderLinkWithContext(pagename, param1,
param2); // to create the link
}

script
window.open('${popuplink}');
/script

I haven't compiled/run this code so please forgive typos etc.

Josh

On Tue, Jan 11, 2011 at 3:58 AM, Argo Vilberg wilps...@gmail.com wrote:
 hi,

 How to add parameters into Tapetstry page java object if i open page with
  javascript pop-up windows ?


 Argo


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



Re: How to hide a component ?

2011-01-11 Thread Christian Riedel
hi taha,

you could add the DiscardBody mixin:
http://tapestry.apache.org/current/tapestry-core/ref/org/apache/tapestry5/corelib/mixins/DiscardBody.html

or write your own one that implements some more sophisticated 
visibility-function.

cheers
christian


Am 11.01.2011 um 16:02 schrieb Taha Hafeez:

 Hi
 
 Can I hide a component in code. Say I have
 
 class Page {
 
 @Component
 private Select select;
 
 }
 
 Now I want to hide select in code(not in template using t:if), how can i
 do that ?
 
 regards
 Taha


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



Re: chenillekit-tapestry 1.3.0 Unable to resolve 'chenillekit/TabSet'

2011-01-11 Thread Josh Canfield
I'd be stunned and surprised if your second instance was able to start
on the same port. Try to do this intentionally and you should get a
port already in use error on the second instance, is it possible you
didn't notice the error? This isn't a Jetty thing, it's an OS thing,
or more specifically TCP stack thing.

Josh

On Tue, Jan 11, 2011 at 6:46 AM, Borut Bolčina borut.bolc...@gmail.com wrote:
 Just not to leave this hanging...

 The problem has nothing to do with ChenilleKit nor with Tapestry - it is
 Jetty related. I run the application in the command line (mvn jetty:run) in
 Friday and forgot about it. Then I ran another instance within Eclipse, but
 the browser was still responding to the first instance.

 Can Jetty (or Jetty maven plugin) be configured not to start if the port
 (8080) is already in use? It is easy to start more than one instance of web
 app with Jetty on the same port. I am developing on Windows.

 -Borut

 2011/1/10 Borut Bolčina borut.bolc...@gmail.com

 Hi,

 just now I tried to use the TabSet component from chenillekit-tapestry
 1.3.0 with Tapestry 5.2.4. I am getting this

 Unable to resolve 'chenillekit/TabSet' to a component class name.

 When my application starts, it prints the available components and TabSet
 is one of them:
 chenillekit/TabSet: org.chenillekit.tapestry.core.components.TabSet
 and
 ck/TabSet: org.chenillekit.tapestry.core.components.TabSet

 I even looked inside the manifest of the chenillekit-tapestry jar and it
 seems ok.

 The error page however does not list the ck components:

 org.apache.tapestry5.ioc.util.UnknownValueException
 Unable to resolve 'chenillekit/TabSet' to a component class name.
 availableValues

 Component types:

    - ActionLink
    - AddRowLink
    - AjaxFormLoop
    - Any
    - BeanDisplay
    - BeanEditForm
    - BeanEditor
    - Checkbox
    - DateField
    - Delegate
    - Error
    - Errors
    - EventLink
    - ExceptionDisplay
    - Form
    - FormFragment
    - FormInjector
    - Grid
    - GridCell
    - GridColumns
    - GridPager
    - GridRows
    - Hidden
    - If
    - Label
    - Layout
    - LinkSubmit
    - Loop
    - Output
    - OutputRaw
    - PageLink
    - Palette
    - PasswordField
    - ProgressiveDisplay
    - PropertyDisplay
    - PropertyEditor
    - Radio
    - RadioGroup
    - RemoveRowLink
    - RenderObject
    - Select
    - Submit
    - SubmitNotifier
    - TextArea
    - TextField
    - TextOutput
    - Trigger
    - Unless
    - Zone
    - cay/EntityField
    - cay/Select
    - cay/ToManyViewer
    - cay/ToOneEditor


 I am including the component library like:

         dependency
             groupIdorg.chenillekit/groupId
             artifactIdchenillekit-tapestry/artifactId
             version1.3.0/version
         /dependency

 Any ideas?

 Regards,
 Borut



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



Re: How to hide a component ?

2011-01-11 Thread Thiago H. de Paula Figueiredo
On Tue, 11 Jan 2011 13:02:03 -0200, Taha Hafeez tawus.tapes...@gmail.com  
wrote:



Hi


Hi!


Can I hide a component in code. Say I have

class Page {

@Component
private Select select;

}
Now I want to hide select in code(not in template using t:if), how can  
i do that ?


If it's just hiding, use CSS for that. If you don't want the component to  
be rendered at all, there's two scenarios:


* Component which you can change its code: make it return false on  
@BeginRender. This could be made into a mixin.
* Component which you cannot change its code: no way to do it unless you  
write a mixin.


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

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

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



Tapestry 4.1 injecting the wrong application state object

2011-01-11 Thread Pepijn Schmitz

Hi everyone,

I'm having a bizarre problem with Tapestry, and I'm hoping someone here 
might be able to point me to a solution. Before I go into detail I'd 
like to describe the problem generally, in the hopes that it might be a 
known problem or someone may have encountered something similar.


The problem is that Tapestry 4.1.6 sometimes injects the wrong 
application state object on my pages! As you can imagine, this plays 
havoc with my application, with users seeing other users' details, or 
even worse, changing other users' information! It's a support and 
security nightmare.


I'm using Tapestry 4.1.6, and I'm using annotations instead of XML 
files. My pages all descend from a base class:


public abstract SupplierDNAPage extends BasePage {
@InjectState
public abstract SupplierDnaSession getSupplierDnaSession();

@InjectStateFlag
public abstract boolean getSupplierDnaSessionExists();

...
}

hivemodule.xml contains the following:

?xml version=1.0 encoding=UTF-8?
module id=com.supplierdna version=0.0.0
contribution configuration-id=tapestry.state.ApplicationObjects
state-object name=supplier-dna-session scope=session
create-instance class=com.supplierdna.logic.SupplierDnaSession/
/state-object
/contribution
  ...
/module

SupplierDNA is the name of the company I'm writing this for. As I 
understand it, this is the correct way of using application state 
objects. And most of the time, it works perfectly. When testing locally 
I have no problems with wrong application state being injected, and our 
demo system also doesn't have the problem.


The problems seem to start when the server is heavily loaded. Then, 
sometimes, getSupplierDnaSession() will return an application state 
object from a different session!!!


I have verified this by adding a pageBeginRender() listener method to 
the base class, and a client address property to the session. The 
listener method checks whether the client address stored on the session 
it gets from Tapestry is the same as the client address from the current 
request, and throws an exception if this is not the case. On our 
production server, this happens dozens of times a day!


The method also directly retrieves the application state object from the 
HttpSession and compares it to the one it got from Tapestry, and it 
turns out that the application state object on the HttpSession is the 
correct one, but somehow Tapestry is injecting a different one! This 
seems to rule out the web container as being the culprit (which is 
Glassfish 2 update 2, in this case).


Obviously this is a complex problem with a potentially huge number of 
contributing factors, but first I'd just like to know whether this 
sounds familiar to anyone? Is there a known problem with Tapestry which 
could cause this? Has anyone ever experienced something similar? Many 
thanks in advance for any help you can give me!


Kind regards,
Pepijn Schmitz

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



Re: How to hide a component ?

2011-01-11 Thread Taha Hafeez
Thanks Christian  Thiago

regards
Taha


On Tue, Jan 11, 2011 at 9:18 PM, Thiago H. de Paula Figueiredo 
thiag...@gmail.com wrote:

 On Tue, 11 Jan 2011 13:02:03 -0200, Taha Hafeez tawus.tapes...@gmail.com
 wrote:

  Hi


 Hi!

  Can I hide a component in code. Say I have

 class Page {

 @Component
 private Select select;

 }
 Now I want to hide select in code(not in template using t:if), how can i
 do that ?


 If it's just hiding, use CSS for that. If you don't want the component to
 be rendered at all, there's two scenarios:

 * Component which you can change its code: make it return false on
 @BeginRender. This could be made into a mixin.
 * Component which you cannot change its code: no way to do it unless you
 write a mixin.

 --
 Thiago H. de Paula Figueiredo
 Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
 and instructor
 Owner, Ars Machina Tecnologia da Informação Ltda.
 http://www.arsmachina.com.br


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




Context of a Zone

2011-01-11 Thread Mark
I have a form with a loop that looks something like this:

|__QTY__|_ITEM__|__PRICE__|
|__1_|_soup__|$1|
|__3_|_peas__|$3|
etc.

Users can change the quantity and it automatically changes the price.
Each price is in its own zone and the KeyUp action on the
cooresponding QTY causes that price zone to update. (I'm using the
zoneUpdater described at
http://tinybits.blogspot.com/2010/03/new-and-better-zoneupdater.html)

Now the requirements have changed and we need to be able to offer a
discount based on the number of items being purchased.  This means
that an update to the soup row will sometimes need to change not only
the price soup row, but also the peas row. At first I tried building a
MultiZoneUpdate (Thank you for your help Josh), but that just sets
every price to the same thing as the row that is being updated. This
is because the context of the row/event that triggered the updated
doesn't provide the context for the zones that need to be updated. If
I change the Qty of soup to 2, the soup item is the context for that
update, so when I update the row for peas, that zone doesn't know
anything about peas--only soup.

So my question is:
How can I access an item from the context when the zone was rendered
instead of the context of the section that is triggering the zone
update.

It seems like I could solve this if each zone was rendered with a
context that could be used when an update was triggered on that zone.
Something like:
t:zone t:context=item t:id=priceZone id=priceZoneId
${itemSubtotal}/t:zone

The idea being, that when you update a zone, it can figure out the
context at which the zone was originally created and not just the
context of the event firing the update. (Of course I don't know how
this would work on the Java side of things.)

Is there a way to do something like this?  Is there a different way to
do it that I've just overlooked and I'm making things harder than they
need to be?

Mark

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



Re: Tapestry 4.1 injecting the wrong application state object

2011-01-11 Thread Koka Kiknadze
I did have exactly similar problem couple of years ago - JSF app worked fine
from intranet, but messed up user sessions when accessed from WAN side.

So initial suspect was the squid proxy configuration of our ISP. The problem
disappeared as soon as we turned encryption on for the whole site (so that
proxy could not mess things up). Well, as the performance was acceptable
even with HTTPS we just left everything as is.

Hence I'd suggest temporarily requiring HTTPS for the whole site and if the
problem disappears, you'll know for sure it's not your application or
tapestry to be blamed.

Good luck.




On Tue, Jan 11, 2011 at 8:37 PM, Pepijn Schmitz tapes...@chaos.demon.nlwrote:

 Hi everyone,

 I'm having a bizarre problem with Tapestry, and I'm hoping someone here
 might be able to point me to a solution. Before I go into detail I'd like to
 describe the problem generally, in the hopes that it might be a known
 problem or someone may have encountered something similar.

 The problem is that Tapestry 4.1.6 sometimes injects the wrong application
 state object on my pages! As you can imagine, this plays havoc with my
 application, with users seeing other users' details, or even worse, changing
 other users' information! It's a support and security nightmare.

 I'm using Tapestry 4.1.6, and I'm using annotations instead of XML files.
 My pages all descend from a base class:

 public abstract SupplierDNAPage extends BasePage {
@InjectState
public abstract SupplierDnaSession getSupplierDnaSession();

@InjectStateFlag
public abstract boolean getSupplierDnaSessionExists();

...
 }

 hivemodule.xml contains the following:

 ?xml version=1.0 encoding=UTF-8?
 module id=com.supplierdna version=0.0.0
 contribution configuration-id=tapestry.state.ApplicationObjects
 state-object name=supplier-dna-session scope=session
 create-instance class=com.supplierdna.logic.SupplierDnaSession/
 /state-object
 /contribution
  ...
 /module

 SupplierDNA is the name of the company I'm writing this for. As I
 understand it, this is the correct way of using application state objects.
 And most of the time, it works perfectly. When testing locally I have no
 problems with wrong application state being injected, and our demo system
 also doesn't have the problem.

 The problems seem to start when the server is heavily loaded. Then,
 sometimes, getSupplierDnaSession() will return an application state object
 from a different session!!!

 I have verified this by adding a pageBeginRender() listener method to the
 base class, and a client address property to the session. The listener
 method checks whether the client address stored on the session it gets from
 Tapestry is the same as the client address from the current request, and
 throws an exception if this is not the case. On our production server, this
 happens dozens of times a day!

 The method also directly retrieves the application state object from the
 HttpSession and compares it to the one it got from Tapestry, and it turns
 out that the application state object on the HttpSession is the correct one,
 but somehow Tapestry is injecting a different one! This seems to rule out
 the web container as being the culprit (which is Glassfish 2 update 2, in
 this case).

 Obviously this is a complex problem with a potentially huge number of
 contributing factors, but first I'd just like to know whether this sounds
 familiar to anyone? Is there a known problem with Tapestry which could cause
 this? Has anyone ever experienced something similar? Many thanks in advance
 for any help you can give me!

 Kind regards,
 Pepijn Schmitz

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




Re: Opportunity for some PR?

2011-01-11 Thread Joel Halbert
+1


On Mon, 2011-01-10 at 11:36 -0800, Josh Canfield wrote:
 I love working in Tapestry and there is some truth in what the person
 has to say. I believe in the Tapestry5 framework but I also know there
 is a long way we need to go to distance ourselves from the pain that
 people experienced when Tap3/4 stopped getting Howard's attention.
 
 The choice of calling the framework Tapestry 5 came with it's
 benefits and it's harm. Obviously people know the name Tapestry
 because it's been around for a long time. But with that longevity
 brings a host of people with a bad experience in any previous version
 who can denigrate the current framework armed with all the ammo of
 past mistakes.
 
 The recent documentation effort has been amazing. If you can't write
 (me) and you want to help push the project forward, maybe we can get
 an effort going to clean up the defect database? I'd like to work on
 the issues that will help the most people. Picking what to work on
 next can be a challenge so, please vote up issues in the defect system
 that you care about, they will get more attention. Add comments to
 defects that give helpful information about how you are experiencing
 the defect, what you are trying to do and what is happening especially
 if it's different from the submitter. The less time any of the
 committers have to spend figuring out what the defect means or how to
 reproduce the more time can be spent making appropriate changes :)
 
 Anyway, here's to continuing to build out a solid framework that best
 suits our mental model, even if some portion of population never gets
 it!
 
 Josh
 
 On Mon, Jan 10, 2011 at 10:02 AM, Thiago H. de Paula Figueiredo
 thiag...@gmail.com wrote:
  On Mon, 10 Jan 2011 14:46:58 -0200, jackkuros...@w9z.org wrote:
 
  Just posted:
 
  http://stackoverflow.com/questions/4638851/what-java-web-application-framework-to-use
 
  If you look at the things tagged Tapestry there are quite a few
  opportunities to help clear up some misconceptions about Tapestry.  It 
  looks
  like there are two people who heavily use the StackOverFlow to spread
  mis-information about the framework. SO could benefit from some more voices
  and votes from people who are actually using Tapestry.
 
  http://stackoverflow.com/questions/tagged/tapestry
 
  And there's this:
  http://stackoverflow.com/questions/1303438/why-did-you-stop-using-tapestry.
  What about downvoting the first answer? It's mostly about Tapestry 4 and he
  calls Howard a liar. Classy. I wrote an answer to it. It's the third most
  voted one until now, but with way less votes than the first.
 
  --
  Thiago H. de Paula Figueiredo
  Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and
  instructor
  Owner, Ars Machina Tecnologia da Informação Ltda.
  http://www.arsmachina.com.br
 
  -
  To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
  For additional commands, e-mail: users-h...@tapestry.apache.org
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org
 



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



Re: chenillekit-tapestry 1.3.0 Unable to resolve 'chenillekit/TabSet'

2011-01-11 Thread Borut Bolčina
Here is something to backup my claims:
http://docs.codehaus.org/display/JETTY/Socket+reuse+on+Windows, but seems
old.

I can repeat this behaviour any time. No complaint about port already taken!
I can start webapp A, then webapp B, browse to localhost:8080, it displays
the webapp B, then I stop webapp B, hit refresh in the browser and
immediately see webapp A.

-Borut

2011/1/11 Josh Canfield joshcanfi...@gmail.com

 I'd be stunned and surprised if your second instance was able to start
 on the same port. Try to do this intentionally and you should get a
 port already in use error on the second instance, is it possible you
 didn't notice the error? This isn't a Jetty thing, it's an OS thing,
 or more specifically TCP stack thing.

 Josh

 On Tue, Jan 11, 2011 at 6:46 AM, Borut Bolčina borut.bolc...@gmail.com
 wrote:
  Just not to leave this hanging...
 
  The problem has nothing to do with ChenilleKit nor with Tapestry - it is
  Jetty related. I run the application in the command line (mvn jetty:run)
 in
  Friday and forgot about it. Then I ran another instance within Eclipse,
 but
  the browser was still responding to the first instance.
 
  Can Jetty (or Jetty maven plugin) be configured not to start if the port
  (8080) is already in use? It is easy to start more than one instance of
 web
  app with Jetty on the same port. I am developing on Windows.
 
  -Borut
 
  2011/1/10 Borut Bolčina borut.bolc...@gmail.com
 
  Hi,
 
  just now I tried to use the TabSet component from chenillekit-tapestry
  1.3.0 with Tapestry 5.2.4. I am getting this
 
  Unable to resolve 'chenillekit/TabSet' to a component class name.
 
  When my application starts, it prints the available components and
 TabSet
  is one of them:
  chenillekit/TabSet: org.chenillekit.tapestry.core.components.TabSet
  and
  ck/TabSet: org.chenillekit.tapestry.core.components.TabSet
 
  I even looked inside the manifest of the chenillekit-tapestry jar and it
  seems ok.
 
  The error page however does not list the ck components:
 
  org.apache.tapestry5.ioc.util.UnknownValueException
  Unable to resolve 'chenillekit/TabSet' to a component class name.
  availableValues
 
  Component types:
 
 - ActionLink
 - AddRowLink
 - AjaxFormLoop
 - Any
 - BeanDisplay
 - BeanEditForm
 - BeanEditor
 - Checkbox
 - DateField
 - Delegate
 - Error
 - Errors
 - EventLink
 - ExceptionDisplay
 - Form
 - FormFragment
 - FormInjector
 - Grid
 - GridCell
 - GridColumns
 - GridPager
 - GridRows
 - Hidden
 - If
 - Label
 - Layout
 - LinkSubmit
 - Loop
 - Output
 - OutputRaw
 - PageLink
 - Palette
 - PasswordField
 - ProgressiveDisplay
 - PropertyDisplay
 - PropertyEditor
 - Radio
 - RadioGroup
 - RemoveRowLink
 - RenderObject
 - Select
 - Submit
 - SubmitNotifier
 - TextArea
 - TextField
 - TextOutput
 - Trigger
 - Unless
 - Zone
 - cay/EntityField
 - cay/Select
 - cay/ToManyViewer
 - cay/ToOneEditor
 
 
  I am including the component library like:
 
  dependency
  groupIdorg.chenillekit/groupId
  artifactIdchenillekit-tapestry/artifactId
  version1.3.0/version
  /dependency
 
  Any ideas?
 
  Regards,
  Borut
 
 

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




Re: Context of a Zone

2011-01-11 Thread Josh Canfield
 but that just sets
 every price to the same thing as the row that is being updated. This
 is because the context of the row/event that triggered the updated
 doesn't provide the context for the zones that need to be updated.

Ah... static structure ;)

You have a single zone component and when doing a multi-zone update
you want to simulate a loop to get different content rendered for that
zone. I'm not sure there is a way to do this easily. It's definitely a
reasonable use case.

If your change is modifying all the prices, could you just re-draw the
whole table with an outer zone?

Josh


On Tue, Jan 11, 2011 at 9:35 AM, Mark mark-li...@xeric.net wrote:
 I have a form with a loop that looks something like this:

 |__QTY__|_ITEM__|__PRICE__|
 |__1_|_soup__|$1|
 |__3_|_peas__|$3|
 etc.

 Users can change the quantity and it automatically changes the price.
 Each price is in its own zone and the KeyUp action on the
 cooresponding QTY causes that price zone to update. (I'm using the
 zoneUpdater described at
 http://tinybits.blogspot.com/2010/03/new-and-better-zoneupdater.html)

 Now the requirements have changed and we need to be able to offer a
 discount based on the number of items being purchased.  This means
 that an update to the soup row will sometimes need to change not only
 the price soup row, but also the peas row. At first I tried building a
 MultiZoneUpdate (Thank you for your help Josh), but that just sets
 every price to the same thing as the row that is being updated. This
 is because the context of the row/event that triggered the updated
 doesn't provide the context for the zones that need to be updated. If
 I change the Qty of soup to 2, the soup item is the context for that
 update, so when I update the row for peas, that zone doesn't know
 anything about peas--only soup.

 So my question is:
 How can I access an item from the context when the zone was rendered
 instead of the context of the section that is triggering the zone
 update.

 It seems like I could solve this if each zone was rendered with a
 context that could be used when an update was triggered on that zone.
 Something like:
 t:zone t:context=item t:id=priceZone id=priceZoneId
 ${itemSubtotal}/t:zone

 The idea being, that when you update a zone, it can figure out the
 context at which the zone was originally created and not just the
 context of the event firing the update. (Of course I don't know how
 this would work on the Java side of things.)

 Is there a way to do something like this?  Is there a different way to
 do it that I've just overlooked and I'm making things harder than they
 need to be?

 Mark

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



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



Re: Tapestry 4.1 injecting the wrong application state object

2011-01-11 Thread Pepijn Schmitz

Hi,

Thanks! But I don't think that's it. We're already using HTTPS, but also 
that would not explain how the correct application state object can be 
on the HttpSession, even though Tapestry injected the wrong one...


We are using Apache 2 using mod_proxy as a front-end though. Apache 
takes care of the SSL and forwards the requests to Glassfish over HTTP. 
I'll look into the possibility that something is going wrong there, 
although it seems unlikely due to the above reason...


Cheers,
Pepijn

On 11-01-11 19:04, Koka Kiknadze wrote:

I did have exactly similar problem couple of years ago - JSF app worked fine
from intranet, but messed up user sessions when accessed from WAN side.

So initial suspect was the squid proxy configuration of our ISP. The problem
disappeared as soon as we turned encryption on for the whole site (so that
proxy could not mess things up). Well, as the performance was acceptable
even with HTTPS we just left everything as is.

Hence I'd suggest temporarily requiring HTTPS for the whole site and if the
problem disappears, you'll know for sure it's not your application or
tapestry to be blamed.

Good luck.




On Tue, Jan 11, 2011 at 8:37 PM, Pepijn Schmitztapes...@chaos.demon.nlwrote:


Hi everyone,

I'm having a bizarre problem with Tapestry, and I'm hoping someone here
might be able to point me to a solution. Before I go into detail I'd like to
describe the problem generally, in the hopes that it might be a known
problem or someone may have encountered something similar.

The problem is that Tapestry 4.1.6 sometimes injects the wrong application
state object on my pages! As you can imagine, this plays havoc with my
application, with users seeing other users' details, or even worse, changing
other users' information! It's a support and security nightmare.

I'm using Tapestry 4.1.6, and I'm using annotations instead of XML files.
My pages all descend from a base class:

public abstract SupplierDNAPage extends BasePage {
@InjectState
public abstract SupplierDnaSession getSupplierDnaSession();

@InjectStateFlag
public abstract boolean getSupplierDnaSessionExists();

...
}

hivemodule.xml contains the following:

?xml version=1.0 encoding=UTF-8?
module id=com.supplierdna version=0.0.0
contribution configuration-id=tapestry.state.ApplicationObjects
state-object name=supplier-dna-session scope=session
create-instance class=com.supplierdna.logic.SupplierDnaSession/
/state-object
/contribution
  ...
/module

SupplierDNA is the name of the company I'm writing this for. As I
understand it, this is the correct way of using application state objects.
And most of the time, it works perfectly. When testing locally I have no
problems with wrong application state being injected, and our demo system
also doesn't have the problem.

The problems seem to start when the server is heavily loaded. Then,
sometimes, getSupplierDnaSession() will return an application state object
from a different session!!!

I have verified this by adding a pageBeginRender() listener method to the
base class, and a client address property to the session. The listener
method checks whether the client address stored on the session it gets from
Tapestry is the same as the client address from the current request, and
throws an exception if this is not the case. On our production server, this
happens dozens of times a day!

The method also directly retrieves the application state object from the
HttpSession and compares it to the one it got from Tapestry, and it turns
out that the application state object on the HttpSession is the correct one,
but somehow Tapestry is injecting a different one! This seems to rule out
the web container as being the culprit (which is Glassfish 2 update 2, in
this case).

Obviously this is a complex problem with a potentially huge number of
contributing factors, but first I'd just like to know whether this sounds
familiar to anyone? Is there a known problem with Tapestry which could cause
this? Has anyone ever experienced something similar? Many thanks in advance
for any help you can give me!

Kind regards,
Pepijn Schmitz

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







smime.p7s
Description: S/MIME Cryptographic Signature


Re: chenillekit-tapestry 1.3.0 Unable to resolve 'chenillekit/TabSet'

2011-01-11 Thread Josh Canfield
Ah well... I guess I'm stunned and surprised :) Although, the JVM
defect mentioned in the link was supposedly fixed in JDK 1.4.1...

On Tue, Jan 11, 2011 at 11:03 AM, Borut Bolčina borut.bolc...@gmail.com wrote:
 Here is something to backup my claims:
 http://docs.codehaus.org/display/JETTY/Socket+reuse+on+Windows, but seems
 old.

 I can repeat this behaviour any time. No complaint about port already taken!
 I can start webapp A, then webapp B, browse to localhost:8080, it displays
 the webapp B, then I stop webapp B, hit refresh in the browser and
 immediately see webapp A.

 -Borut

 2011/1/11 Josh Canfield joshcanfi...@gmail.com

 I'd be stunned and surprised if your second instance was able to start
 on the same port. Try to do this intentionally and you should get a
 port already in use error on the second instance, is it possible you
 didn't notice the error? This isn't a Jetty thing, it's an OS thing,
 or more specifically TCP stack thing.

 Josh

 On Tue, Jan 11, 2011 at 6:46 AM, Borut Bolčina borut.bolc...@gmail.com
 wrote:
  Just not to leave this hanging...
 
  The problem has nothing to do with ChenilleKit nor with Tapestry - it is
  Jetty related. I run the application in the command line (mvn jetty:run)
 in
  Friday and forgot about it. Then I ran another instance within Eclipse,
 but
  the browser was still responding to the first instance.
 
  Can Jetty (or Jetty maven plugin) be configured not to start if the port
  (8080) is already in use? It is easy to start more than one instance of
 web
  app with Jetty on the same port. I am developing on Windows.
 
  -Borut
 
  2011/1/10 Borut Bolčina borut.bolc...@gmail.com
 
  Hi,
 
  just now I tried to use the TabSet component from chenillekit-tapestry
  1.3.0 with Tapestry 5.2.4. I am getting this
 
  Unable to resolve 'chenillekit/TabSet' to a component class name.
 
  When my application starts, it prints the available components and
 TabSet
  is one of them:
  chenillekit/TabSet: org.chenillekit.tapestry.core.components.TabSet
  and
  ck/TabSet: org.chenillekit.tapestry.core.components.TabSet
 
  I even looked inside the manifest of the chenillekit-tapestry jar and it
  seems ok.
 
  The error page however does not list the ck components:
 
  org.apache.tapestry5.ioc.util.UnknownValueException
  Unable to resolve 'chenillekit/TabSet' to a component class name.
  availableValues
 
  Component types:
 
     - ActionLink
     - AddRowLink
     - AjaxFormLoop
     - Any
     - BeanDisplay
     - BeanEditForm
     - BeanEditor
     - Checkbox
     - DateField
     - Delegate
     - Error
     - Errors
     - EventLink
     - ExceptionDisplay
     - Form
     - FormFragment
     - FormInjector
     - Grid
     - GridCell
     - GridColumns
     - GridPager
     - GridRows
     - Hidden
     - If
     - Label
     - Layout
     - LinkSubmit
     - Loop
     - Output
     - OutputRaw
     - PageLink
     - Palette
     - PasswordField
     - ProgressiveDisplay
     - PropertyDisplay
     - PropertyEditor
     - Radio
     - RadioGroup
     - RemoveRowLink
     - RenderObject
     - Select
     - Submit
     - SubmitNotifier
     - TextArea
     - TextField
     - TextOutput
     - Trigger
     - Unless
     - Zone
     - cay/EntityField
     - cay/Select
     - cay/ToManyViewer
     - cay/ToOneEditor
 
 
  I am including the component library like:
 
          dependency
              groupIdorg.chenillekit/groupId
              artifactIdchenillekit-tapestry/artifactId
              version1.3.0/version
          /dependency
 
  Any ideas?
 
  Regards,
  Borut
 
 

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




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



attn howard: live reloading breaking using jetty

2011-01-11 Thread Paul Stanton

Hi,

I've been using jetty with live reloading working just fine.

however i've just started using javascript files located in my 
src/main/resources dir via the @Import annotation:


@Import(library = MyScript.js)
public class MyPage
{}

src/main/resources/basepackage/pages/MyScript.js

After editing the js (between 2 and 5 times) I get a red cross on my 
project in eclipse and jetty is broken in that it can't respond to requests.


only after stopping jetty and doing a project clean can i get it to work 
again.


p.

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



Spring SymbolProvider breaks when upgrading from 5.1.0.5 to 5.2.4

2011-01-11 Thread Ólafur Freyr Hjálmsson
Hello


My application is using Hibernate for the database with Spring wired
services for business logic and Tapestry for the UI.

To customize the database access and image base url and the like, I use
multiple properties files for configuration, loaded from the filesystem or
classpath depending on which system should be accessed.

This is achieved by implementing a Spring PropertyPlaceholderConfigurer
which exposes properties using the expression syntax (${key}) for use in
applicationContext.xml.

Accessing these same properties in Tapestry is possible by implementing a
SymbolProvider and connect that to the SymbolSource in my AppModule.


This worked fine in Tapestry 5.1.0.5 using Spring 2.5.6 but broke down when
I upgraded to Tapestry 5.2.4 using Spring 3.0.5.

The workaround to use the servlet
context-param tapestry.use-external-spring-context works fine, but I would
like to understand why that is needed.


The closest I came to getting it to work without reporting errors was to
contribute to SymbolSource using this in my AppModule:


public static void
contributeSymbolSource(OrderedConfigurationSymbolProvider configuration,
ObjectLocator locator) {

configuration.add(SpringSymbolProvider,

locator.proxy(SymbolProvider.class, SpringSymbolProvider.class),

after:ApplicationDefaults);

}

This throws no exception and works but reports an error in the log:

ERROR 2011-01-11 20:03:03,179 [main] (OperationTrackerImpl.java:108) -
Construction of service 'ApplicationContext' has failed due to recursion:
the service depends on itself in some way. Please check
org.apache.tapestry5.ioc.internal.util.internalutil...@1341363e for
references to another service that is itself dependent on service
'ApplicationContext'.
ERROR 2011-01-11 20:03:03,179 [main] (OperationTrackerImpl.java:109) -
Operations trace:
ERROR 2011-01-11 20:03:03,180 [main] (OperationTrackerImpl.java:118) - [ 1]
Realizing service ApplicationContext
ERROR 2011-01-11 20:03:03,181 [main] (OperationTrackerImpl.java:118) - [ 2]
Invoking ObjectCreator for Spring ApplicationContext
ERROR 2011-01-11 20:03:03,181 [main] (OperationTrackerImpl.java:118) - [ 3]
Creating Spring ApplicationContext via ContextLoader
ERROR 2011-01-11 20:03:03,181 [main] (OperationTrackerImpl.java:118) - [ 4]
Autobuilding instance of class i.l.c.t.services.SpringSymbolProvider
ERROR 2011-01-11 20:03:03,181 [main] (OperationTrackerImpl.java:118) - [ 5]
Realizing service ApplicationContext

Seems like the Tapestry service ApplicationContext which provides access to
Spring beans depends on SpringSymbolProvider which uses ApplicationContext
to provide the Spring symbols. Catch-22.
Tapestry seems to recover from this and eventually instantiates the services
properly.

As far as I understand the clever use of proxy objects and on-demand
instantiation of Tapestry services, this should be possible if I can inject
the objects properly (correct order or use of @Inject or constructor
arguments).
The reason I think so is that the above errors appear when
SpringSymbolProvider accepts an ApplicationContext reference in
the constructor and uses that object to load the properties immediately
after which the object is discarded.

When instead using @Inject to instantiate an ApplicationContext member which
is used only when requesting a valueForSymbol, the properties don't get
translated and the following errors occur:

ERROR 2011-01-11 20:16:34,010 [main] (OperationTrackerImpl.java:108) -
Construction of service 'ApplicationContext' has failed due to recursion:
the service depends on itself in some way. Please check
org.apache.tapestry5.ioc.internal.util.internalutil...@62de76a1 for
references to another service that is itself dependent on service
'ApplicationContext'.
ERROR 2011-01-11 20:16:34,010 [main] (OperationTrackerImpl.java:109) -
Operations trace:
ERROR 2011-01-11 20:16:34,010 [main] (OperationTrackerImpl.java:118) - [ 1]
Realizing service ApplicationContext
ERROR 2011-01-11 20:16:34,011 [main] (OperationTrackerImpl.java:118) - [ 2]
Invoking ObjectCreator for Spring ApplicationContext
ERROR 2011-01-11 20:16:34,011 [main] (OperationTrackerImpl.java:118) - [ 3]
Creating Spring ApplicationContext via ContextLoader
ERROR 2011-01-11 20:16:34,011 [main] (OperationTrackerImpl.java:118) - [ 4]
Realizing service ApplicationContext

This strikes me as quite weird, ApplicationContext cannot be injected and no
exception is reported.

I would appreciate it if someone has any hints for me as I prefer to use the
more integrated approach.

Thanks in advance.
Regards, Óli


Re: attn howard: live reloading breaking using jetty

2011-01-11 Thread Howard Lewis Ship
Why attn: howard?

Version of Tapestry and operating system details, please.

On Tue, Jan 11, 2011 at 12:49 PM, Paul Stanton p...@mapshed.com.au wrote:

 Hi,

 I've been using jetty with live reloading working just fine.

 however i've just started using javascript files located in my
 src/main/resources dir via the @Import annotation:

 @Import(library = MyScript.js)
 public class MyPage
 {}

 src/main/resources/basepackage/pages/MyScript.js

 After editing the js (between 2 and 5 times) I get a red cross on my
 project in eclipse and jetty is broken in that it can't respond to requests.

 only after stopping jetty and doing a project clean can i get it to work
 again.

 p.

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




-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

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

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


Re: Context of a Zone

2011-01-11 Thread Mark
Thanks for your suggestion. It sounds like I'm not overlooking
anything obvious. :)  Redrawing the entire loop works with some
issues. I figured if it was capable of redrawing the entire loop then
I should be able to get access to what I need to redraw only certain
parts of it.

The problem I'm having with redrawing the whole loop is that now my
text field is part of what is being redrawn and this is introducing
two other issues:

1. All text fields update, which isn't desirable because it highlights
the entire table instead of just what changed. (My end goal was to
only update the zones that had changed.)

2. It also isn't ideal with a long list.

3. The text field loses focus after the first keyup so it is
impossible for anyone other than Superman to type more than one digit
before the text field loses focus.

I can live with items 1 and 2, but the prospects of only letting
Superman use this application are slim. So #3 is probably the big
issue.

I can't seem to tell the zone update to return focus to the last
updated field.  I'm using the javascript described here:
http://tinybits.blogspot.com/2010/03/new-and-better-zoneupdater.html)

And I've tried adding:
this.element.focus();
To the last line of updateZone : function() but it doesn't seem to do
anything.  I AM able to set the focus to a field that is outside of
the updated zone, so my guess is that the zone update is somehow
making it lose focus.

Any ideas?

Mark


On Tue, Jan 11, 2011 at 1:35 PM, Josh Canfield joshcanfi...@gmail.com wrote:

 You have a single zone component and when doing a multi-zone update
 you want to simulate a loop to get different content rendered for that
 zone. I'm not sure there is a way to do this easily. It's definitely a
 reasonable use case.

 If your change is modifying all the prices, could you just re-draw the
 whole table with an outer zone?

 Josh


 On Tue, Jan 11, 2011 at 9:35 AM, Mark mark-li...@xeric.net wrote:
 I have a form with a loop that looks something like this:

 |__QTY__|_ITEM__|__PRICE__|
 |__1_|_soup__|$1|
 |__3_|_peas__|$3|
 etc.

 Users can change the quantity and it automatically changes the price.
 Each price is in its own zone and the KeyUp action on the
 cooresponding QTY causes that price zone to update. (I'm using the
 zoneUpdater described at
 http://tinybits.blogspot.com/2010/03/new-and-better-zoneupdater.html)

 Now the requirements have changed and we need to be able to offer a
 discount based on the number of items being purchased.  This means
 that an update to the soup row will sometimes need to change not only
 the price soup row, but also the peas row. At first I tried building a
 MultiZoneUpdate (Thank you for your help Josh), but that just sets
 every price to the same thing as the row that is being updated. This
 is because the context of the row/event that triggered the updated
 doesn't provide the context for the zones that need to be updated. If
 I change the Qty of soup to 2, the soup item is the context for that
 update, so when I update the row for peas, that zone doesn't know
 anything about peas--only soup.

 So my question is:
 How can I access an item from the context when the zone was rendered
 instead of the context of the section that is triggering the zone
 update.

 It seems like I could solve this if each zone was rendered with a
 context that could be used when an update was triggered on that zone.
 Something like:
 t:zone t:context=item t:id=priceZone id=priceZoneId
 ${itemSubtotal}/t:zone

 The idea being, that when you update a zone, it can figure out the
 context at which the zone was originally created and not just the
 context of the event firing the update. (Of course I don't know how
 this would work on the Java side of things.)

 Is there a way to do something like this?  Is there a different way to
 do it that I've just overlooked and I'm making things harder than they
 need to be?

 Mark

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



Re: attn howard: live reloading breaking using jetty

2011-01-11 Thread Kalle Korhonen
I bet it's Windows and it's because Eclipse's not able to copy around
the resource files since they are locked. Simply *don't* copy them.
http://tynamo.org/Developing+with+Tomcat+and+Eclipse is for Tomcat but
same principles apply.

Kalle


On Tue, Jan 11, 2011 at 12:52 PM, Howard Lewis Ship hls...@gmail.com wrote:
 Why attn: howard?

 Version of Tapestry and operating system details, please.

 On Tue, Jan 11, 2011 at 12:49 PM, Paul Stanton p...@mapshed.com.au wrote:

 Hi,

 I've been using jetty with live reloading working just fine.

 however i've just started using javascript files located in my
 src/main/resources dir via the @Import annotation:

 @Import(library = MyScript.js)
 public class MyPage
 {}

 src/main/resources/basepackage/pages/MyScript.js

 After editing the js (between 2 and 5 times) I get a red cross on my
 project in eclipse and jetty is broken in that it can't respond to requests.

 only after stopping jetty and doing a project clean can i get it to work
 again.

 p.

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




 --
 Howard M. Lewis Ship

 Creator of Apache Tapestry

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

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


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



Re: attn howard: live reloading breaking using jetty

2011-01-11 Thread Paul Stanton
sorry, thought that was appropriate .. i thought you'd be interested - 
you always seem respond to 'reloading' questions.


On 12/01/2011 7:52 AM, Howard Lewis Ship wrote:

Why attn: howard?

Version of Tapestry and operating system details, please.

On Tue, Jan 11, 2011 at 12:49 PM, Paul Stantonp...@mapshed.com.au  wrote:


Hi,

I've been using jetty with live reloading working just fine.

however i've just started using javascript files located in my
src/main/resources dir via the @Import annotation:

@Import(library = MyScript.js)
public class MyPage
{}

src/main/resources/basepackage/pages/MyScript.js

After editing the js (between 2 and 5 times) I get a red cross on my
project in eclipse and jetty is broken in that it can't respond to requests.

only after stopping jetty and doing a project clean can i get it to work
again.

p.

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






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



Re: attn howard: live reloading breaking using jetty

2011-01-11 Thread Mark
You might try running mvn jetty:run from the command line and see if
the problem only happens in Eclipse?  I've been doing something
similar all day and haven't had any problem, but I don't run Jetty
from within Eclipse.

Mark

On Tue, Jan 11, 2011 at 2:49 PM, Paul Stanton p...@mapshed.com.au wrote:
 Hi,

 I've been using jetty with live reloading working just fine.

 however i've just started using javascript files located in my
 src/main/resources dir via the @Import annotation:

 @Import(library = MyScript.js)
 public class MyPage
 {}

 src/main/resources/basepackage/pages/MyScript.js

 After editing the js (between 2 and 5 times) I get a red cross on my project
 in eclipse and jetty is broken in that it can't respond to requests.

 only after stopping jetty and doing a project clean can i get it to work
 again.

 p.

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



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



Re: attn howard: live reloading breaking using jetty

2011-01-11 Thread Thiago H. de Paula Figueiredo
On Tue, 11 Jan 2011 19:09:54 -0200, Paul Stanton p...@mapshed.com.au  
wrote:


sorry, thought that was appropriate .. i thought you'd be interested -  
you always seem respond to 'reloading' questions.


Contrary to what some trolls love to say, Tapestry isn't a one-man  
project, so no need to ask for attention of just one of the team. ;)


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

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

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



Re: attn howard: live reloading breaking using jetty

2011-01-11 Thread Paul Stanton

Tapestry 5.2.4
Win XP
Eclipse 3.5
Jetty 7.2.1.v2010

i have my src/main/resources configured as a classpathentry

classpathentry kind=src path=src/main/resources/


On 12/01/2011 8:05 AM, Kalle Korhonen wrote:

I bet it's Windows and it's because Eclipse's not able to copy around
the resource files since they are locked. Simply *don't* copy them.
http://tynamo.org/Developing+with+Tomcat+and+Eclipse is for Tomcat but
same principles apply.

Kalle


On Tue, Jan 11, 2011 at 12:52 PM, Howard Lewis Shiphls...@gmail.com  wrote:

Why attn: howard?

Version of Tapestry and operating system details, please.

On Tue, Jan 11, 2011 at 12:49 PM, Paul Stantonp...@mapshed.com.au  wrote:


Hi,

I've been using jetty with live reloading working just fine.

however i've just started using javascript files located in my
src/main/resources dir via the @Import annotation:

@Import(library = MyScript.js)
public class MyPage
{}

src/main/resources/basepackage/pages/MyScript.js

After editing the js (between 2 and 5 times) I get a red cross on my
project in eclipse and jetty is broken in that it can't respond to requests.

only after stopping jetty and doing a project clean can i get it to work
again.

p.

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




--
Howard M. Lewis Ship

Creator of Apache Tapestry

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

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


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




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



Re: attn howard: live reloading breaking using jetty

2011-01-11 Thread Paul Stanton
dammit, it seems like it is my classpathentry .. removed that and i 
can't break the reloading.


not sure why this causes a problem .. it wouldn't be jetty locking the 
source files would it?


would jetty be locking the output files? (target/classes...)

would changing the classpathentry so that it has it's own 'output' 
location help?


i really like having a classpath entry as it flattens the view in the 
eclipse package explorer...


On 12/01/2011 8:14 AM, Paul Stanton wrote:

Tapestry 5.2.4
Win XP
Eclipse 3.5
Jetty 7.2.1.v2010

i have my src/main/resources configured as a classpathentry

classpathentry kind=src path=src/main/resources/


On 12/01/2011 8:05 AM, Kalle Korhonen wrote:

I bet it's Windows and it's because Eclipse's not able to copy around
the resource files since they are locked. Simply *don't* copy them.
http://tynamo.org/Developing+with+Tomcat+and+Eclipse is for Tomcat but
same principles apply.

Kalle


On Tue, Jan 11, 2011 at 12:52 PM, Howard Lewis 
Shiphls...@gmail.com  wrote:

Why attn: howard?

Version of Tapestry and operating system details, please.

On Tue, Jan 11, 2011 at 12:49 PM, Paul Stantonp...@mapshed.com.au  
wrote:



Hi,

I've been using jetty with live reloading working just fine.

however i've just started using javascript files located in my
src/main/resources dir via the @Import annotation:

@Import(library = MyScript.js)
public class MyPage
{}

src/main/resources/basepackage/pages/MyScript.js

After editing the js (between 2 and 5 times) I get a red cross on my
project in eclipse and jetty is broken in that it can't respond to 
requests.


only after stopping jetty and doing a project clean can i get it to 
work

again.

p.

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




--
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me 
to learn

how I can get you up and productive in Tapestry fast!

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


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




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




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



Re: attn howard: live reloading breaking using jetty

2011-01-11 Thread Thiago H. de Paula Figueiredo
Take a look at  
http://docs.codehaus.org/display/JETTY/Files+locked+on+Windows. One more  
reason for me using Linux for work and Windows just for the games I can't  
run on Linux. :)


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

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

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



Re: attn howard: live reloading breaking using jetty

2011-01-11 Thread Paul Stanton

my prev suspicion was correct ...

i've changed the output for the classpath entry to something arbitrary 
(other than 'target/classes') and it now seems to work fine.


thanks for the responses.

p.

On 12/01/2011 8:32 AM, Thiago H. de Paula Figueiredo wrote:
Take a look at 
http://docs.codehaus.org/display/JETTY/Files+locked+on+Windows. One 
more reason for me using Linux for work and Windows just for the games 
I can't run on Linux. :)




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



Re: Context of a Zone

2011-01-11 Thread Josh Canfield
 Thanks for your suggestion. It sounds like I'm not overlooking
 anything obvious. :)

Well, at least not obvious to me!

 Redrawing the entire loop works with some
 issues. I figured if it was capable of redrawing the entire loop then
 I should be able to get access to what I need to redraw only certain
 parts of it.

Yeah, I agree. I have to believe that given time we could come up with
an elegant solution...

 3. The text field loses focus after the first keyup so it is
 impossible for anyone other than Superman to type more than one digit
 before the text field loses focus.

Can you trigger the update via onchange instead of keyup? I'm not sure
how to keep the focus, or why it's being taken away...



On Tue, Jan 11, 2011 at 1:03 PM, Mark mark-li...@xeric.net wrote:
 Thanks for your suggestion. It sounds like I'm not overlooking
 anything obvious. :)  Redrawing the entire loop works with some
 issues. I figured if it was capable of redrawing the entire loop then
 I should be able to get access to what I need to redraw only certain
 parts of it.

 The problem I'm having with redrawing the whole loop is that now my
 text field is part of what is being redrawn and this is introducing
 two other issues:

 1. All text fields update, which isn't desirable because it highlights
 the entire table instead of just what changed. (My end goal was to
 only update the zones that had changed.)

 2. It also isn't ideal with a long list.

 3. The text field loses focus after the first keyup so it is
 impossible for anyone other than Superman to type more than one digit
 before the text field loses focus.

 I can live with items 1 and 2, but the prospects of only letting
 Superman use this application are slim. So #3 is probably the big
 issue.

 I can't seem to tell the zone update to return focus to the last
 updated field.  I'm using the javascript described here:
 http://tinybits.blogspot.com/2010/03/new-and-better-zoneupdater.html)

 And I've tried adding:
 this.element.focus();
 To the last line of updateZone : function() but it doesn't seem to do
 anything.  I AM able to set the focus to a field that is outside of
 the updated zone, so my guess is that the zone update is somehow
 making it lose focus.

 Any ideas?

 Mark


 On Tue, Jan 11, 2011 at 1:35 PM, Josh Canfield joshcanfi...@gmail.com wrote:

 You have a single zone component and when doing a multi-zone update
 you want to simulate a loop to get different content rendered for that
 zone. I'm not sure there is a way to do this easily. It's definitely a
 reasonable use case.

 If your change is modifying all the prices, could you just re-draw the
 whole table with an outer zone?

 Josh


 On Tue, Jan 11, 2011 at 9:35 AM, Mark mark-li...@xeric.net wrote:
 I have a form with a loop that looks something like this:

 |__QTY__|_ITEM__|__PRICE__|
 |__1_|_soup__|$1|
 |__3_|_peas__|$3|
 etc.

 Users can change the quantity and it automatically changes the price.
 Each price is in its own zone and the KeyUp action on the
 cooresponding QTY causes that price zone to update. (I'm using the
 zoneUpdater described at
 http://tinybits.blogspot.com/2010/03/new-and-better-zoneupdater.html)

 Now the requirements have changed and we need to be able to offer a
 discount based on the number of items being purchased.  This means
 that an update to the soup row will sometimes need to change not only
 the price soup row, but also the peas row. At first I tried building a
 MultiZoneUpdate (Thank you for your help Josh), but that just sets
 every price to the same thing as the row that is being updated. This
 is because the context of the row/event that triggered the updated
 doesn't provide the context for the zones that need to be updated. If
 I change the Qty of soup to 2, the soup item is the context for that
 update, so when I update the row for peas, that zone doesn't know
 anything about peas--only soup.

 So my question is:
 How can I access an item from the context when the zone was rendered
 instead of the context of the section that is triggering the zone
 update.

 It seems like I could solve this if each zone was rendered with a
 context that could be used when an update was triggered on that zone.
 Something like:
 t:zone t:context=item t:id=priceZone id=priceZoneId
 ${itemSubtotal}/t:zone

 The idea being, that when you update a zone, it can figure out the
 context at which the zone was originally created and not just the
 context of the event firing the update. (Of course I don't know how
 this would work on the Java side of things.)

 Is there a way to do something like this?  Is there a different way to
 do it that I've just overlooked and I'm making things harder than they
 need to be?

 Mark

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




Re: Context of a Zone

2011-01-11 Thread Mark
 Can you trigger the update via onchange instead of keyup? I'm not sure
 how to keep the focus, or why it's being taken away...

onChange will fire the update, but it requires the user move the focus
out of the changed textbox to do the update. Like I said this isn't
being designed for superman and the users probably aren't going to
understand why it didn't update at first and then miraculously updated
when they did something else.

It seems like this wouldn't be to extreme of a use case, so there must
be someway to get it to work.

Mark

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



Re: tapestry-auth

2011-01-11 Thread Taha Hafeez
Sorry... I had to forward it to someone else...

Taha


On Wed, Jan 12, 2011 at 9:21 AM, Taha Hafeez tawus.tapes...@gmail.comwrote:





Tapestry 5.1.0.5 and HTML 5 Doctype

2011-01-11 Thread Benny Law
I am trying to convert my pages to HTML5 but am having problem getting the
correct DOCTYPE to be output. The !DOCTYPE html I put in the .tml file is
ignored, and the generated HTML code has no DOCTYPE. I'm interested in how
people are working around this. Thanks.

Benny


Re: attn howard: live reloading breaking using jetty

2011-01-11 Thread Sven Homburg
since using tapestry, there is more time for gaming ;-)

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





2011/1/11 Thiago H. de Paula Figueiredo thiag...@gmail.com:
 Take a look at
 http://docs.codehaus.org/display/JETTY/Files+locked+on+Windows. One more
 reason for me using Linux for work and Windows just for the games I can't
 run on Linux. :)

 --
 Thiago H. de Paula Figueiredo
 Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and
 instructor
 Owner, Ars Machina Tecnologia da Informação Ltda.
 http://www.arsmachina.com.br

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



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