1 31 32 package org.opencms.flex; 33 34 import org.opencms.file.CmsObject; 35 import org.opencms.file.CmsResource; 36 import org.opencms.loader.I_CmsFlexCacheEnabledLoader; 37 import org.opencms.loader.I_CmsResourceLoader; 38 39 import java.util.HashMap ; 40 import java.util.Locale ; 41 import java.util.Map ; 42 43 import javax.servlet.ServletException ; 44 import javax.servlet.ServletRequest ; 45 import javax.servlet.ServletResponse ; 46 import javax.servlet.http.HttpServletRequest ; 47 import javax.servlet.http.HttpServletResponse ; 48 49 62 public class CmsFlexDummyLoader implements I_CmsResourceLoader, I_CmsFlexCacheEnabledLoader { 63 64 65 public static final int LOADER_ID = 100; 66 67 68 public static final String LOADER_INFO = "Dummy Loader, which provides test classes access to the CmsFlexCache instance"; 69 70 71 static CmsFlexCache m_flexCache; 72 73 74 private HashMap m_config = new HashMap (); 75 76 79 public void addConfigurationParameter(String paramName, String paramValue) { 80 81 m_config.put(paramName, paramValue); 82 } 83 84 87 public void destroy() { 88 89 m_flexCache = null; 90 m_config.clear(); 91 } 92 93 96 public byte[] dump( 97 CmsObject cms, 98 CmsResource resource, 99 String element, 100 Locale locale, 101 HttpServletRequest req, 102 HttpServletResponse res) throws ServletException { 103 104 throw new ServletException ("Not implemented"); 105 } 106 107 110 public byte[] export(CmsObject cms, CmsResource resource, HttpServletRequest req, HttpServletResponse res) 111 throws ServletException { 112 113 throw new ServletException ("Not implemented"); 114 } 115 116 119 public Map getConfiguration() { 120 121 return m_config; 122 } 123 124 127 public int getLoaderId() { 128 129 return LOADER_ID; 130 } 131 132 135 public String getResourceLoaderInfo() { 136 137 return LOADER_INFO; 138 } 139 140 143 public void initConfiguration() { 144 145 } 147 148 151 public boolean isStaticExportEnabled() { 152 153 return false; 154 } 155 156 159 public boolean isStaticExportProcessable() { 160 161 return false; 162 } 163 164 167 public boolean isUsableForTemplates() { 168 169 return false; 170 } 171 172 175 public boolean isUsingUriWhenLoadingTemplate() { 176 177 return false; 178 } 179 180 183 public void load(CmsObject cms, CmsResource resource, HttpServletRequest req, HttpServletResponse res) 184 throws ServletException { 185 186 throw new ServletException ("Not implemented"); 187 } 188 189 192 public void service(CmsObject cms, CmsResource resource, ServletRequest req, ServletResponse res) 193 throws ServletException { 194 195 throw new ServletException ("Not implemented"); 196 } 197 198 201 public void setFlexCache(CmsFlexCache cache) { 202 203 m_flexCache = cache; 204 } 205 } | Popular Tags |