use of org.commongeoregistry.adapter.metadata.GeoObjectType in project geoprism-registry by terraframe.
the class AttributeTypeServiceTest method testCreateGeoObjectTypeDate.
@Test
public void testCreateGeoObjectTypeDate() {
String organizationCode = FastTestDataset.ORG_CGOV.getCode();
GeoObjectType province = MetadataFactory.newGeoObjectType(TEST_GOT.getCode(), GeometryType.POLYGON, new LocalizedValue("Province"), new LocalizedValue(""), true, organizationCode, testData.adapter);
String gtJSON = province.toJSON().toString();
AttributeType testDate = AttributeType.factory("testDate", new LocalizedValue("testDateLocalName"), new LocalizedValue("testDateLocalDescrip"), AttributeDateType.TYPE, false, false, false);
testData.adapter.createGeoObjectType(gtJSON);
String geoObjectTypeCode = province.getCode();
String attributeTypeJSON = testDate.toJSON().toString();
testDate = testData.adapter.createAttributeType(geoObjectTypeCode, attributeTypeJSON);
MdAttributeDAOIF mdAttributeConcreteDAOIF = checkAttribute(TEST_GOT.getCode(), testDate.getName());
Assert.assertNotNull("A GeoObjectType did not define the attribute: " + testDate.getName(), mdAttributeConcreteDAOIF);
Assert.assertTrue("A GeoObjectType did not define the attribute of the correct type: " + mdAttributeConcreteDAOIF.getType(), mdAttributeConcreteDAOIF instanceof MdAttributeMomentDAOIF);
}
use of org.commongeoregistry.adapter.metadata.GeoObjectType in project geoprism-registry by terraframe.
the class TestGeoObjectTypeInfo method applyInTrans.
@Transaction
private void applyInTrans() {
if (this.getServerObject() != null) {
return;
}
String organizationCode = this.getOrganization().getCode();
GeoObjectType got = new GeoObjectType(this.getCode(), this.geomType, this.getDisplayLabel(), this.getDescription(), true, organizationCode, ServiceFactory.getAdapter());
got.setIsAbstract(this.isAbstract);
got.setIsPrivate(this.isPrivate);
if (this.getSuperType() != null) {
got.setSuperTypeCode(this.getSuperType().code);
}
this.serverObject = new ServerGeoObjectTypeConverter().create(got);
universal = this.serverObject.getUniversal();
this.setUid(universal.getOid());
}
use of org.commongeoregistry.adapter.metadata.GeoObjectType in project geoprism-registry by terraframe.
the class InheritedHierarchyAnnotationTest method testGetTypeAncestorsInherited.
@Test
@Request
public void testGetTypeAncestorsInherited() {
ServerGeoObjectType sGOT = FastTestDataset.PROVINCE.getServerObject();
ServerHierarchyType forHierarchy = TEST_HT.getServerObject();
ServerHierarchyType inheritedHierarchy = FastTestDataset.HIER_ADMIN.getServerObject();
InheritedHierarchyAnnotation annotation = sGOT.setInheritedHierarchy(forHierarchy, inheritedHierarchy);
try {
ServerGeoObjectType childType = TEST_CHILD.getServerObject();
List<GeoObjectType> results = childType.getTypeAncestors(TEST_HT.getServerObject(), true);
Assert.assertEquals(2, results.size());
} finally {
annotation.delete();
}
}
Aggregations