eagle-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h..@apache.org
Subject [1/2] incubator-eagle git commit: support hbase sensitivity
Date Thu, 03 Dec 2015 03:16:40 GMT
Repository: incubator-eagle
Updated Branches:
  refs/heads/master de30b151e -> 369093cd7


support hbase sensitivity


Project: http://git-wip-us.apache.org/repos/asf/incubator-eagle/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-eagle/commit/5d977e6b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-eagle/tree/5d977e6b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-eagle/diff/5d977e6b

Branch: refs/heads/master
Commit: 5d977e6ba3cb2282a05b520693ee059b2c31f0d7
Parents: f9d688f
Author: jiljiang <jiljiang@ebay.com>
Authored: Mon Nov 30 02:56:05 2015 +0000
Committer: jiljiang <jiljiang@ebay.com>
Committed: Mon Nov 30 02:56:05 2015 +0000

----------------------------------------------------------------------
 .../webapp/app/partials/dam/sensitivity.html    |  16 +-
 .../app/partials/dam/sensitivity/HDFS.html      | 110 --------
 .../app/partials/dam/sensitivity/Hive.html      | 150 ----------
 .../app/partials/dam/sensitivity/folder.html    | 110 ++++++++
 .../app/partials/dam/sensitivity/table.html     | 150 ++++++++++
 .../app/partials/dam/sensitivitySummary.html    |  62 ++---
 .../src/main/webapp/app/public/js/app.js        |   2 +-
 .../app/public/js/ctrl/sensitivityController.js | 271 +++++++++++--------
 8 files changed, 469 insertions(+), 402 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/5d977e6b/eagle-webservice/src/main/webapp/app/partials/dam/sensitivity.html
----------------------------------------------------------------------
diff --git a/eagle-webservice/src/main/webapp/app/partials/dam/sensitivity.html b/eagle-webservice/src/main/webapp/app/partials/dam/sensitivity.html
index af73ee4..b00bbaf 100644
--- a/eagle-webservice/src/main/webapp/app/partials/dam/sensitivity.html
+++ b/eagle-webservice/src/main/webapp/app/partials/dam/sensitivity.html
@@ -15,8 +15,18 @@
   See the License for the specific language governing permissions and
   limitations under the License.
   -->
-<div tabs icon="folder-open" data-title="Sensitivity Broswer" selected="type">
-	<div pane ng-repeat="entity in sensitivityList" data-title="{{entity.name}}">
-		<ng-include src="'partials/dam/sensitivity/' + entity.name + '.html?_=' + ajaxId"></ng-include>
+<div class="nav-tabs-custom">
+	<!-- Tabs within a box -->
+	<ul class="nav nav-tabs pull-right ui-sortable-handle">
+		<li ng-repeat="entity in config.list" ng-class="{active: dataSrc.name === entity.name}">
+			<a ng-click="site.url('/dam/sensitivity/' + entity.name)">{{entity.name}}</a>
+		</li>
+		<li class="pull-left header"><i class="fa fa-folder-open"></i> Sensitivity
Broswer</li>
+	</ul>
+	<div class="tab-content">
+		<!-- Morris chart - Sales -->
+		<div class="tab-pane active">
+			<ng-include src="'partials/dam/sensitivity/' + dataSrc.type + '.html?_=' + ajaxId"></ng-include>
+		</div>
 	</div>
 </div>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/5d977e6b/eagle-webservice/src/main/webapp/app/partials/dam/sensitivity/HDFS.html
