[CONF] Apache Tapestry Building Tapestry from Source

2014-08-28 Thread Bob Harner (Confluence)














  


Bob Harner edited the page:
 


Building Tapestry from Source   




 Comment: Removed dead link reported by Felix Scheffer 


...

Install the TestNG plugin to allow running of individual TestNG unit tests from within in Eclipse.
 Right-click on any test class and select Run As TestNG Test 

 Command-line users: 

 ./gradlew -Dtest.single=myclassname 
 ./gradlew -Dtest.single=myclassname.mymethod 

 where myclassname is the test class, such as FormTest 
The Tapestry integration tests will repeatedly start up a Firefox browser.
...
The Tapestry source includes several web apps that are used by the automated Selenium integration tests. You can also run these apps manually to try out nearly every browser-visible aspect of Tapestry.(See a live example running on Google App Engine.) 

If using Eclipse:

Use the run-jetty-run plugin in Eclipse, with the context directory selected from among the test context directories. For example, in the tapestry-core module, right click on the /src/test/app1 (or app2, etc) folder, and select Run As  Run Jetty, then open your browser to http://localhost:8080/tapestry-core 
 

...






 View Online   Like   View Changes  
 Stop watching space   Manage Notifications  


 


 


  This message was sent by Atlassian Confluence 5.0.3, Team Collaboration Software  






[CONF] Apache Tapestry Starting the IoC Registry

2014-07-05 Thread Bob Harner (Confluence)














  


Bob Harner edited the page:
 


Starting the IoC Registry   




 Comment: minor typo 


...
The class RegistryBuilder is used to create a Registry.



 Code Block









java


 




 

RegistryBuilder builder = new RegistryBuilder();

builder.add(AppModule.class, UtilModule.class);

Registry registry = builder.build();

registry.performRegistryStartup(); 



...
The call to performRegistryStartup() is necessary to ensure that any services marked with the EagerLoad annotation are, in fact, loaded.



since








since
5.2


 




 

 



   

[CONF] Apache Tapestry JavaScript

2014-06-02 Thread Bob Harner (Confluence)














  


Bob Harner created a page:
 


_javascript_   





The Tapestry documentation is being reorganized. For the _javascript_ topic, please see one of the following pages:

 Client-Side _javascript_ (Tapestry 5.4 and newer) 
 Legacy _javascript_ (prior to Tapestry 5.4)   






 View Online   Like  
 Stop watching space   Manage Notifications  


 


 


  This message was sent by Atlassian Confluence 5.0.3, Team Collaboration Software  






[CONF] Apache Tapestry Localization

2014-06-01 Thread Bob Harner (Confluence)














  


Bob Harner edited the page:
 


Localization   




 Comment: Added Slovenian to the list of supported locales 


...




 en (English) 
  el (Greek)  
  it (Italian)  
  pl (Polish)  
  vi sv (VietnameseSwedish)  


 bg (Bulgarian) 
  es (Spanish)  
  ja (Japanese)  
  pt (Portuguese)  
  zh vi (ChineseVietnamese)  


 cs (Czech)1  
  fi (Finnish)  
  mk (Macedonian)  
  ru (Russian)  
  zh (Chinese)  


  da (Danish)  
  fr (French)  
  nl (Dutch)sr   
sl (SerbianSlovenian)2
  


  de (German)  
  hr (Croatian)  
  no (Norwegian)  
  sv sr (SwedishSerbian)  
  




 1as of Tapestry 5.3.8 
 2 as of Tapestry 5.4 
Providing translations for Tapestry built-in messages
...






   

[CONF] Apache Tapestry Index

2014-03-07 Thread Bob Harner (Confluence)














  


Bob Harner edited the page:
 


Index   




 Comment: republish 





 HTML




 !-- Force update: 910 --
style type=text/css

.big-col {
margin-right: 310px !important;
}

#content {
height : 1080px;
}

#col {
   width : 250px;
}

DIV.left-column {
  float: left;
  width: 48%;
}

DIV.right-column {
  float: right;
  width: 48%;
}

.blogSurtitle {
background: none repeat scroll 0 0 #569D2F;
border: 2px solid #DD;
color: #FF;
margin: 1px 1px 10px;
padding: 3px;
}
a.blogDate {
color: #FF;
}

a.blogHeading {
color: #569D2F;
font-size: 14px;
}

#col p {
text-align : justify;
font-size : 11px;
line-height : 1.2 !important
}

.feature {
#height: 150px;
}

/style

!-- BEGIN Dialog code (commented out, but we could use it in the future)

link rel=stylesheet href="" type=text/css media=all /
			script src="" type=text/_javascript_/script
			script src="" type=text/_javascript_/script
		
div id=evil title=Stop CISPA
pAs web developers, we're deeply concerned about the a href="" Cyber Intelligence Sharing and Protection Act /a. We encourage all developers to visit a href="" American Censorship/a and do their part to oppose this misguided bill.
/p

pCancel this dialog to begin exploring Apache Tapestry./p
/div

