Changeset 8199


Ignore:
Timestamp:
31/03/12 15:03:44 (8 years ago)
Author:
mnagni
Message:

Incomplete - # 22399: CEDA Observation - permission
 http://team.ceda.ac.uk/trac/ceda/ticket/22399

Location:
mauRepo/MolesManager/trunk/src/libs/migration/processor
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • mauRepo/MolesManager/trunk/src/libs/migration/processor/commons.py

    r8198 r8199  
    669669    return md_constraints 
    670670 
    671 def createMD_LegalConstraints(useLimitation = None): 
     671def createMD_LegalConstraints(useLimitation = None, accessConstrains = None): 
    672672    """ 
    673673        Creates a new MD_LegalConstrains 
    674674        @param useLimitation: a string array 
     675        @param accessConstrains: an MD_RestrictionCode array  
    675676    """  
    676677    md_legalconstraints = MD_LegalConstraints() 
    677678    if useLimitation and type(useLimitation) == list: 
    678679        md_legalconstraints.useLimitation = useLimitation 
     680    if accessConstrains and type(accessConstrains) == list: 
     681        md_legalconstraints.accessConstrains = accessConstrains         
    679682    return md_legalconstraints 
    680683 
  • mauRepo/MolesManager/trunk/src/libs/migration/processor/deployment.py

    r8198 r8199  
    1818    createCI_Telephone, extractMolesTemporalRange, isoDateStringToTimeDate,\ 
    1919    createTM_Period, createCI_Individual, findAccessLinksInMigrationDocument,\ 
    20     findLinksInDeployment 
     20    findLinksInDeployment, createMD_LegalConstraints 
    2121from ea_model.moles3_4.utilities.mo_rolevalue import MO_RoleValue 
    2222from ea_model.ceda_metadatamodel.ceda_observation.ceda_observation import CEDA_Observation 
     
    3434from libs.migration.processor.check.check import moles3Append 
    3535from ea_model.iso_19115_2006_metadata_corrigendum.citation_and_responsible_party_information.ci_datetypecode import CI_DateTypeCode 
     36from ea_model.iso_19115_2006_metadata_corrigendum.constraint_information.md_restrictioncode import MD_RestrictionCode 
    3637 
    3738class DeploymentProcessor(object): 
     
    314315        if len(access_link) == 0: 
    315316            access_link = findAccessLinksInMigrationDocument(self._dataEntityMigration)  
    316                     
     317 
     318        i_accessConstraints = [] 
     319        i_use_limitation = [] 
     320         
     321        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_) 
     328        else: 
     329            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'])) 
     331                i_accessConstraints.append(MD_RestrictionCode.cl_restricted) 
     332                             
     333        createMD_LegalConstraints(useLimitation = i_use_limitation, accessConstrains = i_accessConstraints) 
     334         
     335        '''                                 
    317336        contentDict = extractContent(self._deploymentMigration) 
    318337        if not contentDict.has_key('access-restricted'): 
    319338            contentDict = extractContent(self._dataEntityMigration) 
    320         ## TO BE DONE 
     339        ''' 
    321340             
    322341    def _assignMoles2Link(self, ceda_observation): 
Note: See TracChangeset for help on using the changeset viewer.