----------------------------------------------------------------------
diff --git a/eagle-webservice/src/main/webapp/app/partials/dam/sensitivity/HDFS.html b/eagle-webservice/src/main/webapp/app/partials/dam/sensitivity/HDFS.html
deleted file mode 100644
index 70929c4..0000000
--- a/eagle-webservice/src/main/webapp/app/partials/dam/sensitivity/HDFS.html
+++ /dev/null
@@ -1,110 +0,0 @@
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
-  -->
-<div ng-controller="sensitivityHDFSCtrl">
-	<ul class="list-inline path">
-		<li>Path:</li>
-		<li ng-repeat="unit in pathUnitList">
-			<a ng-click="updateItems(unit.path)" class="label bg-black">{{unit.name}}</a>
-		</li>
-	</ul>
-
-	<table class="table table-bordered">
-		<thead>
-			<tr>
-				<th width="15%">File Name</th>
-				<th width="10%">Owner</th>
-				<th width="10%">Group</th>
-				<th>Sensitivity Type</th>
-				<th width="10" ng-show="auth.isRole('ROLE_ADMIN')"> </th>
-			</tr>
-		</thead>
-		<tbody>
-			<tr ng-show="items._promise.$$state.status !== 1">
-				<td colspan="5">
-					<span class="fa fa-refresh fa-spin"> </span>
-					Loading...
-				</td>
-			</tr>
-			<tr ng-show="items._promise.$$state.status === 1 && !items.length">
-				<td colspan="5">
-					<span class="fa fa-exclamation-triangle"> </span>
-					Empty Folder
-				</td>
-			</tr>
-			<tr ng-repeat="item in items" ng-class="{warning : item.sensitiveType}">
-				<td>
-					<span ng-show="!item.isdir">
-						<span class="fa fa-file"> </span>
-						{{getFileName(item)}}
-					</span>
-					<a ng-show="item.isdir" ng-click="updateItems(item.resource)">
-						<span class="fa fa-folder"> </span>
-						{{getFileName(item)}}
-					</a>
-
-					<span class="pull-right" ng-show="item.childSensitiveTypes.length">
-						<span class="fa fa-dot-circle-o text-muted" uib-tooltip="Contain child sensitivity
defination"> </span>
-					</span>
-				</td>
-				<td>{{item.owner}}</td>
-				<td>{{item.group}}</td>
-				<td>{{item.sensitiveType}}</td>
-				<td ng-show="auth.isRole('ROLE_ADMIN')">
-					<button class="fa fa-eye btn btn-primary btn-xs" ng-click="markSensitivity(item)"
ng-show="!item.sensitiveType"
-					uib-tooltip="Mark as sensitivity data" tooltip-animation="false" tooltip-placement="left">
</button>
-					<button class="fa fa-eye-slash btn btn-warning btn-xs" ng-click="unmarkSensitivity(item)"
ng-show="item.sensitiveType"
-					uib-tooltip="Remove the sensitivity mark" tooltip-animation="false" tooltip-placement="left">
</button>
-				</td>
-			</tr>
-		</tbody>
-	</table>
-
-
-	<!-- Modal: Create / Edit site -->
-	<div class="modal fade" id="sensitivityHdfsMDL" tabindex="-1" role="dialog">
-		<div class="modal-dialog" role="document">
-			<div class="modal-content">
-				<div class="modal-header">
-					<button type="button" class="close" data-dismiss="modal" aria-label="Close">
-						<span aria-hidden="true">&times;</span>
-					</button>
-					<h4 class="modal-title">Mark Sensitivity Data</h4>
-				</div>
-				<div class="modal-body">
-					<div class="form-group">
-						<label>Resource</label>
-						<input type="text" readonly="readonly" class="form-control" ng-model="_markItem.tags.filedir"
/>
-					</div>
-					<div class="form-group">
-						<label>* Sensitivity Type</label>
-						<input type="text" class="form-control" ng-model="_markItem.sensitivityType" id="hdfsSensitiveType"
/>
-					</div>
-				</div>
-				<div class="modal-footer">
-					<button type="button" class="btn btn-default" data-dismiss="modal">
-						Close
-					</button>
-					<button type="button" class="btn btn-primary" ng-click="confirmUpateSensitivity()"
ng-disabled="!_markItem.sensitivityType">
-						Update
-					</button>
-				</div>
-			</div>
-		</div>
-	</div>
-
-</div>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/5d977e6b/eagle-webservice/src/main/webapp/app/partials/dam/sensitivity/Hive.html
----------------------------------------------------------------------
diff --git a/eagle-webservice/src/main/webapp/app/partials/dam/sensitivity/Hive.html b/eagle-webservice/src/main/webapp/app/partials/dam/sensitivity/Hive.html
deleted file mode 100644
index f276ee0..0000000
--- a/eagle-webservice/src/main/webapp/app/partials/dam/sensitivity/Hive.html
+++ /dev/null
@@ -1,150 +0,0 @@
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
-  -->
-<div ng-controller="sensitivityHiveCtrl">
-	<p ng-show="databases._promise.$$state.status !== 1">
-		<span class="fa fa-refresh fa-spin"> </span>
-		Loading...
-	</p>
-
-	<div ng-show="databases._promise.$$state.status === 1" class="row">
-		<div class="col-md-4">
-			<label>
-				Databases
-				({{databases.length}})
-			</label>
-			<ul class="tree tree-bordered" style="max-height: 500px; overflow-y: auto;">
-				<li ng-repeat="db in databases">
-					<span class="tree-item box-clickable text-primary" ng-click="db.show = !db.show;
loadTables(db);">
-						<span ng-class="{'text-warning' : db.sensitiveType}">
-							<span class="fa fa-database"> </span>
-							{{db.database}}
-							<span ng-show="db.tables._promise.$$state.status === 1">({{db.tables.length}})</span>
-
-							<span ng-show="auth.isRole('ROLE_ADMIN')">
-								<a class="fa fa-eye text-muted hover" ng-click="markSensitivity(db, $event)" ng-show="!db.sensitiveType"
-								uib-tooltip="Mark as sensitivity data" tooltip-animation="false" tooltip-placement="right"></a>
-								<a class="fa fa-eye-slash text-muted hover" ng-click="unmarkSensitivity(db, $event)"
ng-show="db.sensitiveType"
-								uib-tooltip="Remove the sensitivity mark" tooltip-animation="false" tooltip-placement="right"></a>
-							</span>
-
-							<span class="pull-right" ng-show="db.childSensitiveTypes.length">
-								<span class="fa fa-dot-circle-o" tooltip="Contain child sensitivity defination">
</span>
-							</span>
-							<span ng-show="db.sensitiveType" class="pull-right">[{{db.sensitiveType}}]</span>
-						</span>
-					</span>
-					<ul ng-show="db.show">
-						<li ng-show="db.tables._promise.$$state.status !== 1">
-							<span>
-								<span class="fa fa-refresh fa-spin"> </span>
-								Loading...
-							</span>
-						</li>
-						<li ng-repeat="tb in db.tables" ng-class="{active : tb === table}">
-							<span class="tree-item box-clickable text-primary" ng-click="loadColumns(db, tb)">
-								<span ng-class="{'text-warning' : tb.sensitiveType}">
-									<span class="fa fa-table"> </span>
-									{{tb.table}}
-
-									<span ng-show="auth.isRole('ROLE_ADMIN')">
-										<a class="fa fa-eye text-muted hover" ng-click="markSensitivity(tb, $event)"
ng-show="!tb.sensitiveType"
-										uib-tooltip="Mark as sensitivity data" tooltip-animation="false" tooltip-placement="right"></a>
-										<a class="fa fa-eye-slash text-muted hover" ng-click="unmarkSensitivity(tb,
$event)" ng-show="tb.sensitiveType"
-										uib-tooltip="Remove the sensitivity mark" tooltip-animation="false" tooltip-placement="right"></a>
-									</span>
-
-									<span class="pull-right" ng-show="tb.childSensitiveTypes.length">
-										<span class="fa fa-dot-circle-o" uib-tooltip="Contain child sensitivity defination">
</span>
-									</span>
-									<span ng-show="tb.sensitiveType" class="pull-right">[{{tb.sensitiveType}}]</span>
-								</span>
-							</span>
-						</li>
-					</ul>
-				</li>
-			</ul>
-		</div>
-		<div class="col-md-8">
-			<label ng-show="table">Route: {{table.database}} > {{table.table}}</label>
-			<p ng-show="table && table.columns._promise.$$state.status !== 1">
-				<span class="fa fa-refresh fa-spin"> </span>
-				Loading...
-			</p>
-			<div ng-show="table && table.columns._promise.$$state.status === 1">
-				<table class="table table-bordered">
-					<thead>
-						<tr>
-							<th width="40%">Column Name</th>
-							<th>Sensitivity Type</th>
-							<th width="10" ng-show="auth.isRole('ROLE_ADMIN')"> </th>
-						</tr>
-					</thead>
-					<tbody>
-						<tr ng-repeat="col in table.columns" ng-class="{warning : col.sensitiveType}">
-							<td>{{col.column}}</td>
-							<td>{{col.sensitiveType}}</td>
-							<td ng-show="auth.isRole('ROLE_ADMIN')">
-								<button class="fa fa-eye btn btn-primary btn-xs" ng-click="markSensitivity(col)"
ng-show="!col.sensitiveType"
-								uib-tooltip="Mark as sensitivity data" tooltip-animation="false" tooltip-placement="left">
</button>
-								<button class="fa fa-eye-slash btn btn-warning btn-xs" ng-click="unmarkSensitivity(col)"
ng-show="col.sensitiveType"
-								uib-tooltip="Remove the sensitivity mark" tooltip-animation="false" tooltip-placement="left">
</button>
-							</td>
-						</tr>
-					</tbody>
-				</table>
-			</div>
-		</div>
-	</div>
-
-
-
-
-
-
-	<!-- Modal: Create / Edit site -->
-	<div class="modal fade" id="sensitivityHiveMDL" tabindex="-1" role="dialog">
-		<div class="modal-dialog" role="document">
-			<div class="modal-content">
-				<div class="modal-header">
-					<button type="button" class="close" data-dismiss="modal" aria-label="Close">
-						<span aria-hidden="true">&times;</span>
-					</button>
-					<h4 class="modal-title">Mark Sensitivity Data</h4>
-				</div>
-				<div class="modal-body">
-					<div class="form-group">
-						<label>Resource</label>
-						<input type="text" readonly="readonly" class="form-control" ng-model="_markItem.tags.hiveResource"
/>
-					</div>
-					<div class="form-group">
-						<label>* Sensitivity Type</label>
-						<input type="text" class="form-control" ng-model="_markItem.sensitivityType" id="hiveSensitiveType"
/>
-					</div>
-				</div>
-				<div class="modal-footer">
-					<button type="button" class="btn btn-default" data-dismiss="modal">
-						Close
-					</button>
-					<button type="button" class="btn btn-primary" ng-click="confirmUpateSensitivity()"
ng-disabled="!_markItem.sensitivityType">
-						Update
-					</button>
-				</div>
-			</div>
-		</div>
-	</div>
-</div>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/5d977e6b/eagle-webservice/src/main/webapp/app/partials/dam/sensitivity/folder.html
----------------------------------------------------------------------
diff --git a/eagle-webservice/src/main/webapp/app/partials/dam/sensitivity/folder.html b/eagle-webservice/src/main/webapp/app/partials/dam/sensitivity/folder.html
new file mode 100644
index 0000000..1827eac
--- /dev/null
+++ b/eagle-webservice/src/main/webapp/app/partials/dam/sensitivity/folder.html
@@ -0,0 +1,110 @@
+<!--
+  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 ng-controller="sensitivityViewFolderCtrl">
+	<ul class="list-inline path">
+		<li>Path:</li>
+		<li ng-repeat="unit in pathUnitList">
+			<a ng-click="updateItems(unit.path)" class="label bg-black">{{unit.name}}</a>
+		</li>
+	</ul>
+
+	<table class="table table-bordered">
+		<thead>
+			<tr>
+				<th width="15%">File Name</th>
+				<th width="10%">Owner</th>
+				<th width="10%">Group</th>
+				<th>Sensitivity Type</th>
+				<th width="10" ng-show="auth.isRole('ROLE_ADMIN')"> </th>
+			</tr>
+		</thead>
+		<tbody>
+			<tr ng-show="items._promise.$$state.status !== 1">
+				<td colspan="5">
+					<span class="fa fa-refresh fa-spin"> </span>
+					Loading...
+				</td>
+			</tr>
+			<tr ng-show="items._promise.$$state.status === 1 && !items.length">
+				<td colspan="5">
+					<span class="fa fa-exclamation-triangle"> </span>
+					Empty Folder
+				</td>
+			</tr>
+			<tr ng-repeat="item in items" ng-class="{warning : item.sensitiveType}">
+				<td>
+					<span ng-show="!item.isdir">
+						<span class="fa fa-file"> </span>
+						{{getFileName(item)}}
+					</span>
+					<a ng-show="item.isdir" ng-click="updateItems(item.resource)">
+						<span class="fa fa-folder"> </span>
+						{{getFileName(item)}}
+					</a>
+
+					<span class="pull-right" ng-show="item.childSensitiveTypes.length">
+						<span class="fa fa-dot-circle-o text-muted" uib-tooltip="Contain child sensitivity
defination"> </span>
+					</span>
+				</td>
+				<td>{{item.owner}}</td>
+				<td>{{item.group}}</td>
+				<td>{{item.sensitiveType}}</td>
+				<td ng-show="auth.isRole('ROLE_ADMIN')">
+					<button class="fa fa-eye btn btn-primary btn-xs" ng-click="markSensitivity(item)"
ng-show="!item.sensitiveType"
+					uib-tooltip="Mark as sensitivity data" tooltip-animation="false" tooltip-placement="left">
</button>
+					<button class="fa fa-eye-slash btn btn-warning btn-xs" ng-click="unmarkSensitivity(item)"
ng-show="item.sensitiveType"
+					uib-tooltip="Remove the sensitivity mark" tooltip-animation="false" tooltip-placement="left">
</button>
+				</td>
+			</tr>
+		</tbody>
+	</table>
+
+
+	<!-- Modal: Create / Edit site -->
+	<div class="modal fade" id="sensitivityMDL" tabindex="-1" role="dialog">
+		<div class="modal-dialog" role="document">
+			<div class="modal-content">
+				<div class="modal-header">
+					<button type="button" class="close" data-dismiss="modal" aria-label="Close">
+						<span aria-hidden="true">&times;</span>
+					</button>
+					<h4 class="modal-title">Mark Sensitivity Data</h4>
+				</div>
+				<div class="modal-body">
+					<div class="form-group">
+						<label>Resource</label>
+						<input type="text" readonly="readonly" class="form-control" ng-model="_markItem.tags.filedir"
/>
+					</div>
+					<div class="form-group">
+						<label>* Sensitivity Type</label>
+						<input type="text" class="form-control" ng-model="_markItem.sensitivityType" id="sensitiveType"
/>
+					</div>
+				</div>
+				<div class="modal-footer">
+					<button type="button" class="btn btn-default" data-dismiss="modal">
+						Close
+					</button>
+					<button type="button" class="btn btn-primary" ng-click="confirmUpateSensitivity()"
ng-disabled="!_markItem.sensitivityType">
+						Update
+					</button>
+				</div>
+			</div>
+		</div>
+	</div>
+
+</div>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/5d977e6b/eagle-webservice/src/main/webapp/app/partials/dam/sensitivity/table.html
----------------------------------------------------------------------
diff --git a/eagle-webservice/src/main/webapp/app/partials/dam/sensitivity/table.html b/eagle-webservice/src/main/webapp/app/partials/dam/sensitivity/table.html
new file mode 100644
index 0000000..baa824c
--- /dev/null
+++ b/eagle-webservice/src/main/webapp/app/partials/dam/sensitivity/table.html
@@ -0,0 +1,150 @@
+<!--
+  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 ng-controller="sensitivityViewTableCtrl">
+	<p ng-show="databases._promise.$$state.status !== 1">
+		<span class="fa fa-refresh fa-spin"> </span>
+		Loading...
+	</p>
+
+	<div ng-show="databases._promise.$$state.status === 1" class="row">
+		<div class="col-md-4">
+			<label>
+				Databases
+				({{databases.length}})
+			</label>
+			<ul class="tree tree-bordered" style="max-height: 500px; overflow-y: auto;">
+				<li ng-repeat="db in databases">
+					<span class="tree-item box-clickable text-primary" ng-click="db.show = !db.show;
loadTables(db);">
+						<span ng-class="{'text-warning' : db.sensitiveType}">
+							<span class="fa fa-database"> </span>
+							{{db.database}}
+							<span ng-show="db.tables._promise.$$state.status === 1">({{db.tables.length}})</span>
+
+							<span ng-show="auth.isRole('ROLE_ADMIN')">
+								<a class="fa fa-eye text-muted hover" ng-click="markSensitivity(db, $event)" ng-show="!db.sensitiveType"
+								uib-tooltip="Mark as sensitivity data" tooltip-animation="false" tooltip-placement="right"></a>
+								<a class="fa fa-eye-slash text-muted hover" ng-click="unmarkSensitivity(db, $event)"
ng-show="db.sensitiveType"
+								uib-tooltip="Remove the sensitivity mark" tooltip-animation="false" tooltip-placement="right"></a>
+							</span>
+
+							<span class="pull-right" ng-show="db.childSensitiveTypes.length">
+								<span class="fa fa-dot-circle-o" uib-tooltip="Contain child sensitivity defination"
tooltip-placement="right" tooltip-append-to-body="true"> </span>
+							</span>
+							<span ng-show="db.sensitiveType" class="pull-right">[{{db.sensitiveType}}]</span>
+						</span>
+					</span>
+					<ul ng-show="db.show">
+						<li ng-show="db.tables._promise.$$state.status !== 1">
+							<span>
+								<span class="fa fa-refresh fa-spin"> </span>
+								Loading...
+							</span>
+						</li>
+						<li ng-repeat="tb in db.tables" ng-class="{active : tb === table}">
+							<span class="tree-item box-clickable text-primary" ng-click="loadColumns(db, tb)">
+								<span ng-class="{'text-warning' : tb.sensitiveType}">
+									<span class="fa fa-table"> </span>
+									{{tb.table}}
+
+									<span ng-show="auth.isRole('ROLE_ADMIN')">
+										<a class="fa fa-eye text-muted hover" ng-click="markSensitivity(tb, $event)"
ng-show="!tb.sensitiveType"
+										uib-tooltip="Mark as sensitivity data" tooltip-animation="false" tooltip-placement="right"></a>
+										<a class="fa fa-eye-slash text-muted hover" ng-click="unmarkSensitivity(tb,
$event)" ng-show="tb.sensitiveType"
+										uib-tooltip="Remove the sensitivity mark" tooltip-animation="false" tooltip-placement="right"></a>
+									</span>
+
+									<span class="pull-right" ng-show="tb.childSensitiveTypes.length">
+										<span class="fa fa-dot-circle-o" uib-tooltip="Contain child sensitivity defination"
tooltip-placement="right" tooltip-append-to-body="true"> </span>
+									</span>
+									<span ng-show="tb.sensitiveType" class="pull-right">[{{tb.sensitiveType}}]</span>
+								</span>
+							</span>
+						</li>
+					</ul>
+				</li>
+			</ul>
+		</div>
+		<div class="col-md-8">
+			<label ng-show="table">Route: {{table.database}} > {{table.table}}</label>
+			<p ng-show="table && table.columns._promise.$$state.status !== 1">
+				<span class="fa fa-refresh fa-spin"> </span>
+				Loading...
+			</p>
+			<div ng-show="table && table.columns._promise.$$state.status === 1">
+				<table class="table table-bordered">
+					<thead>
+						<tr>
+							<th width="40%">Column Name</th>
+							<th>Sensitivity Type</th>
+							<th width="10" ng-show="auth.isRole('ROLE_ADMIN')"> </th>
+						</tr>
+					</thead>
+					<tbody>
+						<tr ng-repeat="col in table.columns" ng-class="{warning : col.sensitiveType}">
+							<td>{{col.column}}</td>
+							<td>{{col.sensitiveType}}</td>
+							<td ng-show="auth.isRole('ROLE_ADMIN')">
+								<button class="fa fa-eye btn btn-primary btn-xs" ng-click="markSensitivity(col)"
ng-show="!col.sensitiveType"
+								uib-tooltip="Mark as sensitivity data" tooltip-animation="false" tooltip-placement="left">
</button>
+								<button class="fa fa-eye-slash btn btn-warning btn-xs" ng-click="unmarkSensitivity(col)"
ng-show="col.sensitiveType"
+								uib-tooltip="Remove the sensitivity mark" tooltip-animation="false" tooltip-placement="left">
</button>
+							</td>
+						</tr>
+					</tbody>
+				</table>
+			</div>
+		</div>
+	</div>
+
+
+
+
+
+
+	<!-- Modal: Create / Edit site -->
+	<div class="modal fade" id="sensitivityMDL" tabindex="-1" role="dialog">
+		<div class="modal-dialog" role="document">
+			<div class="modal-content">
+				<div class="modal-header">
+					<button type="button" class="close" data-dismiss="modal" aria-label="Close">
+						<span aria-hidden="true">&times;</span>
+					</button>
+					<h4 class="modal-title">Mark Sensitivity Data</h4>
+				</div>
+				<div class="modal-body">
+					<div class="form-group">
+						<label>Resource</label>
+						<input type="text" readonly="readonly" class="form-control" ng-model="_markItem.tags[dataSrc.keys[0]]"
/>
+					</div>
+					<div class="form-group">
+						<label>* Sensitivity Type</label>
+						<input type="text" class="form-control" ng-model="_markItem.sensitivityType" id="sensitiveType"
/>
+					</div>
+				</div>
+				<div class="modal-footer">
+					<button type="button" class="btn btn-default" data-dismiss="modal">
+						Close
+					</button>
+					<button type="button" class="btn btn-primary" ng-click="confirmUpateSensitivity()"
ng-disabled="!_markItem.sensitivityType">
+						Update
+					</button>
+				</div>
+			</div>
+		</div>
+	</div>
+</div>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/5d977e6b/eagle-webservice/src/main/webapp/app/partials/dam/sensitivitySummary.html
----------------------------------------------------------------------
diff --git a/eagle-webservice/src/main/webapp/app/partials/dam/sensitivitySummary.html b/eagle-webservice/src/main/webapp/app/partials/dam/sensitivitySummary.html
index 294b105..3dfe103 100644
--- a/eagle-webservice/src/main/webapp/app/partials/dam/sensitivitySummary.html
+++ b/eagle-webservice/src/main/webapp/app/partials/dam/sensitivitySummary.html
@@ -16,40 +16,40 @@
   limitations under the License.
   -->
 <div class="row">
