edu.internet2.middleware.grouper.ui
Interface TemplateResolver

All Known Implementing Classes:
DefaultTemplateResolverImpl

public interface TemplateResolver

Interface for resolving an object and a view to a template. This is a plugable interface. To use your own implementation set the key edu.internet2.middleware.grouper.ui.TemplateResolver in resources/media.resources to the name of a class which implements this interface. If none is specified DefaultTemplateREsolverImpl is used.

Version:
$Id: TemplateResolver.java,v 1.4 2007-04-11 08:19:24 isgwb Exp $
Author:
Gary Brown.

Method Summary
 String getObjectType(Object obj)
          Given an Object determine its type.
 String getTemplateName(Object obj, String view, ResourceBundle bundle, HttpServletRequest request)
          Given an Object and the name of a view, use the ResourceBundle to determine which JSP should render the view.
 

Method Detail

getObjectType

String getObjectType(Object obj)
Given an Object determine its type. The type is not necessarily the Java type - it can be an entity type e.g. GroupAsMap has an object type of GrouperGroup

Parameters:
obj - object to determine type of
Returns:
generic type of obj

getTemplateName

String getTemplateName(Object obj,
                       String view,
                       ResourceBundle bundle,
                       HttpServletRequest request)
Given an Object and the name of a view, use the ResourceBundle to determine which JSP should render the view. request is redundant at the moment.

Parameters:
obj - object to be rendered
view - name of template
bundle - ResourceBundle containing keys which can be maped to template names
request - current HttpServletRequest
Returns:
name of template to use to render obj