Modalbox Integration Example

2011-03-21 Thread Taha Hafeez
Hi

I recently required some modal window in my application and found this

http://okonet.ru/projects/modalbox/index.html

So, I thought of integrating it with tapestry and it was so easy.

Here is the code

import java.util.List;

import org.apache.tapestry5.BindingConstants;
import org.apache.tapestry5.ClientElement;
import org.apache.tapestry5.ComponentResources;
import org.apache.tapestry5.Link;
import org.apache.tapestry5.MarkupWriter;
import org.apache.tapestry5.annotations.Import;
import org.apache.tapestry5.annotations.Parameter;
import org.apache.tapestry5.annotations.SupportsInformalParameters;
import org.apache.tapestry5.ioc.annotations.Inject;
import org.apache.tapestry5.json.JSONObject;
import org.apache.tapestry5.services.PageRenderLinkSource;
import org.apache.tapestry5.services.javascript.JavaScriptSupport;

/**
 * ModalBox support for Tapestry5 Check ModalBox for
details
 * This component uses version 1.5.5
 *
 *
 */
@Import(library = { "modal/effects.js", "modal/builder.js",
  "modal/modalbox.js", "modal/modalboxinit.js" }, stylesheet =
"modal/modalbox.css")
@SupportsInformalParameters
public class ModalBox implements ClientElement {

   public static final String EVENT_TYPE = "event";
   public static final String PAGE_TYPE = "page";

   @Parameter(value = "componentResources.id", defaultPrefix =
BindingConstants.LITERAL)
   private String clientId;

   @Inject
   private JavaScriptSupport javaScriptSupport;

   private String assignedClientId;

   @Parameter(value = EVENT_TYPE, defaultPrefix = BindingConstants.LITERAL,
allowNull = false)
   private String type;

   @Parameter(value = "event", defaultPrefix = BindingConstants.LITERAL,
allowNull = false)
   private String event;

   @Parameter(value = "click", defaultPrefix = BindingConstants.LITERAL,
allowNull = false)
   private String clientEvent;

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

   @Inject
   private ComponentResources resources;

   @Inject
   private PageRenderLinkSource pageRenderLinkSource;

   @Parameter
   private List context;

   private Object[] contextArray;

   @Parameter(value = "false", defaultPrefix = BindingConstants.LITERAL)
   private boolean disabled;

   /**
* Setup render
*/
   void setupRender() {
  assignedClientId = javaScriptSupport.allocateClientId(clientId);
  contextArray = context == null ? new Object[] {} : context.toArray();

  if (!type.equals(EVENT_TYPE) && !type.equals(PAGE_TYPE)) {
 throw new RuntimeException("Parameter type can only be " +
EVENT_TYPE
   + " or " + PAGE_TYPE);
  }

  if (type.equals(PAGE_TYPE) && pageName == null) {
 throw new RuntimeException(
   "Parameter pageName cannot be null if parameter type is "
 + PAGE_TYPE);
  }
   }

   void beginRender(final MarkupWriter writer) {
  writer.element("a", "href", "#", "id", getClientId());
   }

   void afterRender(final MarkupWriter writer) {
  writer.end();

  if (disabled) {
 return;
  }

  final Link link;
  if (EVENT_TYPE.equalsIgnoreCase(type)) {
 link = resources.createEventLink(event, contextArray);
  } else { // if(PAGE_TYPE.equals(type)){
 System.out.println("Page Link");
 link =
pageRenderLinkSource.createPageRenderLinkWithContext(pageName,
   contextArray);
  }

  final JSONObject params = new JSONObject();
  for (String informalParameter : resources.getInformalParameterNames())
{
 params.put(informalParameter, resources.getInformalParameter(
   informalParameter, String.class));
  }

  final JSONObject spec = new JSONObject();
  spec.put("id", getClientId());
  spec.put("href", link.toAbsoluteURI());
  spec.put("event", clientEvent);
  spec.put("type", type);
  spec.put("params", params);
  javaScriptSupport.addScript("new ModalBoxInit(%s);", spec);

   }

