Search in sources :

Example 11 with MdAttributeConcrete

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

the class RegistryService method refreshAttributeTermTypeInCache.

/**
 * Returns the {@link AttributeTermType}s that use the given term.
 *
 * @param term
 * @return
 */
private void refreshAttributeTermTypeInCache(List<MdAttributeConcrete> mdAttrList) {
    for (MdAttributeConcrete mdAttribute : mdAttrList) {
        String geoObjectTypeCode = mdAttribute.getDefiningMdClass().getTypeName();
        Optional<ServerGeoObjectType> optional = ServiceFactory.getMetadataCache().getGeoObjectType(geoObjectTypeCode);
        if (optional.isPresent()) {
            ServerGeoObjectType geoObjectType = optional.get();
            AttributeType attributeType = new AttributeTypeConverter().build((MdAttributeConcreteDAOIF) BusinessFacade.getEntityDAO(mdAttribute));
            geoObjectType.getType().addAttribute(attributeType);
            ServiceFactory.getMetadataCache().addGeoObjectType(geoObjectType);
        }
    }
}
Also used : ServerGeoObjectType(net.geoprism.registry.model.ServerGeoObjectType) AttributeType(org.commongeoregistry.adapter.metadata.AttributeType) AttributeTypeConverter(net.geoprism.registry.conversion.AttributeTypeConverter) MdAttributeConcrete(com.runwaysdk.system.metadata.MdAttributeConcrete)

Aggregations

MdAttributeConcrete (com.runwaysdk.system.metadata.MdAttributeConcrete)11 MdAttributeTerm (com.runwaysdk.system.metadata.MdAttributeTerm)4 Classifier (net.geoprism.ontology.Classifier)4 Term (org.commongeoregistry.adapter.Term)4 AttributeClassificationType (org.commongeoregistry.adapter.metadata.AttributeClassificationType)4 AttributeFloatType (org.commongeoregistry.adapter.metadata.AttributeFloatType)4 AttributeTermType (org.commongeoregistry.adapter.metadata.AttributeTermType)4 JsonObject (com.google.gson.JsonObject)3 Request (com.runwaysdk.session.Request)3 MdAttributeBoolean (com.runwaysdk.system.metadata.MdAttributeBoolean)3 MdAttributeCharacter (com.runwaysdk.system.metadata.MdAttributeCharacter)3 MdAttributeDateTime (com.runwaysdk.system.metadata.MdAttributeDateTime)3 MdAttributeDouble (com.runwaysdk.system.metadata.MdAttributeDouble)3 MdAttributeLong (com.runwaysdk.system.metadata.MdAttributeLong)3 MdBusiness (com.runwaysdk.system.metadata.MdBusiness)3 AttributeTypeConverter (net.geoprism.registry.conversion.AttributeTypeConverter)3 TermConverter (net.geoprism.registry.conversion.TermConverter)3 OAuthClientRequest (org.apache.oltu.oauth2.client.request.OAuthClientRequest)3 LocalizedValue (org.commongeoregistry.adapter.dataaccess.LocalizedValue)3 Transaction (com.runwaysdk.dataaccess.transaction.Transaction)2