You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by Apache Wiki <wi...@apache.org> on 2011/01/23 03:01:51 UTC

[Tapestry Wiki] Update of "Tapestry5HowToCreateYourOwnComponentLibrary" by BobHarner

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Tapestry Wiki" for change notification.

The "Tapestry5HowToCreateYourOwnComponentLibrary" page has been changed by BobHarner.
The comment on this change is: Removed redundant howto.
http://wiki.apache.org/tapestry/Tapestry5HowToCreateYourOwnComponentLibrary?action=diff&rev1=3&rev2=4

--------------------------------------------------

+ See [http://tapestry.apache.org/component-libraries.html]
- One of the great thing about Tapestry is that it encourages the creation of components that can be reused between pages. 
- Some components are so useful that they can reused between applications inside a '''component library''' JAR file. 
- This page describes the steps to do this.
  
- = Basic requirements (quick reference) =
-  1. A JAR file with a package hierarchy that Tapestry expects, e.g. <packagePrefix>.[components,pages,mixins,base]
- 
-  1. Create Tapestry components as you usually would, just in the JAR instead (hint: put your templates in the packages themselves, e.g. src/main/resources if using Maven2)
- 
-  1. A Tapestry IOC module that contributes to the [[http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/services/ComponentClassResolver.html|ComponentClassResolver]] T5 service (see [[http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/services/TapestryModule.html#contributeComponentClassResolver(org.apache.tapestry.ioc.Configuration)|TapestryModule]])  - this can be either in the JAR (library) file or in your application's module (AppModule.java by default). You will need to use a ''prefix'' and ''root package.''
- 
-  1. Include the JAR in your project's dependencies.
- 
-  1. Reference the component in your application (typically WAR) using the aforementioned ''prefix'' as a "pseudo-package" name. If you use @Component in your page/component class, then simply import the correct class from your JAR, and use t:id in your template. If you prefer to specify the component type in your template (.tml), then use either <t:''<prefix>''.''<componentPath>'' ... /> or <span t:type="''<prefix>/''<componentPath>''" ... />.
- 
- = Notes =
-  * Tapestry IOC allows libraries to automatically contribute to the framework at application start time. To do this, use the Tapestry-Module-Classes entry in the JAR's MANIFEST.MF file, e.g. via the maven-jar-plugin. See [[http://tapestry.apache.org/tapestry5/tapestry-ioc/autoload.html|Auto-loading modules in Tapestry IOC]]
- 
- = Example =
- TODO
- 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org