Package org.apache.cocoon.pipeline

Examples of org.apache.cocoon.pipeline.Pipeline


        configuration.put("id", id);

        ProfilingGenerator profilingGenerator = new ProfilingGenerator();
        profilingGenerator.setProfilingDataHolder(holder);

        Pipeline pipeline = new NonCachingPipeline();
        profilingGenerator.setConfiguration(configuration);

        pipeline.addComponent(profilingGenerator);
        pipeline.addComponent(new XMLSerializer());

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        pipeline.setup(baos, configuration);
        pipeline.execute();

        String s = baos.toString();

        assertTrue(s.contains("<cocoon-profiling id=\"42\">"));
        assertTrue(s.contains("<component"));
View Full Code Here


        configuration.put("id", id);

        ProfilingGenerator profilingGenerator = new ProfilingGenerator();
        profilingGenerator.setProfilingDataHolder(holder);

        Pipeline pipeline = new NonCachingPipeline();
        profilingGenerator.setConfiguration(configuration);

        pipeline.addComponent(profilingGenerator);
        pipeline.addComponent(new XMLSerializer());

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        pipeline.setup(baos, configuration);
        pipeline.execute();

        String s = baos.toString();

        assertTrue(s.contains("<cocoon-profiling id=\"42\">"));
        assertTrue(s.contains("<component"));
View Full Code Here

    @Around("execution(* org.apache.cocoon.pipeline.Pipeline.execute(..))")
    public Object interceptInvoke(ProceedingJoinPoint proceedingJoinPoint) throws Throwable {
        Object result = proceedingJoinPoint.proceed();

        Pipeline pipeline = (Pipeline) proceedingJoinPoint.getTarget();
        long lastModified = pipeline.getLastModified();
        THREAD_LOCAL.set(lastModified);

        return result;
    }
View Full Code Here

        if (pipelineClass == null) {
            throw new IllegalArgumentException("Pipeline type '" + type + "' is not supported.");
        }

        try {
            Pipeline pipeline = pipelineClass.newInstance();
            return pipeline;
        } catch (Exception e) {
            throw new IllegalArgumentException("A pipeline of type '" + type + "' could not be created.", e);
        }
    }
View Full Code Here

     *
     * @throws Exception
     */
    public static void transform(String xmlString, Map<String, Object> xsltParameters, Properties outputProperties,
            OutputStream outputStream, URL... xsltUrls) throws Exception {
        Pipeline pipeline = new NonCachingPipeline();

        pipeline.addComponent(new StringGenerator(xmlString));
        for (URL xsltUrl : xsltUrls) {
            pipeline.addComponent(new XSLTTransformer(xsltUrl, xsltParameters));
        }
        pipeline.addComponent(new XMLSerializer(outputProperties));

        pipeline.setup(outputStream, null);
        pipeline.execute();
    }
View Full Code Here

    @Around("execution(* org.apache.cocoon.pipeline.Pipeline.execute(..))")
    public Object interceptInvoke(ProceedingJoinPoint proceedingJoinPoint) throws Throwable {
        Object result = proceedingJoinPoint.proceed();

        Pipeline pipeline = (Pipeline) proceedingJoinPoint.getTarget();
        String newValue = pipeline.getContentType();
        if (newValue != null) {
            THREAD_LOCAL.set(newValue);
        }

        return result;
View Full Code Here

TOP

Related Classes of org.apache.cocoon.pipeline.Pipeline

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.