   /**
* {@inheritDoc}
*/
   public String getClientId() {
  return assignedClientId;
   }

}


I have downloaded http://modalbox.googlecode.com/files/modalbox_1.5.5.zip
and extracted the lib folder as model folder

I have also added a small script for customization.

ModalBoxInit = Class.create( {

   /* Initialize Function */
   initialize : function(spec) {
  if (spec.type == "page") {
 Event.observe($(spec.id), spec.event, function() {
Modalbox.show(spec.href, spec.params);
 });
  } else {
 Event.observe($(spec.id), spec.event, function() {
Tapestry.ajaxRequest(spec.href, {
   method : 'get',
   onSuccess : function(transport) {
  var node = new
Element('div').update(transport.responseJSON.content);
  Modalbox.show(node, spec.params);
   }
}
);
 }
 );
  }
   }
});


Usage is simple


Template is



   Click To See
  

Re: Customizing the Layout Component

2011-03-21 Thread Barry Books
If you have a Blue/Red that inherit from BasePage I'd use a Layout 
Environmental. Since you have a BasePage you can create the Environmental in 
your BasePage class. The Red/Blue pages should be able to set the color 
property and then the layout component can retrieve it. That way only those 4 
classes need to know about it.

I'd provide an example but I'm typing this on my phone.

See Environmental Services in the docs. If you have trouble post back and I'll 
post and example when I get home. I usually create a Layout Envrionmental on my 
projects because I think it's easier than passing parms via the template.
-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: 5.1 : Available pages downgrade

2011-03-21 Thread Rich M
Thanks for the replies so far, they have been helpful. I will be looking 
into both the application server's maintenance of the /tmp folder - 
where it does seem Jetty is unpacking the WAR - as well as the memory 
usage of the application and optimizations for that.


The production version is frozen at 5.1.0.15 unfortunately, but I 
recently begun development on the next release version. That, coinciding 
with the release of ChenilleKit for 5.2.4, has allowed me to 
successfully upgrade the next version to 5.2.4, which I'm very excited 
about.


Thanks,
Rich

On 03/21/2011 02:17 PM, Thiago H. de Paula Figueiredo wrote:
Using 5.2.4 will help, as the memory consumption is lowered by not 
using a page pool anymore.


On Mon, 21 Mar 2011 14:51:01 -0300, Kalle Korhonen 
 wrote:



I can confirm I've seen similar behavior on Jetty. It's linked to heap
space running out and in my case it was directly related to sending
huge amounts gzipped form data. See related Jetty issue at
http://jira.codehaus.org/browse/JETTY-1167 and my comments there.
Apparently Jetty in some cases shuts down the application in order to
keep the container running, after which you'd see the behavior you
described. Adjust jvm settings and allocate more memory to your
process. Allocate enough until the whole process dies (if you are on
Linux platform - especially virtualized with no swap space, the OOM
killer will shut down the JVM way before your process consumes all of
the available RAM). Then investigate if any of your forms are
reserving a high amount of memory, possibly play with other JVM
settings and *if* you are sending a lot of gzipped data, turn gzipping
off and see if it makes a difference.

Kalle


On Mon, Mar 21, 2011 at 8:21 AM, Rich M  wrote:

Hi,

I've been running a production version of a tapestry application for a
couple months now. Just the other day it was reported to me that the
application was no longer resolving pages normally, but instead 
displaying a

directory view from the root context.

Restarting the application solved the problem, but I'm at a loss as 
to the

cause. Looking through the application logs, the only unusual logging I
noticed was that sometime during the timeframe in which the problem was
expected to occur, the TapestryModule.ComponentClassResolver fired 
off 3

lines of logging similar to when you execute the start-up of a Tapestry
application.

Namely, it displayed lists of available pages, available components, 
and
available mixins. The list of available pages was significantly 
reduced from

the actual pages within the application. It seemed like an at-random
mini-subset of the actual pages in the application. There is nothing to
indicate someone had tried to start/restart the application again or
anything along those lines.

