Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add placeholder support for classifications and relationships #8044

Merged
merged 1 commit into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,6 @@ egeria-lineage-repositories/**
*-graph-repository/**

# Ignore archives if they are in the top level directory
/OpenConnectorsArchive.json
/OpenMetadataTypes.json
/SimpleAPICatalog.json
/SimpleCatalog.json
/SimpleDataCatalog.json
/SimpleEventCatalog.json
/SimpleGovernanceCatalog.json
/*Archive.json
/BigGlossary*.json
/*.omarchive

# Ignore report output
Expand Down
1 change: 1 addition & 0 deletions BigGlossaryGUIDMap.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion OpenConnectorsArchiveGUIDMap.json

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ server.port=9443
# "topicURLRoot": "egeria.omag",\
# "configurationProperties":\
# {\
# "producer": {"bootstrap.servers": "{{kafkaep}}"},\
# "consumer": {"bootstrap.servers": "{{kafkaep}}"}\
# "producer": {"bootstrap.servers": "{{kafkaEndpoint}}"},\
# "consumer": {"bootstrap.servers": "{{kafkaEndpoint}}"}\
# }\
# }\
# }
Expand All @@ -49,7 +49,7 @@ server.port=9443
################################################
platform.placeholder.variables=\
{\
"kafkaep" : "localhost:9092"\
"kafkaEndpoint" : "localhost:9092"\
}

################################################
Expand Down Expand Up @@ -188,10 +188,10 @@ scan.packages=org.odpi.openmetadata.*
################################################
logging.level.root=OFF
logging.level.org.springframework=ERROR
#logging.level.org.odpi.openmetadata.commonservices=DEBUG
#logging.level.org.odpi.openmetadata.accessservices.subjectarea.handlers=DEBUG
logging.level.org.springframework.boot.web.embedded.tomcat=INFO
logging.level.org.odpi.openmetadata.platformchassis.springboot=INFO
#tracing REST calls
#logging.level.org.odpi.openmetadata.commonservices.ffdc.RESTCallLogger=DEBUG

################################################
### Swagger Docs
Expand Down
2 changes: 1 addition & 1 deletion content-packs/CocoGovernanceEngineDefinitionsArchive.json

Large diffs are not rendered by default.

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 @@ -286,6 +286,8 @@ void removeSecurityTags(String userId,
* @param assetGUID unique identifier of the asset to classify
* @param name name of the template
* @param description description of when, where and how to use the template
* @param replacementProperties map of attribute names to description that should be replaced in the parent entity
* @param placeholderProperties map of placeholder property names to description used throughout the template
* @param additionalProperties any additional properties
*
* @throws InvalidParameterException asset or element not known, null userId or guid
Expand All @@ -296,6 +298,8 @@ void addTemplateClassification(String userId,
String assetGUID,
String name,
String description,
Map<String, String> replacementProperties,
Map<String, String> placeholderProperties,
Map<String, String> additionalProperties) throws InvalidParameterException,
UserNotAuthorizedException,
PropertyServerException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
@JsonIgnoreProperties(ignoreUnknown=true)
public class TemplateClassificationRequestBody extends AssetOwnerOMASAPIRequestBody
{
private static final long serialVersionUID = 1L;

private String name = null;
private String description = null;
private Map<String, String> replacementProperties = null;
private Map<String, String> placeholderProperties = null;
private Map<String, String> additionalProperties = null;


Expand All @@ -50,6 +50,8 @@ public TemplateClassificationRequestBody(TemplateClassificationRequestBody templ
{
name = template.getName();
description = template.getDescription();
replacementProperties = template.getReplacementProperties();
placeholderProperties = template.getPlaceholderProperties();
additionalProperties = template.getAdditionalProperties();
}
}
Expand Down Expand Up @@ -101,25 +103,58 @@ public void setDescription(String description)
}


/**
* Return map of attribute names to description that should be replaced in the parent entity.
*
* @return string map
*/
public Map<String, String> getReplacementProperties()
{
return replacementProperties;
}


