IERXRouteComponent Interface Reference

Inherits com::webobjects::appserver::WOActionResults.

Inherited by PersonShowPage, SEEOEntityShowPage, SEEOModelGroupIndexPage, SEEOModelGroupShowPage, SEEOModelIndexPage, and SEEOModelShowPage.

Collaboration diagram for IERXRouteComponent:

Collaboration graph
[legend]

Detailed Description

If you return a component from ERXRouteController that implements the IERXRouteComponent interface, the route controller will attempt to find set-methods on your component that correspond to the current route keys. For instance, if you have a {person:Person} in your route, ERXRouteController will attempt to call setPerson(Person) on your component as long as the setPerson method has a annotation.

The system will look for a String variant of the method first (to avoid faulting if you don't want to trigger a fault). If a String method is not found, it will look for the typed version, which will trigger a fault of the object if the method is found.

Example

 route (super-contrived): /person/{person:Person}/company/{company:Company}/task/{task:Task}
 

 public class TasksController extends ERXRouteController {
     public WOActionResults viewAction() {
         if (format() == ERXRestFormat.HTML) {
             return pageWithName(TaskComponent.class);
         }
         return response(...);
     }
 }
 

 public class TaskComponent extends ERXComponent implements IERXRouteComponent {
     @ERXRouteParameter
     public void setCompany(String companyID) {
         ...
     }

     @ERXRouteParameter
     public void setTask(Task task) {
         ...
     }

     public void setPerson(Person person) {
         ...
     }
 }
 

In the above example, setCompany will be called, passing in the company ID from the URL. setTask will be called, passing in the actual Task object, and setPerson will NOT be called because it is not annotated

Author:
mschrag

The documentation for this interface was generated from the following file:

Generated on Sat May 26 06:43:33 2012 for Project Wonder by  doxygen 1.5.8