Procházet zdrojové kódy

Revert "AMBARI-15829. Files View: Extract the directory viewer UI component so that other views can use it. (dipayanb)"

This reverts commit 281307fceb533c1a557d9972991263546288bb41.
Alex Antonenko před 9 roky
rodič
revize
6f340ec2d9
68 změnil soubory, kde provedl 102 přidání a 1838 odebrání
  1. 0 84
      contrib/views/commons/README.md
  2. 0 140
      contrib/views/commons/pom.xml
  3. 0 106
      contrib/views/commons/src/main/java/org/apache/ambari/view/commons/hdfs/UserService.java
  4. 0 4
      contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/.bowerrc
  5. 0 34
      contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/.editorconfig
  6. 0 27
      contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/.ember-cli
  7. 0 17
      contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/.gitignore
  8. 0 32
      contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/.jshintrc
  9. 0 30
      contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/.npmignore
  10. 0 50
      contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/.travis.yml
  11. 0 21
      contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/.watchmanconfig
  12. 0 28
      contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/LICENSE.md
  13. 0 97
      contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/README.md
  14. 0 0
      contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/addon/.gitkeep
  15. 0 196
      contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/addon/components/directory-viewer.js
  16. 0 18
      contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/addon/templates/components/directory-viewer.hbs
  17. 0 59
      contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/addon/utils/viewer-config.js
  18. 0 0
      contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/app/.gitkeep
  19. 0 19
      contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/app/components/directory-viewer.js
  20. 0 19
      contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/app/utils/viewer-config.js
  21. 0 19
      contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/bower.json
  22. 0 54
      contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/config/ember-try.js
  23. 0 24
      contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/config/environment.js
  24. 0 36
      contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/ember-cli-build.js
  25. 0 32
      contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/index.js
  26. 0 51
      contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/package.json
  27. 0 12
      contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/testem.json
  28. 0 52
      contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/tests/.jshintrc
  29. 0 36
      contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/tests/dummy/app/app.js
  30. 0 0
      contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/tests/dummy/app/components/.gitkeep
  31. 0 0
      contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/tests/dummy/app/controllers/.gitkeep
  32. 0 32
      contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/tests/dummy/app/controllers/application.js
  33. 0 0
      contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/tests/dummy/app/helpers/.gitkeep
  34. 0 43
      contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/tests/dummy/app/index.html
  35. 0 0
      contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/tests/dummy/app/models/.gitkeep
  36. 0 29
      contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/tests/dummy/app/router.js
  37. 0 0
      contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/tests/dummy/app/routes/.gitkeep
  38. 0 23
      contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/tests/dummy/app/styles/app.css
  39. 0 36
      contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/tests/dummy/app/templates/application.hbs
  40. 0 0
      contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/tests/dummy/app/templates/components/.gitkeep
  41. 0 35
      contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/tests/dummy/app/utils/my-viewer-config.js
  42. 0 65
      contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/tests/dummy/config/environment.js
  43. 0 15
      contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/tests/dummy/public/crossdomain.xml
  44. 0 3
      contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/tests/dummy/public/robots.txt
  45. 0 23
      contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/tests/helpers/destroy-app.js
  46. 0 41
      contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/tests/helpers/module-for-acceptance.js
  47. 0 29
      contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/tests/helpers/resolver.js
  48. 0 36
      contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/tests/helpers/start-app.js
  49. 0 52
      contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/tests/index.html
  50. 0 0
      contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/tests/integration/.gitkeep
  51. 0 24
      contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/tests/test-helper.js
  52. 0 0
      contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/tests/unit/.gitkeep
  53. 0 0
      contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/vendor/.gitkeep
  54. 0 5
      contrib/views/files/pom.xml
  55. 4 4
      contrib/views/files/src/main/java/org/apache/ambari/view/filebrowser/DownloadService.java
  56. 2 11
      contrib/views/files/src/main/java/org/apache/ambari/view/filebrowser/FileBrowserService.java
  57. 18 13
      contrib/views/files/src/main/java/org/apache/ambari/view/filebrowser/FileOperationService.java
  58. 3 4
      contrib/views/files/src/main/java/org/apache/ambari/view/filebrowser/FilePreviewService.java
  59. 2 2
      contrib/views/files/src/main/java/org/apache/ambari/view/filebrowser/HdfsService.java
  60. 66 1
      contrib/views/files/src/main/java/org/apache/ambari/view/filebrowser/HelpService.java
  61. 2 3
      contrib/views/files/src/main/java/org/apache/ambari/view/filebrowser/UploadService.java
  62. 1 1
      contrib/views/files/src/main/java/org/apache/ambari/view/filebrowser/utils/MisconfigurationFormattedException.java
  63. 1 1
      contrib/views/files/src/main/java/org/apache/ambari/view/filebrowser/utils/NotFoundFormattedException.java
  64. 1 1
      contrib/views/files/src/main/java/org/apache/ambari/view/filebrowser/utils/ServiceFormattedException.java
  65. 2 2
      contrib/views/files/src/main/resources/ui/app/services/file-operation.js
  66. 0 5
      contrib/views/files/src/main/resources/ui/package.json
  67. 0 1
      contrib/views/files/src/test/java/org/apache/ambari/view/filebrowser/FilebrowserTest.java
  68. 0 1
      contrib/views/pom.xml

+ 0 - 84
contrib/views/commons/README.md

