Hi Boris,

you mean

interface GetSearchTerms {
   public String[] getSearchTerms;
}

class GetSearchTermsJackrabbitImpl {
   public String[] getSearchTerms {
      //something like the code I posted
   }
}

then call the search tag with a reference to the implementation class.
<searchterms impl="info.magnolia.GetSearchTermsJackrabbitImpl"/>

right? If correct I will put it on the wiki like that.

>expensive - all the keywords in the page.
I know. I was thinking about putting the terms in an separate js-file, to 
permit browser-caching. But I think browser-caching will not reload the 
js-file, even thought it is changed. Do you have a suggestion how to allow 
client side caching whithout running into this problem?

Cool ! Christoph




>
>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
>----------------------------------------------------------------

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

Reply via email to