src/main/java/ch/bfh/ti/i4mi/mag/mhd/iti66/Iti66ResponseBugfix.java
/**
	 * bugfix: add missing type classification to SubmissionSets in ITI-18 response 
	 * @param response
	 * @return
	 */
add missing type classification to SubmissionSets in ITI-18 response
@param response
@return
add missing type classification to SubmissionSets in ITI - 18 response @param response @return
public AdhocQueryResponse fixResponse(@Body AdhocQueryResponse response) {
		RegistryObjectListType registryObjectList = response.getRegistryObjectList();
		if (registryObjectList != null) {
			var registryPackages = registryObjectList.getIdentifiable();
			if (registryPackages != null) {
				for (var possibleRegistryPackage : registryPackages) {
					IdentifiableType type = possibleRegistryPackage.getValue();
					if (type instanceof RegistryPackageType) {
						RegistryPackageType registryPackageType = (RegistryPackageType) type;
						boolean foundTypeClassification = false;
						for (var classification : registryPackageType.getClassification()) {
							if ("urn:uuid:a54d6aa5-d40d-43f9-88c5-b4633d873bdd".equals(classification.getClassificationNode())
								|| "urn:uuid:d9d542f3-6cc4-48b6-8870-ea235fbc94c2".equals(classification.getClassificationNode()))
								foundTypeClassification = true;
						}
						if (!foundTypeClassification) {
							ClassificationType missing = new ClassificationType();
							missing.setClassificationNode("urn:uuid:a54d6aa5-d40d-43f9-88c5-b4633d873bdd");
							missing.setClassifiedObject(registryPackageType.getId());
							registryPackageType.getClassification().add(missing);
						}
					}
				}
			}
		}
		return response;
	}
public AdhocQueryResponse fixResponse ( @ Body AdhocQueryResponse response ) { RegistryObjectListType registryObjectList = response . getRegistryObjectList ( ) ; if ( registryObjectList != null ) { var registryPackages = registryObjectList . getIdentifiable ( ) ; if ( registryPackages != null ) { for ( var possibleRegistryPackage : registryPackages ) { IdentifiableType type = possibleRegistryPackage . getValue ( ) ; if ( type instanceof RegistryPackageType ) { RegistryPackageType registryPackageType = ( RegistryPackageType ) type ; boolean foundTypeClassification = false ; for ( var classification : registryPackageType . getClassification ( ) ) { if ( "urn:uuid:a54d6aa5-d40d-43f9-88c5-b4633d873bdd" . equals ( classification . getClassificationNode ( ) ) || "urn:uuid:d9d542f3-6cc4-48b6-8870-ea235fbc94c2" . equals ( classification . getClassificationNode ( ) ) ) foundTypeClassification = true ; } if ( ! foundTypeClassification ) { ClassificationType missing = new ClassificationType ( ) ; missing . setClassificationNode ( "urn:uuid:a54d6aa5-d40d-43f9-88c5-b4633d873bdd" ) ; missing . setClassifiedObject ( registryPackageType . getId ( ) ) ; registryPackageType . getClassification ( ) . add ( missing ) ; } } } } } return response ; }
bugfix: add missing type classification to SubmissionSets in ITI-18 response
 @param response
 @return
bugfix : add missing type classification to SubmissionSets in ITI - 18 response @param response @return
// If not found add SubmissionSet classification 