コード例 #1
0
# -*- coding: utf-8 -*-
"""
    indico_payment_stripe.blueprint
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    The plugin blueprint.

"""
from __future__ import unicode_literals

from indico.core.plugins import IndicoPluginBlueprint

from indico_payment_stripe.controllers import RHStripe

blueprint = IndicoPluginBlueprint(
    'payment_stripe',
    __name__,
    url_prefix=('/event/<confId>/registrations/'
                '<int:reg_form_id>/payment/response/stripe'))

blueprint.add_url_rule('/handler', 'handler', RHStripe, methods=['GET'])
コード例 #2
0
from __future__ import unicode_literals

from indico.core.plugins import IndicoPluginBlueprint

from indico_chat.controllers.event import RHChatEventPage
from indico_chat.controllers.logs import RHChatManageEventLogs, RHChatManageEventShowLogs, RHChatManageEventAttachLogs
from indico_chat.controllers.management import (
    RHChatManageEvent, RHChatManageEventModify, RHChatManageEventRefresh,
    RHChatManageEventRemove, RHChatManageEventCreate, RHChatManageEventAttach)

blueprint = IndicoPluginBlueprint('chat',
                                  'indico_chat',
                                  url_prefix='/event/<confId>')

# Event
blueprint.add_url_rule('/chat', 'event_page', RHChatEventPage)

# Event management
blueprint.add_url_rule('/manage/chat/', 'manage_rooms', RHChatManageEvent)
blueprint.add_url_rule('/manage/chat/<int:chatroom_id>/',
                       'manage_rooms_modify',
                       RHChatManageEventModify,
                       methods=('GET', 'POST'))
blueprint.add_url_rule('/manage/chat/<int:chatroom_id>/logs/',
                       'manage_rooms_logs', RHChatManageEventLogs)
blueprint.add_url_rule('/manage/chat/<int:chatroom_id>/logs/show',
                       'manage_rooms_show_logs', RHChatManageEventShowLogs)
blueprint.add_url_rule('/manage/chat/<int:chatroom_id>/logs/attach',
                       'manage_rooms_attach_logs',
                       RHChatManageEventAttachLogs,
                       methods=('POST', ))
コード例 #3
0
# This file is part of the CERN Indico plugins.
# Copyright (C) 2014 - 2021 CERN
#
# The CERN Indico plugins are free software; you can redistribute
# them and/or modify them under the terms of the MIT License; see
# the LICENSE file for more details.

from indico.core.plugins import IndicoPluginBlueprint

from indico_audiovisual.controllers import RHRequestList

blueprint = IndicoPluginBlueprint('audiovisual',
                                  __name__,
                                  url_prefix='/service/audiovisual')
blueprint.add_url_rule('/', 'request_list', RHRequestList)
コード例 #4
0
                    cid = (contribution.legacy_mapping.legacy_contribution_id
                           if contribution.legacy_mapping else contribution.id)
                    params['contrib_id'] = '{}t{}'.format(
                        contribution.event_id, cid)
        return params

    def _get_tracking_url(self):
        url = self.settings.get('server_url')
        url = url if url.endswith('/') else url + '/'
        url = urlparse.urlparse(url)
        return url.netloc + url.path


blueprint = IndicoPluginBlueprint(
    'piwik', __name__, url_prefix='/event/<confId>/manage/statistics')
blueprint.add_url_rule('/', 'view', RHStatistics)
blueprint.add_url_rule('/material',
                       'material',
                       RHApiMaterial,
                       methods=('GET', 'POST'))
blueprint.add_url_rule('/data/downloads',
                       'data_downloads',
                       RHApiDownloads,
                       methods=('GET', 'POST'))
blueprint.add_url_rule('/data/visits',
                       'data_visits',
                       RHApiEventVisitsPerDay,
                       methods=('GET', 'POST'))
