On Mon, 09 Mar 2015 20:45:30 -0300, Daniel Jue <teamp...@gmail.com> wrote:

Hi,

Hi!

There were a couple ways I thought of doing this but they all seemed to
fight Tapestry's static structure paradigm.

Let's see. :)

The first way would be to let the customer completely define the search
results page and tml, and then have a proxy interface that could let my
omni-search box redirect the user there.

This isn't against the Tapestry static structure paradigm at all. You're just direting the browser to the page that will handle the results.

The second way would be to have each customer supply a component that did
the templating and grid logic.

I think you can solve the whole problem by defining different Tapestry types (by contributing DataTypeAnalyzer implementations to the DataTypeAnalyzer service) for different visualizations and contributing viewing and edition blocks for these types and just let Grid and BeanEditor/BeanEditForm do their job. As the distributed configuration of DataTypeAnalyzer is ordered, you can very easily override the base logic for it.

The problem arises because any of the cells can be complex; for instance a single cell might have a list of contextualized page links back into the
search page (allowing the user to pivot his search in the results), or it
might be a list of icons or an action button, or an image, links to
external urls, etc.

This is handled easily by the approach above.

In addition, Tapestry 5.4 has the ComponentOverrides service, which allows you to override a page, component or mixin completely. For example, if you want every <t:datefield> or <input t:type="DateField"> replaced by your own DanielDataField component, you can do it:

public static void contributeComponentOverrides(MappedConfiguration<Class, Class>) {
        configuration.add(DateField.class, DanielDateField.class);
}

--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to