From b731e2f1dd0972409b136aebc7b463dd72c9cfad Mon Sep 17 00:00:00 2001 From: CNlucius Date: Tue, 13 Sep 2016 11:40:12 +0800 Subject: ONOSFW-171 O/S-SFC-ONOS scenario documentation Change-Id: I51ae1cf736ea24ab6680f8edca1b2bf5dd598365 Signed-off-by: CNlucius --- .../src/onos/tools/package/archetypes/ui/pom.xml | 31 ----- .../META-INF/maven/archetype-metadata.xml | 38 ------ .../src/main/resources/archetype-resources/pom.xml | 139 --------------------- .../src/main/java/AppUiComponent.java | 79 ------------ .../src/main/java/AppUiMessageHandler.java | 77 ------------ .../app/view/sampleCustom/sampleCustom.css | 48 ------- .../app/view/sampleCustom/sampleCustom.html | 32 ----- .../app/view/sampleCustom/sampleCustom.js | 69 ---------- .../src/main/resources/css.html | 1 - .../archetype-resources/src/main/resources/js.html | 1 - .../resources/projects/basic/archetype.properties | 21 ---- .../ui/src/test/resources/projects/basic/goal.txt | 0 12 files changed, 536 deletions(-) delete mode 100644 framework/src/onos/tools/package/archetypes/ui/pom.xml delete mode 100644 framework/src/onos/tools/package/archetypes/ui/src/main/resources/META-INF/maven/archetype-metadata.xml delete mode 100644 framework/src/onos/tools/package/archetypes/ui/src/main/resources/archetype-resources/pom.xml delete mode 100644 framework/src/onos/tools/package/archetypes/ui/src/main/resources/archetype-resources/src/main/java/AppUiComponent.java delete mode 100644 framework/src/onos/tools/package/archetypes/ui/src/main/resources/archetype-resources/src/main/java/AppUiMessageHandler.java delete mode 100644 framework/src/onos/tools/package/archetypes/ui/src/main/resources/archetype-resources/src/main/resources/app/view/sampleCustom/sampleCustom.css delete mode 100644 framework/src/onos/tools/package/archetypes/ui/src/main/resources/archetype-resources/src/main/resources/app/view/sampleCustom/sampleCustom.html delete mode 100644 framework/src/onos/tools/package/archetypes/ui/src/main/resources/archetype-resources/src/main/resources/app/view/sampleCustom/sampleCustom.js delete mode 100644 framework/src/onos/tools/package/archetypes/ui/src/main/resources/archetype-resources/src/main/resources/css.html delete mode 100644 framework/src/onos/tools/package/archetypes/ui/src/main/resources/archetype-resources/src/main/resources/js.html delete mode 100644 framework/src/onos/tools/package/archetypes/ui/src/test/resources/projects/basic/archetype.properties delete mode 100644 framework/src/onos/tools/package/archetypes/ui/src/test/resources/projects/basic/goal.txt (limited to 'framework/src/onos/tools/package/archetypes/ui') diff --git a/framework/src/onos/tools/package/archetypes/ui/pom.xml b/framework/src/onos/tools/package/archetypes/ui/pom.xml deleted file mode 100644 index c4ed2c01..00000000 --- a/framework/src/onos/tools/package/archetypes/ui/pom.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - 4.0.0 - - - org.onosproject - onos-archetypes - 1.4.0-rc1 - - - onos-ui-archetype - maven-archetype - - ONOS UI Custom-View overlay archetype - - diff --git a/framework/src/onos/tools/package/archetypes/ui/src/main/resources/META-INF/maven/archetype-metadata.xml b/framework/src/onos/tools/package/archetypes/ui/src/main/resources/META-INF/maven/archetype-metadata.xml deleted file mode 100644 index 309fd6ad..00000000 --- a/framework/src/onos/tools/package/archetypes/ui/src/main/resources/META-INF/maven/archetype-metadata.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - src/main/java - - **/*.java - - - - src/main/resources - - **/*.html - **/*.js - **/*.css - - - - diff --git a/framework/src/onos/tools/package/archetypes/ui/src/main/resources/archetype-resources/pom.xml b/framework/src/onos/tools/package/archetypes/ui/src/main/resources/archetype-resources/pom.xml deleted file mode 100644 index c067ee51..00000000 --- a/framework/src/onos/tools/package/archetypes/ui/src/main/resources/archetype-resources/pom.xml +++ /dev/null @@ -1,139 +0,0 @@ - - - - 4.0.0 - - ${groupId} - ${artifactId} - ${version} - bundle - - ONOS OSGi UI Custom-View bundle archetype - http://onosproject.org - - - 1.4.0-rc1 - - - - - - org.onosproject - onos-api - ${onos.version} - - - - org.onosproject - onlab-osgi - ${onos.version} - - - - junit - junit - 4.11 - test - - - - org.onosproject - onos-api - ${onos.version} - test - tests - - - - org.apache.felix - org.apache.felix.scr.annotations - 1.9.8 - provided - - - - - - - org.apache.felix - maven-bundle-plugin - 2.5.3 - true - - - org.apache.maven.plugins - maven-compiler-plugin - 2.5.1 - - 1.8 - 1.8 - - - - org.apache.felix - maven-scr-plugin - 1.20.0 - - - generate-scr-srcdescriptor - - scr - - - - - - bundle - war - - - - - org.onosproject - onos-maven-plugin - 1.5 - - - cfg - generate-resources - - cfg - - - - swagger - generate-sources - - swagger - - - - app - package - - app - - - - - - - - diff --git a/framework/src/onos/tools/package/archetypes/ui/src/main/resources/archetype-resources/src/main/java/AppUiComponent.java b/framework/src/onos/tools/package/archetypes/ui/src/main/resources/archetype-resources/src/main/java/AppUiComponent.java deleted file mode 100644 index e44b34d5..00000000 --- a/framework/src/onos/tools/package/archetypes/ui/src/main/resources/archetype-resources/src/main/java/AppUiComponent.java +++ /dev/null @@ -1,79 +0,0 @@ -#set( $symbol_pound = '#' ) -#set( $symbol_dollar = '$' ) -#set( $symbol_escape = '\' ) -/* - * Copyright 2014,2015 Open Networking Laboratory - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ${package}; - -import com.google.common.collect.ImmutableList; -import org.apache.felix.scr.annotations.Activate; -import org.apache.felix.scr.annotations.Component; -import org.apache.felix.scr.annotations.Deactivate; -import org.apache.felix.scr.annotations.Reference; -import org.apache.felix.scr.annotations.ReferenceCardinality; -import org.onosproject.ui.UiExtension; -import org.onosproject.ui.UiExtensionService; -import org.onosproject.ui.UiMessageHandlerFactory; -import org.onosproject.ui.UiView; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.List; - -/** - * Skeletal ONOS UI Custom-View application component. - */ -@Component(immediate = true) -public class AppUiComponent { - - private static final String VIEW_ID = "sampleCustom"; - private static final String VIEW_TEXT = "Sample Custom"; - - private final Logger log = LoggerFactory.getLogger(getClass()); - - @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) - protected UiExtensionService uiExtensionService; - - // List of application views - private final List uiViews = ImmutableList.of( - new UiView(UiView.Category.OTHER, VIEW_ID, VIEW_TEXT) - ); - - // Factory for UI message handlers - private final UiMessageHandlerFactory messageHandlerFactory = - () -> ImmutableList.of( - new AppUiMessageHandler() - ); - - // Application UI extension - protected UiExtension extension = - new UiExtension.Builder(getClass().getClassLoader(), uiViews) - .messageHandlerFactory(messageHandlerFactory) - .build(); - - @Activate - protected void activate() { - uiExtensionService.register(extension); - log.info("Started"); - } - - @Deactivate - protected void deactivate() { - uiExtensionService.unregister(extension); - log.info("Stopped"); - } - -} diff --git a/framework/src/onos/tools/package/archetypes/ui/src/main/resources/archetype-resources/src/main/java/AppUiMessageHandler.java b/framework/src/onos/tools/package/archetypes/ui/src/main/resources/archetype-resources/src/main/java/AppUiMessageHandler.java deleted file mode 100644 index d6486328..00000000 --- a/framework/src/onos/tools/package/archetypes/ui/src/main/resources/archetype-resources/src/main/java/AppUiMessageHandler.java +++ /dev/null @@ -1,77 +0,0 @@ -#set( $symbol_pound = '#' ) -#set( $symbol_dollar = '$' ) -#set( $symbol_escape = '\' ) -/* - * Copyright 2014,2015 Open Networking Laboratory - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ${package}; - -import com.fasterxml.jackson.databind.node.ObjectNode; -import com.google.common.collect.ImmutableSet; -import org.onosproject.ui.RequestHandler; -import org.onosproject.ui.UiMessageHandler; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.Collection; - -/** - * Skeletal ONOS UI Custom-View message handler. - */ -public class AppUiMessageHandler extends UiMessageHandler { - - private static final String SAMPLE_CUSTOM_DATA_REQ = "sampleCustomDataRequest"; - private static final String SAMPLE_CUSTOM_DATA_RESP = "sampleCustomDataResponse"; - - private static final String NUMBER = "number"; - private static final String SQUARE = "square"; - private static final String CUBE = "cube"; - private static final String MESSAGE = "message"; - private static final String MSG_FORMAT = "Next incrememt is %d units"; - - private final Logger log = LoggerFactory.getLogger(getClass()); - - private long someNumber = 1; - private long someIncrement = 1; - - @Override - protected Collection createRequestHandlers() { - return ImmutableSet.of( - new SampleCustomDataRequestHandler() - ); - } - - // handler for sample data requests - private final class SampleCustomDataRequestHandler extends RequestHandler { - - private SampleCustomDataRequestHandler() { - super(SAMPLE_CUSTOM_DATA_REQ); - } - - @Override - public void process(long sid, ObjectNode payload) { - someIncrement++; - someNumber += someIncrement; - log.debug("Computing data for {}...", someNumber); - - ObjectNode result = objectNode(); - result.put(NUMBER, someNumber); - result.put(SQUARE, someNumber * someNumber); - result.put(CUBE, someNumber * someNumber * someNumber); - result.put(MESSAGE, String.format(MSG_FORMAT, someIncrement + 1)); - sendMessage(SAMPLE_CUSTOM_DATA_RESP, 0, result); - } - } -} \ No newline at end of file diff --git a/framework/src/onos/tools/package/archetypes/ui/src/main/resources/archetype-resources/src/main/resources/app/view/sampleCustom/sampleCustom.css b/framework/src/onos/tools/package/archetypes/ui/src/main/resources/archetype-resources/src/main/resources/app/view/sampleCustom/sampleCustom.css deleted file mode 100644 index ffeac0aa..00000000 --- a/framework/src/onos/tools/package/archetypes/ui/src/main/resources/archetype-resources/src/main/resources/app/view/sampleCustom/sampleCustom.css +++ /dev/null @@ -1,48 +0,0 @@ -/* css for sample app custom view */ - -#ov-sample-custom { - padding: 20px; -} -.light #ov-sample-custom { - color: navy; -} -.dark #ov-sample-custom { - color: #88f; -} - -#ov-sample-custom .button-panel { - margin: 10px; - width: 200px; -} - -.light #ov-sample-custom .button-panel { - background-color: #ccf; -} -.dark #ov-sample-custom .button-panel { - background-color: #444; -} - -#ov-sample-custom .my-button { - cursor: pointer; - padding: 4px; - text-align: center; -} - -.light #ov-sample-custom .my-button { - color: white; - background-color: #99d; -} -.dark #ov-sample-custom .my-button { - color: black; - background-color: #aaa; -} - -#ov-sample-custom .number { - font-size: 140%; - text-align: right; -} - -#ov-sample-custom .quote { - margin: 10px 20px; - font-style: italic; -} \ No newline at end of file diff --git a/framework/src/onos/tools/package/archetypes/ui/src/main/resources/archetype-resources/src/main/resources/app/view/sampleCustom/sampleCustom.html b/framework/src/onos/tools/package/archetypes/ui/src/main/resources/archetype-resources/src/main/resources/app/view/sampleCustom/sampleCustom.html deleted file mode 100644 index d3d79a10..00000000 --- a/framework/src/onos/tools/package/archetypes/ui/src/main/resources/archetype-resources/src/main/resources/app/view/sampleCustom/sampleCustom.html +++ /dev/null @@ -1,32 +0,0 @@ - -
-
-
- Fetch Data -
-
- -
- - - - - - - - - - - - - -
Number {{data.number}}
Square {{data.square}}
Cube {{data.cube}}
- -

- A message from our sponsors: -

-

- {{data.message}} -

-
-
diff --git a/framework/src/onos/tools/package/archetypes/ui/src/main/resources/archetype-resources/src/main/resources/app/view/sampleCustom/sampleCustom.js b/framework/src/onos/tools/package/archetypes/ui/src/main/resources/archetype-resources/src/main/resources/app/view/sampleCustom/sampleCustom.js deleted file mode 100644 index 21058640..00000000 --- a/framework/src/onos/tools/package/archetypes/ui/src/main/resources/archetype-resources/src/main/resources/app/view/sampleCustom/sampleCustom.js +++ /dev/null @@ -1,69 +0,0 @@ -// js for sample app custom view -(function () { - 'use strict'; - - // injected refs - var $log, $scope, wss, ks; - - // constants - var dataReq = 'sampleCustomDataRequest', - dataResp = 'sampleCustomDataResponse'; - - function addKeyBindings() { - var map = { - space: [getData, 'Fetch data from server'], - - _helpFormat: [ - ['space'] - ] - }; - - ks.keyBindings(map); - } - - function getData() { - wss.sendEvent(dataReq); - } - - function respDataCb(data) { - $scope.data = data; - $scope.$apply(); - } - - - angular.module('ovSampleCustom', []) - .controller('OvSampleCustomCtrl', - ['$log', '$scope', 'WebSocketService', 'KeyService', - - function (_$log_, _$scope_, _wss_, _ks_) { - $log = _$log_; - $scope = _$scope_; - wss = _wss_; - ks = _ks_; - - var handlers = {}; - $scope.data = {}; - - // data response handler - handlers[dataResp] = respDataCb; - wss.bindHandlers(handlers); - - addKeyBindings(); - - // custom click handler - $scope.getData = getData; - - // get data the first time... - getData(); - - // cleanup - $scope.$on('$destroy', function () { - wss.unbindHandlers(handlers); - ks.unbindKeys(); - $log.log('OvSampleCustomCtrl has been destroyed'); - }); - - $log.log('OvSampleCustomCtrl has been created'); - }]); - -}()); diff --git a/framework/src/onos/tools/package/archetypes/ui/src/main/resources/archetype-resources/src/main/resources/css.html b/framework/src/onos/tools/package/archetypes/ui/src/main/resources/archetype-resources/src/main/resources/css.html deleted file mode 100644 index 4e7b7092..00000000 --- a/framework/src/onos/tools/package/archetypes/ui/src/main/resources/archetype-resources/src/main/resources/css.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/framework/src/onos/tools/package/archetypes/ui/src/main/resources/archetype-resources/src/main/resources/js.html b/framework/src/onos/tools/package/archetypes/ui/src/main/resources/archetype-resources/src/main/resources/js.html deleted file mode 100644 index 6550b85e..00000000 --- a/framework/src/onos/tools/package/archetypes/ui/src/main/resources/archetype-resources/src/main/resources/js.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/framework/src/onos/tools/package/archetypes/ui/src/test/resources/projects/basic/archetype.properties b/framework/src/onos/tools/package/archetypes/ui/src/test/resources/projects/basic/archetype.properties deleted file mode 100644 index a1213b40..00000000 --- a/framework/src/onos/tools/package/archetypes/ui/src/test/resources/projects/basic/archetype.properties +++ /dev/null @@ -1,21 +0,0 @@ -# -# Copyright 2014 Open Networking Laboratory -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -#Thu Dec 04 09:24:50 PST 2014 -package=it.pkg -version=0.1-SNAPSHOT -groupId=archetype.it -artifactId=basic diff --git a/framework/src/onos/tools/package/archetypes/ui/src/test/resources/projects/basic/goal.txt b/framework/src/onos/tools/package/archetypes/ui/src/test/resources/projects/basic/goal.txt deleted file mode 100644 index e69de29b..00000000 -- cgit 1.2.3-korg