blueprint.add_url_rule('/graph/countries',
                       'graph_countries',
                       RHApiEventGraphCountries,
コード例 #5
0
ファイル: blueprint.py プロジェクト: indico/indico-plugins
# This file is part of Indico.
# Copyright (C) 2002 - 2018 European Organization for Nuclear Research (CERN).
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# Indico is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Indico; if not, see <http://www.gnu.org/licenses/>.

from __future__ import unicode_literals

from indico.core.plugins import IndicoPluginBlueprint

from indico_search.controllers import RHSearch, RHSearchCategoryTitles


blueprint = IndicoPluginBlueprint('search', 'indico_search')

blueprint.add_url_rule('/search', 'search', RHSearch)
blueprint.add_url_rule('/category/<int:category_id>/search', 'search', RHSearch)
blueprint.add_url_rule('/event/<confId>/search', 'search', RHSearch)

blueprint.add_url_rule('/category/search-titles', 'category_names', RHSearchCategoryTitles)
コード例 #6
0
# Indico is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Indico; if not, see <http://www.gnu.org/licenses/>.

from __future__ import unicode_literals

from indico.core.plugins import IndicoPluginBlueprint

from indico_livesync.controllers import RHAddAgent, RHDeleteAgent, RHEditAgent

blueprint = IndicoPluginBlueprint('livesync',
                                  'indico_livesync',
                                  url_prefix='/admin/plugins/livesync')

blueprint.add_url_rule('/agents/create/<backend>',
                       'add_agent',
                       RHAddAgent,
                       methods=('GET', 'POST'))
blueprint.add_url_rule('/agents/<int:agent_id>',
                       'edit_agent',
                       RHEditAgent,
                       methods=('GET', 'POST'))
blueprint.add_url_rule('/agents/<int:agent_id>',
                       'delete_agent',
                       RHDeleteAgent,
                       methods=('DELETE', ))
コード例 #7
0
from indico.core.plugins import IndicoPluginBlueprint

from indico_cern_access.controllers import (
    RHExportCERNAccessCSV, RHExportCERNAccessExcel,
    RHRegistrationAccessIdentityData, RHRegistrationEnterIdentityData,
    RHRegistrationGrantCERNAccess, RHRegistrationPreviewCERNAccessEmail,
    RHRegistrationRevokeCERNAccess)

blueprint = IndicoPluginBlueprint('cern_access',
                                  __name__,
                                  url_prefix='/event/<confId>')

blueprint.add_url_rule(
    '/manage/registration/<int:reg_form_id>/registrations/cern-access/grant',
    'registrations_grant_cern_access',
    RHRegistrationGrantCERNAccess,
    methods=('POST', ))
blueprint.add_url_rule(
    '/manage/registration/<int:reg_form_id>/registrations/cern-access/revoke',
    'registrations_revoke_cern_access',
    RHRegistrationRevokeCERNAccess,
    methods=('POST', ))
blueprint.add_url_rule(
    '/manage/registration/<int:reg_form_id>/registrations/cern-access/email-preview',
    'registrations_preview_cern_access_email',
    RHRegistrationPreviewCERNAccessEmail,
    methods=('POST', ))
blueprint.add_url_rule(
    '/manage/registration/<int:reg_form_id>/registrations/cern-access.csv',
    'registrations_cern_access_csv',
コード例 #8
0
ファイル: blueprint.py プロジェクト: indico/indico-plugins
# This file is part of Indico.
# Copyright (C) 2002 - 2018 European Organization for Nuclear Research (CERN).
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# Indico is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Indico; if not, see <http://www.gnu.org/licenses/>.

from __future__ import unicode_literals

from indico.core.plugins import IndicoPluginBlueprint

from indico_payment_paypal.controllers import RHPaypalCancel, RHPaypalIPN, RHPaypalSuccess


blueprint = IndicoPluginBlueprint('payment_paypal', __name__,
                                  url_prefix='/event/<confId>/registrations/<int:reg_form_id>/payment/response/paypal')

blueprint.add_url_rule('/cancel', 'cancel', RHPaypalCancel, methods=('GET', 'POST'))
blueprint.add_url_rule('/success', 'success', RHPaypalSuccess, methods=('GET', 'POST'))
# Used by PayPal to send an asynchronous notification for the transaction (pending, successful, etc)
blueprint.add_url_rule('/ipn', 'notify', RHPaypalIPN, methods=('POST',))
コード例 #9
0
ファイル: blueprint.py プロジェクト: dsquire/indico-plugins
# This file is part of the Indico plugins.
# Copyright (C) 2017 - 2022 Max Fischer, Martin Claus, CERN
#
# The Indico plugins are free software; you can redistribute
# them and/or modify them under the terms of the MIT License;
# see the LICENSE file for more details.

from indico.core.plugins import IndicoPluginBlueprint

from indico_payment_sixpay.controllers import (RHInitSixpayPayment, SixpayNotificationHandler, UserCancelHandler,
                                               UserFailureHandler, UserSuccessHandler)


blueprint = IndicoPluginBlueprint(
    'payment_sixpay', __name__,
    url_prefix='/event/<int:event_id>/registrations/<int:reg_form_id>/payment/sixpay'
)

blueprint.add_url_rule('/init', 'init', RHInitSixpayPayment, methods=('GET', 'POST'))
blueprint.add_url_rule('/failure', 'failure', UserCancelHandler, methods=('GET', 'POST'))
blueprint.add_url_rule('/cancel', 'cancel', UserFailureHandler, methods=('GET', 'POST'))
blueprint.add_url_rule('/success', 'success', UserSuccessHandler, methods=('GET', 'POST'))
blueprint.add_url_rule('/notify', 'notify', SixpayNotificationHandler, methods=('Get', 'POST'))
コード例 #10
0
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
# Created on Mar 9, 2018
#
# @author: pedersen

from __future__ import unicode_literals

from indico.core.plugins import IndicoPluginBlueprint
from indico_mlz_export.controller import RHExportRegistrations, RHExportRegistration, RHExportRegistrationsFlat, RHExportRegistrationFlat

blueprint = IndicoPluginBlueprint('mlzexport',
                                  __name__,
                                  url_prefix='/mlz/export')
# API
blueprint.add_url_rule('/<int:event_id>/registrants/<int:registrant_id>',
                       'api_registrant',
                       RHExportRegistration,
                       methods=('GET', ))
blueprint.add_url_rule('/<int:event_id>/registrants', 'api_registrants',
                       RHExportRegistrations)
blueprint.add_url_rule('/<int:event_id>/registrants_flat/<int:registrant_id>',
                       'api_registrant_flat',
                       RHExportRegistrationFlat,
                       methods=('GET', ))
blueprint.add_url_rule('/<int:event_id>/registrants_flat',
                       'api_registrants_flat', RHExportRegistrationsFlat)
コード例 #11
0
# This file is part of the Indico plugins.
# Copyright (C) 2002 - 2020 CERN
#
# The Indico plugins are free software; you can redistribute
# them and/or modify them under the terms of the MIT License;
# see the LICENSE file for more details.

from __future__ import unicode_literals

from indico.core.plugins import IndicoPluginBlueprint

from indico_payment_touchnet.controllers import TouchnetPost, TouchnetSuccess, TouchnetCancel


blueprint = IndicoPluginBlueprint('payment_touchnet', __name__,
                                  url_prefix='/event/<confId>/registrations/<int:reg_form_id>/payment/response/touchnet')

blueprint.add_url_rule('/cancel', 'cancel', TouchnetCancel, methods=('GET', 'POST'))
blueprint.add_url_rule('/success', 'success', TouchnetSuccess, methods=('GET', 'POST'))
# Used by TouchNet to send an asynchronous notification for the transaction (pending, successful, etc)
blueprint.add_url_rule('/tnp', 'notify', TouchnetPost, methods=('POST',))
コード例 #12
0
# This file is part of the CERN Indico plugins.
# Copyright (C) 2014 - 2019 CERN
#
# The CERN Indico plugins are free software; you can redistribute
# them and/or modify them under the terms of the MIT License; see
# the LICENSE file for more details.

from __future__ import unicode_literals

from indico.core.plugins import IndicoPluginBlueprint

from indico_burotel.controllers import RHUserExperiment


blueprint = IndicoPluginBlueprint('burotel', __name__, url_prefix='/rooms-new')

blueprint.add_url_rule('/api/user/experiment', 'user_experiment', RHUserExperiment, methods=('GET', 'POST'))

# XXX: RHLanding is not handled here on purpose!
コード例 #13
0
ファイル: __init__.py プロジェクト: cmorgia/indicoxmpp

class UHSignInNoUI(SecureURLHandler):
    _endpoint = "user.signIn-noui"


class UHPrebind(SecureURLHandler):
    _endpoint = "user.prebind"


class UHExists(SecureURLHandler):
    _endpoint = "user.exists"


# XMPP Prebind support
blueprint.add_url_rule('/prebind', 'prebind', RHPrebind)

# Exists
blueprint.add_url_rule('/exists', 'exists', RHExists,methods=('GET', 'POST'))

# Sign in
blueprint.add_url_rule('/login/noui', 'signIn-noui', RHSignInNoUI, methods=('POST',))


def boshInitConnection(_login,_password):
    plugin = plugin_engine.get_plugin("indicoxmpp")
    base_host = plugin.settings.get("base_host")
    base_port = plugin.settings.get("base_port")
    jid = _login + "@" + base_host
    service = "http://{0}:{1}/http-bind".format(base_host, base_port)
    cli = BOSHClient(service, jid, _password)
コード例 #14
0
ファイル: plugin.py プロジェクト: indico/indico-plugins
        if not self.settings.get('enabled_for_events') or not site_id_events:
            return {}
        params = {'site_id_events': site_id_events}
        if request.blueprint in ('event', 'events', 'contributions') and 'confId' in request.view_args:
            if not unicode(request.view_args['confId']).isdigit():
                return {}
            params['event_id'] = request.view_args['confId']
            contrib_id = request.view_args.get('contrib_id')
            if contrib_id is not None and unicode(contrib_id).isdigit():
                contribution = Contribution.find_first(event_id=params['event_id'], id=contrib_id)
                if contribution:
                    cid = (contribution.legacy_mapping.legacy_contribution_id if contribution.legacy_mapping
                           else contribution.id)
                    params['contrib_id'] = '{}t{}'.format(contribution.event_id, cid)
        return params

    def _get_tracking_url(self):
        url = self.settings.get('server_url')
        url = url if url.endswith('/') else url + '/'
        url = urlparse.urlparse(url)
        return url.netloc + url.path


blueprint = IndicoPluginBlueprint('piwik', __name__, url_prefix='/event/<confId>/manage/statistics')
blueprint.add_url_rule('/', 'view', RHStatistics)
blueprint.add_url_rule('/material', 'material', RHApiMaterial, methods=('GET', 'POST'))
blueprint.add_url_rule('/data/downloads', 'data_downloads', RHApiDownloads, methods=('GET', 'POST'))
blueprint.add_url_rule('/data/visits', 'data_visits', RHApiEventVisitsPerDay, methods=('GET', 'POST'))
blueprint.add_url_rule('/graph/countries', 'graph_countries', RHApiEventGraphCountries, methods=('GET', 'POST'))
blueprint.add_url_rule('/graph/devices', 'graph_devices', RHApiEventGraphDevices, methods=('GET', 'POST'))
コード例 #15
0
ファイル: blueprint.py プロジェクト: errikos/indico-plugins
# This file is part of the Indico plugins.
# Copyright (C) 2002 - 2021 CERN
#
# The Indico plugins are free software; you can redistribute
# them and/or modify them under the terms of the MIT License;
# see the LICENSE file for more details.

from indico.core.plugins import IndicoPluginBlueprint

from indico_storage_s3.controllers import RHBuckets

blueprint = IndicoPluginBlueprint('storage_s3',
                                  __name__,
                                  url_prefix='/api/plugin/s3')
blueprint.add_url_rule('/buckets', 'buckets', RHBuckets)
コード例 #16
0
ファイル: blueprint.py プロジェクト: dsquire/indico-plugins
# This file is part of the Indico plugins.
# Copyright (C) 2002 - 2022 CERN
#
# The Indico plugins are free software; you can redistribute
# them and/or modify them under the terms of the MIT License;
# see the LICENSE file for more details.

from indico.core.plugins import IndicoPluginBlueprint

from indico_payment_touchnet.controllers import RHTouchNetCancel, RHTouchNetIPN, RHTouchNetSuccess

blueprint = IndicoPluginBlueprint(
    'payment_touchnet',
    __name__,
    url_prefix=
    '/event/<int:event_id>/registrations/<int:reg_form_id>/payment/response/touchnet'
)

blueprint.add_url_rule('/cancel',
                       'cancel',
                       RHTouchNetCancel,
                       methods=('GET', 'POST'))
blueprint.add_url_rule('/success',
                       'success',
                       RHTouchNetSuccess,
                       methods=('GET', 'POST'))
# Used by TouchNet to send an asynchronous notification for the transaction (pending, successful, etc)
blueprint.add_url_rule('/ipn', 'notify', RHTouchNetIPN, methods=('POST', ))
コード例 #17
0
# This file is part of the CERN Indico plugins.
# Copyright (C) 2014 - 2017 CERN
#
# The CERN Indico plugins are free software; you can redistribute
# them and/or modify them under the terms of the MIT License; see
# the LICENSE file for more details.

from __future__ import unicode_literals

from indico.core.plugins import IndicoPluginBlueprint

from indico_conversion.conversion import RHConversionCheck, RHConversionFinished


blueprint = IndicoPluginBlueprint('conversion', __name__)
blueprint.add_url_rule('/conversion/finished', 'callback', RHConversionFinished, methods=('POST',))
blueprint.add_url_rule('/conversion/check', 'check', RHConversionCheck)
コード例 #18
0
ファイル: blueprint.py プロジェクト: florv/indico-plugins
# This file is part of Indico.
# Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN).
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# Indico is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Indico; if not, see <http://www.gnu.org/licenses/>.

from __future__ import unicode_literals

from indico.core.plugins import IndicoPluginBlueprint

from indico_vc_vidyo.controllers import RHVidyoRoomOwner

blueprint = IndicoPluginBlueprint('vc_vidyo', 'indico_vc_vidyo')

# Room management
# using any(vidyo) instead of defaults since the event vc room locator
# includes the service and normalization skips values provided in 'defaults'
blueprint.add_url_rule('/event/<confId>/manage/videoconference/<any(vidyo):service>/<int:event_vc_room_id>/room-owner',
                       'set_room_owner', RHVidyoRoomOwner, methods=('POST',))
コード例 #19
0
# This file is part of Indico.
# Copyright (C) 2002 - 2018 European Organization for Nuclear Research (CERN).
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# Indico is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Indico; if not, see <http://www.gnu.org/licenses/>.

from indico.core.plugins import IndicoPluginBlueprint

from indico_previewer_jupyter.controllers import RHEventPreviewIPyNB

blueprint = IndicoPluginBlueprint('previewer_jupyter', __name__)
blueprint.add_url_rule('/preview/ipynb/<int:attachment_id>', 'preview_ipynb',
                       RHEventPreviewIPyNB)
コード例 #20
0

class UHSignInNoUI(SecureURLHandler):
    _endpoint = "user.signIn-noui"


class UHPrebind(SecureURLHandler):
    _endpoint = "user.prebind"


class UHExists(SecureURLHandler):
    _endpoint = "user.exists"


# XMPP Prebind support
blueprint.add_url_rule('/prebind', 'prebind', RHPrebind)

# Exists
blueprint.add_url_rule('/exists', 'exists', RHExists, methods=('GET', 'POST'))

# Sign in
blueprint.add_url_rule('/login/noui',
                       'signIn-noui',
                       RHSignInNoUI,
                       methods=('POST', ))


def boshInitConnection(_login, _password):
    plugin = plugin_engine.get_plugin("indicoxmpp")
    base_host = plugin.settings.get("base_host")
    base_port = plugin.settings.get("base_port")
コード例 #21
0
ファイル: plugin.py プロジェクト: florv/indico-plugins
    def get_timetable_buttons(self, *args, **kwargs):
        yield (_('Importer'), 'create-importer-dialog')

    def get_vars_js(self):
        return {'urls': {'import_data': plugin_url_rule_to_js('importer.import_data'),
                         'importers': plugin_url_rule_to_js('importer.importers'),
                         'day_end_date': plugin_url_rule_to_js('importer.day_end_date'),
                         'block_end_date': plugin_url_rule_to_js('importer.block_end_date'),
                         'add_contrib': url_rule_to_js('timetable.add_contribution'),
                         'create_subcontrib_rest': url_rule_to_js('contributions.create_subcontrib_rest'),
                         'create_contrib_reference_rest': url_rule_to_js('contributions.create_contrib_reference_rest'),
                         'create_subcontrib_reference_rest': url_rule_to_js('contributions'
                                                                            '.create_subcontrib_reference_rest'),
                         'add_link': url_rule_to_js('attachments.add_link')}}

    def register_assets(self):
        self.register_js_bundle('importer_js', 'js/importer.js')
        self.register_css_bundle('importer_css', 'css/importer.css')

    def register_importer_engine(self, importer_engine, plugin):
        self.importer_engines[importer_engine._id] = (importer_engine, plugin)


blueprint = IndicoPluginBlueprint('importer', __name__)
blueprint.add_url_rule('/importers/<importer_name>/search', 'import_data', RHImportData, methods=('POST',))
blueprint.add_url_rule('/importers/', 'importers', RHGetImporters)

blueprint.add_url_rule('/importers/<importer_name>/event/<confId>/day-end-date', 'day_end_date', RHDayEndTime)
blueprint.add_url_rule('/importers/<importer_name>/event/<confId>/entry/<entry_id>/block-end-date', 'block_end_date',
                       RHBlockEndTime)
コード例 #22
0
        add_to_context('bar',
                       name='foo',
                       doc='foobar from example plugin',
                       color='magenta!')


class SettingsForm(IndicoForm):
    dummy_message = StringField('Dummy Message')
    show_message = BooleanField('Show Message')


class WPExample(WPDecorated):
    def _get_body(self, params):
        return render_plugin_template('example.html', **params)


class RHExample(RH):
    def _process(self):
        return WPExample(self, foo=u'bar').display()


class RHTest(RH):
    def _process(self):
        return render_plugin_template('test.html')


blueprint = IndicoPluginBlueprint('example', __name__)
blueprint.add_url_rule('/example', 'example', view_func=RHExample)
blueprint.add_url_rule('/example/x', 'example', view_func=RHExample)
blueprint.add_url_rule('/test', 'test', view_func=RHTest)
コード例 #23
0
# This file is part of the CERN Indico plugins.
# Copyright (C) 2014 - 2017 CERN
#
# The CERN Indico plugins are free software; you can redistribute
# them and/or modify them under the terms of the MIT License; see
# the LICENSE file for more details.

from __future__ import unicode_literals

from indico.core.plugins import IndicoPluginBlueprint

from indico_ravem.controllers import RHRavemConnectRoom, RHRavemDisconnectRoom, RHRavemRoomStatus

blueprint = IndicoPluginBlueprint(
    'ravem',
    'indico_ravem',
    url_prefix='/event/<confId>/videoconference/ravem')

blueprint.add_url_rule('/room-status/<int:event_vc_room_id>/', 'room_status',
                       RHRavemRoomStatus)
blueprint.add_url_rule('/connect-room/<int:event_vc_room_id>/',
                       'connect_room',
                       RHRavemConnectRoom,
                       methods=('POST', ))
blueprint.add_url_rule('/disconnect-room/<int:event_vc_room_id>/',
                       'disconnect_room',
                       RHRavemDisconnectRoom,
                       methods=('POST', ))
コード例 #24
0
            break
    else:
        raise BadRequest(response=redirect(event.url))
    if vca.data.get('only_registered_users') and \
        not any([x[1] for x in get_event_regforms(event, session.user)]):
        flash(_("The vc link is only available to registered users."), 'error')
        raise BadRequest(response=redirect(event.url))

    vcroom = vca.vc_room
    url = vcroom.data['room_url_base']
    data = {'id': contrib.friendly_id, 'username': session.user.name}

    req = requests.post(url, json=data)
    if req.status_code != 200:
        flash('Error: The redirector did not succeed!', 'error')
        raise BadRequest(response=redirect(event.url))

    res = req.json()
    if res['status'] != 'success':
        flash(_("Videoconference link:") + ' ' + res['message'], 'error')
        raise BadRequest(response=redirect(event.url))

    return redirect(res['url'])


_bp = IndicoPluginBlueprint('vc_redirector', __name__)

_bp.add_url_rule('/redirectVC/<contrib_id>',
                 'vc_redirect',
                 view_func=RHredirectToExternal)
コード例 #25
0
ファイル: blueprint.py プロジェクト: indico/indico-plugins
# This file is part of Indico.
# Copyright (C) 2002 - 2018 European Organization for Nuclear Research (CERN).
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# Indico is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Indico; if not, see <http://www.gnu.org/licenses/>.

from __future__ import unicode_literals

from indico.core.plugins import IndicoPluginBlueprint

from indico_livesync.controllers import RHAddAgent, RHDeleteAgent, RHEditAgent


blueprint = IndicoPluginBlueprint('livesync', 'indico_livesync', url_prefix='/admin/plugins/livesync')

blueprint.add_url_rule('/agents/create/<backend>', 'add_agent', RHAddAgent, methods=('GET', 'POST'))
blueprint.add_url_rule('/agents/<int:agent_id>', 'edit_agent', RHEditAgent, methods=('GET', 'POST'))
blueprint.add_url_rule('/agents/<int:agent_id>', 'delete_agent', RHDeleteAgent, methods=('DELETE',))
コード例 #26
0
# This file is part of the CERN Indico plugins.
# Copyright (C) 2014 - 2020 CERN
#
# The CERN Indico plugins are free software; you can redistribute
# them and/or modify them under the terms of the MIT License; see
# the LICENSE file for more details.

from __future__ import unicode_literals

from indico.core.plugins import IndicoPluginBlueprint

from indico_livesync_cern.controllers import RHCategoriesJSON

blueprint = IndicoPluginBlueprint('livesync_cern', __name__)

blueprint.add_url_rule('/livesync/cernsearch/categories.json',
                       'categories_json', RHCategoriesJSON)
コード例 #27
0
# This file is part of the Indico plugins.
# Copyright (C) 2002 - 2020 CERN
#
# The Indico plugins are free software; you can redistribute
# them and/or modify them under the terms of the MIT License;
# see the LICENSE file for more details.

from __future__ import unicode_literals

from indico.core.plugins import IndicoPluginBlueprint

from indico_search.controllers import RHSearch, RHSearchCategoryTitles

blueprint = IndicoPluginBlueprint('search', 'indico_search')

blueprint.add_url_rule('/search', 'search', RHSearch)
blueprint.add_url_rule('/category/<int:category_id>/search', 'search',
                       RHSearch)
blueprint.add_url_rule('/event/<confId>/search', 'search', RHSearch)

blueprint.add_url_rule('/category/search-titles', 'category_names',
                       RHSearchCategoryTitles)
コード例 #28
0
from indico.core.plugins import IndicoPluginBlueprint

from indico_cern_access.controllers import (RHExportCERNAccessCSV,
                                            RHExportCERNAccessExcel,
                                            RHRegistrationAccessIdentityData,
                                            RHRegistrationBulkCERNAccess,
                                            RHRegistrationEnterIdentityData)

blueprint = IndicoPluginBlueprint('cern_access',
                                  __name__,
                                  url_prefix='/event/<confId>')

blueprint.add_url_rule(
    '/manage/registration/<int:reg_form_id>/registrations/cern-access',
    'registrations_cern_access',
    RHRegistrationBulkCERNAccess,
    methods=('POST', ))
blueprint.add_url_rule(
    '/manage/registration/<int:reg_form_id>/registrations/cern-access.csv',
    'registrations_cern_access_csv',
    RHExportCERNAccessCSV,
    defaults={'type': 'cern-access'})
blueprint.add_url_rule(
    '/manage/registration/<int:reg_form_id>/registrations/cern-access.xlsx',
    'registrations_cern_access_excel',
    RHExportCERNAccessExcel,
    defaults={'type': 'cern-access'})
blueprint.add_url_rule(
    '/manage/registration/<int:reg_form_id>/registrations/<int:registration_id>/cern-access-data',
    'enter_identity_data',
コード例 #29
0
# Indico is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Indico; if not, see <http://www.gnu.org/licenses/>.

from __future__ import unicode_literals

from indico.core.plugins import IndicoPluginBlueprint

from indico_payment_paypal.controllers import RHPaypalCancel, RHPaypalIPN, RHPaypalSuccess

blueprint = IndicoPluginBlueprint(
    'payment_paypal',
    __name__,
    url_prefix=
    '/event/<confId>/registrations/<int:reg_form_id>/payment/response/paypal')

blueprint.add_url_rule('/cancel',
                       'cancel',
                       RHPaypalCancel,
                       methods=('GET', 'POST'))
blueprint.add_url_rule('/success',
                       'success',
                       RHPaypalSuccess,
                       methods=('GET', 'POST'))
# Used by PayPal to send an asynchronous notification for the transaction (pending, successful, etc)
blueprint.add_url_rule('/ipn', 'notify', RHPaypalIPN, methods=('POST', ))
コード例 #30
0
        self.register_js_bundle('global_js', 'js/global.js')
        self.register_css_bundle('example_css', 'css/example.scss')
        self.register_css_bundle('global_css', 'css/global.scss')


blueprint = IndicoPluginBlueprint('example', __name__)


class WPExample(WPDecorated):
    def _getBody(self, params):
        locale = get_current_locale()
        params['language'] = IndicoLocale.parse('en').languages[locale.language]
        params['python_msg_core_i18n'] = core_gettext('Hello world!')
        params['python_msg_plugin_i18n'] = _('Hello world!')
        return render_plugin_template('example:example.html', **params)


class RHExample(RH):
    def _process(self):
        return WPExample(self, foo=u'bar').display()


class RHTest(RH):
    def _process(self):
        return render_plugin_template('test.html')


blueprint.add_url_rule('/example', 'example', view_func=RHExample)
blueprint.add_url_rule('/example/x', 'example', view_func=RHExample)
blueprint.add_url_rule('/test', 'test', view_func=RHTest)
コード例 #31
0
ファイル: blueprint.py プロジェクト: florv/indico-plugins
# along with Indico; if not, see <http://www.gnu.org/licenses/>.

from __future__ import unicode_literals

from indico.core.plugins import IndicoPluginBlueprint

from indico_chat.controllers.event import RHChatEventPage
from indico_chat.controllers.logs import RHChatManageEventLogs, RHChatManageEventShowLogs, RHChatManageEventAttachLogs
from indico_chat.controllers.management import (RHChatManageEvent, RHChatManageEventModify, RHChatManageEventRefresh,
                                                RHChatManageEventRemove, RHChatManageEventCreate,
                                                RHChatManageEventAttach)

blueprint = IndicoPluginBlueprint('chat', 'indico_chat', url_prefix='/event/<confId>')

# Event
blueprint.add_url_rule('/chat', 'event_page', RHChatEventPage)

# Event management
blueprint.add_url_rule('/manage/chat/', 'manage_rooms', RHChatManageEvent)
blueprint.add_url_rule('/manage/chat/<int:chatroom_id>/', 'manage_rooms_modify', RHChatManageEventModify,
                       methods=('GET', 'POST'))
blueprint.add_url_rule('/manage/chat/<int:chatroom_id>/logs/', 'manage_rooms_logs', RHChatManageEventLogs)
blueprint.add_url_rule('/manage/chat/<int:chatroom_id>/logs/show', 'manage_rooms_show_logs',
                       RHChatManageEventShowLogs)
blueprint.add_url_rule('/manage/chat/<int:chatroom_id>/logs/attach', 'manage_rooms_attach_logs',
                       RHChatManageEventAttachLogs, methods=('POST',))
blueprint.add_url_rule('/manage/chat/<int:chatroom_id>/refresh', 'manage_rooms_refresh', RHChatManageEventRefresh,
                       methods=('POST',))
blueprint.add_url_rule('/manage/chat/<int:chatroom_id>/remove', 'manage_rooms_remove', RHChatManageEventRemove,
                       methods=('POST',))
blueprint.add_url_rule('/manage/chat/create', 'manage_rooms_create', RHChatManageEventCreate,
コード例 #32
0
# This file is part of the Indico plugins.
# Copyright (C) 2002 - 2020 CERN
#
# The Indico plugins are free software; you can redistribute
# them and/or modify them under the terms of the MIT License;
# see the LICENSE file for more details.

from __future__ import unicode_literals

from indico.core.plugins import IndicoPluginBlueprint

from indico_ursh.controllers import RHCustomShortURLPage, RHGetShortURL, RHShortURLPage


blueprint = IndicoPluginBlueprint('ursh', 'indico_ursh')
blueprint.add_url_rule('/ursh', 'get_short_url', RHGetShortURL, methods=('POST',))
blueprint.add_url_rule('/url-shortener', 'shorten_url', RHShortURLPage)
blueprint.add_url_rule('/event/<confId>/manage/short-url', 'shorten_event_url', RHCustomShortURLPage,
                       methods=('GET', 'POST'))
コード例 #33
0
                url_rule_to_js('contributions.create_contrib_reference_rest'),
                'create_subcontrib_reference_rest':
                url_rule_to_js('contributions'
                               '.create_subcontrib_reference_rest'),
                'add_link':
                url_rule_to_js('attachments.add_link')
            }
        }

    def register_assets(self):
        self.register_js_bundle('importer_js', 'js/importer.js')
        self.register_css_bundle('importer_css', 'css/importer.css')

    def register_importer_engine(self, importer_engine, plugin):
        self.importer_engines[importer_engine._id] = (importer_engine, plugin)


blueprint = IndicoPluginBlueprint('importer', __name__)
blueprint.add_url_rule('/importers/<importer_name>/search',
                       'import_data',
                       RHImportData,
                       methods=('POST', ))
blueprint.add_url_rule('/importers/', 'importers', RHGetImporters)

blueprint.add_url_rule(
    '/importers/<importer_name>/event/<confId>/day-end-date', 'day_end_date',
    RHDayEndTime)
blueprint.add_url_rule(
    '/importers/<importer_name>/event/<confId>/entry/<entry_id>/block-end-date',
    'block_end_date', RHBlockEndTime)
コード例 #34
0
# This file is part of Indico.
# Copyright (C) 2017 Bjoern Pedersen.
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# Indico is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Indico; if not, see <http://www.gnu.org/licenses/>.

from __future__ import unicode_literals

from indico.core.plugins import IndicoPluginBlueprint

from indico_print_checkin.controllers import RHPrintBadgeManageEvent

blueprint = IndicoPluginBlueprint('print_checkin', 'print_checkin', url_prefix='/event/<confId>')


# Event management
blueprint.add_url_rule('/manage/printbadge/', 'configure', RHPrintBadgeManageEvent, methods=('GET', 'POST'))
コード例 #35
0
# This file is part of the Indico plugins.
# Copyright (C) 2002 - 2020 CERN
#
# The Indico plugins are free software; you can redistribute
# them and/or modify them under the terms of the MIT License;
# see the LICENSE file for more details.

from indico.core.plugins import IndicoPluginBlueprint

from indico_vc_bbb.controllers import RHStartAndJoin, RHVCManageEventSlides, RHVCManageEventRecordings, RHVCViewEventRecordings

blueprint = IndicoPluginBlueprint('vc_bbb', 'indico_vc_bbb')

blueprint.add_url_rule(
    '/event/<int:event_id>/videoconference/<any(bbb):service>/<int:event_vc_room_id>/start',
    'start_and_join',
    RHStartAndJoin,
    methods=('POST', 'GET'))
blueprint.add_url_rule(
    '/event/<int:event_id>/manage/videoconference/<any(bbb):service>/<int:event_vc_room_id>/slides',
    'slides',
    RHVCManageEventSlides,
    methods=('POST', 'GET'))
blueprint.add_url_rule(
    '/event/<int:event_id>/manage/videoconference/<any(bbb):service>/<int:event_vc_room_id>/recordings',
    'recordings', RHVCManageEventRecordings)
blueprint.add_url_rule(
    '/event/<int:event_id>/manage/videoconference/<any(bbb):service>/<int:event_vc_room_id>/view_recordings',
    'view_recordings', RHVCViewEventRecordings)
コード例 #36
0
from __future__ import unicode_literals

from indico.core.plugins import IndicoPluginBlueprint

from indico_payment_cern.controllers import (
    RHPaymentCancel, RHPaymentCancelBackground, RHPaymentDecline,
    RHPaymentSuccess, RHPaymentSuccessBackground, RHPaymentUncertain)

blueprint = IndicoPluginBlueprint(
    'payment_cern',
    __name__,
    url_prefix=
    '/event/<confId>/registrations/<int:reg_form_id>/payment/response/cern')
blueprint.add_url_rule('/cancel',
                       'cancel',
                       RHPaymentCancel,
                       methods=('GET', 'POST'))
blueprint.add_url_rule('/decline',
                       'decline',
                       RHPaymentDecline,
                       methods=('GET', 'POST'))
blueprint.add_url_rule('/uncertain',
                       'uncertain',
                       RHPaymentUncertain,
                       methods=('GET', 'POST'))
blueprint.add_url_rule('/success',
                       'success',
                       RHPaymentSuccess,
                       methods=('GET', 'POST'))
# ID-less URL for the callback where we cannot customize anything besides a single variable
blueprint.add_url_rule('!/payment/cern/success',
コード例 #37
0
from __future__ import unicode_literals

from indico.core.plugins import IndicoPluginBlueprint

from .request_handlers import (SixPayResponseHandler, UserCancelHandler,
                               UserFailureHandler, UserSuccessHandler)

#: url mount points exposing callbacks
blueprint = IndicoPluginBlueprint(
    'payment_sixpay',
    __name__,
    url_prefix=('/event/<confId>/registrations/'
                '<int:reg_form_id>/payment/response/sixpay'))

blueprint.add_url_rule('/failure',
                       'failure',
                       UserCancelHandler,
                       methods=('GET', 'POST'))
blueprint.add_url_rule('/cancel',
                       'cancel',
                       UserFailureHandler,
                       methods=('GET', 'POST'))
blueprint.add_url_rule('/success',
                       'success',
                       UserSuccessHandler,
                       methods=('GET', 'POST'))
# Used by SixPay to send an asynchronous notification for the transaction
blueprint.add_url_rule('/ipn',
                       'notify',
                       SixPayResponseHandler,
                       methods=('Get', 'POST'))
コード例 #38
0
# This file is part of the Indico plugins.
# Copyright (C) 2020 - 2021 CERN and ENEA
#
# The Indico plugins are free software; you can redistribute
# them and/or modify them under the terms of the MIT License;
# see the LICENSE file for more details.

from indico.core.plugins import IndicoPluginBlueprint

from indico_vc_zoom.controllers import RHRoomAlternativeHost, RHWebhook

blueprint = IndicoPluginBlueprint('vc_zoom', 'indico_vc_zoom')

# Room management
# using any(zoom) instead of defaults since the event vc room locator
# includes the service and normalization skips values provided in 'defaults'
blueprint.add_url_rule(
    '/event/<int:event_id>/manage/videoconference/<any(zoom):service>/<int:event_vc_room_id>/make-me-alt-host',
    'make_me_alt_host',
    RHRoomAlternativeHost,
    methods=('POST', ))
blueprint.add_url_rule('/api/plugin/zoom/webhook',
                       'webhook',
                       RHWebhook,
                       methods=('POST', ))
コード例 #39
0
ファイル: blueprint.py プロジェクト: florv/indico-plugins
# This file is part of Indico.
# Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN).
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# Indico is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Indico; if not, see <http://www.gnu.org/licenses/>.

from __future__ import unicode_literals

from indico.core.plugins import IndicoPluginBlueprint

from indico_search.controllers import RHSearch, RHSearchCategoryTitles


blueprint = IndicoPluginBlueprint('search', 'indico_search')

blueprint.add_url_rule('/search', 'search', RHSearch, methods=('GET', 'POST'))
blueprint.add_url_rule('/category/<categId>/search', 'search', RHSearch, methods=('GET', 'POST'))
blueprint.add_url_rule('/event/<confId>/search', 'search', RHSearch, methods=('GET', 'POST'))

blueprint.add_url_rule('/category/search-titles', 'category_names', RHSearchCategoryTitles)
コード例 #40
0
ファイル: blueprint.py プロジェクト: errikos/indico-plugins
# This file is part of the Indico plugins.
# Copyright (C) 2002 - 2021 CERN
#
# The Indico plugins are free software; you can redistribute
# them and/or modify them under the terms of the MIT License;
# see the LICENSE file for more details.

from indico.core.plugins import IndicoPluginBlueprint

from indico_vc_vidyo.controllers import RHVidyoRoomOwner

blueprint = IndicoPluginBlueprint('vc_vidyo', 'indico_vc_vidyo')

# Room management
# using any(vidyo) instead of defaults since the event vc room locator
# includes the service and normalization skips values provided in 'defaults'
blueprint.add_url_rule(
    '/event/<int:event_id>/manage/videoconference/<any(vidyo):service>/<int:event_vc_room_id>/room-owner',
    'set_room_owner',
    RHVidyoRoomOwner,
    methods=('POST', ))
コード例 #41
0
ファイル: blueprint.py プロジェクト: florv/indico-plugins
# This file is part of Indico.
# Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN).
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# Indico is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Indico; if not, see <http://www.gnu.org/licenses/>.

from indico.core.plugins import IndicoPluginBlueprint
from indico_previewer_jupyter.controllers import RHEventPreviewIPyNB


blueprint = IndicoPluginBlueprint('previewer_jupyter', __name__)
blueprint.add_url_rule('/preview/ipynb/<int:attachment_id>', 'preview_ipynb', RHEventPreviewIPyNB)
コード例 #42
0
ファイル: blueprint.py プロジェクト: indico/indico-plugins
# This file is part of Indico.
# Copyright (C) 2002 - 2018 European Organization for Nuclear Research (CERN).
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# Indico is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Indico; if not, see <http://www.gnu.org/licenses/>.

from __future__ import unicode_literals

from indico.core.plugins import IndicoPluginBlueprint

from indico_storage_s3.controllers import RHBuckets


blueprint = IndicoPluginBlueprint('storage_s3', __name__, url_prefix='/api/plugin/s3')
blueprint.add_url_rule('/buckets', 'buckets', RHBuckets)