-	<div class="col-md-4" ng-repeat="entity in sensitivityList">
-			<div class="info-box bg-aqua box-clickable">
-				<span class="info-box-icon" ng-click="site.url('/dam/sensitivity?type=' + entity.name)"><i
class="fa fa-suitcase"></i></span>
-				<div class="info-box-content">
-					<div class="pull-right btn-group" ng-show="auth.isRole('ROLE_ADMIN')">
-						<a class="fa fa-cog config" data-toggle="dropdown"></a>
-						<ul class="dropdown-menu" role="menu">
-							<li>
-								<a ng-click="showImportEditor(entity);"><span class="fa fa-cloud-upload"></span>Import</a>
-							</li>
-							<li class="divider"></li>
-							<li>
-								<a ng-click="showManagementEditor(entity);"><span class="fa fa-list"></span>Management</a>
-							</li>
-						</ul>
-					</div>
+	<div class="col-md-4" ng-repeat="entity in config.list">
+		<div class="info-box bg-aqua box-clickable">
+			<span class="info-box-icon" ng-click="site.url('/dam/sensitivity/' + entity.name)"><i
class="fa fa-suitcase"></i></span>
+			<div class="info-box-content">
+				<div class="pull-right btn-group" ng-show="auth.isRole('ROLE_ADMIN')">
+					<a class="fa fa-cog config" data-toggle="dropdown"></a>
+					<ul class="dropdown-menu" role="menu">
+						<li>
+							<a ng-click="showImportEditor(entity);"><span class="fa fa-cloud-upload"></span>Import</a>
+						</li>
+						<li class="divider"></li>
+						<li>
+							<a ng-click="showManagementEditor(entity);"><span class="fa fa-list"></span>Management</a>
+						</li>
+					</ul>
+				</div>
 
