[ONOS-3634] Add REST API for extended application properties

Change-Id: I61f91075ac3bd527d0e10436e14ed496f55ef593
diff --git a/core/common/src/main/java/org/onosproject/codec/impl/ApplicationCodec.java b/core/common/src/main/java/org/onosproject/codec/impl/ApplicationCodec.java
index a09c0bd..3c6f37c 100644
--- a/core/common/src/main/java/org/onosproject/codec/impl/ApplicationCodec.java
+++ b/core/common/src/main/java/org/onosproject/codec/impl/ApplicationCodec.java
@@ -16,6 +16,7 @@
 package org.onosproject.codec.impl;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
+import org.apache.commons.lang3.StringEscapeUtils;
 import org.onosproject.app.ApplicationService;
 import org.onosproject.codec.CodecContext;
 import org.onosproject.codec.JsonCodec;
@@ -36,8 +37,11 @@
                 .put("name", app.id().name())
                 .put("id", app.id().id())
                 .put("version", app.version().toString())
-                .put("description", app.description())
+                .put("category", app.category())
+                .put("description", StringEscapeUtils.escapeJson(app.description()))
+                .put("readme", StringEscapeUtils.escapeJson(app.readme()))
                 .put("origin", app.origin())
+                .put("url", app.url())
                 .put("permissions", app.permissions().toString()) // FIXME: change to an array
                 .put("featuresRepo", app.featuresRepo().isPresent() ?
                         app.featuresRepo().get().toString() : "")
@@ -45,5 +49,4 @@
                 .put("requiredApps", app.requiredApps().toString()) // FIXME: change to an array
                 .put("state", service.getState(app.id()).toString());
     }
-
 }
diff --git a/core/common/src/test/resources/org/onosproject/common/app/app.xml b/core/common/src/test/resources/org/onosproject/common/app/app.xml
index 6e58cb8..f623722 100644
--- a/core/common/src/test/resources/org/onosproject/common/app/app.xml
+++ b/core/common/src/test/resources/org/onosproject/common/app/app.xml
@@ -15,7 +15,7 @@
   -->
 <app name="org.foo.app" origin="Circus" version="1.2.a" category="other"
      url="http://www.onosproject.org" featuresRepo="mvn:org.foo-features/1.2a/xml/features"
-     readme="Awesome application from Circus, Inc." features="foo,bar">
+     features="foo,bar">
     <description>Awesome application from Circus, Inc.</description>
     <security>
         <role>ADMIN</role>
diff --git a/core/common/src/test/resources/org/onosproject/common/app/app.zip b/core/common/src/test/resources/org/onosproject/common/app/app.zip
index 9d48b8f..6ee64c0 100644
--- a/core/common/src/test/resources/org/onosproject/common/app/app.zip
+++ b/core/common/src/test/resources/org/onosproject/common/app/app.zip
Binary files differ
diff --git a/web/api/src/main/resources/definitions/Application.json b/web/api/src/main/resources/definitions/Application.json
index fb5bbeb..9be4fe4 100644
--- a/web/api/src/main/resources/definitions/Application.json
+++ b/web/api/src/main/resources/definitions/Application.json
@@ -5,8 +5,11 @@
     "name",
     "id",
     "version",
+    "category",
     "description",
+    "readme",
     "origin",
+    "url",
     "permissions",
     "featuresRepo",
     "features",
@@ -27,14 +30,26 @@
       "type": "string",
       "example": "1.2.3"
     },
+    "category": {
+      "type": "string",
+      "example": "default"
+    },
     "description": {
       "type": "string",
       "example": "ONOS app to test distributed primitives"
     },
+    "readme": {
+      "type": "string",
+      "example": "ONOS app to test distributed primitives."
+    },
     "origin": {
       "type": "string",
       "example": "ON.Lab"
     },
+    "url": {
+      "type": "string",
+      "example": "http://onosproject.org"
+    },
     "permissions": {
       "type": "array",
       "xml": {
diff --git a/web/api/src/main/resources/definitions/ApplicationPost.json b/web/api/src/main/resources/definitions/ApplicationPost.json
index fb5bbeb..9be4fe4 100644
--- a/web/api/src/main/resources/definitions/ApplicationPost.json
+++ b/web/api/src/main/resources/definitions/ApplicationPost.json
@@ -5,8 +5,11 @@
     "name",
     "id",
     "version",
+    "category",
     "description",
+    "readme",
     "origin",
+    "url",
     "permissions",
     "featuresRepo",
     "features",
@@ -27,14 +30,26 @@
       "type": "string",
       "example": "1.2.3"
     },
+    "category": {
+      "type": "string",
+      "example": "default"
+    },
     "description": {
       "type": "string",
       "example": "ONOS app to test distributed primitives"
     },
+    "readme": {
+      "type": "string",
+      "example": "ONOS app to test distributed primitives."
+    },
     "origin": {
       "type": "string",
       "example": "ON.Lab"
     },
+    "url": {
+      "type": "string",
+      "example": "http://onosproject.org"
+    },
     "permissions": {
       "type": "array",
       "xml": {
diff --git a/web/api/src/main/resources/definitions/Applications.json b/web/api/src/main/resources/definitions/Applications.json
index 304404a..32a225d 100644
--- a/web/api/src/main/resources/definitions/Applications.json
+++ b/web/api/src/main/resources/definitions/Applications.json
@@ -18,8 +18,11 @@
           "name",
           "id",
           "version",
+          "category",
           "description",
+          "readme",
           "origin",
+          "url",
           "permissions",
           "featuresRepo",
           "features",
@@ -40,14 +43,26 @@
             "type": "string",
             "example": "1.2.3"
           },
+          "category": {
+            "type": "string",
+            "example": "default"
+          },
           "description": {
             "type": "string",
             "example": "ONOS app to test distributed primitives"
           },
+          "readme": {
+            "type": "string",
+            "example": "ONOS app to test distributed primitives."
+          },
           "origin": {
             "type": "string",
             "example": "ON.Lab"
           },
+          "url": {
+            "type": "string",
+            "example": "http://onosproject.org"
+          },
           "permissions": {
             "type": "array",
             "xml": {