def geoserver_post_save(instance, sender, created, **kwargs): from geonode.messaging import producer # this is attached to various models, (ResourceBase, Document) # so we should select what will be handled here if isinstance(instance, Layer): instance_dict = model_to_dict(instance) payload = json_serializer_producer(instance_dict) producer.geoserver_upload_layer(payload) if getattr(settings, 'DELAYED_SECURITY_SIGNALS', False): instance.set_dirty_state() if instance.storeType != 'remoteStore' and created: logger.info("... Creating Default Resource Links for Layer [%s]" % (instance.alternate)) try: set_resource_default_links(instance, sender, prune=True) except BaseException: from django.db import connection connection._rollback() logger.warn( "Failure Creating Default Resource Links for Layer [%s]" % (instance.alternate)) logger.info("... Creating Thumbnail for Layer [%s]" % (instance.alternate)) try: create_gs_thumbnail(instance, overwrite=True, check_bbox=True) except BaseException: logger.warn("Failure Creating Thumbnail for Layer [%s]" % (instance.alternate))
def geoserver_post_save(instance, sender, **kwargs): from geonode.messaging import producer # this is attached to various models, (ResourceBase, Document) # so we should select what will be handled here if isinstance(instance, Layer): instance_dict = model_to_dict(instance) payload = json_serializer_producer(instance_dict) producer.geoserver_upload_layer(payload)
def geoserver_post_save(instance, sender, created, **kwargs): from geonode.messaging import producer # this is attached to various models, (ResourceBase, Document) # so we should select what will be handled here if isinstance(instance, Layer): instance_dict = model_to_dict(instance) payload = json_serializer_producer(instance_dict) producer.geoserver_upload_layer(payload) if getattr(settings, 'DELAYED_SECURITY_SIGNALS', False): instance.set_dirty_state()
def geoserver_post_save(instance, sender, **kwargs): from geonode.messaging import producer # this is attached to various models, (ResourceBase, Document) # so we should select what will be handled here if isinstance(instance, Layer): instance_dict = model_to_dict(instance) payload = json_serializer_producer(instance_dict) producer.geoserver_upload_layer(payload) logger.info("... Creating Thumbnail for Layer [%s]" % (instance.alternate)) try: create_gs_thumbnail(instance, overwrite=True, check_bbox=True) except BaseException: logger.warn("!WARNING! - Failure while Creating Thumbnail for Layer [%s]" % (instance.alternate))
def geoserver_post_save(instance, sender, created, **kwargs): from geonode.messaging import producer # this is attached to various models, (ResourceBase, Document) # so we should select what will be handled here if isinstance(instance, Layer): instance_dict = model_to_dict(instance) payload = json_serializer_producer(instance_dict) producer.geoserver_upload_layer(payload) if getattr(settings, 'DELAYED_SECURITY_SIGNALS', False): instance.set_dirty_state() if instance.storeType != 'remoteStore' and created: logger.info("... Creating Default Resource Linkks for Layer [%s]" % (instance.alternate)) set_resource_default_links(instance, sender, prune=True) logger.info("... Creating Thumbnail for Layer [%s]" % (instance.alternate)) try: create_gs_thumbnail(instance, overwrite=True, check_bbox=True) except BaseException: logger.warn("!WARNING! - Failure while Creating Thumbnail for Layer [%s]" % (instance.alternate))
def geoserver_post_save(instance, sender, **kwargs): from geonode.messaging import producer # this is attached to various models, (ResourceBase, Document) # so we should select what will be handled here if isinstance(instance, Layer): instance_dict = model_to_dict(instance) payload = json_serializer_producer(instance_dict) producer.geoserver_upload_layer(payload) if getattr(settings, 'DELAYED_SECURITY_SIGNALS', False): instance.set_dirty_state() logger.info("... Creating Thumbnail for Layer [%s]" % (instance)) try: thumbnail_task.delay(instance.id, instance.__class__.__name__, overwrite=True, check_bbox=True) except BaseException: logger.warn( "!WARNING! - Failure while Creating Thumbnail for Layer [%s]" % (instance))
def geoserver_post_save(instance, sender, **kwargs): from geonode.messaging import producer instance_dict = model_to_dict(instance) payload = json_serializer_producer(instance_dict) producer.geoserver_upload_layer(payload)