Search in sources :

Example 1 with MdVertex

use of com.runwaysdk.system.metadata.MdVertex in project geoprism-registry by terraframe.

the class BusinessType method getAttributeMap.

public Map<String, AttributeType> getAttributeMap() {
    AttributeTypeConverter converter = new AttributeTypeConverter();
    MdVertexDAOIF mdVertex = this.getMdVertexDAO();
    return mdVertex.definesAttributes().stream().filter(attr -> {
        return !attr.isSystem() && !attr.definesAttribute().equals(BusinessType.SEQ) && !attr.definesAttribute().equals(BusinessType.GEO_OBJECT);
    }).map(attr -> converter.build(attr)).collect(Collectors.toMap(AttributeType::getName, attr -> attr));
}
Also used : MdVertexDAOIF(com.runwaysdk.dataaccess.MdVertexDAOIF) JsonObject(com.google.gson.JsonObject) Operation(com.runwaysdk.business.rbac.Operation) Transaction(com.runwaysdk.dataaccess.transaction.Transaction) MdGeoVertexInfo(com.runwaysdk.gis.constants.MdGeoVertexInfo) MdAttributeTermDAOIF(com.runwaysdk.dataaccess.MdAttributeTermDAOIF) LocalizedValue(org.commongeoregistry.adapter.dataaccess.LocalizedValue) ServerGeoObjectType(net.geoprism.registry.model.ServerGeoObjectType) JsonParser(com.google.gson.JsonParser) MdAttributeLocalInfo(com.runwaysdk.constants.MdAttributeLocalInfo) MdAttributeBooleanInfo(com.runwaysdk.constants.MdAttributeBooleanInfo) MdVertex(com.runwaysdk.system.metadata.MdVertex) ServiceFactory(net.geoprism.registry.service.ServiceFactory) Classifier(net.geoprism.ontology.Classifier) MdAttributeConcreteDAOIF(com.runwaysdk.dataaccess.MdAttributeConcreteDAOIF) DefaultAttribute(org.commongeoregistry.adapter.constants.DefaultAttribute) IndexTypes(com.runwaysdk.constants.IndexTypes) MdAttributeCharacterInfo(com.runwaysdk.constants.MdAttributeCharacterInfo) LocalizedValueConverter(net.geoprism.registry.conversion.LocalizedValueConverter) Map(java.util.Map) QueryFactory(com.runwaysdk.query.QueryFactory) RoleDAO(com.runwaysdk.business.rbac.RoleDAO) Collector(java.util.stream.Collector) JsonSerializable(net.geoprism.registry.view.JsonSerializable) MdAttributeConcrete(com.runwaysdk.system.metadata.MdAttributeConcrete) TermConverter(net.geoprism.registry.conversion.TermConverter) AttributeType(org.commongeoregistry.adapter.metadata.AttributeType) MdAttributeCharacterDAO(com.runwaysdk.dataaccess.metadata.MdAttributeCharacterDAO) MdAttributeConcreteDAO(com.runwaysdk.dataaccess.metadata.MdAttributeConcreteDAO) GeoVertex(net.geoprism.registry.graph.GeoVertex) Roles(com.runwaysdk.system.Roles) AttributeTypeConverter(net.geoprism.registry.conversion.AttributeTypeConverter) MdAttributeConcreteInfo(com.runwaysdk.constants.MdAttributeConcreteInfo) Collectors(java.util.stream.Collectors) BusinessFacade(com.runwaysdk.business.BusinessFacade) MdVertexDAO(com.runwaysdk.dataaccess.metadata.graph.MdVertexDAO) OIterator(com.runwaysdk.query.OIterator) Page(net.geoprism.registry.view.Page) MdAttributeGraphReferenceInfo(com.runwaysdk.constants.MdAttributeGraphReferenceInfo) MdAttributeMultiTermDAOIF(com.runwaysdk.dataaccess.MdAttributeMultiTermDAOIF) MdVertexDAOIF(com.runwaysdk.dataaccess.MdVertexDAOIF) List(java.util.List) JsonArray(com.google.gson.JsonArray) DataNotFoundException(com.runwaysdk.dataaccess.cache.DataNotFoundException) MdVertexInfo(com.runwaysdk.constants.graph.MdVertexInfo) Session(com.runwaysdk.session.Session) MdAttributeGraphReferenceDAO(com.runwaysdk.dataaccess.metadata.MdAttributeGraphReferenceDAO) BusinessTypePageQuery(net.geoprism.registry.query.graph.BusinessTypePageQuery) AttributeTypeConverter(net.geoprism.registry.conversion.AttributeTypeConverter)

