public void init() throws PortletException {
if (initDone) // Why is init called more than once per portlet?
return;
PortletConfig config = this.getPortletConfig();
try
{
//FIXME: HTMLRewriter should take a Reader, and work
rewriter = new HTMLRewriter(
! config.getInitParameter("dont_remove_script","no")
.equalsIgnoreCase("yes"),
! config.getInitParameter("dont_remove_style","no")
.equalsIgnoreCase("yes"),
! config.getInitParameter("dont_remove_noscript","no")
.equalsIgnoreCase("yes"),
! config.getInitParameter("dont_remove_meta","no")
.equalsIgnoreCase("yes"),
! config.getInitParameter("dont_remove_applet","no")
.equalsIgnoreCase("yes"),
! config.getInitParameter("dont_remove_object","no")
.equalsIgnoreCase("yes"),
! config.getInitParameter("dont_remove_head","no")
.equalsIgnoreCase("yes"),
! config.getInitParameter("dont_remove_onsomething","no")
.equalsIgnoreCase("yes"),
config.getInitParameter("open_in_popup","no")
.equalsIgnoreCase("yes")
);
// fetch username and password for HTTP Basic Autentication
username = config.getInitParameter("username");
password = config.getInitParameter("password");
contentStale = true;
initDone = true;
} catch (Exception e) {
logger.info("Exception occurred:" + e.toString());