DisplayTag

Make configurable the class created by the PortletRequestHelperFactory

Details

  • Type: Improvement Improvement
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: 1.1
  • Fix Version/s: None
  • Component/s: Configuration
  • Labels:
    None

Description

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

Activity

Hide
Raśl Herranz added a comment -
Var 'retorno' is used to return the RequestHelper that has been created
Show
Raśl Herranz added a comment - Var 'retorno' is used to return the RequestHelper that has been created

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:

Time Tracking

Estimated:
30m
Original Estimate - 30 minutes
Remaining:
30m
Remaining Estimate - 30 minutes
Logged:
Not Specified
Time Spent - Not Specified