Пример #1
0
    def __init__(self):
        handlers = [
            (r"/", MainHandler),
            (r"/auth/login/", AuthLoginHandler),
            (r"/auth/logout/", AuthLogoutHandler),
            (r"/auth/create/", AuthCreateHandler),
            (r"/auth/verify/(.*)", AuthVerifyHandler),
            (r"/auth/forgot/", ForgotPasswordHandler),
            (r"/auth/reset/(.*)", ChangeForgotPasswordHandler),
            (r"/profile/", UserProfileHandler),
            (r"/user/messages/", UserMessagesHander),
            (r"/user/jobs/", UserJobs),
            (r"/static/(.*)", tornado.web.StaticFileHandler,
             {"path": STATIC_PATH}),
            # Analysis handlers
            (r"/analysis/list/", ListAnalysesHandler),
            (r"/analysis/dflt/sumary/", AnalysisSummaryAJAX),
            (r"/analysis/create/", CreateAnalysisHandler),
            (r"/analysis/selected/", SelectedSamplesHandler),
            (r"/analysis/selected/socket/", SelectedSocketHandler),
            (r"/analysis/description/(.*)/graph/", AnalysisGraphHandler),
            (r"/analysis/description/(.*)/jobs/", AnalysisJobsHandler),
            (r"/analysis/description/(.*)/", AnalysisDescriptionHandler),
            (r"/analysis/sharing/", ShareAnalysisAJAX),
            (r"/artifact/samples/", ArtifactGetSamples),
            (r"/artifact/info/", ArtifactGetInfo),
            (r"/consumer/", MessageHandler),
            (r"/admin/error/", LogEntryViewerHandler),
            (r"/admin/approval/", StudyApprovalList),
            (r"/admin/artifact/", ArtifactAdminAJAX),
            (r"/admin/software/", SoftwareHandler),
            (r"/ebi_submission/(.*)", EBISubmitHandler),
            # Study handlers
            (r"/study/create/", StudyEditHandler),
            (r"/study/edit/(.*)", StudyEditHandler),
            (r"/study/list/", ListStudiesHandler),
            (r"/study/process/commands/options/", ListOptionsHandler),
            (r"/study/process/commands/", ListCommandsHandler),
            (r"/study/process/workflow/run/", WorkflowRunHandler),
            (r"/study/process/workflow/", WorkflowHandler),
            (r"/study/process/job/", JobAJAX),
            (r"/study/list/socket/", SelectSamplesHandler),
            (r"/study/list_studies/(.*)", ListStudiesAJAX),
            (r"/study/new_artifact/", NewArtifactHandler),
            (r"/study/files/", StudyFilesAJAX),
            (r"/study/sharing/", ShareStudyAJAX),
            (r"/study/sharing/autocomplete/", AutocompleteHandler),
            (r"/study/new_prep_template/", NewPrepTemplateAjax),
            (r"/study/tags/(.*)", StudyTags),
            (r"/study/get_tags/", StudyGetTags),
            (r"/study/([0-9]+)$", Study),
            # Artifact handlers
            (r"/artifact/graph/", ArtifactGraphAJAX),
            (r"/artifact/(.*)/summary/", ArtifactSummaryAJAX),
            (r"/artifact/html_summary/(.*)", ArtifactSummaryHandler,
             {"path": qiita_config.base_data_dir}),
            (r"/artifact/(.*)/", ArtifactAJAX),
            # Prep template handlers
            (r"/prep_template/", PrepTemplateHandler),
            (r"/prep_template/(.*)/graph/", PrepTemplateGraphHandler),
            (r"/prep_template/(.*)/jobs/", PrepTemplateJobHandler),
            (r"/ontology/", OntologyHandler),
            # ORDER FOR /study/description/ SUBPAGES HERE MATTERS.
            # Same reasoning as below. /study/description/(.*) should be last.
            (r"/study/description/sample_template/overview/",
             SampleTemplateOverviewHandler),
            (r"/study/description/sample_template/columns/",
             SampleTemplateColumnsHandler),
            (r"/study/description/sample_template/", SampleTemplateHandler),
            (r"/study/description/sample_summary/", SampleAJAX),
            (r"/study/description/prep_summary/", PrepTemplateSummaryAJAX),
            (r"/study/description/prep_template/", PrepTemplateAJAX),
            (r"/study/description/baseinfo/", StudyBaseInfoAJAX),
            (r"/study/description/data_type_menu/", DataTypesMenuAJAX),
            (r"/study/description/(.*)", StudyIndexHandler),
            (r"/study/delete/", StudyDeleteAjax),
            (r"/study/upload/remote/(.*)", StudyUploadViaRemote),
            (r"/study/upload/(.*)", StudyUploadFileHandler),
            (r"/upload/", UploadFileHandler),
            (r"/check_study/", CreateStudyAJAX),
            (r"/stats/", StatsHandler),
            (r"/download/(.*)", DownloadHandler),
            (r"/download_study_bioms/(.*)", DownloadStudyBIOMSHandler),
            (r"/download_raw_data/(.*)", DownloadRawData),
            (r"/download_ebi_accessions/samples/(.*)",
                DownloadEBISampleAccessions),
            (r"/download_ebi_accessions/experiments/(.*)",
                DownloadEBIPrepAccessions),
            (r"/download_upload/(.*)", DownloadUpload),
            (r"/release/download/(.*)", DownloadRelease),
            (r"/vamps/(.*)", VAMPSHandler),
            (r"/redbiom/(.*)", RedbiomPublicSearch),
            (r"/iframe/", IFrame),
            # Plugin handlers - the order matters here so do not change
            # qiita_db/jobs/(.*) should go after any of the
            # qiita_db/jobs/(.*)/XXXX because otherwise it will match the
            # regular expression and the qiita_db/jobs/(.*)/XXXX will never
            # be hit.
            (r"/qiita_db/authenticate/", TokenAuthHandler),
            (r"/qiita_db/jobs/(.*)/heartbeat/", HeartbeatHandler),
            (r"/qiita_db/jobs/(.*)/step/", ActiveStepHandler),
            (r"/qiita_db/jobs/(.*)/complete/", CompleteHandler),
            (r"/qiita_db/jobs/(.*)", JobHandler),
            (r"/qiita_db/artifacts/types/", ArtifactTypeHandler),
            (r"/qiita_db/artifacts/(.*)/", ArtifactHandler),
            (r"/qiita_db/users/", UsersListDBHandler),
            (r"/qiita_db/user/(.*)/data/", UserInfoDBHandler),
            (r"/qiita_db/sample_information/(.*)/data/", SampleInfoDBHandler),
            (r"/qiita_db/prep_template/(.*)/data/", PrepTemplateDataHandler),
            (r"/qiita_db/prep_template/(.*)/", PrepTemplateDBHandler),
            (r"/qiita_db/references/(.*)/", ReferenceHandler),
            (r"/qiita_db/plugins/(.*)/(.*)/commands/(.*)/activate/",
             CommandActivateHandler),
            (r"/qiita_db/plugins/(.*)/(.*)/commands/(.*)/", CommandHandler),
            (r"/qiita_db/plugins/(.*)/(.*)/commands/", CommandListHandler),
            (r"/qiita_db/plugins/(.*)/(.*)/", PluginHandler),
            (r"/qiita_db/analysis/(.*)/metadata/", APIAnalysisMetadataHandler),
            (r"/qiita_db/archive/observations/", APIArchiveObservations)

        ]

        # rest endpoints
        handlers.extend(REST_ENDPOINTS)

        if qiita_config.portal == "QIITA":
            # Add portals editing pages only on main portal
            portals = [
                (r"/admin/portals/studies/", StudyPortalHandler),
                (r"/admin/portals/studiesAJAX/", StudyPortalAJAXHandler)
            ]
            handlers.extend(portals)

        if is_test_environment():
            # We add the endpoints for testing plugins
            test_handlers = [
                (r"/apitest/processing_job/", ProcessingJobAPItestHandler),
                (r"/apitest/reset/", ResetAPItestHandler),
                (r"/apitest/prep_template/", PrepTemplateAPItestHandler),
                (r"/apitest/artifact/", ArtifactAPItestHandler),
                (r"/apitest/reload_plugins/", ReloadPluginAPItestHandler)
            ]
            handlers.extend(test_handlers)

        # 404 PAGE MUST BE LAST IN THIS LIST!
        handlers.append((r".*", NoPageHandler))

        settings = {
            "template_path": TEMPLATE_PATH,
            "debug": DEBUG,
            "cookie_secret": qiita_config.cookie_secret,
            "login_url": "%s/auth/login/" % qiita_config.portal_dir,
        }
        tornado.web.Application.__init__(self, handlers, **settings)
