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 @@
"isUnique": true
},
{
"name": "displayName",
"name": "name",
"typeName": "string",
"cardinality": "SINGLE",
"isIndexable": true,
......@@ -151,7 +151,7 @@
"isUnique": true
},
{
"name": "displayName",
"name": "name",
"typeName": "string",
"cardinality": "SINGLE",
"isIndexable": true,
......@@ -216,7 +216,7 @@
"isUnique": true
},
{
"name": "displayName",
"name": "name",
"typeName": "string",
"cardinality": "SINGLE",
"isIndexable": true,
......
......@@ -49,7 +49,7 @@ define([
this.searchVent = new Backbone.Wreqr.EventAggregator();
this.glossaryCollection = new VGlossaryList([], {
comparator: function(item) {
return item.get("displayName");
return item.get("name");
}
});
this.preFetchedCollectionLists = {
......
......@@ -27,7 +27,7 @@
<div class="form-group">
<label class="control-label col-sm-2" for="name">{{@key}}</label>
<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>
{{/each}}
......
......@@ -18,7 +18,7 @@
<div class="form-group">
<label class="control-label col-sm-2 {{#if create}}required{{/if}}" for="name">Name</label>
<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 class="form-group">
......
......@@ -18,7 +18,7 @@
<div class="form-group">
<label class="control-label col-sm-2 {{#if create}}required{{/if}}" for="name">Name</label>
<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 class="form-group">
......
......@@ -616,11 +616,11 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
modal.$el.find('button.ok').attr("disabled", false);
});
} else {
view.ui.displayName.on('keyup', function(e) {
view.ui.name.on('keyup', function(e) {
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() == "") {
modal.$el.find('button.ok').attr("disabled", true);
}
......@@ -663,7 +663,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
silent: true,
success: function(rModel, response) {
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) {
options.callback(rModel);
......
......@@ -380,8 +380,9 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums',
}
Utils.extractKeyValueFromEntity = function() {
var collectionJSON = arguments[0],
priorityAttribute = arguments[1];
var returnObj = {
priorityAttribute = arguments[1],
skipAttribute = arguments[2],
returnObj = {
name: '-',
found: true,
key: null
......@@ -413,6 +414,16 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums',
returnObj.key = 'qualifiedName';
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 (_.isObject(collectionJSON.attributes.id)) {
if (collectionJSON.id.id) {
......@@ -463,8 +474,17 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums',
}
}
returnObj.found = false;
if (skipAttribute && returnObj.key == skipAttribute) {
return {
name: '-',
found: true,
key: null
}
} else {
return returnObj;
}
}
Utils.showTitleLoader = function(loaderEl, titleBoxEl) {
loaderEl.css ? loaderEl.css({
'display': 'block',
......
......@@ -73,7 +73,11 @@ define(['require',
}
try {
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) {
if (_.isArray(parseDetailsObject)) {
var name = _.escape(parseDetailsObject[0]);
......
......@@ -43,7 +43,7 @@ define(['require',
/** ui selector cache */
ui: {
"qualifiedName": "[data-id='qualifiedName']",
"displayName": "[data-id='displayName']",
"name": "[data-id='name']",
"shortDescription": "[data-id='shortDescription']",
"longDescription": "[data-id='longDescription']",
"categoryTermForm": "[data-id='categoryTermForm']"
......
......@@ -41,7 +41,7 @@ define(['require',
/** ui selector cache */
ui: {
"displayName": "[data-id='displayName']",
"name": "[data-id='name']",
"shortDescription": "[data-id='shortDescription']",
"longDescription": "[data-id='longDescription']",
"glossaryForm": "[data-id='glossaryForm']"
......
......@@ -141,18 +141,18 @@ define(['require',
"model": this.data,
"collection": this.glossaryCollection,
"callback": function(data) {
if (data.displayName != that.data.displayName) {
if (data.name != that.data.name) {
var glossary = that.glossaryCollection.fullCollection.get(data.anchor.glossaryGuid);
if (that.isTermView) {
_.find(glossary.get('terms'), function(obj) {
if (obj.termGuid == data.guid) {
obj.displayText = data.displayName
obj.displayText = data.name
}
});
} else if (!data.parentCategory) {
_.find(glossary.get('categories'), function(obj) {
if (obj.categoryGuid == data.guid) {
obj.displayText = data.displayName
obj.displayText = data.name
}
});
}
......@@ -266,7 +266,7 @@ define(['require',
renderDetails: function(data) {
Utils.hideTitleLoader(this.$('.fontLoader'), this.ui.details);
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.longDescription.text(data.longDescription);
this.generateCategories(data.categories);
......@@ -315,7 +315,7 @@ define(['require',
if (foundModel) {
glossary = new VGlossaryList([foundModel.toJSON()], {
comparator: function(item) {
return item.get("displayName");
return item.get("name");
}
});
}
......@@ -342,7 +342,7 @@ define(['require',
if (foundModel) {
glossary = new VGlossaryList([foundModel.toJSON()], {
comparator: function(item) {
return item.get("displayName");
return item.get("name");
}
});
}
......@@ -385,7 +385,7 @@ define(['require',
onClickTagCross: function(e) {
var that = this,
tagName = $(e.currentTarget).text(),
termName = this.data.displayName;
termName = this.data.name;
CommonViewFunction.deleteTag(_.extend({}, {
msg: "<div class='ellipsis'>Remove: " + "<b>" + _.escape(tagName) + "</b> assignment from" + " " + "<b>" + termName + "?</b></div>",
titleMessage: Messages.removeTag,
......@@ -408,7 +408,7 @@ define(['require',
selectedGuid: guid,
model: that.data,
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"],
isCategoryView: that.isCategoryView,
isTermView: that.isTermView,
......
......@@ -180,7 +180,7 @@ define(['require',
guid: model.guid,
id: model.guid,
model: model,
text: model.displayName,
text: model.name,
gType: "glossary"
}
}
......@@ -267,7 +267,7 @@ define(['require',
"gType": "glossary",
"model": that.glossaryCollection.fullCollection.first().toJSON()
};
selectedItem.text = selectedItem.model.displayName;
selectedItem.text = selectedItem.model.name;
selectedItem.guid = selectedItem.model.guid;
if (index == 0 && selectedItem.guid == objGuid) {
that.glossary.selectedItem = selectedItem;
......@@ -294,7 +294,7 @@ define(['require',
return this.glossaryCollection.fullCollection.map(function(model, i) {
var obj = model.toJSON(),
parent = {
"text": obj.displayName,
"text": obj.name,
"icon": "fa fa-folder-o",
"guid": obj.guid,
"id": obj.guid,
......@@ -324,7 +324,7 @@ define(['require',
"id": guid,
"parent": obj,
"glossaryId": obj.guid,
"glossaryName": obj.displayName,
"glossaryName": obj.name,
"model": category,
"children": true,
"icon": "fa fa-files-o",
......@@ -348,7 +348,7 @@ define(['require',
"guid": guid,
"id": guid,
"parent": obj,
"glossaryName": obj.displayName,
"glossaryName": obj.name,
"glossaryId": obj.guid,
"model": term,
"icon": "fa fa-file-o"
......@@ -697,7 +697,7 @@ define(['require',
selectedItem.guid = selectedItem.model.guid;
selectedItem.type = "Glossary";
selectedItem.gType = "glossary";
selectedItem.text = model.displayName;
selectedItem.text = model.name;
this.glossary.selectedItem = selectedItem;
this.query[this.viewType].model = selectedItem.model;
this.query[this.viewType].gType = "glossary";
......
......@@ -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"),
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"),
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_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_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_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, 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, 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"),
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_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"),
MISSING_CATEGORY_DISPLAY_NAME(400, "ATLAS-400-00-082", "Category displayName is empty/null"),
INVALID_DISPLAY_NAME(400, "ATLAS-400-00-083", "displayName cannot contain following special chars ('@', '.')"),
MISSING_CATEGORY_DISPLAY_NAME(400, "ATLAS-400-00-082", "Category name is empty/null"),
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."),
UNAUTHORIZED_ACCESS(403, "ATLAS-403-00-001", "{0} is not authorized to perform {1}"),
......
......@@ -44,7 +44,7 @@ public class AtlasGlossary extends AtlasGlossaryBaseObject {
super(other);
super.setQualifiedName(other.getQualifiedName());
super.setGuid(other.getGuid());
super.setDisplayName(other.displayName);
super.setName(other.name);
super.setShortDescription(other.shortDescription);
super.setLongDescription(other.longDescription);
this.language = other.language;
......@@ -90,8 +90,8 @@ public class AtlasGlossary extends AtlasGlossaryBaseObject {
public void setAttribute(String attrName, String attrVal) {
Objects.requireNonNull(attrName, "AtlasGlossary attribute name");
switch (attrName) {
case "displayName":
setDisplayName(attrVal);
case "name":
setName(attrVal);
break;
case "shortDescription":
setShortDescription(attrVal);
......
......@@ -30,7 +30,7 @@ public abstract class AtlasGlossaryBaseObject extends AtlasBaseModelObject {
// Core attributes
private String qualifiedName;
protected String displayName;
protected String name;
protected String shortDescription;
protected String longDescription;
......@@ -42,7 +42,7 @@ public abstract class AtlasGlossaryBaseObject extends AtlasBaseModelObject {
public AtlasGlossaryBaseObject(final AtlasGlossaryBaseObject other) {
super(other);
this.displayName = other.displayName;
this.name = other.name;
this.shortDescription = other.shortDescription;
this.longDescription = other.longDescription;
this.classifications = other.classifications;
......@@ -57,12 +57,12 @@ public abstract class AtlasGlossaryBaseObject extends AtlasBaseModelObject {
this.qualifiedName = qualifiedName;
}
public String getDisplayName() {
return displayName;
public String getName() {
return name;
}
public void setDisplayName(final String displayName) {
this.displayName = displayName;
public void setName(final String name) {
this.name = name;
}
public String getShortDescription() {
......@@ -114,7 +114,7 @@ public abstract class AtlasGlossaryBaseObject extends AtlasBaseModelObject {
if (!(o instanceof AtlasGlossaryBaseObject)) return false;
if (!super.equals(o)) return false;
final AtlasGlossaryBaseObject that = (AtlasGlossaryBaseObject) o;
return Objects.equals(displayName, that.displayName) &&
return Objects.equals(name, that.name) &&
Objects.equals(shortDescription, that.shortDescription) &&
Objects.equals(longDescription, that.longDescription) &&
Objects.equals(classifications, that.classifications) &&
......@@ -124,13 +124,13 @@ public abstract class AtlasGlossaryBaseObject extends AtlasBaseModelObject {
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), displayName, shortDescription, longDescription, classifications, qualifiedName);
return Objects.hash(super.hashCode(), name, shortDescription, longDescription, classifications, qualifiedName);
}
@Override
protected StringBuilder toString(final StringBuilder sb) {
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(", longDescription='").append(longDescription).append('\'');
sb.append(", classifications=").append(classifications);
......
......@@ -122,8 +122,8 @@ public class AtlasGlossaryCategory extends AtlasGlossaryBaseObject {
public void setAttribute(String attrName, String attrVal) {
Objects.requireNonNull(attrName, "AtlasGlossary attribute name");
switch(attrName) {
case "displayName":
setDisplayName(attrVal);
case "name":
setName(attrVal);
break;
case "shortDescription":
setShortDescription(attrVal);
......
......@@ -290,7 +290,7 @@ public class AtlasGlossaryTerm extends AtlasGlossaryBaseObject {
public String toAuditString() {
AtlasGlossaryTerm t = new AtlasGlossaryTerm();
t.setGuid(this.getGuid());
t.setDisplayName(this.getDisplayName());
t.setName(this.getName());
t.setQualifiedName(this.getQualifiedName());
return AtlasType.toJson(t);
......@@ -306,8 +306,8 @@ public class AtlasGlossaryTerm extends AtlasGlossaryBaseObject {
public void setAttribute(String attrName, String attrVal) {
Objects.requireNonNull(attrName, "AtlasGlossaryTerm attribute name");
switch (attrName) {
case "displayName":
setDisplayName(attrVal);
case "name":
setName(attrVal);
break;
case "shortDescription":
setShortDescription(attrVal);
......
......@@ -92,7 +92,7 @@ public class GlossaryCategoryUtils extends GlossaryUtils {
// Derive the qualifiedName
String anchorGlossaryGuid = updatedCategory.getAnchor().getGlossaryGuid();
AtlasGlossary glossary = dataAccess.load(getGlossarySkeleton(anchorGlossaryGuid));
storeObject.setQualifiedName(storeObject.getDisplayName()+ "@" + glossary.getQualifiedName());
storeObject.setQualifiedName(storeObject.getName()+ "@" + glossary.getQualifiedName());
if (LOG.isDebugEnabled()) {
LOG.debug("Derived qualifiedName = {}", storeObject.getQualifiedName());
......@@ -118,7 +118,7 @@ public class GlossaryCategoryUtils extends GlossaryUtils {
// Derive the qualifiedName when anchor changes
String anchorGlossaryGuid = updatedCategory.getAnchor().getGlossaryGuid();
AtlasGlossary glossary = dataAccess.load(getGlossarySkeleton(anchorGlossaryGuid));
storeObject.setQualifiedName(storeObject.getDisplayName()+ "@" + glossary.getQualifiedName());
storeObject.setQualifiedName(storeObject.getName()+ "@" + glossary.getQualifiedName());
if (LOG.isDebugEnabled()) {
LOG.debug("Derived qualifiedName = {}", storeObject.getQualifiedName());
......@@ -196,7 +196,7 @@ public class GlossaryCategoryUtils extends GlossaryUtils {
// New parent added, qualifiedName needs recomputation
// Derive the qualifiedName of the Glossary
AtlasGlossaryCategory parentCategory = dataAccess.load(getAtlasGlossaryCategorySkeleton(newParent.getCategoryGuid()));
storeObject.setQualifiedName(storeObject.getDisplayName() + "." + parentCategory.getQualifiedName());
storeObject.setQualifiedName(storeObject.getName() + "." + parentCategory.getQualifiedName());
if (LOG.isDebugEnabled()) {
LOG.debug("Derived qualifiedName = {}", storeObject.getQualifiedName());
......@@ -216,7 +216,7 @@ public class GlossaryCategoryUtils extends GlossaryUtils {
// Derive the qualifiedName of the Glossary
String anchorGlossaryGuid = updatedCategory.getAnchor().getGlossaryGuid();
AtlasGlossary glossary = dataAccess.load(getGlossarySkeleton(anchorGlossaryGuid));
storeObject.setQualifiedName(storeObject.getDisplayName() + "@" + glossary.getQualifiedName());
storeObject.setQualifiedName(storeObject.getName() + "@" + glossary.getQualifiedName());
if (LOG.isDebugEnabled()) {
LOG.debug("Derived qualifiedName = {}", storeObject.getQualifiedName());
......@@ -232,7 +232,7 @@ public class GlossaryCategoryUtils extends GlossaryUtils {
switch (op) {
case CREATE:
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");
}
createTermCategorizationRelationships(storeObject, newTerms.values());
......@@ -240,7 +240,7 @@ public class GlossaryCategoryUtils extends GlossaryUtils {
case UPDATE:
if (MapUtils.isEmpty(existingTerms)) {
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");
}
createTermCategorizationRelationships(storeObject, newTerms.values());
......@@ -249,7 +249,7 @@ public class GlossaryCategoryUtils extends GlossaryUtils {
if (MapUtils.isEmpty(newTerms)) {
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());
break;
......@@ -328,7 +328,7 @@ public class GlossaryCategoryUtils extends GlossaryUtils {
if (CollectionUtils.isNotEmpty(terms)) {
for (AtlasRelatedTermHeader term : terms) {
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());
updateRelationshipAttributes(relationship, term);
......@@ -341,7 +341,7 @@ public class GlossaryCategoryUtils extends GlossaryUtils {
if (CollectionUtils.isNotEmpty(terms)) {
for (AtlasRelatedTermHeader term : terms) {
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);
}
......@@ -354,7 +354,7 @@ public class GlossaryCategoryUtils extends GlossaryUtils {
switch (op) {
case CREATE:
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");
}
createCategoryRelationships(storeObject, newChildren.values());
......@@ -366,7 +366,7 @@ public class GlossaryCategoryUtils extends GlossaryUtils {
// Create new children
if (MapUtils.isEmpty(existingChildren)) {
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");
}
createCategoryRelationships(storeObject, newChildren.values());
......@@ -378,7 +378,7 @@ public class GlossaryCategoryUtils extends GlossaryUtils {
// Delete current children
if (MapUtils.isEmpty(newChildren)) {
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());
......@@ -455,7 +455,7 @@ public class GlossaryCategoryUtils extends GlossaryUtils {
if (StringUtils.equals(storeObject.getAnchor().getGlossaryGuid(), childCategory.getAnchor().getGlossaryGuid())) {
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));
} else {
......@@ -470,7 +470,7 @@ public class GlossaryCategoryUtils extends GlossaryUtils {
if (CollectionUtils.isNotEmpty(toUpdate)) {
for (AtlasRelatedCategoryHeader categoryHeader : toUpdate) {
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());
updateRelationshipAttributes(childRelationship, categoryHeader);
......@@ -483,7 +483,7 @@ public class GlossaryCategoryUtils extends GlossaryUtils {
if (CollectionUtils.isNotEmpty(existingChildren)) {
for (AtlasRelatedCategoryHeader child : existingChildren) {
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);
}
......@@ -543,7 +543,7 @@ public class GlossaryCategoryUtils extends GlossaryUtils {
for (AtlasRelatedCategoryHeader childCategoryHeader : childCategories) {
AtlasGlossaryCategory child = dataAccess.load(getAtlasGlossaryCategorySkeleton(childCategoryHeader.getCategoryGuid()));
String qualifiedName = child.getDisplayName() + ".";
String qualifiedName = child.getName() + ".";
String childAnchorGuid = child.getAnchor().getGlossaryGuid();
if (isParentRemoved) {
if (LOG.isDebugEnabled()) {
......
......@@ -137,13 +137,13 @@ public class GlossaryService {
}
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);
}
if (isNameInvalid(atlasGlossary.getDisplayName())){
if (isNameInvalid(atlasGlossary.getName())){
throw new AtlasBaseException(AtlasErrorCode.INVALID_DISPLAY_NAME);
} else {
atlasGlossary.setQualifiedName(atlasGlossary.getDisplayName());
atlasGlossary.setQualifiedName(atlasGlossary.getName());
}
}
......@@ -246,11 +246,11 @@ public class GlossaryService {
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");
}
if (isNameInvalid(atlasGlossary.getDisplayName())) {
if (isNameInvalid(atlasGlossary.getName())) {
throw new AtlasBaseException(AtlasErrorCode.INVALID_DISPLAY_NAME);
}
......@@ -331,14 +331,14 @@ public class GlossaryService {
throw new AtlasBaseException(AtlasErrorCode.MISSING_MANDATORY_ANCHOR);
}
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);
}
if (isNameInvalid(glossaryTerm.getDisplayName())){
if (isNameInvalid(glossaryTerm.getName())){
throw new AtlasBaseException(AtlasErrorCode.INVALID_DISPLAY_NAME);
} else {
glossaryTerm.setQualifiedName(glossaryTerm.getDisplayName());
glossaryTerm.setQualifiedName(glossaryTerm.getName());
}
}
......@@ -403,11 +403,11 @@ public class GlossaryService {
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");
}
if (isNameInvalid(atlasGlossaryTerm.getDisplayName())) {
if (isNameInvalid(atlasGlossaryTerm.getName())) {
throw new AtlasBaseException(AtlasErrorCode.INVALID_DISPLAY_NAME);
}
......@@ -546,13 +546,13 @@ public class GlossaryService {
throw new AtlasBaseException(AtlasErrorCode.MISSING_MANDATORY_ANCHOR);
}
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);
}
if (isNameInvalid(glossaryCategory.getDisplayName())){
if (isNameInvalid(glossaryCategory.getName())){
throw new AtlasBaseException(AtlasErrorCode.INVALID_DISPLAY_NAME);
} else {
glossaryCategory.setQualifiedName(glossaryCategory.getDisplayName());
glossaryCategory.setQualifiedName(glossaryCategory.getName());
}
}
......@@ -621,11 +621,11 @@ public class GlossaryService {
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");
}
if (isNameInvalid(glossaryCategory.getDisplayName())) {
if (isNameInvalid(glossaryCategory.getName())) {
throw new AtlasBaseException(AtlasErrorCode.INVALID_DISPLAY_NAME);
}
......@@ -997,7 +997,7 @@ public class GlossaryService {
.collect(Collectors.toList());
Map<String, AtlasGlossaryCategory> categoryMap = new HashMap<>();
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 {
......@@ -1009,7 +1009,7 @@ public class GlossaryService {
dataAccess.load(categories).forEach(c -> categoryMap.put(c.getGuid(), c));
for (AtlasRelatedCategoryHeader c : categoryHeaders) {
AtlasGlossaryCategory category = categoryMap.get(c.getCategoryGuid());
c.setDisplayText(category.getDisplayName());
c.setDisplayText(category.getName());
if (Objects.nonNull(category.getParentCategory())) {
c.setParentCategoryGuid(category.getParentCategory().getCategoryGuid());
}
......@@ -1024,7 +1024,7 @@ public class GlossaryService {
Map<String, AtlasGlossaryTerm> termMap = new HashMap<>();
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) {
......
......@@ -155,7 +155,7 @@ public class GlossaryTermUtils extends GlossaryUtils {
// Derive the qualifiedName
String anchorGlossaryGuid = updatedTermAnchor.getGlossaryGuid();
AtlasGlossary glossary = dataAccess.load(getGlossarySkeleton(anchorGlossaryGuid));
storeObject.setQualifiedName(storeObject.getDisplayName() + "@" + glossary.getQualifiedName());
storeObject.setQualifiedName(storeObject.getName() + "@" + glossary.getQualifiedName());
if (LOG.isDebugEnabled()) {
LOG.debug("Derived qualifiedName = {}", storeObject.getQualifiedName());
......@@ -174,14 +174,14 @@ public class GlossaryTermUtils extends GlossaryUtils {
LOG.debug("Updating term anchor, currAnchor = {}, newAnchor = {} and term = {}",
existingAnchor.getGlossaryGuid(),
updatedTermAnchor.getGlossaryGuid(),
storeObject.getDisplayName());
storeObject.getName());
}
relationshipStore.deleteById(existingAnchor.getRelationGuid(), true);
// Derive the qualifiedName when anchor changes
String anchorGlossaryGuid = updatedTermAnchor.getGlossaryGuid();
AtlasGlossary glossary = dataAccess.load(getGlossarySkeleton(anchorGlossaryGuid));
storeObject.setQualifiedName(storeObject.getDisplayName() + "@" + glossary.getQualifiedName());
storeObject.setQualifiedName(storeObject.getName() + "@" + glossary.getQualifiedName());
if (LOG.isDebugEnabled()) {
LOG.debug("Derived qualifiedName = {}", storeObject.getQualifiedName());
......
......@@ -53,7 +53,7 @@ public class AtlasGlossaryCategoryDTO extends AbstractGlossaryDTO<AtlasGlossaryC
ret.setGuid(entity.getGuid());
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.setLongDescription((String) entity.getAttribute("longDescription"));
......@@ -120,7 +120,7 @@ public class AtlasGlossaryCategoryDTO extends AbstractGlossaryDTO<AtlasGlossaryC
AtlasEntity ret = getDefaultAtlasEntity(obj);
ret.setAttribute("qualifiedName", obj.getQualifiedName());
ret.setAttribute("displayName", obj.getDisplayName());
ret.setAttribute("name", obj.getName());
ret.setAttribute("shortDescription", obj.getShortDescription());
ret.setAttribute("longDescription", obj.getLongDescription());
......
......@@ -53,7 +53,7 @@ public class AtlasGlossaryDTO extends AbstractGlossaryDTO<AtlasGlossary> {
ret.setGuid(entity.getGuid());
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.setLongDescription((String) entity.getAttribute("longDescription"));
ret.setLanguage((String) entity.getAttribute("language"));
......@@ -114,7 +114,7 @@ public class AtlasGlossaryDTO extends AbstractGlossaryDTO<AtlasGlossary> {
AtlasEntity ret = getDefaultAtlasEntity(obj);
ret.setAttribute("qualifiedName", obj.getQualifiedName());
ret.setAttribute("displayName", obj.getDisplayName());
ret.setAttribute("name", obj.getName());
ret.setAttribute("shortDescription", obj.getShortDescription());
ret.setAttribute("longDescription", obj.getLongDescription());
ret.setAttribute("language", obj.getLanguage());
......
......@@ -56,7 +56,7 @@ public class AtlasGlossaryTermDTO extends AbstractGlossaryDTO<AtlasGlossaryTerm>
ret.setGuid(entity.getGuid());
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.setLongDescription((String) entity.getAttribute("longDescription"));
ret.setExamples((List<String>) entity.getAttribute("examples"));
......@@ -212,7 +212,7 @@ public class AtlasGlossaryTermDTO extends AbstractGlossaryDTO<AtlasGlossaryTerm>
AtlasEntity ret = getDefaultAtlasEntity(obj);
ret.setAttribute("qualifiedName", obj.getQualifiedName());
ret.setAttribute("displayName", obj.getDisplayName());
ret.setAttribute("name", obj.getName());
ret.setAttribute("shortDescription", obj.getShortDescription());
ret.setAttribute("longDescription", obj.getLongDescription());
ret.setAttribute("examples", obj.getExamples());
......
......@@ -122,7 +122,7 @@ public final class EntityGraphRetriever {
private static final Logger LOG = LoggerFactory.getLogger(EntityGraphRetriever.class);
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 DISPLAY_NAME = "displayName";
......
......@@ -110,7 +110,7 @@ public class GlossaryServiceTest {
// Glossary
bankGlossary = new AtlasGlossary();
bankGlossary.setQualifiedName("testBankingGlossary");
bankGlossary.setDisplayName("Banking glossary");
bankGlossary.setName("Banking glossary");
bankGlossary.setShortDescription("Short description");
bankGlossary.setLongDescription("Long description");
bankGlossary.setUsage("N/A");
......@@ -118,7 +118,7 @@ public class GlossaryServiceTest {
creditUnionGlossary = new AtlasGlossary();
creditUnionGlossary.setQualifiedName("testCreditUnionGlossary");
creditUnionGlossary.setDisplayName("Credit union glossary");
creditUnionGlossary.setName("Credit union glossary");
creditUnionGlossary.setShortDescription("Short description");
creditUnionGlossary.setLongDescription("Long description");
creditUnionGlossary.setUsage("N/A");
......@@ -126,24 +126,24 @@ public class GlossaryServiceTest {
// Category
accountCategory = new AtlasGlossaryCategory();
accountCategory.setDisplayName("Account categorization");
accountCategory.setName("Account categorization");
accountCategory.setShortDescription("Short description");
accountCategory.setLongDescription("Long description");
customerCategory = new AtlasGlossaryCategory();
customerCategory.setQualifiedName("customer@testBankingGlossary");
customerCategory.setDisplayName("Customer category");
customerCategory.setName("Customer category");
customerCategory.setShortDescription("Short description");
customerCategory.setLongDescription("Long description");
mortgageCategory = new AtlasGlossaryCategory();
mortgageCategory.setDisplayName("Mortgage categorization");
mortgageCategory.setName("Mortgage categorization");
mortgageCategory.setShortDescription("Short description");
mortgageCategory.setLongDescription("Long description");
// Terms
checkingAccount = new AtlasGlossaryTerm();
checkingAccount.setDisplayName("A checking account");
checkingAccount.setName("A checking account");
checkingAccount.setShortDescription("Short description");
checkingAccount.setLongDescription("Long description");
checkingAccount.setAbbreviation("CHK");
......@@ -152,7 +152,7 @@ public class GlossaryServiceTest {
savingsAccount = new AtlasGlossaryTerm();
savingsAccount.setQualifiedName("sav_acc@testBankingGlossary");
savingsAccount.setDisplayName("A savings account");
savingsAccount.setName("A savings account");
savingsAccount.setShortDescription("Short description");
savingsAccount.setLongDescription("Long description");
savingsAccount.setAbbreviation("SAV");
......@@ -160,7 +160,7 @@ public class GlossaryServiceTest {
savingsAccount.setUsage("N/A");
fixedRateMortgage = new AtlasGlossaryTerm();
fixedRateMortgage.setDisplayName("Conventional mortgage");
fixedRateMortgage.setName("Conventional mortgage");
fixedRateMortgage.setShortDescription("Short description");
fixedRateMortgage.setLongDescription("Long description");
fixedRateMortgage.setAbbreviation("FMTG");
......@@ -169,7 +169,7 @@ public class GlossaryServiceTest {
adjustableRateMortgage = new AtlasGlossaryTerm();
adjustableRateMortgage.setQualifiedName("arm_mtg@testBankingGlossary");
adjustableRateMortgage.setDisplayName("ARM loans");
adjustableRateMortgage.setName("ARM loans");
adjustableRateMortgage.setShortDescription("Short description");
adjustableRateMortgage.setLongDescription("Long description");
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