RE: How to observe property binding events
OK, let's get to brass tacks. I have some derived values that are somewhat expensive to compute so I compute them once per request/response cycle and then they're in local instance variables (non-persisted). The particular component in question (with the semi-expensive derived values) is used inside a loop and so may appear multiple times on a page. By default the first time I use the component I compute the value and then display from that computed value... The 2nd, 3rd, etc instance of those component on the page is actually the exact same Java instance and so the computed/derived ivar is still set. I've added a hack that records an original property value when the derived ivar is computed and if the original and current property values don't match I reset the derived ivar. It works, but it a total hack. The common way I'd imagine doing it is to listen to when the property (parameter) is set by Tapestry. But now that I've lain out the use case maybe some knows the right way to do this in Tapestry. Thanks, Ezra Epstein -Original Message- From: Jesse Kuhnert [mailto:[EMAIL PROTECTED] Sent: Monday, October 09, 2006 3:33 PM To: Tapestry users Subject: Re: How to observe property binding events There's also the org.apache.tapestry.event.ChangeObserver interface, though this is currently only used by the services in tapestry.persist to observe page property changes when they are being managed via a particular persistence strategy. (like session/client/etc..) ~Maybe~ it's an oversight, and maybe not..I guess that depends on what/why you are trying to do. You'll find that there is very little in the framework that wasn't put there for an actual need, so adding in support for things that no one has needed yet doesn't seem to fall in line with sound design. (imho of course..) If you can outline why you need this, and exactly what properties/conditions you'd want to observe we might be able to work something out...A general anything is harder to understand / design around. There is no such thing as a parameter property listener because parameters have no meaning in the context of something taking a parameter...There has to be a source for that parameter value (usually a page ) somewhere. On 10/9/06, Epstein, Ezra [EMAIL PROTECTED] wrote: Hi Jesse, Thanks for that reply. If I read it correctly, it sounds, simply, like the framework is missing this feature. It's a pretty common thing to ask for listener call-backs on framework events. (Listener here in the generic sense rather than the way tapestry uses the term for direct-link targets.) In short, this sounds like a design over-sight. It's common when beans are bound to be able to receive a call-back -- Hibernate, for example, offers this. So much of Tapestry seems automagic I'm surprised that there's no way to register to be informed of the events as they occur. If Howard's reading this perhaps he has a better perspective that he may offer. Thanks, Ezra Epstein Amazon.com - Developer Tools 206-266-2259 -Original Message- From: Jesse Kuhnert [mailto:[EMAIL PROTECTED] Sent: Friday, October 06, 2006 7:22 PM To: Tapestry users Subject: Re: How to observe property binding events Yes, but the usefulness of my answer largely depends on how clever/efficient you are trying to be doing it. Now, there is IBinding. The one object to bind them all ;) If you work your way down the type hierarchy you'll find AbstractBinding, which holds the method you care about most - setObject. This will be called by tapestry when managing all of the page properties automagically for you. Some of the magic happens in (for your exact case at least) org.apache.tapestry.enhance.ParameterPropertyWorker. The other half of the work happens in each specific binding implementation that will handle these set/get object calls..(Like ognl bindings, etc..) I'm not sure where you are going with this but I guess you could use the hivemind chain of command service sort of configuration (like I did for org.apache.tapestry.services.ComponentRenderWorker ) to generically call a single interface method for a hivemind configuration point...Then you can contribute as many workers into the chain you like if you decide that you have more than one use for it. Again...Not knowing what you are doing - and taking the exact parameters given I'd probably extend and override the default ParameterPropertyWorker (a hivemind service, so replacing it inline with what Tapestry does already should be easy ) and just override whatever section of code I needed to in that implementation to inject + call my service reference. It may look a little complicated in there at first, but the whole org.apache.tapestry.enhance package is filled with lots of different enhancement works - and most of them inject a service into the object they work on...So finding an easier to follow
RE: How to observe property binding events
Also, that title should have been parameter binding events not (generic) property. The situation I have occurs when the framework sets the parameter on a Component. Thanks, Ezra Epstein -Original Message- From: Epstein, Ezra [mailto:[EMAIL PROTECTED] Sent: Monday, October 09, 2006 3:00 PM To: Tapestry users Subject: RE: How to observe property binding events Hi Jesse, Thanks for that reply. If I read it correctly, it sounds, simply, like the framework is missing this feature. It's a pretty common thing to ask for listener call-backs on framework events. (Listener here in the generic sense rather than the way tapestry uses the term for direct-link targets.) In short, this sounds like a design over-sight. It's common when beans are bound to be able to receive a call-back -- Hibernate, for example, offers this. So much of Tapestry seems automagic I'm surprised that there's no way to register to be informed of the events as they occur. If Howard's reading this perhaps he has a better perspective that he may offer. Thanks, Ezra Epstein Amazon.com - Developer Tools 206-266-2259 -Original Message- From: Jesse Kuhnert [mailto:[EMAIL PROTECTED] Sent: Friday, October 06, 2006 7:22 PM To: Tapestry users Subject: Re: How to observe property binding events Yes, but the usefulness of my answer largely depends on how clever/efficient you are trying to be doing it. Now, there is IBinding. The one object to bind them all ;) If you work your way down the type hierarchy you'll find AbstractBinding, which holds the method you care about most - setObject. This will be called by tapestry when managing all of the page properties automagically for you. Some of the magic happens in (for your exact case at least) org.apache.tapestry.enhance.ParameterPropertyWorker. The other half of the work happens in each specific binding implementation that will handle these set/get object calls..(Like ognl bindings, etc..) I'm not sure where you are going with this but I guess you could use the hivemind chain of command service sort of configuration (like I did for org.apache.tapestry.services.ComponentRenderWorker ) to generically call a single interface method for a hivemind configuration point...Then you can contribute as many workers into the chain you like if you decide that you have more than one use for it. Again...Not knowing what you are doing - and taking the exact parameters given I'd probably extend and override the default ParameterPropertyWorker (a hivemind service, so replacing it inline with what Tapestry does already should be easy ) and just override whatever section of code I needed to in that implementation to inject + call my service reference. It may look a little complicated in there at first, but the whole org.apache.tapestry.enhance package is filled with lots of different enhancement works - and most of them inject a service into the object they work on...So finding an easier to follow worker to reference before modifying ParameterPropertyWorker might be easier. Hope that helps. On 10/6/06, Epstein, Ezra [EMAIL PROTECTED] wrote: I've got a component which accepts a parameter. I want to listen (receive a callback) when the parameter is set (bound). Does Tapestry provide such a facility? Thanks, Ezra Epstein -- Jesse Kuhnert Tapestry/Dojo/(and a dash of TestNG), team member/developer Open source based consulting work centered around dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to observe property binding events
That's the opposite of the functionality I want. These are not PER request. They are per instance of a component. Thus true instance variables are the way to go. Tapestry recycles Components and it seems that within a request the same component is re-used but not cleared (ivars reset) even though it is re-parametrized. So, I don't think request vars would work. Thanks, Ezra Epstein Amazon.com - Developer Tools 206-266-2259 -Original Message- From: andyhot [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 10, 2006 12:35 AM To: Tapestry users Subject: Re: How to observe property binding events Why store them in local variables? Store it in the current request cycle... First do a cycle.getAttribute(myexpensivevar) if that returns null, do the computations and store the result back cycle.setAttribute(myexpensivevar,obj); See http://tapestry.apache.org/tapestry4/tapestry/apidocs/org/apache/tapestry/IRequestCycle.html Epstein, Ezra wrote: OK, let's get to brass tacks. I have some derived values that are somewhat expensive to compute so I compute them once per request/response cycle and then they're in local instance variables (non-persisted). The particular component in question (with the semi-expensive derived values) is used inside a loop and so may appear multiple times on a page. By default the first time I use the component I compute the value and then display from that computed value... The 2nd, 3rd, etc instance of those component on the page is actually the exact same Java instance and so the computed/derived ivar is still set. I've added a hack that records an original property value when the derived ivar is computed and if the original and current property values don't match I reset the derived ivar. It works, but it a total hack. The common way I'd imagine doing it is to listen to when the property (parameter) is set by Tapestry. But now that I've lain out the use case maybe some knows the right way to do this in Tapestry. Thanks, Ezra Epstein -Original Message- From: Jesse Kuhnert [mailto:[EMAIL PROTECTED] Sent: Monday, October 09, 2006 3:33 PM To: Tapestry users Subject: Re: How to observe property binding events There's also the org.apache.tapestry.event.ChangeObserver interface, though this is currently only used by the services in tapestry.persist to observe page property changes when they are being managed via a particular persistence strategy. (like session/client/etc..) ~Maybe~ it's an oversight, and maybe not..I guess that depends on what/why you are trying to do. You'll find that there is very little in the framework that wasn't put there for an actual need, so adding in support for things that no one has needed yet doesn't seem to fall in line with sound design. (imho of course..) If you can outline why you need this, and exactly what properties/conditions you'd want to observe we might be able to work something out...A general anything is harder to understand / design around. There is no such thing as a parameter property listener because parameters have no meaning in the context of something taking a parameter...There has to be a source for that parameter value (usually a page ) somewhere. On 10/9/06, Epstein, Ezra [EMAIL PROTECTED] wrote: Hi Jesse, Thanks for that reply. If I read it correctly, it sounds, simply, like the framework is missing this feature. It's a pretty common thing to ask for listener call-backs on framework events. (Listener here in the generic sense rather than the way tapestry uses the term for direct-link targets.) In short, this sounds like a design over-sight. It's common when beans are bound to be able to receive a call-back -- Hibernate, for example, offers this. So much of Tapestry seems automagic I'm surprised that there's no way to register to be informed of the events as they occur. If Howard's reading this perhaps he has a better perspective that he may offer. Thanks, Ezra Epstein Amazon.com - Developer Tools 206-266-2259 -Original Message- From: Jesse Kuhnert [mailto:[EMAIL PROTECTED] Sent: Friday, October 06, 2006 7:22 PM To: Tapestry users Subject: Re: How to observe property binding events Yes, but the usefulness of my answer largely depends on how clever/efficient you are trying to be doing it. Now, there is IBinding. The one object to bind them all ;) If you work your way down the type hierarchy you'll find AbstractBinding, which holds the method you care about most - setObject. This will be called by tapestry when managing all of the page properties automagically for you. Some of the magic happens in (for your exact case at least) org.apache.tapestry.enhance.ParameterPropertyWorker. The other half of the work happens in each specific binding implementation that will handle these set/get object calls..(Like ognl bindings, etc..) I'm not sure where you
Tapestry page (and other) event listeners
The common idiom for listener registration (Swing, Java Beans, etc.) is that the remove() method returns the listener and the add() method only adds a listener if it's not already listening. Tapestry's impl follows neither of these approaches. Is there a reason for the naïve implementation of the methods like void addPageBeginRenderListener(PageBeginRenderListener listener) ? A LinkedHashSet() would give the ordering of the current ArrayList implementation plus the uniquing properties of a set... Thanks, Ezra Epstein Amazon.com - Developer Tools 206-266-2259 -Original Message- From: Jesse Kuhnert [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 10, 2006 1:09 PM To: Tapestry users Subject: Re: How to observe property binding events I'm not sure what the requirements are wrt properties and specific users. I've done similar things on a per request basis via doing something like: public abstract int getProp(); public abstract void setProp(int value); public int getComplicatedValue() { if(getProp() == -1) { // do something complicated setProp(newVal); } return getProp(); } The idea being that the heavy operation will only happen once for that request/response cycle. This all changes if you want it to be done for all users ? You can do that as well I suppose but I think I probably need more clarification on who the properties are supposed to be exposed to/etc.. On 10/10/06, Epstein, Ezra [EMAIL PROTECTED] wrote: That's the opposite of the functionality I want. These are not PER request. They are per instance of a component. Thus true instance variables are the way to go. Tapestry recycles Components and it seems that within a request the same component is re-used but not cleared (ivars reset) even though it is re-parametrized. So, I don't think request vars would work. Thanks, Ezra Epstein Amazon.com - Developer Tools 206-266-2259 -Original Message- From: andyhot [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 10, 2006 12:35 AM To: Tapestry users Subject: Re: How to observe property binding events Why store them in local variables? Store it in the current request cycle... First do a cycle.getAttribute(myexpensivevar) if that returns null, do the computations and store the result back cycle.setAttribute (myexpensivevar,obj); See http://tapestry.apache.org/tapestry4/tapestry/apidocs/org/apache/tapes try/IRequestCycle.html Epstein, Ezra wrote: OK, let's get to brass tacks. I have some derived values that are somewhat expensive to compute so I compute them once per request/response cycle and then they're in local instance variables (non-persisted). The particular component in question (with the semi-expensive derived values) is used inside a loop and so may appear multiple times on a page. By default the first time I use the component I compute the value and then display from that computed value... The 2nd, 3rd, etc instance of those component on the page is actually the exact same Java instance and so the computed/derived ivar is still set. I've added a hack that records an original property value when the derived ivar is computed and if the original and current property values don't match I reset the derived ivar. It works, but it a total hack. The common way I'd imagine doing it is to listen to when the property (parameter) is set by Tapestry. But now that I've lain out the use case maybe some knows the right way to do this in Tapestry. Thanks, Ezra Epstein -Original Message- From: Jesse Kuhnert [mailto:[EMAIL PROTECTED] Sent: Monday, October 09, 2006 3:33 PM To: Tapestry users Subject: Re: How to observe property binding events There's also the org.apache.tapestry.event.ChangeObserver interface, though this is currently only used by the services in tapestry.persist to observe page property changes when they are being managed via a particular persistence strategy. (like session/client/etc..) ~Maybe~ it's an oversight, and maybe not..I guess that depends on what/why you are trying to do. You'll find that there is very little in the framework that wasn't put there for an actual need, so adding in support for things that no one has needed yet doesn't seem to fall in line with sound design. (imho of course..) If you can outline why you need this, and exactly what properties/conditions you'd want to observe we might be able to work something out...A general anything is harder to understand / design around. There is no such thing as a parameter property listener because parameters have no meaning in the context of something taking a parameter...There has to be a source for that parameter value (usually a page ) somewhere. On 10/9/06, Epstein, Ezra [EMAIL PROTECTED] wrote: Hi Jesse, Thanks for that reply. If I read it correctly, it sounds, simply, like the framework
RE: Tapestry page (and other) event listeners
A-ha! So if I have a component that implements this that component will auto-magically be registered and receive the call-back? Thanks, Ezra Epstein Amazon.com - Developer Tools 206-266-2259 -Original Message- From: Jesse Kuhnert [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 10, 2006 4:32 PM To: Tapestry users Subject: Re: Tapestry page (and other) event listeners I'd have to dig into the code to be sure I understood all points but I don't think addPageBeginRenderListener is called by user code most of the time. .. If you page implements one of the various Listener classes (like umm... PageBeginRenderListener) - the framework will detect it and perform the necessary registrations for you automatically when it enhances the page class the first time. On 10/10/06, Epstein, Ezra [EMAIL PROTECTED] wrote: The common idiom for listener registration (Swing, Java Beans, etc.) is that the remove() method returns the listener and the add() method only adds a listener if it's not already listening. Tapestry's impl follows neither of these approaches. Is there a reason for the naïve implementation of the methods like void addPageBeginRenderListener(PageBeginRenderListener listener) ? A LinkedHashSet() would give the ordering of the current ArrayList implementation plus the uniquing properties of a set... Thanks, Ezra Epstein Amazon.com - Developer Tools 206-266-2259 -Original Message- From: Jesse Kuhnert [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 10, 2006 1:09 PM To: Tapestry users Subject: Re: How to observe property binding events I'm not sure what the requirements are wrt properties and specific users. I've done similar things on a per request basis via doing something like: public abstract int getProp(); public abstract void setProp(int value); public int getComplicatedValue() { if(getProp() == -1) { // do something complicated setProp(newVal); } return getProp(); } The idea being that the heavy operation will only happen once for that request/response cycle. This all changes if you want it to be done for all users ? You can do that as well I suppose but I think I probably need more clarification on who the properties are supposed to be exposed to/etc.. On 10/10/06, Epstein, Ezra [EMAIL PROTECTED] wrote: That's the opposite of the functionality I want. These are not PER request. They are per instance of a component. Thus true instance variables are the way to go. Tapestry recycles Components and it seems that within a request the same component is re-used but not cleared (ivars reset) even though it is re-parametrized. So, I don't think request vars would work. Thanks, Ezra Epstein Amazon.com - Developer Tools 206-266-2259 -Original Message- From: andyhot [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 10, 2006 12:35 AM To: Tapestry users Subject: Re: How to observe property binding events Why store them in local variables? Store it in the current request cycle... First do a cycle.getAttribute(myexpensivevar) if that returns null, do the computations and store the result back cycle.setAttribute (myexpensivevar,obj); See http://tapestry.apache.org/tapestry4/tapestry/apidocs/org/apache/tap es try/IRequestCycle.html Epstein, Ezra wrote: OK, let's get to brass tacks. I have some derived values that are somewhat expensive to compute so I compute them once per request/response cycle and then they're in local instance variables (non-persisted). The particular component in question (with the semi-expensive derived values) is used inside a loop and so may appear multiple times on a page. By default the first time I use the component I compute the value and then display from that computed value... The 2nd, 3rd, etc instance of those component on the page is actually the exact same Java instance and so the computed/derived ivar is still set. I've added a hack that records an original property value when the derived ivar is computed and if the original and current property values don't match I reset the derived ivar. It works, but it a total hack. The common way I'd imagine doing it is to listen to when the property (parameter) is set by Tapestry. But now that I've lain out the use case maybe some knows the right way to do this in Tapestry. Thanks, Ezra Epstein -Original Message- From: Jesse Kuhnert [mailto:[EMAIL PROTECTED] Sent: Monday, October 09, 2006 3:33 PM To: Tapestry users Subject: Re: How to observe property binding events There's also the org.apache.tapestry.event.ChangeObserver interface, though this is currently only used by the services in tapestry.persist to observe page property changes when they are being managed via a particular persistence strategy. (like session/client
RE: Tapestry page (and other) event listeners
I declared the proper interface as being implemented and that was all that was needed. Works on components. Thanks, Ezra Epstein -Original Message- From: andyhot [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 10, 2006 5:08 PM To: Tapestry users Subject: Re: Tapestry page (and other) event listeners Jesse Kuhnert wrote: I don't remember whether or not Page listeners get attached to components or not. It doesn't sound like something that would make sense, but who knows.. They do get attached to components... but i'm under the impression that your page also has to implement PageBeginRenderListener for this to work... Additionally,if you use Blocks from other pages, take a look at this entry: http://jroller.com/page/genjitsuteki?entry=tapestry_avoid_pagerenderlistener For components specifically, you also have the other options involved, like: (from http://tapestry.apache.org/tapestry4.1/target/site/tapestry-framework/ apidocs/org/apache/tapestry/AbstractComponent.html) finishLoad prepareForRender renderComponent On 10/10/06, Epstein, Ezra [EMAIL PROTECTED] wrote: A-ha! So if I have a component that implements this that component will auto-magically be registered and receive the call-back? Thanks, Ezra Epstein Amazon.com - Developer Tools 206-266-2259 -Original Message- From: Jesse Kuhnert [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 10, 2006 4:32 PM To: Tapestry users Subject: Re: Tapestry page (and other) event listeners I'd have to dig into the code to be sure I understood all points but I don't think addPageBeginRenderListener is called by user code most of the time. .. If you page implements one of the various Listener classes (like umm... PageBeginRenderListener) - the framework will detect it and perform the necessary registrations for you automatically when it enhances the page class the first time. On 10/10/06, Epstein, Ezra [EMAIL PROTECTED] wrote: The common idiom for listener registration (Swing, Java Beans, etc.) is that the remove() method returns the listener and the add() method only adds a listener if it's not already listening. Tapestry's impl follows neither of these approaches. Is there a reason for the naïve implementation of the methods like void addPageBeginRenderListener(PageBeginRenderListener listener) ? A LinkedHashSet() would give the ordering of the current ArrayList implementation plus the uniquing properties of a set... Thanks, Ezra Epstein Amazon.com - Developer Tools 206-266-2259 -Original Message- From: Jesse Kuhnert [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 10, 2006 1:09 PM To: Tapestry users Subject: Re: How to observe property binding events I'm not sure what the requirements are wrt properties and specific users. I've done similar things on a per request basis via doing something like: public abstract int getProp(); public abstract void setProp(int value); public int getComplicatedValue() { if(getProp() == -1) { // do something complicated setProp(newVal); } return getProp(); } The idea being that the heavy operation will only happen once for that request/response cycle. This all changes if you want it to be done for all users ? You can do that as well I suppose but I think I probably need more clarification on who the properties are supposed to be exposed to/etc.. On 10/10/06, Epstein, Ezra [EMAIL PROTECTED] wrote: That's the opposite of the functionality I want. These are not PER request. They are per instance of a component. Thus true instance variables are the way to go. Tapestry recycles Components and it seems that within a request the same component is re-used but not cleared (ivars reset) even though it is re-parametrized. So, I don't think request vars would work. Thanks, Ezra Epstein Amazon.com - Developer Tools 206-266-2259 -Original Message- From: andyhot [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 10, 2006 12:35 AM To: Tapestry users Subject: Re: How to observe property binding events Why store them in local variables? Store it in the current request cycle... First do a cycle.getAttribute(myexpensivevar) if that returns null, do the computations and store the result back cycle.setAttribute (myexpensivevar,obj); See http://tapestry.apache.org/tapestry4/tapestry/apidocs/org/apache/ tap es try/IRequestCycle.html Epstein, Ezra wrote: OK, let's get to brass tacks. I have some derived values that are somewhat expensive to compute so I compute them once per request/response cycle and then they're in local instance variables (non-persisted). The particular component in question (with the semi-expensive derived values) is used inside a loop and so may appear
How to observe property binding events
I've got a component which accepts a parameter. I want to listen (receive a callback) when the parameter is set (bound). Does Tapestry provide such a facility? Thanks, Ezra Epstein
RE: Maximize Portlet
This works fine for me on JBoss Portal 2.4 (pre-release) java-snippet @InjectObject(service:tapestry.portlet.ActionResponse) public abstract javax.portlet.ActionResponse getActionResponse(); public void maximizeWindow() { try { getActionResponse().setWindowState(WindowState.MAXIMIZED); } catch (WindowStateException e) { // TODO Auto-generated catch block e.printStackTrace(); } } /java-snippet html-snippet a href=# jwcid=[EMAIL PROTECTED] listener=listener:maximizeWindowMaximize/a /html-snippet Thanks, Ezra Epstein -Original Message- From: Epstein, Ezra [mailto:[EMAIL PROTECTED] Sent: Monday, August 07, 2006 12:45 PM To: Tapestry users Subject: RE: Maximize Portlet What's the code for your getActionResponse() method? When you say DirectLink call do you mean a Listener method? Page 50 (among others) of the JSR 168 spec lists conditions where one may not call setWindowState() and where an exception should be thrown. Thanks, Ezra Epstein -Original Message- From: Joel Trunick [mailto:[EMAIL PROTECTED] Sent: Monday, August 07, 2006 12:21 PM To: Tapestry users Subject: Maximize Portlet I'm doing getActionResponse().setWindowState(WindowState.MAXIMIZED) as part of a DirectLink call. This apparently throws an exception in Liferay. How does one maximize the window? Joel -Original Message- From: Michael Becke [mailto:[EMAIL PROTECTED] Sent: Friday, March 31, 2006 7:53 AM To: Tapestry users Subject: Re: Portlets and PageRedirectException Thanks Raphaël. I'll give it a try. Mike On 3/30/06, Raphaël Jean [EMAIL PROTECTED] wrote: Michael, I've attached a patch to TAPESTRY-855 in jira that fixes this problem. The patch is for the 4.0 branch. Perhaps this could make it into 4.0.1? I've seen a couple people beside me hitting this problem. Thanks, Raphael Jean EntropySoft -Original Message- From: Michael Becke [mailto:[EMAIL PROTECTED] Sent: jeudi 30 mars 2006 16:57 To: tapestry-user@jakarta.apache.org Subject: Portlets and PageRedirectException Hello, I am using Tapestry 4 to create portlets inside of Jetspeed 2 and am running into problems with page redirects. Here's the scenario: - Each portlet implements PageValidateListener and does some validation inside of pageValidate() - In some cases I need to redirect to a new page from pageValidate() and so I throw a PageRedirectException. - This exception seems to be handled by AbstractEngine but a NPE occurs before the redirected to page is rendered. The exception is included below. This problem appears to be similar to this bug http://issues.apache.org/jira/browse/TAPESTRY-855, except that this is being throws after a redirect in beginPageRender. Any ideas on how to solve this? Thanks, Mike Property 'actionResponse' of OuterProxy for tapestry.portlet.PortletRequestGlobals(org.apache.tapestry.portlet.P ortlet RequestGlobals) is null. * $ActionResponse_10a4b804525._targetServiceProperty($ActionResponse_1 0a4b80 4525.java) * $ActionResponse_10a4b804525.setRenderParameter($ActionResponse_10a4b 804525 .java) * $ActionResponse_10a4b804523.setRenderParameter($ActionResponse_10a4b 804523 .java) * org.apache.tapestry.portlet.PortletResponseRenderer.renderResponse(P ortlet ResponseRenderer.java:44) * $ResponseRenderer_10a4b8043e5.renderResponse($ResponseRenderer_10a4b 8043e5 .java) * org.apache.tapestry.engine.AbstractEngine.renderResponse(AbstractEng ine.ja va:203) * org.apache.tapestry.engine.AbstractEngine.handlePageRedirectExceptio n(Abst ractEngine.java:343) * org.apache.tapestry.engine.AbstractEngine.service(AbstractEngine.java:254) * org.apache.tapestry.services.impl.InvokeEngineTerminator.service(Inv okeEng ineTerminator.java:60) * $WebRequestServicer_10a4b804439.service($WebRequestServicer_10a4b804 439.ja va) * org.apache.tapestry.services.impl.DisableCachingFilter.service(Disab leCach ingFilter.java:48) * $WebRequestServicerFilter_10a4b80443b.service($WebRequestServicerFil ter_10 a4b80443b.java) * $WebRequestServicer_10a4b80443d.service($WebRequestServicer_10a4b804 43d.ja va) * $WebRequestServicer_10a4b804437.service($WebRequestServicer_10a4b804 437.ja va) * org.apache.tapestry.portlet.RenderRequestServicerToWebRequestService rBridg e.service(RenderRequestServicerToWebRequestServicerBridge.java:49) * $RenderRequestServicer_10a4b804431.service($RenderRequestServicer_10 a4b804 431.java) * $RenderRequestServicer_10a4b80442b.service($RenderRequestServicer_10 a4b804 42b.java) * org.apache.tapestry.portlet.ApplicationPortlet.render(ApplicationPor
RE: Maximize Portlet
What's the code for your getActionResponse() method? When you say DirectLink call do you mean a Listener method? Page 50 (among others) of the JSR 168 spec lists conditions where one may not call setWindowState() and where an exception should be thrown. Thanks, Ezra Epstein -Original Message- From: Joel Trunick [mailto:[EMAIL PROTECTED] Sent: Monday, August 07, 2006 12:21 PM To: Tapestry users Subject: Maximize Portlet I'm doing getActionResponse().setWindowState(WindowState.MAXIMIZED) as part of a DirectLink call. This apparently throws an exception in Liferay. How does one maximize the window? Joel -Original Message- From: Michael Becke [mailto:[EMAIL PROTECTED] Sent: Friday, March 31, 2006 7:53 AM To: Tapestry users Subject: Re: Portlets and PageRedirectException Thanks Raphaël. I'll give it a try. Mike On 3/30/06, Raphaël Jean [EMAIL PROTECTED] wrote: Michael, I've attached a patch to TAPESTRY-855 in jira that fixes this problem. The patch is for the 4.0 branch. Perhaps this could make it into 4.0.1? I've seen a couple people beside me hitting this problem. Thanks, Raphael Jean EntropySoft -Original Message- From: Michael Becke [mailto:[EMAIL PROTECTED] Sent: jeudi 30 mars 2006 16:57 To: tapestry-user@jakarta.apache.org Subject: Portlets and PageRedirectException Hello, I am using Tapestry 4 to create portlets inside of Jetspeed 2 and am running into problems with page redirects. Here's the scenario: - Each portlet implements PageValidateListener and does some validation inside of pageValidate() - In some cases I need to redirect to a new page from pageValidate() and so I throw a PageRedirectException. - This exception seems to be handled by AbstractEngine but a NPE occurs before the redirected to page is rendered. The exception is included below. This problem appears to be similar to this bug http://issues.apache.org/jira/browse/TAPESTRY-855, except that this is being throws after a redirect in beginPageRender. Any ideas on how to solve this? Thanks, Mike Property 'actionResponse' of OuterProxy for tapestry.portlet.PortletRequestGlobals(org.apache.tapestry.portlet.P ortlet RequestGlobals) is null. * $ActionResponse_10a4b804525._targetServiceProperty($ActionResponse_1 0a4b80 4525.java) * $ActionResponse_10a4b804525.setRenderParameter($ActionResponse_10a4b 804525 .java) * $ActionResponse_10a4b804523.setRenderParameter($ActionResponse_10a4b 804523 .java) * org.apache.tapestry.portlet.PortletResponseRenderer.renderResponse(P ortlet ResponseRenderer.java:44) * $ResponseRenderer_10a4b8043e5.renderResponse($ResponseRenderer_10a4b 8043e5 .java) * org.apache.tapestry.engine.AbstractEngine.renderResponse(AbstractEng ine.ja va:203) * org.apache.tapestry.engine.AbstractEngine.handlePageRedirectExceptio n(Abst ractEngine.java:343) * org.apache.tapestry.engine.AbstractEngine.service(AbstractEngine.java:254) * org.apache.tapestry.services.impl.InvokeEngineTerminator.service(Inv okeEng ineTerminator.java:60) * $WebRequestServicer_10a4b804439.service($WebRequestServicer_10a4b804 439.ja va) * org.apache.tapestry.services.impl.DisableCachingFilter.service(Disab leCach ingFilter.java:48) * $WebRequestServicerFilter_10a4b80443b.service($WebRequestServicerFil ter_10 a4b80443b.java) * $WebRequestServicer_10a4b80443d.service($WebRequestServicer_10a4b804 43d.ja va) * $WebRequestServicer_10a4b804437.service($WebRequestServicer_10a4b804 437.ja va) * org.apache.tapestry.portlet.RenderRequestServicerToWebRequestService rBridg e.service(RenderRequestServicerToWebRequestServicerBridge.java:49) * $RenderRequestServicer_10a4b804431.service($RenderRequestServicer_10 a4b804 431.java) * $RenderRequestServicer_10a4b80442b.service($RenderRequestServicer_10 a4b804 42b.java) * org.apache.tapestry.portlet.ApplicationPortlet.render(ApplicationPor tlet.j ava:161) * org.apache.jetspeed.factory.JetspeedPortletInstance.render(JetspeedP ortlet Instance.java:102) * org.apache.jetspeed.container.JetspeedContainerServlet.doGet(Jetspee dConta inerServlet.java:230) * javax.servlet.http.HttpServlet.service(HttpServlet.java:689) * javax.servlet.http.HttpServlet.service(HttpServlet.java:802) * org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(App licati onFilterChain.java:252) * org.apache.catalina.core.ApplicationFilterChain.doFilter(Application Filter Chain.java:173) * org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDis patche r.java:672) * org.apache.catalina.core.ApplicationDispatcher.doInclude(Application Dispat cher.java:574) *
After validation Hook
Is there a place to put logic that is called after (post-) validation? Simply put, there's some logic that I'd like to have invoked before any listener is called (after validation) but would rather not explicitly call that logic from each listener method. Thanks, Ezra Epstein - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Portlets on Tapestry 4.1
We want to move to 4.1 for our portlets. Reading up I find: By default, the Shell component will include the core dojo javascript object dojo.js, as well as the new core Tapestry javascript object - core.js. This means that you don't have to worry about how to include dojo or Tapestry javascript on any of your pages, they will already be available. Of course, that's not the case for portlets. Is there a simple step-by-step how-to for those of us who don't (can't) use the Shell component. Thanks, Ezra Epstein - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: recursive rendering
This may not be the issue, but... You could make a dyna-eval component that (re-)evaluates an ognl expression wherever/whenever you choose. OGNL is pretty easy to work with. Perhaps that could work? Thanks, Ezra Epstein -Original Message- From: Dan Adams [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 02, 2006 2:31 PM To: Tapestry users Subject: Re: recursive rendering Thanks Mike. Yeah, I've read that article at least twice now and read through the code. :) I'm having a problem that you may have run into; much like your code the block to render is returned via an ognl expression and it apprears the the expression is only being evaluated once and not each time. Did you ever have this problem? On Tue, 2006-08-01 at 16:04 -0700, Mike Henderson wrote: Hi, It's a T3 example but it should show how it's done: http://www.behindthesite.com/blog/C1931765677/E923478269/index.html Mike - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Dan Adams Senior Software Engineer Interactive Factory 617.235.5857 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Re: Tapestry 5 Discussions
I think there's a mis-communication. I do not at all feel HiveMind is just an ego trip. Far from it. Rather I was questioning how the decision about IoC adoption is being made. At the time HiveMind got started the IoC container space was pretty open and empty. Not so anymore. Of course Spring lacks features needed. Understood. Could Spring be extended? The trouble we all have -- it is certainly not unique to a creator of software or this software -- so I'm speaking of my own experience, is that I (and most folks I know) tend to get a bit skewed in favor of things that are our babies so to speak. And there's nothing wrong with that. But we need to recognize it when we're trying to make a decision and then correct for it. If HM is the best choice (not just technically, but also in terms of adoption) then great, but what's the process of deciding? Is it worth exploring Spring enhancements? That was the point. Thanks, Ezra Epstein -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of hv @ Fashion Content Sent: Monday, July 31, 2006 4:27 AM To: users@tapestry.apache.org Subject: Re: Tapestry 5 Discussions Trashing HiveMind is sort of uninformed(not trying to sling mud). As previously pointed out you can't really do contributions in Spring. And that was one of the key T3 features it was supposed to replace. While I'm not terribly happy about the multitude of concepts involved in writing a non-trivial Tap4 app, I bet it would have been much worse if it had been built on Spring. Being a bit blunt: If you think HiveMind is just an ego trip why dont you write a version of ApplicationServlet that uses Spring instead. If the two are equal it shouldn't be much of a challenge to swap HiveMind out. Henrik - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Streaming files from Tapestry
If the content is available from another servlet context then hasn't this added (only) more obscurity rather than security? It seems for the security the servlet must do the authorization check before serving hence, again, I don't see how it relates to Tapestry. Thanks, Ezra Epstein -Original Message- From: Murray Collingwood [mailto:[EMAIL PROTECTED] Sent: Friday, July 28, 2006 2:14 PM To: Tapestry users Subject: RE: Streaming files from Tapestry Hi Ezra I did look at doing this as a work around, however it has one major flaw - it doesn't provide any security. In a CRM system, for example, if the document download link is http://webserver/MyOtherWebContext/images/01.doc then it's not going to take somebody long to realise they can type in other numbers and retrieve documents that they may not have access to. With a servlet running inside my application I can check the users security immediately before I stream the document. The other benefit of keeping the servlet as part of my application is that I can store the external directory name in one location rather than two. A small benefit. My final argument is that the faq should be providing the recommended solution. Obviously lots of people have already asked for this (that's why it's in a faq) so I'm not alone out here... I have written a small servlet to do what I want. It has limited functionality but it serves my immediate purpose. I am still hopeful that somebody will deliver a servlet or library that does serve this purpose in a better and generic method, I am happy to be the first to test and implement it. Cheers mc On 28 Jul 2006 at 9:53, Epstein, Ezra wrote: I'm not sure I really followed, but your option c doesn't seem to have anything to do with a web framework (tapestry or otherwise). Rather you're just dynamically generating some text a la: img src=/MyOtherWebContext/images/my-dynamically-named-image.gif / Or whatever. The only part of that which is dynamic is the image name. And Any tag can give you this no sweat. Maybe the name of the other web context is a config param and so is dynamic too. Again, no sweat. As for the serving of the static files themselves (the name of a given file is dynamic in that if you're showing the details of a CD then the image name may depend on the product, but the image itself is in a web servers file system) any web server will do. Apache, Tomcat, JBoss, etc. I think the problem is with the word stream. Stream implies dynamically feeding data into the response. I think your question is about serving images. If so, it's a snap. For example, I serve my Tapestry javascript files (same applies to images) simply as: script type=text/javascript src=/MyTapestryAppName/js/myJavaScriptFile.js/script Works great. Perhaps I misread the question. Thanks, Ezra Epstein -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.394 / Virus Database: 268.10.4/402 - Release Date: 27/07/2006 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Portlet Tapestry: using @Persist with a ValidationDelegate vs. using an ApplicationStateObject
Hmmm. I checked the 4.08 code the Persist annotation explicitly checks for the InitialValue annot. and seems to apply it. Writing the session persistence by hand turned out to be easy. Then I remembered: in Portlet world the default session scope is the portlet instance, so the ASO won't be shared across pages anyway. :-) Thanks, Ezra Epstein -Original Message- From: Jesse Kuhnert [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 25, 2006 6:12 PM To: Tapestry users Subject: Re: Portlet Tapestry: using @Persist with a ValidationDelegate vs. using an ApplicationStateObject I don't think @Persist and @InitialValue can currently be used together. It's on my list of things to look at but I haven't found time to dig deeper into it yet. If you aren't against alpha software I can probably get a fix out soon-ish, if there is a fix to be had. (maybe tomorrow I'll take a look) You'd have to move to tapestry 4.1 though. On 7/25/06, Epstein, Ezra [EMAIL PROTECTED] wrote: Doing some validation on a portlet. Got it working using the recommended approach described on http://tapestry.apache.org/tapestry4/tapestry-portlet/coding-issues.ht ml#Loss+of+Transient+State I'd like to try doing it where the ValidationDelegate is stored in the session for a specific page (portlet). I.e., not shared with other pages in the app. So I tried: java-snippet public IValidationDelegate getInitialValidationDelegate() { return new PortletValidationDelegate(); } @Persist @InitialValue(initialValidationDelegate) public abstract IValidationDelegate getValidationDelegate(); /java-snippet But it doesn't seem to work. Thanks, Ezra Epstein - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Jesse Kuhnert Tacos/Tapestry, team member/developer Open source based consulting work centered around dojo/tapestry/tacos/hivemind. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Portlet Tapestry: using @Persist with a ValidationDelegate vs. using an ApplicationStateObject
Doing some validation on a portlet. Got it working using the recommended approach described on http://tapestry.apache.org/tapestry4/tapestry-portlet/coding-issues.html#Loss+of+Transient+State I'd like to try doing it where the ValidationDelegate is stored in the session for a specific page (portlet). I.e., not shared with other pages in the app. So I tried: java-snippet public IValidationDelegate getInitialValidationDelegate() { return new PortletValidationDelegate(); } @Persist @InitialValue(initialValidationDelegate) public abstract IValidationDelegate getValidationDelegate(); /java-snippet But it doesn't seem to work. Thanks, Ezra Epstein - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Portlet hivemodule space in class name?
Looking at the Tapestry 4.02 Portlet source I noticed: construct class=org.apache.tapestry.describe.RootDescriptionReceiverFactory Impl In the hivemodule.xml file. Is the space between 'RootDescriptionReceiverFactory' and 'Impl' a typo? Thanks, Ezra Epstein - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Inject and the infrastructure namespace
http://tapestry.apache.org/tapestry4/tapestry/apidocs/org/apache/tapestry/services/Infrastructure.html But clearly the converse is not true: there are properties available via the infrastructure: prefix that are not in the interface. The WebContext (infrastructure:context) is an example that comes to mind. Isn't it odd that one can't inspect the service providers for their contents? String interpretation can still be idiosyncratic and the s.ps could still have a way to expose what they've parsed. I'm surprised if HiveMind lacks this feature common to most IoC containers. Thanks, Ezra Epstein -Original Message- From: James Carman [mailto:[EMAIL PROTECTED] Sent: Thursday, July 13, 2006 5:28 PM To: 'Tapestry users' Subject: RE: Inject and the infrastructure namespace Take a look at the Infrastructure interface. Any property from the interface is available via the infrastructure: prefix. -Original Message- From: Epstein, Ezra [mailto:[EMAIL PROTECTED] Sent: Thursday, July 13, 2006 7:07 PM To: Tapestry users Subject: Inject and the infrastructure namespace This: @InjectObject(infrastructure:context) works fine. And of course there's the 'request' available from infrastructure. Can someone kindly point me to the docs that list all the possible values that may be placed after the infrastructure: tag/namespace for a default tapestry+portlet deployment? Thanks, Ezra Epstein - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Inject and the infrastructure namespace
Yes, but the static (.xml) config'd part of it could be inspected dynamically. 'course when used via inject where the parameter (e.g., class name) is provided dynamically it's a meaningless concept, but for most of the things that hivemind has built-in it's not: they're static. Guess I'm still figuring out how to even read HiveDoc... Since that seems to be how the info are (statically) available. Thanks, Ezra Epstein -Original Message- From: James Carman [mailto:[EMAIL PROTECTED] Sent: Friday, July 14, 2006 10:30 AM To: 'Tapestry users' Subject: RE: Inject and the infrastructure namespace Service providers don't have contents. Take the instance provider, for example. It can provide an object of any class which has a public no-argument constructor. Or, consider the class provider. It can provide any java.lang.Class object given a class name. So, there's no real way for it to be able to tell you here are all of the objects that I can provide. -Original Message- From: Epstein, Ezra [mailto:[EMAIL PROTECTED] Sent: Friday, July 14, 2006 1:21 PM To: Tapestry users Subject: RE: Inject and the infrastructure namespace http://tapestry.apache.org/tapestry4/tapestry/apidocs/org/apache/tapestry/se rvices/Infrastructure.html But clearly the converse is not true: there are properties available via the infrastructure: prefix that are not in the interface. The WebContext (infrastructure:context) is an example that comes to mind. Isn't it odd that one can't inspect the service providers for their contents? String interpretation can still be idiosyncratic and the s.ps could still have a way to expose what they've parsed. I'm surprised if HiveMind lacks this feature common to most IoC containers. Thanks, Ezra Epstein -Original Message- From: James Carman [mailto:[EMAIL PROTECTED] Sent: Thursday, July 13, 2006 5:28 PM To: 'Tapestry users' Subject: RE: Inject and the infrastructure namespace Take a look at the Infrastructure interface. Any property from the interface is available via the infrastructure: prefix. -Original Message- From: Epstein, Ezra [mailto:[EMAIL PROTECTED] Sent: Thursday, July 13, 2006 7:07 PM To: Tapestry users Subject: Inject and the infrastructure namespace This: @InjectObject(infrastructure:context) works fine. And of course there's the 'request' available from infrastructure. Can someone kindly point me to the docs that list all the possible values that may be placed after the infrastructure: tag/namespace for a default tapestry+portlet deployment? Thanks, Ezra Epstein - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Access to PortletConfig (init-param and friends) SOLVED ?
On the plus side, to get the IApplicationSpecification the Inject incantation is: @InjectObject(infrastructure:applicationSpecification) But one the other hand, the portlet's init-param(s) are nowhere to be found :-( But it seems this does the trick: @InjectObject(infrastructure:globalPropertySource) public abstract IPropertySource getGlobalPropertySource(); Now public void aMethod() { String initParamName; // since we know this String initParamValue = getGlobalPropertySource.getPropertyValue( initParamName ); // use initParamValue here... } Thanks, Ezra Epstein -Original Message- From: Epstein, Ezra [mailto:[EMAIL PROTECTED] Sent: Thursday, July 13, 2006 4:33 PM To: Tapestry users Subject: Access to PortletConfig (init-param and friends) So I think I found the code that handles the PortletConfig: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-portlet/src/java/org/apache/tapestry/portlet/PortletApplicationSpecificationInitializer.java?view=markup public void initialize(PortletConfig portletConfig) { String name = portletConfig.getPortletName(); Resource resource = findApplicationSpecification(name); IApplicationSpecification specification = resource == null ? constructStandinSpecification(name) : _parser.parseApplicationSpecification(resource); _globals.storeSpecification(specification); } So I do I get the specification back out of the globals service? @InjectObject(global:specification) perhaps? Thanks, Ezra Epstein - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tapestry 4: @DirectLink with parameter=ognl:null not handled as a null parameter
The problem isn't with DirectLink it's with the method being invoked which expects a single parameter. I could, of course, write a special method that takes no params and then calls the extant method with a null parameter but that's a kludgy hack. Jim S. got the best answer: ognl:{} does the trick. Note 1: this is a more general problem for DirectLink. So if you have a possibly null parameter wrap it in curly braces. Note 2: this is in the Tapestry javadocs on DirectLink. That said, is it the right behavior? I'm unsure. Thanks, Ezra Epstein -Original Message- From: Jesse Kuhnert [mailto:[EMAIL PROTECTED] Sent: Thursday, July 13, 2006 2:19 PM To: Tapestry users Subject: Re: Tapestry 4: @DirectLink with parameter=ognl:null not handled as a null parameter I don't think parameters is a required parameter of DirectLink. What happens when you don't define that portion at all? On 7/13/06, Jim Steinberger [EMAIL PROTECTED] wrote: Ezra, While looking for a workaround for you, I found out it's not just /explicit/ nulls: To my page class, I added: public Integer getBip() { return null; } And changed my template to: parameters=ognl:bip And got the same error as you. Good to know. But you can still do this. The parameters attribute can also take an Object[] or List, and OGNL makes it very easy to create one inline. The following worked for me: parameters=ognl:{ null } Prolly cuz the list itself isn't null and thus not thrown away, and then it's mapped to the input parameters. Jim -Original Message- From: Epstein, Ezra [mailto:[EMAIL PROTECTED] Sent: Thursday, July 13, 2006 4:39 PM To: Tapestry users Subject: Tapestry 4: @DirectLink with parameter=ognl:null not handled as a null parameter I've got working @DirectLink tags for a listener that takes a single String parameter. In one case I want to pass in null as the parameter. How does one do this? Using a href=# jwcid=@DirectLink listener=listener:setCurrentNodeId parameter=ognl:nullLink/a Causes: org.apache.tapestry.BindingException Exception invoking listener method setCurrentNodeId of component View: No listener method named 'setCurrentNodeId' suitable for no listener parameters found in [EMAIL PROTECTED] binding [EMAIL PROTECTED] parameter listener, component=View, methodName=setCurrentNodeId, location=context:/View.html, line 22] Yet the listener does exist and works just fine with a non-null param. I'm thinking that Tapestry throws away the param b/c its null? If so, how does one explicitly provide a null param? (And also, if so, isn't that behavior incorrect? i.e., is this a bug?) Thanks, Ezra Epstein - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Jesse Kuhnert Tacos/Tapestry, team member/developer Open source based consulting work centered around dojo/tapestry/tacos/hivemind. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tapestry and a portlet's init-param
So the portlet spec lists a way to get the init-params set in the portlet.xml file. How does one access these from a Tapestry (portlet) page? I've been perusing the javadocs and seem to only get 1/2 way there. Thanks, Ezra Epstein - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Inject and the infrastructure namespace
This: @InjectObject(infrastructure:context) works fine. And of course there's the 'request' available from infrastructure. Can someone kindly point me to the docs that list all the possible values that may be placed after the infrastructure: tag/namespace for a default tapestry+portlet deployment? Thanks, Ezra Epstein - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Inject and the infrastructure namespace GENERALIZED
More generally, how does one introspect the entire HiveMind registry? I'd really like to list out the top level entry points (namespaces) and then crawl those printing out what I find. Is there some sample code to do that? Thanks, Ezra Epstein -Original Message- From: Epstein, Ezra [mailto:[EMAIL PROTECTED] Sent: Thursday, July 13, 2006 4:07 PM To: Tapestry users Subject: Inject and the infrastructure namespace This: @InjectObject(infrastructure:context) works fine. And of course there's the 'request' available from infrastructure. Can someone kindly point me to the docs that list all the possible values that may be placed after the infrastructure: tag/namespace for a default tapestry+portlet deployment? Thanks, Ezra Epstein - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
'context' ObjectProvider (hivemind/tapestry)
Does Tapestry's HiveMind come with a ContextObjectProvider ? Basically I want a way to get attributes from the WebContext and use them as parameters in instantiating an object inside a hivemodule.xml file. If not, looks like I have to role my own ObjectProvider a la: http://jakarta.apache.org/hivemind/hivemind/ObjectProviders.html In which case: does anyone have example code of how this is done and how one configures the hivemodule.xml to use a custom ObjectProvider for a given prefix and then (last step) using that prefix to access an object Thanks, Ezra Epstein - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
JSF-style bean access (JBoss) via HiveMind ?
We're trying to write some admin/management code for JBoss Portal in Tapestry. Current code uses JSF. The relevant portion of the faces-config.xml is: managed-bean managed-bean-nameportalobjectmgr/managed-bean-name managed-bean-classorg.jboss.portal.core.portlet.management.PortalObjectManagerBean/managed-bean-class managed-bean-scopesession/managed-bean-scope managed-property property-nameroleModule/property-name value#{applicationScope.RoleModule}/value /managed-property managed-property property-nameportalObjectContainer/property-name value#{applicationScope.PortalObjectContainer}/value /managed-property ... /managed-bean I'd like to recreate this via HiveMind but am unclear what to put into the hivemodule.xml file. Any pointers to anything remotely related is/are appreciated. Thanks, Ezra Epstein - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: General HiveMind questions
), then all you have to do is declare an abstract getter of the same type as your bean class and Tapestry will automatically look it up for you. -Original Message- From: Epstein, Ezra [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 11, 2006 3:12 PM To: Tapestry users Subject: General HiveMind questions So I've got an object I want to make available to a Tapestry page and I want to use HiveMind to do this. What are the steps one takes? More specifically: the object does *not* implement an interface; the object has parameters (set via mutator methods). (Maybe should be posted on the HiveMind lists) Thanks, Ezra Epstein - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: General HiveMind questions
OK, thanks to the SVN links, I see I need to reference the service by the Java class of the interface, not by the id which I assigned to that service). Very curious and I either missed that in the docs or (once again?) it's not documented. I swear, back in Tap2.0 I was an evangelist, but at this point using Tapestry feels like coding by braille or utter trial and error. Is that just me or is there some hard to find great docs that everyone else has read? If so, please, please pass along the link. Thanks, Ezra Epstein -Original Message- From: Epstein, Ezra [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 11, 2006 1:19 PM To: Tapestry users Subject: RE: General HiveMind questions Thanks. I'm not (yet) using autowire (nor Tap4.1) so how does one reference something in a page? I'm trying to use an annotation but it's not working. Here are some details: html-snippet file=View.html pspan jwcid=@Insert value=ognl:dateMonday/span/p pspan jwcid=@Insert value=ognl:jndiServiceStringjndi info/span/p /html-snippet java-snippet file=View.java import java.util.Date; import org.apache.hivemind.lib.NameLookup; import org.apache.tapestry.annotations.InjectObject; import org.apache.tapestry.html.BasePage; public abstract class View extends BasePage { @InjectObject(service:jndiLookup) public abstract NameLookup getJndiLookupService(); // This blows chunks. public String getJndiServiceString() { return getJndiLookupService().toString(); } // This works public String getDate() { return (new Date()).toString(); } } /java-snippet xml-snippet file=hivemodule.xml ?xml version=1.0? module id=CustomTeamPageAdmin version=1.0.0 service-point id=jndiLookup interface=org.apache.hivemind.lib.NameLookup parameters-occurs=none invoke-factory service-id=hivemind.BuilderFactory model=singleton construct class=org.apache.hivemind.lib.impl.NameLookupImpl set property=initialFactory value=org.jnp.interfaces.NamingContextFactory / set property=URLPackages value=org.jboss.naming:org.jnp.interfaces / set property=providerURL value=jnp://localhost:1099 / set-service property=coordinator service-id=RemoteExceptionCoordinator / event-listener service-id=RemoteExceptionCoordinator / /construct /invoke-factory /service-point /module /xml-snippet The hivemodule.xml is in the WEB-INF folder and is being found and parsed (I know, because I initially left out the version attribute and saw an exception in the JBoss logs). The above doesn't work. Am I referencing the hivemind stuff the wrong way? using the annotation incorrectly? HiveMind is completely silent on the subject (nothing in the JBoss logs or the page) what I see is: output-snippet org.apache.tapestry.BindingException Unable to read OGNL expression 'parsed OGNL expression' of [EMAIL PROTECTED]: jndiServiceString binding ExpressionBinding[View jndiServiceString] locationcontext:/View.html, line 11 6 7 div jwcid=@For source=ognl:list value=ognl:item 8 span jwcid=@Insert value=ognl:item /br / 9 /div 10 11 pspan jwcid=@Insert value=ognl:jndiServiceStringjndi info/span/p 12 13 /body 14 /html org.apache.hivemind.ApplicationRuntimeException Unable to read OGNL expression 'parsed OGNL expression' of [EMAIL PROTECTED]: jndiServiceString component [EMAIL PROTECTED] locationcontext:/View.html ognl.OgnlException jndiServiceString java.lang.AbstractMethodError amazon.pizza.portal.tapestry.pages.View.getJndiLookupService()Lorg/apache/hivemind/lib/NameLookup; * amazon.pizza.portal.tapestry.pages.View.getJndiServiceString(View.java:21) * sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) * sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) * sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) * java.lang.reflect.Method.invoke(Method.java:585) * ognl.OgnlRuntime.invokeMethod(OgnlRuntime.java:491) /output-snippet Which, thanks to the vaunted line-precise error reporting, tells me exactly what I already knew and very little about what's causing the issue. Hence this post Any help appreciated. BTW, I can't for the best Google query I can construct, find a simple example of accessing a JNDI object via HiveMind and using it in Tapestry page or component. I'd think this would be a canonical
RE: Source code for Tapestry examples
SVN access to Tapestry4 source: http://svn.apache.org/repos/asf/tapestry/tapestry4/trunk I'm using Subclipse from within eclipse. Browse to what is of interest and make a project... Thanks, Ezra Epstein -Original Message- From: Epstein, Ezra [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 11, 2006 2:10 PM To: Tapestry users Subject: Source code for Tapestry examples So I went to go download the vLib example: http://tapestry.apache.org/tapestry4/examples/index.html It links to Howard's personal site. Fair enough, I downloaded the 27MB gzipped package from there. And... Not a .java file to be found. No source code. No indication of where to find the source either. H. I'm in a gripe-y mood, but it does seem like I detect a pattern here. Thanks, Ezra Epstein - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Re: Why I hate mailing lists
Thanks! Gmane fixes this very well. Any plans to post a link to Gamne (or similar) from the main mailing list page? Thanks, Ezra -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Mark Reynolds Sent: Monday, July 10, 2006 9:57 AM To: users@tapestry.apache.org Subject: Re: Why I hate mailing lists Using gmane, you can access any mirrored mailing list (including all apache mailing lists): * using a web-based threaded reader with search * using a blog-like, flat interface with search * using an NNTP news reader * using any one of four variations of an rss feed You can even search across multiple mailing lists at one time. As far as I am concerned, this is much more flexible than most forums. Go to http://dir.gmane.org/gmane.comp.java.tapestry.user and try it out. With gmane, might even learn to love mailing lists! Epstein, Ezra wrote: So I wanted to read up about putting multiple portlets/pages in a single Tapestry portlet .war and went happily to the online mailing list archives and what do I find: The archives are segmented: + first by month (oh and only 3 months are online) then by a page of + n postings in a month. + there's no search feature. This is why I deplore mailing lists. They are so 1983. Why don't all teams follow Hibernate's (and others) lead and choose a simple Forum (phpBB in the case of Hibernate). It (like google/yahoo groups) is free, keeps all the old posts, is automatically topically threaded, is entirely searchable, if you're addicted to email you can get posts as emails or, if you prefer, receive daily digests. Why would anyone continue to use an outdated technology like an email list? Thanks, Ezra Epstein - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: From the online docs
Do you have a working example that provides multiple portlets from a single .war? Thanks, Ezra Epstein -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Saturday, July 08, 2006 8:41 AM To: Tapestry users Subject: Re: From the online docs Why does this imply one portlet per war?? There is clearly no such limitation. See http://tapestry.apache.org/tapestry4/tapestry-portlet/configuration.html for more... From Epstein, Ezra [EMAIL PROTECTED]: From http://tapestry.apache.org/tapestry4/tapestry-portlet/index.html The pattern of development for Tapestry portlet applications is to create a (generally) small application, consisting of just a few pages. Each Tapestry portlet within a portal page will be a completely separate instance of not just the portlet, but all the Tapestry services behind it. So if that's true it does indeed imply one portlet per war. This makes Tapestry a non-starter for us. Can someone confirm or deny this limitation? Thanks, Ezra Epstein -- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Portlets -- many in one .war ?
Can you give me an example of this configuration? Especially how one maps the different portlets to different .html/.page/.java files? The sample here implicitly only works with a single portlet: http://tapestry.apache.org/tapestry4/tapestry-portlet/configuration.html Thanks, Ezra Epstein -Original Message- From: Danny Angus [mailto:[EMAIL PROTECTED] Sent: Monday, July 10, 2006 1:10 AM To: Tapestry users Subject: Re: Portlets -- many in one .war ? Easy, Just have multiple instances of the tapestry servlet configured in your WAR once for each tapestry application. It works. d. Epstein, Ezra [EMAIL PROTECTED] wrote on 07/07/2006 20:24:13: We're looking to Tapestry for our portlet development. Basically we love what Tapestry does for servlet/web-app dev. and are hoping it can help with an in-process Portal. Reading the list I'm not optimistic. Here are the questions: 1. How do we add multiple portlets to a single .war (not multiple views of the same portlet, but multiple portlets)? 2. How do we avoid the automatic HiveMind overhead? See also: http://mail-archives.apache.org/mod_mbox/tapestry- users/200606.mbox/[EMAIL PROTECTED] Thanks, Ezra Epstein - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] *** The information in this e-mail is confidential and for use by the addressee(s) only. If you are not the intended recipient please delete the message from your computer. You may not copy or forward it or use or disclose its contents to any other person. As Internet communications are capable of data corruption Student Loans Company Limited does not accept any responsibility for changes made to this message after it was sent. For this reason it may be inappropriate to rely on advice or opinions contained in an e-mail without obtaining written confirmation of it. Neither Student Loans Company Limited or the sender accepts any liability or responsibility for viruses as it is your responsibility to scan attachments (if any). Opinions and views expressed in this e-mail are those of the sender and may not reflect the opinions and views of The Student Loans Company Limited. This footnote also confirms that this email message has been swept for the presence of computer viruses. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Why I hate mailing lists
So I wanted to read up about putting multiple portlets/pages in a single Tapestry portlet .war and went happily to the online mailing list archives and what do I find: The archives are segmented: + first by month (oh and only 3 months are online) + then by a page of n postings in a month. + there's no search feature. This is why I deplore mailing lists. They are so 1983. Why don't all teams follow Hibernate's (and others) lead and choose a simple Forum (phpBB in the case of Hibernate). It (like google/yahoo groups) is free, keeps all the old posts, is automatically topically threaded, is entirely searchable, if you're addicted to email you can get posts as emails or, if you prefer, receive daily digests. Why would anyone continue to use an outdated technology like an email list? Thanks, Ezra Epstein - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Portlets -- many in one .war ?
We're looking to Tapestry for our portlet development. Basically we love what Tapestry does for servlet/web-app dev. and are hoping it can help with an in-process Portal. Reading the list I'm not optimistic. Here are the questions: 1. How do we add multiple portlets to a single .war (not multiple views of the same portlet, but multiple portlets)? 2. How do we avoid the automatic HiveMind overhead? See also: http://mail-archives.apache.org/mod_mbox/tapestry-users/200606.mbox/[EMAIL PROTECTED] Thanks, Ezra Epstein - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
From the online docs
From http://tapestry.apache.org/tapestry4/tapestry-portlet/index.html The pattern of development for Tapestry portlet applications is to create a (generally) small application, consisting of just a few pages. Each Tapestry portlet within a portal page will be a completely separate instance of not just the portlet, but all the Tapestry services behind it. So if that's true it does indeed imply one portlet per war. This makes Tapestry a non-starter for us. Can someone confirm or deny this limitation? Thanks, Ezra Epstein