Пример #2
0
    def __init__(self):
        handlers = [
            (r"/", MainHandler),
            (r"/auth/login/", AuthLoginHandler),
            (r"/auth/logout/", AuthLogoutHandler),
            (r"/auth/create/", AuthCreateHandler),
            (r"/auth/verify/(.*)", AuthVerifyHandler),
            (r"/auth/forgot/", ForgotPasswordHandler),
            (r"/auth/reset/(.*)", ChangeForgotPasswordHandler),
            (r"/profile/", UserProfileHandler),
            (r"/user/messages/", UserMessagesHander),
            (r"/user/jobs/", UserJobs),
            (r"/static/(.*)", tornado.web.StaticFileHandler, {
                "path": STATIC_PATH
            }),
            # Analysis handlers
            (r"/analysis/list/", ListAnalysesHandler),
            (r"/analysis/dflt/sumary/", AnalysisSummaryAJAX),
            (r"/analysis/create/", CreateAnalysisHandler),
            (r"/analysis/selected/", SelectedSamplesHandler),
            (r"/analysis/selected/socket/", SelectedSocketHandler),
            (r"/analysis/description/(.*)/graph/", AnalysisGraphHandler),
            (r"/analysis/description/(.*)/jobs/", AnalysisJobsHandler),
            (r"/analysis/description/(.*)/", AnalysisDescriptionHandler),
            (r"/analysis/sharing/", ShareAnalysisAJAX),
            (r"/artifact/samples/", ArtifactGetSamples),
            (r"/artifact/info/", ArtifactGetInfo),
            (r"/consumer/", MessageHandler),
            (r"/admin/error/", LogEntryViewerHandler),
            (r"/admin/approval/", StudyApprovalList),
            (r"/admin/artifact/", ArtifactAdminAJAX),
            (r"/ebi_submission/(.*)", EBISubmitHandler),
            # Study handlers
            (r"/study/create/", StudyEditHandler),
            (r"/study/edit/(.*)", StudyEditHandler),
            (r"/study/list/", ListStudiesHandler),
            (r"/study/process/commands/options/", ListOptionsHandler),
            (r"/study/process/commands/", ListCommandsHandler),
            (r"/study/process/workflow/run/", WorkflowRunHandler),
            (r"/study/process/workflow/", WorkflowHandler),
            (r"/study/process/job/", JobAJAX),
            (r"/study/list/socket/", SelectSamplesHandler),
            (r"/study/list_studies/(.*)", ListStudiesAJAX),
            (r"/study/new_artifact/", NewArtifactHandler),
            (r"/study/files/", StudyFilesAJAX),
            (r"/study/sharing/", ShareStudyAJAX),
            (r"/study/sharing/autocomplete/", AutocompleteHandler),
            (r"/study/new_prep_template/", NewPrepTemplateAjax),
            (r"/study/analyses/", AnalysesAjax),
            (r"/study/tags/(.*)", StudyTags),
            (r"/study/get_tags/", StudyGetTags),
            (r"/study/([0-9]+)$", Study),
            # Artifact handlers
            (r"/artifact/graph/", ArtifactGraphAJAX),
            (r"/artifact/(.*)/summary/", ArtifactSummaryAJAX),
            (r"/artifact/html_summary/(.*)", ArtifactSummaryHandler, {
                "path": qiita_config.base_data_dir
            }),
            (r"/artifact/(.*)/", ArtifactAJAX),
            # Prep template handlers
            (r"/prep_template/", PrepTemplateHandler),
            (r"/prep_template/(.*)/graph/", PrepTemplateGraphHandler),
            (r"/prep_template/(.*)/jobs/", PrepTemplateJobHandler),
            (r"/ontology/", OntologyHandler),
            # ORDER FOR /study/description/ SUBPAGES HERE MATTERS.
            # Same reasoning as below. /study/description/(.*) should be last.
            (r"/study/description/sample_template/overview/",
             SampleTemplateOverviewHandler),
            (r"/study/description/sample_template/columns/",
             SampleTemplateColumnsHandler),
            (r"/study/description/sample_template/", SampleTemplateHandler),
            (r"/study/description/sample_summary/", SampleAJAX),
            (r"/study/description/prep_summary/", PrepTemplateSummaryAJAX),
            (r"/study/description/prep_template/", PrepTemplateAJAX),
            (r"/study/description/baseinfo/", StudyBaseInfoAJAX),
            (r"/study/description/data_type_menu/", DataTypesMenuAJAX),
            (r"/study/description/(.*)", StudyIndexHandler),
            (r"/study/delete/", StudyDeleteAjax),
            (r"/study/upload/remote/(.*)", StudyUploadViaRemote),
            (r"/study/upload/(.*)", StudyUploadFileHandler),
            (r"/upload/", UploadFileHandler),
            (r"/check_study/", CreateStudyAJAX),
            (r"/stats/", StatsHandler),
            (r"/software/", SoftwareHandler),
            (r"/workflows/", WorkflowsHandler),
            (r"/download/(.*)", DownloadHandler),
            (r"/download_study_bioms/(.*)", DownloadStudyBIOMSHandler),
            (r"/download_raw_data/(.*)", DownloadRawData),
            (r"/download_ebi_accessions/samples/(.*)",
             DownloadEBISampleAccessions),
            (r"/download_sample_info_per_prep/(.*)",
             DownloadSampleInfoPerPrep),
            (r"/download_ebi_accessions/experiments/(.*)",
             DownloadEBIPrepAccessions),
            (r"/download_upload/(.*)", DownloadUpload),
            (r"/release/download/(.*)", DownloadRelease),
            (r"/public_download/", DownloadPublicHandler),
            (r"/public_artifact_download/", DownloadPublicArtifactHandler),
            (r"/private_download/(.*)", DownloadPrivateArtifactHandler),
            (r"/public/", PublicHandler),
            (r"/vamps/(.*)", VAMPSHandler),
            (r"/redbiom/(.*)", RedbiomPublicSearch),
            (r"/iframe/", IFrame),
            # Plugin handlers - the order matters here so do not change
            # qiita_db/jobs/(.*) should go after any of the
            # qiita_db/jobs/(.*)/XXXX because otherwise it will match the
            # regular expression and the qiita_db/jobs/(.*)/XXXX will never
            # be hit.
            (r"/qiita_db/authenticate/", TokenAuthHandler),
            (r"/qiita_db/jobs/(.*)/heartbeat/", HeartbeatHandler),
            (r"/qiita_db/jobs/(.*)/step/", ActiveStepHandler),
            (r"/qiita_db/jobs/(.*)/complete/", CompleteHandler),
            (r"/qiita_db/jobs/(.*)", JobHandler),
            (r"/qiita_db/artifacts/types/", ArtifactTypeHandler),
            (r"/qiita_db/artifacts/(.*)/", ArtifactHandler),
            (r"/qiita_db/artifact/", APIArtifactHandler),
            (r"/qiita_db/users/", UsersListDBHandler),
            (r"/qiita_db/user/(.*)/data/", UserInfoDBHandler),
            (r"/qiita_db/sample_information/(.*)/data/", SampleInfoDBHandler),
            (r"/qiita_db/prep_template/(.*)/data/", PrepTemplateDataHandler),
            (r"/qiita_db/prep_template/(.*)/", PrepTemplateDBHandler),
            (r"/qiita_db/references/(.*)/", ReferenceHandler),
            (r"/qiita_db/plugins/(.*)/(.*)/commands/(.*)/activate/",
             CommandActivateHandler),
            (r"/qiita_db/plugins/(.*)/(.*)/commands/(.*)/", CommandHandler),
            (r"/qiita_db/plugins/(.*)/(.*)/commands/", CommandListHandler),
            (r"/qiita_db/plugins/(.*)/(.*)/", PluginHandler),
            (r"/qiita_db/analysis/(.*)/metadata/", APIAnalysisMetadataHandler),
            (r"/qiita_db/archive/observations/", APIArchiveObservations)
        ]

        # rest endpoints
        handlers.extend(REST_ENDPOINTS)

        if qiita_config.portal == "QIITA":
            # Add portals editing pages only on main portal
            portals = [(r"/admin/portals/studies/", StudyPortalHandler),
                       (r"/admin/portals/studiesAJAX/", StudyPortalAJAXHandler)
                       ]
            handlers.extend(portals)

        if is_test_environment():
            # We add the endpoints for testing plugins
            test_handlers = [
                (r"/apitest/processing_job/", ProcessingJobAPItestHandler),
                (r"/apitest/reset/", ResetAPItestHandler),
                (r"/apitest/prep_template/", PrepTemplateAPItestHandler),
                (r"/apitest/artifact/", ArtifactAPItestHandler),
                (r"/apitest/reload_plugins/", ReloadPluginAPItestHandler)
            ]
            handlers.extend(test_handlers)

        # 404 PAGE MUST BE LAST IN THIS LIST!
        handlers.append((r".*", NoPageHandler))

        settings = {
            "template_path": TEMPLATE_PATH,
            "debug": DEBUG,
            "cookie_secret": qiita_config.cookie_secret,
            "login_url": "%s/auth/login/" % qiita_config.portal_dir,
        }
        tornado.web.Application.__init__(self, handlers, **settings)
