use of oasis.names.tc.ebxml_regrep.xsd.rim._3.ExtrinsicObjectType in project nhin-d by DirectProject.
the class DirectDocument2Test method testMimeType.
/**
* Test mimeType.
*
* @throws Exception
*/
public void testMimeType() throws Exception {
DirectDocument2 document = new DirectDocument2();
DirectDocument2.Metadata metadata = document.getMetadata();
String value = "input";
metadata.setMimeType(value);
ExtrinsicObjectType eot = metadata.generateExtrinsicObjectType();
metadata = new DirectDocument2.Metadata();
metadata.setValues(eot);
assertEquals("Output does not match expected", value, metadata.getMimeType());
}
use of oasis.names.tc.ebxml_regrep.xsd.rim._3.ExtrinsicObjectType in project nhin-d by DirectProject.
the class DirectDocument2Test method testAuthorInstitution.
/**
* Test authorInstitution.
*
* @throws Exception
*/
public void testAuthorInstitution() throws Exception {
DirectDocument2 document = new DirectDocument2();
DirectDocument2.Metadata metadata = document.getMetadata();
List<String> values = Arrays.asList("input1", "input2");
metadata.setAuthorInstitution(values);
ExtrinsicObjectType eot = metadata.generateExtrinsicObjectType();
metadata = new DirectDocument2.Metadata();
metadata.setValues(eot);
assertEquals("Output does not match expected", values.get(0), metadata.getAuthorInstitution().get(0));
assertEquals("Output does not match expected", values.get(1), metadata.getAuthorInstitution().get(1));
}
use of oasis.names.tc.ebxml_regrep.xsd.rim._3.ExtrinsicObjectType in project nhin-d by DirectProject.
the class DirectDocument2Test method testConfidentialityCode.
/**
* Test confidentialityCode.
*
* @throws Exception
*/
public void testConfidentialityCode() throws Exception {
DirectDocument2 document = new DirectDocument2();
DirectDocument2.Metadata metadata = document.getMetadata();
String value = "input";
metadata.setConfidentialityCode(value);
ExtrinsicObjectType eot = metadata.generateExtrinsicObjectType();
metadata = new DirectDocument2.Metadata();
metadata.setValues(eot);
assertEquals("Output does not match expected", value, metadata.getConfidentialityCode());
assertEquals("Output does not match expected", null, metadata.getConfidentialityCode_localized());
metadata.setConfidentialityCode(value, true);
eot = metadata.generateExtrinsicObjectType();
metadata = new DirectDocument2.Metadata();
metadata.setValues(eot);
assertEquals("Output does not match expected", value, metadata.getConfidentialityCode());
assertEquals("Output does not match expected", value, metadata.getConfidentialityCode_localized());
}
use of oasis.names.tc.ebxml_regrep.xsd.rim._3.ExtrinsicObjectType in project nhin-d by DirectProject.
the class DefaultXdmXdsTransformerTest method testGetDocId_SubmitObjectsRequest.
/**
* Test the getDocId(SubmitObjectsRequest) method.
*/
public void testGetDocId_SubmitObjectsRequest() {
DefaultXdmXdsTransformer transformer = new DefaultXdmXdsTransformer();
QName qname = null;
String output = null;
SubmitObjectsRequest input = null;
ExternalIdentifierType eit = null;
RegistryObjectListType registryObject = null;
RegistryPackageType registryPackageType = null;
ExtrinsicObjectType extrinsicObjectType = null;
List<ExternalIdentifierType> externalIdentifiers = null;
JAXBElement<ExtrinsicObjectType> jaxbExtrinsicObject = null;
JAXBElement<RegistryPackageType> jaxbRegistryPackageTypeObject = null;
List<JAXBElement<? extends IdentifiableType>> identifiableList = null;
registryObject = new RegistryObjectListType();
identifiableList = registryObject.getIdentifiable();
eit = new ExternalIdentifierType();
eit.setIdentificationScheme("urn:uuid:2e82c1f6-a085-4c72-9da3-8640a32e42ab");
eit.setValue("eitValue");
extrinsicObjectType = new ExtrinsicObjectType();
externalIdentifiers = extrinsicObjectType.getExternalIdentifier();
externalIdentifiers.add(eit);
qname = new QName("urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0", "ExtrinsicObject");
jaxbExtrinsicObject = new JAXBElement<ExtrinsicObjectType>(qname, ExtrinsicObjectType.class, extrinsicObjectType);
registryPackageType = new RegistryPackageType();
qname = new QName("urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0", "RegistryPackage");
jaxbRegistryPackageTypeObject = new JAXBElement<RegistryPackageType>(qname, RegistryPackageType.class, registryPackageType);
identifiableList.add(jaxbRegistryPackageTypeObject);
identifiableList.add(jaxbExtrinsicObject);
input = new SubmitObjectsRequest();
input.setRegistryObjectList(registryObject);
output = transformer.getDocId(input);
assertEquals("Output does not match expected", "eitValue", output);
registryObject = new RegistryObjectListType();
input = new SubmitObjectsRequest();
input.setRegistryObjectList(registryObject);
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 ddf by codice.
the class RegistryPackageWebConverterTest method getFirstExtrinsicObject.
private ExtrinsicObjectType getFirstExtrinsicObject() {
ExtrinsicObjectType extrinsicObject = RIM_FACTORY.createExtrinsicObjectType();
// set default values
extrinsicObject.setMimeType(extrinsicObject.getMimeType());
extrinsicObject.setIsOpaque(extrinsicObject.isIsOpaque());
extrinsicObject.setId("urn:registry:node");
extrinsicObject.setObjectType("urn:registry:federation:node");
extrinsicObject.getSlot().add(stHelper.create("liveDate", "2015-11-01T06:15:30-07:00", "xs:dateTime"));
extrinsicObject.getSlot().add(stHelper.create("dataStartDate", "2015-11-01T13:15:30Z", "xs:dateTime"));
extrinsicObject.getSlot().add(stHelper.create("dataEndDate", "2015-12-01T23:01:40Z", "xs:dateTime"));
extrinsicObject.getSlot().add(stHelper.create("lastUpdated", "2016-01-26T17:16:34.996Z", "xs:dateTime"));
extrinsicObject.getSlot().add(stHelper.create("links", "https://some/link/to/my/repo", "xs:string"));
SlotType1 locationSlot = stHelper.create("location", (String) null, "urn:ogc:def:dataType:ISO-19107:2003:GM_Point");
PointType point = GML_FACTORY.createPointType();
point.setSrsDimension(BigInteger.valueOf(2));
point.setSrsName("urn:ogc:def:crs:EPSG::4326");
DirectPositionType directPosition = GML_FACTORY.createDirectPositionType();
directPosition.getValue().add(112.267472);
directPosition.getValue().add(33.467944);
point.setPos(directPosition);
ValueListType valueList = WRS_FACTORY.createValueListType();
AnyValueType anyValue = WRS_FACTORY.createAnyValueType();
anyValue.getContent().add(GML_FACTORY.createPoint(point));
valueList.getAnyValue().add(anyValue);
locationSlot.setValueList(RIM_FACTORY.createValueList(valueList));
extrinsicObject.getSlot().add(locationSlot);
SlotType1 boundsSlot = stHelper.create("bounds", (String) null, "urn:ogc:def:dataType:ISO-19107:2003:GM_Envelope");
EnvelopeType bounds = GML_FACTORY.createEnvelopeType();
bounds.setSrsName("urn:ogc:def:crs:EPSG::4326");
directPosition = GML_FACTORY.createDirectPositionType();
directPosition.getValue().add(112.267472);
directPosition.getValue().add(33.467944);
bounds.setUpperCorner(directPosition);
directPosition = GML_FACTORY.createDirectPositionType();
directPosition.getValue().add(110.267472);
directPosition.getValue().add(30.467944);
bounds.setLowerCorner(directPosition);
valueList = WRS_FACTORY.createValueListType();
anyValue = WRS_FACTORY.createAnyValueType();
anyValue.getContent().add(GML_FACTORY.createEnvelope(bounds));
valueList.getAnyValue().add(anyValue);
boundsSlot.setValueList(RIM_FACTORY.createValueList(valueList));
extrinsicObject.getSlot().add(boundsSlot);
extrinsicObject.getSlot().add(stHelper.create("region", "USA", "urn:ogc:def:ebRIM-ClassificationScheme:UNSD:GlobalRegions"));
List<String> values = new ArrayList<>();
values.add("youtube");
values.add("myCamera");
extrinsicObject.getSlot().add(stHelper.create("inputDataSources", values, "xs:string"));
values = new ArrayList<>();
values.add("video");
values.add("sensor");
extrinsicObject.getSlot().add(stHelper.create("dataTypes", values, "xs:string"));
extrinsicObject.getSlot().add(stHelper.create("securityLevel", "role=guest", "xs:string"));
extrinsicObject.setName(istHelper.create("Node Name"));
extrinsicObject.setDescription(istHelper.create("A little something describing this node in less than 1024 characters"));
extrinsicObject.setVersionInfo(getVersionInfo("2.9.x"));
ClassificationType classification = RIM_FACTORY.createClassificationType();
classification.setId("urn:classification:id0");
classification.setClassifiedObject("classifiedObjectId");
extrinsicObject.getClassification().add(classification);
return extrinsicObject;
}
Aggregations