Commit 54f5e16a by apoorvnaik Committed by Madhan Neethiraj

ATLAS-2721: rename attribute displayName as name in classes AtlasGlossary,…

ATLAS-2721: rename attribute displayName as name in classes AtlasGlossary, AtlasGlossaryTerm, AtlasGlossaryCategory Change-Id: I47b1a616f412a9540fb985677eadbe86d05391f6 Signed-off-by: 's avatarMadhan Neethiraj <madhan@apache.org>
parent 84196cfc
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
"isUnique": true "isUnique": true
}, },
{ {
"name": "displayName", "name": "name",
"typeName": "string", "typeName": "string",
"cardinality": "SINGLE", "cardinality": "SINGLE",
"isIndexable": true, "isIndexable": true,
...@@ -151,7 +151,7 @@ ...@@ -151,7 +151,7 @@
"isUnique": true "isUnique": true
}, },
{ {
"name": "displayName", "name": "name",
"typeName": "string", "typeName": "string",
"cardinality": "SINGLE", "cardinality": "SINGLE",
"isIndexable": true, "isIndexable": true,
...@@ -216,7 +216,7 @@ ...@@ -216,7 +216,7 @@
"isUnique": true "isUnique": true
}, },
{ {
"name": "displayName", "name": "name",
"typeName": "string", "typeName": "string",
"cardinality": "SINGLE", "cardinality": "SINGLE",
"isIndexable": true, "isIndexable": true,
......
...@@ -49,7 +49,7 @@ define([ ...@@ -49,7 +49,7 @@ define([
this.searchVent = new Backbone.Wreqr.EventAggregator(); this.searchVent = new Backbone.Wreqr.EventAggregator();
this.glossaryCollection = new VGlossaryList([], { this.glossaryCollection = new VGlossaryList([], {
comparator: function(item) { comparator: function(item) {
return item.get("displayName"); return item.get("name");
} }
}); });
this.preFetchedCollectionLists = { this.preFetchedCollectionLists = {
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<div class="form-group"> <div class="form-group">
<label class="control-label col-sm-2" for="name">{{@key}}</label> <label class="control-label col-sm-2" for="name">{{@key}}</label>
<div class="col-sm-10"> <div class="col-sm-10">
<input class="form-control" name="{{@key}}" data-id="displayName" placeholder="{{@key}}" /> <input class="form-control" name="{{@key}}" data-id="name" placeholder="{{@key}}" />
</div> </div>
</div> </div>
{{/each}} {{/each}}
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<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>
<div class="col-sm-10"> <div class="col-sm-10">
<input class="form-control" data-id="displayName" name="displayName" value="{{modelJSON.displayName}}" placeholder="Name(required)" autofocus/> <input class="form-control" data-id="name" name="name" value="{{modelJSON.name}}" placeholder="Name(required)" autofocus/>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<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>
<div class="col-sm-10"> <div class="col-sm-10">
<input class="form-control" name="displayName" value="{{displayName}}" data-id="displayName" placeholder="Name(required)" autofocus/> <input class="form-control" name="name" value="{{name}}" data-id="name" placeholder="Name(required)" autofocus/>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
......
...@@ -616,11 +616,11 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum ...@@ -616,11 +616,11 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
modal.$el.find('button.ok').attr("disabled", false); modal.$el.find('button.ok').attr("disabled", false);
}); });
} else { } else {
view.ui.displayName.on('keyup', function(e) { view.ui.name.on('keyup', function(e) {
modal.$el.find('button.ok').attr("disabled", false); modal.$el.find('button.ok').attr("disabled", false);
}); });
} }
view.ui.displayName.on('keyup', function(e) { view.ui.name.on('keyup', function(e) {
if ((e.keyCode == 8 || e.keyCode == 32 || e.keyCode == 46) && e.currentTarget.value.trim() == "") { if ((e.keyCode == 8 || e.keyCode == 32 || e.keyCode == 46) && e.currentTarget.value.trim() == "") {
modal.$el.find('button.ok').attr("disabled", true); modal.$el.find('button.ok').attr("disabled", true);
} }
...@@ -663,7 +663,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum ...@@ -663,7 +663,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
silent: true, silent: true,
success: function(rModel, response) { success: function(rModel, response) {
Utils.notifySuccess({ Utils.notifySuccess({
content: messageType + ref.ui.displayName.val() + Messages[model ? "editSuccessMessage" : "addSuccessMessage"] content: messageType + ref.ui.name.val() + Messages[model ? "editSuccessMessage" : "addSuccessMessage"]
}); });
if (options.callback) { if (options.callback) {
options.callback(rModel); options.callback(rModel);
......
...@@ -380,8 +380,9 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums', ...@@ -380,8 +380,9 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums',
} }
Utils.extractKeyValueFromEntity = function() { Utils.extractKeyValueFromEntity = function() {
var collectionJSON = arguments[0], var collectionJSON = arguments[0],
priorityAttribute = arguments[1]; priorityAttribute = arguments[1],
var returnObj = { skipAttribute = arguments[2],
returnObj = {
name: '-', name: '-',
found: true, found: true,
key: null key: null
...@@ -413,6 +414,16 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums', ...@@ -413,6 +414,16 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums',
returnObj.key = 'qualifiedName'; returnObj.key = 'qualifiedName';
return returnObj; return returnObj;
} }
if (collectionJSON.attributes.displayText) {
returnObj.name = _.escape(collectionJSON.attributes.displayText);
returnObj.key = 'displayText';
return returnObj;
}
if (collectionJSON.attributes.guid) {
returnObj.name = _.escape(collectionJSON.attributes.guid);
returnObj.key = 'guid';
return returnObj;
}
if (collectionJSON.attributes.id) { if (collectionJSON.attributes.id) {
if (_.isObject(collectionJSON.attributes.id)) { if (_.isObject(collectionJSON.attributes.id)) {
if (collectionJSON.id.id) { if (collectionJSON.id.id) {
...@@ -463,8 +474,17 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums', ...@@ -463,8 +474,17 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums',
} }
} }
returnObj.found = false; returnObj.found = false;
if (skipAttribute && returnObj.key == skipAttribute) {
return {
name: '-',
found: true,
key: null
}
} else {
return returnObj; return returnObj;
} }
}
Utils.showTitleLoader = function(loaderEl, titleBoxEl) { Utils.showTitleLoader = function(loaderEl, titleBoxEl) {
loaderEl.css ? loaderEl.css({ loaderEl.css ? loaderEl.css({
'display': 'block', 'display': 'block',
......
...@@ -73,7 +73,11 @@ define(['require', ...@@ -73,7 +73,11 @@ define(['require',
} }
try { try {
parseDetailsObject = JSON.parse(auditData); parseDetailsObject = JSON.parse(auditData);
var name = _.escape(parseDetailsObject.typeName); var skipAttribute = parseDetailsObject.typeName ? "guid" : null,
name = Utils.getName(parseDetailsObject, null, skipAttribute);
if (name == "-") {
name = _.escape(parseDetailsObject.typeName);
}
} catch (err) { } catch (err) {
if (_.isArray(parseDetailsObject)) { if (_.isArray(parseDetailsObject)) {
var name = _.escape(parseDetailsObject[0]); var name = _.escape(parseDetailsObject[0]);
......
...@@ -43,7 +43,7 @@ define(['require', ...@@ -43,7 +43,7 @@ define(['require',
/** ui selector cache */ /** ui selector cache */
ui: { ui: {
"qualifiedName": "[data-id='qualifiedName']", "qualifiedName": "[data-id='qualifiedName']",
"displayName": "[data-id='displayName']", "name": "[data-id='name']",
"shortDescription": "[data-id='shortDescription']", "shortDescription": "[data-id='shortDescription']",
"longDescription": "[data-id='longDescription']", "longDescription": "[data-id='longDescription']",
"categoryTermForm": "[data-id='categoryTermForm']" "categoryTermForm": "[data-id='categoryTermForm']"
......
...@@ -41,7 +41,7 @@ define(['require', ...@@ -41,7 +41,7 @@ define(['require',
/** ui selector cache */ /** ui selector cache */
ui: { ui: {
"displayName": "[data-id='displayName']", "name": "[data-id='name']",
"shortDescription": "[data-id='shortDescription']", "shortDescription": "[data-id='shortDescription']",
"longDescription": "[data-id='longDescription']", "longDescription": "[data-id='longDescription']",
"glossaryForm": "[data-id='glossaryForm']" "glossaryForm": "[data-id='glossaryForm']"
......
...@@ -141,18 +141,18 @@ define(['require', ...@@ -141,18 +141,18 @@ define(['require',
"model": this.data, "model": this.data,
"collection": this.glossaryCollection, "collection": this.glossaryCollection,
"callback": function(data) { "callback": function(data) {
if (data.displayName != that.data.displayName) { if (data.name != that.data.name) {
var glossary = that.glossaryCollection.fullCollection.get(data.anchor.glossaryGuid); var glossary = that.glossaryCollection.fullCollection.get(data.anchor.glossaryGuid);
if (that.isTermView) { if (that.isTermView) {
_.find(glossary.get('terms'), function(obj) { _.find(glossary.get('terms'), function(obj) {
if (obj.termGuid == data.guid) { if (obj.termGuid == data.guid) {
obj.displayText = data.displayName obj.displayText = data.name
} }
}); });
} else if (!data.parentCategory) { } else if (!data.parentCategory) {
_.find(glossary.get('categories'), function(obj) { _.find(glossary.get('categories'), function(obj) {
if (obj.categoryGuid == data.guid) { if (obj.categoryGuid == data.guid) {
obj.displayText = data.displayName obj.displayText = data.name
} }
}); });
} }
...@@ -266,7 +266,7 @@ define(['require', ...@@ -266,7 +266,7 @@ define(['require',
renderDetails: function(data) { renderDetails: function(data) {
Utils.hideTitleLoader(this.$('.fontLoader'), this.ui.details); Utils.hideTitleLoader(this.$('.fontLoader'), this.ui.details);
if (data) { if (data) {
this.ui.title.text(data.displayName || data.displayText || data.qualifiedName); this.ui.title.text(data.name || data.displayText || data.qualifiedName);
this.ui.shortDescription.text(data.shortDescription); this.ui.shortDescription.text(data.shortDescription);
this.ui.longDescription.text(data.longDescription); this.ui.longDescription.text(data.longDescription);
this.generateCategories(data.categories); this.generateCategories(data.categories);
...@@ -315,7 +315,7 @@ define(['require', ...@@ -315,7 +315,7 @@ define(['require',
if (foundModel) { if (foundModel) {
glossary = new VGlossaryList([foundModel.toJSON()], { glossary = new VGlossaryList([foundModel.toJSON()], {
comparator: function(item) { comparator: function(item) {
return item.get("displayName"); return item.get("name");
} }
}); });
} }
...@@ -342,7 +342,7 @@ define(['require', ...@@ -342,7 +342,7 @@ define(['require',
if (foundModel) { if (foundModel) {
glossary = new VGlossaryList([foundModel.toJSON()], { glossary = new VGlossaryList([foundModel.toJSON()], {
comparator: function(item) { comparator: function(item) {
return item.get("displayName"); return item.get("name");
} }
}); });
} }
...@@ -385,7 +385,7 @@ define(['require', ...@@ -385,7 +385,7 @@ define(['require',
onClickTagCross: function(e) { onClickTagCross: function(e) {
var that = this, var that = this,
tagName = $(e.currentTarget).text(), tagName = $(e.currentTarget).text(),
termName = this.data.displayName; termName = this.data.name;
CommonViewFunction.deleteTag(_.extend({}, { CommonViewFunction.deleteTag(_.extend({}, {
msg: "<div class='ellipsis'>Remove: " + "<b>" + _.escape(tagName) + "</b> assignment from" + " " + "<b>" + termName + "?</b></div>", msg: "<div class='ellipsis'>Remove: " + "<b>" + _.escape(tagName) + "</b> assignment from" + " " + "<b>" + termName + "?</b></div>",
titleMessage: Messages.removeTag, titleMessage: Messages.removeTag,
...@@ -408,7 +408,7 @@ define(['require', ...@@ -408,7 +408,7 @@ define(['require',
selectedGuid: guid, selectedGuid: guid,
model: that.data, model: that.data,
collection: that.glossaryCollection, collection: that.glossaryCollection,
msg: "<div class='ellipsis'>Remove: " + "<b>" + _.escape(name) + "</b> assignment from" + " " + "<b>" + that.data.displayName + "?</b></div>", msg: "<div class='ellipsis'>Remove: " + "<b>" + _.escape(name) + "</b> assignment from" + " " + "<b>" + that.data.name + "?</b></div>",
titleMessage: Messages.glossary[that.isTermView ? "removeCategoryfromTerm" : "removeTermfromCategory"], titleMessage: Messages.glossary[that.isTermView ? "removeCategoryfromTerm" : "removeTermfromCategory"],
isCategoryView: that.isCategoryView, isCategoryView: that.isCategoryView,
isTermView: that.isTermView, isTermView: that.isTermView,
......
...@@ -180,7 +180,7 @@ define(['require', ...@@ -180,7 +180,7 @@ define(['require',
guid: model.guid, guid: model.guid,
id: model.guid, id: model.guid,
model: model, model: model,
text: model.displayName, text: model.name,
gType: "glossary" gType: "glossary"
} }
} }
...@@ -267,7 +267,7 @@ define(['require', ...@@ -267,7 +267,7 @@ define(['require',
"gType": "glossary", "gType": "glossary",
"model": that.glossaryCollection.fullCollection.first().toJSON() "model": that.glossaryCollection.fullCollection.first().toJSON()
}; };
selectedItem.text = selectedItem.model.displayName; selectedItem.text = selectedItem.model.name;
selectedItem.guid = selectedItem.model.guid; selectedItem.guid = selectedItem.model.guid;
if (index == 0 && selectedItem.guid == objGuid) { if (index == 0 && selectedItem.guid == objGuid) {
that.glossary.selectedItem = selectedItem; that.glossary.selectedItem = selectedItem;
...@@ -294,7 +294,7 @@ define(['require', ...@@ -294,7 +294,7 @@ define(['require',
return this.glossaryCollection.fullCollection.map(function(model, i) { return this.glossaryCollection.fullCollection.map(function(model, i) {
var obj = model.toJSON(), var obj = model.toJSON(),
parent = { parent = {
"text": obj.displayName, "text": obj.name,
"icon": "fa fa-folder-o", "icon": "fa fa-folder-o",
"guid": obj.guid, "guid": obj.guid,
"id": obj.guid, "id": obj.guid,
...@@ -324,7 +324,7 @@ define(['require', ...@@ -324,7 +324,7 @@ define(['require',
"id": guid, "id": guid,
"parent": obj, "parent": obj,
"glossaryId": obj.guid, "glossaryId": obj.guid,
"glossaryName": obj.displayName, "glossaryName": obj.name,
"model": category, "model": category,
"children": true, "children": true,
"icon": "fa fa-files-o", "icon": "fa fa-files-o",
...@@ -348,7 +348,7 @@ define(['require', ...@@ -348,7 +348,7 @@ define(['require',
"guid": guid, "guid": guid,
"id": guid, "id": guid,
"parent": obj, "parent": obj,
"glossaryName": obj.displayName, "glossaryName": obj.name,
"glossaryId": obj.guid, "glossaryId": obj.guid,
"model": term, "model": term,
"icon": "fa fa-file-o" "icon": "fa fa-file-o"
...@@ -697,7 +697,7 @@ define(['require', ...@@ -697,7 +697,7 @@ define(['require',
selectedItem.guid = selectedItem.model.guid; selectedItem.guid = selectedItem.model.guid;
selectedItem.type = "Glossary"; selectedItem.type = "Glossary";
selectedItem.gType = "glossary"; selectedItem.gType = "glossary";
selectedItem.text = model.displayName; selectedItem.text = model.name;
this.glossary.selectedItem = selectedItem; this.glossary.selectedItem = selectedItem;
this.query[this.viewType].model = selectedItem.model; this.query[this.viewType].model = selectedItem.model;
this.query[this.viewType].gType = "glossary"; this.query[this.viewType].gType = "glossary";
......
...@@ -137,16 +137,16 @@ public enum AtlasErrorCode { ...@@ -137,16 +137,16 @@ public enum AtlasErrorCode {
MISSING_TERM_ID_FOR_CATEGORIZATION(400, "ATLAS-400-00-076", "Term guid can't be empty/null when adding to a category"), MISSING_TERM_ID_FOR_CATEGORIZATION(400, "ATLAS-400-00-076", "Term guid can't be empty/null when adding to a category"),
INVALID_NEW_ANCHOR_GUID(400, "ATLAS-400-00-077", "New Anchor guid can't be empty/null"), INVALID_NEW_ANCHOR_GUID(400, "ATLAS-400-00-077", "New Anchor guid can't be empty/null"),
TERM_DISSOCIATION_MISSING_RELATION_GUID(400, "ATLAS-400-00-078", "Missing mandatory attribute, TermAssignment relationship guid"), TERM_DISSOCIATION_MISSING_RELATION_GUID(400, "ATLAS-400-00-078", "Missing mandatory attribute, TermAssignment relationship guid"),
GLOSSARY_QUALIFIED_NAME_CANT_BE_DERIVED(400, "ATLAS-400-00-079", "Attributes qualifiedName and displayName are missing. Failed to derive a unique name for Glossary"), GLOSSARY_QUALIFIED_NAME_CANT_BE_DERIVED(400, "ATLAS-400-00-079", "Attributes qualifiedName and name are missing. Failed to derive a unique name for Glossary"),
GLOSSARY_TERM_QUALIFIED_NAME_CANT_BE_DERIVED(400, "ATLAS-400-00-07A", "Attributes qualifiedName, displayName & glossary name are missing. Failed to derive a unique name for Glossary term"), GLOSSARY_TERM_QUALIFIED_NAME_CANT_BE_DERIVED(400, "ATLAS-400-00-07A", "Attributes qualifiedName, name & glossary name are missing. Failed to derive a unique name for Glossary term"),
GLOSSARY_CATEGORY_QUALIFIED_NAME_CANT_BE_DERIVED(400, "ATLAS-400-00-07B", "Attributes qualifiedName, displayName & glossary name are missing. Failed to derive a unique name for Glossary category"), GLOSSARY_CATEGORY_QUALIFIED_NAME_CANT_BE_DERIVED(400, "ATLAS-400-00-07B", "Attributes qualifiedName, name & glossary name are missing. Failed to derive a unique name for Glossary category"),
RELATIONSHIP_END_IS_NULL(400, "ATLAS-400-00-07D", "Relationship end is invalid. Expected {0} but is NULL"), RELATIONSHIP_END_IS_NULL(400, "ATLAS-400-00-07D", "Relationship end is invalid. Expected {0} but is NULL"),
INVALID_TERM_RELATION_TO_SELF(400, "ATLAS-400-00-07E", "Invalid Term relationship: Term can't have a relationship with self"), INVALID_TERM_RELATION_TO_SELF(400, "ATLAS-400-00-07E", "Invalid Term relationship: Term can't have a relationship with self"),
INVALID_CHILD_CATEGORY_DIFFERENT_GLOSSARY(400, "ATLAS-400-00-07F", "Invalid child category relationship: Child category (guid = {0}) belongs to different glossary"), INVALID_CHILD_CATEGORY_DIFFERENT_GLOSSARY(400, "ATLAS-400-00-07F", "Invalid child category relationship: Child category (guid = {0}) belongs to different glossary"),
INVALID_TERM_DISSOCIATION(400, "ATLAS-400-00-080", "Given relationshipGuid({0}) is invalid for term (guid={1}) and entity(guid={2})"), INVALID_TERM_DISSOCIATION(400, "ATLAS-400-00-080", "Given relationshipGuid({0}) is invalid for term (guid={1}) and entity(guid={2})"),
ATTRIBUTE_TYPE_INVALID(400, "ATLAS-400-00-081", "{0}.{1}: invalid attribute type. Attribute cannot be of type classification"), ATTRIBUTE_TYPE_INVALID(400, "ATLAS-400-00-081", "{0}.{1}: invalid attribute type. Attribute cannot be of type classification"),
MISSING_CATEGORY_DISPLAY_NAME(400, "ATLAS-400-00-082", "Category displayName is empty/null"), MISSING_CATEGORY_DISPLAY_NAME(400, "ATLAS-400-00-082", "Category name is empty/null"),
INVALID_DISPLAY_NAME(400, "ATLAS-400-00-083", "displayName cannot contain following special chars ('@', '.')"), INVALID_DISPLAY_NAME(400, "ATLAS-400-00-083", "name cannot contain following special chars ('@', '.')"),
TERM_HAS_ENTITY_ASSOCIATION(400, "ATLAS-400-00-086", "Term (guid={0}) can't be deleted as it has been assigned to {1} entities."), TERM_HAS_ENTITY_ASSOCIATION(400, "ATLAS-400-00-086", "Term (guid={0}) can't be deleted as it has been assigned to {1} entities."),
UNAUTHORIZED_ACCESS(403, "ATLAS-403-00-001", "{0} is not authorized to perform {1}"), UNAUTHORIZED_ACCESS(403, "ATLAS-403-00-001", "{0} is not authorized to perform {1}"),
......
...@@ -44,7 +44,7 @@ public class AtlasGlossary extends AtlasGlossaryBaseObject { ...@@ -44,7 +44,7 @@ public class AtlasGlossary extends AtlasGlossaryBaseObject {
super(other); super(other);
super.setQualifiedName(other.getQualifiedName()); super.setQualifiedName(other.getQualifiedName());
super.setGuid(other.getGuid()); super.setGuid(other.getGuid());
super.setDisplayName(other.displayName); super.setName(other.name);
super.setShortDescription(other.shortDescription); super.setShortDescription(other.shortDescription);
super.setLongDescription(other.longDescription); super.setLongDescription(other.longDescription);
this.language = other.language; this.language = other.language;
...@@ -90,8 +90,8 @@ public class AtlasGlossary extends AtlasGlossaryBaseObject { ...@@ -90,8 +90,8 @@ public class AtlasGlossary extends AtlasGlossaryBaseObject {
public void setAttribute(String attrName, String attrVal) { public void setAttribute(String attrName, String attrVal) {
Objects.requireNonNull(attrName, "AtlasGlossary attribute name"); Objects.requireNonNull(attrName, "AtlasGlossary attribute name");
switch (attrName) { switch (attrName) {
case "displayName": case "name":
setDisplayName(attrVal); setName(attrVal);
break; break;
case "shortDescription": case "shortDescription":
setShortDescription(attrVal); setShortDescription(attrVal);
......
...@@ -30,7 +30,7 @@ public abstract class AtlasGlossaryBaseObject extends AtlasBaseModelObject { ...@@ -30,7 +30,7 @@ public abstract class AtlasGlossaryBaseObject extends AtlasBaseModelObject {
// Core attributes // Core attributes
private String qualifiedName; private String qualifiedName;
protected String displayName; protected String name;
protected String shortDescription; protected String shortDescription;
protected String longDescription; protected String longDescription;
...@@ -42,7 +42,7 @@ public abstract class AtlasGlossaryBaseObject extends AtlasBaseModelObject { ...@@ -42,7 +42,7 @@ public abstract class AtlasGlossaryBaseObject extends AtlasBaseModelObject {
public AtlasGlossaryBaseObject(final AtlasGlossaryBaseObject other) { public AtlasGlossaryBaseObject(final AtlasGlossaryBaseObject other) {
super(other); super(other);
this.displayName = other.displayName; this.name = other.name;
this.shortDescription = other.shortDescription; this.shortDescription = other.shortDescription;
this.longDescription = other.longDescription; this.longDescription = other.longDescription;
this.classifications = other.classifications; this.classifications = other.classifications;
...@@ -57,12 +57,12 @@ public abstract class AtlasGlossaryBaseObject extends AtlasBaseModelObject { ...@@ -57,12 +57,12 @@ public abstract class AtlasGlossaryBaseObject extends AtlasBaseModelObject {
this.qualifiedName = qualifiedName; this.qualifiedName = qualifiedName;
} }
public String getDisplayName() { public String getName() {
return displayName; return name;
} }
public void setDisplayName(final String displayName) { public void setName(final String name) {
this.displayName = displayName; this.name = name;
} }
public String getShortDescription() { public String getShortDescription() {
...@@ -114,7 +114,7 @@ public abstract class AtlasGlossaryBaseObject extends AtlasBaseModelObject { ...@@ -114,7 +114,7 @@ public abstract class AtlasGlossaryBaseObject extends AtlasBaseModelObject {
if (!(o instanceof AtlasGlossaryBaseObject)) return false; if (!(o instanceof AtlasGlossaryBaseObject)) return false;
if (!super.equals(o)) return false; if (!super.equals(o)) return false;
final AtlasGlossaryBaseObject that = (AtlasGlossaryBaseObject) o; final AtlasGlossaryBaseObject that = (AtlasGlossaryBaseObject) o;
return Objects.equals(displayName, that.displayName) && return Objects.equals(name, that.name) &&
Objects.equals(shortDescription, that.shortDescription) && Objects.equals(shortDescription, that.shortDescription) &&
Objects.equals(longDescription, that.longDescription) && Objects.equals(longDescription, that.longDescription) &&
Objects.equals(classifications, that.classifications) && Objects.equals(classifications, that.classifications) &&
...@@ -124,13 +124,13 @@ public abstract class AtlasGlossaryBaseObject extends AtlasBaseModelObject { ...@@ -124,13 +124,13 @@ public abstract class AtlasGlossaryBaseObject extends AtlasBaseModelObject {
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hash(super.hashCode(), displayName, shortDescription, longDescription, classifications, qualifiedName); return Objects.hash(super.hashCode(), name, shortDescription, longDescription, classifications, qualifiedName);
} }
@Override @Override
protected StringBuilder toString(final StringBuilder sb) { protected StringBuilder toString(final StringBuilder sb) {
sb.append(", qualifiedName='").append(qualifiedName).append('\''); sb.append(", qualifiedName='").append(qualifiedName).append('\'');
sb.append(", displayName='").append(displayName).append('\''); sb.append(", name='").append(name).append('\'');
sb.append(", shortDescription='").append(shortDescription).append('\''); sb.append(", shortDescription='").append(shortDescription).append('\'');
sb.append(", longDescription='").append(longDescription).append('\''); sb.append(", longDescription='").append(longDescription).append('\'');
sb.append(", classifications=").append(classifications); sb.append(", classifications=").append(classifications);
......
...@@ -122,8 +122,8 @@ public class AtlasGlossaryCategory extends AtlasGlossaryBaseObject { ...@@ -122,8 +122,8 @@ public class AtlasGlossaryCategory extends AtlasGlossaryBaseObject {
public void setAttribute(String attrName, String attrVal) { public void setAttribute(String attrName, String attrVal) {
Objects.requireNonNull(attrName, "AtlasGlossary attribute name"); Objects.requireNonNull(attrName, "AtlasGlossary attribute name");
switch(attrName) { switch(attrName) {
case "displayName": case "name":
setDisplayName(attrVal); setName(attrVal);
break; break;
case "shortDescription": case "shortDescription":
setShortDescription(attrVal); setShortDescription(attrVal);
......
...@@ -290,7 +290,7 @@ public class AtlasGlossaryTerm extends AtlasGlossaryBaseObject { ...@@ -290,7 +290,7 @@ public class AtlasGlossaryTerm extends AtlasGlossaryBaseObject {
public String toAuditString() { public String toAuditString() {
AtlasGlossaryTerm t = new AtlasGlossaryTerm(); AtlasGlossaryTerm t = new AtlasGlossaryTerm();
t.setGuid(this.getGuid()); t.setGuid(this.getGuid());
t.setDisplayName(this.getDisplayName()); t.setName(this.getName());
t.setQualifiedName(this.getQualifiedName()); t.setQualifiedName(this.getQualifiedName());
return AtlasType.toJson(t); return AtlasType.toJson(t);
...@@ -306,8 +306,8 @@ public class AtlasGlossaryTerm extends AtlasGlossaryBaseObject { ...@@ -306,8 +306,8 @@ public class AtlasGlossaryTerm extends AtlasGlossaryBaseObject {
public void setAttribute(String attrName, String attrVal) { public void setAttribute(String attrName, String attrVal) {
Objects.requireNonNull(attrName, "AtlasGlossaryTerm attribute name"); Objects.requireNonNull(attrName, "AtlasGlossaryTerm attribute name");
switch (attrName) { switch (attrName) {
case "displayName": case "name":
setDisplayName(attrVal); setName(attrVal);
break; break;
case "shortDescription": case "shortDescription":
setShortDescription(attrVal); setShortDescription(attrVal);
......
...@@ -92,7 +92,7 @@ public class GlossaryCategoryUtils extends GlossaryUtils { ...@@ -92,7 +92,7 @@ public class GlossaryCategoryUtils extends GlossaryUtils {
// Derive the qualifiedName // Derive the qualifiedName
String anchorGlossaryGuid = updatedCategory.getAnchor().getGlossaryGuid(); String anchorGlossaryGuid = updatedCategory.getAnchor().getGlossaryGuid();
AtlasGlossary glossary = dataAccess.load(getGlossarySkeleton(anchorGlossaryGuid)); AtlasGlossary glossary = dataAccess.load(getGlossarySkeleton(anchorGlossaryGuid));
storeObject.setQualifiedName(storeObject.getDisplayName()+ "@" + glossary.getQualifiedName()); storeObject.setQualifiedName(storeObject.getName()+ "@" + glossary.getQualifiedName());
if (LOG.isDebugEnabled()) { if (LOG.isDebugEnabled()) {
LOG.debug("Derived qualifiedName = {}", storeObject.getQualifiedName()); LOG.debug("Derived qualifiedName = {}", storeObject.getQualifiedName());
...@@ -118,7 +118,7 @@ public class GlossaryCategoryUtils extends GlossaryUtils { ...@@ -118,7 +118,7 @@ public class GlossaryCategoryUtils extends GlossaryUtils {
// Derive the qualifiedName when anchor changes // Derive the qualifiedName when anchor changes
String anchorGlossaryGuid = updatedCategory.getAnchor().getGlossaryGuid(); String anchorGlossaryGuid = updatedCategory.getAnchor().getGlossaryGuid();
AtlasGlossary glossary = dataAccess.load(getGlossarySkeleton(anchorGlossaryGuid)); AtlasGlossary glossary = dataAccess.load(getGlossarySkeleton(anchorGlossaryGuid));
storeObject.setQualifiedName(storeObject.getDisplayName()+ "@" + glossary.getQualifiedName()); storeObject.setQualifiedName(storeObject.getName()+ "@" + glossary.getQualifiedName());
if (LOG.isDebugEnabled()) { if (LOG.isDebugEnabled()) {
LOG.debug("Derived qualifiedName = {}", storeObject.getQualifiedName()); LOG.debug("Derived qualifiedName = {}", storeObject.getQualifiedName());
...@@ -196,7 +196,7 @@ public class GlossaryCategoryUtils extends GlossaryUtils { ...@@ -196,7 +196,7 @@ public class GlossaryCategoryUtils extends GlossaryUtils {
// New parent added, qualifiedName needs recomputation // New parent added, qualifiedName needs recomputation
// Derive the qualifiedName of the Glossary // Derive the qualifiedName of the Glossary
AtlasGlossaryCategory parentCategory = dataAccess.load(getAtlasGlossaryCategorySkeleton(newParent.getCategoryGuid())); AtlasGlossaryCategory parentCategory = dataAccess.load(getAtlasGlossaryCategorySkeleton(newParent.getCategoryGuid()));
storeObject.setQualifiedName(storeObject.getDisplayName() + "." + parentCategory.getQualifiedName()); storeObject.setQualifiedName(storeObject.getName() + "." + parentCategory.getQualifiedName());
if (LOG.isDebugEnabled()) { if (LOG.isDebugEnabled()) {
LOG.debug("Derived qualifiedName = {}", storeObject.getQualifiedName()); LOG.debug("Derived qualifiedName = {}", storeObject.getQualifiedName());
...@@ -216,7 +216,7 @@ public class GlossaryCategoryUtils extends GlossaryUtils { ...@@ -216,7 +216,7 @@ public class GlossaryCategoryUtils extends GlossaryUtils {
// Derive the qualifiedName of the Glossary // Derive the qualifiedName of the Glossary
String anchorGlossaryGuid = updatedCategory.getAnchor().getGlossaryGuid(); String anchorGlossaryGuid = updatedCategory.getAnchor().getGlossaryGuid();
AtlasGlossary glossary = dataAccess.load(getGlossarySkeleton(anchorGlossaryGuid)); AtlasGlossary glossary = dataAccess.load(getGlossarySkeleton(anchorGlossaryGuid));
storeObject.setQualifiedName(storeObject.getDisplayName() + "@" + glossary.getQualifiedName()); storeObject.setQualifiedName(storeObject.getName() + "@" + glossary.getQualifiedName());
if (LOG.isDebugEnabled()) { if (LOG.isDebugEnabled()) {
LOG.debug("Derived qualifiedName = {}", storeObject.getQualifiedName()); LOG.debug("Derived qualifiedName = {}", storeObject.getQualifiedName());
...@@ -232,7 +232,7 @@ public class GlossaryCategoryUtils extends GlossaryUtils { ...@@ -232,7 +232,7 @@ public class GlossaryCategoryUtils extends GlossaryUtils {
switch (op) { switch (op) {
case CREATE: case CREATE:
if (DEBUG_ENABLED) { if (DEBUG_ENABLED) {
LOG.debug("Creating term relation with category = {}, terms = {}", storeObject.getDisplayName(), LOG.debug("Creating term relation with category = {}, terms = {}", storeObject.getName(),
Objects.nonNull(newTerms) ? newTerms.size() : "none"); Objects.nonNull(newTerms) ? newTerms.size() : "none");
} }
createTermCategorizationRelationships(storeObject, newTerms.values()); createTermCategorizationRelationships(storeObject, newTerms.values());
...@@ -240,7 +240,7 @@ public class GlossaryCategoryUtils extends GlossaryUtils { ...@@ -240,7 +240,7 @@ public class GlossaryCategoryUtils extends GlossaryUtils {
case UPDATE: case UPDATE:
if (MapUtils.isEmpty(existingTerms)) { if (MapUtils.isEmpty(existingTerms)) {
if (DEBUG_ENABLED) { if (DEBUG_ENABLED) {
LOG.debug("Creating term relation with category = {}, terms = {}", storeObject.getDisplayName(), LOG.debug("Creating term relation with category = {}, terms = {}", storeObject.getName(),
Objects.nonNull(newTerms) ? newTerms.size() : "none"); Objects.nonNull(newTerms) ? newTerms.size() : "none");
} }
createTermCategorizationRelationships(storeObject, newTerms.values()); createTermCategorizationRelationships(storeObject, newTerms.values());
...@@ -249,7 +249,7 @@ public class GlossaryCategoryUtils extends GlossaryUtils { ...@@ -249,7 +249,7 @@ public class GlossaryCategoryUtils extends GlossaryUtils {
if (MapUtils.isEmpty(newTerms)) { if (MapUtils.isEmpty(newTerms)) {
if (DEBUG_ENABLED) { if (DEBUG_ENABLED) {
LOG.debug("Deleting term relation with category = {}, terms = {}", storeObject.getDisplayName(), existingTerms.size()); LOG.debug("Deleting term relation with category = {}, terms = {}", storeObject.getName(), existingTerms.size());
} }
deleteTermCategorizationRelationships(storeObject, existingTerms.values()); deleteTermCategorizationRelationships(storeObject, existingTerms.values());
break; break;
...@@ -328,7 +328,7 @@ public class GlossaryCategoryUtils extends GlossaryUtils { ...@@ -328,7 +328,7 @@ public class GlossaryCategoryUtils extends GlossaryUtils {
if (CollectionUtils.isNotEmpty(terms)) { if (CollectionUtils.isNotEmpty(terms)) {
for (AtlasRelatedTermHeader term : terms) { for (AtlasRelatedTermHeader term : terms) {
if (DEBUG_ENABLED) { if (DEBUG_ENABLED) {
LOG.debug("Updating term relation with category = {}, term = {}", storeObject.getDisplayName(), term.getDisplayText()); LOG.debug("Updating term relation with category = {}, term = {}", storeObject.getName(), term.getDisplayText());
} }
AtlasRelationship relationship = relationshipStore.getById(term.getRelationGuid()); AtlasRelationship relationship = relationshipStore.getById(term.getRelationGuid());
updateRelationshipAttributes(relationship, term); updateRelationshipAttributes(relationship, term);
...@@ -341,7 +341,7 @@ public class GlossaryCategoryUtils extends GlossaryUtils { ...@@ -341,7 +341,7 @@ public class GlossaryCategoryUtils extends GlossaryUtils {
if (CollectionUtils.isNotEmpty(terms)) { if (CollectionUtils.isNotEmpty(terms)) {
for (AtlasRelatedTermHeader term : terms) { for (AtlasRelatedTermHeader term : terms) {
if (DEBUG_ENABLED) { if (DEBUG_ENABLED) {
LOG.debug("Creating term relation with category = {}, terms = {}", storeObject.getDisplayName(), term.getDisplayText()); LOG.debug("Creating term relation with category = {}, terms = {}", storeObject.getName(), term.getDisplayText());
} }
relationshipStore.deleteById(term.getRelationGuid(), true); relationshipStore.deleteById(term.getRelationGuid(), true);
} }
...@@ -354,7 +354,7 @@ public class GlossaryCategoryUtils extends GlossaryUtils { ...@@ -354,7 +354,7 @@ public class GlossaryCategoryUtils extends GlossaryUtils {
switch (op) { switch (op) {
case CREATE: case CREATE:
if (DEBUG_ENABLED) { if (DEBUG_ENABLED) {
LOG.debug("Creating new children, category = {}, children = {}", storeObject.getDisplayName(), LOG.debug("Creating new children, category = {}, children = {}", storeObject.getName(),
Objects.nonNull(newChildren) ? newChildren.size() : "none"); Objects.nonNull(newChildren) ? newChildren.size() : "none");
} }
createCategoryRelationships(storeObject, newChildren.values()); createCategoryRelationships(storeObject, newChildren.values());
...@@ -366,7 +366,7 @@ public class GlossaryCategoryUtils extends GlossaryUtils { ...@@ -366,7 +366,7 @@ public class GlossaryCategoryUtils extends GlossaryUtils {
// Create new children // Create new children
if (MapUtils.isEmpty(existingChildren)) { if (MapUtils.isEmpty(existingChildren)) {
if (DEBUG_ENABLED) { if (DEBUG_ENABLED) {
LOG.debug("Creating new children, category = {}, children = {}", storeObject.getDisplayName(), LOG.debug("Creating new children, category = {}, children = {}", storeObject.getName(),
Objects.nonNull(newChildren) ? newChildren.size() : "none"); Objects.nonNull(newChildren) ? newChildren.size() : "none");
} }
createCategoryRelationships(storeObject, newChildren.values()); createCategoryRelationships(storeObject, newChildren.values());
...@@ -378,7 +378,7 @@ public class GlossaryCategoryUtils extends GlossaryUtils { ...@@ -378,7 +378,7 @@ public class GlossaryCategoryUtils extends GlossaryUtils {
// Delete current children // Delete current children
if (MapUtils.isEmpty(newChildren)) { if (MapUtils.isEmpty(newChildren)) {
if (DEBUG_ENABLED) { if (DEBUG_ENABLED) {
LOG.debug("Deleting children, category = {}, children = {}", storeObject.getDisplayName(), existingChildren.size()); LOG.debug("Deleting children, category = {}, children = {}", storeObject.getName(), existingChildren.size());
} }
deleteCategoryRelationships(storeObject, existingChildren.values()); deleteCategoryRelationships(storeObject, existingChildren.values());
...@@ -455,7 +455,7 @@ public class GlossaryCategoryUtils extends GlossaryUtils { ...@@ -455,7 +455,7 @@ public class GlossaryCategoryUtils extends GlossaryUtils {
if (StringUtils.equals(storeObject.getAnchor().getGlossaryGuid(), childCategory.getAnchor().getGlossaryGuid())) { if (StringUtils.equals(storeObject.getAnchor().getGlossaryGuid(), childCategory.getAnchor().getGlossaryGuid())) {
if (DEBUG_ENABLED) { if (DEBUG_ENABLED) {
LOG.debug("Creating new child, category = {}, child = {}", storeObject.getDisplayName(), child.getDisplayText()); LOG.debug("Creating new child, category = {}, child = {}", storeObject.getName(), child.getDisplayText());
} }
createRelationship(defineCategoryHierarchyLink(storeObject.getGuid(), child)); createRelationship(defineCategoryHierarchyLink(storeObject.getGuid(), child));
} else { } else {
...@@ -470,7 +470,7 @@ public class GlossaryCategoryUtils extends GlossaryUtils { ...@@ -470,7 +470,7 @@ public class GlossaryCategoryUtils extends GlossaryUtils {
if (CollectionUtils.isNotEmpty(toUpdate)) { if (CollectionUtils.isNotEmpty(toUpdate)) {
for (AtlasRelatedCategoryHeader categoryHeader : toUpdate) { for (AtlasRelatedCategoryHeader categoryHeader : toUpdate) {
if (DEBUG_ENABLED) { if (DEBUG_ENABLED) {
LOG.debug("Updating child, category = {}, child = {}", storeObject.getDisplayName(), categoryHeader.getDisplayText()); LOG.debug("Updating child, category = {}, child = {}", storeObject.getName(), categoryHeader.getDisplayText());
} }
AtlasRelationship childRelationship = relationshipStore.getById(categoryHeader.getRelationGuid()); AtlasRelationship childRelationship = relationshipStore.getById(categoryHeader.getRelationGuid());
updateRelationshipAttributes(childRelationship, categoryHeader); updateRelationshipAttributes(childRelationship, categoryHeader);
...@@ -483,7 +483,7 @@ public class GlossaryCategoryUtils extends GlossaryUtils { ...@@ -483,7 +483,7 @@ public class GlossaryCategoryUtils extends GlossaryUtils {
if (CollectionUtils.isNotEmpty(existingChildren)) { if (CollectionUtils.isNotEmpty(existingChildren)) {
for (AtlasRelatedCategoryHeader child : existingChildren) { for (AtlasRelatedCategoryHeader child : existingChildren) {
if (DEBUG_ENABLED) { if (DEBUG_ENABLED) {
LOG.debug("Deleting child, category = {}, child = {}", storeObject.getDisplayName(), child.getDisplayText()); LOG.debug("Deleting child, category = {}, child = {}", storeObject.getName(), child.getDisplayText());
} }
relationshipStore.deleteById(child.getRelationGuid(), true); relationshipStore.deleteById(child.getRelationGuid(), true);
} }
...@@ -543,7 +543,7 @@ public class GlossaryCategoryUtils extends GlossaryUtils { ...@@ -543,7 +543,7 @@ public class GlossaryCategoryUtils extends GlossaryUtils {
for (AtlasRelatedCategoryHeader childCategoryHeader : childCategories) { for (AtlasRelatedCategoryHeader childCategoryHeader : childCategories) {
AtlasGlossaryCategory child = dataAccess.load(getAtlasGlossaryCategorySkeleton(childCategoryHeader.getCategoryGuid())); AtlasGlossaryCategory child = dataAccess.load(getAtlasGlossaryCategorySkeleton(childCategoryHeader.getCategoryGuid()));
String qualifiedName = child.getDisplayName() + "."; String qualifiedName = child.getName() + ".";
String childAnchorGuid = child.getAnchor().getGlossaryGuid(); String childAnchorGuid = child.getAnchor().getGlossaryGuid();
if (isParentRemoved) { if (isParentRemoved) {
if (LOG.isDebugEnabled()) { if (LOG.isDebugEnabled()) {
......
...@@ -137,13 +137,13 @@ public class GlossaryService { ...@@ -137,13 +137,13 @@ public class GlossaryService {
} }
if (StringUtils.isEmpty(atlasGlossary.getQualifiedName())) { if (StringUtils.isEmpty(atlasGlossary.getQualifiedName())) {
if (StringUtils.isEmpty(atlasGlossary.getDisplayName())) { if (StringUtils.isEmpty(atlasGlossary.getName())) {
throw new AtlasBaseException(AtlasErrorCode.GLOSSARY_QUALIFIED_NAME_CANT_BE_DERIVED); throw new AtlasBaseException(AtlasErrorCode.GLOSSARY_QUALIFIED_NAME_CANT_BE_DERIVED);
} }
if (isNameInvalid(atlasGlossary.getDisplayName())){ if (isNameInvalid(atlasGlossary.getName())){
throw new AtlasBaseException(AtlasErrorCode.INVALID_DISPLAY_NAME); throw new AtlasBaseException(AtlasErrorCode.INVALID_DISPLAY_NAME);
} else { } else {
atlasGlossary.setQualifiedName(atlasGlossary.getDisplayName()); atlasGlossary.setQualifiedName(atlasGlossary.getName());
} }
} }
...@@ -246,11 +246,11 @@ public class GlossaryService { ...@@ -246,11 +246,11 @@ public class GlossaryService {
throw new AtlasBaseException(AtlasErrorCode.BAD_REQUEST, "Glossary is null/empty"); throw new AtlasBaseException(AtlasErrorCode.BAD_REQUEST, "Glossary is null/empty");
} }
if (StringUtils.isEmpty(atlasGlossary.getDisplayName())) { if (StringUtils.isEmpty(atlasGlossary.getName())) {
throw new AtlasBaseException(AtlasErrorCode.BAD_REQUEST, "DisplayName can't be null/empty"); throw new AtlasBaseException(AtlasErrorCode.BAD_REQUEST, "DisplayName can't be null/empty");
} }
if (isNameInvalid(atlasGlossary.getDisplayName())) { if (isNameInvalid(atlasGlossary.getName())) {
throw new AtlasBaseException(AtlasErrorCode.INVALID_DISPLAY_NAME); throw new AtlasBaseException(AtlasErrorCode.INVALID_DISPLAY_NAME);
} }
...@@ -331,14 +331,14 @@ public class GlossaryService { ...@@ -331,14 +331,14 @@ public class GlossaryService {
throw new AtlasBaseException(AtlasErrorCode.MISSING_MANDATORY_ANCHOR); throw new AtlasBaseException(AtlasErrorCode.MISSING_MANDATORY_ANCHOR);
} }
if (StringUtils.isEmpty(glossaryTerm.getQualifiedName())) { if (StringUtils.isEmpty(glossaryTerm.getQualifiedName())) {
if (StringUtils.isEmpty(glossaryTerm.getDisplayName())) { if (StringUtils.isEmpty(glossaryTerm.getName())) {
throw new AtlasBaseException(AtlasErrorCode.GLOSSARY_TERM_QUALIFIED_NAME_CANT_BE_DERIVED); throw new AtlasBaseException(AtlasErrorCode.GLOSSARY_TERM_QUALIFIED_NAME_CANT_BE_DERIVED);
} }
if (isNameInvalid(glossaryTerm.getDisplayName())){ if (isNameInvalid(glossaryTerm.getName())){
throw new AtlasBaseException(AtlasErrorCode.INVALID_DISPLAY_NAME); throw new AtlasBaseException(AtlasErrorCode.INVALID_DISPLAY_NAME);
} else { } else {
glossaryTerm.setQualifiedName(glossaryTerm.getDisplayName()); glossaryTerm.setQualifiedName(glossaryTerm.getName());
} }
} }
...@@ -403,11 +403,11 @@ public class GlossaryService { ...@@ -403,11 +403,11 @@ public class GlossaryService {
throw new AtlasBaseException(AtlasErrorCode.BAD_REQUEST, "atlasGlossaryTerm is null/empty"); throw new AtlasBaseException(AtlasErrorCode.BAD_REQUEST, "atlasGlossaryTerm is null/empty");
} }
if (StringUtils.isEmpty(atlasGlossaryTerm.getDisplayName())) { if (StringUtils.isEmpty(atlasGlossaryTerm.getName())) {
throw new AtlasBaseException(AtlasErrorCode.BAD_REQUEST, "DisplayName can't be null/empty"); throw new AtlasBaseException(AtlasErrorCode.BAD_REQUEST, "DisplayName can't be null/empty");
} }
if (isNameInvalid(atlasGlossaryTerm.getDisplayName())) { if (isNameInvalid(atlasGlossaryTerm.getName())) {
throw new AtlasBaseException(AtlasErrorCode.INVALID_DISPLAY_NAME); throw new AtlasBaseException(AtlasErrorCode.INVALID_DISPLAY_NAME);
} }
...@@ -546,13 +546,13 @@ public class GlossaryService { ...@@ -546,13 +546,13 @@ public class GlossaryService {
throw new AtlasBaseException(AtlasErrorCode.MISSING_MANDATORY_ANCHOR); throw new AtlasBaseException(AtlasErrorCode.MISSING_MANDATORY_ANCHOR);
} }
if (StringUtils.isEmpty(glossaryCategory.getQualifiedName())) { if (StringUtils.isEmpty(glossaryCategory.getQualifiedName())) {
if (StringUtils.isEmpty(glossaryCategory.getDisplayName())) { if (StringUtils.isEmpty(glossaryCategory.getName())) {
throw new AtlasBaseException(AtlasErrorCode.GLOSSARY_CATEGORY_QUALIFIED_NAME_CANT_BE_DERIVED); throw new AtlasBaseException(AtlasErrorCode.GLOSSARY_CATEGORY_QUALIFIED_NAME_CANT_BE_DERIVED);
} }
if (isNameInvalid(glossaryCategory.getDisplayName())){ if (isNameInvalid(glossaryCategory.getName())){
throw new AtlasBaseException(AtlasErrorCode.INVALID_DISPLAY_NAME); throw new AtlasBaseException(AtlasErrorCode.INVALID_DISPLAY_NAME);
} else { } else {
glossaryCategory.setQualifiedName(glossaryCategory.getDisplayName()); glossaryCategory.setQualifiedName(glossaryCategory.getName());
} }
} }
...@@ -621,11 +621,11 @@ public class GlossaryService { ...@@ -621,11 +621,11 @@ public class GlossaryService {
throw new AtlasBaseException(AtlasErrorCode.BAD_REQUEST, "GlossaryCategory is null/empty"); throw new AtlasBaseException(AtlasErrorCode.BAD_REQUEST, "GlossaryCategory is null/empty");
} }
if (StringUtils.isEmpty(glossaryCategory.getDisplayName())) { if (StringUtils.isEmpty(glossaryCategory.getName())) {
throw new AtlasBaseException(AtlasErrorCode.BAD_REQUEST, "DisplayName can't be null/empty"); throw new AtlasBaseException(AtlasErrorCode.BAD_REQUEST, "DisplayName can't be null/empty");
} }
if (isNameInvalid(glossaryCategory.getDisplayName())) { if (isNameInvalid(glossaryCategory.getName())) {
throw new AtlasBaseException(AtlasErrorCode.INVALID_DISPLAY_NAME); throw new AtlasBaseException(AtlasErrorCode.INVALID_DISPLAY_NAME);
} }
...@@ -997,7 +997,7 @@ public class GlossaryService { ...@@ -997,7 +997,7 @@ public class GlossaryService {
.collect(Collectors.toList()); .collect(Collectors.toList());
Map<String, AtlasGlossaryCategory> categoryMap = new HashMap<>(); Map<String, AtlasGlossaryCategory> categoryMap = new HashMap<>();
dataAccess.load(categories).forEach(c -> categoryMap.put(c.getGuid(), c)); dataAccess.load(categories).forEach(c -> categoryMap.put(c.getGuid(), c));
categorizationHeaders.forEach(c -> c.setDisplayText(categoryMap.get(c.getCategoryGuid()).getDisplayName())); categorizationHeaders.forEach(c -> c.setDisplayText(categoryMap.get(c.getCategoryGuid()).getName()));
} }
private void setInfoForRelatedCategories(final Collection<AtlasRelatedCategoryHeader> categoryHeaders) throws AtlasBaseException { private void setInfoForRelatedCategories(final Collection<AtlasRelatedCategoryHeader> categoryHeaders) throws AtlasBaseException {
...@@ -1009,7 +1009,7 @@ public class GlossaryService { ...@@ -1009,7 +1009,7 @@ public class GlossaryService {
dataAccess.load(categories).forEach(c -> categoryMap.put(c.getGuid(), c)); dataAccess.load(categories).forEach(c -> categoryMap.put(c.getGuid(), c));
for (AtlasRelatedCategoryHeader c : categoryHeaders) { for (AtlasRelatedCategoryHeader c : categoryHeaders) {
AtlasGlossaryCategory category = categoryMap.get(c.getCategoryGuid()); AtlasGlossaryCategory category = categoryMap.get(c.getCategoryGuid());
c.setDisplayText(category.getDisplayName()); c.setDisplayText(category.getName());
if (Objects.nonNull(category.getParentCategory())) { if (Objects.nonNull(category.getParentCategory())) {
c.setParentCategoryGuid(category.getParentCategory().getCategoryGuid()); c.setParentCategoryGuid(category.getParentCategory().getCategoryGuid());
} }
...@@ -1024,7 +1024,7 @@ public class GlossaryService { ...@@ -1024,7 +1024,7 @@ public class GlossaryService {
Map<String, AtlasGlossaryTerm> termMap = new HashMap<>(); Map<String, AtlasGlossaryTerm> termMap = new HashMap<>();
dataAccess.load(terms).iterator().forEachRemaining(t -> termMap.put(t.getGuid(), t)); dataAccess.load(terms).iterator().forEachRemaining(t -> termMap.put(t.getGuid(), t));
termHeaders.forEach(t -> t.setDisplayText(termMap.get(t.getTermGuid()).getDisplayName())); termHeaders.forEach(t -> t.setDisplayText(termMap.get(t.getTermGuid()).getName()));
} }
private boolean isNameInvalid(String name) { private boolean isNameInvalid(String name) {
......
...@@ -155,7 +155,7 @@ public class GlossaryTermUtils extends GlossaryUtils { ...@@ -155,7 +155,7 @@ public class GlossaryTermUtils extends GlossaryUtils {
// Derive the qualifiedName // Derive the qualifiedName
String anchorGlossaryGuid = updatedTermAnchor.getGlossaryGuid(); String anchorGlossaryGuid = updatedTermAnchor.getGlossaryGuid();
AtlasGlossary glossary = dataAccess.load(getGlossarySkeleton(anchorGlossaryGuid)); AtlasGlossary glossary = dataAccess.load(getGlossarySkeleton(anchorGlossaryGuid));
storeObject.setQualifiedName(storeObject.getDisplayName() + "@" + glossary.getQualifiedName()); storeObject.setQualifiedName(storeObject.getName() + "@" + glossary.getQualifiedName());
if (LOG.isDebugEnabled()) { if (LOG.isDebugEnabled()) {
LOG.debug("Derived qualifiedName = {}", storeObject.getQualifiedName()); LOG.debug("Derived qualifiedName = {}", storeObject.getQualifiedName());
...@@ -174,14 +174,14 @@ public class GlossaryTermUtils extends GlossaryUtils { ...@@ -174,14 +174,14 @@ public class GlossaryTermUtils extends GlossaryUtils {
LOG.debug("Updating term anchor, currAnchor = {}, newAnchor = {} and term = {}", LOG.debug("Updating term anchor, currAnchor = {}, newAnchor = {} and term = {}",
existingAnchor.getGlossaryGuid(), existingAnchor.getGlossaryGuid(),
updatedTermAnchor.getGlossaryGuid(), updatedTermAnchor.getGlossaryGuid(),
storeObject.getDisplayName()); storeObject.getName());
} }
relationshipStore.deleteById(existingAnchor.getRelationGuid(), true); relationshipStore.deleteById(existingAnchor.getRelationGuid(), true);
// Derive the qualifiedName when anchor changes // Derive the qualifiedName when anchor changes
String anchorGlossaryGuid = updatedTermAnchor.getGlossaryGuid(); String anchorGlossaryGuid = updatedTermAnchor.getGlossaryGuid();
AtlasGlossary glossary = dataAccess.load(getGlossarySkeleton(anchorGlossaryGuid)); AtlasGlossary glossary = dataAccess.load(getGlossarySkeleton(anchorGlossaryGuid));
storeObject.setQualifiedName(storeObject.getDisplayName() + "@" + glossary.getQualifiedName()); storeObject.setQualifiedName(storeObject.getName() + "@" + glossary.getQualifiedName());
if (LOG.isDebugEnabled()) { if (LOG.isDebugEnabled()) {
LOG.debug("Derived qualifiedName = {}", storeObject.getQualifiedName()); LOG.debug("Derived qualifiedName = {}", storeObject.getQualifiedName());
......
...@@ -53,7 +53,7 @@ public class AtlasGlossaryCategoryDTO extends AbstractGlossaryDTO<AtlasGlossaryC ...@@ -53,7 +53,7 @@ public class AtlasGlossaryCategoryDTO extends AbstractGlossaryDTO<AtlasGlossaryC
ret.setGuid(entity.getGuid()); ret.setGuid(entity.getGuid());
ret.setQualifiedName((String) entity.getAttribute("qualifiedName")); ret.setQualifiedName((String) entity.getAttribute("qualifiedName"));
ret.setDisplayName((String) entity.getAttribute("displayName")); ret.setName((String) entity.getAttribute("name"));
ret.setShortDescription((String) entity.getAttribute("shortDescription")); ret.setShortDescription((String) entity.getAttribute("shortDescription"));
ret.setLongDescription((String) entity.getAttribute("longDescription")); ret.setLongDescription((String) entity.getAttribute("longDescription"));
...@@ -120,7 +120,7 @@ public class AtlasGlossaryCategoryDTO extends AbstractGlossaryDTO<AtlasGlossaryC ...@@ -120,7 +120,7 @@ public class AtlasGlossaryCategoryDTO extends AbstractGlossaryDTO<AtlasGlossaryC
AtlasEntity ret = getDefaultAtlasEntity(obj); AtlasEntity ret = getDefaultAtlasEntity(obj);
ret.setAttribute("qualifiedName", obj.getQualifiedName()); ret.setAttribute("qualifiedName", obj.getQualifiedName());
ret.setAttribute("displayName", obj.getDisplayName()); ret.setAttribute("name", obj.getName());
ret.setAttribute("shortDescription", obj.getShortDescription()); ret.setAttribute("shortDescription", obj.getShortDescription());
ret.setAttribute("longDescription", obj.getLongDescription()); ret.setAttribute("longDescription", obj.getLongDescription());
......
...@@ -53,7 +53,7 @@ public class AtlasGlossaryDTO extends AbstractGlossaryDTO<AtlasGlossary> { ...@@ -53,7 +53,7 @@ public class AtlasGlossaryDTO extends AbstractGlossaryDTO<AtlasGlossary> {
ret.setGuid(entity.getGuid()); ret.setGuid(entity.getGuid());
ret.setQualifiedName((String) entity.getAttribute("qualifiedName")); ret.setQualifiedName((String) entity.getAttribute("qualifiedName"));
ret.setDisplayName((String) entity.getAttribute("displayName")); ret.setName((String) entity.getAttribute("name"));
ret.setShortDescription((String) entity.getAttribute("shortDescription")); ret.setShortDescription((String) entity.getAttribute("shortDescription"));
ret.setLongDescription((String) entity.getAttribute("longDescription")); ret.setLongDescription((String) entity.getAttribute("longDescription"));
ret.setLanguage((String) entity.getAttribute("language")); ret.setLanguage((String) entity.getAttribute("language"));
...@@ -114,7 +114,7 @@ public class AtlasGlossaryDTO extends AbstractGlossaryDTO<AtlasGlossary> { ...@@ -114,7 +114,7 @@ public class AtlasGlossaryDTO extends AbstractGlossaryDTO<AtlasGlossary> {
AtlasEntity ret = getDefaultAtlasEntity(obj); AtlasEntity ret = getDefaultAtlasEntity(obj);
ret.setAttribute("qualifiedName", obj.getQualifiedName()); ret.setAttribute("qualifiedName", obj.getQualifiedName());
ret.setAttribute("displayName", obj.getDisplayName()); ret.setAttribute("name", obj.getName());
ret.setAttribute("shortDescription", obj.getShortDescription()); ret.setAttribute("shortDescription", obj.getShortDescription());
ret.setAttribute("longDescription", obj.getLongDescription()); ret.setAttribute("longDescription", obj.getLongDescription());
ret.setAttribute("language", obj.getLanguage()); ret.setAttribute("language", obj.getLanguage());
......
...@@ -56,7 +56,7 @@ public class AtlasGlossaryTermDTO extends AbstractGlossaryDTO<AtlasGlossaryTerm> ...@@ -56,7 +56,7 @@ public class AtlasGlossaryTermDTO extends AbstractGlossaryDTO<AtlasGlossaryTerm>
ret.setGuid(entity.getGuid()); ret.setGuid(entity.getGuid());
ret.setQualifiedName((String) entity.getAttribute("qualifiedName")); ret.setQualifiedName((String) entity.getAttribute("qualifiedName"));
ret.setDisplayName((String) entity.getAttribute("displayName")); ret.setName((String) entity.getAttribute("name"));
ret.setShortDescription((String) entity.getAttribute("shortDescription")); ret.setShortDescription((String) entity.getAttribute("shortDescription"));
ret.setLongDescription((String) entity.getAttribute("longDescription")); ret.setLongDescription((String) entity.getAttribute("longDescription"));
ret.setExamples((List<String>) entity.getAttribute("examples")); ret.setExamples((List<String>) entity.getAttribute("examples"));
...@@ -212,7 +212,7 @@ public class AtlasGlossaryTermDTO extends AbstractGlossaryDTO<AtlasGlossaryTerm> ...@@ -212,7 +212,7 @@ public class AtlasGlossaryTermDTO extends AbstractGlossaryDTO<AtlasGlossaryTerm>
AtlasEntity ret = getDefaultAtlasEntity(obj); AtlasEntity ret = getDefaultAtlasEntity(obj);
ret.setAttribute("qualifiedName", obj.getQualifiedName()); ret.setAttribute("qualifiedName", obj.getQualifiedName());
ret.setAttribute("displayName", obj.getDisplayName()); ret.setAttribute("name", obj.getName());
ret.setAttribute("shortDescription", obj.getShortDescription()); ret.setAttribute("shortDescription", obj.getShortDescription());
ret.setAttribute("longDescription", obj.getLongDescription()); ret.setAttribute("longDescription", obj.getLongDescription());
ret.setAttribute("examples", obj.getExamples()); ret.setAttribute("examples", obj.getExamples());
......
...@@ -122,7 +122,7 @@ public final class EntityGraphRetriever { ...@@ -122,7 +122,7 @@ public final class EntityGraphRetriever {
private static final Logger LOG = LoggerFactory.getLogger(EntityGraphRetriever.class); private static final Logger LOG = LoggerFactory.getLogger(EntityGraphRetriever.class);
private static final String TERM_RELATION_NAME = "AtlasGlossarySemanticAssignment"; private static final String TERM_RELATION_NAME = "AtlasGlossarySemanticAssignment";
private static final String GLOSSARY_TERM_DISPLAY_NAME_ATTR = "AtlasGlossaryTerm.displayName"; private static final String GLOSSARY_TERM_DISPLAY_NAME_ATTR = "AtlasGlossaryTerm.name";
public static final String NAME = "name"; public static final String NAME = "name";
public static final String DISPLAY_NAME = "displayName"; public static final String DISPLAY_NAME = "displayName";
......
...@@ -110,7 +110,7 @@ public class GlossaryServiceTest { ...@@ -110,7 +110,7 @@ public class GlossaryServiceTest {
// Glossary // Glossary
bankGlossary = new AtlasGlossary(); bankGlossary = new AtlasGlossary();
bankGlossary.setQualifiedName("testBankingGlossary"); bankGlossary.setQualifiedName("testBankingGlossary");
bankGlossary.setDisplayName("Banking glossary"); bankGlossary.setName("Banking glossary");
bankGlossary.setShortDescription("Short description"); bankGlossary.setShortDescription("Short description");
bankGlossary.setLongDescription("Long description"); bankGlossary.setLongDescription("Long description");
bankGlossary.setUsage("N/A"); bankGlossary.setUsage("N/A");
...@@ -118,7 +118,7 @@ public class GlossaryServiceTest { ...@@ -118,7 +118,7 @@ public class GlossaryServiceTest {
creditUnionGlossary = new AtlasGlossary(); creditUnionGlossary = new AtlasGlossary();
creditUnionGlossary.setQualifiedName("testCreditUnionGlossary"); creditUnionGlossary.setQualifiedName("testCreditUnionGlossary");
creditUnionGlossary.setDisplayName("Credit union glossary"); creditUnionGlossary.setName("Credit union glossary");
creditUnionGlossary.setShortDescription("Short description"); creditUnionGlossary.setShortDescription("Short description");
creditUnionGlossary.setLongDescription("Long description"); creditUnionGlossary.setLongDescription("Long description");
creditUnionGlossary.setUsage("N/A"); creditUnionGlossary.setUsage("N/A");
...@@ -126,24 +126,24 @@ public class GlossaryServiceTest { ...@@ -126,24 +126,24 @@ public class GlossaryServiceTest {
// Category // Category
accountCategory = new AtlasGlossaryCategory(); accountCategory = new AtlasGlossaryCategory();
accountCategory.setDisplayName("Account categorization"); accountCategory.setName("Account categorization");
accountCategory.setShortDescription("Short description"); accountCategory.setShortDescription("Short description");
accountCategory.setLongDescription("Long description"); accountCategory.setLongDescription("Long description");
customerCategory = new AtlasGlossaryCategory(); customerCategory = new AtlasGlossaryCategory();
customerCategory.setQualifiedName("customer@testBankingGlossary"); customerCategory.setQualifiedName("customer@testBankingGlossary");
customerCategory.setDisplayName("Customer category"); customerCategory.setName("Customer category");
customerCategory.setShortDescription("Short description"); customerCategory.setShortDescription("Short description");
customerCategory.setLongDescription("Long description"); customerCategory.setLongDescription("Long description");
mortgageCategory = new AtlasGlossaryCategory(); mortgageCategory = new AtlasGlossaryCategory();
mortgageCategory.setDisplayName("Mortgage categorization"); mortgageCategory.setName("Mortgage categorization");
mortgageCategory.setShortDescription("Short description"); mortgageCategory.setShortDescription("Short description");
mortgageCategory.setLongDescription("Long description"); mortgageCategory.setLongDescription("Long description");
// Terms // Terms
checkingAccount = new AtlasGlossaryTerm(); checkingAccount = new AtlasGlossaryTerm();
checkingAccount.setDisplayName("A checking account"); checkingAccount.setName("A checking account");
checkingAccount.setShortDescription("Short description"); checkingAccount.setShortDescription("Short description");
checkingAccount.setLongDescription("Long description"); checkingAccount.setLongDescription("Long description");
checkingAccount.setAbbreviation("CHK"); checkingAccount.setAbbreviation("CHK");
...@@ -152,7 +152,7 @@ public class GlossaryServiceTest { ...@@ -152,7 +152,7 @@ public class GlossaryServiceTest {
savingsAccount = new AtlasGlossaryTerm(); savingsAccount = new AtlasGlossaryTerm();
savingsAccount.setQualifiedName("sav_acc@testBankingGlossary"); savingsAccount.setQualifiedName("sav_acc@testBankingGlossary");
savingsAccount.setDisplayName("A savings account"); savingsAccount.setName("A savings account");
savingsAccount.setShortDescription("Short description"); savingsAccount.setShortDescription("Short description");
savingsAccount.setLongDescription("Long description"); savingsAccount.setLongDescription("Long description");
savingsAccount.setAbbreviation("SAV"); savingsAccount.setAbbreviation("SAV");
...@@ -160,7 +160,7 @@ public class GlossaryServiceTest { ...@@ -160,7 +160,7 @@ public class GlossaryServiceTest {
savingsAccount.setUsage("N/A"); savingsAccount.setUsage("N/A");
fixedRateMortgage = new AtlasGlossaryTerm(); fixedRateMortgage = new AtlasGlossaryTerm();
fixedRateMortgage.setDisplayName("Conventional mortgage"); fixedRateMortgage.setName("Conventional mortgage");
fixedRateMortgage.setShortDescription("Short description"); fixedRateMortgage.setShortDescription("Short description");
fixedRateMortgage.setLongDescription("Long description"); fixedRateMortgage.setLongDescription("Long description");
fixedRateMortgage.setAbbreviation("FMTG"); fixedRateMortgage.setAbbreviation("FMTG");
...@@ -169,7 +169,7 @@ public class GlossaryServiceTest { ...@@ -169,7 +169,7 @@ public class GlossaryServiceTest {
adjustableRateMortgage = new AtlasGlossaryTerm(); adjustableRateMortgage = new AtlasGlossaryTerm();
adjustableRateMortgage.setQualifiedName("arm_mtg@testBankingGlossary"); adjustableRateMortgage.setQualifiedName("arm_mtg@testBankingGlossary");
adjustableRateMortgage.setDisplayName("ARM loans"); adjustableRateMortgage.setName("ARM loans");
adjustableRateMortgage.setShortDescription("Short description"); adjustableRateMortgage.setShortDescription("Short description");
adjustableRateMortgage.setLongDescription("Long description"); adjustableRateMortgage.setLongDescription("Long description");
adjustableRateMortgage.setAbbreviation("ARMTG"); adjustableRateMortgage.setAbbreviation("ARMTG");
......
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