nifi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcgil...@apache.org
Subject incubator-nifi git commit: NIFI-547: - Setting the default charset in the content viewer page. - Using the content stream when formatting json.
Date Thu, 18 Jun 2015 02:59:15 GMT
Repository: incubator-nifi
Updated Branches:
  refs/heads/develop 0af9c75d7 -> 66365b0e1


NIFI-547:
- Setting the default charset in the content viewer page.
- Using the content stream when formatting json.

Project: http://git-wip-us.apache.org/repos/asf/incubator-nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-nifi/commit/66365b0e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-nifi/tree/66365b0e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-nifi/diff/66365b0e

Branch: refs/heads/develop
Commit: 66365b0e1d1a290722bd1a4cfb5821b27fb68648
Parents: 0af9c75
Author: Matt Gilman <matt.c.gilman@gmail.com>
Authored: Wed Jun 17 22:43:33 2015 -0400
Committer: Matt Gilman <matt.c.gilman@gmail.com>
Committed: Wed Jun 17 22:43:33 2015 -0400

----------------------------------------------------------------------
 .../java/org/apache/nifi/web/ContentViewerController.java     | 3 +++
 .../nifi-standard-bundle/nifi-standard-content-viewer/pom.xml | 5 ++---
 .../org/apache/nifi/web/StandardContentViewerController.java  | 4 ++--
 .../nifi-standard-bundle/nifi-standard-processors/pom.xml     | 1 -
 nifi/nifi-nar-bundles/nifi-standard-bundle/pom.xml            | 7 ++++++-
 5 files changed, 13 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/66365b0e/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-content-viewer/src/main/java/org/apache/nifi/web/ContentViewerController.java
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-content-viewer/src/main/java/org/apache/nifi/web/ContentViewerController.java
b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-content-viewer/src/main/java/org/apache/nifi/web/ContentViewerController.java
index 984b8a9..a6f6aec 100644
--- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-content-viewer/src/main/java/org/apache/nifi/web/ContentViewerController.java
+++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-content-viewer/src/main/java/org/apache/nifi/web/ContentViewerController.java
@@ -64,6 +64,9 @@ public class ContentViewerController extends HttpServlet {
      */
     @Override
     protected void doGet(final HttpServletRequest request, final HttpServletResponse response)
throws ServletException, IOException {
+        // specify the charset in a response header
+        response.addHeader("Content-Type", "text/html; charset=UTF-8");
+
         // get the content
         final ServletContext servletContext = request.getServletContext();
         final ContentAccess contentAccess = (ContentAccess) servletContext.getAttribute("nifi-content-access");

http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/66365b0e/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-content-viewer/pom.xml
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-content-viewer/pom.xml
b/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-content-viewer/pom.xml
index f5fdc3b..ed97131 100644
--- a/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-content-viewer/pom.xml
+++ b/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-content-viewer/pom.xml
@@ -44,9 +44,8 @@
             <scope>provided</scope>
         </dependency>
         <dependency>
-            <groupId>org.codehaus.jackson</groupId>
-            <artifactId>jackson-mapper-asl</artifactId>
-            <version>1.9.13</version>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-databind</artifactId>
         </dependency>
         <dependency>
             <groupId>org.apache.nifi</groupId>

http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/66365b0e/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-content-viewer/src/main/java/org/apache/nifi/web/StandardContentViewerController.java
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-content-viewer/src/main/java/org/apache/nifi/web/StandardContentViewerController.java
b/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-content-viewer/src/main/java/org/apache/nifi/web/StandardContentViewerController.java
index 98f7683..a85c450 100644
--- a/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-content-viewer/src/main/java/org/apache/nifi/web/StandardContentViewerController.java
+++ b/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-content-viewer/src/main/java/org/apache/nifi/web/StandardContentViewerController.java
@@ -16,6 +16,7 @@
  */
 package org.apache.nifi.web;
 
+import com.fasterxml.jackson.databind.ObjectMapper;
 import java.io.IOException;
 import java.io.PrintWriter;
 import java.io.StringWriter;
@@ -33,7 +34,6 @@ import javax.xml.transform.TransformerFactoryConfigurationError;
 import javax.xml.transform.stream.StreamResult;
 import javax.xml.transform.stream.StreamSource;
 import org.apache.nifi.web.ViewableContent.DisplayMode;
-import org.codehaus.jackson.map.ObjectMapper;
 
 @WebServlet(name = "StandardContentViewer", urlPatterns = {"/view-content"})
 public class StandardContentViewerController extends HttpServlet {
@@ -60,7 +60,7 @@ public class StandardContentViewerController extends HttpServlet {
                 if ("application/json".equals(content.getContentType())) {
                     // format json
                     final ObjectMapper mapper = new ObjectMapper();
-                    final Object objectJson = mapper.readValue(content.getContent(), Object.class);
+                    final Object objectJson = mapper.readValue(content.getContentStream(),
Object.class);
                     formatted = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(objectJson);
                 } else if ("application/xml".equals(content.getContentType())) {
                     // format xml

http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/66365b0e/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/pom.xml
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/pom.xml b/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/pom.xml
index aa8bfbe..d8cd3d2 100644
--- a/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/pom.xml
+++ b/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/pom.xml
@@ -172,7 +172,6 @@
 		<dependency>
 			<groupId>com.fasterxml.jackson.core</groupId>
 			<artifactId>jackson-databind</artifactId>
-			<version>2.4.5</version>
 		</dependency>
 		<dependency>
 			<groupId>org.apache.avro</groupId>

http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/66365b0e/nifi/nifi-nar-bundles/nifi-standard-bundle/pom.xml
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-standard-bundle/pom.xml b/nifi/nifi-nar-bundles/nifi-standard-bundle/pom.xml
index 55af032..e7eef65 100644
--- a/nifi/nifi-nar-bundles/nifi-standard-bundle/pom.xml
+++ b/nifi/nifi-nar-bundles/nifi-standard-bundle/pom.xml
@@ -29,7 +29,7 @@
         <module>nifi-standard-reporting-tasks</module>
         <module>nifi-standard-content-viewer</module>
         <module>nifi-standard-nar</module>
-  </modules>
+    </modules>
     <dependencyManagement>
         <dependencies>
             <dependency>
@@ -53,6 +53,11 @@
                 <type>war</type>
                 <version>0.2.0-incubating-SNAPSHOT</version>
             </dependency>
+            <dependency>
+                <groupId>com.fasterxml.jackson.core</groupId>
+                <artifactId>jackson-databind</artifactId>
+                <version>2.4.5</version>
+            </dependency>
         </dependencies>
     </dependencyManagement>
 


Mime
View raw message