Example 2 with MdVertex

use of com.runwaysdk.system.metadata.MdVertex in project geoprism-registry by terraframe.

the class BusinessType method delete.

@Override
@Transaction
public void delete() {
    MdVertex mdVertex = this.getMdVertex();
    super.delete();
    mdVertex.delete();
}
Also used : MdVertex(com.runwaysdk.system.metadata.MdVertex) Transaction(com.runwaysdk.dataaccess.transaction.Transaction)

Example 3 with MdVertex

use of com.runwaysdk.system.metadata.MdVertex in project geoprism-registry by terraframe.

the class VertexServerGeoObject method findTypeOfGeoObjectCode.

/**
 * Finds the ServerGeoObjectType associated with the particular Geo-Object
 * code.
 *
 * @return
 */
public static ServerGeoObjectType findTypeOfGeoObjectCode(String code) {
    StringBuilder statement = new StringBuilder();
    statement.append("SELECT @class FROM geo_vertex WHERE code=:code");
    GraphQuery<String> query = new GraphQuery<String>(statement.toString());
    query.setParameter("code", code);
    String className = query.getSingleResult();
    MdVertexQuery mvq = new MdVertexQuery(new QueryFactory());
    mvq.WHERE(mvq.getDbClassName().EQ(className));
    MdVertex mdVertex = mvq.getIterator().getAll().get(0);
    ServerGeoObjectType foundType = ServerGeoObjectType.get(MdGeoVertexDAO.get(mdVertex.getOid()));
    return foundType;
}
Also used : QueryFactory(com.runwaysdk.query.QueryFactory) MdVertex(com.runwaysdk.system.metadata.MdVertex) ServerGeoObjectType(net.geoprism.registry.model.ServerGeoObjectType) MdVertexQuery(com.runwaysdk.system.metadata.MdVertexQuery) MultiLineString(com.vividsolutions.jts.geom.MultiLineString) LineString(com.vividsolutions.jts.geom.LineString) GraphQuery(com.runwaysdk.business.graph.GraphQuery)

Aggregations

MdVertex (com.runwaysdk.system.metadata.MdVertex)3 Transaction (com.runwaysdk.dataaccess.transaction.Transaction)2 QueryFactory (com.runwaysdk.query.QueryFactory)2 ServerGeoObjectType (net.geoprism.registry.model.ServerGeoObjectType)2 JsonArray (com.google.gson.JsonArray)1 JsonObject (com.google.gson.JsonObject)1 JsonParser (com.google.gson.JsonParser)1 BusinessFacade (com.runwaysdk.business.BusinessFacade)1 GraphQuery (com.runwaysdk.business.graph.GraphQuery)1 Operation (com.runwaysdk.business.rbac.Operation)1 RoleDAO (com.runwaysdk.business.rbac.RoleDAO)1 IndexTypes (com.runwaysdk.constants.IndexTypes)1 MdAttributeBooleanInfo (com.runwaysdk.constants.MdAttributeBooleanInfo)1 MdAttributeCharacterInfo (com.runwaysdk.constants.MdAttributeCharacterInfo)1 MdAttributeConcreteInfo (com.runwaysdk.constants.MdAttributeConcreteInfo)1 MdAttributeGraphReferenceInfo (com.runwaysdk.constants.MdAttributeGraphReferenceInfo)1 MdAttributeLocalInfo (com.runwaysdk.constants.MdAttributeLocalInfo)1 MdVertexInfo (com.runwaysdk.constants.graph.MdVertexInfo)1 MdAttributeConcreteDAOIF (com.runwaysdk.dataaccess.MdAttributeConcreteDAOIF)1 MdAttributeMultiTermDAOIF (com.runwaysdk.dataaccess.MdAttributeMultiTermDAOIF)1