Source code for geonode.geoserver

#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
#########################################################################

import logging
from django.conf import settings
from django.utils.translation import ugettext_noop as _
from geonode.notifications_helper import NotificationsAppConfigBase


[docs] logger = logging.getLogger(__name__)
[docs] def run_setup_hooks(*args, **kwargs): from django.db.models import signals from geonode.layers.models import Dataset from geonode.maps.models import MapLayer from geonode.geoserver.signals import geoserver_pre_delete from geonode.geoserver.signals import geoserver_pre_save_maplayer signals.pre_delete.connect(geoserver_pre_delete, sender=Dataset) signals.pre_save.connect(geoserver_pre_save_maplayer, sender=MapLayer)
[docs] class GeoserverAppConfig(NotificationsAppConfigBase):
[docs] name = "geonode.geoserver"
[docs] NOTIFICATIONS = ( ( "dataset_uploaded", _("Dataset Uploaded"), _("A layer was uploaded"), ), ( "dataset_rated", _("Rating for Dataset"), _("A rating was given to a layer"), ), )
[docs] def ready(self): super().ready() run_setup_hooks() # Connect the post_migrate signal with the _set_resource_links # method to update links for each resource from django.db.models import signals signals.post_migrate.connect(set_resource_links, sender=self)
[docs] default_app_config = "geonode.geoserver.GeoserverAppConfig"
[docs] BACKEND_PACKAGE = "geonode.geoserver"