@@ -1,84 +0,0 @@
-<!---
-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](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.
--->
-
-#Ambari Views Commons Module
-
-Have this as a dependency in the view which need the functionality.
-
-This has common code for:
-
-* HDFS access
-
-**Note: More to be added later**
-
-### How to Include it in dependant project
-
-In the service class for the project use `commons` projects code in the way described in the below example for `files` view.
-
-```java
-package org.apache.ambari.view.filebrowser;
-
-import javax.ws.rs.Path;
-
-import org.apache.ambari.view.ViewContext;
-
-import com.google.inject.Inject;
-import org.apache.ambari.view.commons.hdfs.FileOperationService;
-import org.apache.ambari.view.commons.hdfs.UploadService;
-import org.apache.ambari.view.commons.hdfs.UserService;
-
-/**
- * Root files service
- */
-public class FileBrowserService {
-
-  @Inject
-  ViewContext context;
-
-  /**
-   * @see UploadService
-   * @return service
-   */
-  @Path("/upload")
-  public UploadService upload() {
-    return new UploadService(context);
-  }
-
-  /**
-   * @see org.apache.ambari.view.commons.hdfs.FileOperationService
-   * @return service
-   */
-  @Path("/fileops")
-  public FileOperationService fileOps() {
-    return new FileOperationService(context);
-  }
-
-  /**
-   * @see org.apache.ambari.view.commons.hdfs.UserService
-   * @return service
-   */
-  @Path("/user")
-  public UserService userService() { return new UserService(context); }
-
-}
-```
-
-
-####Also, look into the various ember addons that are included in `src/main/resources/ui`.
-Currently we have:
-
-* hdfs-directory-viewer
-
-**More to be added later**

+ 0 - 140
contrib/views/commons/pom.xml

@@ -1,140 +0,0 @@
-<?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>
-  <artifactId>ambari-views-commons</artifactId>
-  <version>2.0.0.0-SNAPSHOT</version>
-  <name>Ambari View Commons</name>
-
-  <parent>
-    <artifactId>ambari-contrib-views</artifactId>
-    <groupId>org.apache.ambari.contrib.views</groupId>
-    <version>2.0.0.0-SNAPSHOT</version>
-  </parent>
-
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.ambari.contrib.views</groupId>
-      <artifactId>ambari-views-utils</artifactId>
-      <version>2.0.0.0-SNAPSHOT</version>
-    </dependency>
-
-    <dependency>
-      <groupId>org.apache.ambari</groupId>
-      <artifactId>ambari-views</artifactId>
-      <scope>provided</scope>
-    </dependency>
-
-    <dependency>
-      <groupId>org.apache.hadoop</groupId>
-      <artifactId>hadoop-hdfs</artifactId>
-      <version>${hadoop.version}</version>
-      <exclusions>
-        <exclusion>
-          <groupId>tomcat</groupId>
-          <artifactId>jasper-runtime</artifactId>
-        </exclusion>
-      </exclusions>
-    </dependency>
-
-    <dependency>
-      <groupId>org.apache.hadoop</groupId>
-      <artifactId>hadoop-common</artifactId>
-      <version>${hadoop.version}</version>
-      <exclusions>
-        <exclusion>
-          <groupId>tomcat</groupId>
-          <artifactId>jasper-runtime</artifactId>
-        </exclusion>
-      </exclusions>
-    </dependency>
-
-    <dependency>
-      <groupId>com.google.inject</groupId>
-      <artifactId>guice</artifactId>
-    </dependency>
-
-    <dependency>
-      <groupId>com.googlecode.json-simple</groupId>
-      <artifactId>json-simple</artifactId>
-    </dependency>
-
-    <dependency>
-      <groupId>com.sun.jersey.contribs</groupId>
-      <artifactId>jersey-multipart</artifactId>
-    </dependency>
-
-    <dependency>
-      <groupId>org.glassfish.jersey.containers</groupId>
-      <artifactId>jersey-container-servlet</artifactId>
-      <scope>provided</scope>
-    </dependency>
-
-    <dependency>
-      <groupId>commons-io</groupId>
-      <artifactId>commons-io</artifactId>
-      <version>2.4</version>
-    </dependency>
-
-    <!-- Testing -->
-    <dependency>
-      <groupId>com.sun.jersey.jersey-test-framework</groupId>
-      <artifactId>jersey-test-framework-core</artifactId>
-      <scope>test</scope>
-    </dependency>
-
-    <dependency>
-      <groupId>org.apache.hadoop</groupId>
-      <artifactId>hadoop-minicluster</artifactId>
-      <version>${hadoop.version}</version>
-      <scope>test</scope>
-    </dependency>
-
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <scope>test</scope>
-    </dependency>
-
-    <dependency>
-      <groupId>org.easymock</groupId>
-      <artifactId>easymock</artifactId>
-      <scope>test</scope>
-    </dependency>
-  </dependencies>
-
-  <build>
-    <resources>
-      <resource>
-        <directory>src/main/resources/</directory>
-        <filtering>false</filtering>
-        <excludes>
-          <exclude>ui/**</exclude>
-        </excludes>
-      </resource>
-    </resources>
-  </build>
-
-  <properties>
-    <ambari.dir>${project.parent.parent.parent.basedir}</ambari.dir>
-  </properties>
-</project>

+ 0 - 106
contrib/views/commons/src/main/java/org/apache/ambari/view/commons/hdfs/UserService.java

@@ -1,106 +0,0 @@
-/**
- * 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 org.apache.ambari.view.commons.hdfs;
-
-import org.apache.ambari.view.ViewContext;
-import org.apache.ambari.view.commons.exceptions.NotFoundFormattedException;
-import org.apache.ambari.view.commons.exceptions.ServiceFormattedException;
-import org.apache.ambari.view.utils.hdfs.HdfsApi;
-
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import java.io.FileNotFoundException;
-
-/**
- * User related info service
- */
-public class UserService extends HdfsService {
-
-  /**
-   * Constructor
-   * @param context View Context instance
-   */
-  public UserService(ViewContext context) {
-    super(context);
-  }
-
-  /**
-   * Returns home directory
-   * @return home directory
-   */
-  @GET
-  @Path("/home")
-  @Produces(MediaType.APPLICATION_JSON)
-  public Response homeDir() {
-    try {
-      HdfsApi api = getApi(context);
-      return Response
-        .ok(getApi(context).fileStatusToJSON(api.getFileStatus(api.getHomeDir()
-          .toString()))).build();
-    } catch (WebApplicationException ex) {
-      throw ex;
-    } catch (Exception ex) {
-      throw new ServiceFormattedException(ex.getMessage(), ex);
-    }
-  }
-
-  /**
-   * Is trash enabled
-   * @return is trash enabled
-   */
-  @GET
-  @Path("/trash/enabled")
-  @Produces(MediaType.APPLICATION_JSON)
-  public Response trashEnabled() {
-    try {
-      HdfsApi api = getApi(context);
-      return Response.ok(new FileOperationResult(api.trashEnabled())).build();
-    } catch (WebApplicationException ex) {
-      throw ex;
-    } catch (Exception ex) {
-      throw new ServiceFormattedException(ex.getMessage(), ex);
-    }
-  }
-
-  /**
-   * Trash dir
-   * @return trash dir
-   */
-  @GET
-  @Path("/trashDir")
-  @Produces(MediaType.APPLICATION_JSON)
-  public Response trashdir() {
-    try {
-      HdfsApi api = getApi(context);
-      return Response.ok(
-        getApi(context).fileStatusToJSON(api.getFileStatus(api.getTrashDir()
-          .toString()))).build();
-    } catch (WebApplicationException ex) {
-      throw ex;
-    } catch (FileNotFoundException ex) {
-      throw new NotFoundFormattedException(ex.getMessage(), ex);
-    } catch (Exception ex) {
-      throw new ServiceFormattedException(ex.getMessage(), ex);
-    }
-  }
-}

+ 0 - 4
contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/.bowerrc

@@ -1,4 +0,0 @@
-{
-  "directory": "bower_components",
-  "analytics": false
-}

+ 0 - 34
contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/.editorconfig

@@ -1,34 +0,0 @@
-# EditorConfig helps developers define and maintain consistent
-# coding styles between different editors and IDEs
-# editorconfig.org
-
-root = true
-
-
-[*]
-end_of_line = lf
-charset = utf-8
-trim_trailing_whitespace = true
-insert_final_newline = true
-indent_style = space
-indent_size = 2
-
-[*.js]
-indent_style = space
-indent_size = 2
-
-[*.hbs]
-insert_final_newline = false
-indent_style = space
-indent_size = 2
-
-[*.css]
-indent_style = space
-indent_size = 2
-
-[*.html]
-indent_style = space
-indent_size = 2
-
-[*.{diff,md}]
-trim_trailing_whitespace = false

+ 0 - 27
contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/.ember-cli

@@ -1,27 +0,0 @@
-/**
- * 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.
- */
-
-{
-  /**
-    Ember CLI sends analytics information by default. The data is completely
-    anonymous, but there are times when you might want to disable this behavior.
-
-    Setting `disableAnalytics` to true will prevent any data from being sent.
-  */
-  "disableAnalytics": false
-}

+ 0 - 17
contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/.gitignore

@@ -1,17 +0,0 @@
-# See http://help.github.com/ignore-files/ for more about ignoring files.
-
-# compiled output
-/dist
-/tmp
-
-# dependencies
-/node_modules
-/bower_components
-
-# misc
-/.sass-cache
-/connect.lock
-/coverage/*
-/libpeerconnection.log
-npm-debug.log
-testem.log

+ 0 - 32
contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/.jshintrc

@@ -1,32 +0,0 @@
-{
-  "predef": [
-    "document",
-    "window",
-    "-Promise"
-  ],
-  "browser": true,
-  "boss": true,
-  "curly": true,
-  "debug": false,
-  "devel": true,
-  "eqeqeq": true,
-  "evil": true,
-  "forin": false,
-  "immed": false,
-  "laxbreak": false,
-  "newcap": true,
-  "noarg": true,
-  "noempty": false,
-  "nonew": false,
-  "nomen": false,
-  "onevar": false,
-  "plusplus": false,
-  "regexp": false,
-  "undef": true,
-  "sub": true,
-  "strict": false,
-  "white": false,
-  "eqnull": true,
-  "esnext": true,
-  "unused": true
-}

+ 0 - 30
contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/.npmignore

@@ -1,30 +0,0 @@
-# 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.
-
-bower_components/
-tests/
-tmp/
-dist/
-
-.bowerrc
-.editorconfig
-.ember-cli
-.travis.yml
-.npmignore
-**/.gitkeep
-bower.json
-Brocfile.js
-testem.json

+ 0 - 50
contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/.travis.yml

@@ -1,50 +0,0 @@
-# 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.
-
----
-language: node_js
-node_js:
-  - "0.12"
-
-sudo: false
-
-cache:
-  directories:
-    - node_modules
-
-env:
-  - EMBER_TRY_SCENARIO=default
-  - EMBER_TRY_SCENARIO=ember-release
-  - EMBER_TRY_SCENARIO=ember-beta
-  - EMBER_TRY_SCENARIO=ember-canary
-
-matrix:
-  fast_finish: true
-  allow_failures:
-    - env: EMBER_TRY_SCENARIO=ember-canary
-
-before_install:
-  - export PATH=/usr/local/phantomjs-2.0.0/bin:$PATH
-  - "npm config set spin false"
-  - "npm install -g npm@^2"
-
-install:
-  - npm install -g bower
-  - npm install
-  - bower install
-
-script:
-  - ember try $EMBER_TRY_SCENARIO test

+ 0 - 21
contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/.watchmanconfig

@@ -1,21 +0,0 @@
-/**
- * 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.
- */
-
-{
-  "ignore_dirs": ["tmp", "dist"]
-}

+ 0 - 28
contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/LICENSE.md

@@ -1,28 +0,0 @@
-<!---
-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](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.
--->
-
-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](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.
-

+ 0 - 97
contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/README.md

@@ -1,97 +0,0 @@
-<!---
-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](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.
--->
-
-# Hdfs-directory-viewer
-
-Ember Addon to view the HDFS file system.
-
-Different Ambari views can use this in their view. Common code should be usable in every view.
-
-# How to use it
-
-### Including it in dependant project
-Add the following code in package.json of the dependant view
-
-```javascript
-"name": "files",
-"ember-addon": {
-	"paths": [
-	  "../../../../../commons/src/main/resources/ui/hdfs-directory-viewer"
-	]
-}
-```
-
-`paths` is an array which includes all the addons shares in ```commons``` library. The entries should be the relative path to the addon in this ```commons``` repository.
-
-### Including the UI dependencies in the dependent project
-As we are going to include the component using the `ember-addon` config in `package.json` and not by the `ember install` way, the UI dependencies also has to be included in the dependent projects `bower.json` file if not already added.
-
-```
-"bootstrap": "~3.3.6",
-"bootstrap-treeview": "~1.2.0",
-"font-awesome": "~4.5.0"
-```
-
-### Overriding configs in dependant project
-
-Create a util object in `utils` directory using `ember generate util <object name>` and override it as follows:
-
-```javascript
-import ViewerConfig from 'hdfs-directory-viewer/utils/viewer-config';
-
-export default ViewerConfig.extend({
-  showOnlyDirectories: true,
-
-  expandIcon: 'fa fa-chevron-right',
-  collapseIcon: 'fa fa-chevron-down',
-
-  listDirectoryUrl(pathParams) {
-    return `/api/v1/views/FILES/versions/1.0.0/instances/files/resources/files/fileops/listdir?${pathParams}`;
-  }
-});
-```
-
-All the functions and attributes in `hdfs-directory-viewer/utils/viewer-config` can be overriden
-
-### Passing the object to the view template
-
-```javascript
-import Ember from 'ember';
-import MyViewerConfig from '../utils/my-viewer-config';
-
-export default Ember.Controller.extend({
-  config: MyViewerConfig.create(),
-  actions: {
-    viewerError: function() {
-      console.log("Failed to fetch the content!!!");
-    },
-    viewerSelectedPath: function(data) {
-      console.log(`User selected: path: ${data.path}, isDirectory: ${data.isDirectory}`);
-    }
-  }
-});
-```
-
-```html
-...
-<div class="directory-viewer-wrap">
-  {{directory-viewer
-    config=config
-    errorAction="viewerError"
-    pathSelectAction="viewerSelectedPath"
-  }}
-</div>
-...
-```

+ 0 - 0
contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/addon/.gitkeep


+ 0 - 196
contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/addon/components/directory-viewer.js

@@ -1,196 +0,0 @@
-/**
- * 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 Ember from 'ember';
-import layout from '../templates/components/directory-viewer';
-
-export default Ember.Component.extend({
-  layout,
-  config: Ember.Object.create({}),
-  classNames: ['directory-viewer'],
-  startPath: '/',
-  treeData: Ember.A(),
-  currentPath: Ember.computed.oneWay('startPath'),
-  currentQueryParam: Ember.computed('currentPath', function() {
-    return Ember.$.param({path: this.get('currentPath')});
-  }),
-
-  startFetch: Ember.on('didInitAttrs', function() {
-    this.fetchData();
-  }),
-
-
-  fetchData: function() {
-    this.listPath(this.get('currentQueryParam')).then(
-      (response) => {
-        let list = this.filterDirectoriesIfRequired(response.files);
-        this.modifyTreeViewData(list);
-      }, (error) => {
-        this.sendAction('errorAction', error);
-      }
-    );
-  },
-
-  /**
-   * Makes a XHR call and returns a promise.
-   */
-  listPath: function(params) {
-    let config = this.get('config');
-    let listUrl = config.listDirectoryUrl(params);
-    let headers = config.getHeaders();
-    return Ember.$.ajax(listUrl, {
-      headers: headers
-    });
-  },
-
-  filterDirectoriesIfRequired: function(files) {
-    let showOnlyDirectories = this.get('config.showOnlyDirectories');
-    return files.filter((entry) => {
-      return (!(showOnlyDirectories) || entry.isDirectory);
-    });
-  },
-
-  modifyTreeViewData: function(response) {
-    let paths = response.map((entry) => {
-      let isDirectory = entry.isDirectory;
-      let icon = isDirectory ? this.get('config.folderIcon') : this.get('config.fileIcon');
-      let data = {
-        path: entry.path,
-        pathSegment: this.getNameForPath(entry.path),
-        isDirectory: isDirectory,
-        icon: icon,
-        text: this.getNameForPath(entry.path)
-      };
-      if(isDirectory) {
-        data.nodes = Ember.A();
-      }
-      return data;
-    });
-
-    var currentPath = this.get('currentPath');
-    var newTreeData = Ember.copy(this.get('treeData'), true);
-    if(currentPath === '/') {
-      newTreeData = paths;
-    } else {
-      this.insertPathToTreeData(newTreeData, paths, currentPath.substring(1));
-    }
-
-    this.set('treeData', newTreeData);
-    this.send('refreshTreeView');
-  },
-
-  insertPathToTreeData(treeData, paths, pathSegment) {
-    let firstPathSegment;
-    if (pathSegment.indexOf('/') !== -1) {
-      firstPathSegment = pathSegment.substring(0, pathSegment.indexOf('/'));
-    } else {
-      firstPathSegment = pathSegment;
-    }
-
-    if(treeData.length === 0) {
-      treeData.pushObjects(paths);
-    } else {
-      treeData.forEach((entry) => {
-        entry.state = {};
-        if (entry.pathSegment === firstPathSegment) {
-          entry.state.expanded = true;
-          if(entry.nodes.length === 0) {
-            paths.forEach((pathEntry) => {
-              entry.nodes.push(pathEntry);
-            });
-          } else {
-            this.insertPathToTreeData(entry.nodes, paths, pathSegment.substring(pathSegment.indexOf('/') + 1));
-          }
-        } else {
-          this.collapseAll(entry);
-        }
-      });
-    }
-  },
-
-  collapseAll: function(node) {
-    if (Ember.isNone(node.state)) {
-      node.state = {};
-    }
-    node.state.expanded = false;
-    if(!Ember.isNone(node.nodes)) {
-      node.nodes.forEach((entry) => {
-        this.collapseAll(entry);
-      });
-    }
-  },
-
-  getNameForPath: function(path) {
-    return path.substring(path.lastIndexOf("/") + 1);
-  },
-
-  collapseAllExceptPath: function(pathSegment) {
-    let collapseAll = function(nodes, pathSegment) {
-      var firstPathSegment;
-      if (pathSegment.indexOf('/') !== -1) {
-        firstPathSegment = pathSegment.substring(0, pathSegment.indexOf('/'));
-      } else {
-        firstPathSegment = pathSegment;
-      }
-
-      nodes.forEach((entry) => {
-        if (Ember.isNone(entry.state)) {
-          entry.state = {};
-        }
-        if(firstPathSegment !== entry.pathSegment) {
-          entry.state.expanded = false;
-        } else {
-          entry.state.expanded = true;
-          collapseAll(entry.nodes, pathSegment.substring(pathSegment.indexOf('/') + 1));
-        }
-      });
-    };
-    var newTreeData = this.get('treeData');
-    collapseAll(newTreeData, pathSegment);
-    this.set('treeData', newTreeData);
-    this.send('refreshTreeView');
-  },
-
-  actions: {
-    refreshTreeView() {
-      Ember.run.later(() => {
-        this.$().treeview({
-          data: this.get('treeData'),
-          expandIcon: this.get('config.expandIcon'),
-          collapseIcon: this.get('config.collapseIcon'),
-          //emptyIcon: "fa",
-          showBorder: false,
-          onNodeSelected: (event, data) => {
-            this.set('currentPath', data.path);
-            this.sendAction('pathSelectAction', {path: data.path, isDirectory: data.isDirectory});
-          },
-          onNodeExpanded: (event, data) => {
-            this.set('currentPath', data.path);
-            if (!Ember.isNone(data.nodes) && data.nodes.length === 0) {
-              var node = this.$().treeview('getNode', data.nodeId);
-              node.icon = "fa fa-refresh fa-spin";
-              this.fetchData();
-            } else {
-              this.collapseAllExceptPath(data.path.substring(1));
-            }
-          }
-        });
-      });
-    }
-  }
-});

