Issue Details (XML | Word | Printable)

Key: DISPL-428
Type: Improvement Improvement
Status: Open Open
Priority: Major Major
Reporter: Raúl Herranz
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
DisplayTag

Make configurable the class created by the PortletRequestHelperFactory

Created: 28/Dec/06 06:03 AM   Updated: 28/Dec/06 06:05 AM
Return to search
Component/s: Configuration
Affects Version/s: 1.1
Fix Version/s: None

Time Tracking:
Original Estimate: 30 minutes
Original Estimate - 30 minutes
Remaining Estimate: 30 minutes
Remaining Estimate - 30 minutes
Time Spent: Not Specified
Time Spent - Not Specified


 Description  « Hide
To make configurable the class created by the PortletRequestHelperFactory, there should be a new config line in the displaytag.properties file with the complete name (package name + class name) of the class. Then, the PortletRequestHelperFactory's getRequestHelperInstance method should be changed to something similar to this:

        String className = //GET THE CLASSNAME FROM THE displaytag.properties
        if (className!=null && !"".equals(className)) {
         try {
         Class requestHelperClass = Class.forName(className);
         Constructor requestHelperConstructor = requestHelperClass.getConstructor(new Class[]{javax.servlet.jsp.PageContext.class});
         retorno = (RequestHelper)requestHelperConstructor.newInstance(new Object[]{pageContext});
         } catch (Exception e) {
         //do whatever is needed (by example, the exception should be logged)
         }
        } else {
        //do whatever is needed (by example, className not finded should be logged)
        }



Raúl Herranz added a comment - 28/Dec/06 06:05 AM
Var 'retorno' is used to return the RequestHelper that has been created