-					<div ng-click="site.url('/dam/sensitivity?type=' + entity.name)">
-						<span class="info-box-text text-large">{{entity.name}}</span>
-						<!--span class="info-box-number">
-							<small>Connected</small>
-						</span-->
-						<div class="progress">
-							<div class="progress-bar"></div>
-						</div>
-						<span class="progress-description">
-							<span class="fa fa-refresh fa-spin" ng-hide="entity.statisitc._promise.$$state.status
=== 1"></span>
-							<span ng-show="entity.statisitc._promise.$$state.status === 1">{{entity.statisitc[0].value[0]
|| 0}}</span>
-							sensitivity items
-						</span>
+				<div ng-click="site.url('/dam/sensitivity/' + entity.name)">
+					<span class="info-box-text text-large">{{entity.name}}</span>
+					<!--span class="info-box-number">
+						<small>Connected</small>
+					</span-->
+					<div class="progress">
+						<div class="progress-bar"></div>
 					</div>
-				</div><!-- /.info-box-content -->
-			</div>
+					<span class="progress-description">
+						<span class="fa fa-refresh fa-spin" ng-hide="entity.statisitc._promise.$$state.status
=== 1"></span>
+						<span ng-show="entity.statisitc._promise.$$state.status === 1">{{entity.statisitc[0].value[0]
|| 0}}</span>
+						sensitivity items
+					</span>
+				</div>
+			</div><!-- /.info-box-content -->
 		</div>
