diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/exchange/CollaborationExchangeInterface.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/exchange/CollaborationExchangeInterface.java index 79aba2a34ab..dd6179323b8 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/exchange/CollaborationExchangeInterface.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/exchange/CollaborationExchangeInterface.java @@ -6,7 +6,6 @@ import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.InformalTagElement; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.NoteElement; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.NoteLogElement; -import org.odpi.openmetadata.accessservices.assetmanager.properties.ArchiveProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.CommentProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.ExternalIdentifierProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.FeedbackProperties; @@ -15,7 +14,6 @@ import org.odpi.openmetadata.accessservices.assetmanager.properties.NoteLogProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.NoteProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.RatingProperties; -import org.odpi.openmetadata.accessservices.assetmanager.properties.TemplateProperties; import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; import org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException; @@ -615,6 +613,7 @@ List getElementsByTag(String userId, * @param elementGUID unique identifier of the element where the note log is located * @param externalIdentifierProperties optional properties used to define an external identifier for the note log * @param noteLogProperties properties about the note log to store + * @param isPublic is this element visible to other people. * @param effectiveTime the time that the retrieved elements must be effective for * @param forLineage return elements marked with the Memento classification? * @param forDuplicateProcessing do not merge elements marked as duplicates? @@ -632,43 +631,13 @@ String createNoteLog(String userId, String elementGUID, ExternalIdentifierProperties externalIdentifierProperties, NoteLogProperties noteLogProperties, + boolean isPublic, Date effectiveTime, boolean forLineage, boolean forDuplicateProcessing) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException; - - /** - * Create a new metadata element to represent a note log using an existing metadata element as a template. - * - * @param userId calling user - * @param assetManagerGUID unique identifier of software capability representing the caller - * @param assetManagerName unique name of software capability representing the caller - * @param assetManagerIsHome ensure that only the asset manager can update this element - * @param elementGUID unique identifier of the element where the note log is located - * @param templateGUID unique identifier of the metadata element to copy - * @param externalIdentifierProperties optional properties used to define an external identifier - * @param templateProperties properties that override the template - * - * @return unique identifier of the new note log - * - * @throws InvalidParameterException one of the parameters is invalid - * @throws UserNotAuthorizedException the user is not authorized to issue this request - * @throws PropertyServerException there is a problem reported in the open metadata server(s) - */ - String createNoteLogFromTemplate(String userId, - String assetManagerGUID, - String assetManagerName, - boolean assetManagerIsHome, - String elementGUID, - String templateGUID, - ExternalIdentifierProperties externalIdentifierProperties, - TemplateProperties templateProperties) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException; - - /** * Update the metadata element representing a note log. * @@ -863,37 +832,6 @@ String createNote(String userId, PropertyServerException; - - /** - * Create a new metadata element to represent a note using an existing metadata element as a template. - * - * @param userId calling user - * @param assetManagerGUID unique identifier of software capability representing the caller - * @param assetManagerName unique name of software capability representing the caller - * @param assetManagerIsHome ensure that only the asset manager can update this element - * @param noteLogGUID unique identifier of the element where the note is located - * @param templateGUID unique identifier of the metadata element to copy - * @param externalIdentifierProperties optional properties used to define an external identifier - * @param templateProperties properties that override the template - * - * @return unique identifier of the new metadata element for the note - * - * @throws InvalidParameterException one of the parameters is invalid - * @throws UserNotAuthorizedException the user is not authorized to issue this request - * @throws PropertyServerException there is a problem reported in the open metadata server(s) - */ - String createNoteFromTemplate(String userId, - String assetManagerGUID, - String assetManagerName, - boolean assetManagerIsHome, - String noteLogGUID, - String templateGUID, - ExternalIdentifierProperties externalIdentifierProperties, - TemplateProperties templateProperties) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException; - - /** * Update the properties of the metadata element representing a note. * @@ -926,64 +864,6 @@ void updateNote(String userId, PropertyServerException; - /** - * Undo the last update to the note. - * - * @param userId calling user - * @param assetManagerGUID unique identifier of software capability representing the caller - * @param assetManagerName unique name of software capability representing the caller - * @param noteGUID unique identifier of the metadata element to update - * @param noteExternalIdentifier unique identifier of the note in the external asset manager - * @param effectiveTime the time that the retrieved elements must be effective for - * @param forLineage return elements marked with the Memento classification? - * @param forDuplicateProcessing do not merge elements marked as duplicates? - * @return recovered note - * - * @throws InvalidParameterException one of the parameters is invalid - * @throws UserNotAuthorizedException the user is not authorized to issue this request - * @throws PropertyServerException there is a problem reported in the open metadata server(s) - */ - NoteElement undoNoteUpdate(String userId, - String assetManagerGUID, - String assetManagerName, - String noteGUID, - String noteExternalIdentifier, - Date effectiveTime, - boolean forLineage, - boolean forDuplicateProcessing) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException; - - - /** - * Archive the metadata element representing a note. This removes it from normal access. However, it is still available - * for lineage requests. - * - * @param userId calling user - * @param assetManagerGUID unique identifier of software capability representing the caller - * @param assetManagerName unique name of software capability representing the caller - * @param noteGUID unique identifier of the metadata element to archive - * @param noteExternalIdentifier unique identifier of the note in the external asset manager - * @param archiveProperties option parameters about the archive process - * @param effectiveTime the time that the retrieved elements must be effective for - * @param forDuplicateProcessing do not merge elements marked as duplicates? - * - * @throws InvalidParameterException one of the parameters is invalid - * @throws UserNotAuthorizedException the user is not authorized to issue this request - * @throws PropertyServerException there is a problem reported in the open metadata server(s) - */ - void archiveNote(String userId, - String assetManagerGUID, - String assetManagerName, - String noteGUID, - String noteExternalIdentifier, - ArchiveProperties archiveProperties, - Date effectiveTime, - boolean forDuplicateProcessing) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException; - - /** * Remove the metadata element representing a note. * @@ -1019,7 +899,6 @@ void removeNote(String userId, * @param userId calling user * @param assetManagerGUID unique identifier of software capability representing the caller * @param assetManagerName unique name of software capability representing the caller - * @param elementGUID unique identifier of the element to query * @param searchString string to find in the properties * @param startFrom paging start point * @param pageSize maximum results that can be returned @@ -1036,7 +915,6 @@ void removeNote(String userId, List findNotes(String userId, String assetManagerGUID, String assetManagerName, - String elementGUID, String searchString, int startFrom, int pageSize, @@ -1079,41 +957,6 @@ List getNotesForNoteLog(String userId, PropertyServerException; - /** - * Retrieve the list of note metadata elements with a matching qualified or display name. - * There are no wildcards supported on this request. - * - * @param userId calling user - * @param assetManagerGUID unique identifier of software capability representing the caller - * @param assetManagerName unique name of software capability representing the caller - * @param elementGUID unique identifier of the element to query - * @param name name to search for - * @param startFrom paging start point - * @param pageSize maximum results that can be returned - * @param effectiveTime the time that the retrieved elements must be effective for - * @param forLineage return elements marked with the Memento classification? - * @param forDuplicateProcessing do not merge elements marked as duplicates? - * - * @return list of matching metadata elements - * - * @throws InvalidParameterException one of the parameters is invalid - * @throws UserNotAuthorizedException the user is not authorized to issue this request - * @throws PropertyServerException there is a problem reported in the open metadata server(s) - */ - List getNotesByName(String userId, - String assetManagerGUID, - String assetManagerName, - String elementGUID, - String name, - int startFrom, - int pageSize, - Date effectiveTime, - boolean forLineage, - boolean forDuplicateProcessing) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException; - - /** * Retrieve the note metadata element with the supplied unique identifier. * diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/management/CollaborationManagementInterface.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/management/CollaborationManagementInterface.java index 63ecbdbf932..ba85505b271 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/management/CollaborationManagementInterface.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/management/CollaborationManagementInterface.java @@ -584,35 +584,12 @@ String createNoteLog(String userId, PropertyServerException; - /** - * Create a new metadata element to represent a note log using an existing metadata element as a template. - * - * @param userId calling user - * @param elementGUID unique identifier of the element where the note log is located - * @param templateGUID unique identifier of the metadata element to copy - * @param templateProperties properties that override the template - * - * @return unique identifier of the new note log - * - * @throws InvalidParameterException one of the parameters is invalid - * @throws UserNotAuthorizedException the user is not authorized to issue this request - * @throws PropertyServerException there is a problem reported in the open metadata server(s) - */ - String createNoteLogFromTemplate(String userId, - String elementGUID, - String templateGUID, - TemplateProperties templateProperties) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException; - - /** * Update the metadata element representing a note log. * * @param userId calling user * @param noteLogGUID unique identifier of the metadata element to update * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? - * @param isPublic is this visible to other people * @param noteLogProperties new properties for the metadata element * @param effectiveTime the time that the retrieved elements must be effective for * @param forLineage return elements marked with the Memento classification? @@ -625,7 +602,6 @@ String createNoteLogFromTemplate(String userId, void updateNoteLog(String userId, String noteLogGUID, boolean isMergeUpdate, - boolean isPublic, NoteLogProperties noteLogProperties, Date effectiveTime, boolean forLineage, @@ -768,29 +744,6 @@ String createNote(String userId, PropertyServerException; - - /** - * Create a new metadata element to represent a note using an existing metadata element as a template. - * - * @param userId calling user - * @param noteLogGUID unique identifier of the element where the note is located - * @param templateGUID unique identifier of the metadata element to copy - * @param templateProperties properties that override the template - * - * @return unique identifier of the new metadata element for the note - * - * @throws InvalidParameterException one of the parameters is invalid - * @throws UserNotAuthorizedException the user is not authorized to issue this request - * @throws PropertyServerException there is a problem reported in the open metadata server(s) - */ - String createNoteFromTemplate(String userId, - String noteLogGUID, - String templateGUID, - TemplateProperties templateProperties) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException; - - /** * Update the properties of the metadata element representing a note. * @@ -816,53 +769,6 @@ void updateNote(String userId, UserNotAuthorizedException, PropertyServerException; - - /** - * Undo the last update to the note. - * - * @param userId calling user - * @param noteGUID unique identifier of the metadata element to update - * @param effectiveTime the time that the retrieved elements must be effective for - * @param forLineage return elements marked with the Memento classification? - * @param forDuplicateProcessing do not merge elements marked as duplicates? - * @return recovered note - * - * @throws InvalidParameterException one of the parameters is invalid - * @throws UserNotAuthorizedException the user is not authorized to issue this request - * @throws PropertyServerException there is a problem reported in the open metadata server(s) - */ - NoteElement undoNoteUpdate(String userId, - String noteGUID, - Date effectiveTime, - boolean forLineage, - boolean forDuplicateProcessing) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException; - - - /** - * Archive the metadata element representing a note. This removes it from normal access. However, it is still available - * for lineage requests. - * - * @param userId calling user - * @param noteGUID unique identifier of the metadata element to archive - * @param archiveProperties option parameters about the archive process - * @param effectiveTime the time that the retrieved elements must be effective for - * @param forDuplicateProcessing do not merge elements marked as duplicates? - * - * @throws InvalidParameterException one of the parameters is invalid - * @throws UserNotAuthorizedException the user is not authorized to issue this request - * @throws PropertyServerException there is a problem reported in the open metadata server(s) - */ - void archiveNote(String userId, - String noteGUID, - ArchiveProperties archiveProperties, - Date effectiveTime, - boolean forDuplicateProcessing) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException; - - /** * Remove the metadata element representing a note. * @@ -890,7 +796,6 @@ void removeNote(String userId, * The search string is treated as a regular expression. * * @param userId calling user - * @param elementGUID unique identifier of the element to query * @param searchString string to find in the properties * @param startFrom paging start point * @param pageSize maximum results that can be returned @@ -905,7 +810,6 @@ void removeNote(String userId, * @throws PropertyServerException there is a problem reported in the open metadata server(s) */ List findNotes(String userId, - String elementGUID, String searchString, int startFrom, int pageSize, @@ -944,37 +848,6 @@ List getNotesForNoteLog(String userId, PropertyServerException; - /** - * Retrieve the list of note metadata elements with a matching qualified or display name. - * There are no wildcards supported on this request. - * - * @param userId calling user - * @param elementGUID unique identifier of the element to query - * @param name name to search for - * @param startFrom paging start point - * @param pageSize maximum results that can be returned - * @param effectiveTime the time that the retrieved elements must be effective for - * @param forLineage return elements marked with the Memento classification? - * @param forDuplicateProcessing do not merge elements marked as duplicates? - * - * @return list of matching metadata elements - * - * @throws InvalidParameterException one of the parameters is invalid - * @throws UserNotAuthorizedException the user is not authorized to issue this request - * @throws PropertyServerException there is a problem reported in the open metadata server(s) - */ - List getNotesByName(String userId, - String elementGUID, - String name, - int startFrom, - int pageSize, - Date effectiveTime, - boolean forLineage, - boolean forDuplicateProcessing) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException; - - /** * Retrieve the note metadata element with the supplied unique identifier. * diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/metadataelements/NoteElement.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/metadataelements/NoteElement.java index a954d0a7f94..d91d2dd5c4a 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/metadataelements/NoteElement.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/metadataelements/NoteElement.java @@ -11,6 +11,7 @@ import java.io.Serial; import java.io.Serializable; +import java.util.Date; import java.util.List; import java.util.Objects; @@ -30,7 +31,9 @@ public class NoteElement implements MetadataElement, Serializable private ElementHeader elementHeader = null; private List correlationHeaders = null; - private NoteProperties properties = null; + private NoteProperties properties = null; + private Date lastUpdate = null; + private String user = null; private FeedbackTargetElement feedbackTargetElement = null; @@ -56,6 +59,13 @@ public NoteElement(NoteElement template) correlationHeaders = template.getCorrelationHeaders(); properties = template.getProperties(); feedbackTargetElement = template.getFeedbackTargetElement(); + user = template.getUser(); + + Date templateLastUpdate = template.getLastUpdate(); + if (templateLastUpdate != null) + { + lastUpdate = new Date(templateLastUpdate.getTime()); + } } } @@ -167,6 +177,57 @@ public void setFeedbackTargetElement(FeedbackTargetElement feedbackTargetElement } + + /** + * Return the last time a change was made to this note. + * + * @return Date last updated + */ + public Date getLastUpdate() + { + if (lastUpdate == null) + { + return null; + } + else + { + return new Date(lastUpdate.getTime()); + } + } + + + /** + * Set up the last time a change was made to this note. + * + * @param lastUpdate Date last updated + */ + public void setLastUpdate(Date lastUpdate) + { + this.lastUpdate = lastUpdate; + } + + + /** + * Return the user id of the person who created the note. Null means the user id is not known. + * + * @return String user making notes + */ + public String getUser() { + return user; + } + + + /** + * Set up the user id of the person who created the note. Null means the user id is not known. + * + * @param user String user making notes + */ + public void setUser(String user) + { + this.user = user; + } + + /** * JSON-style toString * @@ -179,6 +240,8 @@ public String toString() "elementHeader=" + elementHeader + ", correlationHeaders=" + correlationHeaders + ", properties=" + properties + + ", lastUpdate=" + lastUpdate + + ", user='" + user + '\'' + ", feedbackTargetElement=" + feedbackTargetElement + '}'; } @@ -204,6 +267,7 @@ public boolean equals(Object objectToCompare) return Objects.equals(elementHeader, that.elementHeader) && Objects.equals(correlationHeaders, that.correlationHeaders) && Objects.equals(properties, that.properties) && + Objects.equals(lastUpdate, that.lastUpdate) && Objects.equals(user, that.user) && Objects.equals(feedbackTargetElement, that.feedbackTargetElement); } @@ -216,6 +280,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(elementHeader, correlationHeaders, properties, feedbackTargetElement); + return Objects.hash(elementHeader, correlationHeaders, properties, feedbackTargetElement, user, lastUpdate); } } diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/NoteProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/NoteProperties.java index 6a616998e1e..8f7f4441273 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/NoteProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/NoteProperties.java @@ -27,9 +27,9 @@ public class NoteProperties extends ReferenceableProperties /* * Attributes of a Note */ - protected String text = null; - protected Date lastUpdate = null; - protected String user = null; + private String title = null; + private String text = null; + /** @@ -52,84 +52,50 @@ public NoteProperties(NoteProperties template) if (template != null) { + title = template.getTitle(); text = template.getText(); - user = template.getUser(); - - Date templateLastUpdate = template.getLastUpdate(); - if (templateLastUpdate != null) - { - lastUpdate = new Date(templateLastUpdate.getTime()); - } } } /** - * Return the text of the note. + * Return the title. * - * @return String text + * @return string */ - public String getText() { return text; } - - - /** - * Set up the text of the note. - * - * @param text String text - */ - public void setText(String text) + public String getTitle() { - this.text = text; + return title; } /** - * Return the last time a change was made to this note. + * Set up the title. * - * @return Date last updated + * @param title string */ - public Date getLastUpdate() + public void setTitle(String title) { - if (lastUpdate == null) - { - return null; - } - else - { - return new Date(lastUpdate.getTime()); - } - } - - - /** - * Set up the last time a change was made to this note. - * - * @param lastUpdate Date last updated - */ - public void setLastUpdate(Date lastUpdate) - { - this.lastUpdate = lastUpdate; + this.title = title; } /** - * Return the user id of the person who created the note. Null means the user id is not known. + * Return the text of the note. * - * @return String user making notes + * @return String text */ - public String getUser() { - return user; - } + public String getText() { return text; } /** - * Set up the user id of the person who created the note. Null means the user id is not known. + * Set up the text of the note. * - * @param user String user making notes + * @param text String text */ - public void setUser(String user) + public void setText(String text) { - this.user = user; + this.text = text; } @@ -142,9 +108,8 @@ public void setUser(String user) public String toString() { return "NoteProperties{" + - "text='" + text + '\'' + - ", lastUpdate=" + lastUpdate + - ", user='" + user + '\'' + + "title='" + title + '\'' + + ", text='" + text + '\'' + ", qualifiedName='" + getQualifiedName() + '\'' + ", additionalProperties=" + getAdditionalProperties() + ", effectiveFrom=" + getEffectiveFrom() + @@ -169,18 +134,15 @@ public boolean equals(Object objectToCompare) { return true; } - if (objectToCompare == null || getClass() != objectToCompare.getClass()) + if (! (objectToCompare instanceof NoteProperties that)) { return false; } - if (!super.equals(objectToCompare)) + if (! super.equals(objectToCompare)) { return false; } - NoteProperties note = (NoteProperties) objectToCompare; - return Objects.equals(getText(), note.getText()) && - Objects.equals(getLastUpdate(), note.getLastUpdate()) && - Objects.equals(getUser(), note.getUser()); + return Objects.equals(title, that.title) && Objects.equals(text, that.text); } @@ -192,6 +154,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(super.hashCode(), getText(), getLastUpdate(), getUser()); + return Objects.hash(super.hashCode(), title, text); } } \ No newline at end of file diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/AssetManagerBaseClient.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/AssetManagerBaseClient.java index a68613adb2c..ff143e49929 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/AssetManagerBaseClient.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/AssetManagerBaseClient.java @@ -736,7 +736,6 @@ protected String createReferenceableFromTemplate(String us } - /** * Create a new metadata element to represent a community using an existing metadata element as a template. * @@ -804,6 +803,7 @@ protected String createReferenceableFromTemplateWithParent(String } + /** * Create a new metadata element to represent a community using an existing metadata element as a template. * @@ -874,6 +874,79 @@ protected String createReferenceableFromTemplateWithParent(String } + /** + * Create a new metadata element to represent a community using an existing metadata element as a template. + * + * @param userId calling user + * @param assetManagerGUID unique identifier of software capability representing the caller + * @param assetManagerName unique name of software capability representing the caller + * @param assetManagerIsHome ensure that only the asset manager can update this element + * @param parentGUID unique identifier of the parent element + * @param parentGUIDParameterName name of parameter passing the parentGUID + * @param isPublic is this element visible to other people. + * @param templateGUID unique identifier of the metadata element to copy + * @param templateProperties properties that override the template + * @param externalIdentifierProperties optional properties used to define an external identifier + * @param urlTemplate URL to call (with placeholders) + * @param deepCopy should the template creation extend to the anchored elements or just the direct entity? + * @param methodName calling method + * + * @return unique identifier of the new community + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + protected String createFeedbackFromTemplateWithParent(String userId, + String assetManagerGUID, + String assetManagerName, + boolean assetManagerIsHome, + String parentGUID, + String parentGUIDParameterName, + boolean isPublic, + String templateGUID, + TemplateProperties templateProperties, + ExternalIdentifierProperties externalIdentifierProperties, + boolean deepCopy, + String urlTemplate, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String templateGUIDParameterName = "templateGUID"; + final String propertiesParameterName = "templateProperties"; + final String qualifiedNameParameterName = "qualifiedName"; + final String requestParamsURLTemplate = "?assetManagerIsHome={4}&deepCopy={5}&isPublic={6}"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(templateGUID, templateGUIDParameterName, methodName); + invalidParameterHandler.validateGUID(parentGUID, parentGUIDParameterName, methodName); + invalidParameterHandler.validateObject(templateProperties, propertiesParameterName, methodName); + invalidParameterHandler.validateName(templateProperties.getQualifiedName(), qualifiedNameParameterName, methodName); + + TemplateRequestBody requestBody = new TemplateRequestBody(); + + requestBody.setMetadataCorrelationProperties(this.getCorrelationProperties(assetManagerGUID, + assetManagerName, + externalIdentifierProperties, + methodName)); + requestBody.setParentGUID(parentGUID); + + GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, + urlTemplate + requestParamsURLTemplate, + requestBody, + serverName, + userId, + parentGUID, + templateGUID, + assetManagerIsHome, + deepCopy, + isPublic); + + return restResult.getGUID(); + } + + /** * Create a new metadata element that is attached to the parent. * @@ -956,7 +1029,7 @@ protected String createReferenceableWithParent(String user * @param assetManagerIsHome ensure that only the asset manager can update this element * @param parentGUID unique identifier of the parent element * @param parentGUIDParameterName name of parameter passing the parentGUID - * @param isPublic is this comment visible to other people. + * @param isPublic is this element visible to other people. * @param properties properties about the element to store * @param propertiesParameterName name of parameter passing the properties * @param externalIdentifierProperties optional properties used to define an external identifier @@ -1028,8 +1101,8 @@ protected String createFeedbackWithParent(String userId, * set up specialized properties in extended properties. * * @param userId calling user - * @param assetManagerGUID unique identifier of software capability representing the caller - * @param assetManagerName unique name of software capability representing the caller + * @param assetManagerGUID unique identifier of software capability representing the caller + * @param assetManagerName unique name of software capability representing the caller * @param elementGUID unique identifier of the metadata element to update * @param elementGUIDParameterName name of parameter passing the elementGUID * @param externalIdentifierName optional external identifier @@ -1101,8 +1174,8 @@ protected void updateReferenceable(String userId, * set up specialized properties in extended properties. * * @param userId calling user - * @param assetManagerGUID unique identifier of software capability representing the caller - * @param assetManagerName unique name of software capability representing the caller + * @param assetManagerGUID unique identifier of software capability representing the caller + * @param assetManagerName unique name of software capability representing the caller * @param elementGUID unique identifier of the metadata element to update * @param elementGUIDParameterName name of parameter passing the elementGUID * @param externalIdentifierName optional external identifier diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/exchange/CollaborationExchangeClient.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/exchange/CollaborationExchangeClient.java index 16b8007fdf7..c775f43197b 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/exchange/CollaborationExchangeClient.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/exchange/CollaborationExchangeClient.java @@ -7,11 +7,9 @@ import org.odpi.openmetadata.accessservices.assetmanager.client.AssetManagerBaseClient; import org.odpi.openmetadata.accessservices.assetmanager.client.rest.AssetManagerRESTClient; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.CommentElement; -import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.GlossaryElement; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.InformalTagElement; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.NoteElement; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.NoteLogElement; -import org.odpi.openmetadata.accessservices.assetmanager.properties.ArchiveProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.CommentProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.ExternalIdentifierProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.FeedbackProperties; @@ -20,12 +18,8 @@ import org.odpi.openmetadata.accessservices.assetmanager.properties.NoteLogProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.NoteProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.RatingProperties; -import org.odpi.openmetadata.accessservices.assetmanager.properties.TemplateProperties; -import org.odpi.openmetadata.accessservices.assetmanager.rest.ArchiveRequestBody; import org.odpi.openmetadata.accessservices.assetmanager.rest.CommentElementResponse; import org.odpi.openmetadata.accessservices.assetmanager.rest.CommentElementsResponse; -import org.odpi.openmetadata.accessservices.assetmanager.rest.GlossaryElementsResponse; -import org.odpi.openmetadata.accessservices.assetmanager.rest.GlossarySearchStringRequestBody; import org.odpi.openmetadata.accessservices.assetmanager.rest.InformalTagResponse; import org.odpi.openmetadata.accessservices.assetmanager.rest.InformalTagUpdateRequestBody; import org.odpi.openmetadata.accessservices.assetmanager.rest.InformalTagsResponse; @@ -1244,6 +1238,7 @@ public List getElementsByTag(String userId, * @param elementGUID unique identifier of the element where the note log is located * @param externalIdentifierProperties optional properties used to define an external identifier for the note log * @param noteLogProperties properties about the note log to store + * @param isPublic is this element visible to other people. * @param effectiveTime the time that the retrieved elements must be effective for * @param forLineage return elements marked with the Memento classification? * @param forDuplicateProcessing do not merge elements marked as duplicates? @@ -1262,6 +1257,7 @@ public String createNoteLog(String userId, String elementGUID, ExternalIdentifierProperties externalIdentifierProperties, NoteLogProperties noteLogProperties, + boolean isPublic, Date effectiveTime, boolean forLineage, boolean forDuplicateProcessing) throws InvalidParameterException, @@ -1274,69 +1270,21 @@ public String createNoteLog(String userId, final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/elements/{2}/note-logs"; - return super.createReferenceableWithParent(userId, - assetManagerGUID, - assetManagerName, - assetManagerIsHome, - elementGUID, - guidParameterName, - noteLogProperties, - propertiesParameterName, - externalIdentifierProperties, - urlTemplate, - effectiveTime, - forLineage, - forDuplicateProcessing, - methodName); - } - - - /** - * Create a new metadata element to represent a note log using an existing metadata element as a template. - * - * @param userId calling user - * @param assetManagerGUID unique identifier of software capability representing the caller - * @param assetManagerName unique name of software capability representing the caller - * @param assetManagerIsHome ensure that only the asset manager can update this element - * @param elementGUID unique identifier of the element where the note log is located - * @param templateGUID unique identifier of the metadata element to copy - * @param externalIdentifierProperties optional properties used to define an external identifier - * @param templateProperties properties that override the template - * - * @return unique identifier of the new note log - * - * @throws InvalidParameterException one of the parameters is invalid - * @throws UserNotAuthorizedException the user is not authorized to issue this request - * @throws PropertyServerException there is a problem reported in the open metadata server(s) - */ - @Override - public String createNoteLogFromTemplate(String userId, - String assetManagerGUID, - String assetManagerName, - boolean assetManagerIsHome, - String elementGUID, - String templateGUID, - ExternalIdentifierProperties externalIdentifierProperties, - TemplateProperties templateProperties) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException - { - final String methodName = "createNoteLogFromTemplate"; - final String guidParameterName = "elementGUID"; - - final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/elements/{2}/note-logs/from-template/{3}"; - - return super.createReferenceableFromTemplateWithParent(userId, - assetManagerGUID, - assetManagerName, - assetManagerIsHome, - elementGUID, - guidParameterName, - templateGUID, - templateProperties, - externalIdentifierProperties, - urlTemplate, - methodName); + return super.createFeedbackWithParent(userId, + assetManagerGUID, + assetManagerName, + assetManagerIsHome, + elementGUID, + guidParameterName, + isPublic, + noteLogProperties, + propertiesParameterName, + externalIdentifierProperties, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); } @@ -1683,56 +1631,6 @@ public String createNote(String userId, } - - /** - * Create a new metadata element to represent a note using an existing metadata element as a template. - * - * @param userId calling user - * @param assetManagerGUID unique identifier of software capability representing the caller - * @param assetManagerName unique name of software capability representing the caller - * @param assetManagerIsHome ensure that only the asset manager can update this element - * @param noteLogGUID unique identifier of the element where the note is located - * @param templateGUID unique identifier of the metadata element to copy - * @param externalIdentifierProperties optional properties used to define an external identifier - * @param templateProperties properties that override the template - * - * @return unique identifier of the new metadata element for the note - * - * @throws InvalidParameterException one of the parameters is invalid - * @throws UserNotAuthorizedException the user is not authorized to issue this request - * @throws PropertyServerException there is a problem reported in the open metadata server(s) - */ - @Override - public String createNoteFromTemplate(String userId, - String assetManagerGUID, - String assetManagerName, - boolean assetManagerIsHome, - String noteLogGUID, - String templateGUID, - ExternalIdentifierProperties externalIdentifierProperties, - TemplateProperties templateProperties) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException - { - final String methodName = "createNoteFromTemplate"; - final String guidParameterName = "noteLogGUID"; - - final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/note-logs/{2}/notes/from-template/{3}"; - - return super.createReferenceableFromTemplateWithParent(userId, - assetManagerGUID, - assetManagerName, - assetManagerIsHome, - noteLogGUID, - guidParameterName, - templateGUID, - templateProperties, - externalIdentifierProperties, - urlTemplate, - methodName); - } - - /** * Update the properties of the metadata element representing a note. * @@ -1788,110 +1686,6 @@ public void updateNote(String userId, } - /** - * Undo the last update to the note. - * - * @param userId calling user - * @param assetManagerGUID unique identifier of software capability representing the caller - * @param assetManagerName unique name of software capability representing the caller - * @param noteGUID unique identifier of the metadata element to update - * @param noteExternalIdentifier unique identifier of the note in the external asset manager - * @param effectiveTime the time that the retrieved elements must be effective for - * @param forLineage return elements marked with the Memento classification? - * @param forDuplicateProcessing do not merge elements marked as duplicates? - * @return recovered note - * - * @throws InvalidParameterException one of the parameters is invalid - * @throws UserNotAuthorizedException the user is not authorized to issue this request - * @throws PropertyServerException there is a problem reported in the open metadata server(s) - */ - @Override - public NoteElement undoNoteUpdate(String userId, - String assetManagerGUID, - String assetManagerName, - String noteGUID, - String noteExternalIdentifier, - Date effectiveTime, - boolean forLineage, - boolean forDuplicateProcessing) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException - { - final String methodName = "undoNoteUpdate"; - final String noteGUIDParameterName = "noteGUID"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(noteGUID, noteGUIDParameterName, methodName); - - final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/note-logs/notes/{2}/undo&forLineage={3}&forDuplicateProcessing={4}"; - - NoteElementResponse response = restClient.callNoteElementPostRESTCall(methodName, - urlTemplate, - getUpdateRequestBody(assetManagerGUID, assetManagerName, noteExternalIdentifier, effectiveTime, methodName), - serverName, - userId, - noteGUID, - forLineage, - forDuplicateProcessing); - - return response.getElement(); - } - - - /** - * Archive the metadata element representing a note. This removes it from normal access. However, it is still available - * for lineage requests. - * - * @param userId calling user - * @param assetManagerGUID unique identifier of software capability representing the caller - * @param assetManagerName unique name of software capability representing the caller - * @param noteGUID unique identifier of the metadata element to archive - * @param noteExternalIdentifier unique identifier of the note in the external asset manager - * @param archiveProperties option parameters about the archive process - * @param effectiveTime the time that the retrieved elements must be effective for - * @param forDuplicateProcessing do not merge elements marked as duplicates? - * - * @throws InvalidParameterException one of the parameters is invalid - * @throws UserNotAuthorizedException the user is not authorized to issue this request - * @throws PropertyServerException there is a problem reported in the open metadata server(s) - */ - @Override - public void archiveNote(String userId, - String assetManagerGUID, - String assetManagerName, - String noteGUID, - String noteExternalIdentifier, - ArchiveProperties archiveProperties, - Date effectiveTime, - boolean forDuplicateProcessing) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException - { - final String methodName = "archiveNote"; - final String noteGUIDParameterName = "noteGUID"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(noteGUID, noteGUIDParameterName, methodName); - - final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/note-logs/notes/{2}/archive&forLineage={3}&forDuplicateProcessing={4}"; - - ArchiveRequestBody requestBody = new ArchiveRequestBody(); - requestBody.setElementProperties(archiveProperties); - requestBody.setMetadataCorrelationProperties(this.getCorrelationProperties(assetManagerGUID, - assetManagerName, - noteExternalIdentifier, - methodName)); - - restClient.callVoidPostRESTCall(methodName, - urlTemplate, - requestBody, - serverName, - userId, - noteGUID, - forDuplicateProcessing); - } - - /** * Remove the metadata element representing a note. * @@ -1946,7 +1740,6 @@ public void removeNote(String userId, * @param userId calling user * @param assetManagerGUID unique identifier of software capability representing the caller * @param assetManagerName unique name of software capability representing the caller - * @param elementGUID unique identifier of the element to query * @param searchString string to find in the properties * @param startFrom paging start point * @param pageSize maximum results that can be returned @@ -1964,7 +1757,6 @@ public void removeNote(String userId, public List findNotes(String userId, String assetManagerGUID, String assetManagerName, - String elementGUID, String searchString, int startFrom, int pageSize, @@ -2060,71 +1852,6 @@ public List getNotesForNoteLog(String userId, } - /** - * Retrieve the list of note metadata elements with a matching qualified or display name. - * There are no wildcards supported on this request. - * - * @param userId calling user - * @param assetManagerGUID unique identifier of software capability representing the caller - * @param assetManagerName unique name of software capability representing the caller - * @param elementGUID unique identifier of the element to query - * @param name name to search for - * @param startFrom paging start point - * @param pageSize maximum results that can be returned - * @param effectiveTime the time that the retrieved elements must be effective for - * @param forLineage return elements marked with the Memento classification? - * @param forDuplicateProcessing do not merge elements marked as duplicates? - * - * @return list of matching metadata elements - * - * @throws InvalidParameterException one of the parameters is invalid - * @throws UserNotAuthorizedException the user is not authorized to issue this request - * @throws PropertyServerException there is a problem reported in the open metadata server(s) - */ - @Override - public List getNotesByName(String userId, - String assetManagerGUID, - String assetManagerName, - String elementGUID, - String name, - int startFrom, - int pageSize, - Date effectiveTime, - boolean forLineage, - boolean forDuplicateProcessing) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException - { - final String methodName = "getNotesByName"; - final String nameParameterName = "name"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateName(name, nameParameterName, methodName); - int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); - - NameRequestBody requestBody = new NameRequestBody(); - requestBody.setAssetManagerGUID(assetManagerGUID); - requestBody.setAssetManagerName(assetManagerName); - requestBody.setName(name); - requestBody.setNameParameterName(nameParameterName); - requestBody.setEffectiveTime(effectiveTime); - - final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/note-logs/notes/by-name?startFrom={2}&pageSize={3}&forLineage={4}&forDuplicateProcessing={5}"; - - NoteElementsResponse restResult = restClient.callNoteElementsPostRESTCall(methodName, - urlTemplate, - requestBody, - serverName, - userId, - startFrom, - validatedPageSize, - forLineage, - forDuplicateProcessing); - - return restResult.getElementList(); - } - - /** * Retrieve the note metadata element with the supplied unique identifier. * diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/exchange/GlossaryExchangeClient.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/exchange/GlossaryExchangeClient.java index 918ce78e2a4..2e6f5d433b2 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/exchange/GlossaryExchangeClient.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/exchange/GlossaryExchangeClient.java @@ -376,7 +376,6 @@ public void clearGlossaryAsEditingGlossary(String userId, * Classify the glossary to indicate that it can be used as a taxonomy. * This means each term is attached to one, and only one category and the categories are organized as a hierarchy * with a single root category. - * * Taxonomies are used as a way of organizing assets and other related metadata. The terms in the taxonomy * are linked to the assets etc. and as such they are logically categorized by the linked category. * @@ -478,7 +477,6 @@ public void clearGlossaryAsTaxonomy(String userId, * Classify a glossary to declare that it has no two GlossaryTerm definitions with * the same name. This means there is only one definition for each term. Typically, the terms are also of a similar * level of granularity and are limited to a specific scope of use. - * * Canonical vocabularies are used to semantically classify assets in an unambiguous way. * * @param userId calling user diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/management/CollaborationManagementClient.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/management/CollaborationManagementClient.java index 296ad717374..7f0ad498ab8 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/management/CollaborationManagementClient.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/management/CollaborationManagementClient.java @@ -10,7 +10,6 @@ import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.InformalTagElement; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.NoteElement; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.NoteLogElement; -import org.odpi.openmetadata.accessservices.assetmanager.properties.ArchiveProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.CommentProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.FeedbackProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.InformalTagProperties; @@ -18,7 +17,6 @@ import org.odpi.openmetadata.accessservices.assetmanager.properties.NoteLogProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.NoteProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.RatingProperties; -import org.odpi.openmetadata.accessservices.assetmanager.properties.TemplateProperties; import org.odpi.openmetadata.frameworks.auditlog.AuditLog; import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; @@ -799,33 +797,7 @@ public String createNoteLog(String userId, UserNotAuthorizedException, PropertyServerException { - return client.createNoteLog(userId, null, null, false, elementGUID, null, noteLogProperties, effectiveTime, forLineage, forDuplicateProcessing); - } - - - /** - * Create a new metadata element to represent a note log using an existing metadata element as a template. - * - * @param userId calling user - * @param elementGUID unique identifier of the element where the note log is located - * @param templateGUID unique identifier of the metadata element to copy - * @param templateProperties properties that override the template - * - * @return unique identifier of the new note log - * - * @throws InvalidParameterException one of the parameters is invalid - * @throws UserNotAuthorizedException the user is not authorized to issue this request - * @throws PropertyServerException there is a problem reported in the open metadata server(s) - */ - @Override - public String createNoteLogFromTemplate(String userId, - String elementGUID, - String templateGUID, - TemplateProperties templateProperties) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException - { - return client.createNoteLogFromTemplate(userId, null, null, false, elementGUID, templateGUID, null, templateProperties); + return client.createNoteLog(userId, null, null, false, elementGUID, null, noteLogProperties, true, effectiveTime, forLineage, forDuplicateProcessing); } @@ -835,7 +807,6 @@ public String createNoteLogFromTemplate(String userId, * @param userId calling user * @param noteLogGUID unique identifier of the metadata element to update * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? - * @param isPublic is this visible to other people * @param noteLogProperties new properties for the metadata element * @param effectiveTime the time that the retrieved elements must be effective for * @param forLineage return elements marked with the Memento classification? @@ -849,7 +820,6 @@ public String createNoteLogFromTemplate(String userId, public void updateNoteLog(String userId, String noteLogGUID, boolean isMergeUpdate, - boolean isPublic, NoteLogProperties noteLogProperties, Date effectiveTime, boolean forLineage, @@ -857,7 +827,7 @@ public void updateNoteLog(String userId, UserNotAuthorizedException, PropertyServerException { - client.updateNoteLog(userId, null, null, noteLogGUID, null, isMergeUpdate, isPublic, noteLogProperties, effectiveTime, forLineage, forDuplicateProcessing); + client.updateNoteLog(userId, null, null, noteLogGUID, null, isMergeUpdate, true, noteLogProperties, effectiveTime, forLineage, forDuplicateProcessing); } @@ -1012,33 +982,6 @@ public String createNote(String userId, } - - /** - * Create a new metadata element to represent a note using an existing metadata element as a template. - * - * @param userId calling user - * @param noteLogGUID unique identifier of the element where the note is located - * @param templateGUID unique identifier of the metadata element to copy - * @param templateProperties properties that override the template - * - * @return unique identifier of the new metadata element for the note - * - * @throws InvalidParameterException one of the parameters is invalid - * @throws UserNotAuthorizedException the user is not authorized to issue this request - * @throws PropertyServerException there is a problem reported in the open metadata server(s) - */ - @Override - public String createNoteFromTemplate(String userId, - String noteLogGUID, - String templateGUID, - TemplateProperties templateProperties) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException - { - return client.createNoteFromTemplate(userId, null, null, false, noteLogGUID, templateGUID, null, templateProperties); - } - - /** * Update the properties of the metadata element representing a note. * @@ -1069,60 +1012,6 @@ public void updateNote(String userId, } - /** - * Undo the last update to the note. - * - * @param userId calling user - * @param noteGUID unique identifier of the metadata element to update - * @param effectiveTime the time that the retrieved elements must be effective for - * @param forLineage return elements marked with the Memento classification? - * @param forDuplicateProcessing do not merge elements marked as duplicates? - * @return recovered note - * - * @throws InvalidParameterException one of the parameters is invalid - * @throws UserNotAuthorizedException the user is not authorized to issue this request - * @throws PropertyServerException there is a problem reported in the open metadata server(s) - */ - @Override - public NoteElement undoNoteUpdate(String userId, - String noteGUID, - Date effectiveTime, - boolean forLineage, - boolean forDuplicateProcessing) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException - { - return client.undoNoteUpdate(userId, null, null, noteGUID, null, effectiveTime, forLineage, forDuplicateProcessing); - } - - - /** - * Archive the metadata element representing a note. This removes it from normal access. However, it is still available - * for lineage requests. - * - * @param userId calling user - * @param noteGUID unique identifier of the metadata element to archive - * @param archiveProperties option parameters about the archive process - * @param effectiveTime the time that the retrieved elements must be effective for - * @param forDuplicateProcessing do not merge elements marked as duplicates? - * - * @throws InvalidParameterException one of the parameters is invalid - * @throws UserNotAuthorizedException the user is not authorized to issue this request - * @throws PropertyServerException there is a problem reported in the open metadata server(s) - */ - @Override - public void archiveNote(String userId, - String noteGUID, - ArchiveProperties archiveProperties, - Date effectiveTime, - boolean forDuplicateProcessing) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException - { - client.archiveNote(userId, null, null, noteGUID, null, archiveProperties, effectiveTime, forDuplicateProcessing); - } - - /** * Remove the metadata element representing a note. * @@ -1154,7 +1043,6 @@ public void removeNote(String userId, * The search string is treated as a regular expression. * * @param userId calling user - * @param elementGUID unique identifier of the element to query * @param searchString string to find in the properties * @param startFrom paging start point * @param pageSize maximum results that can be returned @@ -1170,7 +1058,6 @@ public void removeNote(String userId, */ @Override public List findNotes(String userId, - String elementGUID, String searchString, int startFrom, int pageSize, @@ -1180,7 +1067,7 @@ public List findNotes(String userId, UserNotAuthorizedException, PropertyServerException { - return client.findNotes(userId, null, null, elementGUID, searchString, startFrom, pageSize, effectiveTime, forLineage, forDuplicateProcessing); + return client.findNotes(userId, null, null, searchString, startFrom, pageSize, effectiveTime, forLineage, forDuplicateProcessing); } @@ -1216,41 +1103,6 @@ public List getNotesForNoteLog(String userId, } - /** - * Retrieve the list of note metadata elements with a matching qualified or display name. - * There are no wildcards supported on this request. - * - * @param userId calling user - * @param elementGUID unique identifier of the element to query - * @param name name to search for - * @param startFrom paging start point - * @param pageSize maximum results that can be returned - * @param effectiveTime the time that the retrieved elements must be effective for - * @param forLineage return elements marked with the Memento classification? - * @param forDuplicateProcessing do not merge elements marked as duplicates? - * - * @return list of matching metadata elements - * - * @throws InvalidParameterException one of the parameters is invalid - * @throws UserNotAuthorizedException the user is not authorized to issue this request - * @throws PropertyServerException there is a problem reported in the open metadata server(s) - */ - @Override - public List getNotesByName(String userId, - String elementGUID, - String name, - int startFrom, - int pageSize, - Date effectiveTime, - boolean forLineage, - boolean forDuplicateProcessing) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException - { - return client.getNotesByName(userId, null, null, elementGUID, name, startFrom, pageSize, effectiveTime, forLineage, forDuplicateProcessing); - } - - /** * Retrieve the note metadata element with the supplied unique identifier. * diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/NoteConverter.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/NoteConverter.java index 707b81dd83b..e0212b63ad4 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/NoteConverter.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/NoteConverter.java @@ -75,11 +75,12 @@ public B getNewBean(Class beanClass, if (entity != null) { instanceProperties = new InstanceProperties(entity.getProperties()); - properties.setUser(entity.getCreatedBy()); - properties.setLastUpdate(entity.getUpdateTime()); + bean.setUser(entity.getCreatedBy()); + bean.setLastUpdate(entity.getUpdateTime()); properties.setQualifiedName(this.removeQualifiedName(instanceProperties)); properties.setAdditionalProperties(this.removeAdditionalProperties(instanceProperties)); + properties.setTitle(this.removeTitle(instanceProperties)); properties.setText(this.removeText(instanceProperties)); /* diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/handlers/ExchangeHandlerBase.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/handlers/ExchangeHandlerBase.java index cc3ee2cde70..cbce72b5221 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/handlers/ExchangeHandlerBase.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/handlers/ExchangeHandlerBase.java @@ -4,6 +4,8 @@ import org.odpi.openmetadata.accessservices.assetmanager.converters.ElementHeaderConverter; import org.odpi.openmetadata.accessservices.assetmanager.converters.ExternalIdentifierConverter; +import org.odpi.openmetadata.accessservices.assetmanager.converters.NoteConverter; +import org.odpi.openmetadata.accessservices.assetmanager.converters.NoteLogConverter; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.*; import org.odpi.openmetadata.accessservices.assetmanager.properties.*; import org.odpi.openmetadata.commonservices.ffdc.InvalidParameterHandler; @@ -27,8 +29,10 @@ */ class ExchangeHandlerBase { - InvalidParameterHandler invalidParameterHandler; - ExternalIdentifierHandler externalIdentifierHandler; + final InvalidParameterHandler invalidParameterHandler; + final ExternalIdentifierHandler externalIdentifierHandler; + private final NoteLogHandler noteLogHandler; + private final NoteHandler noteHandler; String serviceName; String serverName; @@ -80,6 +84,34 @@ class ExchangeHandlerBase publishZones, auditLog); + noteLogHandler = new NoteLogHandler<>(new NoteLogConverter<>(repositoryHelper, serviceName, serverName), + NoteLogElement.class, + serviceName, + serverName, + invalidParameterHandler, + repositoryHandler, + repositoryHelper, + localServerUserId, + securityVerifier, + supportedZones, + defaultZones, + publishZones, + auditLog); + + noteHandler = new NoteHandler<>(new NoteConverter<>(repositoryHelper, serviceName, serverName), + NoteElement.class, + serviceName, + serverName, + invalidParameterHandler, + repositoryHandler, + repositoryHelper, + localServerUserId, + securityVerifier, + supportedZones, + defaultZones, + publishZones, + auditLog); + this.invalidParameterHandler = invalidParameterHandler; this.serviceName = serviceName; this.serverName = serverName; @@ -574,13 +606,102 @@ void getSupplementaryProperties(String elementGUID, * @param userId calling user * @param elementGUID element to attach the comment to * @param elementQualifiedName qualified name of the element (or null if not known) + * @param elementTypeName type name of element + * @param updateTitle description of the type of update * @param updateDescription comment to attach + * @throws InvalidParameterException the parameters are invalid + * @throws UserNotAuthorizedException user not authorized to issue this request + * @throws PropertyServerException problem detected in the repository services */ void updateRevisionHistory(String userId, String elementGUID, String elementQualifiedName, - String updateDescription) + String elementTypeName, + String updateTitle, + String updateDescription) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException { + final String elementParameterName = "elementGUID"; + final String noteLogParameterName = "noteLogGUID"; + final String methodName = "updateRevisionHistory"; + final String noteLogQualifiedNamePrefix = "RevisionHistory:"; + final String noteLogName = "Revision History"; + String noteText = "None"; + + if (updateDescription != null) + { + noteText = updateDescription; + } + + List noteLogs = noteLogHandler.getAttachedNoteLogs(userId, + elementGUID, + elementParameterName, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + 0, + 0, + false, + false, + null, + methodName); + + String noteLogGUID = null; + + if (noteLogs != null) + { + for (NoteLogElement noteLogElement : noteLogs) + { + if ((noteLogElement != null) && + (noteLogElement.getProperties() != null) && + (noteLogElement.getProperties().getQualifiedName() != null) && + (noteLogElement.getElementHeader() != null) && + (noteLogElement.getElementHeader().getGUID() != null)) + { + if (noteLogElement.getProperties().getQualifiedName().startsWith(noteLogQualifiedNamePrefix)) + { + noteLogGUID = noteLogElement.getElementHeader().getGUID(); + break; + } + } + } + } + if (noteLogGUID == null) + { + noteLogGUID = noteLogHandler.attachNewNoteLog(userId, + null, + null, + elementGUID, + elementGUID, + elementParameterName, + noteLogQualifiedNamePrefix + elementTypeName + ":" + elementQualifiedName, + noteLogName, + null, + true, + null, + null, + false, + false, + null, + methodName); + } + + if (noteLogGUID != null) + { + noteHandler.attachNewNote(userId, + null, + null, + elementGUID, + noteLogGUID, + noteLogParameterName, + updateTitle, + noteText, + null, + null, + false, + false, + null, + methodName); + } } } diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/handlers/GlossaryExchangeHandler.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/handlers/GlossaryExchangeHandler.java index f9cc77d770a..5743c1df983 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/handlers/GlossaryExchangeHandler.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/handlers/GlossaryExchangeHandler.java @@ -5,10 +5,34 @@ import org.odpi.openmetadata.accessservices.assetmanager.converters.GlossaryCategoryConverter; import org.odpi.openmetadata.accessservices.assetmanager.converters.GlossaryConverter; import org.odpi.openmetadata.accessservices.assetmanager.converters.GlossaryTermConverter; -import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.*; -import org.odpi.openmetadata.accessservices.assetmanager.properties.*; +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.ExternalGlossaryLinkElement; +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.GlossaryCategoryElement; +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.GlossaryElement; +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.GlossaryTermElement; +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.MetadataElement; +import org.odpi.openmetadata.accessservices.assetmanager.properties.ArchiveProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.CanonicalVocabularyProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.DataFieldValuesProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.EditingGlossaryProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.ExternalGlossaryElementLinkProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.ExternalGlossaryLinkProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.GlossaryCategoryProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.GlossaryProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.GlossaryTermActivityType; +import org.odpi.openmetadata.accessservices.assetmanager.properties.GlossaryTermCategorization; +import org.odpi.openmetadata.accessservices.assetmanager.properties.GlossaryTermContextDefinition; +import org.odpi.openmetadata.accessservices.assetmanager.properties.GlossaryTermProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.GlossaryTermRelationship; +import org.odpi.openmetadata.accessservices.assetmanager.properties.GlossaryTermRelationshipStatus; +import org.odpi.openmetadata.accessservices.assetmanager.properties.GlossaryTermStatus; +import org.odpi.openmetadata.accessservices.assetmanager.properties.MetadataCorrelationProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.TaxonomyProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.TemplateProperties; import org.odpi.openmetadata.commonservices.ffdc.InvalidParameterHandler; -import org.odpi.openmetadata.commonservices.generichandlers.*; +import org.odpi.openmetadata.commonservices.generichandlers.GlossaryCategoryHandler; +import org.odpi.openmetadata.commonservices.generichandlers.GlossaryHandler; +import org.odpi.openmetadata.commonservices.generichandlers.GlossaryTermHandler; +import org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIMapper; import org.odpi.openmetadata.commonservices.repositoryhandler.RepositoryHandler; import org.odpi.openmetadata.frameworks.auditlog.AuditLog; import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; @@ -118,7 +142,6 @@ public GlossaryExchangeHandler(String serviceName, defaultZones, publishZones, auditLog); - } @@ -470,13 +493,14 @@ public void updateGlossary(String userId, effectiveTime, methodName); - if (updateDescription != null) - { - this.updateRevisionHistory(userId, - glossaryGUID, - glossaryProperties.getQualifiedName(), - updateDescription); - } + String revisionHistoryTitle = "Glossary properties updated by " + userId + " on " + new Date(); + + this.updateRevisionHistory(userId, + glossaryGUID, + glossaryProperties.getQualifiedName(), + OpenMetadataAPIMapper.GLOSSARY_TYPE_NAME, + revisionHistoryTitle, + updateDescription); } @@ -656,7 +680,6 @@ public void clearGlossaryAsEditingGlossary(String userId, * Classify the glossary to indicate that it can be used as a taxonomy. * This means each term is attached to one, and only one category and the categories are organized as a hierarchy * with a single root category. - * * Taxonomies are used as a way of organizing assets and other related metadata. The terms in the taxonomy * are linked to the assets etc. and as such they are logically categorized by the linked category. * @@ -780,7 +803,6 @@ public void clearGlossaryAsTaxonomy(String userId, * Classify a glossary to declare that it has no two GlossaryTerm definitions with * the same name. This means there is only one definition for each term. Typically, the terms are also of a similar * level of granularity and are limited to a specific scope of use. - * * Canonical vocabularies are used to semantically classify assets in an unambiguous way. * * @param userId calling user @@ -1224,16 +1246,19 @@ public String createGlossaryCategory(String userId, forDuplicateProcessing, effectiveTime, methodName); - } - if (updateDescription != null) - { + String revisionHistoryTitle = "Glossary category created by " + userId + " on " + new Date(); + this.updateRevisionHistory(userId, glossaryCategoryGUID, glossaryCategoryProperties.getQualifiedName(), + OpenMetadataAPIMapper.GLOSSARY_CATEGORY_TYPE_NAME, + revisionHistoryTitle, updateDescription); } + + return glossaryCategoryGUID; } @@ -1371,13 +1396,15 @@ public void updateGlossaryCategory(String userId, forDuplicateProcessing, methodName); - if (updateDescription != null) - { - this.updateRevisionHistory(userId, - glossaryCategoryGUID, - glossaryCategoryProperties.getQualifiedName(), - updateDescription); - } + String revisionHistoryTitle = "Glossary category updated by " + userId + " on " + new Date(); + + this.updateRevisionHistory(userId, + glossaryCategoryGUID, + glossaryCategoryProperties.getQualifiedName(), + OpenMetadataAPIMapper.GLOSSARY_CATEGORY_TYPE_NAME, + revisionHistoryTitle, + updateDescription); + } @@ -1968,13 +1995,14 @@ public String createGlossaryTerm(String userId, effectiveTime, methodName); - if (updateDescription != null) - { - this.updateRevisionHistory(userId, - glossaryTermGUID, - glossaryTermProperties.getQualifiedName(), - updateDescription); - } + String revisionHistoryTitle = "Glossary term created by " + userId + " on " + new Date(); + + this.updateRevisionHistory(userId, + glossaryTermGUID, + glossaryTermProperties.getQualifiedName(), + OpenMetadataAPIMapper.GLOSSARY_TERM_TYPE_NAME, + revisionHistoryTitle, + updateDescription); } return glossaryTermGUID; @@ -2107,13 +2135,14 @@ public String createControlledGlossaryTerm(String userId, effectiveTime, methodName); - if (updateDescription != null) - { - this.updateRevisionHistory(userId, - glossaryTermGUID, - glossaryTermProperties.getQualifiedName(), - updateDescription); - } + String revisionHistoryTitle = "Glossary term created by " + userId + " on " + new Date(); + + this.updateRevisionHistory(userId, + glossaryTermGUID, + glossaryTermProperties.getQualifiedName(), + OpenMetadataAPIMapper.CONTROLLED_GLOSSARY_TERM_TYPE_NAME, + revisionHistoryTitle, + updateDescription); } return glossaryTermGUID; @@ -2130,7 +2159,7 @@ public String createControlledGlossaryTerm(String userId, * @param templateGUID unique identifier of the metadata element to copy * @param templateProperties properties that override the template * @param initialStatus glossary term status to use when the object is created - * @param deepCopy should the template creation use the extend to the anchored element or just the direct entity? + * @param deepCopy should the template creation extend to the anchored elements or just the direct entity? * @param methodName calling method * * @return unique identifier of the new metadata element for the glossary term @@ -2263,13 +2292,14 @@ public void updateGlossaryTerm(String userId, effectiveTime, methodName); - if (updateDescription != null) - { - this.updateRevisionHistory(userId, - glossaryTermGUID, - glossaryTermProperties.getQualifiedName(), - updateDescription); - } + String revisionHistoryTitle = "Glossary term updated by " + userId + " on " + new Date(); + + this.updateRevisionHistory(userId, + glossaryTermGUID, + glossaryTermProperties.getQualifiedName(), + OpenMetadataAPIMapper.GLOSSARY_TERM_TYPE_NAME, + revisionHistoryTitle, + updateDescription); } diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/handlers/NoteLogExchangeHandler.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/handlers/NoteLogExchangeHandler.java new file mode 100644 index 00000000000..0eea1b740d9 --- /dev/null +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/handlers/NoteLogExchangeHandler.java @@ -0,0 +1,950 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.assetmanager.handlers; + +import org.odpi.openmetadata.accessservices.assetmanager.converters.NoteConverter; +import org.odpi.openmetadata.accessservices.assetmanager.converters.NoteLogConverter; +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.MetadataElement; +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.NoteElement; +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.NoteLogElement; +import org.odpi.openmetadata.accessservices.assetmanager.properties.MetadataCorrelationProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.NoteLogProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.NoteProperties; +import org.odpi.openmetadata.commonservices.ffdc.InvalidParameterHandler; +import org.odpi.openmetadata.commonservices.generichandlers.NoteHandler; +import org.odpi.openmetadata.commonservices.generichandlers.NoteLogHandler; +import org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIMapper; +import org.odpi.openmetadata.commonservices.repositoryhandler.RepositoryHandler; +import org.odpi.openmetadata.frameworks.auditlog.AuditLog; +import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException; +import org.odpi.openmetadata.metadatasecurity.server.OpenMetadataServerSecurityVerifier; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSRepositoryHelper; + +import java.util.Date; +import java.util.List; + +/** + * NoteLogExchangeHandler is the server side handler for managing note logs and their associated notes. + */ +public class NoteLogExchangeHandler extends ExchangeHandlerBase +{ + private final NoteLogHandler noteLogHandler; + private final NoteHandler noteHandler; + + private final static String noteLogGUIDParameterName = "noteLogGUID"; + private final static String noteGUIDParameterName = "noteGUID"; + + /** + * Construct the note log exchange handler with information needed to work with note log related objects + * for Asset Manager OMAS. + * + * @param serviceName name of this service + * @param serverName name of the local server + * @param invalidParameterHandler handler for managing parameter errors + * @param repositoryHandler manages calls to the repository services + * @param repositoryHelper provides utilities for manipulating the repository services objects + * @param localServerUserId userId for this server + * @param securityVerifier open metadata security services verifier + * @param supportedZones list of zones that the access service is allowed to serve instances from. + * @param defaultZones list of zones that the access service should set in all new instances. + * @param publishZones list of zones that the access service sets up in published instances. + * @param auditLog destination for audit log events. + */ + public NoteLogExchangeHandler(String serviceName, + String serverName, + InvalidParameterHandler invalidParameterHandler, + RepositoryHandler repositoryHandler, + OMRSRepositoryHelper repositoryHelper, + String localServerUserId, + OpenMetadataServerSecurityVerifier securityVerifier, + List supportedZones, + List defaultZones, + List publishZones, + AuditLog auditLog) + { + super(serviceName, + serverName, + invalidParameterHandler, + repositoryHandler, + repositoryHelper, + localServerUserId, + securityVerifier, + supportedZones, + defaultZones, + publishZones, + auditLog); + + + noteLogHandler = new NoteLogHandler<>(new NoteLogConverter<>(repositoryHelper, serviceName, serverName), + NoteLogElement.class, + serviceName, + serverName, + invalidParameterHandler, + repositoryHandler, + repositoryHelper, + localServerUserId, + securityVerifier, + supportedZones, + defaultZones, + publishZones, + auditLog); + + noteHandler = new NoteHandler<>(new NoteConverter<>(repositoryHelper, serviceName, serverName), + NoteElement.class, + serviceName, + serverName, + invalidParameterHandler, + repositoryHandler, + repositoryHelper, + localServerUserId, + securityVerifier, + supportedZones, + defaultZones, + publishZones, + auditLog); + } + + + + /* ======================================================== + * Managing the externalIds and related correlation properties. + */ + + + /** + * Update each returned element with details of the correlation properties for the supplied asset manager. + * + * @param userId calling user + * @param assetManagerGUID unique identifier of software server capability representing the caller + * @param assetManagerName unique name of software server capability representing the caller + * @param results list of elements + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + private void addCorrelationPropertiesToNoteLogs(String userId, + String assetManagerGUID, + String assetManagerName, + List results, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + if ((results != null) && (assetManagerGUID != null)) + { + for (MetadataElement noteLog : results) + { + if ((noteLog != null) && (noteLog.getElementHeader() != null) && (noteLog.getElementHeader().getGUID() != null)) + { + noteLog.setCorrelationHeaders(this.getCorrelationProperties(userId, + noteLog.getElementHeader().getGUID(), + noteLogGUIDParameterName, + OpenMetadataAPIMapper.NOTE_LOG_TYPE_NAME, + assetManagerGUID, + assetManagerName, + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName)); + } + } + } + } + + + + + /** + * Update each returned element with details of the correlation properties for the supplied asset manager. + * + * @param userId calling user + * @param assetManagerGUID unique identifier of software server capability representing the caller + * @param assetManagerName unique name of software server capability representing the caller + * @param results list of elements + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + private void addCorrelationPropertiesToNotes(String userId, + String assetManagerGUID, + String assetManagerName, + List results, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + if ((results != null) && (assetManagerGUID != null)) + { + for (MetadataElement note : results) + { + if ((note != null) && (note.getElementHeader() != null) && (note.getElementHeader().getGUID() != null)) + { + note.setCorrelationHeaders(this.getCorrelationProperties(userId, + note.getElementHeader().getGUID(), + noteGUIDParameterName, + OpenMetadataAPIMapper.NOTE_TYPE_NAME, + assetManagerGUID, + assetManagerName, + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName)); + } + } + } + } + + + /* ===================================================================================================================== + * A element may have one or more note logs + */ + + /** + * Create a new metadata element to represent a note log. + * + * @param userId calling user + * @param elementGUID unique identifier of the element where the note log is located + * @param correlationProperties properties to help with the mapping of the elements in the external asset manager and open metadata + * @param assetManagerIsHome ensure that only the asset manager can update this element + * @param noteLogProperties properties about the note log to store + * @param effectiveTime the time that the retrieved elements must be effective for + * @param isPublic should this be visible to all or private to the caller + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param methodName calling method + * + * @return unique identifier of the new note log + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public String createNoteLog(String userId, + String elementGUID, + MetadataCorrelationProperties correlationProperties, + boolean assetManagerIsHome, + NoteLogProperties noteLogProperties, + boolean isPublic, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String propertiesParameterName = "noteLogProperties"; + final String qualifiedNameParameterName = "noteLogProperties.qualifiedName"; + final String elementGUIDParameterName = "elementGUID"; + + invalidParameterHandler.validateObject(noteLogProperties, propertiesParameterName, methodName); + invalidParameterHandler.validateName(noteLogProperties.getQualifiedName(), qualifiedNameParameterName, methodName); + + String noteLogGUID = noteLogHandler.attachNewNoteLog(userId, + getExternalSourceGUID(correlationProperties, assetManagerIsHome), + getExternalSourceName(correlationProperties, assetManagerIsHome), + elementGUID, + elementGUID, + elementGUIDParameterName, + noteLogProperties.getQualifiedName(), + noteLogProperties.getDisplayName(), + noteLogProperties.getDescription(), + isPublic, + noteLogProperties.getEffectiveFrom(), + noteLogProperties.getEffectiveTo(), + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); + + if (noteLogGUID != null) + { + this.createExternalIdentifier(userId, + noteLogGUID, + noteLogGUIDParameterName, + OpenMetadataAPIMapper.NOTE_LOG_TYPE_NAME, + correlationProperties, + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); + } + + return noteLogGUID; + } + + + /** + * Update the metadata element representing a note log. + * + * @param userId calling user + * @param correlationProperties properties to help with the mapping of the elements in the external asset manager and open metadata + * @param noteLogGUID unique identifier of the metadata element to update + * @param noteLogProperties new properties for the metadata element + * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? + * @param isPublic is this element visible to other people. + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime optional date for effective time of the query. Null means any effective time + * @param methodName calling method + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public void updateNoteLog(String userId, + MetadataCorrelationProperties correlationProperties, + String noteLogGUID, + NoteLogProperties noteLogProperties, + boolean isMergeUpdate, + boolean isPublic, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String propertiesParameterName = "noteLogProperties"; + final String qualifiedNameParameterName = "noteLogProperties.qualifiedName"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(noteLogGUID, noteLogGUIDParameterName, methodName); + invalidParameterHandler.validateObject(noteLogProperties, propertiesParameterName, methodName); + invalidParameterHandler.validateName(noteLogProperties.getQualifiedName(), qualifiedNameParameterName, methodName); + + this.validateExternalIdentifier(userId, + noteLogGUID, + noteLogGUIDParameterName, + OpenMetadataAPIMapper.NOTE_LOG_TYPE_NAME, + correlationProperties, + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); + + noteLogHandler.updateNoteLog(userId, + getExternalSourceGUID(correlationProperties), + getExternalSourceName(correlationProperties), + noteLogGUID, + noteLogGUIDParameterName, + noteLogProperties.getQualifiedName(), + noteLogProperties.getDisplayName(), + noteLogProperties.getDescription(), + isPublic, + isMergeUpdate, + noteLogProperties.getEffectiveFrom(), + noteLogProperties.getEffectiveTo(), + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); + } + + + /** + * Remove the metadata element representing a note log. + * + * @param userId calling user + * @param correlationProperties properties to help with the mapping of the elements in the external asset manager and open metadata + * @param noteLogGUID unique identifier of the metadata element to remove + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime optional date for effective time of the query. Null means any effective time + * @param methodName calling method + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public void removeNoteLog(String userId, + MetadataCorrelationProperties correlationProperties, + String noteLogGUID, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + this.validateExternalIdentifier(userId, + noteLogGUID, + noteLogGUIDParameterName, + OpenMetadataAPIMapper.NOTE_LOG_TYPE_NAME, + correlationProperties, + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); + + noteLogHandler.removeNoteLogFromElement(userId, + getExternalSourceGUID(correlationProperties), + getExternalSourceName(correlationProperties), + noteLogGUID, + noteLogGUIDParameterName, + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); + } + + + /** + * Retrieve the list of note log metadata elements that contain the search string. + * The search string is treated as a regular expression. + * + * @param userId calling user + * @param assetManagerGUID unique identifier of software server capability representing the caller + * @param assetManagerName unique name of software server capability representing the caller + * @param searchString string to find in the properties + * @param searchStringParameterName name of parameter for searchString + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * @param effectiveTime optional date for effective time of the query. Null means any effective time + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param methodName calling method + * + * @return list of matching metadata elements + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public List findNoteLogs(String userId, + String assetManagerGUID, + String assetManagerName, + String searchString, + String searchStringParameterName, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + List results = noteLogHandler.findNoteLogs(userId, + searchString, + searchStringParameterName, + startFrom, + pageSize, + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); + + this.addCorrelationPropertiesToNoteLogs(userId, + assetManagerGUID, + assetManagerName, + results, + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); + + return results; + } + + + /** + * Retrieve the list of note log metadata elements with a matching qualified or display name. + * There are no wildcards supported on this request. + * + * @param userId calling user + * @param assetManagerGUID unique identifier of software server capability representing the caller + * @param assetManagerName unique name of software server capability representing the caller + * @param name name to search for + * @param nameParameterName parameter name + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime optional date for effective time of the query. Null means any effective time + * @param methodName calling method + * + * @return list of matching metadata elements + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public List getNoteLogsByName(String userId, + String assetManagerGUID, + String assetManagerName, + String name, + String nameParameterName, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + List results = noteLogHandler.getNoteLogsByName(userId, + name, + nameParameterName, + startFrom, + pageSize, + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); + + this.addCorrelationPropertiesToNoteLogs(userId, + assetManagerGUID, + assetManagerName, + results, + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); + + return results; + } + + + /** + * Retrieve the note log metadata element with the supplied unique identifier. + * + * @param userId calling user + * @param assetManagerGUID unique identifier of software server capability representing the caller + * @param assetManagerName unique name of software server capability representing the caller + * @param openMetadataGUID unique identifier of the requested metadata element + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime optional date for effective time of the query. Null means any effective time + * @param methodName calling method + * + * @return requested metadata element + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public NoteLogElement getNoteLogByGUID(String userId, + String assetManagerGUID, + String assetManagerName, + String openMetadataGUID, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String guidParameterName = "openMetadataGUID"; + + NoteLogElement noteLog = noteLogHandler.getBeanFromRepository(userId, + openMetadataGUID, + guidParameterName, + OpenMetadataAPIMapper.NOTE_LOG_TYPE_NAME, + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); + + if (noteLog != null) + { + noteLog.setCorrelationHeaders(this.getCorrelationProperties(userId, + openMetadataGUID, + guidParameterName, + OpenMetadataAPIMapper.NOTE_LOG_TYPE_NAME, + assetManagerGUID, + assetManagerName, + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName)); + } + + return noteLog; + } + + + /* =============================================================================== + * A note log typically contains many notes, linked with relationships. + */ + + /** + * Create a new metadata element to represent a note. + * + * @param userId calling user + * @param elementGUID unique identifier of the element where the note is located + * @param correlationProperties properties to help with the mapping of the elements in the external asset manager and open metadata + * @param assetManagerIsHome ensure that only the asset manager can update this element + * @param noteProperties properties for the note + * @param effectiveTime the time that the retrieved elements must be effective for + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param methodName calling method + * + * @return unique identifier of the new metadata element for the note + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public String createNote(String userId, + String elementGUID, + MetadataCorrelationProperties correlationProperties, + boolean assetManagerIsHome, + NoteProperties noteProperties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String propertiesParameterName = "noteProperties"; + final String qualifiedNameParameterName = "noteProperties.qualifiedName"; + final String elementGUIDParameterName = "elementGUID"; + + invalidParameterHandler.validateObject(noteProperties, propertiesParameterName, methodName); + invalidParameterHandler.validateName(noteProperties.getQualifiedName(), qualifiedNameParameterName, methodName); + + String noteGUID = noteHandler.attachNewNote(userId, + getExternalSourceGUID(correlationProperties, assetManagerIsHome), + getExternalSourceName(correlationProperties, assetManagerIsHome), + elementGUID, + elementGUIDParameterName, + noteProperties.getQualifiedName(), + noteProperties.getTitle(), + noteProperties.getText(), + noteProperties.getEffectiveFrom(), + noteProperties.getEffectiveTo(), + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); + + if (noteGUID != null) + { + this.createExternalIdentifier(userId, + noteGUID, + noteGUIDParameterName, + OpenMetadataAPIMapper.NOTE_TYPE_NAME, + correlationProperties, + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); + } + + return noteGUID; + } + + + /** + * Update the properties of the metadata element representing a note. + * + * @param userId calling user + * @param correlationProperties properties to help with the mapping of the elements in the external asset manager and open metadata + * @param noteGUID unique identifier of the note to update + * @param noteProperties new properties for the note + * @param isMergeUpdate should the properties be merged with the existing properties or completely over-write them + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime optional date for effective time of the query. Null means any effective time + * @param methodName calling method + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public void updateNote(String userId, + MetadataCorrelationProperties correlationProperties, + String noteGUID, + NoteProperties noteProperties, + boolean isMergeUpdate, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String propertiesParameterName = "noteProperties"; + final String qualifiedNameParameterName = "noteProperties.qualifiedName"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(noteGUID, noteGUIDParameterName, methodName); + invalidParameterHandler.validateObject(noteProperties, propertiesParameterName, methodName); + + if (! isMergeUpdate) + { + invalidParameterHandler.validateName(noteProperties.getQualifiedName(), qualifiedNameParameterName, methodName); + } + + this.validateExternalIdentifier(userId, + noteGUID, + noteGUIDParameterName, + OpenMetadataAPIMapper.NOTE_TYPE_NAME, + correlationProperties, + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); + + noteHandler.updateNote(userId, + getExternalSourceGUID(correlationProperties), + getExternalSourceName(correlationProperties), + noteGUID, + noteGUIDParameterName, + noteProperties.getQualifiedName(), + noteProperties.getTitle(), + noteProperties.getText(), + isMergeUpdate, + noteProperties.getEffectiveFrom(), + noteProperties.getEffectiveTo(), + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); + } + + + /** + * Remove the metadata element representing a note. + * + * @param userId calling user + * @param correlationProperties properties to help with the mapping of the elements in the external asset manager and open metadata + * @param noteGUID unique identifier of the metadata element to update + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime optional date for effective time of the query. Null means any effective time + * @param methodName calling method + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public void removeNote(String userId, + MetadataCorrelationProperties correlationProperties, + String noteGUID, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(noteGUID, noteGUIDParameterName, methodName); + + this.validateExternalIdentifier(userId, + noteGUID, + noteGUIDParameterName, + OpenMetadataAPIMapper.NOTE_TYPE_NAME, + correlationProperties, + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); + + noteHandler.removeNoteFromElement(userId, + getExternalSourceGUID(correlationProperties), + getExternalSourceName(correlationProperties), + noteGUID, + noteGUIDParameterName, + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); + } + + + /** + * Retrieve the list of note metadata elements that contain the search string. + * The search string is treated as a regular expression. + * + * @param userId calling user + * @param assetManagerGUID unique identifier of software server capability representing the caller + * @param assetManagerName unique name of software server capability representing the caller + * @param searchString string to find in the properties + * @param searchStringParameterName parameter supplying search string + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime optional date for effective time of the query. Null means any effective time + * @param methodName calling method + * + * @return list of matching metadata elements + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public List findNotes(String userId, + String assetManagerGUID, + String assetManagerName, + String searchString, + String searchStringParameterName, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + List results = noteHandler.findNotes(userId, + searchString, + searchStringParameterName, + startFrom, + pageSize, + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); + + this.addCorrelationPropertiesToNotes(userId, + assetManagerGUID, + assetManagerName, + results, + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); + + return results; + } + + + /** + * Retrieve the list of notes associated with a note log. + * + * @param userId calling user + * @param assetManagerGUID unique identifier of software server capability representing the caller + * @param assetManagerName unique name of software server capability representing the caller + * @param noteLogGUID unique identifier of the note log of interest + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime optional date for effective time of the query. Null means any effective time + * @param methodName calling method + * + * @return list of associated metadata elements + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public List getNotesForNoteLog(String userId, + String assetManagerGUID, + String assetManagerName, + String noteLogGUID, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + List results = noteHandler.getNotes(userId, + noteLogGUID, + noteLogGUIDParameterName, + OpenMetadataAPIMapper.NOTE_LOG_TYPE_NAME, + startFrom, + pageSize, + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); + + this.addCorrelationPropertiesToNotes(userId, + assetManagerGUID, + assetManagerName, + results, + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); + + return results; + } + + + /** + * Retrieve the note metadata element with the supplied unique identifier. + * + * @param userId calling user + * @param assetManagerGUID unique identifier of software server capability representing the caller + * @param assetManagerName unique name of software server capability representing the caller + * @param guid unique identifier of the requested metadata element + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime optional date for effective time of the query. Null means any effective time + * @param methodName calling method + * + * @return matching metadata element + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public NoteElement getNoteByGUID(String userId, + String assetManagerGUID, + String assetManagerName, + String guid, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String guidParameterName = "guid"; + + NoteElement note = noteHandler.getBeanFromRepository(userId, + guid, + guidParameterName, + OpenMetadataAPIMapper.NOTE_TYPE_NAME, + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); + + if (note != null) + { + note.setCorrelationHeaders(this.getCorrelationProperties(userId, + guid, + guidParameterName, + OpenMetadataAPIMapper.NOTE_TYPE_NAME, + assetManagerGUID, + assetManagerName, + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName)); + } + + return note; + } +} diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/server/AssetManagerInstanceHandler.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/server/AssetManagerInstanceHandler.java index 5e2ea15a7ba..29f17e7dab4 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/server/AssetManagerInstanceHandler.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/server/AssetManagerInstanceHandler.java @@ -7,6 +7,7 @@ import org.odpi.openmetadata.accessservices.assetmanager.handlers.DataAssetExchangeHandler; import org.odpi.openmetadata.accessservices.assetmanager.handlers.ExternalReferenceExchangeHandler; import org.odpi.openmetadata.accessservices.assetmanager.handlers.GlossaryExchangeHandler; +import org.odpi.openmetadata.accessservices.assetmanager.handlers.NoteLogExchangeHandler; import org.odpi.openmetadata.accessservices.assetmanager.handlers.ProcessExchangeHandler; import org.odpi.openmetadata.accessservices.assetmanager.handlers.SchemaExchangeHandler; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.*; @@ -467,4 +468,35 @@ CommentExchangeHandler getCommentHandler(String userId, return null; } + + /** + * Retrieve the specific handler for the access service. + * + * @param userId calling user + * @param serverName name of the server tied to the request + * @param serviceOperationName name of the REST API call (typically the top-level methodName) + * @return handler for use by the requested instance + * @throws InvalidParameterException no available instance for the requested server + * @throws UserNotAuthorizedException user does not have access to the requested server + * @throws PropertyServerException error in the requested server + */ + NoteLogExchangeHandler getNoteLogHandler(String userId, + String serverName, + String serviceOperationName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + + AssetManagerServicesInstance instance = (AssetManagerServicesInstance)super.getServerServiceInstance(userId, + serverName, + serviceOperationName); + + if (instance != null) + { + return instance.getNoteLogHandler(); + } + + return null; + } + } diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/server/AssetManagerServicesInstance.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/server/AssetManagerServicesInstance.java index 60b600341f8..a4369ec9f66 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/server/AssetManagerServicesInstance.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/server/AssetManagerServicesInstance.java @@ -10,6 +10,7 @@ import org.odpi.openmetadata.accessservices.assetmanager.handlers.DataAssetExchangeHandler; import org.odpi.openmetadata.accessservices.assetmanager.handlers.ExternalReferenceExchangeHandler; import org.odpi.openmetadata.accessservices.assetmanager.handlers.GlossaryExchangeHandler; +import org.odpi.openmetadata.accessservices.assetmanager.handlers.NoteLogExchangeHandler; import org.odpi.openmetadata.accessservices.assetmanager.handlers.ProcessExchangeHandler; import org.odpi.openmetadata.accessservices.assetmanager.handlers.SchemaExchangeHandler; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.*; @@ -47,7 +48,8 @@ public class AssetManagerServicesInstance extends OMASServiceInstance private final InformalTagHandler informalTagHandler; private final LikeHandler likeHandler; private final RatingHandler ratingHandler; - private final CommentExchangeHandler commentHandler; + private final CommentExchangeHandler commentHandler; + private final NoteLogExchangeHandler noteLogHandler; /** * Set up the local repository connector that will service the REST Calls. @@ -290,6 +292,18 @@ public AssetManagerServicesInstance(OMRSRepositoryConnector repositoryConnector, defaultZones, publishZones, auditLog); + + this.noteLogHandler = new NoteLogExchangeHandler(serviceName, + serverName, + invalidParameterHandler, + repositoryHandler, + repositoryHelper, + localServerUserId, + securityVerifier, + supportedZones, + defaultZones, + publishZones, + auditLog); } @@ -532,4 +546,20 @@ CommentExchangeHandler getCommentHandler() throws PropertyServerException return commentHandler; } + + + /** + * Return the handler for managing notelogs and notes objects. + * + * @return handler object + * @throws PropertyServerException the instance has not been initialized successfully + */ + NoteLogExchangeHandler getNoteLogHandler() throws PropertyServerException + { + final String methodName = "getNoteLogHandler"; + + validateActiveRepository(methodName); + + return noteLogHandler; + } } diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/server/CollaborationExchangeRESTServices.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/server/CollaborationExchangeRESTServices.java index 7f00fe408c6..1e2b53f84b2 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/server/CollaborationExchangeRESTServices.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/server/CollaborationExchangeRESTServices.java @@ -3,12 +3,15 @@ package org.odpi.openmetadata.accessservices.assetmanager.server; import org.odpi.openmetadata.accessservices.assetmanager.handlers.CommentExchangeHandler; +import org.odpi.openmetadata.accessservices.assetmanager.handlers.NoteLogExchangeHandler; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.InformalTagElement; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.LikeElement; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.RatingElement; import org.odpi.openmetadata.accessservices.assetmanager.properties.CommentProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.FeedbackProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.LikeProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.NoteLogProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.NoteProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.RatingProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.StarRating; import org.odpi.openmetadata.accessservices.assetmanager.properties.TagProperties; @@ -18,16 +21,20 @@ import org.odpi.openmetadata.accessservices.assetmanager.rest.InformalTagResponse; import org.odpi.openmetadata.accessservices.assetmanager.rest.InformalTagUpdateRequestBody; import org.odpi.openmetadata.accessservices.assetmanager.rest.InformalTagsResponse; +import org.odpi.openmetadata.accessservices.assetmanager.rest.NameRequestBody; +import org.odpi.openmetadata.accessservices.assetmanager.rest.NoteElementResponse; +import org.odpi.openmetadata.accessservices.assetmanager.rest.NoteElementsResponse; +import org.odpi.openmetadata.accessservices.assetmanager.rest.NoteLogElementResponse; +import org.odpi.openmetadata.accessservices.assetmanager.rest.NoteLogElementsResponse; import org.odpi.openmetadata.accessservices.assetmanager.rest.ReferenceableUpdateRequestBody; import org.odpi.openmetadata.accessservices.assetmanager.rest.RelationshipRequestBody; +import org.odpi.openmetadata.accessservices.assetmanager.rest.SearchStringRequestBody; import org.odpi.openmetadata.commonservices.ffdc.RESTCallLogger; import org.odpi.openmetadata.commonservices.ffdc.RESTCallToken; import org.odpi.openmetadata.commonservices.ffdc.RESTExceptionHandler; import org.odpi.openmetadata.commonservices.ffdc.rest.GUIDListResponse; import org.odpi.openmetadata.commonservices.ffdc.rest.GUIDResponse; -import org.odpi.openmetadata.commonservices.ffdc.rest.NameRequestBody; import org.odpi.openmetadata.commonservices.ffdc.rest.NullRequestBody; -import org.odpi.openmetadata.commonservices.ffdc.rest.SearchStringRequestBody; import org.odpi.openmetadata.commonservices.ffdc.rest.VoidResponse; import org.odpi.openmetadata.commonservices.generichandlers.InformalTagHandler; import org.odpi.openmetadata.commonservices.generichandlers.LikeHandler; @@ -463,7 +470,6 @@ public GUIDResponse addCommentReply(String serverName, * PropertyServerException There is a problem updating the element properties in the metadata repository. * UserNotAuthorizedException the requesting user is not authorized to issue this request. */ - @SuppressWarnings(value = "unused") public VoidResponse updateComment(String serverName, String userId, String commentGUID, @@ -473,7 +479,6 @@ public VoidResponse updateComment(String serverName, boolean forDuplicateProcessing, ReferenceableUpdateRequestBody requestBody) { - final String guidParameterName = "commentGUID"; final String methodName = "updateComment"; RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); @@ -522,7 +527,6 @@ public VoidResponse updateComment(String serverName, } - /** * Link a comment that contains the best answer to a question posed in another comment. * @@ -622,7 +626,7 @@ public VoidResponse clearAcceptedAnswer(String serverName boolean forDuplicateProcessing, EffectiveTimeQueryRequestBody requestBody) { - final String methodName = "clearCategoryParent"; + final String methodName = "clearAcceptedAnswer"; RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); @@ -1532,4 +1536,841 @@ public GUIDListResponse getElementsByTag(String serverName, restCallLogger.logRESTCallReturn(token, response.toString()); return response; } + + + /* ===================================================================================================================== + * A note log maintains an ordered list of notes. It can be used to support release note, blogs and similar + * broadcast information. Notelogs are typically maintained by the owners/stewards of an element. + */ + + /** + * Create a new metadata element to represent a note log and attach it to an element (if supplied). + * Any supplied element becomes the note log's anchor, causing the note log to be deleted if/when the element is deleted. + * + * @param serverName name of the server instances for this request + * @param userId calling user + * @param assetManagerIsHome ensure that only the asset manager can update this element + * @param elementGUID unique identifier of the element where the note log is located + * @param isPublic is this element visible to other people. + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody properties to control the type of the request + * + * @return unique identifier of the new note log or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public GUIDResponse createNoteLog(String serverName, + String userId, + String elementGUID, + boolean assetManagerIsHome, + boolean isPublic, + boolean forLineage, + boolean forDuplicateProcessing, + ReferenceableUpdateRequestBody requestBody) + { + final String methodName = "createNoteLog"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + GUIDResponse response = new GUIDResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + if (requestBody != null) + { + if (requestBody.getElementProperties() instanceof NoteLogProperties properties) + { + NoteLogExchangeHandler handler = instanceHandler.getNoteLogHandler(userId, serverName, methodName); + + response.setGUID(handler.createNoteLog(userId, + elementGUID, + requestBody.getMetadataCorrelationProperties(), + assetManagerIsHome, + properties, + isPublic, + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), + methodName)); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(NoteLogProperties.class.getName(), methodName); + } + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Update the metadata element representing a note log. + * + * @param serverName name of the server instances for this request + * @param userId calling user + * @param noteLogGUID unique identifier of the metadata element to update + * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? + * @param isPublic is this element visible to other people. + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody new properties for the metadata element + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public VoidResponse updateNoteLog(String serverName, + String userId, + String noteLogGUID, + boolean isMergeUpdate, + boolean isPublic, + boolean forLineage, + boolean forDuplicateProcessing, + ReferenceableUpdateRequestBody requestBody) + { + final String methodName = "updateNoteLog"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + if (requestBody != null) + { + if (requestBody.getElementProperties() instanceof NoteLogProperties properties) + { + NoteLogExchangeHandler handler = instanceHandler.getNoteLogHandler(userId, serverName, methodName); + + handler.updateNoteLog(userId, + requestBody.getMetadataCorrelationProperties(), + noteLogGUID, + properties, + isMergeUpdate, + isPublic, + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), + methodName); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(NoteLogProperties.class.getName(), methodName); + } + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Remove the metadata element representing a note log. + * + * @param serverName name of the server instances for this request + * @param userId calling user + * @param noteLogGUID unique identifier of the metadata element to remove + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody properties to help with the mapping of the elements in the external asset manager and open metadata + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public VoidResponse removeNoteLog(String serverName, + String userId, + String noteLogGUID, + boolean forLineage, + boolean forDuplicateProcessing, + ReferenceableUpdateRequestBody requestBody) + { + final String methodName = "removeNoteLog"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + NoteLogExchangeHandler handler = instanceHandler.getNoteLogHandler(userId, serverName, methodName); + + if (requestBody != null) + { + handler.removeNoteLog(userId, + requestBody.getMetadataCorrelationProperties(), + noteLogGUID, + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), + methodName); + } + else + { + handler.removeNoteLog(userId, + null, + noteLogGUID, + forLineage, + forDuplicateProcessing, + null, + methodName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Retrieve the list of note log metadata elements that contain the search string. + * The search string is treated as a regular expression. + * + * @param serverName name of the server instances for this request + * @param userId calling user + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody string to find in the properties and correlators + * + * @return list of matching metadata elements or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public NoteLogElementsResponse findNoteLogs(String serverName, + String userId, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + SearchStringRequestBody requestBody) + { + final String methodName = "findNoteLogs"; + final String searchStringParameterName = "searchString"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + NoteLogElementsResponse response = new NoteLogElementsResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + if (requestBody != null) + { + NoteLogExchangeHandler handler = instanceHandler.getNoteLogHandler(userId, serverName, methodName); + + response.setElementList(handler.findNoteLogs(userId, + requestBody.getAssetManagerGUID(), + requestBody.getAssetManagerName(), + requestBody.getSearchString(), + searchStringParameterName, + startFrom, + pageSize, + requestBody.getEffectiveTime(), + forLineage, + forDuplicateProcessing, + methodName)); + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Retrieve the list of note log metadata elements with a matching qualified or display name. + * There are no wildcards supported on this request. + * + * @param serverName name of the server instances for this request + * @param userId calling user + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody name to search for and correlators + * + * @return list of matching metadata elements or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public NoteLogElementsResponse getNoteLogsByName(String serverName, + String userId, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + NameRequestBody requestBody) + { + final String methodName = "getNoteLogsByName"; + final String nameParameterName = "name"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + NoteLogElementsResponse response = new NoteLogElementsResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + if (requestBody != null) + { + NoteLogExchangeHandler handler = instanceHandler.getNoteLogHandler(userId, serverName, methodName); + + response.setElementList(handler.getNoteLogsByName(userId, + requestBody.getAssetManagerGUID(), + requestBody.getAssetManagerName(), + requestBody.getName(), + nameParameterName, + startFrom, + pageSize, + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), + methodName)); + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Retrieve the note log metadata element with the supplied unique identifier. + * + * @param serverName name of the server instances for this request + * @param userId calling user + * @param noteLogGUID unique identifier of the requested metadata element + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody correlators + * + * @return requested metadata element or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public NoteLogElementResponse getNoteLogByGUID(String serverName, + String userId, + String noteLogGUID, + boolean forLineage, + boolean forDuplicateProcessing, + EffectiveTimeQueryRequestBody requestBody) + { + final String methodName = "getNoteLogByGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + NoteLogElementResponse response = new NoteLogElementResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + if (requestBody != null) + { + NoteLogExchangeHandler handler = instanceHandler.getNoteLogHandler(userId, serverName, methodName); + + response.setElement(handler.getNoteLogByGUID(userId, + requestBody.getAssetManagerGUID(), + requestBody.getAssetManagerName(), + noteLogGUID, + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), + methodName)); + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /* =============================================================================== + * A element typically contains many notes, linked with relationships. + */ + + /** + * Create a new metadata element to represent a note. + * + * @param serverName name of the server instances for this request + * @param userId calling user + * @param assetManagerIsHome ensure that only the asset manager can update this element + * @param noteLogGUID unique identifier of the element where the note is located + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody properties to help with the mapping of the elements in the external asset manager and open metadata + * + * @return unique identifier of the new metadata element for the note or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public GUIDResponse createNote(String serverName, + String userId, + boolean assetManagerIsHome, + String noteLogGUID, + boolean forLineage, + boolean forDuplicateProcessing, + ReferenceableUpdateRequestBody requestBody) + { + final String methodName = "createNote"; + + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + GUIDResponse response = new GUIDResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + if (requestBody != null) + { + if (requestBody.getElementProperties() instanceof NoteProperties properties) + { + NoteLogExchangeHandler handler = instanceHandler.getNoteLogHandler(userId, serverName, methodName); + + response.setGUID(handler.createNote(userId, + noteLogGUID, + requestBody.getMetadataCorrelationProperties(), + assetManagerIsHome, + properties, + requestBody.getEffectiveTime(), + forLineage, + forDuplicateProcessing, + methodName)); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(NoteProperties.class.getName(), methodName); + } + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Update the properties of the metadata element representing a note. + * + * @param userId calling user + * @param serverName name of the server instances for this request + * @param noteGUID unique identifier of the note to update + * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody properties to help with the mapping of the elements in the external asset manager and open metadata + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public VoidResponse updateNote(String serverName, + String userId, + String noteGUID, + boolean isMergeUpdate, + boolean forLineage, + boolean forDuplicateProcessing, + ReferenceableUpdateRequestBody requestBody) + { + final String methodName = "updateNote"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + if (requestBody != null) + { + if (requestBody.getElementProperties() instanceof NoteProperties properties) + { + NoteLogExchangeHandler handler = instanceHandler.getNoteLogHandler(userId, serverName, methodName); + + handler.updateNote(userId, + requestBody.getMetadataCorrelationProperties(), + noteGUID, + properties, + isMergeUpdate, + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), + methodName); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(NoteProperties.class.getName(), methodName); + } + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Remove the metadata element representing a note. + * + * @param serverName name of the server instances for this request + * @param userId calling user + * @param noteGUID unique identifier of the metadata element to remove + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody properties to help with the mapping of the elements in the external asset manager and open metadata + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public VoidResponse removeNote(String serverName, + String userId, + String noteGUID, + boolean forLineage, + boolean forDuplicateProcessing, + ReferenceableUpdateRequestBody requestBody) + { + final String methodName = "removeNote"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + NoteLogExchangeHandler handler = instanceHandler.getNoteLogHandler(userId, serverName, methodName); + + if (requestBody != null) + { + handler.removeNote(userId, + requestBody.getMetadataCorrelationProperties(), + noteGUID, + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), methodName); + } + else + { + handler.removeNote(userId, + null, + noteGUID, + forLineage, + forDuplicateProcessing, + null, + methodName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Retrieve the list of note metadata elements that contain the search string. + * The search string is treated as a regular expression. + * + * @param serverName name of the server instances for this request + * @param userId calling user + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody string to find in the properties and correlators + * + * @return list of matching metadata elements or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public NoteElementsResponse findNotes(String serverName, + String userId, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + SearchStringRequestBody requestBody) + { + final String methodName = "findNotes"; + final String searchStringParameterName = "searchString"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + NoteElementsResponse response = new NoteElementsResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + if (requestBody != null) + { + NoteLogExchangeHandler handler = instanceHandler.getNoteLogHandler(userId, serverName, methodName); + + response.setElementList(handler.findNotes(userId, + requestBody.getAssetManagerGUID(), + requestBody.getAssetManagerName(), + requestBody.getSearchString(), + searchStringParameterName, + startFrom, + pageSize, + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), + methodName)); + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Retrieve the list of notes associated with a note log. + * + * @param serverName name of the server instances for this request + * @param userId calling user + * @param noteLogGUID unique identifier of the note log of interest + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody asset manager identifiers + * + * @return list of associated metadata elements or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public NoteElementsResponse getNotesForNoteLog(String serverName, + String userId, + String noteLogGUID, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + EffectiveTimeQueryRequestBody requestBody) + { + final String methodName = "getNotesForNoteLog"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + NoteElementsResponse response = new NoteElementsResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + if (requestBody != null) + { + NoteLogExchangeHandler handler = instanceHandler.getNoteLogHandler(userId, serverName, methodName); + + response.setElementList(handler.getNotesForNoteLog(userId, + requestBody.getAssetManagerGUID(), + requestBody.getAssetManagerName(), + noteLogGUID, + startFrom, + pageSize, + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), + methodName)); + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Retrieve the note metadata element with the supplied unique identifier. + * + * @param serverName name of the server instances for this request + * @param userId calling user + * @param noteGUID unique identifier of the requested metadata element + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody asset manager identifiers + * + * @return matching metadata element or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public NoteElementResponse getNoteByGUID(String serverName, + String userId, + String noteGUID, + boolean forLineage, + boolean forDuplicateProcessing, + EffectiveTimeQueryRequestBody requestBody) + { + final String methodName = "getNoteByGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + NoteElementResponse response = new NoteElementResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + if (requestBody != null) + { + NoteLogExchangeHandler handler = instanceHandler.getNoteLogHandler(userId, serverName, methodName); + + response.setElement(handler.getNoteByGUID(userId, + requestBody.getAssetManagerGUID(), + requestBody.getAssetManagerName(), + noteGUID, + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), + methodName)); + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } } \ No newline at end of file diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/server/GlossaryExchangeRESTServices.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/server/GlossaryExchangeRESTServices.java index f0c1ab98390..0e3432a2816 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/server/GlossaryExchangeRESTServices.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/server/GlossaryExchangeRESTServices.java @@ -1420,6 +1420,7 @@ public VoidResponse removeGlossaryCategory(String server ReferenceableUpdateRequestBody requestBody) { final String methodName = "removeGlossaryCategory"; + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); VoidResponse response = new VoidResponse(); @@ -2143,7 +2144,6 @@ public VoidResponse updateGlossaryTerm(String serverName { GlossaryExchangeHandler handler = instanceHandler.getGlossaryExchangeHandler(userId, serverName, methodName); - handler.updateGlossaryTerm(userId, requestBody.getMetadataCorrelationProperties(), glossaryTermGUID, diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-spring/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/server/spring/CollaborationExchangeResource.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-spring/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/server/spring/CollaborationExchangeResource.java index ea426f576d8..4284fbb97c8 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-spring/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/server/spring/CollaborationExchangeResource.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-spring/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/server/spring/CollaborationExchangeResource.java @@ -15,13 +15,18 @@ import org.odpi.openmetadata.accessservices.assetmanager.rest.InformalTagResponse; import org.odpi.openmetadata.accessservices.assetmanager.rest.InformalTagUpdateRequestBody; import org.odpi.openmetadata.accessservices.assetmanager.rest.InformalTagsResponse; +import org.odpi.openmetadata.accessservices.assetmanager.rest.NameRequestBody; +import org.odpi.openmetadata.accessservices.assetmanager.rest.NoteElementResponse; +import org.odpi.openmetadata.accessservices.assetmanager.rest.NoteElementsResponse; +import org.odpi.openmetadata.accessservices.assetmanager.rest.NoteLogElementResponse; +import org.odpi.openmetadata.accessservices.assetmanager.rest.NoteLogElementsResponse; import org.odpi.openmetadata.accessservices.assetmanager.rest.ReferenceableUpdateRequestBody; +import org.odpi.openmetadata.accessservices.assetmanager.rest.RelationshipRequestBody; +import org.odpi.openmetadata.accessservices.assetmanager.rest.SearchStringRequestBody; import org.odpi.openmetadata.accessservices.assetmanager.server.CollaborationExchangeRESTServices; import org.odpi.openmetadata.commonservices.ffdc.rest.GUIDListResponse; import org.odpi.openmetadata.commonservices.ffdc.rest.GUIDResponse; -import org.odpi.openmetadata.commonservices.ffdc.rest.NameRequestBody; import org.odpi.openmetadata.commonservices.ffdc.rest.NullRequestBody; -import org.odpi.openmetadata.commonservices.ffdc.rest.SearchStringRequestBody; import org.odpi.openmetadata.commonservices.ffdc.rest.VoidResponse; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; @@ -694,6 +699,82 @@ public VoidResponse updateComment(@PathVariable String } + /** + * Link a comment that contains the best answer to a question posed in another comment. + * + * @param serverName name of the server to route the request to + * @param userId calling user + * @param questionCommentGUID unique identifier of the comment containing the question + * @param answerCommentGUID unique identifier of the comment containing the accepted answer + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody properties to help with the mapping of the elements in the external asset manager and open metadata + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping("/comments/questions/{questionCommentGUID}/answers/{answerCommentGUID}") + + public VoidResponse setupAcceptedAnswer(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String questionCommentGUID, + @PathVariable String answerCommentGUID, + @RequestParam (required = false, defaultValue = "false") + boolean forLineage, + @RequestParam (required = false, defaultValue = "false") + boolean forDuplicateProcessing, + @RequestBody RelationshipRequestBody requestBody) + { + return restAPI.setupAcceptedAnswer(serverName, + userId, + questionCommentGUID, + answerCommentGUID, + forLineage, + forDuplicateProcessing, + requestBody); + } + + + /** + * Unlink a comment that contains an answer to a question posed in another comment. + * + * @param serverName name of the server to route the request to + * @param userId calling user + * @param questionCommentGUID unique identifier of the comment containing the question + * @param answerCommentGUID unique identifier of the comment containing the accepted answer + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody properties to help with the mapping of the elements in the external asset manager and open metadata + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping("/comments/questions/{questionCommentGUID}/answers/{answerCommentGUID}/remove") + + public VoidResponse clearAcceptedAnswer(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String questionCommentGUID, + @PathVariable String answerCommentGUID, + @RequestParam (required = false, defaultValue = "false") + boolean forLineage, + @RequestParam (required = false, defaultValue = "false") + boolean forDuplicateProcessing, + @RequestBody EffectiveTimeQueryRequestBody requestBody) + { + return restAPI.clearAcceptedAnswer(serverName, + userId, + questionCommentGUID, + answerCommentGUID, + forLineage, + forDuplicateProcessing, + requestBody); + } + + /** * Updates the description of an existing tag (either private or public). * @@ -714,11 +795,418 @@ public VoidResponse updateComment(@PathVariable String externalDocs=@ExternalDocumentation(description="Informal Tag", url="https://egeria-project.org/concepts/informal-tag/")) - public VoidResponse updateTagDescription(@PathVariable String serverName, - @PathVariable String userId, - @PathVariable String tagGUID, - @RequestBody InformalTagUpdateRequestBody requestBody) + public VoidResponse updateTagDescription(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String tagGUID, + @RequestBody InformalTagUpdateRequestBody requestBody) { return restAPI.updateTagDescription(serverName, userId, tagGUID, requestBody); } + + + + /* ===================================================================================================================== + * A note log maintains an ordered list of notes. It can be used to support release note, blogs and similar + * broadcast information. Notelogs are typically maintained by the owners/stewards of an element. + */ + + /** + * Create a new metadata element to represent a note log and attach it to an element (if supplied). + * Any supplied element becomes the note log's anchor, causing the note log to be deleted if/when the element is deleted. + * + * @param serverName name of the server instances for this request + * @param userId calling user + * @param assetManagerIsHome ensure that only the asset manager can update this element + * @param elementGUID unique identifier of the element where the note log is located + * @param isPublic is this element visible to other people. + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody properties to control the type of the request + * + * @return unique identifier of the new note log or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping("/elements/{elementGUID}/note-logs") + + public GUIDResponse createNoteLog(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String elementGUID, + @RequestParam (required = false, defaultValue = "false") + boolean assetManagerIsHome, + @RequestParam (required = false, defaultValue = "true") + boolean isPublic, + @RequestParam (required = false, defaultValue = "false") + boolean forLineage, + @RequestParam (required = false, defaultValue = "false") + boolean forDuplicateProcessing, + @RequestBody ReferenceableUpdateRequestBody requestBody) + { + return restAPI.createNoteLog(serverName, userId, elementGUID, assetManagerIsHome, isPublic, forLineage, forDuplicateProcessing, requestBody); + } + + + /** + * Update the metadata element representing a note log. + * + * @param serverName name of the server instances for this request + * @param userId calling user + * @param noteLogGUID unique identifier of the metadata element to update + * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? + * @param isPublic is this element visible to other people. + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody new properties for the metadata element + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping("/note-logs/{noteLogGUID}/update") + + public VoidResponse updateNoteLog(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String noteLogGUID, + @RequestParam (required = false, defaultValue = "false") + boolean isMergeUpdate, + @RequestParam (required = false, defaultValue = "true") + boolean isPublic, + @RequestParam (required = false, defaultValue = "false") + boolean forLineage, + @RequestParam (required = false, defaultValue = "false") + boolean forDuplicateProcessing, + @RequestBody ReferenceableUpdateRequestBody requestBody) + { + return restAPI.updateNoteLog(serverName, userId, noteLogGUID, isMergeUpdate, isPublic, forLineage, forDuplicateProcessing, requestBody); + } + + + /** + * Remove the metadata element representing a note log. + * + * @param serverName name of the server instances for this request + * @param userId calling user + * @param noteLogGUID unique identifier of the metadata element to remove + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody properties to help with the mapping of the elements in the external asset manager and open metadata + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping("/note-logs/{noteLogGUID}/remove") + + public VoidResponse removeNoteLog(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String noteLogGUID, + @RequestParam (required = false, defaultValue = "false") + boolean forLineage, + @RequestParam (required = false, defaultValue = "false") + boolean forDuplicateProcessing, + @RequestBody(required = false) + ReferenceableUpdateRequestBody requestBody) + { + return restAPI.removeNoteLog(serverName, userId, noteLogGUID, forLineage, forDuplicateProcessing, requestBody); + } + + + /** + * Retrieve the list of note log metadata elements that contain the search string. + * The search string is treated as a regular expression. + * + * @param serverName name of the server instances for this request + * @param userId calling user + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody string to find in the properties and correlators + * + * @return list of matching metadata elements or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping("/note-logs/by-search-string") + + public NoteLogElementsResponse findNoteLogs(@PathVariable String serverName, + @PathVariable String userId, + @RequestParam int startFrom, + @RequestParam int pageSize, + @RequestParam (required = false, defaultValue = "false") + boolean forLineage, + @RequestParam (required = false, defaultValue = "false") + boolean forDuplicateProcessing, + @RequestBody SearchStringRequestBody requestBody) + { + return restAPI.findNoteLogs(serverName, userId, startFrom, pageSize, forLineage, forDuplicateProcessing, requestBody); + } + + + /** + * Retrieve the list of note log metadata elements with a matching qualified or display name. + * There are no wildcards supported on this request. + * + * @param serverName name of the server instances for this request + * @param userId calling user + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody name to search for and correlators + * + * @return list of matching metadata elements or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping("/note-logs/by-name") + + public NoteLogElementsResponse getNoteLogsByName(@PathVariable String serverName, + @PathVariable String userId, + @RequestParam int startFrom, + @RequestParam int pageSize, + @RequestParam (required = false, defaultValue = "false") + boolean forLineage, + @RequestParam (required = false, defaultValue = "false") + boolean forDuplicateProcessing, + @RequestBody NameRequestBody requestBody) + { + return restAPI.getNoteLogsByName(serverName, userId, startFrom, pageSize, forLineage, forDuplicateProcessing, requestBody); + } + + + /** + * Retrieve the note log metadata element with the supplied unique identifier. + * + * @param serverName name of the server instances for this request + * @param userId calling user + * @param noteLogGUID unique identifier of the requested metadata element + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody properties to help with the mapping of the elements in the external asset manager and open metadata + * + * @return requested metadata element or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping("/note-logs/{noteLogGUID}/retrieve") + + public NoteLogElementResponse getNoteLogByGUID(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String noteLogGUID, + @RequestParam (required = false, defaultValue = "false") + boolean forLineage, + @RequestParam (required = false, defaultValue = "false") + boolean forDuplicateProcessing, + @RequestBody(required = false) + EffectiveTimeQueryRequestBody requestBody) + { + return restAPI.getNoteLogByGUID(serverName, userId, noteLogGUID, forLineage, forDuplicateProcessing, requestBody); + } + + + /* =============================================================================== + * A element typically contains many notes, linked with relationships. + */ + + /** + * Create a new metadata element to represent a note. + * + * @param serverName name of the server instances for this request + * @param userId calling user + * @param assetManagerIsHome ensure that only the asset manager can update this element + * @param noteLogGUID unique identifier of the element where the note is located + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody properties to help with the mapping of the elements in the external asset manager and open metadata + * + * @return unique identifier of the new metadata element for the note or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping("/note-logs/{noteLogGUID}/notes") + + public GUIDResponse createNote(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String noteLogGUID, + @RequestParam (required = false, defaultValue = "false") + boolean assetManagerIsHome, + @RequestParam (required = false, defaultValue = "false") + boolean forLineage, + @RequestParam (required = false, defaultValue = "false") + boolean forDuplicateProcessing, + @RequestBody ReferenceableUpdateRequestBody requestBody) + { + return restAPI.createNote(serverName, userId, assetManagerIsHome, noteLogGUID, forLineage, forDuplicateProcessing, requestBody); + } + + + /** + * Update the properties of the metadata element representing a note. + * + * @param userId calling user + * @param serverName name of the server instances for this request + * @param noteGUID unique identifier of the note to update + * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody properties to help with the mapping of the elements in the external asset manager and open metadata + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping("/note-logs/notes/{noteGUID}/update") + + public VoidResponse updateNote(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String noteGUID, + @RequestParam (required = false, defaultValue = "false") + boolean isMergeUpdate, + @RequestParam (required = false, defaultValue = "false") + boolean forLineage, + @RequestParam (required = false, defaultValue = "false") + boolean forDuplicateProcessing, + @RequestBody ReferenceableUpdateRequestBody requestBody) + { + return restAPI.updateNote(serverName, userId, noteGUID, isMergeUpdate, forLineage, forDuplicateProcessing, requestBody); + } + + + /** + * Remove the metadata element representing a note. + * + * @param serverName name of the server instances for this request + * @param userId calling user + * @param noteGUID unique identifier of the metadata element to remove + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody properties to help with the mapping of the elements in the external asset manager and open metadata + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping("/note-logs/notes/{noteGUID}/remove") + + public VoidResponse removeNote(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String noteGUID, + @RequestParam (required = false, defaultValue = "false") + boolean forLineage, + @RequestParam (required = false, defaultValue = "false") + boolean forDuplicateProcessing, + @RequestBody(required = false) + ReferenceableUpdateRequestBody requestBody) + { + return restAPI.removeNote(serverName, userId, noteGUID, forLineage, forDuplicateProcessing, requestBody); + } + + + /** + * Retrieve the list of note metadata elements that contain the search string. + * The search string is treated as a regular expression. + * + * @param serverName name of the server instances for this request + * @param userId calling user + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody string to find in the properties and correlators + * + * @return list of matching metadata elements or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping("/note-logs/notes/by-search-string") + + public NoteElementsResponse findNotes(@PathVariable String serverName, + @PathVariable String userId, + @RequestParam int startFrom, + @RequestParam int pageSize, + @RequestParam (required = false, defaultValue = "false") + boolean forLineage, + @RequestParam (required = false, defaultValue = "false") + boolean forDuplicateProcessing, + @RequestBody SearchStringRequestBody requestBody) + { + return restAPI.findNotes(serverName, userId, startFrom, pageSize, forLineage, forDuplicateProcessing, requestBody); + } + + + /** + * Retrieve the list of notes associated with a note log. + * + * @param serverName name of the server instances for this request + * @param userId calling user + * @param noteLogGUID unique identifier of the note log of interest + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody asset manager identifiers + * + * @return list of associated metadata elements or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping("/note-logs/{noteLogGUID}/notes/retrieve") + + public NoteElementsResponse getNotesForNoteLog(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String noteLogGUID, + @RequestParam int startFrom, + @RequestParam int pageSize, + @RequestParam (required = false, defaultValue = "false") + boolean forLineage, + @RequestParam (required = false, defaultValue = "false") + boolean forDuplicateProcessing, + @RequestBody(required = false) + EffectiveTimeQueryRequestBody requestBody) + { + return restAPI.getNotesForNoteLog(serverName, userId, noteLogGUID, startFrom, pageSize, forLineage, forDuplicateProcessing, requestBody); + } + + + /** + * Retrieve the note metadata element with the supplied unique identifier. + * + * @param serverName name of the server instances for this request + * @param userId calling user + * @param noteGUID unique identifier of the requested metadata element + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody asset manager identifiers + * + * @return matching metadata element or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping("/note-logs/notes/{noteGUID}/retrieve") + + public NoteElementResponse getNoteByGUID(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String noteGUID, + @RequestParam (required = false, defaultValue = "false") + boolean forLineage, + @RequestParam (required = false, defaultValue = "false") + boolean forDuplicateProcessing, + @RequestBody(required = false) + EffectiveTimeQueryRequestBody requestBody) + { + return restAPI.getNoteByGUID(serverName, userId, noteGUID, forLineage, forDuplicateProcessing, requestBody); + } } diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/NoteHandler.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/NoteHandler.java index 3355512ba83..d8f8d111c47 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/NoteHandler.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/NoteHandler.java @@ -94,8 +94,8 @@ public int countAttachedNotes(String userId, return super.countAttachments(userId, elementGUID, OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, - OpenMetadataAPIMapper.NOTE_ENTRY_TYPE_GUID, - OpenMetadataAPIMapper.NOTE_ENTRY_TYPE_NAME, + OpenMetadataAPIMapper.NOTE_TYPE_GUID, + OpenMetadataAPIMapper.NOTE_TYPE_NAME, 2, forLineage, forDuplicateProcessing, @@ -459,4 +459,50 @@ public List getNotes(String userId, effectiveTime, methodName); } + + /** + * Retrieve the list of metadata elements that contain the search string. + * The search string is treated as a regular expression. + * + * @param userId calling user + * @param searchString string to find in the properties + * @param searchStringParameterName name of parameter supplying the search string + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * + * @return list of matching metadata elements + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public List findNotes(String userId, + String searchString, + String searchStringParameterName, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return this.findBeans(userId, + searchString, + searchStringParameterName, + OpenMetadataAPIMapper.NOTE_TYPE_GUID, + OpenMetadataAPIMapper.NOTE_TYPE_NAME, + null, + startFrom, + pageSize, + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); + } } diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/NoteLogHandler.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/NoteLogHandler.java index 0408ae2d3d6..4bcde092369 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/NoteLogHandler.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/NoteLogHandler.java @@ -13,6 +13,7 @@ import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship; import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSRepositoryHelper; +import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.UUID; @@ -448,7 +449,7 @@ public List getAttachedNoteLogs(String userId, elementGUID, elementGUIDParameterName, elementTypeName, - OpenMetadataAPIMapper.REFERENCEABLE_TO_NOTE_LOG_TYPE_NAME, + OpenMetadataAPIMapper.REFERENCEABLE_TO_NOTE_LOG_TYPE_GUID, OpenMetadataAPIMapper.REFERENCEABLE_TO_NOTE_LOG_TYPE_NAME, OpenMetadataAPIMapper.NOTE_LOG_TYPE_NAME, null, @@ -503,7 +504,7 @@ public List getAttachedNoteLogs(String userId, elementGUID, elementGUIDParameterName, elementTypeName, - OpenMetadataAPIMapper.REFERENCEABLE_TO_NOTE_LOG_TYPE_NAME, + OpenMetadataAPIMapper.REFERENCEABLE_TO_NOTE_LOG_TYPE_GUID, OpenMetadataAPIMapper.REFERENCEABLE_TO_NOTE_LOG_TYPE_NAME, OpenMetadataAPIMapper.NOTE_LOG_TYPE_NAME, null, @@ -517,4 +518,108 @@ public List getAttachedNoteLogs(String userId, effectiveTime, methodName); } + + + /** + * Retrieve the list of metadata elements that contain the search string. + * The search string is treated as a regular expression. + * + * @param userId calling user + * @param searchString string to find in the properties + * @param searchStringParameterName name of parameter supplying the search string + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * + * @return list of matching metadata elements + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public List findNoteLogs(String userId, + String searchString, + String searchStringParameterName, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return this.findBeans(userId, + searchString, + searchStringParameterName, + OpenMetadataAPIMapper.NOTE_LOG_TYPE_GUID, + OpenMetadataAPIMapper.NOTE_LOG_TYPE_NAME, + null, + startFrom, + pageSize, + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); + } + + + /** + * Retrieve the list of metadata elements with a matching qualified name, display name or network address. + * There are no wildcards supported on this request. + * + * @param userId calling user + * @param name name to search for + * @param nameParameterName parameter supplying name + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * + * @return list of matching metadata elements + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public List getNoteLogsByName(String userId, + String name, + String nameParameterName, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + List specificMatchPropertyNames = new ArrayList<>(); + specificMatchPropertyNames.add(OpenMetadataAPIMapper.QUALIFIED_NAME_PROPERTY_NAME); + specificMatchPropertyNames.add(OpenMetadataAPIMapper.NAME_PROPERTY_NAME); + + return this.getBeansByValue(userId, + name, + nameParameterName, + OpenMetadataAPIMapper.NOTE_LOG_TYPE_GUID, + OpenMetadataAPIMapper.NOTE_LOG_TYPE_NAME, + specificMatchPropertyNames, + true, + null, + null, + forLineage, + forDuplicateProcessing, + supportedZones, + null, + startFrom, + pageSize, + effectiveTime, + methodName); + } + } diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/OpenMetadataAPIMapper.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/OpenMetadataAPIMapper.java index 9bc68bbc698..9032a656f58 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/OpenMetadataAPIMapper.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/OpenMetadataAPIMapper.java @@ -835,10 +835,6 @@ public class OpenMetadataAPIMapper public static final String NOTE_LOG_ENTRIES_RELATIONSHIP_TYPE_NAME = "AttachedNoteLogEntry"; /* End1 = NoteLog; End 2 = NoteEntry */ - public static final String NOTE_ENTRY_TYPE_GUID = "2a84d94c-ac6f-4be1-a72a-07dcec7b1fe3"; - public static final String NOTE_ENTRY_TYPE_NAME = "NoteEntry"; /* from Area 1 */ - /* Referenceable */ - /* Added warning suppression for SonarCloud since the below constants contain the pattern @@ -858,7 +854,7 @@ public class OpenMetadataAPIMapper public static final String NOTE_LOG_AUTHOR_TYPE_NAME = "NoteLogAuthor"; /* from Area 1 */ /* PersonRole */ - public static final String NOTE_TYPE_GUID = "646727c7-9ad4-46fa-b660-265489ad96c6"; + public static final String NOTE_TYPE_GUID = "2a84d94c-ac6f-4be1-a72a-07dcec7b1fe3"; public static final String NOTE_TYPE_NAME = "NoteEntry"; /* from Area 1 */ /* Referenceable */ diff --git a/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/catalog/connector/CatalogIntegratorContext.java b/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/catalog/connector/CatalogIntegratorContext.java index 67b991419b2..8f8934aa347 100644 --- a/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/catalog/connector/CatalogIntegratorContext.java +++ b/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/catalog/connector/CatalogIntegratorContext.java @@ -117,19 +117,19 @@ public CatalogIntegratorContext(String connectorId, String serverName, OpenIntegrationClient openIntegrationClient, OpenMetadataClient openMetadataStoreClient, - ExternalAssetManagerClient assetManagerClient, + ExternalAssetManagerClient assetManagerClient, AssetManagerEventClient eventClient, ConnectedAssetClient connectedAssetClient, - CollaborationExchangeClient collaborationExchangeClient, - ConnectionExchangeClient connectionExchangeClient, - DataAssetExchangeClient dataAssetExchangeClient, + CollaborationExchangeClient collaborationExchangeClient, + ConnectionExchangeClient connectionExchangeClient, + DataAssetExchangeClient dataAssetExchangeClient, ExternalReferenceExchangeClient externalReferenceExchangeClient, - GlossaryExchangeClient glossaryExchangeClient, - GovernanceExchangeClient governanceExchangeClient, - InfrastructureExchangeClient infrastructureExchangeClient, - LineageExchangeClient lineageExchangeClient, - StewardshipExchangeClient stewardshipExchangeClient, - ValidValuesExchangeClient validValuesExchangeClient, + GlossaryExchangeClient glossaryExchangeClient, + GovernanceExchangeClient governanceExchangeClient, + InfrastructureExchangeClient infrastructureExchangeClient, + LineageExchangeClient lineageExchangeClient, + StewardshipExchangeClient stewardshipExchangeClient, + ValidValuesExchangeClient validValuesExchangeClient, boolean generateIntegrationReport, PermittedSynchronization permittedSynchronization, String integrationConnectorGUID, diff --git a/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/catalog/connector/CollaborationExchangeService.java b/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/catalog/connector/CollaborationExchangeService.java index adcec33ab01..c71f4a2c6d9 100644 --- a/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/catalog/connector/CollaborationExchangeService.java +++ b/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/catalog/connector/CollaborationExchangeService.java @@ -36,12 +36,12 @@ public class CollaborationExchangeService * @param auditLog logging destination */ CollaborationExchangeService(CollaborationExchangeClient collaborationExchangeClient, - SynchronizationDirection synchronizationDirection, - String userId, - String assetManagerGUID, - String assetManagerName, - String connectorName, - AuditLog auditLog) + SynchronizationDirection synchronizationDirection, + String userId, + String assetManagerGUID, + String assetManagerName, + String connectorName, + AuditLog auditLog) { this.collaborationExchangeClient = collaborationExchangeClient; this.synchronizationDirection = synchronizationDirection; diff --git a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/ffdc/OMRSErrorCode.java b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/ffdc/OMRSErrorCode.java index 831ecf77ecf..bf16a2400b5 100644 --- a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/ffdc/OMRSErrorCode.java +++ b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/ffdc/OMRSErrorCode.java @@ -793,7 +793,7 @@ public enum OMRSErrorCode implements ExceptionMessageSet "Raise a Github issue so that this can be fixed."), UNKNOWN_TYPEDEF(500, "OMRS-CONTENT-MANAGER-500-005", "The repository content manager has detected an unknown TypeDef {0} ({1}) from {2}. It was passed to method {3} via parameters {4} and {5}", - "There is an internal problem in the Open Metadata Ecosystem code or its callers because an invalid unique identifier, or name off a type has been passed to the Open Metadata Repository Services (OMRS).", + "There is an internal problem in the Open Metadata Ecosystem code or its callers because an invalid unique identifier, or name of a type has been passed to the Open Metadata Repository Services (OMRS).", "Trace the caller of the request to determine where the type information was specified. If the error is in the Egeria code, or you need help from the community, raise a Github issue so this can be addressed."), ARCHIVE_UNAVAILABLE(500, "OMRS-OPEN-METADATA-ARCHIVE-500-001", "The archive builder failed to initialize.", diff --git a/open-metadata-implementation/view-services/README.md b/open-metadata-implementation/view-services/README.md index 8c2eeee9393..f87fbad3234 100644 --- a/open-metadata-implementation/view-services/README.md +++ b/open-metadata-implementation/view-services/README.md @@ -1,7 +1,6 @@ -![InDev](../../images/egeria-content-status-in-development.png#pagewidth) # Open Metadata View Services (OMVS) diff --git a/open-metadata-implementation/view-services/glossary-browser/README.md b/open-metadata-implementation/view-services/glossary-browser/README.md index 069b6090293..267841675d5 100644 --- a/open-metadata-implementation/view-services/glossary-browser/README.md +++ b/open-metadata-implementation/view-services/glossary-browser/README.md @@ -6,6 +6,7 @@ The Glossary Workflow OMVS enables the caller to create glossary terms and organize them into categories as part of a controlled workflow process. It supports the editing glossary and multiple states. +Link to documentation: [https://egeria-project.org/services/omvs/glossary-browser/overview/](https://egeria-project.org/services/omvs/glossary-browser/overview/) ---- License: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), diff --git a/open-metadata-implementation/view-services/glossary-browser/glossary-browser-server/src/main/java/org/odpi/openmetadata/viewservices/glossarybrowser/server/GlossaryBrowserInstanceHandler.java b/open-metadata-implementation/view-services/glossary-browser/glossary-browser-server/src/main/java/org/odpi/openmetadata/viewservices/glossarybrowser/server/GlossaryBrowserInstanceHandler.java index f8a83a5d675..29aaf74e3db 100644 --- a/open-metadata-implementation/view-services/glossary-browser/glossary-browser-server/src/main/java/org/odpi/openmetadata/viewservices/glossarybrowser/server/GlossaryBrowserInstanceHandler.java +++ b/open-metadata-implementation/view-services/glossary-browser/glossary-browser-server/src/main/java/org/odpi/openmetadata/viewservices/glossarybrowser/server/GlossaryBrowserInstanceHandler.java @@ -149,8 +149,8 @@ else if (endsWith) * @throws UserNotAuthorizedException User not authorized to call this service * @throws PropertyServerException internal error */ - public GlossaryManagementClient getGlossaryManagementClient(String serverName, - String userId, + public GlossaryManagementClient getGlossaryManagementClient(String userId, + String serverName, String serviceOperationName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException diff --git a/open-metadata-implementation/view-services/glossary-workflow/README.md b/open-metadata-implementation/view-services/glossary-workflow/README.md index 069b6090293..7744fa8e9e1 100644 --- a/open-metadata-implementation/view-services/glossary-workflow/README.md +++ b/open-metadata-implementation/view-services/glossary-workflow/README.md @@ -6,6 +6,7 @@ The Glossary Workflow OMVS enables the caller to create glossary terms and organize them into categories as part of a controlled workflow process. It supports the editing glossary and multiple states. +Link to documentation: [https://egeria-project.org/services/omvs/glossary-workflow/overview/](https://egeria-project.org/services/omvs/glossary-workflow/overview/) ---- License: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), diff --git a/open-metadata-implementation/view-services/glossary-workflow/glossary-workflow-server/src/main/java/org/odpi/openmetadata/viewservices/glossaryworkflow/server/GlossaryWorkflowInstanceHandler.java b/open-metadata-implementation/view-services/glossary-workflow/glossary-workflow-server/src/main/java/org/odpi/openmetadata/viewservices/glossaryworkflow/server/GlossaryWorkflowInstanceHandler.java index 4617985624d..58d5ee51c5b 100644 --- a/open-metadata-implementation/view-services/glossary-workflow/glossary-workflow-server/src/main/java/org/odpi/openmetadata/viewservices/glossaryworkflow/server/GlossaryWorkflowInstanceHandler.java +++ b/open-metadata-implementation/view-services/glossary-workflow/glossary-workflow-server/src/main/java/org/odpi/openmetadata/viewservices/glossaryworkflow/server/GlossaryWorkflowInstanceHandler.java @@ -41,8 +41,8 @@ public GlossaryWorkflowInstanceHandler() * @throws UserNotAuthorizedException User not authorized to call this service * @throws PropertyServerException internal error */ - public GlossaryManagementClient getGlossaryManagementClient(String serverName, - String userId, + public GlossaryManagementClient getGlossaryManagementClient(String userId, + String serverName, String serviceOperationName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException diff --git a/open-metadata-implementation/view-services/glossary-workflow/glossary-workflow-spring/src/main/java/org/odpi/openmetadata/viewservices/glossaryworkflow/server/spring/GlossaryWorkflowResource.java b/open-metadata-implementation/view-services/glossary-workflow/glossary-workflow-spring/src/main/java/org/odpi/openmetadata/viewservices/glossaryworkflow/server/spring/GlossaryWorkflowResource.java index b48a3256b63..48ea8bb2717 100644 --- a/open-metadata-implementation/view-services/glossary-workflow/glossary-workflow-spring/src/main/java/org/odpi/openmetadata/viewservices/glossaryworkflow/server/spring/GlossaryWorkflowResource.java +++ b/open-metadata-implementation/view-services/glossary-workflow/glossary-workflow-spring/src/main/java/org/odpi/openmetadata/viewservices/glossaryworkflow/server/spring/GlossaryWorkflowResource.java @@ -39,7 +39,10 @@ @RestController @RequestMapping("/servers/{serverName}/open-metadata/view-services/glossary-workflow/users/{userId}") -@Tag(name="Glossary Workflow OMVS", description=".", externalDocs=@ExternalDocumentation(description="Glossary Workflow Open Metadata View Service (OMVS)",url="https://egeria-project.org/services/omvs/glossary-workflow/overview/")) +@Tag(name="Glossary Workflow OMVS", + description="The Glossary Workflow OMVS enables the caller to create glossary terms and organize them into categories as part of a controlled workflow process. It supports the editing glossary and multiple states.", + externalDocs=@ExternalDocumentation(description="Glossary Workflow Open Metadata View Service (OMVS)", + url="https://egeria-project.org/services/omvs/glossary-workflow/overview/")) public class GlossaryWorkflowResource {