script
	$(function() {
		$( #evil ).dialog({ modal:true });
$(input[type='text']).focus();
	});
/script

style text=text/css
.ui-widget-overlay {
  opacity: .80;
  filter: alpha(opacity = 80);
  background: black;
}
/style

--


!-- END Temporary Stop CISPA --

 



...






 View Online   Like   View Changes  
 Stop watching space   Manage Notifications  


 


 


  This message was sent by Atlassian Confluence 5.0.3, Team Collaboration Software  






[CONF] Apache Tapestry Tapestry 5.4-beta-3 preview now available

2014-03-07 Thread Bob Harner (Confluence)






 repository 
repository
idapachestaging/id

 
nameApache Staging Repository/name

 
urlhttps://repository.apache.org/content/groups/staging/url

 
layoutdefault/layout
/repository
and here's the dependency:dependency 
dependency
groupIdorg.apache.tapestry/groupId

 
artifactIdtapestry-core/artifactId

 
version5.4-beta-3/version

 
typejar/type
/dependency
There is also a Maven archetype available, so you can build a quick little starter project as described at Getting Started, but specifying an alternative catalog:
-DarchetypeCatalog=https://repository.apache.org/content/groups/staging
  







  


Bob Harner edited the blog post:
 


Tapestry 5.4-beta-3 preview now available   




 Comment: Replace {code} blocks with preformatted blocks 


...

If you're using Maven (or Gradle or Ivy, etc), you'll need to add the Apache staging repository to your configured list of Maven repositories first:


  








 Code Block








title
Apache Staging repo (Maven-format)


language
xml


 




 Code Block








title
Tapestry 5.4-beta-3 dependency (Maven format)


language
xml


 




 Code Block






 View Online   Like   View Changes  
 Stop watching space   Manage Notifications  

  

[CONF] Apache Tapestry Tapestry Tutorial

2014-03-06 Thread Bob Harner (Confluence)














  


Bob Harner edited the page:
 


Tapestry Tutorial   




 Comment: Let's finally stop calling annotations new 





 Wiki Markup




 {float:right|background=""
{contentbylabel:title=Related Articles|showLabels=false|showSpace=false|labels=new-users}
{float} 



Table of Contents
 



 Children Display




Introduction
Welcome to Tapestry!
...
You do need to have a reasonable understanding of HTML, a smattering of XML, and a good understanding of basic Java language features, and a few newer things such as Java including Annotations.
The Challenges of Web Application Development
...






 View Online   Like   View Changes  
 Stop watching space   Manage Notifications  


 


 


  This message was sent by Atlassian Confluence 5.0.3, Team Collaboration Software  






[CONF] Apache Tapestry Tapestry 5.4-beta-3 preview now available

2014-03-06 Thread Bob Harner (Confluence)














  


Bob Harner wrote a blog post:
 


Tapestry 5.4-beta-3 preview now available   






The 3rd beta preview release of Tapestry 5.4 is now available.


While not an actual release candidate, beta previews like this one are high-quality builds that pass all of Tapestry's extensive automated tests. You are encouraged to try out this beta preview and let us know how it's working.


If you're using Maven (or Gradle or Ivy, etc), you'll need to add the Apache staging repository to your configured list of Maven repositories first:




Apache Staging repo (Maven-format)


repository
	idapachestaging/id
	nameApache Staging Repository/name
	urlhttps://repository.apache.org/content/groups/staging/url
	layoutdefault/layout
/repository


and here's the dependency:


Tapestry 5.4-beta-3 dependency (Maven format)


dependency
	groupIdorg.apache.tapestry/groupId
	artifactIdtapestry-core/artifactId
	version5.4-beta-3/version
	typejar/type
	scopecompile/scope
/dependency


There is also Maven archetype available, so you can build a quick little starter project as described at Getting Started, but specifying an alternative catalog:-DarchetypeCatalog=https://repository.apache.org/content/groups/staging 







 View Online   Like  
 Stop watching space   Manage Notifications  


 


 


  This message was sent by Atlassian Confluence 5.0.3, Team Collaboration Software  






[CONF] Apache Tapestry Tapestry 5.4-beta-3 preview now available

2014-03-06 Thread Bob Harner (Confluence)














  


Bob Harner edited the blog post:
 


Tapestry 5.4-beta-3 preview now available   




 Comment: whitespace 


...

If you're using Maven (or Gradle or Ivy, etc), you'll need to add the Apache staging repository to your configured list of Maven repositories first:


  



 Code Block








title
Apache Staging repo (Maven-format)


language
xml


 




 repository
	idapachestaging/id
	nameApache Staging Repository/name
	urlhttps://repository.apache.org/content/groups/staging/url
	layoutdefault/layout
/repository 



and here's the dependency:



 Code Block








title

[CONF] Apache Tapestry Tapestry 5.4-beta-3 preview now available

2014-03-06 Thread Bob Harner (Confluence)














  


Bob Harner edited the blog post:
 


Tapestry 5.4-beta-3 preview now available   




 Comment: minor formatting 


...

If you're using Maven (or Gradle or Ivy, etc), you'll need to add the Apache staging repository to your configured list of Maven repositories first:


  



 Code Block








title
Apache Staging repo (Maven-format)


language
xml


 




 repository
	idapachestaging/id
	nameApache Staging Repository/name
	urlhttps://repository.apache.org/content/groups/staging/url
	layoutdefault/layout
/repository 



and here's the dependency:



 Code Block








title
   

[CONF] Apache Tapestry Cookbook

2014-03-05 Thread Bob Harner (Confluence)














  


Bob Harner edited the page:
 


Cookbook   




 Comment: republish after minor reordering 


...
The Tapestry Cookbook is a collection of tips and tricks for commonly occurring patterns in Tapestry.
 



 Children Display








excerpt
true


depth
2


 




  
  



 Wiki Markup




 
{htmlcomment:
 



...



 
5}{htmlcomment}
 



  
  






 View Online   Like   View Changes  
 Stop 

[CONF] Apache Tapestry Building Tapestry from Source

2014-03-02 Thread Bob Harner (Confluence)














  


Bob Harner edited the page:
 


Building Tapestry from Source   




 Comment: Added some details on skipping tests 


...

Command-line users: *( gradlew is the gradle wrapper shell script (gradlew) or batch file (gradlew.bat) found in the root folder of the Tapestry source.

 ./gradlew build 
 
Eclipse Gradle IDE users:

Right click on the top-level project (or any sub-project) and select Run As  Gradle Build..., which starts an External Tools Configuration dialog box. Enter a reasonable name, select the tasks you want to run (for example, tapestry-core/install), and click Run. 
 

 Running Individual Tests 
Eclipse users:

Install the TestNG plugin to allow running of individual TestNG unit tests from within in Eclipse.

...
Running the Tapestry integration tests can take 10 minutes or more (mostly because of Selenium tests, which repeatedly start and stop the Firefox browser), so you won't want to run them every time you try a change.

Command-line users:

 To build while skipping all tests: ./gradlew build -x test 
You can skip tests on a specific module by adding a colon and the module name. For example: -x test:tapestry-ioc 
 
Eclipse Gradle IDE users:

 In your External Tools Configuration, add the same -x test option as above at Arguments  Program Arguments. 
 

Running the Integration Test Apps Manually
...






 View Online   Like   View Changes  
 Stop watching space   Manage Notifications  


 


 


  This message was sent by Atlassian Confluence 5.0.3, Team Collaboration Software  
 

[CONF] Apache Tapestry Page And Component Classes FAQ

2014-03-02 Thread Bob Harner (Confluence)






 {footnote}Tapestry would also create an alias . (Tapestry would also create an alias account/view,   by   stripping   off   the   redundant   account   suffix.   Either   name   is   equally   valid   in   your   code,   and   Tapestry   will   use   the   shorter   name,   account/view   in   URLs.{footnote})In addition, it is possible to define additional root packages for the application:







  


Bob Harner edited the page:
 


Page And Component Classes FAQ   




 Comment: Fixed footnote problem by doing away with it. 


...
You are allowed to create sub-packages, to help organize your code better and more logically. For example, you might have root-package.pages.account.ViewAccount, which would have the page name account/viewaccount







 Wiki Markup






 Code Block








controls
true


linenumbers
true


 




 

public static void contributeComponentClassResolver(ConfigurationLibraryMapping configuration) {
   configuration.add(new LibraryMapping(, com.example.app.tasks));
   configuration.add(new LibraryMapping(, com.example.app.chat));
}
 


 ...



 Code Block








controls
true


linenumbers
true


 




 

@SupportsInformalParameters
public class DBImage
{
  @Parameter(required=true)
  private Image image;

  @Inject
  private ComponentResources resources;

  boolean beginRender(MarkupWriter writer)
  {

[CONF] Apache Tapestry Limitations

2014-03-02 Thread Bob Harner (Confluence)














  


Bob Harner edited the page:
 


Limitations   




 Comment: Added note about running Tap 4  5 apps together 


...
Although you code Tapestry pages and components as if they were ordinary POJOs (Plain Old Java Objects -- Tapestry does not require you to extend any base classes or implement any special interfaces), as deployed by Tapestry they are closer to a traditional servlet: a single instance of each page services requests from multiple threads. Behind the scenes, Tapestry transforms you code, rewriting it on the fly. 
  
What this means is that any incoming request must be handled by a single page instance. Therefore, Tapestry enforces the concept of static structure, dynamic behavior.
...
How do I run multiple Tapestry applications in the same web application?
 This Running multiple Tapestry 5 applications is not supported; there's only one place to identify the application root package, so even configuring multiple filters into multiple folders will not work.
Support for multiple Tapestry applications in the same web application was a specific non-goal in Tapestry 5 (it needlessly complicated Tapestry 4). Given how loosely connected Tapestry 5 pages are from each other, there doesn't seem to be an advantage to doing so ... and certainly, in terms of memory utilization, there is a significant down side, were it even possible.
 Youcanrun a Tapestry 4 app and a Tapestry 5 app side-by-side (the package names are different, for just this reason), but they know nothing of each other, and can't interact directly. This is just like the way you could have a single WAR with multiple servlets; the different applications can only communicate via URLs, or shared state in the HttpSession. 



 Wiki Markup




 {scrollbar} 












 View Online   Like   View Changes  
 Stop watching space   Manage Notifications  


 


 


  This message was sent by Atlassian Confluence 5.0.3, Team Collaboration Software  


 

[CONF] Apache Tapestry Using BeanEditForm To Create User Forms

2014-02-25 Thread Bob Harner (Confluence)














  


Bob Harner edited the page:
 


Using BeanEditForm To Create User Forms   




 Comment: Minor edits 


...
When you refresh the page, you'll see the following:
 
Tapestry 's has done quite a bit of work here. It has created a form that includes a field for each property. Further, its it has seen that the honorific property is an enumerated type, and presented that as a drop-down list.
...
The BeanEditForm must guess at the right order to present the fields; for public fields, they end up in alphabetical order



 Wiki Markup




 
{footnote}For standard JavaBeans properties, the BeanEditForm default is in the order in which the getter methods are defined in the class (it uses line number information, if available).{footnote}
 



.

A better order for these fields is the order in which they are defined in the Address class:
...
In Tapestry, when binding a parameter, the value you provide may include a prefix. The prefix guides Tapestry in how to interpret the rest of the the parameter value ... is it the name of a property? The id of a component? A message key? Most fields parameters have a default prefix, usually prop:, that is used when you fail to provide one (this helps to make the templates as terse as possible).
...



 Code Block








language
xml


 



  

[CONF] Apache Tapestry Tapestry 5.4-beta-3 preview release vote underway

2014-02-23 Thread Bob Harner (Confluence)














  


Bob Harner wrote a blog post:
 


Tapestry 5.4-beta-3 preview release vote underway   





A vote is underway for the 3rd beta preview release of Tapestry 5.4. This follows 2 other betas and 29 alphas for the work on version 5.4 that began over two years ago.





 View Online   Like  
 Stop watching space   Manage Notifications  


 


 


  This message was sent by Atlassian Confluence 5.0.3, Team Collaboration Software  






[CONF] Apache Tapestry Page Navigation

2014-02-17 Thread Bob Harner (Confluence)














  


Bob Harner edited the page:
 


Page Navigation   




 Comment: Fixed a bit of bad wiki markup 


...

 component event requests target a specific component on a specific page, triggering an event within that component
 render requests target a specific page, and stream the HTML markup for that page back to the client

 {float:right This dichotomy between component event requests and render requests is new in Tapestry 5. It is in some ways based on ideas from the Portlet specification and differentiating the two types of requests alleviates a number of problems in traditional web applications related to the browser back button, or to the user hitting the refresh button in their browser.
  Logical Page Name Shortening 
In certain cases, Tapestry will shorten the the logical name of a page. For example, the page class org.example.pages.address.CreateAddress will be given a logical name of address/Create (the redundant Address is removed as a suffix). However, this only affects how the page is referenced in URLs; the template file will still be CreateAddress.tml, whether on the classpath, or as address/CreateAddress.tml (in the web context).
...
 Tapestry actually creates multiple names for the name page: address/Create and address/CreateAddress are both synonymous. You can user either in Java code that refers to a page by name, or as the page parameter of a PageLink. 
Component Event Requests  Responses
...






 View Online   Like   View Changes  
 Stop watching space   Manage Notifications  


 


 


  This message was sent by Atlassian Confluence 5.0.3, Team Collaboration Software  






[CONF] Apache Tapestry Wiki Status

2014-02-17 Thread Bob Harner (Confluence)














  


Bob Harner removed the page:
 


Wiki Status   





This page provides some basic information about the status of the Tapestry documentation wiki.


 All Updates 
 Favourite Spaces 
 Network 
 Space Categories 




 Page Page Navigation

Bob Harner (about 2 hours ago)
 
 Page Building Tapestry from Source

Bob Harner (Feb 08, 2014)
 
 Page Community

Bob Harner (Feb 08, 2014)
 
 Page Developer Information

Bob Harner (Feb 08, 2014)
 
 Page Developer Bible

Bob Harner (Feb 08, 2014)
 
 Page Component Mixins

Bob Harner (Feb 01, 2014)
 
 Page Security

Bob Harner (Jan 25, 2014)
 
 Page HTTPS

Bob Harner (Jan 25, 2014)
 
 Page Assets

Bob Harner (Jan 21, 2014)
 
 Page Security FAQ

Bob Harner (Jan 21, 2014)
 
 Page Getting Started


[CONF] Apache Tapestry Configuration

2014-02-17 Thread Bob Harner (Confluence)














  


Bob Harner edited the page:
 


Configuration   




 Comment: Added tapestry.lenient-date-format 


...
The folder, of the context, in which the Tapestry application executes. By default this is blank, meaning the Tapestry application executes in the root of the web application context. Setting this value allows the Tapestry application to be segregated into a folder, which can be useful when Tapestry is executed inside a web application with other servlets or filters.
...
tapestry.compressed-asset-path-prefix



since








since
5.4


 




  



As with tapestry.asset-path-prefix but for compressed versions of assets. At render time, Tapestry determines whether each asset is compressable (for example, image file formats are not). A path for either tapestry.asset-path-prefix or this prefix is selected at render time. Defaults to the asset path prefix with .gz appended.
...
tapestry.execution-mode
The execution mode. See Setting Execution Modes below.
tapestry.file-check-interval
Time interval between file system checks. During a file system check, only a single thread is active (all others are blocked) and any files loaded are checked for changes (this is part of automatic component reloading).
The default is 1 s (one second; see Time Interval Formats), and is usually overridden with a higher value in production (say, between one and five minutes).
...
In Tapestry 5.4, this defaults to prototype for compatibility with 5.3. This will likely change in 5.5 to default to jquery. At some point in the future, Prototype support may no longer be present.
 tapestry.lenient-date-format 
   

[CONF] Apache Tapestry Page Navigation

2014-02-15 Thread Bob Harner (Confluence)














  


Bob Harner edited the page:
 


Page Navigation   




 Comment: No change, republishing after template change 


...
Any individual request will be targeted at a single page. Requests come in two forms: 

 component event requests target a specific component on a specific page, triggering an event within that component
 render requests target a specific page, and stream the HTML markup for that page back to the client

...
An event handler method may return a HttpError instance to send an error response to the client.



 Code Block




 

public Object onAction(){
  return new HttpError(302, The Error message);
} 



...
This querying takes the form of an event trigger. The event name is passivate (as we'll see shortly, there's a corresponding activate). The return value of the method is used as the context. For example:



 Code Block









java


 




 

public class ProductDetail
{
  private Product product;

  . . .

  long onPassivate() { return product.getId(); }
}
 



...
A page's 

[CONF] Apache Tapestry Developer Bible

2014-02-08 Thread Bob Harner (Confluence)














  


Bob Harner edited the page:
 


Developer Bible   




 Comment: Added spaces-over-tabs rule 


...
Howard uses utility methods that convert from ServiceDef to ServiceDef2, adding a wrapper implementation around a ServiceDef instance if necessary:



 Code Block




 
 public static ServiceDef2 toServiceDef2(final ServiceDef sd)
  {
if (sd instanceof ServiceDef2)
return (ServiceDef2) sd;

return new ServiceDef2()
{
public boolean isPreventDecoration()
{
return false;
}

public ObjectCreator createServiceCreator(ServiceBuilderResources resources)
{
return sd.createServiceCreator(resources);
}

. . .
};
  }
 



...
Use the complete version number of the release in which the type or method was added: i.e., @since 5.1.0.3.
 Code Style  Formatting 
Yes, at one time Howard used leading underscores for field names. He has since changed my mind, but this unfortunately infected other people; please try to make your code blend in when modifying existing source.
Long ago, Tapestry (3) code used the regrettable leading-I-on-interfaces style. Don't do that. Everything's an interfaceInstead, name the implementation class with an Impl at the end.
Howard prefers braces on a new line (and thus, open braces lined up with close braces), so that's what the default code formatting is set up for. It's okay to omit braces for trivial one-liner if statements, such as if (!test) return;.
 Indent with 4 spaces instead of tabs. 
Use a lot of vertical whitespace to break methods into logical sections.
...
Try and keep the documentation up-to date as you make changes; it is much harder to do so later. This is now much easier using the Confluence wiki (you're reading the result ).
Documentation is was at one point the #1 criticism of Tapestry!
...






 View Online   Like   View Changes  
 Stop watching space   Manage Notifications  


 

 

[CONF] Apache Tapestry Developer Bible

2014-02-08 Thread Bob Harner (Confluence)














  


Bob Harner edited the page:
 


Developer Bible   




 Comment: Chagned SVN to Git 


...
It is very important to include the JIRA issue id in the commit. This is used in many places: JIRA links issues to the SVN commits Gitcommits for that issue (very handy for seeing what changed as part of a bug fix). The Hudson CI server does as well, and will actually link SVN commits Gitcommits to issues after succesfully building.
...
For anything non-trivial, wait for the Hudson CI server to build. It catches a lot of things ... such as files that were not added to SVNGit. And even IntelliJ has a bit of trouble with wildly refactored code. Hudson will catch all that.
...






 View Online   Like   View Changes  
 Stop watching space   Manage Notifications  


 


 


  This message was sent by Atlassian Confluence 5.0.3, Team Collaboration Software  






[CONF] Apache Tapestry Developer Bible

2014-02-08 Thread Bob Harner (Confluence)














  


Bob Harner edited the page:
 


Developer Bible   




 Comment: Updated intro paragraph 





 Wiki Markup




 {float:right|background=""
{contentbylabel:title=Related Articles|showLabels=false|showSpace=false|labels=tapestry-dev}
{float} 



 This is a semi-random outpouring of thoughts related to being a Tapestry committerIDE choices, coding style and formatting, commit practices, naming conventions and other issues relevant to Tapestry committers  contributers.
IDE Choices
IntelliJ
It's a free license for all committers and it's just better. Yes, the first few days can be an unpleasant fumble because everything is almost, but not quite, familiar. Pretty soon you'll love IDEA and recognize that Eclipse has been bending you over and doing unspeakable things.
...






 View Online   Like   View Changes  
 Stop watching space   Manage Notifications  


 


 


  This message was sent by Atlassian Confluence 5.0.3, Team Collaboration Software  






[CONF] Apache Tapestry Developer Information

2014-02-08 Thread Bob Harner (Confluence)














  


Bob Harner edited the page:
 


Developer Information   




 Comment: Better description of Developer Bible link 


...

 Confluence Site Setup – all about how Confluence is used to edit the content of the static documentation site
 Release Process – how to produce a release
 Developer Bible – random thoughts from Howard related to being a Tapestry committercoding  committingadvice, includingIDE choices, coding style, class naming conventions andbug tracking policies 
 Building Tapestry from Source – how to build Tapestry itself
 Version Numbers 

...

 Jenkins automated build results – trunk
 Cobertura code coverage report – measures test coverage
 Sonar code quality report – measures test coverage, complexity  rule violations
 Browse Git source 
 The Tapestry Jailtapestry jail – information about our FreeBSD jail at typestry.zones.apache.org







 View Online   Like   View Changes  
 Stop watching space   Manage Notifications  


 


 


  This message was sent by Atlassian Confluence 5.0.3, Team Collaboration Software  






[CONF] Apache Tapestry Building Tapestry from Source

2014-02-08 Thread Bob Harner (Confluence)














  


Bob Harner edited the page:
 


Building Tapestry from Source   




 Comment: Minor correction on the Gradle IDE part, and removed link to GAE demo, since it hasn't been running for a long time 


...

Command-line gradle users only:

If you're using Eclipse but not Gradle IDE do ./gradlew eclipse 
The command-line Gradle's eclipse plugin doesn't include the provided project dependencies; you need to add them manually (Java Build Path  Projects  Add tapestry-test). The plugin also generates a root eclipse project, so you'll need to delete the .project file in the root folder, and then you can import all Tapestry sub-projects at once.
 
Eclipse Gradle IDE users:

Switch to Java (or JEE) perspective and right-click  Import...  Gradle  Gradle Project  Next.
Set the Root folder to where you put your Tapestry source in the previous section (e.g. ~/git/tapestry-5 or %Home%\git\tapestry-5)
Click Build Model.  Select When it completes, select the top-level (the top-level module and all sub-modules) then click Finish.
Be sure the Enable dependency management and Add to Create workingset 'tapestry-5'  checkboxes are checked.
Click Finish. (Be patient; the import operation might take a few minutes.)
 
Eclipse EGit users: Do a Git Share on the project:

Still in the Java (or JEE) perspective, select all of the Tapestry projects (top-level and sub-modules) and right-click  Team  Share Project...  Git  Next  Ensure all are selected, click Finish.
 

...
The Tapestry source includes several web apps that are used by the automated Selenium integration tests. You can also run these apps manually to try out nearly every browser-visible aspect of Tapestry. (See a live example running on Google App Engine.) 

If using Eclipse:

Use the run-jetty-run plugin in Eclipse, with the context directory selected from among the test context directories. For example, in the tapestry-core module, right click on the /src/test/app1 (or app2, etc) folder, and select Run As  Run Jetty, then open your browser to http://localhost:8080/tapestry-core 
 

...





[CONF] Apache Tapestry Building Tapestry from Source

2014-02-08 Thread Bob Harner (Confluence)














  


Bob Harner edited the page:
 


Building Tapestry from Source   




 Comment: Restored link to http://tapestry-test.appspot.com/ – it's still running, although very slow 


...
The Tapestry source includes several web apps that are used by the automated Selenium integration tests. You can also run these apps manually to try out nearly every browser-visible aspect of Tapestry.(See a live example running on Google App Engine.) 

If using Eclipse:

Use the run-jetty-run plugin in Eclipse, with the context directory selected from among the test context directories. For example, in the tapestry-core module, right click on the /src/test/app1 (or app2, etc) folder, and select Run As  Run Jetty, then open your browser to http://localhost:8080/tapestry-core 
 

...






 View Online   Like   View Changes  
 Stop watching space   Manage Notifications  


 


 


  This message was sent by Atlassian Confluence 5.0.3, Team Collaboration Software  






[CONF] Apache Tapestry Component Mixins

2014-02-01 Thread Bob Harner (Confluence)














  


Bob Harner edited the page:
 


Component Mixins   




 Comment: Tweaks to intro paragraph 


...
You can think of a mixin as a kind of mashup for a component; it combines the new behavior of the mixin with the existing behavior of the component, and bundles it all in one place. Mixins may be used to add specialized validation to user input fields, dynamically modify the HTML output of a component, or to add Ajax effects and behaviors to of all sorts of to components.
Tapestry comes with several mixins, such as the Autocomplete mixin which adds autocomplete behavior to an ordinary TextField Component. In addition, you can easily create your own.
...






 View Online   Like   View Changes  
 Stop watching space   Manage Notifications  


 


 


  This message was sent by Atlassian Confluence 5.0.3, Team Collaboration Software  






[CONF] Apache Tapestry HTTPS

2014-01-25 Thread Bob Harner (Confluence)














  


Bob Harner edited the page:
 


HTTPS   




 Comment: Added Related Articles box 


Securing your application with HTTPS






 Wiki Markup




 
{float:right|background=""
{contentbylabel:title=Related Articles|showLabels=false|showSpace=false|space=@self|labels=security}
{float}
 



Tapestry assumes your application will be primarily deployed as a standard web application, using HTTP HTTP(not HTTPS) as the transport mechanism.
...






 View Online   Like   View Changes  
 Stop watching space   Manage Notifications  


 


 


  This message was sent by Atlassian Confluence 5.0.3, Team Collaboration Software  






[CONF] Apache Tapestry Security

2014-01-25 Thread Bob Harner (Confluence)














  


Bob Harner edited the page:
 


Security   




 Comment: Reorganized the Security Framework Integration section 


...
Tapestry provides several annotations and configuration settings that you can use toensure that all access to certain pages (or all pages) occurs only via the encrypted HTTPS protocol. SeeHTTPS for details. 
 Controlling Page Access 
  



 Wiki Markup




 {float:right|background="" 1em}
*JumpStart Demo:*
[Protecting Pages|http://jumpstart.doublenegative.com.au/jumpstart/examples/infrastructure/protectingpages]
{float} 



...
 Security Framework Integration 
Tapestry does not come with a built-in lock you into a specific authentication/authorization mechanism, to avoid lock-in to a specific implementation. There are various Java security frameworks available, but the main two Java-based open source security frameworks are Apache Shiro (earlier Instead, there are integration modules available for the more popular open source Java security frameworks, namely Apache Shiro (formerly JSecurity) and Spring Security (earlier formerly Acegi Security). Spring Security is the more popular of the two (because of Spring's popularity), whereas Shiro is widely regarded as the more flexible choice. There are well-maintained Tapestry integration projects for both of these frameworks, 

 Thetapestry-security 

...

 module (from Tynamo.org) 

...

 uses Apache Shiro 
 Thetapestry-spring-security 

...

 module uses Spring Security. 

 For tapestry-security (Shiro-based)Additional information: 

 Tynamo-federatedaccounts Facebook etc. 3rd party authentication provider integrations, building on Tapestry-security 

 For tapestry-spring-security 

 

[CONF] Apache Tapestry Community

2014-01-21 Thread Bob Harner (Confluence)














  


Bob Harner edited the page:
 


Community   




 Comment: Endorsed Eclipse-tapestry5-plugin over Tapestry Tools 


Tapestry has an active community of users and developers. This is an overview of how to participate, along with a list of some of the great contributions of the community members.
 



 Table of Contents




Getting Involved
Reporting Problems / Getting Support
 



 Include Page









Mailing Lists


 




Tapestry issues are tracked in the Apache JIRA.
...
Access using Git client:



 No Format




 

$ git clone http://git-wip-us.apache.org/repos/asf/tapestry-5.git
 



...



 Section


 

[CONF] Apache Tapestry Security FAQ

2014-01-21 Thread Bob Harner (Confluence)














  


Bob Harner removed a comment from the page:
 


Security FAQ   





Added security label





 
 Stop watching space   Manage Notifications  


 


 


  This message was sent by Atlassian Confluence 5.0.3, Team Collaboration Software  






[CONF] Apache Tapestry Security FAQ

2014-01-21 Thread Bob Harner (Confluence)














  


Bob Harner edited the page:
 


Security FAQ   




 Comment: Added Related Articles box 





 Wiki Markup




 {scrollbar} 



Security FAQ



 Wiki Markup




 
{float:right|background=""
{contentbylabel:title=Related Articles|showLabels=false|showSpace=false|space=@self|labels=security}
{float}
 



The built-in PageCatalog and ServiceStatus pages are visible in my production application and I don't want them to be, what can I do?
...
Sometimes, in production, a firewall or proxy may make it look like the client web browser originates from localhost; in that situation, you may want to disable the logic that puts localhost onto the whitelist. This determination is made by the contributions to the ClientWhitelist service. Tapestry makes a contribution with id LocalhostOnly, which one of your modules can override:



 Code Block




 
 @Contribute(ClientWhitelist.class)
  public static void turnOffLocalhostInProduction(OrderedConfigurationWhitelistAnalyzer configuration,
 @Symbol(SymbolConstants.PRODUCTION_MODE) boolean productionMode) {
if (productionMode) { configuration.override(LocalhostOnly, null); }
  }
 



...






 View Online   Like   View Changes  

[CONF] Apache Tapestry Security

2014-01-21 Thread Bob Harner (Confluence)














  


Bob Harner edited the page:
 


Security   




 Comment: Added lots more information about Tapestry security features 


Tapestry has a number of security features designed to harden your application against unwanted intrusion and denial of service. 



 Wiki Markup




 
{float:right|background=""
{contentbylabel:title=Related Articles|showLabels=false|showSpace=false|space=@self|labels=spring,security}
{float}
 



 HTTPS-only Pages 
 Main Article: HTTPS 
 Tapestry provides several annotations and configuration settings that you can use toensure that all access to certain pages–or all pages–occurs only via the encrypted HTTPS protocol. SeeHTTPS for details. 
 Controlling Page Access 
  



 Wiki Markup




 
{float:right|background="" 1em}
*JumpStart Demo:*
[Protecting Pages|http://jumpstart.doublenegative.com.au/jumpstart/examples/infrastructure/protectingpages]
{float}
 



 For simple access control needs, you can contribute aComponentRequestFilter with your custom logic that decides which pages should be accessed by which users. 
 For more advanced needs see the Security Framework Integration section below. 
 White-listed Pages 
 Pages whose component classes are annotated with@WhitelistAccessOnlywill only be displayed to users (clients) that are on thewhitelist. By default the whitelist consists only of clients whose fully-qualified domain name is localhost (or the IP address equivalent, 127.0.0.1 or 0:0:0:0:0:0:0:1),but you can customize this by contributing to the ClientWhitelist servicein your application's module class (usually AppModule.java): 



 Code Block



  

[CONF] Apache Tapestry Getting Started

2014-01-20 Thread Bob Harner (Confluence)






 {display-footnotes}  







  


Bob Harner edited the page:
 


Getting Started   




 Comment: Removed garbled footnotes, made image bigger 


...
Once you have Maven installed, execute the following command:



 Code Blocknoformat




 

mvn archetype:generate -DarchetypeCatalog=http://tapestry.apache.org

 



 Maven will prompt you for the archetype to create (Tapestry 5 Quickstart Project) and the exact version number (5.3.7, at the time of writing). It also asks you for a group id, an artifact id, and a version number. You can see this in the following transcript: 



 No Format




 

$ mvn archetype:generate -DarchetypeCatalog=http://tapestry.apache.org
[INFO] Scanning for projects...
[INFO]
[INFO] 
[INFO] Building Maven Stub Project (No POM) 1
[INFO] 
[INFO]
[INFO]  maven-archetype-plugin:2.1:generate (default-cli) @ standalone-pom 
[INFO]
[INFO]  maven-archetype-plugin:2.1:generate (default-cli) @ standalone-pom 
[INFO]
[INFO] --- maven-archetype-plugin:2.1:generate (default-cli) @ standalone-pom ---
[INFO] Generating project in Interactive mode
[INFO] No archetype defined. Using maven-archetype-quickstart (org.apache.maven.archetypes:maven-archetype-quickstart:1.0)
Choose archetype:
1: http://tapestry.apache.org - org.apache.tapestry:quickstart (Tapestry 5 Quickstart Project)
2: http://tapestry.apache.org - org.apache.tapestry:tapestry-archetype (Tapestry 4.1.6 Archetype)
Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): : 1
Choose version:
1: 5.0.19
2: 5.1.0.5
3: 5.2.6
4: 5.3.7
Choose a number: 4: 4
Downloading: http://tapestry.apache.org/org/apache/tapestry/quickstart/5.3.6/quickstart-5.3.7.jar
Downloading: http://repo1.maven.org/maven2/org/apache/tapestry/quickstart/5.3.6/quickstart-5.3.7.jar
Downloaded: http://repo1.maven.org/maven2/org/apache/tapestry/quickstart/5.3.6/quickstart-5.3.7.jar (64 KB at 69.3 KB/sec)
Downloading: http://tapestry.apache.org/org/apache/tapestry/quickstart/5.3.6/quickstart-5.3.7.pom
Downloading: http://repo1.maven.org/maven2/org/apache/tapestry/quickstart/5.3.6/quickstart-5.3.7.pom
Downloaded: http://repo1.maven.org/maven2/org/apache/tapestry/quickstart/5.3.6/quickstart-5.3.7.pom (400 B at 1.0 KB/sec)
Define value for property 'groupId': : com.example
Define value for property 'artifactId': : newapp
Define value for property 'version':  1.0-SNAPSHOT: :
Define value for property 'package':  

[CONF] Apache Tapestry Exploring the Project

2014-01-19 Thread Bob Harner (Confluence)














  


Bob Harner edited the page:
 


Exploring the Project   




 Comment: Made images big enough to see 


...
Make sure you save changes; then click the refresh link in the web browser:
 Image RemovedImage Added 



 Wiki Markup




 {float:right|width=30%}
{note}
If Live Class Reloading isn't working for you, check the Troubleshooting section at [Class Reloading].
{note}
{float} 



...
But ... what if you make a mistake? What if you got the name in the template wrong. Give it a try; in the template, change ${currentTime} to, say, ${currenTime}, and see what you get:
 Image RemovedImage Added 
This is Tapestry's exception report page. It's quite detailed. It clearly identifies what Tapestry was doing, and relates the problem to a specific line in the template, which is shown in context. Tapestry always expands out the entire stack of exceptions, because it is so common for exceptions to be thrown, caught, and re-thrown inside other exceptions. In fact, if we scroll down just a little bit, we see more detail about this exception, plus a little bit of help:
 Image RemovedImage Added 
This is part of Tapestry's way: it not only spells out exactly what it was doing and what went wrong, but it even helps you find a solution; here it tells you the names of properties you could have used.
...






 View Online   Like   View Changes  
 Stop watching space   Manage Notifications  


 


 


  This message was sent by Atlassian Confluence 5.0.3, Team Collaboration Software  






[CONF] Apache Tapestry Using BeanEditForm To Create User Forms

2014-01-19 Thread Bob Harner (Confluence)














  


Bob Harner edited the page:
 


Using BeanEditForm To Create User Forms   




 Comment: Made images big enough to see 


...



 Code Block








title
src/main/java/com/example/tutorial/entities/Address.java


language
java


 




 package com.example.tutorial.entities;

import com.example.tutorial.data.Honorific;

public class Address
{
  public Honorific honorific;
   public String firstName;
   public String lastName;
   public String street1;
   public String street2;
   public String city;
   public String state;
   public String zip;
   public String email;
   public String phone;
}
 



We also need to define the enum type, Honorific:
...
So ... why is the class named CreateAddress and not simply Create? Actually, we could have named it Create, and the application would still work, but the longer class name is equally valid. Tapestry noticed the redundancy in the class name (com.example.tutorial.pages.address.CreateAddress) and just stripped out the redundant suffix
...
 . Tapestry also checks for redundant prefixes. In addition, the long name, address/CreateAddress  
...
 . 
  
 would also work. 
Eventually, your application will probably have more entities: perhaps you'll have a user/Create page and a payment/Create page and an account/Create page. You could have a bunch of different classes all named Create spread across a number of different packages. That's legal Java, but it isn't ideal. You may find yourself 

[CONF] Apache Tapestry Creating The Skeleton Application

2014-01-19 Thread Bob Harner (Confluence)














  


Bob Harner edited the page:
 


Creating The Skeleton Application   




 Comment: Made images big enough to see 


...
Our final command line is:
 



 Code Block








language
text


 




 mvn archetype:generate -DarchetypeCatalog=http://tapestry.apache.org
 



It will then prompt you to pick the archetype - choose the latest Tapestry 5.X Quickstart Project, enter the group id, artifact id, version and package when prompted.



 No Format




 

$ mvn archetype:generate -DarchetypeCatalog=http://tapestry.apache.org
[INFO] Scanning for projects...
[INFO]
[INFO] 
[INFO] Building Maven Stub Project (No POM) 1
[INFO] 
[INFO]
[INFO]  maven-archetype-plugin:2.1:generate (default-cli) @ standalone-pom 
[INFO]
[INFO]  maven-archetype-plugin:2.1:generate (default-cli) @ standalone-pom 
[INFO]
[INFO] --- maven-archetype-plugin:2.1:generate (default-cli) @ standalone-pom ---
[INFO] Generating project in Interactive mode
[INFO] No archetype defined. Using maven-archetype-quickstart (org.apache.maven.archetypes:maven-archetype-quickstart:1.0)
Choose archetype:
1: http://tapestry.apache.org - org.apache.tapestry:quickstart (Tapestry 5 Quickstart Project)
2: http://tapestry.apache.org - org.apache.tapestry:tapestry-archetype (Tapestry 4.1.6 Archetype)
Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): : 1
Choose version:
1: 5.0.19
2: 5.1.0.5
3: 5.2.6
4: 5.3.7
Choose a number: 4: 4
Define value for property 

[CONF] Apache Tapestry Type Coercion

2014-01-18 Thread Bob Harner (Confluence)














  


Bob Harner edited the page:
 


Type Coercion   




 Comment: fixed language param of code macro 


...
For example, consider the Count component:



 Code Block








language
java


 




 

public class Count
{
@Parameter
private int start = 1;

@Parameter(required = true)
private int end;

@Parameter
private int value;

. . .
 



...
However, it is likely that the component will be used as so:



 Code Block








language
java


 




 
 Merry Christmas: t:count end=3 Ho! /t:count
 



  

[CONF] Apache Tapestry Component Events

2014-01-18 Thread Bob Harner (Confluence)














  


Bob Harner edited the page:
 


Component Events   




 Comment: fixed language param of code macro 


...
Let's review a simple example. Here's a portion of the template for a page (let's call it Chooser) that lets the user choose a number between 1 and 10:



 Code Block








language
xml


 




 

p Choose a number from 1 to 10:

t:count end=10 value=index
a t:id=select t:type=actionlink context=index${index}/t:comp
/t:count
/p
 



...
When a component event occurs, Tapestry invokes any event handler methods that you have identified for that event. You can identify your event handler methods via a naming convention (see Method Naming Convention below), or via the @OnEvent annotation.



 Code Block








language
java


 




 

[CONF] Apache Tapestry CSS

2014-01-18 Thread Bob Harner (Confluence)














  


Bob Harner edited the page:
 


CSS   




 Comment: fixed language param of code macro 


...
A page or component (for example, a layout component) that is rendering the head tag can add a style sheet directly in the markup.



 Code Block








language
java


 




 

head
  link href="" rel=stylesheet type=text/css/
  . . .
 



If you want to leverage Tapestry's localization support, you may want to make use of an expansion and the asset: or context: binding prefix:



 Code Block








language
java


 




 

head
  link href="" rel=stylesheet type=text/css/
  . . .
 



   

[CONF] Apache Tapestry Integration Testing

2014-01-18 Thread Bob Harner (Confluence)














  


Bob Harner edited the page:
 


Integration Testing   




 Comment: fixed language param of code macro 


...
Here's an example from one of the Tapestry modules:
 



 Code Block








java
title
Your Integration Test Class : SinglePersistenceUnitIntegrationTest.java


 




language
java


 




 package org.apache.tapestry5.jpa.integration.app2;

import org.apache.tapestry5.test.SeleniumTestCase;
import org.testng.annotations.Test;

public class SinglePersistenceUnitIntegrationTest extends SeleniumTestCase
{

@Test
public void persist_entities()
{
open(/persistitem);
assertEquals(getText(//span[@id='name']).length(), 0);

clickAndWait(link=create item);
assertText(//span[@id='name'], name);
}
}
 



...
Here's an example :
 



 Code Block




 

[CONF] Apache Tapestry Autoloading Modules

2014-01-18 Thread Bob Harner (Confluence)














  


Bob Harner edited the page:
 


Autoloading Modules   




 Comment: fixed language param of code macro 


...
The manifest entry name is Tapestry-Module-Classes. The value is a comma-separated list of fully qualified class names of module classes (this allows a single JAR to contain multiple, related modules). Whitespace is ignored.
Example:
 



 Code Block




 java



language


 




text


 




 Manifest-Version: 1.0
Tapestry-Module-Classes: org.example.mylib.LibModule, org.example.mylib.internal.InternalModule 



If you are using Maven 2, then getting these entries into your JAR's manifest is as simple as some configuration in your pom.xml:
 



 Code Block




 java



language
   

[CONF] Apache Tapestry Logging in Tapestry

2014-01-18 Thread Bob Harner (Confluence)














  


Bob Harner edited the page:
 


Logging in Tapestry   




 Comment: fixed language param of code macro 


...
An example from the startup of a Tapestry application:



 No Format




 

[INFO] RegistryBuilder Adding module definition for class org.apache.tapestry5.services.TapestryModule
[INFO] RegistryBuilder Adding module definition for class org.apache.tapestry5.internal.services.InternalModule
[INFO] RegistryBuilder Adding module definition for class org.apache.tapestry5.services.assets.AssetsModule
[INFO] RegistryBuilder Adding module definition for class org.apache.tapestry5.services.pageload.PageLoadModule
[INFO] RegistryBuilder Adding module definition for class org.apache.tapestry5.integration.app1.services.AppModule
[INFO] RegistryBuilder Adding module definition for class org.apache.tapestry5.integration.app1.services.TestOnlyModule
[DEBUG] Registry [  1] -- Creating proxy for service ServletApplicationInitializer
[DEBUG] Registry [  2] -- Obtaining AspectDecorator service
[DEBUG] Registry [  3] -- Creating proxy for service AspectDecorator
[DEBUG] Registry [  3] -- Creating proxy for service AspectDecorator [59.42 ms]
[DEBUG] Registry [  2] -- Obtaining AspectDecorator service [62.49 ms]
[DEBUG] Registry [  1] -- Creating proxy for service ServletApplicationInitializer [113.98 ms]
[DEBUG] Registry [  1] -- Realizing service ServletApplicationInitializer
[DEBUG] Registry [  2] -- Realizing service ServletApplicationInitializer via org.apache.tapestry5.services.TapestryModule.buildServletApplicationInitializer(Logger, List, ApplicationInitializer) (at TapestryModule.java:1398)
[DEBUG] Registry [  3] -- Constructing module class org.apache.tapestry5.services.TapestryModule
[DEBUG] Registry [  4] -- Determining injection value for parameter #1 (org.apache.tapestry5.ioc.services.PipelineBuilder)
[DEBUG] Registry [  5] -- Creating proxy for service MasterObjectProvider
[DEBUG] Registry [  5] -- Creating proxy for service MasterObjectProvider [5.77 ms]
[DEBUG] Registry [  5] -- Realizing service MasterObjectProvider
[DEBUG] Registry [  6] -- Realizing service MasterObjectProvider via org.apache.tapestry5.ioc.internal.services.MasterObjectProviderImpl(List, OperationTracker) (at MasterObjectProviderImpl.java:32) via org.apache.tapestry5.ioc.services.TapestryIOCModule.bind(ServiceBinder) (at TapestryIOCModule.java:49)
[DEBUG] Registry [  7] -- Invoking constructor org.apache.tapestry5.ioc.internal.services.MasterObjectProviderImpl(List, OperationTracker) (at MasterObjectProviderImpl.java:32) via org.apache.tapestry5.ioc.services.TapestryIOCModule.bind(ServiceBinder) (at TapestryIOCModule.java:49)
[DEBUG] Registry [  8] -- Determining injection value for parameter #1 (java.util.List)
[DEBUG] Registry [  9] -- Collecting ordered configuration for service MasterObjectProvider
[DEBUG] Registry [ 10] -- Invoking method org.apache.tapestry5.ioc.services.TapestryIOCModule.setupObjectProviders(OrderedConfiguration, ServiceOverride) (at TapestryIOCModule.java:131).
[DEBUG] Registry [ 11] -- Determining injection value for parameter #1 (org.apache.tapestry5.ioc.OrderedConfiguration)
[DEBUG] Registry [ 11] -- Determining injection value for parameter #1 (org.apache.tapestry5.ioc.OrderedConfiguration) [0.17 ms]
[DEBUG] Registry [ 11] -- 

[CONF] Apache Tapestry Integrating with Spring Framework

2014-01-18 Thread Bob Harner (Confluence)














  


Bob Harner edited the page:
 


Integrating with Spring Framework   




 Comment: fixed language param of code macro 


...
For integrating Spring Security into your application, see Security.
 Contents 
 



 Table of Contents








maxLevel
3


type
list


 




Spring Version
This module is compiled and tested against Spring Framework 2.5.6. It should be reasonable to override the dependency to earlier versions of Spring, though the code makes use of some APIs that were added to Spring to support JDK 1.5 annotations.
...
To integrate Spring with Tapestry, you should add the below dependency in your classpath. The following exemple is for Maven users.



 Code Block








language
xml


 
   

[CONF] Apache Tapestry Bean Validation

2014-01-18 Thread Bob Harner (Confluence)














  


Bob Harner edited the page:
 


Bean Validation   




 Comment: fixed language param of code macro 





since








since
5.2


 




 

 






 Wiki Markup




 {float:right|background=""
{contentbylabel:title=Related Articles|showLabels=false|showSpace=false|space=TAPESTRY|labels=validation}
{float} 



...
The BeanValidatorSource service is responsible for bootstrapping the Validator. You can contribute a BeanValidatorConfigurer to the configuration of this service in order to participate on the configuration of Validator.



 Code Block








language
java
  

[CONF] Apache Tapestry Component Report

2014-01-18 Thread Bob Harner (Confluence)














  


Bob Harner edited the page:
 


Component Report   




 Comment: fixed language param of code macro 


...
The documentation is generated into a directory structure that mimics the package structure; thus a link to component documentation for components in the same package is just a link to another file (with a .html extension) in the same folder.
Example:



 Code Block








language
xml


 




 

document
body
section name=Related Components
ul
lia href=""
lia href=""
/ul
 /section
 section name=Examples
pThe Baz component can be used to generate a gloop style of interface:/p
pimg src=""
. . .
 



...
Just add the following to the reporting/plugins section of your POM:



 Code Block








language
xml


 



[CONF] Apache Tapestry Tapestry for JSF Users

2014-01-18 Thread Bob Harner (Confluence)














  


Bob Harner edited the page:
 


Tapestry for JSF Users   




 Comment: fixed language param of code macro 


...



 Wiki Markup




 {float:right|background=""
{contentbylabel:title=Related Articles|showLabels=false|showSpace=false|labels=new-users}
{float} 



This is



 Excerpt




 a cheat sheet brief guide for learning Tapestry, designed for those who already know JavaServer Faces (JSF) 


.

...
Faces templates and Tapestry templates are superficially quite similar.



 Section








 Column




  



 Code Block


 

[CONF] Apache Tapestry Default Parameter

2014-01-18 Thread Bob Harner (Confluence)














  


Bob Harner edited the page:
 


Default Parameter   




 Comment: fixed language param of code macro 





 Wiki Markup




 {scrollbar} 






 Excerpt








hidden
true


 




  Avoiding repetition when using component parameters by adding autoconnect=true  



Default Parameter



 Wiki Markup




 {float:right|background=""
{contentbylabel:title=Related Articles|showLabels=false|showSpace=false|space=@self|labels=parameters}
{float} 



...
Let's say you have created a component, RichTextEditor, which operates like a normal TextArea component, but provides a _javascript_ rich text editor. You might start with something like:
 


[CONF] Apache Tapestry Component Libraries

2014-01-18 Thread Bob Harner (Confluence)














  


Bob Harner edited the page:
 


Component Libraries   




 Comment: fixed language param of code macro 





 Wiki Markup




 {scrollbar} 






 Excerpt








hidden
true


 




  How to create a library of your custom components  



Creating Component Libraries
...
Tapestry doesn't mandate that you use any build system, but we'll assume for the moment that you are using Maven 2. In that case, you'll have a pom.xml file something like the following:
 



 Code Block








XML
title

[CONF] Apache Tapestry Switching Cases

2014-01-18 Thread Bob Harner (Confluence)














  


Bob Harner edited the page:
 


Switching Cases   




 Comment: fixed language param of code macro 





 Wiki Markup




 {scrollbar} 






 Excerpt








hidden
true


 




  Performing the equivalent of a switch statement in your component template using blocks and a delegate  



Switching Cases
With Tapestry's If component you can only test one condition at a time. In order to distinguish multiple cases, you'd have to write complex nested if/else constructs in your page template and have a checker method for each test inside your page class.
...
Imagine for example a use case, where you want to distinguish between 4 cases and you have an int property called whichCase that should be tested against. Your page template would look as follows:
 



 Code Block






  

[CONF] Apache Tapestry Error Page Recipe

2014-01-18 Thread Bob Harner (Confluence)














  


Bob Harner edited the page:
 


Error Page Recipe   




 Comment: fixed language param of code macro 





 Wiki Markup




 {scrollbar} 






 Excerpt








hidden
true


 




  Serving up a Tapestry page as your site's custom 404 response page  






 Wiki Markup




 {float:right|background=""
{contentbylabel:title=Related Articles|showLabels=false|showSpace=false|space=@self|labels=errors}
{float} 



...
Simply upgrade your application web.xml to the 2.4 version, and make a couple of changes:
 



 Code Block
  

[CONF] Apache Tapestry Extending the If Component

2014-01-18 Thread Bob Harner (Confluence)














  


Bob Harner edited the page:
 


Extending the If Component   




 Comment: fixed language param of code macro 





 Wiki Markup




 {scrollbar} 






 Excerpt








hidden
true


 




  Adding a type coercion to enable the If component to test for anything  



Extending the If Component
...
 



 Code Block








title
SearchResult.java


 
   

[CONF] Apache Tapestry Meta-Programming Page Content

2014-01-18 Thread Bob Harner (Confluence)














  


Bob Harner edited the page:
 


Meta-Programming Page Content   




 Comment: fixed language param of code macro 





 Wiki Markup




 {scrollbar} 






 Excerpt








hidden
true


 




  Adding an Annotation and a Filter to customize Tapestry's page rendering  



Meta-Programming Page Content
...
 



 Code Block








title
ForbidFraming.java


 
  

[CONF] Apache Tapestry Link Components FAQ

2014-01-18 Thread Bob Harner (Confluence)














  


Bob Harner edited the page:
 


Link Components FAQ   




 Comment: fixed language param of code macro 


...
However, you can accomplish the same thing with a little code and markup. For example, to create a link to another page and pass a query parameter, you can replace your PageLink component with a standard a tag:



 Code Block








controls
true


linenumberslanguage
truexml


 




 

a href="" Profile (w/ full details)/a
 



In the matching Java class, you can create the Link programmatically:



 Code Block








controls
true


linenumberslanguage
truejava

  

[CONF] Apache Tapestry Ajax Components FAQ

2014-01-18 Thread Bob Harner (Confluence)














  


Bob Harner edited the page:
 


Ajax Components FAQ   




 Comment: fixed language param of code macro 


...
Where does that content come from? You inject it into your page.



 Code Block








controls
true


linenumberslanguage
truexml


 




 

t:zone id=search t:id=searchZone
  t:form t:id=searchForm zone=searchZone
t:textfield t:id=query size=20/
input type=submit value=Search/
  /t:form
/t:zone

t:block id=searchResults
  ul
li t:type=loop source=searchHits value=searchHit${searchHit}/li
  /ul
/t:block
 






 Code Block








controls
true


linenumberslanguage
truejava

  

[CONF] Apache Tapestry Security FAQ

2014-01-18 Thread Bob Harner (Confluence)














  


Bob Harner added a comment to the page:
 


Security FAQ   





Added security label





 View Online   Like  
 Stop watching space   Manage Notifications  


 


 


  This message was sent by Atlassian Confluence 5.0.3, Team Collaboration Software  






[CONF] Apache Tapestry Integration with existing applications

2014-01-18 Thread Bob Harner (Confluence)














  


Bob Harner edited the page:
 


Integration with existing applications   




 Comment: Removed broken footnote 


...
All you need to know is how Tapestry converts page class names to page names (that appear in the URL). It's basically a matter of stripping off the root-package.pages prefix from the fully qualified class name. So, for example, if you are building a login screen as a JSP, you might want to have a Tapestry page to receive the user name and password. Let's assume the Tapestry page class is com.example.myapp.pages.LoginForm; the page name will be loginform  
 



 Wiki Markup




 
{footnote}Tapestry is case insensitive, so LoginForm would work just as well.{footnote}
 




 (although, sinceTapestry is case insensitive, LoginForm would work just as well), and the URL will be /loginform. 
  



 Code Block








controls
true


linenumbers
true


 



...



 
form method=post action=""

  input type=text value=userName/
  br/
  input type=password value=password/
  br/
  input type=submit value=Login/


[CONF] Apache Tapestry Limitations

2014-01-18 Thread Bob Harner (Confluence)














  


Bob Harner edited the page:
 


Limitations   




 Comment: Removed broken footnote 


...
Although you code Tapestry pages and components as if they were ordinary POJOs 
 



 Wiki Markup




 
{footnote}Plain Old Java Object. Tapestry does not require you to extend any base classes or implement any special interfaces.{footnote}
 




 (Plain Old Java Objects -- Tapestry does not require you to extend any base classes or implement any special interfaces), as deployed by Tapestry they are closer to a traditional servlet: a single instance of each page services requests from multiple threads. Behind the scenes, Tapestry transforms you code, rewriting it on the fly. 
  
What this means is that any incoming request must be handled by a single page instance. Therefore, Tapestry enforces the concept of static structure, dynamic behavior.
...



 Code Block








controls
true


linenumbers
true


 




 

public static void bind(ServiceBinder binder)
{
  binder.bind(ArchiveService.class, ArchiveServiceImpl.class);
}

public static JobQueue buildJobQueue(MessageService 

[CONF] Apache Tapestry Specific Errors FAQ

2014-01-18 Thread Bob Harner (Confluence)














  


Bob Harner edited the page:
 


Specific Errors FAQ   




 Comment: Removed broken footnote 


...
Tapestry's live class reloading is not perfect
 



 Wiki Markup




 
{footnote:1}The perfect is the enemy of the good.{footnote}
 




 .It tends to use a lot of Java ClassLoaders on top of the normal ClassLoaders used by the Java Virtual Machine and the servlet container. When you change non-component classes and interfaces that are referenced by components and pages, such as to add or change a method, only the component classes are reloaded. The non-component classes are frozen as they were when they were first loaded. 
Unfortunately, this is one of the areas where you must restart your application entirely in order to force the new versions of the non-component classes to be loaded into memory.
 



 Wiki Markup




 
{display-footnotes}
 




  



 Wiki Markup




 
{scrollbar}
 









 View Online   Like   View Changes  
 Stop watching space   Manage Notifications  
  

[CONF] Apache Tapestry Maven Support FAQ

2014-01-18 Thread Bob Harner (Confluence)














  


Bob Harner edited the page:
 


Maven Support FAQ   




 Comment: fixed language param of code macro 


...



 Code Block








title
pom.xml (partial)


language
xml


 




 
 resource
directorysrc/main/resources/directory
excludes
  exclude**/*.tml/exclude
/excludes
filteringtrue/filtering
  /resource

  resource
directorysrc/main/resources/directory
includes
  include**/*.tml/include
/includes
filteringfalse/filtering
  /resource
 



...






 View Online   Like   View Changes  
 Stop watching space   Manage Notifications  


 


 


  This message was sent by Atlassian Confluence 5.0.3, Team Collaboration Software  






[CONF] Apache Tapestry Release Notes 5.2

2014-01-18 Thread Bob Harner (Confluence)














  


Bob Harner edited the page:
 


Release Notes 5.2   




 Comment: fixed language param of code macro 


...
This is the consolidated list of changes between Tapestry versions 5.1 and 5.2. To upgrade from 5.1 to 5.2, most users will be able to just update the Maven dependency in their POM file (or download the new JAR file) and the new version will just work. However, please read carefully below before upgrading, and also review the How to Upgrade instructions.
 Contents 
 



 Table of Contents








maxLevel
2


minLevel
2


 




Breaking Changes
The following changes have been made in Tapestry 5.2 that are likely to result in unexpected behavior if your application relies on the changed functionality. Please review this list carefully before upgrading from 5.1 to 5.2. Also check the Deprecated API List for non-breaking changes.

Page classes with instance variables that are not thread safe must be created in a method rather than declared as an instance variable. For example, creating an instance variable private final DateFormat format = DateFormat.getDateInstance(DateFormat.MEDIUM, locale); in a page and using it will cause problems because DateFormat is not thread safe. Instead, you must create the DateFormat in a method. See Release Notes: Tapestry 5.2.0 (below) for details.
 Link.toAbsoluteURI() now returns the absolute URL, which includes the scheme, hostname and possibly port (e.g., http://example.com:8080/myapp/viewproduct/4), rather than a relative URL (e.g., /myapp/viewproduct/4). See Release Notes: Tapestry 5.2.2 (below) for details.
The Label component no longer outputs an id:

Previously valid 

[CONF] Apache Tapestry Configuration

2014-01-18 Thread Bob Harner (Confluence)














  


Bob Harner edited the page:
 


Configuration   




 Comment: Removed tapestry.requirejs as suggested by M. Gelbana (it went away with Howard's commit c29f410 back in Nov 2013) 


...
The folder, of the context, in which the Tapestry application executes. By default this is blank, meaning the Tapestry application executes in the root of the web application context. Setting this value allows the Tapestry application to be segregated into a folder, which can be useful when Tapestry is executed inside a web application with other servlets or filters.
...
tapestry.compressed-asset-path-prefix



since








since
5.4


 




  



As with tapestry.asset-path-prefix but for compressed versions of assets. At render time, Tapestry determines whether each asset is compressable (for example, image file formats are not). A path for either tapestry.asset-path-prefix or this prefix is selected at render time. Defaults to the asset path prefix with .gz appended.
...
tapestry.execution-mode
The execution mode. See Setting Execution Modes below.
tapestry.file-check-interval
Time interval between file system checks. During a file system check, only a single thread is active (all others are blocked) and any files loaded are checked for changes (this is part of automatic component reloading).
The default is 1 s (one second; see Time Interval Formats), and is usually overridden with a higher value in production (say, between one and five minutes).
...
A flag (true or false) indicating whether the application is running in production or in development. The default is true, which means that runtime exceptions are not reported with full detail (only the root 

[CONF] Apache Tapestry Implementing the Hi-Lo Guessing Game

2014-01-18 Thread Bob Harner (Confluence)














  


Bob Harner edited the page:
 


Implementing the Hi-Lo Guessing Game   




 Comment: Made images big enough to see 


...
Running the application gives us our start:
 Image RemovedImage Added 
However, clicking the link doesn't do anything yet, as its just a placeholder \a\ tag, not an actual Tapestry component. Let's think about what should happen when the user clicks that link:
...
If you click the link, you'll get an error:
 Image RemovedImage Added 
Tapestry is telling us that we need to provide some kind of event handler for that event. What does that look like?
...
So ... let's click the link and see what we get:
 Image RemovedImage Added 
Ah! We didn't create a Guess page template. Tapestry was really expecting us to create one, so we better do so.
...
Hit the browser's back button, then click the start guessing link again. We're getting closer:
 Image RemovedImage Added 
If you scroll down, you'll see the line of the Guess.tml template that has the error. We have a field named target, but it is private and there's no corresponding property, so Tapestry was unable to access it.
...
We are getting very close but there's one last big oddity to handle. Once you refresh the page you'll see that target is 0!
 Image RemovedImage Added 
What gives? We know it was set to at least 1 ... where did the value go?
...
Go back to the Index page and click the link again. Finally, we have a target number:
 Image RemovedImage Added 
That enough for us to get started. Let's build out the Guess page, and get ready to let the user make guesses. We'll show the count of guesses, and increment that count when they make them. We'll worry about high and low and actually selecting the correct value later.
...
At this point, the page is partially operational:
 Image RemovedImage Added 
Our next step is to actually check the value provided by the user against the target and provide feedback: either they guessed too high, or too low, or just right. If they get it just right, we'll switch to the GameOver page.
For wrong guesses, we'll see an update such as:
 Image RemovedImage Added 
And correct guesses will send us to the GameOver page:
 Image RemovedImage Added 
Let's start with the Guess 

[CONF] Apache Tapestry Component Classes

2013-12-22 Thread Bob Harner (Confluence)














  


Bob Harner edited the page:
 


Component Classes   




 Comment: changed {code} param from xml to language=xml, as an experiment 


...



 Section








 Column








 Code Block









java


title
HelloWorld.java


 



 

[CONF] Apache Tapestry Building Tapestry from Source

2013-12-18 Thread Bob Harner (Confluence)














  


Bob Harner edited the page:
 


Building Tapestry from Source   




 Comment: Just testing the publishing process 


This is a guide to building Tapestry itself from source code. This is primarily of interest to Tapestry contributors, rather than Tapestry users.
...
Clone Tapestry from the Git repo:

  Command-line git users: 




 Non Committers: 
 git clone http://git-wip-us.apache.org/repos/asf/tapestry-5.git


 Committers: 
 git clone https://git-wip-us.apache.org/repos/asf/tapestry-5.git



 
Eclipse EGit users:

Switch to Git perspective; then copy one of the URLs above into paste buffer
Right-click  Paste repository path or URI. This will bring up the Clone Git Repository dialog.
Committers: make sure Protocol is https, and enter your Apache commiter LDAP user name  password
click Next.
Select the branches you're interested in (e.g 5.3 and master), click Next
Select Directory to where you want the project source code (e.g. ~/git/tapestry-5 or %HOME%\git\tapestry-5)
Select whichever Initial Branch you're interested in (e.g. master)
Set Remote name to origin (the default)
 VERY IMPORTANT: uncheck the Import all existing projects checkbox (we'll do this using Gradle, below)
Click Finish. (Be patient; the clone operation might take a few minutes.)
 

...

Command-line users:

 ./gradlew build -x test 
You can skip tests on a specific module by adding a colon and the module name. For example: -x test:tapestry-ioc 
   

[CONF] Apache Tapestry IoC Cookbook - Patterns

2013-11-25 Thread Bob Harner (Confluence)







IoC Cookbook - Patterns
Page edited by Bob Harner


Comment:
Fixed the , ,  and  occurrances as reported by basileChandesris


 Changes (16)
 




...
Main Article: [Chain of Command|ChainBuilder Service]  
Letapos;s Lets look at another example, again from the Tapestry code base. The [InjectProvider|http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/InjectionProvider.html] interface is used to process the @Inject annotation on the fields of a Tapestry page or component. Many different instances are combined together to form a _chain of command_. 
 The interface has only a single method (this is far from uncommon): 
...
}{code}  
The return type indicates whether the provider was able to do something. For example, the AssetInjectionProvider checks to see if thereapos;s theres an @Path annotation on the field, and if so, converts the path to an asset, works with the ClassTransformation object to implement injection, and returns true to indicate success. Returns true terminates the chain early, and that true value is ultimately returned to the caller. 
 In other cases, it returns false and the chain of command continues down to the next provider. If no provider is capable of handling the injection, then the value false is ultimately returned. 
...
{code} public static void contributeInjectionProvider( 
OrderedConfigurationlt;InjectionProvidergt; OrderedConfigurationInjectionProvider configuration, 
MasterObjectProvider masterObjectProvider, ObjectLocator locator, 
...
AssetSource assetSource) { 
configuration.add(quot;Defaultquot;, configuration.add(Default, new DefaultInjectionProvider(masterObjectProvider, locator)); 
 
configuration.add(quot;ComponentResourcesquot;, configuration.add(ComponentResources, new ComponentResourcesInjectionProvider()); 
 
  configuration.add(   quot;CommonResourcesquot;, 
configuration.add(CommonResources, new CommonResourcesInjectionProvider(), after:Default); 
  quot;after:Defaultquot;); 
 
  configuration.add(   quot;Assetquot;, 
configuration.add(Asset, new AssetInjectionProvider(symbolSource, assetSource), before:Default); 
  quot;before:Defaultquot;); 
 
  configuration.add(quot;Blockquot;, new BlockInjectionProvider(), quot;before:Defaultquot;);   configuration.add(quot;Servicequot;, new ServiceInjectionProvider(locator), quot;after:*quot;); 
  configuration.add(Block, new BlockInjectionProvider(), before:Default);   configuration.add(Service, new ServiceInjectionProvider(locator), after:*); 
}{code}  
...
 {code} 
public InjectionProvider build(Listlt;InjectionProvidergt; build(ListInjectionProvider configuration, ChainBuilder chainBuilder) 
  { return chainBuilder.build(InjectionProvider.class, configuration);   }{code}  
Now, letapos;s lets see how this is used. The InjectWorker class looks for fields with the InjectAnnotation, and uses the chain of command to inject the appropriate value. However, to InjectWorker, there is no chain ... just a _single_ object that implements the InjectionProvider interface. 
 {code} 
...
}{code}  
Reducing the chain to a single object vastly simplifies the code: weapos;ve weve _factored out_ the loop implicit in the chain of command. That eliminates a lot of code, and thatapos;s thats less code to test, and fewer paths through InjectWorker, which lowers its complexity further. We donapos;t dont have to test the cases where the list of injection providers is empty, or consists of only a single object, or where itapos;s its the third object in that returns true: it looks like a single object, it acts like a single object ... but its implementation uses many objects. 
 {scrollbar} 


Full Content

IoC Cookbook - Overriding IoC ServicesIoC cookbookIoC cookbook - Service Configurations
Using Patterns 


Related Articles


 Page:
 ChainBuilder Service





 Page:
 PipelineBuilder Service





 Page:
 StrategyBuilder 

[CONF] Apache Tapestry Community

2013-10-30 Thread Bob Harner (Confluence)







Community
Page edited by Bob Harner


Comment:
Added link to "Eclipse Integration for Tapestry 5"


 Changes (1)
 




...
h1. IDE Integrations  
[Eclipse-tapestry5-plugin|https://github.com/anjlab/eclipse-tapestry5-plugin] {quote} An Eclipse plugin for Tapestry 5 by Dmitry Gusev, with a Quick Switch between templates and component classes, a Tapestry Context view, and many other convenience features. {quote}  
[Tapestry Tools|http://code.google.com/p/tapestrytools/wiki/Install_Guide_Lightweight_TapestryTools] by Gavin Lei {quote} 
...


Full Content

Tapestry has an active community of users and developers. This is an overview of how to participate, along with a list of some of the great contributions of the community members.



Getting Involved

Reporting Problems / Getting Support
Contributing translations for Tapestry built-in messages
Source Code Access
Becoming a Contributor
Becoming a Committer

Community Contributions

Modules

Extensions
Tutorials
IDE Integrations



Getting Involved

Reporting Problems / Getting Support

Like all Apache projects, Tapestry uses mailing lists for most communication. You can subscribe by sending e-mail to the addresses below. For each list, there are subscribe, unsubscribe, and archive links.  All Tapestry users are welcome to subscribe to any of these lists, however questions on how to use Tapestry in your application are best sent to the user mailing list.

Please note that the Nabble archives are set to read-only and don't allow for posting or answering using Nabble's web interface. You have to subscribe to the mailing list in order to post.





 Subscribe 
 Unsubscribe 
 Apache Archive 
 Nabble Archive 
 MarkMail Archive 


 Tapestry User List 
 Subscribe 
 Unsubscribe 
 mail-archives.apache.org 
 www.nabble.com 
 tapestry.markmail.org 


 Tapestry Developer List 
 Subscribe 
 Unsubscribe 
 mail-archives.apache.org 
 www.nabble.com 
 tapestry.markmail.org 


 Tapestry Commits List 
 Subscribe 
 Unsubscribe 
 mail-archives.apache.org 
  
 tapestry.markmail.org 


 Search Multiple Lists 
  
  
  
 www.nabble.com 
 tapestry.markmail.org 





Tapestry issues are tracked in the Apache JIRA.

Unless your problem is clear as day, it's a good idea to discuss it on the Tapestry Users mailing list first, before adding an issue. At the same time, it's generally unlikely that a bug will be fixed unless a JIRA Issue is created.

Eric Raymond has a detailed guide to asking questions the right way.  If you are not getting a response to your problem, it's likely because you aren't asking it the right way.

Just saying something is "broken" or "failed" is not enough.  How did it fail?  Did it do the wrong thing? Throw an exception? Not respond in any way?  What exactly did you expect to happen?  All of this information should be made available when looking for help, plus context on the general problem you were trying to solve in the first place (there may be a better solution entirely).  Read Eric Raymond's guide ... it's fun and informative.

Contributing translations for Tapestry built-in messages

If Tapestry's built-in messages aren't available in your language, you are welcome to contribute a new translation of the message catalogs. For easy instructions, see Localization.

Source Code Access

Source code for Tapestry can be downloaded along with pre-compiled binaries.

Tapestry uses Git to manage the project's source code.

Web access to the Tapestry repository is available as GIT-WIP at Apache.

Access using Git client:


$ git clone http://git-wip-us.apache.org/repos/asf/tapestry-5.git



(See Building Tapestry from Source for more info.)

Becoming a Contributor

The best way to become a contributor is to become active on the mailing list; Tapestry is known to have an active and helpful community on the mailing list, and the more mentors we can add, the better.

If you want to help out with documentation, you must sign an Apache Contributor License Agreement, at which point we can grant write access to the Confluence Wiki (where official documentation is created).

Providing patches (with tests) is another way to become a contributor.

Becoming a Committer

Active contributors may be asked to become full committers, with write access to the source code. Generally, contributors who have been consistently active and helpful for three to six months are eligible for committer access. If you think you are in that category, don't be shy about contacting members of the Tapestry PMC (Project Management Committee).



Community Contributions








Modules

Chenille Kit by Massimo Lusetti

Collection of modules, services, utilities and components 

[CONF] Apache Tapestry Performance and Clustering

2013-10-22 Thread Bob Harner (Confluence)







Performance and Clustering
Page edited by Bob Harner


Comment:
Added mention of tapestry.clustered-sessions symbol


 Changes (1)
 




...
* Ensure (be absolutely sure) that [Production Mode|Configuration#tapestry.productionmode] is turned on in production. * Minimize the use of the HTTPSession (see below), especially if youre using clustering. 
* Set [tapestry.clustered-sessions|Configuration#tapestry.clustered-sessions] to false if you arent using clustering. 
* Organize your _javascript_ files into [_javascript_Stacks|_javascript_#_javascript_Stacks]. * Ensure that your static resources (images, CSS, _javascript_) are being cached by the browser. 
...


Full Content


Related Articles


 Page:
 Persistent Page Data





 Page:
 Session Storage





 Page:
 Performance and Clustering




 

Performance and Clustering

Tapestry has a great performance story to tell. It's designed to take advantage of the speed of the modern JVM: no reflection, built to support a high level of concurrency without contention, and clean, lightweight code paths. In addition, there is built-in integrated GZIP content compression, far-future expires headers on static resources, _javascript_ aggregation and minification, and an intentionally lightweight use of the HTTPSession. The result is a blistering fast framework. See Tapestry's Performance Tested for some objective numbers.

Performance Tips

But even with all of Tapestry's built-in speediness, to really get top performance you'll need to be sure you're not hamstringing Tapestry. As a start, use the following checklist:


	Ensure (be absolutely sure) that Production Mode is turned on in production.
	Minimize the use of the HTTPSession (see below), especially if you're using clustering.
	Set tapestry.clustered-sessions to "false" if you aren't using clustering.
	Organize your _javascript_ files into _javascript_Stacks.
	Ensure that your static resources (images, CSS, _javascript_) are being cached by the browser.
	
		Use "asset:" or "context:" binding prefixes for all links to static resources (images, CSS, _javascript_).
		Make sure that your firewall, proxy server, load balancer, front-end web servers, and app servers all allow caching of static resources.
		Ensure "cache-control" and "vary" HTTP headers are set correctly for your static resources.
		Use a client-based tool (like Firebug) to examine the requests that your browser makes as you navigate through the site. You should not see repeated requests for static resources.
	
	
	Consider using a Content Delivery Network for static parts of your site.



After all of the above issues are addressed, if you still have performance problems, they probably aren't related to Tapestry.

Clustering versus Sticky Sessions

For web applications, clustering is a load-balancing technique in which multiple application servers are set up to behave as one big server. Generally this requires replicating HttpSession data across the servers, to ensure that a user's web interactions will continue without interruption regardless of which server handles the next request. Session replication achieves very high reliability, but it incurs an extra performance cost (due to the serializing and deserializing of session data and the extra network traffic required).

In contrast, Sticky Sessions (also called session persistence or sticky persistence) is a load balancing technique in which each session is assigned to a particular server for the duration of the session. This approach doesn't require copying HTTPSession data between servers, so it's very scalable. But if a server goes down, all of its sessions are lost.

In general, the sticky sessions approach is the way to go when possible (that is, when performance is more important than session survival).  It represents a much more efficient use of resources ... you are scaling out not up, which is always cheaper. It also means that you don't have to be as careful about what goes into the HTTPSession.

For details on setting up clustering and sticky sessions, see the documentation of whatever load balancer you are using.

Clustering

Tapestry is designed to be "a good citizen" of an application server that supports clustering.  It is careful about what it 

[CONF] Apache Tapestry Component Rendering

2013-10-15 Thread Bob Harner (Confluence)







Component Rendering
File attached by  Bob Harner




tapestry_render_phases.gliffy
(39 kB application/octet-stream)
-
Updated render phase chart (Gliffy source)



   
Stop watching space
|
Change email notification preferences

   View Attachments









[CONF] Apache Tapestry Component Rendering

2013-10-15 Thread Bob Harner (Confluence)







Component Rendering
File attached by  Bob Harner




tapestry_render_phases.png
(61 kB image/png)
-
Updated render phase chart (PNG)



   
Stop watching space
|
Change email notification preferences

   View Attachments









[CONF] Apache Tapestry Component Events

2013-10-14 Thread Bob Harner (Confluence)







Component Events
Page edited by Bob Harner


Comment:
"then then" fixed per M. MGelbana


 Changes (1)
 




...
In the above example, the navigational response is the page itself.  
If there is no exception event handler, or the exception event handler returns null (or is void), then then the exception will be passed to the [RequestExceptionHandler|http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/RequestExceptionHandler.html] service, which (in default configuration) will be render the exception page. 


Full Content

Component Events


Related Articles


 Page:
 Request Processing





 Page:
 Component Events





 Page:
 Component Rendering





 Page:
 Page Life Cycle





 Page:
 Page Navigation





 Page:
 Component Events FAQ






Component events are Tapestry's way of conveying a user's interactions with the web page, such as clicking links and submitting forms, to designated methods in your page and component classes.  When a component event occurs, Tapestry calls the event handler method you've provided, if any, in the containing component's class.

Let's review a simple example. Here's a portion of the template for a page (let's call it "Chooser") that lets the user choose a number between 1 and 10:



p Choose a number from 1 to 10:

t:count end="10" value="index"
a t:id="select" t:type="actionlink" context="index"${index}/t:comp
/t:count
/p



Notice that Chooser.tml contains an ActionLink component. When rendered on the page, the ActionLink component creates a component event request URL, with the event type set to "action". In this case the URL might look like http://localhost:8080/chooser.select/3

This URL identifies the page that contains the component ("chooser"), the type of event (unless it is "action", the default and most common event type), the id of the component within the page ("select"), plus the additional context value ("3"). Additional context values, if any, are appended to the path.

There's no direct mapping from URL to a piece of code. Instead, when the user clicks on the link, the ActionLink component emits events. And then Tapestry ensures that the correct bit of code (your event handler method, see below) gets invoked for those events.

This demonstrates a critical difference between Tapestry and a more traditional, action oriented framework. The URL doesn't say what happens when the link is clicked, it identifies which component is responsible when the link is clicked.

Often, a navigation request (originating with the user) will spawn a number of flow-of-control requests. For example, an action event will trigger a form component, which will then emit notification events to announce when the form submission is about to be processed, and whether it was successful or not, and those event could be further handled by the page component.

Event Handler Methods

When a component event occurs, Tapestry invokes any event handler methods that you have identified for that event. You can identify your event handler methods via a naming convention (see Method Naming Convention below), or via the @OnEvent annotation.



  @OnEvent(component = "select")
  void valueChosen(int value)
  {
this.value = value;
  }



Tapestry does two things here:


	Because of the annotation, it identifies method valueChosen() as the method to invoke.
	When the link is clicked, it converts the context value from a string to an integer and passes it into the method.





Added in 5.3

Starting in release 5.3, Tapestry will validate that the component, if any, identified for the event handler method actually exists in the containing component's template. This helps with typos in annotations (or in the naming conventions identified below).


In the above example, the valueChosen() method will be invoked when the default 

[CONF] Apache Tapestry Component Events

2013-10-14 Thread Bob Harner (Confluence)







Component Events
Page edited by Bob Harner


Comment:
Another typo


 Changes (1)
 




...
In the above example, the navigational response is the page itself.  
If there is no exception event handler, or the exception event handler returns null (or is void), then the exception will be passed to the [RequestExceptionHandler|http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/RequestExceptionHandler.html] service, which (in default configuration) will be render the exception page. 


Full Content

Component Events


Related Articles


 Page:
 Request Processing





 Page:
 Component Rendering





 Page:
 Page Life Cycle





 Page:
 Page Navigation





 Page:
 Component Events FAQ





 Page:
 Component Events






Component events are Tapestry's way of conveying a user's interactions with the web page, such as clicking links and submitting forms, to designated methods in your page and component classes.  When a component event occurs, Tapestry calls the event handler method you've provided, if any, in the containing component's class.

Let's review a simple example. Here's a portion of the template for a page (let's call it "Chooser") that lets the user choose a number between 1 and 10:



p Choose a number from 1 to 10:

t:count end="10" value="index"
a t:id="select" t:type="actionlink" context="index"${index}/t:comp
/t:count
/p



Notice that Chooser.tml contains an ActionLink component. When rendered on the page, the ActionLink component creates a component event request URL, with the event type set to "action". In this case the URL might look like http://localhost:8080/chooser.select/3

This URL identifies the page that contains the component ("chooser"), the type of event (unless it is "action", the default and most common event type), the id of the component within the page ("select"), plus the additional context value ("3"). Additional context values, if any, are appended to the path.

There's no direct mapping from URL to a piece of code. Instead, when the user clicks on the link, the ActionLink component emits events. And then Tapestry ensures that the correct bit of code (your event handler method, see below) gets invoked for those events.

This demonstrates a critical difference between Tapestry and a more traditional, action oriented framework. The URL doesn't say what happens when the link is clicked, it identifies which component is responsible when the link is clicked.

Often, a navigation request (originating with the user) will spawn a number of flow-of-control requests. For example, an action event will trigger a form component, which will then emit notification events to announce when the form submission is about to be processed, and whether it was successful or not, and those event could be further handled by the page component.

Event Handler Methods

When a component event occurs, Tapestry invokes any event handler methods that you have identified for that event. You can identify your event handler methods via a naming convention (see Method Naming Convention below), or via the @OnEvent annotation.



  @OnEvent(component = "select")
  void valueChosen(int value)
  {
this.value = value;
  }



Tapestry does two things here:


	Because of the annotation, it identifies method valueChosen() as the method to invoke.
	When the link is clicked, it converts the context value from a string to an integer and passes it into the method.





Added in 5.3

Starting in release 5.3, Tapestry will validate that the component, if any, identified for the event handler method actually exists in the containing component's template. This helps with typos in annotations (or in the naming conventions identified below).


In the above example, the valueChosen() method will be invoked when the default event, "action", occurs 

[CONF] Apache Tapestry Component Events FAQ

2013-10-14 Thread Bob Harner (Confluence)







Component Events FAQ
Page edited by Bob Harner


Comment:
"redirect-after-post" renamed to Post/Redirect/Get


 Changes (1)
 




...
h3. Why does Tapestry send a redirect after a form is submitted?  
This is an extension of the [redirect after post|http://en.wikipedia.org/wiki/Post/Redirect/Get] [Post/Redirect/Get|http://en.wikipedia.org/wiki/Post/Redirect/Get] approach. It ensures that after an operation that updates server-side state, such as a form submission, if the user resubmits the resulting page, the operation is *not* performed a second time; instead just the results of the operation, reflecting the changed server-side state, is re-rendered. 
 This has the unwanted requirement that any data needed to render the response must persist between the event request (the form submission) and the render request; this often means that fields must be annotated with @[Persist|http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/Persist.html]. 
...


Full Content

Link Components FAQFrequently Asked Questions_javascript_ FAQ 

Component Events 

Why does Tapestry send a redirect after a form is submitted?

This is an extension of the Post/Redirect/Get approach. It ensures that after an operation that updates server-side state, such as a form submission, if the user resubmits the resulting page, the operation is not performed a second time; instead just the results of the operation, reflecting the changed server-side state, is re-rendered.

This has the unwanted requirement that any data needed to render the response must persist between the event request (the form submission) and the render request; this often means that fields must be annotated with @Persist.



Added in 5.2

If you want to short-circuit this behavior and render a response directly, your component event handle method may return an instance of StreamPageContent. Tapestry will render the page as part of the event request and stream its content back to the client web browser, rather than sending the normal redirect.




Added in 5.4

Starting in release 5.4, Forms (by default) will NOT redirect after post if there are validation errors. This makes it possible to re-render the page, with error decorations, without requiring that the validation errors be stored in the session between requests ... and that means that the application can remain stateless much longer.


I specified a zone in my ActionLink/EventLink, so why doesn't my event fire via ajax (request.isXHR() is false)?

Check your browser's _javascript_ console for errors. It's likely that a _javascript_ error has prevented Tapestry from transforming your ActionLink/EventLink from a page render action to an ajax action.

Link Components FAQFrequently Asked Questions_javascript_ FAQ



Stop watching space
|
Change email notification preferences

View Online
|
View Changes









[CONF] Apache Tapestry Component Rendering

2013-10-14 Thread Bob Harner (Confluence)







Component Rendering
Page edited by Bob Harner


Comment:
Added table of render phases


 Changes (3)
 




...
These methods are *optional*, a default behavior is associated with each phase.  
The large number of phases reflects the use of [component mixins|Component Mixins] which also plug into the render phases. Several of the phases exist almost exclusively for mixins. 
|| Annotation || Method Name || When Called | | | *[@SetupRender|http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/SetupRender.html]* | setupRender()  | When initial setup actions, if any, are needed | | *[@BeginRender|http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/BeginRender]* | beginRender() | When Tapestry is ready for the components start tag, if any, to be rendered | | [@BeforeRenderTemplate|http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/BeforeRenderTemplate] | beforeRenderTemplate() | Before Tapestry renders the components template, if any | | [@BeforeRenderBody|http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/BeforeRenderBody] | beforeRenderBody() | Before Tapestry renders the body of the component, if any | | [@AfterRenderBody|http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/AfterRenderBody] | afterRenderBody() | After Tapestry renders the body of the component, if any, but before the rest of the components template is rendered | | [@AfterRenderTemplate|http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/AfterRenderTemplate] | afterRenderTemplate() | After Tapestry finishes rendering the components template, if any | | *[@AfterRender|http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/AfterRender]* | afterRender() | After Tapestry has finished rendering both the template and body of the component | | *[@CleanupRender|http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/CleanupRender]* | cleanupRender() | When final cleanup actions, if any, are needed | 
 
The large number of phases reflects the need for precise control of components from [component mixins|Component Mixins]. Several of the phases exist almost exclusively for mixins.  
Generally, your code will use the SetupRender, BeginRender, AfterRender and CleanupRender phases ... often just one or two of those.  
...


Full Content

Component Rendering


Related Articles


 Page:
 Request Processing





 Page:
 Component Rendering





 Page:
 Content Type and Markup





 Page:
 Page Life Cycle





 Page:
 Page Navigation





 Page:
 Component Events





 Page:
 Component Events FAQ




 

Rendering of components in Tapestry 5 is based on a state machine and a queue (instead of the tail recursion used in Tapestry 4). This breaks the rendering process up into tiny pieces that can easily be implemented or overridden. Don't worry, in practice, writing components requires a breathtakingly small amount of code.

Rendering Phases

The rendering of each component is divided into a number of phases, illustrated below.



Each of the orange phases (SetupRender, BeginRender, BeforeRenderBody, etc.) corresponds to an annotation you may place on one or more methods of your class. The annotation directs Tapestry to invoke your method as part of that phase.

Methods marked with these annotations are called render phase methods.

Your methods may be void, or return a boolean value. Returning a value can force phases to be skipped, or even be re-visited. In the diagram, solid lines show the normal processing path. Dashed lines are alternate 

[CONF] Apache Tapestry Component Rendering

2013-10-14 Thread Bob Harner (Confluence)







Component Rendering
Page edited by Bob Harner


Comment:
A clarification on how often SetupRender methods are called


 Changes (4)
 




...
Render phase methods may take no parameters, or may take a parameter of type [MarkupWriter|DOM]. The methods can have any visibility you like ... typically, package private is used, as this visibility makes it possible to unit test your code (from within the same Java package) without making the methods part of the components _public_ API.  
These methods are *optional*, a default behavior is associated with each phase. 
All Render phase methods are _optional_; a default behavior is associated with each phase. 
 
|| Annotation || Method Name || When Called || 
| *[@SetupRender|http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/SetupRender.html]* | setupRender()  | When initial setup actions, if any, are needed | | *[@BeginRender|http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/BeginRender]* | beginRender() | When Tapestry is ready for the components start tag, if any, to be rendered | 
...
Generally, your code will use the SetupRender, BeginRender, AfterRender and CleanupRender phases ... often just one or two of those.  
h2. An Example  
Heres the source for a looping component that counts up or down between two values, renders its body a number of times, and stores the current index value in a parameter:  
...
Whats really mind blowing is that the template and body of a component will often contain ... more components! That means that many different components will be in different phases of their own state machine.  
h2. Render Phases in Detail   {float:right|background="" {note} The SetupRender phase, like all render phases, occurs once for each rendering of the component. If the component is inside a looping component ([Loop|http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Loop.html], [Grid|http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Grid.html], etc.), then the SetupRender method will be called once for _each_ iteration of the loop. {note} {float}  
h3. SetupRender  
...


Full Content

Component Rendering


Related Articles


 Page:
 Request Processing





 Page:
 Content Type and Markup





 Page:
 Page Life Cycle





 Page:
 Page Navigation





 Page:
 Component Events





 Page:
 Component Events FAQ





 Page:
 Component Rendering




 

Rendering of components in Tapestry 5 is based on a state machine and a queue (instead of the tail recursion used in Tapestry 4). This breaks the rendering process up into tiny pieces that can easily be implemented or overridden. Don't worry, in practice, writing components requires a breathtakingly small amount of code.

Rendering Phases

The rendering of each component is divided into a number of phases, illustrated below.



Each of the orange phases (SetupRender, BeginRender, BeforeRenderBody, etc.) corresponds to an annotation you may place on one or more methods of your class. The annotation directs Tapestry to invoke your method as part of that phase.

Methods marked with these annotations are called render phase methods.

Your methods may be void, or return a boolean value. Returning a value can force phases to be skipped, or even be re-visited. In the diagram, solid lines show the normal processing path. Dashed lines are alternate flows that are triggered when your render phase methods return false instead of true (or void).

Render phase methods may take 

[CONF] Apache Tapestry Default Parameter

2013-10-14 Thread Bob Harner (Confluence)







Default Parameter
Page edited by Bob Harner


Comment:
Reordered to define "autoconnect" before using the term.


 Changes (3)
 




...
{code}  
Every component has a unique id; if you dont assign one with the {{t:id}} attribute, Tapestry will assign a less meaningful one. Component ids can end up inside URLs or used as query parameter names, so using meaningful ids helps if you are ever stuck debugging a request. The most common case of using autoconnect is form control components such as TextField and friends ... or this RichTextEditor. 
 
This repetition can be avoided by adding the _autoconnect_ attribute to the @Parameter annotation: 
 {code:java} 
...
{code}  
This can now be written as {{t:richtexteditor t:id=profile/}}. The unwanted repetition is gone: we set the id of the component and the property it edits in a single pass. 
 If there is no matching property, then a runtime exception will be thrown when loading the page because the value parameter is required and not bound. 
 The most common case of using autoconnect is form control components such as TextField and friends ... or this RichTextEditor. 


Full Content

CookbookOverriding Exception Reporting


Default Parameter


Related Articles


 Page:
 Supporting Informal Parameters





 Page:
 Enum Parameter Recipe





 Page:
 Default Parameter





 Page:
 Component Parameters






Many of the components provided with Tapestry share a common behavior: if the component's id matches a property of the container, then some parameter of the component (usually value) defaults to that property.

This is desirable, in terms of not having to specify the component's id and then specify the same value as some other parameter.

Let's say you have created a component, RichTextEditor, which operates like a normal TextArea component, but provides a _javascript_ rich text editor.  You might start with something like:



public class RichTextEditor implements Field
{
  @Property
  @Parameter(required=true)
  private String value;

  . . . // Lots more code not shown here
}



However, the weakness here is when you make use of the component. You template may look like:



t:label for=""/
br/
t:richtexteditor t:id="profile" value="profile"/



Every component has a unique id; if you don't assign one with the t:id attribute, Tapestry will assign a less meaningful one. Component ids can end up inside URLs or used as query parameter names, so using meaningful ids helps if you are ever stuck debugging a request.

This repetition can be avoided by adding the autoconnect attribute to the @Parameter annotation:



  @Property
  @Parameter(required=true, autoconnect=true)
  private String value;



This can now be written as t:richtexteditor t:id="profile"/. The unwanted repetition is gone: we set the id of the component and the property it edits in a single pass.

If there is no matching property, then a runtime exception will be thrown when loading the page because the value parameter is required and not bound.

The most common case of using autoconnect is form control components such as TextField and friends ... or this RichTextEditor.



Stop watching space
|
Change email notification preferences

View Online
|
View Changes









[CONF] Apache Tapestry Confluence Site Setup

2013-10-14 Thread Bob Harner (Confluence)







Confluence Site Setup
Page edited by Bob Harner


Comment:
Minor worsmithing


 Changes (1)
 




...
_For more details see the [SiteExporter README|https://svn.apache.org/repos/asf/tapestry/tapestry-site/trunk/README]._  
SiteExporter is a command-line Java program that is run hourly (currently at 20 minutes after the hour) from Apaches BuildBot. It makes a web service call to Confluence (to its RSS feed, actually) to get a list of each page pages that has have changed since the last run, and the HTML-formatted export of those pages. For each, it post-processes the file (described below). Finally, SiteExporter commits all changed HTML files into Tapestrys part of the Apache Subversion repository, which (nearly instantly) makes it available to the public at http://tapestry.apache.org, and commit emails are sent to Tapestrys commits mailing list. 
 Attachments (to Confluence pages) are exported in roughly the same way. 
...


Full Content


Related Articles


 Page:
 Developer Information





 Page:
 Release Process





 Page:
 Developer Bible





 Page:
 Version Numbers





 Page:
 Building Tapestry from Source





 Page:
 Confluence Site Setup




 

This document describes our web site setup: what is where and how it works.

Overview

Most of the web site and documentation (with the notable exception of the Javadoc API pages) are kept in Confluence.

Since the Confluence instance at https://cwiki.apache.org/confluence/ isn't capable of handling a lot of incoming requests, all wiki spaces are statically exported. The SiteExporter program is responsible for that. Once a page in Confluence changes, that page gets re-exported automatically.

How SiteExporter works

For more details see the SiteExporter README.

SiteExporter is a command-line Java program that is run hourly (currently at 20 minutes after the hour) from Apache's BuildBot. It makes a web service call to Confluence (to its RSS feed, actually) to get a list of pages that have changed since the last run, and the HTML-formatted export of those pages. For each, it post-processes the file (described below). Finally, SiteExporter commits all changed HTML files into Tapestry's part of the Apache Subversion repository, which (nearly instantly) makes it available to the public at http://tapestry.apache.org, and commit emails are sent to Tapestry's "commits" mailing list.

Attachments (to Confluence pages) are exported in roughly the same way.

The time between saving a change in Confluence and seeing the result on the public site is at most 1 hour, depending on when you do it. If you save a change at 19 minutes after the hour you'll see the change in about a minute. If you publish it at 21 minutes after the hour then you'll have to wait almost an hour.




 HTML files in SVN 
 https://svn.apache.org/repos/infra/websites/production/tapestry 


 Cache File 
 https://svn.apache.org/repos/infra/websites/production/tapestry/content/cache/main.pageCache 


 SiteExporter source 
 https://svn.apache.org/repos/asf/tapestry/tapestry-site/trunk 


 Velocity template 
 https://svn.apache.org/repos/asf/tapestry/tapestry-site/trunk/template/template.vm 





Post-processing HTML Pages

HTML pages exported from Confluence are post-processed in several ways before being committed to SVN. Here are just a few of the things going on:


	Tagsoup is used to clean up the HTML.
	The breadcrumb links are updated.
	Empty paragraph (p) tags are removed from the top of the page.
	{code} macro output (code examples) are detected, and SyntaxHighlighter _javascript_ links are added to the page when needed.
	{include} tags (when one Confluence page includes another) are detected, causing the including page to be regenerated autoamtically.
	{children} tags are also detected and handled



Manual Intervention

You can 

[CONF] Apache Tapestry Page Life Cycle

2013-10-14 Thread Bob Harner (Confluence)







Page Life Cycle
Comment removed by  Bob Harner



I believe this page needs to be rewritten for the new approach in 5.2 of not pooling pages.  This will need to be done by someone with a better understanding of the mechanisms involved than I have.



   
Stop watching space
|
Change email notification preferences










[CONF] Apache Tapestry Forms and Validation

2013-10-14 Thread Bob Harner (Confluence)







Forms and Validation
Page edited by Bob Harner


Comment:
Corrected error in onValidateXXX method example


 Changes (1)
 




...
 * Do the cross-field validation  */ 
void onValidateFromLoginForm() 
{ if (!authenticator.isValid(userName, password)) 
...


Full Content


Related Articles


 Page:
 Forms and Validation





 Page:
 Forms and Form Components FAQ





 Page:
 Bean Validation






The life's blood of any application is form input; this is the most effective way to gather significant information from the user. Whether it's a search form, a login screen or a multi-page registration wizard, forms are how the user really expresses themselves to the application.

Tapestry excels at creating forms and validating input. Input validation is declarative, meaning you simply tell Tapestry what validations to apply to a given field, and it takes care of it on the server and (once implemented) on the client as well.

Finally, Tapestry is able to not only present the errors back to the user, but to decorate the fields and the labels for the fields, marking them as containing errors (primarily, using CSS effects).

Contents



The Form Component

Form Events
Tracking Validation Errors
Storing Data Between Requests
Configuring Fields and Labels
Errors and Decorations

Form Validation

Available Validators
Centralizing Validation with @Validate
Customizing Validation Messages

Customizing Validation Messages for BeanEditForm

Configuring Validator Contraints in the Message Catalog
Validation Macros
Overriding the Translator with Events



The Form Component

The core of Tapestry's form support is the Form component. The Form component encloses (wraps around) all the other field components such as TextField, TextArea, Checkbox, etc.

Form Events

The Form component emits a number of component events. You'll need to provide event handler methods for some of these.

When rendering, the Form component emits two notifications: first, "prepareForRender", then "prepare". These allow the Form's container to setup any fields or properties that will be referenced in the form. For example, this is a good place to create a temporary entity object to be rendered, or to load an entity from a database to be edited.

When user submits the form on the client, a series of steps occur on the server.

First, the Form emits a "prepareForSubmit" notification, then a "prepare" notification. These allow the container to ensure that objects are set up and ready to receive information from the form submission.

Next, all the fields inside the form are activated to pull values out of the incoming request, validate them and (if valid) store the changes.

For Tapestry 4 Users: Tapestry 5 does not use the fragile "form rewind" approach from Tapestry 4. Instead, a hidden field generated during the render stores the information needed to process the form submission.

After the fields have done their processing, the Form emits a "validate" event. This is a chance to perform cross-form validation that can't be described declaratively.

Note: For compatibility with release 5.1 and earlier, the Form component also emits a "validateForm" event. (See TAP5-760.)

Next, the Form determines if there have been any validation errors. If there have been, then the submission is considered a failure, and a "failure" event is emitted. If there have been no validation errors, then a "success" event is emitted.

Finally, the Form emits a "submit" event, for logic that doesn't care about success or failure.




 Form Event (in order) 
 Phase 
 When emitted 
 Typical use 


 prepareForRender 
 Render 
 Before rendering the form 
 Load an entity from a database to be edited 


 prepare 
 Render 
 Before rendering the form, but after prepareForRender 



 prepareForSubmit 
 Submit 
 Before the submitted form is processed 



 prepare 
 Submit 
 Before the submitted form is processed, but after prepareForSubmit 



 validate 
 Submit 
 After fields have been populated from submitted values and validated 
 Perform cross-field validation 


 validateForm 
 Submit 
 same as validate 
 deprecated 


 failure 
 Submit 
 After one or more validation 

[CONF] Apache Tapestry Component Rendering

2013-10-14 Thread Bob Harner (Confluence)







Component Rendering
File attached by  Bob Harner




tapestry_render_phases.gliffy
(38 kB application/octet-stream)
-
Updated render phase chart (Gliffy source)



   
Stop watching space
|
Change email notification preferences

   View Attachments









[CONF] Apache Tapestry Component Rendering

2013-10-14 Thread Bob Harner (Confluence)







Component Rendering
File attached by  Bob Harner




tapestry_render_phases.png
(50 kB image/png)
-
Updated render phase chart (PNG)



   
Stop watching space
|
Change email notification preferences

   View Attachments









[CONF] Apache Tapestry Component Rendering

2013-10-14 Thread Bob Harner (Confluence)







Component Rendering
File attached by  Bob Harner




component-render-states.png
(86 kB image/png)
-
Older render phase chart



   
Stop watching space
|
Change email notification preferences

   View Attachments









[CONF] Apache Tapestry Component Rendering

2013-10-14 Thread Bob Harner (Confluence)







Component Rendering
File attached by  Bob Harner




tapestry_render_phases.gliffy
(38 kB application/octet-stream)
-
Updated render phase chart (Gliffy source)



   
Stop watching space
|
Change email notification preferences

   View Attachments









[CONF] Apache Tapestry Component Rendering

2013-10-14 Thread Bob Harner (Confluence)







Component Rendering
File attached by  Bob Harner




tapestry_render_phases.png
(49 kB image/png)
-
Updated render phase chart (PNG)



   
Stop watching space
|
Change email notification preferences

   View Attachments









[CONF] Apache Tapestry Injection

2013-10-12 Thread Bob Harner (Confluence)







Injection
Page edited by Bob Harner


Comment:
Minor layout issue


 Changes (8)
 




...
A large number of services are provided by Tapestry. See the following packages:  
{float:left} 
{float:left|width=12em} 
* [Core Services|http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/package-summary.html] * [AJAX Services|http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/ajax/package-summary.html] 
...
{float}  
{float:left} 
{float:left|width=12em} 
* [_javascript_ Services|http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/_javascript_/package-summary.html] * [Link Transformation Services|http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/linktransform/package-summary.html] 
...
{float}  
{float:left} 
{float:left|width=12em} 
* [Page Loading Services|http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/pageload/package-summary.html] * [Security Services|http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/security/package-summary.html] 
...
{float}  
{float:left} 
{float:left|width=12em} 
* [Tapestry IOC Services|http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/services/package-summary.html] * [Tapestry IOC Cron Services|http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/services/cron/package-summary.html] 
...


Full Content

Injection

Injection is Tapestry's way of making a dependency  such as a resource, asset, component, block or service  available in a page, component, mixin or service class.

Injection is a key concept in Tapestry, and it is used in several different but related ways.


Related Articles


 Page:
 Injection FAQ





 Page:
 Injection in Detail





 Page:
 Injection






Injection in Tapestry IOC Services

Main Article: Tapestry IoC Overview

The Tapestry IoC container makes use of injection primarily through constructors and via parameters to service builder methods.

Injection in Component Classes

For components, however, Tapestry takes a completely different tack: injection directly into component fields.

The @Inject annotation is used to identify fields that will contain injected services and other resources.

Tapestry allows for two kinds of injection:


	Default injection, where Tapestry determines the object to inject into the field based on its type.
	Explicit injection, where the particular service to be injected is specified.



In both cases, the field is transformed into a read only value. As elsewhere in Tapestry, this transformation occurs at runtime (which is very important in terms of being able to test your components). Attempting to update an injected field will result in a runtime exception.

In addition, there are a few special cases that are triggered by specific field types, or additional annotations, in addition, to @Inject, on a field.

Block Injection

For field type Block, the value of the Inject annotation is the id of the t:block element within the component's template. Normally, the id of the block is determined from the field name (after stripping out any leading "_" and "$" characters):



@Inject
private Block foo;



Where that is not appropriate, an @Id annotation can be supplied:



@Inject
@Id("bar")
private Block barBlock;



The first injection will inject the Block with id "foo" (as always, case is ignored). The second injection will inject the Block with id "bar".

Resource Injection

For a particular set of field types, Tapestry will inject a resource related to the component, such as its Locale.

A very common example occurs when a component needs access to its resources. The component can define a field of the appropriate type and use the @Inject annotation without a value:



@Inject
private ComponentResources resources;



Tapestry uses the type of the field, ComponentResources, to determine what to inject into this field.

The following types are supported for resources injection:


	java.lang.String   The complete id of the component, which 

[CONF] Apache Tapestry Confluence Site Setup

2013-10-01 Thread Bob Harner (Confluence)







Confluence Site Setup
Page edited by Bob Harner


Comment:
Rewrote to describe the SiteExporter program rather than the dead Autoexport program


 Changes (24)
 




...
{float}   
This document describes our web site setup: what is where and how does it works. 
 h1. Overview  
Our website and documentation are kept in Confluence.  
Most of the web site and documentation (with the notable exception of the Javadoc API pages) are kept in Confluence. 
 
Since the cConfluence instance at https://cwiki.apache.org/confluence/ isnt capable of handling a lot of incoming requests, all wiki spaces are statically exported. The SiteExporter program is responsible for that. Once a page in Confluence changes, that page gets re-exported automatically. 
 
The Autoexport plugin for Confluence is responsible for that. Once a page in Confluence changes, that page gets re-exported automatically. The Autoexport plugin is configured to export the pages to a directory on thor (the machine Confluence is running on). From there a cron job copies the exports to {{/www/confluence-exports}} on people.apache.org.  
h2. How SiteExporter works 
 
On people.apache.org _another_ cron job copies the exported Tapestry space to {{~uli/public_html/tapestry-site/}} which is available as [http://people.apache.org/~uli/tapestry-site/].  
_For more details see the [SiteExporter README|https://svn.apache.org/repos/asf/tapestry/tapestry-site/trunk/README]._ 
 
{note} This will shortly be updated to copy our space to a {{/www/tapestry.apache.org}} which is the folder that itself is copied out and available as [http://tapestry.apache.org]. {note} 
SiteExporter is a command-line Java program that is run hourly (currently at 20 minutes after the hour) from Apaches BuildBot. It makes a web service call to Confluence (to its RSS feed, actually) to get a list of each page that has changed since the last run, and the HTML-formatted export of those pages. For each, it post-processes the file (described below). Finally, SiteExporter commits all changed HTML files into Tapestrys part of the Apache Subversion repository, which (nearly instantly) makes it available to the public at http://tapestry.apache.org, and commit emails are sent to Tapestrys commits mailing list. 
 
Yes, this is a bit [Rube Goldberg|http://en.wikipedia.org/wiki/Rube_Goldberg_machine], and the multiple steps, hops, and cron jobs mean it can be quite some time between a change in Confluence, and the content being visible (possibly a couple of hours). 
Attachments (to Confluence pages) are exported in roughly the same way. 
 
{info} Content copied to {{/www/tapestry.apache.org}} is not immediately visible; yet another cron job \(!) copies this content to the main Apache web server, about once an hour. On the other hand, content {{~uli}} is available in real time. {info} 
The time between saving a change in Confluence and seeing the result on the public site is at most 1 hour, depending on when you do it. If you save a change at 19 minutes after the hour youll see the change in about a minute. If you publish it at 21 minutes after the hour then youll have to wait almost an hour. 
 
| HTML files in SVN | https://svn.apache.org/repos/infra/websites/production/tapestry | | Cache File | https://svn.apache.org/repos/infra/websites/production/tapestry/content/cache/main.pageCache | | SiteExporter source | https://svn.apache.org/repos/asf/tapestry/tapestry-site/trunk | | Velocity template | https://svn.apache.org/repos/asf/tapestry/tapestry-site/trunk/template/template.vm |  h3. Post-processing HTML Pages  HTML pages exported from Confluence are post-processed in several ways before being committed to SVN. Here are just a few of the things going on:  * Tagsoup is used to clean up the HTML. * The breadcrumb links are updated. * Empty paragraph (p) tags are removed from the top of the page. * \{code\} macro output (code examples) are detected, and SyntaxHighlighter _javascript_ links are added to the page when needed. * \{include\} tags (when one Confluence page includes another) are detected, causing the _including_ page to be regenerated autoamtically. * \{children\} tags are also detected and handled  h2. Manual Intervention  You can cause the _whole site_ to be republished by deleting the main.pageCache file (above) in the subversion repo. This is usually only needed after changing the template.  h2. Changing SiteExporter itself  Currently the SiteExporter source code is an unmodified copy of a program of the same name written by Dan Kulp for the Apache 

[CONF] Apache Tapestry Test Page

2013-09-29 Thread Bob Harner (Confluence)







Test Page
Page edited by Bob Harner


Comment:
j


 Changes (1)
 




...
deck.tab.active.border=1px solid #ccc deck.tab.inactive.border=1px solid #ccc 
deck.tab.spacer=0 
{composition-setup}  
...


Full Content

Test page to test changes to the autoexport template...







Starting with Tapestry 5.4, you can easily choose whether the foundation _javascript_ framework is jQuery or Prototype.


Tapestry comes with the Prototype and Scriptaculous libraries, or you can easily swap in JQuery using a 3rd-party module.




Loading





Testing, testing...








Test Page 2  {toc}

f



Stop watching space
|
Change email notification preferences

View Online
|
View Changes









[CONF] Apache Tapestry Test Page

2013-09-29 Thread Bob Harner (Confluence)







Test Page
Page edited by Bob Harner


Comment:
j


 Changes (1)
 




...
deck.tab.inactive.border=1px solid #ccc deck.tab.spacer=0 
deck.tab.spacer=0 
{composition-setup}  
...


Full Content

Test page to test changes to the autoexport template...







Starting with Tapestry 5.4, you can easily choose whether the foundation _javascript_ framework is jQuery or Prototype.


Tapestry comes with the Prototype and Scriptaculous libraries, or you can easily swap in JQuery using a 3rd-party module.




Loading





Testing, testing...








Test Page 2  {toc}

f



Stop watching space
|
Change email notification preferences

View Online
|
View Changes









[CONF] Apache Tapestry How to Upgrade

2013-09-14 Thread Bob Harner (Confluence)







How to Upgrade
Page edited by Bob Harner


Comment:
Mentioned Gradle


 Changes (2)
 




...
 # *Upgrade one step at a time:* It is usually best to upgrade to each intermediate version of Tapestry rather than skipping ahead multiple versions. Skipping versions (except for minor bug fix releases) makes it harder to find all calls to deprecated APIs (see above). 
# *Update your POM (or download the JARs manually):* If youre using Maven (or Gradle), update the version of the Tapestry dependencies in your pom.xml (or build.gradle) file. Remember to keep all of the Tapestry-supplied modules in sync. For example, dont forget to update the version of Tapestry-hibernate, Tapestry-spring, Tapestry-upload, etc. 
# *Remove old Tapestry JARs:* If youre not using Maven dependency management or Gradle (e.g. if you have the Tapestry JARSs in your lib directory), be sure you remove older versions of Tapestry JARSs (including JARs for any Tapestry-supplied modules). 
 h2. After You Upgrade 
...


Full Content

Upgrading from one Tapestry version to the next is usually quite easy. Backward compatibility is one of Tapestry's core principles. Even so, sometimes a checklist comes in handy to be sure you consider all of the implications of an upgrade.

Before You Upgrade


	Check 3rd Party compatibility: Find out whether your 3rd party modules are compatible with the new version of Tapestry. Although the Tapestry developers try very hard to maintain backward compatibility across versions, sometimes an older version of a 3rd party module (particularly if it uses internal APIs) won't work with a newly-released version of Tapestry, and in that case you may have to wait until that 3rd party module is updated by its developers.
	Find and replace all calls to deprecated APIs. Those are the places most likely to be broken after the upgrade. Most IDEs make it easy to find all deprecated items. In Eclipse, for example, the "Problems" view will show warnings for the use of deprecated APIs if you set it to show "All Errors/Warnings on Project".
	Read the Release Notes: Each Tapestry version has a Release Notes document that lists all of the changes, including some that may cause compatibility issues with your current code. You will save yourself a lot of frustration if you carefully read this material before proceeding.



Upgrading


	Upgrade one step at a time: It is usually best to upgrade to each intermediate version of Tapestry rather than skipping ahead multiple versions. Skipping versions (except for minor bug fix releases) makes it harder to find all calls to deprecated APIs (see above).
	Update your POM (or download the JARs manually): If you're using Maven (or Gradle), update the version of the Tapestry dependencies in your pom.xml (or build.gradle) file. Remember to keep all of the Tapestry-supplied modules in sync. For example, don't forget to update the version of Tapestry-hibernate, Tapestry-spring, Tapestry-upload, etc.
	Remove old Tapestry JARs: If you're not using Maven or Gradle (e.g. if you have the Tapestry JARs in your lib directory), be sure you remove older versions of Tapestry JARs (including JARs for any Tapestry-supplied modules).



After You Upgrade


	Remove cached _javascript_: Tapestry's internal _javascript_ may change between releases, and your web browser may have cached the older version. If you have set a specific application version in your application's module class (usually AppModule.java), you should increment it to ensure that the URLs to the _javascript_ files will have a new version number in their paths. Doing so will cause the browser to download the latest versions from your server. Alternatively, you can just clear your browser's cache (and have all your developers and testers do the same). This issue is usually not a problem on production servers, since you will likely increment the application version with each new production release.





Stop watching space
|
Change email notification preferences

View Online
|
View Changes









[CONF] Apache Tapestry Component Events FAQ

2013-08-20 Thread Bob Harner (Confluence)







Component Events FAQ
Page edited by Bob Harner


Comment:
Added Lance


 Changes (1)
 




...
{since}  
h3.  I specified a zone in my ActionLink/EventLink, so why doesnt my event fire via ajax (request.isXHR() is false)?  Check your browsers _javascript_ console for errors. Its likely that a _javascript_ error has prevented Tapestry from transforming your ActionLink/EventLink from a page render action to an ajax action.  
{scrollbar} 


Full Content

Link Components FAQFrequently Asked Questions_javascript_ FAQ 

Component Events 

Why does Tapestry send a redirect after a form is submitted?

This is an extension of the redirect after post approach. It ensures that after an operation that updates server-side state, such as a form submission, if the user resubmits the resulting page, the operation is not performed a second time; instead just the results of the operation, reflecting the changed server-side state, is re-rendered.

This has the unwanted requirement that any data needed to render the response must persist between the event request (the form submission) and the render request; this often means that fields must be annotated with @Persist.



Added in 5.2

If you want to short-circuit this behavior and render a response directly, your component event handle method may return an instance of StreamPageContent. Tapestry will render the page as part of the event request and stream its content back to the client web browser, rather than sending the normal redirect.




Added in 5.4

Starting in release 5.4, Forms (by default) will NOT redirect after post if there are validation errors. This makes it possible to re-render the page, with error decorations, without requiring that the validation errors be stored in the session between requests ... and that means that the application can remain stateless much longer.


I specified a zone in my ActionLink/EventLink, so why doesn't my event fire via ajax (request.isXHR() is false)?

Check your browser's _javascript_ console for errors. It's likely that a _javascript_ error has prevented Tapestry from transforming your ActionLink/EventLink from a page render action to an ajax action.

Link Components FAQFrequently Asked Questions_javascript_ FAQ



Stop watching space
|
Change email notification preferences

View Online
|
View Changes









[CONF] Apache Tapestry Switching Cases

2013-08-17 Thread Bob Harner (Confluence)







Switching Cases
Page edited by Bob Harner


Comment:
Added JumpStart demo link


 Changes (1)
 




...
With Tapestrys {{If}} component you can only test one condition at a time. In order to distinguish multiple cases, youd have to write complex nested if/else constructs in your page template and have a checker method for each test inside your page class.  
{float:right|background="" 1em} *JumpStart Demo:* [If, Not, Negate, Switch, Else, Unless|http://jumpstart.doublenegative.com.au/jumpstart/examples/lang/ifnotnegateswitchelseunless] {float}  
In cases where you have to distinguish multiple cases, the {{Delegate}} component comes in. It delegates rendering to some other component, for example a {{Block}}. For each case you have, you basically wrap the content inside a {{Block}} that doesnt get rendered by default. You then place a Delegate component on your page and point it to a method inside your page class that will decide which of your Blocks should be rendered.  
...


Full Content

Component LibrariesCookbookEnum Parameter Recipe


Switching Cases

With Tapestry's If component you can only test one condition at a time. In order to distinguish multiple cases, you'd have to write complex nested if/else constructs in your page template and have a checker method for each test inside your page class.

JumpStart Demo:
If, Not, Negate, Switch, Else, Unless

In cases where you have to distinguish multiple cases, the Delegate component comes in. It delegates rendering to some other component, for example a Block. For each case you have, you basically wrap the content inside a Block that doesn't get rendered by default. You then place a Delegate component on your page and point it to a method inside your page class that will decide which of your Blocks should be rendered.

Imagine for example a use case, where you want to distinguish between 4 cases and you have an int property called whichCase that should be tested against. Your page template would look as follows:

SwitchMe.tml

html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"
body
h1Switch/h1

t:delegate to="case"/

t:block t:id="case1"
Here is the content for case1.
/t:block

t:block t:id="case2"
Here is the content for case2.
/t:block

t:block t:id="case3"
Here is the content for case3.
/t:block

t:block t:id="case4"
Here is the content for case4.
/t:block
/body
/html



You can see, that the Delegate component's to parameter is bound to the case property of your page class. In your page class you therefore have a getCase() method that is responsible for telling the Delegate component which component should be rendered. For that we are injecting references to the Block}}s defined in your page template into the page class and return the according {{Block in the getCase() method.

SwitchMe.java

public class SwitchMe
{
@Persist
private int whichCase;

@Inject
private Block case1, case2, case3, case4;

public Object getCase()
{
switch (whichCase)
{
case 1:
return case1;
case 2:
return case2;
case 3:
return case3;
case 4:
return case4;
default:
return null;
}
}
}



Happy switching!



Stop watching space
|
Change email notification preferences

View Online
|
View Changes









[CONF] Apache Tapestry JavaScript

2013-08-17 Thread Bob Harner (Confluence)







_javascript_
Page edited by Bob Harner


Comment:
Added a couple JumpStart links, and clarified addScript calling context as suggested by Rainer's comment


 Changes (7)
 




...
Tapestry provides several ways to add a link to a _javascript_ library within your page or component. Although you can use direct {{script type=text/_javascript_ src="" approach, you should only use it for _javascript_ that resides outside of your application. For _javascript_ within your app, Tapestry provides _much_ better ways to do the same thing. Most users choose the simplest, the @Import annotation approach.  
{float:right|background="" 1em}  *JumpStart Demo:*  [_javascript_|http://jumpstart.doublenegative.com.au/jumpstart/examples/_javascript_/_javascript_]  {float}   
h2. Approach 1: @Import  
...
The {{setupRender}} method (the name is specifically linked to a [render phase|Component Rendering]) is the correct place to inform the _javascript_Support (or RenderSupport) service that the library is needed.  
{float:right|background="" 1em}  *JumpStart Demo:*  [Reusable _javascript_|http://jumpstart.doublenegative.com.au/jumpstart/examples/_javascript_/reusable]  {float}   
h3. The {{addScript}} method  
...
{column} {code:java|title=Tapestry 5.2 and later} 
void afterRender() { 
_javascript_Support.addScript( 
$(%s).observe(click, hideMe());, container.getClientId()); 
} 
{code} {column} 
...
{column} {code:java|title=Tapestry 5.1 and earlier} 
void addScript(String.format( 
void afterRender() { _javascript_Support.addScript(String.format( 
$(%s).observe(click, hideMe());, container.getClientId())); 
} 
{code} {column} 
...


Full Content


Related Articles


 Page:
 Ajax and Zones





 Page:
 _javascript_





 Page:
 Assets





 Page:
 Ajax Components FAQ





 Page:
 Component Cheat Sheet





 Page:
 _javascript_ FAQ






_javascript_ is a first-class concept in Tapestry, and sophisticated _javascript_ support is provided right out of the box, including rich AJAX support, download optimization, client-side logging, and localization.

In production mode, by default, Tapestry will merge _javascript_ libraries, add version numbering, and set a far-future expires header to encourage aggressive browser caching. Starting with version 5.3, Tapestry can also automatically minify (compress) _javascript_ libraries when in production mode.

In addition, as will be described in detail below, Tapestry comes with the Prototype and Scriptaculous libraries, or you can easily swap in JQuery using a 3rd-party module.

Adding Custom _javascript_

When adding your own custom _javascript_ or third-party libraries, just follow the strategies below to take advantage of Tapestry's _javascript_ support mechanisms.

The recommended practice in Tapestry is to package up any significant amount of _javascript_ as a static _javascript_ library, a .js file that can be downloaded to the client. Keep your in-page _javascript_ code to a minimum, just the few statements needed to initialize objects and reference methods in the _javascript_ libraries.

Linking to your _javascript_ libraries

Tapestry provides several ways to add a link to a _javascript_ library within your page or component. Although you can use direct script type="text/_javascript_" src=""/script approach, you should only use it for _javascript_ that resides outside of your application. For _javascript_ within your app, Tapestry provides much better ways to do the same thing. Most users choose the simplest, the @Import annotation approach.

JumpStart Demo: 
_javascript_  

[CONF] Apache Tapestry Configuration

2013-08-11 Thread Bob Harner (Confluence)







Configuration
Page edited by Bob Harner


Comment:
Added tapestry.session-locking-enabled symbol


 Changes (2)
 




...
{since:since=5.2}{since}  
If true (the default), then Tapestry IoC will attempt to reload service implementations when they change. This only applies to classes that Tapestry IoC instantiates itself, and have a known service interface (the container creates a proxy that, internally, can reload the implementation). Service reloading only works when the underlying class files are on the filesystem ... it is intended for development, not an option at deployment. 
 This must be specified as a JVM system property. 
...
The path to the embedded copy of [script.aculo.us|http://script.aculo.us/] packaged with Tapestry. This value may be overridden to use a different version of the script.aculo.us library. See [_javascript_] for the default version.  
h3. tapestry.session-locking-enabled  {since:since=5.4}{since}  If true (the default), then Tapestry will use a lock when reading/updating HttpSession attributes, to avoid simultaneous access by multiple threads when using AJAX. See [TAP5-2049|https://issues.apache.org/jira/browse/TAP5-2049]. Set to false to deactivate the session locking logic.  Prior to version 5.4 session locking was not performed.  
h3. tapestry.start-page-name  
...


Full Content


Related Articles


 Page:
 Response Compression





 Page:
 Tapestry IoC Configuration





 Page:
 Configuration





 Page:
 Symbols





 Page:
 IoC cookbook - Service Configurations





 Page:
 Application Module Class Cheat Sheet






Configuring Tapestry

Tapestry runs on top of the standard Java Servlet API. To the servlet container, such as Tomcat, Tapestry appears as a servlet filter. This gives Tapestry great flexibility in matching URLs without requiring lots of XML configuration.

Contents


Changes to web.xml
Your Application's Module Class
Configuration Symbol Names

tapestry.app-catalog
tapestry.application-version
tapestry.application-folder
tapestry.asset-url-fully-qualified
tapestry.asset-path-prefix
tapestry.blackbird-enabled
tapestry.charset
tapestry.combine-scripts
tapestry.compatibility.unknown-component-id-check-enabled
tapestry.component-render-tracing-enabled
tapestry.compress-whitespace
tapestry.default-cookie-max-age
tapestry.default-stylesheet
tapestry.exception-report-page
tapestry.execution-mode
tapestry.file-check-interval
tapestry.file-check-update-timeout
tapestry.force-absolute-uris
tapestry.gzip-compression-enabled
tapestry.hmac-passphrase
tapestry.min-gzip-size
tapestry.omit-generator-meta
tapestry.page-pool.active-window
tapestry.page-pool-enabled
tapestry.page-pool.hard-limit
tapestry.page-pool.soft-limit
tapestry.page-pool.soft-wait
tapestry.production-mode
tapestry.secure-enabled
tapestry.secure-page
tapestry.service-reloading-enabled
tapestry.scriptaculous
tapestry.session-locking-enabled
tapestry.start-page-name
tapestry.supported-locales
tapestry.suppress-redirect-from-action-requests
tapestry.thread-pool.core-pool-size
tapestry.thread-pool.max-pool-size
tapestry.thread-pool.queue-size
tapestry.thread-pool.keep-alive
tapestry.thread-pool-enabled

Setting Component Parameter Defaults
Configuring Ignored Paths
Configuring Content Type Mapping
Setting Execution Modes
Segregating Applications Into Folders


Changes to web.xml

Tapestry applications are configured almost entirely using Java, not XML. However, a small but necessary amount of configuration occurs inside the servlet deployment descriptor, WEB-INF/web.xml. Most of the configuration is 

[CONF] Apache Tapestry Documentation

2013-08-10 Thread Bob Harner (Confluence)







Documentation
Page edited by Bob Harner


Comment:
Spelling fix suggested by Muhammad Gelbana


 Changes (1)
 




...
* [Java Magic|http://tawus.wordpress.com/] (by Taha Hafeez, committer) has a series of tutorials illustrating some of the more advanced Tapestry and Plastic features and techniques. * [Andreas Andreous blog|http://blog.andyhot.gr/tag/tapestry/] (committer  PMC) has news and commentary on Tapestry. 
* [Spread the Source blog|http://spreadthesource.com/] (Christophe Cordenier and Robin Komiwes committerss blog) has news and advanced tutorials on Tapestry 5. 
 h1. Books on Tapestry 
...


Full Content

All Topics

IntroductionGetting StartedPrinciplesTapestry TutorialDependencies, Tools and PluginsCreating The Skeleton ApplicationLoading the Project Into EclipseExploring the ProjectImplementing the Hi-Lo Guessing GameUsing BeanEditForm To Create User FormsUsing Tapestry With HibernateUser GuideProject LayoutConfigurationClass ReloadingComponent ReferenceAnnotationsComponent ClassesComponent TemplatesProperty ExpressionsComponent ParametersType CoercionLayout ComponentComponent MixinsBuilt-in MixinsPage NavigationLocalizationPage Life CycleRequest ProcessingComponent RenderingComponent EventsURL rewritingDOMResponse CompressionSecurityHTTPSContent Type and MarkupPersistent Page DataSession StorageClustering IssuesInjectionEnvironmental Services_javascript_Ajax and ZonesCSSAssetsForms and ValidationBeanEditForm GuideUploading FilesLoggingUnit testing pages or componentsIntegration TestingService StatusModulesBuilt In ModulesThird Party ModulesIoCTapestry IoC OverviewTapestry IoC ModulesDefining Tapestry IOC ServicesService AdvisorsTapestry IoC DecoratorsTapestry IoC ConfigurationCase InsensitivityAutoloading ModulesService Implementation ReloadingOrdering by ConstraintsSymbolsChainBuilder ServicePipelineBuilder ServiceShadowBuilder ServiceStrategyBuilder ServiceInjection in DetailObject ProvidersService SerializationTypeCoercer ServiceStarting the IoC RegistryRegistry StartupParallel ExecutionLogging in TapestryUsing JSR 330 standard annotationsHibernate - CoreHibernate - Core - ConfHibernateIntegrating with Spring FrameworkBean ValidationComponent ReportAliasesIntegrating with JPACheat SheetsApplication Module Class Cheat SheetComponent Cheat SheetTapestry for JSF UsersCookbookDefault ParameterOverriding Exception ReportingSupporting Informal ParametersComponent LibrariesSwitching CasesEnum Parameter RecipeError Page RecipeExtending the If ComponentMeta-Programming Page ContentUsing Select With a ListIoC cookbookIoC Cookbook - Basic Services and InjectionIoC Cookbook - Overriding IoC ServicesIoC Cookbook - PatternsIoC cookbook - Service ConfigurationsPerformance and ClusteringFrequently Asked QuestionsGeneral QuestionsTemplating and Markup FAQPage And Component Classes FAQForms and Form Components FAQBeanEditForm FAQLink Components FAQComponent Events FAQ_javascript_ FAQAjax Components FAQInjection FAQTapestry Inversion of Control FAQSecurity FAQIntegration with existing applicationsRequest Processing FAQLimitationsSpecific Errors FAQHibernate Support FAQMaven Support FAQRelease Upgrade FAQRelease NotesHow to UpgradeRelease Notes 5.0Release Notes 5.1Release Notes 5.2Release Notes 5.2.0Release Notes 5.2.1Release Notes 5.2.2Release Notes 5.2.3Release Notes 5.2.4Release Notes 5.2.5Release Notes 5.2.6Release Notes 5.3Release Notes 5.3.1Release Notes 5.3.2Release Notes 5.3.3Release Notes 5.3.4Release Notes 5.3.5Release Notes 5.3.6Release Notes 5.3.7Release Notes 5.4_javascript_ RewriteSupportDeveloper InformationBuilding Tapestry from SourceConfluence Site SetupSince and Deprecated User MacrosDeveloper BibleRelease ProcessThe tapestry jailVersion Numbers 

Welcome to the Tapestry 5 Documentation.  A rich collection of guides is available to teach beginners the basics and help even experienced developers deepen their understanding of Tapestry's power. Code less, deliver more!

Highlights

These are the most useful starting points for common needs.




 Introduction 
 An overview of Tapestry's general approach and philosophy 


 Getting Started 
 A quick guide to creating your first Tapestry project, using Maven 


 Tapestry Tutorial 
 Picks up where Getting Started leaves off, explaining in greater detail how Tapestry works 


 User Guide 
 Detailed articles on every Tapestry feature 


 Community 
 Getting support, mailing lists, JIRA, outside resources, and access to the source 


 Cookbook 
 Guides to doing common things with Tapestry 


 FAQ 
 A quick place to check for common problems and solutions 


 Component Cheat Sheet 
 A concise guide to component classes, methods and annotations 


 Refcard 
 A color, 

[CONF] Apache Tapestry Tapestry for JSF Users

2013-07-13 Thread Bob Harner (Confluence)







Tapestry for JSF Users
Page edited by Bob Harner


Comment:
Minor tweak of _expression_ example and other tweaks


 Changes (4)
 




...
 | || JSF Syntax || Tapestry Syntax || 
| Property (calls getMyProperty() or setMyProperty()) | #\{employeeBean.employeeName\} | $\{employeeName\} | 
| Property (calls getEmployeeName() or setEmployeeName()) | #\{employeeBean.employeeName\} | $\{employeeName\} | 
| Boolean property (calls isHourly() or setHourly()) | #\{employeeBean.hourly\} | $\{hourly\} | | Property chain | #\{employeeBean.address.street\} | $\{address.street\} | 
...
h3. Event handling  
In JSF, you specify the event via the {{action}} parameter (for example, h:commandButton value=Submit action="" For Tapestry, event handler methods are found by method naming conventions (onSomeEvent() or by method annotations (@Event), based on a combination of the t:id attribute and event name, and the action name used depends on the component. For example, the t:actionlink component in Tapestry emits an action event when clicked, and you handle that event in your onAction() method. 
 h2. Validation 
...
By contrast, Tapestry implements this Post-Redirect-Get pattern by default. The URL will always reflect the page youre seeing, not the page you just came from.  
Note that by default Tapestry does not save property values across the Post-Redirect-Get cycle. This means that you have to consider how (and whether) to persist property values from one page to the next.  The usual solution is to either make the values part of the pages [Activation Context|Navigation#Page Activation] (which means the values will be appended to the URL) or [@Persist the properties|Persistent Page Data] the values in the session. 
 h2. Custom and Composite Components 
...


Full Content

Component Cheat SheetCheat Sheets

Tapestry for JSF Users


Related Articles


 Page:
 Introduction





 Page:
 Tapestry Tutorial





 Page:
 Getting Started





 Page:
 Principles





 Page:
 Tapestry for JSF Users






This is a cheat sheet for learning Tapestry, designed for those who already know JavaServer Faces (JSF).

Because both JSF and Tapestry are component oriented frameworks designed to serve mostly the same kinds of problems in similar ways, developers who already know JSF will find it very easy to learn Tapestry. In fact, Facelets, the default view technology in JSF 2.0, was created specifically to give JSF a Tapestry-like templating capability, so Facelets users should feel right at home.

Since almost all modern JSF applications use Facelets as their view technology, we assume the use of Facelets here when discussing JSF features.

JSF is a rich, mature web framework specification, and there are lots of smart people who use it productively. This guide isn't intended as a pro-versus-con comparison or as advocacy of any kind. Instead, it just attempts to make transitions between the two frameworks easier, regardless of the reason for doing so.

Side-by-side Comparison

JSF and Tapestry have a lot of superficial similarities, so the first steps in that transition are all about relating similar concepts, terms and components in your mind:




 Concepts  Terminology 
 JSF 
 Tapestry 


 Java class associated with a page or component 
 "Backing Bean" 
 "Component Class" 


 Component attributes/parameters 
 "attributes" 
 "parameters" 


 Common Attributes/Parameters
 JSF 
 Tapestry 


 HTML Attribute used for invisible instrumentation 
 jsfc="someComponentType" 
 t:type="someComponentType" 


 CSS "class" attribute name 
 styleClass 
 class 


 Alternating "zebra" striped rows 
 rowclasses="class1,class2" 
 class="${cycle:class1,class2}" using cycle binding prefix, or with CSS: .rowClass:nth-child(even) {background-color: #e8e8e8;} 


 Output and Messages 
 JSF 
 Tapestry 


 Escaped HTML from property 
 

[CONF] Apache Tapestry Community

2013-06-25 Thread Bob Harner (Confluence)







Community
Page edited by Bob Harner


Comment:
Added link to Tapestry Stitch as recommended by Lance


 Changes (1)
 




...
{quote}  
[Tapestry Stitch|http://tapestry-stitch.uklance.cloudbees.net/] by Lance {quote} Sample components and concepts in Apache Tapestry 5 {quote}  
[Shams Examples|http://code.google.com/p/shams/] by Mohammad H. Shamsi {quote} 
...


Full Content

Tapestry has an active community of users and developers. This is an overview of how to participate, along with a list of some of the great contributions of the community members.



Getting Involved

Reporting Problems / Getting Support
Contributing translations for Tapestry built-in messages
Source Code Access
Becoming a Contributor
Becoming a Committer

Community Contributions

Modules

Extensions
Tutorials
IDE Integrations



Getting Involved

Reporting Problems / Getting Support

Like all Apache projects, Tapestry uses mailing lists for most communication. You can subscribe by sending e-mail to the addresses below. For each list, there are subscribe, unsubscribe, and archive links.  All Tapestry users are welcome to subscribe to any of these lists, however questions on how to use Tapestry in your application are best sent to the user mailing list.

Please note that the Nabble archives are set to read-only and don't allow for posting or answering using Nabble's web interface. You have to subscribe to the mailing list in order to post.





 Subscribe 
 Unsubscribe 
 Apache Archive 
 Nabble Archive 
 MarkMail Archive 


 Tapestry User List 
 Subscribe 
 Unsubscribe 
 mail-archives.apache.org 
 www.nabble.com 
 tapestry.markmail.org 


 Tapestry Developer List 
 Subscribe 
 Unsubscribe 
 mail-archives.apache.org 
 www.nabble.com 
 tapestry.markmail.org 


 Tapestry Commits List 
 Subscribe 
 Unsubscribe 
 mail-archives.apache.org 
  
 tapestry.markmail.org 


 Search Multiple Lists 
  
  
  
 www.nabble.com 
 tapestry.markmail.org 





Tapestry issues are tracked in the Apache JIRA.

Unless your problem is clear as day, it's a good idea to discuss it on the Tapestry Users mailing list first, before adding an issue. At the same time, it's generally unlikely that a bug will be fixed unless a JIRA Issue is created.

Eric Raymond has a detailed guide to asking questions the right way.  If you are not getting a response to your problem, it's likely because you aren't asking it the right way.

Just saying something is "broken" or "failed" is not enough.  How did it fail?  Did it do the wrong thing? Throw an exception? Not respond in any way?  What exactly did you expect to happen?  All of this information should be made available when looking for help, plus context on the general problem you were trying to solve in the first place (there may be a better solution entirely).  Read Eric Raymond's guide ... it's fun and informative.

Contributing translations for Tapestry built-in messages

If Tapestry's built-in messages aren't available in your language, you are welcome to contribute a new translation of the message catalogs. For easy instructions, see Localization.

Source Code Access

Source code for Tapestry can be downloaded along with pre-compiled binaries.

Tapestry uses Git to manage the project's source code.

Web access to the Tapestry repository is available as GIT-WIP at Apache.

Access using Git client:


$ git clone http://git-wip-us.apache.org/repos/asf/tapestry-5.git



(See Building Tapestry from Source for more info.)

Becoming a Contributor

The best way to become a contributor is to become active on the mailing list; Tapestry is known to have an active and helpful community on the mailing list, and the more mentors we can add, the better.

If you want to help out with documentation, you must sign an Apache Contributor License Agreement, at which point we can grant write access to the Confluence Wiki (where official documentation is created).

Providing patches (with tests) is another way to become a contributor.

Becoming a Committer

Active contributors may be asked to become full committers, with write access to the source code. Generally, contributors who have been consistently active and helpful for three to six months are eligible for committer access. If you think you are in that category, don't be shy about contacting members of the Tapestry PMC (Project Management Committee).



Community Contributions








Modules

Chenille Kit by Massimo Lusetti

Collection of modules, services, utilities and components (many of which require only tapestry-ioc). Includes Accordion, ColorPicker, Editor, Kaptcha, MultipleSelect, RoundCornerContainer, ThumbNail, and many more useful components. Also