PortletContext context = getPortletContext();
spacesService = (Spaces) context.getAttribute(CommonPortletServices.CPS_SPACES_SERVICE);
if (spacesService == null)
{
throw new PortletException("Could not get instance of portal spaces service component");
}
admin = (PortalAdministration) context.getAttribute(CommonPortletServices.CPS_PORTAL_ADMINISTRATION);
if (admin == null)
{
throw new PortletException("Failed to find the Portal Administration on portlet initialization");
}
pageManager = (PageManager)context.getAttribute(CommonPortletServices.CPS_PAGE_MANAGER_COMPONENT);
if (pageManager == null)
{
throw new PortletException("Failed to find the Page Manager on portlet initialization");
}
userManager = (UserManager) context.getAttribute(CommonPortletServices.CPS_USER_MANAGER_COMPONENT);
if (null == userManager)
{
throw new PortletException("Failed to find the user manager on portlet initialization");
}
decorationFactory = (DecorationFactory)context.getAttribute(CommonPortletServices.CPS_DECORATION_FACTORY);
if (null == decorationFactory)
{
throw new PortletException("Failed to find the Decoration Factory on portlet initialization");
}
}