Skip to content

Commit

Permalink
Merge pull request #8146 from mandy-chessell/oak2024
Browse files Browse the repository at this point in the history
Update DigitalProduct types and implementation
  • Loading branch information
mandy-chessell authored Apr 17, 2024
2 parents 5ac2aa7 + af21205 commit e147f2e
Show file tree
Hide file tree
Showing 45 changed files with 1,013 additions and 1,092 deletions.
2 changes: 1 addition & 1 deletion OpenConnectorsArchiveGUIDMap.json

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

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/CocoGovernanceProgramArchive.omarchive

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

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

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.

1 change: 0 additions & 1 deletion content-packs/OpenMetadataTypes.json

This file was deleted.

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

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion open-metadata-distribution/omag-server-platform/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,8 @@ distributions {
{ include 'Egeria*.http' }
from { "$rootProject.projectDir/open-metadata-implementation/platform-services" }
{ include 'Egeria*.http' }
from { "$rootProject.projectDir/open-metadata-implementation/server-operations" }
{ include 'Egeria*.http' }
from { "$rootProject.projectDir/open-metadata-implementation/access-services/asset-consumer" }
{ include 'Egeria*.http' }
from { "$rootProject.projectDir/open-metadata-implementation/access-services/asset-manager" }
Expand All @@ -378,7 +380,9 @@ distributions {
{ include 'Egeria*.http' }
from { "$rootProject.projectDir/open-metadata-implementation/access-services/discovery-engine" }
{ include 'Egeria*.http' }
from { "$rootProject.projectDir/open-metadata-implementation/access-services/governance-engine" }
from { "$rootProject.projectDir/open-metadata-implementation/access-services/governance-program" }
{ include 'Egeria*.http' }
from { "$rootProject.projectDir/open-metadata-implementation/access-services/governance-server" }
{ include 'Egeria*.http' }
from { "$rootProject.projectDir/open-metadata-implementation/access-services/it-infrastructure" }
{ include 'Egeria*.http' }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,24 +76,23 @@ public GUIDResponse createCollection(String serverName,

if (requestBody != null)
{
if (requestBody.getProperties() instanceof CollectionProperties)
if (requestBody.getProperties() instanceof CollectionProperties properties)
{
CollectionProperties properties = (CollectionProperties)requestBody.getProperties();

String collectionGUID = handler.createCollection(userId,
requestBody.getExternalSourceGUID(),
requestBody.getExternalSourceName(),
properties.getQualifiedName(),
properties.getName(),
properties.getDescription(),
properties.getAdditionalProperties(),
properties.getTypeName(),
properties.getExtendedProperties(),
null,
properties.getEffectiveFrom(),
properties.getEffectiveTo(),
new Date(),
methodName);
requestBody.getExternalSourceGUID(),
requestBody.getExternalSourceName(),
properties.getQualifiedName(),
properties.getName(),
properties.getDescription(),
properties.getCollectionType(),
properties.getAdditionalProperties(),
properties.getTypeName(),
properties.getExtendedProperties(),
null,
properties.getEffectiveFrom(),
properties.getEffectiveTo(),
new Date(),
methodName);

if (collectionGUID != null)
{
Expand Down Expand Up @@ -169,6 +168,7 @@ public GUIDResponse createFolderCollection(String serverName,
properties.getQualifiedName(),
properties.getName(),
properties.getDescription(),
properties.getCollectionType(),
properties.getAdditionalProperties(),
properties.getTypeName(),
properties.getExtendedProperties(),
Expand Down Expand Up @@ -268,6 +268,7 @@ public VoidResponse updateCollection(String serverName,
properties.getQualifiedName(),
properties.getName(),
properties.getDescription(),
properties.getCollectionType(),
properties.getAdditionalProperties(),
properties.getTypeName(),
properties.getExtendedProperties(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class DigitalProductProperties extends ClassificationProperties
private String maturity = null;
private String serviceLife = null;
private String currentVersion = null;
private Date nextVersion = null;
private Date nextVersionDate = null;
private Date withdrawDate = null;
private Map<String, String> additionalProperties = null;

Expand Down Expand Up @@ -63,9 +63,9 @@ public DigitalProductProperties(DigitalProductProperties template)
introductionDate = template.getIntroductionDate();
maturity = template.getMaturity();
serviceLife = template.getServiceLife();
currentVersion = template.getCurrentVersion();
nextVersion = template.getNextVersion();
withdrawDate = template.getWithdrawDate();
currentVersion = template.getCurrentVersion();
nextVersionDate = template.getNextVersionDate();
withdrawDate = template.getWithdrawDate();
additionalProperties = template.getAdditionalProperties();
}
}
Expand Down Expand Up @@ -252,20 +252,20 @@ public void setCurrentVersion(String currentVersion)
*
* @return date
*/
public Date getNextVersion()
public Date getNextVersionDate()
{
return nextVersion;
return nextVersionDate;
}


/**
* Set up the date of the next version of the digital service.
*
* @param nextVersion date
* @param nextVersionDate date
*/
public void setNextVersion(Date nextVersion)
public void setNextVersionDate(Date nextVersionDate)
{
this.nextVersion = nextVersion;
this.nextVersionDate = nextVersionDate;
}


Expand Down Expand Up @@ -333,7 +333,7 @@ public String toString()
", maturity='" + maturity + '\'' +
", serviceLife='" + serviceLife + '\'' +
", currentVersion='" + currentVersion + '\'' +
", nextVersion=" + nextVersion +
", nextVersionDate=" + nextVersionDate +
", withdrawDate=" + withdrawDate +
", additionalProperties=" + additionalProperties +
'}';
Expand Down Expand Up @@ -366,7 +366,7 @@ public boolean equals(Object objectToCompare)
Objects.equals(productType, that.productType) && Objects.equals(description, that.description) &&
Objects.equals(introductionDate, that.introductionDate) && Objects.equals(maturity, that.maturity) &&
Objects.equals(serviceLife, that.serviceLife) && Objects.equals(currentVersion, that.currentVersion) &&
Objects.equals(nextVersion, that.nextVersion) && Objects.equals(withdrawDate, that.withdrawDate) &&
Objects.equals(nextVersionDate, that.nextVersionDate) && Objects.equals(withdrawDate, that.withdrawDate) &&
Objects.equals(additionalProperties, that.additionalProperties);
}

Expand All @@ -380,6 +380,6 @@ public boolean equals(Object objectToCompare)
public int hashCode()
{
return Objects.hash(super.hashCode(), productStatus, productName, productType, description, introductionDate,
maturity, serviceLife, currentVersion, nextVersion, withdrawDate, additionalProperties);
maturity, serviceLife, currentVersion, nextVersionDate, withdrawDate, additionalProperties);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,7 @@ public enum DigitalProductStatus implements Serializable
*/
OTHER (50, "Other", "The instance is in a locally defined state."),

/**
* Deleted - The instance has been deleted and is no longer available.
*/
DELETED (99, "Deleted", "The instance has been deleted and is no longer available.");
;

private static final long serialVersionUID = 1L;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public List<CollectionElement> getLinkedCollections(String userId,

for (RelatedMetadataElement relatedMetadataElement : linkedResources)
{
if (propertyHelper.isTypeOf(relatedMetadataElement, OpenMetadataType.COLLECTION.typeName))
if (propertyHelper.isTypeOf(relatedMetadataElement.getElement(), OpenMetadataType.COLLECTION.typeName))
{
CollectionElement collectionElement = collectionConverter.getNewBean(collectionBeanClass, relatedMetadataElement, methodName);

Expand Down Expand Up @@ -651,7 +651,7 @@ public String createDigitalProduct(String userId,
{
openMetadataStoreClient.classifyMetadataElementInStore(userId,
collectionGUID,
OpenMetadataType.DIGITAL_PRODUCT_CLASSIFICATION_TYPE_NAME,
OpenMetadataType.DIGITAL_PRODUCT_CLASSIFICATION.typeName,
false,
false,
digitalProductProperties.getEffectiveFrom(),
Expand Down Expand Up @@ -736,7 +736,7 @@ public void updateDigitalProduct(String userId,

openMetadataStoreClient.reclassifyMetadataElementInStore(userId,
collectionGUID,
OpenMetadataType.DIGITAL_PRODUCT_CLASSIFICATION_TYPE_NAME,
OpenMetadataType.DIGITAL_PRODUCT_CLASSIFICATION.typeName,
replaceAllProperties,
false,
false,
Expand Down Expand Up @@ -1220,39 +1220,46 @@ private ElementProperties getElementProperties(DigitalProductProperties digitalP
if (digitalProductProperties != null)
{
ElementProperties elementProperties = propertyHelper.addStringProperty(null,
OpenMetadataType.PRODUCT_NAME_PROPERTY_NAME,
OpenMetadataProperty.PRODUCT_NAME.name,
digitalProductProperties.getProductName());

if (digitalProductProperties.getProductStatus() != null)
{
elementProperties = propertyHelper.addStringProperty(elementProperties,
OpenMetadataProperty.PRODUCT_STATUS.name,
digitalProductProperties.getProductStatus().getName());
}

elementProperties = propertyHelper.addStringProperty(elementProperties,
OpenMetadataType.PRODUCT_TYPE_PROPERTY_NAME,
OpenMetadataProperty.PRODUCT_TYPE.name,
digitalProductProperties.getProductType());

elementProperties = propertyHelper.addStringProperty(elementProperties,
OpenMetadataProperty.DESCRIPTION.name,
digitalProductProperties.getDescription());

elementProperties = propertyHelper.addDateProperty(elementProperties,
OpenMetadataType.INTRODUCTION_DATE_PROPERTY_NAME,
OpenMetadataProperty.INTRODUCTION_DATE.name,
digitalProductProperties.getIntroductionDate());

elementProperties = propertyHelper.addStringProperty(elementProperties,
OpenMetadataType.MATURITY_PROPERTY_NAME,
OpenMetadataProperty.MATURITY.name,
digitalProductProperties.getMaturity());

elementProperties = propertyHelper.addStringProperty(elementProperties,
OpenMetadataType.SERVICE_LIFE_PROPERTY_NAME,
OpenMetadataProperty.SERVICE_LIFE.name,
digitalProductProperties.getServiceLife());

elementProperties = propertyHelper.addStringProperty(elementProperties,
OpenMetadataType.CURRENT_VERSION_PROPERTY_NAME,
OpenMetadataProperty.CURRENT_VERSION.name,
digitalProductProperties.getCurrentVersion());

elementProperties = propertyHelper.addDateProperty(elementProperties,
OpenMetadataType.NEXT_VERSION_PROPERTY_NAME,
digitalProductProperties.getNextVersion());
OpenMetadataProperty.NEXT_VERSION_DATE.name,
digitalProductProperties.getNextVersionDate());

elementProperties = propertyHelper.addDateProperty(elementProperties,
OpenMetadataType.WITHDRAW_DATE_PROPERTY_NAME,
OpenMetadataProperty.WITHDRAW_DATE.name,
digitalProductProperties.getWithdrawDate());

elementProperties = propertyHelper.addStringMapProperty(elementProperties,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Egeria-governance-program-omas

@guid = xxx
Loading

0 comments on commit e147f2e

Please sign in to comment.