Considering the minimal amount of information I have at hand, I was 
curious
to know if this ComponentClassResolver issue might look familiar to 
anyone?
Or perhaps at least an idea of what might cause the 
ComponentClassResolver
to behave as it had so I can follow up with a code review of my 
application?

I run the application in a standalone Jetty 6.1.26 as a WAR deployment.

Thanks,
Rich


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




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







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



Re: google bot caches pages results in component not found errors

2011-03-21 Thread anton.litvinenko
Thanks! Filed as  https://issues.apache.org/jira/browse/TAP5-1481
https://issues.apache.org/jira/browse/TAP5-1481 

--
View this message in context: 
http://tapestry-users.832.n2.nabble.com/google-bot-caches-pages-results-in-component-not-found-errors-tp6191675p6193820.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: Customizing the Layout Component

2011-03-21 Thread Thiago H. de Paula Figueiredo
On Mon, 21 Mar 2011 15:22:30 -0300, stephanos2k  
 wrote:



Thanks for the quick response!
Hm, I didn't know that this would break the class hierarchy.


It doesn't.


I understand the issue like this (hope it works in HTML/Mail):
Layout.tml > Page.tml --> Result <-- Page.java < BasePageRed.java <


It's not correct. Layout is rendered inside Page, not the opposite. Layout  
is a component as any other and it's being used as part of the Page  
template.


I am far from completely grasping what goes on when Tapestry renders,  
but I though the tmls ('left') and classes ('right') are merged somehow.


There's no merge.

I assumed I could tell Layout to 'expect' a Parameter coming from the  
class side.



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: Customizing the Layout Component

2011-03-21 Thread stephanos2k
Thanks for the quick response!
Hm, I didn't know that this would break the class hierarchy.

I understand the issue like this (hope it works in HTML/Mail):
Layout.tml > Page.tml --> Result <-- Page.java < BasePageRed.java <
BasePage.java
 [read P]  
[Set P]  [Declare P]

I am far from completely grasping what goes on when Tapestry renders, but I
though the tmls ('left') and classes ('right') are merged somehow. 
I assumed I could tell Layout to 'expect' a Parameter coming from the class
side. 
Alternatively, setting the parameter in every Page.tml (few dozen) just
didn't seem so 'DRY'.

But your solution sounds very reasonable - I was just wondering :-)

Cheers

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Customizing-the-Layout-Component-tp4234938p4235829.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: 5.1 : Available pages downgrade

2011-03-21 Thread Thiago H. de Paula Figueiredo
Using 5.2.4 will help, as the memory consumption is lowered by not using a  
page pool anymore.


On Mon, 21 Mar 2011 14:51:01 -0300, Kalle Korhonen  
 wrote:



I can confirm I've seen similar behavior on Jetty. It's linked to heap
space running out and in my case it was directly related to sending
huge amounts gzipped form data. See related Jetty issue at
http://jira.codehaus.org/browse/JETTY-1167 and my comments there.
Apparently Jetty in some cases shuts down the application in order to
keep the container running, after which you'd see the behavior you
described. Adjust jvm settings and allocate more memory to your
process. Allocate enough until the whole process dies (if you are on
Linux platform - especially virtualized with no swap space, the OOM
killer will shut down the JVM way before your process consumes all of
the available RAM). Then investigate if any of your forms are
reserving a high amount of memory, possibly play with other JVM
settings and *if* you are sending a lot of gzipped data, turn gzipping
off and see if it makes a difference.

Kalle


On Mon, Mar 21, 2011 at 8:21 AM, Rich M  wrote:

Hi,

I've been running a production version of a tapestry application for a
couple months now. Just the other day it was reported to me that the
application was no longer resolving pages normally, but instead  
displaying a

directory view from the root context.

Restarting the application solved the problem, but I'm at a loss as to  
the

cause. Looking through the application logs, the only unusual logging I
noticed was that sometime during the timeframe in which the problem was
expected to occur, the TapestryModule.ComponentClassResolver fired off 3
lines of logging similar to when you execute the start-up of a Tapestry
application.

