1 7 8 package org.jboss.portal.core.theme.strategy; 9 10 import org.apache.log4j.Logger; 11 import org.jboss.portal.core.theme.strategy.impl.PortletContextImpl; 12 import org.jboss.portal.core.theme.strategy.impl.StrategyContextImpl; 13 import org.jboss.portal.server.Window; 14 import org.jboss.portal.server.theme.PortalLayout; 15 import org.jboss.portal.server.theme.strategy.PortletContext; 16 import org.jboss.portal.server.theme.strategy.StrategyContext; 17 import org.jboss.portal.server.user.UserContext; 18 19 import javax.servlet.http.HttpServletRequest ; 20 import java.util.Collection ; 21 22 29 public class StrategyFactory 30 { 31 private static final Logger log = Logger.getLogger(StrategyFactory.class); 32 33 private StrategyFactory() 34 { 35 } 36 37 51 public static StrategyContext createStrategyContext(HttpServletRequest request, PortalLayout layout, Collection portlets, 52 PortletContext targetPortlet, String portalName, 53 String pageName, String [] regionNames) 54 { 55 log.debug("creating strategy context for: " + (layout.getName() == null ? "[no layout]" : layout.getName()) + 56 " " + portalName + " " + pageName); 57 return new StrategyContextImpl(request, layout, portlets, targetPortlet, portalName, pageName, regionNames); 58 } 59 60 73 public static PortletContext createPortletContext(Window window, UserContext userContext) 74 { 75 log.debug("creating portlet context for: " + window.getName()); 76 return new PortletContextImpl(window, userContext); 77 } 78 } 79 | Popular Tags |