On 28.03.2006, at 10:41, christoph wrote:


At the very least you should probably abstract from the underlying
lucene implementation. Magnolia is explicitly built in such a way
that you can switch between repository implementations. Other
implementations will have a different way of storing indexes, so I
guess you could have somithing like a plugable key word provider and
provide a simple implementation for jackrabbit / lucene. Others could
then add implementations for other indexers / repositories.

Besides that, I am sure what you did is useful and cool! Now make
this an extension of the simple search tag using AJAX and everybody
will have a big smile on her face ;-)
- Boris

Hello Boris,

explain more or provide interface for "plugable key word provider" I would then do it.

Don't worry too much - if it works for you, its a start - who needs more can do so.

But the idea is that you have functionality out of the box (e.g. a tag) and the option to change the implementation of some parts, e.g. of the class that provides the list of key words. SInce all the rest of the functionality stays the same, all you need is a way to define which class provides the keywords. For that you can provide an interface (e.g. public static String[] getSearchTerms()) so your implementations do not need to extend a base class but just need to provide the method(s) defined in the interface. To make this pluggable, there are many ways (Spring, factories, custom) - I'd go with defining an attribute on the tag that holds the class implementing the getSearchTerms().

To add a different implementation, all you need to do is implement the one method in a class, add it to your class path and change the template to use this class. If you define your own control (like the search box) you could probably add a parameter to the control configuration in adminCentral that holds the class name - in which case you do not need to change the templates if you change the implementation.


Of course it is useful and cool, it's not AJAX but pure client side javascript but check it out at http://breidert.net.

expensive - all the keywords in the page. Maybe provide virtual URI mapping and reference as external file, in which case the search terms are cached (until next activation). Additionally, client can then cache the search terms.

By the way, fell free to add your page to the wiki (please create a user-name first so it is easier for us to detect spam)

Cheers
Boris

----------------------------------------------------------------
for list details see
http://www.magnolia.info/en/magnolia/developer.html
----------------------------------------------------------------

Reply via email to