1 23 24 package org.infoglue.deliver.controllers.kernel.impl.simple; 25 26 import javax.servlet.http.HttpServletRequest ; 27 28 import org.infoglue.cms.exception.SystemException; 29 import org.infoglue.deliver.applications.databeans.DeliveryContext; 30 import org.infoglue.deliver.util.HttpUtilities; 31 32 33 public class IntegrationDeliveryController 34 { 35 36 39 40 private IntegrationDeliveryController(Integer siteNodeId, Integer languageId, Integer contentId) throws SystemException, Exception 41 { 42 } 43 44 45 48 49 public static IntegrationDeliveryController getIntegrationDeliveryController(Integer siteNodeId, Integer languageId, Integer contentId) throws SystemException, Exception 50 { 51 return new IntegrationDeliveryController(siteNodeId, languageId, contentId); 52 } 53 54 57 58 public static IntegrationDeliveryController getIntegrationDeliveryController(DeliveryContext deliveryContext) throws SystemException, Exception 59 { 60 return new IntegrationDeliveryController(deliveryContext.getSiteNodeId(), deliveryContext.getLanguageId(), deliveryContext.getContentId()); 61 } 62 63 66 67 public String getUrlContent(String url, HttpServletRequest request, boolean includeRequest) throws SystemException, Exception 68 { 69 String response = ""; 70 71 response = HttpUtilities.getUrlContent(url, request, includeRequest); 72 73 return response; 74 } 75 76 79 80 public String getUrlContent(String url, HttpServletRequest request, boolean includeRequest, String encoding) throws SystemException, Exception 81 { 82 String response = ""; 83 84 response = HttpUtilities.getUrlContent(url, request, includeRequest, encoding); 85 86 return response; 87 } 88 89 90 95 public Object getObjectWithName(String className, HttpServletRequest request) throws InstantiationException , IllegalAccessException , ClassNotFoundException 96 { 97 Class theClass = null; 98 99 try 100 { 101 theClass = Thread.currentThread().getContextClassLoader().loadClass( className ); 102 } 103 catch (ClassNotFoundException e) 104 { 105 theClass = getClass().getClassLoader().loadClass( className ); 106 } 107 108 return theClass.newInstance(); 109 } 110 111 112 } | Popular Tags |