Changeset 4798


Ignore:
Timestamp:
13/01/09 09:54:32 (11 years ago)
Author:
cbyrom
Message:

Change MILK stack to use ndgCommon instead of ndgUtils.

Location:
MILK/trunk/milk_server
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • MILK/trunk/milk_server/milk_server/config/milkMiddleware.py

    r4724 r4798  
    33''' 
    44from paste.deploy import CONFIG 
    5 from ndgUtils.models.myconfig import myConfig 
    6 from ndgUtils.lib.atomvalidator import AtomValidator 
     5from ndg.common.src.models.myconfig import myConfig 
     6from ndg.common.src.lib.atomvalidator import AtomValidator 
    77import milk_server.lib.helpers as h 
    88 
  • MILK/trunk/milk_server/milk_server/controllers/atom_editor/atomeditorcontroller.py

    r4779 r4798  
    55''' 
    66import logging, xmlrpclib, cgi, traceback 
    7 from ndgUtils import ndgObject 
    8 from ndgUtils.models.Atom import Atom 
    9 from ndgUtils.lib.utilities import escapeSpecialCharacters 
    10 import ndgUtils.lib.existdbclient as edc 
     7from ndg.common.src.models.ndgObject import ndgObject 
     8from ndg.common.src.models.Atom import Atom 
     9from ndg.common.src.lib.utilities import escapeSpecialCharacters 
     10import ndg.common.src.clients.xmldb.eXist.existdbclient as edc 
    1111from milk_server.lib.base import * 
     12from milk_server.lib.ndgInterface import ndgInterface  
     13from milk_server.lib import Utilities 
    1214from editorconstants import * 
    13 from milk_server.lib.ndgInterface import ndgInterface  
    1415from formencode import htmlfill 
    15 from milk_server.lib import Utilities 
    1616    
    1717class AtomEditorController(BaseController): 
  • MILK/trunk/milk_server/milk_server/controllers/atom_editor/editatom.py

    r4779 r4798  
    1313from milk_server.models.form import * 
    1414from milk_server.lib import mailer 
    15 import ndgUtils.lib.htmlUtilities as utils 
    16 from ndgUtils.models.Atom import Atom, Person, Link, Category 
    17 from ndgUtils.models import AtomState 
    18 from ndgUtils.lib.atomvalidator import ValidationError 
    19 import ndgUtils.lib.existdbclient as edc 
    20 from ndgUtils.models.MolesEntity import MolesEntity as ME 
    21 from ndgUtils.lib.utilities import escapeSpecialCharacters 
    22 from ndgUtils.models.vocabtermdata import VocabTermData as VTD 
    23 from ndgUtils.lib.granulite import granulite 
     15import ndg.common.src.lib.htmlUtilities as utils 
     16from ndg.common.src.models.Atom import Atom, Person, Link, Category 
     17from ndg.common.src.models import AtomState 
     18from ndg.common.src.lib.atomvalidator import ValidationError 
     19import ndg.common.src.clients.xmldb.eXist.existdbclient as edc 
     20from ndg.common.src.models.MolesEntity import MolesEntity as ME 
     21from ndg.common.src.lib.utilities import escapeSpecialCharacters 
     22from ndg.common.src.models.vocabtermdata import VocabTermData as VTD 
     23from ndg.common.src.lib.granulite import granulite 
    2424from editorconstants import * 
    2525from atomeditorcontroller import AtomEditorController 
  • MILK/trunk/milk_server/milk_server/controllers/atom_editor/listatom.py

    r4779 r4798  
    66''' 
    77import logging, xmlrpclib 
    8 from ndgUtils.models.Atom import Atom 
    9 from ndgUtils import DocumentRetrieve 
    10 from ndgUtils.eXistInterface import ndg_eXist 
    11 from ndgUtils.models.vocabtermdata import VocabTermData as VTD, VocabTermItem as VTI 
     8from ndg.common.src.models.Atom import Atom 
     9from ndg.common.src.dal.DocumentRetrieve import DocumentRetrieve 
     10from ndg.common.src.clients.xmldb.eXist.eXistInterface import ndg_eXist 
     11from ndg.common.src.models.vocabtermdata import VocabTermData as VTD, VocabTermItem as VTI 
    1212from milk_server.lib.base import * 
    1313from editorconstants import * 
    14 import ndgUtils.lib.htmlUtilities as utils 
     14import ndg.common.src.lib.htmlUtilities as utils 
    1515from atomeditorcontroller import AtomEditorController 
    1616    
  • MILK/trunk/milk_server/milk_server/controllers/browse/discovery.py

    r4491 r4798  
    44import socket, logging 
    55from paste.request import parse_querystring 
    6 from ndgUtils import ndgSearch 
    7 from ndgUtils import DocumentRetrieve 
    8 from ndgUtils.DocumentRetrieve import ndgVocabPOX as VS 
    9 from ndgUtils import ndgObject 
    10 from ndgUtils.models.DIF import DIF 
     6from ndg.common.src.clients.ws.ndgSearch import ndgSearch 
     7from ndg.common.src.dal import DocumentRetrieve 
     8from ndg.common.src.dal.DocumentRetrieve import ndgVocabPOX as VS 
     9from ndg.common.src.models.ndgObject import ndgObject 
     10from ndg.common.src.models.DIF import DIF 
    1111from milk_server.lib.base import * 
    1212from milk_server.lib.Date import * 
  • MILK/trunk/milk_server/milk_server/controllers/browse/retrieve.py

    r4779 r4798  
    11 
     2import logging 
     3from paste.request import parse_querystring 
     4from xml.parsers.expat import ExpatError 
    25from milk_server.lib.base import * 
    3 from ndgUtils import ndgObject 
    4 from paste.request import parse_querystring 
    5 from ndgUtils.models import stubB, DIF 
     6from milk_server.lib import Utilities 
    67from milk_server.lib import mailer 
    78from milk_server.lib.ndgInterface import ndgInterface  
    8 from ndgUtils.models.DIF import DIF 
    9 from xml.parsers.expat import ExpatError 
    10 import logging 
    11 from ndgUtils.models.Atom import Atom 
    12 from ndgUtils.models.vocabtermdata import VocabTermData as VTD 
    13 from ndgUtils import DocumentRetrieve 
    14 from milk_server.lib import Utilities 
     9from ndg.common.src.models import stubB, DIF, ndgObject 
     10from ndg.common.src.models.ndgObject import ndgObject 
     11from ndg.common.src.models.Atom import Atom 
     12from ndg.common.src.models.vocabtermdata import VocabTermData as VTD 
     13from ndg.common.src.dal import DocumentRetrieve 
    1514 
    1615class RetrieveController(BaseController): 
  • MILK/trunk/milk_server/milk_server/lib/Utilities.py

    r4779 r4798  
    11import urllib, logging 
    22from milk_server.lib.base import * 
    3 import ndgUtils.lib.existdbclient as edc 
     3import ndg.common.src.clients.xmldb.eXist.existdbclient as edc 
    44 
    55def getExistClient(providerID): 
  • MILK/trunk/milk_server/milk_server/lib/app_globals.py

    r4668 r4798  
    11from pylons import config 
    2 from ndgUtils.models.vocabtermdata import VocabTermData as VTD 
     2from ndg.common.src.models.vocabtermdata import VocabTermData as VTD 
    33 
    44class Globals(object): 
  • MILK/trunk/milk_server/milk_server/lib/ndgInterface.py

    r4625 r4798  
    1010from csml_cache import CSMLExtractCache 
    1111import os, logging 
    12 from ndgUtils import ndgRetrieve, ndgObject, xmlHandler2 
     12from ndg.common.src.dal.ndgRetrieve import ndgRetrieve 
     13from ndg.common.src.models.ndgObject import ndgObject 
     14from ndg.common.src.lib import xmlHandler2 
    1315from pylons import request, session 
    1416 
  • MILK/trunk/milk_server/milk_server/tests/functional/test_listatom.py

    r4779 r4798  
    11""" 
    2 Test cases for the ows retrieve controller 
     2Test cases for the listatom controller 
    33 
    44NERC Data Grid Project 
     
    1515from milk_server.tests import * 
    1616import logging, os 
    17 import ndgUtils.lib.existdbclient as dbc 
     17import ndg.common.src.clients.xmldb.eXist.existdbclient as dbc 
    1818import ndgutilstests.testconstants as tc 
    1919from ndgutilstests.testutils import testUtils as tu 
    2020from milk_server.controllers.atom_editor.editorconstants import * 
    21 import ndgUtils.lib.lib.htmlUtilities as utils 
    22 from ndgUtils.models.vocabtermdata import VocabTermData as VTD 
     21import ndg.common.src.lib.htmlUtilities as utils 
     22from ndg.common.src.models.vocabtermdata import VocabTermData as VTD 
    2323 
    2424logging.basicConfig(level=logging.DEBUG, 
     
    4141    def testInvalidURIIndex(self): 
    4242        try: 
    43             url = url_for(controller='atom_editor/listatom', action='atomHome') 
     43            url = url_for('home') 
    4444            url += '/blah' 
    4545            response = self.app.get(url) 
     
    5050 
    5151    def testAtomHome(self): 
    52         response = self.app.get(url_for(controller='atom_editor/listatom', \ 
    53                                         action='atomHome'), status = 200) 
     52        response = self.app.get(url_for('home'), status = 200) 
    5453        self.assertTrue(response.body.find(ATOM_HOME_TITLE) > -1) 
    5554 
    5655 
    5756    def testExampleGranulite(self): 
    58         response = self.app.get(url_for(controller='atom_editor/listatom', \ 
    59                                         action='showExampleGranulite'), status = 200) 
     57        response = self.app.get(url_for('example'), status = 200) 
    6058        self.assertTrue(response.body.find(EXAMPLE_GRANULITE_TITLE) > -1) 
    6159 
    6260 
    6361    def testListAtomHome(self): 
    64         response = self.app.get(url_for(controller='atom_editor/listatom', \ 
    65                                         action='list'), status = 200) 
     62        response = self.app.get(url_for('list'), status = 200) 
    6663        self.assertTrue(response.body.find(LIST_ATOM_TITLE) > -1) 
    6764 
    6865 
    6966    def testListAtomSearchDataZero(self): 
    70         response = self.app.get(url_for(controller='atom_editor/listatom', \ 
    71                                         action='list', searchData='0'), status = 200) 
    72         self.assertTrue(response.body.find(LIST_ATOM_TITLE) > -1) 
    73         response2 = self.app.get(url_for(controller='atom_editor/listatom', \ 
    74                                         action='list'), status = 200) 
     67        response = self.app.get(url_for('list', searchData='0'), status = 200) 
     68        self.assertTrue(response.body.find(LIST_ATOM_TITLE) > -1) 
     69        response2 = self.app.get(url_for('list'), status = 200) 
    7570        self.assertEquals(response2.body, response.body) 
    7671             
     
    7974        # NB, this will be ignored - in the absense of filter data specified,  
    8075        # so should just return the standard home page 
    81         response = self.app.get(url_for(controller='atom_editor/listatom', \ 
    82                                         action='list', searchData='1'), status = 200) 
    83         self.assertTrue(response.body.find(LIST_ATOM_TITLE) > -1) 
    84         response2 = self.app.get(url_for(controller='atom_editor/listatom', \ 
    85                                         action='list', searchData='0'), status = 200) 
     76        response = self.app.get(url_for('list', searchData='1'), status = 200) 
     77        self.assertTrue(response.body.find(LIST_ATOM_TITLE) > -1) 
     78        response2 = self.app.get(url_for('list', searchData='0'), status = 200) 
    8679        self.assertEquals(response.body, response2.body) 
    8780 
    8881 
    8982    def testListAtomGranuleAssociationType(self): 
    90         response = self.app.get(url_for(controller='atom_editor/listatom', \ 
    91                                         action='list', \ 
    92                                         associationType=utils.GRANULE_ASSOCIATION), status = 200) 
     83        response = self.app.get(url_for('list', \ 
     84                                        associationType=utils.GRANULE_ASSOCIATION),  
     85                                        status = 200) 
    9386        self.assertTrue(response.body.find(GRANULE_ASSOCIATION_TITLE) > -1) 
    9487 
    9588 
    9689    def testListAtomDeploymentAssociationType(self): 
    97         response = self.app.get(url_for(controller='atom_editor/listatom', \ 
    98                                         action='list', \ 
    99                                         associationType=utils.DEPLOYMENT_ASSOCIATION), status = 200) 
     90        response = self.app.get(url_for('list', \ 
     91                                        associationType=utils.DEPLOYMENT_ASSOCIATION),  
     92                                        status = 200) 
    10093        self.assertTrue(response.body.find(DEPLOYMENTS_ASSOCIATION_TITLE) > -1) 
    10194 
    10295 
    10396    def testListAtomEntityAssociationType(self): 
    104         url = url_for(controller='atom_editor/listatom', \ 
    105                       action='list', associationType=utils.ENTITY_ASSOCIATION) 
     97        url = url_for('list', associationType=utils.ENTITY_ASSOCIATION) 
    10698         
    10799        response = self.app.get(url, status = 200) 
     
    112104        # NB, this invalid type code will be ignored -   
    113105        # so should just return the standard home page 
    114         url = url_for(controller='atom_editor/listatom', \ 
    115                                         action='list', \ 
    116                                         associationType='69') 
     106        url = url_for('list', associationType='69') 
    117107        response = self.app.get(url) 
    118108 
     
    128118        # NB, this code determines whether listed data can be added to the 
    129119        # associated atom - so will not affect the basic list set up 
    130         url = url_for(controller='atom_editor/listatom', \ 
    131                       action='list', associatedAtomType='blah') 
     120        url = url_for('list', associatedAtomType='blah') 
    132121         
    133122        response = self.app.get(url, status = 200) 
     
    143132        # NB, this code determines the return, save url - which will not be displayed 
    144133        # without search results - so will not affect the basic list set up 
    145         url = url_for(controller='atom_editor/listatom', \ 
    146                       action='list', associatedAtomID='blah') 
     134        url = url_for('list', associatedAtomID='blah') 
    147135         
    148136        response = self.app.get(url, status = 200) 
     
    158146        # NB, we've created a granule in set up, so this will return at least 
    159147        # one result 
    160         url = url_for(controller='atom_editor/listatom', \ 
    161                       action='list', searchData='1') 
     148        url = url_for('list', searchData='1') 
    162149        v = VTD() 
    163150        provider = v.getVTI(VTD.BADC_TERM) 
     
    186173        # NB, we've created a granule in set up, so this will return at least 
    187174        # one result 
    188         url = url_for(controller='atom_editor/listatom', \ 
    189                       action='list', searchData='1') 
     175        url = url_for('list', searchData='1') 
    190176        v = VTD() 
    191177        provider = v.getVTI(VTD.BADC_TERM) 
     
    215201        # NB, we've created a granule in set up, so this will return at least 
    216202        # one result 
    217         url = url_for(controller='atom_editor/listatom', \ 
    218                       action='list', searchData='1') 
     203        url = url_for('list', searchData='1') 
    219204        v = VTD() 
    220205        provider = v.getVTI(VTD.BADC_TERM) 
  • MILK/trunk/milk_server/setup.py

    r4466 r4798  
    1313                      "TurboKid",  
    1414                      "ows_common",  
    15                       "ndgUtils", 
    16                       "ZSI" # Used for vocab service client 
     15                      "ndgCommon" 
    1716                      ], 
    1817    dependency_links = ["http://ndg.nerc.ac.uk/dist"], 
Note: See TracChangeset for help on using the changeset viewer.