diff options
Diffstat (limited to 'framework/src/onos/tools/package/archetypes/ui/src/main')
9 files changed, 0 insertions, 484 deletions
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 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - ~ Copyright 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. - --> -<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="onos-ui" partial="true" - xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <fileSets> - <fileSet filtered="true" packaged="true" encoding="UTF-8"> - <directory>src/main/java</directory> - <includes> - <include>**/*.java</include> - </includes> - </fileSet> - <fileSet filtered="true" packaged="false" encoding="UTF-8"> - <directory>src/main/resources</directory> - <includes> - <include>**/*.html</include> - <include>**/*.js</include> - <include>**/*.css</include> - </includes> - </fileSet> - </fileSets> -</archetype-descriptor> 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 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - ~ Copyright 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. - --> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - - <groupId>${groupId}</groupId> - <artifactId>${artifactId}</artifactId> - <version>${version}</version> - <packaging>bundle</packaging> - - <description>ONOS OSGi UI Custom-View bundle archetype</description> - <url>http://onosproject.org</url> - - <properties> - <onos.version>1.4.0-rc1</onos.version> - <!-- Uncomment to generate ONOS app from this module. - <onos.app.name>org.foo.app</onos.app.name> - <onos.app.origin>Foo, Inc.</onos.app.origin> - --> - </properties> - - <dependencies> - <dependency> - <groupId>org.onosproject</groupId> - <artifactId>onos-api</artifactId> - <version>${onos.version}</version> - </dependency> - - <dependency> - <groupId>org.onosproject</groupId> - <artifactId>onlab-osgi</artifactId> - <version>${onos.version}</version> - </dependency> - - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.11</version> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>org.onosproject</groupId> - <artifactId>onos-api</artifactId> - <version>${onos.version}</version> - <scope>test</scope> - <classifier>tests</classifier> - </dependency> - - <dependency> - <groupId>org.apache.felix</groupId> - <artifactId>org.apache.felix.scr.annotations</artifactId> - <version>1.9.8</version> - <scope>provided</scope> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.apache.felix</groupId> - <artifactId>maven-bundle-plugin</artifactId> - <version>2.5.3</version> - <extensions>true</extensions> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <version>2.5.1</version> - <configuration> - <source>1.8</source> - <target>1.8</target> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.felix</groupId> - <artifactId>maven-scr-plugin</artifactId> - <version>1.20.0</version> - <executions> - <execution> - <id>generate-scr-srcdescriptor</id> - <goals> - <goal>scr</goal> - </goals> - </execution> - </executions> - <configuration> - <supportedProjectTypes> - <supportedProjectType>bundle</supportedProjectType> - <supportedProjectType>war</supportedProjectType> - </supportedProjectTypes> - </configuration> - </plugin> - <plugin> - <groupId>org.onosproject</groupId> - <artifactId>onos-maven-plugin</artifactId> - <version>1.5</version> - <executions> - <execution> - <id>cfg</id> - <phase>generate-resources</phase> - <goals> - <goal>cfg</goal> - </goals> - </execution> - <execution> - <id>swagger</id> - <phase>generate-sources</phase> - <goals> - <goal>swagger</goal> - </goals> - </execution> - <execution> - <id>app</id> - <phase>package</phase> - <goals> - <goal>app</goal> - </goals> - </execution> - </executions> - </plugin> - </plugins> - </build> - -</project> 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<UiView> 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<RequestHandler> 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 @@ -<!-- partial HTML --> -<div id="ov-sample-custom"> - <div class="button-panel"> - <div class="my-button" ng-click="getData()"> - Fetch Data - </div> - </div> - - <div class="data-panel"> - <table> - <tr> - <td> Number </td> - <td class="number"> {{data.number}} </td> - </tr> - <tr> - <td> Square </td> - <td class="number"> {{data.square}} </td> - </tr> - <tr> - <td> Cube </td> - <td class="number"> {{data.cube}} </td> - </tr> - </table> - - <p> - A message from our sponsors: - </p> - <p> - <span class="quote"> {{data.message}} </span> - </p> - </div> -</div> 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 @@ -<link rel="stylesheet" href="app/view/sampleCustom/sampleCustom.css">
\ 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 @@ -<script src="app/view/sampleCustom/sampleCustom.js"></script>
\ No newline at end of file |