source: mauRepo/MolesManager/trunk/src/libs/migration/client.py @ 8014

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/mauRepo/MolesManager/trunk/src/libs/migration/client.py@8014
Revision 8014, 866 bytes checked in by mnagni, 8 years ago (diff)

The tables are correctly generated and the migration does not show major problem. Good!

Line 
1'''
2Created on 9 Nov 2011
3
4@author: mnagni
5'''
6from libs.migration.db.dbConnection import MOLES3DB, \
7    getObservationCollectionMigrationOrderByDate
8from libs.migration.processor.dataEntity import DataEntityProcessor
9from libs.migration.processor.loadResources import LoadResources
10
11'''
12exist/rest/atoms/published/data_entities/neodc.nerc.ac.uk
13'''
14
15
16session = MOLES3DB.getSession()
17
18'''
19So it works:
20Loads the eXist resources
21Loops over a docStatus
22Loops over the data_entities
23For each data_entity loop over its deployments
24'''
25
26
27lr = LoadResources(session)
28lr.process()
29
30
31sorted_data_ents = getObservationCollectionMigrationOrderByDate(session)
32#loops over the sorted data entities
33for de in sorted_data_ents:
34    de_path = '%s/%s' % (de.exist_path, de.data_ent_name)
35    dep = DataEntityProcessor(de_path, session)
36    dep.process()   
37    session.commit()
38
39
Note: See TracBrowser for help on using the repository browser.