Modifying uitab archetype to allow it to co-exist/overlay the ui archetype.
Change-Id: I5fd8408aaaf461e29e757389d4acbd94647cd1c5
diff --git a/tools/dev/bin/onos-create-app b/tools/dev/bin/onos-create-app
index 65b00b6..cbae101 100755
--- a/tools/dev/bin/onos-create-app
+++ b/tools/dev/bin/onos-create-app
@@ -11,7 +11,7 @@
[ $type = app ] && archetype=bundle || archetype=$type
if [ "$1" = "-?" -o "$1" = "-h" -o "$1" = "--help" ]; then
- echo "usage: $(basename $0) {app|bundle|ui|cli|api} groupId artifactId version package mvn-options"
+ echo "usage: $(basename $0) {app|bundle|ui|uitab|cli|api} groupId artifactId version package mvn-options"
echo " All arguments are optional"
exit 1
fi
diff --git a/tools/package/archetypes/uitab/src/main/resources/archetype-resources/src/main/java/AppUiComponent.java b/tools/package/archetypes/uitab/src/main/resources/archetype-resources/src/main/java/AppUiTableComponent.java
similarity index 94%
rename from tools/package/archetypes/uitab/src/main/resources/archetype-resources/src/main/java/AppUiComponent.java
rename to tools/package/archetypes/uitab/src/main/resources/archetype-resources/src/main/java/AppUiTableComponent.java
index 3a58d83..4cd4df0 100644
--- a/tools/package/archetypes/uitab/src/main/resources/archetype-resources/src/main/java/AppUiComponent.java
+++ b/tools/package/archetypes/uitab/src/main/resources/archetype-resources/src/main/java/AppUiTableComponent.java
@@ -37,7 +37,7 @@
* Skeletal ONOS UI Table-View application component.
*/
@Component(immediate = true)
-public class AppUiComponent {
+public class AppUiTableComponent {
private final Logger log = LoggerFactory.getLogger(getClass());
@@ -52,12 +52,13 @@
// Factory for UI message handlers
private final UiMessageHandlerFactory messageHandlerFactory =
() -> ImmutableList.of(
- new AppUiMessageHandler()
+ new AppUiTableMessageHandler()
);
// Application UI extension
protected UiExtension extension =
new UiExtension.Builder(getClass().getClassLoader(), uiViews)
+ .resourcePath("sampleTable")
.messageHandlerFactory(messageHandlerFactory)
.build();
diff --git a/tools/package/archetypes/uitab/src/main/resources/archetype-resources/src/main/java/AppUiMessageHandler.java b/tools/package/archetypes/uitab/src/main/resources/archetype-resources/src/main/java/AppUiTableMessageHandler.java
similarity index 98%
rename from tools/package/archetypes/uitab/src/main/resources/archetype-resources/src/main/java/AppUiMessageHandler.java
rename to tools/package/archetypes/uitab/src/main/resources/archetype-resources/src/main/java/AppUiTableMessageHandler.java
index cd3602e..50eb76b 100644
--- a/tools/package/archetypes/uitab/src/main/resources/archetype-resources/src/main/java/AppUiMessageHandler.java
+++ b/tools/package/archetypes/uitab/src/main/resources/archetype-resources/src/main/java/AppUiTableMessageHandler.java
@@ -35,7 +35,7 @@
/**
* Skeletal ONOS UI Table-View message handler.
*/
-public class AppUiMessageHandler extends UiMessageHandler {
+public class AppUiTableMessageHandler extends UiMessageHandler {
private static final String SAMPLE_TABLE_DATA_REQ = "sampleTableDataRequest";
private static final String SAMPLE_TABLE_DATA_RESP = "sampleTableDataResponse";
diff --git a/tools/package/archetypes/uitab/src/main/resources/archetype-resources/src/main/resources/css.html b/tools/package/archetypes/uitab/src/main/resources/archetype-resources/src/main/resources/sampleTable/css.html
similarity index 100%
rename from tools/package/archetypes/uitab/src/main/resources/archetype-resources/src/main/resources/css.html
rename to tools/package/archetypes/uitab/src/main/resources/archetype-resources/src/main/resources/sampleTable/css.html
diff --git a/tools/package/archetypes/uitab/src/main/resources/archetype-resources/src/main/resources/js.html b/tools/package/archetypes/uitab/src/main/resources/archetype-resources/src/main/resources/sampleTable/js.html
similarity index 100%
rename from tools/package/archetypes/uitab/src/main/resources/archetype-resources/src/main/resources/js.html
rename to tools/package/archetypes/uitab/src/main/resources/archetype-resources/src/main/resources/sampleTable/js.html
diff --git a/tools/test/scenarios/archetypes.xml b/tools/test/scenarios/archetypes.xml
index 8244a32..ff1c689 100644
--- a/tools/test/scenarios/archetypes.xml
+++ b/tools/test/scenarios/archetypes.xml
@@ -42,8 +42,18 @@
<step name="Reinstall-App-With-UI" requires="^,~Verify-CLI"
exec="onos-app ${OCI} reinstall! target/test-app-1.2.3.oar"/>
<step name="Verify-UI" requires="^"
+ exec="onos-check-views $ou{OCI} id=sample"/>
+
+ <step name="Create-App-UI-Table-Overlay" requires="Reinstall-App-With-UI"
+ exec="onos-create-app uitab org.test.app test-app 1.2.3 org.test.app -DinteractiveMode=false"/>
+ <step name="Build-App-With-UI-Table" requires="^"
+ exec="mvn clean install"/>
+ <step name="Reinstall-App-With-UI-Table" requires="^,~Verify-UI"
+ exec="onos-app ${OCI} reinstall! target/test-app-1.2.3.oar"/>
+ <step name="Verify-UI-Table" requires="^"
exec="onos-check-views ${OCI} id=sample"/>
+
<step name="Uninstall-App" requires="^"
exec="onos-app ${OCI} uninstall org.foo.app"/>
</group>