incubator-ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ey...@apache.org
Subject svn commit: r1189584 - in /incubator/ambari/trunk: ./ controller/src/main/java/org/apache/ambari/controller/rest/config/ controller/src/main/java/org/apache/ambari/controller/rest/resources/ controller/src/main/webapps/
Date Thu, 27 Oct 2011 02:26:57 GMT
Author: eyang
Date: Thu Oct 27 02:26:56 2011
New Revision: 1189584

URL: http://svn.apache.org/viewvc?rev=1189584&view=rev
Log:
AMBARI-107. Added REST example for javadoc generation. (Eric Yang)

Added:
    incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/controller/rest/config/Examples.java
Modified:
    incubator/ambari/trunk/CHANGES.txt
    incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/controller/rest/resources/ClusterResource.java
    incubator/ambari/trunk/controller/src/main/webapps/wadl.xsl

Modified: incubator/ambari/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1189584&r1=1189583&r2=1189584&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Thu Oct 27 02:26:56 2011
@@ -2,6 +2,8 @@ Ambari Change log
 
 Release 0.1.0 - unreleased
 
+  AMBARI-107. Added reporting section to aggregate javadocs. (Eric Yang)
+
   AMBARI-109. Minor fixes to the CLI documentation. (omalley)
 
   AMBARI-108. Change name blueprint to stack (vgogate)

Added: incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/controller/rest/config/Examples.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/controller/rest/config/Examples.java?rev=1189584&view=auto
==============================================================================
--- incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/controller/rest/config/Examples.java
(added)
+++ incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/controller/rest/config/Examples.java
Thu Oct 27 02:26:56 2011
@@ -0,0 +1,14 @@
+package org.apache.ambari.controller.rest.config;
+
+import org.apache.ambari.common.rest.entities.ClusterDefinition;
+import org.apache.ambari.common.rest.entities.ClusterInformation;
+
+public class Examples {
+	public static final ClusterInformation CLUSTER_INFORMATION = new ClusterInformation();
+	public static final ClusterDefinition CLUSTER_DEFINITION = new ClusterDefinition();
+	
+	static {
+		CLUSTER_DEFINITION.setName("example-definition");
+		CLUSTER_INFORMATION.setDefinition(CLUSTER_DEFINITION);
+	}
+}

Modified: incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/controller/rest/resources/ClusterResource.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/controller/rest/resources/ClusterResource.java?rev=1189584&r1=1189583&r2=1189584&view=diff
==============================================================================
--- incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/controller/rest/resources/ClusterResource.java
(original)
+++ incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/controller/rest/resources/ClusterResource.java
Thu Oct 27 02:26:56 2011
@@ -44,7 +44,7 @@ import org.apache.ambari.controller.Clus
 import org.apache.ambari.controller.Clusters;
 import org.apache.ambari.controller.ExceptionResponse;
 import org.apache.ambari.controller.Nodes;
-
+import org.apache.ambari.controller.rest.config.Examples;
 /** 
  * ClusterResource represents a Hadoop Cluster in a data center.
  *  
@@ -57,9 +57,9 @@ public class ClusterResource {
      * and the cluster state.
      * 
      *  @response.representation.200.doc        Get the definition & current state of
the specified Hadoop cluster
-     *  @response.representation.200.mediaType  application/json
+     *  @response.representation.200.mediaType  application/json application/xml
+     *  @response.representation.200.example    {@link Examples#CLUSTER_INFORMATION}
      *  @response.representation.404.doc        Specified cluster does not exist
-     *  @response.representation.200.example    ClusterInformation
      *  
      *  @param      clusterName                 Name of the cluster; Each cluster is identified
w/ unique name
      *  @return                                 Returns the Cluster Information

Modified: incubator/ambari/trunk/controller/src/main/webapps/wadl.xsl
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/controller/src/main/webapps/wadl.xsl?rev=1189584&r1=1189583&r2=1189584&view=diff
==============================================================================
--- incubator/ambari/trunk/controller/src/main/webapps/wadl.xsl (original)
+++ incubator/ambari/trunk/controller/src/main/webapps/wadl.xsl Thu Oct 27 02:26:56 2011
@@ -378,7 +378,8 @@
             <xsl:otherwise>
                 <xsl:choose>
                     <xsl:when test="node()[1]!=text()">
-                        <xsl:apply-templates select="node()" mode="copy"/>
+<!--                        <xsl:apply-templates select="node()" mode="copy"/> -->
+                        <xsl:call-template name="getExample"/>
                     </xsl:when>
                     <xsl:otherwise>
                         <xsl:value-of select="text()"/>
@@ -389,6 +390,15 @@
     </xsl:for-each>
 </xsl:template>
 
+<xsl:template name="getExample">
+    <xsl:choose>
+        <xsl:when test="code"><xsl:value-of select="@code"/></xsl:when>
+        <xsl:otherwise>
+            <xsl:apply-templates select="node()" mode="copy"/>
+        </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
 <xsl:template match="html:*" mode="copy">
     <!-- remove the prefix on HTML elements -->
     <xsl:element name="{local-name()}">



Mime
View raw message