/**
* Set up map of attribute names to description that should be replaced in the parent entity.
*
* @param replacementProperties string map
*/
public void setReplacementProperties(Map<String, String> replacementProperties)
{
this.replacementProperties = replacementProperties;
}


/**
* Return map of placeholder property names to description used throughout the template.
*
* @return string map
*/
public Map<String, String> getPlaceholderProperties()
{
return placeholderProperties;
}


/**
* Set up map of placeholder property names to description used throughout the template.
*
* @param placeholderProperties string name
*/
public void setPlaceholderProperties(Map<String, String> placeholderProperties)
{
this.placeholderProperties = placeholderProperties;
}


/**
* Return a copy of the additional properties. Null means no additional properties are available.
*
* @return AdditionalProperties
*/
public Map<String, String> getAdditionalProperties()
{
if (additionalProperties == null)
{
return null;
}
else if (additionalProperties.isEmpty())
{
return null;
}
else
{
return new HashMap<>(additionalProperties);
}
return additionalProperties;
}


Expand Down Expand Up @@ -172,7 +207,9 @@ public boolean equals(Object objectToCompare)
TemplateClassificationRequestBody that = (TemplateClassificationRequestBody) objectToCompare;
return Objects.equals(name, that.name) &&
Objects.equals(description, that.description) &&
Objects.equals(additionalProperties, that.additionalProperties);
Objects.equals(replacementProperties, that.replacementProperties) &&
Objects.equals(placeholderProperties, that.placeholderProperties) &&
Objects.equals(additionalProperties, that.additionalProperties);
}


Expand All @@ -184,6 +221,6 @@ public boolean equals(Object objectToCompare)
@Override
public int hashCode()
{
return Objects.hash(super.hashCode(), name, description, additionalProperties);
return Objects.hash(super.hashCode(), name, description, replacementProperties, placeholderProperties, additionalProperties);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2535,16 +2535,21 @@ public void removeSecurityTags(String userId,
* @param assetGUID unique identifier of the asset to classify
* @param name name of the template
* @param description description of when, where and how to use the template
* @param replacementProperties map of attribute names to description that should be replaced in the parent entity
* @param placeholderProperties map of placeholder property names to description used throughout the template
* @param additionalProperties any additional properties
*
* @throws InvalidParameterException asset or element not known, null userId or guid
* @throws PropertyServerException problem accessing property server
* @throws UserNotAuthorizedException security access problem
*/
@Override
public void addTemplateClassification(String userId,
String assetGUID,
String name,
String description,
Map<String, String> replacementProperties,
Map<String, String> placeholderProperties,
Map<String, String> additionalProperties) throws InvalidParameterException,
UserNotAuthorizedException,
PropertyServerException
Expand All @@ -2561,6 +2566,8 @@ public void addTemplateClassification(String userId,

requestBody.setName(name);
requestBody.setDescription(description);
requestBody.setReplacementProperties(replacementProperties);
requestBody.setPlaceholderProperties(placeholderProperties);
requestBody.setAdditionalProperties(additionalProperties);

restClient.callVoidPostRESTCall(methodName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4575,6 +4575,8 @@ public VoidResponse addTemplateClassification(String
assetTypeName,
requestBody.getName(),
requestBody.getDescription(),
requestBody.getReplacementProperties(),
requestBody.getPlaceholderProperties(),
requestBody.getAdditionalProperties(),
false,
false,
Expand All @@ -4590,6 +4592,8 @@ public VoidResponse addTemplateClassification(String
null,
null,
null,
null,
null,
false,
false,
new Date(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

/**
* GovernanceConfigurationHandler provides the open metadata server side implementation of
* GovernanceConfigurationServer which is part of the Open Governance Framework (ODF).
* GovernanceConfigurationServer which is part of the Governance Action Framework (GAF).
*/
public class GovernanceConfigurationHandler
{
Expand Down

This file was deleted.

Loading
Loading