Added custom property for Simple Archetype 25/5925/1
authorMadhu Venugopal <mavenugo@gmail.com>
Sun, 6 Apr 2014 01:10:23 +0000 (18:10 -0700)
committerMadhu Venugopal <mavenugo@gmail.com>
Sun, 6 Apr 2014 01:10:23 +0000 (18:10 -0700)
Change-Id: Iab5367fecbd86eceb3480d76333ba7f3857da002
Signed-off-by: Madhu Venugopal <mavenugo@gmail.com>
main/archetypes/archetype-app-simple/src/main/resources/META-INF/maven/archetype-metadata.xml
main/archetypes/archetype-app-simple/src/main/resources/archetype-resources/src/main/java/northbound/AppNorthbound.java
main/archetypes/archetype-app-simple/src/test/resources/projects/basic/archetype.properties

index 5ccd8931e46c7bfd4431faed6c2428df97f0a28d..9ac16be9fc76084793662c79c02c9525ad568e64 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<archetype-descriptor xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0 http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd" name="device"
+<archetype-descriptor xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0 http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd" name="simple"
     xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <fileSets>
@@ -67,4 +67,7 @@
       </includes>
     </fileSet>
   </fileSets>
+    <requiredProperties>
+    <requiredProperty key="REST-Resource-Name"/>
+  </requiredProperties>
 </archetype-descriptor>
index f7ba31914c9f199aa9ebca8ae7dfbaf21efad0c0..10fe260436e292453272e6b26aaeeb12129d299e 100644 (file)
@@ -76,7 +76,7 @@ public class AppNorthbound {
      * Example:
      *
      * Request URL:
-     * http://localhost:8080/app/northbound/api
+     * http://localhost:8080/app/northbound/${REST-Resource-Name}
      *
      * Response body in XML:
      * &lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
@@ -86,7 +86,7 @@ public class AppNorthbound {
      * Sample Northbound API
      * </pre>
      */
-    @Path("/simple")
+    @Path("/${REST-Resource-Name}")
     @GET
     @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
     @StatusCodes()
@@ -106,7 +106,7 @@ public class AppNorthbound {
         return new ArrayList<SimpleData>();
     }
 
-    @Path("/simple/{uuid}")
+    @Path("/${REST-Resource-Name}/{uuid}")
     @GET
     @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
     @TypeHint(SimpleData.class)
@@ -133,7 +133,7 @@ public class AppNorthbound {
      * Example:
      *
      * Request URL:
-     * http://localhost:8080/app/northbound/api
+     * http://localhost:8080/app/northbound/${REST-Resource-Name}
      *
      * Response body in XML:
      * &lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
@@ -143,7 +143,7 @@ public class AppNorthbound {
      * Sample Northbound API
      * </pre>
      */
-    @Path("/simple")
+    @Path("/${REST-Resource-Name}")
     @POST
     @StatusCodes({ @ResponseCode(code = 201, condition = "Data Inserted successfully"),
         @ResponseCode(code = 401, condition = "User not authorized to perform this operation"),
@@ -180,7 +180,7 @@ public class AppNorthbound {
     * Example:
     *
     * Request URL:
-    * http://localhost:8080/app/northbound/api/{uuid}
+    * http://localhost:8080/app/northbound/${REST-Resource-Name}/{uuid}
     *
     * Response body in XML:
     * &lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
@@ -190,7 +190,7 @@ public class AppNorthbound {
     * Sample Northbound API
     * </pre>
     */
-   @Path("/simple/{uuid}")
+   @Path("/${REST-Resource-Name}/{uuid}")
    @PUT
    @StatusCodes({ @ResponseCode(code = 200, condition = "Data Updated successfully"),
        @ResponseCode(code = 401, condition = "User not authorized to perform this operation"),
@@ -223,7 +223,7 @@ public class AppNorthbound {
    * Example:
    *
    * Request URL:
-   * http://localhost:8080/app/northbound/api/{uuid}
+   * http://localhost:8080/app/northbound/${REST-Resource-Name}/{uuid}
    *
    * Response body in XML:
    * &lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
@@ -233,7 +233,7 @@ public class AppNorthbound {
    * Sample Northbound API
    * </pre>
    */
-  @Path("/simple/{uuid}")
+  @Path("/${REST-Resource-Name}/{uuid}")
   @DELETE
   @StatusCodes({ @ResponseCode(code = 200, condition = "Data Deleted successfully"),
                  @ResponseCode(code = 401, condition = "User not authorized to perform this operation"),
index 9857f0e305a8cabcfaf31378d15f2c8971fb5ec9..5fa40b3ef9ee2bbe202fc8cd8c8e247a787200f1 100644 (file)
@@ -3,3 +3,4 @@ package=it.pkg
 version=0.1-SNAPSHOT
 groupId=archetype.it
 artifactId=basic
+REST-Resource-Name=simple-data