Skip to content

Commit

Permalink
Merge pull request #2453 from atlanhq/documenttype
Browse files Browse the repository at this point in the history
Rename Document to AtlasGlossaryDocument
  • Loading branch information
nikhilbonte21 authored Nov 9, 2023
2 parents 5797da5 + 12116bf commit 0288f19
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public final class Constants {
public static final String ATLAS_GLOSSARY_ENTITY_TYPE = "AtlasGlossary";
public static final String ATLAS_GLOSSARY_TERM_ENTITY_TYPE = "AtlasGlossaryTerm";
public static final String ATLAS_GLOSSARY_CATEGORY_ENTITY_TYPE = "AtlasGlossaryCategory";
public static final String DOCUMENT_ENTITY_TYPE = "Document";
public static final String ATLAS_GLOSSARY_DOCUMENT_ENTITY_TYPE = "AtlasGlossaryDocument";
public static final String CATEGORY_PARENT_EDGE_LABEL = "r:AtlasGlossaryCategoryHierarchyLink";
public static final String CATEGORY_TERMS_EDGE_LABEL = "r:AtlasGlossaryTermCategorization";
public static final String GLOSSARY_TERMS_EDGE_LABEL = "r:AtlasGlossaryTermAnchor";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1797,7 +1797,7 @@ public PreProcessor getPreProcessor(String typeName) {
preProcessor = new TermPreProcessor(typeRegistry, entityRetriever, graph, taskManagement);
break;

case DOCUMENT_ENTITY_TYPE:
case ATLAS_GLOSSARY_DOCUMENT_ENTITY_TYPE:
preProcessor = new DocumentPreProcessor(typeRegistry, entityRetriever, graph, taskManagement);
break;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1980,7 +1980,7 @@ private void addGlossaryAttr(AttributeMutationContext ctx, AtlasEdge edge) {
AtlasVertex toVertex = ctx.getReferringVertex();
String toVertexType = getTypeName(toVertex);

if (TYPE_TERM.equals(toVertexType) || DOCUMENT_ENTITY_TYPE.equals(toVertexType) || TYPE_CATEGORY.equals(toVertexType)) {
if (TYPE_TERM.equals(toVertexType) || ATLAS_GLOSSARY_DOCUMENT_ENTITY_TYPE.equals(toVertexType) || TYPE_CATEGORY.equals(toVertexType)) {
// handle __glossary attribute of term or category entity
String gloQname = edge.getOutVertex().getProperty(QUALIFIED_NAME, String.class);
AtlasGraphUtilsV2.setEncodedProperty(toVertex, GLOSSARY_PROPERTY_KEY, gloQname);
Expand Down Expand Up @@ -2064,7 +2064,7 @@ private void addCategoriesToTermEntity(AttributeMutationContext ctx, List<Object
}
}

if (TYPE_TERM.equals(getTypeName(termVertex)) || DOCUMENT_ENTITY_TYPE.equals(getTypeName(termVertex))) {
if (TYPE_TERM.equals(getTypeName(termVertex)) || ATLAS_GLOSSARY_DOCUMENT_ENTITY_TYPE.equals(getTypeName(termVertex))) {
List<AtlasVertex> categoryVertices = newElementsCreated.stream().map(x -> ((AtlasEdge)x).getOutVertex()).collect(Collectors.toList());
Set<String> catQnames = categoryVertices.stream().map(x -> x.getProperty(QUALIFIED_NAME, String.class)).collect(Collectors.toSet());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
import java.util.List;

import static org.apache.atlas.repository.Constants.CATEGORY_TERMS_EDGE_LABEL;
import static org.apache.atlas.repository.Constants.DOCUMENT_ENTITY_TYPE;
import static org.apache.atlas.repository.Constants.ATLAS_GLOSSARY_DOCUMENT_ENTITY_TYPE;
import static org.apache.atlas.repository.Constants.NAME;
import static org.apache.atlas.repository.Constants.QUALIFIED_NAME;
import static org.apache.atlas.repository.graph.GraphHelper.getActiveParentVertices;
Expand Down Expand Up @@ -98,7 +98,7 @@ private void processCreateDocument(AtlasEntity entity, AtlasVertex vertex) throw

String glossaryQName = (String) anchor.getAttribute(QUALIFIED_NAME);

termExists(docName, glossaryQName, DOCUMENT_ENTITY_TYPE);
termExists(docName, glossaryQName, ATLAS_GLOSSARY_DOCUMENT_ENTITY_TYPE);

validateCategory(entity);

Expand Down Expand Up @@ -147,7 +147,7 @@ private void processUpdateDocument(AtlasEntity entity, AtlasVertex vertex) throw
} else {

if (!vertexName.equals(docName)) {
termExists(docName, newGlossaryQualifiedName, DOCUMENT_ENTITY_TYPE);
termExists(docName, newGlossaryQualifiedName, ATLAS_GLOSSARY_DOCUMENT_ENTITY_TYPE);
}

entity.setAttribute(QUALIFIED_NAME, docQualifiedName);
Expand Down Expand Up @@ -194,7 +194,7 @@ public String moveDocToAnotherGlossary(AtlasEntity entity, AtlasVertex vertex,
String currentDocQualifiedName) throws AtlasBaseException {

//check duplicate doc name
termExists((String) entity.getAttribute(NAME), targetGlossaryQualifiedName, DOCUMENT_ENTITY_TYPE);
termExists((String) entity.getAttribute(NAME), targetGlossaryQualifiedName, ATLAS_GLOSSARY_DOCUMENT_ENTITY_TYPE);


String updatedQualifiedName = currentDocQualifiedName.replace(sourceGlossaryQualifiedName, targetGlossaryQualifiedName);
Expand Down

0 comments on commit 0288f19

Please sign in to comment.