indexPageURL = "/carbon/admin/index.jsp";
}
RegistryService registryService = getRegistryService();
Registry registry = registryService.getLocalRepository();
UIBundleDeployer uiBundleDeployer = new UIBundleDeployer();
UIResourceRegistry uiResourceRegistry = new UIResourceRegistry();
uiResourceRegistry.initialize(bundleContext);
uiResourceRegistry.setDefaultUIResourceProvider(
uiBundleDeployer.getBundleBasedUIResourcePrvider());
// BundleResourcePathRegistry resourcePathRegistry = uiBundleDeployer.getBundleResourcePathRegistry();
HttpContext commonContext =
new CarbonSecuredHttpContext(context.getBundle(), "/web", uiResourceRegistry, registry);
//Registering filedownload servlet
Servlet fileDownloadServlet = new ContextPathServletAdaptor(new FileDownloadServlet(
context, getConfigurationContextService()), "/filedownload");
httpService.registerServlet("/filedownload", fileDownloadServlet, null, commonContext);
fileDownloadServlet.getServletConfig().getServletContext().setAttribute(
CarbonConstants.SERVER_URL, serverURL);
fileDownloadServlet.getServletConfig().getServletContext().setAttribute(
CarbonConstants.INDEX_PAGE_URL, indexPageURL);
//Registering fileupload servlet
Servlet fileUploadServlet;
if (isLocalTransportMode) {
fileUploadServlet = new ContextPathServletAdaptor(new FileUploadServlet(
context, serverConfigContext, webContext), "/fileupload");
} else {
fileUploadServlet = new ContextPathServletAdaptor(new FileUploadServlet(
context, clientConfigContext, webContext), "/fileupload");
}
httpService.registerServlet("/fileupload", fileUploadServlet, null, commonContext);
fileUploadServlet.getServletConfig().getServletContext().setAttribute(
CarbonConstants.SERVER_URL, serverURL);
fileUploadServlet.getServletConfig().getServletContext().setAttribute(
CarbonConstants.INDEX_PAGE_URL, indexPageURL);
uiBundleDeployer.deploy(bundleContext, commonContext);
context.addBundleListener(uiBundleDeployer);
httpService.registerServlet("/", new org.apache.tiles.web.startup.TilesServlet(),
initparams,
commonContext);