Пример #3
0
 def test_is_test_environment(self):
     self.assertTrue(is_test_environment())
Пример #4
0
    def __init__(self):
        handlers = [
            (r"/", MainHandler),
            (r"/auth/login/", AuthLoginHandler),
            (r"/auth/logout/", AuthLogoutHandler),
            (r"/auth/create/", AuthCreateHandler),
            (r"/auth/verify/(.*)", AuthVerifyHandler),
            (r"/auth/forgot/", ForgotPasswordHandler),
            (r"/auth/reset/(.*)", ChangeForgotPasswordHandler),
            (r"/profile/", UserProfileHandler),
            (r"/user/messages/", UserMessagesHander),
            (r"/results/(.*)", ResultsHandler,
             {"path": RES_PATH}),
            (r"/static/(.*)", tornado.web.StaticFileHandler,
             {"path": STATIC_PATH}),
            (r"/analysis/3", SelectCommandsHandler),
            (r"/analysis/wait/(.*)", AnalysisWaitHandler),
            (r"/analysis/results/(.*)", AnalysisResultsHandler),
            (r"/analysis/show/", ShowAnalysesHandler),
            (r"/analysis/dflt/sumary/", AnalysisSummaryAJAX),
            (r"/analysis/selected/", SelectedSamplesHandler),
            (r"/analysis/selected/socket/", SelectedSocketHandler),
            (r"/analysis/sharing/", ShareAnalysisAJAX),
            (r"/moi-ws/", MOIMessageHandler),
            (r"/consumer/", MessageHandler),
            (r"/admin/error/", LogEntryViewerHandler),
            (r"/admin/approval/", StudyApprovalList),
            (r"/admin/artifact/", ArtifactAdminAJAX),
            (r"/ebi_submission/(.*)", EBISubmitHandler),
            (r"/study/create/", StudyEditHandler),
            (r"/study/edit/(.*)", StudyEditHandler),
            (r"/study/list/", ListStudiesHandler),
            (r"/study/process/commands/options/", ListOptionsHandler),
            (r"/study/process/commands/", ListCommandsHandler),
            (r"/study/process/workflow/run/", WorkflowRunHandler),
            (r"/study/process/workflow/", WorkflowHandler),
            (r"/study/process/job/", JobAJAX),
            (r"/study/process/", ProcessArtifactHandler),
            (r"/study/list/socket/", SelectSamplesHandler),
            (r"/study/search/(.*)", SearchStudiesAJAX),
            (r"/study/new_artifact/", NewArtifactHandler),
            (r"/study/files/", StudyFilesAJAX),
            (r"/study/sharing/", ShareStudyAJAX),
            (r"/study/sharing/autocomplete/", AutocompleteHandler),
            (r"/study/new_prep_template/", NewPrepTemplateAjax),
            (r"/prep/graph/", PrepTemplateGraphAJAX),
            (r"/artifact/", ArtifactAJAX),
            (r"/artifact/graph/", ArtifactGraphAJAX),
            (r"/prep_template/", PrepTemplateHandler),
            (r"/ontology/", OntologyHandler),
            # ORDER FOR /study/description/ SUBPAGES HERE MATTERS.
            # Same reasoning as below. /study/description/(.*) should be last.
            (r"/study/description/sample_template/", SampleTemplateAJAX),
            (r"/study/description/sample_summary/", SampleAJAX),
            (r"/study/description/prep_summary/", PrepTemplateSummaryAJAX),
            (r"/study/description/prep_template/", PrepTemplateAJAX),
            (r"/study/description/artifact_summary/", ArtifactSummaryAJAX),
            (r"/study/description/baseinfo/", StudyBaseInfoAJAX),
            (r"/study/description/data_type_menu/", DataTypesMenuAJAX),
            (r"/study/description/(.*)", StudyIndexHandler),
            (r"/study/delete/", StudyDeleteAjax),
            (r"/study/upload/(.*)", StudyUploadFileHandler),
            (r"/upload/", UploadFileHandler),
            (r"/check_study/", CreateStudyAJAX),
            (r"/stats/", StatsHandler),
            (r"/download/(.*)", DownloadHandler),
            (r"/vamps/(.*)", VAMPSHandler),
            # Plugin handlers - the order matters here so do not change
            # qiita_db/jobs/(.*) should go after any of the
            # qiita_db/jobs/(.*)/XXXX because otherwise it will match the
            # regular expression and the qiita_db/jobs/(.*)/XXXX will never
            # be hit.
            (r"/qiita_db/authenticate/", TokenAuthHandler),
            (r"/qiita_db/jobs/(.*)/heartbeat/", HeartbeatHandler),
            (r"/qiita_db/jobs/(.*)/step/", ActiveStepHandler),
            (r"/qiita_db/jobs/(.*)/complete/", CompleteHandler),
            (r"/qiita_db/jobs/(.*)", JobHandler),
            (r"/qiita_db/artifacts/types/", ArtifactTypeHandler),
            (r"/qiita_db/artifacts/(.*)/", ArtifactHandler),
            (r"/qiita_db/prep_template/(.*)/data/", PrepTemplateDataHandler),
            (r"/qiita_db/prep_template/(.*)/", PrepTemplateDBHandler),
            (r"/qiita_db/references/(.*)/", ReferenceHandler),
            (r"/qiita_db/plugins/(.*)/(.*)/commands/(.*)/activate/",
             CommandActivateHandler),
            (r"/qiita_db/plugins/(.*)/(.*)/commands/(.*)/", CommandHandler),
            (r"/qiita_db/plugins/(.*)/(.*)/commands/", CommandListHandler),
            (r"/qiita_db/plugins/(.*)/(.*)/", PluginHandler)
        ]
        if qiita_config.portal == "QIITA":
            # Add portals editing pages only on main portal
            portals = [
                (r"/admin/portals/studies/", StudyPortalHandler),
                (r"/admin/portals/studiesAJAX/", StudyPortalAJAXHandler)
            ]
            handlers.extend(portals)

        if is_test_environment():
            # We add the endpoints for testing plugins
            test_handlers = [
                (r"/apitest/processing_job/", ProcessingJobAPItestHandler),
                (r"/apitest/reset/", ResetAPItestHandler),
                (r"/apitest/prep_template/", PrepTemplateAPItestHandler),
                (r"/apitest/artifact/", ArtifactAPItestHandler),
                (r"/apitest/reload_plugins/", ReloadPluginAPItestHandler)
            ]
            handlers.extend(test_handlers)

        # 404 PAGE MUST BE LAST IN THIS LIST!
        handlers.append((r".*", NoPageHandler))

        settings = {
            "template_path": TEMPLATE_PATH,
            "debug": DEBUG,
            "cookie_secret": qiita_config.cookie_secret,
            "login_url": "%s/auth/login/" % qiita_config.portal_dir,
            "ui_modules": uimodules,
        }
        tornado.web.Application.__init__(self, handlers, **settings)
