Last active
August 29, 2015 14:10
-
-
Save tomkralidis/a6da22b546d6a395aeed to your computer and use it in GitHub Desktop.
metador2 repository plugin ideas
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Copy https://github.com/geopython/pycsw/blob/master/pycsw/repository.py to https://github.com/geopython/pycsw/blob/master/pycsw/plugins/repository/metador2/metador2.py and edit the insert/update/delete functions accordingly. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [repository] | |
| ... | |
| source=metador2 | |
| ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/pycsw/server.py b/pycsw/server.py | |
| index 861cb72..3412862 100644 | |
| --- a/pycsw/server.py | |
| +++ b/pycsw/server.py | |
| @@ -275,6 +275,22 @@ class Csw(object): | |
| 'NoApplicableCode', 'service', | |
| 'Could not load repository (odc): %s' % str(err)) | |
| + elif (self.config.has_option('repository', 'source') and | |
| + self.config.get('repository', 'source') == 'metador2'): | |
| + | |
| + # load odc repository | |
| + from pycsw.plugins.repository.metador2 import metador2 | |
| + | |
| + try: | |
| + self.repository = \ | |
| + metador2.Metador2Repository(self.context) | |
| + LOGGER.debug('Metador2 repository loaded: %s.' % \ | |
| + self.repository.dbtype) | |
| + except Exception, err: | |
| + self.response = self.exceptionreport( | |
| + 'NoApplicableCode', 'service', | |
| + 'Could not load repository (metador2): %s' % str(err)) | |
| + | |
| else: # load default repository | |
| self.orm = 'sqlalchemy' | |
| from pycsw import repository |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment