Skip to content

Commit

Permalink
Merge pull request #8157 from mandy-chessell/oak2024
Browse files Browse the repository at this point in the history
Ignore CatalogTemplate relationships
  • Loading branch information
mandy-chessell authored Apr 30, 2024
2 parents f04e930 + 0da9d96 commit 5368b61
Show file tree
Hide file tree
Showing 16 changed files with 975 additions and 731 deletions.
2 changes: 1 addition & 1 deletion OpenConnectorsArchiveGUIDMap.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion content-packs/OpenConnectorsArchive.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion content-packs/OpenConnectorsArchive.omarchive

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,30 @@
*/
public enum FilesPlaceholderProperty
{
/**
* The name of the leaf directory, without its enclosing directories.
*/
FOLDER_NAME("folderName", "The name of the leaf directory, without its enclosing directories.", "string", "myFolder"),

/**
* The display name of the data set.
*/
DATA_SET_NAME("dataSetName", "The display name of the data set.", "string", "myDataSet"),

/**
* The formula used to populate the data set.
*/
FORMULA("formula", "The formula used to populate the data set.", "string", null),

/**
* The language/format used in the data set's formula.
*/
FORMULA_TYPE("formulaType", "The language/format used in the data set's formula.", "string", null),

/**
* The full pathname of the file including the directory names, file name and file extension.
*/
PATH_NAME ("pathName", "The full pathname of the file including the directory names, file name and file extension.", "string", "/a/b/c/myFile.txt"),
PATH_NAME ("pathName", "The full pathname of the file including the directory names, file name and optional file extension, if applicable.", "string", "/a/b/c/myFile.txt"),

/**
* The short name of the file with its extension but without the directory names.
Expand Down Expand Up @@ -49,7 +69,41 @@ public enum FilesPlaceholderProperty
"string",
"JSON"),

;
/**
* The deployed implementation type for the file.
*/
DEPLOYED_IMPLEMENTATION_TYPE ("deployedImplementationType",
"The deployed implementation type for the file.",
"string",
"Build File"),


/**
* The description of the resource to help a consumer understand its content and purpose.
*/
DESCRIPTION ("description",
"The description of the resource to help a consumer understand its content and purpose.",
"string",
"This file contains a moth-worth of patient data for the Teddy Bear Drop Foot clinical trial."),


/**
* The programming language used to encode the file.
*/
PROGRAMMING_LANGUAGE ("programmingLanguage",
"The programming language used to encode the file.",
"string",
"Java"),

/**
* Descriptive metadata values embedded within the file.
*/
EMBEDDED_METADATA ("embeddedMetadata",
"Descriptive metadata values embedded within the file.",
"map<string, string>",
null),

;

public final String name;
public final String description;
Expand Down Expand Up @@ -133,23 +187,101 @@ public String getExample()


/**
* Retrieve all the defined placeholder properties
* Retrieve all the defined placeholder properties for data files
*
* @return list of placeholder property types
*/
public static List<PlaceholderPropertyType> getFilesPlaceholderPropertyTypes()
public static List<PlaceholderPropertyType> getDataFilesPlaceholderPropertyTypes()
{
List<PlaceholderPropertyType> placeholderPropertyTypes = new ArrayList<>();

for (FilesPlaceholderProperty placeholderProperty : FilesPlaceholderProperty.values())
{
placeholderPropertyTypes.add(placeholderProperty.getPlaceholderType());
}
placeholderPropertyTypes.add(DEPLOYED_IMPLEMENTATION_TYPE.getPlaceholderType());
placeholderPropertyTypes.add(PATH_NAME.getPlaceholderType());
placeholderPropertyTypes.add(FILE_NAME.getPlaceholderType());
placeholderPropertyTypes.add(FILE_TYPE.getPlaceholderType());
placeholderPropertyTypes.add(FILE_EXTENSION.getPlaceholderType());
placeholderPropertyTypes.add(FILE_ENCODING.getPlaceholderType());

return placeholderPropertyTypes;
}


/**
* Retrieve all the defined placeholder properties for data files
*
* @return list of placeholder property types
*/
public static List<PlaceholderPropertyType> getMediaFilesPlaceholderPropertyTypes()
{
List<PlaceholderPropertyType> placeholderPropertyTypes = new ArrayList<>();

placeholderPropertyTypes.add(DEPLOYED_IMPLEMENTATION_TYPE.getPlaceholderType());
placeholderPropertyTypes.add(PATH_NAME.getPlaceholderType());
placeholderPropertyTypes.add(FILE_NAME.getPlaceholderType());
placeholderPropertyTypes.add(FILE_TYPE.getPlaceholderType());
placeholderPropertyTypes.add(FILE_EXTENSION.getPlaceholderType());
placeholderPropertyTypes.add(FILE_ENCODING.getPlaceholderType());
placeholderPropertyTypes.add(EMBEDDED_METADATA.getPlaceholderType());

return placeholderPropertyTypes;
}


/**
* Retrieve all the defined placeholder properties for directories (file folder)
*
* @return list of placeholder property types
*/
public static List<PlaceholderPropertyType> getFolderPlaceholderPropertyTypes()
{
List<PlaceholderPropertyType> placeholderPropertyTypes = new ArrayList<>();

placeholderPropertyTypes.add(DEPLOYED_IMPLEMENTATION_TYPE.getPlaceholderType());
placeholderPropertyTypes.add(PATH_NAME.getPlaceholderType());
placeholderPropertyTypes.add(FOLDER_NAME.getPlaceholderType());

return placeholderPropertyTypes;
}


/**
* Retrieve all the defined placeholder properties for directories (file folder)
*
* @return list of placeholder property types
*/
public static List<PlaceholderPropertyType> getDataSetPlaceholderPropertyTypes()
{
List<PlaceholderPropertyType> placeholderPropertyTypes = new ArrayList<>();

placeholderPropertyTypes.add(DEPLOYED_IMPLEMENTATION_TYPE.getPlaceholderType());
placeholderPropertyTypes.add(DATA_SET_NAME.getPlaceholderType());
placeholderPropertyTypes.add(FORMULA.getPlaceholderType());
placeholderPropertyTypes.add(FORMULA_TYPE.getPlaceholderType());

return placeholderPropertyTypes;
}


/**
* Retrieve all the defined placeholder properties for files associated with software
*
* @return list of placeholder property types
*/
public static List<PlaceholderPropertyType> getSoftwareFilesPlaceholderPropertyTypes()
{
List<PlaceholderPropertyType> placeholderPropertyTypes = new ArrayList<>();

placeholderPropertyTypes.add(DEPLOYED_IMPLEMENTATION_TYPE.getPlaceholderType());
placeholderPropertyTypes.add(PATH_NAME.getPlaceholderType());
placeholderPropertyTypes.add(FILE_NAME.getPlaceholderType());
placeholderPropertyTypes.add(FILE_TYPE.getPlaceholderType());
placeholderPropertyTypes.add(FILE_EXTENSION.getPlaceholderType());
placeholderPropertyTypes.add(FILE_ENCODING.getPlaceholderType());
placeholderPropertyTypes.add(PROGRAMMING_LANGUAGE.getPlaceholderType());

return placeholderPropertyTypes;
}

/**
* Return a summary of this enum to use in a service provider.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ public void start() throws ConnectorCheckedException
methodName);
return;
}
else if (! propertyHelper.isTypeOf(assetUniverse, OpenMetadataType.SOFTWARE_SERVER.typeName))
else if (! propertyHelper.isTypeOf(assetUniverse, OpenMetadataType.DATABASE_TYPE_NAME))
{
super.throwWrongTypeOfAsset(assetUniverse.getGUID(),
assetUniverse.getType().getTypeName(),
OpenMetadataType.SOFTWARE_SERVER.typeName,
OpenMetadataType.DATABASE_TYPE_NAME,
methodName);
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -597,11 +597,12 @@ private TemplateProgress addAttachmentsFromTemplate(String userId,
}

/*
* Skip "SourcedFrom" and "SpecificationPropertyAssignment" relationships since they are part of the template
* Skip "SourcedFrom", "CatalogTemplate" and "SpecificationPropertyAssignment" relationships since they are part of the template
* description rather than the template itself.
*/
if ((! repositoryHelper.isTypeOf(serviceName, relationship.getType().getTypeDefName(), OpenMetadataType.SOURCED_FROM_RELATIONSHIP.typeName)) &&
(! repositoryHelper.isTypeOf(serviceName, relationship.getType().getTypeDefName(), OpenMetadataType.SPECIFICATION_PROPERTY_ASSIGNMENT_RELATIONSHIP.typeName)))
(! repositoryHelper.isTypeOf(serviceName, relationship.getType().getTypeDefName(), OpenMetadataType.SPECIFICATION_PROPERTY_ASSIGNMENT_RELATIONSHIP.typeName)) &&
(! repositoryHelper.isTypeOf(serviceName, relationship.getType().getTypeDefName(), OpenMetadataType.CATALOG_TEMPLATE_RELATIONSHIP.typeName)))
{
/*
* If the element is a template substitute then use the entity that it is sourced from.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

###
# Working with entities
@elementGUID=2864a998-61f6-4251-a619-c73e85559fd5
@elementGUID=add guid here


###
Expand Down Expand Up @@ -97,7 +97,7 @@ Content-Type: application/json
# @name getAllRelatedMetadataElements
# Retrieve the metadata elements connected to the supplied element.
GET {{baseURL}}/servers/{{serverName}}/open-metadata/framework-services/{{serviceURLMarker}}/open-metadata-store/users/{{userId}}/related-elements/{{elementGUID}}/any-type?
startingAtEnd=1&
startingAtEnd=0&
startFrom=0&
pageSize=0

Expand Down
Loading

0 comments on commit 5368b61

Please sign in to comment.