Пример #5
0
 def test_is_test_environment(self):
     self.assertTrue(is_test_environment())
Пример #6
0
    def __init__(self):
        handlers = [
            (r"/", MainHandler),
            (r"/auth/login/", AuthLoginHandler),
            (r"/auth/logout/", AuthLogoutHandler),
            (r"/auth/create/", AuthCreateHandler),
            (r"/auth/verify/(.*)", AuthVerifyHandler),
            (r"/auth/forgot/", ForgotPasswordHandler),
            (r"/auth/reset/(.*)", ChangeForgotPasswordHandler),
            (r"/profile/", UserProfileHandler),
            (r"/user/messages/", UserMessagesHander),
            (r"/results/(.*)", ResultsHandler, {
                "path": RES_PATH
            }),
            (r"/static/(.*)", tornado.web.StaticFileHandler, {
                "path": STATIC_PATH
            }),
            (r"/analysis/3", SelectCommandsHandler),
            (r"/analysis/wait/(.*)", AnalysisWaitHandler),
            (r"/analysis/results/(.*)", AnalysisResultsHandler),
            (r"/analysis/show/", ShowAnalysesHandler),
            (r"/analysis/dflt/sumary/", AnalysisSummaryAJAX),
            (r"/analysis/selected/", SelectedSamplesHandler),
            (r"/analysis/selected/socket/", SelectedSocketHandler),
            (r"/analysis/sharing/", ShareAnalysisAJAX),
            (r"/moi-ws/", MOIMessageHandler),
            (r"/consumer/", MessageHandler),
            (r"/admin/error/", LogEntryViewerHandler),
            (r"/admin/approval/", StudyApprovalList),
            (r"/admin/artifact/", ArtifactAdminAJAX),
            (r"/ebi_submission/(.*)", EBISubmitHandler),
            (r"/study/create/", StudyEditHandler),
            (r"/study/edit/(.*)", StudyEditHandler),
            (r"/study/list/", ListStudiesHandler),
            (r"/study/process/commands/options/", ListOptionsHandler),
            (r"/study/process/commands/", ListCommandsHandler),
            (r"/study/process/workflow/run/", WorkflowRunHandler),
            (r"/study/process/workflow/", WorkflowHandler),
            (r"/study/process/job/", JobAJAX),
            (r"/study/process/", ProcessArtifactHandler),
            (r"/study/list/socket/", SelectSamplesHandler),
            (r"/study/search/(.*)", SearchStudiesAJAX),
            (r"/study/new_artifact/", NewArtifactHandler),
            (r"/study/files/", StudyFilesAJAX),
            (r"/study/sharing/", ShareStudyAJAX),
            (r"/study/sharing/autocomplete/", AutocompleteHandler),
            (r"/study/new_prep_template/", NewPrepTemplateAjax),
            (r"/prep/graph/", PrepTemplateGraphAJAX),
            (r"/artifact/", ArtifactAJAX),
            (r"/artifact/graph/", ArtifactGraphAJAX),
            (r"/prep_template/", PrepTemplateHandler),
            (r"/ontology/", OntologyHandler),
            # ORDER FOR /study/description/ SUBPAGES HERE MATTERS.
            # Same reasoning as below. /study/description/(.*) should be last.
            (r"/study/description/sample_template/", SampleTemplateAJAX),
            (r"/study/description/sample_summary/", SampleAJAX),
            (r"/study/description/prep_summary/", PrepTemplateSummaryAJAX),
            (r"/study/description/prep_template/", PrepTemplateAJAX),
            (r"/study/description/artifact_summary/", ArtifactSummaryAJAX),
            (r"/study/description/baseinfo/", StudyBaseInfoAJAX),
            (r"/study/description/data_type_menu/", DataTypesMenuAJAX),
            (r"/study/description/(.*)", StudyIndexHandler),
            (r"/study/delete/", StudyDeleteAjax),
            (r"/study/upload/(.*)", StudyUploadFileHandler),
            (r"/upload/", UploadFileHandler),
            (r"/check_study/", CreateStudyAJAX),
            (r"/stats/", StatsHandler),
            (r"/download/(.*)", DownloadHandler),
            (r"/vamps/(.*)", VAMPSHandler),
            # Plugin handlers - the order matters here so do not change
            # qiita_db/jobs/(.*) should go after any of the
            # qiita_db/jobs/(.*)/XXXX because otherwise it will match the
            # regular expression and the qiita_db/jobs/(.*)/XXXX will never
            # be hit.
            (r"/qiita_db/authenticate/", TokenAuthHandler),
            (r"/qiita_db/jobs/(.*)/heartbeat/", HeartbeatHandler),
            (r"/qiita_db/jobs/(.*)/step/", ActiveStepHandler),
            (r"/qiita_db/jobs/(.*)/complete/", CompleteHandler),
            (r"/qiita_db/jobs/(.*)", JobHandler),
            (r"/qiita_db/artifacts/(.*)/", ArtifactHandler),
            (r"/qiita_db/prep_template/(.*)/data/", PrepTemplateDataHandler),
            (r"/qiita_db/prep_template/(.*)/", PrepTemplateDBHandler),
            (r"/qiita_db/references/(.*)/", ReferenceHandler)
        ]
        if qiita_config.portal == "QIITA":
            # Add portals editing pages only on main portal
            portals = [(r"/admin/portals/studies/", StudyPortalHandler),
                       (r"/admin/portals/studiesAJAX/", StudyPortalAJAXHandler)
                       ]
            handlers.extend(portals)

        if is_test_environment():
            # We add the endpoints for testing plugins
            test_handlers = [
                (r"/apitest/processing_job/", ProcessingJobAPItestHandler),
                (r"/apitest/reset/", ResetAPItestHandler),
                (r"/apitest/prep_template/", PrepTemplateAPItestHandler),
                (r"/apitest/artifact/", ArtifactAPItestHandler)
            ]
            handlers.extend(test_handlers)

        # 404 PAGE MUST BE LAST IN THIS LIST!
        handlers.append((r".*", NoPageHandler))

        settings = {
            "template_path": TEMPLATE_PATH,
            "debug": DEBUG,
            "cookie_secret": qiita_config.cookie_secret,
            "login_url": "%s/auth/login/" % qiita_config.portal_dir,
            "ui_modules": uimodules,
        }
        tornado.web.Application.__init__(self, handlers, **settings)
Пример #7
0
            (r"/qiita_db/archive/observations/", APIArchiveObservations)

        ]

        # rest endpoints
        handlers.extend(REST_ENDPOINTS)

        if qiita_config.portal == "QIITA":
            # Add portals editing pages only on main portal
            portals = [
                (r"/admin/portals/studies/", StudyPortalHandler),
                (r"/admin/portals/studiesAJAX/", StudyPortalAJAXHandler)
            ]
            handlers.extend(portals)

        if is_test_environment():
            # We add the endpoints for testing plugins
            test_handlers = [
                (r"/apitest/processing_job/", ProcessingJobAPItestHandler),
                (r"/apitest/reset/", ResetAPItestHandler),
                (r"/apitest/prep_template/", PrepTemplateAPItestHandler),
                (r"/apitest/artifact/", ArtifactAPItestHandler),
                (r"/apitest/reload_plugins/", ReloadPluginAPItestHandler)
            ]
            handlers.extend(test_handlers)

        # 404 PAGE MUST BE LAST IN THIS LIST!
        handlers.append((r".*", NoPageHandler))

        settings = {
            "template_path": TEMPLATE_PATH,