Publisher API -- simple publish/subscribe implementation for Tapestry5 pages and components
FYI: https://github.com/anjlab/anjlab-tapestry-commons/wiki/Publisher-API -- Dmitry Gusev AnjLab Team http://anjlab.com
Re: pages and components
On Thu, 11 Oct 2012 11:35:12 -0300, Ken in Nashua wrote: Folks, Hi! I am trying to nail down the concept (or at least inspired concept) of page and components and how they should be modeled with parameters and properties. Here is my semantic concept issue... if you can add to it that would be helpful. PAGES HAVE PROPERTIES, COMPONENTS HAVE PARAMETERS (yeah I know I can deviate but this is the general concept) I wouldn't say that. Components can have properties just fine, but you should use parameters to pass information to them (or the Environment on some specific cases). Pages don't have parameters (unless you count the page activation context as parameters), so you can't use @Parameter on them.. 1. would you agree this is the general concept? No. 2. under what conditions would I deviate... Any class can have properties. 2.1 ok say when would i want my page to have parameters Yes if you consider parameters as the page activation context, no if you're thinking about @Parameter. 2.2 ok say when would i want my component to have properties 3. I am seeing cases where I need both... for a component... is this bad practice? No. Just use the same common sense you'd use for any other Java class. Why would it be a bad practice? :) -- Thiago H. de Paula Figueiredo - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
RE: pages and components
Hi Ken, Maybe I can help you out: 1. I would not :) Pages and Components both have Properties. It's nothing special really. Think Bean Properties with automatic getter/setters. Components have Parameters, Pages have PageActivationContext. Both can be Properties as well (because a property is just a field with getter and setters ...). About Component Parameters: http://tapestry.apache.org/component-parameters.html About page activation: http://tapestry.apache.org/page-navigation.html http://blog.tapestry5.de/index.php/2010/08/23/context-values-vs-request-parameters/ http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/PageActivationContext.html So ... 2.1 use @PageActivationContext field annotation or implement "onActivate(param1, param2 ... etc)" event handler 2.2 use @Property in your components 3. Well, of course it's always best to minimize state but I wouldn't call it a bad practice. I'd suggest you browse the tapestry sources and get a feel how the internal components are written. I'd think that they represent t5 best practices. Kind Regards, Wulf -Original Message- From: Ken in Nashua [mailto:kcola...@live.com] Sent: Donnerstag, 11. Oktober 2012 16:35 To: users@tapestry.apache.org Subject: pages and components Folks, I am trying to nail down the concept (or at least inspired concept) of page and components and how they should be modeled with parameters and properties. Here is my semantic concept issue... if you can add to it that would be helpful. PAGES HAVE PROPERTIES, COMPONENTS HAVE PARAMETERS (yeah I know I can deviate but this is the general concept) 1. would you agree this is the general concept? 2. under what conditions would I deviate... 2.1 ok say when would i want my page to have parameters 2.2 ok say when would i want my component to have properties 3. I am seeing cases where I need both... for a component... is this bad practice? What could be bad practice. I am just searching for the religion on this and its twists. Thanks in advance Ken - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: pages and components
Pages and components are generally the same for me. Pages are just top-level components. They both have parameters: for pages they came from GET/POST/... HTTP requests, source of component parameters are pages and other components. Properties are just their state, the state that pages/components want to open to other objects, as in general Object Oriented Programming. There are special case of properties -- which are private fields with @Property annotation, that a page or component wants to open to its TML-design. On Thu, Oct 11, 2012 at 6:35 PM, Ken in Nashua wrote: > > Folks, > > I am trying to nail down the concept (or at least inspired concept) of > page and components and how they should be modeled with parameters and > properties. > > > Here is my semantic concept issue... if you can add to it that would be > helpful. > > PAGES HAVE PROPERTIES, COMPONENTS HAVE PARAMETERS (yeah I know I can > deviate but this is the general concept) > 1. would you agree this is the general concept? > 2. under what conditions would I deviate... > 2.1 ok say when would i want my page to have parameters > 2.2 ok say when would i want my component to have properties > 3. I am seeing cases where I need both... for a component... is this bad > practice? What could be bad practice. > > I am just searching for the religion on this and its twists. > > Thanks in advance > Ken > > > -- Dmitry Gusev AnjLab Team http://anjlab.com
Re: pages and components
Hey, I'm not a tapestry expert but here is what I think about pages, components, properties and parameters: Parameters (annotated with @Parameter) can only be used in components as parameters for the component (pages don't have parameters). Properties (annotated with @Property) are private attributes of pages or components that you want to expose to the template without the need of writing getters and setters. Parameters and properties are, IMHO, not related at all and don't serve the same purpose. I hope it will lighten you a little bit. Charles. 2012/10/11 Ken in Nashua > > Folks, > > I am trying to nail down the concept (or at least inspired concept) of > page and components and how they should be modeled with parameters and > properties. > > > Here is my semantic concept issue... if you can add to it that would be > helpful. > > PAGES HAVE PROPERTIES, COMPONENTS HAVE PARAMETERS (yeah I know I can > deviate but this is the general concept) > 1. would you agree this is the general concept? > 2. under what conditions would I deviate... > 2.1 ok say when would i want my page to have parameters > 2.2 ok say when would i want my component to have properties > 3. I am seeing cases where I need both... for a component... is this bad > practice? What could be bad practice. > > I am just searching for the religion on this and its twists. > > Thanks in advance > Ken > > >
pages and components
Folks, I am trying to nail down the concept (or at least inspired concept) of page and components and how they should be modeled with parameters and properties. Here is my semantic concept issue... if you can add to it that would be helpful. PAGES HAVE PROPERTIES, COMPONENTS HAVE PARAMETERS (yeah I know I can deviate but this is the general concept) 1. would you agree this is the general concept? 2. under what conditions would I deviate... 2.1 ok say when would i want my page to have parameters 2.2 ok say when would i want my component to have properties 3. I am seeing cases where I need both... for a component... is this bad practice? What could be bad practice. I am just searching for the religion on this and its twists. Thanks in advance Ken
Re: Best practice unit testing pages and components
Hi Kai, > > How would I test a page or a component when a @Parameter is not accessible > > because of its need to be a private variable? As well as tests directly on the page/component object that you can do with Tapestry's TestBase class, you can also write tests that run a page through one or more requests and where you test the rendered output. You can test components by embedding them into a "demo" page and writing tests against that. See: http://tapestry.apache.org/tapestry5.1/guide/unit-testing-pages.html If you start on this route then you'll want to use the Testify library to help you: http://tapestry.formos.com/nightly/tapestry-testify/ And you'll find the XPath library useful for asserting things about parts of the output: http://tapestry.formos.com/nightly/tapestry-xpath/ Best wishes, Paul -- Paul Field Research IT Deutsche Bank --- 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 delete this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. Please refer to http://www.db.com/en/content/eu_disclosures.htm for additional EU corporate and regulatory disclosures.
Re: Best practice unit testing pages and components
Take a look into this class: http://tapestry.apache.org/tapestry5.1/apidocs/org/apache/tapestry5/ioc/test/TestBase.html The methods create, get and set are useful in tests. On Tue, Jun 23, 2009 at 12:19 AM, Kai Weber wrote: > How would I test a page or a component when a @Parameter is not accessible > because of its need to be a private variable? > > I want to test my pages and components with unit tests as I do with my > service classes. > > Regards, Kai > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > -- Best regards, Igor Drobiazko
Re: Best practice unit testing pages and components
Em Mon, 22 Jun 2009 19:19:27 -0300, Kai Weber escreveu: How would I test a page or a component when a @Parameter is not accessible because of its need to be a private variable? If the component is written by you, add a getter and a setter, probably with package visibility. -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor http://www.arsmachina.com.br/thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Best practice unit testing pages and components
How would I test a page or a component when a @Parameter is not accessible because of its need to be a private variable? I want to test my pages and components with unit tests as I do with my service classes. Regards, Kai - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Tapestry 5 - "Pages" and "Components" package names
Em Mon, 23 Mar 2009 15:39:16 -0300, fccarmo escreveu: Hi Thiago! Thank you for helping me. You're always welcome. :) So I'll keep them this way. I just would like to put all my package names in Portuguese :D You can still have all the other package names in Portuguese. :) -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor http://www.arsmachina.com.br/thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Tapestry 5 - "Pages" and "Components" package names
Hi Thiago! Thank you for helping me. So I'll keep them this way. I just would like to put all my package names in Portuguese :D Thiago H. de Paula Figueiredo wrote: > > Em Mon, 23 Mar 2009 14:09:51 -0300, fccarmo > escreveu: > >> Is there any kind of context-param (like "tapestry.app-package") where I >> can change "Pages" and "Components" package names? > > Hi, Fernanda! > No, you can't do that without diving deep in the Tapestry internal > services. > By the way, why do you want to do that? > > -- > Thiago H. de Paula Figueiredo > Independent Java consultant, developer, and instructor > http://www.arsmachina.com.br/thiago > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > > - Fernanda Cristina do Carmo System Analyst and Java Developer MSN/GoogleTalk: fernanda.ca...@gmail.com -- View this message in context: http://www.nabble.com/Tapestry-5---%22Pages%22-and-%22Components%22-package-names-tp22663890p22666432.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Tapestry 5 - "Pages" and "Components" package names
Em Mon, 23 Mar 2009 14:09:51 -0300, fccarmo escreveu: Is there any kind of context-param (like "tapestry.app-package") where I can change "Pages" and "Components" package names? Hi, Fernanda! No, you can't do that without diving deep in the Tapestry internal services. By the way, why do you want to do that? -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor http://www.arsmachina.com.br/thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Tapestry 5 - "Pages" and "Components" package names
Is there any kind of context-param (like "tapestry.app-package") where I can change "Pages" and "Components" package names? Thanks! -- View this message in context: http://www.nabble.com/Tapestry-5---%22Pages%22-and-%22Components%22-package-names-tp22663890p22663890.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [T5] Inner Enums of Pages and Components
An idea: I belive it has many pitfalls :(, but might be useful an idea, tapestry could for example extend such enum (persist worker might trigger it) and add serialization code to it. Then when reloading it could force serializing enum values, plus if the value gets serialized outside tapestry it could be better handled (if servlet container serializes it). this might only help enums.. On Tue, Mar 25, 2008 at 10:57 PM, Howard Lewis Ship <[EMAIL PROTECTED]> wrote: > I'm kind of surprised about that; are you storing the enum values > outside of the page instance (i.e. in the session?) > > Inner classes are loaded by the disposable component class loader (the > class loader that handles retry logic and class transformation). When > a class changes, the class loader, plus and objects instantiated from > that class loader, are discarded. > > If you place such an object in the session, it will hang around > (keeping the class loader from being garbage collected) ... AND when > the stored value is assigned to a field of the newly loaded page > instance, it will fail with a ClassCastException because there's a new > class (with the same name) loaded by a new class loader. > > I'd love to patch up these "leaky abstractions" a bit better, but > that's partt of the price of running in your choice of servlet > container; short of Tapestry being an application server, and not an > application framework, it doesn't have sufficient control of things to > make it any more seamless. > > On Tue, Mar 25, 2008 at 2:49 PM, Adam Zimowski <[EMAIL PROTECTED]> > wrote: > > If Page or Component defines Enum internally, Tapestry throws a > > ClassCastException the moment said page or component class (or even > > the template) is "hot" reloaded due to any kind of change. > > > > Can this be fixed/change to allow inner Enums? > > > > -adam > > as of 5.0.11 > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > -- > Howard M. Lewis Ship > > Creator Apache Tapestry and Apache HiveMind > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
Re: [T5] Inner Enums of Pages and Components
Yeah, I haven't thought of that. I'll give it a shot, it just may work for us :) On Tue, Mar 25, 2008 at 5:03 PM, Davor Hrg <[EMAIL PROTECTED]> wrote: > This is most likely due to serialization of the enum in the session, > > I use a workarround that does not affect the code too much, > and I can track references to the enum. > > I persist a string variable, but always use enum.name() > to change the variable. > > I use this to keep track of major blocks that are visible in a page or comp > > private enum Blocks{EDIT,DETAILS, EDIT_DANGER} > > I persist the string > @Persistprivate String _currentBlock = Blocks.EDIT.name > (); > I return block: > public Block getCurrentBlock(){ > return _resources.getBlock(_currentBlock); > } > > whne I change current block, I use the enum > > public void resetView() { > _currentBlock = Blocks.DETAILS.name(); > _splitGoodId = null; > _containerId = null; > } > > public boolean onGoTo() { > resetView(); > return true; > } > > public boolean onGoToEditor() { > _currentBlock = Blocks.EDIT.name(); > return true; > } > > this might be helpfull... and it is not too far from classic usage > > Davor Hrg > > On Tue, Mar 25, 2008 at 10:49 PM, Adam Zimowski <[EMAIL PROTECTED]> > wrote: > > > > > If Page or Component defines Enum internally, Tapestry throws a > > ClassCastException the moment said page or component class (or even > > the template) is "hot" reloaded due to any kind of change. > > > > Can this be fixed/change to allow inner Enums? > > > > -adam > > as of 5.0.11 > > > > > > - > > 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: [T5] Inner Enums of Pages and Components
That makes totally perfect sense, and yes, I am storing an enum value in session. So I had enum defined internally in the page, and then @Persist on its value... I understand the limitation, and I can only image what cool things could be accomplished if Tapestry was budnled with embedded Jetty public class AddBaseItemArticle { @Persist private DisplayMode _displayMode = DisplayMode.Fresh; /** * Represents modes in which page can be rendered. If page is entered * directly, or if it is reset, display mode is [EMAIL PROTECTED] DisplayMode#Fresh}. * If after fresh input block has been validated and article information * is being collected, the mode is [EMAIL PROTECTED] DisplayMode#BlockValidated}. If * another page referred block input (create new block for a known base * item), then display mode is [EMAIL PROTECTED] DisplayMode#DefineBlock}. Finally, * if another page referred article input (which requires fully defined * block input), display mode is [EMAIL PROTECTED] DisplayMode#DefineArticle}. * * @author Adam Zimowski */ public enum DisplayMode { Fresh, BlockValidated, DefineBlock, DefineArticle } void setDisplayMode(DisplayMode aDisplayMode) { _displayMode = aDisplayMode; } } On Tue, Mar 25, 2008 at 4:57 PM, Howard Lewis Ship <[EMAIL PROTECTED]> wrote: > I'm kind of surprised about that; are you storing the enum values > outside of the page instance (i.e. in the session?) > > Inner classes are loaded by the disposable component class loader (the > class loader that handles retry logic and class transformation). When > a class changes, the class loader, plus and objects instantiated from > that class loader, are discarded. > > If you place such an object in the session, it will hang around > (keeping the class loader from being garbage collected) ... AND when > the stored value is assigned to a field of the newly loaded page > instance, it will fail with a ClassCastException because there's a new > class (with the same name) loaded by a new class loader. > > I'd love to patch up these "leaky abstractions" a bit better, but > that's partt of the price of running in your choice of servlet > container; short of Tapestry being an application server, and not an > application framework, it doesn't have sufficient control of things to > make it any more seamless. > > > > On Tue, Mar 25, 2008 at 2:49 PM, Adam Zimowski <[EMAIL PROTECTED]> wrote: > > If Page or Component defines Enum internally, Tapestry throws a > > ClassCastException the moment said page or component class (or even > > the template) is "hot" reloaded due to any kind of change. > > > > Can this be fixed/change to allow inner Enums? > > > > -adam > > as of 5.0.11 > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > -- > Howard M. Lewis Ship > > Creator Apache Tapestry and Apache HiveMind > > - > 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: [T5] Inner Enums of Pages and Components
This is most likely due to serialization of the enum in the session, I use a workarround that does not affect the code too much, and I can track references to the enum. I persist a string variable, but always use enum.name() to change the variable. I use this to keep track of major blocks that are visible in a page or comp private enum Blocks{EDIT,DETAILS, EDIT_DANGER} I persist the string @Persistprivate String _currentBlock = Blocks.EDIT.name (); I return block: public Block getCurrentBlock(){ return _resources.getBlock(_currentBlock); } whne I change current block, I use the enum public void resetView() { _currentBlock = Blocks.DETAILS.name(); _splitGoodId = null; _containerId = null; } public boolean onGoTo() { resetView(); return true; } public boolean onGoToEditor() { _currentBlock = Blocks.EDIT.name(); return true; } this might be helpfull... and it is not too far from classic usage Davor Hrg On Tue, Mar 25, 2008 at 10:49 PM, Adam Zimowski <[EMAIL PROTECTED]> wrote: > If Page or Component defines Enum internally, Tapestry throws a > ClassCastException the moment said page or component class (or even > the template) is "hot" reloaded due to any kind of change. > > Can this be fixed/change to allow inner Enums? > > -adam > as of 5.0.11 > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
Re: [T5] Inner Enums of Pages and Components
I'm kind of surprised about that; are you storing the enum values outside of the page instance (i.e. in the session?) Inner classes are loaded by the disposable component class loader (the class loader that handles retry logic and class transformation). When a class changes, the class loader, plus and objects instantiated from that class loader, are discarded. If you place such an object in the session, it will hang around (keeping the class loader from being garbage collected) ... AND when the stored value is assigned to a field of the newly loaded page instance, it will fail with a ClassCastException because there's a new class (with the same name) loaded by a new class loader. I'd love to patch up these "leaky abstractions" a bit better, but that's partt of the price of running in your choice of servlet container; short of Tapestry being an application server, and not an application framework, it doesn't have sufficient control of things to make it any more seamless. On Tue, Mar 25, 2008 at 2:49 PM, Adam Zimowski <[EMAIL PROTECTED]> wrote: > If Page or Component defines Enum internally, Tapestry throws a > ClassCastException the moment said page or component class (or even > the template) is "hot" reloaded due to any kind of change. > > Can this be fixed/change to allow inner Enums? > > -adam > as of 5.0.11 > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[T5] Inner Enums of Pages and Components
If Page or Component defines Enum internally, Tapestry throws a ClassCastException the moment said page or component class (or even the template) is "hot" reloaded due to any kind of change. Can this be fixed/change to allow inner Enums? -adam as of 5.0.11 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5 : declaration of pages and components packages from a library
While we're tossing out ideas, I accomplish the same thing without subclasses using layout components, which themselves (seamlessly) handle common CSS via @IncludeStyleSheet (or whatever its called). Any page (or component for that matter) that has specific styles (or scripts) can additionally add them in the same manner. It's these kinds of facilities I mean when I say that T5 provides ways of shared state/behavior, which are (imo) superior to subclassing. chris Daniel Jue wrote: I have a few components and pages that I extend, and I put them in a directory called "base", at the same level as the pages and components packages. For instance I have an AbstractReportPage that references Tapestry ASOs, Injects things and Persists things. Then I have a few report page classes that implement different flavors of very similar things. It could be done differently for sure--This is just one way that works for me. I also use the base directory for concrete Tapestry related classes that don't belong in pages, components, services or mixins. One example is a class than has the injected paths to all my css files and some images that are used across several border classes. Then I can do public class Border extends AssetContainer{ } On Jan 8, 2008 5:03 PM, Shing Hing Man <[EMAIL PROTECTED]> wrote: Have you tried the following ? Suppose org.man.tapestry5.components will hold the new components. 1) add the following to AppModule public static void contributeComponentClassResolver(Configuration configuration) { // Creates a virtual root pacakge for pages,components. configuration.add(new LibraryMapping("man", "org.man.tapestry5")); } 2) Suppose in org.man.tapestry5.components, we have component PageLinkPopup.java. Usage : Home or Sum Shing --- Steph <[EMAIL PROTECTED]> wrote: Hi all, I need to import in my tap5 project a library which includes tap5 pages and components. But when i try to extend a page from the library in my project, i get the following exception : java.lang.RuntimeException: Base class com.mylibrary.pages.FramePage (super class of com.myproject.pages.Start) is not in a controlled package and is therefore not valid. You should try moving the class to package com.myproject.base. Should i declare the 'pages' and 'components' directories of my library in the tapestry.app-package context of my web.xml ? If yes, what is the syntax to do such a declaration ? Thanks in advance. Stephane - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Home page : http://www.lombok.demon.co.uk/ ___ Yahoo! Answers - Got a question? Someone out there knows the answer. Try it now. http://uk.answers.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5 : declaration of pages and components packages from a library
I have a few components and pages that I extend, and I put them in a directory called "base", at the same level as the pages and components packages. For instance I have an AbstractReportPage that references Tapestry ASOs, Injects things and Persists things. Then I have a few report page classes that implement different flavors of very similar things. It could be done differently for sure--This is just one way that works for me. I also use the base directory for concrete Tapestry related classes that don't belong in pages, components, services or mixins. One example is a class than has the injected paths to all my css files and some images that are used across several border classes. Then I can do public class Border extends AssetContainer{ } On Jan 8, 2008 5:03 PM, Shing Hing Man <[EMAIL PROTECTED]> wrote: > Have you tried the following ? > > Suppose org.man.tapestry5.components will hold the new > components. > > 1) add the following to AppModule > > > public static void > contributeComponentClassResolver(Configuration > configuration) > { > // Creates a virtual root pacakge for > pages,components. > configuration.add(new LibraryMapping("man", > "org.man.tapestry5")); > } > > 2) Suppose in org.man.tapestry5.components, we have > component PageLinkPopup.java. > > Usage : > > windowName="literal:my windown" features="literal: > 'resizable,scrollbars,top=100,left=200,height=300,width=500'" > >Home > > or > > > windowName="literal:sum" features="literal: > 'resizable,scrollbars,top=100,left=200,height=300,width=500'" > >Sum > > Shing > > > > --- Steph <[EMAIL PROTECTED]> wrote: > > > Hi all, > > > > I need to import in my tap5 project a library which > > includes tap5 pages > > and components. > > But when i try to extend a page from the library in > > my project, i get > > the following exception : > > > > java.lang.RuntimeException: Base class > > com.mylibrary.pages.FramePage > > (super class of com.myproject.pages.Start) is not in > > a controlled > > package and is therefore not valid. You should try > > moving the class to > > package com.myproject.base. > > > > Should i declare the 'pages' and 'components' > > directories of my library > > in the tapestry.app-package context of my web.xml ? > > If yes, what is the > > syntax to do such a declaration ? > > > > Thanks in advance. > > > > Stephane > > > > > > > - > > To unsubscribe, e-mail: > > [EMAIL PROTECTED] > > For additional commands, e-mail: > > [EMAIL PROTECTED] > > > > > > > Home page : http://www.lombok.demon.co.uk/ > > > > ___ > Yahoo! Answers - Got a question? Someone out there knows the answer. Try it > now. > http://uk.answers.yahoo.com/ > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5 : declaration of pages and components packages from a library
Have you tried the following ? Suppose org.man.tapestry5.components will hold the new components. 1) add the following to AppModule public static void contributeComponentClassResolver(Configuration configuration) { // Creates a virtual root pacakge for pages,components. configuration.add(new LibraryMapping("man", "org.man.tapestry5")); } 2) Suppose in org.man.tapestry5.components, we have component PageLinkPopup.java. Usage : Home or Sum Shing --- Steph <[EMAIL PROTECTED]> wrote: > Hi all, > > I need to import in my tap5 project a library which > includes tap5 pages > and components. > But when i try to extend a page from the library in > my project, i get > the following exception : > > java.lang.RuntimeException: Base class > com.mylibrary.pages.FramePage > (super class of com.myproject.pages.Start) is not in > a controlled > package and is therefore not valid. You should try > moving the class to > package com.myproject.base. > > Should i declare the 'pages' and 'components' > directories of my library > in the tapestry.app-package context of my web.xml ? > If yes, what is the > syntax to do such a declaration ? > > Thanks in advance. > > Stephane > > > - > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > Home page : http://www.lombok.demon.co.uk/ ___ Yahoo! Answers - Got a question? Someone out there knows the answer. Try it now. http://uk.answers.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5 : declaration of pages and components packages from a library
Hi Steph, The problem is probably that you are trying to extend a class that exists in your pages package. As documented here (http://tapestry.apache.org/tapestry5/tapestry-core/guide/component-classes.html), you must put such base classes in a 'base' package. I'm not sure if the package must be named 'base', but I know that you cannot have base classes in 'pages', 'components', and probably not in 'mixins.' This is because T5 does some magic on these classes at runtime, and extending them would apparently cause failures. On a personal note, I if you find yourself extending pages you may want to reexamine your design. This is just my opinion, but I'm a firm believer in shallow class hierarchies, and being that T5 provides such a rich environment for composite behavior without subclassing (via services and mixins especially), I avoid page extention. sincerely, chris Steph wrote: Hi all, I need to import in my tap5 project a library which includes tap5 pages and components. But when i try to extend a page from the library in my project, i get the following exception : java.lang.RuntimeException: Base class com.mylibrary.pages.FramePage (super class of com.myproject.pages.Start) is not in a controlled package and is therefore not valid. You should try moving the class to package com.myproject.base. Should i declare the 'pages' and 'components' directories of my library in the tapestry.app-package context of my web.xml ? If yes, what is the syntax to do such a declaration ? Thanks in advance. Stephane - 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]
T5 : declaration of pages and components packages from a library
Hi all, I need to import in my tap5 project a library which includes tap5 pages and components. But when i try to extend a page from the library in my project, i get the following exception : java.lang.RuntimeException: Base class com.mylibrary.pages.FramePage (super class of com.myproject.pages.Start) is not in a controlled package and is therefore not valid. You should try moving the class to package com.myproject.base. Should i declare the 'pages' and 'components' directories of my library in the tapestry.app-package context of my web.xml ? If yes, what is the syntax to do such a declaration ? Thanks in advance. Stephane - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]