private void confirmMatchForDsTypeModel ( ValidationResult result , DsTypeModel typeModel , String contentModelPid , ObjectInfo object ) { String id = typeModel . getId ( ) ; DatastreamInfo dsInfo = object . getDatastreamInfo ( id ) ; if ( dsInfo == null ) { // If there is no datastream by that name, nothing to check. result . addNote ( ValidationResultNotation . noMatchingDatastreamId ( contentModelPid , id ) ) ; return ; } Collection < Form > forms = typeModel . getForms ( ) ; if ( forms . isEmpty ( ) ) { // If the type model has no forms, it's an automatic match. return ; } // Otherwise, the datastream must meet the constraints of at least one form. for ( Form form : forms ) { if ( meetsConstraint ( dsInfo . getMimeType ( ) , form . getMimeType ( ) ) && meetsConstraint ( dsInfo . getFormatUri ( ) , form . getFormatUri ( ) ) ) { return ; } } result . addNote ( ValidationResultNotation . datastreamDoesNotMatchForms ( contentModelPid , id ) ) ; }
The object must have a datastream to match each dsTypeModel in the content model . Matching a dsTypeModel means equal IDs and an acceptable form .