json_titles = document_archiver.db2json('title')
        json_boxes = document_archiver.db2json('issue')
                
        #
        registered_titles = return_journals_list(json_titles)
        registered_boxes = return_issues_list(json_boxes, registered_titles)
        

        all_boxes = AllFolders(registered_boxes, JournalIssuesList(), AllIssues())

        
        email_service = EmailService('', config.parameter('SENDER_EMAIL'), 'localhost', config.parameter('IS_AVAILABLE_EMAIL_SERVICE') == 'yes')
        report_sender_config = ReportSenderConfiguration(config.parameter('BCC_EMAIL'), config.parameter('FLAG_SEND_EMAIL_TO_XML_PROVIDER') == 'yes', config.parameter('ALERT_FORWARD'), config.parameter('FLAG_ATTACH_REPORTS'))
        report_sender = ReportSender(email_service, report_sender_config)

        package_eval_msg_template = EmailMessageTemplate(config.parameter('EMAIL_SUBJECT_PREFIX'), config.parameter('EMAIL_TEXT'))
        adm_msg_template = EmailMessageTemplate(config.parameter('EMAIL_SUBJECT_WORK_PATH'), config.parameter('EMAIL_TEXT_WORK_PATH'))
        

        document_analyst = DocumentsAnalyst(xml2json, json2articlemodel, registered_titles, all_boxes)

        queue_organizer = QueueOrganizer(report, tracker, download_path)
        queue_organizer.archive_and_extract_files(archive_path, work_path, report_sender)

        
        java_xml_transformer = JavaXMLTransformer(config.parameter('JAVA_PATH'), config.parameter('SAXON_PATH'), config.parameter('VALIDATOR_PATH'))

        pmc_xsl_and_output = Configuration( 'pmc.article.xsl.ini')
        
        log_filename, err_filename, summary_filename = [report_path + '/gerapadrao-' + f for f in files]
        report = Report(log_filename, err_filename, summary_filename, int(debug_depth), (display_on_screen == 'yes'))

        proc_title_db = config.parameters['PROC_DB_TITLE_FILENAME']
        proc_issue_db = config.parameters['PROC_DB_ISSUE_FILENAME']

        if not os.path.exists(os.path.dirname(proc_title_db)):
            os.makedirs(os.path.dirname(proc_title_db))

        if not os.path.exists(os.path.dirname(proc_issue_db)):
            os.makedirs(os.path.dirname(proc_issue_db))

        cisis = CISIS(config.parameters['CISIS_PATH'])
        email_service = EmailService('', config.parameter('SENDER_EMAIL'), 'localhost', config.parameter('IS_AVAILABLE_EMAIL_SERVICE') == 'yes')
        report_sender_config = ReportSenderConfiguration(config.parameter('BCC_EMAIL'), config.parameter('FLAG_SEND_EMAIL_TO_XML_PROVIDER') == 'yes', config.parameter('ALERT_FORWARD'), config.parameter('FLAG_ATTACH_REPORTS'))
        report_sender = ReportSender(email_service, report_sender_config)
        template = EmailMessageTemplate(config.parameter('EMAIL_SUBJECT_PREFIX_GERAPADRAO'), config.parameter('EMAIL_TEXT_GERAPADRAO'))
        status = get_status(config.parameter('CTRL_FILE'))
        doit = (status == 'finished')

        if doit:
            set_status(config.parameter('CTRL_FILE'), 'running')
            report.write('Start', True, False, False)

            cisis.create('null count=0', proc_title_db)
            cisis.create('null count=0', proc_issue_db)
            proc_scilista = config.parameters['PROC_SERIAL_PATH'] + '/scilista.lst'
            proc_scilista_del = config.parameters['PROC_SERIAL_PATH'] + '/scilista_del.lst'

            path = config.parameters['COLLECTIONS_PATH']
            report.write('path of collections:' + path, True, False, False)