Access ASO outside of Tapestry (i.e. in Servlet Filter)?
Hi! I have to access an Application State Object in a Servlet filter - so I can't use tapestry's injection mechanism. What's the preferred way to access an ASO? I thought about access via Hivemind... but I can't find doco about this rather special case. Thanks in advance for your help! mika - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Basic HTTP Authentication in Tap 3 = Acegi + Spring ?
Hello all, My production system still runs on Tapestry 3.0.4/Hibernate/Spring. I would like to setup Basic HTTP Authentication scheme for some non-critical, but administrator-only pages (ie. usage stats etc.). For normal user pages we currently use authentication mechanism, but what I need is fast, non db authentication. My first thought is to use old-rusty HTTP Basic Authentication scheme. What is the easiest suggested way to do it in Tapestry? Can this be achieved with Acegi with Tapestry 3? How do I set up Acegi using just Spring? All of previous discussions on Acegi were in context of Tapestry 4, unfortunately (for me :) ) Any suggestions, help, guidance, links to threads I may have missed will be appreciated, Thanks in advance, Bernard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
external link to a tapestry page
Hi, i need my application to send emails with the link to the specific tapestry page. How would i generate a link? I tried extending a page with IExternalPage and using the address: http://localhost:8080/BioJazz/app?service=external/HitList What i get is RuntimeException: No engine service named 'external/HitList' is available. Link (as in ExternalService API doc): http://localhost:8080/BioJazz/app?service=externalcontext=HitList gives a null pointer exception: - org.apache.hivemind.util.Defense.notNull(Defense.java:41) - org.apache.tapestry.engine.RequestCycle.getPage(RequestCycle.java:242) - org.apache.tapestry.engine.ExternalService.service( ExternalService.java:144) - $IEngineService_10c8121ee8c.service($IEngineService_10c8121ee8c.java) Any hint? Thanks, Valdemaras Repšys
Re: DirectLink in TableValue
Thanks a lot! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
java.util.ConcurrentModificationException in portlet when trying to show ArrayList
Good day! I've writed portlet application with tapestry 4.0.2 (using TapestryApplicationPortlet). I have deployed it to our jetspeed-2 portal server. Sometimes exception is rised when some users navigates to my portlet (exception is described bellow). Any ideas why this would happen? Please, help me! Thanks! Sorry for my bad English. With best regards, Vitaly Baranovsky *** EXCEPTION *** org.apache.hivemind.ApplicationRuntimeException component [EMAIL PROTECTED] context:/WEB-INF/View.page, line 7, column 63 2 location 3 !DOCTYPE page-specification PUBLIC 4 -//Apache Software Foundation//Tapestry Specification 4.0 //EN 5 http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd; 6 7 page-specification class=net.mycompany.portal.news.NewsListData 8 9 component id=newslinelist type=For 10 binding name=source value=newslist/ 11 binding name=value value=news/ 12 binding name=element value=literal:tr/ java.util.ConcurrentModificationException java.util.AbstractList$Itr.checkForComodification(Unknown Source) java.util.AbstractList$Itr.next(Unknown Source) org.apache.tapestry.components.ForBean.renderComponent(ForBean.java:125) org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:617) org.apache.tapestry.BaseComponent.renderComponent(BaseComponent.java:92) org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:617) org.apache.tapestry.AbstractPage.renderPage(AbstractPage.java:275) org.apache.tapestry.engine.RequestCycle.renderPage(RequestCycle.java:366) org.apache.tapestry.portlet.PortletRendererImpl.renderPage(PortletRendererImpl.java:76) $PortletRenderer_10c7c3c1767.renderPage($PortletRenderer_10c7c3c1767.java) org.apache.tapestry.portlet.PortletHomeService.service(PortletHomeService.java:80) $IEngineService_10c7c3c1751.service($IEngineService_10c7c3c1751.java) org.apache.tapestry.services.impl.EngineServiceOuterProxy.service(EngineServiceOuterProxy.java:66) org.apache.tapestry.engine.AbstractEngine.service(AbstractEngine.java:248) org.apache.tapestry.services.impl.InvokeEngineTerminator.service(InvokeEngineTerminator.java:60) $WebRequestServicer_10c7c3c171f.service($WebRequestServicer_10c7c3c171f.java) $WebRequestServicer_10c7c3c171d.service($WebRequestServicer_10c7c3c171d.java) org.apache.tapestry.portlet.RenderRequestServicerToWebRequestServicerBridge.service(RenderRequestServicerToWebRequestServicerBridge.java:49) $RenderRequestServicer_10c7c3c1717.service($RenderRequestServicer_10c7c3c1717.java) $RenderRequestServicer_10c7c3c1711.service($RenderRequestServicer_10c7c3c1711.java) org.apache.tapestry.portlet.ApplicationPortlet.render(ApplicationPortlet.java:161) org.apache.jetspeed.factory.JetspeedPortletInstance.render(JetspeedPortletInstance.java:102) org.apache.jetspeed.container.JetspeedContainerServlet.doGet(JetspeedContainerServlet.java:230) javax.servlet.http.HttpServlet.service(HttpServlet.java:689) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672) org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:574) org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:499) org.apache.jetspeed.container.invoker.ServletPortletInvoker.invoke(ServletPortletInvoker.java:215) org.apache.jetspeed.container.invoker.ServletPortletInvoker.render(ServletPortletInvoker.java:126) org.apache.pluto.PortletContainerImpl.renderPortlet(PortletContainerImpl.java:119) org.apache.jetspeed.container.JetspeedPortletContainerWrapper.renderPortlet(JetspeedPortletContainerWrapper.java:120) org.apache.jetspeed.aggregator.impl.RenderingJobImpl.execute(RenderingJobImpl.java:121) org.apache.jetspeed.aggregator.impl.PortletRendererImpl.renderNow(PortletRendererImpl.java:120) org.apache.jetspeed.aggregator.impl.PageAggregatorImpl.aggregateAndRender(PageAggregatorImpl.java:199) org.apache.jetspeed.aggregator.impl.PageAggregatorImpl.aggregateAndRender(PageAggregatorImpl.java:182) org.apache.jetspeed.aggregator.impl.PageAggregatorImpl.build(PageAggregatorImpl.java:106) org.apache.jetspeed.aggregator.AggregatorValve.invoke(AggregatorValve.java:48) org.apache.jetspeed.pipeline.JetspeedPipeline$Invocation.invokeNext(JetspeedPipeline.java:166) org.apache.jetspeed.decoration.DecorationValve.invoke(DecorationValve.java:110) org.apache.jetspeed.pipeline.JetspeedPipeline$Invocation.invokeNext(JetspeedPipeline.java:166) org.apache.jetspeed.pipeline.valve.impl.ActionValveImpl.invoke(ActionValveImpl.java:147) org.apache.jetspeed.pipeline.JetspeedPipeline$Invocation.invokeNext(JetspeedPipeline.java:166)
Re: external link to a tapestry page
Valdemaras Repšys wrote: Hi, i need my application to send emails with the link to the specific tapestry page. How would i generate a link? I tried extending a page with IExternalPage and using the address: http://localhost:8080/BioJazz/app?service=external/HitList What i get is RuntimeException: No engine service named 'external/HitList' is available. Link (as in ExternalService API doc): http://localhost:8080/BioJazz/app?service=externalcontext=HitList gives a null pointer exception: - org.apache.hivemind.util.Defense.notNull(Defense.java:41) - org.apache.tapestry.engine.RequestCycle.getPage(RequestCycle.java:242) - org.apache.tapestry.engine.ExternalService.service( ExternalService.java:144) - $IEngineService_10c8121ee8c.service($IEngineService_10c8121ee8c.java) Any hint? Thanks, Valdemaras Repšys Do not form links manually, use tapestry.services.External service ( in your case ). First inject it into your page with something like: inject property=externalService object=service:tapestry.services.External / in your page file. Be sure that you have a externalService property getter like: public abstract IEngineService getExternalService(); Then, when you need to generate link, just use org.apache.tapestry.engine.ExternalServiceParameter to generate your page parameters ( name and Object[] ) and call getExternalService().getLink( your parameter object ). This will return ILink object and you will be able to call getAbsoluteURL on it, which will return required Link as a string. On the page you can probably put it using @Any component, like: a jwcid=@Any href=yourLinkgo go go/a - GL - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Basic HTTP Authentication in Tap 3 = Acegi + Spring ?
Hugo Palma wrote: I think the fastest way to achieve what you need would be to use declarative security(in the web.xml) together with friendly URLs. Ok. I've done it differently. As I don't want to rely on page urls (whether friendly or not) I've implemented simple authentication page validator. It is registered on particular pages and does the following: 1) If user sent 'Authorization' header, decode auth details and check if they're OK. If yes go to 4. If not go to 3. 2) If no 'Authorization' header found - go to 3; 3) Sent 401 server challenge with 'WWW-Authentication' header; Redirect to authentication required page. Fast and simple :-) Not super secure, but that is not what I needed. This could be improved with failed login counter to break the loop :-) Regards, Bernard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: external link to a tapestry page
Thanks for the answer, Aleksej. The problem is, this URL must be generated on a java thread (or class) that is not an instance of BasePage and is not a tapestry page. That means i have no access to ExternalService, right? Also, I can't use @Any component because this url will be sent as an email to the user (as a simple text). Valdemaras Repšys On 7/18/06, Aleksej [EMAIL PROTECTED] wrote: Valdemaras Repšys wrote: Hi, i need my application to send emails with the link to the specific tapestry page. How would i generate a link? I tried extending a page with IExternalPage and using the address: http://localhost:8080/BioJazz/app?service=external/HitList What i get is RuntimeException: No engine service named 'external/HitList' is available. Link (as in ExternalService API doc): http://localhost:8080/BioJazz/app?service=externalcontext=HitList gives a null pointer exception: - org.apache.hivemind.util.Defense.notNull(Defense.java:41) - org.apache.tapestry.engine.RequestCycle.getPage(RequestCycle.java:242) - org.apache.tapestry.engine.ExternalService.service( ExternalService.java:144) - $IEngineService_10c8121ee8c.service($IEngineService_10c8121ee8c.java) Any hint? Thanks, Valdemaras Repšys Do not form links manually, use tapestry.services.External service ( in your case ). First inject it into your page with something like: inject property=externalService object=service:tapestry.services.External / in your page file. Be sure that you have a externalService property getter like: public abstract IEngineService getExternalService(); Then, when you need to generate link, just use org.apache.tapestry.engine.ExternalServiceParameter to generate your page parameters ( name and Object[] ) and call getExternalService().getLink( your parameter object ). This will return ILink object and you will be able to call getAbsoluteURL on it, which will return required Link as a string. On the page you can probably put it using @Any component, like: a jwcid=@Any href=yourLinkgo go go/a - GL - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: external link to a tapestry page
If you can get to the HiveMind registry, you can lookup the ExternalService and use it. -Original Message- From: Valdemaras Repšys [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 18, 2006 8:27 AM To: Tapestry users Subject: Re: external link to a tapestry page Thanks for the answer, Aleksej. The problem is, this URL must be generated on a java thread (or class) that is not an instance of BasePage and is not a tapestry page. That means i have no access to ExternalService, right? Also, I can't use @Any component because this url will be sent as an email to the user (as a simple text). Valdemaras Repšys On 7/18/06, Aleksej [EMAIL PROTECTED] wrote: Valdemaras Repšys wrote: Hi, i need my application to send emails with the link to the specific tapestry page. How would i generate a link? I tried extending a page with IExternalPage and using the address: http://localhost:8080/BioJazz/app?service=external/HitList What i get is RuntimeException: No engine service named 'external/HitList' is available. Link (as in ExternalService API doc): http://localhost:8080/BioJazz/app?service=externalcontext=HitList gives a null pointer exception: - org.apache.hivemind.util.Defense.notNull(Defense.java:41) - org.apache.tapestry.engine.RequestCycle.getPage(RequestCycle.java:242) - org.apache.tapestry.engine.ExternalService.service( ExternalService.java:144) - $IEngineService_10c8121ee8c.service($IEngineService_10c8121ee8c.java) Any hint? Thanks, Valdemaras Repšys Do not form links manually, use tapestry.services.External service ( in your case ). First inject it into your page with something like: inject property=externalService object=service:tapestry.services.External / in your page file. Be sure that you have a externalService property getter like: public abstract IEngineService getExternalService(); Then, when you need to generate link, just use org.apache.tapestry.engine.ExternalServiceParameter to generate your page parameters ( name and Object[] ) and call getExternalService().getLink( your parameter object ). This will return ILink object and you will be able to call getAbsoluteURL on it, which will return required Link as a string. On the page you can probably put it using @Any component, like: a jwcid=@Any href=yourLinkgo go go/a - GL - 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: Order by which events and listeners are called
I'd suggest using pageValidate on every page EXCEPT the login page. Do the login validation in the doLogin method and set your Visit or similar object there before activating the next page. You could have a look at JumpStart for an example. http://tapestry.apache.org/ tapestry4.1/QuickStart/contributed.html Regards, Geoff On 18/07/2006, at 10:17 PM, Rui Pacheco wrote: Hi all I have a chicken and egg problem. I included a login component in my page. That component is supposed to receive the username and password from the user and process it in its form listener in order to check whether the user is valid or not. The way I see it, the user would fill the username and password, a query on the listener would check whether the user exists or not and then the page would load normally. My problem is, pageValidate, the natural place to check whether the user has permissions to load that page or not, is being called before doLogin and this makes it impossible for the user to login. The order by which events and listeners are being called is pageValidate, pageBeginRender and then doLogin. Am I wrong to assume the only way I have to validate the user is to pass the username and password into the pageValidate event and then do all the db work there? And why is pageBeginRender being called after doLogin? -- Cumprimentos, Rui Pacheco - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Administrator of this forum ?
Hi, Are there any administrators monitoring this forum ? I'd greatly appreciate someone forwarding the email contact of any administrator for this forum. My repeated submissions to be removed from the mailer are being ignored. Would appreciate some help. Thanks Frank - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Order by which events and listeners are called
Rui Pacheco wrote: Hi all Hi, My problem is, pageValidate, the natural place to check whether the user has permissions to load that page or not, is being called before doLogin and this makes it impossible for the user to login. You mean that the form does not start rewinding cause listener in pageValidate redirected the user to login page? This is how we do it. Application pages have registered pageValidate authentication listener. If user is not authenticated, listener redirects him to Login page. Login page does have pageValidate authentication listener :-) regards, Bernard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Order by which events and listeners are called
Bernard Lange wrote: redirects him to Login page. Login page does have pageValidate Correction: Login page *DOES NOT* have such pageValidate authentication listener. Forgive me this important typo :) Cheers, Bernard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Question about PageValidate
Contained within my Border I have a navigation component that contains a number of @DirectLinks. It appears that any DirecLink in that border calls the PageValidate method on the current page, I assumed that pageValidate would only get called on the page you are forwarding to, not on the page that you are leaving. ~chris On 7/17/06, James Carman [EMAIL PROTECTED] wrote: When you say direct link, do you mean a @DirectLink component which calls a listener? Or, do you mean a @PageLink? I am curious if what I have been experiencing with pageValidate is normal behavior. My pageValidate gets called when I click on a direct link that goes to another page. I would have expected pageValidate should only get called when visiting only the enclosed page. -- ~chris James Carman, President Carman Consulting, Inc. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- ~chris
Re: Order by which events and listeners are called
Rui Pacheco wrote: I implement a class called AbstractWebPage that extends BasePage and I store all functionality common to webpages there. I guess, as Geoff sugested, I'll created another abstract web page that deals uniquely with pages that need authentication. This is what I suggested too. If you've put your authentication listener in AbstractWebPage then your Login page cannot extend it any more. If you want authenticated pages and Login page share common functionality you have to move the authentication listener down in the class hierarchy i.e. to AbstractAuthenticatedWebPage. This would look like this: public class AbstractWebPage extends BasePage { common functionality hoes here } public class AbstractAuthenticatedWebPage extends AbstractWebPage { .. pageValidate authentication check listener goes here } public class LoginPage extends AbstractWebPage { .. some login listener goes logic here - no auth check done } public class SomeAppPage extends AbstractAuthenticatedWebPage { ... application page that check whether user has logged in } Another approach is to create simple non-html component, lets call it AuthenticationRequired and place it in pages which does require authentication. This may be better than page hierarchy approach if only some of your pages require authentication. Such component can look like this: public abstract class AuthenticationRequired extends AbstractComponent implements PageValidateListener { public void pageValidate(PageEvent event) { do some authentication check and redirect conditionally to login page } protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle) { // Nothing to render } } regards, Bernard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Order by which events and listeners are called
Another approach is to create simple non-html component, lets call it AuthenticationRequired and place it in pages which does require authentication. And this is another very good idea. But if I stick with the abstract authenticated class, I'll have to update code in one single place, while the component will force me to copy/paste it accross all the templates. On 7/18/06, Bernard Lange [EMAIL PROTECTED] wrote: Rui Pacheco wrote: I implement a class called AbstractWebPage that extends BasePage and I store all functionality common to webpages there. I guess, as Geoff sugested, I'll created another abstract web page that deals uniquely with pages that need authentication. This is what I suggested too. If you've put your authentication listener in AbstractWebPage then your Login page cannot extend it any more. If you want authenticated pages and Login page share common functionality you have to move the authentication listener down in the class hierarchy i.e. to AbstractAuthenticatedWebPage. This would look like this: public class AbstractWebPage extends BasePage { common functionality hoes here } public class AbstractAuthenticatedWebPage extends AbstractWebPage { .. pageValidate authentication check listener goes here } public class LoginPage extends AbstractWebPage { .. some login listener goes logic here - no auth check done } public class SomeAppPage extends AbstractAuthenticatedWebPage { ... application page that check whether user has logged in } Another approach is to create simple non-html component, lets call it AuthenticationRequired and place it in pages which does require authentication. This may be better than page hierarchy approach if only some of your pages require authentication. Such component can look like this: public abstract class AuthenticationRequired extends AbstractComponent implements PageValidateListener { public void pageValidate(PageEvent event) { do some authentication check and redirect conditionally to login page } protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle) { // Nothing to render } } regards, Bernard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Cumprimentos, Rui Pacheco
Re: Order by which events and listeners are called
Rui Pacheco wrote: And this is another very good idea. But if I stick with the abstract authenticated class, I'll have to update code in one single place, while the component will force me to copy/paste it accross all the templates. Yes indeed. Decision is up to you, what's more convienient and maintainable in your app. If number of authenticated pages will grow, the inheritance approach may be better choice. Regards, Bernard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Order by which events and listeners are called
Many thanks for all your help. This was extremelly valuable! On 7/18/06, Bernard Lange [EMAIL PROTECTED] wrote: Rui Pacheco wrote: And this is another very good idea. But if I stick with the abstract authenticated class, I'll have to update code in one single place, while the component will force me to copy/paste it accross all the templates. Yes indeed. Decision is up to you, what's more convienient and maintainable in your app. If number of authenticated pages will grow, the inheritance approach may be better choice. Regards, Bernard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Cumprimentos, Rui Pacheco
Re: help content implementation
Overlib doing Ajax calls does the trick and it does not matter what king of technology produces the pages http://www.bosrup.com/web/overlib/ Peter Dawn [EMAIL PROTECTED] wrote: has anybody tried to implement a help system using tapestry. within my web app i want to implement a help manual and i am debating on whats the best way of implementing this. just a pop-up ie window would do fine or even something in dhtml. has anybody thought of implementing something like this. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Konstantin Ignatyev PS: If this is a typical day on planet earth, humans will add fifteen million tons of carbon to the atmosphere, destroy 115 square miles of tropical rainforest, create seventy-two miles of desert, eliminate between forty to one hundred species, erode seventy-one million tons of topsoil, add 2,700 tons of CFCs to the stratosphere, and increase their population by 263,000 Bowers, C.A. The Culture of Denial: Why the Environmental Movement Needs a Strategy for Reforming Universities and Public Schools. New York: State University of New York Press, 1997: (4) (5) (p.206)
RE: help content implementation
We take Frame output and create a set of HTML pages. These are linked-in via a popup. -Original Message- From: Konstantin Ignatyev [mailto:[EMAIL PROTECTED] Sent: Tue 7/18/2006 9:47 AM To: Tapestry users Subject: Re: help content implementation Overlib doing Ajax calls does the trick and it does not matter what king of technology produces the pages http://www.bosrup.com/web/overlib/ Peter Dawn [EMAIL PROTECTED] wrote: has anybody tried to implement a help system using tapestry. within my web app i want to implement a help manual and i am debating on whats the best way of implementing this. just a pop-up ie window would do fine or even something in dhtml. has anybody thought of implementing something like this. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Konstantin Ignatyev PS: If this is a typical day on planet earth, humans will add fifteen million tons of carbon to the atmosphere, destroy 115 square miles of tropical rainforest, create seventy-two miles of desert, eliminate between forty to one hundred species, erode seventy-one million tons of topsoil, add 2,700 tons of CFCs to the stratosphere, and increase their population by 263,000 Bowers, C.A. The Culture of Denial: Why the Environmental Movement Needs a Strategy for Reforming Universities and Public Schools. New York: State University of New York Press, 1997: (4) (5) (p.206)
Re: Creating new hivemind service
I think you have to do it indirectly by injecting the ApplicationManager into your service. Then in your service, retrieve the desired ASO using the ApplicationManager. There is a how-to on this at the following. http://lombok.demon.co.uk/tapestry4Demo/Inject.html Shing --- [EMAIL PROTECTED] wrote: Hi, I have a application object defined in my hivemodule.xml: contribution configuration-id=tapestry.state.ApplicationObjects state-object name=ApplicationSession scope=application create-instance class=mypackage.ApplicationSession / /state-object /contribution I have a new engine service that I am trying to create: service-point id=ExcelToBrowser interface=org.apache.tapestry.engine.IEngineService invoke-factory model=singleton construct class=mypackage.ExcelToBrowser set-object property=linkFactory value=service:tapestry.url.LinkFactory / set-object property=applicationSession value= / /construct /invoke-factory /service-point What do I need to put in the set-object property to access ApplicationSession? Thanks in advance, Amir - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Home page : http://uk.geocities.com/matmsh/index.html ___ To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: external link to a tapestry page
You're on the right track by using an External link. Make sure your page implements IExternalPage. We do something similar with one page that we wanted to be bookmarkable and the URL Format is quite similar to what you're trying. You'll still have to workaround problems of interdependency between apps if the URL format changes on a different version of Tapestry, and this doesn't account for authentication/security measures, but it's a start. /bd -Original Message- From: Valdemaras Repšys [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 18, 2006 5:27 AM To: Tapestry users Subject: Re: external link to a tapestry page Thanks for the answer, Aleksej. The problem is, this URL must be generated on a java thread (or class) that is not an instance of BasePage and is not a tapestry page. That means i have no access to ExternalService, right? Also, I can't use @Any component because this url will be sent as an email to the user (as a simple text). Valdemaras Repšys On 7/18/06, Aleksej [EMAIL PROTECTED] wrote: Valdemaras Repšys wrote: Hi, i need my application to send emails with the link to the specific tapestry page. How would i generate a link? I tried extending a page with IExternalPage and using the address: http://localhost:8080/BioJazz/app?service=external/HitList What i get is RuntimeException: No engine service named 'external/HitList' is available. Link (as in ExternalService API doc): http://localhost:8080/BioJazz/app?service=externalcontext=HitList gives a null pointer exception: - org.apache.hivemind.util.Defense.notNull(Defense.java:41) - org.apache.tapestry.engine.RequestCycle.getPage(RequestCycle.java:242) - org.apache.tapestry.engine.ExternalService.service( ExternalService.java:144) - $IEngineService_10c8121ee8c.service($IEngineService_10c8121ee8c.java) Any hint? Thanks, Valdemaras Repšys Do not form links manually, use tapestry.services.External service ( in your case ). First inject it into your page with something like: inject property=externalService object=service:tapestry.services.External / in your page file. Be sure that you have a externalService property getter like: public abstract IEngineService getExternalService(); Then, when you need to generate link, just use org.apache.tapestry.engine.ExternalServiceParameter to generate your page parameters ( name and Object[] ) and call getExternalService().getLink( your parameter object ). This will return ILink object and you will be able to call getAbsoluteURL on it, which will return required Link as a string. On the page you can probably put it using @Any component, like: a jwcid=@Any href=yourLinkgo go go/a - GL - 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: Administrator of this forum ?
I'm a moderator of the forum, but if it won't un-subscribe you when sending an email to [EMAIL PROTECTED] there's not much more I can do about it. Could it be that the actual email address you are signed up to the list with is different than the return address the list sees? This might be the cause of your failures. I noticed that someone in this thread semerau seemed to have multiple identities in their email header. On 7/18/06, Blackwings [EMAIL PROTECTED] wrote: So, the bot is dead... Try to contact directly the main site. 2006/7/18, [EMAIL PROTECTED] [EMAIL PROTECTED]: I have been trying to unsubscribe for awhile, too. No luck. Date: Tue, 18 Jul 2006 15:08:06 +0200 From: [EMAIL PROTECTED] To: users@tapestry.apache.org Subject: Re: Administrator of this forum ? It is an automatic process normally. You just have to send an email to [EMAIL PROTECTED] the content is not important I think. The goal is for the bot to receive a mail from an adress and remove the adress from the list BW 2006/7/18, Frank Misa [EMAIL PROTECTED]: Hi, Are there any administrators monitoring this forum ? I'd greatly appreciate someone forwarding the email contact of any administrator for this forum. My repeated submissions to be removed from the mailer are being ignored. Would appreciate some help. Thanks Frank - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Express yourself: design your homepage the way you want it with Live.com . http://www.live.com/getstarted -- Jesse Kuhnert Tacos/Tapestry, team member/developer Open source based consulting work centered around dojo/tapestry/tacos/hivemind.
Re: handling file downloads
I finally got back to this. I wrote up a service to send the csv files (using http://lombok.demon.co.uk/serviceHowTo/app - thanks Shing for the example - well done), which all works fine, but I have one question (which could easily be addressed by using the unsanctioned approach mentioned in the FAQ - thanks Nick). Imagine you've done a bunch of work in home.html/home.java to create a set of data. Now you're ready to save it as a csv file. You click on the link which invokes the csv service, but it's unrealistic to pass all the parameters needed to re-create the data set to the service, or to even pass the data set itself (via a parameter). Home.java, of course, knows all about this set of data (as does the session). So how can the service be told to get the data set from Home.java (or from the session)? One way around it seems to be to use a regular @DirectLink, which would create the file and then redirect to the csv service, which would then stream the file (instead of assembling it on the fly). It would be nicer though if it can be done without writing intermediate files. Any hints? Thanks, J On 10-Jul-06, at 4:49 PM, Julian Wood wrote: I would like to click a link, have a listener assemble a CSV file, and send it back as a download (ie change a few headers behind the scenes like Content-Type and Content-Disposition). -- Julian Wood [EMAIL PROTECTED] Software Engineer Teaching Learning Centre University of Calgary http://tlc.ucalgary.ca
Re: handling file downloads
A possibility is to store the parameters (that are needed to construct the data set) in a session ASO. You can inject the above session ASO into your service. So that the data set can be constructed in your service when the service is called. Shing --- Julian Wood [EMAIL PROTECTED] wrote: I finally got back to this. I wrote up a service to send the csv files (using http://lombok.demon.co.uk/serviceHowTo/app - thanks Shing for the example - well done), which all works fine, but I have one question (which could easily be addressed by using the unsanctioned approach mentioned in the FAQ - thanks Nick). Imagine you've done a bunch of work in home.html/home.java to create a set of data. Now you're ready to save it as a csv file. You click on the link which invokes the csv service, but it's unrealistic to pass all the parameters needed to re-create the data set to the service, or to even pass the data set itself (via a parameter). Home.java, of course, knows all about this set of data (as does the session). So how can the service be told to get the data set from Home.java (or from the session)? One way around it seems to be to use a regular @DirectLink, which would create the file and then redirect to the csv service, which would then stream the file (instead of assembling it on the fly). It would be nicer though if it can be done without writing intermediate files. Any hints? Thanks, J On 10-Jul-06, at 4:49 PM, Julian Wood wrote: I would like to click a link, have a listener assemble a CSV file, and send it back as a download (ie change a few headers behind the scenes like Content-Type and Content-Disposition). -- Julian Wood [EMAIL PROTECTED] Software Engineer Teaching Learning Centre University of Calgary http://tlc.ucalgary.ca Home page : http://uk.geocities.com/matmsh/index.html ___ All new Yahoo! Mail The new Interface is stunning in its simplicity and ease of use. - PC Magazine http://uk.docs.yahoo.com/nowyoucan.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: A bit OT: how to manage database connections for multiple components rendered simultaneously.
1) To have 9 pages rendering simultaneously you need to have very very high traffic. 2) We have systems with 500 connections to the database running just fine. It is easier to throw hardware on a well-known problem (at least to some extent) than to spend cycles over-engineering. 3) Think of caching the data if possible or think of implementing an aggregator that can send a single request on behalf of all components and distribute the results to them. - Original Message - From: Rui Pacheco [EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org Sent: Tuesday, July 18, 2006 6:30 PM Subject: Re: A bit OT: how to manage database connections for multiple components rendered simultaneously. Still, if the components were all rendered at the same time, you would be tying up 9 connections simultaneously, and that would kill your response times. On 7/18/06, kranga [EMAIL PROTECTED] wrote: Yes I would be fine with opening/closing 9 connections to the database if they are from a connection pool because then I would be opening/closing 0 connections in reality! - Original Message - From: James Carman [EMAIL PROTECTED] To: 'Tapestry users' users@tapestry.apache.org Sent: Monday, July 17, 2006 12:48 PM Subject: RE: A bit OT: how to manage database connections for multiple components rendered simultaneously. So, you'd be okay with opening/closing 9 connections to the database during each request cycle? I'd think it would be better to just use one during the entire request cycle. -Original Message- From: kranga [mailto:[EMAIL PROTECTED] Sent: Monday, July 17, 2006 12:40 PM To: Tapestry users Subject: Re: A bit OT: how to manage database connections for multiple components rendered simultaneously. Even if all components ask for their own connection, assuming components release connections when they are done, you would still expect only 1 connection in use (though it may physically travel on upto 8 different connection, there is only 1 connection open at any given time). A much better optimization would be to add an observer/mediator style pattern - a data provider that each component is able to tell what data it needs (perhaps in the renderComponent method) and when the first request for the data is made, the provider creates a SQL encompassing all requests, gets it and is able to dish it out. However, I personally (without any more info) would classify this optimization as pre-mature. 8 requests to the database may only result in about 400ms while I have a monster elsewhere slowing everything down. Plus you need to take into account how often the index page is actually invoked. - Original Message - From: James Carman [EMAIL PROTECTED] To: 'Tapestry users' users@tapestry.apache.org Sent: Monday, July 17, 2006 11:36 AM Subject: RE: A bit OT: how to manage database connections for multiple components rendered simultaneously. Unless all components ask for their own connection, which I think is what they were saying. -Original Message- From: kranga [mailto:[EMAIL PROTECTED] Sent: Monday, July 17, 2006 11:28 AM To: Tapestry users Subject: Re: A bit OT: how to manage database connections for multiple components rendered simultaneously. Unless I'm missing something, you will not be using 9 connections as the components will render in serial order. So you will make 9 requests over a single connection. - Original Message - From: James Carman [EMAIL PROTECTED] To: 'Tapestry users' users@tapestry.apache.org; 'Tapestry users' tapestry-user@jakarta.apache.org Sent: Monday, July 17, 2006 10:19 AM Subject: RE: A bit OT: how to manage database connections for multiple components rendered simultaneously. All code within one request can easily just use one connection. That's what we do with Tapernate. -Original Message- From: Rui Pacheco [mailto:[EMAIL PROTECTED] Sent: Monday, July 17, 2006 10:13 AM To: Tapestry users; Tapestry users Subject: A bit OT: how to manage database connections for multiple components rendered simultaneously. Hi all This is not a pure Tapestry question, but I believe you have seen this before and might be able to give me some guiding light. I have a web application, which I am splitting into several fragments, ie, components, each one rendering content stored in a database. I just realised my index page would have 9 such fragments and if each is to retrieve a connection from the pool to get its content, the stress on the db server might be crazy, even if each request is quite short. I have a connection pool, but even with that I don't believe its healthy to use 9 connections at the same time. What about the other users? How would you deal with this issue? -- Cumprimentos, Rui Pacheco - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional
$template option using annotations
I've built a Border component using only annotations. I would like to put the .html template in /context/basic/Border.html. And in general I would like to organize my components in various directories as I expect them to grow pretty quickly. Is there an option for specifying the template location for a component using only annotations that is the equivalent of putting an asset named $template in the .jwc file? Thanks, Rowland - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Scheduling tasks
+1 on quartz On 7/19/06, Jesse Kuhnert [EMAIL PROTECTED] wrote: I would use quartz. It took me about half an hour to integrate with hivemind. On 7/18/06, Martin Strand [EMAIL PROTECTED] wrote: Hi guys. How can I schedule a task with Hivemind? I want something similar to crond in Linux - a service should be notified every n minutes. Ideally the service would implement Runnable and the scheduler would invoke run(). I've heard of Quartz, but I've never used it before and I'm not sure how to use it together with Hivemind. What other options are there? Thanks for any help, Martin - 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.