Namely, it displayed lists of available pages, available components, and
available mixins. The list of available pages was significantly reduced  
from

the actual pages within the application. It seemed like an at-random
mini-subset of the actual pages in the application. There is nothing to
indicate someone had tried to start/restart the application again or
anything along those lines.

Considering the minimal amount of information I have at hand, I was  
curious
to know if this ComponentClassResolver issue might look familiar to  
anyone?
Or perhaps at least an idea of what might cause the  
ComponentClassResolver
to behave as it had so I can follow up with a code review of my  
application?

I run the application in a standalone Jetty 6.1.26 as a WAR deployment.

Thanks,
Rich


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




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




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

Owner, Ars Machina Tecnologia da Informação Ltda.
Consultor, desenvolvedor e instrutor em Java, Tapestry e Hibernate
Coordenador e professor da Especialização em Engenharia de Software com  
Ênfase em Java da Faculdade Pitágoras

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: 5.1 : Available pages downgrade

2011-03-21 Thread Kalle Korhonen
I can confirm I've seen similar behavior on Jetty. It's linked to heap
space running out and in my case it was directly related to sending
huge amounts gzipped form data. See related Jetty issue at
http://jira.codehaus.org/browse/JETTY-1167 and my comments there.
Apparently Jetty in some cases shuts down the application in order to
keep the container running, after which you'd see the behavior you
described. Adjust jvm settings and allocate more memory to your
process. Allocate enough until the whole process dies (if you are on
Linux platform - especially virtualized with no swap space, the OOM
killer will shut down the JVM way before your process consumes all of
the available RAM). Then investigate if any of your forms are
reserving a high amount of memory, possibly play with other JVM
settings and *if* you are sending a lot of gzipped data, turn gzipping
off and see if it makes a difference.

Kalle


On Mon, Mar 21, 2011 at 8:21 AM, Rich M  wrote:
> Hi,
>
> I've been running a production version of a tapestry application for a
> couple months now. Just the other day it was reported to me that the
> application was no longer resolving pages normally, but instead displaying a
> directory view from the root context.
>
> Restarting the application solved the problem, but I'm at a loss as to the
> cause. Looking through the application logs, the only unusual logging I
> noticed was that sometime during the timeframe in which the problem was
> expected to occur, the TapestryModule.ComponentClassResolver fired off 3
> lines of logging similar to when you execute the start-up of a Tapestry
> application.
>
> Namely, it displayed lists of available pages, available components, and
> available mixins. The list of available pages was significantly reduced from
> the actual pages within the application. It seemed like an at-random
> mini-subset of the actual pages in the application. There is nothing to
> indicate someone had tried to start/restart the application again or
> anything along those lines.
>
> Considering the minimal amount of information I have at hand, I was curious
> to know if this ComponentClassResolver issue might look familiar to anyone?
> Or perhaps at least an idea of what might cause the ComponentClassResolver
> to behave as it had so I can follow up with a code review of my application?
> I run the application in a standalone Jetty 6.1.26 as a WAR deployment.
>
> Thanks,
> Rich
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

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



Re: Customizing the Layout Component

2011-03-21 Thread Thiago H. de Paula Figueiredo
On Mon, 21 Mar 2011 14:27:35 -0300, stephanos2k  
 wrote:


In my Layout I'd like to distinguish between 2 states (let's just say  
red or blue). Those are known/set by each page individually - it  
inherits from BasePageRed or BasePageBlue (which go back to BasePage  
where the parameter Col is

defined).
How do I 'get' the parameter value from the BasePage (class) to the  
Layout (tml)?
PS: I am aware that I can set the parameter in Page.tml - but I don't  
want to repeat myself in each file.


Abusing class hierarchy, for me, is way worse than adding a single  
parameter to a component use.
Another option (preferred) is to define an annotation and use  
ComponentResources.getPage() to get the page instance and check if that  
annotation is there or not.


--
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: [newbie] I cannot export my tapestry app

2011-03-21 Thread Nikola Milikic
Hi,

Thank Nikola, it works .. I use "mvn package" command on my suse terminal
> n it makes war file on target project :D


