[ONOS-3634] Remove readme tag from app.xml
Change-Id: I536f54f74586a0bb5c671564f71b44a0a871d5f6
diff --git a/core/api/src/main/java/org/onosproject/app/DefaultApplicationDescription.java b/core/api/src/main/java/org/onosproject/app/DefaultApplicationDescription.java
index 3e52001..40f1d76 100644
--- a/core/api/src/main/java/org/onosproject/app/DefaultApplicationDescription.java
+++ b/core/api/src/main/java/org/onosproject/app/DefaultApplicationDescription.java
@@ -76,7 +76,7 @@
this.origin = checkNotNull(origin, "Origin cannot be null");
this.category = checkNotNull(category, "Category cannot be null");
this.url = checkNotNull(url, "URL cannot be null");
- this.readme = readme;
+ this.readme = checkNotNull(readme, "Readme cannot be null");
this.icon = icon;
this.role = checkNotNull(role, "Role cannot be null");
this.permissions = checkNotNull(permissions, "Permissions cannot be null");
diff --git a/core/api/src/main/java/org/onosproject/core/DefaultApplication.java b/core/api/src/main/java/org/onosproject/core/DefaultApplication.java
index 8d63600..e22d14f 100644
--- a/core/api/src/main/java/org/onosproject/core/DefaultApplication.java
+++ b/core/api/src/main/java/org/onosproject/core/DefaultApplication.java
@@ -75,7 +75,7 @@
this.origin = checkNotNull(origin, "Origin cannot be null");
this.category = checkNotNull(category, "Category cannot be null");
this.url = checkNotNull(url, "URL cannot be null");
- this.readme = readme;
+ this.readme = checkNotNull(readme, "Readme cannot be null");
this.icon = icon;
this.role = checkNotNull(role, "Role cannot be null");
this.permissions = checkNotNull(permissions, "Permissions cannot be null");
diff --git a/core/common/src/main/java/org/onosproject/common/app/ApplicationArchive.java b/core/common/src/main/java/org/onosproject/common/app/ApplicationArchive.java
index 42f8c9c..6d7dc31 100644
--- a/core/common/src/main/java/org/onosproject/common/app/ApplicationArchive.java
+++ b/core/common/src/main/java/org/onosproject/common/app/ApplicationArchive.java
@@ -88,7 +88,6 @@
private static final String CATEGORY = "[@category]";
private static final String URL = "[@url]";
- private static final String README = "readme";
private static final String ROLE = "security.role";
private static final String APP_PERMISSIONS = "security.permissions.app-perm";
@@ -307,19 +306,16 @@
List<String> requiredApps = apps.isEmpty() ?
ImmutableList.of() : ImmutableList.copyOf(apps.split(","));
- String desc = cfg.getString(DESCRIPTION);
- String readme = cfg.getString(README);
+ // put full description to readme field
+ String readme = cfg.getString(DESCRIPTION);
- if (readme == null) {
- readme = desc;
- } else {
- desc = compactDescription(readme);
- }
+ // put short description to description field
+ String desc = compactDescription(readme);
return new DefaultApplicationDescription(name, version, desc, origin,
- category, url, readme, icon, role,
- perms, featuresRepo, features,
- requiredApps);
+ category, url, readme, icon,
+ role, perms, featuresRepo,
+ features, requiredApps);
}
// Expands the specified ZIP stream into app-specific directory.
@@ -488,7 +484,7 @@
if (StringUtils.contains(sentence, ".")) {
return StringUtils.substringBefore(sentence, ".") + ".";
} else {
- return sentence + ".";
+ return sentence;
}
}
return sentence;