Examples of UIBundleDeployer


Examples of org.wso2.carbon.ui.deployment.UIBundleDeployer

            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 = new ContextPathServletAdaptor(new FileUploadServlet(
                context, configContext, 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);
View Full Code Here

Examples of org.wso2.carbon.ui.deployment.UIBundleDeployer

            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);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.