You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by sa...@apache.org on 2020/03/09 20:56:40 UTC
[atlas] branch branch-2.0 updated: ATLAS-3656 : UI: Rename type
Namespace to BusinessMetadata
This is an automated email from the ASF dual-hosted git repository.
sarath pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/atlas.git
The following commit(s) were added to refs/heads/branch-2.0 by this push:
new 8cb136f ATLAS-3656 : UI: Rename type Namespace to BusinessMetadata
8cb136f is described below
commit 8cb136f9c982da7c91ec046d4acf80958025b048
Author: kevalbhatt <kb...@apache.org>
AuthorDate: Mon Mar 9 23:47:56 2020 +0530
ATLAS-3656 : UI: Rename type Namespace to BusinessMetadata
Signed-off-by: Sarath Subramanian <sa...@apache.org>
(cherry picked from commit 3d0fcedb025b5a2669fa7f32af826323a3c1d58f)
---
.../{namespace.scss => business-metadata.scss} | 26 +-
dashboardv3/public/css/scss/style.scss | 2 +-
dashboardv3/public/js/collection/BaseCollection.js | 3 +
dashboardv3/public/js/main.js | 16 +-
dashboardv3/public/js/models/BaseModel.js | 3 +
dashboardv3/public/js/models/VEntity.js | 14 +-
dashboardv3/public/js/router/Router.js | 16 +-
.../AdministratorLayoutView_tmpl.html | 6 +-
.../BusinessMetadataAttrTableLayoutView_tmpl.html} | 22 +-
.../BusinessMetadataAttributeItemView_tmpl.html} | 4 +-
.../BusinessMetadataContainerLayoutView_tmpl.html} | 4 +-
.../BusinessMetadataDetailLayoutView_tmpl.html} | 0
.../BusinessMetadataTableLayoutView_tmpl.html} | 26 +-
.../CreateBusinessMetadataLayoutView_tmpl.html} | 10 +-
.../EnumCreateUpdateItemView_tmpl.html | 0
.../detail_page/DetailPageLayoutView_tmpl.html | 2 +-
...ml => EntityBusinessMetaDataItemView_tmpl.html} | 8 +-
...l.html => EntityBusinessMetaDataView_tmpl.html} | 16 +-
.../search/SearchFilterBrowseLayoutView_tmpl.html | 2 +-
...ml => BusinessMetadataTreeLayoutView_tmpl.html} | 22 +-
dashboardv3/public/js/utils/UrlLinks.js | 33 +-
dashboardv3/public/js/utils/Utils.js | 2 +-
.../views/administrator/AdministratorLayoutView.js | 16 +-
.../BusinessMetadataAttrTableLayoutView.js} | 117 ++---
.../BusinessMetadataAttributeItemView.js} | 66 ++-
.../BusinessMetadataContainerLayoutView.js | 119 +++++
.../BusinessMetadataDetailLayoutView.js | 68 +++
.../BusinessMetadataTableLayoutView.js} | 172 +++---
.../CreateBusinessMetadataLayoutView.js | 484 +++++++++++++++++
.../EnumCreateUpdateItemView.js | 10 +-
.../js/views/detail_page/DetailPageLayoutView.js | 16 +-
...emView.js => EntityBusinessMetaDataItemView.js} | 62 +--
...eSpaceView.js => EntityBusinessMetaDataView.js} | 93 ++--
.../views/name_space/CreateNameSpaceLayoutView.js | 576 ---------------------
.../name_space/NameSpaceContainerLayoutView.js | 117 -----
.../views/name_space/NameSpaceDetailLayoutView.js | 110 ----
.../public/js/views/search/QueryBuilderView.js | 25 +-
.../js/views/search/SearchDefaultLayoutView.js | 8 +-
.../views/search/SearchFilterBrowseLayoutView.js | 20 +-
.../js/views/search/SearchResultLayoutView.js | 27 +-
...utView.js => BusinessMetadataTreeLayoutView.js} | 117 ++---
41 files changed, 1144 insertions(+), 1316 deletions(-)
diff --git a/dashboardv3/public/css/scss/namespace.scss b/dashboardv3/public/css/scss/business-metadata.scss
similarity index 88%
rename from dashboardv3/public/css/scss/namespace.scss
rename to dashboardv3/public/css/scss/business-metadata.scss
index 4b5125c..a521a4b 100644
--- a/dashboardv3/public/css/scss/namespace.scss
+++ b/dashboardv3/public/css/scss/business-metadata.scss
@@ -15,15 +15,15 @@
// limitations under the License.
-/* namespace */
-.namespace-tree-parent {
+/* business-metadata */
+.business-metadata-tree-parent {
padding: 0px;
>li:first-child {
font-weight: 600;
}
- .namespace-tree-child {
+ .business-metadata-tree-child {
&.entity-detail-table table {
td {
&:nth-child(1) {
@@ -40,7 +40,7 @@
}
}
-.namespace-options.dropdown {
+.business-metadata-options.dropdown {
.dropdown-menu {
min-width: 100px;
@@ -59,7 +59,7 @@
}
}
-.namespace-options.dropdown.open {
+.business-metadata-options.dropdown.open {
.btn-action {
background-color: $color_jungle_green_approx;
border: 1px solid $color_jungle_green_approx;
@@ -67,7 +67,7 @@
}
}
-.namespace-details {
+.business-metadata-details {
.expandable .attr-details {
max-height: 300px;
@@ -78,7 +78,7 @@
}
.tab-pane {
- .namespace-attr-page {
+ .business-metadata-attr-page {
position: absolute;
top: 0px;
left: 0px;
@@ -89,7 +89,7 @@
}
}
-.namespace-attr-page {
+.business-metadata-attr-page {
.form-horizontal {
padding: 10px 22px;
// border: 1px solid #DEDEDE;
@@ -108,21 +108,21 @@
padding-right: 10px;
}
- .namespace-attr {
+ .business-metadata-attr {
border: 1px solid #DEDEDE;
padding: 10px 20px
}
}
}
-.namespace-attr-fontLoader {
+.business-metadata-attr-fontLoader {
position: absolute;
top: 50%;
left: 50%;
display: none;
}
-.namespace-attr-tableOverlay {
+.business-metadata-attr-tableOverlay {
position: absolute;
width: 100%;
height: 100%;
@@ -132,7 +132,7 @@
opacity: 0.2;
}
-.name-space-details {
+.business-metadata-details {
.backgrid {
td.expandable-content {
max-width: none;
@@ -152,7 +152,7 @@
}
}
-.namespace-attr-page {
+.business-metadata-attr-page {
.modal-footer {
text-align: center;
}
diff --git a/dashboardv3/public/css/scss/style.scss b/dashboardv3/public/css/scss/style.scss
index fd84b25..32640ec 100644
--- a/dashboardv3/public/css/scss/style.scss
+++ b/dashboardv3/public/css/scss/style.scss
@@ -34,7 +34,7 @@
@import "profile-table.scss";
@import "glossary.scss";
@import "wizard.scss";
-@import "namespace.scss";
+@import "business-metadata.scss";
@import "stats.scss";
@import "override.scss";
@import "leftsidebar.scss"
\ No newline at end of file
diff --git a/dashboardv3/public/js/collection/BaseCollection.js b/dashboardv3/public/js/collection/BaseCollection.js
index 5413f40..0c9e912 100644
--- a/dashboardv3/public/js/collection/BaseCollection.js
+++ b/dashboardv3/public/js/collection/BaseCollection.js
@@ -129,6 +129,9 @@ define(['require',
nonCrudOperation: function(url, requestMethod, options) {
var that = this;
options['beforeSend'] = CommonViewFunction.addRestCsrfCustomHeader;
+ if (options.data && typeof options.data === "object") {
+ options.data = JSON.stringify(options.data);
+ }
return Backbone.sync.call(this, null, this, _.extend({
url: url,
type: requestMethod
diff --git a/dashboardv3/public/js/main.js b/dashboardv3/public/js/main.js
index b83bcc3..96ef7ae 100644
--- a/dashboardv3/public/js/main.js
+++ b/dashboardv3/public/js/main.js
@@ -219,10 +219,10 @@ require(['App',
this.metricCollection = new VTagList();
this.metricCollection.url = UrlLinks.metricsApiUrl();
this.metricCollection.modelAttrName = "data";
- // nameSpace
- this.nameSpaceCollection = new VEntityList();
- this.nameSpaceCollection.url = UrlLinks.nameSpaceApiUrl();
- this.nameSpaceCollection.modelAttrName = "namespaceDefs";
+ // businessMetadata
+ this.businessMetadataDefCollection = new VEntityList();
+ this.businessMetadataDefCollection.url = UrlLinks.businessMetadataDefApiUrl();
+ this.businessMetadataDefCollection.modelAttrName = "businessMetadataDefs";
App.appRouter = new Router({
entityDefCollection: this.entityDefCollection,
@@ -230,7 +230,7 @@ require(['App',
enumDefCollection: this.enumDefCollection,
classificationDefCollection: this.classificationDefCollection,
metricCollection: this.metricCollection,
- nameSpaceCollection: this.nameSpaceCollection
+ businessMetadataDefCollection: this.businessMetadataDefCollection
});
var startApp = function() {
@@ -318,12 +318,12 @@ require(['App',
}
});
- this.nameSpaceCollection.fetch({
+ this.businessMetadataDefCollection.fetch({
complete: function() {
- that.nameSpaceCollection.fullCollection.comparator = function(model) {
+ that.businessMetadataDefCollection.fullCollection.comparator = function(model) {
return model.get('name').toLowerCase();
};
- that.nameSpaceCollection.fullCollection.sort({ silent: true });
+ that.businessMetadataDefCollection.fullCollection.sort({ silent: true });
--that.asyncFetchCounter;
startApp();
}
diff --git a/dashboardv3/public/js/models/BaseModel.js b/dashboardv3/public/js/models/BaseModel.js
index 654b5f2..eaeb534 100644
--- a/dashboardv3/public/js/models/BaseModel.js
+++ b/dashboardv3/public/js/models/BaseModel.js
@@ -57,6 +57,9 @@ define(['require', 'utils/Utils', 'backbone', 'utils/CommonViewFunction'], funct
nonCrudOperation: function(url, requestMethod, options) {
var that = this;
options['beforeSend'] = CommonViewFunction.addRestCsrfCustomHeader;
+ if (options.data && typeof options.data === "object") {
+ options.data = JSON.stringify(options.data);
+ }
return Backbone.sync.call(this, null, this, _.extend({
url: url,
type: requestMethod
diff --git a/dashboardv3/public/js/models/VEntity.js b/dashboardv3/public/js/models/VEntity.js
index e9ea1f3..08ebfb1 100644
--- a/dashboardv3/public/js/models/VEntity.js
+++ b/dashboardv3/public/js/models/VEntity.js
@@ -96,20 +96,20 @@ define(['require',
}, options);
return this.constructor.nonCrudOperation.call(this, url, "POST", options);
},
- saveNameSpaceAttribute: function(options) {
- var url = UrlLinks.nameSpaceUpdateUrl();
+ saveBusinessMetadata: function(options) {
+ var url = UrlLinks.businessMetadataDefApiUrl();
options = _.extend({
contentType: 'application/json',
dataType: 'json'
}, options);
- return this.constructor.nonCrudOperation.call(this, url, 'PUT', options);
+ return this.constructor.nonCrudOperation.call(this, url, '', options);
},
- deleteNameSpace: function(options) {
- var url = UrlLinks.nameSpaceUpdateUrl(options.typeName);
+ deleteBusinessMetadata: function(options) {
+ var url = UrlLinks.businessMetadataDefApiUrl(options.typeName);
return this.constructor.nonCrudOperation.call(this, url, 'DELETE', options);
},
- saveNamespaceEntity: function(guid, options) {
- var url = UrlLinks.entitiesNamespaceApiUrl(guid);
+ saveBusinessMetadataEntity: function(guid, options) {
+ var url = UrlLinks.entitiesBusinessMetadataApiUrl(guid);
options = _.extend({
contentType: 'application/json',
dataType: 'json'
diff --git a/dashboardv3/public/js/router/Router.js b/dashboardv3/public/js/router/Router.js
index 20bb43f..7127c40 100644
--- a/dashboardv3/public/js/router/Router.js
+++ b/dashboardv3/public/js/router/Router.js
@@ -49,14 +49,14 @@ define([
"!/detailPage/:id": "detailPage",
//Audit table
'!/administrator': 'administrator',
- '!/administrator/namespace/:id': 'nameSpaceDetailPage',
+ '!/administrator/businessMetadata/:id': 'businessMetadataDetailPage',
// Default
"*actions": "defaultAction"
},
initialize: function(options) {
_.extend(
this,
- _.pick(options, "entityDefCollection", "typeHeaders", "enumDefCollection", "classificationDefCollection", "metricCollection", "nameSpaceCollection")
+ _.pick(options, "entityDefCollection", "typeHeaders", "enumDefCollection", "classificationDefCollection", "metricCollection", "businessMetadataDefCollection")
);
this.showRegions();
this.bindCommonEvents();
@@ -75,7 +75,7 @@ define([
classificationDefCollection: this.classificationDefCollection,
glossaryCollection: this.glossaryCollection,
metricCollection: this.metricCollection,
- nameSpaceCollection: this.nameSpaceCollection
+ businessMetadataDefCollection: this.businessMetadataDefCollection
};
this.sharedObj = {
searchTableColumns: {},
@@ -486,7 +486,7 @@ define([
var that = this;
require(["views/site/Header", "views/site/SideNavLayoutView", 'views/administrator/AdministratorLayoutView'], function(Header, SideNavLayoutView, AdministratorLayoutView) {
var value = Utils.getUrlState.getQueryParams(),
- paramObj = _.extend({ value: value, namespaceID: null }, that.preFetchedCollectionLists);
+ paramObj = _.extend({ value: value, guid: null }, that.preFetchedCollectionLists);
that.renderViewIfNotExists(that.getHeaderOptions(Header));
that.renderViewIfNotExists({
view: App.rSideNav,
@@ -502,13 +502,13 @@ define([
App.rContent.show(new AdministratorLayoutView(paramObj));
});
},
- nameSpaceDetailPage: function(namespaceGuid) {
+ businessMetadataDetailPage: function(guid) {
var that = this;
- require(["views/site/Header", "views/site/SideNavLayoutView", "views/name_space/NameSpaceContainerLayoutView", ], function(Header, SideNavLayoutView, NameSpaceContainerLayoutView) {
+ require(["views/site/Header", "views/site/SideNavLayoutView", "views/business_metadata/BusinessMetadataContainerLayoutView", ], function(Header, SideNavLayoutView, BusinessMetadataContainerLayoutView) {
var paramObj = Utils.getUrlState.getQueryParams();
that.renderViewIfNotExists(that.getHeaderOptions(Header));
var options = _.extend({
- namespaceID: namespaceGuid,
+ guid: guid,
value: paramObj,
searchVent: that.searchVent,
categoryEvent: that.categoryEvent
@@ -525,7 +525,7 @@ define([
return new SideNavLayoutView(options);
}
});
- App.rContent.show(new NameSpaceContainerLayoutView(options));
+ App.rContent.show(new BusinessMetadataContainerLayoutView(options));
});
},
defaultAction: function(actions) {
diff --git a/dashboardv3/public/js/templates/administrator/AdministratorLayoutView_tmpl.html b/dashboardv3/public/js/templates/administrator/AdministratorLayoutView_tmpl.html
index ddc55f3..cc6279a 100644
--- a/dashboardv3/public/js/templates/administrator/AdministratorLayoutView_tmpl.html
+++ b/dashboardv3/public/js/templates/administrator/AdministratorLayoutView_tmpl.html
@@ -20,15 +20,15 @@
</div> -->
<div class="col-sm-12 default-tab">
<ul class="nav nav-tabs" data-id="tab-list">
- <li role="namespace" class="tab active"><a href="#tab-namespace" aria-controls="tab-namespace" role="tab" data-toggle="tab">Namespaces</a></li>
+ <li role="businessMetadata" class="tab active"><a href="#tab-businessMetadata" aria-controls="tab-businessMetadata" role="tab" data-toggle="tab">Business Metadata</a></li>
<li role="enum"><a href="#tab-enum" aria-controls="tab-enum" role="tab" data-toggle="tab">Enumerations</a></li>
</ul>
</div>
</div>
<div>
<div class="tab-content purge-details">
- <div id="tab-namespace" role="namespace" class="tab-pane active animated fadeIn">
- <div id="r_namespaceTableLayoutView">
+ <div id="tab-businessMetadata" role="businessMetadata" class="tab-pane active animated fadeIn">
+ <div id="r_businessMetadataTableLayoutView">
</div>
</div>
<div id="tab-enum" role="enum" class="tab-pane animated fadeIn">
diff --git a/dashboardv3/public/js/templates/name_space/NameSpaceAttrTableLayoutView_tmpl.html b/dashboardv3/public/js/templates/business_metadata/BusinessMetadataAttrTableLayoutView_tmpl.html
similarity index 66%
rename from dashboardv3/public/js/templates/name_space/NameSpaceAttrTableLayoutView_tmpl.html
rename to dashboardv3/public/js/templates/business_metadata/BusinessMetadataAttrTableLayoutView_tmpl.html
index c36195c..98f30a3 100644
--- a/dashboardv3/public/js/templates/name_space/NameSpaceAttrTableLayoutView_tmpl.html
+++ b/dashboardv3/public/js/templates/business_metadata/BusinessMetadataAttrTableLayoutView_tmpl.html
@@ -14,34 +14,34 @@
* See the License for the specific language governing permissions and
* limitations under the License.
-->
-<div class="namespace-attr-page" data-id="namespaceAttrPage">
- <div class="namespace-attr-tableOverlay"></div>
- <div class=" modal-header" data-id="namespaceAttrPageHeader">
- <h4 class="modal-title" data-id="namespaceAttrPageTitle"></h4>
+<div class="business-metadata-attr-page" data-id="businessMetadataAttrPage">
+ <div class="business-metadata-attr-tableOverlay"></div>
+ <div class=" modal-header" data-id="businessMetadataAttrPageHeader">
+ <h4 class="modal-title" data-id="businessMetadataAttrPageTitle"></h4>
</div>
<div id="r_modal">
</div>
- <div class="namespace-attr-fontLoader">
+ <div class="business-metadata-attr-fontLoader">
<i class="fa fa-refresh fa-spin-custom"></i>
</div>
<!-- <div class="modal-footer " data-id="modalFooter">
- <button type="button" class="btn btn-action cancel" data-id="namespaceAttrPageCancle">Cancel</button>
- <button type="button" class="btn btn-atlas ok" data-id="namespaceAttrPageOk">Ok</button>
+ <button type="button" class="btn btn-action cancel" data-id="businessMetadataAttrPageCancle">Cancel</button>
+ <button type="button" class="btn btn-atlas ok" data-id="businessMetadataAttrPageOk">Ok</button>
</div> -->
</div>
-<div class="namespace-details" data-id="namespaceDetailPage">
+<div class="business-metadata-details" data-id="businessMetadataDetailPage">
<div class="position-relative">
<div class="pull-right inline-content-fr no-padding-left">
<div class="inline" data-id="colManager"></div>
<div class="inline">
- <button type="button" data-id="addAttribute" title="Create Namespace" class="btn btn-action btn-sm pull-right btn-loader" style="margin-bottom: 10px;" data-action="createNamespace">
+ <button type="button" data-id="addAttribute" title="Create Business Metadata Attribute" class="btn btn-action btn-sm pull-right btn-loader" style="margin-bottom: 10px;" data-action="createBusinessMetadata">
<i class='fa fa-plus'></i> Attributes
</button></div>
</div>
<div class="tableOverlay"></div>
<div class='attr-filter-overlay hide'></div>
- <div class="auditTable name-space-details">
- <div id="r_nameSpaceAttrTableLayoutView"></div>
+ <div class="auditTable business-metadata-details">
+ <div id="r_businessMetadataAttrTableLayoutView"></div>
</div>
</div>
</div>
\ No newline at end of file
diff --git a/dashboardv3/public/js/templates/name_space/NameSpaceAttributeItemView_tmpl.html b/dashboardv3/public/js/templates/business_metadata/BusinessMetadataAttributeItemView_tmpl.html
similarity index 96%
rename from dashboardv3/public/js/templates/name_space/NameSpaceAttributeItemView_tmpl.html
rename to dashboardv3/public/js/templates/business_metadata/BusinessMetadataAttributeItemView_tmpl.html
index f374ec4..2c3f57c 100644
--- a/dashboardv3/public/js/templates/name_space/NameSpaceAttributeItemView_tmpl.html
+++ b/dashboardv3/public/js/templates/business_metadata/BusinessMetadataAttributeItemView_tmpl.html
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
-->
-<div id="{{modalID}}" class="form-group clearfix namespace-attr">
+<div id="{{modalID}}" class="form-group clearfix business-metadata-attr">
<div class="form-group">
<div class="col-sm-12 attributePlusData " align="right">
<button type="button" class="btn btn-danger btn-sm closeInput" data-id="close"><i class="fa fa-times"></i></button>
@@ -79,7 +79,7 @@
</div>
</div>
</div>
- <div class="form-group entity-namespace-selector">
+ <div class="form-group entity-businessMetadata-selector">
<label class="control-label col-sm-3" for="name">Applicable Types</label>
<div class="col-sm-8">
<select class="form-control entityTypeSelector" data-id="entityTypeSelector" multiple="multiple">
diff --git a/dashboardv3/public/js/templates/name_space/NameSpaceContainerLayoutView_tmpl.html b/dashboardv3/public/js/templates/business_metadata/BusinessMetadataContainerLayoutView_tmpl.html
similarity index 83%
rename from dashboardv3/public/js/templates/name_space/NameSpaceContainerLayoutView_tmpl.html
rename to dashboardv3/public/js/templates/business_metadata/BusinessMetadataContainerLayoutView_tmpl.html
index 7aaed9a..72b5c2f 100644
--- a/dashboardv3/public/js/templates/name_space/NameSpaceContainerLayoutView_tmpl.html
+++ b/dashboardv3/public/js/templates/business_metadata/BusinessMetadataContainerLayoutView_tmpl.html
@@ -15,6 +15,6 @@
* limitations under the License.
-->
<div>
- <div id="r_nameSpaceDetailContainer" class="sidebar-fixed-filter"></div>
- <div id="r_nameSpaceAttrContainer" class="col-sm-12"></div>
+ <div id="r_businessMetadataDetailContainer" class="sidebar-fixed-filter"></div>
+ <div id="r_businessMetadataAttrContainer" class="col-sm-12"></div>
</div>
\ No newline at end of file
diff --git a/dashboardv3/public/js/templates/name_space/NameSpaceDetailLayoutView_tmpl.html b/dashboardv3/public/js/templates/business_metadata/BusinessMetadataDetailLayoutView_tmpl.html
similarity index 100%
rename from dashboardv3/public/js/templates/name_space/NameSpaceDetailLayoutView_tmpl.html
rename to dashboardv3/public/js/templates/business_metadata/BusinessMetadataDetailLayoutView_tmpl.html
diff --git a/dashboardv3/public/js/templates/name_space/NameSpaceTableLayoutView_tmpl.html b/dashboardv3/public/js/templates/business_metadata/BusinessMetadataTableLayoutView_tmpl.html
similarity index 58%
rename from dashboardv3/public/js/templates/name_space/NameSpaceTableLayoutView_tmpl.html
rename to dashboardv3/public/js/templates/business_metadata/BusinessMetadataTableLayoutView_tmpl.html
index c30d90d..154d5b8 100644
--- a/dashboardv3/public/js/templates/name_space/NameSpaceTableLayoutView_tmpl.html
+++ b/dashboardv3/public/js/templates/business_metadata/BusinessMetadataTableLayoutView_tmpl.html
@@ -14,34 +14,34 @@
* See the License for the specific language governing permissions and
* limitations under the License.
-->
-<div class="namespace-attr-page" data-id="namespaceAttrPage">
- <div class="namespace-attr-tableOverlay"></div>
- <div class=" modal-header" data-id="namespaceAttrPageHeader">
- <h4 class="modal-title" data-id="namespaceAttrPageTitle"></h4>
+<div class="business-metadata-attr-page" data-id="businessMetadataAttrPage">
+ <div class="business-metadata-attr-tableOverlay"></div>
+ <div class=" modal-header" data-id="businessMetadataAttrPageHeader">
+ <h4 class="modal-title" data-id="businessMetadataAttrPageTitle"></h4>
</div>
<div id="r_modal">
</div>
- <div class="namespace-attr-fontLoader">
+ <div class="business-metadata-attr-fontLoader">
<i class="fa fa-refresh fa-spin-custom"></i>
</div>
-<!-- <div class="modal-footer " data-id="modalFooter">
- <button type="button" class="btn btn-action cancel" data-id="namespaceAttrPageCancle">Cancel</button>
- <button type="button" class="btn btn-atlas ok" data-id="namespaceAttrPageOk">Ok</button>
+ <!-- <div class="modal-footer " data-id="modalFooter">
+ <button type="button" class="btn btn-action cancel" data-id="businessMetadataAttrPageCancle">Cancel</button>
+ <button type="button" class="btn btn-atlas ok" data-id="businessMetadataAttrPageOk">Ok</button>
</div> -->
</div>
-<div class="namespace-details" data-id="namespaceDetailPage">
+<div class="business-metadata-details" data-id="businessMetadataDetailPage">
<div class="position-relative">
<div class="pull-right inline-content-fr no-padding-left">
<div class="inline" data-id="colManager"></div>
<div class="inline">
- <button type="button" data-id="createNameSpace" title="Create Namespace" class="btn btn-action btn-sm pull-right btn-loader" style="margin-bottom: 10px;" data-action="createNamespace">
- <i class='fa fa-plus'></i> Create Namespace
+ <button type="button" data-id="createBusinessMetadata" title="Create Business Metadata" class="btn btn-action btn-sm pull-right btn-loader" style="margin-bottom: 10px;" data-action="createBusinessMetadata">
+ <i class='fa fa-plus'></i> Create Business Metadata
</button></div>
</div>
<div class="tableOverlay"></div>
<div class='attr-filter-overlay hide'></div>
- <div class="auditTable name-space-details">
- <div id="r_nameSpaceTableLayoutView"></div>
+ <div class="auditTable business-metadata-details">
+ <div id="r_businessMetadataTableLayoutView"></div>
</div>
</div>
</div>
\ No newline at end of file
diff --git a/dashboardv3/public/js/templates/name_space/CreateNameSpaceLayoutView_tmpl.html b/dashboardv3/public/js/templates/business_metadata/CreateBusinessMetadataLayoutView_tmpl.html
similarity index 77%
rename from dashboardv3/public/js/templates/name_space/CreateNameSpaceLayoutView_tmpl.html
rename to dashboardv3/public/js/templates/business_metadata/CreateBusinessMetadataLayoutView_tmpl.html
index acf3b23..b84c1f1 100644
--- a/dashboardv3/public/js/templates/name_space/CreateNameSpaceLayoutView_tmpl.html
+++ b/dashboardv3/public/js/templates/business_metadata/CreateBusinessMetadataLayoutView_tmpl.html
@@ -17,13 +17,13 @@
<div class="fontLoader">
<i class="fa fa-refresh fa-spin-custom"></i>
</div>
-<form name="tagDefinitionform" class="hide form-horizontal" data-id="createTagForm" style="width: 70%;margin: 0 auto;">
+<form class="hide form-horizontal" data-id="createForm" style="width: 70%;margin: 0 auto;">
{{#if fromTable}}
<div class="form-group">
<label class="control-label col-sm-2 {{#if create}}required{{/if}}" for="name">Name</label>
{{#if create}}
<div class="col-sm-10">
- <input class="form-control namespace-name" data-id="tagName" placeholder="Name(required)" autofocus />
+ <input class="form-control businessMetadata-name" data-id="name" placeholder="Name(required)" autofocus />
</div>
{{else}}
<span class="ellipsis-with-margin control-label text-left col-sm-10" data-id="title"></span> {{/if}}
@@ -39,7 +39,7 @@
<!-- <h4 class="col-sm-6">Attributes</h4> -->
{{#if isEditAttr}}
<div class="col-sm-12 no-padding-left">
- <button title="Add Namespace attribute" type="button" class="btn btn-action btn-sm pull-left" data-id="attributeData"><i class="fa fa-plus"></i> Add Namespace attribute</button>
+ <button title="Add Business Metadata attribute" type="button" class="btn btn-action btn-sm pull-left" data-id="attributeData"><i class="fa fa-plus"></i> Add Business Metadata attribute</button>
</div>
{{/if}}
</div>
@@ -48,6 +48,6 @@
</div>
</form>
<div class="modal-footer " data-id="modalFooter">
- <button type="button" class="btn btn-action cancel" data-id="namespaceAttrPageCancle">Cancel</button>
- <button type="button" class="btn btn-atlas ok" data-id="namespaceAttrPageOk">Ok</button>
+ <button type="button" class="btn btn-action cancel" data-id="businessMetadataAttrPageCancle">Cancel</button>
+ <button type="button" class="btn btn-atlas ok" data-id="businessMetadataAttrPageOk">Ok</button>
</div>
\ No newline at end of file
diff --git a/dashboardv3/public/js/templates/name_space/EnumCreateUpdateItemView_tmpl.html b/dashboardv3/public/js/templates/business_metadata/EnumCreateUpdateItemView_tmpl.html
similarity index 100%
rename from dashboardv3/public/js/templates/name_space/EnumCreateUpdateItemView_tmpl.html
rename to dashboardv3/public/js/templates/business_metadata/EnumCreateUpdateItemView_tmpl.html
diff --git a/dashboardv3/public/js/templates/detail_page/DetailPageLayoutView_tmpl.html b/dashboardv3/public/js/templates/detail_page/DetailPageLayoutView_tmpl.html
index 94518a1..b68ae9e 100644
--- a/dashboardv3/public/js/templates/detail_page/DetailPageLayoutView_tmpl.html
+++ b/dashboardv3/public/js/templates/detail_page/DetailPageLayoutView_tmpl.html
@@ -83,7 +83,7 @@
</div>
</div>
<div id="r_entityLabelDefineView"></div>
- <div id="r_entityNameSpaceView"></div>
+ <div id="r_entityBusinessMetadataView"></div>
</div>
</div>
</div>
diff --git a/dashboardv3/public/js/templates/entity/EntityNameSpaceItemView_tmpl.html b/dashboardv3/public/js/templates/entity/EntityBusinessMetaDataItemView_tmpl.html
similarity index 84%
rename from dashboardv3/public/js/templates/entity/EntityNameSpaceItemView_tmpl.html
rename to dashboardv3/public/js/templates/entity/EntityBusinessMetaDataItemView_tmpl.html
index afbf46f..3338fd5 100644
--- a/dashboardv3/public/js/templates/entity/EntityNameSpaceItemView_tmpl.html
+++ b/dashboardv3/public/js/templates/entity/EntityBusinessMetaDataItemView_tmpl.html
@@ -18,7 +18,7 @@
<table class="custom-table" style="font-weight: 100;">
<tr class="custom-tr">
<td class="custom-col-1">
- {{{callmyfunction getNamespaceDroupdown nameSpaceCollection}}}
+ {{{callmyfunction getBusinessMetadataDroupdown businessMetadataCollection}}}
</td>
<td class="custom-col-0"> : </td>
<td class="custom-col-1" data-id="value">
@@ -36,9 +36,9 @@
</table>
{{else}}
<hr />
-<ul class="namespace-tree-parent">
- <li>{{model.__internal_UI_nameSpaceName}}</li>
- <li class="namespace-tree-child" data-id="namespaceTreeChild">
+<ul class="business-metadata-tree-parent">
+ <li>{{model.__internal_UI_businessMetadataName}}</li>
+ <li class="business-metadata-tree-child" data-id="businessMetadataTreeChild">
</li>
</ul>
{{/ifCond}}
\ No newline at end of file
diff --git a/dashboardv3/public/js/templates/entity/EntityNameSpaceView_tmpl.html b/dashboardv3/public/js/templates/entity/EntityBusinessMetaDataView_tmpl.html
similarity index 75%
rename from dashboardv3/public/js/templates/entity/EntityNameSpaceView_tmpl.html
rename to dashboardv3/public/js/templates/entity/EntityBusinessMetaDataView_tmpl.html
index f4a9df3..0e4c2aa 100644
--- a/dashboardv3/public/js/templates/entity/EntityNameSpaceView_tmpl.html
+++ b/dashboardv3/public/js/templates/entity/EntityBusinessMetaDataView_tmpl.html
@@ -14,28 +14,28 @@
* See the License for the specific language governing permissions and
* limitations under the License.
-->
-<div class="panel panel-default custom-panel expand_collapse_panel-icon" data-id="namespace">
- <div class="panel-heading" data-toggle="collapse" href="#namespaceCollapse" aria-expanded="false" style="width: 70%;">
+<div class="panel panel-default custom-panel expand_collapse_panel-icon">
+ <div class="panel-heading" data-toggle="collapse" href="#businessMetadataCollapse" aria-expanded="false" style="width: 70%;">
<h4 class="panel-title">
- <a>Namespaces</a>
+ <a>Business Metadata</a>
</h4>
<div class="btn-group pull-left">
<button type="button" title="Collapse"><i class="ec-icon fa"></i></button>
</div>
</div>
<div class="panel-actions">
- <button class="btn btn-action btn-sm" data-id="addNameSpace">Add</button>
- <button class="btn btn-action btn-sm" style="display: none;" data-id="saveNameSpace">Save</button>
+ <button class="btn btn-action btn-sm" data-id="addBusinessMetadata">Add</button>
+ <button class="btn btn-action btn-sm" style="display: none;" data-id="saveBusinessMetadata">Save</button>
<button class="btn btn-action btn-sm" style="display: none;" data-id="cancel">Cancel</button>
</div>
- <div id="namespaceCollapse" class="panel-collapse collapse">
+ <div id="businessMetadataCollapse" class="panel-collapse collapse">
<div class="panel-body">
- <div data-id="namespaceTree"></div>
+ <div data-id="businessMetadataTree"></div>
<div class="editBox" style="display: none;">
<div class="form-group">
<a href="javascript:void(0)" class="btn btn-action btn-sm" data-id="addItem" data-type="addAttrButton">Add New Attribute</a>
</div>
- <ul class="namespace-tree-parent" data-id="itemView"></ul>
+ <ul class="business-metadata-tree-parent" data-id="itemView"></ul>
</div>
</div>
</div>
diff --git a/dashboardv3/public/js/templates/search/SearchFilterBrowseLayoutView_tmpl.html b/dashboardv3/public/js/templates/search/SearchFilterBrowseLayoutView_tmpl.html
index dc0f4c5..9ca3455 100644
--- a/dashboardv3/public/js/templates/search/SearchFilterBrowseLayoutView_tmpl.html
+++ b/dashboardv3/public/js/templates/search/SearchFilterBrowseLayoutView_tmpl.html
@@ -39,7 +39,7 @@
<div data-id="r_classificationTreeRender"></div>
</div>
<div class="col-sm-12">
- <div data-id="r_nameSpaceTreeRender"></div>
+ <div data-id="r_businessMetadataTreeRender"></div>
</div>
<div class="col-sm-12">
<div data-id="r_glossaryTreeRender"></div>
diff --git a/dashboardv3/public/js/templates/search/tree/NameSpaceTreeLayoutView_tmpl.html b/dashboardv3/public/js/templates/search/tree/BusinessMetadataTreeLayoutView_tmpl.html
similarity index 54%
rename from dashboardv3/public/js/templates/search/tree/NameSpaceTreeLayoutView_tmpl.html
rename to dashboardv3/public/js/templates/search/tree/BusinessMetadataTreeLayoutView_tmpl.html
index 52eca04..9fb47b9 100644
--- a/dashboardv3/public/js/templates/search/tree/NameSpaceTreeLayoutView_tmpl.html
+++ b/dashboardv3/public/js/templates/search/tree/BusinessMetadataTreeLayoutView_tmpl.html
@@ -15,31 +15,21 @@
* limitations under the License.
-->
<div class="panel panel-default expand_collapse_panel-icon right-icons">
- <div class="panel-heading dash-button-icon clearfix" data-toggle="collapse" aria-expanded="true" href="#c_namespace">
+ <div class="panel-heading dash-button-icon clearfix" data-toggle="collapse" aria-expanded="true" href="#businessMetadataTree">
<i class="ec-icon fa"></i>
- <h4 class="panel-title">Namespaces</h4>
+ <h4 class="panel-title">Business Metadata</h4>
<div class="btn-group pull-right">
- <button type="button" class="typeRefresh drop-down-menu-view" data-id="refreshTree" data-type="classification" title="Refresh">
+ <button type="button" class="typeRefresh drop-down-menu-view" data-id="refreshTree" title="Refresh">
<i class="fa fa-refresh"></i>
</button>
- <button type="button" class="typeRefresh drop-down-menu-view" data-id="createNameSpace" data-type="classification" title="Open Namespaces">
+ <button type="button" class="typeRefresh drop-down-menu-view" data-id="createBusinessMetadata" title="Open Business Metadata">
<i class="fa fa-external-link"></i>
</button>
- <!-- <button type="button" class="typeRefresh dropdown">
- <div class=" btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
- <i class="fa fa-ellipsis-v"></i>
- </div>
- <ul class="dropdown-menu" aria-labelledby="dropdownMenuButton">
- <li data-id="groupOrFlatTreeView" data-type="classification"> <i class="fa fa-list-ul"></i><span>Show flat tree</span>
- </li>
- <li data-id="createNameSpace" data-type="classification"> <i class="fa fa-plus"></i><span>Create Namespace</span>
- </li>
- </button> -->
</ul>
</button>
</div>
</div>
- <div id="c_namespace" class="panel-collapse collapse jstree-with-action in">
- <div data-id="nameSpaceSearchTree"></div>
+ <div id="businessMetadataTree" class="panel-collapse collapse jstree-with-action in">
+ <div data-id="businessMetadataSearchTree"></div>
</div>
</div>
\ No newline at end of file
diff --git a/dashboardv3/public/js/utils/UrlLinks.js b/dashboardv3/public/js/utils/UrlLinks.js
index 2bbe679..95ca065 100644
--- a/dashboardv3/public/js/utils/UrlLinks.js
+++ b/dashboardv3/public/js/utils/UrlLinks.js
@@ -37,6 +37,9 @@ define(['require', 'utils/Enums', 'utils/Utils', 'underscore'], function(require
classificationDefApiUrl: function(name) {
return this.getDefApiUrl('classification', name);
},
+ businessMetadataDefApiUrl: function(name) {
+ return this.getDefApiUrl('business_metadata', name);
+ },
enumDefApiUrl: function(name) {
return this.getDefApiUrl('enum', name);
},
@@ -99,9 +102,9 @@ define(['require', 'utils/Enums', 'utils/Utils', 'underscore'], function(require
return this.baseUrlV2 + '/entity/bulk/classification';
}
},
- entitiesNamespaceApiUrl: function(guid) {
+ entitiesBusinessMetadataApiUrl: function(guid) {
if (guid) {
- return this.baseUrlV2 + '/entity/guid/' + guid + '/namespaces?isOverwrite=true';
+ return this.baseUrlV2 + '/entity/guid/' + guid + '/businessmetata?isOverwrite=true';
}
},
entityCollectionaudit: function(guid) {
@@ -130,14 +133,6 @@ define(['require', 'utils/Enums', 'utils/Utils', 'underscore'], function(require
}
return url;
},
- classicationApiUrl: function(name, guid) {
- var typeUrl = this.typedefsUrl();
- if (name) {
- return typeUrl.def + '/name/' + name + '?type=classification';
- } else if (guid) {
- return typeUrl.def + '/guid/' + guid + '?type=classification';
- }
- },
typesApiUrl: function() {
return this.typedefsUrl().defs + '/headers?excludeInternalTypesAndReferences=true'
},
@@ -234,24 +229,6 @@ define(['require', 'utils/Enums', 'utils/Utils', 'underscore'], function(require
},
purgeApiUrl: function() {
return this.baseUrl + '/admin/audit';
- },
- nameSpaceApiUrl: function() {
- return this.typedefsUrl().defs + '?type=namespace';
- },
- nameSpaceGuidApiUrl: function(guid) {
- var lineageUrl = this.baseUrlV2 + '/types/namespacedef/guid';
- if (guid) {
- return lineageUrl + '/' + guid;
- } else {
- return lineageUrl
- }
- },
- nameSpaceUpdateUrl: function(name) {
- if (name) {
- return this.typedefsUrl().def + '/name/' + name;
- } else {
- return this.typedefsUrl().defs + '?type=namespace';
- }
}
});
diff --git a/dashboardv3/public/js/utils/Utils.js b/dashboardv3/public/js/utils/Utils.js
index bd3d6bf..bb33102 100644
--- a/dashboardv3/public/js/utils/Utils.js
+++ b/dashboardv3/public/js/utils/Utils.js
@@ -567,7 +567,7 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums',
urlPath = "tagUrl";
} else if (queryParams.from == "glossary") {
urlPath = "glossaryUrl";
- } else if (queryParams.from == "namespace") {
+ } else if (queryParams.from == "bm") {
urlPath = "administratorUrl";
}
}
diff --git a/dashboardv3/public/js/views/administrator/AdministratorLayoutView.js b/dashboardv3/public/js/views/administrator/AdministratorLayoutView.js
index f0633c1..78d7cd1 100644
--- a/dashboardv3/public/js/views/administrator/AdministratorLayoutView.js
+++ b/dashboardv3/public/js/views/administrator/AdministratorLayoutView.js
@@ -37,7 +37,7 @@ define(['require',
/** Layout sub regions */
regions: {
- RNamespaceTableLayoutView: "#r_namespaceTableLayoutView",
+ RBusinessMetadataTableLayoutView: "#r_businessMetadataTableLayoutView",
REnumTableLayoutView: '#r_enumTableLayoutView'
},
@@ -67,7 +67,7 @@ define(['require',
* @constructs
*/
initialize: function(options) {
- _.extend(this, _.pick(options, 'value', 'guid', 'entity', 'entityName', 'attributeDefs', 'entityDefCollection', 'nameSpaceCollection', 'enumDefCollection'));
+ _.extend(this, _.pick(options, 'value', 'guid', 'entityDefCollection', 'businessMetadataDefCollection', 'enumDefCollection'));
},
onShow: function() {
@@ -81,21 +81,21 @@ define(['require',
this.renderEnumLayoutView();
},
onRender: function() {
- this.renderNameSpaceLayoutView();
+ this.renderBusinessMetadataLayoutView();
this.bindEvents();
},
- renderNameSpaceLayoutView: function(obj) {
+ renderBusinessMetadataLayoutView: function(obj) {
var that = this;
- require(['views/name_space/NameSpaceTableLayoutView'], function(NameSpaceTableLayoutView) {
- that.RNamespaceTableLayoutView.show(new NameSpaceTableLayoutView({ nameSpaceCollection: that.nameSpaceCollection, entityDefCollection: that.entityDefCollection }));
+ require(['views/business_metadata/BusinessMetadataTableLayoutView'], function(BusinessMetadataTableLayoutView) {
+ that.RBusinessMetadataTableLayoutView.show(new BusinessMetadataTableLayoutView({ businessMetadataDefCollection: that.businessMetadataDefCollection, entityDefCollection: that.entityDefCollection }));
});
},
renderEnumLayoutView: function(obj) {
var that = this;
- require(["views/name_space/EnumCreateUpdateItemView"], function(EnumCreateUpdateItemView) {
+ require(["views/business_metadata/EnumCreateUpdateItemView"], function(EnumCreateUpdateItemView) {
var view = new EnumCreateUpdateItemView({
enumDefCollection: that.enumDefCollection,
- nameSpaceCollection: that.nameSpaceCollection
+ businessMetadataDefCollection: that.businessMetadataDefCollection
});
that.REnumTableLayoutView.show(view);
});
diff --git a/dashboardv3/public/js/views/name_space/NameSpaceAttrTableLayoutView.js b/dashboardv3/public/js/views/business_metadata/BusinessMetadataAttrTableLayoutView.js
similarity index 60%
rename from dashboardv3/public/js/views/name_space/NameSpaceAttrTableLayoutView.js
rename to dashboardv3/public/js/views/business_metadata/BusinessMetadataAttrTableLayoutView.js
index b60cc39..173d76f 100644
--- a/dashboardv3/public/js/views/name_space/NameSpaceAttrTableLayoutView.js
+++ b/dashboardv3/public/js/views/business_metadata/BusinessMetadataAttrTableLayoutView.js
@@ -18,28 +18,21 @@
define(['require',
'backbone',
- 'hbs!tmpl/name_space/NameSpaceAttrTableLayoutView_tmpl',
- 'collection/VEntityList',
- 'collection/VTagList',
- 'models/VSearch',
- 'utils/Utils',
- 'utils/Messages',
- 'utils/Enums',
- 'utils/UrlLinks',
- 'utils/CommonViewFunction'
-], function(require, Backbone, NameSpaceAttrTableLayoutView_tmpl, VEntityList, VTagList, VSearch, Utils, Messages, Enums, UrlLinks, CommonViewFunction) {
+ 'hbs!tmpl/business_metadata/BusinessMetadataAttrTableLayoutView_tmpl',
+ 'collection/VEntityList'
+], function(require, Backbone, BusinessMetadataAttrTableLayoutView_tmpl, VEntityList) {
'use strict';
- var NameSpaceAttrTableLayoutView = Backbone.Marionette.LayoutView.extend(
- /** @lends NameSpaceAttrTableLayoutView */
+ var BusinessMetadataAttrTableLayoutView = Backbone.Marionette.LayoutView.extend(
+ /** @lends BusinessMetadataAttrTableLayoutView */
{
- _viewName: 'NameSpaceAttrTableLayoutView',
+ _viewName: 'BusinessMetadataAttrTableLayoutView',
- template: NameSpaceAttrTableLayoutView_tmpl,
+ template: BusinessMetadataAttrTableLayoutView_tmpl,
/** Layout sub regions */
regions: {
- RNameSpaceAttrTableLayoutView: "#r_nameSpaceAttrTableLayoutView",
+ RBusinessMetadataAttrTableLayoutView: "#r_businessMetadataAttrTableLayoutView",
RModal: "#r_modal"
},
@@ -47,9 +40,9 @@ define(['require',
ui: {
attributeEdit: "[data-id='attributeEdit']",
addAttribute: '[data-id="addAttribute"]',
- namespaceAttrPage: "[data-id='namespaceAttrPage']",
- namespaceAttrPageTitle: "[data-id='namespaceAttrPageTitle']",
- namespaceDetailPage: "[data-id='namespaceDetailPage']",
+ businessMetadataAttrPage: "[data-id='businessMetadataAttrPage']",
+ businessMetadataAttrPageTitle: "[data-id='businessMetadataAttrPageTitle']",
+ businessMetadataDetailPage: "[data-id='businessMetadataDetailPage']",
},
/** ui events hash */
events: function() {
@@ -59,13 +52,14 @@ define(['require',
return events;
},
/**
- * intialize a new NameSpaceAttrTableLayoutView Layout
+ * intialize a new BusinessMetadataAttrTableLayoutView Layout
* @constructs
*/
initialize: function(options) {
- _.extend(this, _.pick(options, 'guid', 'entity', 'entityName', 'attributeDefs', 'typeHeaders', 'nameSpaceCollection', 'nameSpaceAttr', 'entityDefCollection'));
+ _.extend(this, _.pick(options, 'guid', 'model', 'typeHeaders', 'businessMetadataDefCollection', 'entityDefCollection'));
+ this.businessMetadataAttr = new VEntityList(this.model.get("attributeDefs") || []);
this.commonTableOptions = {
- collection: this.nameSpaceAttr,
+ collection: this.businessMetadataAttr,
includeFilter: false,
includePagination: false,
includePageSize: false,
@@ -82,35 +76,31 @@ define(['require',
this.showDetails = true;
},
onRender: function() {
- this.toggleNamespaceDetailsAttrView();
- if (this.nameSpaceCollection.models.length && !this.model) {
- this.model = this.nameSpaceCollection.fullCollection.findWhere({ guid: this.guid });
- Utils.showTitleLoader(this.$('.page-title .fontLoader'), this.$('.tagDetail'));
- this.renderTableLayoutView();
- }
+ this.renderTableLayoutView();
+ this.toggleBusinessMetadataDetailsAttrView();
},
bindEvents: function() {},
- toggleNamespaceDetailsAttrView: function() {
+ toggleBusinessMetadataDetailsAttrView: function() {
var that = this;
if (that.showDetails) {
- that.ui.namespaceAttrPage.hide();
- that.ui.namespaceDetailPage.show();
+ that.ui.businessMetadataAttrPage.hide();
+ that.ui.businessMetadataDetailPage.show();
} else {
- that.ui.namespaceAttrPage.show();
- that.ui.namespaceDetailPage.hide();
+ that.ui.businessMetadataAttrPage.show();
+ that.ui.businessMetadataDetailPage.hide();
}
},
onEditAttr: function(e) {
var that = this,
isAttrEdit = false,
- selectedNamespace = that.nameSpaceCollection.fullCollection.findWhere({ guid: that.guid }),
- attrributes = selectedNamespace ? selectedNamespace.get('attributeDefs') : null,
+ selectedBusinessMetadata = that.model,
+ attrributes = selectedBusinessMetadata ? selectedBusinessMetadata.get('attributeDefs') : null,
attrName = e.target.dataset.name ? e.target.dataset.name : null,
attrDetails = { name: attrName };
if (e.target.dataset.action == 'attributeEdit') {
isAttrEdit = true
}
- if (selectedNamespace) {
+ if (selectedBusinessMetadata) {
that.newAttr = isAttrEdit ? false : true;
_.each(attrributes, function(attrObj) {
if (attrObj.name === attrName) {
@@ -125,39 +115,32 @@ define(['require',
}
});
this.showDetails = false;
- that.toggleNamespaceDetailsAttrView();
- require(["views/name_space/CreateNameSpaceLayoutView"], function(CreateNameSpaceLayoutView) {
- that.view = new CreateNameSpaceLayoutView({
+ that.toggleBusinessMetadataDetailsAttrView();
+ require(["views/business_metadata/CreateBusinessMetadataLayoutView"], function(CreateBusinessMetadataLayoutView) {
+ that.view = new CreateBusinessMetadataLayoutView({
onEditCallback: function() {
enumDefCollection.fetch({ reset: true });
- that.nameSpaceAttr.fullCollection.reset();
- that.options.selectedNameSpace.fetch({
- complete: function(model, status) {
- that.nameSpaceAttr.fullCollection.add(model.responseJSON.attributeDefs);
- }
- });
+ that.businessMetadataAttr.reset(that.model.get("attributeDefs"));
},
- onUpdateNamespace: function() {
- that.renderTableLayoutView();
+ onUpdateBusinessMetadata: function() {
that.showDetails = true;
- that.toggleNamespaceDetailsAttrView();
+ that.toggleBusinessMetadataDetailsAttrView();
that.entityDefCollection.fetch({ silent: true });
},
parent: that.$el,
- tagCollection: that.nameSpaceCollection,
+ businessMetadataDefCollection: that.businessMetadataDefCollection,
enumDefCollection: enumDefCollection,
isAttrEdit: isAttrEdit,
attrDetails: attrDetails,
typeHeaders: typeHeaders,
- selectedNamespace: selectedNamespace,
- nameSpaceCollection: nameSpaceCollection,
+ selectedBusinessMetadata: that.model,
guid: that.guid,
isNewAttr: that.newAttr
});
if (isAttrEdit) {
- that.ui.namespaceAttrPageTitle.text("Update Attribute of: " + selectedNamespace.get('name'));
+ that.ui.businessMetadataAttrPageTitle.text("Update Attribute of: " + selectedBusinessMetadata.get('name'));
} else {
- that.ui.namespaceAttrPageTitle.text("Add Namespace Attribute for: " + selectedNamespace.get('name'));
+ that.ui.businessMetadataAttrPageTitle.text("Add Business Metadata Attribute for: " + selectedBusinessMetadata.get('name'));
}
that.RModal.show(that.view);
});
@@ -167,18 +150,15 @@ define(['require',
renderTableLayoutView: function() {
var that = this;
require(['utils/TableLayout'], function(TableLayout) {
- var cols = new Backgrid.Columns(that.getNamespaceTableColumns());
- that.RNameSpaceAttrTableLayoutView.show(new TableLayout(_.extend({}, that.commonTableOptions, {
+ var cols = new Backgrid.Columns(that.getBusinessMetadataTableColumns());
+ that.RBusinessMetadataAttrTableLayoutView.show(new TableLayout(_.extend({}, that.commonTableOptions, {
columns: cols
})));
- if (!(that.nameSpaceAttr.models.length < that.limit)) {
- // that.RNameSpaceAttrTableLayoutView.$el.find('table tr').last().hide();
- }
});
},
- getNamespaceTableColumns: function() {
+ getBusinessMetadataTableColumns: function() {
var that = this;
- return this.nameSpaceAttr.constructor.getTableCols({
+ return this.businessMetadataAttr.constructor.getTableCols({
name: {
label: "Attribute Name",
cell: "html",
@@ -205,12 +185,15 @@ define(['require',
editable: false,
formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
fromRaw: function(rawValue, model) {
- var applicableEntityTypes = '',
- attrEntityTypes = JSON.parse(model.get('options').applicableEntityTypes);
- _.each(attrEntityTypes, function(values) {
- applicableEntityTypes += '<label class="btn btn-action btn-xs btn-blue no-pointer">' + values + '</label>';
- });
- return applicableEntityTypes;
+ var options = model.get('options')
+ if (options && options.applicableEntityTypes) {
+ var applicableEntityTypes = '',
+ attrEntityTypes = JSON.parse(options.applicableEntityTypes);
+ _.each(attrEntityTypes, function(values) {
+ applicableEntityTypes += '<label class="btn btn-action btn-xs btn-blue no-pointer">' + values + '</label>';
+ });
+ return applicableEntityTypes;
+ }
}
})
},
@@ -225,8 +208,8 @@ define(['require',
}
})
}
- }, this.nameSpaceAttr);
+ }, this.businessMetadataAttr);
}
});
- return NameSpaceAttrTableLayoutView;
+ return BusinessMetadataAttrTableLayoutView;
});
\ No newline at end of file
diff --git a/dashboardv3/public/js/views/name_space/NameSpaceAttributeItemView.js b/dashboardv3/public/js/views/business_metadata/BusinessMetadataAttributeItemView.js
similarity index 81%
rename from dashboardv3/public/js/views/name_space/NameSpaceAttributeItemView.js
rename to dashboardv3/public/js/views/business_metadata/BusinessMetadataAttributeItemView.js
index a8837f9..7bc1016 100644
--- a/dashboardv3/public/js/views/name_space/NameSpaceAttributeItemView.js
+++ b/dashboardv3/public/js/views/business_metadata/BusinessMetadataAttributeItemView.js
@@ -17,19 +17,19 @@
*/
define(['require',
'backbone',
- 'hbs!tmpl/name_space/NameSpaceAttributeItemView_tmpl',
+ 'hbs!tmpl/business_metadata/BusinessMetadataAttributeItemView_tmpl',
'utils/Utils',
'utils/UrlLinks',
'utils/Messages'
-], function(require, Backbone, NameSpaceAttributeItemViewTmpl, Utils, UrlLinks, Messages) {
+], function(require, Backbone, BusinessMetadataAttributeItemViewTmpl, Utils, UrlLinks, Messages) {
'use strict';
return Backbone.Marionette.ItemView.extend(
/** @lends GlobalExclusionListView */
{
- template: NameSpaceAttributeItemViewTmpl,
+ template: BusinessMetadataAttributeItemViewTmpl,
templateHelpers: function() {
return {
modalID: this.viewId
@@ -62,34 +62,47 @@ define(['require',
this.model.set({ "name": e.target.value.trim() });
};
events["change " + this.ui.dataTypeSelector] = function(e) {
+ var obj = { options: this.model.get('options') || {} };
+ debugger;
+ delete obj.enumValues;
+ delete obj.options.maxStrLength;
if (e.target.value.trim() === 'enumeration' || e.target.value.trim() === 'Enumeration') {
this.ui.enumTypeSelectorContainer.show();
this.emumTypeSelectDisplay();
this.ui.stringLengthContainer.hide();
- } else if (e.target.value.trim() === 'string' || e.target.value.trim() === 'String') {
- this.model.set({ "typeName": e.target.value.trim() });
- this.model.set({ "enumValues": null });
- this.ui.stringLengthContainer.show();
- this.ui.enumTypeSelectorContainer.hide();
- this.ui.enumValueSelectorContainer.hide();
} else {
- this.model.set({ "typeName": e.target.value.trim() });
- this.model.set({ "enumValues": null });
- this.ui.enumTypeSelectorContainer.hide();
- this.ui.enumValueSelectorContainer.hide();
- this.ui.stringLengthContainer.hide();
+ obj.typeName = e.target.value.trim();
+ if (e.target.value.trim() === 'string' || e.target.value.trim() === 'String') {
+ this.ui.stringLengthContainer.show();
+ this.ui.enumTypeSelectorContainer.hide();
+ this.ui.enumValueSelectorContainer.hide();
+ obj.options["maxStrLength"] = e.target.value.trim();
+ } else {
+ this.ui.enumTypeSelectorContainer.hide();
+ this.ui.enumValueSelectorContainer.hide();
+ this.ui.stringLengthContainer.hide();
+ }
}
+ this.model.set(obj);
};
events["change " + this.ui.enumTypeSelector] = function(e) {
this.model.set({ "enumValues": e.target.value.trim() });
};
events["change " + this.ui.stringLengthContainer] = function(e) {
- this.model.set({ "maxStrLength": e.target.value.trim() });
+ var options = this.model.get('options') || {};
+ if (this.ui.dataTypeSelector.val() == 'string') {
+ options["maxStrLength"] = e.target.value.trim();
+ }
+ this.model.set({ "options": options });
+
};
events["change " + this.ui.enumTypeSelector] = function(e) {
var emumValue = this.ui.enumTypeSelector.select2('data')[0] ? this.ui.enumTypeSelector.select2('data')[0].text : this.ui.enumTypeSelector.val();
this.model.set({ "typeName": emumValue });
+ if (this.model.get("multiValueSelect")) {
+ this.model.set({ "typeName": "array<" + emumValue + ">" });
+ }
if (emumValue == '' || emumValue == null) {
this.ui.enumValueSelectorContainer.hide();
} else {
@@ -102,7 +115,19 @@ define(['require',
};
events["change " + this.ui.multiValueSelectStatus] = function(e) {
this.model.set({ "multiValueSelect": e.target.checked });
+ var typename = this.model.get('typeName');
+ if (e.target.checked) {
+ typename = "array<" + typename + ">";
+ } else {
+ typename = typename.replace('array<', '').replace('>', '');
+ }
+ this.model.set({ "typeName": typename });
};
+ events["change " + this.ui.entityTypeSelector] = function(e) {
+ var options = this.model.get('options') || {};
+ options.applicableEntityTypes = JSON.stringify(this.ui.entityTypeSelector.val());
+ this.model.set({ "options": options });
+ }
events["click " + this.ui.close] = 'onCloseButton';
events["click " + this.ui.createNewEnum] = 'onCreateUpdateEnum';
return events;
@@ -115,13 +140,12 @@ define(['require',
initialize: function(options) {
this.parentView = options.parentView;
this.viewId = options.model ? options.model.cid : this.parentView.cid;
-
},
onRender: function() {
var that = this,
entitytypes = '',
enumTypes = [];
- this.model.set({ "modalID": this.viewId });
+ //this.model.set({ "modalID": this.viewId });
this.parentView.typeHeaders.fullCollection.each(function(model) {
if (model.toJSON().category == "ENTITY") {
that.ui.entityTypeSelector.append("<option>" + model.get('name') + "</option>");
@@ -139,14 +163,14 @@ define(['require',
this.ui.entityTypeSelector.on('select2:open', function(e) { // to make selected option disable in dropdown added remove-from-list class
$('.select2-dropdown--below').addClass('remove-from-list');
});
- this.ui.stringLengthValue.val('50'); //default length for string is 50
+ this.ui.stringLengthValue.val('50').trigger('change'); //default length for string is 50
this.ui.enumValueSelector.attr("disabled", "false"); // cannot edit the values
this.emumTypeSelectDisplay();
this.ui.enumTypeSelectorContainer.hide();
this.ui.enumValueSelectorContainer.hide();
if (this.parentView.isAttrEdit) {
this.ui.close.hide();
- this.ui.createNewEnum.hide(); // cannot add new namespace on edit view
+ this.ui.createNewEnum.hide(); // cannot add new businessMetadata on edit view
this.ui.attributeInput.val(this.parentView.attrDetails.name);
this.ui.attributeInput.attr("disabled", "false");
this.ui.dataTypeSelector.attr("disabled", "false");
@@ -222,7 +246,7 @@ define(['require',
},
onCreateUpdateEnum: function(e) {
var that = this;
- require(["views/name_space/EnumCreateUpdateItemView", "modules/Modal"], function(EnumCreateUpdateItemView, Modal) {
+ require(["views/business_metadata/EnumCreateUpdateItemView", "modules/Modal"], function(EnumCreateUpdateItemView, Modal) {
var view = new EnumCreateUpdateItemView({
onUpdateEnum: function() {
that.ui.enumValueSelectorContainer.hide();
@@ -238,7 +262,7 @@ define(['require',
});
},
enumDefCollection: that.parentView.enumDefCollection,
- nameSpaceCollection: that.parentView.options.nameSpaceCollection
+ businessMetadataDefCollection: that.parentView.options.businessMetadataDefCollection
}),
modal = new Modal({
title: "Create/ Update Enum",
diff --git a/dashboardv3/public/js/views/business_metadata/BusinessMetadataContainerLayoutView.js b/dashboardv3/public/js/views/business_metadata/BusinessMetadataContainerLayoutView.js
new file mode 100644
index 0000000..a1c80da
--- /dev/null
+++ b/dashboardv3/public/js/views/business_metadata/BusinessMetadataContainerLayoutView.js
@@ -0,0 +1,119 @@
+/**
+ * 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/business_metadata/BusinessMetadataContainerLayoutView_tmpl"
+], function(require, Backbone, BusinessMetadataContainerLayoutViewTmpl) {
+ "use strict";
+
+ var BusinessMetadataContainerLayoutView = Backbone.Marionette.LayoutView.extend(
+ /** @lends BusinessMetadataContainerLayoutView */
+ {
+ _viewName: "BusinessMetadataContainerLayoutView",
+
+ template: BusinessMetadataContainerLayoutViewTmpl,
+
+ /** Layout sub regions */
+ regions: {
+ RBusinessMetadataDetailContainer: "#r_businessMetadataDetailContainer",
+ RBusinessMetadataAttrContainer: "#r_businessMetadataAttrContainer"
+ },
+
+ /** ui selector cache */
+ ui: {},
+ /** ui events hash */
+ events: function() {},
+ /**
+ * intialize a new TagLayoutView Layout
+ * @constructs
+ */
+ initialize: function(options) {
+ _.extend(this, options);
+ },
+ bindEvents: function() {
+ // this.listenTo(this.businessMetadataDefCollection, 'reset', function() {
+ // if (!this.model) {
+ // this.model = this.businessMetadataDefCollection.fullCollection.findWhere({ guid: this.guid });
+ // if (this.model) {
+ // this.renderTagDetail();
+ // } else {
+ // this.$('.fontLoader').hide();
+ // Utils.notifyError({
+ // content: 'Tag Not Found'
+ // });
+ // }
+ // }
+ // }, this);
+ // this.listenTo(this.collection, 'error', function(error, response) {
+ // if (response.responseJSON && response.responseJSON.error) {
+ // Utils.notifyError({
+ // content: response.responseJSON.error
+ // });
+ // } else {
+ // Utils.notifyError({
+ // content: 'Something went wrong'
+ // });
+ // }
+ // this.$('.fontLoader').hide();
+ // }, this);
+ },
+ onRender: function() {
+ this.updateView();
+ },
+ updateView: function() {
+ this.model = this.businessMetadataDefCollection.fullCollection.findWhere({ guid: this.guid });
+ this.renderBusinessMetadataDetailLayoutView();
+ this.renderBusinessMetadataAttrLayoutView();
+ },
+ renderBusinessMetadataDetailLayoutView: function() {
+ var that = this;
+ require(["views/business_metadata/BusinessMetadataDetailLayoutView"], function(BusinessMetadataDetailLayoutView) {
+ if (that.isDestroyed) {
+ return;
+ }
+ that.RBusinessMetadataDetailContainer.show(new BusinessMetadataDetailLayoutView({
+ businessMetadataDefCollection: that.businessMetadataDefCollection,
+ guid: that.guid,
+ model: that.model,
+ enumDefCollection: that.enumDefCollection,
+ typeHeaders: that.typeHeaders
+ }));
+ });
+ },
+ renderBusinessMetadataAttrLayoutView: function() {
+ var that = this;
+ require(["views/business_metadata/BusinessMetadataAttrTableLayoutView"], function(BusinessMetadataAttrTableLayoutView) {
+ if (that.isDestroyed) {
+ return;
+ }
+ that.RBusinessMetadataAttrContainer.show(new BusinessMetadataAttrTableLayoutView({
+ businessMetadataDefCollection: that.businessMetadataDefCollection,
+ model: that.model,
+ guid: that.guid,
+ typeHeaders: that.typeHeaders,
+ enumDefCollection: that.enumDefCollection,
+ entityDefCollection: that.entityDefCollection
+ }));
+ });
+ }
+ }
+ );
+ return BusinessMetadataContainerLayoutView;
+});
\ No newline at end of file
diff --git a/dashboardv3/public/js/views/business_metadata/BusinessMetadataDetailLayoutView.js b/dashboardv3/public/js/views/business_metadata/BusinessMetadataDetailLayoutView.js
new file mode 100644
index 0000000..36e613f
--- /dev/null
+++ b/dashboardv3/public/js/views/business_metadata/BusinessMetadataDetailLayoutView.js
@@ -0,0 +1,68 @@
+/**
+ * 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/business_metadata/BusinessMetadataDetailLayoutView_tmpl',
+ 'utils/Utils',
+], function(require, Backbone, BusinessMetadataDetailLayoutViewTmpl, Utils) {
+ 'use strict';
+
+ var BusinessMetadataDetailLayoutView = Backbone.Marionette.LayoutView.extend(
+ /** @lends BusinessMetadataDetailLayoutView */
+ {
+ template: BusinessMetadataDetailLayoutViewTmpl,
+ /** Layout sub regions */
+ regions: {},
+ /** ui selector cache */
+ ui: {
+ title: '[data-id="title"]',
+ editBox: '[data-id="editBox"]',
+ saveButton: "[data-id='saveButton']",
+ description: '[data-id="description"]',
+ publishButton: '[data-id="publishButton"]',
+ backButton: '[data-id="backButton"]'
+ },
+ /** ui events hash */
+ events: function() {
+ var events = {};
+ events["click " + this.ui.backButton] = function() {
+ Utils.backButtonClick();
+ };
+ return events;
+ },
+ /**
+ * intialize a new BusinessMetadataDetailLayoutView Layout
+ * @constructs
+ */
+ initialize: function(options) {
+ _.extend(this, _.pick(options, 'guid', 'model', 'enumDefCollection', 'typeHeaders'));
+ },
+ onRender: function() {
+ this.renderDetail();
+ },
+ renderDetail: function() {
+ var that = this;
+ this.ui.title.html('<span>' + that.model.get('name') + '</span>');
+ if (that.model.get('description')) {
+ this.ui.description.text((that.model.get('description')));
+ }
+ }
+ });
+ return BusinessMetadataDetailLayoutView;
+});
\ No newline at end of file
diff --git a/dashboardv3/public/js/views/name_space/NameSpaceTableLayoutView.js b/dashboardv3/public/js/views/business_metadata/BusinessMetadataTableLayoutView.js
similarity index 68%
rename from dashboardv3/public/js/views/name_space/NameSpaceTableLayoutView.js
rename to dashboardv3/public/js/views/business_metadata/BusinessMetadataTableLayoutView.js
index 3697d91..1afa205 100644
--- a/dashboardv3/public/js/views/name_space/NameSpaceTableLayoutView.js
+++ b/dashboardv3/public/js/views/business_metadata/BusinessMetadataTableLayoutView.js
@@ -18,75 +18,74 @@
define(['require',
'backbone',
- 'hbs!tmpl/name_space/NameSpaceTableLayoutView_tmpl',
+ 'hbs!tmpl/business_metadata/BusinessMetadataTableLayoutView_tmpl',
'collection/VEntityList',
- 'collection/VTagList',
'models/VSearch',
'utils/Utils',
'utils/Messages',
'utils/Enums',
'utils/UrlLinks',
'utils/CommonViewFunction'
-], function(require, Backbone, NameSpaceTableLayoutView_tmpl, VEntityList, VTagList, VSearch, Utils, Messages, Enums, UrlLinks, CommonViewFunction) {
+], function(require, Backbone, BusinessMetadataTableLayoutView_tmpl, VEntityList, VSearch, Utils, Messages, Enums, UrlLinks, CommonViewFunction) {
'use strict';
- var NameSpaceTableLayoutView = Backbone.Marionette.LayoutView.extend(
- /** @lends NameSpaceTableLayoutView */
+ var BusinessMetadataTableLayoutView = Backbone.Marionette.LayoutView.extend(
+ /** @lends BusinessMetadataTableLayoutView */
{
- _viewName: 'NameSpaceTableLayoutView',
+ _viewName: 'BusinessMetadataTableLayoutView',
- template: NameSpaceTableLayoutView_tmpl,
+ template: BusinessMetadataTableLayoutView_tmpl,
/** Layout sub regions */
regions: {
- RNameSpaceTableLayoutView: "#r_nameSpaceTableLayoutView",
+ RBusinessMetadataTableLayoutView: "#r_businessMetadataTableLayoutView",
RModal: "#r_modal"
},
/** ui selector cache */
ui: {
- namespaceAttrPage: "[data-id='namespaceAttrPage']",
- namespaceAttrPageTitle: "[data-id='namespaceAttrPageTitle']",
- namespaceDetailPage: "[data-id='namespaceDetailPage']",
+ businessMetadataAttrPage: "[data-id='businessMetadataAttrPage']",
+ businessMetadataAttrPageTitle: "[data-id='businessMetadataAttrPageTitle']",
+ businessMetadataDetailPage: "[data-id='businessMetadataDetailPage']",
auditCreate: "[data-id='auditCreate']",
pageRecordText: "[data-id='pageRecordText']",
activePage: "[data-id='activePage']",
- createNameSpace: "[data-id='createNameSpace']",
+ createBusinessMetadata: "[data-id='createBusinessMetadata']",
attributeEdit: "[data-id='attributeEdit']",
addAttribute: '[data-id="addAttribute"]',
- namespaceAttrPageOk: '[data-id="namespaceAttrPageOk"]',
+ businessMetadataAttrPageOk: '[data-id="businessMetadataAttrPageOk"]',
colManager: "[data-id='colManager']",
- deleteNamespace: '[data-id="deleteNamespace"]',
- namespaceAttrFontLoader: '.namespace-attr-fontLoader',
- namespaceAttrTableOverlay: '.namespace-attr-tableOverlay'
+ deleteBusinessMetadata: '[data-id="deleteBusinessMetadata"]',
+ businessMetadataAttrFontLoader: '.business-metadata-attr-fontLoader',
+ businessMetadataAttrTableOverlay: '.businessMetadata-attr-tableOverlay'
},
/** ui events hash */
events: function() {
var events = {},
that = this;
- events["click " + this.ui.createNameSpace] = "onClickCreateNamespace";
+ events["click " + this.ui.createBusinessMetadata] = "onClickCreateBusinessMetadata";
events["click " + this.ui.addAttribute] = "onEditAttr";
events["click " + this.ui.attributeEdit] = "onEditAttr";
- events["click " + this.ui.deleteNamespace] = function(e) {
+ events["click " + this.ui.deleteBusinessMetadata] = function(e) {
that.guid = e.target.dataset.guid;
- that.deleteNamespaceElement();
+ that.deleteBusinessMetadataElement();
};
return events;
},
/**
- * intialize a new NameSpaceTableLayoutView Layout
+ * intialize a new BusinessMetadataTableLayoutView Layout
* @constructs
*/
initialize: function(options) {
- _.extend(this, _.pick(options, 'guid', 'entity', 'entityName', 'attributeDefs', 'typeHeaders', 'nameSpaceCollection', 'entityDefCollection', 'nameSpaceAttr', 'selectedNameSpace'));
+ _.extend(this, _.pick(options, 'guid', 'entity', 'entityName', 'attributeDefs', 'typeHeaders', 'businessMetadataDefCollection', 'entityDefCollection', 'businessMetadataAttr', 'selectedBusinessMetadata'));
this.limit = 10;
this.offset = 0;
this.pervOld = [];
this.onlyPurge = true;
this.newAttr = false;
this.commonTableOptions = {
- collection: this.nameSpaceCollection,
+ collection: this.businessMetadataDefCollection,
includeFilter: false,
includePagination: true,
includeFooterRecords: true,
@@ -118,47 +117,47 @@ define(['require',
this.showDetails = true; // toggle between sttribute page and detail page
},
onRender: function() {
- this.toggleNamespaceDetailsAttrView();
- $.extend(this.nameSpaceCollection.queryParams, { count: this.limit });
- this.nameSpaceCollection.fullCollection.sort({ silent: true });
+ this.toggleBusinessMetadataDetailsAttrView();
+ $.extend(this.businessMetadataDefCollection.queryParams, { count: this.limit });
+ this.businessMetadataDefCollection.fullCollection.sort({ silent: true });
this.renderTableLayoutView();
this.$('.tableOverlay').hide();
this.$('.auditTable').show(); // Only for first time table show because we never hide after first render.
- this.nameSpaceCollection.comparator = function(model) {
+ this.businessMetadataDefCollection.comparator = function(model) {
return -model.get('timestamp');
}
},
- toggleNamespaceDetailsAttrView: function() {
+ toggleBusinessMetadataDetailsAttrView: function() {
var that = this;
if (that.showDetails) {
- that.ui.namespaceAttrPage.hide();
- that.ui.namespaceDetailPage.show();
+ that.ui.businessMetadataAttrPage.hide();
+ that.ui.businessMetadataDetailPage.show();
} else {
- that.ui.namespaceAttrPage.show();
- that.ui.namespaceDetailPage.hide();
+ that.ui.businessMetadataAttrPage.show();
+ that.ui.businessMetadataDetailPage.hide();
}
},
bindEvents: function() {},
loaderStatus: function(isActive) {
var that = this;
if (isActive) {
- that.$('.namespace-attr-tableOverlay').show();
- that.$('.namespace-attr-fontLoader').show();
+ that.$('.businessMetadata-attr-tableOverlay').show();
+ that.$('.business-metadata-attr-fontLoader').show();
} else {
- that.$('.namespace-attr-tableOverlay').hide();
- that.$('.namespace-attr-fontLoader').hide();
+ that.$('.businessMetadata-attr-tableOverlay').hide();
+ that.$('.business-metadata-attr-fontLoader').hide();
}
},
onEditAttr: function(e) {
var that = this,
isAttrEdit = e.currentTarget.dataset && e.currentTarget.dataset.id === 'attributeEdit' ? true : false,
guid = e.currentTarget.dataset && e.currentTarget.dataset.guid ? e.currentTarget.dataset.guid : null,
- selectedNamespace = that.nameSpaceCollection.fullCollection.findWhere({ guid: guid }),
- attrributes = selectedNamespace ? selectedNamespace.get('attributeDefs') : null,
+ selectedBusinessMetadata = that.businessMetadataDefCollection.fullCollection.findWhere({ guid: guid }),
+ attrributes = selectedBusinessMetadata ? selectedBusinessMetadata.get('attributeDefs') : null,
attrName = e.currentTarget.dataset.name ? e.currentTarget.dataset.name : null,
attrDetails = { name: attrName };
- if (selectedNamespace) {
- that.ui.namespaceAttrPageOk.text("Save");
+ if (selectedBusinessMetadata) {
+ that.ui.businessMetadataAttrPageOk.text("Save");
that.newAttr = e.currentTarget && e.currentTarget.dataset.action === "createAttr" ? true : false;
that.guid = guid;
_.each(attrributes, function(attrObj) {
@@ -175,63 +174,62 @@ define(['require',
});
that.showDetails = false;
- that.toggleNamespaceDetailsAttrView();
- that.ui.namespaceAttrPageOk.attr('data-action', e.currentTarget.dataset.id);
- require(["views/name_space/CreateNameSpaceLayoutView"], function(CreateNameSpaceLayoutView) {
- that.view = new CreateNameSpaceLayoutView({
+ that.toggleBusinessMetadataDetailsAttrView();
+ that.ui.businessMetadataAttrPageOk.attr('data-action', e.currentTarget.dataset.id);
+ require(["views/business_metadata/CreateBusinessMetadataLayoutView"], function(CreateBusinessMetadataLayoutView) {
+ that.view = new CreateBusinessMetadataLayoutView({
onEditCallback: function() {
- that.nameSpaceCollection.fullCollection.sort({ silent: true });
+ that.businessMetadataDefCollection.fullCollection.sort({ silent: true });
that.renderTableLayoutView();
},
- onUpdateNamespace: function() {
+ onUpdateBusinessMetadata: function() {
enumDefCollection.fetch({ reset: true });
that.showDetails = true;
- that.toggleNamespaceDetailsAttrView();
+ that.toggleBusinessMetadataDetailsAttrView();
that.entityDefCollection.fetch({ silent: true });
},
parent: that.$el,
- tagCollection: that.nameSpaceCollection,
+ businessMetadataDefCollection: that.businessMetadataDefCollection,
enumDefCollection: enumDefCollection,
isAttrEdit: isAttrEdit,
typeHeaders: typeHeaders,
attrDetails: attrDetails,
- selectedNamespace: selectedNamespace,
- nameSpaceCollection: nameSpaceCollection,
+ selectedBusinessMetadata: selectedBusinessMetadata,
guid: that.guid,
isNewAttr: that.newAttr
});
if (isAttrEdit) {
- that.ui.namespaceAttrPageTitle.text("Update Attribute of: " + selectedNamespace.get('name'));
+ that.ui.businessMetadataAttrPageTitle.text("Update Attribute of: " + selectedBusinessMetadata.get('name'));
} else {
- that.ui.namespaceAttrPageTitle.text("Add Namespace Attribute for: " + selectedNamespace.get('name'));
+ that.ui.businessMetadataAttrPageTitle.text("Add Business Metadata Attribute for: " + selectedBusinessMetadata.get('name'));
}
that.RModal.show(that.view);
});
}
},
- onClickCreateNamespace: function(e) {
+ onClickCreateBusinessMetadata: function(e) {
var that = this,
- isNewNameSpace = true;
+ isNewBusinessMetadata = true;
that.showDetails = false;
- that.ui.namespaceAttrPageOk.text("Create");
- that.ui.namespaceAttrPageOk.attr('data-action', 'createNamespace');
- that.ui.namespaceAttrPageTitle.text("Create Namespace");
- that.toggleNamespaceDetailsAttrView();
- require(["views/name_space/CreateNameSpaceLayoutView"], function(CreateNameSpaceLayoutView) {
- that.view = new CreateNameSpaceLayoutView({
- onUpdateNamespace: function() {
+ that.ui.businessMetadataAttrPageOk.text("Create");
+ that.ui.businessMetadataAttrPageOk.attr('data-action', 'createBusinessMetadata');
+ that.ui.businessMetadataAttrPageTitle.text("Create Business Metadata");
+ that.toggleBusinessMetadataDetailsAttrView();
+ require(["views/business_metadata/CreateBusinessMetadataLayoutView"], function(CreateBusinessMetadataLayoutView) {
+ that.view = new CreateBusinessMetadataLayoutView({
+ onUpdateBusinessMetadata: function() {
enumDefCollection.fetch({ reset: true });
that.showDetails = true;
- that.toggleNamespaceDetailsAttrView();
+ that.toggleBusinessMetadataDetailsAttrView();
that.entityDefCollection.fetch({ silent: true });
},
- tagCollection: that.nameSpaceCollection,
+ tagCollection: that.businessMetadataDefCollection,
enumDefCollection: enumDefCollection,
typeHeaders: typeHeaders,
- isNewNameSpace: isNewNameSpace,
- nameSpaceCollection: nameSpaceCollection
+ isNewBusinessMetadata: isNewBusinessMetadata,
+ businessMetadataDefCollection: businessMetadataDefCollection
});
that.RModal.show(that.view);
});
@@ -239,19 +237,19 @@ define(['require',
renderTableLayoutView: function() {
var that = this;
require(['utils/TableLayout'], function(TableLayout) {
- var cols = new Backgrid.Columns(that.getNamespaceTableColumns());
- that.RNameSpaceTableLayoutView.show(new TableLayout(_.extend({}, that.commonTableOptions, {
+ var cols = new Backgrid.Columns(that.getBusinessMetadataTableColumns());
+ that.RBusinessMetadataTableLayoutView.show(new TableLayout(_.extend({}, that.commonTableOptions, {
columns: cols
})));
- if (!(that.nameSpaceCollection.models.length < that.limit)) {
- that.RNameSpaceTableLayoutView.$el.find('table tr').last().hide();
+ if (!(that.businessMetadataDefCollection.models.length < that.limit)) {
+ that.RBusinessMetadataTableLayoutView.$el.find('table tr').last().hide();
}
});
},
- getNamespaceTableColumns: function() {
+ getBusinessMetadataTableColumns: function() {
var that = this;
- return this.nameSpaceCollection.constructor.getTableCols({
+ return this.businessMetadataDefCollection.constructor.getTableCols({
attributeDefs: {
label: "",
cell: "html",
@@ -273,7 +271,7 @@ define(['require',
_.each(model.attributes.attributeDefs, function(attrObj) {
var applicableEntityTypes = '',
typeName = attrObj.typeName;
- if (attrObj.options) {
+ if (attrObj.options && attrObj.options.applicableEntityTypes) {
// attrEntityTypes = JSON.parse(attrObj.options.applicableEntityTypes).join(', ');
var entityTypes = JSON.parse(attrObj.options.applicableEntityTypes);
_.each(entityTypes, function(values) {
@@ -300,7 +298,7 @@ define(['require',
editable: false,
formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
fromRaw: function(rawValue, model) {
- return '<a title= "' + model.get('name') + '" href ="#!/administrator/namespace/' + model.get('guid') + '?from=namespace">' + model.get('name') + '</a>';
+ return '<a title= "' + model.get('name') + '" href ="#!/administrator/businessMetadata/' + model.get('guid') + '?from=bm">' + model.get('name') + '</a>';
}
})
},
@@ -365,14 +363,14 @@ define(['require',
editable: false,
formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
fromRaw: function(rawValue, model) {
- return "<button type='button' data-id='addAttribute' data-guid='" + model.get('guid') + "'' title='' class='btn btn-action btn-xs ' style='margin-bottom: 10px;' data-action='createAttr' data-original-title='Add Namespace attribute'><i class='fa fa-plus'></i> Attributes</button>";
- // "<button type='button' data-id='deleteNamespace' data-guid='" + model.get('guid') + "'' title='' class='btn btn-action btn-xs ' style='margin-bottom: 10px;' data-action='createAttr' data-original-title='Delete Namespace'><i class='fa fa-trash-o'></i> Delete</button>";
+ return "<button type='button' data-id='addAttribute' data-guid='" + model.get('guid') + "'' title='' class='btn btn-action btn-xs ' style='margin-bottom: 10px;' data-action='createAttr' data-original-title='Add Business Metadata attribute'><i class='fa fa-plus'></i> Attributes</button>";
+ // "<button type='button' data-id='deleteBusinessMetadata' data-guid='" + model.get('guid') + "'' title='' class='btn btn-action btn-xs ' style='margin-bottom: 10px;' data-action='createAttr' data-original-title='Delete BusinessMetadata'><i class='fa fa-trash-o'></i> Delete</button>";
}
})
}
- }, this.nameSpaceCollection);
+ }, this.businessMetadataDefCollection);
},
- deleteNamespaceElement: function(nameSpaceName) {
+ deleteBusinessMetadataElement: function(businessMetadataName) {
var that = this,
notifyObj = {
modal: true,
@@ -381,28 +379,28 @@ define(['require',
},
cancel: function(argument) {}
};
- var text = "Are you sure you want to delete the namespace";
+ var text = "Are you sure you want to delete the business metadata";
notifyObj["text"] = text;
Utils.notifyConfirm(notifyObj);
},
onNotifyDeleteOk: function(data) {
var that = this,
- deleteNamespaceData = that.nameSpaceCollection.fullCollection.findWhere({ guid: that.guid });
+ deleteBusinessMetadataData = that.businessMetadataDefCollection.fullCollection.findWhere({ guid: that.guid });
// that.$('.position-relative .fontLoader').addClass('show');
that.$('.tableOverlay').show();
- if (deleteNamespaceData) {
- var nameSpaceName = deleteNamespaceData.get("name");
- deleteNamespaceData.deleteNameSpace({
- typeName: nameSpaceName,
+ if (deleteBusinessMetadataData) {
+ var businessMetadataName = deleteBusinessMetadataData.get("name");
+ deleteBusinessMetadataData.deleteBusinessMetadata({
+ typeName: businessMetadataName,
success: function() {
Utils.notifySuccess({
- content: "Namespace " + nameSpaceName + Messages.getAbbreviationMsg(false, 'deleteSuccessMessage')
+ content: "Business Metadata " + businessMetadataName + Messages.getAbbreviationMsg(false, 'deleteSuccessMessage')
});
- that.nameSpaceCollection.fullCollection.remove(deleteNamespaceData);
- that.nameSpaceCollection.fullCollection.sort({ silent: true });
+ that.businessMetadataDefCollection.fullCollection.remove(deleteBusinessMetadataData);
+ that.businessMetadataDefCollection.fullCollection.sort({ silent: true });
that.renderTableLayoutView();
that.showDetails = true;
- that.toggleNamespaceDetailsAttrView();
+ that.toggleBusinessMetadataDetailsAttrView();
that.loaderStatus(false);
},
complete: function() {
@@ -417,5 +415,5 @@ define(['require',
}
}
});
- return NameSpaceTableLayoutView;
+ return BusinessMetadataTableLayoutView;
});
\ No newline at end of file
diff --git a/dashboardv3/public/js/views/business_metadata/CreateBusinessMetadataLayoutView.js b/dashboardv3/public/js/views/business_metadata/CreateBusinessMetadataLayoutView.js
new file mode 100644
index 0000000..6d18425
--- /dev/null
+++ b/dashboardv3/public/js/views/business_metadata/CreateBusinessMetadataLayoutView.js
@@ -0,0 +1,484 @@
+/**
+ * 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/business_metadata/CreateBusinessMetadataLayoutView_tmpl',
+ 'utils/Utils',
+ 'utils/Messages',
+ 'views/business_metadata/BusinessMetadataAttributeItemView',
+ 'collection/VTagList',
+ 'models/VEntity',
+ 'utils/UrlLinks',
+ 'platform'
+], function(require, Backbone, CreateBusinessMetadataLayoutViewTmpl, Utils, Messages, BusinessMetadataAttributeItemView, VTagList, VEntity, UrlLinks, platform) {
+
+ var CreateBusinessMetadataLayoutView = Backbone.Marionette.CompositeView.extend(
+ /** @lends CreateBusinessMetadataLayoutView */
+ {
+ _viewName: 'CreateBusinessMetadataLayoutView',
+
+ template: CreateBusinessMetadataLayoutViewTmpl,
+
+ templateHelpers: function() {
+ return {
+ create: this.create,
+ description: this.description,
+ fromTable: this.fromTable,
+ isEditAttr: this.isEditAttr
+ };
+ },
+
+ /** Layout sub regions */
+ regions: {},
+
+ childView: BusinessMetadataAttributeItemView,
+
+ childViewContainer: "[data-id='addAttributeDiv']",
+
+ childViewOptions: function() {
+ return {
+ // saveButton: this.ui.saveButton,
+ parentView: this
+ };
+ },
+ /** ui selector cache */
+ ui: {
+ name: "[data-id='name']",
+ description: "[data-id='description']",
+ title: "[data-id='title']",
+ attributeData: "[data-id='attributeData']",
+ addAttributeDiv: "[data-id='addAttributeDiv']",
+ createForm: '[data-id="createForm"]',
+ businessMetadataAttrPageCancle: '[data-id="businessMetadataAttrPageCancle"]',
+ businessMetadataAttrPageOk: '[data-id="businessMetadataAttrPageOk"]'
+ },
+ /** ui events hash */
+ events: function() {
+ var events = {};
+ events["click " + this.ui.attributeData] = "onClickAddAttriBtn";
+ events["click " + this.ui.businessMetadataAttrPageOk] = function(e) {
+ var that = this,
+ modal = that.$el;
+ if (e.target.dataset.action == "attributeEdit" || e.target.dataset.action == "addAttribute") {
+ // var selectedBusinessMetadata = that.businessMetadataDefCollection.fullCollection.findWhere({ guid: that.guid });
+ that.onUpdateAttr();
+ } else {
+ if (that.$el.find('.form-control.businessMetadata-name')[0].value === "") {
+ $(that.$el.find('.form-control.businessMetadata-name')[0]).css("borderColor", "red");
+ Utils.notifyInfo({
+ content: "Business Metadata name is empty."
+ });
+
+ } else {
+ that.onCreateBusinessMetadata();
+ }
+ }
+
+ };
+ events["click " + this.ui.businessMetadataAttrPageCancle] = function(e) {
+ this.options.onUpdateBusinessMetadata();
+ };
+ return events;
+ },
+ /**
+ * intialize a new CreateBusinessMetadataLayoutView Layout
+ * @constructs
+ */
+ initialize: function(options) {
+ _.extend(this, _.pick(options, 'businessMetadataDefCollection', 'enumDefCollection', 'model', 'descriptionData', 'isNewBusinessMetadata', 'isAttrEdit', 'entityDefCollection', 'typeHeaders', 'attrDetails'));
+ this.fromTable = this.isNewBusinessMetadata ? true : false;
+ this.isEditAttr = this.isAttrEdit ? false : true;
+ this.businessMetadataModel = new VEntity();
+ if (this.model) {
+ this.description = this.model.get('description');
+ } else {
+ this.create = true;
+ }
+ if (!this.isNewBusinessMetadata) {
+ this.collection = this.isAttrEdit ? new Backbone.Collection([{
+ "name": this.attrDetails.name,
+ "typeName": this.attrDetails.attrTypeName,
+ "isOptional": true,
+ "cardinality": "SINGLE",
+ "valuesMinCount": 0,
+ "valuesMaxCount": 1,
+ "isUnique": false,
+ "isIndexable": false
+ }]) : new Backbone.Collection([{
+ "name": "",
+ "typeName": "string",
+ "isOptional": true,
+ "cardinality": "SINGLE",
+ "valuesMinCount": 0,
+ "valuesMaxCount": 1,
+ "isUnique": false,
+ "isIndexable": false
+ }]);
+ } else {
+ this.collection = new Backbone.Collection();
+ }
+
+ },
+ bindEvents: function() {},
+ onRender: function() {
+ var that = this;
+ this.$('.fontLoader').show();
+ if (!('placeholder' in HTMLInputElement.prototype)) {
+ this.ui.createForm.find('input,textarea').placeholder();
+ }
+ if (this.isNewBusinessMetadata == true) {
+ that.ui.businessMetadataAttrPageOk.text("Create");
+ that.ui.businessMetadataAttrPageOk.attr('data-action', 'newBusinessMetadata');
+ } else {
+ that.ui.businessMetadataAttrPageOk.text("Save");
+ that.ui.businessMetadataAttrPageOk.attr('data-action', 'attributeEdit');
+ }
+ this.hideLoader();
+ },
+ hideLoader: function() {
+ this.$('.fontLoader').hide();
+ this.$('.hide').removeClass('hide');
+ },
+ collectionAttribute: function() {
+ this.collection.add(new Backbone.Model({
+ "name": "",
+ "typeName": "string",
+ "isOptional": true,
+ "cardinality": "SINGLE",
+ "valuesMinCount": 0,
+ "valuesMaxCount": 1,
+ "isUnique": false,
+ "isIndexable": false
+ }));
+ },
+ onClickAddAttriBtn: function() {
+ this.collectionAttribute();
+ if (!('placeholder' in HTMLInputElement.prototype)) {
+ this.ui.addAttributeDiv.find('input,textarea').placeholder();
+ }
+ },
+ loaderStatus: function(isActive) {
+ var that = this;
+ if (isActive) {
+ parent.$('.business-metadata-attr-tableOverlay').show();
+ parent.$('.business-metadata-attr-fontLoader').show();
+ } else {
+ parent.$('.business-metadata-attr-tableOverlay').hide();
+ parent.$('.business-metadata-attr-fontLoader').hide();
+ }
+ },
+ validateValues: function() {
+ var attrNameValidate = true,
+ enumValue = true,
+ stringValidate = true,
+ enumType = true;
+ if (this.$el.find(".attributeInput").length > 0) {
+ this.$el.find(".attributeInput").each(function() {
+ if ($(this).val() === "") {
+ $(this).css("borderColor", "red");
+ attrNameValidate = false;
+ }
+ });
+ }
+ if (this.$el.find(".enumvalue-container").length > 0 && this.$el.find(".enumvalue-container")[0].style.display != 'none') {
+ this.$el.find(".enumvalue-container").each(function(index) {
+ if (this.style.display != 'none') {
+ if ($(this).find(".enumValueSelector").length > 0) {
+ $(this).find(".enumValueSelector").each(function(index) {
+ if ($(this).val().length === 0) {
+ $(this).css("borderColor", "red");
+ enumValue = false;
+ }
+ });
+ }
+ }
+ })
+ }
+ if (this.$el.find(".enumtype-container").length > 0 && this.$el.find(".enumtype-container")[0].style.display != 'none') {
+ this.$el.find(".enumtype-container").each(function(index) {
+ if (this.style.display != 'none') {
+ if ($(this).find(".enumTypeSelector").length > 0) {
+ $(this).find(".enumTypeSelector").each(function(index) {
+ if ($(this).val() == null || $(this).val() == '' || $(this).val().length === 0) {
+ $(this).css("borderColor", "red");
+ enumType = false;
+ }
+ });
+ }
+ }
+ })
+ }
+ if (this.$el.find(".stringlength-container").length > 0 && this.$el.find(".stringlength-container")[0].style.display != 'none') {
+ this.$el.find(".stringlength-container").each(function(index) {
+ if (this.style.display != 'none') {
+ if ($(this).find(".stringLengthVal").length > 0) {
+ $(this).find(".stringLengthVal").each(function(index) {
+ if ($(this).val().length === 0) {
+ $(this).css("borderColor", "red");
+ stringValidate = false;
+ }
+ });
+ }
+ };
+ })
+ }
+
+ this.$el.find(".attributeInput").keyup(function() {
+ $(this).css("borderColor", "#e8e9ee");
+ });
+ if (!attrNameValidate) {
+ Utils.notifyInfo({
+ content: "Please fill the attributes details"
+ });
+ return true;
+ }
+ if (!enumType) {
+ Utils.notifyInfo({
+ content: "Please enter the Enumeration Name or select another type"
+ });
+ return true;
+ }
+ if (!enumValue) {
+ Utils.notifyInfo({
+ content: "Please enter the Enum values or select another type"
+ });
+ return true;
+ }
+ if (!stringValidate) {
+ Utils.notifyInfo({
+ content: "Please enter the Max Length for string or select another type"
+ });
+ return true;
+ }
+ },
+ businessMetadataAttributes: function(modelEl, attrObj) {
+ var obj = {
+ options: {
+ "applicableEntityTypes": JSON.stringify(modelEl.find(".entityTypeSelector").val()),
+ "maxStrLength": modelEl.find(".stringLengthVal").val() ? modelEl.find(".stringLengthVal").val() : "0"
+ }
+ };
+ // var types = ["string","boolean"];
+ // if (attrObj.typeName != "string" && attrObj.typeName != "boolean" && attrObj.typeName != "byte" && attrObj.typeName != "short" && attrObj.typeName != "int" && attrObj.typeName != "float" && attrObj.typeName != "double" && attrObj.typeName != "long" && attrObj.typeName != "date") {
+ // var enumName = enumDefCollection.fullCollection.findWhere({ name: attrObj.typeName });
+ // if (enumName) {
+ // return
+ // }
+ // }
+ if (obj.multiValueSelect) {
+ obj.multiValued = true;
+ obj.typeName = "array<" + obj.typeName + ">";
+ }
+ return obj;
+ },
+ highlightAttrinuteName: function(modelEl, obj) {
+ Utils.notifyInfo({
+ content: "Attribute " + obj.name + " already exist"
+ });
+ modelEl.find(".attributeInput").css("borderColor", "red");
+ this.loaderStatus(false);
+ },
+ createEnumObject: function(arrayObj, obj, enumVal) {
+ return arrayObj.push({
+ "name": obj.typeName,
+ "elementDefs": enumVal
+ });
+ },
+ onCreateBusinessMetadata: function() {
+ var that = this,
+ attrNames = [],
+ isvalidName = true;
+
+ if (this.validateValues()) {
+ return;
+ };
+ this.loaderStatus(true);
+ var name = this.ui.name.val(),
+ description = _.escape(this.ui.description.val());
+ var attributeObj = this.collection.toJSON();
+ if (this.collection.length === 1 && this.collection.first().get("name") === "") {
+ attributeObj = [];
+ }
+ if (attributeObj.length) {
+ // _.each(attributeObj, function(obj) {
+ // var modelEl = this.$('#' + obj.modalID);
+ // modelEl.find(".attributeInput").css("borderColor", "transparent");;
+ // if (attrNames.indexOf(obj.name) > -1) {
+ // that.highlightAttrinuteName(modelEl, obj);
+ // isvalidName = false;
+ // return true;
+ // } else {
+ // attrNames.push(obj.name);
+ // }
+ // obj = that.businessMetadataAttributes(modelEl, obj);
+ // // if (that.isPostCallEnum) {
+ // // that.createEnumObject(enumDefs, obj, elementValues);
+ // // }
+ // // if (that.isPutCall) {
+ // // that.createEnumObject(putEnumDef, obj, elementValues);
+ // // }
+ // });
+ var notifyObj = {
+ modal: true,
+ confirm: {
+ confirm: true,
+ buttons: [{
+ text: "Ok",
+ addClass: "btn-atlas btn-md",
+ click: function(notice) {
+ notice.remove();
+ }
+ },
+ null
+ ]
+ }
+ };
+ }
+ if (isvalidName) {
+ this.json = {
+ "enumDefs": [],
+ "structDefs": [],
+ "classificationDefs": [],
+ "entityDefs": [],
+ "businessMetadataDefs": [{
+ "category": "BUSINESS_METADATA",
+ "createdBy": "admin",
+ "updatedBy": "admin",
+ "version": 1,
+ "typeVersion": "1.1",
+ "name": name.trim(),
+ "description": description.trim(),
+ "attributeDefs": attributeObj
+ }]
+ };
+ var apiObj = {
+ sort: false,
+ data: this.json,
+ success: function(model, response) {
+ var nameSpaveDef = model.businessMetadataDefs;
+ if (nameSpaveDef) {
+ that.options.businessMetadataDefCollection.fullCollection.add(nameSpaveDef);
+ Utils.notifySuccess({
+ content: "Business Metadata " + name + Messages.getAbbreviationMsg(false, 'addSuccessMessage')
+ });
+ }
+ that.options.onUpdateBusinessMetadata();
+ },
+ silent: true,
+ reset: true,
+ complete: function(model, status) {
+ attrNames = [];
+ that.loaderStatus(false);
+ }
+ }
+ apiObj.type = "POST";
+ that.businessMetadataModel.saveBusinessMetadata(apiObj);
+ } else {
+ attrNames = [];
+ }
+ },
+ onUpdateAttr: function() {
+ var that = this,
+ selectedBusinessMetadata = $.extend(true, {}, that.options.selectedBusinessMetadata.toJSON()),
+ attributeDefs = selectedBusinessMetadata['attributeDefs'],
+ isvalidName = true;
+ if (this.validateValues()) {
+ return;
+ };
+ if (this.collection.length > 0) {
+ this.loaderStatus(true);
+ if (selectedBusinessMetadata.attributeDefs === undefined) {
+ selectedBusinessMetadata.attributeDefs = [];
+ }
+ selectedBusinessMetadata.attributeDefs = selectedBusinessMetadata.attributeDefs.concat(this.collection.toJSON());
+ // this.collection.each(function(model) {
+ // var obj = model.toJSON(),
+ // modelEl = this.$('#' + obj.modalID);
+ // modelEl.find(".attributeInput").css("borderColor", "transparent");
+ // // if (that.options.isNewAttr == true && _.find(attributeDefs, { name: obj.name })) {
+ // // that.highlightAttrinuteName(modelEl, obj);
+ // // isvalidName = false;
+ // // return true;
+ // // }
+ // obj = that.businessMetadataAttributes(modelEl, obj);
+ // // if (that.isPostCallEnum) {
+ // // that.createEnumObject(postEnumDef, obj, elementValues);
+ // // } else if (that.isPutCall) {
+ // // that.createEnumObject(enumDefs, obj, elementValues);
+ // // }
+
+ // // if (that.options.isNewAttr == true) {
+ // // selectedBusinessMetadata.attributeDefs.push(obj);
+ // // } else {
+ // // var attrDef = selectedBusinessMetadata.attributeDefs;
+ // // _.each(attrDef, function(attrObj) {
+ // // if (attrObj.name === that.$el.find(".attributeInput")[0].value) {
+ // // attrObj.name = obj.name;
+ // // attrObj.typeName = obj.typeName;
+ // // attrObj.multiValued = obj.multiValueSelect || false;
+ // // attrObj.options.applicableEntityTypes = obj.options.applicableEntityTypes;
+ // // attrObj.enumValues = obj.enumValues;
+ // // attrObj.options.maxStrLength = obj.options.maxStrLength;
+ // // }
+ // // });
+ // // }
+ // });
+ if (isvalidName) {
+ this.json = {
+ "enumDefs": [],
+ "structDefs": [],
+ "classificationDefs": [],
+ "entityDefs": [],
+ "businessMetadataDefs": [selectedBusinessMetadata]
+ };
+ var apiObj = {
+ sort: false,
+ data: this.json,
+ success: function(model, response) {
+ var selectedBusinessMetadata = that.options.businessMetadataDefCollection.fullCollection.findWhere({ guid: that.options.guid });
+ Utils.notifySuccess({
+ content: "One or more Business Metadada attribute" + Messages.getAbbreviationMsg(false, 'editSuccessMessage')
+ });
+ if (model.businessMetadataDefs && model.businessMetadataDefs.length) {
+ that.options.selectedBusinessMetadata.set(model.businessMetadataDefs[0]);
+ }
+ that.options.onEditCallback();
+ that.options.onUpdateBusinessMetadata();
+ },
+ silent: true,
+ reset: true,
+ complete: function(model, status) {
+ that.loaderStatus(false);
+ }
+ }
+ apiObj.type = "PUT";
+ that.businessMetadataModel.saveBusinessMetadata(apiObj);
+ }
+
+ } else {
+ Utils.notifySuccess({
+ content: "No attribute updated"
+ });
+ this.loaderStatus(false);
+ that.options.onUpdateBusinessMetadata();
+ }
+ }
+ });
+ return CreateBusinessMetadataLayoutView;
+});
\ No newline at end of file
diff --git a/dashboardv3/public/js/views/name_space/EnumCreateUpdateItemView.js b/dashboardv3/public/js/views/business_metadata/EnumCreateUpdateItemView.js
similarity index 95%
rename from dashboardv3/public/js/views/name_space/EnumCreateUpdateItemView.js
rename to dashboardv3/public/js/views/business_metadata/EnumCreateUpdateItemView.js
index 4f42288..e0f647f 100644
--- a/dashboardv3/public/js/views/name_space/EnumCreateUpdateItemView.js
+++ b/dashboardv3/public/js/views/business_metadata/EnumCreateUpdateItemView.js
@@ -15,7 +15,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-define(["require", "backbone", "hbs!tmpl/name_space/EnumCreateUpdateItemView_tmpl", "utils/Utils", "utils/UrlLinks", "utils/Messages"], function(
+define(["require", "backbone", "hbs!tmpl/business_metadata/EnumCreateUpdateItemView_tmpl", "utils/Utils", "utils/UrlLinks", "utils/Messages"], function(
require,
Backbone,
EnumCreateUpdateItemViewTmpl,
@@ -82,7 +82,7 @@ define(["require", "backbone", "hbs!tmpl/name_space/EnumCreateUpdateItemView_tmp
*/
initialize: function(options) {
this.enumDefCollection = options.enumDefCollection;
- this.nameSpaceCollection = options.nameSpaceCollection;
+ this.businessMetadataDefCollection = options.businessMetadataDefCollection;
},
onRender: function() {
var that = this,
@@ -234,7 +234,7 @@ define(["require", "backbone", "hbs!tmpl/name_space/EnumCreateUpdateItemView_tmp
});
}
that.enumDefCollection.fetch({ reset: true });
- if (that.options.onUpdateEnum) { //callback from namespaceattributeItemView
+ if (that.options.onUpdateEnum) { //callback from BusinessMetadataAttributeItemView
that.options.onUpdateEnum();
}
that.ui.enumCancleBtn.attr("disabled", "true");
@@ -253,9 +253,9 @@ define(["require", "backbone", "hbs!tmpl/name_space/EnumCreateUpdateItemView_tmp
};
$.extend(apiObj, { contentType: "application/json", dataType: "json", data: JSON.stringify(this.json) });
if (isPostCallEnum) {
- this.nameSpaceCollection.constructor.nonCrudOperation.call(this, UrlLinks.typedefsUrl().defs, "POST", apiObj);
+ this.businessMetadataDefCollection.constructor.nonCrudOperation.call(this, UrlLinks.typedefsUrl().defs, "POST", apiObj);
} else if (isPutCall) {
- this.nameSpaceCollection.constructor.nonCrudOperation.call(this, UrlLinks.typedefsUrl().defs, "PUT", apiObj);
+ this.businessMetadataDefCollection.constructor.nonCrudOperation.call(this, UrlLinks.typedefsUrl().defs, "PUT", apiObj);
} else {
Utils.notifySuccess({
content: "No updated values"
diff --git a/dashboardv3/public/js/views/detail_page/DetailPageLayoutView.js b/dashboardv3/public/js/views/detail_page/DetailPageLayoutView.js
index 5bf4230..37bfc0e 100644
--- a/dashboardv3/public/js/views/detail_page/DetailPageLayoutView.js
+++ b/dashboardv3/public/js/views/detail_page/DetailPageLayoutView.js
@@ -47,7 +47,7 @@ define(['require',
RRelationshipLayoutView: "#r_relationshipLayoutView",
REntityUserDefineView: "#r_entityUserDefineView",
REntityLabelDefineView: "#r_entityLabelDefineView",
- REntityNameSpaceView: "#r_entityNameSpaceView"
+ REntityBusinessMetadataView: "#r_entityBusinessMetadataView"
},
/** ui selector cache */
ui: {
@@ -121,7 +121,7 @@ define(['require',
* @constructs
*/
initialize: function(options) {
- _.extend(this, _.pick(options, 'value', 'collection', 'id', 'entityDefCollection', 'typeHeaders', 'enumDefCollection', 'classificationDefCollection', 'glossaryCollection', 'nameSpaceCollection', 'searchVent'));
+ _.extend(this, _.pick(options, 'value', 'collection', 'id', 'entityDefCollection', 'typeHeaders', 'enumDefCollection', 'classificationDefCollection', 'glossaryCollection', 'businessMetadataDefCollection', 'searchVent'));
$('body').addClass("detail-page");
},
bindEvents: function() {
@@ -245,7 +245,7 @@ define(['require',
enumDefCollection: this.enumDefCollection,
classificationDefCollection: this.classificationDefCollection,
glossaryCollection: this.glossaryCollection,
- nameSpaceCollection: this.activeEntityDef.get('namespaceAttributeDefs'),
+ businessMetadataCollection: this.activeEntityDef.get('businessAttributeDefs'),
searchVent: this.searchVent,
attributeDefs: (function() {
return that.getEntityDef(collectionJSON);
@@ -255,8 +255,8 @@ define(['require',
this.renderEntityDetailTableLayoutView(obj);
this.renderEntityUserDefineView(obj);
this.renderEntityLabelDefineView(obj);
- if (obj.nameSpaceCollection) {
- this.renderEntityNameSpaceView(obj);
+ if (obj.businessMetadataCollection) {
+ this.renderEntityBusinessMetadataView(obj);
}
this.renderRelationshipLayoutView(obj);
this.renderAuditTableLayoutView(obj);
@@ -517,10 +517,10 @@ define(['require',
that.REntityLabelDefineView.show(new EntityLabelDefineView(obj));
});
},
- renderEntityNameSpaceView: function(obj) {
+ renderEntityBusinessMetadataView: function(obj) {
var that = this;
- require(['views/entity/EntityNameSpaceView'], function(EntityNameSpaceView) {
- that.REntityNameSpaceView.show(new EntityNameSpaceView(obj));
+ require(['views/entity/EntityBusinessMetaDataView'], function(EntityBusinessMetaDataView) {
+ that.REntityBusinessMetadataView.show(new EntityBusinessMetaDataView(obj));
});
},
renderTagTableLayoutView: function(obj) {
diff --git a/dashboardv3/public/js/views/entity/EntityNameSpaceItemView.js b/dashboardv3/public/js/views/entity/EntityBusinessMetaDataItemView.js
similarity index 80%
rename from dashboardv3/public/js/views/entity/EntityNameSpaceItemView.js
rename to dashboardv3/public/js/views/entity/EntityBusinessMetaDataItemView.js
index 4cde4bf..e19bd43 100644
--- a/dashboardv3/public/js/views/entity/EntityNameSpaceItemView.js
+++ b/dashboardv3/public/js/views/entity/EntityBusinessMetaDataItemView.js
@@ -17,29 +17,29 @@
*/
define(['require',
'backbone',
- 'hbs!tmpl/entity/EntityNameSpaceItemView_tmpl',
+ 'hbs!tmpl/entity/EntityBusinessMetaDataItemView_tmpl',
'moment',
'daterangepicker'
-], function(require, Backbone, EntityNameSpaceItemViewTmpl, moment) {
+], function(require, Backbone, EntityBusinessMetaDataItemViewTmpl, moment) {
'use strict';
return Backbone.Marionette.ItemView.extend({
- _viewName: 'EntityNameSpaceItemView',
+ _viewName: 'EntityBusinessMetaDataItemView',
- template: EntityNameSpaceItemViewTmpl,
+ template: EntityBusinessMetaDataItemViewTmpl,
templateHelpers: function() {
return {
editMode: this.editMode,
entity: this.entity,
getValue: this.getValue.bind(this),
- getNamespaceDroupdown: this.getNamespaceDroupdown.bind(this),
- nameSpaceCollection: this.nameSpaceCollection,
+ getBusinessMetadataDroupdown: this.getBusinessMetadataDroupdown.bind(this),
+ businessMetadataCollection: this.businessMetadataCollection,
model: this.model.toJSON()
}
},
tagName: 'li',
- className: "namespace-tree-child",
+ className: "business-metadata-tree-child",
/** Layout sub regions */
regions: {},
@@ -61,7 +61,7 @@ define(['require',
},
/**
- * intialize a new EntityNameSpaceItemView Layout
+ * intialize a new EntityBusinessMetaDataItemView Layout
* @constructs
*/
initialize: function(options) {
@@ -73,7 +73,7 @@ define(['require',
this.ui.keyEl.select2({ placeholder: "Select Attribute" });
if (this.editMode && (!this.model.has("isNew"))) {
- this.getEditNamespaceEl();
+ this.getEditBusinessMetadataEl();
}
this.initializeElement();
this.bindEvent();
@@ -100,7 +100,7 @@ define(['require',
});
this.$el.off("change", ".custom-col-1[data-id='value']>[data-key]").on("change", ".custom-col-1[data-id='value']>[data-key]", function(e) {
var key = $(this).data("key"),
- namespace = $(this).data("namespace"),
+ businessMetadata = $(this).data("businessMetadata"),
typeName = $(this).data("typename"),
multi = $(this).data("multi"),
updateObj = that.model.toJSON();
@@ -111,8 +111,8 @@ define(['require',
if (multi && typeName.indexOf("date") == -1) {
updateObj[key].value = $(this).select2("val");
}
- if (!that.model.has("__internal_UI_nameSpaceName")) {
- updateObj["__internal_UI_nameSpaceName"] = namespace;
+ if (!that.model.has("__internal_UI_businessMetadataName")) {
+ updateObj["__internal_UI_businessMetadataName"] = businessMetadata;
}
if (typeName.indexOf("date") > -1) {
if (multi && updateObj[key].value) {
@@ -151,7 +151,7 @@ define(['require',
typeName = options.val.typeName || "",
val = options.val.value,
isMultiValued = typeName && typeName.indexOf("array<") === 0,
- namespace = options.namespace,
+ businessMetadata = options.businessMetadata,
allowOnlyNum = false;
var elType = isMultiValued ? "select" : "input";
if (!isMultiValued && !_.isEmpty(val)) {
@@ -174,11 +174,11 @@ define(['require',
}
}
if (typeName.indexOf("string") > -1) {
- returnEL = '<' + elType + ' type="text" data-key="' + key + '" data-namespace="' + namespace + '" data-typename="' + typeName + '" data-multi="' + isMultiValued + '" data-tags="true" placeholder="Enter String" class="form-control" ' + (!_.isUndefinedNull(val) ? 'value="' + val + '"' : "") + '></' + elType + '>';
+ returnEL = '<' + elType + ' type="text" data-key="' + key + '" data-businessMetadata="' + businessMetadata + '" data-typename="' + typeName + '" data-multi="' + isMultiValued + '" data-tags="true" placeholder="Enter String" class="form-control" ' + (!_.isUndefinedNull(val) ? 'value="' + val + '"' : "") + '></' + elType + '>';
} else if (typeName.indexOf("boolean") > -1) {
- returnEL = '<select data-key="' + key + '" data-namespace="' + namespace + '" data-typename="' + typeName + '" data-multi="' + isMultiValued + '" class="form-control">' + (isMultiValued ? "" : '<option value="">--Select Value--</option>') + '<option value="true" ' + (!_.isUndefinedNull(val) && val == "true" ? "selected" : "") + '>true</option><option value="false" ' + (!_.isUndefinedNull(val) && val == "false" ? "selected" : "") + '>false</option></select>';
+ returnEL = '<select data-key="' + key + '" data-businessMetadata="' + businessMetadata + '" data-typename="' + typeName + '" data-multi="' + isMultiValued + '" class="form-control">' + (isMultiValued ? "" : '<option value="">--Select Value--</option>') + '<option value="true" ' + (!_.isUndefinedNull(val) && val == "true" ? "selected" : "") + '>true</option><option value="false" ' + (!_.isUndefinedNull(val) && val == "false" ? "selected" : "") + '>false</option></select>';
} else if (typeName.indexOf("date") > -1) {
- returnEL = '<' + (isMultiValued ? "textarea" : "input") + ' type="text" data-key="' + key + '" data-namespace="' + namespace + '" data-typename="' + typeName + '"data-multi="' + isMultiValued + '" data-type="date" class="form-control" ' + (isMultiValued === false && !_.isUndefinedNull(val) ? 'value="' + val + '"' : "") + '>' + (isMultiValued === true && !_.isUndefinedNull(val) ? val : "") + (isMultiValued ? "</textarea>" : "");
+ returnEL = '<' + (isMultiValued ? "textarea" : "input") + ' type="text" data-key="' + key + '" data-businessMetadata="' + businessMetadata + '" data-typename="' + typeName + '"data-multi="' + isMultiValued + '" data-type="date" class="form-control" ' + (isMultiValued === false && !_.isUndefinedNull(val) ? 'value="' + val + '"' : "") + '>' + (isMultiValued === true && !_.isUndefinedNull(val) ? val : "") + (isMultiValued ? "</textarea>" : "");
setTimeout(function() {
var dateObj = { "singleDatePicker": true, autoUpdateInput: isMultiValued ? false : true },
dateEl = that.$el.find('[data-type="date"][data-key="' + key + '"]').daterangepicker(dateObj);
@@ -195,7 +195,7 @@ define(['require',
}, 0);
} else if (typeName.indexOf("byte") > -1 || typeName.indexOf("short") > -1 || typeName.indexOf("int") > -1 || typeName.indexOf("float") > -1 || typeName.indexOf("double") > -1 || typeName.indexOf("long") > -1) {
allowOnlyNum = true;
- returnEL = '<' + elType + ' data-key="' + key + '" data-namespace="' + namespace + '" data-typename="' + typeName + '" type="number" data-multi="' + isMultiValued + '" data-tags="true" placeholder="Enter Number" class="form-control" ' + (!_.isUndefinedNull(val) ? 'value="' + val + '"' : "") + '></' + elType + '>';
+ returnEL = '<' + elType + ' data-key="' + key + '" data-businessMetadata="' + businessMetadata + '" data-typename="' + typeName + '" type="number" data-multi="' + isMultiValued + '" data-tags="true" placeholder="Enter Number" class="form-control" ' + (!_.isUndefinedNull(val) ? 'value="' + val + '"' : "") + '></' + elType + '>';
} else if (typeName) {
var modTypeName = typeName;
if (isMultiValued) {
@@ -210,7 +210,7 @@ define(['require',
_.forEach(foundEnumType.get("elementDefs"), function(obj) {
enumOptions += '<option value="' + obj.value + '">' + obj.value + '</option>'
});
- returnEL = '<select data-key="' + key + '" data-namespace="' + namespace + '" data-typename="' + typeName + '" data-multi="' + isMultiValued + '" >' + enumOptions + '</select>';
+ returnEL = '<select data-key="' + key + '" data-businessMetadata="' + businessMetadata + '" data-typename="' + typeName + '" data-multi="' + isMultiValued + '" >' + enumOptions + '</select>';
}
setTimeout(function() {
if (!isMultiValued) {
@@ -245,7 +245,7 @@ define(['require',
hasModalData = this.model.get(key[1]);
if (!hasModalData) {
var tempObj = {
- "__internal_UI_nameSpaceName": key[0]
+ "__internal_UI_businessMetadataName": key[0]
};
if (this.model.has("isNew")) {
tempObj["isNew"] = true;
@@ -253,13 +253,13 @@ define(['require',
tempObj[key[1]] = null;
this.model.clear({ silent: true }).set(tempObj)
}
- valEl.html(this.getAttrElement({ namespace: key[0], key: key[1], val: hasModalData ? hasModalData : { typeName: key[2] } }));
+ valEl.html(this.getAttrElement({ businessMetadata: key[0], key: key[1], val: hasModalData ? hasModalData : { typeName: key[2] } }));
if (manual === undefined) {
this.model.collection.trigger("selected:attr", e.currentTarget.value, this.model);
}
}
},
- getValue: function(value, key, namespaceName) {
+ getValue: function(value, key, businessMetadataName) {
var typeName = value.typeName,
value = value.value;
if (typeName === "date") {
@@ -268,24 +268,24 @@ define(['require',
return value;
}
},
- getNamespaceDroupdown: function(nameSpaceCollection) {
+ getBusinessMetadataDroupdown: function(businessMetadataCollection) {
var optgroup = "";
var that = this;
- var model = that.model.omit(["isNew", "__internal_UI_nameSpaceName"]),
+ var model = that.model.omit(["isNew", "__internal_UI_businessMetadataName"]),
keys = _.keys(model),
isSelected = false,
selectdVal = null;
if (keys.length === 1) {
isSelected = true;
}
- _.each(nameSpaceCollection, function(obj, key) {
+ _.each(businessMetadataCollection, function(obj, key) {
var options = "";
if (obj.length) {
_.each(obj, function(attrObj) {
- var entityNamespace = that.model.collection.filter({ __internal_UI_nameSpaceName: key }),
+ var entityBusinessMetadata = that.model.collection.filter({ __internal_UI_businessMetadataName: key }),
hasAttr = false;
- if (entityNamespace) {
- var found = entityNamespace.find(function(eObj) {
+ if (entityBusinessMetadata) {
+ var found = entityBusinessMetadata.find(function(eObj) {
return eObj.attributes.hasOwnProperty(attrObj.name);
});
if (found) {
@@ -313,12 +313,12 @@ define(['require',
}, 0);
return '<select data-id="key">' + optgroup + '</select>';
},
- getEditNamespaceEl: function() {
+ getEditBusinessMetadataEl: function() {
var that = this,
trs = "";
_.each(this.model.attributes, function(val, key) {
- if (key !== "__internal_UI_nameSpaceName" && key !== "isNew") {
- var td = '<td class="custom-col-1" data-key=' + key + '>' + key + ' (' + _.escape(val.typeName) + ')</td><td class="custom-col-0">:</td><td class="custom-col-1" data-id="value">' + that.getAttrElement({ namespace: that.model.get("__internal_UI_nameSpaceName"), key: key, val: val }) + '</td>';
+ if (key !== "__internal_UI_businessMetadataName" && key !== "isNew") {
+ var td = '<td class="custom-col-1" data-key=' + key + '>' + key + ' (' + _.escape(val.typeName) + ')</td><td class="custom-col-0">:</td><td class="custom-col-1" data-id="value">' + that.getAttrElement({ businessMetadata: that.model.get("__internal_UI_businessMetadataName"), key: key, val: val }) + '</td>';
td += '<td class="custom-col-2 btn-group">' +
'<button class="btn btn-default btn-sm" data-key="' + key + '" data-id="deleteItem">' +
@@ -327,7 +327,7 @@ define(['require',
trs += "<tr class='custom-tr'>" + td + "</tr>";
}
})
- this.$("[data-id='namespaceTreeChild']").html("<table class='custom-table'>" + trs + "</table>");
+ this.$("[data-id='businessMetadataTreeChild']").html("<table class='custom-table'>" + trs + "</table>");
},
onDeleteItem: function(e) {
var key = $(e.currentTarget).data("key");
diff --git a/dashboardv3/public/js/views/entity/EntityNameSpaceView.js b/dashboardv3/public/js/views/entity/EntityBusinessMetaDataView.js
similarity index 70%
rename from dashboardv3/public/js/views/entity/EntityNameSpaceView.js
rename to dashboardv3/public/js/views/entity/EntityBusinessMetaDataView.js
index 3210255..3409847 100644
--- a/dashboardv3/public/js/views/entity/EntityNameSpaceView.js
+++ b/dashboardv3/public/js/views/entity/EntityBusinessMetaDataView.js
@@ -19,57 +19,56 @@
define([
"require",
"backbone",
- "hbs!tmpl/entity/EntityNameSpaceView_tmpl",
- "views/entity/EntityNameSpaceItemView",
+ "hbs!tmpl/entity/EntityBusinessMetaDataView_tmpl",
+ "views/entity/EntityBusinessMetaDataItemView",
"models/VEntity",
"utils/Utils",
- "utils/Enums",
"utils/Messages",
"utils/CommonViewFunction",
'moment'
-], function(require, Backbone, EntityNameSpaceViewTmpl, EntityNameSpaceItemView, VEntity, Utils, Enums, Messages, CommonViewFunction, moment) {
+], function(require, Backbone, EntityBusinessMetaDataView_tmpl, EntityBusinessMetaDataItemView, VEntity, Utils, Messages, CommonViewFunction, moment) {
"use strict";
return Backbone.Marionette.CompositeView.extend({
- _viewName: "EntityNameSpaceView",
- template: EntityNameSpaceViewTmpl,
- childView: EntityNameSpaceItemView,
+ _viewName: "EntityBusinessMetaDataView",
+ template: EntityBusinessMetaDataView_tmpl,
+ childView: EntityBusinessMetaDataItemView,
childViewContainer: "[data-id='itemView']",
childViewOptions: function() {
return {
editMode: this.editMode,
entity: this.entity,
- nameSpaceCollection: this.nameSpaceCollection,
+ businessMetadataCollection: this.businessMetadataCollection,
enumDefCollection: this.enumDefCollection
};
},
/** ui selector cache */
ui: {
addItem: "[data-id='addItem']",
- addNameSpace: "[data-id='addNameSpace']",
- saveNameSpace: "[data-id='saveNameSpace']",
- namespaceTree: "[data-id='namespaceTree']",
+ addBusinessMetadata: "[data-id='addBusinessMetadata']",
+ saveBusinessMetadata: "[data-id='saveBusinessMetadata']",
+ businessMetadataTree: "[data-id='businessMetadataTree']",
cancel: "[data-id='cancel']"
},
events: function() {
var events = {};
events["click " + this.ui.addItem] = 'createNameElement';
- events["click " + this.ui.addNameSpace] = "onAddNameSpace";
- events["click " + this.ui.saveNameSpace] = "onSaveNameSpace";
+ events["click " + this.ui.addBusinessMetadata] = "onAddBusinessMetadata";
+ events["click " + this.ui.saveBusinessMetadata] = "onSaveBusinessMetadata";
events["click " + this.ui.cancel] = "onCancel";
return events;
},
initialize: function(options) {
var that = this;
- _.extend(this, _.pick(options, "entity", "nameSpaceCollection", "enumDefCollection", "guid", "fetchCollection"));
+ _.extend(this, _.pick(options, "entity", "businessMetadataCollection", "enumDefCollection", "guid", "fetchCollection"));
this.editMode = false;
this.$("editBox").hide();
this.actualCollection = new Backbone.Collection(
- _.map(this.entity.namespaceAttributes, function(val, key) {
- var foundNameSpace = that.nameSpaceCollection[key];
- if (foundNameSpace) {
+ _.map(this.entity.businessAttributes, function(val, key) {
+ var foundBusinessMetadata = that.businessMetadataCollection[key];
+ if (foundBusinessMetadata) {
_.each(val, function(aVal, aKey) {
- var foundAttr = _.find(foundNameSpace, function(o) {
+ var foundAttr = _.find(foundBusinessMetadata, function(o) {
return o.name === aKey
});
if (foundAttr) {
@@ -77,7 +76,7 @@ define([
}
})
}
- return _.extend({}, val, { __internal_UI_nameSpaceName: key });
+ return _.extend({}, val, { __internal_UI_businessMetadataName: key });
}));
this.collection = new Backbone.Collection();
this.entityModel = new VEntity();
@@ -86,12 +85,12 @@ define([
var silent = options && options.silent || false;
this.collection.reset(this.actualCollection.toJSON(), { silent: silent });
},
- onAddNameSpace: function() {
- this.ui.addNameSpace.hide();
- this.ui.saveNameSpace.show();
+ onAddBusinessMetadata: function() {
+ this.ui.addBusinessMetadata.hide();
+ this.ui.saveBusinessMetadata.show();
this.ui.cancel.show();
this.editMode = true;
- this.ui.namespaceTree.hide();
+ this.ui.businessMetadataTree.hide();
this.$(".editBox").show();
this.updateToActualData({ silent: true });
if (this.collection.length === 0) {
@@ -103,10 +102,10 @@ define([
},
onCancel: function() {
this.ui.cancel.hide();
- this.ui.saveNameSpace.hide();
- this.ui.addNameSpace.show();
+ this.ui.saveBusinessMetadata.hide();
+ this.ui.addBusinessMetadata.show();
this.editMode = false;
- this.ui.namespaceTree.show();
+ this.ui.businessMetadataTree.show();
this.$(".editBox").hide();
this.updateToActualData();
this.panelOpenClose();
@@ -116,9 +115,9 @@ define([
if (collection && collection.length === 0) {
this.$el.find(".panel-heading").addClass("collapsed");
this.$el.find(".panel-collapse.collapse").removeClass("in");
- this.ui.addNameSpace.text("Add");
+ this.ui.addBusinessMetadata.text("Add");
} else {
- this.ui.addNameSpace.text("Edit");
+ this.ui.addBusinessMetadata.text("Edit");
this.$el.find(".panel-heading").removeClass("collapsed");
this.$el.find(".panel-collapse.collapse").addClass("in");
}
@@ -150,7 +149,7 @@ define([
});
return validation;
},
- onSaveNameSpace: function() {
+ onSaveBusinessMetadata: function() {
var that = this;
if (!this.validate()) {
return;
@@ -160,14 +159,14 @@ define([
this.onCancel();
return;
}
- this.entityModel.saveNamespaceEntity(this.guid, {
+ this.entityModel.saveBusinessMetadataEntity(this.guid, {
data: JSON.stringify(nData),
type: "POST",
success: function(data) {
Utils.notifySuccess({
- content: "One or more namespace attributes" + Messages.getAbbreviationMsg(false, 'editSuccessMessage')
+ content: "One or more Business Metadada attributes" + Messages.getAbbreviationMsg(false, 'editSuccessMessage')
});
- that.entity.namespaceAttributes = data;
+ that.entity.businessAttributes = data;
this.editMode = false;
that.fetchCollection();
that.onCancel();
@@ -181,10 +180,10 @@ define([
var finalObj = {};
this.collection.forEach(function(model) {
if (!model.has("addAttrButton")) {
- var nameSpaceName = model.get("__internal_UI_nameSpaceName"),
+ var businessMetadataName = model.get("__internal_UI_businessMetadataName"),
modelObj = model.toJSON();
_.each(modelObj, function(o, k) {
- if (k === "isNew" && k === "__internal_UI_nameSpaceName") {
+ if (k === "isNew" || k === "__internal_UI_businessMetadataName") {
delete modelObj[k];
return;
}
@@ -192,20 +191,20 @@ define([
modelObj[k] = o.value;
}
})
- if (nameSpaceName !== undefined) {
- if (finalObj[nameSpaceName]) {
- finalObj[nameSpaceName] = _.extend(finalObj[nameSpaceName], modelObj);
+ if (businessMetadataName !== undefined) {
+ if (finalObj[businessMetadataName]) {
+ finalObj[businessMetadataName] = _.extend(finalObj[businessMetadataName], modelObj);
} else {
- finalObj[nameSpaceName] = modelObj;
+ finalObj[businessMetadataName] = modelObj;
}
}
}
});
if (_.isEmpty(finalObj)) {
this.actualCollection.forEach(function(model) {
- var nameSpaceName = model.get("__internal_UI_nameSpaceName");
- if (nameSpaceName) {
- finalObj[nameSpaceName] = {};
+ var businessMetadataName = model.get("__internal_UI_businessMetadataName");
+ if (businessMetadataName) {
+ finalObj[businessMetadataName] = {};
}
})
}
@@ -215,12 +214,12 @@ define([
var modelObj = { isNew: true };
this.collection.unshift(modelObj);
},
- renderNamespace: function() {
+ renderBusinessMetadata: function() {
var li = ""
this.actualCollection.forEach(function(obj) {
var attrLi = "";
_.each(obj.attributes, function(val, key) {
- if (key !== "__internal_UI_nameSpaceName") {
+ if (key !== "__internal_UI_businessMetadataName") {
var newVal = val;
if (_.isObject(val) && !_.isUndefinedNull(val.value)) {
newVal = val.value;
@@ -237,16 +236,16 @@ define([
attrLi += "<tr><td>" + _.escape(key) + " (" + _.escape(val.typeName) + ")</td><td>" + _.escape(newVal) + "</td></tr>";
}
});
- li += "<ul class='namespace-tree-parent'><li class='table'>" + _.escape(obj.get("__internal_UI_nameSpaceName")) + "</li>" +
- "<li class='namespace-tree-child entity-detail-table'>" +
+ li += "<ul class='business-metadata-tree-parent'><li class='table'>" + _.escape(obj.get("__internal_UI_businessMetadataName")) + "</li>" +
+ "<li class='business-metadata-tree-child entity-detail-table'>" +
"<table class='table'>" + attrLi + "</table>" +
"</li></ul>";
});
- this.ui.namespaceTree.html(li);
+ this.ui.businessMetadataTree.html(li);
},
onRender: function() {
this.panelOpenClose();
- this.renderNamespace();
+ this.renderBusinessMetadata();
}
});
});
\ No newline at end of file
diff --git a/dashboardv3/public/js/views/name_space/CreateNameSpaceLayoutView.js b/dashboardv3/public/js/views/name_space/CreateNameSpaceLayoutView.js
deleted file mode 100644
index 5cdd145..0000000
--- a/dashboardv3/public/js/views/name_space/CreateNameSpaceLayoutView.js
+++ /dev/null
@@ -1,576 +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.
- */
-
-define(['require',
- 'backbone',
- 'hbs!tmpl/name_space/CreateNameSpaceLayoutView_tmpl',
- 'utils/Utils',
- 'utils/Messages',
- 'views/name_space/NameSpaceAttributeItemView',
- 'collection/VTagList',
- 'utils/UrlLinks',
- 'platform'
-], function(require, Backbone, CreateNameSpaceLayoutViewTmpl, Utils, Messages, NameSpaceAttributeItemView, VTagList, UrlLinks, platform) {
-
- var CreateNameSpaceLayoutView = Backbone.Marionette.CompositeView.extend(
- /** @lends CreateNameSpaceLayoutView */
- {
- _viewName: 'CreateNameSpaceLayoutView',
-
- template: CreateNameSpaceLayoutViewTmpl,
-
- templateHelpers: function() {
- return {
- create: this.create,
- description: this.description,
- fromTable: this.fromTable,
- isEditAttr: this.isEditAttr
- };
- },
-
- /** Layout sub regions */
- regions: {},
-
- childView: NameSpaceAttributeItemView,
-
- childViewContainer: "[data-id='addAttributeDiv']",
-
- childViewOptions: function() {
- return {
- // saveButton: this.ui.saveButton,
- parentView: this
- };
- },
- /** ui selector cache */
- ui: {
- tagName: "[data-id='tagName']",
- description: "[data-id='description']",
- title: "[data-id='title']",
- attributeData: "[data-id='attributeData']",
- addAttributeDiv: "[data-id='addAttributeDiv']",
- createTagForm: '[data-id="createTagForm"]',
- namespaceAttrPageCancle: '[data-id="namespaceAttrPageCancle"]',
- namespaceAttrPageOk: '[data-id="namespaceAttrPageOk"]'
- },
- /** ui events hash */
- events: function() {
- var events = {};
- events["click " + this.ui.attributeData] = "onClickAddAttriBtn";
- events["click " + this.ui.namespaceAttrPageOk] = function(e) {
- var that = this,
- modal = that.$el;
- if (e.target.dataset.action == "attributeEdit" || e.target.dataset.action == "addAttribute") {
- // var selectedNamespace = that.nameSpaceCollection.fullCollection.findWhere({ guid: that.guid });
- that.onUpdateAttr();
- } else {
- if (that.$el.find('.form-control.namespace-name')[0].value === "") {
- $(that.$el.find('.form-control.namespace-name')[0]).css("borderColor", "red");
- Utils.notifyInfo({
- content: "Namespace name is empty."
- });
-
- } else {
- that.onCreateNameSpace();
- }
- }
-
- };
- events["click " + this.ui.namespaceAttrPageCancle] = function(e) {
- this.options.onUpdateNamespace();
- };
- return events;
- },
- /**
- * intialize a new CreateNameSpaceLayoutView Layout
- * @constructs
- */
- initialize: function(options) {
- _.extend(this, _.pick(options, 'tagCollection', 'enumDefCollection', 'model', 'tag', 'descriptionData', 'selectedTag', 'isNewNameSpace', 'isAttrEdit', 'entityDefCollection', 'typeHeaders', 'attrDetails'));
- this.fromTable = this.isNewNameSpace ? true : false;
- this.isEditAttr = this.isAttrEdit ? false : true;
- if (this.model) {
- this.description = this.model.get('description');
- } else {
- this.create = true;
- }
- if (!this.isNewNameSpace) {
- this.collection = this.isAttrEdit ? new Backbone.Collection([{
- "name": this.attrDetails.name,
- "typeName": this.attrDetails.attrTypeName,
- "isOptional": true,
- "cardinality": "SINGLE",
- "valuesMinCount": 0,
- "valuesMaxCount": 1,
- "isUnique": false,
- "isIndexable": false
- }]) : new Backbone.Collection([{
- "name": "",
- "typeName": "string",
- "isOptional": true,
- "cardinality": "SINGLE",
- "valuesMinCount": 0,
- "valuesMaxCount": 1,
- "isUnique": false,
- "isIndexable": false
- }]);
- } else {
- this.collection = new Backbone.Collection();
- }
-
- },
- bindEvents: function() {},
- onRender: function() {
- var that = this;
- this.$('.fontLoader').show();
- if (this.create) {
- this.tagCollectionList();
- } else {
- this.ui.title.html('<span>' + _.escape(this.tag) + '</span>');
- }
- if (!('placeholder' in HTMLInputElement.prototype)) {
- this.ui.createTagForm.find('input,textarea').placeholder();
- }
- if (this.isNewNameSpace == true) {
- that.ui.namespaceAttrPageOk.text("Create");
- that.ui.namespaceAttrPageOk.attr('data-action', 'newNamespace');
- } else {
- that.ui.namespaceAttrPageOk.text("Save");
- that.ui.namespaceAttrPageOk.attr('data-action', 'attributeEdit');
- }
- this.hideLoader();
- },
- tagCollectionList: function() {
- var that = this,
- str = '';
- this.tagCollection.fullCollection.each(function(val) {
- var name = Utils.getName(val.toJSON());
- str += '<option ' + (name == that.selectedTag ? 'selected' : '') + '>' + (name) + '</option>';
- });
- },
- hideLoader: function() {
- this.$('.fontLoader').hide();
- this.$('.hide').removeClass('hide');
- },
- collectionAttribute: function() {
- this.collection.add(new Backbone.Model({
- "name": "",
- "typeName": "string",
- "isOptional": true,
- "cardinality": "SINGLE",
- "valuesMinCount": 0,
- "valuesMaxCount": 1,
- "isUnique": false,
- "isIndexable": false
- }));
- },
- onClickAddAttriBtn: function() {
- this.collectionAttribute();
- if (!('placeholder' in HTMLInputElement.prototype)) {
- this.ui.addAttributeDiv.find('input,textarea').placeholder();
- }
-
- },
- loaderStatus: function(isActive) {
- var that = this;
- if (isActive) {
- parent.$('.namespace-attr-tableOverlay').show();
- parent.$('.namespace-attr-fontLoader').show();
- } else {
- parent.$('.namespace-attr-tableOverlay').hide();
- parent.$('.namespace-attr-fontLoader').hide();
- }
- },
- validateValues: function() {
- var attrNameValidate = true,
- enumValue = true,
- stringValidate = true,
- enumType = true;
-
- this.ui;
- if (this.$el.find(".attributeInput").length > 0) {
- this.$el.find(".attributeInput").each(function() {
- if ($(this).val() === "") {
- $(this).css("borderColor", "red");
- attrNameValidate = false;
- }
- });
- }
- if (this.$el.find(".enumvalue-container").length > 0 && this.$el.find(".enumvalue-container")[0].style.display != 'none') {
- this.$el.find(".enumvalue-container").each(function(index) {
- if (this.style.display != 'none') {
- if ($(this).find(".enumValueSelector").length > 0) {
- $(this).find(".enumValueSelector").each(function(index) {
- if ($(this).val().length === 0) {
- $(this).css("borderColor", "red");
- enumValue = false;
- }
- });
- }
- }
- })
- }
- if (this.$el.find(".enumtype-container").length > 0 && this.$el.find(".enumtype-container")[0].style.display != 'none') {
- this.$el.find(".enumtype-container").each(function(index) {
- if (this.style.display != 'none') {
- if ($(this).find(".enumTypeSelector").length > 0) {
- $(this).find(".enumTypeSelector").each(function(index) {
- if ($(this).val() == null || $(this).val() == '' || $(this).val().length === 0) {
- $(this).css("borderColor", "red");
- enumType = false;
- }
- });
- }
- }
- })
- }
- if (this.$el.find(".stringlength-container").length > 0 && this.$el.find(".stringlength-container")[0].style.display != 'none') {
- this.$el.find(".stringlength-container").each(function(index) {
- if (this.style.display != 'none') {
- if ($(this).find(".stringLengthVal").length > 0) {
- $(this).find(".stringLengthVal").each(function(index) {
- if ($(this).val().length === 0) {
- $(this).css("borderColor", "red");
- stringValidate = false;
- }
- });
- }
- };
- })
- }
-
- this.$el.find(".attributeInput").keyup(function() {
- $(this).css("borderColor", "#e8e9ee");
- });
- if (!attrNameValidate) {
- Utils.notifyInfo({
- content: "Please fill the attributes details"
- });
- return true;
- }
- if (!enumType) {
- Utils.notifyInfo({
- content: "Please enter the Enumeration Name or select another type"
- });
- return true;
- }
- if (!enumValue) {
- Utils.notifyInfo({
- content: "Please enter the Enum values or select another type"
- });
- return true;
- }
- if (!stringValidate) {
- Utils.notifyInfo({
- content: "Please enter the Max Length for string or select another type"
- });
- return true;
- }
- },
- namespaceAttributes: function(modelEl, obj, elementValues) {
- obj.options = {
- "applicableEntityTypes": JSON.stringify(modelEl.find(".entityTypeSelector").val()),
- "maxStrLength": modelEl.find(".stringLengthVal").val() ? modelEl.find(".stringLengthVal").val() : "0"
- };
-
- if (obj.typeName != "string" && obj.typeName != "boolean" && obj.typeName != "byte" && obj.typeName != "short" && obj.typeName != "int" && obj.typeName != "float" && obj.typeName != "double" && obj.typeName != "long" && obj.typeName != "date") {
- var enumName = enumDefCollection.fullCollection.findWhere({ name: obj.typeName });
- if (enumName) {
- var enumDef = enumName.get('elementDefs');
- if (enumDef.length === obj.enumValues.length) {
- _.each(enumDef, function(enumVal, index) {
- if (obj.enumValues.indexOf(enumVal.value) === -1) {
- this.isPutCall = true;
- };
- })
- } else {
- this.isPutCall = true;
- }
- } else {
- this.isPostCallEnum = true;
- }
-
- _.each(obj.enumValues, function(inputEnumVal, index) {
- elementValues.push({
- "ordinal": index + 1,
- "value": inputEnumVal
- })
- });
- }
- if (obj.multiValueSelect) {
- obj.multiValued = true;
- obj.typeName = "array<" + obj.typeName + ">";
- }
- },
- highlightAttrinuteName: function(modelEl, obj) {
- Utils.notifyInfo({
- content: "Attribute " + obj.name + " already exist"
- });
- modelEl.find(".attributeInput").css("borderColor", "red");
- this.loaderStatus(false);
- },
- createEnumObject: function(arrayObj, obj, enumVal) {
- return arrayObj.push({
- "name": obj.typeName,
- "elementDefs": enumVal
- });
- },
- onCreateNameSpace: function() {
- var that = this,
- validate = true,
- attrNameValidate = true,
- enumValue = true,
- stringValidate = true,
- enumDefs = [],
- putEnumDef = [],
- attrNames = [],
- isvalidName = true;
- this.checkLoader = 0;
- this.isPutCall = false;
- this.isPostCallEnum = false;
-
- if (this.validateValues()) {
- return;
- };
- this.loaderStatus(true);
- var name = this.ui.tagName.val(),
- description = _.escape(this.ui.description.val());
- var attributeObj = this.collection.toJSON();
- if (this.collection.length === 1 && this.collection.first().get("name") === "") {
- attributeObj = [];
- }
- if (attributeObj.length) {
- _.each(attributeObj, function(obj) {
- var modelEl = this.$('#' + obj.modalID);
- modelEl.find(".attributeInput").css("borderColor", "transparent");;
- if (attrNames.indexOf(obj.name) > -1) {
- that.highlightAttrinuteName(modelEl, obj);
- isvalidName = false;
- return true;
- } else {
- attrNames.push(obj.name);
- }
- var elementValues = [];
- that.namespaceAttributes(modelEl, obj, elementValues);
- if (that.isPostCallEnum) {
- that.createEnumObject(enumDefs, obj, elementValues);
- }
- if (that.isPutCall) {
- that.createEnumObject(putEnumDef, obj, elementValues);
- }
- });
- var notifyObj = {
- modal: true,
- confirm: {
- confirm: true,
- buttons: [{
- text: "Ok",
- addClass: "btn-atlas btn-md",
- click: function(notice) {
- notice.remove();
- }
- },
- null
- ]
- }
- };
- }
- if (isvalidName) {
- this.json = {
- "enumDefs": enumDefs,
- "structDefs": [],
- "classificationDefs": [],
- "entityDefs": [],
- "namespaceDefs": [{
- "category": "NAMESPACE",
- "createdBy": "admin",
- "updatedBy": "admin",
- "version": 1,
- "typeVersion": "1.1",
- "name": name.trim(),
- "description": description.trim(),
- "attributeDefs": attributeObj
- }]
- };
- var apiObj = {
- sort: false,
- success: function(model, response) {
- var nameSpaveDef = model.namespaceDefs;
- if (nameSpaveDef) {
- that.options.nameSpaceCollection.fullCollection.add(nameSpaveDef);
- Utils.notifySuccess({
- content: "Namespace " + name + Messages.getAbbreviationMsg(false, 'addSuccessMessage')
- });
- }
- that.checkLoader--;
- if (that.checkLoader == 0) {
- that.options.onUpdateNamespace();
- }
- },
- silent: true,
- reset: true,
- complete: function(model, status) {
- attrNames = [];
- that.loaderStatus(false);
- }
- }
- that.checkLoader++;
- $.extend(apiObj, { contentType: 'application/json', dataType: 'json', data: JSON.stringify(that.json) })
- this.options.nameSpaceCollection.constructor.nonCrudOperation.call(this, UrlLinks.nameSpaceApiUrl(), "POST", apiObj);
- if (that.isPutCall) {
- var putData = {
- "enumDefs": putEnumDef
- };
- that.checkLoader++;
- $.extend(apiObj, { contentType: 'application/json', dataType: 'json', data: JSON.stringify(putData) })
- this.options.nameSpaceCollection.constructor.nonCrudOperation.call(this, UrlLinks.typedefsUrl().defs, "PUT", apiObj);
- }
- } else {
- attrNames = [];
- }
-
- },
- onUpdateAttr: function() {
- var that = this,
- attrNameValidate = true,
- enumValue = true,
- stringValidate = true,
- enumDefs = [],
- postEnumDef = [],
- selectedNamespace = $.extend(true, {}, that.options.selectedNamespace.toJSON()),
- attributeDefs = selectedNamespace['attributeDefs'],
- isvalidName = true;
- this.checkLoader = 0;
- this.isPutCall = false;
- this.isPostCallEnum = false;
- if (this.validateValues()) {
- return;
- };
- if (this.$el.find(".namespace-attr").length > 0 && this.collection.length > 0) {
- this.loaderStatus(true);
- if (this.collection.length > 0) {
- this.collection.each(function(model) {
- var obj = model.toJSON(),
- modelEl = this.$('#' + obj.modalID);
- modelEl.find(".attributeInput").css("borderColor", "transparent");
- if (that.options.isNewAttr == true && _.find(attributeDefs, { name: obj.name })) {
- that.highlightAttrinuteName(modelEl, obj);
- isvalidName = false;
- return true;
- }
- var elementValues = [];
- that.namespaceAttributes(modelEl, obj, elementValues);
- if (that.isPostCallEnum) {
- that.createEnumObject(postEnumDef, obj, elementValues);
- } else if (that.isPutCall) {
- that.createEnumObject(enumDefs, obj, elementValues);
- }
-
- if (that.options.isNewAttr == true) {
- selectedNamespace.attributeDefs.push(obj);
- } else {
- var attrDef = selectedNamespace.attributeDefs;
- _.each(attrDef, function(attrObj) {
- if (attrObj.name === that.$el.find(".attributeInput")[0].value) {
- attrObj.name = obj.name;
- attrObj.typeName = obj.typeName;
- attrObj.multiValued = obj.multiValueSelect || false;
- attrObj.options.applicableEntityTypes = obj.options.applicableEntityTypes;
- attrObj.enumValues = obj.enumValues;
- attrObj.options.maxStrLength = obj.options.maxStrLength;
- }
- });
- }
- });
- if (isvalidName) {
- var notifyObj = {
- modal: true,
- confirm: {
- confirm: true,
- buttons: [{
- text: "Ok",
- addClass: "btn-atlas btn-md",
- click: function(notice) {
- notice.remove();
- }
- },
- null
- ]
- }
- };
-
- var putNameSpace = function() {
- that.checkLoader++;
- $.extend(apiObj, { contentType: 'application/json', dataType: 'json', data: JSON.stringify(that.json) })
- that.options.nameSpaceCollection.constructor.nonCrudOperation.call(that, UrlLinks.nameSpaceUpdateUrl(), "PUT", apiObj);
- }
- this.json = {
- "enumDefs": enumDefs,
- "structDefs": [],
- "classificationDefs": [],
- "entityDefs": [],
- "namespaceDefs": that.options.isNewAttr ? [selectedNamespace] : [selectedNamespace]
- };
- var apiObj = {
- sort: false,
- success: function(model, response) {
- if (model.namespaceDefs.length === 0 && model.enumDefs.length) {
- putNameSpace();
- } else {
- var selectedNameSpace = that.options.nameSpaceCollection.fullCollection.findWhere({ guid: that.options.guid });
- Utils.notifySuccess({
- content: "One or more Namespace attribute" + Messages.getAbbreviationMsg(false, 'editSuccessMessage')
- });
- if (model.namespaceDefs && model.namespaceDefs.length) {
- that.options.selectedNamespace.set(model.namespaceDefs[0]);
- }
- that.options.onEditCallback();
- }
- that.checkLoader--;
- if (that.checkLoader == 0) {
- that.options.onUpdateNamespace();
- }
- },
- silent: true,
- reset: true,
- complete: function(model, status) {
- that.loaderStatus(false);
- }
- }
- if (that.isPostCallEnum) {
- var postData = {
- "enumDefs": postEnumDef
- };
- this.checkLoader++;
- $.extend(apiObj, { contentType: 'application/json', dataType: 'json', data: JSON.stringify(postData) })
- this.options.nameSpaceCollection.constructor.nonCrudOperation.call(this, UrlLinks.typedefsUrl().defs, "POST", apiObj);
- } else {
- putNameSpace();
- }
- }
- }
- } else {
- Utils.notifySuccess({
- content: "No attribute updated"
- });
- this.loaderStatus(false);
- that.options.onUpdateNamespace();
- }
- }
- });
- return CreateNameSpaceLayoutView;
-});
\ No newline at end of file
diff --git a/dashboardv3/public/js/views/name_space/NameSpaceContainerLayoutView.js b/dashboardv3/public/js/views/name_space/NameSpaceContainerLayoutView.js
deleted file mode 100644
index a68715b..0000000
--- a/dashboardv3/public/js/views/name_space/NameSpaceContainerLayoutView.js
+++ /dev/null
@@ -1,117 +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.
- */
-
-define([
- "require",
- "backbone",
- "hbs!tmpl/name_space/NameSpaceContainerLayoutView_tmpl",
- 'collection/VEntityList',
- "utils/Utils",
- "utils/Messages",
- "utils/Globals",
- "utils/UrlLinks",
- "models/VTag"
-], function(require, Backbone, NameSpaceContainerLayoutViewTmpl, VEntityList, Utils, Messages, Globals, UrlLinks, VTag) {
- "use strict";
-
- var NameSpaceContainerLayoutView = Backbone.Marionette.LayoutView.extend(
- /** @lends NameSpaceContainerLayoutView */
- {
- _viewName: "NameSpaceContainerLayoutView",
-
- template: NameSpaceContainerLayoutViewTmpl,
-
- /** Layout sub regions */
- regions: {
- RNameSpaceDetailContainer: "#r_nameSpaceDetailContainer",
- RNameSpaceAttrContainer: "#r_nameSpaceAttrContainer"
- },
-
- /** ui selector cache */
- ui: {},
- /** ui events hash */
- events: function() {},
- /**
- * intialize a new TagLayoutView Layout
- * @constructs
- */
- initialize: function(options) {
- _.extend(this.options, options);
- this.selectedNameSpace = new VEntityList();
- this.selectedNameSpace.url = UrlLinks.nameSpaceGuidApiUrl(this.options.namespaceID);
- this.nameSpaceAttr = new VEntityList();
- },
- bindEvents: function() {},
- onRender: function() {
- this.fetchNameSpaceGuid();
- this.options.nameSpaceCollection.fullCollection.sort({ silent: true });
- this.options.nameSpaceCollection.comparator = function(model) {
- return -model.get('timestamp');
- }
- this.renderNameSpaceDetailLayoutView(this.options);
- this.renderNameSpaceAttrLayoutView(this.options);
- },
- fetchNameSpaceGuid: function() {
- var that = this;
- this.selectedNameSpace.fetch({
- complete: function(model, status) {
- that.nameSpaceAttr.fullCollection.add(model.responseJSON.attributeDefs);
- }
- });
- },
- renderNameSpaceDetailLayoutView: function(options) {
- var that = this;
- require(["views/name_space/NameSpaceDetailLayoutView"], function(NameSpaceDetailLayoutView) {
- if (that.isDestroyed) {
- return;
- }
- that.RNameSpaceDetailContainer.show(
- new NameSpaceDetailLayoutView({
- nameSpaceVent: that.options.nameSpaceVent,
- nameSpaceCollection: that.options.nameSpaceCollection,
- nameSpaceAttr: that.nameSpaceAttr,
- guid: that.options.namespaceID,
- enumDefCollection: that.enumDefCollection,
- typeHeaders: that.typeHeaders
- })
- );
- });
- },
- renderNameSpaceAttrLayoutView: function(options) {
- var that = this;
- require(['views/name_space/NameSpaceAttrTableLayoutView'], function(NameSpaceAttrTableLayoutView) {
- if (that.isDestroyed) {
- return;
- }
- that.RNameSpaceAttrContainer.show(
- new NameSpaceAttrTableLayoutView({
- nameSpaceVent: that.options.nameSpaceVent,
- nameSpaceCollection: that.options.nameSpaceCollection,
- nameSpaceAttr: that.nameSpaceAttr,
- guid: that.options.namespaceID,
- typeHeaders: that.typeHeaders,
- enumDefCollection: that.enumDefCollection,
- selectedNameSpace: that.selectedNameSpace,
- entityDefCollection: that.options.entityDefCollection
- }));
- });
- }
- }
- );
- return NameSpaceContainerLayoutView;
-});
\ No newline at end of file
diff --git a/dashboardv3/public/js/views/name_space/NameSpaceDetailLayoutView.js b/dashboardv3/public/js/views/name_space/NameSpaceDetailLayoutView.js
deleted file mode 100644
index 59f3b94..0000000
--- a/dashboardv3/public/js/views/name_space/NameSpaceDetailLayoutView.js
+++ /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.
- */
-
-define(['require',
- 'backbone',
- 'hbs!tmpl/name_space/NameSpaceDetailLayoutView_tmpl',
- 'utils/Utils',
- 'views/tag/AddTagAttributeView',
- 'collection/VTagList',
- 'models/VTag',
- 'utils/Messages',
- 'utils/UrlLinks',
- "utils/Globals",
-], function(require, Backbone, NameSpaceDetailLayoutViewTmpl, Utils, AddTagAttributeView, VTagList, VTag, Messages, UrlLinks, Globals) {
- 'use strict';
-
- var NameSpaceDetailLayoutView = Backbone.Marionette.LayoutView.extend(
- /** @lends NameSpaceDetailLayoutView */
- {
- template: NameSpaceDetailLayoutViewTmpl,
- /** Layout sub regions */
- regions: {},
- /** ui selector cache */
- ui: {
- title: '[data-id="title"]',
- editBox: '[data-id="editBox"]',
- saveButton: "[data-id='saveButton']",
- description: '[data-id="description"]',
- publishButton: '[data-id="publishButton"]',
- backButton: '[data-id="backButton"]'
- },
- /** ui events hash */
- events: function() {
- var events = {};
- events["click " + this.ui.backButton] = function() {
- Utils.backButtonClick();
- };
- return events;
- },
- /**
- * intialize a new NameSpaceDetailLayoutView Layout
- * @constructs
- */
- initialize: function(options) {
- _.extend(this, _.pick(options, 'guid', 'entity', 'entityName', 'attributeDefs', 'enumDefCollection', 'typeHeaders', 'nameSpaceCollection', 'selectedNameSpace', 'nameSpaceAttr'));
-
- },
- bindEvents: function() {
- this.listenTo(this.nameSpaceCollection, 'reset', function() {
- if (!this.model) {
- this.model = this.nameSpaceCollection.fullCollection.findWhere({ guid: this.guid });
- if (this.model) {
- this.renderTagDetail();
- } else {
- this.$('.fontLoader').hide();
- Utils.notifyError({
- content: 'Tag Not Found'
- });
- }
- }
- }, this);
- this.listenTo(this.collection, 'error', function(error, response) {
- if (response.responseJSON && response.responseJSON.error) {
- Utils.notifyError({
- content: response.responseJSON.error
- });
- } else {
- Utils.notifyError({
- content: 'Something went wrong'
- });
- }
- this.$('.fontLoader').hide();
- }, this);
- },
- onRender: function() {
- if (this.nameSpaceCollection.models.length && !this.model) {
- this.model = this.nameSpaceCollection.fullCollection.findWhere({ guid: this.guid });
- Utils.showTitleLoader(this.$('.page-title .fontLoader'), this.$('.tagDetail'));
- this.renderTagDetail();
- }
- this.bindEvents();
- },
- renderTagDetail: function() {
- var that = this,
- attributeData = "";
- this.attributeDefs = this.model.get('attributeDefs');
- this.ui.title.html('<span>' + that.model.get('name') + '</span>');
- if (that.model.get('description')) {
- this.ui.description.text((that.model.get('description')));
- }
- Utils.hideTitleLoader(this.$('.fontLoader'), this.$('.tagDetail'));
- }
- });
- return NameSpaceDetailLayoutView;
-});
\ No newline at end of file
diff --git a/dashboardv3/public/js/views/search/QueryBuilderView.js b/dashboardv3/public/js/views/search/QueryBuilderView.js
index c68087a..a96f39c 100644
--- a/dashboardv3/public/js/views/search/QueryBuilderView.js
+++ b/dashboardv3/public/js/views/search/QueryBuilderView.js
@@ -54,18 +54,7 @@ define(['require',
* @constructs
*/
initialize: function(options) {
- _.extend(this, _.pick(options,
- 'attrObj',
- 'value',
- 'typeHeaders',
- 'entityDefCollection',
- 'enumDefCollection',
- 'classificationDefCollection',
- 'nameSpaceCollection',
- 'tag',
- 'type',
- 'searchTableFilters',
- 'systemAttrArr'));
+ _.extend(this, _.pick(options, 'attrObj', 'value', 'typeHeaders', 'entityDefCollection', 'enumDefCollection', 'classificationDefCollection', 'tag', 'type', 'searchTableFilters', 'systemAttrArr'));
this.attrObj = _.sortBy(this.attrObj, 'name');
//this.systemAttrArr = _.sortBy(this.systemAttrArr, 'name');
this.filterType = this.tag ? 'tagFilters' : 'entityFilters';
@@ -368,21 +357,21 @@ define(['require',
});
if (this.type) {
var entityDef = this.entityDefCollection.fullCollection.find({ name: that.options.applicableType }),
- namespaceAttributeDefs = null;
+ businessMetadataAttributeDefs = null;
if (entityDef) {
- namespaceAttributeDefs = entityDef.get("namespaceAttributeDefs");
+ BusinessMetadataAttributeDefs = entityDef.get("businessAttributeDefs");
}
- if (namespaceAttributeDefs) {
- _.each(namespaceAttributeDefs, function(attributes, key) {
+ if (BusinessMetadataAttributeDefs) {
+ _.each(BusinessMetadataAttributeDefs, function(attributes, key) {
var sortedAttributes = _.sortBy(attributes, function(obj) {
return obj.name;
});
_.each(sortedAttributes, function(attrDetails) {
- var returnObj = that.getObjDef(attrDetails, rules_widgets, isGroupView, 'Select Namespace Attribute', true);
+ var returnObj = that.getObjDef(attrDetails, rules_widgets, isGroupView, 'Select Business Metadata Attribute', true);
if (returnObj) {
returnObj.id = key + "." + returnObj.id;
returnObj.label = key + ": " + returnObj.label;
- returnObj.data = { 'entityType': "namespace" };
+ returnObj.data = { 'entityType': "businessMetadata" };
filters.push(returnObj);
}
});
diff --git a/dashboardv3/public/js/views/search/SearchDefaultLayoutView.js b/dashboardv3/public/js/views/search/SearchDefaultLayoutView.js
index 25c36a2..3c0d813 100644
--- a/dashboardv3/public/js/views/search/SearchDefaultLayoutView.js
+++ b/dashboardv3/public/js/views/search/SearchDefaultLayoutView.js
@@ -243,7 +243,7 @@ define(["require", "backbone", "utils/Globals", "hbs!tmpl/search/SearchDefaultLa
enumDefCollection: that.options.enumDefCollection,
typeHeaders: that.options.typeHeaders,
classificationDefCollection: that.options.classificationDefCollection,
- nameSpaceCollection: that.options.nameSpaceCollection,
+ businessMetadataDefCollection: that.options.businessMetadataDefCollection,
searchTableFilters: that.checkEntityFilter(that.options)
};
if (that.options.value) {
@@ -365,8 +365,8 @@ define(["require", "backbone", "utils/Globals", "hbs!tmpl/search/SearchDefaultLa
if (_.has(obj, "condition")) {
return that.getIdFromRuleObj(obj);
} else {
- if ((obj && obj.data && obj.data.entityType === "namespace") || obj.id.indexOf(".") > -1) {
- return col.add("namespace");
+ if ((obj && obj.data && obj.data.entityType === "businessMetadata") || obj.id.indexOf(".") > -1) {
+ return col.add("businessMetadata");
} else {
return col.add(obj.id);
}
@@ -382,7 +382,7 @@ define(["require", "backbone", "utils/Globals", "hbs!tmpl/search/SearchDefaultLa
if (!this.options.searchTableColumns[this.options.value.type]) {
this.options.searchTableColumns[this.options.value.type] = ["selected", "name", "description", "typeName", "owner", "tag", "term"];
}
- this.options.searchTableColumns[this.options.value.type] = _.sortBy(_.union(_.without(this.options.searchTableColumns[this.options.value.type], "namespace"), this.getIdFromRuleObj(rule)));
+ this.options.searchTableColumns[this.options.value.type] = _.sortBy(_.union(_.without(this.options.searchTableColumns[this.options.value.type], "businessMetadata"), this.getIdFromRuleObj(rule)));
}
},
renderQueryBuilder: function(obj, rQueryBuilder) {
diff --git a/dashboardv3/public/js/views/search/SearchFilterBrowseLayoutView.js b/dashboardv3/public/js/views/search/SearchFilterBrowseLayoutView.js
index b299140..9e5fe64 100644
--- a/dashboardv3/public/js/views/search/SearchFilterBrowseLayoutView.js
+++ b/dashboardv3/public/js/views/search/SearchFilterBrowseLayoutView.js
@@ -37,7 +37,7 @@ define([
RClassificationTreeRender: '[data-id="r_classificationTreeRender"]',
REntityTreeRender: '[data-id="r_entityTreeRender"]',
RCustomFilterTreeRender: '[data-id="r_customFilterTreeRender"]',
- RNameSpaceTreeRender: '[data-id="r_nameSpaceTreeRender"]'
+ RBusinessMetadataTreeRender: '[data-id="r_businessMetadataTreeRender"]'
},
ui: {
//search
@@ -82,7 +82,7 @@ define([
this.classificationSearchTree = this.$('[data-id="classificationSearchTree"]');
this.termSearchTree = this.$('[data-id="termSearchTree"]');
this.customFilterSearchTree = this.$('[data-id="customFilterSearchTree"]');
- this.nameSpaceSearchTree = this.$('[data-id="nameSpaceSearchTree"]');
+ this.businessMetadataSearchTree = this.$('[data-id="businessMetadataSearchTree"]');
this.entitySearchTree.jstree(true).show_all();
this.entitySearchTree.jstree("search", searchString);
this.classificationSearchTree.jstree(true).show_all();
@@ -91,8 +91,8 @@ define([
this.termSearchTree.jstree("search", searchString);
this.customFilterSearchTree.jstree(true).show_all();
this.customFilterSearchTree.jstree("search", searchString);
- this.nameSpaceSearchTree.jstree(true).show_all();
- this.nameSpaceSearchTree.jstree("search", searchString);
+ this.businessMetadataSearchTree.jstree(true).show_all();
+ this.businessMetadataSearchTree.jstree("search", searchString);
};
@@ -128,7 +128,7 @@ define([
this.renderClassificationTree(opt);
this.renderGlossaryTree(opt);
this.renderCustomFilterTree();
- this.renderNameSpaceTree();
+ this.renderBusinessMetadataTree();
this.showHideGlobalFilter();
this.showDefaultPage();
},
@@ -201,8 +201,8 @@ define([
if (options) {
_.extend(this.options, options);
this.showHideGlobalFilter();
- if (this.RNameSpaceTreeRender.currentView) {
- this.RNameSpaceTreeRender.currentView.manualRender(this.options);
+ if (this.RBusinessMetadataTreeRender.currentView) {
+ this.RBusinessMetadataTreeRender.currentView.manualRender(this.options);
}
if (this.RCustomFilterTreeRender.currentView) {
this.RCustomFilterTreeRender.currentView.manualRender(this.options);
@@ -242,10 +242,10 @@ define([
that.RCustomFilterTreeRender.show(new CustomFilterTreeLayoutView(_.extend({ query: that.query }, that.options)));
});
},
- renderNameSpaceTree: function() {
+ renderBusinessMetadataTree: function() {
var that = this;
- require(["views/search/tree/NameSpaceTreeLayoutView"], function(NameSpaceTreeLayoutView) {
- that.RNameSpaceTreeRender.show(new NameSpaceTreeLayoutView(_.extend({ query: that.query }, that.options)));
+ require(["views/search/tree/BusinessMetadataTreeLayoutView"], function(BusinessMetadataTreeLayoutView) {
+ that.RBusinessMetadataTreeRender.show(new BusinessMetadataTreeLayoutView(_.extend({ query: that.query }, that.options)));
});
}
});
diff --git a/dashboardv3/public/js/views/search/SearchResultLayoutView.js b/dashboardv3/public/js/views/search/SearchResultLayoutView.js
index e45c5b5..3741bc0 100644
--- a/dashboardv3/public/js/views/search/SearchResultLayoutView.js
+++ b/dashboardv3/public/js/views/search/SearchResultLayoutView.js
@@ -365,7 +365,7 @@ define(['require',
this.searchTableColumns[this.value.type] = listOfColumns.length ? listOfColumns : null;
}
} else if (this.value && this.value.type && this.searchTableColumns && this.value.attributes) {
- this.searchTableColumns[this.value.type] = this.value.entityFilters ? this.value.attributes.split(",") : this.value.attributes.replace("namespace,", "").split(",");
+ this.searchTableColumns[this.value.type] = this.value.entityFilters ? this.value.attributes.split(",") : this.value.attributes.replace("businessMetadata,", "").split(",");
}
},
fetchCollection: function(value, options) {
@@ -648,8 +648,7 @@ define(['require',
var that = this,
nameCheck = 0,
columnToShow = null,
- col = {},
- namespaceRenderable = false;
+ col = {};
this.value = Utils.getUrlState.getQueryParams() || this.value;
if (this.value && this.value.searchType === "basic" && this.searchTableColumns && (this.searchTableColumns[this.value.type] !== undefined)) {
columnToShow = this.searchTableColumns[this.value.type] == null ? [] : this.searchTableColumns[this.value.type];
@@ -794,25 +793,25 @@ define(['require',
}
})
};
- col['namespace'] = {
- label: "Namespaces",
+ col['businessMetaData'] = {
+ label: "Business MetaData",
cell: "Html",
editable: false,
resizeable: true,
orderable: true,
alwaysVisible: true, //Backgrid.ColumnManager.js -> render() to hide the name in dropdownlist
- renderable: _.contains(columnToShow, 'namespace'),
+ renderable: _.contains(columnToShow, 'businessMetaData'),
formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
fromRaw: function(rawValue, model) {
var obj = model.toJSON(),
- namespaceStr = '';
+ businessMetadataStr = '';
if (obj && obj.attributes) {
- _.each(obj.attributes, function(namespaceValue, attributeName) {
+ _.each(obj.attributes, function(businessMetadataValue, attributeName) {
if (attributeName.indexOf('.') != -1) {
var isDate = false,
- namespace = that.options.nameSpaceCollection.fullCollection.find({ "name": attributeName.split('.')[0] });
- if (namespace) {
- var getAttributes = namespace.get('attributeDefs');
+ businessMetadata = that.options.businessMetadataDefCollection.fullCollection.find({ "name": attributeName.split('.')[0] });
+ if (businessMetadata) {
+ var getAttributes = businessMetadata.get('attributeDefs');
getAttributes.every(function(attrTypeCheck) {
if (attributeName.split('.')[1] === attrTypeCheck.name && attrTypeCheck.typeName.indexOf("date") > -1) {
isDate = true;
@@ -821,12 +820,12 @@ define(['require',
});
}
if (isDate) {
- namespaceValue = moment(namespaceValue).format("MM/DD/YYYY")
+ businessMetadataValue = moment(businessMetadataValue).format("MM/DD/YYYY")
}
- namespaceStr += '<label class="btn btn-action btn-xs btn-blue no-pointer">' + attributeName + ': ' + namespaceValue + '</label>';
+ businessMetadataStr += '<label class="btn btn-action btn-xs btn-blue no-pointer">' + attributeName + ': ' + businessMetadataValue + '</label>';
}
})
- return namespaceStr;
+ return businessMetadataStr;
}
}
})
diff --git a/dashboardv3/public/js/views/search/tree/NameSpaceTreeLayoutView.js b/dashboardv3/public/js/views/search/tree/BusinessMetadataTreeLayoutView.js
similarity index 73%
rename from dashboardv3/public/js/views/search/tree/NameSpaceTreeLayoutView.js
rename to dashboardv3/public/js/views/search/tree/BusinessMetadataTreeLayoutView.js
index c9afe7d..32374a8 100644
--- a/dashboardv3/public/js/views/search/tree/NameSpaceTreeLayoutView.js
+++ b/dashboardv3/public/js/views/search/tree/BusinessMetadataTreeLayoutView.js
@@ -17,7 +17,7 @@
*/
define([
"require",
- "hbs!tmpl/search/tree/NameSpaceTreeLayoutView_tmpl",
+ "hbs!tmpl/search/tree/BusinessMetadataTreeLayoutView_tmpl",
"utils/Utils",
"utils/Messages",
"utils/Globals",
@@ -27,11 +27,11 @@ define([
"collection/VGlossaryList",
"utils/Enums",
"jstree"
-], function(require, NameSpaceTreeLayoutViewTmpl, Utils, Messages, Globals, UrlLinks, CommonViewFunction, VSearchList, VGlossaryList, Enums) {
+], function(require, BusinessMetadataTreeLayoutViewTmpl, Utils, Messages, Globals, UrlLinks, CommonViewFunction, VSearchList, VGlossaryList, Enums) {
"use strict";
- var NameSpaceTreeLayoutView = Marionette.LayoutView.extend({
- template: NameSpaceTreeLayoutViewTmpl,
+ var BusinessMetadataTreeLayoutView = Marionette.LayoutView.extend({
+ template: BusinessMetadataTreeLayoutViewTmpl,
regions: {},
ui: {
@@ -39,10 +39,10 @@ define([
refreshTree: '[data-id="refreshTree"]',
// tree el
- nameSpaceSearchTree: '[data-id="nameSpaceSearchTree"]',
+ businessMetadataSearchTree: '[data-id="businessMetadataSearchTree"]',
// Create
- createNameSpace: '[data-id="createNameSpace"]'
+ createBusinessMetadata: '[data-id="createBusinessMetadata"]'
},
templateHelpers: function() {
return {
@@ -54,14 +54,13 @@ define([
that = this;
// refresh individual tree
events["click " + this.ui.refreshTree] = function(e) {
- var type = $(e.currentTarget).data("type");
e.stopPropagation();
- that.refresh({ type: type });
+ that.refresh();
};
- events["click " + this.ui.createNameSpace] = function(e) {
+ events["click " + this.ui.createBusinessMetadata] = function(e) {
e.stopPropagation();
- that.triggerUrl("#!/administrator?tabActive=namespace");
+ that.triggerUrl("#!/administrator?tabActive=bm");
};
return events;
@@ -73,52 +72,48 @@ define([
_.pick(
options,
"typeHeaders",
- "namespaceID",
+ "guid",
"searchVent",
"entityDefCollection",
"enumDefCollection",
- "nameSpaceCollection",
+ "businessMetadataDefCollection",
"searchTableColumns",
"searchTableFilters",
- "metricCollection",
- "nameSpaceCollection"
+ "metricCollection"
)
);
this.bindEvents();
},
onRender: function() {
- this.renderNameSpaceTree();
- //this.createNameSpaceAction();
+ this.renderBusinessMetadataTree();
+ //this.createBusinessMetadataAction();
},
bindEvents: function() {
var that = this;
this.listenTo(
- this.nameSpaceCollection.fullCollection,
+ this.businessMetadataDefCollection.fullCollection,
"reset add remove",
function() {
- if (this.ui.nameSpaceSearchTree.jstree(true)) {
- that.ui.nameSpaceSearchTree.jstree(true).refresh();
+ if (this.ui.businessMetadataSearchTree.jstree(true)) {
+ that.ui.businessMetadataSearchTree.jstree(true).refresh();
} else {
- this.renderNameSpaceTree();
+ this.renderBusinessMetadataTree();
}
},
this
);
- // this.options.nameSpaceVent.on("Save:NamespaceAttribute", function(data) {
- // that.ui.nameSpaceSearchTree.jstree(true).refresh();
- // });
- $("body").on("click", ".namespacePopoverOptions li", function(e) {
- that.$(".nameSpacePopover").popover("hide");
- that[$(this).find("a").data("fn") + "NameSpace"](e);
+ $("body").on("click", ".businessMetadataPopoverOptions li", function(e) {
+ that.$(".businessMetadataPopover").popover("hide");
+ that[$(this).find("a").data("fn") + "BusinessMetadata"](e);
});
},
- createNameSpaceAction: function() {
+ createBusinessMetadataAction: function() {
var that = this;
Utils.generatePopover({
el: this.$el,
- contentClass: "namespacePopoverOptions",
+ contentClass: "businessMetadataPopoverOptions",
popoverOptions: {
- selector: ".nameSpacePopover",
+ selector: ".businessMetadataPopover",
content: function() {
var type = $(this).data("detail"),
liString =
@@ -128,25 +123,25 @@ define([
}
});
},
- renderNameSpaceTree: function() {
+ renderBusinessMetadataTree: function() {
this.generateSearchTree({
- $el: this.ui.nameSpaceSearchTree
+ $el: this.ui.businessMetadataSearchTree
});
},
manualRender: function(options) {
var that = this;
_.extend(this, options);
- if (Utils.getUrlState.isAdministratorTab() && this.namespaceID) {
- this.ui.nameSpaceSearchTree.jstree(true).select_node(this.namespaceID);
+ if (Utils.getUrlState.isAdministratorTab() && this.guid) {
+ this.ui.businessMetadataSearchTree.jstree(true).select_node(this.guid);
} else {
- this.ui.nameSpaceSearchTree.jstree(true).deselect_all();
- this.namespaceID = null;
+ this.ui.businessMetadataSearchTree.jstree(true).deselect_all();
+ this.guid = null;
}
},
onNodeSelect: function(nodeData) {
var that = this,
options = nodeData.node.original,
- url = "#!/administrator/namespace",
+ url = "#!/administrator/businessMetadata",
trigger = true,
queryParams = Utils.getUrlState.getQueryParams();
@@ -154,7 +149,7 @@ define([
url += "/" + options.id;
}
- if (queryParams && queryParams.from === "namespace" && Utils.getUrlState.getQueryUrl().queyParams[0] === url) {
+ if (queryParams && queryParams.from === "bm" && Utils.getUrlState.getQueryUrl().queyParams[0] === url) {
trigger = false;
}
if (trigger) {
@@ -162,11 +157,11 @@ define([
}
},
- onViewEditNameSpace: function() {
- var selectedNode = this.ui.nameSpaceSearchTree.jstree("get_selected", true);
+ onViewEditBusinessMetadata: function() {
+ var selectedNode = this.ui.businessMetadataSearchTree.jstree("get_selected", true);
if (selectedNode && selectedNode[0]) {
selectedNode = selectedNode[0];
- var url = "#!/administrator?tabActive=namespace";
+ var url = "#!/administrator?tabActive=bm";
if (selectedNode.parent && selectedNode.original && selectedNode.original.name) {
url += "&ns=" + selectedNode.parent + "&nsa=" + selectedNode.original.name;
this.triggerUrl(url);
@@ -183,22 +178,22 @@ define([
},
refresh: function(options) {
var that = this;
- this.nameSpaceCollection.fetch({
+ this.businessMetadataDefCollection.fetch({
silent: true,
complete: function() {
- that.nameSpaceCollection.fullCollection.comparator = function(model) {
+ that.businessMetadataDefCollection.fullCollection.comparator = function(model) {
return model.get("name").toLowerCase();
};
- that.nameSpaceCollection.fullCollection.sort({ silent: true });
- that.ui.nameSpaceSearchTree.jstree(true).refresh();
+ that.businessMetadataDefCollection.fullCollection.sort({ silent: true });
+ that.ui.businessMetadataSearchTree.jstree(true).refresh();
}
});
},
- getNameSpaceTree: function(options) {
+ getBusinessMetadataTree: function(options) {
var that = this,
- nameSpaceList = [],
+ businessMetadataList = [],
allCustomFilter = [],
- namsSpaceTreeData = that.nameSpaceCollection.fullCollection.models,
+ namsSpaceTreeData = that.businessMetadataDefCollection.fullCollection.models,
openClassificationNodesState = function(treeDate) {
if (treeDate.length == 1) {
_.each(treeDate, function(model) {
@@ -211,31 +206,31 @@ define([
nodeStructure = {
text: attrNode ? _.escape(nodeOptions.name) : _.escape(nodeOptions.get("name")),
name: attrNode ? _.escape(nodeOptions.name) : _.escape(nodeOptions.get("name")),
- type: "nameSpace",
+ type: "businessMetadata",
id: attrNode ? _.escape(nodeOptions.name) : nodeOptions.get("guid"),
icon: attrNode ? "fa fa-file-o" : "fa fa-folder-o",
children: [],
- state: { selected: nodeOptions.get("guid") === that.namespaceID },
- gType: "NameSpace",
+ state: { selected: nodeOptions.get("guid") === that.guid },
+ gType: "BusinessMetadata",
model: nodeOptions
};
return nodeStructure;
};
_.each(namsSpaceTreeData, function(filterNode) {
- nameSpaceList.push(generateNode(filterNode));
+ businessMetadataList.push(generateNode(filterNode));
});
var treeView = [{
icon: "fa fa-folder-o",
- gType: "nameSpace",
- type: "nameSpaceFolder",
- children: nameSpaceList,
- text: "Namespace",
- name: "Namespace",
+ gType: "businessMetadata",
+ type: "businessMetadataFolder",
+ children: businessMetadataList,
+ text: "BusinessMetadata",
+ name: "BusinessMetadata",
state: { opened: true }
}];
var customFilterList = treeView;
- return nameSpaceList;
+ return businessMetadataList;
},
generateSearchTree: function(options) {
var $el = options && options.$el,
@@ -246,7 +241,7 @@ define([
plugins: ["search", "core", "sort", "conditionalselect", "changed", "wholerow", "node_customize"],
conditionalselect: function(node) {
var type = node.original.type;
- if (type == "nameSpaceFolder") {
+ if (type == "businessMetadataFolder") {
if (node.children.length) {
return false;
} else {
@@ -268,7 +263,7 @@ define([
if (node.parent === "#") {
$(el).append('<div class="tools"><i class="fa"></i></div>');
} else {
- $(el).append('<div class="tools"><i class="fa fa-ellipsis-h nameSpacePopover" rel="popover"></i></div>');
+ $(el).append('<div class="tools"><i class="fa fa-ellipsis-h businessMetadataPopover" rel="popover"></i></div>');
}
}
},
@@ -276,7 +271,7 @@ define([
multiple: false,
data: function(node, cb) {
if (node.id === "#") {
- cb(that.getNameSpaceTree());
+ cb(that.getBusinessMetadataTree());
}
}
}
@@ -322,5 +317,5 @@ define([
});
}
});
- return NameSpaceTreeLayoutView;
+ return BusinessMetadataTreeLayoutView;
});
\ No newline at end of file