+ 0 - 18
contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/addon/templates/components/directory-viewer.hbs

@@ -1,18 +0,0 @@
-{{!
-* 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.
-}}
-

+ 0 - 59
contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/addon/utils/viewer-config.js

@@ -1,59 +0,0 @@
-/**
- * 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 Ember from 'ember';
-
-export default Ember.Object.extend({
-
-  /**
-   * Set this to true, if only directory listing is required.
-   */
-  showOnlyDirectories: false,
-
-  /**
-   * Set this to true, if refresh of current path is required.
-   */
-  showRefreshButton: false,
-
-  /**
-   * Override these for different Icon. Refer https://github.com/jonmiles/bootstrap-treeview
-   */
-  expandIcon: "fa fa-plus",
-  collapseIcon: "fa fa-minus",
-  //Custom
-  fileIcon: "fa fa-file",
-  folderIcon: "fa fa-folder",
-
-  /**
-   * Override to return the headers add to the XHR call made for various operations.
-   * The Overriding object can also merge its result with the default in this object.
-   */
-  getHeaders() {
-    return {"X-Requested-By": "ambari"};
-  },
-
-  /**
-   * Return the URL endpoint for XHR call meant for listing Directories
-   * @param pathParams
-   * @returns {string}
-   */
-  listDirectoryUrl(pathParams) {
-    return `/listdir?${pathParams}`;
-  }
-
-});

