String assocDescription(OMElement obj) { return assocDescription(m.getId(obj)); }
void evalHasMember(ErrorRecorder er, OMElement assoc) { String source = m.getAssocSource(assoc); String target = m.getAssocTarget(assoc); String type = m.getAssocType(assoc); if (source == null || target == null || type == null) return; if (is_ss_to_de_hasmember(assoc)) { er.detail(assocDescription(assoc) + ": is a SubmissionSet to DocmentEntry HasMember association"); } else if (is_ss_to_existing_de_hasmember(assoc)) { er.detail(assocDescription(assoc) + ": is a SubmissionSet to existing DocmentEntry HasMember (ByReference) association"); } else if (is_ss_to_folder_hasmember(assoc)) { er.detail(assocDescription(assoc) + ": is a SubmissionSet to Folder HasMember association"); } else if (is_ss_to_folder_hasmember_hasmember(assoc)) { er.detail(assocDescription(assoc) + ": is a SubmissionSet to Folder-HasMember HasMember association (adds existing DocumentEntry to existing Folder)"); } else if (is_fol_to_de_hasmember(assoc)) { er.detail(assocDescription(assoc) + ": is a Folder to DocumentEntry HasMember association"); } else { er.err(XdsErrorCode.Code.XDSRegistryMetadataError, assocDescription(assoc) + ": do not understand this HasMember association. " + "sourceObject is " + objectDescription(source) + " and targetObject is " + objectDescription(target), this, assocsRef); hasmember_error = true; } }
void all_docs_linked_to_ss(ErrorRecorder er, ValidationContext vc) { List<OMElement> docs = m.getExtrinsicObjects(); for (int i=0; i<docs.size(); i++) { OMElement doc = (OMElement) docs.get(i); OMElement assoc = find_assoc(m.getSubmissionSetId(), assoc_type("HasMember"), doc.getAttributeValue(MetadataSupport.id_qname)); if ( assoc == null) { er.err(XdsErrorCode.Code.XDSRegistryMetadataError, "DocumentEntry(" + doc.getAttributeValue(MetadataSupport.id_qname) + ") is not linked to the SubmissionSet with a " + assoc_type("HasMember") + " Association", this, "ITI TF-3: 4.1.4.1"); } else { if (!has_sss_slot(assoc)) { er.err(XdsErrorCode.Code.XDSRegistryMetadataError, assocDescription(assoc) + ": links a DocumentEntry to the SubmissionSet but does not have a " + "SubmissionSetStatus Slot with value Original", this, "ITI TF-3: 4.1.4.1"); hasmember_error = true; } else if (!is_sss_original(assoc)) { er.err(XdsErrorCode.Code.XDSRegistryMetadataError, assocDescription(assoc) + ": links a DocumentEntry to the SubmissionSet but does not have a " + "SubmissionSetStatus Slot with value Original", this, "ITI TF-3: 4.1.4.1"); hasmember_error = true; } } } }
er.err(XdsErrorCode.Code.XDSRegistryMetadataError, assocDescription(assocId) + ": only Folder to DocumentEntry associations can be members of SubmissionSet (linked to SubmissionSet model via HasMember association", this, assocsRef); hasmember_error = true;