use of oasis.names.tc.ebxml_regrep.xsd.rim._3.ExtrinsicObjectType in project ddf by codice.
the class RegistryPackageConverter method getRegistryObjectMetacard.
public static Metacard getRegistryObjectMetacard(RegistryObjectType registryObject, MetacardType metacardType) throws RegistryConversionException {
MetacardImpl metacard = null;
if (registryObject == null) {
return metacard;
}
validateIdentifiable(registryObject);
metacard = new MetacardImpl(metacardType);
parseTopLevel(registryObject, metacard);
if (registryObject instanceof RegistryPackageType) {
parseRegistryPackage((RegistryPackageType) registryObject, metacard);
} else if (registryObject instanceof ExtrinsicObjectType) {
parseNodeExtrinsicObject(registryObject, metacard);
} else if (registryObject instanceof ServiceType) {
parseRegistryService((ServiceType) registryObject, metacard);
} else if (registryObject instanceof OrganizationType) {
parseRegistryOrganization((OrganizationType) registryObject, metacard);
} else if (registryObject instanceof PersonType) {
parseRegistryPerson((PersonType) registryObject, metacard);
} else {
LOGGER.debug("Unexpected object found: {}", registryObject);
}
return metacard;
}
use of oasis.names.tc.ebxml_regrep.xsd.rim._3.ExtrinsicObjectType in project ddf by codice.
the class RegistryPackageTypeHelperTest method testGetExtrinsicObjectTypesFromRegistryObjectList.
@Test
public void testGetExtrinsicObjectTypesFromRegistryObjectList() throws Exception {
RegistryObjectListType registryObjectList = ((RegistryPackageType) registryObject).getRegistryObjectList();
List<ExtrinsicObjectType> extrinsicObjects = rptHelper.getExtrinsicObjects(registryObjectList);
assertExtrinsicObjects(extrinsicObjects);
}
use of oasis.names.tc.ebxml_regrep.xsd.rim._3.ExtrinsicObjectType in project nhin-d by DirectProject.
the class DefaultXdmXdsTransformerTest method testGetDocId_ExtrinsicObjectType.
/**
* Test the getDocId(ExtrinsicObjectType) method.
*/
public void testGetDocId_ExtrinsicObjectType() {
DefaultXdmXdsTransformer transformer = new DefaultXdmXdsTransformer();
String output = null;
ExtrinsicObjectType input = null;
ExternalIdentifierType eit = null;
List<ExternalIdentifierType> externalIdentifiers = null;
eit = new ExternalIdentifierType();
eit.setIdentificationScheme("urn:uuid:2e82c1f6-a085-4c72-9da3-8640a32e42ab");
eit.setValue("eitValue");
input = new ExtrinsicObjectType();
externalIdentifiers = input.getExternalIdentifier();
externalIdentifiers.add(eit);
output = transformer.getDocId(input);
assertEquals("Output does not match expected", "eitValue", output);
eit = new ExternalIdentifierType();
eit.setIdentificationScheme("urn:uuid:incorrecd-uuid");
eit.setValue("eitValue");
input = new ExtrinsicObjectType();
externalIdentifiers = input.getExternalIdentifier();
externalIdentifiers.add(eit);
output = transformer.getDocId(input);
assertEquals("Output does not match expected", null, output);
input = new ExtrinsicObjectType();
externalIdentifiers = input.getExternalIdentifier();
output = transformer.getDocId(input);
assertEquals("Output does not match expected", null, output);
}
use of oasis.names.tc.ebxml_regrep.xsd.rim._3.ExtrinsicObjectType in project nhin-d by DirectProject.
the class DefaultXdmXdsTransformer method getDocName.
protected String getDocName(SubmitObjectsRequest submitObjectRequest) {
if (submitObjectRequest == null) {
throw new IllegalArgumentException("SubmitObjectRequest must not be null.");
}
String ret = null;
RegistryObjectListType rol = submitObjectRequest.getRegistryObjectList();
List<JAXBElement<? extends IdentifiableType>> extensible = rol.getIdentifiable();
for (JAXBElement<? extends IdentifiableType> elem : extensible) {
String type = elem.getDeclaredType().getName();
Object value = elem.getValue();
if (StringUtils.equals(type, "oasis.names.tc.ebxml_regrep.xsd.rim._3.ExtrinsicObjectType")) {
String obId = ((ExtrinsicObjectType) value).getId();
String mimeType = ((ExtrinsicObjectType) value).getMimeType();
String suffix = "xml";
if (mimeType.indexOf("xml") >= 0) {
suffix = "xml";
} else if (mimeType.indexOf("pdf") >= 0) {
suffix = "pdf";
}
ret = obId + "." + suffix;
if (LOGGER.isTraceEnabled()) {
LOGGER.trace(type + " " + value.toString());
}
}
}
return ret;
}
use of oasis.names.tc.ebxml_regrep.xsd.rim._3.ExtrinsicObjectType in project nhin-d by DirectProject.
the class DirectDocument2Test method testDescription.
/**
* Test description.
*
* @throws Exception
*/
public void testDescription() throws Exception {
DirectDocument2 document = new DirectDocument2();
DirectDocument2.Metadata metadata = document.getMetadata();
String value = "input";
metadata.setDescription(value);
ExtrinsicObjectType eot = metadata.generateExtrinsicObjectType();
metadata = new DirectDocument2.Metadata();
metadata.setValues(eot);
assertEquals("Output does not match expected", value, metadata.getDescription());
}
Aggregations