Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@SrdjanStevanetic
Copy link
Contributor

No description provided.

performDeprecation(zohoSyncReport, operation);
}
else {
logger.debug(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be logged with info level

// deprecate
performDeprecation(zohoSyncReport, operation);
// deprecate if not already deprecated
if(! operation.getEntityRecord().isDisabled()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should change to condition to avoid using the ! operation (likely to be indicated in the code quality checks as well)

BatchOperations operations, String zohoId, Record zohoOrg, EntityRecord entityRecord) {

String entityId = EntityRecordUtils.buildEntityIdUri(EntityTypes.Organization, zohoId);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The use of the buildEntityIdUri method needs to be replaced, as the value is now taken from the "Europeana ID" field

}
} else {
//even though there must be a Europeana_ID here, we check it to avoid strange zoho entries
} else if(Europeana_ID != null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here we have to first check if the EuropeanaID is null, if so, the records does not exists and a create operation needs to be instantiated

//even though there must be a Europeana_ID here, we check it to avoid strange zoho entries
} else if(Europeana_ID != null) {
// entity record not null, update or deletion
if (!hasDpsOwner || markedForDeletion) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this part needs to be separated, marked for deletion must be own else if statement implementing the requirements:
Check if the “Scheduled for deletion field”
If marked and no value is indicated in the “Europeana ID” field
Do nothing (ignore the entry)
If marked and the “Europeana ID” is not empty
Mark as deprecated in the API (if it isn't already) and apply an update workflow

}

List<String> entitiesToUpdate = performEntityRegistration(createOperations, zohoSyncReport);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

performEntityRegistration for the individual entities needs to be updated, and the code that beuild the EntityId based on ZohoId needs to be removed. Instead the identifier needs to be generated as for the other entities using the sequence. The update of ZohoRecord with the EuropeanaID needs to be invoked during the creation, before saving the EntityRecord into the database

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see requirements:
Creation workflow:

generate a new Europeana identifier using the same approach as for other entities (sequential)

Set the value of the new “Europeana ID” field in Zoho with the newly generated identifier for the entity

Keep the Zoho URL as ID of the Zoho Proxy (as it is currently done)

Update the entity data

@gsergiu gsergiu merged commit eb4681b into develop Nov 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants