use of com.runwaysdk.gis.dataaccess.MdGeoVertexDAOIF in project geoprism-registry by terraframe.
the class PatchExistsAndInvalid method getUniversals.
// private void patchMasterlistVersions()
// {
// final Collection<Locale> locales = LocalizationFacade.getInstalledLocales();
//
// MasterListVersionQuery query = new MasterListVersionQuery(new QueryFactory());
//
// try (OIterator<? extends MasterListVersion> it = query.getIterator())
// {
// for (MasterListVersion version : it)
// {
// ServerGeoObjectType type = version.getMasterlist().getGeoObjectType();
//
// // Patch metadata
// AttributeType existsAttr = type.getAttribute(DefaultAttribute.EXISTS.getName()).get();
// MdAttribute existsMdAttr = MasterListVersion.createMdAttributeFromAttributeType(version, type, existsAttr, locales).getPairs().keySet().iterator().next();
//
// AttributeType invalidAttr = type.getAttribute(DefaultAttribute.INVALID.getName()).get();
// MdAttribute invalidMdAttr = MasterListVersion.createMdAttributeFromAttributeType(version, type, invalidAttr, locales).getPairs().keySet().iterator().next();
//
//
//
// // Patch instance data
// MdBusiness table = version.getMdBusiness();
//
// String statement = "UPDATE " + table.getTableName() + " SET " + existsMdAttr.getColumnName() + " = " +
//
// Database.executeStatement(statement);
// }
// }
// }
// private void patchMasterlistVersions(ServerGeoObjectType type)
// {
// AttributeType existsAttr = type.getAttribute(DefaultAttribute.EXISTS.getName()).get();
// MasterList.createMdAttribute(type, existsAttr);
//
// AttributeType invalidAttr = type.getAttribute(DefaultAttribute.INVALID.getName()).get();
// MasterList.createMdAttribute(type, invalidAttr);
// }
public static List<Universal> getUniversals() {
QueryFactory qf = new QueryFactory();
UniversalQuery uq = new UniversalQuery(qf);
@SuppressWarnings("unchecked") List<Universal> unis = (List<Universal>) uq.getIterator().getAll();
Iterator<Universal> it = unis.iterator();
while (it.hasNext()) {
Universal uni = it.next();
if (uni.getKey().equals(Universal.ROOT_KEY)) {
it.remove();
continue;
}
MdGeoVertexDAOIF superType = GeoVertexType.getMdGeoVertex(uni.getUniversalId()).getSuperClass();
if (superType != null && !superType.definesType().equals(GeoVertex.CLASS)) {
it.remove();
continue;
}
}
return unis;
}
use of com.runwaysdk.gis.dataaccess.MdGeoVertexDAOIF in project geoprism-registry by terraframe.
the class ServerGeoObjectTypeConverter method build.
public ServerGeoObjectType build(Universal universal) {
MdBusiness mdBusiness = universal.getMdBusiness();
MdGeoVertexDAO mdVertex = GeoVertexType.getMdGeoVertex(universal.getUniversalId());
com.runwaysdk.system.gis.geo.GeometryType geoPrismgeometryType = universal.getGeometryType().get(0);
org.commongeoregistry.adapter.constants.GeometryType cgrGeometryType = GeometryTypeFactory.get(geoPrismgeometryType);
LocalizedValue label = convert(universal.getDisplayLabel());
LocalizedValue description = convert(universal.getDescription());
String ownerActerOid = universal.getOwnerOid();
String organizationCode = Organization.getRootOrganizationCode(ownerActerOid);
MdGeoVertexDAOIF superType = mdVertex.getSuperClass();
GeoObjectType geoObjType = new GeoObjectType(universal.getUniversalId(), cgrGeometryType, label, description, universal.getIsGeometryEditable(), organizationCode, ServiceFactory.getAdapter());
geoObjType.setIsAbstract(mdBusiness.getIsAbstract());
try {
GeoObjectTypeMetadata metadata = GeoObjectTypeMetadata.getByKey(universal.getKey());
geoObjType.setIsPrivate(metadata.getIsPrivate());
} catch (DataNotFoundException | AttributeDoesNotExistException e) {
geoObjType.setIsPrivate(false);
}
if (superType != null && !superType.definesType().equals(GeoVertex.CLASS)) {
String parentCode = superType.getTypeName();
geoObjType.setSuperTypeCode(parentCode);
}
geoObjType = this.convertAttributeTypes(universal, geoObjType, mdBusiness);
return new ServerGeoObjectType(geoObjType, universal, mdBusiness, mdVertex);
}
Aggregations