You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by je...@apache.org on 2019/08/21 13:50:34 UTC

[sling-whiteboard] branch master updated (ff54658 -> 9c7deff)

This is an automated email from the ASF dual-hosted git repository.

jeb pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/sling-whiteboard.git.


    from ff54658  initial changes
     new 628e998  extending writer
     new 778e87f  Merge branch 'master' of https://github.com/apache/sling-whiteboard.git
     new 9c7deff  removed old response

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../apache/sling/transformer/ProcessManager.java   | 11 +++++
 .../sling/transformer/ProcessingContext.java       |  5 --
 .../org/apache/sling/transformer/Processor.java    | 57 ----------------------
 .../apache/sling/transformer/ProcessorFactory.java | 36 --------------
 .../sling/transformer/impl/ParserWriter.java       | 26 ++++++++++
 .../org/apache/sling/transformer/impl/Process.java | 32 ++++++++----
 ...ProcessManager.java => ProcessManagerImpl.java} |  4 +-
 .../transformer/impl/TransformationFilter.java     | 28 ++++-------
 ...riterResponse.java => TransformerResponse.java} | 36 ++------------
 9 files changed, 78 insertions(+), 157 deletions(-)
 create mode 100644 transformer/src/main/java/org/apache/sling/transformer/ProcessManager.java
 delete mode 100644 transformer/src/main/java/org/apache/sling/transformer/Processor.java
 delete mode 100644 transformer/src/main/java/org/apache/sling/transformer/ProcessorFactory.java
 create mode 100644 transformer/src/main/java/org/apache/sling/transformer/impl/ParserWriter.java
 copy transformer/src/main/java/org/apache/sling/transformer/impl/{ProcessManager.java => ProcessManagerImpl.java} (93%)
 rename transformer/src/main/java/org/apache/sling/transformer/impl/{RewriterResponse.java => TransformerResponse.java} (72%)


[sling-whiteboard] 02/03: Merge branch 'master' of https://github.com/apache/sling-whiteboard.git

Posted by je...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jeb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-whiteboard.git

commit 778e87fe1be6e709ec86980e2788585fc88f7523
Merge: 628e998 ff54658
Author: JE Bailey <ja...@sas.com>
AuthorDate: Wed Aug 21 09:49:22 2019 -0400

    Merge branch 'master' of https://github.com/apache/sling-whiteboard.git
    
    Conflicts:
    	transformer/src/main/java/org/apache/sling/transformer/impl/Process.java
    	transformer/src/main/java/org/apache/sling/transformer/impl/ProcessManager.java
    	transformer/src/main/java/org/apache/sling/transformer/impl/RewriterResponse.java
    	transformer/src/main/java/org/apache/sling/transformer/impl/TransformationFilter.java

 .../org/apache/sling/transformer/impl/Process.java |  16 +--
 .../sling/transformer/impl/ProcessManager.java     |  81 ++++++++++++++
 .../sling/transformer/impl/RewriterResponse.java   | 116 +++++++++++++++++++++
 .../transformer/impl/TransformationFilter.java     |  28 ++---
 4 files changed, 215 insertions(+), 26 deletions(-)

diff --cc transformer/src/main/java/org/apache/sling/transformer/impl/Process.java
index c10b057,18ab00d..399950e
--- a/transformer/src/main/java/org/apache/sling/transformer/impl/Process.java
+++ b/transformer/src/main/java/org/apache/sling/transformer/impl/Process.java
@@@ -35,18 -31,18 +35,17 @@@ import org.osgi.annotation.versioning.P
   * BiConsumer<Element,TagMapping> lambda.
   * 
   * This allows you to use the next() method to collect the elements that will be