+	</div>
 </div>
 
 <!-- Modal: Create sensitivity -->

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/5d977e6b/eagle-webservice/src/main/webapp/app/public/js/app.js
----------------------------------------------------------------------
diff --git a/eagle-webservice/src/main/webapp/app/public/js/app.js b/eagle-webservice/src/main/webapp/app/public/js/app.js
index c8654f3..220e586 100644
--- a/eagle-webservice/src/main/webapp/app/public/js/app.js
+++ b/eagle-webservice/src/main/webapp/app/public/js/app.js
@@ -132,7 +132,7 @@ eagleApp.config(function($routeProvider) {
 			site: function(Site) {return Site._promise();},
 			auth: function(Authorization) {return Authorization._promise();},
 		},
-	}).when('/dam/sensitivity', {
+	}).when('/dam/sensitivity/:dataSrc', {
 		templateUrl : 'partials/dam/sensitivity.html',
 		controller : 'sensitivityCtrl',
 		reloadOnSearch: false,

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/5d977e6b/eagle-webservice/src/main/webapp/app/public/js/ctrl/sensitivityController.js
----------------------------------------------------------------------
diff --git a/eagle-webservice/src/main/webapp/app/public/js/ctrl/sensitivityController.js
b/eagle-webservice/src/main/webapp/app/public/js/ctrl/sensitivityController.js
index 0dd5ea5..7ae868b 100644
--- a/eagle-webservice/src/main/webapp/app/public/js/ctrl/sensitivityController.js
+++ b/eagle-webservice/src/main/webapp/app/public/js/ctrl/sensitivityController.js
@@ -18,13 +18,70 @@
 
 'use strict';
 
+damControllers.service('SensitivityConfig', function(Site) {
+	var config = {
+		list: [
+			{
+				name: "HDFS",
+				dataSrc: common.array.find("hdfsAuditLog", Site.current().dataSrcList, "tags.dataSource"),
+				service: "FileSensitivityService",
+				keys: ["filedir", "sensitivityType"],
+
+				type: "folder",
+				prefix: "fileSensitivity",
+				api: "hdfsResource",
+			},
+			{
+				name: "Hive",
+				dataSrc: common.array.find("hiveQueryLog", Site.current().dataSrcList, "tags.dataSource"),
+				service: "HiveResourceSensitivityService",
+				keys: ["hiveResource", "sensitivityType"],
+
+				type: "table",
+				prefix: "hiveResourceSensitivity",
+				api: {
+					database: "hiveResource/databases",
+					table: "hiveResource/tables",
+					column: "hiveResource/columns",
+				},
+				mapping: {
+					database: "database",
+					table: "table",
+					column: "column",
+				},
+			},
+			{
+				name: "HBase",
+				dataSrc: common.array.find("hbaseSecurityLog", Site.current().dataSrcList, "tags.dataSource"),
+				service: "HbaseResourceSensitivityService",
+				keys: ["hbaseResource", "sensitivityType"],
+				type: "table",
+				prefix: "hbaseResourceSensitivity",
+				api: {
+					database: "hbaseResource/namespaces",
+					table: "hbaseResource/tables",
+					column: "hbaseResource/columns",
+				},
+				mapping: {
+					database: "namespace",
+					table: "table",
+					column: "columnFamily",
+				},
+			},
+		],
+	};
+
+	return config;
+});
+
 // =============================================================
 // =                    Sensitivity Summary                    =
 // =============================================================
-damControllers.controller('sensitivitySummaryCtrl', function(globalContent, Site, damContent,
$scope, Entities) {
+damControllers.controller('sensitivitySummaryCtrl', function(globalContent, Site, damContent,
$scope, Entities, SensitivityConfig) {
 	globalContent.setConfig(damContent.config);
 	globalContent.pageTitle = "Data Classification";
 	globalContent.pageSubTitle = Site.current().name;
+	$scope.config = SensitivityConfig;
 
 	$scope._sensitivitySource = null;
 	$scope._sensitivityLock = false;
@@ -32,31 +89,20 @@ damControllers.controller('sensitivitySummaryCtrl', function(globalContent,
Site
 	$scope._sensitivityFile = "";
 	$scope._sensitivityData = "";
 	$scope._sensitivityError = "";
-	$scope.sensitivityList = [];
 
-	// TODO: Only support Hive & HDFS
-	if(common.array.find("hdfsAuditLog", Site.current().dataSrcList, "tags.dataSource")) {
-		$scope.sensitivityList.push(
-			{name: "HDFS", service: "FileSensitivityService", keys: ["filedir", "sensitivityType"]}
-		);
-	}
-	if(common.array.find("hiveQueryLog", Site.current().dataSrcList, "tags.dataSource")) {
-		$scope.sensitivityList.push(
-			{name: "Hive", service: "HiveResourceSensitivityService", keys: ["hiveResource", "sensitivityType"]}
-		);
-	}
-
-	function _refreshStatistic(entity) {
+	// ==================== Statistic ====================
+	var _refreshStatistic = function(entity) {
 		if(entity) {
 				entity.statisitc = Entities.queryGroup(entity.service, {site: Site.current().name}, "@site",
"count");
 		} else {
-			$.each($scope.sensitivityList, function(i, entity) {
+			$.each($scope.config.list, function(i, entity) {
 				entity.statisitc = Entities.queryGroup(entity.service, {site: Site.current().name}, "@site",
"count");
 			});
 		}
-	}
+	};
 	_refreshStatistic();
 
+	// ================== Configuration ==================
 	// Import sensitivity data
 	$scope.showImportEditor = function(entity) {
 		$scope._sensitivitySource = entity;
@@ -82,7 +128,7 @@ damControllers.controller('sensitivitySummaryCtrl', function(globalContent,
Site
 				if(!Entities.dialog(data)) {
 					$("#sensitivityMDL").modal('hide');
 					$scope._sensitivityData = "";
-	
+
 					_refreshStatistic($scope._sensitivitySource);
 				}
 			}).finally(function() {
@@ -198,90 +244,38 @@ damControllers.controller('sensitivitySummaryCtrl', function(globalContent,
Site
 // =============================================================
 // =                        Sensitivity                        =
 // =============================================================
-damControllers.controller('sensitivityCtrl', function(globalContent, Site, damContent, $scope,
$q, $routeParams, $location, Entities) {
+damControllers.controller('sensitivityCtrl', function(globalContent, Site, damContent, $scope,
$routeParams, SensitivityConfig) {
 	globalContent.setConfig(damContent.config);
 	globalContent.pageTitle = "Data Classification";
 	globalContent.pageSubTitle = Site.current().name;
-
-	$scope.sensitivityList = [];
-	$scope.type = $routeParams.type;
+	$scope.config = SensitivityConfig;
 	$scope.ajaxId = Math.random();
 
-	// TODO: Only support Hive & HDFS
-	if(common.array.find("hdfsAuditLog", Site.current().dataSrcList, "tags.dataSource")) {
-		$scope.sensitivityList.push(
-			{name: "HDFS"}
-		);
-	}
-	if(common.array.find("hiveQueryLog", Site.current().dataSrcList, "tags.dataSource")) {
-		$scope.sensitivityList.push(
-			{name: "Hive"}
-		);
+	// Check data source
+	$scope.dataSrc = common.array.find($routeParams.dataSrc, $scope.config.list, "name");
+	if(!$scope.dataSrc) {
+		$.dialog({
+			title: "OPS",
+			content: "Data Source '" + $routeParams.dataSrc + "' not found!"
+		}, function() {
+			Site.url('/dam/sensitivitySummary');
+		});
 	}
-
-	// Update search
-	$scope.$watch("type", function(value) {
-		$location.search("type", value);
-	});
 });
 
-// =============================================================
-// =                     Sensitivity: HDFS                     =
-// =============================================================
-damControllers.controller('sensitivityHDFSCtrl', function(globalContent, Site, damContent,
$scope, $location, $q, Entities) {
+// ==============================================================
+// =                    Sensitivity - Folder                    =
+// ==============================================================
+damControllers.controller('sensitivityViewFolderCtrl', function(globalContent, Site, damContent,
$scope, $location, Entities, SensitivityConfig) {
 	$scope.path = $location.search().path || "/";
 	$scope.pathUnitList = [];
-
 	$scope.items = [];
 
-	/*$scope.$parent.$on("tab-change", function(event, pane) {
-		$location.search("path", pane.title === "HDFS" ? $scope.path : null);
-	});*/
-
 	// Mark sensitivity
 	$scope._oriItem = {};
 	$scope._markItem = {};
 
-	$scope.markSensitivity = function(item) {
-		$scope._oriItem = item;
-		$scope._markItem = {
-			prefix: "fileSensitivity",
-			tags: {
-				site: Site.current().name,
-				filedir: item.resource
-			},
-			sensitivityType: ""
-		};
-		$("#sensitivityHdfsMDL").modal();
-		setTimeout(function() {
-			$("#hdfsSensitiveType").focus();
-		}, 500);
-	};
-	$scope.confirmUpateSensitivity = function() {
-		$scope._oriItem.sensitiveType = $scope._markItem.sensitivityType;
-		var _promise = Entities.updateEntity("FileSensitivityService", $scope._markItem, {timestamp:
false})._promise.success(function(data) {
-			Entities.dialog(data);
-		});
-		$("#sensitivityHdfsMDL").modal('hide');
-	};
-	$scope.unmarkSensitivity = function(item) {
-		$.dialog({
-			title: "Unmark Confirm",
-			content: "Do you want to remove the sensitivity mark on '" + item.resource + "'?",
-			confirm: true
-		}, function(ret) {
-			if(!ret) return;
-
-			Entities.deleteEntities("FileSensitivityService", {
-				site: Site.current().name,
-				filedir: item.resource
-			});
-
-			item.sensitiveType = null;
-			$scope.$apply();
-		});
-	};
-
+	// ======================= View =======================
 	// Path
 	function _refreshPathUnitList(_path) {
 		var _start,_current, _unitList = [];
@@ -302,15 +296,13 @@ damControllers.controller('sensitivityHDFSCtrl', function(globalContent,
Site, d
 	$scope.updateItems = function(path) {
 		if(path) $scope.path = path;
 
-		$scope.items = Entities.query("hdfsResource", {site: Site.current().name, path: $scope.path});
+		$scope.items = Entities.query($scope.dataSrc.api, {site: Site.current().name, path: $scope.path});
 		$scope.items._promise.success(function(data) {
 			var $dlg = Entities.dialog(data, function() {
 				if($scope.path !== "/") $scope.updateItems("/");
 			});
 		});
 		_refreshPathUnitList($scope.path);
-
-		//$location.search("path", $scope.path);
 	};
 
 	$scope.getFileName = function(item) {
@@ -318,54 +310,118 @@ damControllers.controller('sensitivityHDFSCtrl', function(globalContent,
Site, d
 	};
 
 	$scope.updateItems($scope.path);
+
+	// =================== Sensitivity ===================
+	$scope.markSensitivity = function(item) {
+		$scope._oriItem = item;
+		$scope._markItem = {
+			prefix: $scope.dataSrc.prefix,
+			tags: {
+				site: Site.current().name,
+			},
+			sensitivityType: ""
+		};
+		$scope._markItem.tags[$scope.dataSrc.keys[0]] = item.resource;
+		$("#sensitivityMDL").modal();
+		setTimeout(function() {
+			$("#sensitiveType").focus();
+		}, 500);
+	};
+	$scope.confirmUpateSensitivity = function() {
+		$scope._oriItem.sensitiveType = $scope._markItem.sensitivityType;
+		var _promise = Entities.updateEntity($scope.dataSrc.service, $scope._markItem, {timestamp:
false})._promise.success(function(data) {
+			Entities.dialog(data);
+		});
+		$("#sensitivityMDL").modal('hide');
+	};
+	$scope.unmarkSensitivity = function(item) {
+		$.dialog({
+			title: "Unmark Confirm",
+			content: "Do you want to remove the sensitivity mark on '" + item.resource + "'?",
+			confirm: true
+		}, function(ret) {
+			if(!ret) return;
+
+			var _cond = {site: Site.current().name};
+			_cond[$scope.dataSrc.keys[0]] = item.resource;
+			Entities.deleteEntities($scope.dataSrc.service, _cond);
+
+			item.sensitiveType = null;
+			$scope.$apply();
+		});
+	};
 });
 
 // =============================================================
-// =                     Sensitivity: Hive                     =
+// =                    Sensitivity - Table                    =
 // =============================================================
-damControllers.controller('sensitivityHiveCtrl', function(globalContent, Site, damContent,
$scope, $q, Entities) {
+damControllers.controller('sensitivityViewTableCtrl', function(globalContent, Site, damContent,
$scope, $location, Entities, SensitivityConfig) {
 	$scope.table = null;
 
-	$scope.databases = Entities.query("hiveResource/databases", {site: Site.current().name});
+	// Mark sensitivity
+	$scope._oriItem = {};
+	$scope._markItem = {};
+
+	// ======================= View =======================
+	var _fillAttr = function(list, key, target) {
+		list._promise.then(function() {
+			$.each(list, function(i, unit) {
+				unit[key] = unit[target];
+			});
+		});
+	};
+
+	$scope.databases = Entities.query($scope.dataSrc.api.database, {site: Site.current().name});
+	_fillAttr($scope.databases, "database", $scope.dataSrc.mapping.database);
+
 	$scope.loadTables = function(database) {
 		if(database.tables) return;
-		database.tables = Entities.query("hiveResource/tables", {site: Site.current().name, database:
database.database});
+		var _qry = {
+			site: Site.current().name
+		};
+		_qry[$scope.dataSrc.mapping.database] = database[$scope.dataSrc.mapping.database];
+		database.tables = Entities.query($scope.dataSrc.api.table, _qry);
+		_fillAttr(database.tables, "table", $scope.dataSrc.mapping.table);
+		_fillAttr(database.tables, "database", $scope.dataSrc.mapping.database);
 	};
 
 	$scope.loadColumns = function(database, table) {
 		$scope.table = table;
 
 		if(table.columns) return;
-		table.columns = Entities.query("hiveResource/columns", {site: Site.current().name, database:
database.database, table: table.table});
+		var _qry = {
+			site: Site.current().name
+		};
+		_qry[$scope.dataSrc.mapping.database] = database[$scope.dataSrc.mapping.database];
+		_qry[$scope.dataSrc.mapping.table] = table[$scope.dataSrc.mapping.table];
+		table.columns = Entities.query($scope.dataSrc.api.column, _qry);
+		_fillAttr(table.columns, "column", $scope.dataSrc.mapping.column);
 	};
 
-	// Mark sensitivity
-	$scope._oriItem = {};
-	$scope._markItem = {};
-
+	// =================== Sensitivity ===================
 	$scope.markSensitivity = function(item, event) {
 		if(event) event.stopPropagation();
 
 		$scope._oriItem = item;
 		$scope._markItem = {
-			prefix: "hiveResourceSensitivity",
+			prefix: $scope.dataSrc.prefix,
 			tags: {
 				site: Site.current().name,
-				hiveResource: item.resource
 			},
 			sensitivityType: ""
 		};
-		$("#sensitivityHiveMDL").modal();
+		$scope._markItem.tags[$scope.dataSrc.keys[0]] = item.resource;
+		$("#sensitivityMDL").modal();
 		setTimeout(function() {
-			$("#hiveSensitiveType").focus();
+			$("#sensitiveType").focus();
 		}, 500);
 	};
 	$scope.confirmUpateSensitivity = function() {
 		$scope._oriItem.sensitiveType = $scope._markItem.sensitivityType;
-		var _promise = Entities.updateEntity("HiveResourceSensitivityService", $scope._markItem,
{timestamp: false})._promise.success(function(data) {
+		var _promise = Entities.updateEntity($scope.dataSrc.service, $scope._markItem, {timestamp:
false})._promise.success(function(data) {
 			Entities.dialog(data);
 		});
-		$("#sensitivityHiveMDL").modal('hide');
+		$("#sensitivityMDL").modal('hide');
 	};
 	$scope.unmarkSensitivity = function(item, event) {
 		if(event) event.stopPropagation();
@@ -377,10 +433,11 @@ damControllers.controller('sensitivityHiveCtrl', function(globalContent,
Site, d
 		}, function(ret) {
 			if(!ret) return;
 
-			Entities.deleteEntities("HiveResourceSensitivityService", {
+			var _qry = {
 				site: Site.current().name,
-				hiveResource: item.resource
-			});
+			};
+			_qry[$scope.dataSrc.keys[0]] = item.resource;
+			Entities.deleteEntities($scope.dataSrc.service, _qry);
 
 			item.sensitiveType = null;
 			$scope.$apply();



Mime
View raw message