Commit 3d0fcedb by kevalbhatt Committed by Sarath Subramanian

ATLAS-3656 : UI: Rename type Namespace to BusinessMetadata

parent aa4bbb08
...@@ -15,15 +15,15 @@ ...@@ -15,15 +15,15 @@
// limitations under the License. // limitations under the License.
/* namespace */ /* business-metadata */
.namespace-tree-parent { .business-metadata-tree-parent {
padding: 0px; padding: 0px;
>li:first-child { >li:first-child {
font-weight: 600; font-weight: 600;
} }
.namespace-tree-child { .business-metadata-tree-child {
&.entity-detail-table table { &.entity-detail-table table {
td { td {
&:nth-child(1) { &:nth-child(1) {
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
} }
} }
.namespace-options.dropdown { .business-metadata-options.dropdown {
.dropdown-menu { .dropdown-menu {
min-width: 100px; min-width: 100px;
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
} }
} }
.namespace-options.dropdown.open { .business-metadata-options.dropdown.open {
.btn-action { .btn-action {
background-color: $color_jungle_green_approx; background-color: $color_jungle_green_approx;
border: 1px solid $color_jungle_green_approx; border: 1px solid $color_jungle_green_approx;
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
} }
} }
.namespace-details { .business-metadata-details {
.expandable .attr-details { .expandable .attr-details {
max-height: 300px; max-height: 300px;
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
} }
.tab-pane { .tab-pane {
.namespace-attr-page { .business-metadata-attr-page {
position: absolute; position: absolute;
top: 0px; top: 0px;
left: 0px; left: 0px;
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
} }
} }
.namespace-attr-page { .business-metadata-attr-page {
.form-horizontal { .form-horizontal {
padding: 10px 22px; padding: 10px 22px;
// border: 1px solid #DEDEDE; // border: 1px solid #DEDEDE;
...@@ -108,21 +108,21 @@ ...@@ -108,21 +108,21 @@
padding-right: 10px; padding-right: 10px;
} }
.namespace-attr { .business-metadata-attr {
border: 1px solid #DEDEDE; border: 1px solid #DEDEDE;
padding: 10px 20px padding: 10px 20px
} }
} }
} }
.namespace-attr-fontLoader { .business-metadata-attr-fontLoader {
position: absolute; position: absolute;
top: 50%; top: 50%;
left: 50%; left: 50%;
display: none; display: none;
} }
.namespace-attr-tableOverlay { .business-metadata-attr-tableOverlay {
position: absolute; position: absolute;
width: 100%; width: 100%;
height: 100%; height: 100%;
...@@ -132,7 +132,7 @@ ...@@ -132,7 +132,7 @@
opacity: 0.2; opacity: 0.2;
} }
.name-space-details { .business-metadata-details {
.backgrid { .backgrid {
td.expandable-content { td.expandable-content {
max-width: none; max-width: none;
...@@ -152,7 +152,7 @@ ...@@ -152,7 +152,7 @@
} }
} }
.namespace-attr-page { .business-metadata-attr-page {
.modal-footer { .modal-footer {
text-align: center; text-align: center;
} }
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
@import "profile-table.scss"; @import "profile-table.scss";
@import "glossary.scss"; @import "glossary.scss";
@import "wizard.scss"; @import "wizard.scss";
@import "namespace.scss"; @import "business-metadata.scss";
@import "stats.scss"; @import "stats.scss";
@import "override.scss"; @import "override.scss";
@import "leftsidebar.scss" @import "leftsidebar.scss"
\ No newline at end of file
...@@ -129,6 +129,9 @@ define(['require', ...@@ -129,6 +129,9 @@ define(['require',
nonCrudOperation: function(url, requestMethod, options) { nonCrudOperation: function(url, requestMethod, options) {
var that = this; var that = this;
options['beforeSend'] = CommonViewFunction.addRestCsrfCustomHeader; 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({ return Backbone.sync.call(this, null, this, _.extend({
url: url, url: url,
type: requestMethod type: requestMethod
......
...@@ -219,10 +219,10 @@ require(['App', ...@@ -219,10 +219,10 @@ require(['App',
this.metricCollection = new VTagList(); this.metricCollection = new VTagList();
this.metricCollection.url = UrlLinks.metricsApiUrl(); this.metricCollection.url = UrlLinks.metricsApiUrl();
this.metricCollection.modelAttrName = "data"; this.metricCollection.modelAttrName = "data";
// nameSpace // businessMetadata
this.nameSpaceCollection = new VEntityList(); this.businessMetadataDefCollection = new VEntityList();
this.nameSpaceCollection.url = UrlLinks.nameSpaceApiUrl(); this.businessMetadataDefCollection.url = UrlLinks.businessMetadataDefApiUrl();
this.nameSpaceCollection.modelAttrName = "namespaceDefs"; this.businessMetadataDefCollection.modelAttrName = "businessMetadataDefs";
App.appRouter = new Router({ App.appRouter = new Router({
entityDefCollection: this.entityDefCollection, entityDefCollection: this.entityDefCollection,
...@@ -230,7 +230,7 @@ require(['App', ...@@ -230,7 +230,7 @@ require(['App',
enumDefCollection: this.enumDefCollection, enumDefCollection: this.enumDefCollection,
classificationDefCollection: this.classificationDefCollection, classificationDefCollection: this.classificationDefCollection,
metricCollection: this.metricCollection, metricCollection: this.metricCollection,
nameSpaceCollection: this.nameSpaceCollection businessMetadataDefCollection: this.businessMetadataDefCollection
}); });
var startApp = function() { var startApp = function() {
...@@ -318,12 +318,12 @@ require(['App', ...@@ -318,12 +318,12 @@ require(['App',
} }
}); });
this.nameSpaceCollection.fetch({ this.businessMetadataDefCollection.fetch({
complete: function() { complete: function() {
that.nameSpaceCollection.fullCollection.comparator = function(model) { that.businessMetadataDefCollection.fullCollection.comparator = function(model) {
return model.get('name').toLowerCase(); return model.get('name').toLowerCase();
}; };
that.nameSpaceCollection.fullCollection.sort({ silent: true }); that.businessMetadataDefCollection.fullCollection.sort({ silent: true });
--that.asyncFetchCounter; --that.asyncFetchCounter;
startApp(); startApp();
} }
......
...@@ -57,6 +57,9 @@ define(['require', 'utils/Utils', 'backbone', 'utils/CommonViewFunction'], funct ...@@ -57,6 +57,9 @@ define(['require', 'utils/Utils', 'backbone', 'utils/CommonViewFunction'], funct
nonCrudOperation: function(url, requestMethod, options) { nonCrudOperation: function(url, requestMethod, options) {
var that = this; var that = this;
options['beforeSend'] = CommonViewFunction.addRestCsrfCustomHeader; 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({ return Backbone.sync.call(this, null, this, _.extend({
url: url, url: url,
type: requestMethod type: requestMethod
......
...@@ -96,20 +96,20 @@ define(['require', ...@@ -96,20 +96,20 @@ define(['require',
}, options); }, options);
return this.constructor.nonCrudOperation.call(this, url, "POST", options); return this.constructor.nonCrudOperation.call(this, url, "POST", options);
}, },
saveNameSpaceAttribute: function(options) { saveBusinessMetadata: function(options) {
var url = UrlLinks.nameSpaceUpdateUrl(); var url = UrlLinks.businessMetadataDefApiUrl();
options = _.extend({ options = _.extend({
contentType: 'application/json', contentType: 'application/json',
dataType: 'json' dataType: 'json'
}, options); }, options);
return this.constructor.nonCrudOperation.call(this, url, 'PUT', options); return this.constructor.nonCrudOperation.call(this, url, '', options);
}, },
deleteNameSpace: function(options) { deleteBusinessMetadata: function(options) {
var url = UrlLinks.nameSpaceUpdateUrl(options.typeName); var url = UrlLinks.businessMetadataDefApiUrl(options.typeName);
return this.constructor.nonCrudOperation.call(this, url, 'DELETE', options); return this.constructor.nonCrudOperation.call(this, url, 'DELETE', options);
}, },
saveNamespaceEntity: function(guid, options) { saveBusinessMetadataEntity: function(guid, options) {
var url = UrlLinks.entitiesNamespaceApiUrl(guid); var url = UrlLinks.entitiesBusinessMetadataApiUrl(guid);
options = _.extend({ options = _.extend({
contentType: 'application/json', contentType: 'application/json',
dataType: 'json' dataType: 'json'
......
...@@ -49,14 +49,14 @@ define([ ...@@ -49,14 +49,14 @@ define([
"!/detailPage/:id": "detailPage", "!/detailPage/:id": "detailPage",
//Audit table //Audit table
'!/administrator': 'administrator', '!/administrator': 'administrator',
'!/administrator/namespace/:id': 'nameSpaceDetailPage', '!/administrator/businessMetadata/:id': 'businessMetadataDetailPage',
// Default // Default
"*actions": "defaultAction" "*actions": "defaultAction"
}, },
initialize: function(options) { initialize: function(options) {
_.extend( _.extend(
this, this,
_.pick(options, "entityDefCollection", "typeHeaders", "enumDefCollection", "classificationDefCollection", "metricCollection", "nameSpaceCollection") _.pick(options, "entityDefCollection", "typeHeaders", "enumDefCollection", "classificationDefCollection", "metricCollection", "businessMetadataDefCollection")
); );
this.showRegions(); this.showRegions();
this.bindCommonEvents(); this.bindCommonEvents();
...@@ -75,7 +75,7 @@ define([ ...@@ -75,7 +75,7 @@ define([
classificationDefCollection: this.classificationDefCollection, classificationDefCollection: this.classificationDefCollection,
glossaryCollection: this.glossaryCollection, glossaryCollection: this.glossaryCollection,
metricCollection: this.metricCollection, metricCollection: this.metricCollection,
nameSpaceCollection: this.nameSpaceCollection businessMetadataDefCollection: this.businessMetadataDefCollection
}; };
this.sharedObj = { this.sharedObj = {
searchTableColumns: {}, searchTableColumns: {},
...@@ -486,7 +486,7 @@ define([ ...@@ -486,7 +486,7 @@ define([
var that = this; var that = this;
require(["views/site/Header", "views/site/SideNavLayoutView", 'views/administrator/AdministratorLayoutView'], function(Header, SideNavLayoutView, AdministratorLayoutView) { require(["views/site/Header", "views/site/SideNavLayoutView", 'views/administrator/AdministratorLayoutView'], function(Header, SideNavLayoutView, AdministratorLayoutView) {
var value = Utils.getUrlState.getQueryParams(), 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(that.getHeaderOptions(Header));
that.renderViewIfNotExists({ that.renderViewIfNotExists({
view: App.rSideNav, view: App.rSideNav,
...@@ -502,13 +502,13 @@ define([ ...@@ -502,13 +502,13 @@ define([
App.rContent.show(new AdministratorLayoutView(paramObj)); App.rContent.show(new AdministratorLayoutView(paramObj));
}); });
}, },
nameSpaceDetailPage: function(namespaceGuid) { businessMetadataDetailPage: function(guid) {
var that = this; 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(); var paramObj = Utils.getUrlState.getQueryParams();
that.renderViewIfNotExists(that.getHeaderOptions(Header)); that.renderViewIfNotExists(that.getHeaderOptions(Header));
var options = _.extend({ var options = _.extend({
namespaceID: namespaceGuid, guid: guid,
value: paramObj, value: paramObj,
searchVent: that.searchVent, searchVent: that.searchVent,
categoryEvent: that.categoryEvent categoryEvent: that.categoryEvent
...@@ -525,7 +525,7 @@ define([ ...@@ -525,7 +525,7 @@ define([
return new SideNavLayoutView(options); return new SideNavLayoutView(options);
} }
}); });
App.rContent.show(new NameSpaceContainerLayoutView(options)); App.rContent.show(new BusinessMetadataContainerLayoutView(options));
}); });
}, },
defaultAction: function(actions) { defaultAction: function(actions) {
......
...@@ -20,15 +20,15 @@ ...@@ -20,15 +20,15 @@
</div> --> </div> -->
<div class="col-sm-12 default-tab"> <div class="col-sm-12 default-tab">
<ul class="nav nav-tabs" data-id="tab-list"> <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> <li role="enum"><a href="#tab-enum" aria-controls="tab-enum" role="tab" data-toggle="tab">Enumerations</a></li>
</ul> </ul>
</div> </div>
</div> </div>
<div> <div>
<div class="tab-content purge-details"> <div class="tab-content purge-details">
<div id="tab-namespace" role="namespace" class="tab-pane active animated fadeIn"> <div id="tab-businessMetadata" role="businessMetadata" class="tab-pane active animated fadeIn">
<div id="r_namespaceTableLayoutView"> <div id="r_businessMetadataTableLayoutView">
</div> </div>
</div> </div>
<div id="tab-enum" role="enum" class="tab-pane animated fadeIn"> <div id="tab-enum" role="enum" class="tab-pane animated fadeIn">
......
...@@ -14,34 +14,34 @@ ...@@ -14,34 +14,34 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
--> -->
<div class="namespace-attr-page" data-id="namespaceAttrPage"> <div class="business-metadata-attr-page" data-id="businessMetadataAttrPage">
<div class="namespace-attr-tableOverlay"></div> <div class="business-metadata-attr-tableOverlay"></div>
<div class=" modal-header" data-id="namespaceAttrPageHeader"> <div class=" modal-header" data-id="businessMetadataAttrPageHeader">
<h4 class="modal-title" data-id="namespaceAttrPageTitle"></h4> <h4 class="modal-title" data-id="businessMetadataAttrPageTitle"></h4>
</div> </div>
<div id="r_modal"> <div id="r_modal">
</div> </div>
<div class="namespace-attr-fontLoader"> <div class="business-metadata-attr-fontLoader">
<i class="fa fa-refresh fa-spin-custom"></i> <i class="fa fa-refresh fa-spin-custom"></i>
</div> </div>
<!-- <div class="modal-footer " data-id="modalFooter"> <!-- <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-action cancel" data-id="businessMetadataAttrPageCancle">Cancel</button>
<button type="button" class="btn btn-atlas ok" data-id="namespaceAttrPageOk">Ok</button> <button type="button" class="btn btn-atlas ok" data-id="businessMetadataAttrPageOk">Ok</button>
</div> --> </div> -->
</div> </div>
<div class="namespace-details" data-id="namespaceDetailPage"> <div class="business-metadata-details" data-id="businessMetadataDetailPage">
<div class="position-relative"> <div class="position-relative">
<div class="pull-right inline-content-fr no-padding-left"> <div class="pull-right inline-content-fr no-padding-left">
<div class="inline" data-id="colManager"></div> <div class="inline" data-id="colManager"></div>
<div class="inline"> <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 <i class='fa fa-plus'></i> Attributes
</button></div> </button></div>
</div> </div>
<div class="tableOverlay"></div> <div class="tableOverlay"></div>
<div class='attr-filter-overlay hide'></div> <div class='attr-filter-overlay hide'></div>
<div class="auditTable name-space-details"> <div class="auditTable business-metadata-details">
<div id="r_nameSpaceAttrTableLayoutView"></div> <div id="r_businessMetadataAttrTableLayoutView"></div>
</div> </div>
</div> </div>
</div> </div>
\ No newline at end of file
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * 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="form-group">
<div class="col-sm-12 attributePlusData " align="right"> <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> <button type="button" class="btn btn-danger btn-sm closeInput" data-id="close"><i class="fa fa-times"></i></button>
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
</div> </div>
</div> </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> <label class="control-label col-sm-3" for="name">Applicable Types</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select class="form-control entityTypeSelector" data-id="entityTypeSelector" multiple="multiple"> <select class="form-control entityTypeSelector" data-id="entityTypeSelector" multiple="multiple">
......
...@@ -15,6 +15,6 @@ ...@@ -15,6 +15,6 @@
* limitations under the License. * limitations under the License.
--> -->
<div> <div>
<div id="r_nameSpaceDetailContainer" class="sidebar-fixed-filter"></div> <div id="r_businessMetadataDetailContainer" class="sidebar-fixed-filter"></div>
<div id="r_nameSpaceAttrContainer" class="col-sm-12"></div> <div id="r_businessMetadataAttrContainer" class="col-sm-12"></div>
</div> </div>
\ No newline at end of file
...@@ -14,34 +14,34 @@ ...@@ -14,34 +14,34 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
--> -->
<div class="namespace-attr-page" data-id="namespaceAttrPage"> <div class="business-metadata-attr-page" data-id="businessMetadataAttrPage">
<div class="namespace-attr-tableOverlay"></div> <div class="business-metadata-attr-tableOverlay"></div>
<div class=" modal-header" data-id="namespaceAttrPageHeader"> <div class=" modal-header" data-id="businessMetadataAttrPageHeader">
<h4 class="modal-title" data-id="namespaceAttrPageTitle"></h4> <h4 class="modal-title" data-id="businessMetadataAttrPageTitle"></h4>
</div> </div>
<div id="r_modal"> <div id="r_modal">
</div> </div>
<div class="namespace-attr-fontLoader"> <div class="business-metadata-attr-fontLoader">
<i class="fa fa-refresh fa-spin-custom"></i> <i class="fa fa-refresh fa-spin-custom"></i>
</div> </div>
<!-- <div class="modal-footer " data-id="modalFooter"> <!-- <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-action cancel" data-id="businessMetadataAttrPageCancle">Cancel</button>
<button type="button" class="btn btn-atlas ok" data-id="namespaceAttrPageOk">Ok</button> <button type="button" class="btn btn-atlas ok" data-id="businessMetadataAttrPageOk">Ok</button>
</div> --> </div> -->
</div> </div>
<div class="namespace-details" data-id="namespaceDetailPage"> <div class="business-metadata-details" data-id="businessMetadataDetailPage">
<div class="position-relative"> <div class="position-relative">
<div class="pull-right inline-content-fr no-padding-left"> <div class="pull-right inline-content-fr no-padding-left">
<div class="inline" data-id="colManager"></div> <div class="inline" data-id="colManager"></div>
<div class="inline"> <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"> <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 Namespace <i class='fa fa-plus'></i> Create Business Metadata
</button></div> </button></div>
</div> </div>
<div class="tableOverlay"></div> <div class="tableOverlay"></div>
<div class='attr-filter-overlay hide'></div> <div class='attr-filter-overlay hide'></div>
<div class="auditTable name-space-details"> <div class="auditTable business-metadata-details">
<div id="r_nameSpaceTableLayoutView"></div> <div id="r_businessMetadataTableLayoutView"></div>
</div> </div>
</div> </div>
</div> </div>
\ No newline at end of file
...@@ -17,13 +17,13 @@ ...@@ -17,13 +17,13 @@
<div class="fontLoader"> <div class="fontLoader">
<i class="fa fa-refresh fa-spin-custom"></i> <i class="fa fa-refresh fa-spin-custom"></i>
</div> </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}} {{#if fromTable}}
<div class="form-group"> <div class="form-group">
<label class="control-label col-sm-2 {{#if create}}required{{/if}}" for="name">Name</label> <label class="control-label col-sm-2 {{#if create}}required{{/if}}" for="name">Name</label>
{{#if create}} {{#if create}}
<div class="col-sm-10"> <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> </div>
{{else}} {{else}}
<span class="ellipsis-with-margin control-label text-left col-sm-10" data-id="title"></span> {{/if}} <span class="ellipsis-with-margin control-label text-left col-sm-10" data-id="title"></span> {{/if}}
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
<!-- <h4 class="col-sm-6">Attributes</h4> --> <!-- <h4 class="col-sm-6">Attributes</h4> -->
{{#if isEditAttr}} {{#if isEditAttr}}
<div class="col-sm-12 no-padding-left"> <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> </div>
{{/if}} {{/if}}
</div> </div>
...@@ -48,6 +48,6 @@ ...@@ -48,6 +48,6 @@
</div> </div>
</form> </form>
<div class="modal-footer " data-id="modalFooter"> <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-action cancel" data-id="businessMetadataAttrPageCancle">Cancel</button>
<button type="button" class="btn btn-atlas ok" data-id="namespaceAttrPageOk">Ok</button> <button type="button" class="btn btn-atlas ok" data-id="businessMetadataAttrPageOk">Ok</button>
</div> </div>
\ No newline at end of file
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
</div> </div>
</div> </div>
<div id="r_entityLabelDefineView"></div> <div id="r_entityLabelDefineView"></div>
<div id="r_entityNameSpaceView"></div> <div id="r_entityBusinessMetadataView"></div>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<table class="custom-table" style="font-weight: 100;"> <table class="custom-table" style="font-weight: 100;">
<tr class="custom-tr"> <tr class="custom-tr">
<td class="custom-col-1"> <td class="custom-col-1">
{{{callmyfunction getNamespaceDroupdown nameSpaceCollection}}} {{{callmyfunction getBusinessMetadataDroupdown businessMetadataCollection}}}
</td> </td>
<td class="custom-col-0"> : </td> <td class="custom-col-0"> : </td>
<td class="custom-col-1" data-id="value"> <td class="custom-col-1" data-id="value">
...@@ -36,9 +36,9 @@ ...@@ -36,9 +36,9 @@
</table> </table>
{{else}} {{else}}
<hr /> <hr />
<ul class="namespace-tree-parent"> <ul class="business-metadata-tree-parent">
<li>{{model.__internal_UI_nameSpaceName}}</li> <li>{{model.__internal_UI_businessMetadataName}}</li>
<li class="namespace-tree-child" data-id="namespaceTreeChild"> <li class="business-metadata-tree-child" data-id="businessMetadataTreeChild">
</li> </li>
</ul> </ul>
{{/ifCond}} {{/ifCond}}
\ No newline at end of file
...@@ -14,28 +14,28 @@ ...@@ -14,28 +14,28 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
--> -->
<div class="panel panel-default custom-panel expand_collapse_panel-icon" data-id="namespace"> <div class="panel panel-default custom-panel expand_collapse_panel-icon">
<div class="panel-heading" data-toggle="collapse" href="#namespaceCollapse" aria-expanded="false" style="width: 70%;"> <div class="panel-heading" data-toggle="collapse" href="#businessMetadataCollapse" aria-expanded="false" style="width: 70%;">
<h4 class="panel-title"> <h4 class="panel-title">
<a>Namespaces</a> <a>Business Metadata</a>
</h4> </h4>
<div class="btn-group pull-left"> <div class="btn-group pull-left">
<button type="button" title="Collapse"><i class="ec-icon fa"></i></button> <button type="button" title="Collapse"><i class="ec-icon fa"></i></button>
</div> </div>
</div> </div>
<div class="panel-actions"> <div class="panel-actions">
<button class="btn btn-action btn-sm" data-id="addNameSpace">Add</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="saveNameSpace">Save</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> <button class="btn btn-action btn-sm" style="display: none;" data-id="cancel">Cancel</button>
</div> </div>
<div id="namespaceCollapse" class="panel-collapse collapse"> <div id="businessMetadataCollapse" class="panel-collapse collapse">
<div class="panel-body"> <div class="panel-body">
<div data-id="namespaceTree"></div> <div data-id="businessMetadataTree"></div>
<div class="editBox" style="display: none;"> <div class="editBox" style="display: none;">
<div class="form-group"> <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> <a href="javascript:void(0)" class="btn btn-action btn-sm" data-id="addItem" data-type="addAttrButton">Add New Attribute</a>
</div> </div>
<ul class="namespace-tree-parent" data-id="itemView"></ul> <ul class="business-metadata-tree-parent" data-id="itemView"></ul>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
<div data-id="r_classificationTreeRender"></div> <div data-id="r_classificationTreeRender"></div>
</div> </div>
<div class="col-sm-12"> <div class="col-sm-12">
<div data-id="r_nameSpaceTreeRender"></div> <div data-id="r_businessMetadataTreeRender"></div>
</div> </div>
<div class="col-sm-12"> <div class="col-sm-12">
<div data-id="r_glossaryTreeRender"></div> <div data-id="r_glossaryTreeRender"></div>
......
...@@ -15,31 +15,21 @@ ...@@ -15,31 +15,21 @@
* limitations under the License. * limitations under the License.
--> -->
<div class="panel panel-default expand_collapse_panel-icon right-icons"> <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> <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"> <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> <i class="fa fa-refresh"></i>
</button> </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> <i class="fa fa-external-link"></i>
</button> </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> </ul>
</button> </button>
</div> </div>
</div> </div>
<div id="c_namespace" class="panel-collapse collapse jstree-with-action in"> <div id="businessMetadataTree" class="panel-collapse collapse jstree-with-action in">
<div data-id="nameSpaceSearchTree"></div> <div data-id="businessMetadataSearchTree"></div>
</div> </div>
</div> </div>
\ No newline at end of file
...@@ -37,6 +37,9 @@ define(['require', 'utils/Enums', 'utils/Utils', 'underscore'], function(require ...@@ -37,6 +37,9 @@ define(['require', 'utils/Enums', 'utils/Utils', 'underscore'], function(require
classificationDefApiUrl: function(name) { classificationDefApiUrl: function(name) {
return this.getDefApiUrl('classification', name); return this.getDefApiUrl('classification', name);
}, },
businessMetadataDefApiUrl: function(name) {
return this.getDefApiUrl('business_metadata', name);
},
enumDefApiUrl: function(name) { enumDefApiUrl: function(name) {
return this.getDefApiUrl('enum', name); return this.getDefApiUrl('enum', name);
}, },
...@@ -99,9 +102,9 @@ define(['require', 'utils/Enums', 'utils/Utils', 'underscore'], function(require ...@@ -99,9 +102,9 @@ define(['require', 'utils/Enums', 'utils/Utils', 'underscore'], function(require
return this.baseUrlV2 + '/entity/bulk/classification'; return this.baseUrlV2 + '/entity/bulk/classification';
} }
}, },
entitiesNamespaceApiUrl: function(guid) { entitiesBusinessMetadataApiUrl: function(guid) {
if (guid) { if (guid) {
return this.baseUrlV2 + '/entity/guid/' + guid + '/namespaces?isOverwrite=true'; return this.baseUrlV2 + '/entity/guid/' + guid + '/businessmetata?isOverwrite=true';
} }
}, },
entityCollectionaudit: function(guid) { entityCollectionaudit: function(guid) {
...@@ -130,14 +133,6 @@ define(['require', 'utils/Enums', 'utils/Utils', 'underscore'], function(require ...@@ -130,14 +133,6 @@ define(['require', 'utils/Enums', 'utils/Utils', 'underscore'], function(require
} }
return url; 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() { typesApiUrl: function() {
return this.typedefsUrl().defs + '/headers?excludeInternalTypesAndReferences=true' return this.typedefsUrl().defs + '/headers?excludeInternalTypesAndReferences=true'
}, },
...@@ -234,24 +229,6 @@ define(['require', 'utils/Enums', 'utils/Utils', 'underscore'], function(require ...@@ -234,24 +229,6 @@ define(['require', 'utils/Enums', 'utils/Utils', 'underscore'], function(require
}, },
purgeApiUrl: function() { purgeApiUrl: function() {
return this.baseUrl + '/admin/audit'; 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';
}
} }
}); });
......
...@@ -567,7 +567,7 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums', ...@@ -567,7 +567,7 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums',
urlPath = "tagUrl"; urlPath = "tagUrl";
} else if (queryParams.from == "glossary") { } else if (queryParams.from == "glossary") {
urlPath = "glossaryUrl"; urlPath = "glossaryUrl";
} else if (queryParams.from == "namespace") { } else if (queryParams.from == "bm") {
urlPath = "administratorUrl"; urlPath = "administratorUrl";
} }
} }
......
...@@ -37,7 +37,7 @@ define(['require', ...@@ -37,7 +37,7 @@ define(['require',
/** Layout sub regions */ /** Layout sub regions */
regions: { regions: {
RNamespaceTableLayoutView: "#r_namespaceTableLayoutView", RBusinessMetadataTableLayoutView: "#r_businessMetadataTableLayoutView",
REnumTableLayoutView: '#r_enumTableLayoutView' REnumTableLayoutView: '#r_enumTableLayoutView'
}, },
...@@ -67,7 +67,7 @@ define(['require', ...@@ -67,7 +67,7 @@ define(['require',
* @constructs * @constructs
*/ */
initialize: function(options) { 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() { onShow: function() {
...@@ -81,21 +81,21 @@ define(['require', ...@@ -81,21 +81,21 @@ define(['require',
this.renderEnumLayoutView(); this.renderEnumLayoutView();
}, },
onRender: function() { onRender: function() {
this.renderNameSpaceLayoutView(); this.renderBusinessMetadataLayoutView();
this.bindEvents(); this.bindEvents();
}, },
renderNameSpaceLayoutView: function(obj) { renderBusinessMetadataLayoutView: function(obj) {
var that = this; var that = this;
require(['views/name_space/NameSpaceTableLayoutView'], function(NameSpaceTableLayoutView) { require(['views/business_metadata/BusinessMetadataTableLayoutView'], function(BusinessMetadataTableLayoutView) {
that.RNamespaceTableLayoutView.show(new NameSpaceTableLayoutView({ nameSpaceCollection: that.nameSpaceCollection, entityDefCollection: that.entityDefCollection })); that.RBusinessMetadataTableLayoutView.show(new BusinessMetadataTableLayoutView({ businessMetadataDefCollection: that.businessMetadataDefCollection, entityDefCollection: that.entityDefCollection }));
}); });
}, },
renderEnumLayoutView: function(obj) { renderEnumLayoutView: function(obj) {
var that = this; var that = this;
require(["views/name_space/EnumCreateUpdateItemView"], function(EnumCreateUpdateItemView) { require(["views/business_metadata/EnumCreateUpdateItemView"], function(EnumCreateUpdateItemView) {
var view = new EnumCreateUpdateItemView({ var view = new EnumCreateUpdateItemView({
enumDefCollection: that.enumDefCollection, enumDefCollection: that.enumDefCollection,
nameSpaceCollection: that.nameSpaceCollection businessMetadataDefCollection: that.businessMetadataDefCollection
}); });
that.REnumTableLayoutView.show(view); that.REnumTableLayoutView.show(view);
}); });
......
...@@ -17,19 +17,19 @@ ...@@ -17,19 +17,19 @@
*/ */
define(['require', define(['require',
'backbone', 'backbone',
'hbs!tmpl/name_space/NameSpaceAttributeItemView_tmpl', 'hbs!tmpl/business_metadata/BusinessMetadataAttributeItemView_tmpl',
'utils/Utils', 'utils/Utils',
'utils/UrlLinks', 'utils/UrlLinks',
'utils/Messages' 'utils/Messages'
], function(require, Backbone, NameSpaceAttributeItemViewTmpl, Utils, UrlLinks, Messages) { ], function(require, Backbone, BusinessMetadataAttributeItemViewTmpl, Utils, UrlLinks, Messages) {
'use strict'; 'use strict';
return Backbone.Marionette.ItemView.extend( return Backbone.Marionette.ItemView.extend(
/** @lends GlobalExclusionListView */ /** @lends GlobalExclusionListView */
{ {
template: NameSpaceAttributeItemViewTmpl, template: BusinessMetadataAttributeItemViewTmpl,
templateHelpers: function() { templateHelpers: function() {
return { return {
modalID: this.viewId modalID: this.viewId
...@@ -62,34 +62,47 @@ define(['require', ...@@ -62,34 +62,47 @@ define(['require',
this.model.set({ "name": e.target.value.trim() }); this.model.set({ "name": e.target.value.trim() });
}; };
events["change " + this.ui.dataTypeSelector] = function(e) { 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') { if (e.target.value.trim() === 'enumeration' || e.target.value.trim() === 'Enumeration') {
this.ui.enumTypeSelectorContainer.show(); this.ui.enumTypeSelectorContainer.show();
this.emumTypeSelectDisplay(); this.emumTypeSelectDisplay();
this.ui.stringLengthContainer.hide(); 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 { } else {
this.model.set({ "typeName": e.target.value.trim() }); obj.typeName = e.target.value.trim();
this.model.set({ "enumValues": null }); if (e.target.value.trim() === 'string' || e.target.value.trim() === 'String') {
this.ui.enumTypeSelectorContainer.hide(); this.ui.stringLengthContainer.show();
this.ui.enumValueSelectorContainer.hide(); this.ui.enumTypeSelectorContainer.hide();
this.ui.stringLengthContainer.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) { events["change " + this.ui.enumTypeSelector] = function(e) {
this.model.set({ "enumValues": e.target.value.trim() }); this.model.set({ "enumValues": e.target.value.trim() });
}; };
events["change " + this.ui.stringLengthContainer] = function(e) { 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) { 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(); var emumValue = this.ui.enumTypeSelector.select2('data')[0] ? this.ui.enumTypeSelector.select2('data')[0].text : this.ui.enumTypeSelector.val();
this.model.set({ "typeName": emumValue }); this.model.set({ "typeName": emumValue });
if (this.model.get("multiValueSelect")) {
this.model.set({ "typeName": "array<" + emumValue + ">" });
}
if (emumValue == '' || emumValue == null) { if (emumValue == '' || emumValue == null) {
this.ui.enumValueSelectorContainer.hide(); this.ui.enumValueSelectorContainer.hide();
} else { } else {
...@@ -102,7 +115,19 @@ define(['require', ...@@ -102,7 +115,19 @@ define(['require',
}; };
events["change " + this.ui.multiValueSelectStatus] = function(e) { events["change " + this.ui.multiValueSelectStatus] = function(e) {
this.model.set({ "multiValueSelect": e.target.checked }); 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.close] = 'onCloseButton';
events["click " + this.ui.createNewEnum] = 'onCreateUpdateEnum'; events["click " + this.ui.createNewEnum] = 'onCreateUpdateEnum';
return events; return events;
...@@ -115,13 +140,12 @@ define(['require', ...@@ -115,13 +140,12 @@ define(['require',
initialize: function(options) { initialize: function(options) {
this.parentView = options.parentView; this.parentView = options.parentView;
this.viewId = options.model ? options.model.cid : this.parentView.cid; this.viewId = options.model ? options.model.cid : this.parentView.cid;
}, },
onRender: function() { onRender: function() {
var that = this, var that = this,
entitytypes = '', entitytypes = '',
enumTypes = []; enumTypes = [];
this.model.set({ "modalID": this.viewId }); //this.model.set({ "modalID": this.viewId });
this.parentView.typeHeaders.fullCollection.each(function(model) { this.parentView.typeHeaders.fullCollection.each(function(model) {
if (model.toJSON().category == "ENTITY") { if (model.toJSON().category == "ENTITY") {
that.ui.entityTypeSelector.append("<option>" + model.get('name') + "</option>"); that.ui.entityTypeSelector.append("<option>" + model.get('name') + "</option>");
...@@ -139,14 +163,14 @@ define(['require', ...@@ -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 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'); $('.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.ui.enumValueSelector.attr("disabled", "false"); // cannot edit the values
this.emumTypeSelectDisplay(); this.emumTypeSelectDisplay();
this.ui.enumTypeSelectorContainer.hide(); this.ui.enumTypeSelectorContainer.hide();
this.ui.enumValueSelectorContainer.hide(); this.ui.enumValueSelectorContainer.hide();
if (this.parentView.isAttrEdit) { if (this.parentView.isAttrEdit) {
this.ui.close.hide(); 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.val(this.parentView.attrDetails.name);
this.ui.attributeInput.attr("disabled", "false"); this.ui.attributeInput.attr("disabled", "false");
this.ui.dataTypeSelector.attr("disabled", "false"); this.ui.dataTypeSelector.attr("disabled", "false");
...@@ -222,7 +246,7 @@ define(['require', ...@@ -222,7 +246,7 @@ define(['require',
}, },
onCreateUpdateEnum: function(e) { onCreateUpdateEnum: function(e) {
var that = this; 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({ var view = new EnumCreateUpdateItemView({
onUpdateEnum: function() { onUpdateEnum: function() {
that.ui.enumValueSelectorContainer.hide(); that.ui.enumValueSelectorContainer.hide();
...@@ -238,7 +262,7 @@ define(['require', ...@@ -238,7 +262,7 @@ define(['require',
}); });
}, },
enumDefCollection: that.parentView.enumDefCollection, enumDefCollection: that.parentView.enumDefCollection,
nameSpaceCollection: that.parentView.options.nameSpaceCollection businessMetadataDefCollection: that.parentView.options.businessMetadataDefCollection
}), }),
modal = new Modal({ modal = new Modal({
title: "Create/ Update Enum", title: "Create/ Update Enum",
......
/**
* 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
...@@ -18,21 +18,15 @@ ...@@ -18,21 +18,15 @@
define(['require', define(['require',
'backbone', 'backbone',
'hbs!tmpl/name_space/NameSpaceDetailLayoutView_tmpl', 'hbs!tmpl/business_metadata/BusinessMetadataDetailLayoutView_tmpl',
'utils/Utils', 'utils/Utils',
'views/tag/AddTagAttributeView', ], function(require, Backbone, BusinessMetadataDetailLayoutViewTmpl, Utils) {
'collection/VTagList',
'models/VTag',
'utils/Messages',
'utils/UrlLinks',
"utils/Globals",
], function(require, Backbone, NameSpaceDetailLayoutViewTmpl, Utils, AddTagAttributeView, VTagList, VTag, Messages, UrlLinks, Globals) {
'use strict'; 'use strict';
var NameSpaceDetailLayoutView = Backbone.Marionette.LayoutView.extend( var BusinessMetadataDetailLayoutView = Backbone.Marionette.LayoutView.extend(
/** @lends NameSpaceDetailLayoutView */ /** @lends BusinessMetadataDetailLayoutView */
{ {
template: NameSpaceDetailLayoutViewTmpl, template: BusinessMetadataDetailLayoutViewTmpl,
/** Layout sub regions */ /** Layout sub regions */
regions: {}, regions: {},
/** ui selector cache */ /** ui selector cache */
...@@ -53,58 +47,22 @@ define(['require', ...@@ -53,58 +47,22 @@ define(['require',
return events; return events;
}, },
/** /**
* intialize a new NameSpaceDetailLayoutView Layout * intialize a new BusinessMetadataDetailLayoutView Layout
* @constructs * @constructs
*/ */
initialize: function(options) { initialize: function(options) {
_.extend(this, _.pick(options, 'guid', 'entity', 'entityName', 'attributeDefs', 'enumDefCollection', 'typeHeaders', 'nameSpaceCollection', 'selectedNameSpace', 'nameSpaceAttr')); _.extend(this, _.pick(options, 'guid', 'model', 'enumDefCollection', 'typeHeaders'));
},
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() { onRender: function() {
if (this.nameSpaceCollection.models.length && !this.model) { this.renderDetail();
this.model = this.nameSpaceCollection.fullCollection.findWhere({ guid: this.guid });
Utils.showTitleLoader(this.$('.page-title .fontLoader'), this.$('.tagDetail'));
this.renderTagDetail();
}
this.bindEvents();
}, },
renderTagDetail: function() { renderDetail: function() {
var that = this, var that = this;
attributeData = "";
this.attributeDefs = this.model.get('attributeDefs');
this.ui.title.html('<span>' + that.model.get('name') + '</span>'); this.ui.title.html('<span>' + that.model.get('name') + '</span>');
if (that.model.get('description')) { if (that.model.get('description')) {
this.ui.description.text((that.model.get('description'))); this.ui.description.text((that.model.get('description')));
} }
Utils.hideTitleLoader(this.$('.fontLoader'), this.$('.tagDetail'));
} }
}); });
return NameSpaceDetailLayoutView; return BusinessMetadataDetailLayoutView;
}); });
\ No newline at end of file
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * 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, require,
Backbone, Backbone,
EnumCreateUpdateItemViewTmpl, EnumCreateUpdateItemViewTmpl,
...@@ -82,7 +82,7 @@ define(["require", "backbone", "hbs!tmpl/name_space/EnumCreateUpdateItemView_tmp ...@@ -82,7 +82,7 @@ define(["require", "backbone", "hbs!tmpl/name_space/EnumCreateUpdateItemView_tmp
*/ */
initialize: function(options) { initialize: function(options) {
this.enumDefCollection = options.enumDefCollection; this.enumDefCollection = options.enumDefCollection;
this.nameSpaceCollection = options.nameSpaceCollection; this.businessMetadataDefCollection = options.businessMetadataDefCollection;
}, },
onRender: function() { onRender: function() {
var that = this, var that = this,
...@@ -234,7 +234,7 @@ define(["require", "backbone", "hbs!tmpl/name_space/EnumCreateUpdateItemView_tmp ...@@ -234,7 +234,7 @@ define(["require", "backbone", "hbs!tmpl/name_space/EnumCreateUpdateItemView_tmp
}); });
} }
that.enumDefCollection.fetch({ reset: true }); that.enumDefCollection.fetch({ reset: true });
if (that.options.onUpdateEnum) { //callback from namespaceattributeItemView if (that.options.onUpdateEnum) { //callback from BusinessMetadataAttributeItemView
that.options.onUpdateEnum(); that.options.onUpdateEnum();
} }
that.ui.enumCancleBtn.attr("disabled", "true"); that.ui.enumCancleBtn.attr("disabled", "true");
...@@ -253,9 +253,9 @@ define(["require", "backbone", "hbs!tmpl/name_space/EnumCreateUpdateItemView_tmp ...@@ -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) }); $.extend(apiObj, { contentType: "application/json", dataType: "json", data: JSON.stringify(this.json) });
if (isPostCallEnum) { 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) { } 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 { } else {
Utils.notifySuccess({ Utils.notifySuccess({
content: "No updated values" content: "No updated values"
......
...@@ -47,7 +47,7 @@ define(['require', ...@@ -47,7 +47,7 @@ define(['require',
RRelationshipLayoutView: "#r_relationshipLayoutView", RRelationshipLayoutView: "#r_relationshipLayoutView",
REntityUserDefineView: "#r_entityUserDefineView", REntityUserDefineView: "#r_entityUserDefineView",
REntityLabelDefineView: "#r_entityLabelDefineView", REntityLabelDefineView: "#r_entityLabelDefineView",
REntityNameSpaceView: "#r_entityNameSpaceView" REntityBusinessMetadataView: "#r_entityBusinessMetadataView"
}, },
/** ui selector cache */ /** ui selector cache */
ui: { ui: {
...@@ -121,7 +121,7 @@ define(['require', ...@@ -121,7 +121,7 @@ define(['require',
* @constructs * @constructs
*/ */
initialize: function(options) { 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"); $('body').addClass("detail-page");
}, },
bindEvents: function() { bindEvents: function() {
...@@ -245,7 +245,7 @@ define(['require', ...@@ -245,7 +245,7 @@ define(['require',
enumDefCollection: this.enumDefCollection, enumDefCollection: this.enumDefCollection,
classificationDefCollection: this.classificationDefCollection, classificationDefCollection: this.classificationDefCollection,
glossaryCollection: this.glossaryCollection, glossaryCollection: this.glossaryCollection,
nameSpaceCollection: this.activeEntityDef.get('namespaceAttributeDefs'), businessMetadataCollection: this.activeEntityDef.get('businessAttributeDefs'),
searchVent: this.searchVent, searchVent: this.searchVent,
attributeDefs: (function() { attributeDefs: (function() {
return that.getEntityDef(collectionJSON); return that.getEntityDef(collectionJSON);
...@@ -255,8 +255,8 @@ define(['require', ...@@ -255,8 +255,8 @@ define(['require',
this.renderEntityDetailTableLayoutView(obj); this.renderEntityDetailTableLayoutView(obj);
this.renderEntityUserDefineView(obj); this.renderEntityUserDefineView(obj);
this.renderEntityLabelDefineView(obj); this.renderEntityLabelDefineView(obj);
if (obj.nameSpaceCollection) { if (obj.businessMetadataCollection) {
this.renderEntityNameSpaceView(obj); this.renderEntityBusinessMetadataView(obj);
} }
this.renderRelationshipLayoutView(obj); this.renderRelationshipLayoutView(obj);
this.renderAuditTableLayoutView(obj); this.renderAuditTableLayoutView(obj);
...@@ -517,10 +517,10 @@ define(['require', ...@@ -517,10 +517,10 @@ define(['require',
that.REntityLabelDefineView.show(new EntityLabelDefineView(obj)); that.REntityLabelDefineView.show(new EntityLabelDefineView(obj));
}); });
}, },
renderEntityNameSpaceView: function(obj) { renderEntityBusinessMetadataView: function(obj) {
var that = this; var that = this;
require(['views/entity/EntityNameSpaceView'], function(EntityNameSpaceView) { require(['views/entity/EntityBusinessMetaDataView'], function(EntityBusinessMetaDataView) {
that.REntityNameSpaceView.show(new EntityNameSpaceView(obj)); that.REntityBusinessMetadataView.show(new EntityBusinessMetaDataView(obj));
}); });
}, },
renderTagTableLayoutView: function(obj) { renderTagTableLayoutView: function(obj) {
......
/**
* 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
...@@ -54,18 +54,7 @@ define(['require', ...@@ -54,18 +54,7 @@ define(['require',
* @constructs * @constructs
*/ */
initialize: function(options) { initialize: function(options) {
_.extend(this, _.pick(options, _.extend(this, _.pick(options, 'attrObj', 'value', 'typeHeaders', 'entityDefCollection', 'enumDefCollection', 'classificationDefCollection', 'tag', 'type', 'searchTableFilters', 'systemAttrArr'));
'attrObj',
'value',
'typeHeaders',
'entityDefCollection',
'enumDefCollection',
'classificationDefCollection',
'nameSpaceCollection',
'tag',
'type',
'searchTableFilters',
'systemAttrArr'));
this.attrObj = _.sortBy(this.attrObj, 'name'); this.attrObj = _.sortBy(this.attrObj, 'name');
//this.systemAttrArr = _.sortBy(this.systemAttrArr, 'name'); //this.systemAttrArr = _.sortBy(this.systemAttrArr, 'name');
this.filterType = this.tag ? 'tagFilters' : 'entityFilters'; this.filterType = this.tag ? 'tagFilters' : 'entityFilters';
...@@ -368,21 +357,21 @@ define(['require', ...@@ -368,21 +357,21 @@ define(['require',
}); });
if (this.type) { if (this.type) {
var entityDef = this.entityDefCollection.fullCollection.find({ name: that.options.applicableType }), var entityDef = this.entityDefCollection.fullCollection.find({ name: that.options.applicableType }),
namespaceAttributeDefs = null; businessMetadataAttributeDefs = null;
if (entityDef) { if (entityDef) {
namespaceAttributeDefs = entityDef.get("namespaceAttributeDefs"); BusinessMetadataAttributeDefs = entityDef.get("businessAttributeDefs");
} }
if (namespaceAttributeDefs) { if (BusinessMetadataAttributeDefs) {
_.each(namespaceAttributeDefs, function(attributes, key) { _.each(BusinessMetadataAttributeDefs, function(attributes, key) {
var sortedAttributes = _.sortBy(attributes, function(obj) { var sortedAttributes = _.sortBy(attributes, function(obj) {
return obj.name; return obj.name;
}); });
_.each(sortedAttributes, function(attrDetails) { _.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) { if (returnObj) {
returnObj.id = key + "." + returnObj.id; returnObj.id = key + "." + returnObj.id;
returnObj.label = key + ": " + returnObj.label; returnObj.label = key + ": " + returnObj.label;
returnObj.data = { 'entityType': "namespace" }; returnObj.data = { 'entityType': "businessMetadata" };
filters.push(returnObj); filters.push(returnObj);
} }
}); });
......
...@@ -243,7 +243,7 @@ define(["require", "backbone", "utils/Globals", "hbs!tmpl/search/SearchDefaultLa ...@@ -243,7 +243,7 @@ define(["require", "backbone", "utils/Globals", "hbs!tmpl/search/SearchDefaultLa
enumDefCollection: that.options.enumDefCollection, enumDefCollection: that.options.enumDefCollection,
typeHeaders: that.options.typeHeaders, typeHeaders: that.options.typeHeaders,
classificationDefCollection: that.options.classificationDefCollection, classificationDefCollection: that.options.classificationDefCollection,
nameSpaceCollection: that.options.nameSpaceCollection, businessMetadataDefCollection: that.options.businessMetadataDefCollection,
searchTableFilters: that.checkEntityFilter(that.options) searchTableFilters: that.checkEntityFilter(that.options)
}; };
if (that.options.value) { if (that.options.value) {
...@@ -365,8 +365,8 @@ define(["require", "backbone", "utils/Globals", "hbs!tmpl/search/SearchDefaultLa ...@@ -365,8 +365,8 @@ define(["require", "backbone", "utils/Globals", "hbs!tmpl/search/SearchDefaultLa
if (_.has(obj, "condition")) { if (_.has(obj, "condition")) {
return that.getIdFromRuleObj(obj); return that.getIdFromRuleObj(obj);
} else { } else {
if ((obj && obj.data && obj.data.entityType === "namespace") || obj.id.indexOf(".") > -1) { if ((obj && obj.data && obj.data.entityType === "businessMetadata") || obj.id.indexOf(".") > -1) {
return col.add("namespace"); return col.add("businessMetadata");
} else { } else {
return col.add(obj.id); return col.add(obj.id);
} }
...@@ -382,7 +382,7 @@ define(["require", "backbone", "utils/Globals", "hbs!tmpl/search/SearchDefaultLa ...@@ -382,7 +382,7 @@ define(["require", "backbone", "utils/Globals", "hbs!tmpl/search/SearchDefaultLa
if (!this.options.searchTableColumns[this.options.value.type]) { 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] = ["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) { renderQueryBuilder: function(obj, rQueryBuilder) {
......
...@@ -37,7 +37,7 @@ define([ ...@@ -37,7 +37,7 @@ define([
RClassificationTreeRender: '[data-id="r_classificationTreeRender"]', RClassificationTreeRender: '[data-id="r_classificationTreeRender"]',
REntityTreeRender: '[data-id="r_entityTreeRender"]', REntityTreeRender: '[data-id="r_entityTreeRender"]',
RCustomFilterTreeRender: '[data-id="r_customFilterTreeRender"]', RCustomFilterTreeRender: '[data-id="r_customFilterTreeRender"]',
RNameSpaceTreeRender: '[data-id="r_nameSpaceTreeRender"]' RBusinessMetadataTreeRender: '[data-id="r_businessMetadataTreeRender"]'
}, },
ui: { ui: {
//search //search
...@@ -82,7 +82,7 @@ define([ ...@@ -82,7 +82,7 @@ define([
this.classificationSearchTree = this.$('[data-id="classificationSearchTree"]'); this.classificationSearchTree = this.$('[data-id="classificationSearchTree"]');
this.termSearchTree = this.$('[data-id="termSearchTree"]'); this.termSearchTree = this.$('[data-id="termSearchTree"]');
this.customFilterSearchTree = this.$('[data-id="customFilterSearchTree"]'); 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(true).show_all();
this.entitySearchTree.jstree("search", searchString); this.entitySearchTree.jstree("search", searchString);
this.classificationSearchTree.jstree(true).show_all(); this.classificationSearchTree.jstree(true).show_all();
...@@ -91,8 +91,8 @@ define([ ...@@ -91,8 +91,8 @@ define([
this.termSearchTree.jstree("search", searchString); this.termSearchTree.jstree("search", searchString);
this.customFilterSearchTree.jstree(true).show_all(); this.customFilterSearchTree.jstree(true).show_all();
this.customFilterSearchTree.jstree("search", searchString); this.customFilterSearchTree.jstree("search", searchString);
this.nameSpaceSearchTree.jstree(true).show_all(); this.businessMetadataSearchTree.jstree(true).show_all();
this.nameSpaceSearchTree.jstree("search", searchString); this.businessMetadataSearchTree.jstree("search", searchString);
}; };
...@@ -128,7 +128,7 @@ define([ ...@@ -128,7 +128,7 @@ define([
this.renderClassificationTree(opt); this.renderClassificationTree(opt);
this.renderGlossaryTree(opt); this.renderGlossaryTree(opt);
this.renderCustomFilterTree(); this.renderCustomFilterTree();
this.renderNameSpaceTree(); this.renderBusinessMetadataTree();
this.showHideGlobalFilter(); this.showHideGlobalFilter();
this.showDefaultPage(); this.showDefaultPage();
}, },
...@@ -201,8 +201,8 @@ define([ ...@@ -201,8 +201,8 @@ define([
if (options) { if (options) {
_.extend(this.options, options); _.extend(this.options, options);
this.showHideGlobalFilter(); this.showHideGlobalFilter();
if (this.RNameSpaceTreeRender.currentView) { if (this.RBusinessMetadataTreeRender.currentView) {
this.RNameSpaceTreeRender.currentView.manualRender(this.options); this.RBusinessMetadataTreeRender.currentView.manualRender(this.options);
} }
if (this.RCustomFilterTreeRender.currentView) { if (this.RCustomFilterTreeRender.currentView) {
this.RCustomFilterTreeRender.currentView.manualRender(this.options); this.RCustomFilterTreeRender.currentView.manualRender(this.options);
...@@ -242,10 +242,10 @@ define([ ...@@ -242,10 +242,10 @@ define([
that.RCustomFilterTreeRender.show(new CustomFilterTreeLayoutView(_.extend({ query: that.query }, that.options))); that.RCustomFilterTreeRender.show(new CustomFilterTreeLayoutView(_.extend({ query: that.query }, that.options)));
}); });
}, },
renderNameSpaceTree: function() { renderBusinessMetadataTree: function() {
var that = this; var that = this;
require(["views/search/tree/NameSpaceTreeLayoutView"], function(NameSpaceTreeLayoutView) { require(["views/search/tree/BusinessMetadataTreeLayoutView"], function(BusinessMetadataTreeLayoutView) {
that.RNameSpaceTreeRender.show(new NameSpaceTreeLayoutView(_.extend({ query: that.query }, that.options))); that.RBusinessMetadataTreeRender.show(new BusinessMetadataTreeLayoutView(_.extend({ query: that.query }, that.options)));
}); });
} }
}); });
......
...@@ -365,7 +365,7 @@ define(['require', ...@@ -365,7 +365,7 @@ define(['require',
this.searchTableColumns[this.value.type] = listOfColumns.length ? listOfColumns : null; this.searchTableColumns[this.value.type] = listOfColumns.length ? listOfColumns : null;
} }
} else if (this.value && this.value.type && this.searchTableColumns && this.value.attributes) { } 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) { fetchCollection: function(value, options) {
...@@ -648,8 +648,7 @@ define(['require', ...@@ -648,8 +648,7 @@ define(['require',
var that = this, var that = this,
nameCheck = 0, nameCheck = 0,
columnToShow = null, columnToShow = null,
col = {}, col = {};
namespaceRenderable = false;
this.value = Utils.getUrlState.getQueryParams() || this.value; this.value = Utils.getUrlState.getQueryParams() || this.value;
if (this.value && this.value.searchType === "basic" && this.searchTableColumns && (this.searchTableColumns[this.value.type] !== undefined)) { 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]; columnToShow = this.searchTableColumns[this.value.type] == null ? [] : this.searchTableColumns[this.value.type];
...@@ -794,25 +793,25 @@ define(['require', ...@@ -794,25 +793,25 @@ define(['require',
} }
}) })
}; };
col['namespace'] = { col['businessMetaData'] = {
label: "Namespaces", label: "Business MetaData",
cell: "Html", cell: "Html",
editable: false, editable: false,
resizeable: true, resizeable: true,
orderable: true, orderable: true,
alwaysVisible: true, //Backgrid.ColumnManager.js -> render() to hide the name in dropdownlist 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, { formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
fromRaw: function(rawValue, model) { fromRaw: function(rawValue, model) {
var obj = model.toJSON(), var obj = model.toJSON(),
namespaceStr = ''; businessMetadataStr = '';
if (obj && obj.attributes) { if (obj && obj.attributes) {
_.each(obj.attributes, function(namespaceValue, attributeName) { _.each(obj.attributes, function(businessMetadataValue, attributeName) {
if (attributeName.indexOf('.') != -1) { if (attributeName.indexOf('.') != -1) {
var isDate = false, var isDate = false,
namespace = that.options.nameSpaceCollection.fullCollection.find({ "name": attributeName.split('.')[0] }); businessMetadata = that.options.businessMetadataDefCollection.fullCollection.find({ "name": attributeName.split('.')[0] });
if (namespace) { if (businessMetadata) {
var getAttributes = namespace.get('attributeDefs'); var getAttributes = businessMetadata.get('attributeDefs');
getAttributes.every(function(attrTypeCheck) { getAttributes.every(function(attrTypeCheck) {
if (attributeName.split('.')[1] === attrTypeCheck.name && attrTypeCheck.typeName.indexOf("date") > -1) { if (attributeName.split('.')[1] === attrTypeCheck.name && attrTypeCheck.typeName.indexOf("date") > -1) {
isDate = true; isDate = true;
...@@ -821,12 +820,12 @@ define(['require', ...@@ -821,12 +820,12 @@ define(['require',
}); });
} }
if (isDate) { 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;
} }
} }
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment