1 7 8 package org.jboss.portal.core.theme.impl; 9 10 import org.apache.log4j.Logger; 11 import org.jboss.portal.server.ServerRegistrationID; 12 import org.jboss.portal.server.metadata.ThemeRegistrationMetaData; 13 import org.jboss.portal.server.theme.PortalTheme; 14 import org.jboss.portal.server.theme.ThemeLink; 15 import org.jboss.portal.server.theme.ThemeScript; 16 17 import javax.servlet.ServletContext ; 18 import java.util.ArrayList ; 19 import java.util.List ; 20 21 28 public class PortalThemeImpl extends ThemeRegistrationMetaData 29 implements PortalTheme 30 { 31 private static Logger log = Logger.getLogger(PortalThemeImpl.class); 32 33 private String name; 34 private ServletContext context; 35 private List scripts = new ArrayList (); 36 private List links = new ArrayList (); 37 private String appName; 38 private String contextPath; 39 40 public PortalThemeImpl(ServerRegistrationID id, ServletContext context, String contextPath, String appName, String name) 41 { 42 super(id); 43 log.debug("create theme for context " + context.getServletContextName() + " name " + name); 44 this.name = name; 45 this.context = context; 46 this.appName = appName; 47 this.contextPath = contextPath; 48 } 49 50 53 public ServletContext getServletContext() 54 { 55 return context; 56 } 57 58 61 public String getContextPath() 62 { 63 return contextPath; 64 } 65 66 69 public String getAppName() 70 { 71 return appName; 72 } 73 74 77 public String getName() 78 { 79 return name; 80 } 81 82 85 public List getScripts() 86 { 87 return scripts; 88 } 89 90 93 public List getLinks() 94 { 95 return links; 96 } 97 98 101 public void addLink(ThemeLink themeLink) 102 { 103 log.debug("theme " + name + " add link " + themeLink); 104 links.add(themeLink); 105 } 106 107 110 public void addScript(ThemeScript themeScript) 111 { 112 log.debug("theme " + name + " add link " + themeScript); 113 scripts.add(themeScript); 114 } 115 116 119 public String toString() 120 { 121 return name; 122 } 123 } 124 | Popular Tags |