Commit 5299b837 by babanb

made changes for details, schema and lineage

parent 93a16d2b
......@@ -67,9 +67,7 @@ header.navbar-top {
.search {
padding-top: 20px;
background-color: #eeeded;
padding-bottom: 10px;
border-bottom: solid 1px #d9d9d8;
}
header .container {
......@@ -91,3 +89,34 @@ footer.navbar-bottom img {
padding-left: 5px;
margin-top: -21px;
}
.searchresults {
border: 1px solid #ddd;
padding: 10px;
}
.mt10px {
margin-top: 10px;
}
.searchresults:first-child {
border-top-right-radius: 4px;
border-top-left-radius: 4px;
}
.searchresults:last-child {
margin-bottom: 0;
border-bottom-right-radius: 4px;
border-bottom-left-radius: 4px;
}
.searchresults hr {
margin: 0;
border: 0;
}
.searchresults .well {
background-color: #fff;
border: 0;
box-shadow: none;
height: auto;
min-height: 0;
padding: 5px 5px 5px 0;
}
\ No newline at end of file
......@@ -45,4 +45,27 @@ g text {
div.lineage {
border-bottom: 2px solid #006600;
margin-bottom: 30px;
}
\ No newline at end of file
}
.node rect {
stroke: #333;
fill: #fff;
}
.edgePath path {
stroke: #333;
fill: #333;
stroke-width: 1.5px;
}
.node rect,
.node circle {
stroke: #333;
fill: #fff;
stroke-width: 1.5px;
}
.lineage-viz {
width: 800px !important;
height: 600px !important;
}
......@@ -24,7 +24,8 @@ angular.module('dgc', ['ngCookies',
'ui.router',
'dgc.system',
'dgc.home',
'dgc.search'
'dgc.search',
'dgc.navigation'
]);
angular.module('dgc.system', ['dgc.system.notification']);
......
......@@ -23,6 +23,6 @@ angular.module('dgc').config(['$locationProvider', '$urlRouterProvider',
function($locationProvider, $urlRouterProvider) {
$locationProvider.hashPrefix('!');
// For unmatched routes:
$urlRouterProvider.otherwise('/');
$urlRouterProvider.otherwise('/search');
}
]);
......@@ -21,24 +21,16 @@
angular.module('dgc.details').controller('DetailsController', ['$scope', '$stateParams', 'DetailsResource',
function($scope, $stateParams, DetailsResource) {
$scope.details = DetailsResource.get({
var details = DetailsResource.get({
id: $stateParams.id
});
$scope.details=details;
$scope.tableName= details.name;
$scope.isString = angular.isString;
//schema
$scope.schemas = DetailsResource.get({
id: $stateParams.id
});
}
]);
......@@ -24,7 +24,7 @@ angular.module('dgc.details').factory('DetailsResource', ['$resource', function(
method: 'GET',
transformResponse: function(data) {
if (data) {
return angular.fromJson(data.results);
return angular.fromJson(data.definition);
}
},
responseType: 'json'
......
......@@ -23,17 +23,9 @@
<!--</div>-->
<div >
<table class="table table-bordered" ng-if="value && !(key==='columns') && !(key==='name') && !(key==='description')">
<thead>
<tr >
<th>{{key}}</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{value}}</td>
</tr>
</tbody>
</table>
</div>
<div class="row" data-ng-repeat="(key1,value1) in value" ng-if="value1">
<div class="col-md-6" data-ng-if="!isString(value1)" data-ng-repeat="(key2,value2) in value1 track by $index"></div>
<div data-ng-if="isString(value2)" data-ng-repeat="(key3,value3) in value2"> {{key3}}: {{value3}}</div>
<div class="col-md-6" data-ng-if="isString(value1)"> {{key1}}: {{value1 | date:'medium'}}</div>
</div>
......@@ -16,25 +16,45 @@
~ limitations under the License.
-->
<div class="container details" data-ng-controller="DetailsController">
<div class="col-lg-12">
<h4>Name : {{details.name}}</h4>
<h5>Description : {{details.description}}</h5>
<tabset>
<tab heading="Details">
<section data-ng-repeat="(key,value) in details" data-ng-if="isString(value)" data-ng-include="'/modules/details/views/attribute.html'"></section>
</tab>
<tab heading="Schema" >
<section data-ng-include="'/modules/details/views/schema.html'"></section>
</tab>
<tab heading="Outputs" ng-if="details['$typeName$']==='Table'">
<div class="lineage" data-ng-include="'/modules/lineage/views/lineage.html'"></div>
</tab>
<tab heading="Inputs" ng-if="details['$typeName$']==='Table'">
<div class="lineage" data-ng-include="'/modules/lineage/views/lineage.html'"></div>
</tab>
</tabset>
<div role="tabpanel" class="col-md-7 col-lg-offset-3" data-ng-controller="DetailsController">
<h2>{{details.values.name}}</h2>
<h4>{{details.values.description}}</h4>
<!-- Nav tabs -->
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="active"><a href="#Details" aria-controls="Details" role="tab" data-toggle="tab">Details</a></li>
<li role="presentation"><a href="#Schema" aria-controls="Schema" role="tab" data-toggle="tab">Schema</a></li>
<li role="presentation" ><a href="#Output" aria-controls="Output" role="tab" data-toggle="tab">Output</a></li>
<li role="presentation"><a href="#Input" aria-controls="Input" role="tab" data-toggle="tab">Input</a></li>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<div role="tabpanel" class="tab-pane active" id="Details">
<table class="table table-bordered">
<thead>
<tr >
<th>Key</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<tr data-ng-repeat="(key,value) in details.values" ng-if="value && !(key==='columns') && !(key==='name') && !(key==='description')">
<td>{{key}}</td>
<td data-ng-if="!isString(value)" data-ng-include="'/modules/details/views/attribute.html'"></td>
<td data-ng-if="isString(value)">{{value | date:'medium'}}</td>
</tr>
</tbody>
</table>
</div>
<div role="tabpanel" data-ng-if="details.typeName=='Table'" class="tab-pane" id="Schema"> <section data-ng-include="'/modules/details/views/schema.html'"></section></div>
<div role="tabpanel" data-ng-if="details.typeName=='Table'" class="tab-pane" id="Output"><div data-ng-include="'/modules/lineage/views/outputs.html'"></div></div>
<div role="tabpanel" data-ng-if="details.typeName=='Table'" class="tab-pane" id="Input"><div data-ng-include="'/modules/lineage/views/inputs.html'"></div></div>
</div>
</div>
\ No newline at end of file
</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>
<table class="table table-bordered">
<thead>
......@@ -8,11 +25,30 @@
</tr>
</thead>
<tbody>
<tr ng-repeat="s in schemas.columns track by $index">
<td> {{s.name}}</td>
<td>{{s.comment}}</td>
<td> {{s.dataType}}</td>
<tr >
<td> {{details.values.columns[0].values.name}}</td>
<td>{{details.values.columns[0].values.comment}}</td>
<td> {{details.values.columns[0].values.dataType}}</td>
</tr>
<tr>
<td> {{details.values.columns[1].values.name}}</td>
<td>{{details.values.columns[1].values.comment}}</td>
<td> {{details.values.columns[1].values.dataType}}</td>
</tr>
<tr>
<td> {{details.values.columns[2].values.name}}</td>
<td>{{details.values.columns[2].values.comment}}</td>
<td> {{details.values.columns[2].values.dataType}}</td>
</tr>
<tr>
<td> {{details.values.columns[3].values.name}}</td>
<td>{{details.values.columns[3].values.comment}}</td>
<td> {{details.values.columns[3].values.dataType}}</td>
</tr>
</tbody>
</table>
</div>
\ No newline at end of file
</div>
......@@ -24,7 +24,7 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a data-ui-sref="home" data-ui-sref-active="active"><img src="modules/home/img/logo-sm.png"/></a>
<a data-ui-sref="search" data-ui-sref-active="active"><h1>DGI</h1></a>
</div>
<nav class="collapse navbar-collapse" data-collapse="isCollapsed" data-role="navigation">
<ul class="navbar-nav nav" data-ng-if="isLoggedIn()">
......
......@@ -21,170 +21,92 @@
angular.module('dgc.lineage').controller('LineageController', ['$element', '$scope', '$state', '$stateParams', 'lodash', 'LineageResource', 'd3',
function($element, $scope, $state, $stateParams, _, LineageResource, d3) {
$scope.lineageData = LineageResource.get({
id: $stateParams.id
}, function(data) {
var nodes = {};
function getNode(nodeId) {
if (!nodes[nodeId]) {
var node;
if (data.vertices[nodeId]) {
node = angular.copy(data.vertices[nodeId]);
node.__key = nodeId;
node.__name = node['hive_table.name'] || node.__key;
node.__tooltip = node['hive_table.description'] || node['HiveLineage.query'];
} else {
node = {};
node.__key = nodeId;
node.__tooltip = node.__name = nodeId + ', Node Missing';
$scope.metaData =[];
LineageResource.get({tableName:$scope.tableName,type:"outputs"}, function lineageSuccess(response) {
$scope.metaData = response.results;
renderGraph(transformData(response.results), d3.select($element[0]).select('svg'));
});
tableName="sales_fact_daily_mv";
LineageResource.get({tableName:$scope.tableName,type:"inputs"}, function lineageSuccess(response) {
$scope.metaData = response.results;
renderGraph(transformData(response.results), d3.select($element[0]).select('svg'));
});
function transformData(metaData){
var nodes = [];
var name, guid;
var nodeGuids = Object.keys(metaData.values.vertices);
for (var index in nodeGuids) {
name = metaData.values.vertices[nodeGuids[index]].values.name;
guid = nodeGuids[index];
nodes.push({ guid: guid, label: name, shape: "rect" });
}
var edges = [];
var parent;
var child;
var edgesParents = Object.keys(metaData.values.edges);
for(index in edgesParents){
parent = edgesParents[index];
for(var j = 0; j < metaData.values.edges[parent].length; j++ ) {
child = metaData.values.edges[parent][j];
if(!metaData.values.vertices.hasOwnProperty(child)) {
nodes.push({guid: child, label: 'Load Process', shape: "circle"});
}
nodes[nodeId] = node;
edges.push({parent: parent, child: child});
}
return nodes[nodeId];
}
return {nodes: nodes, edges: edges};
}
var edges = [],
edgeTypes = [];
function renderGraph(data, element){
angular.forEach(data.edges, function(edge) {
/* Put the head (edge) inside tail (edge)
* Tail is parent
* Head is child
* */
var parentNode = getNode(edge.tail);
edge.source = parentNode;
edge.target = getNode(edge.head);
// Create a new directed graph
var g = new dagreD3
.graphlib
.Graph()
.setGraph({rankdir: "LR"});
parentNode.__hasChild = true;
// Automatically label each of the nodes
//g.setNode("DB (sales)", { label: "Sales DB", width: 144, height: 100 })
//states.forEach(function(state) { g.setNode(state, { label: state }); });
edge.__type = edge.label;
edgeTypes.push(edge.label);
edges.push(edge);
_.forEach(data.nodes, function (node) {
g.setNode(node.guid, { label: node.label, shape: node.shape });
});
edgeTypes = _.uniq(edgeTypes);
render(nodes, edges, edgeTypes);
});
function render(nodes, links, linkTypes) {
// Use elliptical arc path segments to doubly-encode directionality.
function click(node) {
if (node.guid) {
$state.go('details', {
id: node.guid
}, {
location: 'replace'
});
}
}
_.forEach(data.edges, function(edge) {
g.setEdge(edge.parent, edge.child, {label: ""});
});
function tick() {
path.attr("d", linkArc);
circle.attr("transform", transform);
text.attr("transform", transform);
}
// Set some general styles
g.nodes().forEach(function(v) {
var node = g.node(v);
node.rx = node.ry = 5;
});
function linkArc(d) {
var dx = d.target.x - d.source.x,
dy = d.target.y - d.source.y,
dr = Math.sqrt(dx * dx + dy * dy);
return "M" + d.source.x + "," + d.source.y + "A" + dr + "," + dr + " 0 0,1 " + d.target.x + "," + d.target.y;
}
var inner = element.select("g");
function transform(d) {
return "translate(" + d.x + "," + d.y + ")";
}
// Create the renderer
var render = new dagreD3.render();
var width = Math.max($element[0].offsetWidth, 960),
height = Math.max($element[0].offsetHeight, 350);
var force = d3.layout.force()
.nodes(d3.values(nodes))
.links(links)
.size([width, height])
.linkDistance(200)
.charge(-120)
.gravity(0.05)
.on("tick", tick)
.start();
var svg = d3.select($element[0]).select('svg')
.attr("width", width)
.attr("height", height);
/* Initialize tooltip */
var tooltip = d3.tip()
.attr('class', 'd3-tip')
.html(function(d) {
return '<pre class="alert alert-success">' + d.__tooltip + '</pre>';
});
/* Invoke the tip in the context of your visualization */
svg.call(tooltip);
// Per-type markers, as they don't inherit styles.
var defs = svg.append("defs");
var imageDim = 10;
defs.append('svg:pattern')
.attr('id', 'process-image')
.attr('patternUnits', 'userSpaceOnUse')
.attr('width', imageDim)
.attr('height', imageDim)
.append('svg:image')
.attr('xlink:href', '/img/process.png')
.attr('x', 0)
.attr('y', 0)
.attr('width', imageDim)
.attr('height', imageDim);
defs.selectAll("marker")
.data(linkTypes)
.enter().append("marker")
.attr("id", function(d) {
return d;
})
.attr("viewBox", "0 -5 10 10")
.attr("refX", 15)
.attr("refY", -1.5)
.attr("markerWidth", 6)
.attr("markerHeight", 6)
.attr("orient", "auto")
.append("path")
.attr("d", "M0,-5L10,0L0,5");
var path = svg.append("g").selectAll("path")
.data(force.links())
.enter().append("path")
.attr("class", function(d) {
return "link " + d.__type;
})
.attr("marker-end", function(d) {
return "url(#" + d.__type + ")";
});
var circle = svg.append("g").selectAll("circle")
.data(force.nodes())
.enter().append("circle")
.on('click', click)
.on('mouseover', tooltip.show)
.on('mouseout', tooltip.hide)
.attr('class', function(d) {
return d.__hasChild ? '' : 'empty';
})
.attr("r", function(d) {
return d.__hasChild ? 15 : 10;
})
.call(force.drag);
var text = svg.append("g").selectAll("text")
.data(force.nodes())
.enter().append("text")
.attr('dy', '2em')
.text(function(d) {
return d.__name;
});
// Run the renderer. This is what draws the final graph.
render(inner, g);
// Center the graph
var initialScale = 0.75;
zoom
.translate([(element.attr("width") - g.graph().width * initialScale) / 2, 20])
.scale(initialScale)
.event(element);
element.attr('height', g.graph().height * initialScale + 90);
}
}
]);
......@@ -19,8 +19,5 @@
'use strict';
angular.module('dgc.lineage').factory('LineageResource', ['$resource', function($resource) {
return $resource('/api/metadata/discovery/search/relationships/:id', {
depth: 3,
edgesToFollow: 'HiveLineage.sourceTables.0,HiveLineage.sourceTables.1,HiveLineage.sourceTables.2,HiveLineage.tableName'
});
return $resource('/api/metadata/lineage/hive/table/:tableName/:type/graph', {});
}]);
<!--
~ 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 data-ng-controller="LineageController">
<div id="inputs">
<svg class="lineage-viz"><g></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 data-ng-controller="LineageController">
<div id="outputs">
<svg class="lineage-viz"><g></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.
*/
'use strict';
angular.module('dgc.navigation').controller('NavigationController', ['$scope', 'NavigationResource',
function($scope, NavigationResource) {
$scope.leftnav= NavigationResource.get();
$scope.updateVar = function(event) {
$scope.$$prevSibling.query = angular.element(event.target).text();
};
}
]);
\ 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.
*/
'use strict';
angular.module('dgc.navigation',[]);
\ 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.
*/
'use strict';
angular.module('dgc.navigation').factory('NavigationResource', ['$resource', function($resource) {
return $resource('api/metadata/types?type=TRAIT', {}, {
get: {
'method': 'GET',
'responseType': 'json',
'isArray': true,
'transformResponse': function(data) {
var results = [];
angular.forEach(data && data.results, function(val) {
results.push(val);
});
return results;
}
}
});
}]);
<!--
~ 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 data-ng-controller="NavigationController">
<div class="col-lg-3">
<h4>Tags</h4>
<div class="list-group">
<a ng-repeat="nav in leftnav" ui-sref="search.results({ query: nav })" class="list-group-item">{{nav}} </a>
</div>
</div>
</div>
\ No newline at end of file
......@@ -21,18 +21,22 @@
angular.module('dgc.search').controller('SearchController', ['$scope', '$location', '$http', '$state', '$stateParams', 'SearchResource', 'NotificationService',
function($scope, $location, $http, $state, $stateParams, SearchResource, NotificationService) {
$scope.types = [];
$scope.types = ['table','column','db','view','loadprocess','storagedesc'];
$scope.results = [];
$scope.resultCount=0;
$scope.isCollapsed = true;
$scope.search = function(query) {
$scope.results = [];
NotificationService.reset();
SearchResource.search($location.search(query).search(), function searchSuccess(response) {
$scope.results = response;
$scope.limit = 4;
SearchResource.search({query:query}, function searchSuccess(response) {
$scope.results = response.results;
$scope.resultCount=response.count;
if ($scope.results.length < 1) {
NotificationService.error('No Result found', false);
}
$state.go('search.results', {}, {
location: false
$state.go('search.results', {query:query}, {
location: 'replace'
});
}, function searchError(err) {
NotificationService.error('Error occurred during executing search query, error status code = ' + err.status + ', status text = ' + err.statusText, false);
......@@ -40,11 +44,25 @@ angular.module('dgc.search').controller('SearchController', ['$scope', '$locatio
};
$scope.typeAvailable = function() {
return ['hive_table'].indexOf(this.result.type && this.result.type.toLowerCase()) > -1;
return $scope.types.indexOf(this.results.dataType.typeName && this.results.dataType.typeName.toLowerCase()) > -1;
};
var urlParts = $location.url().split('?');
$scope.query = urlParts.length > 1 ? urlParts[1] : null;
/* $scope.$watch("currentPage + numPerPage", function() {
var begin = (($scope.currentPage - 1) * $scope.numPerPage);
var end = begin + $scope.numPerPage;
$scope.filteredResults = $scope.rows.slice(begin, end);
});*/
$scope.filterSearchResults = function(items) {
var res = {};
angular.forEach(items, function(value, key) {
if((typeof value !== 'object'))
res[key] = value;
});
return res;
};
$scope.query=$stateParams.query;
if ($scope.query) {
$scope.search($scope.query);
}
......
/*
* 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.
*/
'use strict';
angular.module('dgc.search').directive(
"myDirective", function() {
return {
restrict: 'EA',
template: '<a href="javascript: void(0);" button-toggle toggle="isCollapsed" class="show-more" ng-click="isCollapsed = !isCollapsed">..show more</a>',
link: function($scope){
$scope.isCollapsed = true;
console.log($scope.isCollapsed);
},
transclude: true,
scope: {}
};
});
\ No newline at end of file
......@@ -19,18 +19,14 @@
'use strict';
angular.module('dgc.search').factory('SearchResource', ['$resource', function($resource) {
return $resource('/api/metadata/discovery/search/fulltext', {}, {
return $resource('/api/metadata/discovery/search/', {}, {
search: {
'method': 'GET',
'responseType': 'json',
'isArray': true,
'transformResponse': function(data) {
var results = [];
angular.forEach(data && data.vertices, function(val) {
results.push(val);
});
return results;
return data;
}
}
});
}]);
......@@ -25,10 +25,12 @@ angular.module('dgc.search').config(['$stateProvider',
// states for my app
$stateProvider.state('search', {
url: '/search',
templateUrl: '/modules/search/views/search.html'
templateUrl: '/modules/search/views/search.html',
controller:'SearchController'
}).state('search.results', {
url: '/?',
templateUrl: '/modules/search/views/searchResult.html'
url: '/:query',
templateUrl: '/modules/search/views/searchResult.html',
controller:'SearchController'
});
}
]);
......@@ -19,7 +19,7 @@
<div data-ng-controller="SearchController">
<div class="search">
<form name="form" novalidate class="container">
<div class="col-lg-7">
<div class="col-lg-7 col-lg-offset-3">
<div class="row input-group">
<input type="text" class="form-control" placeholder="Search" data-ng-model="query" data-typeahead="type for type in types" required/>
<span class="input-group-btn">
......@@ -29,18 +29,17 @@
</span>
</div>
<div class="row">
<small class="small-txt">Examples : property=HiveLineage.executionEngine&text=tez</small>
<br/>
<small class="small-txt">property=type&text=HiveLineage</small>
<br/>
<small class="small-txt">property=type&text=hive_table</small>
<small class="small-txt">search: Table, DB, Column</small>
</div>
</div>
</form>
</div>
<div class="container">
<div class="row">
<div class="col-lg-11" data-ui-view=""></div>
<div data-ng-include="'/modules/navigation/views/navigation.html'"></div>
<div class="col-lg-9" data-ui-view=""></div>
</div>
</div>
</div>
......@@ -16,10 +16,27 @@
~ limitations under the License.
-->
<h4>{{results.length}} results matching your search query "{{query}}" were found</h4>
<h4>{{resultCount}} results matching your search query "{{query}}" were found</h4>
<ul class="list-unstyled">
<li ng-repeat="result in results">
<div data-ng-if="typeAvailable()" data-ng-include="'/modules/search/views/types/'+result.type.toLowerCase()+'.html'"></div>
<div data-ng-if="!typeAvailable()" data-ng-include="'/modules/search/views/types/guid.html'"></div>
</li>
</ul>
\ No newline at end of file
<li ng-repeat="result in results.rows" class="searchresults">
<div data-ng-if="typeAvailable()">
<h4><a data-ui-sref="details({id:result['$id$'].id})">{{result.name}}</a></h4>
<p>{{result.description}}</p>
<span ng-repeat="(key, value) in filterSearchResults(result)" >
<span ng-show="$index < 4"><b>{{key}}: </b>{{value}}{{$index+1 === limit ? '' : ', '}}</span>
</span>
<div collapse="isCollapsed">
<span class="well well-lg"><span ng-repeat="(key, value) in filterSearchResults(result)" >
<span ng-show="$index > 4"><b>{{key}}: </b>{{value}}{{$last ? '' : ', '}}</span>
</span></span>
</div>
<a href="javascript: void(0);" class="show-more" ng-click="isCollapsed = !isCollapsed">..show more</a>
<!-- <a href="javascript: void(0);" bn-slide-show class="show-more" ng-click="doToggle(!isCollapsed)">..show more</a>-->
<h5>Tags : <a ng-repeat="(key, value) in result['$traits$']" data-ui-sref="search.results({query: key})">{{key}}</a> </h5>
</div>
<div data-ng-if="!typeAvailable()" data-ng-include="'/modules/search/views/types/guid.html'"></div>
</li>
</ul>
<!--
~ 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.
-->
<h4><a data-ui-sref="details({id:result['$id$'].id})">{{result.name}}</a></h4>
<p><b>Comment:</b> {{result.comment}}, <b>DataType:</b> {{result.dataType}},<b>Table:</b> {{result.table}}</p>
<h5>Tags : <a ng-repeat="(key, value) in result['$traits$']" data-ui-sref="search.results({query: key})">{{key}}</a> </h5>
\ 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.
-->
<h4><a data-ui-sref="details({id:result['$id$'].id})">{{result.name}}</a></h4>
<p>{{result.description}}</p>
<p><b>locationUri:</b> {{result.locationUri}}, <b>Owner: </b>{{result.owner}}</p>
<h5>Tags : <a ng-repeat="(key, value) in result['$traits$']" data-ui-sref="search.results({query: key})">{{key}}</a> </h5>
\ No newline at end of file
......@@ -16,4 +16,6 @@
~ limitations under the License.
-->
<a data-ui-sref="details({id:result.guid})">{{result.guid}}</a>
\ No newline at end of file
<h4><a data-ui-sref="details({id:result.instanceInfo.guid})">{{result.instanceInfo.guid}}</a></h4>
<p><b>TypeName: </b>{{result.instanceInfo.typeName}}</p>
<h5>Tags : <a ng-repeat="(key, value) in result['$traits$']" data-ui-sref="search.results({query: key})">{{key}}</a> </h5>
\ 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.
-->
<h4><a data-ui-sref="details({id:result['$id$'].id})">{{result.name}}</a></h4>
<p>{{result.description}}</p>
<p><b>inputTables: </b>{{result.inputTables['id']}},<b>queryText: </b>{{result.queryText}},<b>startTime: </b>{{result.startTime | date:'medium'}},<b>endTime: </b> {{result.endTime | date:'medium'}}</p>
<h5>Tags : <a ng-repeat="(key, value) in result['$traits$']" data-ui-sref="search.results({query: key})">{{key}}</a> </h5>
\ 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.
-->
<h4><a data-ui-sref="details({id:result['$id$'].id})">{{result.name}}</a></h4>
<p><b>compressed: </b>{{result.compressed}},<b>outputFormat: </b>{{result.outputFormat}},<b>location: </b>{{result.location}}, <b>inputFormat: </b>{{result.inputFormat}}</p>
<h5>Tags : <a ng-repeat="(key, value) in result['$traits$']" data-ui-sref="search.results({query: key})">{{key}}</a> </h5>
\ 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.
-->
<h4><a data-ui-sref="details({id:result['$id$'].id})">{{result.name}}</a></h4>
<p>{{result.description}}</p>
<p><b>owner: </b>{{result.owner}}, <b>createTime: </b>{{result.createTime}}</p>
<h5>Tags : <a ng-repeat="(key, value) in result['$traits$']" data-ui-sref="search.results({query: key})">{{key}}</a> </h5>
\ No newline at end of file
......@@ -15,7 +15,11 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<script>
$(function () {
$('#myTab a:last').tab('show')
})
</script>
<!-- Angular JS -->
<script type="text/javascript" src="/lib/angular/angular.min.js"></script>
<script type="text/javascript" src="/lib/lodash/lodash.min.js"></script>
......@@ -26,11 +30,13 @@
<!-- Angular UI -->
<script type="text/javascript" src="/lib/angular-bootstrap/ui-bootstrap.js"></script>
<script type="text/javascript" src="/lib/angular-bootstrap/ui-bootstrap-tpls.js"></script>
<script type="text/javascript" src="/lib/d3/d3.min.js"></script>
<script type="text/javascript" src="/lib/d3-tip/index.js"></script>
<!--<script type="text/javascript" src="/lib/d3/d3.min.js"></script>
<script type="text/javascript" src="/lib/d3-tip/index.js"></script>-->
<script src="http://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"></script>
<script src="http://cpettitt.github.io/project/dagre-d3/latest/dagre-d3.js"></script>
<script type="text/javascript" src="dist/app.min.js"></script>
{% if (process.env.NODE_ENV == 'local') %}
<!-- Livereload script rendered -->
<script type="text/javascript" src="http://localhost:35730/livereload.js"></script>
......
......@@ -23,8 +23,7 @@
<title>{{app.title}}</title>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
<meta name="keywords" content="artifact-graph, Cengage, registry-services">
<meta name="description" content="Cengage registry services">
<link href="/img/favicon.ico" rel="shortcut icon" type="image/x-icon">
......@@ -33,6 +32,10 @@
<link rel="stylesheet" href="/css/sticky-footer-navbar.css">
<link rel="stylesheet" href="/css/common.css">
<link rel="stylesheet" href="/css/lineage.css">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
......
......@@ -28,7 +28,7 @@ var path = require('path'),
config = require('rc')(packageJson.name, {
app: {
name: packageJson.name,
title: 'DGI | aetna'
title: 'DGI'
},
nodeEnv: 'local',
root: rootPath,
......@@ -38,7 +38,7 @@ var path = require('path'),
verbose: true,
hosts: [{
routes: {
'/api': 'http://162.249.6.76:21000/api'
'/api': 'http://162.249.6.39:21000/api'
}
}]
}
......
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