+ 0 - 0
contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/app/.gitkeep


+ 0 - 19
contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/app/components/directory-viewer.js

@@ -1,19 +0,0 @@
-/**
- * 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.
- */
-
-export { default } from 'hdfs-directory-viewer/components/directory-viewer';

+ 0 - 19
contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/app/utils/viewer-config.js

@@ -1,19 +0,0 @@
-/**
- * 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.
- */
-
-export { default } from 'hdfs-directory-viewer/utils/viewer-config';

+ 0 - 19
contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/bower.json

@@ -1,19 +0,0 @@
-{
-  "name": "hdfs-directory-viewer",
-  "dependencies": {
-    "ember": "2.2.0",
-    "ember-cli-shims": "0.1.0",
-    "ember-cli-test-loader": "0.2.2",
-    "ember-load-initializers": "0.1.7",
-    "ember-qunit-notifications": "0.1.0",
-    "jquery": "1.11.3",
-    "loader.js": "^3.5.0",
-    "qunit": "~1.20.0",
-    "bootstrap": "~3.3.6",
-    "bootstrap-treeview": "~1.2.0",
-    "font-awesome": "~4.5.0"
-  },
-  "resolutions": {
-    "ember": "2.2.0"
-  }
-}

+ 0 - 54
contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/config/ember-try.js

@@ -1,54 +0,0 @@
-/**
- * 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.
- */
-
-/*jshint node:true*/
-module.exports = {
-  scenarios: [
-    {
-      name: 'default',
-      dependencies: { }
-    },
-    {
-      name: 'ember-release',
-      dependencies: {
-        'ember': 'components/ember#release'
-      },
-      resolutions: {
-        'ember': 'release'
-      }
-    },
-    {
-      name: 'ember-beta',
-      dependencies: {
-        'ember': 'components/ember#beta'
-      },
-      resolutions: {
-        'ember': 'beta'
-      }
-    },
-    {
-      name: 'ember-canary',
-      dependencies: {
-        'ember': 'components/ember#canary'
-      },
-      resolutions: {
-        'ember': 'canary'
-      }
-    }
-  ]
-};

+ 0 - 24
contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/config/environment.js

@@ -1,24 +0,0 @@
-/**
- * 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.
- */
-
-/*jshint node:true*/
-'use strict';
-
-module.exports = function(/* environment, appConfig */) {
-  return { };
-};

