Remove the old scheduler
[cds-indico.git] / indico / MaKaC / webinterface / urlHandlers.py
blob3cf6736ae04f8bf848eb7b3a1003516c9b61a748
1 # This file is part of Indico.
2 # Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN).
4 # Indico is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License as
6 # published by the Free Software Foundation; either version 3 of the
7 # License, or (at your option) any later version.
9 # Indico is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with Indico; if not, see <http://www.gnu.org/licenses/>.
17 import os
18 import re
19 import string
20 import urlparse
22 from flask import request, session, has_request_context
24 from MaKaC.common.url import URL, EndpointURL
25 from MaKaC.common.utils import utf8rep
26 from MaKaC.common.timezoneUtils import nowutc
27 from MaKaC.common.contextManager import ContextManager
29 from indico.core.config import Config
32 class BooleanMixin:
33 """Mixin to convert True to 'y' and remove False altogether."""
34 _true = 'y'
36 @classmethod
37 def _translateParams(cls, params):
38 return dict((key, cls._true if value is True else value)
39 for key, value in params.iteritems()
40 if value is not False)
43 class BooleanTrueMixin(BooleanMixin):
44 _true = 'True'
47 class URLHandler(object):
48 """This is the generic URLHandler class. It contains information about the
49 concrete URL pointing to the request handler and gives basic methods to
50 generate the URL from some target objects complying to the Locable
51 interface.
52 Actually, URLHandlers must never be intanciated as all their methods are
53 classmethods.
55 Attributes:
56 _relativeURL - (string) Contains the relative (the part which is
57 variable from the root) URL pointing to the corresponding request
58 handler.
59 _endpoint - (string) Contains the name of a Flask endpoint.
60 _defaultParams - (dict) Default params (overwritten by kwargs)
61 _fragment - (string) URL fragment to set
62 """
63 _relativeURL = None
64 _endpoint = None
65 _defaultParams = {}
66 _fragment = False
68 @classmethod
69 def getRelativeURL(cls):
70 """Gives the relative URL (URL part which is carachteristic) for the
71 corresponding request handler.
72 """
73 return cls._relativeURL
75 @classmethod
76 def getStaticURL(cls, target=None, **params):
77 if cls._relativeURL:
78 return cls._relativeURL.replace('.py', '.html')
79 else:
80 # yay, super ugly, but it works...
81 return re.sub(r'^event\.', '', cls._endpoint) + '.html'
83 @classmethod
84 def _want_secure_url(cls, force_secure=None):
85 if not Config.getInstance().getBaseSecureURL():
86 return False
87 elif force_secure is not None:
88 return force_secure
89 elif not has_request_context():
90 return False
91 else:
92 return request.is_secure
94 @classmethod
95 def _getURL(cls, _force_secure=None, **params):
96 """ Gives the full URL for the corresponding request handler.
98 Parameters:
99 _force_secure - (bool) create a secure url if possible
100 params - (dict) parameters to be added to the URL.
103 secure = cls._want_secure_url(_force_secure)
104 if not cls._endpoint:
105 # Legacy UH containing a relativeURL
106 cfg = Config.getInstance()
107 baseURL = cfg.getBaseSecureURL() if secure else cfg.getBaseURL()
108 url = URL('%s/%s' % (baseURL, cls.getRelativeURL()), **params)
109 else:
110 assert not cls.getRelativeURL()
111 url = EndpointURL(cls._endpoint, secure, params)
113 if cls._fragment:
114 url.fragment = cls._fragment
116 return url
118 @classmethod
119 def _translateParams(cls, params):
120 # When overriding this you may return a new dict or modify the existing one in-place.
121 # But in any case, you must return the final dict.
122 return params
124 @classmethod
125 def _getParams(cls, target, params):
126 params = dict(cls._defaultParams, **params)
127 if target is not None:
128 params.update(target.getLocator())
129 params = cls._translateParams(params)
130 return params
132 @classmethod
133 def getURL(cls, target=None, _ignore_static=False, **params):
134 """Gives the full URL for the corresponding request handler. In case
135 the target parameter is specified it will append to the URL the
136 the necessary parameters to make the target be specified in the url.
138 Parameters:
139 target - (Locable) Target object which must be uniquely
140 specified in the URL so the destination request handler
141 is able to retrieve it.
142 params - (Dict) parameters to be added to the URL.
144 if not _ignore_static and ContextManager.get('offlineMode', False):
145 return URL(cls.getStaticURL(target, **params))
146 return cls._getURL(**cls._getParams(target, params))
149 class SecureURLHandler(URLHandler):
150 @classmethod
151 def getURL(cls, target=None, **params):
152 return cls._getURL(_force_secure=True, **cls._getParams(target, params))
155 class OptionallySecureURLHandler(URLHandler):
156 @classmethod
157 def getURL(cls, target=None, secure=False, **params):
158 return cls._getURL(_force_secure=secure, **cls._getParams(target, params))
161 class UserURLHandler(URLHandler):
162 """Strips the userId param if it's the current user"""
164 @classmethod
165 def _translateParams(cls, params):
166 if 'userId' in params and session.get('_avatarId') == params['userId']:
167 del params['userId']
168 return params
171 # Hack to allow secure Indico on non-80 ports
172 def setSSLPort(url):
174 Returns url with port changed to SSL one.
175 If url has no port specified, it returns the same url.
176 SSL port is extracted from loginURL (MaKaCConfig)
178 # Set proper PORT for images requested via SSL
179 sslURL = Config.getInstance().getBaseSecureURL()
180 sslPort = ':%d' % (urlparse.urlsplit(sslURL).port or 443)
182 # If there is NO port, nothing will happen (production indico)
183 # If there IS a port, it will be replaced with proper SSL one, taken from loginURL
184 regexp = ':\d{2,5}' # Examples: :8080 :80 :65535
185 return re.sub(regexp, sslPort, url)
188 class UHWelcome(URLHandler):
189 _endpoint = 'misc.index'
192 class UHOAuthRequestToken(URLHandler):
193 _endpoint = 'oauth_old.oauth-request_token'
196 class UHOAuthAuthorization(URLHandler):
197 _endpoint = 'oauth_old.oauth-authorize'
200 class UHOAuthAccessTokenURL(URLHandler):
201 _endpoint = 'oauth_old.oauth-access_token'
204 class UHOAuthAuthorizeConsumer(UserURLHandler):
205 _endpoint = 'oauth_old.oauth-authorize_consumer'
208 class UHOAuthThirdPartyAuth(UserURLHandler):
209 _endpoint = 'oauth_old.oauth-thirdPartyAuth'
212 class UHIndicoNews(URLHandler):
213 _endpoint = 'misc.news'
216 class UHConferenceHelp(URLHandler):
217 _endpoint = 'misc.help'
220 class UHCalendar(URLHandler):
221 _endpoint = 'category.wcalendar'
223 @classmethod
224 def getURL(cls, categList=None):
225 url = cls._getURL()
226 if not categList:
227 categList = []
228 lst = [categ.getId() for categ in categList]
229 url.addParam('selCateg', lst)
230 return url
233 class UHCalendarSelectCategories(URLHandler):
234 _endpoint = 'category.wcalendar-select'
237 class UHConferenceCreation(URLHandler):
238 _endpoint = 'event_creation.conferenceCreation'
240 @classmethod
241 def getURL(cls, target):
242 url = cls._getURL()
243 if target is not None:
244 url.addParams(target.getLocator())
245 return url
248 class UHConferencePerformCreation(URLHandler):
249 _endpoint = 'event_creation.conferenceCreation-createConference'
252 class UHConferenceDisplay(URLHandler):
253 _endpoint = 'event.conferenceDisplay'
256 class UHNextEvent(URLHandler):
257 _endpoint = 'event.conferenceDisplay-next'
260 class UHPreviousEvent(URLHandler):
261 _endpoint = 'event.conferenceDisplay-prev'
264 class UHConferenceOverview(URLHandler):
265 _endpoint = 'event.conferenceDisplay-overview'
267 @classmethod
268 def getURL(cls, target):
269 if ContextManager.get('offlineMode', False):
270 return URL(UHConferenceDisplay.getStaticURL(target))
271 return super(UHConferenceOverview, cls).getURL(target)
274 class UHConferenceEmail(URLHandler):
275 _endpoint = 'event.EMail'
277 @classmethod
278 def getStaticURL(cls, target, **params):
279 if target is not None:
280 return "mailto:%s" % str(target.getEmail())
281 return cls.getURL(target)
284 class UHConferenceSendEmail(URLHandler):
285 _endpoint = 'event.EMail-send'
288 class UHRegistrantsSendEmail(URLHandler):
289 _endpoint = 'event_mgmt.EMail-sendreg'
292 class UHConvenersSendEmail(URLHandler):
293 _endpoint = 'event_mgmt.EMail-sendconvener'
296 class UHContribParticipantsSendEmail(URLHandler):
297 _endpoint = 'event_mgmt.EMail-sendcontribparticipants'
300 class UHConferenceOtherViews(URLHandler):
301 _endpoint = 'event.conferenceOtherViews'
304 class UHConferenceLogo(URLHandler):
305 _endpoint = 'event.conferenceDisplay-getLogo'
307 @classmethod
308 def getStaticURL(cls, target, **params):
309 return os.path.join(Config.getInstance().getImagesBaseURL(), "logo", str(target.getLogo()))
312 class UHConferenceCSS(URLHandler):
313 _endpoint = 'event.conferenceDisplay-getCSS'
315 @classmethod
316 def getStaticURL(cls, target, **params):
317 return cls.getURL(target, _ignore_static=True, **params)
320 class UHConferencePic(URLHandler):
321 _endpoint = 'event.conferenceDisplay-getPic'
324 class UHConfModifPreviewCSS(URLHandler):
325 _endpoint = 'event_mgmt.confModifDisplay-previewCSS'
328 class UHCategoryIcon(URLHandler):
329 _endpoint = 'category.categoryDisplay-getIcon'
332 class UHConferenceModification(URLHandler):
333 _endpoint = 'event_mgmt.conferenceModification'
336 class UHConfModifShowMaterials(URLHandler):
337 _endpoint = 'event_mgmt.conferenceModification-materialsShow'
340 class UHConfModifAddMaterials(URLHandler):
341 _endpoint = 'event_mgmt.conferenceModification-materialsAdd'
343 # ============================================================================
344 # ROOM BOOKING ===============================================================
345 # ============================================================================
347 # Free standing ==============================================================
350 class UHRoomBookingMapOfRooms(URLHandler):
351 _endpoint = 'rooms.roomBooking-mapOfRooms'
354 class UHRoomBookingMapOfRoomsWidget(URLHandler):
355 _endpoint = 'rooms.roomBooking-mapOfRoomsWidget'
358 class UHRoomBookingWelcome(URLHandler):
359 _endpoint = 'rooms.roomBooking'
362 class UHRoomBookingSearch4Bookings(URLHandler):
363 _endpoint = 'rooms.roomBooking-search4Bookings'
366 class UHRoomBookingRoomDetails(BooleanTrueMixin, URLHandler):
367 _endpoint = 'rooms.roomBooking-roomDetails'
370 class UHRoomBookingRoomStats(URLHandler):
371 _endpoint = 'rooms.roomBooking-roomStats'
374 class UHRoomBookingBookingDetails(URLHandler):
375 _endpoint = 'rooms.roomBooking-bookingDetails'
377 @classmethod
378 def _translateParams(cls, params):
379 # confId is apparently unused and thus just ugly
380 params.pop('confId', None)
381 return params
384 class UHRoomBookingModifyBookingForm(URLHandler):
385 _endpoint = 'rooms.roomBooking-modifyBookingForm'
388 class UHRoomBookingDeleteBooking(URLHandler):
389 _endpoint = 'rooms.roomBooking-deleteBooking'
392 class UHRoomBookingCloneBooking(URLHandler):
393 _endpoint = 'rooms.roomBooking-cloneBooking'
396 class UHRoomBookingCancelBooking(URLHandler):
397 _endpoint = 'rooms.roomBooking-cancelBooking'
400 class UHRoomBookingAcceptBooking(URLHandler):
401 _endpoint = 'rooms.roomBooking-acceptBooking'
404 class UHRoomBookingRejectBooking(URLHandler):
405 _endpoint = 'rooms.roomBooking-rejectBooking'
408 class UHRoomBookingCancelBookingOccurrence(URLHandler):
409 _endpoint = 'rooms.roomBooking-cancelBookingOccurrence'
412 # RB Administration
413 class UHRoomBookingAdmin(URLHandler):
414 _endpoint = 'rooms_admin.roomBooking-admin'
417 class UHRoomBookingAdminLocation(URLHandler):
418 _endpoint = 'rooms_admin.roomBooking-adminLocation'
421 class UHRoomBookingSetDefaultLocation(URLHandler):
422 _endpoint = 'rooms_admin.roomBooking-setDefaultLocation'
425 class UHRoomBookingSaveLocation(URLHandler):
426 _endpoint = 'rooms_admin.roomBooking-saveLocation'
429 class UHRoomBookingDeleteLocation(URLHandler):
430 _endpoint = 'rooms_admin.roomBooking-deleteLocation'
433 class UHRoomBookingSaveEquipment(URLHandler):
434 _endpoint = 'rooms_admin.roomBooking-saveEquipment'
437 class UHRoomBookingDeleteEquipment(URLHandler):
438 _endpoint = 'rooms_admin.roomBooking-deleteEquipment'
441 class UHRoomBookingSaveCustomAttributes(URLHandler):
442 _endpoint = 'rooms_admin.roomBooking-saveCustomAttributes'
445 class UHConferenceClose(URLHandler):
446 _endpoint = 'event_mgmt.conferenceModification-close'
449 class UHConferenceOpen(URLHandler):
450 _endpoint = 'event_mgmt.conferenceModification-open'
453 class UHConfDataModif(URLHandler):
454 _endpoint = 'event_mgmt.conferenceModification-data'
457 class UHConfScreenDatesEdit(URLHandler):
458 _endpoint = 'event_mgmt.conferenceModification-screenDates'
461 class UHConfPerformDataModif(URLHandler):
462 _endpoint = 'event_mgmt.conferenceModification-dataPerform'
465 class UHConfAddContribType(URLHandler):
466 _endpoint = 'event_mgmt.conferenceModification-addContribType'
469 class UHConfRemoveContribType(URLHandler):
470 _endpoint = 'event_mgmt.conferenceModification-removeContribType'
473 class UHConfEditContribType(URLHandler):
474 _endpoint = 'event_mgmt.conferenceModification-editContribType'
477 class UHConfModifCFAOptFld(URLHandler):
478 _endpoint = 'event_mgmt.confModifCFA-abstractFields'
481 class UHConfModifCFARemoveOptFld(URLHandler):
482 _endpoint = 'event_mgmt.confModifCFA-removeAbstractField'
485 class UHConfModifCFAAbsFieldUp(URLHandler):
486 _endpoint = 'event_mgmt.confModifCFA-absFieldUp'
489 class UHConfModifCFAAbsFieldDown(URLHandler):
490 _endpoint = 'event_mgmt.confModifCFA-absFieldDown'
493 class UHConfModifProgram(URLHandler):
494 _endpoint = 'event_mgmt.confModifProgram'
497 class UHConfModifCFA(URLHandler):
498 _endpoint = 'event_mgmt.confModifCFA'
501 class UHConfModifCFAPreview(URLHandler):
502 _endpoint = 'event_mgmt.confModifCFA-preview'
505 class UHConfCFAChangeStatus(URLHandler):
506 _endpoint = 'event_mgmt.confModifCFA-changeStatus'
509 class UHConfCFASwitchMultipleTracks(URLHandler):
510 _endpoint = 'event_mgmt.confModifCFA-switchMultipleTracks'
513 class UHConfCFAMakeTracksMandatory(URLHandler):
514 _endpoint = 'event_mgmt.confModifCFA-makeTracksMandatory'
517 class UHConfCFAAllowAttachFiles(URLHandler):
518 _endpoint = 'event_mgmt.confModifCFA-switchAttachFiles'
521 class UHAbstractAttachmentFileAccess(URLHandler):
522 _endpoint = 'event.abstractDisplay-getAttachedFile'
525 class UHConfCFAShowSelectAsSpeaker(URLHandler):
526 _endpoint = 'event_mgmt.confModifCFA-switchShowSelectSpeaker'
529 class UHConfCFASelectSpeakerMandatory(URLHandler):
530 _endpoint = 'event_mgmt.confModifCFA-switchSelectSpeakerMandatory'
533 class UHConfCFAAttachedFilesContribList(URLHandler):
534 _endpoint = 'event_mgmt.confModifCFA-switchShowAttachedFiles'
537 class UHCFADataModification(URLHandler):
538 _endpoint = 'event_mgmt.confModifCFA-modifyData'
541 class UHCFAPerformDataModification(URLHandler):
542 _endpoint = 'event_mgmt.confModifCFA-performModifyData'
545 class UHConfAbstractManagment(URLHandler):
546 _endpoint = 'event_mgmt.abstractsManagment'
549 class UHConfAbstractList(URLHandler):
550 _endpoint = 'event_mgmt.abstractsManagment'
553 class UHAbstractSubmission(URLHandler):
554 _endpoint = 'event.abstractSubmission'
557 class UHAbstractSubmissionConfirmation(URLHandler):
558 _endpoint = 'event.abstractSubmission-confirmation'
561 class UHAbstractDisplay(URLHandler):
562 _endpoint = 'event.abstractDisplay'
565 class UHAbstractDisplayPDF(URLHandler):
566 _endpoint = 'event.abstractDisplay-pdf'
569 class UHAbstractConfManagerDisplayPDF(URLHandler):
570 _endpoint = 'event_mgmt.abstractManagment-abstractToPDF'
573 class UHAbstractConfSelectionAction(URLHandler):
574 _endpoint = 'event_mgmt.abstractsManagment-abstractsActions'
577 class UHAbstractsConfManagerDisplayParticipantList(URLHandler):
578 _endpoint = 'event_mgmt.abstractsManagment-participantList'
581 class UHUserAbstracts(URLHandler):
582 _endpoint = 'event.userAbstracts'
585 class UHUserAbstractsPDF(URLHandler):
586 _endpoint = 'event.userAbstracts-pdf'
589 class UHAbstractModify(URLHandler):
590 _endpoint = 'event.abstractModify'
593 class UHCFAAbstractManagment(URLHandler):
594 _endpoint = 'event_mgmt.abstractManagment'
597 class UHAbstractManagment(URLHandler):
598 _endpoint = 'event_mgmt.abstractManagment'
601 class UHAbstractManagmentAccept(URLHandler):
602 _endpoint = 'event_mgmt.abstractManagment-accept'
605 class UHAbstractManagmentAcceptMultiple(URLHandler):
606 _endpoint = 'event_mgmt.abstractManagment-acceptMultiple'
609 class UHAbstractManagmentRejectMultiple(URLHandler):
610 _endpoint = 'event_mgmt.abstractManagment-rejectMultiple'
613 class UHAbstractManagmentReject(URLHandler):
614 _endpoint = 'event_mgmt.abstractManagment-reject'
617 class UHAbstractManagmentChangeTrack(URLHandler):
618 _endpoint = 'event_mgmt.abstractManagment-changeTrack'
621 class UHAbstractTrackProposalManagment(URLHandler):
622 _endpoint = 'event_mgmt.abstractManagment-trackProposal'
625 class UHAbstractTrackOrderByRating(URLHandler):
626 _endpoint = 'event_mgmt.abstractManagment-orderByRating'
629 class UHAbstractDirectAccess(URLHandler):
630 _endpoint = 'event_mgmt.abstractManagment-directAccess'
633 class UHAbstractToXML(URLHandler):
634 _endpoint = 'event_mgmt.abstractManagment-xml'
637 class UHAbstractSubmissionDisplay(URLHandler):
638 _endpoint = 'event.abstractSubmission'
641 class UHConfAddTrack(URLHandler):
642 _endpoint = 'event_mgmt.confModifProgram-addTrack'
645 class UHConfDelTracks(URLHandler):
646 _endpoint = 'event_mgmt.confModifProgram-deleteTracks'
649 class UHConfPerformAddTrack(URLHandler):
650 _endpoint = 'event_mgmt.confModifProgram-performAddTrack'
653 class UHTrackModification(URLHandler):
654 _endpoint = 'event_mgmt.trackModification'
657 class UHTrackModifAbstracts(URLHandler):
658 _endpoint = 'event_mgmt.trackModifAbstracts'
661 class UHTrackAbstractBase(URLHandler):
662 @classmethod
663 def getURL(cls, track, abstract):
664 url = cls._getURL()
665 url.setParams(track.getLocator())
666 url.addParam('abstractId', abstract.getId())
667 return url
670 class UHTrackAbstractModif(UHTrackAbstractBase):
671 _endpoint = 'event_mgmt.trackAbstractModif'
674 class UHAbstractTrackManagerDisplayPDF(UHTrackAbstractBase):
675 _endpoint = 'event_mgmt.trackAbstractModif-abstractToPDF'
678 class UHAbstractsTrackManagerAction(URLHandler):
679 _endpoint = 'event_mgmt.trackAbstractModif-abstractAction'
682 class UHTrackAbstractPropToAcc(UHTrackAbstractBase):
683 _endpoint = 'event_mgmt.trackAbstractModif-proposeToBeAcc'
686 class UHTrackAbstractPropToRej(UHTrackAbstractBase):
687 _endpoint = 'event_mgmt.trackAbstractModif-proposeToBeRej'
690 class UHTrackAbstractAccept(UHTrackAbstractBase):
691 _endpoint = 'event_mgmt.trackAbstractModif-accept'
694 class UHTrackAbstractReject(UHTrackAbstractBase):
695 _endpoint = 'event_mgmt.trackAbstractModif-reject'
698 class UHTrackAbstractDirectAccess(URLHandler):
699 _endpoint = 'event_mgmt.trackAbstractModif-directAccess'
702 class UHTrackAbstractPropForOtherTrack(UHTrackAbstractBase):
703 _endpoint = 'event_mgmt.trackAbstractModif-proposeForOtherTracks'
706 class UHTrackModifCoordination(URLHandler):
707 _endpoint = 'event_mgmt.trackModifCoordination'
710 class UHTrackDataModif(URLHandler):
711 _endpoint = 'event_mgmt.trackModification-modify'
714 class UHTrackPerformDataModification(URLHandler):
715 _endpoint = 'event_mgmt.trackModification-performModify'
718 class UHTrackAbstractModIntComments(UHTrackAbstractBase):
719 _endpoint = 'event_mgmt.trackAbstractModif-comments'
722 class UHConfModifSchedule(URLHandler):
723 _endpoint = 'event_mgmt.confModifSchedule'
726 class UHContribConfSelectionAction(URLHandler):
727 _endpoint = 'event_mgmt.confModifContribList-contribsActions'
730 class UHContribsConfManagerDisplayMenuPDF(URLHandler):
731 _endpoint = 'event_mgmt.confModifContribList-contribsToPDFMenu'
734 class UHContribsConfManagerDisplayParticipantList(URLHandler):
735 _endpoint = 'event_mgmt.confModifContribList-participantList'
738 class UHSessionClose(URLHandler):
739 _endpoint = 'event_mgmt.sessionModification-close'
742 class UHSessionOpen(URLHandler):
743 _endpoint = 'event_mgmt.sessionModification-open'
746 class UHSessionCreation(URLHandler):
747 _endpoint = 'event_mgmt.confModifSchedule'
750 class UHContribCreation(URLHandler):
751 _endpoint = 'event_mgmt.confModifSchedule'
754 class UHContribToXMLConfManager(URLHandler):
755 _endpoint = 'event_mgmt.contributionModification-xml'
758 class UHContribToXML(URLHandler):
759 _endpoint = 'event.contributionDisplay-xml'
761 @classmethod
762 def getStaticURL(cls, target, **params):
763 return ""
766 class UHContribToiCal(URLHandler):
767 _endpoint = 'event.contributionDisplay-ical'
769 @classmethod
770 def getStaticURL(cls, target, **params):
771 return ""
774 class UHContribToPDFConfManager(URLHandler):
775 _endpoint = 'event_mgmt.contributionModification-pdf'
778 class UHContribToPDF(URLHandler):
779 _endpoint = 'event.contributionDisplay-pdf'
781 @classmethod
782 def getStaticURL(cls, target, **params):
783 if target is not None:
784 return "files/generatedPdf/%s-Contribution.pdf" % target.getId()
787 class UHContribModifAC(URLHandler):
788 _endpoint = 'event_mgmt.contributionAC'
791 class UHContributionSetVisibility(URLHandler):
792 _endpoint = 'event_mgmt.contributionAC-setVisibility'
795 class UHContribModifMaterialMgmt(URLHandler):
796 _endpoint = 'event_mgmt.contributionModification-materials'
799 class UHContribModifAddMaterials(URLHandler):
800 _endpoint = 'event_mgmt.contributionModification-materialsAdd'
803 class UHContribModifSubCont(URLHandler):
804 _endpoint = 'event_mgmt.contributionModifSubCont'
807 class UHContribAddSubCont(URLHandler):
808 _endpoint = 'event_mgmt.contributionModifSubCont-add'
811 class UHContribCreateSubCont(URLHandler):
812 _endpoint = 'event_mgmt.contributionModifSubCont-create'
815 class UHSubContribActions(URLHandler):
816 _endpoint = 'event_mgmt.contributionModifSubCont-actionSubContribs'
819 class UHContribModifTools(URLHandler):
820 _endpoint = 'event_mgmt.contributionTools'
823 class UHContributionDataModif(URLHandler):
824 _endpoint = 'event_mgmt.contributionModification-modifData'
827 class UHContributionDataModification(URLHandler):
828 _endpoint = 'event_mgmt.contributionModification-data'
831 class UHConfModifAC(URLHandler):
832 _endpoint = 'event_mgmt.confModifAC'
835 class UHConfSetVisibility(URLHandler):
836 _endpoint = 'event_mgmt.confModifAC-setVisibility'
839 class UHConfGrantSubmissionToAllSpeakers(URLHandler):
840 _endpoint = 'event_mgmt.confModifAC-grantSubmissionToAllSpeakers'
843 class UHConfRemoveAllSubmissionRights(URLHandler):
844 _endpoint = 'event_mgmt.confModifAC-removeAllSubmissionRights'
847 class UHConfGrantModificationToAllConveners(URLHandler):
848 _endpoint = 'event_mgmt.confModifAC-grantModificationToAllConveners'
851 class UHConfModifCoordinatorRights(URLHandler):
852 _endpoint = 'event_mgmt.confModifAC-modifySessionCoordRights'
855 class UHConfModifTools(URLHandler):
856 _endpoint = 'event_mgmt.confModifTools'
859 class UHConfModifParticipants(URLHandler):
860 _endpoint = 'event_mgmt.confModifParticipants'
863 class UHConfModifLog(URLHandler):
864 _endpoint = 'event_mgmt.confModifLog'
867 class UHInternalPageDisplay(URLHandler):
868 _endpoint = 'event.internalPage'
870 @classmethod
871 def getStaticURL(cls, target, **params):
872 params = target.getLocator()
873 url = os.path.join("internalPage-%s.html" % params["pageId"])
874 return url
877 class UHConfModifDisplay(URLHandler):
878 _endpoint = 'event_mgmt.confModifDisplay'
881 class UHConfModifDisplayCustomization(URLHandler):
882 _endpoint = 'event_mgmt.confModifDisplay-custom'
885 class UHConfModifDisplayMenu(URLHandler):
886 _endpoint = 'event_mgmt.confModifDisplay-menu'
889 class UHConfModifDisplayResources(URLHandler):
890 _endpoint = 'event_mgmt.confModifDisplay-resources'
893 class UHConfModifDisplayConfHeader(URLHandler):
894 _endpoint = 'event_mgmt.confModifDisplay-confHeader'
897 class UHConfModifDisplayAddLink(URLHandler):
898 _endpoint = 'event_mgmt.confModifDisplay-addLink'
901 class UHConfModifDisplayAddPage(URLHandler):
902 _endpoint = 'event_mgmt.confModifDisplay-addPage'
905 class UHConfModifDisplayModifyData(URLHandler):
906 _endpoint = 'event_mgmt.confModifDisplay-modifyData'
909 class UHConfModifDisplayModifySystemData(URLHandler):
910 _endpoint = 'event_mgmt.confModifDisplay-modifySystemData'
913 class UHConfModifDisplayAddSpacer(URLHandler):
914 _endpoint = 'event_mgmt.confModifDisplay-addSpacer'
917 class UHConfModifDisplayRemoveLink(URLHandler):
918 _endpoint = 'event_mgmt.confModifDisplay-removeLink'
921 class UHConfModifDisplayToggleLinkStatus(URLHandler):
922 _endpoint = 'event_mgmt.confModifDisplay-toggleLinkStatus'
925 class UHConfModifDisplayToggleHomePage(URLHandler):
926 _endpoint = 'event_mgmt.confModifDisplay-toggleHomePage'
929 class UHConfModifDisplayUpLink(URLHandler):
930 _endpoint = 'event_mgmt.confModifDisplay-upLink'
933 class UHConfModifDisplayDownLink(URLHandler):
934 _endpoint = 'event_mgmt.confModifDisplay-downLink'
937 class UHConfModifDisplayToggleTimetableView(URLHandler):
938 _endpoint = 'event_mgmt.confModifDisplay-toggleTimetableView'
941 class UHConfModifDisplayToggleTTDefaultLayout(URLHandler):
942 _endpoint = 'event_mgmt.confModifDisplay-toggleTTDefaultLayout'
945 class UHConfModifFormatTitleBgColor(URLHandler):
946 _endpoint = 'event_mgmt.confModifDisplay-formatTitleBgColor'
949 class UHConfModifFormatTitleTextColor(URLHandler):
950 _endpoint = 'event_mgmt.confModifDisplay-formatTitleTextColor'
953 class UHConfDeletion(URLHandler):
954 _endpoint = 'event_mgmt.confModifTools-delete'
957 class UHConfClone(URLHandler):
958 _endpoint = 'event_mgmt.confModifTools-clone'
961 class UHConfPerformCloning(URLHandler):
962 _endpoint = 'event_mgmt.confModifTools-performCloning'
965 class UHConfAllSessionsConveners(URLHandler):
966 _endpoint = 'event_mgmt.confModifTools-allSessionsConveners'
969 class UHConfAllSessionsConvenersAction(URLHandler):
970 _endpoint = 'event_mgmt.confModifTools-allSessionsConvenersAction'
973 class UHConfAllSpeakers(URLHandler):
974 _endpoint = 'event_mgmt.confModifListings-allSpeakers'
977 class UHConfAllSpeakersAction(URLHandler):
978 _endpoint = 'event_mgmt.confModifListings-allSpeakersAction'
981 class UHSaveLogo(URLHandler):
982 _endpoint = 'event_mgmt.confModifDisplay-saveLogo'
985 class UHRemoveLogo(URLHandler):
986 _endpoint = 'event_mgmt.confModifDisplay-removeLogo'
989 class UHSaveCSS(URLHandler):
990 _endpoint = 'event_mgmt.confModifDisplay-saveCSS'
993 class UHUseCSS(URLHandler):
994 _endpoint = 'event_mgmt.confModifDisplay-useCSS'
997 class UHRemoveCSS(URLHandler):
998 _endpoint = 'event_mgmt.confModifDisplay-removeCSS'
1001 class UHSavePic(URLHandler):
1002 _endpoint = 'event_mgmt.confModifDisplay-savePic'
1005 class UHConfModifParticipantsSetup(URLHandler):
1006 _endpoint = 'event_mgmt.confModifParticipants-setup'
1009 class UHConfModifParticipantsPending(URLHandler):
1010 _endpoint = 'event_mgmt.confModifParticipants-pendingParticipants'
1013 class UHConfModifParticipantsDeclined(URLHandler):
1014 _endpoint = 'event_mgmt.confModifParticipants-declinedParticipants'
1017 class UHConfModifParticipantsAction(URLHandler):
1018 _endpoint = 'event_mgmt.confModifParticipants-action'
1021 class UHConfModifParticipantsStatistics(URLHandler):
1022 _endpoint = 'event_mgmt.confModifParticipants-statistics'
1025 class UHConfParticipantsInvitation(URLHandler):
1026 _endpoint = 'event.confModifParticipants-invitation'
1029 class UHConfParticipantsRefusal(URLHandler):
1030 _endpoint = 'event.confModifParticipants-refusal'
1033 class UHConfModifToggleSearch(URLHandler):
1034 _endpoint = 'event_mgmt.confModifDisplay-toggleSearch'
1037 class UHConfModifToggleNavigationBar(URLHandler):
1038 _endpoint = 'event_mgmt.confModifDisplay-toggleNavigationBar'
1041 class UHTickerTapeAction(URLHandler):
1042 _endpoint = 'event_mgmt.confModifDisplay-tickerTapeAction'
1045 class UHConfUser(URLHandler):
1046 @classmethod
1047 def getURL(cls, conference, av=None):
1048 url = cls._getURL()
1049 if conference is not None:
1050 loc = conference.getLocator().copy()
1051 if av:
1052 loc.update(av.getLocator())
1053 url.setParams(loc)
1054 return url
1057 class UHConfEnterAccessKey(UHConfUser):
1058 _endpoint = 'event.conferenceDisplay-accessKey'
1061 class UHConfManagementAccess(UHConfUser):
1062 _endpoint = 'event_mgmt.conferenceModification-managementAccess'
1065 class UHConfEnterModifKey(UHConfUser):
1066 _endpoint = 'event_mgmt.conferenceModification-modifKey'
1069 class UHConfCloseModifKey(UHConfUser):
1070 _endpoint = 'event_mgmt.conferenceModification-closeModifKey'
1073 class UHUserDetails(UserURLHandler):
1074 # XXX: This UH is deprecated. It's just kept around to have a
1075 # quick reference to find code that needs to be rewritten/removed.
1076 _endpoint = None
1079 class UHDomains(URLHandler):
1080 _endpoint = 'admin.domainList'
1083 class UHNewDomain(URLHandler):
1084 _endpoint = 'admin.domainCreation'
1087 class UHDomainPerformCreation(URLHandler):
1088 _endpoint = 'admin.domainCreation-create'
1091 class UHDomainDetails(URLHandler):
1092 _endpoint = 'admin.domainDetails'
1095 class UHDomainModification(URLHandler):
1096 _endpoint = 'admin.domainDataModification'
1099 class UHDomainPerformModification(URLHandler):
1100 _endpoint = 'admin.domainDataModification-modify'
1103 class UHRoomMappers(URLHandler):
1104 _endpoint = 'rooms_admin.roomMapper'
1107 class UHNewRoomMapper(URLHandler):
1108 _endpoint = 'rooms_admin.roomMapper-creation'
1111 class UHRoomMapperPerformCreation(URLHandler):
1112 _endpoint = 'rooms_admin.roomMapper-performCreation'
1115 class UHRoomMapperDetails(URLHandler):
1116 _endpoint = 'rooms_admin.roomMapper-details'
1119 class UHRoomMapperModification(URLHandler):
1120 _endpoint = 'rooms_admin.roomMapper-modify'
1123 class UHRoomMapperPerformModification(URLHandler):
1124 _endpoint = 'rooms_admin.roomMapper-performModify'
1127 class UHAdminArea(URLHandler):
1128 _endpoint = 'admin.adminList'
1131 class UHAdminSwitchNewsActive(URLHandler):
1132 _endpoint = 'admin.adminList-switchNewsActive'
1135 class UHAdminsStyles(URLHandler):
1136 _endpoint = 'admin.adminLayout-styles'
1139 class UHAdminsConferenceStyles(URLHandler):
1140 _endpoint = 'admin.adminConferenceStyles'
1143 class UHAdminsAddStyle(URLHandler):
1144 _endpoint = 'admin.adminLayout-addStyle'
1147 class UHAdminsDeleteStyle(URLHandler):
1148 _endpoint = 'admin.adminLayout-deleteStyle'
1151 class UHAdminsSystem(URLHandler):
1152 _endpoint = 'admin.adminSystem'
1155 class UHAdminsSystemModif(URLHandler):
1156 _endpoint = 'admin.adminSystem-modify'
1159 class UHAdminsProtection(URLHandler):
1160 _endpoint = 'admin.adminProtection'
1163 class UHMaterialModification(URLHandler):
1164 @classmethod
1165 def getURL(cls, material, returnURL=""):
1166 from MaKaC import conference
1168 owner = material.getOwner()
1169 # return handler depending on parent type
1170 if isinstance(owner, conference.Category):
1171 handler = UHCategModifFiles
1172 elif isinstance(owner, conference.Conference):
1173 handler = UHConfModifShowMaterials
1174 elif isinstance(owner, conference.Session):
1175 handler = UHSessionModifMaterials
1176 elif isinstance(owner, conference.Contribution):
1177 handler = UHContribModifMaterials
1178 elif isinstance(owner, conference.SubContribution):
1179 handler = UHSubContribModifMaterials
1180 else:
1181 raise Exception('Unknown material owner type: %s' % owner)
1183 return handler.getURL(owner, returnURL=returnURL)
1186 class UHMaterialEnterAccessKey(URLHandler):
1187 _endpoint = 'files.materialDisplay-accessKey'
1190 class UHFileEnterAccessKey(URLHandler):
1191 _endpoint = 'files.getFile-accessKey'
1194 class UHCategoryModification(URLHandler):
1195 _endpoint = 'category_mgmt.categoryModification'
1197 @classmethod
1198 def getActionURL(cls):
1199 return ''
1202 class UHCategoryAddMaterial(URLHandler):
1203 _endpoint = 'category_mgmt.categoryFiles-addMaterial'
1206 class UHCategoryActionSubCategs(URLHandler):
1207 _endpoint = 'category_mgmt.categoryModification-actionSubCategs'
1210 class UHCategoryActionConferences(URLHandler):
1211 _endpoint = 'category_mgmt.categoryModification-actionConferences'
1214 class UHCategModifAC(URLHandler):
1215 _endpoint = 'category_mgmt.categoryAC'
1218 class UHCategorySetConfCreationControl(URLHandler):
1219 _endpoint = 'category_mgmt.categoryConfCreationControl-setCreateConferenceControl'
1222 class UHCategorySetNotifyCreation(URLHandler):
1223 _endpoint = 'category_mgmt.categoryConfCreationControl-setNotifyCreation'
1226 class UHCategModifTools(URLHandler):
1227 _endpoint = 'category_mgmt.categoryTools'
1230 class UHCategoryDeletion(URLHandler):
1231 _endpoint = 'category_mgmt.categoryTools-delete'
1234 class UHCategModifTasks(URLHandler):
1235 _endpoint = 'category_mgmt.categoryTasks'
1238 class UHCategModifFiles(URLHandler):
1239 _endpoint = 'category_mgmt.categoryFiles'
1242 class UHCategModifTasksAction(URLHandler):
1243 _endpoint = 'category_mgmt.categoryTasks-taskAction'
1246 class UHCategoryDataModif(URLHandler):
1247 _endpoint = 'category_mgmt.categoryDataModification'
1250 class UHCategoryPerformModification(URLHandler):
1251 _endpoint = 'category_mgmt.categoryDataModification-modify'
1254 class UHCategoryTasksOption(URLHandler):
1255 _endpoint = 'category_mgmt.categoryDataModification-tasksOption'
1258 class UHCategorySetVisibility(URLHandler):
1259 _endpoint = 'category_mgmt.categoryAC-setVisibility'
1262 class UHCategoryCreation(URLHandler):
1263 _endpoint = 'category_mgmt.categoryCreation'
1266 class UHCategoryPerformCreation(URLHandler):
1267 _endpoint = 'category_mgmt.categoryCreation-create'
1270 class UHCategoryDisplay(URLHandler):
1271 _endpoint = 'category.categoryDisplay'
1273 @classmethod
1274 def getURL(cls, target=None, **params):
1275 url = cls._getURL(**params)
1276 if target:
1277 if target.isRoot():
1278 return UHWelcome.getURL()
1279 url.setParams(target.getLocator())
1280 return url
1283 class UHCategoryMap(URLHandler):
1284 _endpoint = 'category.categoryMap'
1287 class UHCategoryOverview(URLHandler):
1288 _endpoint = 'category.categOverview'
1290 @classmethod
1291 def getURLFromOverview(cls, ow):
1292 url = cls.getURL()
1293 url.setParams(ow.getLocator())
1294 return url
1296 @classmethod
1297 def getWeekOverviewUrl(cls, categ):
1298 url = cls.getURL(categ)
1299 p = {"day": nowutc().day,
1300 "month": nowutc().month,
1301 "year": nowutc().year,
1302 "period": "week",
1303 "detail": "conference"}
1304 url.addParams(p)
1305 return url
1307 @classmethod
1308 def getMonthOverviewUrl(cls, categ):
1309 url = cls.getURL(categ)
1310 p = {"day": nowutc().day,
1311 "month": nowutc().month,
1312 "year": nowutc().year,
1313 "period": "month",
1314 "detail": "conference"}
1315 url.addParams(p)
1316 return url
1319 class UHGeneralInfoModification(URLHandler):
1320 _endpoint = 'admin.generalInfoModification'
1323 class UHGeneralInfoPerformModification(URLHandler):
1324 _endpoint = 'admin.generalInfoModification-update'
1327 class UHContributionDelete(URLHandler):
1328 _endpoint = 'event_mgmt.contributionTools-delete'
1331 class UHSubContributionDataModification(URLHandler):
1332 _endpoint = 'event_mgmt.subContributionModification-data'
1335 class UHSubContributionDataModif(URLHandler):
1336 _endpoint = 'event_mgmt.subContributionModification-modifData'
1339 class UHSubContributionDelete(URLHandler):
1340 _endpoint = 'event_mgmt.subContributionTools-delete'
1343 class UHSubContribModifAddMaterials(URLHandler):
1344 _endpoint = 'event_mgmt.subContributionModification-materialsAdd'
1347 class UHSubContribModifTools(URLHandler):
1348 _endpoint = 'event_mgmt.subContributionTools'
1351 class UHSessionModification(URLHandler):
1352 _endpoint = 'event_mgmt.sessionModification'
1355 class UHSessionModifMaterials(URLHandler):
1356 _endpoint = 'event_mgmt.sessionModification-materials'
1359 class UHSessionDataModification(URLHandler):
1360 _endpoint = 'event_mgmt.sessionModification-modify'
1363 class UHSessionFitSlot(URLHandler):
1364 _endpoint = 'event_mgmt.sessionModifSchedule-fitSlot'
1367 class UHSessionModifAddMaterials(URLHandler):
1368 _endpoint = 'event_mgmt.sessionModification-materialsAdd'
1371 class UHSessionModifSchedule(URLHandler):
1372 _endpoint = 'event_mgmt.sessionModifSchedule'
1375 class UHSessionModSlotCalc(URLHandler):
1376 _endpoint = 'event_mgmt.sessionModifSchedule-slotCalc'
1379 class UHSessionModifAC(URLHandler):
1380 _endpoint = 'event_mgmt.sessionModifAC'
1383 class UHSessionSetVisibility(URLHandler):
1384 _endpoint = 'event_mgmt.sessionModifAC-setVisibility'
1387 class UHSessionModifTools(URLHandler):
1388 _endpoint = 'event_mgmt.sessionModifTools'
1391 class UHSessionModifComm(URLHandler):
1392 _endpoint = 'event_mgmt.sessionModifComm'
1395 class UHSessionModifCommEdit(URLHandler):
1396 _endpoint = 'event_mgmt.sessionModifComm-edit'
1399 class UHSessionDeletion(URLHandler):
1400 _endpoint = 'event_mgmt.sessionModifTools-delete'
1403 class UHContributionModification(URLHandler):
1404 _endpoint = 'event_mgmt.contributionModification'
1407 class UHContribModifMaterials(URLHandler):
1408 _endpoint = 'event_mgmt.contributionModification-materials'
1411 class UHSubContribModification(URLHandler):
1412 _endpoint = 'event_mgmt.subContributionModification'
1415 class UHSubContribModifMaterials(URLHandler):
1416 _endpoint = 'event_mgmt.subContributionModification-materials'
1419 class UHMaterialDisplay(URLHandler):
1420 _endpoint = 'files.materialDisplay'
1422 @classmethod
1423 def getStaticURL(cls, target, **params):
1424 if target is not None:
1425 params = target.getLocator()
1426 resources = target.getOwner().getMaterialById(params["materialId"]).getResourceList()
1427 if len(resources) == 1:
1428 return UHFileAccess.getStaticURL(resources[0])
1429 return "materialDisplay-%s.html" % params["materialId"]
1430 return cls._getURL()
1433 class UHConferenceProgram(URLHandler):
1434 _endpoint = 'event.conferenceProgram'
1437 class UHConferenceProgramPDF(URLHandler):
1438 _endpoint = 'event.conferenceProgram-pdf'
1440 @classmethod
1441 def getStaticURL(cls, target, **params):
1442 return "files/generatedPdf/Programme.pdf"
1445 class UHConferenceTimeTable(URLHandler):
1446 _endpoint = 'event.conferenceTimeTable'
1449 class UHConfTimeTablePDF(URLHandler):
1450 _endpoint = 'event.conferenceTimeTable-pdf'
1452 @classmethod
1453 def getStaticURL(cls, target, **params):
1454 if target is not None:
1455 params = target.getLocator()
1456 from MaKaC import conference
1458 if isinstance(target, conference.Conference):
1459 return "files/generatedPdf/Conference.pdf"
1460 if isinstance(target, conference.Contribution):
1461 return "files/generatedPdf/%s-Contribution.pdf" % (params["contribId"])
1462 elif isinstance(target, conference.Session) or isinstance(target, conference.SessionSlot):
1463 return "files/generatedPdf/%s-Session.pdf" % (params["sessionId"])
1464 return cls._getURL()
1467 class UHConferenceCFA(URLHandler):
1468 _endpoint = 'event.conferenceCFA'
1471 class UHSessionDisplay(URLHandler):
1472 _endpoint = 'event.sessionDisplay'
1474 @classmethod
1475 def getStaticURL(cls, target, **params):
1476 if target is not None:
1477 params.update(target.getLocator())
1478 return "%s-session.html" % params["sessionId"]
1481 class UHSessionToiCal(URLHandler):
1482 _endpoint = 'event.sessionDisplay-ical'
1485 class UHContributionDisplay(URLHandler):
1486 _endpoint = 'event.contributionDisplay'
1488 @classmethod
1489 def getStaticURL(cls, target, **params):
1490 if target is not None:
1491 params = target.getLocator()
1492 return "%s-contrib.html" % (params["contribId"])
1493 return cls.getURL(target, _ignore_static=True, **params)
1496 class UHSubContributionDisplay(URLHandler):
1497 _endpoint = 'event.subContributionDisplay'
1499 @classmethod
1500 def getStaticURL(cls, target, **params):
1501 if target is not None:
1502 params = target.getLocator()
1503 return "%s-subcontrib.html" % (params["subContId"])
1504 return cls.getURL(target, _ignore_static=True, **params)
1507 class UHSubContributionModification(URLHandler):
1508 _endpoint = 'event_mgmt.subContributionModification'
1511 class UHFileAccess(URLHandler):
1512 _endpoint = 'files.getFile-access'
1514 @staticmethod
1515 def generateFileStaticLink(target):
1516 from MaKaC import conference
1518 params = target.getLocator()
1519 owner = target.getOwner().getOwner()
1521 if isinstance(owner, conference.Conference):
1522 path = "events/conference"
1523 elif isinstance(owner, conference.Session):
1524 path = "agenda/%s-session" % owner.getId()
1525 elif isinstance(owner, conference.Contribution):
1526 path = "agenda/%s-contribution" % owner.getId()
1527 elif isinstance(owner, conference.SubContribution):
1528 path = "agenda/%s-subcontribution" % owner.getId()
1529 else:
1530 return None
1531 url = os.path.join("files", path, params["materialId"], params["resId"] + "-" + target.getName())
1532 return url
1534 @classmethod
1535 def getStaticURL(cls, target, **params):
1536 return cls.generateFileStaticLink(target) or cls.getURL(target, _ignore_static=True, **params)
1539 class UHVideoWmvAccess(URLHandler):
1540 _endpoint = 'files.getFile-wmv'
1543 class UHVideoFlashAccess(URLHandler):
1544 _endpoint = 'files.getFile-flash'
1547 class UHErrorReporting(URLHandler):
1548 _endpoint = 'misc.errors'
1551 class UHAbstractWithdraw(URLHandler):
1552 _endpoint = 'event.abstractWithdraw'
1555 class UHAbstractRecovery(URLHandler):
1556 _endpoint = 'event.abstractWithdraw-recover'
1559 class UHConfModifContribList(URLHandler):
1560 _endpoint = 'event_mgmt.confModifContribList'
1563 class UHContribModifMaterialBrowse(URLHandler):
1564 _endpoint = 'event_mgmt.contributionModification-browseMaterial'
1567 class UHContribModSetTrack(URLHandler):
1568 _endpoint = 'event_mgmt.contributionModification-setTrack'
1571 class UHContribModSetSession(URLHandler):
1572 _endpoint = 'event_mgmt.contributionModification-setSession'
1575 class UHTrackModMoveUp(URLHandler):
1576 _endpoint = 'event_mgmt.confModifProgram-moveTrackUp'
1579 class UHTrackModMoveDown(URLHandler):
1580 _endpoint = 'event_mgmt.confModifProgram-moveTrackDown'
1583 class UHAbstractModEditData(URLHandler):
1584 _endpoint = 'event_mgmt.abstractManagment-editData'
1587 class UHAbstractModIntComments(URLHandler):
1588 _endpoint = 'event_mgmt.abstractManagment-comments'
1591 class UHAbstractModNewIntComment(URLHandler):
1592 _endpoint = 'event_mgmt.abstractManagment-newComment'
1595 class UHAbstractModIntCommentEdit(URLHandler):
1596 _endpoint = 'event_mgmt.abstractManagment-editComment'
1599 class UHAbstractModIntCommentRem(URLHandler):
1600 _endpoint = 'event_mgmt.abstractManagment-remComment'
1603 class UHTrackAbstractModIntCommentNew(UHTrackAbstractBase):
1604 _endpoint = 'event_mgmt.trackAbstractModif-commentNew'
1607 class UHTrackAbstractModCommentBase(URLHandler):
1608 @classmethod
1609 def getURL(cls, track, comment):
1610 url = cls._getURL()
1611 url.setParams(comment.getLocator())
1612 url.addParam("trackId", track.getId())
1613 return url
1616 class UHTrackAbstractModIntCommentEdit(UHTrackAbstractModCommentBase):
1617 _endpoint = 'event_mgmt.trackAbstractModif-commentEdit'
1620 class UHTrackAbstractModIntCommentRem(UHTrackAbstractModCommentBase):
1621 _endpoint = 'event_mgmt.trackAbstractModif-commentRem'
1624 class UHAbstractReviewingNotifTpl(URLHandler):
1625 _endpoint = 'event_mgmt.abstractReviewing-notifTpl'
1628 class UHAbstractModNotifTplNew(URLHandler):
1629 _endpoint = 'event_mgmt.abstractReviewing-notifTplNew'
1632 class UHAbstractModNotifTplRem(URLHandler):
1633 _endpoint = 'event_mgmt.abstractReviewing-notifTplRem'
1636 class UHAbstractModNotifTplEdit(URLHandler):
1637 _endpoint = 'event_mgmt.abstractReviewing-notifTplEdit'
1640 class UHAbstractModNotifTplDisplay(URLHandler):
1641 _endpoint = 'event_mgmt.abstractReviewing-notifTplDisplay'
1644 class UHAbstractModNotifTplPreview(URLHandler):
1645 _endpoint = 'event_mgmt.abstractReviewing-notifTplPreview'
1648 class UHTrackAbstractModMarkAsDup(UHTrackAbstractBase):
1649 _endpoint = 'event_mgmt.trackAbstractModif-markAsDup'
1652 class UHTrackAbstractModUnMarkAsDup(UHTrackAbstractBase):
1653 _endpoint = 'event_mgmt.trackAbstractModif-unMarkAsDup'
1656 class UHAbstractModMarkAsDup(URLHandler):
1657 _endpoint = 'event_mgmt.abstractManagment-markAsDup'
1660 class UHAbstractModUnMarkAsDup(URLHandler):
1661 _endpoint = 'event_mgmt.abstractManagment-unMarkAsDup'
1664 class UHAbstractModMergeInto(URLHandler):
1665 _endpoint = 'event_mgmt.abstractManagment-mergeInto'
1668 class UHAbstractModUnMerge(URLHandler):
1669 _endpoint = 'event_mgmt.abstractManagment-unmerge'
1672 class UHConfModNewAbstract(URLHandler):
1673 _endpoint = 'event_mgmt.abstractsManagment-newAbstract'
1676 class UHConfModNotifTplConditionNew(URLHandler):
1677 _endpoint = 'event_mgmt.abstractReviewing-notifTplCondNew'
1680 class UHConfModNotifTplConditionRem(URLHandler):
1681 _endpoint = 'event_mgmt.abstractReviewing-notifTplCondRem'
1684 class UHConfModAbstractsMerge(URLHandler):
1685 _endpoint = 'event_mgmt.abstractsManagment-mergeAbstracts'
1688 class UHAbstractModNotifLog(URLHandler):
1689 _endpoint = 'event_mgmt.abstractManagment-notifLog'
1692 class UHAbstractModTools(URLHandler):
1693 _endpoint = 'event_mgmt.abstractTools'
1696 class UHAbstractDelete(URLHandler):
1697 _endpoint = 'event_mgmt.abstractTools-delete'
1700 class UHSessionModContribList(URLHandler):
1701 _endpoint = 'event_mgmt.sessionModification-contribList'
1704 class UHSessionModContribListEditContrib(URLHandler):
1705 _endpoint = 'event_mgmt.sessionModification-editContrib'
1708 class UHConfModifReschedule(URLHandler):
1709 _endpoint = 'event_mgmt.confModifSchedule-reschedule'
1712 class UHContributionList(URLHandler):
1713 _endpoint = 'event.contributionListDisplay'
1716 class UHContributionListToPDF(URLHandler):
1717 _endpoint = 'event.contributionListDisplay-contributionsToPDF'
1719 @classmethod
1720 def getStaticURL(cls, target=None, **params):
1721 return "files/generatedPdf/Contributions.pdf"
1724 class UHConfModAbstractPropToAcc(URLHandler):
1725 _endpoint = 'event_mgmt.abstractManagment-propToAcc'
1728 class UHAbstractManagmentBackToSubmitted(URLHandler):
1729 _endpoint = 'event_mgmt.abstractManagment-backToSubmitted'
1732 class UHConfModAbstractPropToRej(URLHandler):
1733 _endpoint = 'event_mgmt.abstractManagment-propToRej'
1736 class UHConfModAbstractWithdraw(URLHandler):
1737 _endpoint = 'event_mgmt.abstractManagment-withdraw'
1740 class UHSessionModAddContribs(URLHandler):
1741 _endpoint = 'event_mgmt.sessionModification-addContribs'
1744 class UHSessionModContributionAction(URLHandler):
1745 _endpoint = 'event_mgmt.sessionModification-contribAction'
1748 class UHSessionModParticipantList(URLHandler):
1749 _endpoint = 'event_mgmt.sessionModification-participantList'
1752 class UHSessionModToPDF(URLHandler):
1753 _endpoint = 'event_mgmt.sessionModification-contribsToPDF'
1756 class UHConfModCFANotifTplUp(URLHandler):
1757 _endpoint = 'event_mgmt.abstractReviewing-notifTplUp'
1760 class UHConfModCFANotifTplDown(URLHandler):
1761 _endpoint = 'event_mgmt.abstractReviewing-notifTplDown'
1764 class UHConfAuthorIndex(URLHandler):
1765 _endpoint = 'event.confAuthorIndex'
1768 class UHConfSpeakerIndex(URLHandler):
1769 _endpoint = 'event.confSpeakerIndex'
1772 class UHContribModWithdraw(URLHandler):
1773 _endpoint = 'event_mgmt.contributionModification-withdraw'
1776 class UHTrackModContribList(URLHandler):
1777 _endpoint = 'event_mgmt.trackModContribList'
1780 class UHTrackModContributionAction(URLHandler):
1781 _endpoint = 'event_mgmt.trackModContribList-contribAction'
1784 class UHTrackModParticipantList(URLHandler):
1785 _endpoint = 'event_mgmt.trackModContribList-participantList'
1788 class UHTrackModToPDF(URLHandler):
1789 _endpoint = 'event_mgmt.trackModContribList-contribsToPDF'
1792 class UHConfModContribQuickAccess(URLHandler):
1793 _endpoint = 'event_mgmt.confModifContribList-contribQuickAccess'
1796 class UHSessionModContribQuickAccess(URLHandler):
1797 _endpoint = 'event_mgmt.sessionModification-contribQuickAccess'
1800 class UHTrackModContribQuickAccess(URLHandler):
1801 _endpoint = 'event_mgmt.trackModContribList-contribQuickAccess'
1804 class UHConfMyStuff(URLHandler):
1805 _endpoint = 'event.myconference'
1808 class UHConfMyStuffMySessions(URLHandler):
1809 _endpoint = 'event.myconference-mySessions'
1812 class UHConfMyStuffMyTracks(URLHandler):
1813 _endpoint = 'event.myconference-myTracks'
1816 class UHConfMyStuffMyContributions(URLHandler):
1817 _endpoint = 'event.myconference-myContributions'
1820 class UHConfModMoveContribsToSession(URLHandler):
1821 _endpoint = 'event_mgmt.confModifContribList-moveToSession'
1824 class UHConferenceDisplayMaterialPackage(URLHandler):
1825 _endpoint = 'event.conferenceDisplay-matPkg'
1828 class UHConferenceDisplayMaterialPackagePerform(URLHandler):
1829 _endpoint = 'event.conferenceDisplay-performMatPkg'
1832 class UHConfAbstractBook(URLHandler):
1833 _endpoint = 'event.conferenceDisplay-abstractBook'
1835 @classmethod
1836 def getStaticURL(cls, target=None, **params):
1837 return "files/generatedPdf/BookOfAbstracts.pdf"
1840 class UHConfAbstractBookLatex(URLHandler):
1841 _endpoint = 'event.conferenceDisplay-abstractBookLatex'
1844 class UHConferenceToiCal(URLHandler):
1845 _endpoint = 'event.conferenceDisplay-ical'
1848 class UHConfModAbstractBook(URLHandler):
1849 _endpoint = 'event_mgmt.confModBOA'
1852 class UHConfModAbstractBookToogleShowIds(URLHandler):
1853 _endpoint = 'event_mgmt.confModBOA-toogleShowIds'
1856 class UHAbstractReviewingSetup(URLHandler):
1857 _endpoint = 'event_mgmt.abstractReviewing-reviewingSetup'
1860 class UHAbstractReviewingTeam(URLHandler):
1861 _endpoint = 'event_mgmt.abstractReviewing-reviewingTeam'
1864 class UHConfModScheduleDataEdit(URLHandler):
1865 _endpoint = 'event_mgmt.confModifSchedule-edit'
1868 class UHConfModMaterialPackage(URLHandler):
1869 _endpoint = 'event_mgmt.confModifContribList-matPkg'
1872 class UHConfModProceedings(URLHandler):
1873 _endpoint = 'event_mgmt.confModifContribList-proceedings'
1876 class UHConfModFullMaterialPackage(URLHandler):
1877 _endpoint = 'event_mgmt.confModifTools-matPkg'
1880 class UHConfModFullMaterialPackagePerform(URLHandler):
1881 _endpoint = 'event_mgmt.confModifTools-performMatPkg'
1884 class UHUpdateNews(URLHandler):
1885 _endpoint = 'admin.updateNews'
1888 class UHMaintenance(URLHandler):
1889 _endpoint = 'admin.adminMaintenance'
1892 class UHMaintenanceTmpCleanup(URLHandler):
1893 _endpoint = 'admin.adminMaintenance-tmpCleanup'
1896 class UHMaintenancePerformTmpCleanup(URLHandler):
1897 _endpoint = 'admin.adminMaintenance-performTmpCleanup'
1900 class UHMaintenancePack(URLHandler):
1901 _endpoint = 'admin.adminMaintenance-pack'
1904 class UHMaintenancePerformPack(URLHandler):
1905 _endpoint = 'admin.adminMaintenance-performPack'
1908 class UHAdminLayoutGeneral(URLHandler):
1909 _endpoint = 'admin.adminLayout'
1912 class UHAdminLayoutSaveTemplateSet(URLHandler):
1913 _endpoint = 'admin.adminLayout-saveTemplateSet'
1916 class UHAdminLayoutSaveSocial(URLHandler):
1917 _endpoint = 'admin.adminLayout-saveSocial'
1920 class UHTemplatesSetDefaultPDFOptions(URLHandler):
1921 _endpoint = 'admin.adminLayout-setDefaultPDFOptions'
1924 class UHIPBasedACL(URLHandler):
1925 _endpoint = 'admin.adminServices-ipbasedacl'
1928 class UHIPBasedACLFullAccessGrant(URLHandler):
1929 _endpoint = 'admin.adminServices-ipbasedacl_fagrant'
1932 class UHIPBasedACLFullAccessRevoke(URLHandler):
1933 _endpoint = 'admin.adminServices-ipbasedacl_farevoke'
1936 class UHAdminOAuthConsumers(URLHandler):
1937 _endpoint = 'admin.adminServices-oauthConsumers'
1940 class UHAdminOAuthAuthorized(URLHandler):
1941 _endpoint = 'admin.adminServices-oauthAuthorized'
1944 class UHBadgeTemplates(URLHandler):
1945 _endpoint = 'admin.badgeTemplates'
1948 class UHPosterTemplates(URLHandler):
1949 _endpoint = 'admin.posterTemplates'
1952 class UHAnnouncement(URLHandler):
1953 _endpoint = 'admin.adminAnnouncement'
1956 class UHAnnouncementSave(URLHandler):
1957 _endpoint = 'admin.adminAnnouncement-save'
1960 class UHConfigUpcomingEvents(URLHandler):
1961 _endpoint = 'admin.adminUpcomingEvents'
1964 # ------- Static webpages ------
1966 class UHStaticConferenceDisplay(URLHandler):
1967 _relativeURL = "./index.html"
1970 class UHStaticMaterialDisplay(URLHandler):
1971 _relativeURL = "none-page-material.html"
1973 @classmethod
1974 def _normalisePathItem(cls, name):
1975 return str(name).translate(string.maketrans(" /:()*?<>|\"", "___________"))
1977 @classmethod
1978 def getRelativeURL(cls, target=None, escape=True):
1979 from MaKaC.conference import Contribution, Conference, Link, Video, Session
1981 if target is not None:
1982 if len(target.getResourceList()) == 1:
1983 res = target.getResourceList()[0]
1984 # TODO: Remove the "isinstance", it's just for CHEP04
1985 if isinstance(res, Link):# and not isinstance(target, Video):
1986 return res.getURL()
1987 else:
1988 return UHStaticResourceDisplay.getRelativeURL(res)
1989 else:
1990 contrib = target.getOwner()
1991 relativeURL = None
1992 if isinstance(contrib, Contribution):
1993 spk = ""
1994 if len(contrib.getSpeakerList()) > 0:
1995 spk = contrib.getSpeakerList()[0].getFamilyName().lower()
1996 contribDirName = "%s-%s" % (contrib.getId(), spk)
1997 relativeURL = "./%s-material-%s.html" % (contribDirName, cls._normalisePathItem(target.getId()))
1998 elif isinstance(contrib, Conference):
1999 relativeURL = "./material-%s.html" % cls._normalisePathItem(target.getId())
2000 elif isinstance(contrib, Session):
2001 relativeURL = "./material-s%s-%s.html" % (contrib.getId(), cls._normalisePathItem(target.getId()))
2003 if escape:
2004 relativeURL = utf8rep(relativeURL)
2006 return relativeURL
2007 return cls._relativeURL
2010 class UHStaticConfAbstractBook(URLHandler):
2011 _relativeURL = "./abstractBook.pdf"
2014 class UHStaticConferenceProgram(URLHandler):
2015 _relativeURL = "./programme.html"
2018 class UHStaticConferenceTimeTable(URLHandler):
2019 _relativeURL = "./timetable.html"
2022 class UHStaticContributionList(URLHandler):
2023 _relativeURL = "./contributionList.html"
2026 class UHStaticConfAuthorIndex(URLHandler):
2027 _relativeURL = "./authorIndex.html"
2030 class UHStaticContributionDisplay(URLHandler):
2031 _relativeURL = ""
2033 @classmethod
2034 def getRelativeURL(cls, target=None, prevPath=".", escape=True):
2035 url = cls._relativeURL
2036 if target is not None:
2037 spk = ""
2038 if len(target.getSpeakerList()) > 0:
2039 spk = target.getSpeakerList()[0].getFamilyName().lower()
2040 contribDirName = "%s-%s" % (target.getId(), spk)
2041 track = target.getTrack()
2042 if track is not None:
2043 url = "./%s/%s/%s.html" % (prevPath, track.getTitle().replace(" ", "_"), contribDirName)
2044 else:
2045 url = "./%s/other_contributions/%s.html" % (prevPath, contribDirName)
2047 if escape:
2048 url = utf8rep(url)
2050 return url
2053 class UHStaticSessionDisplay(URLHandler):
2054 _relativeURL = ""
2056 @classmethod
2057 def getRelativeURL(cls, target=None):
2058 return "./sessions/s%s.html" % target.getId()
2061 class UHStaticResourceDisplay(URLHandler):
2062 _relativeURL = "none-page-resource.html"
2064 @classmethod
2065 def _normalisePathItem(cls, name):
2066 return str(name).translate(string.maketrans(" /:()*?<>|\"", "___________"))
2068 @classmethod
2069 def getRelativeURL(cls, target=None, escape=True):
2070 from MaKaC.conference import Contribution, Conference, Video, Link, Session
2072 relativeURL = cls._relativeURL
2073 if target is not None:
2074 mat = target.getOwner()
2075 contrib = mat.getOwner()
2076 # TODO: Remove the first if...cos it's just for CHEP.
2077 # Remove as well in pages.conferences.WMaterialStaticDisplay
2078 #if isinstance(mat, Video) and isinstance(target, Link):
2079 # relativeURL = "./%s.rm"%os.path.splitext(os.path.basename(target.getURL()))[0]
2080 # return relativeURL
2081 if isinstance(contrib, Contribution):
2082 relativeURL = "./%s-%s-%s-%s" % (cls._normalisePathItem(contrib.getId()), target.getOwner().getId(),
2083 target.getId(), cls._normalisePathItem(target.getFileName()))
2084 elif isinstance(contrib, Conference):
2085 relativeURL = "./resource-%s-%s-%s" % (target.getOwner().getId(), target.getId(),
2086 cls._normalisePathItem(target.getFileName()))
2087 elif isinstance(contrib, Session):
2088 relativeURL = "./resource-s%s-%s-%s" % (contrib.getId(), target.getId(),
2089 cls._normalisePathItem(target.getFileName()))
2091 if escape:
2092 relativeURL = utf8rep(relativeURL)
2094 return relativeURL
2097 class UHStaticTrackContribList(URLHandler):
2098 _relativeURL = ""
2100 @classmethod
2101 def getRelativeURL(cls, target=None, escape=True):
2102 url = cls._relativeURL
2103 if target is not None:
2104 url = "%s.html" % (target.getTitle().replace(" ", "_"))
2106 if escape:
2107 url = utf8rep(url)
2108 return url
2111 class UHMStaticMaterialDisplay(URLHandler):
2112 _relativeURL = "none-page.html"
2114 @classmethod
2115 def _normalisePathItem(cls, name):
2116 return str(name).translate(string.maketrans(" /:()*?<>|\"", "___________"))
2118 @classmethod
2119 def getRelativeURL(cls, target=None, escape=True):
2120 from MaKaC.conference import Contribution, Link, Session, SubContribution
2122 if target is not None:
2123 if len(target.getResourceList()) == 1:
2124 res = target.getResourceList()[0]
2125 if isinstance(res, Link):
2126 return res.getURL()
2127 else:
2128 return UHMStaticResourceDisplay.getRelativeURL(res)
2129 else:
2130 owner = target.getOwner()
2131 parents = "./material"
2132 if isinstance(owner, Session):
2133 parents = "%s/session-%s-%s" % (parents, owner.getId(), cls._normalisePathItem(owner.getTitle()))
2134 elif isinstance(owner, Contribution):
2135 if isinstance(owner.getOwner(), Session):
2136 parents = "%s/session-%s-%s" % (parents, owner.getOwner().getId(),
2137 cls._normalisePathItem(owner.getOwner().getTitle()))
2138 spk = ""
2139 if len(owner.getSpeakerList()) > 0:
2140 spk = owner.getSpeakerList()[0].getFamilyName().lower()
2141 contribDirName = "%s-%s" % (owner.getId(), spk)
2142 parents = "%s/contrib-%s" % (parents, contribDirName)
2143 elif isinstance(owner, SubContribution):
2144 contrib = owner.getContribution()
2145 if isinstance(contrib.getOwner(), Session):
2146 parents = "%s/session-%s-%s" % (parents, contrib.getOwner().getId(),
2147 cls._normalisePathItem(contrib.getOwner().getTitle()))
2148 contribspk = ""
2149 if len(contrib.getSpeakerList()) > 0:
2150 contribspk = contrib.getSpeakerList()[0].getFamilyName().lower()
2151 contribDirName = "%s-%s" % (contrib.getId(), contribspk)
2152 subcontspk = ""
2153 if len(owner.getSpeakerList()) > 0:
2154 subcontspk = owner.getSpeakerList()[0].getFamilyName().lower()
2155 subcontribDirName = "%s-%s" % (owner.getId(), subcontspk)
2156 parents = "%s/contrib-%s/subcontrib-%s" % (parents, contribDirName, subcontribDirName)
2157 relativeURL = "%s/material-%s.html" % (parents, cls._normalisePathItem(target.getId()))
2159 if escape:
2160 relativeURL = utf8rep(relativeURL)
2161 return relativeURL
2162 return cls._relativeURL
2165 class UHMStaticResourceDisplay(URLHandler):
2166 _relativeURL = "none-page.html"
2168 @classmethod
2169 def _normalisePathItem(cls, name):
2170 return str(name).translate(string.maketrans(" /:()*?<>|\"", "___________"))
2172 @classmethod
2173 def getRelativeURL(cls, target=None, escape=True):
2174 from MaKaC.conference import Contribution, Session, SubContribution
2176 if target is not None:
2178 mat = target.getOwner()
2179 owner = mat.getOwner()
2180 parents = "./material"
2181 if isinstance(owner, Session):
2182 parents = "%s/session-%s-%s" % (parents, owner.getId(), cls._normalisePathItem(owner.getTitle()))
2183 elif isinstance(owner, Contribution):
2184 if isinstance(owner.getOwner(), Session):
2185 parents = "%s/session-%s-%s" % (parents, owner.getOwner().getId(),
2186 cls._normalisePathItem(owner.getOwner().getTitle()))
2187 spk = ""
2188 if len(owner.getSpeakerList()) > 0:
2189 spk = owner.getSpeakerList()[0].getFamilyName().lower()
2190 contribDirName = "%s-%s" % (owner.getId(), spk)
2191 parents = "%s/contrib-%s" % (parents, contribDirName)
2192 elif isinstance(owner, SubContribution):
2193 contrib = owner.getContribution()
2194 if isinstance(contrib.getOwner(), Session):
2195 parents = "%s/session-%s-%s" % (parents, contrib.getOwner().getId(),
2196 cls._normalisePathItem(contrib.getOwner().getTitle()))
2197 contribspk = ""
2198 if len(contrib.getSpeakerList()) > 0:
2199 contribspk = contrib.getSpeakerList()[0].getFamilyName().lower()
2200 contribDirName = "%s-%s" % (contrib.getId(), contribspk)
2201 subcontspk = ""
2202 if len(owner.getSpeakerList()) > 0:
2203 subcontspk = owner.getSpeakerList()[0].getFamilyName().lower()
2204 subcontribDirName = "%s-%s" % (owner.getId(), subcontspk)
2205 parents = "%s/contrib-%s/subcontrib-%s" % (parents, contribDirName, subcontribDirName)
2207 relativeURL = "%s/resource-%s-%s-%s" % (parents, cls._normalisePathItem(target.getOwner().getTitle()),
2208 target.getId(), cls._normalisePathItem(target.getFileName()))
2209 if escape:
2210 relativeURL = utf8rep(relativeURL)
2211 return relativeURL
2212 return cls._relativeURL
2215 # ------- END: Static webpages ------
2217 class UHContribAuthorDisplay(URLHandler):
2218 _endpoint = 'event.contribAuthorDisplay'
2220 @classmethod
2221 def getStaticURL(cls, target, **params):
2222 if target is not None:
2223 return "contribs-%s-authorDisplay-%s.html" % (target.getId(), params.get("authorId", ""))
2224 return cls._getURL()
2227 class UHConfTimeTableCustomizePDF(URLHandler):
2228 _endpoint = 'event.conferenceTimeTable-customizePdf'
2230 @classmethod
2231 def getStaticURL(cls, target, **params):
2232 return "files/generatedPdf/Conference.pdf"
2235 class UHConfRegistrationForm(URLHandler):
2236 _endpoint = 'event.confRegistrationFormDisplay'
2239 class UHConfRegistrationFormDisplay(URLHandler):
2240 _endpoint = 'event.confRegistrationFormDisplay-display'
2243 class UHConfRegistrationFormCreation(URLHandler):
2244 _endpoint = 'event.confRegistrationFormDisplay-creation'
2247 class UHConfRegistrationFormConditions(URLHandler):
2248 _endpoint = 'event.confRegistrationFormDisplay-conditions'
2251 class UHConfRegistrationFormCreationDone(URLHandler):
2252 _endpoint = 'event.confRegistrationFormDisplay-creationDone'
2254 @classmethod
2255 def getURL(cls, registrant):
2256 url = cls._getURL()
2257 if not session.user:
2258 url.setParams(registrant.getLocator())
2259 url.addParam('authkey', registrant.getRandomId())
2260 else:
2261 url.setParams(registrant.getConference().getLocator())
2262 return url
2265 class UHConferenceTicketPDF(URLHandler):
2266 _endpoint = 'event.e-ticket-pdf'
2268 @classmethod
2269 def getURL(cls, conf):
2270 url = cls._getURL()
2271 user = ContextManager.get("currentUser")
2272 if user:
2273 registrant = user.getRegistrantById(conf.getId())
2274 if registrant:
2275 url.setParams(registrant.getLocator())
2276 url.addParam('authkey', registrant.getRandomId())
2277 return url
2280 class UHConfRegistrationFormModify(URLHandler):
2281 _endpoint = 'event.confRegistrationFormDisplay-modify'
2284 class UHConfRegistrationFormPerformModify(URLHandler):
2285 _endpoint = 'event.confRegistrationFormDisplay-performModify'
2288 class UHConfModifRegForm(URLHandler):
2289 _endpoint = 'event_mgmt.confModifRegistrationForm'
2292 class UHConfModifRegFormChangeStatus(URLHandler):
2293 _endpoint = 'event_mgmt.confModifRegistrationForm-changeStatus'
2296 class UHConfModifRegFormDataModification(URLHandler):
2297 _endpoint = 'event_mgmt.confModifRegistrationForm-dataModif'
2300 class UHConfModifRegFormPerformDataModification(URLHandler):
2301 _endpoint = 'event_mgmt.confModifRegistrationForm-performDataModif'
2304 class UHConfModifRegFormActionStatuses(URLHandler):
2305 _endpoint = 'event_mgmt.confModifRegistrationForm-actionStatuses'
2308 class UHConfModifRegFormStatusModif(URLHandler):
2309 _endpoint = 'event_mgmt.confModifRegistrationForm-modifStatus'
2312 class UHConfModifRegFormStatusPerformModif(URLHandler):
2313 _endpoint = 'event_mgmt.confModifRegistrationForm-performModifStatus'
2316 class UHConfModifRegistrationModification(URLHandler):
2317 _endpoint = 'event_mgmt.confModifRegistrationModification'
2320 class UHConfModifRegistrationModificationSectionQuery(URLHandler):
2321 _endpoint = 'event_mgmt.confModifRegistrationModificationSection-query'
2324 class UHConfModifRegistrantList(URLHandler):
2325 _endpoint = 'event_mgmt.confModifRegistrants'
2328 class UHConfModifRegistrantNew(URLHandler):
2329 _endpoint = 'event_mgmt.confModifRegistrants-newRegistrant'
2332 class UHConfModifRegistrantListAction(URLHandler):
2333 _endpoint = 'event_mgmt.confModifRegistrants-action'
2336 class UHConfModifRegistrantPerformRemove(URLHandler):
2337 _endpoint = 'event_mgmt.confModifRegistrants-remove'
2340 class UHRegistrantModification(URLHandler):
2341 _endpoint = 'event_mgmt.confModifRegistrants-modification'
2344 class UHRegistrantAttachmentFileAccess(URLHandler):
2345 _endpoint = 'event_mgmt.confModifRegistrants-getAttachedFile'
2348 class UHCategoryStatistics(URLHandler):
2349 _endpoint = 'category.categoryStatistics'
2352 class UHCategoryToiCal(URLHandler):
2353 _endpoint = 'category.categoryDisplay-ical'
2356 class UHCategoryToRSS(URLHandler):
2357 _endpoint = 'category.categoryDisplay-rss'
2360 class UHCategoryToAtom(URLHandler):
2361 _endpoint = 'category.categoryDisplay-atom'
2364 class UHCategOverviewToRSS(URLHandler):
2365 _endpoint = 'category.categOverview-rss'
2368 class UHConfRegistrantsList(URLHandler):
2369 _endpoint = 'event.confRegistrantsDisplay-list'
2371 @classmethod
2372 def getStaticURL(cls, target, **params):
2373 return "confRegistrantsDisplay.html"
2376 class UHConfModifRegistrantSessionModify(URLHandler):
2377 _endpoint = 'event_mgmt.confModifRegistrants-modifySessions'
2380 class UHConfModifRegistrantSessionPeformModify(URLHandler):
2381 _endpoint = 'event_mgmt.confModifRegistrants-performModifySessions'
2384 class UHConfModifRegistrantAccoModify(URLHandler):
2385 _endpoint = 'event_mgmt.confModifRegistrants-modifyAccommodation'
2388 class UHConfModifRegistrantAccoPeformModify(URLHandler):
2389 _endpoint = 'event_mgmt.confModifRegistrants-performModifyAccommodation'
2392 class UHConfModifRegistrantSocialEventsModify(URLHandler):
2393 _endpoint = 'event_mgmt.confModifRegistrants-modifySocialEvents'
2396 class UHConfModifRegistrantSocialEventsPeformModify(URLHandler):
2397 _endpoint = 'event_mgmt.confModifRegistrants-performModifySocialEvents'
2400 class UHConfModifRegistrantReasonPartModify(URLHandler):
2401 _endpoint = 'event_mgmt.confModifRegistrants-modifyReasonParticipation'
2404 class UHConfModifRegistrantReasonPartPeformModify(URLHandler):
2405 _endpoint = 'event_mgmt.confModifRegistrants-performModifyReasonParticipation'
2408 class UHConfModifPendingQueues(URLHandler):
2409 _endpoint = 'event_mgmt.confModifPendingQueues'
2412 class UHConfModifPendingQueuesActionConfSubm(URLHandler):
2413 _endpoint = 'event_mgmt.confModifPendingQueues-actionConfSubmitters'
2416 class UHConfModifPendingQueuesActionConfMgr(URLHandler):
2417 _endpoint = 'event_mgmt.confModifPendingQueues-actionConfManagers'
2420 class UHConfModifPendingQueuesActionSubm(URLHandler):
2421 _endpoint = 'event_mgmt.confModifPendingQueues-actionSubmitters'
2424 class UHConfModifPendingQueuesActionMgr(URLHandler):
2425 _endpoint = 'event_mgmt.confModifPendingQueues-actionManagers'
2428 class UHConfModifPendingQueuesActionCoord(URLHandler):
2429 _endpoint = 'event_mgmt.confModifPendingQueues-actionCoordinators'
2432 class UHConfModifRegistrantMiscInfoModify(URLHandler):
2433 _endpoint = 'event_mgmt.confModifRegistrants-modifyMiscInfo'
2436 class UHConfModifRegistrantMiscInfoPerformModify(URLHandler):
2437 _endpoint = 'event_mgmt.confModifRegistrants-performModifyMiscInfo'
2440 class UHConfModifRegistrantStatusesModify(URLHandler):
2441 _endpoint = 'event_mgmt.confModifRegistrants-modifyStatuses'
2444 class UHConfModifRegistrantStatusesPerformModify(URLHandler):
2445 _endpoint = 'event_mgmt.confModifRegistrants-performModifyStatuses'
2448 class UHGetCalendarOverview(URLHandler):
2449 _endpoint = 'category.categOverview'
2452 class UHCategoryCalendarOverview(URLHandler):
2453 _endpoint = 'category.wcalendar'
2456 # URL Handlers for Printing and Design
2457 class UHConfModifBadgePrinting(URLHandler):
2458 _endpoint = "event_mgmt.confModifTools-badgePrinting"
2460 @classmethod
2461 def getURL(cls, target=None, templateId=None, deleteTemplateId=None, cancel=False, new=False, copyTemplateId=None):
2463 -The deleteTemplateId param should be set if we want to erase a template.
2464 -The copyTemplateId param should be set if we want to duplicate a template
2465 -The cancel param should be set to True if we return to this url
2466 after cancelling a template creation or edit (it is used to delete
2467 temporary template backgrounds).
2468 -The new param should be set to true if we return to this url
2469 after creating a new template.
2471 url = cls._getURL()
2472 if target is not None:
2473 if target.getId() == 'default':
2474 url = UHBadgeTemplatePrinting._getURL()
2475 url.setParams(target.getLocator())
2476 if templateId is not None:
2477 url.addParam("templateId", templateId)
2478 if deleteTemplateId is not None:
2479 url.addParam("deleteTemplateId", deleteTemplateId)
2480 if copyTemplateId is not None:
2481 url.addParam("copyTemplateId", copyTemplateId)
2482 if cancel:
2483 url.addParam("cancel", True)
2484 if new:
2485 url.addParam("new", True)
2486 return url
2489 class UHBadgeTemplatePrinting(URLHandler):
2490 _endpoint = 'admin.badgeTemplates-badgePrinting'
2493 class UHConfModifBadgeDesign(URLHandler):
2494 _endpoint = 'event_mgmt.confModifTools-badgeDesign'
2496 @classmethod
2497 def getURL(cls, target=None, templateId=None, new=False):
2499 -The templateId param should always be set:
2500 *if we are editing a template, it's the id of the template edited.
2501 *if we are creating a template, it's the id that the template will
2502 have after being stored for the first time.
2503 -The new param should be set to True if we are creating a new template.
2505 url = cls._getURL()
2506 if target is not None:
2507 if target.getId() == 'default':
2508 url = UHModifDefTemplateBadge._getURL()
2509 url.setParams(target.getLocator())
2510 if templateId is not None:
2511 url.addParam("templateId", templateId)
2512 url.addParam("new", new)
2513 return url
2516 class UHModifDefTemplateBadge(URLHandler):
2517 _endpoint = 'admin.badgeTemplates-badgeDesign'
2519 @classmethod
2520 def getURL(cls, target=None, templateId=None, new=False):
2522 -The templateId param should always be set:
2523 *if we are editing a template, it's the id of the template edited.
2524 *if we are creating a template, it's the id that the template will
2525 have after being stored for the first time.
2526 -The new param should be set to True if we are creating a new template.
2528 url = cls._getURL()
2529 if target is not None:
2530 url.setParams(target.getLocator())
2531 if templateId is not None:
2532 url.addParam("templateId", templateId)
2533 url.addParam("new", new)
2534 return url
2537 class UHConfModifBadgeSaveBackground(URLHandler):
2538 _endpoint = 'event_mgmt.confModifTools-badgeSaveBackground'
2540 @classmethod
2541 def getURL(cls, target=None, templateId=None):
2542 url = cls._getURL()
2543 if target is not None and templateId is not None:
2544 url.setParams(target.getLocator())
2545 url.addParam("templateId", templateId)
2546 return url
2549 class UHConfModifBadgeGetBackground(URLHandler):
2550 _endpoint = 'event_mgmt.confModifTools-badgeGetBackground'
2552 @classmethod
2553 def getURL(cls, target=None, templateId=None, backgroundId=None):
2554 url = cls._getURL()
2555 if target is not None and templateId is not None:
2556 url.setParams(target.getLocator())
2557 url.addParam("templateId", templateId)
2558 url.addParam("backgroundId", backgroundId)
2559 return url
2562 class UHConfModifBadgePrintingPDF(URLHandler):
2563 _endpoint = 'event_mgmt.confModifTools-badgePrintingPDF'
2566 # URL Handlers for Poster Printing and Design
2567 class UHConfModifPosterPrinting(URLHandler):
2568 _endpoint = 'event_mgmt.confModifTools-posterPrinting'
2570 @classmethod
2571 def getURL(cls, target=None, templateId=None, deleteTemplateId=None, cancel=False, new=False, copyTemplateId=None):
2573 -The deleteTemplateId param should be set if we want to erase a template.
2574 -The copyTemplateId param should be set if we want to duplicate a template
2575 -The cancel param should be set to True if we return to this url
2576 after cancelling a template creation or edit (it is used to delete
2577 temporary template backgrounds).
2578 -The new param should be set to true if we return to this url
2579 after creating a new template.
2581 url = cls._getURL()
2583 if target is not None:
2584 if target.getId() == 'default':
2585 url = UHPosterTemplatePrinting._getURL()
2586 url.setParams(target.getLocator())
2587 if templateId is not None:
2588 url.addParam("templateId", templateId)
2589 if deleteTemplateId is not None:
2590 url.addParam("deleteTemplateId", deleteTemplateId)
2591 if copyTemplateId is not None:
2592 url.addParam("copyTemplateId", copyTemplateId)
2593 if cancel:
2594 url.addParam("cancel", True)
2595 if new:
2596 url.addParam("new", True)
2597 return url
2600 class UHPosterTemplatePrinting(URLHandler):
2601 _endpoint = 'admin.posterTemplates-posterPrinting'
2604 class UHConfModifPosterDesign(URLHandler):
2605 _endpoint = 'event_mgmt.confModifTools-posterDesign'
2607 @classmethod
2608 def getURL(cls, target=None, templateId=None, new=False):
2610 -The templateId param should always be set:
2611 *if we are editing a template, it's the id of the template edited.
2612 *if we are creating a template, it's the id that the template will
2613 have after being stored for the first time.
2614 -The new param should be set to True if we are creating a new template.
2616 url = cls._getURL()
2617 if target is not None:
2618 if target.getId() == 'default':
2619 url = UHModifDefTemplatePoster._getURL()
2620 url.setParams(target.getLocator())
2621 if templateId is not None:
2622 url.addParam("templateId", templateId)
2623 url.addParam("new", new)
2624 return url
2627 class UHModifDefTemplatePoster(URLHandler):
2628 _endpoint = 'admin.posterTemplates-posterDesign'
2630 @classmethod
2631 def getURL(cls, target=None, templateId=None, new=False):
2633 -The templateId param should always be set:
2634 *if we are editing a template, it's the id of the template edited.
2635 *if we are creating a template, it's the id that the template will
2636 have after being stored for the first time.
2637 -The new param should be set to True if we are creating a new template.
2639 url = cls._getURL()
2640 if target is not None:
2641 url.setParams(target.getLocator())
2642 if templateId is not None:
2643 url.addParam("templateId", templateId)
2644 url.addParam("new", new)
2645 return url
2648 class UHConfModifPosterSaveBackground(URLHandler):
2649 _endpoint = 'event_mgmt.confModifTools-posterSaveBackground'
2651 @classmethod
2652 def getURL(cls, target=None, templateId=None):
2653 url = cls._getURL()
2654 if target is not None and templateId is not None:
2655 url.setParams(target.getLocator())
2656 url.addParam("templateId", templateId)
2657 return url
2660 class UHConfModifPosterGetBackground(URLHandler):
2661 _endpoint = 'event_mgmt.confModifTools-posterGetBackground'
2663 @classmethod
2664 def getURL(cls, target=None, templateId=None, backgroundId=None):
2665 url = cls._getURL()
2666 if target is not None and templateId is not None:
2667 url.setParams(target.getLocator())
2668 url.addParam("templateId", templateId)
2669 url.addParam("backgroundId", backgroundId)
2670 return url
2673 class UHConfModifPosterPrintingPDF(URLHandler):
2674 _endpoint = 'event_mgmt.confModifTools-posterPrintingPDF'
2677 ############
2678 #Evaluation# DISPLAY AREA
2679 ############
2681 class UHConfEvaluationMainInformation(URLHandler):
2682 _endpoint = 'event.confDisplayEvaluation'
2685 class UHConfEvaluationDisplay(URLHandler):
2686 _endpoint = 'event.confDisplayEvaluation-display'
2689 class UHConfEvaluationDisplayModif(URLHandler):
2690 _endpoint = 'event.confDisplayEvaluation-modif'
2693 class UHConfEvaluationSubmit(URLHandler):
2694 _endpoint = 'event.confDisplayEvaluation-submit'
2697 class UHConfEvaluationSubmitted(URLHandler):
2698 _endpoint = 'event.confDisplayEvaluation-submitted'
2701 ############
2702 #Evaluation# MANAGEMENT AREA
2703 ############
2704 class UHConfModifEvaluation(URLHandler):
2705 _endpoint = 'event_mgmt.confModifEvaluation'
2708 class UHConfModifEvaluationSetup(URLHandler):
2709 """same result as UHConfModifEvaluation."""
2710 _endpoint = 'event_mgmt.confModifEvaluation-setup'
2713 class UHConfModifEvaluationSetupChangeStatus(URLHandler):
2714 _endpoint = 'event_mgmt.confModifEvaluation-changeStatus'
2717 class UHConfModifEvaluationSetupSpecialAction(URLHandler):
2718 _endpoint = 'event_mgmt.confModifEvaluation-specialAction'
2721 class UHConfModifEvaluationDataModif(URLHandler):
2722 _endpoint = 'event_mgmt.confModifEvaluation-dataModif'
2725 class UHConfModifEvaluationPerformDataModif(URLHandler):
2726 _endpoint = 'event_mgmt.confModifEvaluation-performDataModif'
2729 class UHConfModifEvaluationEdit(URLHandler):
2730 _endpoint = 'event_mgmt.confModifEvaluation-edit'
2733 class UHConfModifEvaluationEditPerformChanges(URLHandler):
2734 _endpoint = 'event_mgmt.confModifEvaluation-editPerformChanges'
2737 class UHConfModifEvaluationPreview(URLHandler):
2738 _endpoint = 'event_mgmt.confModifEvaluation-preview'
2741 class UHConfModifEvaluationResults(URLHandler):
2742 _endpoint = 'event_mgmt.confModifEvaluation-results'
2745 class UHConfModifEvaluationResultsOptions(URLHandler):
2746 _endpoint = 'event_mgmt.confModifEvaluation-resultsOptions'
2749 class UHConfModifEvaluationResultsSubmittersActions(URLHandler):
2750 _endpoint = 'event_mgmt.confModifEvaluation-resultsSubmittersActions'
2753 class UHResetSession(URLHandler):
2754 _endpoint = 'misc.resetSessionTZ'
2757 ##############
2758 # Reviewing
2759 #############
2760 class UHConfModifReviewingAccess(URLHandler):
2761 _endpoint = 'event_mgmt.confModifReviewing-access'
2764 class UHConfModifReviewingPaperSetup(URLHandler):
2765 _endpoint = 'event_mgmt.confModifReviewing-paperSetup'
2768 class UHSetTemplate(URLHandler):
2769 _endpoint = 'event_mgmt.confModifReviewing-setTemplate'
2772 class UHDownloadContributionTemplate(URLHandler):
2773 _endpoint = 'event_mgmt.confModifReviewing-downloadTemplate'
2776 class UHConfModifReviewingControl(URLHandler):
2777 _endpoint = 'event_mgmt.confModifReviewingControl'
2780 class UHConfModifUserCompetences(URLHandler):
2781 _endpoint = 'event_mgmt.confModifUserCompetences'
2784 class UHConfModifListContribToJudge(URLHandler):
2785 _endpoint = 'event_mgmt.confListContribToJudge'
2788 class UHConfModifListContribToJudgeAsReviewer(URLHandler):
2789 _endpoint = 'event_mgmt.confListContribToJudge-asReviewer'
2792 class UHConfModifListContribToJudgeAsEditor(URLHandler):
2793 _endpoint = 'event_mgmt.confListContribToJudge-asEditor'
2796 class UHConfModifReviewingAssignContributionsList(URLHandler):
2797 _endpoint = 'event_mgmt.assignContributions'
2800 class UHConfModifReviewingDownloadAcceptedPapers(URLHandler):
2801 _endpoint = 'event_mgmt.assignContributions-downloadAcceptedPapers'
2804 #Contribution reviewing
2805 class UHContributionModifReviewing(URLHandler):
2806 _endpoint = 'event_mgmt.contributionReviewing'
2809 class UHContribModifReviewingMaterials(URLHandler):
2810 _endpoint = 'event_mgmt.contributionReviewing-contributionReviewingMaterials'
2813 class UHContributionReviewingJudgements(URLHandler):
2814 _endpoint = 'event_mgmt.contributionReviewing-contributionReviewingJudgements'
2817 class UHAssignReferee(URLHandler):
2818 _endpoint = 'event_mgmt.contributionReviewing-assignReferee'
2821 class UHRemoveAssignReferee(URLHandler):
2822 _endpoint = 'event_mgmt.contributionReviewing-removeAssignReferee'
2825 class UHAssignEditing(URLHandler):
2826 _endpoint = 'event_mgmt.contributionReviewing-assignEditing'
2829 class UHRemoveAssignEditing(URLHandler):
2830 _endpoint = 'event_mgmt.contributionReviewing-removeAssignEditing'
2833 class UHAssignReviewing(URLHandler):
2834 _endpoint = 'event_mgmt.contributionReviewing-assignReviewing'
2837 class UHRemoveAssignReviewing(URLHandler):
2838 _endpoint = 'event_mgmt.contributionReviewing-removeAssignReviewing'
2841 class UHContributionModifReviewingHistory(URLHandler):
2842 _endpoint = 'event_mgmt.contributionReviewing-reviewingHistory'
2845 class UHContributionEditingJudgement(URLHandler):
2846 _endpoint = 'event_mgmt.contributionEditingJudgement'
2849 class UHContributionGiveAdvice(URLHandler):
2850 _endpoint = 'event_mgmt.contributionGiveAdvice'
2853 class UHDownloadPRTemplate(URLHandler):
2854 _endpoint = 'event.paperReviewingDisplay-downloadTemplate'
2857 class UHUploadPaper(URLHandler):
2858 _endpoint = 'event.paperReviewingDisplay-uploadPaper'
2861 class UHPaperReviewingDisplay(URLHandler):
2862 _endpoint = 'event.paperReviewingDisplay'
2865 #### End of reviewing
2866 class UHAbout(URLHandler):
2867 _endpoint = 'misc.about'
2870 class UHContact(URLHandler):
2871 _endpoint = 'misc.contact'
2874 class UHHelper(object):
2875 """ Returns the display or modif UH for an object of a given class
2878 modifUHs = {
2879 "Category": UHCategoryModification,
2880 "Conference": UHConferenceModification,
2881 "DefaultConference": UHConferenceModification,
2882 "Contribution": UHContributionModification,
2883 "AcceptedContribution": UHContributionModification,
2884 "Session": UHSessionModification,
2885 "SubContribution": UHSubContributionModification,
2886 "Track": UHTrackModification,
2887 "Abstract": UHAbstractModify
2890 displayUHs = {
2891 "Category": UHCategoryDisplay,
2892 "CategoryMap": UHCategoryMap,
2893 "CategoryOverview": UHCategoryOverview,
2894 "CategoryStatistics": UHCategoryStatistics,
2895 "CategoryCalendar": UHCategoryCalendarOverview,
2896 "Conference": UHConferenceDisplay,
2897 "Contribution": UHContributionDisplay,
2898 "AcceptedContribution": UHContributionDisplay,
2899 "Session": UHSessionDisplay,
2900 "Abstract": UHAbstractDisplay
2903 @classmethod
2904 def getModifUH(cls, klazz):
2905 return cls.modifUHs.get(klazz.__name__, None)
2907 @classmethod
2908 def getDisplayUH(cls, klazz, type=""):
2909 return cls.displayUHs.get("%s%s" % (klazz.__name__, type), None)