Commit a5f8c5aa by Shwetha GS

ATLAS-582 Move Atlas UI to use backboneJS (kevalbhatt18 via shwethags)

parent c2356f8e
# 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.
.DS_Store
.bower-*/
.idea/
node_modules/
public/js/libs/
dist
target/
*.log
*.tgz
node/
dist/
{
"name": "atlas-metadata",
"description": "Apache Atlas",
"version": "0.5.0-incubating",
"private": true,
"repository": {
"type": "git",
"url": "https://git-wip-us.apache.org/repos/asf/incubator-atlas.git"
},
"engines": {
"node": "4.4.x",
"npm": "3.8.x"
},
"keywords": [
"Apache",
"Atlas",
"HortonWorks"
],
"dependencies": {
"backbone": "1.2.3",
"backbone.babysitter": "git+https://github.com/marionettejs/backbone.babysitter.git",
"backbone.marionette": "2.3.2",
"backbone.paginator": "^2.0.0",
"backbone.wreqr": "^1.3.2",
"backgrid": "^0.3.7",
"backgrid-filter": "^0.3.7",
"backgrid-orderable-columns": "^0.1.2",
"backgrid-paginator": "^0.3.7",
"backgrid-sizeable-columns": "^0.1.1",
"bootstrap": "^3.3.5",
"d3": "^3.5.16",
"d3-tip": "^0.6.7",
"dagre-d3": "^0.4.17",
"jquery": "^2.2.2",
"jquery-asBreadcrumbs": "git+https://github.com/amazingSurge/jquery-asBreadcrumbs.git",
"jquery-ui": "^1.10.4",
"noty": "^2.3.8",
"requirejs": "^2.1.16",
"requirejs-text": "^2.0.12",
"underscore": "^1.8.3"
},
"devDependencies": {
"connect-livereload": "^0.5.4",
"git-rev": "^0.2.1",
"grunt": "~0.4.2",
"grunt-cli": "~0.1.11",
"grunt-concurrent": "^1.0.0",
"grunt-connect-proxy": "^0.2.0",
"grunt-contrib-clean": "~0.6.0",
"grunt-contrib-compress": "^0.13.0",
"grunt-contrib-connect": "^1.0.0",
"grunt-contrib-copy": "~0.8.0",
"grunt-contrib-jshint": "^0.11.0",
"grunt-contrib-watch": "^0.6.1",
"grunt-dev-update": "^1.0.2",
"grunt-jsbeautifier": "^0.2.6",
"grunt-nginx": "~0.2.2",
"grunt-nodemon": "^0.4.0",
"grunt-npmcopy": "^0.1.0",
"grunt-shell": "^1.1.1",
"load-grunt-tasks": "^3.1.0",
"proxit": "~0.6.4"
}
}
<?xml version="1.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.
-->
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.atlas</groupId>
<artifactId>apache-atlas</artifactId>
<version>0.7-incubating-SNAPSHOT</version>
</parent>
<artifactId>atlas-dashboardv2</artifactId>
<description>Apache Atlas UI Application</description>
<name>Apache Atlas UI</name>
<packaging>war</packaging>
<url>http://atlas.incubator.apache.org</url>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<configuration>
<phase>validate</phase>
<workingDirectory>${project.build.directory}</workingDirectory>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<webResources>
<resource>
<directory>${project.build.directory}/dist</directory>
</resource>
</webResources>
</configuration>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.7</version>
<executions>
<execution>
<id>copy-resources</id>
<goals>
<goal>copy-resources</goal>
</goals>
<phase>validate</phase>
<configuration>
<outputDirectory>${basedir}/target/</outputDirectory>
<resources>
<resource>
<directory>${basedir}</directory>
<includes>
<include>package.json</include>
<include>gruntfile.js</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<executions>
<execution>
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<configuration>
<nodeVersion>${node-for-v2.version}</nodeVersion>
<npmVersion>3.8.5</npmVersion>
</configuration>
</execution>
<execution>
<id>npm install</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>install</arguments>
</configuration>
</execution>
<execution>
<id>npm remaining</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>install --ignore-scripts</arguments>
</configuration>
</execution>
<execution>
<id>grunt dist</id>
<goals>
<goal>grunt</goal>
</goals>
<configuration>
<arguments>build</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
/*!
* Start Bootstrap - Simple Sidebar HTML Template (http://startbootstrap.com)
* Code licensed under the Apache License v2.0.
* For details, see http://www.apache.org/licenses/LICENSE-2.0.
*/
/* Toggle Styles */
#wrapper {
padding-left: 0;
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
}
#wrapper.toggled {
padding-left: 300px;
}
#sidebar-wrapper {
z-index: 1000;
position: fixed;
left: 300px;
width: 0;
height: 100%;
margin-left: -300px;
overflow-y: auto;
background: #323544;
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
}
#wrapper.toggled #sidebar-wrapper {
width: 300px;}
#page-content-wrapper {
width: 100%;
position: absolute;
}
#wrapper.toggled #page-content-wrapper {
position: absolute;
margin-right: -300px;
}
/* Sidebar Styles */
.sidebar-nav, .sidebar-components {
margin: 0;
padding: 0;
list-style: none;
}
.sidebar-nav li {
line-height: 50px;
padding: 0 20px;
border-bottom: 1px #1c1e2a solid;
}
.sidebar-components li {
line-height: 40px;
padding: 0 20px;
}
.sidebar-components li:hover {
background-color: #1d1f2b;
}
.sidebar-nav li a ,
.sidebar-components li a {
display: block;
text-decoration: none;
color: #fff;
}
.sidebar-nav li a:hover {
text-decoration: none;
color: #fff;
}
.sidebar-nav li a:active,
.sidebar-nav li a:focus {
text-decoration: none;
}
.sidebar-nav > .sidebar-brand {
font-size: 18px;
line-height: 35px;
padding: 10px;
}
.sidebar-nav > .sidebar-brand a {
color: #ddd;
letter-spacing: 1px;
}
.sidebar-nav > .sidebar-brand a:hover {
color: #fff;
background: none;
}
/* Extended Eleemnts */
.sidebar-actions a {
display: inline-block !important;
margin-right: 20px;
color: #359f89 !important;
}
.sidebar-actions a i {
color: #fff;
}
.sidebar-actions a:hover {
background-color: transparent;
}
.sidebar-input .input-group {
margin: 10px 0px;
}
.sidebar-input .form-control,
.sidebar-input .input-group-addon {
background-color: transparent;
border-radius: 0px;
}
.sidebar-input .form-control {
border-right: none;
color: #eee;
}
.sidebar-input .input-group-addon {
border-left: none;
color: #ccc;
}
.sidebar-input .form-control:focus + .input-group-addon {
border-color: #66afe9;
}
.sidebar-item:hover,
.sidebar-item.active {
background-color: #1d1f2b;
}
.component-badge {
float: right;
margin-top: 8px;
padding: 0px 10px 2px 10px;
background-color: #4990e2;
color: #fff;
font-size: 12px;
line-height: 22px;
border-radius: 12px;
}
@media(min-width:768px) {
#wrapper {
padding-left: 300px;
}
#wrapper.toggled {
padding-left: 0;
}
#sidebar-wrapper {
width: 300px; }
#wrapper.toggled #sidebar-wrapper {
width: 0;
padding: 0;
}
#page-content-wrapper {
position: relative;
}
#wrapper.toggled #page-content-wrapper {
position: relative;
margin-right: 0;
}
}
\ No newline at end of file
/*
* 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.
*/
body {
font-family: 'Raleway', sans-serif;
background-color: #E6E6E6;
/* color: #686868;*/
}
a {
color: #359f89;
}
header {
background-color: #fff;
border-bottom: 1px #e7e8ed solid;
}
textarea:focus,
button:focus {
outline: none !important;
}
textarea {
resize: none;
}
/* Bootstrap Extended */
.form-control:focus {
box-shadow: none;
}
.breadcrumb {
padding: 8px 25px;
background-color: transparent;
margin-bottom: 0px;
font-weight: 600;
line-height: 44px;
}
.breadcrumb>li+li:before {
padding: 0 10px;
font-family: FontAwesome;
color: #686868;
content: "\f105";
}
.well {
background-color: #f6f7fa;
border: 1px solid #e8e9ef;
}
/* Header */
.main-search .form-control {
border: none;
border-left: 1px #e7e8ed solid;
border-radius: 0px;
box-shadow: none;
height: 60px;
font-size: 18px;
font-style: italic;
-webkit-font-smoothing: antialiased;
}
.main-search .input-group-addon {
font-size: 20px;
color: #b5b9bc;
background: none;
border: none;
}
.page-title {
background-color: #fff;
padding: 50px;
}
.page-title h1 {
margin-top: 0px;
margin-bottom: 20px;
font-weight: 600;
-webkit-font-smoothing: antialiased;
}
.page-title h1 small {
position: relative;
bottom: 5px;
margin-left: 15px;
padding-left: 15px;
border-left: 1px #e8e9ef solid;
color: #b4b7bc;
font-size: 40%;
font-weight: 600;
text-transform: uppercase;
}
.page-title .sub-title {
margin-bottom: 40px;
}
/* Atlas Specific */
.atlast-tabbable {
margin: 50px 0px;
}
.atlast-tabbable .nav-tabs {
border-bottom: 1px solid #e8e9ee;
}
.atlast-tabbable .nav-tabs>li>a {
padding: 15px 30px;
text-transform: uppercase;
letter-spacing: 1px;
border-radius: 2px 2px 0 0;
}
.atlast-tabbable .nav-tabs>li.active>a,
.atlast-tabbable .nav-tabs>li.active>a:focus,
.atlast-tabbable .nav-tabs>li.active>a:hover {
border: 1px solid #e8e9ee;
border-bottom-color: transparent;
}
.atlast-tabbable .tab-content {
background-color: #fff;
padding: 35px;
border: 1px solid #e8e9ee;
border-top: none;
}
.btn-atlas {
padding: 10px 20px;
background-color: #fff;
color: #37bb9b;
border: 1px #37bb9b solid;
border-radius: 4px;
-webkit-transition: all .3s ease;
-moz-transition: all .3s ease;
transition: all .3s ease;
}
.btn-atlas:hover {
background-color: #37bb9b;
color: #fff;
}
.btn-tag {
color: #4a90e2;
border: 1px #4a90e2 solid;
background-color: #fff;
border-radius: 4px;
-webkit-transition: all .3s ease;
-moz-transition: all .3s ease;
transition: all .3s ease;
}
.btn-tag:hover {
color: #fff;
background-color: #4a90e2;
}
.breadcrumb > li {
display: inline-block;
}
.breadcrumb-dropdown + li:before,
.breadcrumb-ellipsis + li:before {
display: none;
}
.breadcrumb-menu {
display: none
}
.sidebar-item.active i {
display: block !important;
}
.arrowPosition {
left: -75px;
}
.dropdown-menu>li>a {
color: #359f89;
padding: 6px 20px;
}
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
/*
* 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.
*/
body {
font-family: 'Raleway', sans-serif;
background-color: #f6f7fb;
color: #686868;
}
a {
color: #359f89;
}
button:focus {
outline: none !important;
}
/* Bootstrap Extended */
.form-control:focus {
box-shadow: none;
}
.errorBox {
position: absolute;
right: 36px;
display: none;
top: 26px;
width: 251px;
}
.errorBox .alert {
box-shadow: 4px 3px 8px -2px gray;
}
.close {
padding: 6px;
font-size: 15px;
}
/* Login Page */
.login-pane {
margin-top: 50px;
background: #323544;
color: #eee;
padding: 15px;
border-radius: 5px;
}
.login-pane h2 {
margin-bottom: 40px;
}
.login-pane .input-group {
margin: 20px 0px;
}
.login-pane .form-control,
.login-pane .input-group-addon {
background-color: transparent;
border-radius: 0px;
}
.login-pane .form-control {
border-left: none;
color: #eee;
}
.login-pane .form-control:focus {
border-color: #CCC;
}
.login-pane .input-group-addon {
border-right: none;
color: #ccc;
}
.login-pane .form-control:focus + .input-group-addon {
border-color: #66afe9;
}
.login-pane .btn-atlas {
background-color: #37bb9b;
color: #fff;
}
/* Login Page */
.login-pane {
margin-top: 35%;
background: #323544;
color: #eee;
padding: 15px;
border-radius: 5px;
}
.login-pane h2 {
margin-bottom: 40px;
}
.login-pane .input-group {
margin: 20px 0px;
}
.login-pane .form-control,
.login-pane .input-group-addon {
background-color: transparent;
border-radius: 0px;
}
.login-pane .form-control {
border-left: none;
color: #eee;
}
.login-pane .form-control:focus {
border-color: #CCC;
}
.login-pane .input-group-addon {
border-right: none;
color: #ccc;
}
.login-pane .form-control:focus + .input-group-addon {
border-color: #66afe9;
}
.login-pane .btn-atlas {
padding: 10px 20px;
background-color: #37bb9b;
color: #fff;
border: 1px #37bb9b solid;
border-radius: 4px;
-webkit-transition: all .3s ease;
-moz-transition: all .3s ease;
transition: all .3s ease;
}
/**
* 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.
*/
#old header a.mainLogo {
color: #FFF;
font-size: 16px;
line-height: 40px;
padding: 2px 5px 0 15px;
text-shadow: 0 1px 0 #555;
}
#old footer.navbar-bottom {
background-color: #fafafa;
border-top: solid 4px #444;
position: absolute;
bottom: 0px;
width: 100%;
height: 60px;
}
#old .footer {
padding: 7px;
}
#old .tab a {
color: #000;
}
#old .backgrid th {
text-align: left;
}
#old .backgrid a,
#old table a {
color: #428bca;
}
.backgrid th {
text-transform: capitalize;
}
#old .fa-refresh {
color: #333;
}
#old .tagList a {
display: inline-block;
text-transform: capitalize;
background: #ADD8E6 !important;
color: #333 !important;
padding: 3px 6px;
margin: 0px 3px 3px 0px;
cursor: pointer;
}
#old .tagList a i.fa {
margin-left: 5px;
}
/*
#old .tagList a {
max-width: 100px;
display: list-item;
overflow: hidden;
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
white-space: nowrap;
text-transform: capitalize;
float: left;
background: #ADD8E6 !important;
color: #000 !important;
margin: 4px !important;
padding-left: 7px !important;
padding-right: 7px !important;
cursor: pointer;
}*/
#new footer {
display: none;
}
.nav-tabs > li.active > a,
.nav-tabs > li.active > a:focus,
.nav-tabs > li.active > a:hover {
border-width: 0;
}
.nav-tabs > li > a {
border: none;
color: #666;
}
.nav-tabs > li.active > a,
.nav-tabs > li > a:hover {
border: none;
color: #359f89 !important;
}
.nav-tabs > li > a:after {
content: "";
background: #359f89;
height: 2px;
position: absolute;
width: 100%;
left: 0px;
top: -1px;
transition: all 250ms ease 0s;
transform: scale(0);
}
.nav-tabs > li > a:hover:after {
background: #359f89;
}
.nav-tabs > li.active > a:after,
.nav-tabs > li:hover > a:after {
transform: scale(1);
}
.tab-nav > li > a:after {
background: #21527d none repeat scroll 0% 0%;
color: #fff;
}
.tab-pane {
padding: 15px 0;
}
.sidebar-nav .dropdown-menu li {
border-bottom: none;
color: #323544;
}
.sidebar-nav .dropdown-menu li a:hover,
.sidebar-nav .dropdown-menu li a {
color: #323544;
}
.sidebar-nav .dropdown-menu li:hover {
background: #E4E4E4;
}
.sidebar-nav .dropdown-menu:after {
position: absolute;
top: -6px;
left: 10px;
display: inline-block;
border-right: 6px solid transparent;
border-bottom: 6px solid #ffffff;
border-left: 6px solid transparent;
content: '';
}
.breadcrumb-ellipsis {
color: #359f89;
cursor: pointer;
display: none !important;
}
.breadcrumb>li:last-child a {
color: #b4b7bc;
}
.atlas-tag .select2-selection__choice {
padding: 3px 6px !important;
background-color: #4a90e2 !important;
color: #fff !important;
font-size: 12px;
text-transform: uppercase;
border-radius: 4px;
}
.atlas-tag .select2-selection__choice__remove {
font-size: 17px;
line-height: 14px;
margin: 0px 6px !important;
color: #fff !important;
float: right;
}
.breadcrumb-dropdown .popover.bottom
{
margin-top: 35px;
}
<!--
* 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>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js">
<!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Atlas</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="icon" href="favicon.ico" type="image/x-icon">
<!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
<link rel="stylesheet" type="text/css" href="css/animate.min.css" />
<link rel="stylesheet" href="js/libs/backgrid/css/backgrid.css">
<link rel="stylesheet" href="js/libs/backgrid-filter/css/backgrid-filter.min.css">
<link rel="stylesheet" href="js/libs/backgrid-paginator/css/backgrid-paginator.css">
<link rel="stylesheet" href="js/libs/backgrid-orderable-columns/css/backgrid-orderable-columns.css">
<link rel="stylesheet" href="js/libs/backgrid-sizeable-columns/css/backgrid-sizeable-columns.css">
<link rel="stylesheet" href="js/libs/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="js/libs/jquery-asBreadcrumbs/css/asBreadcrumbs.css">
<link href='https://fonts.googleapis.com/css?family=Raleway:400,400italic,600,600italic,700,700italic' rel='stylesheet' type='text/css'>
<link href="css/bootstrap-sidebar.css" rel="stylesheet">
<link href="css/font-awesome.min.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<link href="css/business-catlog.css" rel="stylesheet">
<link href="css/override.css" rel="stylesheet">
</head>
<body>
<div id="new">
<div id="wrapper">
<div id="sidebar-wrapper">
<div id="sideNav-wrapper"></div>
</div>
<div id="page-content-wrapper">
<header id="new-header" class="clearfix"></header>
<div id="new-page-wrapper"> </div>
</div>
</div>
</div>
<div id='old'>
<!--Header Begin-->
<header id="header" class="navbar-fixed-top navbar-top navbar-atlas"> </header>
<!--Header End-->
<div class="container wrapper">
<div class="">
<div id="page-wrapper">
<div>
<img class="initialLoading" src="../img/ring.gif">
</div>
</div>
</div>
</div>
<div id="footer"></div>
</div>
<!-- build:js scripts/main.js -->
<script data-main="js/main" src="js/libs/requirejs/require.js"></script>
<!-- endbuild -->
</body>
</html>
/**
* 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.
*/
define(['marionette'], function(Marionette) {
var App = new Marionette.Application();
App.addRegions({
rHeader: '#header',
rSideNav: '#sideNav-wrapper',
rNContent: '#new-page-wrapper',
rNHeader: '#new-header',
rContent: '#page-wrapper',
rFooter: '#footer'
});
App.addInitializer(function() {
Backbone.history.start();
});
return App;
});
/**
* 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.
*/
define(['require',
'utils/Globals',
'utils/Utils',
'backbone.paginator'
], function(require, Globals, Utils) {
'use strict';
var BaseCollection = Backbone.PageableCollection.extend(
/** @lends BaseCollection.prototype */
{
/**
* BaseCollection's initialize function
* @augments Backbone.PageableCollection
* @constructs
*/
initialize: function() {
},
bindErrorEvents: function() {
this.bind("error", Utils.defaultErrorHandler);
},
/**
* state required for the PageableCollection
*/
state: {
firstPage: 0,
pageSize: Globals.settings.PAGE_SIZE
},
mode: 'client',
/**
* override the parseRecords of PageableCollection for our use
*/
parseRecords: function(resp, options) {
this.responseData = {
dataType: resp.dataType,
query: resp.query,
queryType: resp.queryType,
requestId: resp.requestId
}
try {
if (!this.modelAttrName) {
throw new Error("this.modelAttrName not defined for " + this);
}
return resp[this.modelAttrName];
} catch (e) {
console.log(e);
}
},
////////////////////////////////////////////////////////////
// Overriding backbone-pageable page handlers methods //
////////////////////////////////////////////////////////////
getFirstPage: function(options) {
return this.getPage('first', _.extend({
reset: true
}, options));
},
getPreviousPage: function(options) {
return this.getPage("prev", _.extend({
reset: true
}, options));
},
getNextPage: function(options) {
return this.getPage("next", _.extend({
reset: true
}, options));
},
getLastPage: function(options) {
return this.getPage("last", _.extend({
reset: true
}, options));
},
hasPrevious: function(options) {
return this.hasPreviousPage();
},
hasNext: function(options) {
return this.hasNextPage();
}
/////////////////////////////
// End overriding methods //
/////////////////////////////
},
/** BaseCollection's Static Attributes */
{
// Static functions
getTableCols: function(cols, collection) {
var retCols = _.map(cols, function(v, k, l) {
var defaults = collection.constructor.tableCols[k];
if (!defaults) {
//console.log("Error!! " + k + " not found in collection: " , collection);
defaults = {};
}
return _.extend({
'name': k
}, defaults, v);
});
return retCols;
},
nonCrudOperation: function(url, requestMethod, options) {
return Backbone.sync.call(this, null, this, _.extend({
url: url,
type: requestMethod
}, options));
}
});
return BaseCollection;
});
/**
* 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.
*/
define(['require',
'utils/Globals',
'collection/BaseCollection',
'models/VCommon',
], function(require, Globals, BaseCollection, VCommon) {
'use strict';
var VCommonList = BaseCollection.extend(
//Prototypal attributes
{
url: Globals.baseURL + '',
model: VCommon,
initialize: function() {
this.modelName = 'VCommon';
this.modelAttrName = '';
this.bindErrorEvents();
},
},
//Static Class Members
{
/**
* Table Cols to be passed to Backgrid
* UI has to use this as base and extend this.
*
*/
tableCols: {}
}
);
return VCommonList;
});
/**
* 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.
*/
define(['require',
'utils/Globals',
'collection/BaseCollection',
'models/VEntity'
], function(require, Globals, BaseCollection, VEntity) {
'use strict';
var VEntityList = BaseCollection.extend(
//Prototypal attributes
{
url: Globals.baseURL + '/api/atlas/entities',
model: VEntity,
initialize: function() {
this.modelName = 'VEntity';
this.modelAttrName = 'definition';
this.bindErrorEvents();
}
},
//Static Class Members
{
/**
* Table Cols to be passed to Backgrid
* UI has to use this as base and extend this.
*
*/
tableCols: {}
}
);
return VEntityList;
});
/**
* 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.
*/
define(['require',
'utils/Globals',
'collection/BaseCollection',
'models/VLineage'
], function(require, Globals, BaseCollection, VLineage) {
'use strict';
var VLineageList = BaseCollection.extend(
//Prototypal attributes
{
url: Globals.baseURL + 'api/atlas/lineage/hive/table/assetName/outputs/graph',
model: VLineage,
initialize: function() {
this.modelName = 'VLineage';
this.modelAttrName = 'results';
this.bindErrorEvents();
}
},
//Static Class Members
{
/**
* Table Cols to be passed to Backgrid
* UI has to use this as base and extend this.
*
*/
tableCols: {}
}
);
return VLineageList;
});
/**
* 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.
*/
define(['require',
'utils/Globals',
'collection/BaseCollection',
'models/VSchema'
], function(require, Globals, BaseCollection, VSchema) {
'use strict';
var VSchemaList = BaseCollection.extend(
//Prototypal attributes
{
url: Globals.baseURL + '/api/atlas/lineage/hive/table/log_fact_daily_mv/schema',
model: VSchema,
initialize: function() {
this.modelName = 'VSchema';
this.modelAttrName = 'results';
this.bindErrorEvents();
},
parseRecords: function(resp, options) {
try {
if (!this.modelAttrName) {
throw new Error("this.modelAttrName not defined for " + this);
}
var arr = [];
resp[this.modelAttrName].rows.forEach(function(d) {
arr.push(d)
})
return arr;
} catch (e) {
console.log(e);
}
},
},
//Static Class Members
{
/**
* Table Cols to be passed to Backgrid
* UI has to use this as base and extend this.
*
*/
tableCols: {}
}
);
return VSchemaList;
});
/**
* 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.
*/
define(['require',
'utils/Globals',
'collection/BaseCollection',
'models/VSearch'
], function(require, Globals, BaseCollection, VSearch) {
'use strict';
var VSearchList = BaseCollection.extend(
//Prototypal attributes
{
url: Globals.baseURL + '/api/atlas/discovery/search',
model: VSearch,
initialize: function() {
this.modelName = 'VSearch';
this.modelAttrName = 'results';
this.bindErrorEvents();
}
},
//Static Class Members
{
/**
* Table Cols to be passed to Backgrid
* UI has to use this as base and extend this.
*
*/
tableCols: {}
}
);
return VSearchList;
});
/**
* 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.
*/
define(['require',
'utils/Globals',
'collection/BaseCollection',
'models/VTag'
], function(require, Globals, BaseCollection, VTag) {
'use strict';
var VTagList = BaseCollection.extend(
//Prototypal attributes
{
url: Globals.baseURL + '/api/atlas/types',
model: VTag,
initialize: function() {
this.modelName = 'VTag';
this.modelAttrName = 'results';
this.bindErrorEvents();
},
parseRecords: function(resp, options) {
try {
if (!this.modelAttrName) {
throw new Error("this.modelAttrName not defined for " + this);
}
var arr = [];
resp[this.modelAttrName].forEach(function(d) {
arr.push({
tags: d
})
})
return arr;
} catch (e) {
console.log(e);
}
},
},
//Static Class Members
{
/**
* Table Cols to be passed to Backgrid
* UI has to use this as base and extend this.
*
*/
tableCols: {}
}
);
return VTagList;
});
/**
* 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.
*/
require.config({
/* starting point for application */
hbs: {
disableI18n: true, // This disables the i18n helper and doesn't require the json i18n files (e.g. en_us.json)
helperPathCallback: // Callback to determine the path to look for helpers
function(name) { // ('/template/helpers/'+name by default)
return 'modules/Helpers';
},
templateExtension: 'html', // Set the extension automatically appended to templates
compileOptions: {} // options object which is passed to Handlebars compiler
},
/**
* Requested as soon as the loader has processed the configuration. It does
* not block any other require() calls from starting their requests for
* modules, it is just a way to specify some modules to load asynchronously
* as part of a config block.
* @type {Array} An array of dependencies to load.
*/
deps: ['marionette'],
/**
* The number of seconds to wait before giving up on loading a script.
* @default 7 seconds
* @type {Number}
*/
waitSeconds: 30,
shim: {
backbone: {
deps: ['underscore', 'jquery'],
exports: 'Backbone'
},
asBreadcrumbs: {
deps: ['jquery'],
exports: 'asBreadcrumbs'
},
bootstrap: {
deps: ['jquery'],
exports: 'jquery'
},
underscore: {
exports: '_'
},
marionette: {
deps: ['backbone']
},
backgrid: {
deps: ['backbone'],
exports: 'Backgrid'
},
'backgrid-paginator': {
deps: ['backbone', 'backgrid']
},
'backgrid-filter': {
deps: ['backbone', 'backgrid']
},
'backgrid-orderable': {
deps: ['backbone', 'backgrid'],
},
'backgrid-sizeable': {
deps: ['backbone', 'backgrid'],
},
hbs: {
deps: ['underscore', 'handlebars']
},
d3: {
exports: 'd3'
},
'd3-tip': {
deps: ['d3'],
exports: 'd3-tip'
},
noty: {
deps: ['jquery'],
},
dagreD3: {
deps: ['d3'],
exports: 'dagreD3'
}
},
paths: {
'jquery': 'libs/jquery/js/jquery.min',
'underscore': 'libs/underscore/underscore-min',
'bootstrap': 'libs/bootstrap/js/bootstrap.min',
'backbone': 'libs/backbone/backbone-min',
'backbone.babysitter': 'libs/backbone.babysitter/lib/backbone.babysitter.min',
'marionette': 'libs/backbone-marionette/backbone.marionette.min',
'backbone.paginator': 'libs/backbone-paginator/backbone.paginator.min',
'backbone.wreqr': 'libs/backbone-wreqr/backbone.wreqr.min',
'backgrid': 'libs/backgrid/js/backgrid',
'backgrid-filter': 'libs/backgrid-filter/js/backgrid-filter.min',
'backgrid-orderable': 'libs/backgrid-orderable-columns/js/backgrid-orderable-columns',
'backgrid-paginator': 'libs/backgrid-paginator/js/backgrid-paginator.min',
'backgrid-sizeable': 'libs/backgrid-sizeable-columns/js/backgrid-sizeable-columns',
'asBreadcrumbs': 'libs/jquery-asBreadcrumbs/js/jquery-asBreadcrumbs.min',
'd3': 'libs/d3/d3.min',
'd3-tip': 'libs/d3/index',
'tmpl': 'templates',
'noty': 'libs/noty/js/jquery.noty.packaged.min',
'requirejs.text': 'libs/requirejs-text/text',
'handlebars': 'require-handlebars-plugin/js/handlebars',
'json2': 'require-handlebars-plugin/js/json2',
'hbs': 'require-handlebars-plugin/js/hbs',
'i18nprecompile': 'require-handlebars-plugin/js/i18nprecompile',
'dagreD3': 'libs/dagre-d3/dagre-d3.min'
},
/**
* If set to true, an error will be thrown if a script loads that does not
* call define() or have a shim exports string value that can be checked.
* To get timely, correct error triggers in IE, force a define/shim export.
* @type {Boolean}
*/
enforceDefine: false
});
require(['App',
'router/Router',
'utils/Overrides',
'bootstrap',
'd3'
], function(App, Router) {
App.appRouter = new Router();
App.start();
});
/**
* 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.
*/
define(['require', 'utils/Utils', 'backbone'], function(require, Utils, Backbone) {
'use strict';
var BaseModel = Backbone.Model.extend(
/** @lends BaseModel.prototype */
{
/**
* BaseModel's initialize function
* @augments Backbone.Model
* @constructs
*/
initialize: function() {
},
bindErrorEvents: function() {
this.bind("error", Utils.defaultErrorHandler);
},
/**
* toString for a model. Every model should implement this function.
*/
toString: function() {
throw new Error('ERROR: toString() not defined for ' + this.modelName);
},
/**
* Silent'ly set the attributes. ( do not trigger events )
*/
silent_set: function(attrs) {
return this.set(attrs, {
silent: true
});
}
},
/** BaseModel's Static Attributes */
{
/**
* [nonCrudOperation description]
* @param {[type]} url [description]
* @param {[type]} requestMethod [description]
* @param {[type]} options [description]
* @return {[type]} [description]
*/
nonCrudOperation: function(url, requestMethod, options) {
return Backbone.sync.call(this, null, this, _.extend({
url: url,
type: requestMethod
}, options));
}
});
return BaseModel;
});
/**
* 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.
*/
define(['require',
'utils/Globals',
'models/BaseModel'
], function(require, Globals, VBaseModel) {
'use strict';
var VCommon = VBaseModel.extend({
urlRoot: Globals.baseURL + '',
defaults: {},
serverSchema: {},
idAttribute: 'id',
initialize: function() {
this.modelName = 'VCommon';
this.bindErrorEvents();
},
toString: function() {
return this.get('name');
},
}, {});
return VCommon;
});
/**
* 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.
*/
define(['require',
'utils/Globals',
'models/BaseModel'
], function(require, Globals, VBaseModel) {
'use strict';
var VEntity = VBaseModel.extend({
urlRoot: Globals.baseURL + '/api/atlas/entities/',
defaults: {},
serverSchema: {},
idAttribute: 'id',
initialize: function() {
this.modelName = 'VEntity';
this.bindErrorEvents();
},
toString: function() {
return this.get('name');
},
/*************************
* Non - CRUD operations
*************************/
getEntity: function(token, options) {
var url = Globals.baseURL + '/api/atlas/entities/' + token;
options = _.extend({
contentType: 'application/json',
dataType: 'json'
}, options);
return this.constructor.nonCrudOperation.call(this, url, 'GET', options);
},
saveEntity: function(token, options) {
var url = Globals.baseURL + '/api/atlas/entities/' + token + '/traits';
options = _.extend({
contentType: 'application/json',
dataType: 'json'
}, options);
return this.constructor.nonCrudOperation.call(this, url, 'POST', options);
},
}, {});
return VEntity;
});
/**
* 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.
*/
define(['require',
'utils/Globals',
'models/BaseModel'
], function(require, Globals, VBaseModel) {
'use strict';
var VLineage = VBaseModel.extend({
urlRoot: Globals.baseURL + 'api/atlas/lineage/hive/table/assetName/outputs/graph',
defaults: {},
serverSchema: {},
idAttribute: 'id',
initialize: function() {
this.modelName = 'VLineage';
this.bindErrorEvents();
},
toString: function() {
return this.get('name');
},
}, {});
return VLineage;
});
/**
* 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.
*/
define(['require',
'utils/Globals',
'models/BaseModel'
], function(require, Globals, VBaseModel) {
'use strict';
var VSchema = VBaseModel.extend({
urlRoot: Globals.baseURL + '/api/atlas/lineage/hive/table/log_fact_daily_mv/schema',
defaults: {},
serverSchema: {},
idAttribute: 'id',
initialize: function() {
this.modelName = 'VSchema';
this.bindErrorEvents();
},
toString: function() {
return this.get('name');
},
}, {});
return VSchema;
});
/**
* 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.
*/
define(['require',
'utils/Globals',
'models/BaseModel'
], function(require, Globals, VBaseModel) {
'use strict';
var VSearch = VBaseModel.extend({
urlRoot: Globals.baseURL + '/api/atlas/discovery/search',
defaults: {},
serverSchema: {},
idAttribute: 'id',
initialize: function() {
this.modelName = 'VSearch';
this.bindErrorEvents();
},
toString: function() {
return this.get('name');
},
/*************************
* Non - CRUD operations
*************************/
getEntity: function(token, options) {
var url = Globals.baseURL + '/api/atlas/entities/' + token;
options = _.extend({
contentType: 'application/json',
dataType: 'json'
}, options);
return this.constructor.nonCrudOperation.call(this, url, 'GET', options);
},
}, {});
return VSearch;
});
/**
* 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.
*/
define(['require',
'utils/Globals',
'models/BaseModel'
], function(require, Globals, vBaseModel) {
'use strict';
var VTag = vBaseModel.extend({
urlRoot: Globals.baseURL + '/api/atlas/types',
defaults: {},
serverSchema: {},
idAttribute: 'id',
initialize: function() {
this.modelName = 'VTag';
this.bindErrorEvents();
},
toString: function() {
return this.get('name');
},
/*************************
* Non - CRUD operations
*************************/
deleteTag: function(guid, name, options) {
var url = Globals.baseURL + '/api/atlas/entities/' + guid + '/traits/' + name;
options = _.extend({
contentType: 'application/json',
dataType: 'json'
}, options);
return this.constructor.nonCrudOperation.call(this, url, 'DELETE', options);
}
}, {});
return VTag;
});
/**
* 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.
*/
define(['require',
'handlebars',
], function(require, Handlebars, localization) {
/*
* General guidelines while writing helpers:
*
* - If returning HTML use return new Handlebars.SafeString();
* - If the helper needs optional arguments use the "hash arguments"
* Eg. {{{link . "See more..." story.url class="story"}}}
* NOTE: the first argument after the helper name should be . which will be context in the helper function
* Handlebars.registerHelper('link', function (context, text, url, options) {
* var attrs = [];
*
* for(var prop in options.hash) {
* attrs.push(prop + '="' + options.hash[prop] + '"');
* }
* return new Handlebars.SafeString("<a " + attrs.join(" ") + ">" + text + "</a>");
* });
*
*
* NOTE: Due to some limitations in the require-handlebars-plugin, we cannot have helper that takes zero arguments,
* for such helpers we have to pass a "." as first argument. [https://github.com/SlexAxton/require-handlebars-plugin/issues/72]
*/
var HHelpers = {};
/**
* Convert new line (\n\r) to <br>
* from http://phpjs.org/functions/nl2br:480
*/
HHelpers.nl2br = function(text) {
text = Handlebars.Utils.escapeExpression(text);
var nl2br = (text + '').replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1' + '<br>' + '$2');
return new Handlebars.SafeString(nl2br);
};
Handlebars.registerHelper('nl2br', HHelpers.nl2br);
Handlebars.registerHelper('toHumanDate', function(val) {
if (!val) return "";
return val //localization.formatDate(val, 'f');
});
Handlebars.registerHelper('tt', function(str) {
//return localization.tt(str);
return str;
});
Handlebars.registerHelper('ifCond', function(v1, operator, v2, options) {
switch (operator) {
case '==':
return (v1 == v2) ? options.fn(this) : options.inverse(this);
break;
case '===':
return (v1 === v2) ? options.fn(this) : options.inverse(this);
break;
case '<':
return (v1 < v2) ? options.fn(this) : options.inverse(this);
break;
case '<=':
return (v1 <= v2) ? options.fn(this) : options.inverse(this);
break;
case '>':
return (v1 > v2) ? options.fn(this) : options.inverse(this);
break;
case '>=':
return (v1 >= v2) ? options.fn(this) : options.inverse(this);
break;
default:
return options.inverse(this);
break;
}
//return options.inverse(this);
});
return HHelpers;
});
/**
* 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.
*/
define(function(require) {
var Backbone = require('backbone');
var template = require('hbs!tmpl/common/modal');
var Modal = Backbone.View.extend({
className: 'modal',
events: {
'click .close': function(event) {
event.preventDefault();
this.trigger('closeModal');
if (this.options.content && this.options.content.trigger) {
this.options.content.trigger('closeModal', this);
}
},
'click .cancel': function(event) {
event.preventDefault();
this.trigger('closeModal');
if (this.options.content && this.options.content.trigger) {
this.options.content.trigger('closeModal', this);
}
},
'click .ok': function(event) {
event.preventDefault();
this.trigger('ok');
if (this.options.content && this.options.content.trigger) {
this.options.content.trigger('ok', this);
}
if (this.options.okCloses) {
this.close();
}
}
},
/**
* Creates an instance of a Bootstrap Modal
*
* @see http://twitter.github.com/bootstrap/javascript.html#modals
*
* @param {Object} options
* @param {String|View} [options.content] Modal content. Default: none
* @param {String} [options.title] Title. Default: none
* @param {String} [options.okText] Text for the OK button. Default: 'OK'
* @param {String} [options.cancelText] Text for the cancel button. Default: 'Cancel'. If passed a falsey value, the button will be removed
* @param {Boolean} [options.allowCancel Whether the modal can be closed, other than by pressing OK. Default: true
* @param {Boolean} [options.escape] Whether the 'esc' key can dismiss the modal. Default: true, but false if options.cancellable is true
* @param {Boolean} [options.animate] Whether to animate in/out. Default: false
* @param {Function} [options.template] Compiled underscore template to override the default one
*/
initialize: function(options) {
this.options = _.extend({
title: null,
okText: 'OK',
focusOk: true,
okCloses: true,
cancelText: 'Cancel',
allowCancel: false,
showFooter: true,
escape: true,
animate: true,
contentWithFooter: false,
template: template
}, options);
},
/**
* Creates the DOM element
*
* @api private
*/
render: function() {
var $el = this.$el,
options = this.options,
content = options.content;
//Create the modal container
$el.html(options.template(options));
// var $content = this.$content = $el.find('.modal-body');
//Insert the main content if it's a view
if (content && content.$el) {
content.render();
if (options.contentWithFooter) {
$el.find('.modal-content').append(content.$el);
} else {
$el.find('.modal-body').html(content.$el);
}
} else {
if (options.htmlContent) {
$el.find('.modal-body').append(options.htmlContent);
}
}
// if (options.mainClass) $el.addClass(options.mainClass);
if (options.animate) $el.addClass('fade');
this.isRendered = true;
return this;
},
onClose: function() {
alert('close');
},
/**
* Renders and shows the modal
*
* @param {Function} [cb] Optional callback that runs only when OK is pressed.
*/
open: function(cb) {
if (!this.isRendered) this.render();
var self = this,
$el = this.$el;
//Create it
$el.modal(_.extend({
keyboard: this.options.allowCancel,
backdrop: this.options.allowCancel ? true : 'static'
}, this.options.modalOptions));
//Focus OK button
$el.one('shown', function() {
if (self.options.focusOk) {
$el.find('.btn.ok').focus();
}
if (self.options.content && self.options.content.trigger) {
self.options.content.trigger('shown', self);
}
self.trigger('shown');
});
//Adjust the modal and backdrop z-index; for dealing with multiple modals
var numModals = Modal.count,
$backdrop = $('.modal-backdrop:eq(' + numModals + ')'),
backdropIndex = parseInt($backdrop.css('z-index'), 10),
elIndex = parseInt($backdrop.css('z-index'), 10);
$backdrop.css('z-index', backdropIndex + numModals);
this.$el.css('z-index', elIndex + numModals);
if (this.options.allowCancel) {
$backdrop.one('click', function() {
if (self.options.content && self.options.content.trigger) {
self.options.content.trigger('closeModal', self);
}
self.trigger('closeModal');
});
$(document).one('keyup.dismiss.modal', function(e) {
e.which == 27 && self.trigger('closeModal');
if (self.options.content && self.options.content.trigger) {
e.which == 27 && self.options.content.trigger('shown', self);
}
});
}
this.on('cancel', function() {
self.close();
});
Modal.count++;
//Run callback on OK if provided
if (cb) {
self.on('ok', cb);
}
return this;
},
/**
* Closes the modal
*/
close: function() {
var self = this,
$el = this.$el;
//Check if the modal should stay open
if (this._preventClose) {
this._preventClose = false;
return;
}
$el.one('hidden.bs.modal', function onHidden(e) {
// Ignore events propagated from interior objects, like bootstrap tooltips
if (e.target !== e.currentTarget) {
return $el.one('hidden.bs.modal', onHidden);
}
self.remove();
if (self.options.content && self.options.content.trigger) {
self.options.content.trigger('hidden.bs.modal', self);
}
self.trigger('hidden.bs.modal');
});
$el.modal('hide');
Modal.count--;
},
/**
* Stop the modal from closing.
* Can be called from within a 'close' or 'ok' event listener.
*/
preventClose: function() {
this._preventClose = true;
}
}, {
//STATICS
//The number of modals on display
count: 0
});
return Modal;
});
/**
* 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.
*/
define(['backbone.wreqr'], function(Wreqr) {
"use strict";
return new Wreqr.EventAggregator();
});
This source diff could not be displayed because it is too large. You can view the blob instead.
//>>excludeStart('excludeAfterBuild', pragmas.excludeAfterBuild)
define(['handlebars', "underscore"], function(Handlebars, _) {
function replaceLocaleStrings(ast, mapping, options) {
options = options || {};
mapping = mapping || {};
// Base set of things
if (ast && ast.type === "program" && ast.statements) {
_(ast.statements).forEach(function(statement, i) {
var newString = "<!-- i18n error -->";
// If it's a translation node
if (statement.type === "mustache" && statement.id && statement.id.original === "$") {
if (statement.params.length && statement.params[0].string) {
var key = statement.params[0].string;
newString = mapping[key] || (options.originalKeyFallback ? key : newString);
}
ast.statements[i] = new Handlebars.AST.ContentNode(newString);
}
// If we need to recurse
else if (statement.program) {
statement.program = replaceLocaleStrings(statement.program, mapping, options);
}
});
// Also cover the else blocks
if (ast.inverse) {
replaceLocaleStrings(ast.inverse, mapping, options);
}
}
return ast;
}
return function precompile(string, mapping, options) {
var ast, environment;
options = options || {};
if (!('data' in options)) {
options.data = true;
}
if (options.compat) {
options.useDepths = true;
}
ast = Handlebars.parse(string);
// avoid replacing locale if mapping is `false`
if (mapping !== false) {
ast = replaceLocaleStrings(ast, mapping, options);
}
environment = new Handlebars.Compiler().compile(ast, options);
return new Handlebars.JavaScriptCompiler().compile(environment, options);
};
});
//>>excludeEnd('excludeAfterBuild')
/**
* 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.
*/
define([
'jquery',
'underscore',
'backbone',
'App',
'utils/Globals',
'utils/Utils'
], function($, _, Backbone, App, Globals, Utils) {
var AppRouter = Backbone.Router.extend({
routes: {
// Define some URL routes
'': 'assetPageLoad',
'!/': 'assetPageLoad',
"!/dashboard/assetPage": 'assetPageLoad',
'!/dashboard/detailPage/:id': 'detailPageLoad',
'!/dashboard/createTags': 'tagPageLoad',
// Default
'*actions': 'defaultAction'
},
initialize: function() {
this.showRegions();
this.bindCommonEvents();
this.listenTo(this, 'route', this.postRouteExecute, this);
this.globalVent = new Backbone.Wreqr.EventAggregator();
this.catalogVent = new Backbone.Wreqr.EventAggregator();
this.tagVent = new Backbone.Wreqr.EventAggregator();
},
bindCommonEvents: function() {
var that = this;
$('body').on('click', 'li.aboutAtlas', function() {
that.aboutAtlas();
});
},
aboutAtlas: function() {
var that = this;
require([
'hbs!tmpl/common/aboutAtlas_tmpl',
'modules/Modal'
], function(aboutAtlasTmpl, Modal) {
var aboutAtlas = Marionette.LayoutView.extend({
template: aboutAtlasTmpl,
events: {},
});
var view = new aboutAtlas();
var modal = new Modal({
title: 'About',
content: view,
okCloses: true,
showFooter: true,
}).open();
view.on('closeModal', function() {
modal.trigger('cancel');
});
});
},
showRegions: function() {},
/**
* @override
* Execute a route handler with the provided parameters. This is an
* excellent place to do pre-route setup or post-route cleanup.
* @param {Function} callback - route handler
* @param {Array} args - route params
*/
execute: function(callback, args) {
this.preRouteExecute();
if (callback) callback.apply(this, args);
this.postRouteExecute();
},
preRouteExecute: function() {
// console.log("Pre-Route Change Operations can be performed here !!");
},
postRouteExecute: function(name, args) {
// console.log("Post-Route Change Operations can be performed here !!");
// console.log("Route changed: ", name);
},
/**
* Define route handlers here
*/
assetPageLoad: function() {
var that = this;
$('#old').show();
$('#new').hide();
require([
'views/asset/AssetPageLayoutView',
'collection/VSearchList',
'views/site/Header',
/*'views/site/footer',*/
], function(AssetPageLayoutView, VSearchList, HeaderView /*, FooterView*/ ) {
that.searchCollection = new VSearchList([], {
state: {
firstPage: 0,
pageSize: 10
}
});
App.rHeader.show(new HeaderView({ 'globalVent': that.globalVent }));
App.rContent.show(new AssetPageLayoutView({
'globalVent': that.globalVent,
'collection': that.searchCollection,
'vent': that.tagVent
}));
});
},
detailPageLoad: function(id) {
var that = this;
$('#old').show();
$('#new').hide();
if (id) {
require([
'views/detail_page/DetailPageLayoutView',
'collection/VEntityList',
'views/site/Header',
], function(DetailPageLayoutView, VEntityList, HeaderView) {
this.entityCollection = new VEntityList([], {});
App.rHeader.show(new HeaderView({ 'globalVent': that.globalVent }));
App.rContent.show(new DetailPageLayoutView({
'globalVent': that.globalVent,
'collection': entityCollection,
'id': id,
'vent': that.tagVent
}));
entityCollection.url = "/api/atlas/entities/" + id;
entityCollection.fetch({ reset: true });
});
}
},
tagPageLoad: function() {
var that = this;
$('#old').show();
$('#new').hide();
require([
'views/tag/createTagsLayoutView',
'collection/VTagList',
'views/site/Header',
], function(CreateTagsLayoutView, VTagList, HeaderView) {
this.tagsCollection = new VTagList([], {});
App.rHeader.show(new HeaderView({ 'globalVent': that.globalVent }));
App.rContent.show(new CreateTagsLayoutView({
'globalVent': that.globalVent,
'tagsCollection': tagsCollection,
}));
});
},
defaultAction: function(actions) {
// We have no matching route, lets just log what the URL was
console.log('No route:', actions);
}
});
return AppRouter;
});
<!--
* 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.
-->
<div class="row">
<div class="col-sm-3">
<div id="r_tagLayoutView"></div>
</div>
<div class="col-sm-9">
<div class="panel panel-default">
<div class="panel-body">
<div id="r_searchLayoutView"></div>
<div class="fontLoader">
<i class="fa fa-refresh fa-spin-custom"></i>
</div>
<div id="r_entityTableLayoutView" class="entityTable"></div>
</div>
</div>
</div>
</div>
<!--
* 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.
-->
<div class="clearfix">
<div class="form-group pull-right no-margin">
<div data-id="control" class="pull-right"></div>
<label class="select pull-right">
<select data-id="pageSize" class="form-control">
<option selected>10</option>
<option>25</option>
<option>50</option>
<option>100</option>
</select>
</label>
</div>
</div>
<div class="position-relative thick-border">
<div data-id="r_tableList" class="table-responsive tableBorder"> </div>
<div data-id="r_tableSpinner"></div>
</div>
<div class="row banded">
<div data-id="r_footerRecords" class="col-sm-6 margin-top-10"></div>
<div data-id="r_pagination" class="col-sm-6 text-right"></div>
</div>
\ No newline at end of file
<!--
* 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.
-->
<div class="row">
<div class="col-md-4">
<img src="img/ApacheAtlasLogo.png" class="img-responsive">
<div class="col-md-8 subContent">
<h2 class="title-bold">Apache Atlas</h2>
<p class="ng-binding"><b>Version : </b> 0.7-incubating-SNAPSHOT-ra2cc01c4342ace7f7a3e3e254d7ede781f990318</p>
<br>
<p class="text-info">Get involved!</p>
<p class="text-info"><a href="http://apache.org/licenses/LICENSE-2.0" target="_blank">Licensed under the Apache License Version 2.0</a></p>
</div>
</div>
<!--
* 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.
-->
<div class="modal-dialog {{mainClass}}" role="document">
<div class="modal-content">
{{#if title}}
<div class="modal-header">
<a class="close">&times;</a>
<h4 class="modal-title">
{{#if titleHtml}}
{{{tt title}}}
{{else}}
{{tt title}}
{{/if}}
</h4>
</div>
{{/if}}
{{#if contentWithFooter}}
{{else}}
<div class="modal-body">{{content}}</div>
{{#if showFooter}}
<div class="modal-footer" >
<a href="#" class="btn ok btn-success">{{tt okText}}</a>
{{#if allowCancel}}
{{#if cancelText}}
<a href="#" class="btn btn-default cancel">{{tt cancelText}}</a>
{{/if}}
{{/if}}
</div>
{{/if}}
{{/if}}
</div>
</div>
\ No newline at end of file
<!--
* 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.
-->
<div class="col-sm-12">
<ol class="breadcrumb">
<li><a href="#!/dashboard/assetPage">Home</a></li>
<li class="active breadcrumbName"></li>
</ol>
<div class="panel panel-default lineageLayout" style="display:none">
<div id="r_lineageLayoutView"></div>
</div>
<div class="panel panel-default">
<div class="panel-body">
<p class="name"></p>
<p class="description"></p>
<hr>
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="tab active"><a href="#tab-details" aria-controls="tab-details" role="tab" data-toggle="tab">Details</a></li>
<li role="presentation" class="tab schemaTable" style="display:none"><a href="#tab-schema" aria-controls="tab-schema" role="tab" data-toggle="tab">Schema</a></li>
<li role="presentation" class="tab "><a href="#tab-tags" aria-controls="tab-tags" role="tab" data-toggle="tab">Tags</a></li>
</ul>
<div class="tab-content">
<div id="tab-details" role="tabpanel" class="tab-pane active">
<div id="r_entityDetailTableLayoutView"></div>
</div>
<div id="tab-schema" class="tab-pane">
<div id="r_schemaTableLayoutView"></div>
</div>
<div id="tab-tags" class="tab-pane">
<div id="r_tagTableLayoutView"></div>
</div>
</div>
</div>
</div>
</div>
<!--
* 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.
-->
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Key</th>
<th>Value</th>
</tr>
</thead>
<tbody data-id="detailValue">
</tbody>
</table>
<!--
* 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.
-->
<div class="panel-heading">
<h3 class="panel-title">Lineage</h3>
</div>
<div class="fontLoader">
<i class="fa fa-refresh fa-spin-custom"></i>
</div>
<div class="panel-body graph-bg" align="center">
<!-- <div class="temp">
<i class="glyphicon glyphicon-plus"></i>
<i class="glyphicon glyphicon-minus"></i>
</div> -->
<div class="graph" id="tree-container">
</div>
<div>
<svg width=100% height=350> </svg>
</div>
</div>
<!--
* 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.
-->
<div id="r_tagLayoutView"></div>
\ No newline at end of file
<!--
* 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.
-->
<div class="row row-margin-bottom">
<div class="col-sm-12">
<div class="switch" style="float: left;">
<input type="radio" class="switch-input" name="queryType" value="fulltext" id="fulltext_toggle" checked="">
<label for="fulltext_toggle" class="switch-label switch-label-off">Text</label>
<input type="radio" class="switch-input" name="queryType" value="dsl" id="dsl_toggle">
<label for="dsl_toggle" class="switch-label switch-label-on">DSL</label>
<span class="switch-selection"></span>
</div>
<div class="input-group">
<input style="padding-left: 132px;" type="text" class="form-control" data-id="searchInput" placeholder="Search using a query string: e.g. sales_fact">
<span class="input-group-btn">
<button class="btn btn-success" data-id="searchButton" type="button"><i class="fa fa-search"></i></button>
</span>
</div>
</div>
</div>
<!--
* 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.
-->
<footer class="footer navbar-bottom">
<div class="container">
<p align="right">Powered by<img src="../img/logo-green.png"></p>
</div>
</footer>
<!--
* 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.
-->
<div class="container">
<div class="row">
<div class="navbar-header">
<ul class="sidebar-nav">
<li class="sidebar-brand clearfix">
<a class="pull-left" href="#!/"><i class="fa fa-globe"></i><strong> Atlas</strong></a>
<div class="dropdown headerDroupDown pull-left">
<a href="javascript:void(0)" class="dropdown-toggle" data-toggle="dropdown">
{{#ifCond urlType "==" "assetPage"}}
Assets
{{else}}
{{#ifCond urlType "==" "createTags"}}
Tag Definition
{{else}}
Asset Details
{{/ifCond}}
{{/ifCond}}
<span class="caret"></span></a>
<ul class="dropdown-menu">
{{#ifCond urlType "==" "assetPage"}}
<li><a href="#!/dashboard/createTags">Tag Definition</a></li>
{{else}} {{#ifCond urlType "==" "createTags"}}
<li><a href="#!/dashboard/assetPage">Assets</a></li>
{{else}}
<li><a href="#!/dashboard/assetPage">Assets</a></li>
<li><a href="#!/dashboard/createTags">Tag Definition</a></li>
{{/ifCond}} {{/ifCond}}
<li><a target="_blank" href="https://cwiki.apache.org/confluence/display/ATLAS/Atlas+Home">Help</a></li>
<li class="aboutAtlas"><a href="javascript:void(0)">About</a></li>
<li><a href="logout.html">Logout</a></li>
</ul>
</div>
</li>
</ul>
</div>
</div>
</div>
<!--
* 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.
-->
<div>
<button class="add-tag btn btn-success pull-right" data-id="addTag" style="margin-bottom:10px">Add Tag</button>
</div>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Tag</th>
<th>Attribute</th>
<th>Tools</th>
</tr>
</thead>
<tbody data-id="detailValue">
</tbody>
</table>
<div class="noTags" style="display:none">
No tags to display
</div>
<!--
* 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.
-->
<div class="tagsList">
<div class="atlast-tabbable">
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="tab active"><a href="#tab-tags" role="tab" data-toggle="tab">Tags</a></li>
<li role="presentation" class="tab"><a href="#tab-types" role="tab" data-toggle="tab">Type</a></li>
<div class="pull-right" data-id="referesh"><a href="javascript:void(0)"><i class="fa fa-refresh"></i></a></div>
<div class="indicator" style="right: 116px; left: 0px;"></div>
</ul>
<div class="tab-content">
<div id="tab-tags" role="tabpanel" class="tab-pane active">
<div class="row-margin-bottom">
<input data-id="searchTag" data-type="listTag" placeholder="Search for Tags…" class="form-control">
</div>
<div class="list-group scrollTagList" data-id="listTag"> </div>
</div>
<div id="tab-types" role="tabpanel" class="tab-pane">
<div class="row-margin-bottom ">
<input data-id="searchTag" data-type="listType" placeholder="Search for Types…" class="form-control">
</div>
<div class="list-group scrollTagList" data-id="listType"> </div>
</div>
</div>
</div>
</div>
<!--
* 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.
-->
<div class="form-group">
<label class="col-sm-2 control-label">Attribute name</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="name" id="attributeId" placeholder="Attribute name" required="">
<button class="remove" id="close"><i class="fa fa-times"></i></button>
</div>
</div>
<!--
* 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.
-->
<div class="modalHeight">
<form name="tagDefinitionform" class="css-form">
<div class="form-group">
<label class="control-label col-sm-4">Tag definition</label>
<div class="col-sm-8 input-spacing">
<select class="form-control" data-id="addTagOptions" id="addTagID" required>
</select>
</div>
</div>
</form>
</div>
<div class="form-group modalHeight" data-id="tagAttribute" style="display:none">
</div>
<!--
* 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.
-->
<div class="row">
<div class="appForm col-lg-12">
<div class="panel panel-default">
<div class="panel-heading">
<h4>Tag Definition</h4></div>
<div class="panel-body inputs">
<form data-name="tagForm" class="form-horizontal" novalidate="" role="form">
<fieldset>
<div class="form-group hide">
<label for="category" class="col-sm-2 control-label">Category</label>
<div class="col-sm-10">
<select class="form-control" data-id="category" name="category" required="">
</select>
</div>
</div>
<div class="form-group">
<label for="typeName" class="col-sm-2 control-label">Tag Name</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="typeName" data-id="typeName" placeholder="Tag Name" required="">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">Parent Tag</label>
<div class="col-sm-5 mrt-8">
<select class="form-control h160" data-id="parentTag" name="ParentTag" multiple>
</select>
</div>
<div class="mtop3">
<a href="javascript:void(0)" class="pull-left fa fa-refresh" title="Refreh parent tag list" data-id="refreshBtn">
</a>
</div>
</div>
<div data-id="addAttributeDiv"></div>
<div class="form-group text-right">
<div class="col-sm-offset-2 col-sm-10">
<button type="default" class="btn btn-default addAttr" disabled="true" data-id="addAttrBtn"><i class="fa fa-plus"></i> Add Attribute</button>
</div>
</div>
<div class="form-group panel-footer">
<div class="col-sm-12 text-right padding0">
<button class="btn btn-primary saveAttr" type="button" disabled="true" data-id="saveButton">Save</button>
</div>
</div>
</fieldset>
</form>
</div>
</div>
</div>
</div>
/**
* 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.
*/
define(['require'], function(require) {
'use strict';
var Globals = {};
Globals.baseURL = '';
Globals.settings = {};
Globals.settings.PAGE_SIZE = 25;
Globals.saveApplicationState = {
mainPageState: {},
detailPageState: {}
};
return Globals;
});
/**
* 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.
*/
define(['require', 'backgrid'], function(require) {
'use strict';
/*
* HtmlCell renders any html code
* @class Backgrid.HtmlCell
* @extends Backgrid.Cell
*/
var HtmlCell = Backgrid.HtmlCell = Backgrid.Cell.extend({
/** @property */
className: "html-cell",
render: function() {
this.$el.empty();
var rawValue = this.model.get(this.column.get("name"));
var formattedValue = this.formatter.fromRaw(rawValue, this.model);
this.$el.append(formattedValue);
this.delegateEvents();
return this;
}
});
var UriCell = Backgrid.UriCell = Backgrid.Cell.extend({
className: "uri-cell",
title: null,
target: "_blank",
initialize: function(options) {
UriCell.__super__.initialize.apply(this, arguments);
this.title = options.title || this.title;
this.target = options.target || this.target;
},
render: function() {
this.$el.empty();
var rawValue = this.model.get(this.column.get("name"));
var href = _.isFunction(this.column.get("href")) ? this.column.get('href')(this.model) : this.column.get('href');
var klass = this.column.get("klass");
var formattedValue = this.formatter.fromRaw(rawValue, this.model);
this.$el.append($("<a>", {
tabIndex: -1,
href: href,
title: this.title || formattedValue,
'class': klass
}).text(formattedValue));
if (this.column.has("iconKlass")) {
var iconKlass = this.column.get("iconKlass");
var iconTitle = this.column.get("iconTitle");
this.$el.find('a').append('<i class="' + iconKlass + '" title="' + iconTitle + '"></i>');
}
this.delegateEvents();
return this;
}
});
});
/**
* 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.
*/
define(['require', 'utils/Globals'], function(require, Globals) {
'use strict';
var Utils = {};
require(['noty'], function() {
$.extend($.noty.defaults, {
timeout: 5000,
layout: "topRight",
theme: "relax",
closeWith: ['click', 'button'],
animation: {
open: 'animated flipInX',
close: 'animated flipOutX',
easing: 'swing',
speed: 500
}
});
});
Utils.generateUUID = function() {
var d = new Date().getTime();
if (window.performance && typeof window.performance.now === "function") {
d += performance.now(); //use high-precision timer if available
}
var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
var r = (d + Math.random() * 16) % 16 | 0;
d = Math.floor(d / 16);
return (c == 'x' ? r : (r & 0x3 | 0x8)).toString(16);
});
return uuid;
};
Utils.notifyInfo = function(options) {
noty({
type: "information",
text: "<i class='fa fa-exclamation-circle'></i> " + (options.content || "Info message.")
});
};
Utils.notifyWarn = function(options) {
noty({
type: "warning",
text: "<i class='fa fa-times-circle'></i> " + (options.content || "Info message.")
});
};
Utils.notifyError = function(options) {
noty({
type: "error",
text: "<i class='fa fa-times-circle'></i> " + (options.content || "Error occurred.")
});
};
Utils.notifySuccess = function(options) {
noty({
type: "success",
text: "<i class='fa fa-check-circle-o'></i> " + (options.content || "Error occurred.")
});
};
Utils.defaultErrorHandler = function(model, error) {
/*
require(['views/common/ErrorView', 'App'], function(vError, App) {
if (error.status == 404) {
App.rContent.show(new vError({
status: error.status
}));
} else if (error.status == 401) {
App.rContent.show(new vError({
status: error.status
}));
} else if (error.status == 419) {
window.location = 'login.jsp'
} else if (error.status == "0") {
var diffTime = (new Date().getTime() - prevNetworkErrorTime);
if (diffTime > 3000) {
prevNetworkErrorTime = new Date().getTime();
Utils.notifyError({
content: "Network Connection Failure : " +
"It seems you are not connected to the internet. Please check your internet connection and try again"
})
}
}
});
*/
};
Utils.localStorage = {
checkLocalStorage: function(key, value) {
if (typeof(Storage) !== "undefined") {
return this.getLocalStorage(key, value);
} else {
console.log('Sorry! No Web Storage support');
Utils.cookie.checkCookie(key, value);
}
},
setLocalStorage: function(key, value) {
localStorage.setItem(key, value);
return { found: false, 'value': value };
},
getLocalStorage: function(key, value) {
var keyValue = localStorage.getItem(key)
if (!keyValue || keyValue == "undefined") {
return this.setLocalStorage(key, value);
} else {
return { found: true, 'value': keyValue };
}
}
}
Utils.cookie = {
setCookie: function(cname, cvalue) {
//var d = new Date();
//d.setTime(d.getTime() + (exdays*24*60*60*1000));
//var expires = "expires=" + d.toGMTString();
document.cookie = cname + "=" + cvalue + "; "
return { found: false, 'value': cvalue };
},
getCookie: function(findString) {
var search = findString + "=";
var ca = document.cookie.split(';');
for (var i = 0; i < ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == ' ') c = c.substring(1);
if (c.indexOf(name) == 0) {
return c.substring(name.length, c.length);
}
}
return "";
},
checkCookie: function(key, value) {
var findString = getCookie(key);
if (findString != "" || keyValue != "undefined") {
return { found: true, 'value': ((findString == "undefined") ? (undefined) : (findString)) };
} else {
return setCookie(key, value);
}
}
}
Utils.getQueryParams = function(qs) {
qs = qs.split('+').join(' ');
var params = {},
tokens,
re = /[?&]?([^=]+)=([^&]*)/g;
while (tokens = re.exec(qs)) {
params[decodeURIComponent(tokens[1])] = decodeURIComponent(tokens[2]);
}
return params;
}
Utils.setUrl = function(options) {
if (options) {
if (options.mergeBrowserUrl) {
var hashUrl = window.location.hash.split("?");
if (hashUrl.length > 1) {
var param = Utils.getQueryParams(hashUrl[1]);
options.urlParams = _.extend(param, options.urlParams)
}
}
if (options.urlParams) {
var urlParams = "?"
_.each(options.urlParams, function(value, key, obj) {
urlParams += key + "=" + value + "&";
});
urlParams = urlParams.slice(0, -1);
options.url += urlParams;
}
Backbone.history.navigate(options.url, { trigger: options.trigger != undefined ? options.trigger : true });
}
}
return Utils;
});
\ No newline at end of file
/**
* 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.
*/
define(['require',
'backbone',
'underscore',
'utils/Utils',
'utils/Globals',
'backgrid-filter',
'backgrid-paginator',
'select2',
], function(require, Backbone, _, Utils) {
'use strict';
var HeaderSearchCell = Backbone.View.extend({
tagName: 'td',
className: 'backgrid-filter',
template: _.template('<input type="search" <% if (placeholder) { %> placeholder="<%- placeholder %>" <% } %> name="<%- name %>" <% if (style) { %> style="<%- style %>" <% } %> />'),
//<a class='clear' href='#'>&times;</a>'),
placeholder: '',
events: {
'keyup input': 'evKeyUp',
'submit': 'search'
},
initialize: function(options) {
_.extend(this, _.pick(options, 'column'));
this.name = this.column.get('name');
if (this.column.get('reName') !== undefined)
this.name = this.column.get('reName');
var collection = this.collection,
self = this;
if (Backbone.PageableCollection && collection instanceof Backbone.PageableCollection) {
collection.queryParams[this.name] = function() {
return self.searchBox().val() || null;
};
}
},
render: function() {
this.$el.empty().append(this.template({
name: this.column.get('name'),
placeholder: this.column.get('placeholder') || 'Search',
style: this.column.get('headerSearchStyle')
}));
this.$el.addClass('renderable');
this.delegateEvents();
return this;
},
evKeyUp: function(e) {
var $clearButton = this.clearButton();
var searchTerms = this.searchBox().val();
if (!e.shiftKey) {
this.search();
}
if (searchTerms) {
$clearButton.show();
} else {
$clearButton.hide();
}
},
searchBox: function() {
return this.$el.find('input[type=search]');
},
clearButton: function() {
return this.$el.find('.clear');
},
search: function() {
var data = {};
// go back to the first page on search
var collection = this.collection;
if (Backbone.PageableCollection &&
collection instanceof Backbone.PageableCollection &&
collection.mode === 'server') {
collection.state.currentPage = collection.state.firstPage;
}
var query = this.searchBox().val();
if (query) data[this.name] = query;
if (collection.extraSearchParams) {
_.extend(data, collection.extraSearchParams);
}
if (collection.mode === 'server') {
collection.fetch({
data: data,
reset: true,
success: function() {},
error: function(msResponse) {
Utils.notifyError('Error', 'Invalid input data!');
}
});
} else if (collection.mode === 'client') {
}
},
clear: function(e) {
if (e) e.preventDefault();
this.searchBox().val(null);
this.collection.fetch({
reset: true
});
}
});
var HeaderFilterCell = Backbone.View.extend({
tagName: 'td',
className: 'backgrid-filter',
template: _.template('<select > <option>ALL</option>' +
'<% _.each(list, function(data) {' +
'if(_.isObject(data)){ %>' +
'<option value="<%= data.value %>"><%= data.label %></option>' +
'<% }else{ %>' +
'<option value="<%= data %>"><%= data %></option>' +
'<% } %>' +
'<% }); %></select>'),
placeholder: '',
events: {
'click': function() {},
},
initialize: function(options) {
_.extend(this, _.pick(options, 'column'));
this.name = this.column.get('name');
this.headerFilterOptions = this.column.get('headerFilterOptions');
},
render: function() {
var that = this;
this.$el.empty().append(this.template({
name: this.column.get('name'),
list: this.headerFilterOptions.filterList,
}));
this.$el.find('select').select2({
allowClear: true,
closeOnSelect: false,
width: this.headerFilterOptions.filterWidth || '100%',
height: this.headerFilterOptions.filterHeight || '20px',
});
this.$el.addClass('renderable');
this.$el.find('select').on('click', function(e) {
that.search(e.currentTarget.value);
});
return this;
},
search: function(selectedOptionValue) {
var data = {},
query;
// go back to the first page on search
var collection = this.collection;
if (Backbone.PageableCollection &&
collection instanceof Backbone.PageableCollection &&
collection.mode === 'server') {
collection.state.currentPage = collection.state.firstPage;
}
if (selectedOptionValue !== 'ALL') {
query = selectedOptionValue;
}
if (query) {
data[this.name] = query;
}
if (collection.extraSearchParams) {
_.extend(data, collection.extraSearchParams);
}
collection.fetch({
data: data,
reset: true
});
},
/*clear: function (e) {
if (e) e.preventDefault();
this.searchBox().val(null);
this.collection.fetch({reset: true});
}*/
});
var HeaderRow = Backgrid.Row.extend({
requiredOptions: ['columns', 'collection'],
initialize: function() {
Backgrid.Row.prototype.initialize.apply(this, arguments);
},
makeCell: function(column, options) {
var headerCell;
switch (true) {
case (column.has('canHeaderSearch') && column.get('canHeaderSearch') === true):
headerCell = new HeaderSearchCell({
column: column,
collection: this.collection,
});
break;
case (column.has('canHeaderFilter') && column.get('canHeaderFilter') === true):
headerCell = new HeaderFilterCell({
column: column,
collection: this.collection,
});
break;
default:
headerCell = new Backbone.View({
tagName: 'td'
});
}
return headerCell;
}
});
var Header = Backgrid.Header.extend({
initialize: function(options) {
var args = Array.prototype.slice.apply(arguments);
Backgrid.Header.prototype.initialize.apply(this, args);
this.searchRow = new HeaderRow({
columns: this.columns,
collection: this.collection
});
},
/**
Renders this table head with a single row of header cells.
*/
render: function() {
var args = Array.prototype.slice.apply(arguments);
Backgrid.Header.prototype.render.apply(this, args);
this.$el.append(this.searchRow.render().$el);
return this;
},
remove: function() {
var args = Array.prototype.slice.apply(arguments);
Backgrid.Header.prototype.remove.apply(this, args);
this.searchRow.remove.apply(this.searchRow, arguments);
return Backbone.View.prototype.remove.apply(this, arguments);
}
});
return Header;
});
/**
* 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.
*/
define(['require',
'backbone',
'hbs!tmpl/detail_page/DetailPageLayoutView_tmpl'
], function(require, Backbone, DetailPageLayoutViewTmpl) {
'use strict';
var DetailPageLayoutView = Backbone.Marionette.LayoutView.extend(
/** @lends DetailPageLayoutView */
{
_viewName: 'DetailPageLayoutView',
template: DetailPageLayoutViewTmpl,
/** Layout sub regions */
regions: {
REntityDetailTableLayoutView: "#r_entityDetailTableLayoutView",
RSchemaTableLayoutView: "#r_schemaTableLayoutView",
RTagTableLayoutView: "#r_tagTableLayoutView",
RLineageLayoutView: "#r_lineageLayoutView",
},
/** ui selector cache */
ui: {},
/** ui events hash */
events: function() {
var events = {};
return events;
},
/**
* intialize a new DetailPageLayoutView Layout
* @constructs
*/
initialize: function(options) {
_.extend(this, _.pick(options, 'globalVent', 'collection', 'vent'));
this.bindEvents();
this.commonTableOptions = {
collection: this.collection,
includeFilter: false,
includePagination: false,
includePageSize: false,
includeFooterRecords: true,
gridOpts: {
className: "table table-striped table-condensed backgrid table-quickMenu",
emptyText: 'No records found!'
},
filterOpts: {},
paginatorOpts: {}
};
},
bindEvents: function() {
this.listenTo(this.collection, 'reset', function() {
var collectionJSON = this.collection.toJSON();
if (collectionJSON[0].id && collectionJSON[0].id.id) {
var tagGuid = collectionJSON[0].id.id;
}
if (collectionJSON && collectionJSON.length) {
if (collectionJSON[0].values) {
this.name = collectionJSON[0].values.name;
this.description = collectionJSON[0].values.description;
if (this.name) {
this.$('.breadcrumbName').text(this.name);
this.$('.name').show();
this.$('.name').html('<strong>Name: </strong><span>' + this.name + '</span>');
} else {
this.$('.name').hide();
}
if (this.description) {
this.$('.description').show();
this.$('.description').html('<strong>Description: </strong><span>' + this.description + '</span>');
} else {
this.$('.description').hide();
}
}
}
this.renderEntityDetailTableLayoutView();
this.renderTagTableLayoutView(tagGuid);
this.renderLineageLayoutView(tagGuid);
this.renderSchemaLayoutView();
}, this);
},
onRender: function() {},
renderEntityDetailTableLayoutView: function() {
var that = this;
require(['views/entity/EntityDetailTableLayoutView'], function(EntityDetailTableLayoutView) {
that.REntityDetailTableLayoutView.show(new EntityDetailTableLayoutView({
globalVent: that.globalVent,
collection: that.collection
}));
});
},
renderTagTableLayoutView: function(tagGuid) {
var that = this;
require(['views/tag/TagDetailTableLayoutView'], function(TagDetailTableLayoutView) {
that.RTagTableLayoutView.show(new TagDetailTableLayoutView({
globalVent: that.globalVent,
collection: that.collection,
guid: tagGuid
}));
});
},
renderLineageLayoutView: function(tagGuid) {
var that = this;
require(['views/graph/LineageLayoutView'], function(LineageLayoutView) {
that.RLineageLayoutView.show(new LineageLayoutView({
globalVent: that.globalVent,
assetName: that.name,
guid: tagGuid
}));
});
},
renderSchemaLayoutView: function() {
var that = this;
require(['views/schema/SchemaLayoutView'], function(SchemaLayoutView) {
that.RSchemaTableLayoutView.show(new SchemaLayoutView({
globalVent: that.globalVent,
name: that.name,
vent: that.vent
}));
});
},
getTagTableColumns: function() {
var that = this;
return this.collection.constructor.getTableCols({
tag: {
label: "Tag",
cell: "html",
editable: false,
sortable: false,
formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
fromRaw: function(rawValue, model) {
var modelObject = model.toJSON();
if (modelObject.$typeName$ && modelObject.instanceInfo) {
return '<a href="#!/dashboard/detailPage/' + modelObject.instanceInfo.guid + '">' + modelObject.instanceInfo.typeName + '</a>';
} else if (!modelObject.$typeName$) {
return '<a href="#!/dashboard/detailPage/' + modelObject.guid + '">' + modelObject.typeName + '</a>';
}
}
})
},
attributes: {
label: "Attributes",
cell: "html",
editable: false,
sortable: false,
formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
fromRaw: function(rawValue, model) {
var modelObject = model.toJSON();
if (modelObject.$typeName$ && modelObject.instanceInfo) {
var guid = model.toJSON().instanceInfo.guid;
model.getEntity(guid, {
beforeSend: function() {},
success: function(data) {
return that.$('td a[data-id="' + guid + '"]').html(data.definition.values.name);
},
error: function(error, data, status) {},
complete: function() {}
});
return '<a href="#!/dashboard/detailPage/' + guid + '" data-id="' + guid + '"></a>';
} else if (!modelObject.$typeName$) {
var guid = model.toJSON().guid;
model.getEntity(guid, {
beforeSend: function() {},
success: function(data) {
return that.$('td a[data-id="' + guid + '"]').html(data.definition.values.name);
},
error: function(error, data, status) {},
complete: function() {}
});
return '<a href="#!/dashboard/detailPage/' + guid + '" data-id="' + guid + '"></a>';
}
}
})
}
}, this.collection);
}
});
return DetailPageLayoutView;
});
/**
* 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.
*/
define(['require',
'backbone',
'hbs!tmpl/entity/EntityDetailTableLayoutView_tmpl',
], function(require, Backbone, EntityDetailTableLayoutView_tmpl) {
'use strict';
var EntityDetailTableLayoutView = Backbone.Marionette.LayoutView.extend(
/** @lends EntityDetailTableLayoutView */
{
_viewName: 'EntityDetailTableLayoutView',
template: EntityDetailTableLayoutView_tmpl,
/** Layout sub regions */
regions: {},
/** ui selector cache */
ui: {
detailValue: "[data-id='detailValue']",
},
/** ui events hash */
events: function() {
var events = {};
return events;
},
/**
* intialize a new EntityDetailTableLayoutView Layout
* @constructs
*/
initialize: function(options) {
_.extend(this, _.pick(options, 'globalVent', 'collection'));
this.collectionObject = this.collection.toJSON();
this.entityModel = new this.collection.model();
},
bindEvents: function() {},
onRender: function() {
this.entityTableGenerate();
},
entityTableGenerate: function() {
var that = this,
table = "",
valueObject = this.collectionObject[0].values;
_.keys(valueObject).map(function(key) {
/* if (key == 'columns')
return;*/
var keyValue = valueObject[key];
if (_.isArray(keyValue)) {
var subLink = "";
for (var i = 0; i < keyValue.length; i++) {
var inputOutputField = keyValue[i];
if (_.isObject(inputOutputField.id)) {
id = inputOutputField.id.id;
} else {
id = inputOutputField.id;
}
that.fetchInputOutputValue(id);
//var coma = (i = 0) ? ('') : (',');
subLink += '<div data-id="' + id + '"></div>';
}
table += '<tr><td>' + key + '</td><td>' + subLink + '</td></tr>';
} else if (_.isObject(keyValue)) {
var id = "";
if (_.isObject(keyValue.id)) {
id = keyValue.id.id;
} else {
id = keyValue.id;
}
that.fetchInputOutputValue(id);
table += '<tr><td>' + key + '</td><td><div data-id="' + id + '"></div></td></tr>';
} else {
if (key == "createTime" || key == "lastAccessTime" || key == "retention") {
table += '<tr><td>' + key + '</td><td>' + new Date(valueObject[key]) + '</td></tr>';
} else {
table += '<tr><td>' + key + '</td><td>' + valueObject[key] + '</td></tr>';
}
}
});
that.ui.detailValue.append(table);
},
fetchInputOutputValue: function(id) {
var that = this;
this.entityModel.getEntity(id, {
beforeSend: function() {},
success: function(data) {
var value = "";
if (data.definition.values.name) {
value = data.definition.values.name;
} else {
value = data.GUID;
}
that.$('td div[data-id="' + data.GUID + '"]').html('<a href="#!/dashboard/detailPage/' + data.GUID + '">' + value + '</a>');
},
error: function(error, data, status) {},
complete: function() {}
});
}
});
return EntityDetailTableLayoutView;
});
/**
* 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.
*/
define(['require',
'backbone',
'hbs!tmpl/schema/SchemaTableLayoutView_tmpl',
'collection/VSchemaList',
'utils/Utils',
], function(require, Backbone, SchemaTableLayoutViewTmpl, VSchemaList, Utils) {
'use strict';
var SchemaTableLayoutView = Backbone.Marionette.LayoutView.extend(
/** @lends SchemaTableLayoutView */
{
_viewName: 'SchemaTableLayoutView',
template: SchemaTableLayoutViewTmpl,
/** Layout sub regions */
regions: {
RTagLayoutView: "#r_tagLayoutView",
},
/** ui selector cache */
ui: {
tagClick: '[data-id="tagClick"]',
DetailValue: "[data-id='detailValue']",
addTag: "[data-id='addTag']",
},
/** ui events hash */
events: function() {
var events = {};
events["click " + this.ui.addTag] = function(e) {
this.onClickSchemaTag(e);
},
events["click " + this.ui.tagClick] = function(e) {
if (e.target.nodeName.toLocaleLowerCase() == "i") {
this.onClickTagCross(e);
} else {
var value = e.currentTarget.text;
Utils.setUrl({
url: '#!/dashboard/assetPage',
urlParams: {
query: value
},
mergeBrowserUrl: false,
trigger: true
});
}
};
return events;
},
/**
* intialize a new SchemaTableLayoutView Layout
* @constructs
*/
initialize: function(options) {
_.extend(this, _.pick(options, 'globalVent', 'name', 'vent'));
this.schemaCollection = new VSchemaList([], {});
this.schemaCollection.url = "/api/atlas/lineage/hive/table/" + this.name + "/schema";
this.commonTableOptions = {
collection: this.schemaCollection,
includeFilter: false,
includePagination: false,
includePageSize: false,
includeFooterRecords: true,
gridOpts: {
className: "table table-striped table-condensed backgrid table-quickMenu",
emptyText: 'No records found!'
},
filterOpts: {},
paginatorOpts: {}
};
this.bindEvents();
},
bindEvents: function() {
this.listenTo(this.schemaCollection, "reset", function(value) {
this.renderTableLayoutView();
$('.schemaTable').show();
}, this);
this.listenTo(this.schemaCollection, "error", function(value) {
$('.schemaTable').hide();
}, this);
},
onRender: function() {
this.schemaCollection.fetch({ reset: true });
this.renderTableLayoutView();
},
renderTableLayoutView: function() {
var that = this;
require(['utils/TableLayout'], function(TableLayout) {
var cols = new Backgrid.Columns(that.getSchemaTableColumns());
that.RTagLayoutView.show(new TableLayout(_.extend({}, that.commonTableOptions, {
globalVent: that.globalVent,
columns: cols,
gridOpts: {
className: "table table-bordered table-hover table-condensed backgrid table-quickMenu",
},
})));
});
},
getSchemaTableColumns: function() {
var that = this;
return this.schemaCollection.constructor.getTableCols({
name: {
label: "Name",
cell: "Html",
editable: false,
sortable: false,
formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
fromRaw: function(rawValue, model) {
return '<div><a href="#!/dashboard/detailPage/' + model.get('$id$').id + '">' + rawValue + '</a></div>';
}
})
},
comment: {
label: "Comment",
cell: "html",
editable: false,
sortable: false
},
dataType: {
label: "DataType",
cell: "html",
editable: false,
sortable: false
},
tag: {
label: "Tags",
cell: "Html",
editable: false,
sortable: false,
formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
fromRaw: function(rawValue, model) {
var traits = model.get('$traits$');
var atags = "";
_.keys(model.get('$traits$')).map(function(key) {
atags += '<a data-id="tagClick">' + traits[key].$typeName$ + '<i class="fa fa-times" data-id="delete" data-name="' + traits[key].$typeName$ + '" data-guid="' + model.get('$id$').id + '" ></i></a>';
});
return '<div class="tagList">' + atags + '</div>';
}
})
},
addTag: {
label: "Tools",
cell: "Html",
editable: false,
sortable: false,
formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
fromRaw: function(rawValue, model) {
return '<a href="javascript:void(0);" data-id="addTag" data-guid="' + model.get('$id$').id + '"><i class="fa fa-tag"></i></a>';
}
})
}
}, this.schemaCollection);
},
onClickSchemaTag: function(e) {
var that = this;
require(['views/tag/addTagModalView'], function(addTagModalView) {
var view = new addTagModalView({
vent: that.vent,
guid: that.$(e.currentTarget).data("guid"),
modalCollection: that.schemaCollection
});
// view.saveTagData = function() {
//override saveTagData function
// }
});
},
onClickTagCross: function(e) {
var tagName = $(e.target).data("name");
var that = this;
require([
'modules/Modal'
], function(Modal) {
var modal = new Modal({
title: 'Are you sure you want to delete ?',
okText: 'Delete',
htmlContent: "<b>Tag: " + tagName + "</b>",
cancelText: "Cancel",
allowCancel: true,
okCloses: true,
showFooter: true,
}).open();
modal.on('ok', function() {
that.deleteTagData(e);
});
modal.on('closeModal', function() {
modal.trigger('cancel');
});
});
},
deleteTagData: function(e) {
var that = this,
tagName = $(e.target).data("name");
var guid = $(e.target).data("guid");
require(['models/VTag'], function(VTag) {
var tagModel = new VTag();
tagModel.deleteTag(guid, tagName, {
beforeSend: function() {},
success: function(data) {
that.schemaCollection.fetch({ reset: true });
},
error: function(error, data, status) {},
complete: function() {}
});
});
}
});
return SchemaTableLayoutView;
});
/**
* 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.
*/
define(['require',
'backbone',
'hbs!tmpl/search/SearchLayoutView_tmpl',
'utils/Utils',
], function(require, Backbone, SearchLayoutViewTmpl, Utils) {
'use strict';
var SearchLayoutView = Backbone.Marionette.LayoutView.extend(
/** @lends SearchLayoutView */
{
_viewName: 'SearchLayoutView',
template: SearchLayoutViewTmpl,
/** Layout sub regions */
regions: {},
/** ui selector cache */
ui: {
searchButton: '[data-id="searchButton"]',
searchInput: '[data-id="searchInput"]',
searchType: 'input[name="queryType"]'
},
/** ui events hash */
events: function() {
var events = {},
that = this;
events["click " + this.ui.searchButton] = 'onSearchButtonClick';
events["keyup " + this.ui.searchInput] = function(e) {
var code = e.which;
if (code == 13) {
Utils.setUrl({
url: '#!/dashboard/assetPage',
urlParams: {
query: this.ui.searchInput.val(),
searchType: this.type
},
mergeBrowserUrl: false,
trigger: false
});
that.onSearchButtonClick(e.currentTarget.value);
}
};
events["change " + this.ui.searchType] = function(e) {
this.type = e.currentTarget.value;
if (this.ui.searchInput.val() !== "") {
this.onSearchButtonClick();
}
this.ui.searchInput.attr("placeholder", this.type == "dsl" ? 'Search using a DSL query: e.g. DataSet where name="sales_fact "' : 'Search using a query string: e.g. sales_fact');
Utils.setUrl({
url: '#!/dashboard/assetPage',
urlParams: {
query: this.ui.searchInput.val(),
searchType: this.type
},
mergeBrowserUrl: false,
trigger: false
});
};
return events;
},
/**
* intialize a new SearchLayoutView Layout
* @constructs
*/
initialize: function(options) {
_.extend(this, _.pick(options, 'globalVent', 'vent'));
this.bindEvents();
this.type = "fulltext";
},
bindEvents: function() {
this.listenTo(this.vent, "tag:click", function(tagvalues) {
if (tagvalues.searchType) {
this.type = tagvalues.searchType;
this.$('input[name="queryType"][value=' + this.type + ']').prop('checked', true);
}
if (tagvalues.query) {
this.ui.searchInput.val(tagvalues.query);
this.triggerSearch(tagvalues.query);
}
}, this);
},
onRender: function() {},
onSearchButtonClick: function(e) {
this.triggerSearch(this.ui.searchInput.val());
},
triggerSearch: function(value) {
this.vent.trigger("search:click", { 'query': value, type: this.type });
}
});
return SearchLayoutView;
});
/**
* 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.
*/
define(['require',
'hbs!tmpl/site/header',
], function(require, tmpl) {
'use strict';
var Header = Marionette.LayoutView.extend({
template: tmpl,
templateHelpers: function() {
return {
urlType: this.urlType
};
},
regions: {},
events: {},
initialize: function(options) {
var url = window.location.href.split("/");
this.urlType = url[url.length - 1];
/*if we us only old ui then uncomment this condition*/
if (this.urlType == "") {
this.urlType = "assetPage";
}
},
onRender: function() {},
addTagsFileds: function() {
var that = this;
require(['views/tag/createTagsLayoutView'], function(createTagsLayoutView) {
var view = new createTagsLayoutView({
vent: that.vent
});
});
}
});
return Header;
});
/**
* 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.
*/
define(['require',
'hbs!tmpl/site/footer'
], function(require, tmpl) {
'use strict';
var Footer = Marionette.LayoutView.extend({
template: tmpl,
templateHelpers: function() {},
regions: {},
events: {},
initialize: function(options) {},
onRender: function() {}
});
return Footer;
});
/**
* 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.
*/
define(['require',
'backbone',
'hbs!tmpl/tag/TagDetailTableLayoutView_tmpl'
], function(require, Backbone, TagDetailTableLayoutView_tmpl) {
'use strict';
var TagDetailTableLayoutView = Backbone.Marionette.LayoutView.extend(
/** @lends TagDetailTableLayoutView */
{
_viewName: 'TagDetailTableLayoutView',
template: TagDetailTableLayoutView_tmpl,
/** Layout sub regions */
regions: {},
/** ui selector cache */
ui: {
detailValue: "[data-id='detailValue']",
addTag: "[data-id='addTag']",
deleteTag: "[data-id='delete']",
},
/** ui events hash */
events: function() {
var events = {};
events["click " + this.ui.addTag] = function(e) {
this.addModalView(e);
};
events["click " + this.ui.deleteTag] = function(e) {
this.deleteTagDataModal(e);
};
return events;
},
/**
* intialize a new EntityDetailTableLayoutView Layout
* @constructs
*/
initialize: function(options) {
_.extend(this, _.pick(options, 'globalVent', 'collection', 'guid'));
this.collectionObject = this.collection.toJSON();
},
bindEvents: function() {},
onRender: function() {
this.tagTableGenerate();
},
tagTableGenerate: function() {
var that = this,
table = "",
valueObject = this.collectionObject[0].traits;
if (_.isEmpty(valueObject)) {
this.$(".noTags").show();
} else {
this.$(".noTags").hide();
_.keys(valueObject).map(function(key) {
var keyValue = valueObject[key];
var tagValue = 'NA';
if (_.isObject(keyValue)) {
//tagValue = "";
if (!_.isEmpty(keyValue.values)) {
var stringArr = [];
tagValue = "";
_.each(keyValue.values, function(val, key) {
var attrName = "<span>" + key + ":" + val + "</span>";
stringArr.push(attrName);
});
tagValue += stringArr.join(", ");
}
table += '<tr><td>' + keyValue.typeName + '</td><td>' + tagValue + '</td><td>' + '<a href="javascript:void(0)"><i class="fa fa-trash" data-id="delete" data-name="' + keyValue.typeName + '"></i></a></tr>';
} else {}
});
that.ui.detailValue.append(table);
}
},
addModalView: function(e) {
var that = this;
require(['views/tag/addTagModalView'], function(addTagModalView) {
var view = new addTagModalView({
vent: that.vent,
guid: that.guid,
modalCollection: that.collection
});
// view.saveTagData = function() {
//override saveTagData function
// }
});
},
deleteTagDataModal: function(e) {
var tagName = $(e.currentTarget).data("name");
var that = this;
require([
'modules/Modal'
], function(Modal) {
var modal = new Modal({
title: 'Are you sure you want to delete ?',
okText: 'Delete',
htmlContent: "<b>Tag: " + tagName + "</b>",
cancelText: "Cancel",
allowCancel: true,
okCloses: true,
showFooter: true,
}).open();
modal.on('ok', function() {
that.deleteTagData(e);
});
modal.on('closeModal', function() {
modal.trigger('cancel');
});
});
},
deleteTagData: function(e) {
var that = this,
tagName = $(e.currentTarget).data("name");
require(['models/VTag'], function(VTag) {
var tagModel = new VTag();
tagModel.deleteTag(that.guid, tagName, {
beforeSend: function() {},
success: function(data) {
that.collection.fetch({ reset: true });
},
error: function(error, data, status) {},
complete: function() {}
});
});
}
});
return TagDetailTableLayoutView;
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment