Changeset 8201
- Timestamp:
- 01/04/12 11:04:34 (9 years ago)
- Location:
- mauRepo/MolesManager/trunk/src/libs/migration/processor
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
mauRepo/MolesManager/trunk/src/libs/migration/processor/commons.py
r8199 r8201 582 582 def createMO_Organization(name = None, contactInfo = None): 583 583 ''' 584 Creates a new MO_Organization instance 584 Creates a new MO_Organization instance. 585 TEMPORARILY RETURNS A CI_ORGANIZATION BECAUSE A DB SCHEMA PROBLEM!!!! 585 586 @param name: a String 586 587 @param contactInfo: an array of CI_Contact 587 588 ''' 588 ci_party = MO_Organization()589 ci_party = CI_Organisation() 589 590 if name: 590 591 ci_party.name = name -
mauRepo/MolesManager/trunk/src/libs/migration/processor/deployment.py
r8199 r8201 30 30 from libs.migration.authors import authors 31 31 from logging import StreamHandler 32 import logging, datetime 32 import logging 33 from datetime import date 33 34 from ea_model.iso_19115_2006_metadata_corrigendum.citation_and_responsible_party_information.ci_onlinefunctioncode import CI_OnLineFunctionCode 34 35 from libs.migration.processor.check.check import moles3Append 35 36 from ea_model.iso_19115_2006_metadata_corrigendum.citation_and_responsible_party_information.ci_datetypecode import CI_DateTypeCode 36 37 from ea_model.iso_19115_2006_metadata_corrigendum.constraint_information.md_restrictioncode import MD_RestrictionCode 38 from copy import deepcopy 37 39 38 40 class DeploymentProcessor(object): … … 244 246 if doi['href'] == '10.5285/E8F43A51-0198-4323-A926-FE69225D57DD': 245 247 #dt = createDateTime('21', '11', '04', '01', '07', '25', '35') 246 py_date = date time.date(2011, 4, 1)248 py_date = date(2011, 4, 1) 247 249 dt = createDate(py_date) 248 250 ci_date = createCI_Date(CI_DateTypeCode.cl_publication, date = dt) 249 251 elif doi['href'] == '10.5285/78114093-E2BD-4601-8AE5-3551E62AEF2B': 250 252 #dt = createDateTime('21', '11', '11', '29', '11', '37', '11') 251 py_date = date time.date(2011, 11, 29)253 py_date = date(2011, 11, 29) 252 254 dt = createDate(py_date) 253 255 ci_date = createCI_Date(CI_DateTypeCode.cl_publication, date = dt) … … 287 289 if party: 288 290 observation.relatedParty.append(createMO_ResponsiblePartyInfo_(MO_RoleValue.cl_publisher, [party])) 289 observation.relatedParty.append(createMO_ResponsiblePartyInfo_(MO_RoleValue.cl_custodian, [party]))290 observation.relatedParty.append(createMO_ResponsiblePartyInfo_(MO_RoleValue.cl_distributor, [party]))291 observation.relatedParty.append(createMO_ResponsiblePartyInfo_(MO_RoleValue.cl_pointofcontact, [party]))292 observation.relatedParty.append(createMO_ResponsiblePartyInfo_(MO_RoleValue.cl_metadataowner, [party]))293 observation.relatedParty.append(createMO_ResponsiblePartyInfo_(MO_RoleValue.cl_curator, [party]))291 observation.relatedParty.append(createMO_ResponsiblePartyInfo_(MO_RoleValue.cl_custodian, deepcopy([party]))) 292 observation.relatedParty.append(createMO_ResponsiblePartyInfo_(MO_RoleValue.cl_distributor, deepcopy([party]))) 293 observation.relatedParty.append(createMO_ResponsiblePartyInfo_(MO_RoleValue.cl_pointofcontact, deepcopy([party]))) 294 observation.relatedParty.append(createMO_ResponsiblePartyInfo_(MO_RoleValue.cl_metadataowner, deepcopy([party]))) 295 observation.relatedParty.append(createMO_ResponsiblePartyInfo_(MO_RoleValue.cl_curator, deepcopy([party]))) 294 296 295 297 def _assignPhenomenonTime(self, observation): … … 313 315 def _assignPermission(self, observation): 314 316 access_link = findAccessLinksInMigrationDocument(self._deploymentMigration) 317 dwn_link = findDownloadLinksInMigrationDocument(self._deploymentMigration) 315 318 if len(access_link) == 0: 316 319 access_link = findAccessLinksInMigrationDocument(self._dataEntityMigration) … … 318 321 i_accessConstraints = [] 319 322 i_use_limitation = [] 323 md_legal_constraints = None 320 324 321 325 if len(access_link) == 0: 322 dwn_link = findDownloadLinksInMigrationDocument(self._deploymentMigration)323 if len(dwn_link) == 0:324 dwn_link = findDownloadLinksInMigrationDocument(self._dataEntityMigration)325 if dwn_link and len(dwn_link) == 1:326 i_use_limitation.append("These data are open access and available through %s." % (dwn_link['href']))327 #i_accessConstraints.append(MD_RestrictionCode.cl_)326 if len(dwn_link) == 0: 327 dwn_link = findDownloadLinksInMigrationDocument(self._dataEntityMigration) 328 if dwn_link and len(dwn_link) == 1: 329 i_use_limitation.append("These data are open access and available through %s." % (dwn_link[0]['href']) ) 330 #i_accessConstraints.append(MD_RestrictionCode.cl_) 331 observation.permission = createMD_LegalConstraints(useLimitation = i_use_limitation, accessConstrains = i_accessConstraints) 328 332 else: 329 333 if access_link and len(access_link) == 1: 330 i_use_limitation.append("Access to these data is restricted. To obtain access please apply for access at: %s" % (access_link[ 'href']))334 i_use_limitation.append("Access to these data is restricted. To obtain access please apply for access at: %s" % (access_link[0]['href'])) 331 335 i_accessConstraints.append(MD_RestrictionCode.cl_restricted) 332 333 createMD_LegalConstraints(useLimitation = i_use_limitation, accessConstrains = i_accessConstraints) 334 336 observation.permission = createMD_LegalConstraints(useLimitation = i_use_limitation, accessConstrains = i_accessConstraints) 337 335 338 ''' 336 339 contentDict = extractContent(self._deploymentMigration)
Note: See TracChangeset
for help on using the changeset viewer.