2012-11-05 20:07:16 +01:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
|
|
|
"""
|
|
|
|
***************************************************************************
|
2012-11-07 21:04:51 +01:00
|
|
|
AdminToolsAlgorithmProvider.py
|
2012-11-05 20:07:16 +01:00
|
|
|
---------------------
|
|
|
|
Date : October 2012
|
|
|
|
Copyright : (C) 2012 by Victor Olaya
|
|
|
|
Email : volayaf at gmail dot com
|
|
|
|
***************************************************************************
|
|
|
|
* *
|
|
|
|
* 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 2 of the License, or *
|
|
|
|
* (at your option) any later version. *
|
|
|
|
* *
|
|
|
|
***************************************************************************
|
|
|
|
"""
|
2012-12-15 18:49:32 +01:00
|
|
|
|
2012-11-05 20:07:16 +01:00
|
|
|
__author__ = 'Victor Olaya'
|
|
|
|
__date__ = 'October 2012'
|
|
|
|
__copyright__ = '(C) 2012, Victor Olaya'
|
2013-10-01 20:52:22 +03:00
|
|
|
|
2012-11-05 20:07:16 +01:00
|
|
|
# This will get replaced with a git SHA1 when you do a git archive
|
2013-10-01 20:52:22 +03:00
|
|
|
|
2012-11-05 20:07:16 +01:00
|
|
|
__revision__ = '$Format:%H$'
|
|
|
|
|
2013-10-01 20:52:22 +03:00
|
|
|
import os
|
|
|
|
from PyQt4 import QtGui
|
|
|
|
|
|
|
|
from processing.core.AlgorithmProvider import AlgorithmProvider
|
2014-04-17 01:41:25 +02:00
|
|
|
from PostGISExecuteSQL import PostGISExecuteSQL
|
|
|
|
from ImportIntoPostGIS import ImportIntoPostGIS
|
|
|
|
from ImportVectorIntoGeoServer import ImportVectorIntoGeoServer
|
|
|
|
from CreateWorkspace import CreateWorkspace
|
|
|
|
from ImportRasterIntoGeoServer import ImportRasterIntoGeoServer
|
|
|
|
from DeleteWorkspace import DeleteWorkspace
|
|
|
|
from DeleteDatastore import DeleteDatastore
|
|
|
|
from CreateStyleGeoServer import CreateStyleGeoServer
|
2013-10-01 20:52:22 +03:00
|
|
|
|
2012-11-05 20:07:16 +01:00
|
|
|
|
2012-11-07 21:04:51 +01:00
|
|
|
class AdminToolsAlgorithmProvider(AlgorithmProvider):
|
2012-11-05 20:07:16 +01:00
|
|
|
|
|
|
|
def __init__(self):
|
|
|
|
AlgorithmProvider.__init__(self)
|
2013-10-01 20:52:22 +03:00
|
|
|
self.alglist = [
|
|
|
|
ImportVectorIntoGeoServer(),
|
|
|
|
ImportRasterIntoGeoServer(),
|
|
|
|
CreateWorkspace(),
|
|
|
|
DeleteWorkspace(),
|
|
|
|
DeleteDatastore(),
|
|
|
|
CreateStyleGeoServer(),
|
|
|
|
]
|
2013-02-28 22:08:32 +01:00
|
|
|
|
|
|
|
try:
|
2013-02-24 16:07:21 +01:00
|
|
|
self.alglist.append(ImportIntoPostGIS())
|
|
|
|
self.alglist.append(PostGISExecuteSQL())
|
|
|
|
except:
|
2013-02-28 22:08:32 +01:00
|
|
|
pass
|
2012-11-05 20:07:16 +01:00
|
|
|
|
|
|
|
def initializeSettings(self):
|
|
|
|
AlgorithmProvider.initializeSettings(self)
|
|
|
|
|
|
|
|
def unload(self):
|
|
|
|
AlgorithmProvider.unload(self)
|
|
|
|
|
|
|
|
def getName(self):
|
2013-10-01 20:52:22 +03:00
|
|
|
return 'gspg'
|
2012-11-05 20:07:16 +01:00
|
|
|
|
|
|
|
def getDescription(self):
|
2013-10-01 20:52:22 +03:00
|
|
|
return 'GeoServer/PostGIS tools'
|
2012-11-05 20:07:16 +01:00
|
|
|
|
2012-12-15 18:49:32 +01:00
|
|
|
def getIcon(self):
|
2013-10-01 20:52:22 +03:00
|
|
|
return QtGui.QIcon(os.path.dirname(__file__)
|
2014-04-17 01:41:25 +02:00
|
|
|
+ '/../../images/database.png')
|
2012-11-05 20:07:16 +01:00
|
|
|
|
|
|
|
def _loadAlgorithms(self):
|
|
|
|
self.algs = self.alglist
|
|
|
|
|
|
|
|
def supportsNonFileBasedOutput(self):
|
2013-10-01 20:52:22 +03:00
|
|
|
return False
|