+ 0 - 36
contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/ember-cli-build.js

@@ -1,36 +0,0 @@
-/**
- * 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.
- */
-
-/*jshint node:true*/
-/* global require, module */
-var EmberAddon = require('ember-cli/lib/broccoli/ember-addon');
-
-module.exports = function(defaults) {
-  var app = new EmberAddon(defaults, {
-    // Add options here
-  });
-
-  /*
-    This build file specifies the options for the dummy test app of this
-    addon, located in `/tests/dummy`
-    This build file does *not* influence how the addon or the app using it
-    behave. You most likely want to be modifying `./index.js` or app's build file
-  */
-
-  return app.toTree();
-};

+ 0 - 32
contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/index.js

@@ -1,32 +0,0 @@
-/**
- * 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.
- */
-
-/* jshint node: true */
-'use strict';
-
-module.exports = {
-  name: 'hdfs-directory-viewer',
-  included: function(app) {
-    this._super.included(app);
-
-    app.import(app.bowerDirectory + '/bootstrap/dist/css/bootstrap.css');
-    app.import(app.bowerDirectory + '/bootstrap/dist/js/bootstrap.js');
-    app.import(app.bowerDirectory + '/bootstrap-treeview/src/js/bootstrap-treeview.js');
-    app.import(app.bowerDirectory + '/bootstrap-treeview/dist/bootstrap-treeview.min.css');
-  }
-};

+ 0 - 51
contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/package.json

@@ -1,51 +0,0 @@
-{
-  "name": "hdfs-directory-viewer",
-  "version": "0.1.0",
-  "description": "The hdfs directory viewer addon to be used by ambari views",
-  "directories": {
-    "doc": "doc",
-    "test": "tests"
-  },
-  "scripts": {
-    "build": "ember build",
-    "start": "ember server",
-    "test": "ember try:testall"
-  },
-  "repository": "",
-  "engines": {
-    "node": ">= 0.10.0"
-  },
-  "author": "",
-  "license": "MIT",
-  "devDependencies": {
-    "broccoli-asset-rev": "^2.2.0",
-    "ember-ajax": "0.7.1",
-    "ember-cli": "2.2.0-beta.4",
-    "ember-cli-app-version": "^1.0.0",
-    "ember-cli-dependency-checker": "^1.2.0",
-    "ember-cli-font-awesome": "1.5.0",
-    "ember-cli-htmlbars": "^1.0.1",
-    "ember-cli-htmlbars-inline-precompile": "^0.3.1",
-    "ember-cli-inject-live-reload": "^1.3.1",
-    "ember-cli-qunit": "^1.1.0",
-    "ember-cli-release": "0.2.8",
-    "ember-cli-sri": "^2.0.0",
-    "ember-cli-uglify": "^1.2.0",
-    "ember-data": "^2.2.1",
-    "ember-disable-prototype-extensions": "^1.0.0",
-    "ember-disable-proxy-controllers": "^1.0.1",
-    "ember-export-application-global": "^1.0.4",
-    "ember-resolver": "^2.0.3",
-    "ember-try": "~0.0.8"
-  },
-  "keywords": [
-    "ember-addon"
-  ],
-  "dependencies": {
-    "ember-cli-babel": "^5.1.5",
-    "ember-cli-htmlbars": "^1.0.1"
-  },
-  "ember-addon": {
-    "configPath": "tests/dummy/config"
-  }
-}

+ 0 - 12
contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/testem.json

@@ -1,12 +0,0 @@
-{
-  "framework": "qunit",
-  "test_page": "tests/index.html?hidepassed",
-  "disable_watching": true,
-  "launch_in_ci": [
-    "PhantomJS"
-  ],
-  "launch_in_dev": [
-    "PhantomJS",
-    "Chrome"
-  ]
-}

+ 0 - 52
contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/tests/.jshintrc

@@ -1,52 +0,0 @@
-{
-  "predef": [
-    "document",
-    "window",
-    "location",
-    "setTimeout",
-    "$",
-    "-Promise",
-    "define",
-    "console",
-    "visit",
-    "exists",
-    "fillIn",
-    "click",
-    "keyEvent",
-    "triggerEvent",
-    "find",
-    "findWithAssert",
-    "wait",
-    "DS",
-    "andThen",
-    "currentURL",
-    "currentPath",
-    "currentRouteName"
-  ],
-  "node": false,
-  "browser": false,
-  "boss": true,
-  "curly": true,
-  "debug": false,
-  "devel": false,
-  "eqeqeq": true,
-  "evil": true,
-  "forin": false,
-  "immed": false,
-  "laxbreak": false,
-  "newcap": true,
-  "noarg": true,
-  "noempty": false,
-  "nonew": false,
-  "nomen": false,
-  "onevar": false,
-  "plusplus": false,
-  "regexp": false,
-  "undef": true,
-  "sub": true,
-  "strict": false,
-  "white": false,
-  "eqnull": true,
-  "esnext": true,
-  "unused": true
-}

+ 0 - 36
contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/tests/dummy/app/app.js

@@ -1,36 +0,0 @@
-/**
- * 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 Ember from 'ember';
-import Resolver from 'ember-resolver';
-import loadInitializers from 'ember/load-initializers';
-import config from './config/environment';
-
-let App;
-
-Ember.MODEL_FACTORY_INJECTIONS = true;
-
-App = Ember.Application.extend({
-  modulePrefix: config.modulePrefix,
-  podModulePrefix: config.podModulePrefix,
-  Resolver
-});
-
-loadInitializers(App, config.modulePrefix);
-
-export default App;

+ 0 - 0
contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/tests/dummy/app/components/.gitkeep


+ 0 - 0
contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/tests/dummy/app/controllers/.gitkeep


+ 0 - 32
contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/tests/dummy/app/controllers/application.js

@@ -1,32 +0,0 @@
-/**
- * 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 Ember from 'ember';
-import MyViewerConfig from '../utils/my-viewer-config';
-
-export default Ember.Controller.extend({
-  config: MyViewerConfig.create(),
-  actions: {
-    viewerError: function() {
-      console.log("Failed to fetch the content!!!");
-    },
-    viewerSelectedPath: function(data) {
-      console.log(`User selected: path: ${data.path}, isDirectory: ${data.isDirectory}`);
-    }
-  }
-});

+ 0 - 0
contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/tests/dummy/app/helpers/.gitkeep


+ 0 - 43
contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/tests/dummy/app/index.html

@@ -1,43 +0,0 @@
-<!--
- * 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>
-  <head>
-    <meta charset="utf-8">
-    <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <title>Dummy</title>
-    <meta name="description" content="">
-    <meta name="viewport" content="width=device-width, initial-scale=1">
-
-    {{content-for "head"}}
-
-    <link rel="stylesheet" href="assets/vendor.css">
-    <link rel="stylesheet" href="assets/dummy.css">
-
-    {{content-for "head-footer"}}
-  </head>
-  <body>
-    {{content-for "body"}}
-
-    <script src="assets/vendor.js"></script>
-    <script src="assets/dummy.js"></script>
-
-    {{content-for "body-footer"}}
-  </body>
-</html>

+ 0 - 0
contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/tests/dummy/app/models/.gitkeep


+ 0 - 29
contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/tests/dummy/app/router.js

@@ -1,29 +0,0 @@
-/**
- * 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 Ember from 'ember';
-import config from './config/environment';
-
-const Router = Ember.Router.extend({
-  location: config.locationType
-});
-
-Router.map(function() {
-});
-
-export default Router;

+ 0 - 0
contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/tests/dummy/app/routes/.gitkeep


+ 0 - 23
contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/tests/dummy/app/styles/app.css

@@ -1,23 +0,0 @@
-/**
- * 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.
- */
-
-.directory-viewer-wrap {
-  width: 600px;
-  height: 500px;
-  border: 1px solid darkgray;
-}

