Package org.apache.jetspeed.components

Examples of org.apache.jetspeed.components.SpringComponentManager


        MockServletConfig servletConfig = new MockServletConfig();       
        ResourceLocatingServletContext servletContent = new ResourceLocatingServletContext(new File(appRoot));       
        servletConfig.setServletContext(servletContent);
        ServletConfigFactoryBean.setServletConfig(servletConfig);
       
        SpringComponentManager scm = new SpringComponentManager(new String[] {"/WEB-INF/assembly/boot/datasource.xml"}, new String[] {"/WEB-INF/assembly/*.xml"}, servletContent, appRoot );
      
        engine = new JetspeedEngine(config, appRoot, servletConfig, scm );
        Jetspeed.setEngine(engine);
        engine.start();
        getContext().put(ENGINE_ATTR, engine );
View Full Code Here


        { //"src/webapp/WEB-INF/assembly/layout-api.xml",
                "src/test/resources/assembly/test-layout-constraints-api.xml",
                "src/test/resources/assembly/page-manager.xml"};
       
               
        cm = new SpringComponentManager(bootConfigs, appConfigs, servletContent, ".");
        cm.start();
        valve = (LayoutValve) cm.getComponent("layoutValve");
        velocity = (VelocityEngine) cm.getComponent("AjaxVelocityEngine");
        ajax = (AjaxRequestService) cm.getComponent("AjaxRequestService");
        pageManager = (PageManager) cm.getComponent("pageManager");
View Full Code Here

        String[] appConfigs =
        { //"src/webapp/WEB-INF/assembly/layout-api.xml",
                "src/test/resources/assembly/test-layout-api.xml"};
       
               
        cm = new SpringComponentManager(bootConfigs, appConfigs, servletContent, ".");
        cm.start();
        valve = (LayoutValve) cm.getComponent("layoutValve");
        velocity = (VelocityEngine) cm.getComponent("AjaxVelocityEngine");
        ajax = (AjaxRequestService) cm.getComponent("AjaxRequestService");
               
View Full Code Here

        final String assemblyFileExtension = configuration.getString("assembly.extension",".xml");
                   
        String[] bootConfigs = new String[] {"/WEB-INF/assembly/boot/*.xml"};
        String[] appConfigs =  new String[] {assemblyDir+"/*"+assemblyFileExtension, assemblyDir+"/override/*"+assemblyFileExtension};
        ServletContext servletContext = servletConfig.getServletContext();
        SpringComponentManager cm = new SpringComponentManager(bootConfigs, appConfigs, servletContext, appRoot);     
       
        return cm;       
    }
View Full Code Here

     
     
      if (this.initialized)
            throw new SerializerException(
                    SerializerException.COMPONENT_MANAGER_EXISTS.create(""));
        SpringComponentManager cm = new SpringComponentManager(bootConfig,
                appConfig, appRoot);
        cm.start();
        Configuration properties = new PropertiesConfiguration();
        properties.setProperty(JetspeedEngineConstants.APPLICATION_ROOT_KEY,
                appRoot);
        this.setComponentManager(cm);
    }
View Full Code Here

                configs[i] = current0Offset;
               
            }         
        }
       
        ComponentManager cm = new SpringComponentManager(configs, null);
       
        return cm;
    }   
View Full Code Here

        String[] appConfigs =
        { //"src/webapp/WEB-INF/assembly/layout-api.xml",
                "src/test/resources/assembly/test-layout-api.xml"};
       
               
        cm = new SpringComponentManager(bootConfigs, appConfigs, servletContent, ".");
        cm.start();
        valve = (LayoutValve) cm.getComponent("layoutValve");
        velocity = (VelocityEngine) cm.getComponent("AjaxVelocityEngine");
        ajax = (AjaxRequestService) cm.getComponent("AjaxRequestService");
               
View Full Code Here

           
       
        String[] bootConfigs = new String[] {"/WEB-INF/assembly/boot/*.xml"};
        String[] appConfigs =  new String[] {assemblyDir+"/*"+assemblyFileExtension};
        ServletContext servletContext = servletConfig.getServletContext();
        SpringComponentManager cm = new SpringComponentManager(bootConfigs, appConfigs, servletContext, appRoot);     
       
        return cm;       
    }
View Full Code Here

                configs[i] = current0Offset;
               
            }         
        }
       
        SpringComponentManager cm = new SpringComponentManager(configs, null);
        servletConfig.getServletContext().setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, cm.getApplicationContext());
       
        return cm;
    }   
View Full Code Here

    }

    private Result execute(ToolsLogger logger, String applicationRootPath, String categories, String filterPropertiesFileName, Properties initProperties, String rootFolder, boolean importing) throws JetspeedException
    {
        ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
        SpringComponentManager scm = null;
        PageSerializer.Result result = null;
        try
        {
            JetspeedBeanDefinitionFilter filter = null;
           
            if (filterPropertiesFileName != null)
            {
                filter = new JetspeedBeanDefinitionFilter("file:"+filterPropertiesFileName, categories);
            }
            else
            {
                filter = new JetspeedBeanDefinitionFilter(categories);
            }
           
            String assemblyRootPath = "file:"+applicationRootPath+"/WEB-INF/assembly";
            String[] bootConfig = {assemblyRootPath+"/boot/*.xml"};
            String[] appConfig = { assemblyRootPath+"/*.xml", assemblyRootPath+"/override/*.xml" };                      
           
            ClassLoader extendedClassLoader = contextClassLoader;
            File webInfClasses = new File(applicationRootPath, "WEB-INF/classes");
            if (webInfClasses.exists())
            {
                extendedClassLoader = new URLClassLoader(new URL[]{webInfClasses.toURL()}, contextClassLoader);
            }
            Thread.currentThread().setContextClassLoader(extendedClassLoader);
           
            if (initProperties == null)
            {
                initProperties = new Properties();
            }
            initProperties.put("page.manager.permissions.security", "false");
            initProperties.put("page.manager.constraints.security", "false");
           
            scm = new SpringComponentManager(filter, bootConfig, appConfig, applicationRootPath, initProperties, true);
            scm.start();
           
            PageSerializer serializer = (PageSerializer)scm.getComponent(PageSerializer.class.getName());
            if (importing)
            {
                result = serializer.importPages(logger, rootFolder);
            }
            else
            {
                result = serializer.exportPages(logger, rootFolder);
            }
        }
        catch (Exception e)
        {
            logger.error(e);
            if (e instanceof JetspeedException)
            {
                throw (JetspeedException)e;
            }
            throw new JetspeedException(e);
        }
        finally
        {
            Thread.currentThread().setContextClassLoader(contextClassLoader);
            if (scm != null)
            {
                scm.stop();
            }
        }
        return result;
    }
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.components.SpringComponentManager

Copyright © 2018 www.massapicom. 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.