Search in sources :

Example 21 with ExtrinsicObjectType

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;
}
Also used : RegistryPackageType(oasis.names.tc.ebxml_regrep.xsd.rim._3.RegistryPackageType) ServiceType(oasis.names.tc.ebxml_regrep.xsd.rim._3.ServiceType) ExtrinsicObjectType(oasis.names.tc.ebxml_regrep.xsd.rim._3.ExtrinsicObjectType) PersonType(oasis.names.tc.ebxml_regrep.xsd.rim._3.PersonType) OrganizationType(oasis.names.tc.ebxml_regrep.xsd.rim._3.OrganizationType) MetacardImpl(ddf.catalog.data.impl.MetacardImpl)

Example 22 with ExtrinsicObjectType

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);
}
Also used : RegistryObjectListType(oasis.names.tc.ebxml_regrep.xsd.rim._3.RegistryObjectListType) RegistryPackageType(oasis.names.tc.ebxml_regrep.xsd.rim._3.RegistryPackageType) ExtrinsicObjectType(oasis.names.tc.ebxml_regrep.xsd.rim._3.ExtrinsicObjectType) Test(org.junit.Test)

Example 23 with ExtrinsicObjectType

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);
}
Also used : DefaultXdmXdsTransformer(org.nhindirect.xd.transform.impl.DefaultXdmXdsTransformer) ExtrinsicObjectType(oasis.names.tc.ebxml_regrep.xsd.rim._3.ExtrinsicObjectType) ExternalIdentifierType(oasis.names.tc.ebxml_regrep.xsd.rim._3.ExternalIdentifierType)

Example 24 with ExtrinsicObjectType

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;
}
Also used : RegistryObjectListType(oasis.names.tc.ebxml_regrep.xsd.rim._3.RegistryObjectListType) IdentifiableType(oasis.names.tc.ebxml_regrep.xsd.rim._3.IdentifiableType) ExtrinsicObjectType(oasis.names.tc.ebxml_regrep.xsd.rim._3.ExtrinsicObjectType) JAXBElement(javax.xml.bind.JAXBElement)

Example 25 with ExtrinsicObjectType

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());
}
Also used : ExtrinsicObjectType(oasis.names.tc.ebxml_regrep.xsd.rim._3.ExtrinsicObjectType)

Aggregations

ExtrinsicObjectType (oasis.names.tc.ebxml_regrep.xsd.rim._3.ExtrinsicObjectType)46 RegistryPackageType (oasis.names.tc.ebxml_regrep.xsd.rim._3.RegistryPackageType)8 JAXBElement (javax.xml.bind.JAXBElement)7 RegistryObjectListType (oasis.names.tc.ebxml_regrep.xsd.rim._3.RegistryObjectListType)7 ArrayList (java.util.ArrayList)5 AssociationType1 (oasis.names.tc.ebxml_regrep.xsd.rim._3.AssociationType1)5 IdentifiableType (oasis.names.tc.ebxml_regrep.xsd.rim._3.IdentifiableType)5 SlotType1 (oasis.names.tc.ebxml_regrep.xsd.rim._3.SlotType1)5 OrganizationType (oasis.names.tc.ebxml_regrep.xsd.rim._3.OrganizationType)4 PersonType (oasis.names.tc.ebxml_regrep.xsd.rim._3.PersonType)4 RegistryObjectType (oasis.names.tc.ebxml_regrep.xsd.rim._3.RegistryObjectType)4 ServiceType (oasis.names.tc.ebxml_regrep.xsd.rim._3.ServiceType)4 Date (java.util.Date)3 ClassificationType (oasis.names.tc.ebxml_regrep.xsd.rim._3.ClassificationType)3 Metacard (ddf.catalog.data.Metacard)2 OffsetDateTime (java.time.OffsetDateTime)2 HashMap (java.util.HashMap)2 QName (javax.xml.namespace.QName)2 SubmitObjectsRequest (oasis.names.tc.ebxml_regrep.xsd.lcm._3.SubmitObjectsRequest)2 ExternalIdentifierType (oasis.names.tc.ebxml_regrep.xsd.rim._3.ExternalIdentifierType)2