source: mauRepo/MolesManager/trunk/src/libs/migration/processor/deployment.py @ 8207

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/mauRepo/MolesManager/trunk/src/libs/migration/processor/deployment.py@8207
Revision 8207, 24.9 KB checked in by mnagni, 8 years ago (diff)

Complete - # 22388: CEDA Observation - inSupportOf
 http://team.ceda.ac.uk/trac/ceda/ticket/22388

Line 
1'''
2Created on 15 Nov 2011
3
4@author: mnagni
5'''
6from libs.migration.processor.commons import findMolesLineage,\
7    createMO_ResponsiblePartyInfo,\
8    DO_BADC, DO_NEODC, findAuthorsInResource, CEDA,\
9    createMD_Identifier, extractSummary, extractQuality, \
10    hasAtomDocumentSameHash, getAtomDocumentHashByMO, extractTitle,\
11        createCEDA_Result,\
12    createEX_GeographicBoundingBox, extractGeographicExtentInMigrationDocument, findDownloadLinksInMigrationDocument,\
13    findDOIInMigrationDocument, extractContent, createCI_Citation, createCI_Date, createDate,\
14    createTM_Position, createTM_Instant, extractMolesCreationDate,\
15    createDateTime, isoDateTimeStringToTimeDate, extractMolesProviderID,\
16    DO_UKSSDC, createMO_ResponsiblePartyInfo_, createMO_Organization,\
17    createCI_Contact, createCI_Address, createCI_OnlineResource,\
18    createCI_Telephone, extractMolesTemporalRange, isoDateStringToTimeDate,\
19    createTM_Period, createCI_Individual, findAccessLinksInMigrationDocument,\
20    findLinksInDeployment, createMD_LegalConstraints, extractMolesQuality,\
21    createDQ_Element, createDQ_ConformanceResult, findUpdatedDate,\
22    createMD_Metadata
23from ea_model.moles3_4.utilities.mo_rolevalue import MO_RoleValue
24from ea_model.ceda_metadatamodel.ceda_observation.ceda_observation import CEDA_Observation
25from libs.migration.MigrationEPB import MigrationEPB
26from libs.epb import EPB
27from libs.migration.processor.deployment_data import DeploymentDataProcessor
28from ea_model.moles3_4.utilities.mo_publicationstatevalue import MO_PublicationStateValue
29from libs.migration.exception.exceptions import NoDataLineage,\
30    NoAssociatedAuthor
31from MolesManager.moles3epb import Moles3EPB
32from libs.migration.authors import authors
33from logging import StreamHandler
34import logging
35from datetime import date
36from ea_model.iso_19115_2006_metadata_corrigendum.citation_and_responsible_party_information.ci_onlinefunctioncode import CI_OnLineFunctionCode
37from libs.migration.processor.check.check import moles3Append
38from ea_model.iso_19115_2006_metadata_corrigendum.citation_and_responsible_party_information.ci_datetypecode import CI_DateTypeCode
39from ea_model.iso_19115_2006_metadata_corrigendum.constraint_information.md_restrictioncode import MD_RestrictionCode
40from copy import deepcopy
41import datetime
42
43class DeploymentProcessor(object):
44    '''
45        Migrates a deployment element in a CEDA_Observation entity
46    '''
47    publisherName = 'CEDA'
48   
49    log = logging.getLogger('DeploymentProcessor')
50    log.addHandler(StreamHandler())
51    log.setLevel(logging.DEBUG)   
52    def __init__(self, dataEntityMigration, deploymentMigration, migrationSessions):
53        '''
54            Initializes the class
55            @param dataEntityMigration: a DataEntityMigration instance
56            @param deploymentMigration: the DeploymentMigration instance
57            @param migrationSessions: a MigrationSessions instance   
58        '''             
59        self._dataEntityMigration = dataEntityMigration
60        self._deploymentMigration = deploymentMigration
61        self._dataEntityHasSameHash = hasAtomDocumentSameHash(self._dataEntityMigration) and self._dataEntityMigration.doc_hash is not None
62        self._deploymentHasSameHash = hasAtomDocumentSameHash(self._deploymentMigration) and self._deploymentMigration.doc_hash is not None
63       
64        self._migrationSessions = migrationSessions
65
66    def _existsCEDAasPublisher(self):
67        for rp in self._ceda_observation.relatedParty:
68            if rp.role == MO_RoleValue.cl_publisher:
69                for party in rp.parties:
70                    if party.name == DeploymentProcessor.publisherName:
71                        return True
72        return False
73                   
74    def _extractResponsiblePartyInfo(self, authors = None, parsedParties = []):
75        '''
76            @param authors: the deployment's authors
77            @param parsedParties: a list to fill with the created MO_ResponsiblePartyInfos
78        '''
79        #First is assumend to be the author
80        parsedParties.append(createMO_ResponsiblePartyInfo(MO_RoleValue.cl_author, authors[:1]))   
81        parsedParties.append(createMO_ResponsiblePartyInfo(MO_RoleValue.cl_coinvestigator, authors[1:]))           
82
83    def _addResponsiblePartyInfo(self, oldResponsiblePartyInfos, newResponsiblePartyInfo):
84        opi = None
85        for oldPartyInfo in oldResponsiblePartyInfos:
86            if oldPartyInfo.role == newResponsiblePartyInfo.role:
87                opi = oldPartyInfo
88                break
89           
90        if len(oldResponsiblePartyInfos) == 0 or opi is None:
91            oldResponsiblePartyInfos.append(newResponsiblePartyInfo)
92       
93        if opi is not None: 
94            for np in newResponsiblePartyInfo.party:
95                opi.party.append(np)
96
97    def _appendResponsibleParty(self, observation, names, creation_function, role):
98        for nm in names:
99            i_party = creation_function(name = nm)
100            observation.relatedParty.append(createMO_ResponsiblePartyInfo_(role, [i_party]))       
101
102    def _assignName(self, observation):       
103        '''
104            @param relatedPartyInfos: a MO_ResponsiblePartyInfo list
105            @return True if the documents changed, False otherwise
106        '''
107        whereAreAuthors = self._deploymentMigration       
108        doc_authors = findAuthorsInResource(self._deploymentMigration)       
109        if doc_authors['authors'] in [DO_BADC, DO_NEODC]:
110            doc_authors = findAuthorsInResource(self._dataEntityMigration)
111            whereAreAuthors = self._dataEntityMigration
112
113        i_party = createMO_Organization(name = CEDA)
114        observation.relatedParty.append(createMO_ResponsiblePartyInfo_(MO_RoleValue.cl_curator, [i_party]))                               
115       
116        if authors.has_key(doc_authors['authors']):
117            tmp_auth = authors[doc_authors['authors']]
118            ret = self._extractIndividualsAndOrganizations(tmp_auth, whereAreAuthors)
119            if len(ret['ind']) > 0:
120                self._appendResponsibleParty(observation, ret['ind'], createCI_Individual, MO_RoleValue.cl_author)               
121            if len(ret['org']) > 0:
122                self._appendResponsibleParty(observation, ret['org'], createMO_Organization, MO_RoleValue.cl_author)                               
123            if len(ret['co_ind']) > 0:
124                self._appendResponsibleParty(observation, ret['co_ind'], createCI_Individual, MO_RoleValue.cl_coinvestigator)               
125            if len(ret['co_org']) > 0:
126                self._appendResponsibleParty(observation, ret['co_org'], createMO_Organization, MO_RoleValue.cl_coinvestigator)                                                                                         
127        else:
128            raise NoAssociatedAuthor(doc_authors['authors'], migrationObject = whereAreAuthors)
129       
130        if doc_authors['contributors'] is None:
131            return
132       
133        if authors.has_key(doc_authors['contributors']):
134            tmp_auth = authors[doc_authors['contributors']]           
135            ret = self._extractIndividualsAndOrganizations(tmp_auth, whereAreAuthors)
136            if len(ret['ind']) > 0:
137                self._appendResponsibleParty(observation, ret['ind'], createCI_Individual, MO_RoleValue.cl_coinvestigator)
138            if len(ret['org']) > 0:
139                self._appendResponsibleParty(observation, ret['org'], createMO_Organization, MO_RoleValue.cl_coinvestigator)               
140            if len(ret['co_ind']) > 0:
141                self._appendResponsibleParty(observation, ret['co_ind'], createCI_Individual, MO_RoleValue.cl_coinvestigator)               
142            if len(ret['co_org']) > 0:
143                self._appendResponsibleParty(observation, ret['co_org'], createMO_Organization, MO_RoleValue.cl_coinvestigator)                                                       
144        else:
145            raise NoAssociatedAuthor(doc_authors['contributors'], migrationObject = whereAreAuthors)
146
147
148    def _extractIndividualsAndOrganizations(self, tmp_auth, whereAreAuthors):
149        if whereAreAuthors is None:
150            raise Exception("migrationObject is None")
151        try:
152            ret = {'ind': [], 'org': [], 'co_ind': [], 'co_org': []}
153            if tmp_auth['type'] == 'ind':
154                ret['ind'].append(tmp_auth['author'])
155            elif tmp_auth['type'] == 'org':
156                ret['org'].append(tmp_auth['author'])
157           
158            if tmp_auth['author'] == 'unknown':
159                DeploymentProcessor.log.info("%s %s %s has unknown author" \
160                                             % (whereAreAuthors.doc_status, whereAreAuthors.doc_owner, whereAreAuthors.doc_name))       
161                 
162            for item in tmp_auth['co_author_type']:
163                if item == 'ind':
164                    ret['ind'].append(tmp_auth['co_author'][tmp_auth['co_author_type'].index(item)])
165                elif item == 'org':
166                    ret['org'].append(tmp_auth['co_author'][tmp_auth['co_author_type'].index(item)])
167           
168                if (tmp_auth['co_author'][tmp_auth['co_author_type'].index(item)] == 'unknown'):
169                    DeploymentProcessor.log.info("%s %s %s has unknown author" \
170                                                 % (whereAreAuthors.doc_status, whereAreAuthors.doc_owner, whereAreAuthors.doc_name))
171        except Exception as e:
172            print e
173        return ret
174
175    def _assignLineage(self, observation):
176        data_lineage = findMolesLineage(self._dataEntityMigration)
177        if data_lineage is None:
178            raise NoDataLineage(self._dataEntityMigration)
179        Moles3EPB.addDataLineageToObservation(data_lineage, observation, self._migrationSessions.molesSession)       
180       
181    def _assignTitle(self, observation):       
182        doc_title = extractTitle(self._deploymentMigration)
183       
184        if doc_title.startswith('deployment_') or doc_title.startswith('Deployment_'):
185            doc_title = extractTitle(self._dataEntityMigration)           
186        auth = createCI_Citation(title = 'ceda_title')                 
187        Moles3EPB.addIdentifierToObservation(createMD_Identifier(code = doc_title, authority = auth), \
188                                             observation, self._migrationSessions.molesSession)
189
190    def _assignDescription(self, observation):
191        summary = extractSummary(self._deploymentMigration, self._dataEntityMigration)
192        Moles3EPB.addDescriptionToObservation(summary, observation, self._migrationSessions.molesSession)
193       
194    def _assignQuality(self, observation):
195        doc_quality = extractQuality(self._dataEntityMigration)
196        doc_date = findUpdatedDate(self._dataEntityMigration)
197        ci_dates = []           
198        if doc_date:
199            i_date = createDate(isoDateTimeStringToTimeDate(doc_date))               
200            ci_dates.append(createCI_Date(CI_DateTypeCode.cl_revision, date = i_date))           
201        else:
202            i_date = createDate(isoDateTimeStringToTimeDate(datetime.datetime.now()))
203            ci_dates.append(createCI_Date(CI_DateTypeCode.cl_creation, date = i_date))
204
205        i_specification = createCI_Citation(title = "CEDA Data Quality Statement", date=ci_dates)
206        i_dq_result = createDQ_ConformanceResult(doc_quality, True, i_specification)
207        i_quality_element = createDQ_Element(i_dq_result)       
208        observation.resultQuality = [i_quality_element]
209       
210    def updateObservation(self):
211        ceda_observation = EPB.searchOrCreate(CEDA_Observation, self._migrationSessions.molesSession, \
212                                              self._deploymentMigration.ceda_observation_id)
213        return ceda_observation
214
215
216    def _assignResult(self, observation):
217        # TDB - Check that if is an update or not!       
218        download = findDownloadLinksInMigrationDocument(self._deploymentMigration)
219        content = None
220        if len(download) == 0:
221            download = findDownloadLinksInMigrationDocument(self._dataEntityMigration)
222            content = extractContent(self._dataEntityMigration)
223        else:
224            content = extractContent(self._deploymentMigration) 
225        for dwn in download:
226            int_description = None
227            int_applicationProfile = None
228            if content.has_key('formats'):
229                int_applicationProfile = content['formats']
230            if dwn['href'].startswith('http://badc.nerc.ac.uk/browse') or dwn['href'].startswith('http://neodc.nerc.ac.uk/browse'):
231                int_description = "download directly from archive"               
232            observation.result = createCEDA_Result(linkage = dwn['href'], name = dwn['title'], \
233                                                   function = CI_OnLineFunctionCode.cl_download, \
234                                                   description = int_description, applicationProfile = int_applicationProfile)                               
235
236
237    def _assignGeographicExtent(self, observation):
238        # TDB - Check that if is an update or not!
239        ge = extractGeographicExtentInMigrationDocument(self._deploymentMigration)
240        if not ge:
241            ge = extractGeographicExtentInMigrationDocument(self._dataEntityMigration)
242        if ge:
243            moles3Append(observation, 'geographicExtent', createEX_GeographicBoundingBox(ge['east'], ge['north'], ge['west'], ge['south']))
244
245    def _assignCreationDate(self, observation):
246        # TDB - Check that if is an update or not!
247        creation_date = extractMolesCreationDate(self._deploymentMigration)
248        py_datetime = isoDateTimeStringToTimeDate(creation_date)
249        date_time = createDateTime(py_datetime)   
250        tm_position = createTM_Position(dateTime8601 = date_time)
251        observation.resultTime = createTM_Instant(tm_position)
252
253    def _assignDOI(self, observation):
254        # TDB - Check that if is an update or not!
255        doi = findDOIInMigrationDocument(self._deploymentMigration) 
256        if not doi:
257            doi = findDOIInMigrationDocument(self._dataEntityMigration)
258        if doi:
259            identifier = createMD_Identifier(code = doi['href'])
260            ci_date = None
261            if doi['href'] == '10.5285/E8F43A51-0198-4323-A926-FE69225D57DD':
262                #dt = createDateTime('21', '11', '04', '01', '07', '25', '35')
263                py_date = date(2011, 4, 1)
264                dt = createDate(py_date)
265                ci_date = createCI_Date(CI_DateTypeCode.cl_publication, date = dt)
266            elif doi['href'] == '10.5285/78114093-E2BD-4601-8AE5-3551E62AEF2B':
267                #dt = createDateTime('21', '11', '11', '29', '11', '37', '11')
268                py_date = date(2011, 11, 29)               
269                dt = createDate(py_date)               
270                ci_date = createCI_Date(CI_DateTypeCode.cl_publication, date = dt)
271            if ci_date:               
272                identifier.authority = createCI_Citation("", date = ci_date)
273            moles3Append(observation, 'identifier', identifier)                 
274            #Moles3EPB.addIdentifierToObservation(identifier, observation, self._migrationSessions.molesSession)                   
275
276    def _assignPublisherCurator(self, observation):       
277        provider_id = extractMolesProviderID(self._deploymentMigration)
278        party = None
279        if provider_id == DO_BADC:
280            i_linkage = 'http://badc.rl.ac.uk'
281            i_onlineResources = createCI_OnlineResource(linkage = i_linkage, name = 'British Atmospheric Data Centre Website')
282            i_address = createCI_Address(deliveryPoint = ['British Atmospheric Data Centre, STFC Rutherford Appleton Laboratory'], \
283                                         electronicMailAddress=['badc@rl.ac.uk'], postalCode='OX11 0QX', country='UK', city='Harwell Oxford')                                   
284            i_phone = createCI_Telephone(voice=['+44(0)1235 446432'])                                   
285            contact = createCI_Contact(phone=i_phone, address=i_address, onlineResource=i_onlineResources)                       
286            party = createMO_Organization(name = "NERC - British Atmospheric Data Centre", contactInfo = [contact])
287        elif provider_id == DO_NEODC:
288            i_linkage = 'http://www.neodc.rl.ac.uk'
289            i_onlineResources = createCI_OnlineResource(linkage = i_linkage, name = 'NERC Earth Observation Data Centre website')
290            i_address = createCI_Address(deliveryPoint = ['NERC - Earth Observation Data Centre, STFC Rutherford Appleton Laboratory'], \
291                                         electronicMailAddress=['neodc@rl.ac.uk'], postalCode='OX11 0QX', country='UK', city='Harwell Oxford')                                   
292            i_phone = createCI_Telephone(voice=['+44(0)1235 446432'])                                 
293            contact = createCI_Contact(phone=i_phone, address=i_address, onlineResource=i_onlineResources)                       
294            party = createMO_Organization(name = 'NERC - British Atmospheric Data Centre', contactInfo = [contact])
295        elif provider_id == DO_UKSSDC:
296            i_linkage = 'http://www.ukssdc.rl.ac.uk'
297            i_onlineResources = createCI_OnlineResource(linkage = i_linkage, name = 'UK Solar System Data Centre website')
298            i_address = createCI_Address(deliveryPoint = ['UK Solar System Data Centre, STFC Rutherford Appleton Laboratory'], \
299                                         electronicMailAddress=['support@rl.ac.uk'], postalCode='OX11 0QX', country='UK', city='Harwell Oxford')                                   
300            i_phone = createCI_Telephone(voice=['+44(0)1235 445173'])                                 
301            contact = createCI_Contact(phone=i_phone, address=i_address, onlineResource=i_onlineResources)                       
302            party = createMO_Organization(name = 'NERC - UK Solar System Data Centre', contactInfo = [contact])
303       
304        if party:
305            observation.relatedParty.append(createMO_ResponsiblePartyInfo_(MO_RoleValue.cl_publisher, [party]))
306            observation.relatedParty.append(createMO_ResponsiblePartyInfo_(MO_RoleValue.cl_custodian, deepcopy([party])))
307            observation.relatedParty.append(createMO_ResponsiblePartyInfo_(MO_RoleValue.cl_distributor, deepcopy([party])))
308            observation.relatedParty.append(createMO_ResponsiblePartyInfo_(MO_RoleValue.cl_pointofcontact, deepcopy([party])))
309            observation.relatedParty.append(createMO_ResponsiblePartyInfo_(MO_RoleValue.cl_metadataowner, deepcopy([party])))
310            observation.relatedParty.append(createMO_ResponsiblePartyInfo_(MO_RoleValue.cl_curator, deepcopy([party])))                                                           
311
312    def _assignPhenomenonTime(self, observation):       
313        doc_phenomenon_time = extractMolesTemporalRange(self._deploymentMigration)
314       
315        if doc_phenomenon_time:
316            if '/' in doc_phenomenon_time:
317                period = doc_phenomenon_time.split('/')
318                begin_date = createDate(isoDateStringToTimeDate(period[0]))
319                begin_position = createTM_Position(date8601 = begin_date)
320                begin_tm_instant = createTM_Instant(begin_position)
321               
322                end_date = createDate(isoDateStringToTimeDate(period[1]))
323                end_position = createTM_Position(date8601 = end_date)
324                end_tm_instant = createTM_Instant(end_position)
325               
326                observation.phenomenonTime = createTM_Period(begin_tm_instant, end_tm_instant)
327            else:
328                observation.phenomenonTime = createTM_Position(date8601 = createDate(isoDateStringToTimeDate(doc_phenomenon_time)))         
329
330    def _assignPermission(self, observation):
331        access_link = findAccessLinksInMigrationDocument(self._deploymentMigration)
332        dwn_link = findDownloadLinksInMigrationDocument(self._deploymentMigration)
333        if len(access_link) == 0:
334            access_link = findAccessLinksInMigrationDocument(self._dataEntityMigration) 
335
336        i_accessConstraints = []
337        i_use_limitation = []
338        md_legal_constraints = None
339       
340        if len(access_link) == 0:
341            if len(dwn_link) == 0:
342                dwn_link = findDownloadLinksInMigrationDocument(self._dataEntityMigration)
343                if dwn_link and len(dwn_link) == 1:               
344                    i_use_limitation.append("These data are open access and available through %s." % (dwn_link[0]['href']) )
345                    #i_accessConstraints.append(MD_RestrictionCode.cl_)
346                    observation.permission = createMD_LegalConstraints(useLimitation = i_use_limitation, accessConstrains = i_accessConstraints)
347        else:
348            if access_link and len(access_link) == 1:
349                i_use_limitation.append("Access to these data is restricted. To obtain access please apply for access at: %s" % (access_link[0]['href']))
350                i_accessConstraints.append(MD_RestrictionCode.cl_restricted)
351                observation.permission = createMD_LegalConstraints(useLimitation = i_use_limitation, accessConstrains = i_accessConstraints)               
352                                   
353        '''                               
354        contentDict = extractContent(self._deploymentMigration)
355        if not contentDict.has_key('access-restricted'):
356            contentDict = extractContent(self._dataEntityMigration)
357        '''
358           
359    def _assignMoles2Link(self, ceda_observation):
360        i_code = 'http://badc.nerc.ac.uk/view/%s__ATOM__%s' % (self._deploymentMigration.doc_owner, self._deploymentMigration.doc_name)
361        i_code = i_code.replace('.atom', '')
362        #i_code = buildExistDocPath(self._deploymentMigration.doc_status, DT_DEPLOYMENTS, self._deploymentMigration.doc_owner, self._deploymentMigration.doc_name)
363        i_authority = createCI_Citation('moles2url')
364        identifier = createMD_Identifier(code = i_code, authority = i_authority)
365        moles3Append(ceda_observation, 'identifier', identifier)
366   
367    def _assignLanguage(self, ceda_observation):
368        i_date_stamp = createDate(isoDateStringToTimeDate(datetime.datetime.now()))
369        i_contact = createCI_Citation("", date = i_date_stamp)
370        ceda_observation.metadata = createMD_Metadata(date_stamp=i_date_stamp, contact = i_contact, language = "English")
371   
372    def createNewObservation(self):
373        ceda_observation = CEDA_Observation()
374        ceda_observation.publicationState = MO_PublicationStateValue.cl_working
375        self._assignQuality(ceda_observation)
376        self._assignLineage(ceda_observation)
377        self._assignDescription(ceda_observation)
378        self._assignName(ceda_observation)
379        self._assignTitle(ceda_observation)
380        #self._assignResult(ceda_observation)   
381        self._assignGeographicExtent(ceda_observation)   
382        self._assignDOI(ceda_observation)       
383        self._assignCreationDate(ceda_observation)
384        self._assignPublisherCurator(ceda_observation)       
385        self._assignPhenomenonTime(ceda_observation)       
386        self._assignPermission(ceda_observation)       
387        self._assignMoles2Link(ceda_observation)
388        self._assignQuality(ceda_observation)               
389        #self._assignLanguage(ceda_observation)       
390        Moles3EPB.addCedaObject(ceda_observation, self._migrationSessions.molesSession, True)
391        MigrationEPB.associateObservationToDeployment(self._deploymentMigration, ceda_observation.id, self._migrationSessions.molesSession, True)
392        return ceda_observation
393
394    def _getObservation(self):
395        return EPB.search(CEDA_Observation, self._deploymentMigration.ceda_observation_id, self._migrationSessions.molesSession)
396           
397    def process(self):
398        ceda_observation = None
399        #Moles3 object exists...
400        if self._deploymentMigration.ceda_observation_id: 
401            # ...and the data entity document has not changed
402            if hasAtomDocumentSameHash(self._deploymentMigration):
403                ceda_observation = self._getObservation()
404            else:
405                ceda_observation = self.updateObservation()
406        else:
407            #... does not exist so create it
408            ceda_observation = self.createNewObservation()
409       
410        #process the CEDA_Observation.procedure
411        deploymentDataProcessor = DeploymentDataProcessor(self._deploymentMigration, self._migrationSessions)
412        links = findLinksInDeployment(self._deploymentMigration)
413        procedure = deploymentDataProcessor.createProcess(links)
414       
415        #Temporary commented because CEDA_Project.subProject is not correctly mapped to the DB
416        project = deploymentDataProcessor.createProject(links)       
417        if procedure:
418            ceda_observation.procedure = procedure
419           
420        if project:
421            ceda_observation.inSupportOf = project         
422           
423        if procedure or project:                       
424            self._migrationSessions.molesSession.commit()
425           
426        if not self._deploymentHasSameHash:
427            self._deploymentMigration.doc_hash = getAtomDocumentHashByMO(self._deploymentMigration)
428            self._commitMigration()
429             
430       
431        return ceda_observation
Note: See TracBrowser for help on using the repository browser.