public void init(PortletConfig config)
throws PortletException
{
super.init(config);
PortletContext context = getPortletContext();
registry = (PortletRegistry)context.getAttribute(CommonPortletServices.CPS_REGISTRY_COMPONENT);
if (null == registry)
{
throw new PortletException("Failed to find the Portlet Registry on portlet initialization");
}
searchEngine = (SearchEngine)context.getAttribute(CommonPortletServices.CPS_SEARCH_COMPONENT);
if (null == searchEngine)
{
throw new PortletException("Failed to find the Search Engine on portlet initialization");
}
securityAccessController = (SecurityAccessController)context.getAttribute(CommonPortletServices.CPS_SECURITY_ACCESS_CONTROLLER);
if (null == securityAccessController)
{
throw new PortletException("Failed to find the Security Access Controller on portlet initialization");
}
profiler = (Profiler)context.getAttribute(CommonPortletServices.CPS_PROFILER_COMPONENT);
if (null == profiler)
{
throw new PortletException("Failed to find the Profiler on portlet initialization");
}
pageLayoutComponent = (PageLayoutComponent)context.getAttribute(CommonPortletServices.CPS_PAGE_LAYOUT_COMPONENT);
if (null == pageLayoutComponent)
{
throw new PortletException("Failed to find the PageLayoutComponent on portlet initialization");
}
preferenceService = (PortletPreferencesProvider)context.getAttribute(CommonPortletServices.CPS_PORTLET_PREFERENCES_PROVIDER);
if (null == preferenceService)
{
throw new PortletException("Failed to find the Prefs Service on portlet initialization");
}
rand = new Random( 19580427 );