That's great!

because on my eclipse it just looks ->Run As->Run On Server | Java Applet |
> bla bla ..
> there's no Maven package menu.. indeed I ever install maven plugin for
> eclipse but I have failed installation.
> For information I use eclipse Helios 3.6.1..and until now I cannt install
> it
> :) where is the match repo for  maven plugin to my eclipse ?


This should be a matter of some other mailing list, so sorry to others.

Nevertheless, I'll be glad to help you. Obviously, you don't have maven
plugin. I use m2eclipse  and you can get it
from its update site http://m2eclipse.sonatype.org/sites/m2e

Best,
Nikola


On Sun, Mar 20, 2011 at 1:44 AM, ronizedsynch  wrote:

> Thank Nikola, it works .. I use "mvn package" command on my suse terminal n
> it makes war file on target project :D
>
> but I dont can do this
>
> Nikola Milikic wrote:
> >
> > Just right click on the project -> Run As -> Maven package.
> >
>
> because on my eclipse it just looks ->Run As->Run On Server | Java Applet |
> bla bla ..
> there's no Maven package menu.. indeed I ever install maven plugin for
> eclipse but I have failed installation.
> For information I use eclipse Helios 3.6.1..and until now I cannt install
> it
> :) where is the match repo for  maven plugin to my eclipse ?
>
> Ok.. thank all for your attentions :D
>
>
>
> --
> View this message in context:
> http://tapestry.1045711.n5.nabble.com/newbie-I-cannot-export-my-tapestry-app-tp4022063p4095695.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Customizing the Layout Component

2011-03-21 Thread stephanos2k
In my Layout I'd like to distinguish between 2 states (let's just say red or
blue). 
Those are known/set by each page individually - it inherits from BasePageRed
or BasePageBlue (which go back to BasePage where the parameter Col is
defined).

How do I 'get' the parameter value from the BasePage (class) to the Layout
(tml)?

PS: I am aware that I can set the parameter in Page.tml - but I don't want
to repeat myself in each file.

Cheers,
Stephanos

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Customizing-the-Layout-Component-tp4234938p4234938.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: 5.1 : Available pages downgrade

2011-03-21 Thread Cezary Biernacki
Hi,
on Linux or other Unix-like system, one possibility is that Jetty unpacked
your WAR to /tmp and tmpwatch or something similar removed some not recently
used files.

Cezary


On Mon, Mar 21, 2011 at 4:21 PM, Rich M  wrote:

> Hi,
>
> I've been running a production version of a tapestry application for a
> couple months now. Just the other day it was reported to me that the
> application was no longer resolving pages normally, but instead displaying a
> directory view from the root context.
>
> Restarting the application solved the problem, but I'm at a loss as to the
> cause. Looking through the application logs, the only unusual logging I
> noticed was that sometime during the timeframe in which the problem was
> expected to occur, the TapestryModule.ComponentClassResolver fired off 3
> lines of logging similar to when you execute the start-up of a Tapestry
> application.
>
> Namely, it displayed lists of available pages, available components, and
> available mixins. The list of available pages was significantly reduced from
> the actual pages within the application. It seemed like an at-random
> mini-subset of the actual pages in the application. There is nothing to
> indicate someone had tried to start/restart the application again or
> anything along those lines.
>
> Considering the minimal amount of information I have at hand, I was curious
> to know if this ComponentClassResolver issue might look familiar to anyone?
> Or perhaps at least an idea of what might cause the ComponentClassResolver
> to behave as it had so I can follow up with a code review of my application?
> I run the application in a standalone Jetty 6.1.26 as a WAR deployment.
>
> Thanks,
> Rich
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: 5.1 : Available pages downgrade

2011-03-21 Thread Howard Lewis Ship
This is a troubling mystery, and doesn't sound familiar at all.