+ 0 - 36
contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/tests/dummy/app/templates/application.hbs

@@ -1,36 +0,0 @@
-{{!
-* 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.
-}}
-
-<h2 id="title">Ambari HDFS Directory Viewer example</h2>
-<p>
-  This will require Ambari installation with a file view instance created.<br/>
-  <strong>Instance name: files
-  <br/>Files view version used is: 1.0.0</strong>
-</p>
-
-
-<div class="directory-viewer-wrap">
-  {{directory-viewer
-    config=config
-    errorAction="viewerError"
-    pathSelectAction="viewerSelectedPath"
-  }}
-</div>
-
-
-{{outlet}}

+ 0 - 0
contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/tests/dummy/app/templates/components/.gitkeep


+ 0 - 35
contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/tests/dummy/app/utils/my-viewer-config.js

@@ -1,35 +0,0 @@
-/**
- * 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 Ember from 'ember';
-import ViewerConfig from 'hdfs-directory-viewer/utils/viewer-config';
-
-export default ViewerConfig.extend({
-  showOnlyDirectories: true,
-
-  expandIcon: 'fa fa-chevron-right',
-  collapseIcon: 'fa fa-chevron-down',
-
-  getHeaders() {
-    return Ember.merge({"Authorization": "Basic YWRtaW46YWRtaW4="}, this._super());
-  },
-
-  listDirectoryUrl(pathParams) {
-    return `/api/v1/views/FILES/versions/1.0.0/instances/files/resources/files/fileops/listdir?${pathParams}`;
-  }
-});

+ 0 - 65
contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/tests/dummy/config/environment.js

@@ -1,65 +0,0 @@
-/**
- * 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.
- */
-
-/* jshint node: true */
-
-module.exports = function(environment) {
-  var ENV = {
-    modulePrefix: 'dummy',
-    environment: environment,
-    baseURL: '/',
-    locationType: 'auto',
-    EmberENV: {
-      FEATURES: {
-        // Here you can enable experimental features on an ember canary build
-        // e.g. 'with-controller': true
-      }
-    },
-
-    APP: {
-      // Here you can pass flags/options to your application instance
-      // when it is created
-    }
-  };
-
-  if (environment === 'development') {
-    // ENV.APP.LOG_RESOLVER = true;
-    // ENV.APP.LOG_ACTIVE_GENERATION = true;
-    // ENV.APP.LOG_TRANSITIONS = true;
-    // ENV.APP.LOG_TRANSITIONS_INTERNAL = true;
-    // ENV.APP.LOG_VIEW_LOOKUPS = true;
-  }
-
-  if (environment === 'test') {
-    // Testem prefers this...
-    ENV.baseURL = '/';
-    ENV.locationType = 'none';
-
-    // keep test console output quieter
-    ENV.APP.LOG_ACTIVE_GENERATION = false;
-    ENV.APP.LOG_VIEW_LOOKUPS = false;
-
-    ENV.APP.rootElement = '#ember-testing';
-  }
-
-  if (environment === 'production') {
-
-  }
-
-  return ENV;
-};

+ 0 - 15
contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/tests/dummy/public/crossdomain.xml

@@ -1,15 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
-<cross-domain-policy>
-  <!-- Read this: www.adobe.com/devnet/articles/crossdomain_policy_file_spec.html -->
-
-  <!-- Most restrictive policy: -->
-  <site-control permitted-cross-domain-policies="none"/>
-
-  <!-- Least restrictive policy: -->
-  <!--
-  <site-control permitted-cross-domain-policies="all"/>
-  <allow-access-from domain="*" to-ports="*" secure="false"/>
-  <allow-http-request-headers-from domain="*" headers="*" secure="false"/>
-  -->
-</cross-domain-policy>

+ 0 - 3
contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/tests/dummy/public/robots.txt

@@ -1,3 +0,0 @@
-# http://www.robotstxt.org
-User-agent: *
-Disallow:

+ 0 - 23
contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/tests/helpers/destroy-app.js

