You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by he...@apache.org on 2018/07/26 10:50:30 UTC
[13/28] brooklyn-ui git commit: This adds the contributed
brooklyn-ui-angular code in the folder new/.
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/blueprint-composer/config/test/karma.config.js
----------------------------------------------------------------------
diff --git a/new/ui-modules/blueprint-composer/config/test/karma.config.js b/new/ui-modules/blueprint-composer/config/test/karma.config.js
new file mode 100644
index 0000000..6fc6558
--- /dev/null
+++ b/new/ui-modules/blueprint-composer/config/test/karma.config.js
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+const PRODUCTION_BUILD = process.env.NODE_ENV === 'production';
+const webpackConfig = require('./../build/webpack.config.js');
+
+module.exports = function (config) {
+ const conf = {
+ basePath: '',
+ frameworks: ['jasmine'],
+ files: [
+ {pattern: './karma.test.shim.js', watched: false}
+ ],
+ preprocessors: {
+ './karma.test.shim.js': ['webpack', 'sourcemap']
+ },
+ webpack: Object.assign({}, webpackConfig, {entry: undefined, plugins: undefined}),
+ webpackMiddleware: {
+ stats: 'errors-only'
+ },
+ webpackServer: {
+ noInfo: true
+ },
+ exclude: [],
+ colors: !PRODUCTION_BUILD,
+ logLevel: config.LOG_INFO,
+ autoWatch: !PRODUCTION_BUILD,
+ singleRun: PRODUCTION_BUILD,
+ reporters: ['progress'],
+ browsers: ['PhantomJS'],
+ plugins: [
+ require('karma-webpack'),
+ require('karma-sourcemap-loader'),
+ 'karma-jasmine',
+ 'karma-phantomjs-launcher'
+ ],
+ failOnEmptyTestSuite: false
+ };
+ config.set(conf);
+};
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/blueprint-composer/config/test/karma.test.shim.js
----------------------------------------------------------------------
diff --git a/new/ui-modules/blueprint-composer/config/test/karma.test.shim.js b/new/ui-modules/blueprint-composer/config/test/karma.test.shim.js
new file mode 100644
index 0000000..3d926c0
--- /dev/null
+++ b/new/ui-modules/blueprint-composer/config/test/karma.test.shim.js
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+Error.stackTraceLimit = Infinity;
+
+require('angular');
+require('angular-mocks');
+require('babel-polyfill');
+
+var testsContext = require.context('./../../app', true, /\.spec\.js$/);
+testsContext.keys().forEach(testsContext);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/blueprint-composer/config/test/protractor.config.js
----------------------------------------------------------------------
diff --git a/new/ui-modules/blueprint-composer/config/test/protractor.config.js b/new/ui-modules/blueprint-composer/config/test/protractor.config.js
new file mode 100644
index 0000000..5274c81
--- /dev/null
+++ b/new/ui-modules/blueprint-composer/config/test/protractor.config.js
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+exports.config = {
+ framework: 'jasmine2',
+ seleniumAddress: 'http://localhost:4444/wd/hub',
+ specs: ['../../app/**/*.e2e-spec.js'],
+ baseUrl: 'http://admin:password@localhost:8080',
+ capabilities: {
+ 'browserName': 'chrome',
+ 'chromeOptions': {
+ 'args': ['--window-size=1440,1000']
+ }
+ },
+ onPrepare: function () {
+ require('babel-register');
+ },
+ jasmineNodeOpts: {
+ // If true, print colors to the terminal.
+ showColors: true,
+ // Default time to wait in ms before a test fails.
+ defaultTimeoutInterval: 30000
+ }
+};
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/blueprint-composer/package.json
----------------------------------------------------------------------
diff --git a/new/ui-modules/blueprint-composer/package.json b/new/ui-modules/blueprint-composer/package.json
new file mode 100644
index 0000000..c6ad804
--- /dev/null
+++ b/new/ui-modules/blueprint-composer/package.json
@@ -0,0 +1,111 @@
+{
+ "__license__": [
+ "Licensed to the Apache Software Foundation (ASF) under one",
+ "or more contributor license agreements. See the NOTICE file",
+ "distributed with this work for additional information",
+ "regarding copyright ownership. The ASF licenses this file",
+ "to you 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."
+ ],
+ "name": "brooklyn-ui-blueprint-composer",
+ "versionBuildNote": "BROOKLYN_VERSION_BELOW this exists so scripts update this automatically",
+ "version": "1.0.0-SNAPSHOT",
+ "description": "Brooklyn UI :: Modules - Blueprint composer",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/apache/brooklyn-ui.git"
+ },
+ "author": "Apache Software Foundation",
+ "license": "Apache-2.0",
+ "scripts": {
+ "build": "rimraf dist && webpack --config ./config/build/webpack.config.js --bail",
+ "start": "node ./config/server.js",
+ "test": "karma start ./config/test/karma.config.js",
+ "lint": "./node_modules/.bin/eslint app/**/*.js",
+ "e2e": "protractor ./config/test/protractor.config.js"
+ },
+ "engines": {
+ "node": ">=8.0.0",
+ "npm": ">=5.0.0"
+ },
+ "brooklyn": {
+ "appname": "Blueprint composer"
+ },
+ "dependencies": {
+ "brooklyn-ui-utils": "file:../utils",
+ "angular": "^1.7.2",
+ "angular-animate": "^1.7.2",
+ "angular-cookies": "^1.7.2",
+ "angular-java-stack-viewer": "^1.0.1",
+ "angular-resource": "^1.7.2",
+ "angular-sanitize": "^1.7.2",
+ "angular-ui-bootstrap": "^2.5.0",
+ "angular-ui-router": "^1.0.18",
+ "angular-xeditable": "^0.4.0",
+ "bootstrap": "^3.3.7",
+ "codemirror": "^5.19.0",
+ "d3": "4.10.0",
+ "es6-promise": "^4.0.5",
+ "file-saver": "^1.3.3",
+ "font-awesome": "^4.6.3",
+ "isomorphic-fetch": "^2.2.1",
+ "lodash": "^4.16.4",
+ "ngclipboard": "^1.1.1",
+ "normalizr": "^2.2.1",
+ "underscore": "^1.8.3"
+ },
+ "devDependencies": {
+ "angular-mocks": "^1.6.1",
+ "autoprefixer": "^6.5.1",
+ "babel-core": "^6.17.0",
+ "babel-loader": "^6.2.5",
+ "babel-polyfill": "^6.20.0",
+ "babel-preset-env": "^1.6.0",
+ "babel-preset-stage-0": "^6.16.0",
+ "css-loader": "^0.25.0",
+ "dotenv": "^2.0.0",
+ "ejs": "^2.5.2",
+ "ejs-html-loader": "^2.0.2",
+ "ejs-loader": "^0.3.0",
+ "eslint": "^3.8.1",
+ "exports-loader": "^0.6.3",
+ "expose-loader": "^0.7.1",
+ "express": "^4.14.0",
+ "extract-text-webpack-plugin": "^1.0.1",
+ "file-loader": "^0.9.0",
+ "html-loader": "^0.4.4",
+ "html-webpack-plugin": "^2.22.0",
+ "image-webpack-loader": "^3.0.0",
+ "imports-loader": "^0.6.5",
+ "jasmine-core": "^2.5.2",
+ "karma": "^1.3.0",
+ "karma-jasmine": "^1.0.2",
+ "karma-phantomjs-launcher": "^1.0.2",
+ "karma-sourcemap-loader": "^0.3.7",
+ "karma-webpack": "^1.8.0",
+ "less": "^2.7.1",
+ "less-loader": "^2.2.3",
+ "less-vars-to-js": "^1.1.2",
+ "phantomjs-prebuilt": "^2.1.13",
+ "postcss-loader": "^1.0.0",
+ "properties-reader": "0.0.15",
+ "proxy-middleware": "^0.15.0",
+ "raw-loader": "^0.5.1",
+ "resolve-url-loader": "^1.6.0",
+ "rimraf": "^2.5.4",
+ "style-loader": "^0.13.1",
+ "url": "^0.11.0",
+ "url-loader": "^0.5.7",
+ "webpack": "^1.13.2",
+ "webpack-dev-middleware": "^1.8.4",
+ "webpack-hot-middleware": "^2.13.0"
+ }
+}
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/blueprint-composer/pom.xml
----------------------------------------------------------------------
diff --git a/new/ui-modules/blueprint-composer/pom.xml b/new/ui-modules/blueprint-composer/pom.xml
new file mode 100644
index 0000000..edc8505
--- /dev/null
+++ b/new/ui-modules/blueprint-composer/pom.xml
@@ -0,0 +1,137 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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>
+
+ <parent>
+ <artifactId>brooklyn-ui-modules-parent</artifactId>
+ <groupId>org.apache.brooklyn.ui.modules</groupId>
+ <version>${revision}</version>
+ </parent>
+
+ <artifactId>brooklyn-ui-blueprint-composer</artifactId>
+ <packaging>war</packaging>
+ <name>Brooklyn UI :: Modules - Blueprint composer</name>
+
+ <build>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <artifactId>maven-clean-plugin</artifactId>
+ <configuration>
+ <filesets>
+ <fileset>
+ <directory>dist</directory>
+ <followSymlinks>false</followSymlinks>
+ </fileset>
+ </filesets>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>com.github.eirslett</groupId>
+ <artifactId>frontend-maven-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <artifactId>maven-resources-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy-resources</id>
+ <!-- here the phase you need -->
+ <phase>compile</phase>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>
+ ${project.build.directory}/${project.artifactId}-${project.version}
+ </outputDirectory>
+ <resources>
+ <resource>
+ <directory>${project.basedir}/dist</directory>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-war-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
+ </archive>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <extensions>true</extensions>
+ <!-- configure plugin to generate MANIFEST.MF
+ adapted from http://blog.knowhowlab.org/2010/06/osgi-tutorial-from-project-structure-to.html -->
+ <executions>
+ <execution>
+ <id>bundle-manifest</id>
+ <phase>process-classes</phase>
+ <goals>
+ <goal>manifest</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <supportedProjectTypes>
+ <supportedProjectType>war</supportedProjectType>
+ <supportedProjectType>jar</supportedProjectType>
+ <supportedProjectType>bundle</supportedProjectType>
+ </supportedProjectTypes>
+ <instructions>
+ <Bundle-ManifestVersion>${project.version}</Bundle-ManifestVersion>
+ <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
+ <Import-Package>
+ org.apache.brooklyn.ui.modularity.module.api,
+ org.eclipse.jetty.servlets,
+ *
+ </Import-Package>
+ <Export-Package>
+ !*
+ </Export-Package>
+ <Web-ContextPath>/${project.artifactId}</Web-ContextPath>
+ <_wab>app</_wab>
+ </instructions>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.rat</groupId>
+ <artifactId>apache-rat-plugin</artifactId>
+ <configuration>
+ <excludes combine.children="append">
+ <exclude>**/test/fixtures/brooklyn-api/v1/**</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/blueprint-composer/src/main/resources/ui-module/config.yaml
----------------------------------------------------------------------
diff --git a/new/ui-modules/blueprint-composer/src/main/resources/ui-module/config.yaml b/new/ui-modules/blueprint-composer/src/main/resources/ui-module/config.yaml
new file mode 100644
index 0000000..2e17a7b
--- /dev/null
+++ b/new/ui-modules/blueprint-composer/src/main/resources/ui-module/config.yaml
@@ -0,0 +1,22 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+name: Blueprint composer
+slug: ${project.artifactId}
+icon: fa-code-fork fa-flip-vertical
+types:
+- home-ui-module
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/blueprint-composer/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/new/ui-modules/blueprint-composer/src/main/webapp/WEB-INF/web.xml b/new/ui-modules/blueprint-composer/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000..c8d59e9
--- /dev/null
+++ b/new/ui-modules/blueprint-composer/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,64 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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.
+-->
+<web-app version="2.4"
+ xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
+ http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+
+ <description>Brooklyn Blueprint composer</description>
+ <display-name>Brooklyn Blueprint composer</display-name>
+ <welcome-file-list>
+ <welcome-file>index.html</welcome-file>
+ </welcome-file-list>
+
+ <listener>
+ <listener-class>org.apache.brooklyn.ui.modularity.module.api.UiModuleListener</listener-class>
+ </listener>
+
+ <!--FILTERS :: START-->
+ <filter>
+ <filter-name>ui-module-filter</filter-name>
+ <filter-class>org.apache.brooklyn.ui.modularity.module.api.UiModuleFilter</filter-class>
+ <init-param>
+ <param-name>Cache-Control</param-name>
+ <param-value>public, max-age=604800</param-value><!--Cache static content for 1 week-->
+ </init-param>
+ </filter>
+ <filter>
+ <filter-name>GzipFilter</filter-name>
+ <filter-class>org.eclipse.jetty.servlets.GzipFilter</filter-class>
+ <init-param>
+ <param-name>mimeTypes</param-name>
+ <param-value>text/html,text/plain,text/xml,application/xhtml+xml,text/css,application/javascript,image/svg+xml</param-value>
+ </init-param>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>ui-module-filter</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+ <filter-mapping>
+ <filter-name>GzipFilter</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+ <!--FILTERS :: END-->
+
+
+</web-app>
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/blueprint-composer/test/fixtures/brooklyn-api/v1/catalog/applications
----------------------------------------------------------------------
diff --git a/new/ui-modules/blueprint-composer/test/fixtures/brooklyn-api/v1/catalog/applications b/new/ui-modules/blueprint-composer/test/fixtures/brooklyn-api/v1/catalog/applications
new file mode 100644
index 0000000..d8a8c0b
--- /dev/null
+++ b/new/ui-modules/blueprint-composer/test/fixtures/brooklyn-api/v1/catalog/applications
@@ -0,0 +1,26 @@
+[
+ {
+ "symbolicName": "catalog-app1",
+ "version": "0.10.0-SNAPSHOT",
+ "name": "Catalog APP 1",
+ "description": "Catalog APP Description 1",
+ "id": "catalog-app1:0.10.0-SNAPSHOT",
+ "type": "catalog-app1"
+ },
+ {
+ "symbolicName": "catalog-app2",
+ "version": "0.10.0-SNAPSHOT",
+ "name": "Catalog APP 2",
+ "description": "Catalog APP Description 2",
+ "id": "catalog-app2:0.10.0-SNAPSHOT",
+ "type": "catalog-app2"
+ },
+ {
+ "symbolicName": "catalog-app3",
+ "version": "0.10.0-SNAPSHOT",
+ "name": "Catalog APP 3",
+ "description": "Catalog APP Description 3",
+ "id": "catalog-app3:0.10.0-SNAPSHOT",
+ "type": "catalog-app3"
+ }
+]
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/blueprint-composer/test/fixtures/brooklyn-api/v1/catalog/entities
----------------------------------------------------------------------
diff --git a/new/ui-modules/blueprint-composer/test/fixtures/brooklyn-api/v1/catalog/entities b/new/ui-modules/blueprint-composer/test/fixtures/brooklyn-api/v1/catalog/entities
new file mode 100644
index 0000000..8bce280
--- /dev/null
+++ b/new/ui-modules/blueprint-composer/test/fixtures/brooklyn-api/v1/catalog/entities
@@ -0,0 +1,81 @@
+[
+ {
+ "id": "com.example.TestEntityOne:0.10.0-SNAPSHOT",
+ "type": "com.example.TestEntityOne",
+ "symbolicName": "com.example.TestEntityOne",
+ "version": "0.10.0-SNAPSHOT",
+ "name": "TestEntityOne",
+ "config": [
+ {
+ "name": "test.entity.1.config1",
+ "label": "test.entity.1.config1",
+ "type": "java.lang.String",
+ "description": "Test Entity 1 Config1"
+ },
+ {
+ "name": "test.entity.1.config2",
+ "label": "test.entity.1.config2",
+ "type": "java.lang.Boolean",
+ "description": "Test Entity 1 Config2"
+ },
+ {
+ "name": "test.entity.1.config3",
+ "label": "test.entity.1.config3",
+ "type": "java.lang.Long",
+ "description": "Test Entity 1 Config3"
+ }
+ ]
+ },
+ {
+ "id": "com.example.TestEntityTwo:0.10.0-SNAPSHOT",
+ "type": "com.example.TestEntityTwo",
+ "symbolicName": "com.example.TestEntityTwo",
+ "name": "TestEntityTwo",
+ "config": [
+ {
+ "name": "test.entity.2.config1",
+ "label": "test.entity.2.config1",
+ "type": "java.lang.String",
+ "description": "Test Entity 2 Config1"
+ },
+ {
+ "name": "test.entity.2.config2",
+ "label": "test.entity.2.config2",
+ "type": "java.lang.Boolean",
+ "description": "Test Entity 2 Config2"
+ },
+ {
+ "name": "test.entity.2.config3",
+ "label": "test.entity.2.config3",
+ "type": "java.lang.Long",
+ "description": "Test Entity 2 Config3"
+ }
+ ]
+ },
+ {
+ "id": "com.example.TestEntityThree:0.10.0-SNAPSHOT",
+ "type": "com.example.TestEntityThree",
+ "symbolicName": "com.example.TestEntityThree",
+ "name": "TestEntityThree",
+ "config": [
+ {
+ "name": "test.entity.3.config1",
+ "label": "test.entity.3.config1",
+ "type": "java.lang.String",
+ "description": "Test Entity 3 Config1"
+ },
+ {
+ "name": "test.entity.3.config2",
+ "label": "test.entity.3.config2",
+ "type": "java.lang.Boolean",
+ "description": "Test Entity 1 Config2"
+ },
+ {
+ "name": "test.entity.3.config3",
+ "label": "test.entity.3.config3",
+ "type": "java.lang.Long",
+ "description": "Test Entity 3 Config3"
+ }
+ ]
+ }
+]
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/blueprint-composer/test/fixtures/brooklyn-api/v1/locations
----------------------------------------------------------------------
diff --git a/new/ui-modules/blueprint-composer/test/fixtures/brooklyn-api/v1/locations b/new/ui-modules/blueprint-composer/test/fixtures/brooklyn-api/v1/locations
new file mode 100644
index 0000000..0614afb
--- /dev/null
+++ b/new/ui-modules/blueprint-composer/test/fixtures/brooklyn-api/v1/locations
@@ -0,0 +1,14 @@
+[
+ {
+ "id": "tl1",
+ "name": "test-location-1"
+ },
+ {
+ "id": "tl2",
+ "name": "test-location-2"
+ },
+ {
+ "id": "tl3",
+ "name": "test-location-3"
+ }
+]
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/blueprint-composer/test/fixtures/test.yaml
----------------------------------------------------------------------
diff --git a/new/ui-modules/blueprint-composer/test/fixtures/test.yaml b/new/ui-modules/blueprint-composer/test/fixtures/test.yaml
new file mode 100644
index 0000000..b19511c
--- /dev/null
+++ b/new/ui-modules/blueprint-composer/test/fixtures/test.yaml
@@ -0,0 +1,25 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+a: b
+c:
+ d: e
+ f:
+ - a
+ - b
+ - c
+ - d: true
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/blueprint-composer/test/karma-test.shim.js
----------------------------------------------------------------------
diff --git a/new/ui-modules/blueprint-composer/test/karma-test.shim.js b/new/ui-modules/blueprint-composer/test/karma-test.shim.js
new file mode 100644
index 0000000..487f198
--- /dev/null
+++ b/new/ui-modules/blueprint-composer/test/karma-test.shim.js
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+Error.stackTraceLimit = Infinity;
+
+require('angular');
+require('angular-mocks');
+require('phantomjs-polyfill-object-assign');
+require('babel-polyfill');
+
+var testsContext = require.context('../app', true, /\.spec\.js$/);
+testsContext.keys().forEach(testsContext);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/blueprint-importer/.babelrc
----------------------------------------------------------------------
diff --git a/new/ui-modules/blueprint-importer/.babelrc b/new/ui-modules/blueprint-importer/.babelrc
new file mode 100644
index 0000000..222c2ba
--- /dev/null
+++ b/new/ui-modules/blueprint-importer/.babelrc
@@ -0,0 +1,6 @@
+{
+ "presets": [
+ "env",
+ "stage-0"
+ ]
+}
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/blueprint-importer/.eslintrc.json
----------------------------------------------------------------------
diff --git a/new/ui-modules/blueprint-importer/.eslintrc.json b/new/ui-modules/blueprint-importer/.eslintrc.json
new file mode 100644
index 0000000..c4fe470
--- /dev/null
+++ b/new/ui-modules/blueprint-importer/.eslintrc.json
@@ -0,0 +1,52 @@
+{
+ "__license__": [
+ "Licensed to the Apache Software Foundation (ASF) under one",
+ "or more contributor license agreements. See the NOTICE file",
+ "distributed with this work for additional information",
+ "regarding copyright ownership. The ASF licenses this file",
+ "to you 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."
+ ],
+ "extends": "google",
+ "rules": {
+ "indent": [
+ "error",
+ 4
+ ],
+ "max-len": [
+ "warn",
+ 120
+ ],
+ "space-before-function-paren": [
+ "error",
+ "always"
+ ],
+ "sort-imports": [
+ "error",
+ {
+ "ignoreCase": false,
+ "ignoreMemberSort": false,
+ "memberSyntaxSortOrder": [
+ "none",
+ "all",
+ "multiple",
+ "single"
+ ]
+ }
+ ],
+ "quotes": [
+ "error",
+ "single"
+ ]
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/blueprint-importer/.npmrc
----------------------------------------------------------------------
diff --git a/new/ui-modules/blueprint-importer/.npmrc b/new/ui-modules/blueprint-importer/.npmrc
new file mode 100644
index 0000000..c595d19
--- /dev/null
+++ b/new/ui-modules/blueprint-importer/.npmrc
@@ -0,0 +1,18 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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-lock=false
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/blueprint-importer/Makefile
----------------------------------------------------------------------
diff --git a/new/ui-modules/blueprint-importer/Makefile b/new/ui-modules/blueprint-importer/Makefile
new file mode 100755
index 0000000..c7cb424
--- /dev/null
+++ b/new/ui-modules/blueprint-importer/Makefile
@@ -0,0 +1,49 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+default: dev
+
+build:
+ @echo "Building production bundle..."
+ NODE_ENV="production" npm run build
+
+clean:
+ @echo "Cleaning modules..."
+ @rm -rf ./node_modules
+
+dev:
+ @echo "Starting dev web server..."
+ @npm start
+
+server: build
+ @echo "Starting api proxy server..."
+ NODE_ENV="production" npm start
+
+install:
+ @echo "Installing npm modules..."
+ @npm install
+
+test:
+ @echo "Running tests..."
+ @npm test
+
+setup: clean install
+
+war:
+ @mvn clean install
+
+.PHONY: build clean deploy dev install server setup test war
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/blueprint-importer/app/index.e2e-spec.js
----------------------------------------------------------------------
diff --git a/new/ui-modules/blueprint-importer/app/index.e2e-spec.js b/new/ui-modules/blueprint-importer/app/index.e2e-spec.js
new file mode 100644
index 0000000..02f3f38
--- /dev/null
+++ b/new/ui-modules/blueprint-importer/app/index.e2e-spec.js
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+const request = require('request');
+
+const APP_NAME = 'Blueprint importer';
+
+describe('App Shell', ()=> {
+ browser.get('./');
+ browser.waitForAngular();
+
+ describe('metadata', ()=> {
+ it('should have the correct title', ()=> {
+ expect(browser.getTitle()).toEqual('Brooklyn - ' + APP_NAME);
+ });
+ });
+});
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/blueprint-importer/app/index.html
----------------------------------------------------------------------
diff --git a/new/ui-modules/blueprint-importer/app/index.html b/new/ui-modules/blueprint-importer/app/index.html
new file mode 100644
index 0000000..0464f36
--- /dev/null
+++ b/new/ui-modules/blueprint-importer/app/index.html
@@ -0,0 +1,37 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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.
+-->
+<!doctype html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8"/>
+ <meta http-equiv="x-ua-compatible" content="ie=edge"/>
+ <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width"/>
+ <link rel="icon" type="image/png" href="${require('!!file-loader!<%= brand.product.favicon %>')}"/>
+ <title><%= getBrandedText('product.name') %> - <%= app.appname %></title>
+ </head>
+ <body ng-app="app" br-server-status ng-strict-di>
+ ${require('ejs-html!brooklyn-shared/partials/header.html')}
+
+ <main class="page-main-area" id="main-content" ui-view ng-cloak></main>
+
+ <br-interstitial-spinner event-count="1">
+ ${require('ejs-html!brooklyn-shared/partials/interstitial.html')}
+ </br-interstitial-spinner>
+ </body>
+</html>
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/blueprint-importer/app/index.js
----------------------------------------------------------------------
diff --git a/new/ui-modules/blueprint-importer/app/index.js b/new/ui-modules/blueprint-importer/app/index.js
new file mode 100644
index 0000000..71deea4
--- /dev/null
+++ b/new/ui-modules/blueprint-importer/app/index.js
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+import angular from 'angular';
+import ngAnimate from 'angular-animate';
+import ngCookies from 'angular-cookies';
+import ngResource from 'angular-resource';
+
+import brCore from 'brooklyn-ui-utils/br-core/br-core';
+
+import brServerStatus from 'brooklyn-ui-utils/server-status/server-status';
+import brInterstitialSpinner from 'brooklyn-ui-utils/interstitial-spinner/interstitial-spinner';
+import brooklynModuleLinks from 'brooklyn-ui-utils/module-links/module-links';
+import brooklynUserManagement from "brooklyn-ui-utils/user-management/user-management";
+
+import uiRouter from 'angular-ui-router';
+
+import mainState from 'views/main/main.controller.js';
+
+const IS_PRODUCTION = process.env.NODE_ENV === 'production' || false;
+
+angular.module('app', [ngAnimate, ngCookies, ngResource, brCore, brServerStatus, brInterstitialSpinner, brooklynModuleLinks, brooklynUserManagement, uiRouter, mainState])
+ .config(['$logProvider', '$compileProvider', appConfig])
+ .config(['$urlRouterProvider', routerConfig])
+ .run(['$rootScope', '$state', 'brSnackbar', errorHandler])
+ .run(['$http', httpConfig]);
+
+function appConfig($logProvider, $compileProvider) {
+ $logProvider.debugEnabled(!IS_PRODUCTION);
+ $compileProvider.debugInfoEnabled(!IS_PRODUCTION);
+}
+
+function routerConfig($urlRouterProvider) {
+ $urlRouterProvider.otherwise('/');
+}
+
+function errorHandler($rootScope, $state, brSnackbar) {
+ $rootScope.$on('$stateChangeError', (event, toState, toParams, fromState, fromParams, error)=> {
+ // Add error handling here
+ });
+}
+
+function httpConfig($http){
+ $http.defaults.headers.common['X-Csrf-Token-Required-For-Requests'] = 'write'; //Enables XSRF
+ // Add further $http config here
+}
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/blueprint-importer/app/index.less
----------------------------------------------------------------------
diff --git a/new/ui-modules/blueprint-importer/app/index.less b/new/ui-modules/blueprint-importer/app/index.less
new file mode 100644
index 0000000..58b65ea
--- /dev/null
+++ b/new/ui-modules/blueprint-importer/app/index.less
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+@import '~brooklyn-shared/style/first.less';
+
+// Add project less files here
+@import "views/main/main.less";
+
+// Load last so that these style rules and var values trump others
+@import "~brooklyn-shared/style/last.less";
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/blueprint-importer/app/index.spec.js
----------------------------------------------------------------------
diff --git a/new/ui-modules/blueprint-importer/app/index.spec.js b/new/ui-modules/blueprint-importer/app/index.spec.js
new file mode 100644
index 0000000..3bfde1b
--- /dev/null
+++ b/new/ui-modules/blueprint-importer/app/index.spec.js
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+describe('Blueprint importer module', () => {
+ it('has a dummy unit test', () => {
+ expect(true).toBeTruthy();
+ });
+});
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/blueprint-importer/app/views/main/bottom-sheet.less
----------------------------------------------------------------------
diff --git a/new/ui-modules/blueprint-importer/app/views/main/bottom-sheet.less b/new/ui-modules/blueprint-importer/app/views/main/bottom-sheet.less
new file mode 100644
index 0000000..054abdb
--- /dev/null
+++ b/new/ui-modules/blueprint-importer/app/views/main/bottom-sheet.less
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+@progress-border-radius: 0px;
+
+.bottom-sheet {
+ .progress {
+ margin-bottom: 0px;
+ }
+ .container-padding {
+ padding: 10px 15px;
+ overflow: hidden;
+
+ .bottom-sheet-links a {
+ margin-right: 10px;
+ }
+ }
+
+ .imported-item {
+ .imported-item-deploy {
+ opacity: 0;
+ visibility: hidden;
+ transition: opacity 0.3s ease;
+ }
+ &:hover .imported-item-deploy {
+ opacity: 1;
+ visibility: visible;
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/blueprint-importer/app/views/main/bottom-sheet.template.html
----------------------------------------------------------------------
diff --git a/new/ui-modules/blueprint-importer/app/views/main/bottom-sheet.template.html b/new/ui-modules/blueprint-importer/app/views/main/bottom-sheet.template.html
new file mode 100644
index 0000000..4eb67ae
--- /dev/null
+++ b/new/ui-modules/blueprint-importer/app/views/main/bottom-sheet.template.html
@@ -0,0 +1,62 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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.
+-->
+<uib-progressbar class="progress-striped active" type="info" ng-if="ctrl.loading"></uib-progressbar>
+
+<div class="container-padding">
+ <h4 ng-if="ctrl.loading">Importing...</h4>
+
+ <div ng-if="ctrl.imported">
+ <h4 class="text-success"><i class="fa fa-check-circle-o"></i> Blueprint imported successfully!</h4>
+ <p class="text-muted">
+ The following items have been imported successfully:
+ <ul class="fa-ul">
+ <li ng-repeat="(id, item) in ctrl.importedItems track by id" class="imported-item">
+ <i class="fa-li fa fa-check-square"></i>
+ <a ng-href="{{ctrl.getCatalogItemUrl(item)}}">{{item.symbolicName}}:{{item.version}}</a>
+ <a ng-href="{{ctrl.getDeployUrl(item)}}" ng-if="ctrl.canBeDeployed(item)" class="btn btn-success btn-xs imported-item-deploy">
+ {{item.itemType.toLowerCase() !== 'template' ? 'Compose and Deploy' : 'Deploy'}}
+ </a>
+ </li>
+ </ul>
+ </p>
+ <div class="text-right">
+ <button ng-click="ctrl.close()" class="btn btn-default">Close</button>
+ </div>
+ </div>
+
+ <div ng-if="ctrl.error">
+ <h4 class="text-danger">{{ctrl.error.title}}</h4>
+ <p nclass="text-muted">{{ctrl.error.message}}</p>
+ <p ng-if="ctrl.error.details" class="text-muted bottom-sheet-links">
+ <a class="text-danger" ng-click="ctrl.viewStackTrace = !ctrl.viewStackTrace">
+ <i class="fa fa-list-ul"></i> {{ctrl.viewStackTrace ? 'Hide' : 'View'}} stacktrace
+ </a>
+ <a class="text-muted" ngclipboard ngclipboard-success="ctrl.onClipboardSuccess(e)" ngclipboard-error="ctrl.onClipboardError(e)" data-clipboard-text="{{ctrl.error.details}}" uib-tooltip="Copied!" tooltip-trigger="{'copied': 'mouseleave'}" tooltip-placement="top">
+ <i class="fa fa-clipboard"></i> Copy stacktrace
+ </a>
+ </p>
+ <div ng-if="ctrl.error.details" tb-stack-viewer trace="ctrl.error.details" vendors="ctrl.vendors" uib-collapse="!ctrl.viewStackTrace"></div>
+
+ <div class="text-right">
+ <button ng-click="ctrl.investigate()" class="btn btn-default" title="Investigate issue"><i class="fa fa-search-minus" aria-hidden="true" aria-label="Investigate issue"></i></button>
+ <button ng-click="ctrl.close()" class="btn btn-danger">Dismiss</button>
+ </div>
+ </div>
+
+</div>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/blueprint-importer/app/views/main/main.controller.e2e-spec.js
----------------------------------------------------------------------
diff --git a/new/ui-modules/blueprint-importer/app/views/main/main.controller.e2e-spec.js b/new/ui-modules/blueprint-importer/app/views/main/main.controller.e2e-spec.js
new file mode 100644
index 0000000..570c75f
--- /dev/null
+++ b/new/ui-modules/blueprint-importer/app/views/main/main.controller.e2e-spec.js
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+describe('Brooklyn brooklyn-ui-blueprint-importer :: main view', ()=> {
+ let EC = protractor.ExpectedConditions;
+ let appLoadCondition = EC.stalenessOf(element(by.tagName('interstitial-spinner')));
+
+ describe('should do', ()=> {
+ browser.get('./');
+ browser.waitForAngular();
+ browser.wait(appLoadCondition, 5000);
+
+ it('something really useful', ()=> {
+ // This is an example of e2e test. It uses jasmine (http://jasmine.github.io/) syntax to define all tests to run.
+ });
+ })
+});
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/blueprint-importer/app/views/main/main.controller.js
----------------------------------------------------------------------
diff --git a/new/ui-modules/blueprint-importer/app/views/main/main.controller.js b/new/ui-modules/blueprint-importer/app/views/main/main.controller.js
new file mode 100644
index 0000000..b92b644
--- /dev/null
+++ b/new/ui-modules/blueprint-importer/app/views/main/main.controller.js
@@ -0,0 +1,151 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+import angular from 'angular';
+import ngClipboard from 'ngclipboard';
+import stackViewer from 'angular-java-stack-viewer';
+import brYamlEditor from 'brooklyn-ui-utils/yaml-editor/yaml-editor';
+import brBottomSheet from 'brooklyn-ui-utils/bottom-sheet/bottom-sheet';
+import {catalogApiProvider} from 'brooklyn-ui-utils/providers/catalog-api.provider';
+import {HIDE_INTERSTITIAL_SPINNER_EVENT} from "brooklyn-ui-utils/interstitial-spinner/interstitial-spinner";
+import template from './main.template.html';
+import bottomSheetTemplate from './bottom-sheet.template.html';
+
+const MODULE_NAME = 'main.state';
+
+angular.module(MODULE_NAME, [ngClipboard, stackViewer, brYamlEditor, brBottomSheet])
+ .provider('catalogApi', catalogApiProvider)
+ .config(['$stateProvider', mainStateConfig]);
+
+export default MODULE_NAME;
+
+export const mainState = {
+ name: 'main',
+ url: '/?yaml',
+ params: {
+ yaml: {value: ''}
+ },
+ template: template,
+ controller: ['$scope', '$stateParams', 'brBottomSheet', mainController],
+ controllerAs: 'ctrl'
+};
+
+export function mainStateConfig($stateProvider) {
+ $stateProvider.state(mainState);
+}
+
+export function mainController ($scope, $stateParams, brBottomSheet) {
+ $scope.$emit(HIDE_INTERSTITIAL_SPINNER_EVENT);
+
+ this.yaml = $stateParams.yaml;
+
+ this.import = ()=> {
+ let options = {
+ controller: ['$log', 'brBrandInfo', 'brBottomSheetInstance', 'catalogApi', 'brSnackbar', 'yaml', bottomSheetController],
+ controllerAs: 'ctrl',
+ template: bottomSheetTemplate,
+ resolve: {
+ yaml: ()=>(this.yaml)
+ }
+ };
+ brBottomSheet.open(options);
+ };
+
+}
+
+function bottomSheetController($log, brBrandInfo, brBottomSheetInstance, catalogApi, brSnackbar, yaml) {
+ this.loading = true;
+ this.imported = false;
+ this.vendors = brBrandInfo.getVendorPackages();
+
+ this.close = ()=> {
+ brBottomSheetInstance.close('User closed the bottom sheet');
+ };
+ this.investigate = ()=> {
+ brBottomSheetInstance.updateMode('inset');
+ };
+ this.onClipboardSuccess = (e)=> {
+ angular.element(e.trigger).triggerHandler('copied');
+ e.clearSelection();
+ };
+ this.onClipboardError = (e)=> {
+ let message = '';
+ let actionKey = e.action === 'cut' ? 'X' : 'C';
+ if(/iPhone|iPad/i.test(navigator.userAgent)) {
+ message = 'No support :(';
+ }
+ else if(/Mac/i.test(navigator.userAgent)) {
+ message = 'Press ⌘-' + actionKey + ' to ' + e.action;
+ }
+ else {
+ message = 'Press Ctrl-' + actionKey + ' to ' + e.action;
+ }
+ brSnackbar.create(message);
+ };
+
+ this.getCatalogItemUrl = (item)=> {
+ switch (item.itemType.toLowerCase()) {
+ case 'template':
+ case 'entity':
+ case 'policy':
+ let bundle = item.containingBundle.split(':');
+ return `/brooklyn-ui-catalog/#!/bundles/${bundle[0]}/${bundle[1]}/types/${item.symbolicName}/${item.version}`;
+ case 'location':
+ return `/brooklyn-ui-location-manager/#!/location?symbolicName=${item.symbolicName}&version=${item.version}`;
+ default:
+ return;
+ }
+ };
+ this.getDeployUrl = (item)=> {
+ switch (item.itemType.toLowerCase()) {
+ case 'template':
+ let bundle = item.containingBundle.split(':');
+ return `/#!/deploy/${bundle[0]}/${bundle[1]}/${item.symbolicName}/${item.version}`;
+ case 'entity':
+ let yaml = {
+ name: item.name,
+ services: [{
+ type: item.symbolicName + ':' + item.version
+ }]
+ };
+ return '/brooklyn-ui-blueprint-composer/#!/graphical?yaml=' + JSON.stringify(yaml);
+ default:
+ return;
+ }
+ };
+ this.canBeDeployed = (item)=> {
+ return ['template', 'entity'].indexOf(item.itemType.toLowerCase()) > -1;
+ };
+
+ catalogApi.create(yaml).then((response)=> {
+ $log.info('Blueprint import ... success ', response);
+ this.imported = true;
+ this.importedItems = response;
+ }).catch((response)=> {
+ $log.error('Blueprint import ... error ', response);
+ this.error = {
+ title: 'Blueprint import failed',
+ message: response.error.message,
+ details: response.error.details
+ };
+ }).finally(()=> {
+ this.loading = false;
+ });
+}
+
+
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/blueprint-importer/app/views/main/main.less
----------------------------------------------------------------------
diff --git a/new/ui-modules/blueprint-importer/app/views/main/main.less b/new/ui-modules/blueprint-importer/app/views/main/main.less
new file mode 100644
index 0000000..3e3b882
--- /dev/null
+++ b/new/ui-modules/blueprint-importer/app/views/main/main.less
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+@import "~brooklyn-ui-utils/yaml-editor/yaml-editor";
+@import "~brooklyn-ui-utils/bottom-sheet/bottom-sheet";
+@import "./bottom-sheet";
+
+.navbar-default {
+ margin-bottom: 0;
+}
+
+br-yaml-editor .CodeMirror {
+ height: calc(~"100vh - @{navbar-height}");
+}
+
+.btn-import {
+ position: absolute;
+ bottom: 15px;
+ right: 15px;
+ z-index: 100;
+}
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/blueprint-importer/app/views/main/main.template.html
----------------------------------------------------------------------
diff --git a/new/ui-modules/blueprint-importer/app/views/main/main.template.html b/new/ui-modules/blueprint-importer/app/views/main/main.template.html
new file mode 100644
index 0000000..249473d
--- /dev/null
+++ b/new/ui-modules/blueprint-importer/app/views/main/main.template.html
@@ -0,0 +1,21 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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.
+-->
+<br-yaml-editor value="ctrl.yaml" type="catalog"></br-yaml-editor>
+
+<button ng-click="ctrl.import()" class="btn btn-lg btn-success btn-import">Import</button>
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/blueprint-importer/config/build/webpack.config.js
----------------------------------------------------------------------
diff --git a/new/ui-modules/blueprint-importer/config/build/webpack.config.js b/new/ui-modules/blueprint-importer/config/build/webpack.config.js
new file mode 100644
index 0000000..a050fa9
--- /dev/null
+++ b/new/ui-modules/blueprint-importer/config/build/webpack.config.js
@@ -0,0 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+eval(require('fs').readFileSync('../shared/config/build/webpack.config.js')+'');
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/blueprint-importer/config/server.js
----------------------------------------------------------------------
diff --git a/new/ui-modules/blueprint-importer/config/server.js b/new/ui-modules/blueprint-importer/config/server.js
new file mode 100644
index 0000000..dfba7dc
--- /dev/null
+++ b/new/ui-modules/blueprint-importer/config/server.js
@@ -0,0 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+eval(require('fs').readFileSync('../shared/config/server.js')+'');
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/blueprint-importer/config/test/karma.config.js
----------------------------------------------------------------------
diff --git a/new/ui-modules/blueprint-importer/config/test/karma.config.js b/new/ui-modules/blueprint-importer/config/test/karma.config.js
new file mode 100644
index 0000000..6fc6558
--- /dev/null
+++ b/new/ui-modules/blueprint-importer/config/test/karma.config.js
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+const PRODUCTION_BUILD = process.env.NODE_ENV === 'production';
+const webpackConfig = require('./../build/webpack.config.js');
+
+module.exports = function (config) {
+ const conf = {
+ basePath: '',
+ frameworks: ['jasmine'],
+ files: [
+ {pattern: './karma.test.shim.js', watched: false}
+ ],
+ preprocessors: {
+ './karma.test.shim.js': ['webpack', 'sourcemap']
+ },
+ webpack: Object.assign({}, webpackConfig, {entry: undefined, plugins: undefined}),
+ webpackMiddleware: {
+ stats: 'errors-only'
+ },
+ webpackServer: {
+ noInfo: true
+ },
+ exclude: [],
+ colors: !PRODUCTION_BUILD,
+ logLevel: config.LOG_INFO,
+ autoWatch: !PRODUCTION_BUILD,
+ singleRun: PRODUCTION_BUILD,
+ reporters: ['progress'],
+ browsers: ['PhantomJS'],
+ plugins: [
+ require('karma-webpack'),
+ require('karma-sourcemap-loader'),
+ 'karma-jasmine',
+ 'karma-phantomjs-launcher'
+ ],
+ failOnEmptyTestSuite: false
+ };
+ config.set(conf);
+};
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/blueprint-importer/config/test/karma.test.shim.js
----------------------------------------------------------------------
diff --git a/new/ui-modules/blueprint-importer/config/test/karma.test.shim.js b/new/ui-modules/blueprint-importer/config/test/karma.test.shim.js
new file mode 100644
index 0000000..3d926c0
--- /dev/null
+++ b/new/ui-modules/blueprint-importer/config/test/karma.test.shim.js
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+Error.stackTraceLimit = Infinity;
+
+require('angular');
+require('angular-mocks');
+require('babel-polyfill');
+
+var testsContext = require.context('./../../app', true, /\.spec\.js$/);
+testsContext.keys().forEach(testsContext);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/blueprint-importer/config/test/protractor.config.js
----------------------------------------------------------------------
diff --git a/new/ui-modules/blueprint-importer/config/test/protractor.config.js b/new/ui-modules/blueprint-importer/config/test/protractor.config.js
new file mode 100644
index 0000000..5274c81
--- /dev/null
+++ b/new/ui-modules/blueprint-importer/config/test/protractor.config.js
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+exports.config = {
+ framework: 'jasmine2',
+ seleniumAddress: 'http://localhost:4444/wd/hub',
+ specs: ['../../app/**/*.e2e-spec.js'],
+ baseUrl: 'http://admin:password@localhost:8080',
+ capabilities: {
+ 'browserName': 'chrome',
+ 'chromeOptions': {
+ 'args': ['--window-size=1440,1000']
+ }
+ },
+ onPrepare: function () {
+ require('babel-register');
+ },
+ jasmineNodeOpts: {
+ // If true, print colors to the terminal.
+ showColors: true,
+ // Default time to wait in ms before a test fails.
+ defaultTimeoutInterval: 30000
+ }
+};
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/blueprint-importer/package.json
----------------------------------------------------------------------
diff --git a/new/ui-modules/blueprint-importer/package.json b/new/ui-modules/blueprint-importer/package.json
new file mode 100644
index 0000000..04b588f
--- /dev/null
+++ b/new/ui-modules/blueprint-importer/package.json
@@ -0,0 +1,105 @@
+{
+ "__license__": [
+ "Licensed to the Apache Software Foundation (ASF) under one",
+ "or more contributor license agreements. See the NOTICE file",
+ "distributed with this work for additional information",
+ "regarding copyright ownership. The ASF licenses this file",
+ "to you 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."
+ ],
+ "name": "brooklyn-ui-blueprint-importer",
+ "versionBuildNote": "BROOKLYN_VERSION_BELOW this exists so scripts update this automatically",
+ "version": "1.0.0-SNAPSHOT",
+ "description": "Brooklyn UI :: Modules - Blueprint importer",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/apache/brooklyn-ui.git"
+ },
+ "author": "Apache Software Foundation",
+ "license": "Apache-2.0",
+ "scripts": {
+ "build": "rimraf dist && webpack --config ./config/build/webpack.config.js --bail",
+ "start": "node ./config/server.js",
+ "test": "karma start ./config/test/karma.config.js",
+ "lint": "./node_modules/.bin/eslint app/**/*.js",
+ "e2e": "protractor ./config/test/protractor.config.js"
+ },
+ "engines": {
+ "node": ">=8.0.0",
+ "npm": ">=5.0.0"
+ },
+ "brooklyn": {
+ "appname": "Blueprint importer"
+ },
+ "dependencies": {
+ "brooklyn-ui-utils": "file:../utils",
+ "angular": "^1.6.1",
+ "angular-animate": "^1.6.1",
+ "angular-cookies": "^1.6.1",
+ "angular-java-stack-viewer": "^1.0.1",
+ "angular-resource": "^1.6.1",
+ "angular-ui-bootstrap": "^2.5.0",
+ "angular-ui-router": "^0.3.1",
+ "bootstrap": "^3.3.7",
+ "es6-promise": "^4.0.5",
+ "font-awesome": "^4.6.3",
+ "isomorphic-fetch": "^2.2.1",
+ "lodash": "^4.16.4",
+ "ngclipboard": "^1.1.1",
+ "normalizr": "^2.2.1"
+ },
+ "devDependencies": {
+ "angular-mocks": "^1.6.1",
+ "autoprefixer": "^6.5.1",
+ "babel-core": "^6.17.0",
+ "babel-loader": "^6.2.5",
+ "babel-polyfill": "^6.20.0",
+ "babel-preset-env": "^1.6.0",
+ "babel-preset-stage-0": "^6.16.0",
+ "css-loader": "^0.25.0",
+ "dotenv": "^2.0.0",
+ "ejs": "^2.5.2",
+ "ejs-html-loader": "^2.0.2",
+ "ejs-loader": "^0.3.0",
+ "eslint": "^3.8.1",
+ "exports-loader": "^0.6.3",
+ "expose-loader": "^0.7.1",
+ "express": "^4.14.0",
+ "extract-text-webpack-plugin": "^1.0.1",
+ "file-loader": "^0.9.0",
+ "html-loader": "^0.4.4",
+ "html-webpack-plugin": "^2.22.0",
+ "image-webpack-loader": "^3.0.0",
+ "imports-loader": "^0.6.5",
+ "jasmine-core": "^2.5.2",
+ "karma": "^1.3.0",
+ "karma-jasmine": "^1.0.2",
+ "karma-phantomjs-launcher": "^1.0.2",
+ "karma-sourcemap-loader": "^0.3.7",
+ "karma-webpack": "^1.8.0",
+ "less": "^2.7.1",
+ "less-loader": "^2.2.3",
+ "less-vars-to-js": "^1.1.2",
+ "phantomjs-prebuilt": "^2.1.13",
+ "postcss-loader": "^1.0.0",
+ "properties-reader": "0.0.15",
+ "proxy-middleware": "^0.15.0",
+ "raw-loader": "^0.5.1",
+ "resolve-url-loader": "^1.6.0",
+ "rimraf": "^2.5.4",
+ "style-loader": "^0.13.1",
+ "url": "^0.11.0",
+ "url-loader": "^0.5.7",
+ "webpack": "^1.13.2",
+ "webpack-dev-middleware": "^1.8.4",
+ "webpack-hot-middleware": "^2.13.0"
+ }
+}
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/blueprint-importer/pom.xml
----------------------------------------------------------------------
diff --git a/new/ui-modules/blueprint-importer/pom.xml b/new/ui-modules/blueprint-importer/pom.xml
new file mode 100644
index 0000000..fa0ed73
--- /dev/null
+++ b/new/ui-modules/blueprint-importer/pom.xml
@@ -0,0 +1,128 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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>
+
+ <parent>
+ <artifactId>brooklyn-ui-modules-parent</artifactId>
+ <groupId>org.apache.brooklyn.ui.modules</groupId>
+ <version>${revision}</version>
+ </parent>
+
+ <artifactId>brooklyn-ui-blueprint-importer</artifactId>
+ <packaging>war</packaging>
+ <name>Brooklyn UI :: Modules - Blueprint importer</name>
+
+ <build>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <artifactId>maven-clean-plugin</artifactId>
+ <configuration>
+ <filesets>
+ <fileset>
+ <directory>dist</directory>
+ <followSymlinks>false</followSymlinks>
+ </fileset>
+ </filesets>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>com.github.eirslett</groupId>
+ <artifactId>frontend-maven-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <artifactId>maven-resources-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy-resources</id>
+ <!-- here the phase you need -->
+ <phase>compile</phase>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>
+ ${project.build.directory}/${project.artifactId}-${project.version}
+ </outputDirectory>
+ <resources>
+ <resource>
+ <directory>${project.basedir}/dist</directory>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-war-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
+ </archive>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <extensions>true</extensions>
+ <!-- configure plugin to generate MANIFEST.MF
+ adapted from http://blog.knowhowlab.org/2010/06/osgi-tutorial-from-project-structure-to.html -->
+ <executions>
+ <execution>
+ <id>bundle-manifest</id>
+ <phase>process-classes</phase>
+ <goals>
+ <goal>manifest</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <supportedProjectTypes>
+ <supportedProjectType>war</supportedProjectType>
+ <supportedProjectType>jar</supportedProjectType>
+ <supportedProjectType>bundle</supportedProjectType>
+ </supportedProjectTypes>
+ <instructions>
+ <Bundle-ManifestVersion>${project.version}</Bundle-ManifestVersion>
+ <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
+ <Import-Package>
+ org.apache.brooklyn.ui.modularity.module.api,
+ org.eclipse.jetty.servlets,
+ *
+ </Import-Package>
+ <Export-Package>
+ !*
+ </Export-Package>
+ <Web-ContextPath>/${project.artifactId}</Web-ContextPath>
+ <_wab>app</_wab>
+ </instructions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/blueprint-importer/src/main/resources/ui-module/config.yaml
----------------------------------------------------------------------
diff --git a/new/ui-modules/blueprint-importer/src/main/resources/ui-module/config.yaml b/new/ui-modules/blueprint-importer/src/main/resources/ui-module/config.yaml
new file mode 100644
index 0000000..dcc5445
--- /dev/null
+++ b/new/ui-modules/blueprint-importer/src/main/resources/ui-module/config.yaml
@@ -0,0 +1,22 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+name: Blueprint importer
+slug: ${project.artifactId}
+icon: fa-upload
+types:
+- home-ui-module
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/blueprint-importer/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/new/ui-modules/blueprint-importer/src/main/webapp/WEB-INF/web.xml b/new/ui-modules/blueprint-importer/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000..7316240
--- /dev/null
+++ b/new/ui-modules/blueprint-importer/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,64 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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.
+-->
+<web-app version="2.4"
+ xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
+ http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+
+ <description>Brooklyn Blueprint importer</description>
+ <display-name>Brooklyn Blueprint importer</display-name>
+ <welcome-file-list>
+ <welcome-file>index.html</welcome-file>
+ </welcome-file-list>
+
+ <listener>
+ <listener-class>org.apache.brooklyn.ui.modularity.module.api.UiModuleListener</listener-class>
+ </listener>
+
+ <!--FILTERS :: START-->
+ <filter>
+ <filter-name>ui-module-filter</filter-name>
+ <filter-class>org.apache.brooklyn.ui.modularity.module.api.UiModuleFilter</filter-class>
+ <init-param>
+ <param-name>Cache-Control</param-name>
+ <param-value>public, max-age=604800</param-value><!--Cache static content for 1 week-->
+ </init-param>
+ </filter>
+ <filter>
+ <filter-name>GzipFilter</filter-name>
+ <filter-class>org.eclipse.jetty.servlets.GzipFilter</filter-class>
+ <init-param>
+ <param-name>mimeTypes</param-name>
+ <param-value>text/html,text/plain,text/xml,application/xhtml+xml,text/css,application/javascript,image/svg+xml</param-value>
+ </init-param>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>ui-module-filter</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+ <filter-mapping>
+ <filter-name>GzipFilter</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+ <!--FILTERS :: END-->
+
+
+</web-app>
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/branding/.babelrc
----------------------------------------------------------------------
diff --git a/new/ui-modules/branding/.babelrc b/new/ui-modules/branding/.babelrc
new file mode 100644
index 0000000..9d2089b
--- /dev/null
+++ b/new/ui-modules/branding/.babelrc
@@ -0,0 +1,3 @@
+{
+ "presets": []
+}
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/branding/brand.js
----------------------------------------------------------------------
diff --git a/new/ui-modules/branding/brand.js b/new/ui-modules/branding/brand.js
new file mode 100644
index 0000000..b38a221
--- /dev/null
+++ b/new/ui-modules/branding/brand.js
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+/* File where brands can provide JS extensions available as angular modules.
+ * If supplied, they must supply all elements declared by the stock Brooklyn implementation.
+ * It can be omitted from a brand.
+ *
+ * The entries returned by the `brBrandInfoProvider` here can be accessed in `brBrandInfo` by passing that module to an angular module.
+ */
+
+import angular from "angular";
+
+const MODULE_NAME = 'brooklyn.brand.extensionPoint.default';
+
+angular.module(MODULE_NAME, [])
+ .factory('brBrandInfo', brBrandInfoProvider);
+
+export default MODULE_NAME;
+
+const BRAND_PROPS = __BRAND_PROPS__; //injected by webpack
+
+export function brBrandInfoProviderDefault() {
+ return {
+ getVendorPackages: function() {
+ return {
+ 'Java/Sun/Oracle': ['java', 'javax', 'sun', 'sunw', 'com.sun', 'com.oracle'],
+ 'Apache CXF': ['org.apache.cxf'],
+ 'Apache log4j': ['org.apache.log4j'],
+ 'Apache Brooklyn': ['org.apache.brooklyn', 'io.brooklyn'],
+ 'Apache': ['org.apache'],
+ 'slf4j': ['org.slf4j'],
+ 'Jetty': ['org.eclipse.jetty', 'org.mortbay'],
+ };
+ },
+ getBrandedText: function (key, defaultValue) {
+ return key.split('.').reduce(function(o, x) {
+ return o ? o[x] : undefined;
+ }, BRAND_PROPS);
+ },
+ getAppDeployedUrl: function (appId, entityId) {
+ return '/brooklyn-ui-app-inspector/#!/application/' + appId + '/entity/' + entityId + '/summary';
+ },
+ };
+}
+
+export function brBrandInfoProvider() {
+ // for extensions to customize
+ return brBrandInfoProviderDefault();
+}
\ No newline at end of file