On Mon, Mar 21, 2011 at 8:21 AM, Rich M  wrote:
> Hi,
>
> I've been running a production version of a tapestry application for a
> couple months now. Just the other day it was reported to me that the
> application was no longer resolving pages normally, but instead displaying a
> directory view from the root context.
>
> Restarting the application solved the problem, but I'm at a loss as to the
> cause. Looking through the application logs, the only unusual logging I
> noticed was that sometime during the timeframe in which the problem was
> expected to occur, the TapestryModule.ComponentClassResolver fired off 3
> lines of logging similar to when you execute the start-up of a Tapestry
> application.
>
> Namely, it displayed lists of available pages, available components, and
> available mixins. The list of available pages was significantly reduced from
> the actual pages within the application. It seemed like an at-random
> mini-subset of the actual pages in the application. There is nothing to
> indicate someone had tried to start/restart the application again or
> anything along those lines.
>
> Considering the minimal amount of information I have at hand, I was curious
> to know if this ComponentClassResolver issue might look familiar to anyone?
> Or perhaps at least an idea of what might cause the ComponentClassResolver
> to behave as it had so I can follow up with a code review of my application?
> I run the application in a standalone Jetty 6.1.26 as a WAR deployment.
>
> Thanks,
> Rich
>
>
> -
> 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



5.1 : Available pages downgrade

2011-03-21 Thread Rich M

Hi,

I've been running a production version of a tapestry application for a 
couple months now. Just the other day it was reported to me that the 
application was no longer resolving pages normally, but instead 
displaying a directory view from the root context.


Restarting the application solved the problem, but I'm at a loss as to 
the cause. Looking through the application logs, the only unusual 
logging I noticed was that sometime during the timeframe in which the 
problem was expected to occur, the TapestryModule.ComponentClassResolver 
fired off 3 lines of logging similar to when you execute the start-up of 
a Tapestry application.


Namely, it displayed lists of available pages, available components, and 
available mixins. The list of available pages was significantly reduced 
from the actual pages within the application. It seemed like an 
at-random mini-subset of the actual pages in the application. There is 
nothing to indicate someone had tried to start/restart the application 
again or anything along those lines.


Considering the minimal amount of information I have at hand, I was 
curious to know if this ComponentClassResolver issue might look familiar 
to anyone? Or perhaps at least an idea of what might cause the 
ComponentClassResolver to behave as it had so I can follow up with a 
code review of my application? I run the application in a standalone 
Jetty 6.1.26 as a WAR deployment.


Thanks,
Rich


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



Re: Select dropdown in grid

2011-03-21 Thread Thiago H. de Paula Figueiredo
On Mon, 21 Mar 2011 10:26:09 -0300, nquirynen  
 wrote:

Any ideas on how I can get the value of the select component in the
actionlink its event?
Or maybe an idea on how to achieve what I want to do in another way?


See the last example in  
http://tapestry.apache.org/current/tapestry-core/ref/org/apache/tapestry5/corelib/components/Select.html.


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



Select dropdown in grid

2011-03-21 Thread nquirynen
I have a grid where i can choose which row i want to edit.
When chosen a row it renders the row with a select in one of the columns
instead of the objects value. This select contains all possible values for
this property.
After choosing an option you can click a actionlink in the row to save this
row.
In the event from this actionlink I want to get the chosen value in this
select to use it to change the objects property and save it to the database.

The problem: 
The value variable of the select component is set after my actionlinks event
where i need the value already

Any ideas on how I can get the value of the select component in the
actionlink its event?
Or maybe an idea on how to achieve what I want to do in another way?

Thanks

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Select-dropdown-in-grid-tp4227978p4227978.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: google bot caches pages results in component not found errors

2011-03-21 Thread Thiago H. de Paula Figueiredo

Hi!

Please file a JIRA about it. That's a very good idea. :)

On Mon, 21 Mar 2011 07:07:37 -0300, anton.litvinenko  
 wrote:



Hey!

I have an app (devpulse.com) in Tapestry 5.1 which was indexed by Google
bot. Some pages got cached and google uses this cached version to post
requests. Recently, we have renamed one of the components and now all  
those
requests containing the old name/id of the component result in errors on  
the
Tapestry side (as Tapestry is not able find the component on the page  
with

such id). Application crashes with error and google bot is served with
overridden tapestry error page.