-- * passed on to the stream method. This can modify the eventual output and assists in use cases where
-- * there is a need to add or remove elements
++ * passed on to the stream method. This can modify the eventual output and
++ * assists in use cases where there is a need to add or remove elements
   *
   */
  @ProviderType
 -public class Process {
 +public class Process implements ProcessingContext {
  
      private List<HtmlElement> list = new ArrayList<>();
--    private Map<String,Object> context = new HashMap<>();
++    private Map<String, Object> context = new HashMap<>();
      private SlingHttpServletRequest request;
      private SlingHttpServletResponse response;
--    
  
      private Process(SlingHttpServletRequest request, SlingHttpServletResponse response) {
          this.request = request;
@@@ -61,7 -57,7 +60,7 @@@
      public void next(HtmlElement... elements) {
          Collections.addAll(list, elements);
      }
--    
++
      public void next(String html) {
          Collections.addAll(list, Html.stream(html).toArray(HtmlElement[]::new));
      }
@@@ -69,11 -65,11 +68,11 @@@
      public Stream<HtmlElement> getElements() {
          return list.stream();
      }
--    
--    public Map<String,Object> getContext(){
++
++    public Map<String, Object> getContext() {
          return context;
      }
--    
++
      public SlingHttpServletResponse getResponse() {
          return response;
      }
@@@ -81,14 -77,4 +80,15 @@@
      public SlingHttpServletRequest getRequest() {
          return request;
      }
 +
 +    @Override
 +    public PrintWriter getWriter() throws IOException {
 +        return response.getWriter();
 +    }
 +
 +    @Override
 +    public OutputStream getOutputStream() throws IOException {
 +        return response.getOutputStream();
 +    }
++
  }
diff --cc transformer/src/main/java/org/apache/sling/transformer/impl/TransformationFilter.java
index 2aadb36,d21616c..905d57b
--- a/transformer/src/main/java/org/apache/sling/transformer/impl/TransformationFilter.java
+++ b/transformer/src/main/java/org/apache/sling/transformer/impl/TransformationFilter.java
@@@ -36,15 -36,15 +36,8 @@@ import org.osgi.service.component.annot
   * This filter activates the rewriter for the output.
   *
   */
--@Component(
--        service = Filter.class,
--        property = {
--                Constants.SERVICE_VENDOR + "=The Apache Software Foundation",
--                "sling.filter.scope=request",
--                "sling.filter.scope=error",
--                Constants.SERVICE_RANKING + ":Integer=2500"
--        }
--)
++@Component(service = Filter.class, property = { Constants.SERVICE_VENDOR + "=The Apache Software Foundation",
++        "sling.filter.scope=request", "sling.filter.scope=error", Constants.SERVICE_RANKING + ":Integer=2500" })
  public class TransformationFilter implements Filter {
  
      @Reference
@@@ -67,21 -67,21 +60,20 @@@
      }
  
      /**
--     * @see javax.servlet.Filter#doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain)
++     * @see javax.servlet.Filter#doFilter(javax.servlet.ServletRequest,
++     *      javax.servlet.ServletResponse, javax.servlet.FilterChain)
       */
      @Override
--    public void doFilter(ServletRequest request,
--                         ServletResponse response,
--                         FilterChain chain)
--    throws IOException, ServletException {
--        if ( ! (request instanceof SlingHttpServletRequest)) {
++    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
++            throws IOException, ServletException {
++        if (!(request instanceof SlingHttpServletRequest)) {
              throw new ServletException("Request is not a Apache Sling HTTP request.");
          }
          final SlingHttpServletRequest slingRequest = (SlingHttpServletRequest) request;
          final SlingHttpServletResponse slingResponse = (SlingHttpServletResponse) response;
  
-         final TransformerResponse rewriterResponse =
-                 new TransformerResponse(slingRequest, slingResponse);
 -        final RewriterResponse rewriterResponse =
 -                new RewriterResponse(slingRequest, slingResponse);
++        final TransformerResponse rewriterResponse = new TransformerResponse(slingRequest, slingResponse);
++
          boolean errorOccured = true;
          try {
              chain.doFilter(request, rewriterResponse);
@@@ -89,5 -89,5 +81,5 @@@
          } finally {
              rewriterResponse.finished(errorOccured);
          }
--	}
++    }
  }


[sling-whiteboard] 01/03: extending writer

Posted by je...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jeb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-whiteboard.git

commit 628e998912db271e2d1e843bddb23333f6927e31
Author: JE Bailey <je...@apache.org>
AuthorDate: Fri Aug 16 11:45:24 2019 -0400

    extending writer
---
 transformer/pom.xml                                | 107 ++----------
 .../apache/sling/transformer/ProcessManager.java   |  11 ++
 .../sling/transformer/ProcessingContext.java       |   5 -
 .../org/apache/sling/transformer/Processor.java    |  57 ------
 .../apache/sling/transformer/ProcessorFactory.java |  36 ----
 .../apache/sling/transformer/ProcessorManager.java |  40 -----
 .../sling/transformer/TransformationStep.java      |  16 ++
 .../sling/transformer/impl/LinkTransformer.java    |  91 ++++++++--
 .../sling/transformer/impl/ParserWriter.java       |  26 +++
 .../org/apache/sling/transformer/impl/Process.java |  51 ++++--
 .../sling/transformer/impl/ProcessManager.java     |  23 ---
 .../sling/transformer/impl/ProcessManagerImpl.java |  83 +++++++++
 .../sling/transformer/impl/RewriterResponse.java   | 188 --------------------
 .../transformer/impl/TransformationFilter.java     |   8 +-
 .../impl/TransformationStepWrapper.java            |  16 ++
 .../transformer/impl/TransformerResponse.java      |  90 ++++++++++
 .../org/apache/sling/transformer/package-info.java |  24 ---
 .../apache/sling/rewriter/it/tests/EmojiIT.java    |  60 -------
 .../impl/ProcessorConfigurationImplTest.java       | 193 ---------------------
 19 files changed, 369 insertions(+), 756 deletions(-)

diff --git a/transformer/pom.xml b/transformer/pom.xml
index 92cd653..c3a0971 100644
--- a/transformer/pom.xml
+++ b/transformer/pom.xml
@@ -1,23 +1,17 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-    Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements.  See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership.  The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License.  You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, either express or implied.  See the License for the
-    specific language governing permissions and limitations
-    under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor 
+    license agreements. See the NOTICE file distributed with this work for additional 
+    information regarding copyright ownership. The ASF licenses this file to 
+    you under the Apache License, Version 2.0 (the "License"); you may not use 
+    this file except in compliance with the License. You may obtain a copy of 
+    the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
+    by applicable law or agreed to in writing, software distributed under the 
+    License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
+    OF ANY KIND, either express or implied. See the License for the specific 
+    language governing permissions and limitations under the License. -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
 
     <modelVersion>4.0.0</modelVersion>
     <parent>
@@ -28,7 +22,7 @@
     </parent>
 
     <artifactId>org.apache.sling.transformer</artifactId>
-    <version>1.2.3-SNAPSHOT</version>
+    <version>0.0.0-SNAPSHOT</version>
 
     <name>Apache Sling Transformer</name>
     <description>
@@ -37,56 +31,15 @@
         or a configurable pipeline.
     </description>
 
-    <properties>
-        <org.ops4j.pax.exam.version>4.13.1</org.ops4j.pax.exam.version>
-    </properties>
-
     <build>
         <plugins>
             <plugin>
                 <groupId>biz.aQute.bnd</groupId>
-                <artifactId>bnd-maven-plugin</artifactId>
-            </plugin>
-            <plugin>
-                <groupId>biz.aQute.bnd</groupId>
-                <artifactId>bnd-baseline-maven-plugin</artifactId>
+                <artifactId>bnd-maven-plugin </artifactId>
             </plugin>
             <plugin>
                 <groupId>org.apache.sling</groupId>
                 <artifactId>sling-maven-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <id>generate-adapter-metadata</id>
-                        <phase>process-classes</phase>
-                        <goals>
-                            <goal>generate-adapter-metadata</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-failsafe-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>integration-test</goal>
-                            <goal>verify</goal>
-                        </goals>
-                    </execution>
-                </executions>
-                <configuration>
-                    <systemProperties>
-                        <property>
-                            <name>bundle.filename</name>
-                            <value>${basedir}/target/${project.build.finalName}.jar</value>
-                        </property>
-                    </systemProperties>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.servicemix.tooling</groupId>
-                <artifactId>depends-maven-plugin</artifactId>
             </plugin>
         </plugins>
     </build>
@@ -206,35 +159,5 @@
             <version>1.3_1</version>
             <scope>test</scope>
         </dependency>
-        <dependency>
-            <groupId>org.ops4j.pax.exam</groupId>
-            <artifactId>pax-exam</artifactId>
-            <version>${org.ops4j.pax.exam.version}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.ops4j.pax.exam</groupId>
-            <artifactId>pax-exam-cm</artifactId>
-            <version>${org.ops4j.pax.exam.version}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.ops4j.pax.exam</groupId>
-            <artifactId>pax-exam-container-forked</artifactId>
-            <version>${org.ops4j.pax.exam.version}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.ops4j.pax.exam</groupId>
-            <artifactId>pax-exam-junit4</artifactId>
-            <version>${org.ops4j.pax.exam.version}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.ops4j.pax.exam</groupId>
-            <artifactId>pax-exam-link-mvn</artifactId>
-            <version>${org.ops4j.pax.exam.version}</version>
-            <scope>test</scope>
-        </dependency>
     </dependencies>
 </project>
diff --git a/transformer/src/main/java/org/apache/sling/transformer/ProcessManager.java b/transformer/src/main/java/org/apache/sling/transformer/ProcessManager.java
new file mode 100644
index 0000000..d55ce3d
--- /dev/null
+++ b/transformer/src/main/java/org/apache/sling/transformer/ProcessManager.java
@@ -0,0 +1,11 @@
+package org.apache.sling.transformer;
+
+import java.util.List;
+
+import org.apache.sling.api.SlingHttpServletRequest;
+
+public interface ProcessManager {
+
+    List<TransformationStep> getSteps(SlingHttpServletRequest request);
+
+}
\ No newline at end of file
diff --git a/transformer/src/main/java/org/apache/sling/transformer/ProcessingContext.java b/transformer/src/main/java/org/apache/sling/transformer/ProcessingContext.java
index 2720a8a..c0ce18d 100644
--- a/transformer/src/main/java/org/apache/sling/transformer/ProcessingContext.java
+++ b/transformer/src/main/java/org/apache/sling/transformer/ProcessingContext.java
@@ -39,11 +39,6 @@ public interface ProcessingContext {
     SlingHttpServletResponse getResponse();
 
     /**
-     * The content type of the response.
-     */
-    String getContentType();
-
-    /**
      * The writer.
      */
     PrintWriter getWriter() throws IOException;
diff --git a/transformer/src/main/java/org/apache/sling/transformer/Processor.java b/transformer/src/main/java/org/apache/sling/transformer/Processor.java
deleted file mode 100644
index 21bf02e..0000000
--- a/transformer/src/main/java/org/apache/sling/transformer/Processor.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.sling.transformer;
-
-import java.io.IOException;
-import java.io.PrintWriter;
-
-import org.xml.sax.ContentHandler;
-
-/**
- * A <code>Processor</code> post processes the output.
- */
-public interface Processor {
-
-    /**
-     * Initialize this component.
-     * @param context The invocation context.
-     * @param config The configuration for this component.
-     * @throws IOException If an error occurs
-     */
-    void init(ProcessingContext context,
-              ProcessorConfiguration config)
-    throws IOException;
-
-    /**
-     * Get the writer to write the output to.
-     * @return A print writer.
-     */
-    PrintWriter getWriter();
-
-    /**
-     * Get the content handler to write the output to.
-     * @return A content handler
-     */
-    ContentHandler getContentHandler();
-
-    /**
-     * Clean up the processor.
-     * This method should always be called after a processor run, regardless if it was successful or failed.
-     * @param errorOccurred Indicates if an error occurred during processing
-     */
-    void finished(boolean errorOccurred) throws IOException;
-}
diff --git a/transformer/src/main/java/org/apache/sling/transformer/ProcessorFactory.java b/transformer/src/main/java/org/apache/sling/transformer/ProcessorFactory.java
deleted file mode 100644
index c8a5d03..0000000
--- a/transformer/src/main/java/org/apache/sling/transformer/ProcessorFactory.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.sling.transformer;
-
-
-/**
- * The <code>ProcessorFactory</code> is a service which creates
- * {@link Processor}s on demand. The processor is used to rewrite
- * the generated content.
- *
- * The factory is referenced using a service property named
- * 'pipeline.type'. Each factory should have a unique value
- * for this property.
- */
-public interface ProcessorFactory {
-
-    /**
-     * Create a new processor.
-     * @return A new processor.
-     */
-    Processor createProcessor();
-}
diff --git a/transformer/src/main/java/org/apache/sling/transformer/ProcessorManager.java b/transformer/src/main/java/org/apache/sling/transformer/ProcessorManager.java
deleted file mode 100644
index 6d88809..0000000
--- a/transformer/src/main/java/org/apache/sling/transformer/ProcessorManager.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.sling.transformer;
-
-import java.util.List;
-
-/**
- * This service manages the processor configurations.
- */
-public interface ProcessorManager {
-
-    /**
-     * Return the list of currently available processor configurations.
-     * 
-     * @return The list of processor configurations in the order to check.
-     */
-    List<ProcessorConfiguration> getProcessorConfigurations();
-
-    /**
-     * Return a pipeline for a pipeline configuration.
-     * 
-     * @throws org.apache.sling.api.SlingException
-     *             If an error occurs during setup
-     */
-    Processor getProcessor(ProcessorConfiguration configuration, ProcessingContext context);
-}
diff --git a/transformer/src/main/java/org/apache/sling/transformer/TransformationStep.java b/transformer/src/main/java/org/apache/sling/transformer/TransformationStep.java
index 38d64ab..364abb7 100644
--- a/transformer/src/main/java/org/apache/sling/transformer/TransformationStep.java
+++ b/transformer/src/main/java/org/apache/sling/transformer/TransformationStep.java
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.sling.transformer;
 
 import org.apache.sling.commons.html.HtmlElement;
diff --git a/transformer/src/main/java/org/apache/sling/transformer/impl/LinkTransformer.java b/transformer/src/main/java/org/apache/sling/transformer/impl/LinkTransformer.java
index 1ac0836..415efb2 100644
--- a/transformer/src/main/java/org/apache/sling/transformer/impl/LinkTransformer.java
+++ b/transformer/src/main/java/org/apache/sling/transformer/impl/LinkTransformer.java
@@ -1,34 +1,87 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.sling.transformer.impl;
 
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.util.Base64;
+import java.util.Map;
+
 import org.apache.sling.commons.html.HtmlElement;
-import org.apache.sling.commons.html.HtmlElementType;
 import org.apache.sling.transformer.TransformationStep;
 import org.osgi.service.component.annotations.Component;
 
-@Component(property = {
-        "extension=html",
-        "path=/content/*",
-        "type=REQUEST"
-})
+@Component(property = { "extension=html", "path=/content/*", "type=REQUEST" })
 public class LinkTransformer implements TransformationStep {
 
+    private enum State {
+        IN, OUT
+    }
+
     public void handle(HtmlElement element, Process process) {
-        if (element.getType() != HtmlElementType.START_TAG) {
-            process.next(element);
-            return;
-        }
-        if (element.containsAttribute("href")) {
-            String value = element.getAttributeValue("href");
-            if (value != null && value.startsWith("/")) {
-                element.setAttribute("href", "http://www.apache.org" + value);
+
+        Map<String,Object> context = process.getContext();
+        State current = (State) context.getOrDefault("currentState", State.OUT);
+        
+        MessageDigest d = (MessageDigest) context.computeIfAbsent("hash", (value)->{
+            MessageDigest digest = null;
+            try {
+                digest = MessageDigest.getInstance("SHA-256");
+            } catch (NoSuchAlgorithmException e) {
+                e.printStackTrace();
             }
-        }
-        if (element.containsAttribute("src")) {
-            String value = element.getAttributeValue("src");
-            if (value != null && value.startsWith("/")) {
-                element.setAttribute("src", "http://www.apache.org" + value);
+            return digest;
+        });
+        
+        switch (current) {
+        case IN:
+            switch (element.getType()) {
+            case END_TAG:
+                context.put("currentState", State.OUT);
+                break;
+            case TEXT:
+                d.update(element.getValue().getBytes());
+                break;
+            default:
+                break;
+            }
+            break;
+        case OUT:
+            switch (element.getType()) {
+            case START_TAG:
+                String tag = element.getValue();
+                if (tag.equals("script") || tag.equals("style")) {
+                    context.put("currentState", State.IN);
+                }
+                break;
+            case EOF:
+                String headerValue = Base64.getEncoder().encodeToString(d.digest());
+                process.getResponse().addHeader("X-Sucks", headerValue);
+                break;
+            default:
+                break;
+
             }
+            break;
+        default:
+            break;
+
         }
+
         process.next(element);
     }
 
diff --git a/transformer/src/main/java/org/apache/sling/transformer/impl/ParserWriter.java b/transformer/src/main/java/org/apache/sling/transformer/impl/ParserWriter.java
new file mode 100644
index 0000000..f798d14
--- /dev/null
+++ b/transformer/src/main/java/org/apache/sling/transformer/impl/ParserWriter.java
@@ -0,0 +1,26 @@
+package org.apache.sling.transformer.impl;
+
+import java.io.IOException;
+import java.io.Writer;
+
+public class ParserWriter extends Writer {
+
+    @Override
+    public void write(char[] cbuf, int off, int len) throws IOException {
+        // TODO Auto-generated method stub
+
+    }
+
+    @Override
+    public void flush() throws IOException {
+        // TODO Auto-generated method stub
+
+    }
+
+    @Override
+    public void close() throws IOException {
+        // TODO Auto-generated method stub
+
+    }
+
+}
diff --git a/transformer/src/main/java/org/apache/sling/transformer/impl/Process.java b/transformer/src/main/java/org/apache/sling/transformer/impl/Process.java
index c2f7855..c10b057 100644
--- a/transformer/src/main/java/org/apache/sling/transformer/impl/Process.java
+++ b/transformer/src/main/java/org/apache/sling/transformer/impl/Process.java
@@ -13,16 +13,21 @@
  */
 package org.apache.sling.transformer.impl;
 
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.PrintWriter;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.function.BiConsumer;
-import java.util.function.Function;
 import java.util.stream.Stream;
 
+import org.apache.sling.api.SlingHttpServletRequest;
+import org.apache.sling.api.SlingHttpServletResponse;
+import org.apache.sling.commons.html.Html;
 import org.apache.sling.commons.html.HtmlElement;
+import org.apache.sling.transformer.ProcessingContext;
 import org.osgi.annotation.versioning.ProviderType;
 
 /**
@@ -35,13 +40,17 @@ import org.osgi.annotation.versioning.ProviderType;
  *
  */
 @ProviderType
-public class Process {
+public class Process implements ProcessingContext {
 
     private List<HtmlElement> list = new ArrayList<>();
     private Map<String,Object> context = new HashMap<>();
+    private SlingHttpServletRequest request;
+    private SlingHttpServletResponse response;
     
 
-    private Process() {
+    private Process(SlingHttpServletRequest request, SlingHttpServletResponse response) {
+        this.request = request;
+        this.response = response;
     }
 
     /**
@@ -52,22 +61,34 @@ public class Process {
     public void next(HtmlElement... elements) {
         Collections.addAll(list, elements);
     }
+    
+    public void next(String html) {
+        Collections.addAll(list, Html.stream(html).toArray(HtmlElement[]::new));
+    }
 
-    Function<HtmlElement, Stream<HtmlElement>> createFlatMap(BiConsumer<HtmlElement, Process> consumer, Process mapper) {
-        return element -> {
-            list.clear();
-            consumer.accept(element, mapper);
-            return list.stream();
-        };
+    public Stream<HtmlElement> getElements() {
+        return list.stream();
+    }
+    
+    public Map<String,Object> getContext(){
+        return context;
+    }
+    
+    public SlingHttpServletResponse getResponse() {
+        return response;
     }
 
-    public static Function<HtmlElement, Stream<HtmlElement>> map(BiConsumer<HtmlElement, Process> consumer) {
-        Process mapper = new Process();
-        return mapper.createFlatMap(consumer, mapper);
+    public SlingHttpServletRequest getRequest() {
+        return request;
     }
 
-    public Stream<HtmlElement> getElements() {
-        return list.stream();
+    @Override
+    public PrintWriter getWriter() throws IOException {
+        return response.getWriter();
     }
 
+    @Override
+    public OutputStream getOutputStream() throws IOException {
+        return response.getOutputStream();
+    }
 }
diff --git a/transformer/src/main/java/org/apache/sling/transformer/impl/ProcessManager.java b/transformer/src/main/java/org/apache/sling/transformer/impl/ProcessManager.java
deleted file mode 100644
index d36a879..0000000
--- a/transformer/src/main/java/org/apache/sling/transformer/impl/ProcessManager.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package org.apache.sling.transformer.impl;
-
-import java.util.Map;
-
-import org.osgi.service.component.annotations.Component;
-import org.osgi.service.component.annotations.Reference;
-
-@Component
-public class ProcessManager {
-    
-    
-
-    
-    @Reference
-    void bindProcess(Process process, Map<String, ?> properties) {
-        
-    }
-    
-    void unbindProcess(Process process) {
-        
-    }
-
-}
diff --git a/transformer/src/main/java/org/apache/sling/transformer/impl/ProcessManagerImpl.java b/transformer/src/main/java/org/apache/sling/transformer/impl/ProcessManagerImpl.java
new file mode 100644
index 0000000..8b3efea
--- /dev/null
+++ b/transformer/src/main/java/org/apache/sling/transformer/impl/ProcessManagerImpl.java
@@ -0,0 +1,83 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.transformer.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+
+import org.apache.sling.api.SlingHttpServletRequest;
+import org.apache.sling.transformer.ProcessManager;
+import org.apache.sling.transformer.TransformationStep;
+import org.osgi.framework.Constants;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Reference;
+import org.osgi.service.component.annotations.ReferenceCardinality;
+import org.osgi.service.component.annotations.ReferencePolicy;
+import org.osgi.service.component.annotations.ReferencePolicyOption;
+
+@Component
+public class ProcessManagerImpl implements ProcessManager {
+
+    // comparison in the same manner of a filter, where the highest ranking goes
+    // first
+    // in a situation where ranking is identical, then the lowest service id goes
+    // first
+    private Map<Map<String, Object>, TransformationStep> mapping = new TreeMap<>((map1, map2) -> {
+        Integer value1 = (Integer) map1.getOrDefault(Constants.SERVICE_RANKING, (Integer) 0);
+        Integer value2 = (Integer) map2.getOrDefault(Constants.SERVICE_RANKING, (Integer) 0);
+        if (value1 - value2 == 0) {
+            value1 = (Integer) map1.get(Constants.SERVICE_ID);
+            value2 = (Integer) map2.get(Constants.SERVICE_ID);
+            return value2.compareTo(value1);
+        }
+        return value1.compareTo(value2);
+    });
+
+    @Override
+    public List<TransformationStep> getSteps(SlingHttpServletRequest request) {
+        List<TransformationStep> steps = new ArrayList<>();
+        mapping.forEach((properties, step) -> {
+            if (doStep(properties, request)) {
+                steps.add(step);
+            }
+        });
+        return steps;
+    }
+
+    private boolean doStep(Map<String, Object> properties, SlingHttpServletRequest request) {
+        properties.keySet().forEach(key -> {
+
+        });
+        return true;
+    }
+
+    @Reference(service = TransformationStep.class, cardinality = ReferenceCardinality.MULTIPLE, policy = ReferencePolicy.DYNAMIC, policyOption = ReferencePolicyOption.GREEDY)
+    void bindTransformationStep(Map<String, Object> properties, TransformationStep step) {
+        mapping.put(properties, step);
+    }
+
+    void updateTransformationStep(Map<String, Object> properties, TransformationStep step) {
+        mapping.put(properties, step);
+    }
+
+    void unbindTransformationStep(Map<String, Object> properties) {
+        mapping.remove(properties);
+    }
+
+}
diff --git a/transformer/src/main/java/org/apache/sling/transformer/impl/RewriterResponse.java b/transformer/src/main/java/org/apache/sling/transformer/impl/RewriterResponse.java
deleted file mode 100644
index f21bab2..0000000
--- a/transformer/src/main/java/org/apache/sling/transformer/impl/RewriterResponse.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.sling.transformer.impl;
-
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.Writer;
-import java.util.Iterator;
-import java.util.List;
-
-import org.apache.sling.adapter.annotations.Adaptable;
-import org.apache.sling.adapter.annotations.Adapter;
-import org.apache.sling.api.SlingException;
-import org.apache.sling.api.SlingHttpServletRequest;
-import org.apache.sling.api.SlingHttpServletResponse;
-import org.apache.sling.api.wrappers.SlingHttpServletResponseWrapper;
-import org.apache.sling.transformer.ProcessingContext;
-import org.apache.sling.transformer.Processor;
-import org.apache.sling.transformer.ProcessorConfiguration;
-import org.apache.sling.transformer.ProcessorManager;
-import org.xml.sax.ContentHandler;
-
-/**
- * This response is used to pass the output through the rewriter pipeline.
- */
-@Adaptable(adaptableClass=SlingHttpServletResponse.class, adapters={
-    @Adapter(value=ContentHandler.class,
-            condition="When the response is being processed through the Sling Rewriter filter.")
-})
-class RewriterResponse
-    extends SlingHttpServletResponseWrapper {
-
-    /** The current request. */
-    private final SlingHttpServletRequest request;
-
-    /** The processor. */
-    private Processor processor;
-
-    /** wrapped rewriter/servlet writer */
-    private PrintWriter writer;
-
-    /** response content type */
-    private String contentType;
-
-    /** The processor manager. */
-    private final ProcessorManager processorManager;
-
-    /**
-     * Initializes a new instance.
-     * @param request The sling request.
-     * @param delegatee The SlingHttpServletResponse wrapped by this instance.
-     */
-    public RewriterResponse(SlingHttpServletRequest request,
-                            SlingHttpServletResponse delegatee,
-                            ProcessorManager processorManager) {
-        super(delegatee);
-        this.processorManager = processorManager;
-        this.request = request;
-    }
-
-    /**
-     * @see javax.servlet.ServletResponseWrapper#setContentType(java.lang.String)
-     */
-    public void setContentType(String type) {
-        this.contentType = type;
-        super.setContentType(type);
-    }
-
-    /**
-     * Wraps the underlying writer by a rewriter pipeline.
-     *
-     * @see javax.servlet.ServletResponseWrapper#getWriter()
-     */
-    public PrintWriter getWriter() throws IOException {
-        if ( this.processor != null && this.writer == null ) {
-            return new PrintWriter(new Writer() {
-
-                @Override
-                public void close() throws IOException {
-                    // nothing to do
-                }
-
-                @Override
-                public void flush() throws IOException {
-                    // nothing to do
-                }
-
-                @Override
-                public void write(char[] cbuf, int off, int len)
-                throws IOException {
-                    // nothing to do
-                }
-             });
-        }
-        if (writer == null) {
-            this.processor = this.getProcessor();
-            if ( this.processor != null ) {
-                this.writer = this.processor.getWriter();
-            }
-            if ( this.writer == null ) {
-                this.writer = super.getWriter();
-            }
-        }
-        return writer;
-    }
-
-    /**
-     * @see javax.servlet.ServletResponseWrapper#flushBuffer()
-     */
-    public void flushBuffer() throws IOException {
-        if (writer != null) {
-            writer.flush();
-        } else {
-            super.flushBuffer();
-        }
-    }
-
-    /**
-     * Inform this response that the request processing is finished.
-     * @throws IOException
-     */
-    public void finished(final boolean errorOccured) throws IOException {
-        if ( this.processor != null ) {
-            this.processor.finished(errorOccured);
-            this.processor = null;
-        }
-    }
-
-    /**
-     * If we have a pipeline configuration for the current request,
-     * we can adapt this response to a content handler.
-     * @see org.apache.sling.api.adapter.Adaptable#adaptTo(java.lang.Class)
-     */
-    public <T> T adaptTo(Class<T> type) {
-        if ( type == ContentHandler.class ) {
-            this.processor = this.getProcessor();
-            if ( this.processor != null ) {
-                @SuppressWarnings("unchecked")
-                final T object = (T)this.processor.getContentHandler();
-                return object;
-            }
-        }
-        return super.adaptTo(type);
-    }
-
-    /**
-     * Search the first matching processor
-     */
-    private Processor getProcessor() {
-        final ProcessingContext processorContext = new ServletProcessingContext(this.request, this, this.getSlingResponse(), this.contentType);
-        Processor found = null;
-        final List<ProcessorConfiguration> processorConfigs = this.processorManager.getProcessorConfigurations();
-        final Iterator<ProcessorConfiguration> i = processorConfigs.iterator();
-        while ( found == null && i.hasNext() ) {
-            final ProcessorConfiguration config = i.next();
-            if ( config.match(processorContext) ) {
-                try {
-                    found = this.processorManager.getProcessor(config, processorContext);
-                    this.request.getRequestProgressTracker().log("Found processor for post processing {0}", config);
-                } catch (final SlingException se) {
-                    // if an exception occurs during setup of the pipeline and we are currently
-                    // already processing an error, we ignore this!
-                    if ( processorContext.getRequest().getAttribute("javax.servlet.error.status_code") != null ) {
-                        this.request.getRequestProgressTracker().log("Ignoring found processor for post processing {0}" +
-                                " as an error occured ({1}) during setup while processing another error.", config, se);
-                    } else {
-                        throw se;
-                    }
-                }
-            }
-        }
-        return found;
-    }
-}
diff --git a/transformer/src/main/java/org/apache/sling/transformer/impl/TransformationFilter.java b/transformer/src/main/java/org/apache/sling/transformer/impl/TransformationFilter.java
index e8bd178..2aadb36 100644
--- a/transformer/src/main/java/org/apache/sling/transformer/impl/TransformationFilter.java
+++ b/transformer/src/main/java/org/apache/sling/transformer/impl/TransformationFilter.java
@@ -27,7 +27,7 @@ import javax.servlet.ServletResponse;
 
 import org.apache.sling.api.SlingHttpServletRequest;
 import org.apache.sling.api.SlingHttpServletResponse;
-import org.apache.sling.transformer.ProcessorManager;
+import org.apache.sling.transformer.TransformationStep;
 import org.osgi.framework.Constants;
 import org.osgi.service.component.annotations.Component;
 import org.osgi.service.component.annotations.Reference;
@@ -48,7 +48,7 @@ import org.osgi.service.component.annotations.Reference;
 public class TransformationFilter implements Filter {
 
     @Reference
-    private ProcessorManager pipelineManager;
+    private TransformationStep pipelineManager;
 
     /**
      * @see javax.servlet.Filter#init(javax.servlet.FilterConfig)
@@ -80,8 +80,8 @@ public class TransformationFilter implements Filter {
         final SlingHttpServletRequest slingRequest = (SlingHttpServletRequest) request;
         final SlingHttpServletResponse slingResponse = (SlingHttpServletResponse) response;
 
-        final RewriterResponse rewriterResponse =
-                new RewriterResponse(slingRequest, slingResponse, this.pipelineManager);
+        final TransformerResponse rewriterResponse =
+                new TransformerResponse(slingRequest, slingResponse);
         boolean errorOccured = true;
         try {
             chain.doFilter(request, rewriterResponse);
diff --git a/transformer/src/main/java/org/apache/sling/transformer/impl/TransformationStepWrapper.java b/transformer/src/main/java/org/apache/sling/transformer/impl/TransformationStepWrapper.java
index d0e750a..3f7641f 100644
--- a/transformer/src/main/java/org/apache/sling/transformer/impl/TransformationStepWrapper.java
+++ b/transformer/src/main/java/org/apache/sling/transformer/impl/TransformationStepWrapper.java
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.sling.transformer.impl;
 
 import java.util.function.Function;
diff --git a/transformer/src/main/java/org/apache/sling/transformer/impl/TransformerResponse.java b/transformer/src/main/java/org/apache/sling/transformer/impl/TransformerResponse.java
new file mode 100644
index 0000000..d3b5c63
--- /dev/null
+++ b/transformer/src/main/java/org/apache/sling/transformer/impl/TransformerResponse.java
@@ -0,0 +1,90 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.transformer.impl;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.Writer;
+
+import org.apache.sling.api.SlingHttpServletRequest;
+import org.apache.sling.api.SlingHttpServletResponse;
+import org.apache.sling.api.wrappers.SlingHttpServletResponseWrapper;
+
+class TransformerResponse
+    extends SlingHttpServletResponseWrapper {
+
+    /** The current request. */
+    private final SlingHttpServletRequest request;
+
+
+    /** wrapped rewriter/servlet writer */
+    private PrintWriter writer;
+
+    /** response content type */
+    private String contentType;
+
+    /**
+     * Initializes a new instance.
+     * @param request The sling request.
+     * @param delegatee The SlingHttpServletResponse wrapped by this instance.
+     */
+    public TransformerResponse(SlingHttpServletRequest request,
+                            SlingHttpServletResponse delegatee) {
+        super(delegatee);
+        this.request = request;
+    }
+
+    /**
+     * @see javax.servlet.ServletResponseWrapper#setContentType(java.lang.String)
+     */
+    public void setContentType(String type) {
+        this.contentType = type;
+        super.setContentType(type);
+    }
+
+    /**
+     * Wraps the underlying writer by a rewriter pipeline.
+     *
+     * @see javax.servlet.ServletResponseWrapper#getWriter()
+     */
+    public PrintWriter getWriter() throws IOException {
+        if ( this.writer == null ) {
+            this.writer = super.getWriter();
+        }
+        return writer;
+    }
+
+    /**
+     * @see javax.servlet.ServletResponseWrapper#flushBuffer()
+     */
+    public void flushBuffer() throws IOException {
+        if (writer != null) {
+            writer.flush();
+        } else {
+            super.flushBuffer();
+        }
+    }
+
+    /**
+     * Inform this response that the request processing is finished.
+     * @throws IOException
+     */
+    public void finished(final boolean errorOccured) throws IOException {
+
+    }
+
+}
diff --git a/transformer/src/main/java/org/apache/sling/transformer/package-info.java b/transformer/src/main/java/org/apache/sling/transformer/package-info.java
deleted file mode 100644
index 7d911d9..0000000
--- a/transformer/src/main/java/org/apache/sling/transformer/package-info.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-@Version("1.0.0")
-package org.apache.sling.transformer;
-
-import org.osgi.annotation.versioning.Version;
-
diff --git a/transformer/src/test/java/org/apache/sling/rewriter/it/tests/EmojiIT.java b/transformer/src/test/java/org/apache/sling/rewriter/it/tests/EmojiIT.java
deleted file mode 100644
index f24a299..0000000
--- a/transformer/src/test/java/org/apache/sling/rewriter/it/tests/EmojiIT.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.sling.rewriter.it.tests;
-
-import java.io.IOException;
-
-import org.jsoup.Jsoup;
-import org.jsoup.nodes.Document;
-import org.jsoup.nodes.Element;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.ops4j.pax.exam.junit.PaxExam;
-import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
-import org.ops4j.pax.exam.spi.reactors.PerClass;
-
-import static org.hamcrest.Matchers.is;
-import static org.junit.Assert.assertThat;
-
-@RunWith(PaxExam.class)
-@ExamReactorStrategy(PerClass.class)
-public class EmojiIT extends RewriterTestSupport {
-
-    private Document document;
-
-    @Before
-    public void setup() throws IOException {
-        final String url = String.format("http://localhost:%s/rewriter/emoji.html", httpPort());
-        document = Jsoup.connect(url).get();
-    }
-
-    @Test
-    public void testTitle() throws IOException {
-        final String title = document.title();
-        assertThat(title, is("emoji test"));
-    }
-
-    @Test
-    public void testContent() throws IOException {
-        final Element content = document.getElementById("content");
-        assertThat(content.text(), is("\u2602\uD83D\uDE03 \uD83C\uDF40 \uD83C\uDF40 \uD83C\uDF40 \uD83D\uDE01 \uD83C\uDF40\uD83C\uDF40"));
-    }
-
-}
diff --git a/transformer/src/test/java/org/apache/sling/transformer/impl/ProcessorConfigurationImplTest.java b/transformer/src/test/java/org/apache/sling/transformer/impl/ProcessorConfigurationImplTest.java
deleted file mode 100644
index ab22665..0000000
--- a/transformer/src/test/java/org/apache/sling/transformer/impl/ProcessorConfigurationImplTest.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with this
- * work for additional information regarding copyright ownership. The ASF
- * licenses this file to You under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- * http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package org.apache.sling.transformer.impl;
-
-import static org.apache.sling.transformer.impl.ProcessorConfigurationImpl.PROPERTY_CONTENT_TYPES;
-import static org.apache.sling.transformer.impl.ProcessorConfigurationImpl.PROPERTY_EXTENSIONS;
-import static org.apache.sling.transformer.impl.ProcessorConfigurationImpl.PROPERTY_PATHS;
-import static org.apache.sling.transformer.impl.ProcessorConfigurationImpl.PROPERTY_RESOURCE_TYPES;
-import static org.apache.sling.transformer.impl.ProcessorConfigurationImpl.PROPERTY_SELECTORS;
-import static org.apache.sling.transformer.impl.ProcessorConfigurationImpl.PROPERTY_UNWRAP_RESOURCES;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.when;
-
-import java.util.Map;
-
-import org.apache.sling.api.resource.Resource;
-import org.apache.sling.api.resource.ResourceWrapper;
-import org.apache.sling.testing.mock.sling.junit.SlingContext;
-import org.apache.sling.transformer.ProcessingContext;
-import org.apache.sling.transformer.impl.ProcessorConfigurationImpl;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.mockito.runners.MockitoJUnitRunner;
-
-import com.google.common.collect.ImmutableMap;
-
-@RunWith(MockitoJUnitRunner.class)
-public class ProcessorConfigurationImplTest {
-    
-    @Rule
-    public SlingContext context = new SlingContext();
-    
-    @Mock
-    private ProcessingContext processingContext;
-
-    @Before
-    public void setup() {
-        when(processingContext.getContentType()).thenReturn("text/html");
-        when(processingContext.getRequest()).thenReturn(context.request());
-        when(processingContext.getResponse()).thenReturn(context.response());
-    }
-    
-    private ProcessorConfigurationImpl buildConfig(Map<String,Object> configProps) {
-        Resource configResoruce = context.create().resource("/apps/myapp/rewriter/config", configProps);
-        return new ProcessorConfigurationImpl(configResoruce);
-    }
-    
-    private void assertMatch(Map<String,Object> configProps) {
-        assertTrue(buildConfig(configProps).match(processingContext));
-    }
-
-    private void assertNoMatch(Map<String,Object> configProps) {
-        assertFalse(buildConfig(configProps).match(processingContext));
-    }
-
-    @Test
-    public void testMatchContentTypeMismatch() {
-        assertNoMatch(ImmutableMap.<String,Object>of(PROPERTY_CONTENT_TYPES, new String[] {"text/xml", "text/plain"}));
-    }
-
-    @Test
-    public void testMatchAtLeastOneContentType() {
-        assertMatch(ImmutableMap.<String,Object>of(PROPERTY_CONTENT_TYPES, new String[] {"text/html", "text/xml"}));
-    }
-
-    @Test
-    public void testMatchAnyContentType() {
-        assertMatch(ImmutableMap.<String,Object>of(PROPERTY_CONTENT_TYPES, new String[] {"text/xml", "*"}));
-    }
-
-    @Test
-    public void testMatchExtensionMismatch() {
-        context.requestPathInfo().setExtension("html");
-        assertNoMatch(ImmutableMap.<String,Object>of(PROPERTY_EXTENSIONS, new String[] {"xml","txt"}));
-    }
-
-    @Test
-    public void testMatchAtLeastOneExtension() {
-        context.requestPathInfo().setExtension("html");
-        assertMatch(ImmutableMap.<String,Object>of(PROPERTY_EXTENSIONS, new String[] {"xml","html"}));
-    }
-
-    @Test
-    public void testMatchResourceTypeMismatch() {
-        context.currentResource(context.create().resource("/content/test",
-                ImmutableMap.<String, Object>of("sling:resourceType", "type/1")));
-        assertNoMatch(ImmutableMap.<String,Object>of(PROPERTY_RESOURCE_TYPES, new String[] {"type/2","type/3"}));
-    }
-
-    @Test
-    public void testMatchAtLeastOneResourceType() {
-        context.currentResource(context.create().resource("/content/test",
-                ImmutableMap.<String, Object>of("sling:resourceType", "type/1")));
-        assertMatch(ImmutableMap.<String,Object>of(PROPERTY_RESOURCE_TYPES, new String[] {"type/1","type/2"}));
-    }
-
-    @Test
-    public void testMatchAtLeastOneResourceTypeWithResourceWrapper_UnwrapDisabled() {
-        Resource resource = context.create().resource("/content/test", ImmutableMap.<String, Object>of("sling:resourceType", "type/1"));
-        
-        // overwrite resource type via ResourceWrapper
-        Resource resourceWrapper = new ResourceWrapper(resource) {
-            @Override
-            public String getResourceType() { return "/type/override/1"; }
-        };
-        context.currentResource(resourceWrapper);
-        
-        assertNoMatch(ImmutableMap.<String,Object>of(PROPERTY_RESOURCE_TYPES, new String[] {"type/1","type/2"}));
-    }
-
-    @Test
-    public void testMatchAtLeastOneResourceTypeWithResourceWrapper_UnwrapEnabled() {
-        Resource resource = context.create().resource("/content/test", ImmutableMap.<String, Object>of("sling:resourceType", "type/1"));
-        
-        // overwrite resource type via ResourceWrapper
-        Resource resourceWrapper = new ResourceWrapper(resource) {
-            @Override
-            public String getResourceType() { return "/type/override/1"; }
-        };
-        context.currentResource(resourceWrapper);
-        
-        assertMatch(ImmutableMap.<String,Object>of(PROPERTY_RESOURCE_TYPES, new String[] {"type/1","type/2"},
-                PROPERTY_UNWRAP_RESOURCES, true));
-    }
-
-    @Test
-    public void testMatchPathMismatch() {
-        context.requestPathInfo().setResourcePath("/content/test");
-        assertNoMatch(ImmutableMap.<String,Object>of(PROPERTY_PATHS, new String[] {"/apps","/var"}));
-    }
-
-    @Test
-    public void testMatchAtLeastOnePath() {
-        context.requestPathInfo().setResourcePath("/content/test");
-        assertMatch(ImmutableMap.<String,Object>of(PROPERTY_PATHS, new String[] {"/apps","/content"}));
-    }
-
-    @Test
-    public void testMatchAnyPath() {
-        context.requestPathInfo().setResourcePath("/content/test");
-        assertMatch(ImmutableMap.<String,Object>of(PROPERTY_PATHS, new String[] {"/apps","*"}));
-    }
-
-    @Test
-    public void testMatchSelectorRequired() {
-        assertNoMatch(ImmutableMap.<String,Object>of(PROPERTY_SELECTORS, new String[] {"sel"}));
-    }
-
-    @Test
-    public void testMatchSelectorMismatch() {
-        context.requestPathInfo().setSelectorString("sel1.sel2");
-        assertNoMatch(ImmutableMap.<String,Object>of(PROPERTY_SELECTORS, new String[] {"sel3"}));
-    }
-
-    @Test
-    public void testMatchAtLeastOneSelector() {
-        context.requestPathInfo().setSelectorString("sel1.sel2");
-        assertMatch(ImmutableMap.<String,Object>of(PROPERTY_SELECTORS, new String[] {"sel1"}));
-    }
-
-    @Test
-    public void testNoMatchRequestAttribute() {
-        context.request().setAttribute(ProcessorConfigurationImpl.ATTR_PIPELINE, "config2");
-        context.requestPathInfo().setResourcePath("/content/test");
-        assertNoMatch(ImmutableMap.<String,Object>of(PROPERTY_PATHS, new String[] {"/apps","/content"}));
-    }
-
-    @Test
-    public void testNoMatchRequestAttributeIfConditionsDoNotMatch() {
-        context.request().setAttribute(ProcessorConfigurationImpl.ATTR_PIPELINE, "config");
-        context.requestPathInfo().setResourcePath("/content/test");
-        assertNoMatch(ImmutableMap.<String,Object>of(PROPERTY_PATHS, new String[] {"/apps"}));
-    }
-
-}


[sling-whiteboard] 03/03: removed old response

Posted by je...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jeb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-whiteboard.git

commit 9c7deff3f578ba249db32ed5f16259fc3600c539
Author: JE Bailey <ja...@sas.com>
AuthorDate: Wed Aug 21 09:49:56 2019 -0400

    removed old response
---
 .../sling/transformer/impl/RewriterResponse.java   | 116 ---------------------
 1 file changed, 116 deletions(-)

diff --git a/transformer/src/main/java/org/apache/sling/transformer/impl/RewriterResponse.java b/transformer/src/main/java/org/apache/sling/transformer/impl/RewriterResponse.java
deleted file mode 100644
index 70febb8..0000000
--- a/transformer/src/main/java/org/apache/sling/transformer/impl/RewriterResponse.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.sling.transformer.impl;
-
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.Writer;
-
-import org.apache.sling.api.SlingHttpServletRequest;
-import org.apache.sling.api.SlingHttpServletResponse;
-import org.apache.sling.api.wrappers.SlingHttpServletResponseWrapper;
-import org.apache.sling.transformer.Processor;
-
-class RewriterResponse
-    extends SlingHttpServletResponseWrapper {
-
-    /** The current request. */
-    private final SlingHttpServletRequest request;
-
-    /** The processor. */
-    private Processor processor;
-
-    /** wrapped rewriter/servlet writer */
-    private PrintWriter writer;
-
-    /** response content type */
-    private String contentType;
-
-    /**
-     * Initializes a new instance.
-     * @param request The sling request.
-     * @param delegatee The SlingHttpServletResponse wrapped by this instance.
-     */
-    public RewriterResponse(SlingHttpServletRequest request,
-                            SlingHttpServletResponse delegatee) {
-        super(delegatee);
-        this.request = request;
-    }
-
-    /**
-     * @see javax.servlet.ServletResponseWrapper#setContentType(java.lang.String)
-     */
-    public void setContentType(String type) {
-        this.contentType = type;
-        super.setContentType(type);
-    }
-
-    /**
-     * Wraps the underlying writer by a rewriter pipeline.
-     *
-     * @see javax.servlet.ServletResponseWrapper#getWriter()
-     */
-    public PrintWriter getWriter() throws IOException {
-        if ( this.processor != null && this.writer == null ) {
-            return new PrintWriter(new Writer() {
-
-                @Override
-                public void close() throws IOException {
-                    // nothing to do
-                }
-
-                @Override
-                public void flush() throws IOException {
-                    // nothing to do
-                }
-
-                @Override
-                public void write(char[] cbuf, int off, int len)
-                throws IOException {
-                    // nothing to do
-                }
-             });
-        }
-        if (writer == null) {
-       
-        }
-        return writer;
-    }
-
-    /**
-     * @see javax.servlet.ServletResponseWrapper#flushBuffer()
-     */
-    public void flushBuffer() throws IOException {
-        if (writer != null) {
-            writer.flush();
-        } else {
-            super.flushBuffer();
-        }
-    }
-
-    /**
-     * Inform this response that the request processing is finished.
-     * @throws IOException
-     */
-    public void finished(final boolean errorOccured) throws IOException {
-        if ( this.processor != null ) {
-            this.processor.finished(errorOccured);
-            this.processor = null;
-        }
-    }
-
-}