Author: orudyy
Date: Thu Nov 26 14:31:49 2015
New Revision: 1716688
URL: http://svn.apache.org/viewvc?rev=1716688&view=rev
Log:
QPID-6911 : Api docs for Broker not being displayed
------------------------------------------------------------------------
Merged from trunk with command:
svn merge -c r1716474 https://svn.apache.org/repos/asf/qpid/java/trunk
Modified:
qpid/java/branches/6.0.x/ (props changed)
qpid/java/branches/6.0.x/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObjectTypeRegistry.java
qpid/java/branches/6.0.x/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagement.java
qpid/java/branches/6.0.x/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/ApiDocsServlet.java
Propchange: qpid/java/branches/6.0.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Nov 26 14:31:49 2015
@@ -9,5 +9,5 @@
/qpid/branches/java-broker-vhost-refactor/java:1493674-1494547
/qpid/branches/java-network-refactor/qpid/java:805429-821809
/qpid/branches/qpid-2935/qpid/java:1061302-1072333
-/qpid/java/trunk:1715445-1715447,1715586,1715940,1716086-1716087,1716127-1716128,1716141,1716153,1716155,1716194,1716204,1716209,1716227,1716277,1716357,1716368,1716370,1716374,1716432,1716444-1716445,1716455,1716461
+/qpid/java/trunk:1715445-1715447,1715586,1715940,1716086-1716087,1716127-1716128,1716141,1716153,1716155,1716194,1716204,1716209,1716227,1716277,1716357,1716368,1716370,1716374,1716432,1716444-1716445,1716455,1716461,1716474
/qpid/trunk/qpid:796646-796653
Modified:
qpid/java/branches/6.0.x/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObjectTypeRegistry.java
URL:
http://svn.apache.org/viewvc/qpid/java/branches/6.0.x/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObjectTypeRegistry.java?rev=1716688&r1=1716687&r2=1716688&view=diff
==============================================================================
---
qpid/java/branches/6.0.x/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObjectTypeRegistry.java
(original)
+++
qpid/java/branches/6.0.x/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObjectTypeRegistry.java
Thu Nov 26 14:31:49 2015
@@ -432,7 +432,7 @@ public class ConfiguredObjectTypeRegistr
}
}
}
- if(typeClass == null && typeName.equals(category.getSimpleName()))
+ if(typeClass == null &&
typeName.equals(category.getSimpleName().toLowerCase()))
{
typeClass = category;
}
Modified:
qpid/java/branches/6.0.x/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagement.java
URL:
http://svn.apache.org/viewvc/qpid/java/branches/6.0.x/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagement.java?rev=1716688&r1=1716687&r2=1716688&view=diff
==============================================================================
---
qpid/java/branches/6.0.x/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagement.java
(original)
+++
qpid/java/branches/6.0.x/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagement.java
Thu Nov 26 14:31:49 2015
@@ -262,7 +262,7 @@ public class HttpManagement extends Abst
addRestServlet(root, Broker.class);
- ServletHolder apiDocsServlet = new ServletHolder(new
ApiDocsServlet(getModel(), Collections.<String>emptyList()));
+ ServletHolder apiDocsServlet = new ServletHolder(new
ApiDocsServlet(getModel()));
final ServletHolder rewriteSerlvet = new ServletHolder(new
RewriteServlet("^(.*)$", "$1/"));
for(String path : new String[]{"/apidocs", "/apidocs/latest",
"/apidocs/"+getLatestSupportedVersion()})
{
Modified:
qpid/java/branches/6.0.x/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/ApiDocsServlet.java
URL:
http://svn.apache.org/viewvc/qpid/java/branches/6.0.x/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/ApiDocsServlet.java?rev=1716688&r1=1716687&r2=1716688&view=diff
==============================================================================
---
qpid/java/branches/6.0.x/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/ApiDocsServlet.java
(original)
+++
qpid/java/branches/6.0.x/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/ApiDocsServlet.java
Thu Nov 26 14:31:49 2015
@@ -58,28 +58,28 @@ public class ApiDocsServlet extends Abst
private static final Map<Class<? extends ConfiguredObject>, List<String>>
REGISTERED_CLASSES = new TreeMap<>(CLASS_COMPARATOR);
+ public ApiDocsServlet(final Model model)
+ {
+ super();
+ _model = model;
+ _hierarchy = null;
+ _types = null;
+ }
+
public ApiDocsServlet(final Model model, final List<String>
registeredPaths, Class<? extends ConfiguredObject>... hierarchy)
{
super();
_model = model;
_hierarchy = hierarchy;
- _types = hierarchy.length == 0 ? null : new
ArrayList<>(_model.getTypeRegistry().getTypeSpecialisations(getConfiguredClass()));
- if(_types != null)
+ _types = new
ArrayList<>(_model.getTypeRegistry().getTypeSpecialisations(getConfiguredClass()));
+ Collections.sort(_types, CLASS_COMPARATOR);
+ List<String> paths = REGISTERED_CLASSES.get(getConfiguredClass());
+ if (paths == null)
{
- Collections.sort(_types, CLASS_COMPARATOR);
+ paths = new ArrayList<>();
+ REGISTERED_CLASSES.put(getConfiguredClass(), paths);
}
- if(_hierarchy.length != 0)
- {
- List<String> paths = REGISTERED_CLASSES.get(getConfiguredClass());
- if(paths == null)
- {
- paths = new ArrayList<>();
- REGISTERED_CLASSES.put(getConfiguredClass(), paths);
- }
- paths.addAll(registeredPaths);
-
- }
-
+ paths.addAll(registeredPaths);
}
@Override
@@ -94,7 +94,7 @@ public class ApiDocsServlet extends Abst
writePreamble(writer);
writeHead(writer);
- if(_hierarchy.length == 0)
+ if(_hierarchy == null)
{
writer.println("<table class=\"api\">");
writer.println("<thead>");
@@ -160,7 +160,7 @@ public class ApiDocsServlet extends Abst
private void writeTitle(final PrintWriter writer)
{
writer.print("<title>");
- if(_hierarchy.length == 0)
+ if(_hierarchy == null)
{
writer.print("Qpid API");
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]