I know that this could be solved by either creating robots.txt and  
marking
those requests as forbidden or by creating a filter to rewrite those  
URLs to

be valid. But I found these solutions as workarounds.

Instead I would like to be able to handle such cases separately and serve
google bot (or user) with 404 page. Unfortunately, at the moment there  
is no

way to distinguish between component not found exception and any other
Tapestry exception as a generic TapestryException is thrown:

throw new TapestryException(StructureMessages.noSuchComponent(this,
embeddedId, ids), this, null);  (ComponentPageElementImpl:841).

I wonder, would such improvement make sense and if so I'll be happy to  
add

it to Jira or/and even implement it myself under someone's supervision.

--
View this message in context:  
http://tapestry-users.832.n2.nabble.com/google-bot-caches-pages-results-in-component-not-found-errors-tp6191675p6191675.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




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

Owner, Ars Machina Tecnologia da Informação Ltda.
Consultor, desenvolvedor e instrutor em Java, Tapestry e Hibernate
Coordenador e professor da Especialização em Engenharia de Software com  
Ênfase em Java da Faculdade Pitágoras

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: How to implement nested components?

2011-03-21 Thread Thiago H. de Paula Figueiredo

On Sun, 20 Mar 2011 22:50:20 -0300, leon  wrote:

Thanks a lot, I will try it, I looks Tapestry's component's relationship  
is build by component class rather than component template.


Wrong. It's defined by template. Using @InjectComponent or  
getEmbeddedComponent() is just a way of getting the nested component  
instance.



So, are there some dos about this?


Could you rephrase your question?

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



google bot caches pages results in component not found errors

2011-03-21 Thread anton.litvinenko
Hey!

I have an app (devpulse.com) in Tapestry 5.1 which was indexed by Google
bot. Some pages got cached and google uses this cached version to post
requests. Recently, we have renamed one of the components and now all those
requests containing the old name/id of the component result in errors on the
Tapestry side (as Tapestry is not able find the component on the page with
such id). Application crashes with error and google bot is served with
overridden tapestry error page.

I know that this could be solved by either creating robots.txt and marking
those requests as forbidden or by creating a filter to rewrite those URLs to
be valid. But I found these solutions as workarounds.

Instead I would like to be able to handle such cases separately and serve
google bot (or user) with 404 page. Unfortunately, at the moment there is no
way to distinguish between component not found exception and any other
Tapestry exception as a generic TapestryException is thrown:

throw new TapestryException(StructureMessages.noSuchComponent(this,
embeddedId, ids), this, null);  (ComponentPageElementImpl:841).

I wonder, would such improvement make sense and if so I'll be happy to add
it to Jira or/and even implement it myself under someone's supervision.

--
View this message in context: 
http://tapestry-users.832.n2.nabble.com/google-bot-caches-pages-results-in-component-not-found-errors-tp6191675p6191675.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: T5.1 and Tynamo Security: override a Shiro Filter

2011-03-21 Thread anton.litvinenko
Damn, I only now find out that I have replies to my question.

Kalle, I have an app that sometimes (depending on some conf init parameter)
should use the typical login "inapp" sequence (tapestry login page and out
of the box tapestry-shiro integration) but at other times the authentication
should be handled by apache that proxies jee container and auth info is
passed as XX header.

So in one case I don't need any conf file at all and in the second i need a
shiro.ini file to overrride default authc filter and also to mark number of
URLs to be accessible by anonymous users:

[main]
authc=com.programeter.web.filters.RemoteUserAuhtenticationFilter

[urls]
/assets/**=anon
/register*=anon
/register/**=anon
/unauthorized*=anon
/unauthorized/**=anon
/changepassword*=anon
/changepassword/**=anon
/remindpassword*=anon
/remindpassword/**=anon
/**=authc

Kalle, thanks for raising this in Jira -> will vote and follow it!

--
View this message in context: 
http://tapestry-users.832.n2.nabble.com/T5-1-and-Tynamo-Security-override-a-Shiro-Filter-tp5769989p6191642.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