Package org.apache.jetspeed.page

Examples of org.apache.jetspeed.page.JetspeedPageSerializerApplication


    }
   
    public void execute(Log log) throws MojoExecutionException
    {
       
        JetspeedPageSerializerApplication app = null;
        try
        {
            Class dfClass = Class.forName(PAGE_SERIALIZER_APPLICATION_CLASS_NAME, true, Thread.currentThread().getContextClassLoader());
            app = (JetspeedPageSerializerApplication) dfClass.newInstance();
        }
        catch (Exception e)
        {
            throw new MojoExecutionException("Cannot find or load JetspeedPageSerializerApplication class "+ PAGE_SERIALIZER_APPLICATION_CLASS_NAME, e);
        }
       
        ToolsLogger logger = new MavenToolsLogger(log);
       
        Properties props = new Properties();
        if (initProperties != null)
        {
            // working around an odd Maven on MacOS issue which stored empty mapped properties actually as null values,
            // which isn't allowed for properties
            Iterator iter = initProperties.entrySet().iterator();
            while (iter.hasNext())
            {
                Map.Entry entry = (Map.Entry)iter.next();
                if (entry.getValue() == null)
                {
                    entry.setValue("");
                }
            }
            props.putAll(initProperties);
        }
        if (psmlPagesPath != null)
        {
            props.put("psml.pages.path", psmlPagesPath);
        }
       
        try
        {
            if (importing)
            {
                app.importPages(logger, applicationRootPath, categories, filterPropertiesFileName, props, rootFolder);
            }
            else
            {
                app.exportPages(logger, applicationRootPath, categories, filterPropertiesFileName, props, rootFolder);
            }
        }
        catch (JetspeedException je)
        {
            throw new MojoExecutionException("PageSerializer error: ",je);
View Full Code Here


{
    private static ToolsLogger logger = new Slf4JToolsLogger(LoggerFactory.getLogger(TestJetspeedPageSerializerApplication.class));
   
    public void testSerializer() throws Exception
    {
        JetspeedPageSerializerApplication app = new JetspeedPageSerializerApplicationImpl();
        String applicationRootPath = getBaseDir()+"target/test-classes/webapp";
        Properties initProperties = new Properties();
        initProperties.put("psml.pages.path",getBaseDir()+"../../applications/jetspeed/src/main/webapp/WEB-INF/pages");
        app.importPages(logger, applicationRootPath, "pageSerializer", applicationRootPath+"/WEB-INF/conf/spring-filter.properties", initProperties, "/");
        File exportPath = new File(applicationRootPath+"/WEB-INF/exportedPages");
        exportPath.mkdirs();
        initProperties.put("psml.pages.path",exportPath.getAbsolutePath());
        app.exportPages(logger, applicationRootPath, "pageSerializer", applicationRootPath+"/WEB-INF/conf/spring-filter.properties", initProperties, "/");
    }
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.page.JetspeedPageSerializerApplication

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.