Пример #1
0
        startTime = datetime.now()
        sU = SwissbibUtilities()
        sU.initializeDirectoriesForHarvesting(sConfigs)

        rCollector = ResultCollector()
        appContext = ApplicationContext()
        appContext.setResultCollector(rCollector)
        appContext.setConfiguration(sConfigs)


        mongoWrapper = MongoDBHarvestingWrapper(applicationContext=appContext)

        appContext.setMongoWrapper(mongoWrapper)


        writeContext = HarvestingWriteContext(appContext)
        appContext.setWriteContext(writeContext)

        deleteGenerator = globals()[sConfigs.getDeleteMessagesProcessorType()](appContext,writeContext)



        if deleteGenerator.hasOAIDeletes():

            deleteGenerator.processDeletes()
            writeContext.closeWriteContext()
            writeContext.moveContentFile()



Пример #2
0
        fromDate = sU.getFromFormat(sConfigs.getTimestampUTC(), sConfigs)
        if not sConfigs.getManualUntil() is None:
            untilDate = sU.getUntilDate(sConfigs.getManualUntil(), sConfigs)

    appContext = ApplicationContext()
    appContext.setResultCollector(rCollector)
    appContext.setConfiguration(sConfigs)

    mongoWrapper = MongoDBHarvestingWrapper(applicationContext=appContext)

    appContext.setMongoWrapper(mongoWrapper)

    #registry = SwissBibMetaDataRegistry(sConfigs,mongoWrapper,rCollector)
    registry = SwissBibMetaDataRegistry()

    writeContext = HarvestingWriteContext(appContext)

    #Todo: SwissbibUtilities sollten Teil des Contexts werden??

    appContext.setWriteContext(writeContext)

    client = SwissbibOAIClient(base_url=sConfigs.getUrl(),
                               metadata_registry=registry,
                               applicationContext=appContext,
                               dayGranularity=sU.isDayGranularity(sConfigs))

    # from_ und until_ mit Unterstrich da das Datumsformat aufgrund der granularity spaeter nochmals formatiert wird
    #sind die anderen Parameter None, wird der vor Aufruf des ersten requests gegen das repository aus der parameterliste
    #entfernt -> s. Dazu swissbibOAIClient.SwissbibOAIClient.handleVerb
    #diese Methode musste sowieso wegen des speziellen rero source parameters ueberschrieben werden
    if resumptionToken is None:
Пример #3
0
        startTime = datetime.now()
        sU = SwissbibUtilities()
        sU.initializeDirectoriesForHarvesting(sConfigs)

        rCollector = ResultCollector()
        appContext = ApplicationContext()
        appContext.setResultCollector(rCollector)
        appContext.setConfiguration(sConfigs)


        mongoWrapper = MongoDBHarvestingWrapper(applicationContext=appContext)

        appContext.setMongoWrapper(mongoWrapper)


        writeContext = HarvestingWriteContext(appContext)
        appContext.setWriteContext(writeContext)

        deleteGenerator = globals()[sConfigs.getDeleteMessagesProcessorType()](appContext,writeContext)



        if deleteGenerator.hasOAIDeletes():

            deleteGenerator.processDeletes()
            writeContext.closeWriteContext()
            writeContext.moveContentFile()