@@ -1,23 +0,0 @@
-/**
- * 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 Ember from 'ember';
-
-export default function destroyApp(application) {
-  Ember.run(application, 'destroy');
-}

+ 0 - 41
contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/tests/helpers/module-for-acceptance.js

@@ -1,41 +0,0 @@
-/**
- * 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 { module } from 'qunit';
-import startApp from '../helpers/start-app';
-import destroyApp from '../helpers/destroy-app';
-
-export default function(name, options = {}) {
-  module(name, {
-    beforeEach() {
-      this.application = startApp();
-
-      if (options.beforeEach) {
-        options.beforeEach.apply(this, arguments);
-      }
-    },
-
-    afterEach() {
-      destroyApp(this.application);
-
-      if (options.afterEach) {
-        options.afterEach.apply(this, arguments);
-      }
-    }
-  });
-}

+ 0 - 29
contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/tests/helpers/resolver.js

@@ -1,29 +0,0 @@
-/**
- * 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 Resolver from 'ember-resolver';
-import config from '../../config/environment';
-
-const resolver = Resolver.create();
-
-resolver.namespace = {
-  modulePrefix: config.modulePrefix,
-  podModulePrefix: config.podModulePrefix
-};
-
-export default resolver;

+ 0 - 36
contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/tests/helpers/start-app.js

@@ -1,36 +0,0 @@
-/**
- * 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 Ember from 'ember';
-import Application from '../../app';
-import config from '../../config/environment';
-
-export default function startApp(attrs) {
-  let application;
-
-  let attributes = Ember.merge({}, config.APP);
-  attributes = Ember.merge(attributes, attrs); // use defaults, but you can override;
-
-  Ember.run(() => {
-    application = Application.create(attributes);
-    application.setupForTesting();
-    application.injectTestHelpers();
-  });
-
-  return application;
-}

+ 0 - 52
contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/tests/index.html

@@ -1,52 +0,0 @@
-<!--
- * 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>
-  <head>
-    <meta charset="utf-8">
-    <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <title>Dummy Tests</title>
-    <meta name="description" content="">
-    <meta name="viewport" content="width=device-width, initial-scale=1">
-
-    {{content-for "head"}}
-    {{content-for "test-head"}}
-
-    <link rel="stylesheet" href="assets/vendor.css">
-    <link rel="stylesheet" href="assets/dummy.css">
-    <link rel="stylesheet" href="assets/test-support.css">
-
-    {{content-for "head-footer"}}
-    {{content-for "test-head-footer"}}
-  </head>
-  <body>
-    {{content-for "body"}}
-    {{content-for "test-body"}}
-
-    <script src="testem.js" integrity=""></script>
-    <script src="assets/vendor.js"></script>
-    <script src="assets/test-support.js"></script>
-    <script src="assets/dummy.js"></script>
-    <script src="assets/tests.js"></script>
-    <script src="assets/test-loader.js"></script>
-
-    {{content-for "body-footer"}}
-    {{content-for "test-body-footer"}}
-  </body>
-</html>

+ 0 - 0
contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/tests/integration/.gitkeep


+ 0 - 24
contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/tests/test-helper.js

@@ -1,24 +0,0 @@
-/**
- * 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 resolver from './helpers/resolver';
-import {
-  setResolver
-} from 'ember-qunit';
-
-setResolver(resolver);

+ 0 - 0
contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/tests/unit/.gitkeep


+ 0 - 0
contrib/views/commons/src/main/resources/ui/hdfs-directory-viewer/vendor/.gitkeep


+ 0 - 5
contrib/views/files/pom.xml

@@ -96,11 +96,6 @@
       <artifactId>ambari-views-utils</artifactId>
       <version>2.0.0.0-SNAPSHOT</version>
     </dependency>
-    <dependency>
-      <groupId>org.apache.ambari.contrib.views</groupId>
-      <artifactId>ambari-views-commons</artifactId>
-      <version>2.0.0.0-SNAPSHOT</version>
-    </dependency>
     <dependency>
       <groupId>com.google.code.gson</groupId>
       <artifactId>gson</artifactId>

+ 4 - 4
contrib/views/files/src/main/java/org/apache/ambari/view/filebrowser/DownloadService.java

@@ -47,14 +47,14 @@ import javax.ws.rs.core.UriInfo;
 import javax.xml.bind.annotation.XmlElement;
 
 import com.google.gson.Gson;
-import org.apache.ambari.view.commons.exceptions.MisconfigurationFormattedException;
-import org.apache.ambari.view.commons.exceptions.NotFoundFormattedException;
-import org.apache.ambari.view.commons.exceptions.ServiceFormattedException;
-import org.apache.ambari.view.commons.hdfs.HdfsService;
+import org.apache.ambari.view.filebrowser.utils.MisconfigurationFormattedException;
+import org.apache.ambari.view.filebrowser.utils.NotFoundFormattedException;
+import org.apache.ambari.view.filebrowser.utils.ServiceFormattedException;
 import org.apache.ambari.view.utils.hdfs.HdfsApi;
 import org.apache.ambari.view.utils.hdfs.HdfsApiException;
 import org.apache.ambari.view.utils.hdfs.HdfsUtil;
 import org.apache.hadoop.fs.FSDataInputStream;
+import org.apache.hadoop.fs.FSDataOutputStream;
 import org.apache.hadoop.fs.FileStatus;
 import org.apache.ambari.view.ViewContext;
 import org.apache.hadoop.security.AccessControlException;

+ 2 - 11
contrib/views/files/src/main/java/org/apache/ambari/view/filebrowser/FileBrowserService.java

@@ -23,9 +23,6 @@ import javax.ws.rs.Path;
 import org.apache.ambari.view.ViewContext;
 
 import com.google.inject.Inject;
-import org.apache.ambari.view.commons.hdfs.FileOperationService;
-import org.apache.ambari.view.commons.hdfs.UploadService;
-import org.apache.ambari.view.commons.hdfs.UserService;
 
 /**
  * Root files service
@@ -45,7 +42,7 @@ public class FileBrowserService {
   }
 
   /**
-   * @see UploadService
+   * @see org.apache.ambari.view.filebrowser.UploadService
    * @return service
    */
   @Path("/upload")
@@ -54,7 +51,7 @@ public class FileBrowserService {
   }
 
   /**
-   * @see org.apache.ambari.view.commons.hdfs.FileOperationService
+   * @see org.apache.ambari.view.filebrowser.FileOperationService
    * @return service
    */
   @Path("/fileops")
@@ -71,12 +68,6 @@ public class FileBrowserService {
     return new HelpService(context);
   }
 
-  /**
-   * @see org.apache.ambari.view.commons.hdfs.UserService
-   * @return service
-   */
-  @Path("/user")
-  public UserService userService() { return new UserService(context); }
 
   /**
    * @see org.apache.ambari.view.filebrowser.FilePreviewService

+ 18 - 13
contrib/views/commons/src/main/java/org/apache/ambari/view/commons/hdfs/FileOperationService.java → contrib/views/files/src/main/java/org/apache/ambari/view/filebrowser/FileOperationService.java

@@ -16,26 +16,31 @@
  * limitations under the License.
  */
 
-package org.apache.ambari.view.commons.hdfs;
+package org.apache.ambari.view.filebrowser;
 
-import org.apache.ambari.view.ViewContext;
-import org.apache.ambari.view.commons.exceptions.NotFoundFormattedException;
-import org.apache.ambari.view.commons.exceptions.ServiceFormattedException;
-import org.apache.ambari.view.utils.hdfs.HdfsApi;
-import org.apache.ambari.view.utils.hdfs.HdfsApiException;
-import org.json.simple.JSONObject;
-
-import javax.ws.rs.*;
-import javax.ws.rs.core.*;
-import javax.ws.rs.core.Response.ResponseBuilder;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.ListIterator;
 
+import javax.ws.rs.*;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.Response.ResponseBuilder;
+import javax.ws.rs.core.UriInfo;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.apache.ambari.view.ViewContext;
+import org.apache.ambari.view.filebrowser.utils.NotFoundFormattedException;
+import org.apache.ambari.view.filebrowser.utils.ServiceFormattedException;
+import org.apache.ambari.view.utils.hdfs.HdfsApi;
+import org.apache.ambari.view.utils.hdfs.HdfsApiException;
+import org.json.simple.JSONObject;
+
 /**
  * File operations service
  */

+ 3 - 4
contrib/views/files/src/main/java/org/apache/ambari/view/filebrowser/FilePreviewService.java

@@ -19,9 +19,8 @@
 package org.apache.ambari.view.filebrowser;
 
 import org.apache.ambari.view.ViewContext;
-import org.apache.ambari.view.commons.exceptions.NotFoundFormattedException;
-import org.apache.ambari.view.commons.exceptions.ServiceFormattedException;
-import org.apache.ambari.view.commons.hdfs.HdfsService;
+import org.apache.ambari.view.filebrowser.utils.NotFoundFormattedException;
+import org.apache.ambari.view.filebrowser.utils.ServiceFormattedException;
 import org.apache.ambari.view.utils.hdfs.HdfsApi;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileStatus;
@@ -38,7 +37,7 @@ import java.io.InputStream;
 /**
  * File Preview Service
  */
