RE: T5: Preparing a pristine object for re-use
the default scope of a service is singleton. i you want a new DAO on every request you can annotate you method with : @Scope(IOCConstants.PERTHREAD_SCOPE) if you are using tapestry-hibernate you can have your session injected into a singleton scoped service and tapestry will take care of it. please see the documentation and search the mailinglist. there was a very good thread a week ago e.g. http://www.nabble.com/T5%3A-%27wrapping%27-hibernate-DAOs-as-services-tf4710067.html#a13466570 g, kris Andy Huhn [EMAIL PROTECTED] 07.11.2007 05:11 Bitte antworten an Tapestry users users@tapestry.apache.org An Tapestry users users@tapestry.apache.org Kopie Thema T5: Preparing a pristine object for re-use Hello, I have a DAO that I want to re-initialize every time it is injected (that is, the DAO has state that I want to reset to make it pristine). I thought I could do it in the constructor for the DAO, since I am defining the service as follows in my AppModule: public static AccountDAO buildAccountDAO( Session prmSn ) { return new AccountDAOImpl( prmSn ); } But it appears the constructor is only being executed the first time the DAO is injected, it is not being executed on subsequent injections. Am I missing something? Thanks, Andy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
T5 - change to .TML file picked up automatically
Hi, Is Tapestry 5 supposed to pick up changes I make to my .tml files automatically? Eclipse WTP does the hot code swapping of the Java class correctly but when I change the contents of the .TML file they don't seem to be picked up. Thanks! -- View this message in context: http://www.nabble.com/T5---change-to-.TML-file-picked-up-automatically-tf4763484.html#a13623727 Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5 how to control login state
Hi Chris, Is the wiki article updated? I'd like to try that approach. the wiki site seems down as of this moment. A.C. Chris Lewis-5 wrote: Marcus, I would like to expand on this as it does seem perferable. chris Marcus wrote: Hi Massimo, Can you post some code about this RequestFilter solution ? Thanks, Marcus - 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] -- View this message in context: http://www.nabble.com/T5-how-to-control-login-state-tf4744201.html#a13623915 Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
HandyTapestry 1.3, Tapestry IntelliJ Idea plugin
HandyTapestry 1.3 released If you develop a http://tapestry.apache.org Tapestry web application using http://www.jetbrains.com/idea IntelliJ Idea then try http://handyedit.com/handytapestry.html HandyTapestry plugin! The HandyTapestry plugin for IntelliJ Idea helps you to develop Tapestry web applications faster. The plugin adds helpful completions and navigations in the HTML template. The Create Tapestry component dialog helps to create components. The plugin supports Tapestry 4.0 http://handyedit.com/handytapestry.html Read more... What's new: - Completion / navigation in component: attribute values - Smart completion of page attribute values. Type page name prefix and press Ctrl-Shift-Space! - Smart completion of the class name in OGNL constants. Type @Cust in OGNL expression and press Ctrl-Shift-Space to see all classes which name starts with Cust! - Page structure tool window - Support components without component specification - Fixes in the component libraries handling http://handyedit.com/whatsnew.html Read more... -- View this message in context: http://www.nabble.com/HandyTapestry-1.3%2C-Tapestry-IntelliJ-Idea-plugin-tf4763568.html#a13623957 Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Simple servlet with xml output - to tapestry
Turns out the patch is too big to apply. Fernando, is it possible to share a build with the patch applied? I am sure other people will have the save need and would surely appreciated it thanks Thanos Fernando Padilla wrote: Yes you can output XML directly from the template with some caveats. 1) By default the contentType is text/html, if you want to change that you can override it by using this annotation on your page class file: @Meta(tapestry.response-content-type=text/xml) 2) namespaces are totally ignored and stripped out. 3) if you use any of the special html elements, then it uses the old html method of not actually closing the tags ( br, , etc ). So essentially it outputs invalid xml. You might have to do some post processing to clean it up.. possible work around: If you need namespaces, or if you need to avoid the special html tag handling, you need to look at JIRA issue TAPESTRY-1600. Go there and vote on the bug, it also has a patch if you're stuck and feeling adventurous. I have been using the patch for over a month on production, and have gotten response from another person that they are pretty happy with it. Go vote for it, for some reason we have gotten zero response from the T5 developers on reviewing the patch. If applying the patch is too much for you and there is still interest, maybe I'll have to maintain a tapestry build with the patch applied.. llonely wrote: Many thanks Thiago, this is surprisingly helpful! Is XML output possible on template level? Having a template with the basic structure and update it based on parameter values. BR Thiago H de Paula Figueiredo-2 wrote: On Wed, 31 Oct 2007 09:22:47 -0200, llonely [EMAIL PROTECTED] wrote: Hi all, I am currently testing tapestry and trying to convert a simple servlet. I have a typical servlet that gets parameters and returns xml Generate the XML output using any method you fancy and then return a StreamResponse (in this case, a TextStreamResponse) in your onActivate method. Tapestry 5 will not issue a redirect as it does with normal pages. One example is in Howard's blog: http://tapestryjava.blogspot.com/2007/08/handling-direct-urls-in-tapestry-5.html. :) In previous versions this kind of situation was hard to implement, but in Tapestry 5 it's a piece of cake. :) -- Thiago H. de Paula Figueiredo Desenvolvedor, Instrutor e Consultor de Tecnologia Eteg Tecnologia da Informação Ltda. http://www.eteg.com.br - 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] -- View this message in context: http://www.nabble.com/Simple-servlet-with-xml-output---to-tapestry-tf4724274.html#a13625882 Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5 how to control login state
Hi Chris, I'm interested in your approach and read already the wiki, you spent a lot to explain the concept behind, can you also provide a simple/complete sample code for that? thanks. A.C. Chris Lewis-5 wrote: I'll update the wiki. chris lyifan wrote: Thanks a lot everyone. Finally the BasePase way works But the d -- View this message in context: http://www.nabble.com/T5-how-to-control-login-state-tf4744201.html#a13625879 Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: T5 how to control login state
Chris, Thanks for your insightful wiki on this subject. This seems a much lighter weight solution to the Acegi Authentication. ( the latter requires many more jar file downloads related to Spring) I do have a question that's been on my mind for some time now. Is it standard practice in Tapestry for page redirects to throw exceptions? Is there another method that preserves the current state after a redirection? Say for instance, a user bookmarks a page and returns to it two days later. How does one determine the resultant page after a successful login? Using the current code, the user's session would be invalid and forced to the login page when trying to access the bookmark via an exception. How would you save the destination url for the user after he/she logs in successfully? Rather is there a standard way that Tapestry does this? Would you have to put it into the ASM and then access the ASM during login to determine the users destination? Is there another mechanism? Thanks, Michael -Original Message- From: Chris Lewis [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 07, 2007 8:10 AM To: Tapestry users Subject: Re: T5 how to control login state I've created a new article to supplement the first, showing how to access thread-specific ASOs from a singleton service. It's on the wiki: http://wiki.apache.org/tapestry/Tapestry5HowToCreateADispatcher2 sincerely, chris Angelo Chen wrote: Hi Chris, I'm interested in your approach and read already the wiki, you spent a lot to explain the concept behind, can you also provide a simple/complete sample code for that? thanks. A.C. Chris Lewis-5 wrote: I'll update the wiki. chris lyifan wrote: Thanks a lot everyone. Finally the BasePase way works But the d - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
persists session set
is this the correct way to persists session? .page property name=selectedLocales persist=session initial-value=new java.util.HashSet()/ .java public abstract Set getSelectedLocales(); public abstract void setSelectedLocales(Set set); public void setCheckboxSelected(boolean bSelected) { TheLocale objLocale = getCurrentLocale(); if (bSelected) getSelectedLocales().add(objLocale); else getSelectedLocales().remove(objLocale); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5 - change to .TML file picked up automatically
That may be an issue with Eclipse WTP. That's why I use JettyLauncher. On Nov 7, 2007 1:21 AM, trekmbikes [EMAIL PROTECTED] wrote: Hi, Is Tapestry 5 supposed to pick up changes I make to my .tml files automatically? Eclipse WTP does the hot code swapping of the Java class correctly but when I change the contents of the .TML file they don't seem to be picked up. Thanks! -- View this message in context: http://www.nabble.com/T5---change-to-.TML-file-picked-up-automatically-tf4763484.html#a13623727 Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Howard M. Lewis Ship Partner and Senior Architect at Feature50 Creator Apache Tapestry and Apache HiveMind - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: persists session set
public void setCheckboxSelected(boolean bSelected) { Set locales = getSelectedLocales(); TheLocale objLocale = getCurrentLocale(); if (bSelected) locales.add(objLocale); else locales.remove(objLocale); setSelectedLocales(locales); --- } Tapestry and the session manager won't recognize that you've made changes to your locales Set unless you explicitly call setSelectedLocales again. I tried once to add a proxy mechanism to common classes like collections and such so that Tapestry could automatically detect these changes as well but it proved to be too error prone and cause problems with hibernate / other persistence libraries. On Nov 7, 2007 11:07 AM, cometta [EMAIL PROTECTED] wrote: is this the correct way to persists session? .page property name=selectedLocales persist=session initial-value=new java.util.HashSet()/ .java public abstract Set getSelectedLocales(); public abstract void setSelectedLocales(Set set); public void setCheckboxSelected(boolean bSelected) { TheLocale objLocale = getCurrentLocale(); if (bSelected) getSelectedLocales().add(objLocale); else getSelectedLocales().remove(objLocale); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Jesse Kuhnert Tapestry/Dojo 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]
Re: T4.1.4-SNAPSHOT issue migrating from 4.0.2 with PopupLinkSubmit
I think you need to pass in this to your script execute call, the current method you are executing is deprecated. For the javascript calls you can refer to http://tapestry.apache.org/tapestry4.1/javascript/index.html and http://tapestry.apache.org/tapestry4.1/jsdoc/index.html where you should find the new function tapestry.form.submit(form) (with some other additional documented optional arguments ) On Nov 6, 2007 7:36 PM, Dom Couldwell [EMAIL PROTECTED] wrote: We have a link on a page that does a submit and pops up a new window once the form has been submitted. The code is based on the PopupLinkSubmit example here: http://wiki.apache.org/tapestry/PopupLinkSubmit This all works fine on 4.0.2 but under 4.1.4-SNAPSHOT we get the following error when the page opens up: 2007-11-06 18:35:10,197, ERROR, [org.apache.tapestry.services.impl.HiveMindExpressionCompiler], line 227, Error generating OGNL statements for expression class with root {href=javascript:submitPopupLink('editorForm', 'PopupLinkSubmit','/GQ/Waiting.page');, [EMAIL PROTECTED]/editor.editorForm], class=action, popupLink=/GQ/Waiting.page, name=PopupLinkSubmit} org.apache.hivemind.ApplicationRuntimeException: Unable to add method void set(ognl.OgnlContext, java.lang.Object, java.lang.Object) to class $ASTProperty_116174fa4f8: [source error] put(java.lang.String,java.lang.Object) not found in java.lang.Object at org.apache.tapestry.enhance.ClassFabImpl.addMethod(ClassFabImpl.java:278) at org.apache.tapestry.services.impl.HiveMindExpressionCompiler.compileExpression(HiveMindExpressionCompiler.java:217) at ognl.OgnlRuntime.compileExpression(OgnlRuntime.java:523) at ognl.Ognl.compileExpression(Ognl.java:141) ... Caused by: javassist.CannotCompileException: [source error] put(java.lang.String,java.lang.Object) not found in java.lang.Object at javassist.CtBehavior.setBody(CtBehavior.java:347) at javassist.CtBehavior.setBody(CtBehavior.java:316) at org.apache.tapestry.enhance.ClassFabImpl.addMethod(ClassFabImpl.java:272) ... 137 more Caused by: compile error: put(java.lang.String,java.lang.Object) not found in java.lang.Object at javassist.compiler.TypeChecker.atMethodCallCore(TypeChecker.java:716) at javassist.compiler.TypeChecker.atCallExpr(TypeChecker.java:681) at javassist.compiler.JvstTypeChecker.atCallExpr(JvstTypeChecker.java:156) at javassist.compiler.ast.CallExpr.accept(CallExpr.java:45) at javassist.compiler.CodeGen.doTypeCheck(CodeGen.java:235) at javassist.compiler.CodeGen.atStmnt(CodeGen.java:323) at javassist.compiler.ast.Stmnt.accept(Stmnt.java:49) at javassist.compiler.CodeGen.atStmnt(CodeGen.java:344) at javassist.compiler.ast.Stmnt.accept(Stmnt.java:49) at javassist.compiler.CodeGen.atMethodBody(CodeGen.java:285) at javassist.compiler.Javac.compileBody(Javac.java:212) at javassist.CtBehavior.setBody(CtBehavior.java:341) ... 139 more Here's what's on the page: a href=# jwcid=@PopupLinkSubmit listener=listener:openEditorGraph popuppage=Waiting styleClass=action windowWidth=840 windowHeight=550 Generate Plot /a Here's PopupLinkSubmit.script ?xml version=1.0? !DOCTYPE script PUBLIC -//Apache Software Foundation//Tapestry Script Specification 3.0//EN http://jakarta.apache.org/tapestry/dtd/Script_3_0.dtd; script input-symbol key=name class=java.lang.String required=yes/ input-symbol key=popupLink class=java.lang.String required=yes/ input-symbol key=form class=org.apache.tapestry.IForm required=yes/ input-symbol key=class class=java.lang.String required=no/ let key=href javascript:submitPopupLink('${form.name}', '${name}','${popupLink}'); /let let key=class ${class} /let /script Which comes out as: a href=javascript:submitPopupLink('editorForm', 'PopupLinkSubmit','/GQ/Waiting.page'); class=action Generate Plot /a The Javascript we're rendering in PopupLinkSubmit.java comes out as: function submitPopupLink(form, elementId, url) { var windowName = 'RDQGraphPopup'; var randomNumber = Math.floor(Math.random()*1000); windowName = windowName+randomNumber; aWindow = window.open(url, windowName, 'width=840, height=800, scrollbars=yes,resizable=yes', false); aWindow.focus(); var form = document.getElementById(form); form.target=windowName; form.events.submit(elementId); form.target=''; } I can supply the rest of the source if required but it's basically following the example I mentioned at the top. The rendered versions of the link and the Javascript are the same as under 4.0.2 but we get the above error in the back end and the link does not work. We get a Javascript error stating that 'events' is null or not an object. This is referring to this line:
Re: T4.1.4-SNAPSHOT issue migrating from 4.0.2 with PopupLinkSubmit
OK we updated the generated Javascript with the new version of the Javascript function function submitPopupLink(form, elementId, url) { var windowName = 'RDQGraphPopup'; var randomNumber = Math.floor(Math.random()*1000); windowName = windowName+randomNumber; aWindow = window.open(url, windowName, 'width=840, height=550, scrollbars=yes,resizable=yes', false); aWindow.focus(); var form = document.getElementById(form); form.target=windowName; tapestry.form.submit(form, elementId); form.target=''; } this seems to allow the popup link to work but we're still getting the errors in the back end. They don't seem to have any ill effect but they are generated each time the page serves. For script generation we are using the version of the call passing this: getScript().execute(this, cycle, pageRenderSupport, symbols); (If this is the call Jessie meant) Any ideas as to what is causing the error? Even though it does not seem to be causing any problems I've a feeling it's gonna bite us in the ass at some point... Here's PopupLinkSubmit.java if it's any help. As I mentioned before it's mostly copied from the online example I cited before. public abstract class PopupLinkSubmit extends CustomSubmit { /** * The name of an [EMAIL PROTECTED] org.apache.tapestry.IRequestCycle}attribute in which * the current submit link is stored. LinkSubmits do not nest. */ public static final String ATTRIBUTE_NAME = actualis.web.tapestry.PopupLinkSubmit; public static final String ATTRIBUTE_NAME_SCRIPT = actualis.web.tapestry.PopupLinkSubmitScript; /** * The name of an [EMAIL PROTECTED] org.apache.tapestry.IRequestCycle}attribute in which * the link submit component that generates the javascript function is stored. * The function is only required once per page (containing a form with a * non-disabled LinkSubmit) */ public static final String ATTRIBUTE_FUNCTION_NAME = actualis.web.tapestry.PopupLinkSubmit_function; @InjectObject(engine-service:external) public abstract IEngineService getExternalService(); @Parameter(required=false) public abstract String getStyleClass(); @Parameter(defaultValue=900, required=false) public abstract String getWindowHeight(); @Parameter(defaultValue=600, required=false) public abstract String getWindowWidth(); /** * Checks the submit name ([EMAIL PROTECTED] FormConstants#SUBMIT_NAME_PARAMETER}) to * see if it matches this LinkSubmit's assigned element name. */ @Override protected boolean isClicked(IRequestCycle cycle, String name) { String value = cycle.getParameter(FormConstants.SUBMIT_NAME_PARAMETER); return name.equals(value); } /** * * @param cycle * @return */ public ILink getLink(IRequestCycle cycle) { Object[] pageParameters = DirectLink.constructServiceParameters(getPopupParameters()); ExternalServiceParameter esp = new ExternalServiceParameter( getPopupPage(), pageParameters); return getExternalService().getLink(false, esp); } public abstract Object getPopupParameters(); public abstract String getPopupPage(); /** * @see org.apache.tapestry.form.AbstractFormComponent#renderFormComponent(org.apache.tapestry.IMarkupWriter, * org.apache.tapestry.IRequestCycle) */ @Override @SuppressWarnings(unchecked) protected void renderFormComponent(IMarkupWriter writer, IRequestCycle cycle) { boolean disabled = isDisabled(); if (!disabled) { PageRenderSupport pageRenderSupport = TapestryUtils.getPageRenderSupport(cycle,this); if (cycle.getAttribute(ATTRIBUTE_NAME_SCRIPT) == null) { BodyBuilder builder = new BodyBuilder(); builder.addln(); builder.addln(function {0}(form, elementId, url), submitPopupLink); builder.begin(); builder.addln(var windowName = 'RDQGraphPopup';); builder.addln(var randomNumber = Math.floor(Math.random()*1000);); builder.addln(windowName = windowName+randomNumber;); builder.addln(aWindow = window.open(url, windowName, + 'width=+getWindowWidth()+, height=+getWindowHeight() + , scrollbars=yes,resizable=yes' + , false);); builder.addln(aWindow.focus();); builder.addln(var form = document.getElementById(form);); builder.addln(form.target=windowName;); builder.addln(tapestry.form.submit(form, elementId);); builder.addln(form.target='';); builder.end(); pageRenderSupport.addBodyScript( this, builder.toString()); cycle.setAttribute(ATTRIBUTE_NAME_SCRIPT, this); } IForm form = getForm(); String slink = getLink(cycle).getURL(null, true); Map symbols =
Re: T4.1.4-SNAPSHOT issue migrating from 4.0.2 with PopupLinkSubmit
FYI, if we remove the PopupLinkSubmit component we don't get the errors appearing in the logs so it's definitely related to something in that component Dom --- This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: T5 how to control login state
Thiago, I know that on pages or components navigation is controlled by the return type. ( page class, String, etc) My question has to do with how to deal with navigation before any page or component renders. In other frameworks you can have a workflows specified outside the application in XML, a database, etc. These workflows determine page flow. In tapestry, however this is not the case that I've seen. I've partially implemented what Chris just posted about the Dispatcher but using the RequestFilter like Massimo suggested. What I don't know how to do is to cleanly specify where to go after logging the user in without having to manually stuff something into the HttpSession about where to return in the page flow. Any ideas? --Michael -Original Message- From: Thiago H de Paula Figueiredo [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 07, 2007 10:52 AM To: Tapestry users Subject: Re: T5 how to control login state On Wed, 07 Nov 2007 16:40:45 -0200, Nguyen, Michael [EMAIL PROTECTED] wrote: Chris, Is it standard practice in Tapestry for page redirects to throw exceptions? That's true for Tapestry 4.x, but not for Tapestry 5. -- Thiago H. de Paula Figueiredo Desenvolvedor, Instrutor e Consultor de Tecnologia Eteg Tecnologia da Informação Ltda. http://www.eteg.com.br - 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: T4.1.4-SNAPSHOT issue migrating from 4.0.2 with PopupLinkSubmit
On 11/7/07, Jesse Kuhnert [EMAIL PROTECTED] wrote: I think you need to pass in this to your script execute call, the current method you are executing is deprecated. In fact, I removed it in 4.1.4-SNAPSHOT... it was deprecated since 4.1.1 For the javascript calls you can refer to http://tapestry.apache.org/tapestry4.1/javascript/index.html and http://tapestry.apache.org/tapestry4.1/jsdoc/index.html where you should find the new function tapestry.form.submit(form) (with some other additional documented optional arguments ) On Nov 6, 2007 7:36 PM, Dom Couldwell [EMAIL PROTECTED] wrote: We have a link on a page that does a submit and pops up a new window once the form has been submitted. The code is based on the PopupLinkSubmit example here: http://wiki.apache.org/tapestry/PopupLinkSubmit This all works fine on 4.0.2 but under 4.1.4-SNAPSHOT we get the following error when the page opens up: 2007-11-06 18:35:10,197, ERROR, [org.apache.tapestry.services.impl.HiveMindExpressionCompiler], line 227, Error generating OGNL statements for expression class with root {href=javascript:submitPopupLink('editorForm', 'PopupLinkSubmit','/GQ/Waiting.page');, [EMAIL PROTECTED]/editor.editorForm], class=action, popupLink=/GQ/Waiting.page, name=PopupLinkSubmit} org.apache.hivemind.ApplicationRuntimeException: Unable to add method void set(ognl.OgnlContext, java.lang.Object, java.lang.Object) to class $ASTProperty_116174fa4f8: [source error] put(java.lang.String,java.lang.Object) not found in java.lang.Object at org.apache.tapestry.enhance.ClassFabImpl.addMethod(ClassFabImpl.java:278) at org.apache.tapestry.services.impl.HiveMindExpressionCompiler.compileExpression(HiveMindExpressionCompiler.java:217) at ognl.OgnlRuntime.compileExpression(OgnlRuntime.java:523) at ognl.Ognl.compileExpression(Ognl.java:141) ... Caused by: javassist.CannotCompileException: [source error] put(java.lang.String,java.lang.Object) not found in java.lang.Object at javassist.CtBehavior.setBody(CtBehavior.java:347) at javassist.CtBehavior.setBody(CtBehavior.java:316) at org.apache.tapestry.enhance.ClassFabImpl.addMethod(ClassFabImpl.java:272) ... 137 more Caused by: compile error: put(java.lang.String,java.lang.Object) not found in java.lang.Object at javassist.compiler.TypeChecker.atMethodCallCore(TypeChecker.java:716) at javassist.compiler.TypeChecker.atCallExpr(TypeChecker.java:681) at javassist.compiler.JvstTypeChecker.atCallExpr(JvstTypeChecker.java:156) at javassist.compiler.ast.CallExpr.accept(CallExpr.java:45) at javassist.compiler.CodeGen.doTypeCheck(CodeGen.java:235) at javassist.compiler.CodeGen.atStmnt(CodeGen.java:323) at javassist.compiler.ast.Stmnt.accept(Stmnt.java:49) at javassist.compiler.CodeGen.atStmnt(CodeGen.java:344) at javassist.compiler.ast.Stmnt.accept(Stmnt.java:49) at javassist.compiler.CodeGen.atMethodBody(CodeGen.java:285) at javassist.compiler.Javac.compileBody(Javac.java:212) at javassist.CtBehavior.setBody(CtBehavior.java:341) ... 139 more Here's what's on the page: a href=# jwcid=@PopupLinkSubmit listener=listener:openEditorGraph popuppage=Waiting styleClass=action windowWidth=840 windowHeight=550 Generate Plot /a Here's PopupLinkSubmit.script ?xml version=1.0? !DOCTYPE script PUBLIC -//Apache Software Foundation//Tapestry Script Specification 3.0//EN http://jakarta.apache.org/tapestry/dtd/Script_3_0.dtd; script input-symbol key=name class=java.lang.String required=yes/ input-symbol key=popupLink class=java.lang.String required=yes/ input-symbol key=form class=org.apache.tapestry.IForm required=yes/ input-symbol key=class class=java.lang.String required=no/ let key=href javascript:submitPopupLink('${form.name}', '${name}','${popupLink}'); /let let key=class ${class} /let /script Which comes out as: a href=javascript:submitPopupLink('editorForm', 'PopupLinkSubmit','/GQ/Waiting.page'); class=action Generate Plot /a The Javascript we're rendering in PopupLinkSubmit.java comes out as: function submitPopupLink(form, elementId, url) { var windowName = 'RDQGraphPopup'; var randomNumber = Math.floor(Math.random()*1000); windowName = windowName+randomNumber; aWindow = window.open(url, windowName, 'width=840, height=800, scrollbars=yes,resizable=yes', false); aWindow.focus(); var form = document.getElementById(form); form.target=windowName; form.events.submit(elementId); form.target=''; } I can supply the rest of the source if required but it's basically following the example I mentioned at the top. The rendered versions of
Re: T4.1.4-SNAPSHOT issue migrating from 4.0.2 with PopupLinkSubmit
No ideas are coming to mind right away, other than it looks like it's trying to do Map related functions without casting to map first. It is not a critical bug but it could potentially cause problems for you. Or at least be annoying to see during development and not as fast as it could be in production. I'll play around with this popuplinksubmit component later (maybe add it to contrib) and see what I can find. On Nov 7, 2007 2:26 PM, Dom Couldwell [EMAIL PROTECTED] wrote: snipped Any ideas as to what is causing the error? Even though it does not seem to be causing any problems I've a feeling it's gonna bite us in the ass at some point... /snipped -- Jesse Kuhnert Tapestry/Dojo 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]
Re: T5 how to control login state
I've created a new article to supplement the first, showing how to access thread-specific ASOs from a singleton service. It's on the wiki: http://wiki.apache.org/tapestry/Tapestry5HowToCreateADispatcher2 sincerely, chris Angelo Chen wrote: Hi Chris, I'm interested in your approach and read already the wiki, you spent a lot to explain the concept behind, can you also provide a simple/complete sample code for that? thanks. A.C. Chris Lewis-5 wrote: I'll update the wiki. chris lyifan wrote: Thanks a lot everyone. Finally the BasePase way works But the d
Moving on from 4.0.*
Howdy, I've been using Tapestry since 2.*, and am currently working with the 4.0.12 release. I've been very happy until recently, and I guess now I'm looking for reassurance/guidance. My issue is that Tapestry 5 is still -- it appears to me -- changing significantly between releases, and I'm obviously wary of moving a production application to it while it's stabilizing and still completing features. Tapestry 4.1.* is appealing except it ships with a specific version of Dojo -- I've had to rely on Subversion/manual patches to Dojo to get a lot of my widgets/packages to work properly, and it appears to me that Tapestry 4.1.* requires that I use the shipped version or risk foregoing most of the reasons for switching to it, which would potentially screw with a lot of my existing dojo-based code, and also preclude me from upgrading to dojo 0.9/1.0 if I wanted or even needed to. Thus, I feel as if I'm in Tapestry limbo, indefinitely locked into the inactive 4.0.* release-branch. Am I suffering from misconceptions? Thanks! Jim - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Moving on from 4.0.*
I can't speak to whether or not you should upgrade to T5 or how stable it is relative to your requirements, but can mention some things about Dojo versions. The packaged version of Dojo is sort of Dojo 0.4.3 but contains many local fixes not available in the official distribution - most being smallish bugs we've found in widgets / other things in various places. I'm not saying you are guaranteed to have your problems fixed in this version, but it may be worth looking at if you have the time / energy to do a quick glance. You can also attempt to replace the provided tapestry version with one of your own by overriding the AjaxShellDelegate renderer used in either the Shell or ScriptIncludes components: http://tapestry.apache.org/tapestry4.1/apidocs/org/apache/tapestry/dojo/AjaxShellDelegate.html I think Andy has something up his sleeve for 4.1.4 (4.1.5?) support for using different javascript libraries - which could possibly mean you can use Dojo 0.9 or similar. . It's really not ~that~ much work to make switching javascript libraries possible - it's just been low on my priority list and I've heard Andy mentioning doing something about it so I've ignored it The core supports using prototype dojo already, it's just a question of those few places that have library specific knowledge - such as the form related javascript. ...which I can see Andy has already been making generic for this purpose. I don't know, we can try and squeeze that feature in to the 4.1.4 release depending on what Andy has to say about it. It's really not as much work as people seem to think.. On Nov 7, 2007 3:55 PM, Jim [EMAIL PROTECTED] wrote: Howdy, I've been using Tapestry since 2.*, and am currently working with the 4.0.12 release. I've been very happy until recently, and I guess now I'm looking for reassurance/guidance. My issue is that Tapestry 5 is still -- it appears to me -- changing significantly between releases, and I'm obviously wary of moving a production application to it while it's stabilizing and still completing features. Tapestry 4.1.* is appealing except it ships with a specific version of Dojo -- I've had to rely on Subversion/manual patches to Dojo to get a lot of my widgets/packages to work properly, and it appears to me that Tapestry 4.1.* requires that I use the shipped version or risk foregoing most of the reasons for switching to it, which would potentially screw with a lot of my existing dojo-based code, and also preclude me from upgrading to dojo 0.9/1.0 if I wanted or even needed to. Thus, I feel as if I'm in Tapestry limbo, indefinitely locked into the inactive 4.0.* release-branch. Am I suffering from misconceptions? Thanks! Jim - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Jesse Kuhnert Tapestry/Dojo 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]
Re: T5: how to past two parameters to pageLink?
Or you could use this list binding prefix: http://wiki.apache.org/tapestry/Tapestry5HowToAddBindingPrefix -Filip Angelo Chen skrev: found a old posting, return a list from a method in the page class, then context=myList Angelo Chen wrote: Hi, here i pass one param, how to pass two? let's say : usr.name? Thanks, A.C. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: why this not working in IE?
Hi, This problem comes out only if the request to the page is a XMLHTTPRequest call, ordinary httprequest works in IE too, any idea how to fix this? seems a problem when using T5's page with Ajax. Thanks, A.C. Angelo Chen wrote: Hi, I have this code : @InjectPage private FeedbackBasic feedback; Object onActionFromDelete(Long id) { String html; // some process here to set up html string return feedback.setHtmlbock(html); } This code works in Safari, FF, I can see from a debugger that , first browser call : GET /myapp/myphoto.delete/3098?t:ac=262height=320random=1194365084108 HTTP/1.1 response: HTTP/1.1 302 Moved Temporarily Location: http://localhost.:8080/myapp/feedbackbasic Expires: 0 Cache-Control: no-cache then browser goes to GET /myapp/feedbackbasic in IE, it works first time, the next time around, I can see the response is 302, that's correct, but IE does not goto GET /myapp/feedbackbasic, looks like the page is cached? any solution to this? Thanks. A.C. -- View this message in context: http://www.nabble.com/T5%3A-why-this-not-working-in-IE--tf4759162.html#a13637245 Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: T5 how to control login state
Chris/Thiago: Thanks for the responses. What I'm getting at is trying to see if it is at all possible to allow page flow control reside outside of code. The reason for this is that I don't want to have to make code changes if I want a different flow. Externalizing the workflow makes this possible. It also defines a clear path of execution for a given request. We currently have our workflows defined in XML, which is read in on applcation start. At any point in time during the execution of the workflow, I can print out it's expected route of execution. I'll know the entire decision tree up front before anything executes. Being that it is outside of code, I can view the workflow while the application is offline as well. Having a workflow engine can help differentiate code from business logic. Our current implementation resembles the State pattern I believe. Imagine this, there are a given set of instructions ( externally defined workflow); each represent an action a user can take within the application. ( ie search, open a document, etc). Each workflow can be composed of many steps or instructions. The application acts as the interpreter of the workflow. It makes no decision of its own. All it knows about is the current state of the workflow. The actions the application takes depends on the current state of the workflow. Each step ( state) defines a set of possible actions to take based upon the result of the last action which it passes to the application and which the application passes back to the workflow. By doing it this way, you can easily add new workflows without having to touch any code. For instance, you could combine a series of searches in one workflow. There are many open source workflow engines around. You can find a few at this link here: http://java-source.net/open-source/workflow-engines We currently have our own engine we implemented with our current architecture. I am trying to figure out a way to integrate it into Tapestry. As for my initial question, it seems that using the ASO mechanism you describe is the way to go for now. I agree with you that currently an answer probably lies in services. However, I'm not too familiar with Tapestry to the extent to understand how to hook up the AccessDispatcher/RequestHandler to some service that handles the redirection. I guess I need more detailed information of the request handling. From the docs, the service() methods return true or false. A true tells it processor the request has finished and false tells it to go on. After the dispatcher/requestHandler code executes what is the next dispatcher/filter in line? How can I find that out? Thanks again guys! --Michael -Original Message- From: Chris Lewis [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 07, 2007 2:31 PM To: Tapestry users Subject: Re: T5 how to control login state Michael, I'm pretty sure tapestry has no such mechanism. The short answer to your question is that you'd have to store these things (page names of failed/unauthorized access attempts) as an ASO, and then pull it out after logging in. I've not worked with a system like you're talking about, but am glad that T5 is lacking in XML. However something like this could probably useful, and may be doable in the form of some service. First of all I should point out the link to how you can implement a redirect exception: http://wiki.apache.org/tapestry/Tapestry5RedirectException This is a bit of a hack, but demonstrates how you can get the exception back, as well as use decoration. I think what you want is attainable through services, and probably as a dispatcher. I'll need someone with a more thorough understanding of T5 to chime in on this, especially someone that has used what you are looking for. If a dispatcher handles the request, it is responsible for sending the response (HTTP and content) to the client. With that you should have the basics for what you want. You may also have this option with RequestFilters, but I'm not sure. Anyway, someone with more knowledge on the workings would be good to hear. I'd like to know how you fare as I'm always in the market for a better way to do things. Sincerely, chris Nguyen, Michael wrote: Thiago, I know that on pages or components navigation is controlled by the return type. ( page class, String, etc) My question has to do with how to deal with navigation before any page or component renders. In other frameworks you can have a workflows specified outside the application in XML, a database, etc. These workflows determine page flow. In tapestry, however this is not the case that I've seen. I've partially implemented what Chris just posted about the Dispatcher but using the RequestFilter like Massimo suggested. What I don't know how to do is to cleanly specify where to go after logging the user in without having to manually stuff something
Re: Moving on from 4.0.*
Sounds perfect! Thanks, guys; I really appreciate the response. Jim Andreas Andreou wrote: Yes, I want to commit this for 4.1.4... I just want to polish what i have and send it in till the weekend - stay tuned ;) On 11/7/07, Jesse Kuhnert [EMAIL PROTECTED] wrote: I can't speak to whether or not you should upgrade to T5 or how stable it is relative to your requirements, but can mention some things about Dojo versions. The packaged version of Dojo is sort of Dojo 0.4.3 but contains many local fixes not available in the official distribution - most being smallish bugs we've found in widgets / other things in various places. I'm not saying you are guaranteed to have your problems fixed in this version, but it may be worth looking at if you have the time / energy to do a quick glance. You can also attempt to replace the provided tapestry version with one of your own by overriding the AjaxShellDelegate renderer used in either the Shell or ScriptIncludes components: http://tapestry.apache.org/tapestry4.1/apidocs/org/apache/tapestry/dojo/AjaxShellDelegate.html I think Andy has something up his sleeve for 4.1.4 (4.1.5?) support for using different javascript libraries - which could possibly mean you can use Dojo 0.9 or similar. . It's really not ~that~ much work to make switching javascript libraries possible - it's just been low on my priority list and I've heard Andy mentioning doing something about it so I've ignored it The core supports using prototype dojo already, it's just a question of those few places that have library specific knowledge - such as the form related javascript. ...which I can see Andy has already been making generic for this purpose. I don't know, we can try and squeeze that feature in to the 4.1.4 release depending on what Andy has to say about it. It's really not as much work as people seem to think.. On Nov 7, 2007 3:55 PM, Jim [EMAIL PROTECTED] wrote: Howdy, I've been using Tapestry since 2.*, and am currently working with the 4.0.12 release. I've been very happy until recently, and I guess now I'm looking for reassurance/guidance. My issue is that Tapestry 5 is still -- it appears to me -- changing significantly between releases, and I'm obviously wary of moving a production application to it while it's stabilizing and still completing features. Tapestry 4.1.* is appealing except it ships with a specific version of Dojo -- I've had to rely on Subversion/manual patches to Dojo to get a lot of my widgets/packages to work properly, and it appears to me that Tapestry 4.1.* requires that I use the shipped version or risk foregoing most of the reasons for switching to it, which would potentially screw with a lot of my existing dojo-based code, and also preclude me from upgrading to dojo 0.9/1.0 if I wanted or even needed to. Thus, I feel as if I'm in Tapestry limbo, indefinitely locked into the inactive 4.0.* release-branch. Am I suffering from misconceptions? Thanks! Jim - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Jesse Kuhnert Tapestry/Dojo 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]
RE: T5: Preparing a pristine object for re-use
Bless you, Kris! This is exactly what I needed! I've been reading the mailing list religiously, and trying to dig through the documentation. I saw the discussion you referenced, but a lot of it went over my head. Thanks very much! Andy On Wed, 2007-11-07 at 09:05 +0100, Kristian Marinkovic wrote: the default scope of a service is singleton. i you want a new DAO on every request you can annotate you method with : @Scope(IOCConstants.PERTHREAD_SCOPE) if you are using tapestry-hibernate you can have your session injected into a singleton scoped service and tapestry will take care of it. please see the documentation and search the mailinglist. there was a very good thread a week ago e.g. http://www.nabble.com/T5%3A-%27wrapping%27-hibernate-DAOs-as-services-tf4710067.html#a13466570 g, kris Andy Huhn [EMAIL PROTECTED] 07.11.2007 05:11 Bitte antworten an Tapestry users users@tapestry.apache.org An Tapestry users users@tapestry.apache.org Kopie Thema T5: Preparing a pristine object for re-use Hello, I have a DAO that I want to re-initialize every time it is injected (that is, the DAO has state that I want to reset to make it pristine). I thought I could do it in the constructor for the DAO, since I am defining the service as follows in my AppModule: public static AccountDAO buildAccountDAO( Session prmSn ) { return new AccountDAOImpl( prmSn ); } But it appears the constructor is only being executed the first time the DAO is injected, it is not being executed on subsequent injections. Am I missing something? Thanks, Andy - 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: persists session set
i used the method that you provided and like the workbeach example. my hashset is always have size of only 1 ? i dont understand, since the selectcheckboxmethod is call so many times, why the size is only 1 all the time. //this method is called many times ,but the persists on sysem.out.print(last line) is //always only 1 public void setCheckboxSelected(boolean bSelected) { System.out.println(bSelected+size=+ getSelectedLocales().size()); Set locales = getSelectedLocales(); TheObject objLocale = getCurrentLocale(); Set setSelectedLocalesx = getSelectedLocales(); if (bSelected) {locales.add(objLocale); System.out.println(adding to hashset); } else {locales.remove(objLocale); System.out.println(remove to hashset); } // persist value setSelectedLocales(locales); System.out.println(persist=+getSelectedLocales().size()); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: T5 how to control login state
Hi, Though I'm still in the design phase of my work flow mechanism I would like to share it here as it seems you are looking for something similar. I store a Workflow Object in ASO containing a ListClass containing the pages to walk though, and a child WorkFlow containing a potential sub WorkFlow. I will initially populate these objects hardcoded when needed, but these could obviously come from any DataSource created at startup or page action. I have a GenericPage which all my pages extend and catches all action and form requests. It will redirect to the next page in the workflow object and remove it from the List. If there is a child WorFlow, the redirect page will be obtained from there until there are no more. This approach currently relies on using submits or action links, but can easily be altered to also work on pagelinks. I'm using a GenericPage because I already have one, but this could obviously also be achieved with a RequestFilter (or Dispatcher?? haven't looked into those yet ;-) Next to that I also will build a component to print out the workflow state giving me a generic navigation tool for all my wizards/workflows. I played with apache Shale-Dialog (with apache myfaces) for a while and liked the possibilities but found the configuration somewhat hard to get my head around. If you already have a code base that reads out your work flow config I don't think it will be hard to make this work with T5. Cheers, Joost -Original Message- From: Nguyen, Michael [mailto:[EMAIL PROTECTED] Sent: Thursday, November 08, 2007 12:01 PM To: Tapestry users Subject: RE: T5 how to control login state Chris/Thiago: Thanks for the responses. What I'm getting at is trying to see if it is at all possible to allow page flow control reside outside of code. The reason for this is that I don't want to have to make code changes if I want a different flow. Externalizing the workflow makes this possible. It also defines a clear path of execution for a given request. We currently have our workflows defined in XML, which is read in on applcation start. At any point in time during the execution of the workflow, I can print out it's expected route of execution. I'll know the entire decision tree up front before anything executes. Being that it is outside of code, I can view the workflow while the application is offline as well. Having a workflow engine can help differentiate code from business logic. Our current implementation resembles the State pattern I believe. Imagine this, there are a given set of instructions ( externally defined workflow); each represent an action a user can take within the application. ( ie search, open a document, etc). Each workflow can be composed of many steps or instructions. The application acts as the interpreter of the workflow. It makes no decision of its own. All it knows about is the current state of the workflow. The actions the application takes depends on the current state of the workflow. Each step ( state) defines a set of possible actions to take based upon the result of the last action which it passes to the application and which the application passes back to the workflow. By doing it this way, you can easily add new workflows without having to touch any code. For instance, you could combine a series of searches in one workflow. There are many open source workflow engines around. You can find a few at this link here: http://java-source.net/open-source/workflow-engines We currently have our own engine we implemented with our current architecture. I am trying to figure out a way to integrate it into Tapestry. As for my initial question, it seems that using the ASO mechanism you describe is the way to go for now. I agree with you that currently an answer probably lies in services. However, I'm not too familiar with Tapestry to the extent to understand how to hook up the AccessDispatcher/RequestHandler to some service that handles the redirection. I guess I need more detailed information of the request handling. From the docs, the service() methods return true or false. A true tells it processor the request has finished and false tells it to go on. After the dispatcher/requestHandler code executes what is the next dispatcher/filter in line? How can I find that out? Thanks again guys! --Michael -Original Message- From: Chris Lewis [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 07, 2007 2:31 PM To: Tapestry users Subject: Re: T5 how to control login state Michael, I'm pretty sure tapestry has no such mechanism. The short answer to your question is that you'd have to store these things (page names of failed/unauthorized access attempts) as an ASO, and then pull it out after logging in. I've not worked with a system like you're talking about, but am glad that T5 is lacking in XML. However something like this could probably useful, and may be doable in the form of some service. First of all I should
asset from byte array or stream
Hi all, I need a little help (4.1) I have an object with a byte array which contains data for a small image. I'm printing a summary of this object in a page and need to display the image as well. Is there a way I can create an asset and use it with the Image componet to display the image? something like: asset name=imageAsset stream=ognl:page.imageStream/ -or- asset name=imageAsset data=ognl:page.imageBytes/ ... img jwcid=@Image image=asset:imageAsset/ Any suggestions? Thanks, Paul. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
T5: @Injectpage and ajax
Hi, I have this problem http://www.nabble.com/T5%3A-why-this-not-working-in-IE--tf4759162s302.html why-this-not-working-in-IE , took quite a long time to find a fix to this: if you inject a page and return as object to a xmlhttprequest, it works in Safari, Firefox but not in IE, IE works only the first time, succeeding request will return the old page:(, but if the object is returned to a regular http request, every browser works. to make it working in all browsers, return a Link, passing anything as parameter of onActivate event. or better avoid @InjectPage totally so all your page will be ready for ajax call. my test is only limited to jQuery's ajax, maybe I'm wrong. A.C. -- View this message in context: http://www.nabble.com/T5%3A-%40Injectpage-and-ajax-tf4768575.html#a13640034 Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: persists session set
my mistake. hashset dont add object if it's null. it's working now. thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]