Changeset 8250 for mauRepo


Ignore:
Timestamp:
18/04/12 12:41:33 (8 years ago)
Author:
mnagni
Message:

Incomplete - # 22428: CEDA Project - observationCollection
 http://team.ceda.ac.uk/trac/ceda/ticket/22428
Complete - # 22388: CEDA Observation - inSupportOf
 http://team.ceda.ac.uk/trac/ceda/ticket/22388
Complete - # 22386: CEDA Observation - title
 http://team.ceda.ac.uk/trac/ceda/ticket/22386

Location:
mauRepo/MolesManager/trunk
Files:
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • mauRepo/MolesManager/trunk

    • Property svn:ignore
      •  

        old new  
         1.project 
         2.settings 
        13.directory 
        2 .project 
        34.pydevproject 
        4 .settings 
  • mauRepo/MolesManager/trunk/src/MolesManager/moles3epb.py

    r8245 r8250  
    224224            intSession.commit() 
    225225 
    226     @classmethod 
    227     def addIdentifierToObservation(self, identifier, observation, session = None, commit = False): 
    228         """ 
    229             Adds an identifier element to an Observation if still not assigned or not equal. 
    230             @param identifier: the responsibleParty element to persist 
    231             @param observation: the observation to update 
    232             @param session: the session to use for the operation 
    233             @param commit: if True commits at the end (defaul False)  
    234         """           
    235         intSession = Moles3EPB._getSession(session) 
    236         if not identifier in observation.identifier: 
    237             observation.identifier.append(identifier) 
    238         if commit: 
    239             intSession.commit() 
    240226 
    241227    @classmethod         
  • mauRepo/MolesManager/trunk/src/MolesManager/settings.py

    r8249 r8250  
    2727    'default': { 
    2828        'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. 
    29         #'NAME': 'c:/virtualenvs/www/MolesManager/src/sqlite.db', #'/misc/frigid3/humid1/mnagni/workspaces/moles3/MolesManager/src/sqlite.db',                      # Or path to database file if using sqlite3. 
    30         #'NAME': '/misc/frigid3/humid1/mnagni/workspaces/moles3/MolesManager/src/sqlite.db',                      # Or path to database file if using sqlite3. 
    3129        'NAME': PROJECT_ROOT+'/sqlite.db',                      # Or path to database file if using sqlite3. 
    3230        'USER': '',                      # Not used with sqlite3. 
     
    210208MOLES3 = 'moles3' 
    211209#MOLES3_DB_CONNECTION = 'postgresql://user:pws@host:port/dbName' 
    212 MOLES3_DB_CONNECTION = 'postgresql://badc:rotyn217m@neptune.badc.rl.ac.uk:5432/ceda_moles3_test'#'PG_MOLES3_DB_CONNECTION' 
     210MOLES3_DB_CONNECTION = 'PG_MOLES3_DB_CONNECTION' 
    213211from sqlTables import doTables as doMoles, attachEvents 
    214212MOLES3_DB_SCRIPT = doMoles 
     
    219217MIGRATION = 'migration' 
    220218#MIGRATION_DB_CONNECTION = 'postgresql://user:pws@host:port/dbName' 
    221 MIGRATION_DB_CONNECTION = 'postgresql://badc:rotyn217m@neptune.badc.rl.ac.uk:5432/ceda_moles3_test'#'PG_MIGRATION_DB_CONNECTION' 
     219MIGRATION_DB_CONNECTION = 'PG_MIGRATION_DB_CONNECTION' 
    222220from libs.migration.db.migrationTables import doTables as doMigration 
    223221MIGRATION_DB_SCRIPT = doMigration 
    224222 
    225223#INFO_DB_CONNECTION = 'postgresql://user:pws@host:port/dbName' 
    226 INFO_DB_CONNECTION = 'postgresql://badc:rotyn217m@neptune.badc.rl.ac.uk:5432/ceda_moles3_test'#'PG_INFO_DB_CONNECTION' 
    227  
    228  
    229 RUN_MIGRATION = False 
     224INFO_DB_CONNECTION = 'PG_INFO_DB_CONNECTION' 
     225 
     226 
     227RUN_MIGRATION = True 
    230228#Default to one day 
    231229MIGRATION_INTERVAL = 86400 
    232230 
    233231# Set this boolean to include static URL patterns for CSS, JS, etc. in urls.py 
    234 SERVE_STATIC_CONTENT = True 
     232SERVE_STATIC_CONTENT = False 
    235233 
    236234# Local modifications to settings are imported from settings_local.py 
  • mauRepo/MolesManager/trunk/src/libs/migration/processor/deployment.py

    r8247 r8250  
    2121    createDQ_Element, createDQ_ConformanceResult, findUpdatedDate,\ 
    2222    createMD_Metadata, createMO_OnlineResource, createCEDA_Review, calculateHash,\ 
    23     createCI_ResponsibleParty, extractUpdateFrequency 
     23    createCI_ResponsibleParty, extractUpdateFrequency,\ 
     24    findLinksInMigrationDocument, findSubTypeInDPT 
    2425from ea_model.moles3_4.utilities.mo_rolevalue import MO_RoleValue 
    2526from ea_model.ceda_metadatamodel.ceda_observation.ceda_observation import CEDA_Observation 
     
    199200         
    200201        if doc_title.startswith('deployment_') or doc_title.startswith('Deployment_'): 
    201             doc_title = extractTitle(self._dataEntityMigration)             
     202            links = findLinksInMigrationDocument(self._deploymentMigration) 
     203            dptList = links['DPT'] 
     204            if links.has_key('DPT'): 
     205                doc_title = 'Data from ' + dptList[0]['title'] 
     206                if len(dptList) > 2: 
     207                    for dpt in dptList[1:-2]: 
     208                        doc_title += ', ' + dpt['title'] 
     209                    if len(dptList) > 1: 
     210                        doc_title += ' and ' + dptList[-1] 
     211                                                         
     212            links = findLinksInDeployment(self._deploymentMigration) 
     213            if links.has_key('OBS'): 
     214                obsList = [] 
     215                for obs in links['OBS']: 
     216                    observationStation = MigrationEPB.getDeploymentDataMigrationByName(self._deploymentMigration, obs + \ 
     217                                                                                   '.atom', self._migrationSessions.migrationSession) 
     218                    obsList.append((extractTitle(observationStation), findSubTypeInDPT(observationStation))) 
     219                 
     220                if obsList[0][1] in ['stationary platform' ,'moving platform', 'ship','aircraft','satellite','computer']: 
     221                    doc_title += ' on ' 
     222                else :  
     223                    doc_title += ' at ' 
     224                    doc_title += obsList[0][0] 
     225                if len(obsList) > 2: 
     226                    for obs in obsList[1:-2]: 
     227                        doc_title += ', ' + obs[0] 
     228                    if len(obsList) > 1: 
     229                        doc_title += ' and ' + obsList[-1][0] 
     230             
     231            if links.has_key('ACTIVITY'):              
     232                for link in links['ACTIVITY']: 
     233                    activity = MigrationEPB.getDeploymentDataMigrationByName(self._deploymentMigration, link + '.atom', \ 
     234                                                                             self._migrationSessions.migrationSession)                     
     235      
     236                    projSubType = findSubTypeInDPT(activity) 
     237                    doc_title += ' for the ' + extractTitle(activity) 
     238                    if projSubType[0:8] == 'Activity': 
     239                        doc_title += ' ' + projSubType[8:] 
     240                    else : 
     241                        doc_title += ' ' + projSubType 
     242                                                        
     243        else: 
     244            doc_title = extractTitle(self._dataEntityMigration) 
     245            if doc_title[0:10] != 'Data from' : 
     246                doc_title = "Data from " + doc_title             
    202247        auth = createCI_Citation(title = 'ceda_title')                   
    203248        identifier = createMD_Identifier(code = doc_title, authority = auth) 
     
    430475        self._assignLineage(ceda_observation) 
    431476        self._assignDescription(ceda_observation) 
    432         self._assignName(ceda_observation) 
    433477        self._assignTitle(ceda_observation) 
    434478        self._assignResult(ceda_observation)     
     
    443487        self._assignInternalReview(ceda_observation)         
    444488        self._assignLanguage(ceda_observation) 
    445         self._assignUpdateFrequency(ceda_observation)                         
     489        self._assignUpdateFrequency(ceda_observation)     
     490        self._assignName(ceda_observation)                             
    446491        Moles3EPB.addCedaObject(ceda_observation, self._migrationSessions.molesSession, True) 
    447492         
     
    485530             
    486531        if project: 
    487             ceda_observation.inSupportOf = project           
    488              
     532            ceda_observation.inSupportOf = project                   
     533                     
    489534        if procedure or project:                         
    490535            self._migrationSessions.molesSession.commit() 
Note: See TracChangeset for help on using the changeset viewer.