-public class FilePreviewService extends HdfsService {
+public class FilePreviewService extends HdfsService{
 
   private CompressionCodecFactory compressionCodecFactory;
 

+ 2 - 2
contrib/views/commons/src/main/java/org/apache/ambari/view/commons/hdfs/HdfsService.java → contrib/views/files/src/main/java/org/apache/ambari/view/filebrowser/HdfsService.java

@@ -16,13 +16,13 @@
  * limitations under the License.
  */
 
-package org.apache.ambari.view.commons.hdfs;
+package org.apache.ambari.view.filebrowser;
 
 import javax.ws.rs.WebApplicationException;
 import javax.xml.bind.annotation.XmlRootElement;
 
 import org.apache.ambari.view.ViewContext;
-import org.apache.ambari.view.commons.exceptions.ServiceFormattedException;
+import org.apache.ambari.view.filebrowser.utils.ServiceFormattedException;
 import org.apache.ambari.view.utils.hdfs.HdfsApi;
 import org.apache.ambari.view.utils.hdfs.HdfsUtil;
 import org.apache.hadoop.security.UserGroupInformation;

+ 66 - 1
contrib/views/files/src/main/java/org/apache/ambari/view/filebrowser/HelpService.java

@@ -18,14 +18,19 @@
 
 package org.apache.ambari.view.filebrowser;
 
+import java.io.FileNotFoundException;
+
 import javax.ws.rs.GET;
 import javax.ws.rs.Path;
 import javax.ws.rs.Produces;
+import javax.ws.rs.WebApplicationException;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
 import org.apache.ambari.view.ViewContext;
-import org.apache.ambari.view.commons.hdfs.HdfsService;
+import org.apache.ambari.view.filebrowser.utils.NotFoundFormattedException;
+import org.apache.ambari.view.filebrowser.utils.ServiceFormattedException;
+import org.apache.ambari.view.utils.hdfs.HdfsApi;
 import org.json.simple.JSONObject;
 
 /**
@@ -95,4 +100,64 @@ public class HelpService extends HdfsService {
     return Response.ok().entity(response).type(MediaType.APPLICATION_JSON).build();
   }
 
+  /**
+   * Returns home directory
+   * @return home directory
+   */
+  @GET
+  @Path("/home")
+  @Produces(MediaType.APPLICATION_JSON)
+  public Response homeDir() {
+    try {
+      HdfsApi api = getApi(context);
+      return Response
+          .ok(getApi(context).fileStatusToJSON(api.getFileStatus(api.getHomeDir()
+              .toString()))).build();
+    } catch (WebApplicationException ex) {
+      throw ex;
+    } catch (Exception ex) {
+      throw new ServiceFormattedException(ex.getMessage(), ex);
+    }
+  }
+
+  /**
+   * Is trash enabled
+   * @return is trash enabled
+   */
+  @GET
+  @Path("/trash/enabled")
+  @Produces(MediaType.APPLICATION_JSON)
+  public Response trashEnabled() {
+    try {
+      HdfsApi api = getApi(context);
+      return Response.ok(new FileOperationResult(api.trashEnabled())).build();
+    } catch (WebApplicationException ex) {
+      throw ex;
+    } catch (Exception ex) {
+      throw new ServiceFormattedException(ex.getMessage(), ex);
+    }
+  }
+
+  /**
+   * Trash dir
+   * @return trash dir
+   */
+  @GET
+  @Path("/trashDir")
+  @Produces(MediaType.APPLICATION_JSON)
+  public Response trashdir() {
+    try {
+      HdfsApi api = getApi(context);
+      return Response.ok(
+          getApi(context).fileStatusToJSON(api.getFileStatus(api.getTrashDir()
+              .toString()))).build();
+    } catch (WebApplicationException ex) {
+      throw ex;
+    } catch (FileNotFoundException ex) {
+      throw new NotFoundFormattedException(ex.getMessage(), ex);
+    } catch (Exception ex) {
+      throw new ServiceFormattedException(ex.getMessage(), ex);
+    }
+  }
+
 }

+ 2 - 3
contrib/views/commons/src/main/java/org/apache/ambari/view/commons/hdfs/UploadService.java → contrib/views/files/src/main/java/org/apache/ambari/view/filebrowser/UploadService.java

@@ -16,7 +16,7 @@
  * limitations under the License.
  */
 
-package org.apache.ambari.view.commons.hdfs;
+package org.apache.ambari.view.filebrowser;
 
 import java.io.IOException;
 import java.io.InputStream;
@@ -28,8 +28,7 @@ import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
 import org.apache.ambari.view.ViewContext;
-import org.apache.ambari.view.commons.exceptions.ServiceFormattedException;
-import org.apache.ambari.view.commons.hdfs.HdfsService;
+import org.apache.ambari.view.filebrowser.utils.ServiceFormattedException;
 import org.apache.ambari.view.utils.hdfs.HdfsApi;
 import org.apache.hadoop.fs.FSDataOutputStream;
 

+ 1 - 1
contrib/views/commons/src/main/java/org/apache/ambari/view/commons/exceptions/MisconfigurationFormattedException.java → contrib/views/files/src/main/java/org/apache/ambari/view/filebrowser/utils/MisconfigurationFormattedException.java

@@ -16,7 +16,7 @@
  * limitations under the License.
  */
 
-package org.apache.ambari.view.commons.exceptions;
+package org.apache.ambari.view.filebrowser.utils;
 
 import org.json.simple.JSONObject;
 

+ 1 - 1
contrib/views/commons/src/main/java/org/apache/ambari/view/commons/exceptions/NotFoundFormattedException.java → contrib/views/files/src/main/java/org/apache/ambari/view/filebrowser/utils/NotFoundFormattedException.java

@@ -16,7 +16,7 @@
  * limitations under the License.
  */
 
-package org.apache.ambari.view.commons.exceptions;
+package org.apache.ambari.view.filebrowser.utils;
 
 public class NotFoundFormattedException extends ServiceFormattedException {
   private final static int STATUS = 404;

+ 1 - 1
contrib/views/commons/src/main/java/org/apache/ambari/view/commons/exceptions/ServiceFormattedException.java → contrib/views/files/src/main/java/org/apache/ambari/view/filebrowser/utils/ServiceFormattedException.java

@@ -16,7 +16,7 @@
  * limitations under the License.
  */
 
-package org.apache.ambari.view.commons.exceptions;
+package org.apache.ambari.view.filebrowser.utils;
 
 import org.apache.commons.lang.exception.ExceptionUtils;
 import org.json.simple.JSONObject;

+ 2 - 2
contrib/views/files/src/main/resources/ui/app/services/file-operation.js

@@ -170,12 +170,12 @@ export default Ember.Service.extend(FileOperationMixin, {
 
   getHome: function () {
     var adapter = this.get('store').adapterFor('file');
-    return adapter.ajax(this._getMiscUrl("/user/home"), "GET");
+    return adapter.ajax(this._getMiscUrl("/help/home"), "GET");
   },
 
   getTrash: function () {
     var adapter = this.get('store').adapterFor('file');
-    return adapter.ajax(this._getMiscUrl("/user/trashDir"), "GET");
+    return adapter.ajax(this._getMiscUrl("/help/trashDir"), "GET");
   },
 
   _getMiscUrl: function (segment) {

+ 0 - 5
contrib/views/files/src/main/resources/ui/package.json

@@ -20,11 +20,6 @@
   },
   "author": "",
   "license": "MIT",
-  "ember-addon": {
-    "paths": [
-      "../../../../../commons/src/main/resources/ui/hdfs-directory-viewer"
-    ]
-  },
   "devDependencies": {
     "bower": "1.7.2",
     "broccoli-asset-rev": "^2.2.0",

+ 0 - 1
contrib/views/files/src/test/java/org/apache/ambari/view/filebrowser/FilebrowserTest.java

@@ -38,7 +38,6 @@ import javax.ws.rs.core.UriInfo;
 
 import org.apache.ambari.view.ViewContext;
 import org.apache.ambari.view.ViewResourceHandler;
-import org.apache.ambari.view.commons.hdfs.FileOperationService;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileUtil;
 import org.apache.hadoop.hdfs.MiniDFSCluster;

+ 0 - 1
contrib/views/pom.xml

@@ -43,7 +43,6 @@
     <module>tez</module>
     <module>storm</module>
     <module>zeppelin</module>
-    <module>commons</module>
   </modules>
   <build>
     <pluginManagement>