modules/enterprise/gui/rest-war/src/main/java/org/rhq/enterprise/rest/JsonPFilter.java |
23 ++++------
modules/helpers/pluginAnnotations/pom.xml |
4 -
modules/helpers/pluginGen/pom.xml |
20 +++++++-
modules/helpers/pluginGen/src/main/resources/descriptor.ftl |
4 +
modules/helpers/pluginGen/src/main/resources/pom.ftl |
6 +-
5 files changed, 38 insertions(+), 19 deletions(-)
New commits:
commit 07e921660b7336a96593c71b3bb57624f7645396
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Wed Jul 10 09:05:05 2013 +0200
Don't bail out on empty plugin description. Bump default pom version
diff --git a/modules/helpers/pluginGen/src/main/resources/descriptor.ftl
b/modules/helpers/pluginGen/src/main/resources/descriptor.ftl
index a62af11..85195e8 100644
--- a/modules/helpers/pluginGen/src/main/resources/descriptor.ftl
+++ b/modules/helpers/pluginGen/src/main/resources/descriptor.ftl
@@ -22,7 +22,11 @@
<?xml version="1.0"?>
<plugin name="${props.pluginName}"
displayName="${props.pluginName}Plugin"
+<#if props.pluginDescription??>
description="${props.pluginDescription}"
+<#else>
+ description="TODO provide a description for the plugin"
+</#if>
<#if props.usePluginLifecycleListenerApi>
pluginLifecycleListener="${props.componentClass}"
</#if>
diff --git a/modules/helpers/pluginGen/src/main/resources/pom.ftl
b/modules/helpers/pluginGen/src/main/resources/pom.ftl
index 2434ddd..01daca1 100644
--- a/modules/helpers/pluginGen/src/main/resources/pom.ftl
+++ b/modules/helpers/pluginGen/src/main/resources/pom.ftl
@@ -31,7 +31,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version><#if props.rhqVersion??>${props.rhqVersion}<#else
>4.5.0-SNAPSHOT</#if></version><!-- TODO adjust RHQ version -->
+ <version><#if props.rhqVersion??>${props.rhqVersion}<#else
>4.9.0-SNAPSHOT</#if></version><!-- TODO adjust RHQ version -->
</parent>
<groupId>org.rhq</groupId>
@@ -49,8 +49,8 @@
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
- <source>1.5</source>
- <target>1.5</target>
+ <source>1.6</source>
+ <target>1.6</target>
</configuration>
</plugin>
commit 206bc37502ef973145cf689b3a077722bb8bf2e9
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Wed Jul 10 08:49:08 2013 +0200
BZ 981809 Disable compression when wrapping. Also some cleanup in the file.
diff --git
a/modules/enterprise/gui/rest-war/src/main/java/org/rhq/enterprise/rest/JsonPFilter.java
b/modules/enterprise/gui/rest-war/src/main/java/org/rhq/enterprise/rest/JsonPFilter.java
index 3a785fd..8d43f03 100644
---
a/modules/enterprise/gui/rest-war/src/main/java/org/rhq/enterprise/rest/JsonPFilter.java
+++
b/modules/enterprise/gui/rest-war/src/main/java/org/rhq/enterprise/rest/JsonPFilter.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2012 Red Hat, Inc.
+ * Copyright (C) 2005-2013 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -13,8 +13,8 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
package org.rhq.enterprise.rest;
@@ -45,6 +45,9 @@ import javax.servlet.http.HttpServletResponseWrapper;
/**
* A filter to wrap json answers as jsonp
+ * For this to happen, the user has to pass
?<filter.jsonp.callback>=<name> in the url like
+ *
<pre>http://localhost:7080/rest/metric/data/10001/raw.json?jsonp=foo</pre>
+ * The <filter.jsonp.callback> is defined in web.xml and defaults to
'jsonp'.
* @author Heiko W. Rupp
*/
public class JsonPFilter implements Filter {
@@ -132,7 +135,6 @@ public class JsonPFilter implements Filter {
private static class JsonPRequestWrapper extends HttpServletRequestWrapper {
int contentLength;
BufferedReader reader;
- String method;
ByteArrayInputStream bais;
Map<String, String> headers = new HashMap<String, String>();
@@ -147,6 +149,11 @@ public class JsonPFilter implements Filter {
Enumeration headers = request.getHeaderNames();
while (headers.hasMoreElements()) {
String key = (String) headers.nextElement();
+ if (key.equalsIgnoreCase("Accept-Encoding")) {
+ // Filter Content codings like compression, as we would end up
+ // with compressed inner data and uncompressed wrapper
+ continue;
+ }
String value = request.getHeader(key);
this.headers.put(key, value);
}
@@ -157,14 +164,6 @@ public class JsonPFilter implements Filter {
}
-/*
- public void setBody(String body) {
- bais = new ByteArrayInputStream(body.getBytes());
- contentLength = body.length();
- headers.put("content-length", Integer.toString(contentLength));
- }
-*/
-
@Override
public BufferedReader getReader() throws IOException {
reader = new BufferedReader(new InputStreamReader(bais));
commit 1d75e54e136107c19d0b1163feb69e64993f7944
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Tue Jul 9 17:46:46 2013 +0200
Bump pom versions. Allow to start the generator via mvn exec:java
diff --git a/modules/helpers/pluginAnnotations/pom.xml
b/modules/helpers/pluginAnnotations/pom.xml
index be5e976..7ce1859 100644
--- a/modules/helpers/pluginAnnotations/pom.xml
+++ b/modules/helpers/pluginAnnotations/pom.xml
@@ -7,14 +7,14 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.9.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>rhq-pluginAnnotations</artifactId>
<packaging>jar</packaging>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.9.0-SNAPSHOT</version>
<name>RHQ plugin annotations</name>
<description>Annotations to help generate plugin
descriptors</description>
diff --git a/modules/helpers/pluginGen/pom.xml b/modules/helpers/pluginGen/pom.xml
index fb2cce6..e9a5e29 100644
--- a/modules/helpers/pluginGen/pom.xml
+++ b/modules/helpers/pluginGen/pom.xml
@@ -7,14 +7,14 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.9.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>rhq-pluginGen</artifactId>
<packaging>jar</packaging>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.9.0-SNAPSHOT</version>
<name>RHQ plugin generator</name>
<description>Helper to generate plugin skeletons</description>
@@ -62,6 +62,22 @@
<version>2.1</version>
</plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <version>1.2.1</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>java</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <mainClass>org.rhq.helpers.pluginGen.PluginGen</mainClass>
+ </configuration>
+ </plugin>
+
</plugins>
</build>