1 16 17 22 package org.apache.jetspeed.portal.portlets.viewprocessor; 23 24 import org.apache.jetspeed.services.logging.JetspeedLogFactoryService; 25 import org.apache.jetspeed.services.logging.JetspeedLogger; 26 27 35 public class ViewProcessorFactory 36 { 37 40 private static final JetspeedLogger logger = JetspeedLogFactoryService.getLogger(ViewProcessorFactory.class.getName()); 41 42 43 public ViewProcessorFactory() 44 { 45 46 } 49 50 public static ViewProcessor getViewProcessor(String viewType) 51 { 52 53 ViewProcessor viewProcessor; 54 55 if (viewType.equals("Velocity")) 60 { 61 logger.info("ViewProcessorFactory - creating Velocity processor"); 62 viewProcessor = new VelocityViewProcessor(); 63 } 64 else if (viewType.equals("JSP")) 65 { 66 logger.info("ViewProcessorFactory - creating JSP processor"); 67 viewProcessor = new JSPViewProcessor(); 68 } 69 else if (viewType.equals("XSL")) 70 { 71 logger.info("ViewProcessorFactory - creating XSL processor"); 72 viewProcessor = new XSLViewProcessor(); 73 } 74 else if (viewType.equals("RSS")) 75 { 76 logger.info("ViewProcessorFactory - creating RSS processor"); 77 viewProcessor = new RSSViewProcessor(); 78 } 79 else 80 { 81 logger.error("ViewProcessorFactory - problem figuring out what view processor type you want - " + 82 viewType); 83 logger.error("ViewProcessorFactory - returing a JSP processor"); 84 viewProcessor = new JSPViewProcessor(); 85 } 86 87 return viewProcessor; 88 } 89 } 90 | Popular Tags |