Remove old materials from categories
[cds-indico.git] / indico / MaKaC / webinterface / urlHandlers.py
blobe3894e169e4d1a10d4a07668a897307273eda878
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 UHIndicoNews(URLHandler):
193 _endpoint = 'misc.news'
196 class UHConferenceHelp(URLHandler):
197 _endpoint = 'misc.help'
200 class UHCalendar(URLHandler):
201 _endpoint = 'category.wcalendar'
203 @classmethod
204 def getURL(cls, categList=None):
205 url = cls._getURL()
206 if not categList:
207 categList = []
208 lst = [categ.getId() for categ in categList]
209 url.addParam('selCateg', lst)
210 return url
213 class UHCalendarSelectCategories(URLHandler):
214 _endpoint = 'category.wcalendar-select'
217 class UHConferenceCreation(URLHandler):
218 _endpoint = 'event_creation.conferenceCreation'
220 @classmethod
221 def getURL(cls, target):
222 url = cls._getURL()
223 if target is not None:
224 url.addParams(target.getLocator())
225 return url
228 class UHConferencePerformCreation(URLHandler):
229 _endpoint = 'event_creation.conferenceCreation-createConference'
232 class UHConferenceDisplay(URLHandler):
233 _endpoint = 'event.conferenceDisplay'
236 class UHNextEvent(URLHandler):
237 _endpoint = 'event.conferenceDisplay-next'
240 class UHPreviousEvent(URLHandler):
241 _endpoint = 'event.conferenceDisplay-prev'
244 class UHConferenceOverview(URLHandler):
245 _endpoint = 'event.conferenceDisplay-overview'
247 @classmethod
248 def getURL(cls, target):
249 if ContextManager.get('offlineMode', False):
250 return URL(UHConferenceDisplay.getStaticURL(target))
251 return super(UHConferenceOverview, cls).getURL(target)
254 class UHConferenceEmail(URLHandler):
255 _endpoint = 'event.EMail'
257 @classmethod
258 def getStaticURL(cls, target, **params):
259 if target is not None:
260 return "mailto:%s" % str(target.getEmail())
261 return cls.getURL(target)
264 class UHConferenceSendEmail(URLHandler):
265 _endpoint = 'event.EMail-send'
268 class UHRegistrantsSendEmail(URLHandler):
269 _endpoint = 'event_mgmt.EMail-sendreg'
272 class UHConvenersSendEmail(URLHandler):
273 _endpoint = 'event_mgmt.EMail-sendconvener'
276 class UHContribParticipantsSendEmail(URLHandler):
277 _endpoint = 'event_mgmt.EMail-sendcontribparticipants'
280 class UHConferenceOtherViews(URLHandler):
281 _endpoint = 'event.conferenceOtherViews'
284 class UHConferenceLogo(URLHandler):
285 _endpoint = 'event.conferenceDisplay-getLogo'
287 @classmethod
288 def getStaticURL(cls, target, **params):
289 return os.path.join(Config.getInstance().getImagesBaseURL(), "logo", str(target.getLogo()))
292 class UHConferenceCSS(URLHandler):
293 _endpoint = 'event.conferenceDisplay-getCSS'
295 @classmethod
296 def getStaticURL(cls, target, **params):
297 return cls.getURL(target, _ignore_static=True, **params)
300 class UHConferencePic(URLHandler):
301 _endpoint = 'event.conferenceDisplay-getPic'
304 class UHConfModifPreviewCSS(URLHandler):
305 _endpoint = 'event_mgmt.confModifDisplay-previewCSS'
308 class UHCategoryIcon(URLHandler):
309 _endpoint = 'category.categoryDisplay-getIcon'
312 class UHConferenceModification(URLHandler):
313 _endpoint = 'event_mgmt.conferenceModification'
316 class UHConfModifShowMaterials(URLHandler):
317 _endpoint = 'event_mgmt.conferenceModification-materialsShow'
320 class UHConfModifAddMaterials(URLHandler):
321 _endpoint = 'event_mgmt.conferenceModification-materialsAdd'
323 # ============================================================================
324 # ROOM BOOKING ===============================================================
325 # ============================================================================
327 # Free standing ==============================================================
330 class UHRoomBookingMapOfRooms(URLHandler):
331 _endpoint = 'rooms.roomBooking-mapOfRooms'
334 class UHRoomBookingMapOfRoomsWidget(URLHandler):
335 _endpoint = 'rooms.roomBooking-mapOfRoomsWidget'
338 class UHRoomBookingWelcome(URLHandler):
339 _endpoint = 'rooms.roomBooking'
342 class UHRoomBookingSearch4Bookings(URLHandler):
343 _endpoint = 'rooms.roomBooking-search4Bookings'
346 class UHRoomBookingRoomDetails(BooleanTrueMixin, URLHandler):
347 _endpoint = 'rooms.roomBooking-roomDetails'
350 class UHRoomBookingRoomStats(URLHandler):
351 _endpoint = 'rooms.roomBooking-roomStats'
354 class UHRoomBookingBookingDetails(URLHandler):
355 _endpoint = 'rooms.roomBooking-bookingDetails'
357 @classmethod
358 def _translateParams(cls, params):
359 # confId is apparently unused and thus just ugly
360 params.pop('confId', None)
361 return params
364 class UHRoomBookingModifyBookingForm(URLHandler):
365 _endpoint = 'rooms.roomBooking-modifyBookingForm'
368 class UHRoomBookingDeleteBooking(URLHandler):
369 _endpoint = 'rooms.roomBooking-deleteBooking'
372 class UHRoomBookingCloneBooking(URLHandler):
373 _endpoint = 'rooms.roomBooking-cloneBooking'
376 class UHRoomBookingCancelBooking(URLHandler):
377 _endpoint = 'rooms.roomBooking-cancelBooking'
380 class UHRoomBookingAcceptBooking(URLHandler):
381 _endpoint = 'rooms.roomBooking-acceptBooking'
384 class UHRoomBookingRejectBooking(URLHandler):
385 _endpoint = 'rooms.roomBooking-rejectBooking'
388 class UHRoomBookingCancelBookingOccurrence(URLHandler):
389 _endpoint = 'rooms.roomBooking-cancelBookingOccurrence'
392 # RB Administration
393 class UHRoomBookingAdmin(URLHandler):
394 _endpoint = 'rooms_admin.roomBooking-admin'
397 class UHRoomBookingAdminLocation(URLHandler):
398 _endpoint = 'rooms_admin.roomBooking-adminLocation'
401 class UHRoomBookingSetDefaultLocation(URLHandler):
402 _endpoint = 'rooms_admin.roomBooking-setDefaultLocation'
405 class UHRoomBookingSaveLocation(URLHandler):
406 _endpoint = 'rooms_admin.roomBooking-saveLocation'
409 class UHRoomBookingDeleteLocation(URLHandler):
410 _endpoint = 'rooms_admin.roomBooking-deleteLocation'
413 class UHRoomBookingSaveEquipment(URLHandler):
414 _endpoint = 'rooms_admin.roomBooking-saveEquipment'
417 class UHRoomBookingDeleteEquipment(URLHandler):
418 _endpoint = 'rooms_admin.roomBooking-deleteEquipment'
421 class UHRoomBookingSaveCustomAttributes(URLHandler):
422 _endpoint = 'rooms_admin.roomBooking-saveCustomAttributes'
425 class UHConferenceClose(URLHandler):
426 _endpoint = 'event_mgmt.conferenceModification-close'
429 class UHConferenceOpen(URLHandler):
430 _endpoint = 'event_mgmt.conferenceModification-open'
433 class UHConfDataModif(URLHandler):
434 _endpoint = 'event_mgmt.conferenceModification-data'
437 class UHConfScreenDatesEdit(URLHandler):
438 _endpoint = 'event_mgmt.conferenceModification-screenDates'
441 class UHConfPerformDataModif(URLHandler):
442 _endpoint = 'event_mgmt.conferenceModification-dataPerform'
445 class UHConfAddContribType(URLHandler):
446 _endpoint = 'event_mgmt.conferenceModification-addContribType'
449 class UHConfRemoveContribType(URLHandler):
450 _endpoint = 'event_mgmt.conferenceModification-removeContribType'
453 class UHConfEditContribType(URLHandler):
454 _endpoint = 'event_mgmt.conferenceModification-editContribType'
457 class UHConfModifCFAOptFld(URLHandler):
458 _endpoint = 'event_mgmt.confModifCFA-abstractFields'
461 class UHConfModifCFARemoveOptFld(URLHandler):
462 _endpoint = 'event_mgmt.confModifCFA-removeAbstractField'
465 class UHConfModifCFAAbsFieldUp(URLHandler):
466 _endpoint = 'event_mgmt.confModifCFA-absFieldUp'
469 class UHConfModifCFAAbsFieldDown(URLHandler):
470 _endpoint = 'event_mgmt.confModifCFA-absFieldDown'
473 class UHConfModifProgram(URLHandler):
474 _endpoint = 'event_mgmt.confModifProgram'
477 class UHConfModifCFA(URLHandler):
478 _endpoint = 'event_mgmt.confModifCFA'
481 class UHConfModifCFAPreview(URLHandler):
482 _endpoint = 'event_mgmt.confModifCFA-preview'
485 class UHConfCFAChangeStatus(URLHandler):
486 _endpoint = 'event_mgmt.confModifCFA-changeStatus'
489 class UHConfCFASwitchMultipleTracks(URLHandler):
490 _endpoint = 'event_mgmt.confModifCFA-switchMultipleTracks'
493 class UHConfCFAMakeTracksMandatory(URLHandler):
494 _endpoint = 'event_mgmt.confModifCFA-makeTracksMandatory'
497 class UHConfCFAAllowAttachFiles(URLHandler):
498 _endpoint = 'event_mgmt.confModifCFA-switchAttachFiles'
501 class UHAbstractAttachmentFileAccess(URLHandler):
502 _endpoint = 'event.abstractDisplay-getAttachedFile'
505 class UHConfCFAShowSelectAsSpeaker(URLHandler):
506 _endpoint = 'event_mgmt.confModifCFA-switchShowSelectSpeaker'
509 class UHConfCFASelectSpeakerMandatory(URLHandler):
510 _endpoint = 'event_mgmt.confModifCFA-switchSelectSpeakerMandatory'
513 class UHConfCFAAttachedFilesContribList(URLHandler):
514 _endpoint = 'event_mgmt.confModifCFA-switchShowAttachedFiles'
517 class UHCFADataModification(URLHandler):
518 _endpoint = 'event_mgmt.confModifCFA-modifyData'
521 class UHCFAPerformDataModification(URLHandler):
522 _endpoint = 'event_mgmt.confModifCFA-performModifyData'
525 class UHConfAbstractManagment(URLHandler):
526 _endpoint = 'event_mgmt.abstractsManagment'
529 class UHConfAbstractList(URLHandler):
530 _endpoint = 'event_mgmt.abstractsManagment'
533 class UHAbstractSubmission(URLHandler):
534 _endpoint = 'event.abstractSubmission'
537 class UHAbstractSubmissionConfirmation(URLHandler):
538 _endpoint = 'event.abstractSubmission-confirmation'
541 class UHAbstractDisplay(URLHandler):
542 _endpoint = 'event.abstractDisplay'
545 class UHAbstractDisplayPDF(URLHandler):
546 _endpoint = 'event.abstractDisplay-pdf'
549 class UHAbstractConfManagerDisplayPDF(URLHandler):
550 _endpoint = 'event_mgmt.abstractManagment-abstractToPDF'
553 class UHAbstractConfSelectionAction(URLHandler):
554 _endpoint = 'event_mgmt.abstractsManagment-abstractsActions'
557 class UHAbstractsConfManagerDisplayParticipantList(URLHandler):
558 _endpoint = 'event_mgmt.abstractsManagment-participantList'
561 class UHUserAbstracts(URLHandler):
562 _endpoint = 'event.userAbstracts'
565 class UHUserAbstractsPDF(URLHandler):
566 _endpoint = 'event.userAbstracts-pdf'
569 class UHAbstractModify(URLHandler):
570 _endpoint = 'event.abstractModify'
573 class UHCFAAbstractManagment(URLHandler):
574 _endpoint = 'event_mgmt.abstractManagment'
577 class UHAbstractManagment(URLHandler):
578 _endpoint = 'event_mgmt.abstractManagment'
581 class UHAbstractManagmentAccept(URLHandler):
582 _endpoint = 'event_mgmt.abstractManagment-accept'
585 class UHAbstractManagmentAcceptMultiple(URLHandler):
586 _endpoint = 'event_mgmt.abstractManagment-acceptMultiple'
589 class UHAbstractManagmentRejectMultiple(URLHandler):
590 _endpoint = 'event_mgmt.abstractManagment-rejectMultiple'
593 class UHAbstractManagmentReject(URLHandler):
594 _endpoint = 'event_mgmt.abstractManagment-reject'
597 class UHAbstractManagmentChangeTrack(URLHandler):
598 _endpoint = 'event_mgmt.abstractManagment-changeTrack'
601 class UHAbstractTrackProposalManagment(URLHandler):
602 _endpoint = 'event_mgmt.abstractManagment-trackProposal'
605 class UHAbstractTrackOrderByRating(URLHandler):
606 _endpoint = 'event_mgmt.abstractManagment-orderByRating'
609 class UHAbstractDirectAccess(URLHandler):
610 _endpoint = 'event_mgmt.abstractManagment-directAccess'
613 class UHAbstractToXML(URLHandler):
614 _endpoint = 'event_mgmt.abstractManagment-xml'
617 class UHAbstractSubmissionDisplay(URLHandler):
618 _endpoint = 'event.abstractSubmission'
621 class UHConfAddTrack(URLHandler):
622 _endpoint = 'event_mgmt.confModifProgram-addTrack'
625 class UHConfDelTracks(URLHandler):
626 _endpoint = 'event_mgmt.confModifProgram-deleteTracks'
629 class UHConfPerformAddTrack(URLHandler):
630 _endpoint = 'event_mgmt.confModifProgram-performAddTrack'
633 class UHTrackModification(URLHandler):
634 _endpoint = 'event_mgmt.trackModification'
637 class UHTrackModifAbstracts(URLHandler):
638 _endpoint = 'event_mgmt.trackModifAbstracts'
641 class UHTrackAbstractBase(URLHandler):
642 @classmethod
643 def getURL(cls, track, abstract):
644 url = cls._getURL()
645 url.setParams(track.getLocator())
646 url.addParam('abstractId', abstract.getId())
647 return url
650 class UHTrackAbstractModif(UHTrackAbstractBase):
651 _endpoint = 'event_mgmt.trackAbstractModif'
654 class UHAbstractTrackManagerDisplayPDF(UHTrackAbstractBase):
655 _endpoint = 'event_mgmt.trackAbstractModif-abstractToPDF'
658 class UHAbstractsTrackManagerAction(URLHandler):
659 _endpoint = 'event_mgmt.trackAbstractModif-abstractAction'
662 class UHTrackAbstractPropToAcc(UHTrackAbstractBase):
663 _endpoint = 'event_mgmt.trackAbstractModif-proposeToBeAcc'
666 class UHTrackAbstractPropToRej(UHTrackAbstractBase):
667 _endpoint = 'event_mgmt.trackAbstractModif-proposeToBeRej'
670 class UHTrackAbstractAccept(UHTrackAbstractBase):
671 _endpoint = 'event_mgmt.trackAbstractModif-accept'
674 class UHTrackAbstractReject(UHTrackAbstractBase):
675 _endpoint = 'event_mgmt.trackAbstractModif-reject'
678 class UHTrackAbstractDirectAccess(URLHandler):
679 _endpoint = 'event_mgmt.trackAbstractModif-directAccess'
682 class UHTrackAbstractPropForOtherTrack(UHTrackAbstractBase):
683 _endpoint = 'event_mgmt.trackAbstractModif-proposeForOtherTracks'
686 class UHTrackModifCoordination(URLHandler):
687 _endpoint = 'event_mgmt.trackModifCoordination'
690 class UHTrackDataModif(URLHandler):
691 _endpoint = 'event_mgmt.trackModification-modify'
694 class UHTrackPerformDataModification(URLHandler):
695 _endpoint = 'event_mgmt.trackModification-performModify'
698 class UHTrackAbstractModIntComments(UHTrackAbstractBase):
699 _endpoint = 'event_mgmt.trackAbstractModif-comments'
702 class UHConfModifSchedule(URLHandler):
703 _endpoint = 'event_mgmt.confModifSchedule'
706 class UHContribConfSelectionAction(URLHandler):
707 _endpoint = 'event_mgmt.confModifContribList-contribsActions'
710 class UHContribsConfManagerDisplayMenuPDF(URLHandler):
711 _endpoint = 'event_mgmt.confModifContribList-contribsToPDFMenu'
714 class UHContribsConfManagerDisplayParticipantList(URLHandler):
715 _endpoint = 'event_mgmt.confModifContribList-participantList'
718 class UHSessionClose(URLHandler):
719 _endpoint = 'event_mgmt.sessionModification-close'
722 class UHSessionOpen(URLHandler):
723 _endpoint = 'event_mgmt.sessionModification-open'
726 class UHSessionCreation(URLHandler):
727 _endpoint = 'event_mgmt.confModifSchedule'
730 class UHContribCreation(URLHandler):
731 _endpoint = 'event_mgmt.confModifSchedule'
734 class UHContribToXMLConfManager(URLHandler):
735 _endpoint = 'event_mgmt.contributionModification-xml'
738 class UHContribToXML(URLHandler):
739 _endpoint = 'event.contributionDisplay-xml'
741 @classmethod
742 def getStaticURL(cls, target, **params):
743 return ""
746 class UHContribToiCal(URLHandler):
747 _endpoint = 'event.contributionDisplay-ical'
749 @classmethod
750 def getStaticURL(cls, target, **params):
751 return ""
754 class UHContribToPDFConfManager(URLHandler):
755 _endpoint = 'event_mgmt.contributionModification-pdf'
758 class UHContribToPDF(URLHandler):
759 _endpoint = 'event.contributionDisplay-pdf'
761 @classmethod
762 def getStaticURL(cls, target, **params):
763 if target is not None:
764 return "files/generatedPdf/%s-Contribution.pdf" % target.getId()
767 class UHContribModifAC(URLHandler):
768 _endpoint = 'event_mgmt.contributionAC'
771 class UHContributionSetVisibility(URLHandler):
772 _endpoint = 'event_mgmt.contributionAC-setVisibility'
775 class UHContribModifMaterialMgmt(URLHandler):
776 _endpoint = 'event_mgmt.contributionModification-materials'
779 class UHContribModifAddMaterials(URLHandler):
780 _endpoint = 'event_mgmt.contributionModification-materialsAdd'
783 class UHContribModifSubCont(URLHandler):
784 _endpoint = 'event_mgmt.contributionModifSubCont'
787 class UHContribAddSubCont(URLHandler):
788 _endpoint = 'event_mgmt.contributionModifSubCont-add'
791 class UHContribCreateSubCont(URLHandler):
792 _endpoint = 'event_mgmt.contributionModifSubCont-create'
795 class UHSubContribActions(URLHandler):
796 _endpoint = 'event_mgmt.contributionModifSubCont-actionSubContribs'
799 class UHContribModifTools(URLHandler):
800 _endpoint = 'event_mgmt.contributionTools'
803 class UHContributionDataModif(URLHandler):
804 _endpoint = 'event_mgmt.contributionModification-modifData'
807 class UHContributionDataModification(URLHandler):
808 _endpoint = 'event_mgmt.contributionModification-data'
811 class UHConfModifAC(URLHandler):
812 _endpoint = 'event_mgmt.confModifAC'
815 class UHConfSetVisibility(URLHandler):
816 _endpoint = 'event_mgmt.confModifAC-setVisibility'
819 class UHConfGrantSubmissionToAllSpeakers(URLHandler):
820 _endpoint = 'event_mgmt.confModifAC-grantSubmissionToAllSpeakers'
823 class UHConfRemoveAllSubmissionRights(URLHandler):
824 _endpoint = 'event_mgmt.confModifAC-removeAllSubmissionRights'
827 class UHConfGrantModificationToAllConveners(URLHandler):
828 _endpoint = 'event_mgmt.confModifAC-grantModificationToAllConveners'
831 class UHConfModifCoordinatorRights(URLHandler):
832 _endpoint = 'event_mgmt.confModifAC-modifySessionCoordRights'
835 class UHConfModifTools(URLHandler):
836 _endpoint = 'event_mgmt.confModifTools'
839 class UHConfModifParticipants(URLHandler):
840 _endpoint = 'event_mgmt.confModifParticipants'
843 class UHInternalPageDisplay(URLHandler):
844 _endpoint = 'event.internalPage'
846 @classmethod
847 def getStaticURL(cls, target, **params):
848 params = target.getLocator()
849 url = os.path.join("internalPage-%s.html" % params["pageId"])
850 return url
853 class UHConfModifDisplay(URLHandler):
854 _endpoint = 'event_mgmt.confModifDisplay'
857 class UHConfModifDisplayCustomization(URLHandler):
858 _endpoint = 'event_mgmt.confModifDisplay-custom'
861 class UHConfModifDisplayMenu(URLHandler):
862 _endpoint = 'event_mgmt.confModifDisplay-menu'
865 class UHConfModifDisplayResources(URLHandler):
866 _endpoint = 'event_mgmt.confModifDisplay-resources'
869 class UHConfModifDisplayConfHeader(URLHandler):
870 _endpoint = 'event_mgmt.confModifDisplay-confHeader'
873 class UHConfModifDisplayAddLink(URLHandler):
874 _endpoint = 'event_mgmt.confModifDisplay-addLink'
877 class UHConfModifDisplayAddPage(URLHandler):
878 _endpoint = 'event_mgmt.confModifDisplay-addPage'
881 class UHConfModifDisplayModifyData(URLHandler):
882 _endpoint = 'event_mgmt.confModifDisplay-modifyData'
885 class UHConfModifDisplayModifySystemData(URLHandler):
886 _endpoint = 'event_mgmt.confModifDisplay-modifySystemData'
889 class UHConfModifDisplayAddSpacer(URLHandler):
890 _endpoint = 'event_mgmt.confModifDisplay-addSpacer'
893 class UHConfModifDisplayRemoveLink(URLHandler):
894 _endpoint = 'event_mgmt.confModifDisplay-removeLink'
897 class UHConfModifDisplayToggleLinkStatus(URLHandler):
898 _endpoint = 'event_mgmt.confModifDisplay-toggleLinkStatus'
901 class UHConfModifDisplayToggleHomePage(URLHandler):
902 _endpoint = 'event_mgmt.confModifDisplay-toggleHomePage'
905 class UHConfModifDisplayUpLink(URLHandler):
906 _endpoint = 'event_mgmt.confModifDisplay-upLink'
909 class UHConfModifDisplayDownLink(URLHandler):
910 _endpoint = 'event_mgmt.confModifDisplay-downLink'
913 class UHConfModifDisplayToggleTimetableView(URLHandler):
914 _endpoint = 'event_mgmt.confModifDisplay-toggleTimetableView'
917 class UHConfModifDisplayToggleTTDefaultLayout(URLHandler):
918 _endpoint = 'event_mgmt.confModifDisplay-toggleTTDefaultLayout'
921 class UHConfModifFormatTitleBgColor(URLHandler):
922 _endpoint = 'event_mgmt.confModifDisplay-formatTitleBgColor'
925 class UHConfModifFormatTitleTextColor(URLHandler):
926 _endpoint = 'event_mgmt.confModifDisplay-formatTitleTextColor'
929 class UHConfDeletion(URLHandler):
930 _endpoint = 'event_mgmt.confModifTools-delete'
933 class UHConfClone(URLHandler):
934 _endpoint = 'event_mgmt.confModifTools-clone'
937 class UHConfPerformCloning(URLHandler):
938 _endpoint = 'event_mgmt.confModifTools-performCloning'
941 class UHConfAllSessionsConveners(URLHandler):
942 _endpoint = 'event_mgmt.confModifTools-allSessionsConveners'
945 class UHConfAllSessionsConvenersAction(URLHandler):
946 _endpoint = 'event_mgmt.confModifTools-allSessionsConvenersAction'
949 class UHConfAllSpeakers(URLHandler):
950 _endpoint = 'event_mgmt.confModifListings-allSpeakers'
953 class UHConfAllSpeakersAction(URLHandler):
954 _endpoint = 'event_mgmt.confModifListings-allSpeakersAction'
957 class UHSaveLogo(URLHandler):
958 _endpoint = 'event_mgmt.confModifDisplay-saveLogo'
961 class UHRemoveLogo(URLHandler):
962 _endpoint = 'event_mgmt.confModifDisplay-removeLogo'
965 class UHSaveCSS(URLHandler):
966 _endpoint = 'event_mgmt.confModifDisplay-saveCSS'
969 class UHUseCSS(URLHandler):
970 _endpoint = 'event_mgmt.confModifDisplay-useCSS'
973 class UHRemoveCSS(URLHandler):
974 _endpoint = 'event_mgmt.confModifDisplay-removeCSS'
977 class UHSavePic(URLHandler):
978 _endpoint = 'event_mgmt.confModifDisplay-savePic'
981 class UHConfModifParticipantsSetup(URLHandler):
982 _endpoint = 'event_mgmt.confModifParticipants-setup'
985 class UHConfModifParticipantsPending(URLHandler):
986 _endpoint = 'event_mgmt.confModifParticipants-pendingParticipants'
989 class UHConfModifParticipantsDeclined(URLHandler):
990 _endpoint = 'event_mgmt.confModifParticipants-declinedParticipants'
993 class UHConfModifParticipantsAction(URLHandler):
994 _endpoint = 'event_mgmt.confModifParticipants-action'
997 class UHConfModifParticipantsStatistics(URLHandler):
998 _endpoint = 'event_mgmt.confModifParticipants-statistics'
1001 class UHConfParticipantsInvitation(URLHandler):
1002 _endpoint = 'event.confModifParticipants-invitation'
1005 class UHConfParticipantsRefusal(URLHandler):
1006 _endpoint = 'event.confModifParticipants-refusal'
1009 class UHConfModifToggleSearch(URLHandler):
1010 _endpoint = 'event_mgmt.confModifDisplay-toggleSearch'
1013 class UHConfModifToggleNavigationBar(URLHandler):
1014 _endpoint = 'event_mgmt.confModifDisplay-toggleNavigationBar'
1017 class UHTickerTapeAction(URLHandler):
1018 _endpoint = 'event_mgmt.confModifDisplay-tickerTapeAction'
1021 class UHConfUser(URLHandler):
1022 @classmethod
1023 def getURL(cls, conference, av=None):
1024 url = cls._getURL()
1025 if conference is not None:
1026 loc = conference.getLocator().copy()
1027 if av:
1028 loc.update(av.getLocator())
1029 url.setParams(loc)
1030 return url
1033 class UHConfEnterAccessKey(UHConfUser):
1034 _endpoint = 'event.conferenceDisplay-accessKey'
1037 class UHConfManagementAccess(UHConfUser):
1038 _endpoint = 'event_mgmt.conferenceModification-managementAccess'
1041 class UHConfEnterModifKey(UHConfUser):
1042 _endpoint = 'event_mgmt.conferenceModification-modifKey'
1045 class UHConfCloseModifKey(UHConfUser):
1046 _endpoint = 'event_mgmt.conferenceModification-closeModifKey'
1049 class UHUserDetails(UserURLHandler):
1050 # XXX: This UH is deprecated. It's just kept around to have a
1051 # quick reference to find code that needs to be rewritten/removed.
1052 _endpoint = None
1055 class UHDomains(URLHandler):
1056 _endpoint = 'admin.domainList'
1059 class UHNewDomain(URLHandler):
1060 _endpoint = 'admin.domainCreation'
1063 class UHDomainPerformCreation(URLHandler):
1064 _endpoint = 'admin.domainCreation-create'
1067 class UHDomainDetails(URLHandler):
1068 _endpoint = 'admin.domainDetails'
1071 class UHDomainModification(URLHandler):
1072 _endpoint = 'admin.domainDataModification'
1075 class UHDomainPerformModification(URLHandler):
1076 _endpoint = 'admin.domainDataModification-modify'
1079 class UHRoomMappers(URLHandler):
1080 _endpoint = 'rooms_admin.roomMapper'
1083 class UHNewRoomMapper(URLHandler):
1084 _endpoint = 'rooms_admin.roomMapper-creation'
1087 class UHRoomMapperPerformCreation(URLHandler):
1088 _endpoint = 'rooms_admin.roomMapper-performCreation'
1091 class UHRoomMapperDetails(URLHandler):
1092 _endpoint = 'rooms_admin.roomMapper-details'
1095 class UHRoomMapperModification(URLHandler):
1096 _endpoint = 'rooms_admin.roomMapper-modify'
1099 class UHRoomMapperPerformModification(URLHandler):
1100 _endpoint = 'rooms_admin.roomMapper-performModify'
1103 class UHAdminArea(URLHandler):
1104 _endpoint = 'admin.adminList'
1107 class UHAdminSwitchNewsActive(URLHandler):
1108 _endpoint = 'admin.adminList-switchNewsActive'
1111 class UHAdminsStyles(URLHandler):
1112 _endpoint = 'admin.adminLayout-styles'
1115 class UHAdminsConferenceStyles(URLHandler):
1116 _endpoint = 'admin.adminConferenceStyles'
1119 class UHAdminsAddStyle(URLHandler):
1120 _endpoint = 'admin.adminLayout-addStyle'
1123 class UHAdminsDeleteStyle(URLHandler):
1124 _endpoint = 'admin.adminLayout-deleteStyle'
1127 class UHAdminsSystem(URLHandler):
1128 _endpoint = 'admin.adminSystem'
1131 class UHAdminsSystemModif(URLHandler):
1132 _endpoint = 'admin.adminSystem-modify'
1135 class UHAdminsProtection(URLHandler):
1136 _endpoint = 'admin.adminProtection'
1139 class UHMaterialModification(URLHandler):
1140 @classmethod
1141 def getURL(cls, material, returnURL=""):
1142 from MaKaC import conference
1144 owner = material.getOwner()
1145 # return handler depending on parent type
1146 if isinstance(owner, conference.Conference):
1147 handler = UHConfModifShowMaterials
1148 elif isinstance(owner, conference.Session):
1149 handler = UHSessionModifMaterials
1150 elif isinstance(owner, conference.Contribution):
1151 handler = UHContribModifMaterials
1152 elif isinstance(owner, conference.SubContribution):
1153 handler = UHSubContribModifMaterials
1154 else:
1155 raise Exception('Unknown material owner type: %s' % owner)
1157 return handler.getURL(owner, returnURL=returnURL)
1160 class UHMaterialEnterAccessKey(URLHandler):
1161 _endpoint = 'files.materialDisplay-accessKey'
1164 class UHFileEnterAccessKey(URLHandler):
1165 _endpoint = 'files.getFile-accessKey'
1168 class UHCategoryModification(URLHandler):
1169 _endpoint = 'category_mgmt.categoryModification'
1171 @classmethod
1172 def getActionURL(cls):
1173 return ''
1176 class UHCategoryActionSubCategs(URLHandler):
1177 _endpoint = 'category_mgmt.categoryModification-actionSubCategs'
1180 class UHCategoryActionConferences(URLHandler):
1181 _endpoint = 'category_mgmt.categoryModification-actionConferences'
1184 class UHCategModifAC(URLHandler):
1185 _endpoint = 'category_mgmt.categoryAC'
1188 class UHCategorySetConfCreationControl(URLHandler):
1189 _endpoint = 'category_mgmt.categoryConfCreationControl-setCreateConferenceControl'
1192 class UHCategorySetNotifyCreation(URLHandler):
1193 _endpoint = 'category_mgmt.categoryConfCreationControl-setNotifyCreation'
1196 class UHCategModifTools(URLHandler):
1197 _endpoint = 'category_mgmt.categoryTools'
1200 class UHCategoryDeletion(URLHandler):
1201 _endpoint = 'category_mgmt.categoryTools-delete'
1204 class UHCategModifTasks(URLHandler):
1205 _endpoint = 'category_mgmt.categoryTasks'
1208 class UHCategModifTasksAction(URLHandler):
1209 _endpoint = 'category_mgmt.categoryTasks-taskAction'
1212 class UHCategoryDataModif(URLHandler):
1213 _endpoint = 'category_mgmt.categoryDataModification'
1216 class UHCategoryPerformModification(URLHandler):
1217 _endpoint = 'category_mgmt.categoryDataModification-modify'
1220 class UHCategoryTasksOption(URLHandler):
1221 _endpoint = 'category_mgmt.categoryDataModification-tasksOption'
1224 class UHCategorySetVisibility(URLHandler):
1225 _endpoint = 'category_mgmt.categoryAC-setVisibility'
1228 class UHCategoryCreation(URLHandler):
1229 _endpoint = 'category_mgmt.categoryCreation'
1232 class UHCategoryPerformCreation(URLHandler):
1233 _endpoint = 'category_mgmt.categoryCreation-create'
1236 class UHCategoryDisplay(URLHandler):
1237 _endpoint = 'category.categoryDisplay'
1239 @classmethod
1240 def getURL(cls, target=None, **params):
1241 url = cls._getURL(**params)
1242 if target:
1243 if target.isRoot():
1244 return UHWelcome.getURL()
1245 url.setParams(target.getLocator())
1246 return url
1249 class UHCategoryMap(URLHandler):
1250 _endpoint = 'category.categoryMap'
1253 class UHCategoryOverview(URLHandler):
1254 _endpoint = 'category.categOverview'
1256 @classmethod
1257 def getURLFromOverview(cls, ow):
1258 url = cls.getURL()
1259 url.setParams(ow.getLocator())
1260 return url
1262 @classmethod
1263 def getWeekOverviewUrl(cls, categ):
1264 url = cls.getURL(categ)
1265 p = {"day": nowutc().day,
1266 "month": nowutc().month,
1267 "year": nowutc().year,
1268 "period": "week",
1269 "detail": "conference"}
1270 url.addParams(p)
1271 return url
1273 @classmethod
1274 def getMonthOverviewUrl(cls, categ):
1275 url = cls.getURL(categ)
1276 p = {"day": nowutc().day,
1277 "month": nowutc().month,
1278 "year": nowutc().year,
1279 "period": "month",
1280 "detail": "conference"}
1281 url.addParams(p)
1282 return url
1285 class UHGeneralInfoModification(URLHandler):
1286 _endpoint = 'admin.generalInfoModification'
1289 class UHGeneralInfoPerformModification(URLHandler):
1290 _endpoint = 'admin.generalInfoModification-update'
1293 class UHContributionDelete(URLHandler):
1294 _endpoint = 'event_mgmt.contributionTools-delete'
1297 class UHSubContributionDataModification(URLHandler):
1298 _endpoint = 'event_mgmt.subContributionModification-data'
1301 class UHSubContributionDataModif(URLHandler):
1302 _endpoint = 'event_mgmt.subContributionModification-modifData'
1305 class UHSubContributionDelete(URLHandler):
1306 _endpoint = 'event_mgmt.subContributionTools-delete'
1309 class UHSubContribModifAddMaterials(URLHandler):
1310 _endpoint = 'event_mgmt.subContributionModification-materialsAdd'
1313 class UHSubContribModifTools(URLHandler):
1314 _endpoint = 'event_mgmt.subContributionTools'
1317 class UHSessionModification(URLHandler):
1318 _endpoint = 'event_mgmt.sessionModification'
1321 class UHSessionModifMaterials(URLHandler):
1322 _endpoint = 'event_mgmt.sessionModification-materials'
1325 class UHSessionDataModification(URLHandler):
1326 _endpoint = 'event_mgmt.sessionModification-modify'
1329 class UHSessionFitSlot(URLHandler):
1330 _endpoint = 'event_mgmt.sessionModifSchedule-fitSlot'
1333 class UHSessionModifAddMaterials(URLHandler):
1334 _endpoint = 'event_mgmt.sessionModification-materialsAdd'
1337 class UHSessionModifSchedule(URLHandler):
1338 _endpoint = 'event_mgmt.sessionModifSchedule'
1341 class UHSessionModSlotCalc(URLHandler):
1342 _endpoint = 'event_mgmt.sessionModifSchedule-slotCalc'
1345 class UHSessionModifAC(URLHandler):
1346 _endpoint = 'event_mgmt.sessionModifAC'
1349 class UHSessionSetVisibility(URLHandler):
1350 _endpoint = 'event_mgmt.sessionModifAC-setVisibility'
1353 class UHSessionModifTools(URLHandler):
1354 _endpoint = 'event_mgmt.sessionModifTools'
1357 class UHSessionModifComm(URLHandler):
1358 _endpoint = 'event_mgmt.sessionModifComm'
1361 class UHSessionModifCommEdit(URLHandler):
1362 _endpoint = 'event_mgmt.sessionModifComm-edit'
1365 class UHSessionDeletion(URLHandler):
1366 _endpoint = 'event_mgmt.sessionModifTools-delete'
1369 class UHContributionModification(URLHandler):
1370 _endpoint = 'event_mgmt.contributionModification'
1373 class UHContribModifMaterials(URLHandler):
1374 _endpoint = 'event_mgmt.contributionModification-materials'
1377 class UHSubContribModification(URLHandler):
1378 _endpoint = 'event_mgmt.subContributionModification'
1381 class UHSubContribModifMaterials(URLHandler):
1382 _endpoint = 'event_mgmt.subContributionModification-materials'
1385 class UHMaterialDisplay(URLHandler):
1386 _endpoint = 'files.materialDisplay'
1388 @classmethod
1389 def getStaticURL(cls, target, **params):
1390 if target is not None:
1391 params = target.getLocator()
1392 resources = target.getOwner().getMaterialById(params["materialId"]).getResourceList()
1393 if len(resources) == 1:
1394 return UHFileAccess.getStaticURL(resources[0])
1395 return "materialDisplay-%s.html" % params["materialId"]
1396 return cls._getURL()
1399 class UHConferenceProgram(URLHandler):
1400 _endpoint = 'event.conferenceProgram'
1403 class UHConferenceProgramPDF(URLHandler):
1404 _endpoint = 'event.conferenceProgram-pdf'
1406 @classmethod
1407 def getStaticURL(cls, target, **params):
1408 return "files/generatedPdf/Programme.pdf"
1411 class UHConferenceTimeTable(URLHandler):
1412 _endpoint = 'event.conferenceTimeTable'
1415 class UHConfTimeTablePDF(URLHandler):
1416 _endpoint = 'event.conferenceTimeTable-pdf'
1418 @classmethod
1419 def getStaticURL(cls, target, **params):
1420 if target is not None:
1421 params = target.getLocator()
1422 from MaKaC import conference
1424 if isinstance(target, conference.Conference):
1425 return "files/generatedPdf/Conference.pdf"
1426 if isinstance(target, conference.Contribution):
1427 return "files/generatedPdf/%s-Contribution.pdf" % (params["contribId"])
1428 elif isinstance(target, conference.Session) or isinstance(target, conference.SessionSlot):
1429 return "files/generatedPdf/%s-Session.pdf" % (params["sessionId"])
1430 return cls._getURL()
1433 class UHConferenceCFA(URLHandler):
1434 _endpoint = 'event.conferenceCFA'
1437 class UHSessionDisplay(URLHandler):
1438 _endpoint = 'event.sessionDisplay'
1440 @classmethod
1441 def getStaticURL(cls, target, **params):
1442 if target is not None:
1443 params.update(target.getLocator())
1444 return "%s-session.html" % params["sessionId"]
1447 class UHSessionToiCal(URLHandler):
1448 _endpoint = 'event.sessionDisplay-ical'
1451 class UHContributionDisplay(URLHandler):
1452 _endpoint = 'event.contributionDisplay'
1454 @classmethod
1455 def getStaticURL(cls, target, **params):
1456 if target is not None:
1457 params = target.getLocator()
1458 return "%s-contrib.html" % (params["contribId"])
1459 return cls.getURL(target, _ignore_static=True, **params)
1462 class UHSubContributionDisplay(URLHandler):
1463 _endpoint = 'event.subContributionDisplay'
1465 @classmethod
1466 def getStaticURL(cls, target, **params):
1467 if target is not None:
1468 params = target.getLocator()
1469 return "%s-subcontrib.html" % (params["subContId"])
1470 return cls.getURL(target, _ignore_static=True, **params)
1473 class UHSubContributionModification(URLHandler):
1474 _endpoint = 'event_mgmt.subContributionModification'
1477 class UHFileAccess(URLHandler):
1478 _endpoint = 'files.getFile-access'
1481 class UHVideoWmvAccess(URLHandler):
1482 _endpoint = 'files.getFile-wmv'
1485 class UHVideoFlashAccess(URLHandler):
1486 _endpoint = 'files.getFile-flash'
1489 class UHErrorReporting(URLHandler):
1490 _endpoint = 'misc.errors'
1493 class UHAbstractWithdraw(URLHandler):
1494 _endpoint = 'event.abstractWithdraw'
1497 class UHAbstractRecovery(URLHandler):
1498 _endpoint = 'event.abstractWithdraw-recover'
1501 class UHConfModifContribList(URLHandler):
1502 _endpoint = 'event_mgmt.confModifContribList'
1505 class UHContribModifMaterialBrowse(URLHandler):
1506 _endpoint = 'event_mgmt.contributionModification-browseMaterial'
1509 class UHContribModSetTrack(URLHandler):
1510 _endpoint = 'event_mgmt.contributionModification-setTrack'
1513 class UHContribModSetSession(URLHandler):
1514 _endpoint = 'event_mgmt.contributionModification-setSession'
1517 class UHTrackModMoveUp(URLHandler):
1518 _endpoint = 'event_mgmt.confModifProgram-moveTrackUp'
1521 class UHTrackModMoveDown(URLHandler):
1522 _endpoint = 'event_mgmt.confModifProgram-moveTrackDown'
1525 class UHAbstractModEditData(URLHandler):
1526 _endpoint = 'event_mgmt.abstractManagment-editData'
1529 class UHAbstractModIntComments(URLHandler):
1530 _endpoint = 'event_mgmt.abstractManagment-comments'
1533 class UHAbstractModNewIntComment(URLHandler):
1534 _endpoint = 'event_mgmt.abstractManagment-newComment'
1537 class UHAbstractModIntCommentEdit(URLHandler):
1538 _endpoint = 'event_mgmt.abstractManagment-editComment'
1541 class UHAbstractModIntCommentRem(URLHandler):
1542 _endpoint = 'event_mgmt.abstractManagment-remComment'
1545 class UHTrackAbstractModIntCommentNew(UHTrackAbstractBase):
1546 _endpoint = 'event_mgmt.trackAbstractModif-commentNew'
1549 class UHTrackAbstractModCommentBase(URLHandler):
1550 @classmethod
1551 def getURL(cls, track, comment):
1552 url = cls._getURL()
1553 url.setParams(comment.getLocator())
1554 url.addParam("trackId", track.getId())
1555 return url
1558 class UHTrackAbstractModIntCommentEdit(UHTrackAbstractModCommentBase):
1559 _endpoint = 'event_mgmt.trackAbstractModif-commentEdit'
1562 class UHTrackAbstractModIntCommentRem(UHTrackAbstractModCommentBase):
1563 _endpoint = 'event_mgmt.trackAbstractModif-commentRem'
1566 class UHAbstractReviewingNotifTpl(URLHandler):
1567 _endpoint = 'event_mgmt.abstractReviewing-notifTpl'
1570 class UHAbstractModNotifTplNew(URLHandler):
1571 _endpoint = 'event_mgmt.abstractReviewing-notifTplNew'
1574 class UHAbstractModNotifTplRem(URLHandler):
1575 _endpoint = 'event_mgmt.abstractReviewing-notifTplRem'
1578 class UHAbstractModNotifTplEdit(URLHandler):
1579 _endpoint = 'event_mgmt.abstractReviewing-notifTplEdit'
1582 class UHAbstractModNotifTplDisplay(URLHandler):
1583 _endpoint = 'event_mgmt.abstractReviewing-notifTplDisplay'
1586 class UHAbstractModNotifTplPreview(URLHandler):
1587 _endpoint = 'event_mgmt.abstractReviewing-notifTplPreview'
1590 class UHTrackAbstractModMarkAsDup(UHTrackAbstractBase):
1591 _endpoint = 'event_mgmt.trackAbstractModif-markAsDup'
1594 class UHTrackAbstractModUnMarkAsDup(UHTrackAbstractBase):
1595 _endpoint = 'event_mgmt.trackAbstractModif-unMarkAsDup'
1598 class UHAbstractModMarkAsDup(URLHandler):
1599 _endpoint = 'event_mgmt.abstractManagment-markAsDup'
1602 class UHAbstractModUnMarkAsDup(URLHandler):
1603 _endpoint = 'event_mgmt.abstractManagment-unMarkAsDup'
1606 class UHAbstractModMergeInto(URLHandler):
1607 _endpoint = 'event_mgmt.abstractManagment-mergeInto'
1610 class UHAbstractModUnMerge(URLHandler):
1611 _endpoint = 'event_mgmt.abstractManagment-unmerge'
1614 class UHConfModNewAbstract(URLHandler):
1615 _endpoint = 'event_mgmt.abstractsManagment-newAbstract'
1618 class UHConfModNotifTplConditionNew(URLHandler):
1619 _endpoint = 'event_mgmt.abstractReviewing-notifTplCondNew'
1622 class UHConfModNotifTplConditionRem(URLHandler):
1623 _endpoint = 'event_mgmt.abstractReviewing-notifTplCondRem'
1626 class UHConfModAbstractsMerge(URLHandler):
1627 _endpoint = 'event_mgmt.abstractsManagment-mergeAbstracts'
1630 class UHAbstractModNotifLog(URLHandler):
1631 _endpoint = 'event_mgmt.abstractManagment-notifLog'
1634 class UHAbstractModTools(URLHandler):
1635 _endpoint = 'event_mgmt.abstractTools'
1638 class UHAbstractDelete(URLHandler):
1639 _endpoint = 'event_mgmt.abstractTools-delete'
1642 class UHSessionModContribList(URLHandler):
1643 _endpoint = 'event_mgmt.sessionModification-contribList'
1646 class UHSessionModContribListEditContrib(URLHandler):
1647 _endpoint = 'event_mgmt.sessionModification-editContrib'
1650 class UHConfModifReschedule(URLHandler):
1651 _endpoint = 'event_mgmt.confModifSchedule-reschedule'
1654 class UHContributionList(URLHandler):
1655 _endpoint = 'event.contributionListDisplay'
1658 class UHContributionListToPDF(URLHandler):
1659 _endpoint = 'event.contributionListDisplay-contributionsToPDF'
1661 @classmethod
1662 def getStaticURL(cls, target=None, **params):
1663 return "files/generatedPdf/Contributions.pdf"
1666 class UHConfModAbstractPropToAcc(URLHandler):
1667 _endpoint = 'event_mgmt.abstractManagment-propToAcc'
1670 class UHAbstractManagmentBackToSubmitted(URLHandler):
1671 _endpoint = 'event_mgmt.abstractManagment-backToSubmitted'
1674 class UHConfModAbstractPropToRej(URLHandler):
1675 _endpoint = 'event_mgmt.abstractManagment-propToRej'
1678 class UHConfModAbstractWithdraw(URLHandler):
1679 _endpoint = 'event_mgmt.abstractManagment-withdraw'
1682 class UHSessionModAddContribs(URLHandler):
1683 _endpoint = 'event_mgmt.sessionModification-addContribs'
1686 class UHSessionModContributionAction(URLHandler):
1687 _endpoint = 'event_mgmt.sessionModification-contribAction'
1690 class UHSessionModParticipantList(URLHandler):
1691 _endpoint = 'event_mgmt.sessionModification-participantList'
1694 class UHSessionModToPDF(URLHandler):
1695 _endpoint = 'event_mgmt.sessionModification-contribsToPDF'
1698 class UHConfModCFANotifTplUp(URLHandler):
1699 _endpoint = 'event_mgmt.abstractReviewing-notifTplUp'
1702 class UHConfModCFANotifTplDown(URLHandler):
1703 _endpoint = 'event_mgmt.abstractReviewing-notifTplDown'
1706 class UHConfAuthorIndex(URLHandler):
1707 _endpoint = 'event.confAuthorIndex'
1710 class UHConfSpeakerIndex(URLHandler):
1711 _endpoint = 'event.confSpeakerIndex'
1714 class UHContribModWithdraw(URLHandler):
1715 _endpoint = 'event_mgmt.contributionModification-withdraw'
1718 class UHTrackModContribList(URLHandler):
1719 _endpoint = 'event_mgmt.trackModContribList'
1722 class UHTrackModContributionAction(URLHandler):
1723 _endpoint = 'event_mgmt.trackModContribList-contribAction'
1726 class UHTrackModParticipantList(URLHandler):
1727 _endpoint = 'event_mgmt.trackModContribList-participantList'
1730 class UHTrackModToPDF(URLHandler):
1731 _endpoint = 'event_mgmt.trackModContribList-contribsToPDF'
1734 class UHConfModContribQuickAccess(URLHandler):
1735 _endpoint = 'event_mgmt.confModifContribList-contribQuickAccess'
1738 class UHSessionModContribQuickAccess(URLHandler):
1739 _endpoint = 'event_mgmt.sessionModification-contribQuickAccess'
1742 class UHTrackModContribQuickAccess(URLHandler):
1743 _endpoint = 'event_mgmt.trackModContribList-contribQuickAccess'
1746 class UHConfMyStuff(URLHandler):
1747 _endpoint = 'event.myconference'
1750 class UHConfMyStuffMySessions(URLHandler):
1751 _endpoint = 'event.myconference-mySessions'
1754 class UHConfMyStuffMyTracks(URLHandler):
1755 _endpoint = 'event.myconference-myTracks'
1758 class UHConfMyStuffMyContributions(URLHandler):
1759 _endpoint = 'event.myconference-myContributions'
1762 class UHConfModMoveContribsToSession(URLHandler):
1763 _endpoint = 'event_mgmt.confModifContribList-moveToSession'
1766 class UHConferenceDisplayMaterialPackage(URLHandler):
1767 _endpoint = 'event.conferenceDisplay-matPkg'
1770 class UHConferenceDisplayMaterialPackagePerform(URLHandler):
1771 _endpoint = 'event.conferenceDisplay-performMatPkg'
1774 class UHConfAbstractBook(URLHandler):
1775 _endpoint = 'event.conferenceDisplay-abstractBook'
1777 @classmethod
1778 def getStaticURL(cls, target=None, **params):
1779 return "files/generatedPdf/BookOfAbstracts.pdf"
1782 class UHConfAbstractBookLatex(URLHandler):
1783 _endpoint = 'event.conferenceDisplay-abstractBookLatex'
1786 class UHConferenceToiCal(URLHandler):
1787 _endpoint = 'event.conferenceDisplay-ical'
1790 class UHConfModAbstractBook(URLHandler):
1791 _endpoint = 'event_mgmt.confModBOA'
1794 class UHConfModAbstractBookToogleShowIds(URLHandler):
1795 _endpoint = 'event_mgmt.confModBOA-toogleShowIds'
1798 class UHAbstractReviewingSetup(URLHandler):
1799 _endpoint = 'event_mgmt.abstractReviewing-reviewingSetup'
1802 class UHAbstractReviewingTeam(URLHandler):
1803 _endpoint = 'event_mgmt.abstractReviewing-reviewingTeam'
1806 class UHConfModScheduleDataEdit(URLHandler):
1807 _endpoint = 'event_mgmt.confModifSchedule-edit'
1810 class UHConfModMaterialPackage(URLHandler):
1811 _endpoint = 'event_mgmt.confModifContribList-matPkg'
1814 class UHConfModProceedings(URLHandler):
1815 _endpoint = 'event_mgmt.confModifContribList-proceedings'
1818 class UHConfModFullMaterialPackage(URLHandler):
1819 _endpoint = 'event_mgmt.confModifTools-matPkg'
1822 class UHConfModFullMaterialPackagePerform(URLHandler):
1823 _endpoint = 'event_mgmt.confModifTools-performMatPkg'
1826 class UHUpdateNews(URLHandler):
1827 _endpoint = 'admin.updateNews'
1830 class UHMaintenance(URLHandler):
1831 _endpoint = 'admin.adminMaintenance'
1834 class UHMaintenanceTmpCleanup(URLHandler):
1835 _endpoint = 'admin.adminMaintenance-tmpCleanup'
1838 class UHMaintenancePerformTmpCleanup(URLHandler):
1839 _endpoint = 'admin.adminMaintenance-performTmpCleanup'
1842 class UHMaintenancePack(URLHandler):
1843 _endpoint = 'admin.adminMaintenance-pack'
1846 class UHMaintenancePerformPack(URLHandler):
1847 _endpoint = 'admin.adminMaintenance-performPack'
1850 class UHAdminLayoutGeneral(URLHandler):
1851 _endpoint = 'admin.adminLayout'
1854 class UHAdminLayoutSaveTemplateSet(URLHandler):
1855 _endpoint = 'admin.adminLayout-saveTemplateSet'
1858 class UHAdminLayoutSaveSocial(URLHandler):
1859 _endpoint = 'admin.adminLayout-saveSocial'
1862 class UHTemplatesSetDefaultPDFOptions(URLHandler):
1863 _endpoint = 'admin.adminLayout-setDefaultPDFOptions'
1866 class UHIPBasedACL(URLHandler):
1867 _endpoint = 'admin.adminServices-ipbasedacl'
1870 class UHIPBasedACLFullAccessGrant(URLHandler):
1871 _endpoint = 'admin.adminServices-ipbasedacl_fagrant'
1874 class UHIPBasedACLFullAccessRevoke(URLHandler):
1875 _endpoint = 'admin.adminServices-ipbasedacl_farevoke'
1878 class UHBadgeTemplates(URLHandler):
1879 _endpoint = 'admin.badgeTemplates'
1882 class UHPosterTemplates(URLHandler):
1883 _endpoint = 'admin.posterTemplates'
1886 class UHAnnouncement(URLHandler):
1887 _endpoint = 'admin.adminAnnouncement'
1890 class UHAnnouncementSave(URLHandler):
1891 _endpoint = 'admin.adminAnnouncement-save'
1894 class UHConfigUpcomingEvents(URLHandler):
1895 _endpoint = 'admin.adminUpcomingEvents'
1898 # ------- Static webpages ------
1900 class UHStaticConferenceDisplay(URLHandler):
1901 _relativeURL = "./index.html"
1904 class UHStaticMaterialDisplay(URLHandler):
1905 _relativeURL = "none-page-material.html"
1907 @classmethod
1908 def _normalisePathItem(cls, name):
1909 return str(name).translate(string.maketrans(" /:()*?<>|\"", "___________"))
1911 @classmethod
1912 def getRelativeURL(cls, target=None, escape=True):
1913 from MaKaC.conference import Contribution, Conference, Link, Video, Session
1915 if target is not None:
1916 if len(target.getResourceList()) == 1:
1917 res = target.getResourceList()[0]
1918 # TODO: Remove the "isinstance", it's just for CHEP04
1919 if isinstance(res, Link):# and not isinstance(target, Video):
1920 return res.getURL()
1921 else:
1922 return UHStaticResourceDisplay.getRelativeURL(res)
1923 else:
1924 contrib = target.getOwner()
1925 relativeURL = None
1926 if isinstance(contrib, Contribution):
1927 spk = ""
1928 if len(contrib.getSpeakerList()) > 0:
1929 spk = contrib.getSpeakerList()[0].getFamilyName().lower()
1930 contribDirName = "%s-%s" % (contrib.getId(), spk)
1931 relativeURL = "./%s-material-%s.html" % (contribDirName, cls._normalisePathItem(target.getId()))
1932 elif isinstance(contrib, Conference):
1933 relativeURL = "./material-%s.html" % cls._normalisePathItem(target.getId())
1934 elif isinstance(contrib, Session):
1935 relativeURL = "./material-s%s-%s.html" % (contrib.getId(), cls._normalisePathItem(target.getId()))
1937 if escape:
1938 relativeURL = utf8rep(relativeURL)
1940 return relativeURL
1941 return cls._relativeURL
1944 class UHStaticConfAbstractBook(URLHandler):
1945 _relativeURL = "./abstractBook.pdf"
1948 class UHStaticConferenceProgram(URLHandler):
1949 _relativeURL = "./programme.html"
1952 class UHStaticConferenceTimeTable(URLHandler):
1953 _relativeURL = "./timetable.html"
1956 class UHStaticContributionList(URLHandler):
1957 _relativeURL = "./contributionList.html"
1960 class UHStaticConfAuthorIndex(URLHandler):
1961 _relativeURL = "./authorIndex.html"
1964 class UHStaticContributionDisplay(URLHandler):
1965 _relativeURL = ""
1967 @classmethod
1968 def getRelativeURL(cls, target=None, prevPath=".", escape=True):
1969 url = cls._relativeURL
1970 if target is not None:
1971 spk = ""
1972 if len(target.getSpeakerList()) > 0:
1973 spk = target.getSpeakerList()[0].getFamilyName().lower()
1974 contribDirName = "%s-%s" % (target.getId(), spk)
1975 track = target.getTrack()
1976 if track is not None:
1977 url = "./%s/%s/%s.html" % (prevPath, track.getTitle().replace(" ", "_"), contribDirName)
1978 else:
1979 url = "./%s/other_contributions/%s.html" % (prevPath, contribDirName)
1981 if escape:
1982 url = utf8rep(url)
1984 return url
1987 class UHStaticSessionDisplay(URLHandler):
1988 _relativeURL = ""
1990 @classmethod
1991 def getRelativeURL(cls, target=None):
1992 return "./sessions/s%s.html" % target.getId()
1995 class UHStaticResourceDisplay(URLHandler):
1996 _relativeURL = "none-page-resource.html"
1998 @classmethod
1999 def _normalisePathItem(cls, name):
2000 return str(name).translate(string.maketrans(" /:()*?<>|\"", "___________"))
2002 @classmethod
2003 def getRelativeURL(cls, target=None, escape=True):
2004 from MaKaC.conference import Contribution, Conference, Video, Link, Session
2006 relativeURL = cls._relativeURL
2007 if target is not None:
2008 mat = target.getOwner()
2009 contrib = mat.getOwner()
2010 # TODO: Remove the first if...cos it's just for CHEP.
2011 # Remove as well in pages.conferences.WMaterialStaticDisplay
2012 #if isinstance(mat, Video) and isinstance(target, Link):
2013 # relativeURL = "./%s.rm"%os.path.splitext(os.path.basename(target.getURL()))[0]
2014 # return relativeURL
2015 if isinstance(contrib, Contribution):
2016 relativeURL = "./%s-%s-%s-%s" % (cls._normalisePathItem(contrib.getId()), target.getOwner().getId(),
2017 target.getId(), cls._normalisePathItem(target.getFileName()))
2018 elif isinstance(contrib, Conference):
2019 relativeURL = "./resource-%s-%s-%s" % (target.getOwner().getId(), target.getId(),
2020 cls._normalisePathItem(target.getFileName()))
2021 elif isinstance(contrib, Session):
2022 relativeURL = "./resource-s%s-%s-%s" % (contrib.getId(), target.getId(),
2023 cls._normalisePathItem(target.getFileName()))
2025 if escape:
2026 relativeURL = utf8rep(relativeURL)
2028 return relativeURL
2031 class UHStaticTrackContribList(URLHandler):
2032 _relativeURL = ""
2034 @classmethod
2035 def getRelativeURL(cls, target=None, escape=True):
2036 url = cls._relativeURL
2037 if target is not None:
2038 url = "%s.html" % (target.getTitle().replace(" ", "_"))
2040 if escape:
2041 url = utf8rep(url)
2042 return url
2045 class UHMStaticMaterialDisplay(URLHandler):
2046 _relativeURL = "none-page.html"
2048 @classmethod
2049 def _normalisePathItem(cls, name):
2050 return str(name).translate(string.maketrans(" /:()*?<>|\"", "___________"))
2052 @classmethod
2053 def getRelativeURL(cls, target=None, escape=True):
2054 from MaKaC.conference import Contribution, Link, Session, SubContribution
2056 if target is not None:
2057 if len(target.getResourceList()) == 1:
2058 res = target.getResourceList()[0]
2059 if isinstance(res, Link):
2060 return res.getURL()
2061 else:
2062 return UHMStaticResourceDisplay.getRelativeURL(res)
2063 else:
2064 owner = target.getOwner()
2065 parents = "./material"
2066 if isinstance(owner, Session):
2067 parents = "%s/session-%s-%s" % (parents, owner.getId(), cls._normalisePathItem(owner.getTitle()))
2068 elif isinstance(owner, Contribution):
2069 if isinstance(owner.getOwner(), Session):
2070 parents = "%s/session-%s-%s" % (parents, owner.getOwner().getId(),
2071 cls._normalisePathItem(owner.getOwner().getTitle()))
2072 spk = ""
2073 if len(owner.getSpeakerList()) > 0:
2074 spk = owner.getSpeakerList()[0].getFamilyName().lower()
2075 contribDirName = "%s-%s" % (owner.getId(), spk)
2076 parents = "%s/contrib-%s" % (parents, contribDirName)
2077 elif isinstance(owner, SubContribution):
2078 contrib = owner.getContribution()
2079 if isinstance(contrib.getOwner(), Session):
2080 parents = "%s/session-%s-%s" % (parents, contrib.getOwner().getId(),
2081 cls._normalisePathItem(contrib.getOwner().getTitle()))
2082 contribspk = ""
2083 if len(contrib.getSpeakerList()) > 0:
2084 contribspk = contrib.getSpeakerList()[0].getFamilyName().lower()
2085 contribDirName = "%s-%s" % (contrib.getId(), contribspk)
2086 subcontspk = ""
2087 if len(owner.getSpeakerList()) > 0:
2088 subcontspk = owner.getSpeakerList()[0].getFamilyName().lower()
2089 subcontribDirName = "%s-%s" % (owner.getId(), subcontspk)
2090 parents = "%s/contrib-%s/subcontrib-%s" % (parents, contribDirName, subcontribDirName)
2091 relativeURL = "%s/material-%s.html" % (parents, cls._normalisePathItem(target.getId()))
2093 if escape:
2094 relativeURL = utf8rep(relativeURL)
2095 return relativeURL
2096 return cls._relativeURL
2099 class UHMStaticResourceDisplay(URLHandler):
2100 _relativeURL = "none-page.html"
2102 @classmethod
2103 def _normalisePathItem(cls, name):
2104 return str(name).translate(string.maketrans(" /:()*?<>|\"", "___________"))
2106 @classmethod
2107 def getRelativeURL(cls, target=None, escape=True):
2108 from MaKaC.conference import Contribution, Session, SubContribution
2110 if target is not None:
2112 mat = target.getOwner()
2113 owner = mat.getOwner()
2114 parents = "./material"
2115 if isinstance(owner, Session):
2116 parents = "%s/session-%s-%s" % (parents, owner.getId(), cls._normalisePathItem(owner.getTitle()))
2117 elif isinstance(owner, Contribution):
2118 if isinstance(owner.getOwner(), Session):
2119 parents = "%s/session-%s-%s" % (parents, owner.getOwner().getId(),
2120 cls._normalisePathItem(owner.getOwner().getTitle()))
2121 spk = ""
2122 if len(owner.getSpeakerList()) > 0:
2123 spk = owner.getSpeakerList()[0].getFamilyName().lower()
2124 contribDirName = "%s-%s" % (owner.getId(), spk)
2125 parents = "%s/contrib-%s" % (parents, contribDirName)
2126 elif isinstance(owner, SubContribution):
2127 contrib = owner.getContribution()
2128 if isinstance(contrib.getOwner(), Session):
2129 parents = "%s/session-%s-%s" % (parents, contrib.getOwner().getId(),
2130 cls._normalisePathItem(contrib.getOwner().getTitle()))
2131 contribspk = ""
2132 if len(contrib.getSpeakerList()) > 0:
2133 contribspk = contrib.getSpeakerList()[0].getFamilyName().lower()
2134 contribDirName = "%s-%s" % (contrib.getId(), contribspk)
2135 subcontspk = ""
2136 if len(owner.getSpeakerList()) > 0:
2137 subcontspk = owner.getSpeakerList()[0].getFamilyName().lower()
2138 subcontribDirName = "%s-%s" % (owner.getId(), subcontspk)
2139 parents = "%s/contrib-%s/subcontrib-%s" % (parents, contribDirName, subcontribDirName)
2141 relativeURL = "%s/resource-%s-%s-%s" % (parents, cls._normalisePathItem(target.getOwner().getTitle()),
2142 target.getId(), cls._normalisePathItem(target.getFileName()))
2143 if escape:
2144 relativeURL = utf8rep(relativeURL)
2145 return relativeURL
2146 return cls._relativeURL
2149 # ------- END: Static webpages ------
2151 class UHContribAuthorDisplay(URLHandler):
2152 _endpoint = 'event.contribAuthorDisplay'
2154 @classmethod
2155 def getStaticURL(cls, target, **params):
2156 if target is not None:
2157 return "contribs-%s-authorDisplay-%s.html" % (target.getId(), params.get("authorId", ""))
2158 return cls._getURL()
2161 class UHConfTimeTableCustomizePDF(URLHandler):
2162 _endpoint = 'event.conferenceTimeTable-customizePdf'
2164 @classmethod
2165 def getStaticURL(cls, target, **params):
2166 return "files/generatedPdf/Conference.pdf"
2169 class UHConfRegistrationForm(URLHandler):
2170 _endpoint = 'event.confRegistrationFormDisplay'
2173 class UHConfRegistrationFormDisplay(URLHandler):
2174 _endpoint = 'event.confRegistrationFormDisplay-display'
2177 class UHConfRegistrationFormCreation(URLHandler):
2178 _endpoint = 'event.confRegistrationFormDisplay-creation'
2181 class UHConfRegistrationFormConditions(URLHandler):
2182 _endpoint = 'event.confRegistrationFormDisplay-conditions'
2185 class UHConfRegistrationFormCreationDone(URLHandler):
2186 _endpoint = 'event.confRegistrationFormDisplay-creationDone'
2188 @classmethod
2189 def getURL(cls, registrant):
2190 url = cls._getURL()
2191 if not session.user:
2192 url.setParams(registrant.getLocator())
2193 url.addParam('authkey', registrant.getRandomId())
2194 else:
2195 url.setParams(registrant.getConference().getLocator())
2196 return url
2199 class UHConferenceTicketPDF(URLHandler):
2200 _endpoint = 'event.e-ticket-pdf'
2202 @classmethod
2203 def getURL(cls, conf):
2204 url = cls._getURL()
2205 user = ContextManager.get("currentUser")
2206 if user:
2207 registrant = user.getRegistrantById(conf.getId())
2208 if registrant:
2209 url.setParams(registrant.getLocator())
2210 url.addParam('authkey', registrant.getRandomId())
2211 return url
2214 class UHConfRegistrationFormModify(URLHandler):
2215 _endpoint = 'event.confRegistrationFormDisplay-modify'
2218 class UHConfRegistrationFormPerformModify(URLHandler):
2219 _endpoint = 'event.confRegistrationFormDisplay-performModify'
2222 class UHConfModifRegForm(URLHandler):
2223 _endpoint = 'event_mgmt.confModifRegistrationForm'
2226 class UHConfModifRegFormChangeStatus(URLHandler):
2227 _endpoint = 'event_mgmt.confModifRegistrationForm-changeStatus'
2230 class UHConfModifRegFormDataModification(URLHandler):
2231 _endpoint = 'event_mgmt.confModifRegistrationForm-dataModif'
2234 class UHConfModifRegFormPerformDataModification(URLHandler):
2235 _endpoint = 'event_mgmt.confModifRegistrationForm-performDataModif'
2238 class UHConfModifRegFormActionStatuses(URLHandler):
2239 _endpoint = 'event_mgmt.confModifRegistrationForm-actionStatuses'
2242 class UHConfModifRegFormStatusModif(URLHandler):
2243 _endpoint = 'event_mgmt.confModifRegistrationForm-modifStatus'
2246 class UHConfModifRegFormStatusPerformModif(URLHandler):
2247 _endpoint = 'event_mgmt.confModifRegistrationForm-performModifStatus'
2250 class UHConfModifRegistrationModification(URLHandler):
2251 _endpoint = 'event_mgmt.confModifRegistrationModification'
2254 class UHConfModifRegistrationModificationSectionQuery(URLHandler):
2255 _endpoint = 'event_mgmt.confModifRegistrationModificationSection-query'
2258 class UHConfModifRegistrantList(URLHandler):
2259 _endpoint = 'event_mgmt.confModifRegistrants'
2262 class UHConfModifRegistrantNew(URLHandler):
2263 _endpoint = 'event_mgmt.confModifRegistrants-newRegistrant'
2266 class UHConfModifRegistrantListAction(URLHandler):
2267 _endpoint = 'event_mgmt.confModifRegistrants-action'
2270 class UHConfModifRegistrantPerformRemove(URLHandler):
2271 _endpoint = 'event_mgmt.confModifRegistrants-remove'
2274 class UHRegistrantModification(URLHandler):
2275 _endpoint = 'event_mgmt.confModifRegistrants-modification'
2278 class UHRegistrantAttachmentFileAccess(URLHandler):
2279 _endpoint = 'event_mgmt.confModifRegistrants-getAttachedFile'
2282 class UHCategoryStatistics(URLHandler):
2283 _endpoint = 'category.categoryStatistics'
2286 class UHCategoryToiCal(URLHandler):
2287 _endpoint = 'category.categoryDisplay-ical'
2290 class UHCategoryToRSS(URLHandler):
2291 _endpoint = 'category.categoryDisplay-rss'
2294 class UHCategoryToAtom(URLHandler):
2295 _endpoint = 'category.categoryDisplay-atom'
2298 class UHCategOverviewToRSS(URLHandler):
2299 _endpoint = 'category.categOverview-rss'
2302 class UHConfRegistrantsList(URLHandler):
2303 _endpoint = 'event.confRegistrantsDisplay-list'
2305 @classmethod
2306 def getStaticURL(cls, target, **params):
2307 return "confRegistrantsDisplay.html"
2310 class UHConfModifRegistrantSessionModify(URLHandler):
2311 _endpoint = 'event_mgmt.confModifRegistrants-modifySessions'
2314 class UHConfModifRegistrantSessionPeformModify(URLHandler):
2315 _endpoint = 'event_mgmt.confModifRegistrants-performModifySessions'
2318 class UHConfModifRegistrantAccoModify(URLHandler):
2319 _endpoint = 'event_mgmt.confModifRegistrants-modifyAccommodation'
2322 class UHConfModifRegistrantAccoPeformModify(URLHandler):
2323 _endpoint = 'event_mgmt.confModifRegistrants-performModifyAccommodation'
2326 class UHConfModifRegistrantSocialEventsModify(URLHandler):
2327 _endpoint = 'event_mgmt.confModifRegistrants-modifySocialEvents'
2330 class UHConfModifRegistrantSocialEventsPeformModify(URLHandler):
2331 _endpoint = 'event_mgmt.confModifRegistrants-performModifySocialEvents'
2334 class UHConfModifRegistrantReasonPartModify(URLHandler):
2335 _endpoint = 'event_mgmt.confModifRegistrants-modifyReasonParticipation'
2338 class UHConfModifRegistrantReasonPartPeformModify(URLHandler):
2339 _endpoint = 'event_mgmt.confModifRegistrants-performModifyReasonParticipation'
2342 class UHConfModifPendingQueues(URLHandler):
2343 _endpoint = 'event_mgmt.confModifPendingQueues'
2346 class UHConfModifPendingQueuesActionConfSubm(URLHandler):
2347 _endpoint = 'event_mgmt.confModifPendingQueues-actionConfSubmitters'
2350 class UHConfModifPendingQueuesActionConfMgr(URLHandler):
2351 _endpoint = 'event_mgmt.confModifPendingQueues-actionConfManagers'
2354 class UHConfModifPendingQueuesActionSubm(URLHandler):
2355 _endpoint = 'event_mgmt.confModifPendingQueues-actionSubmitters'
2358 class UHConfModifPendingQueuesActionMgr(URLHandler):
2359 _endpoint = 'event_mgmt.confModifPendingQueues-actionManagers'
2362 class UHConfModifPendingQueuesActionCoord(URLHandler):
2363 _endpoint = 'event_mgmt.confModifPendingQueues-actionCoordinators'
2366 class UHConfModifRegistrantMiscInfoModify(URLHandler):
2367 _endpoint = 'event_mgmt.confModifRegistrants-modifyMiscInfo'
2370 class UHConfModifRegistrantMiscInfoPerformModify(URLHandler):
2371 _endpoint = 'event_mgmt.confModifRegistrants-performModifyMiscInfo'
2374 class UHConfModifRegistrantStatusesModify(URLHandler):
2375 _endpoint = 'event_mgmt.confModifRegistrants-modifyStatuses'
2378 class UHConfModifRegistrantStatusesPerformModify(URLHandler):
2379 _endpoint = 'event_mgmt.confModifRegistrants-performModifyStatuses'
2382 class UHGetCalendarOverview(URLHandler):
2383 _endpoint = 'category.categOverview'
2386 class UHCategoryCalendarOverview(URLHandler):
2387 _endpoint = 'category.wcalendar'
2390 # URL Handlers for Printing and Design
2391 class UHConfModifBadgePrinting(URLHandler):
2392 _endpoint = "event_mgmt.confModifTools-badgePrinting"
2394 @classmethod
2395 def getURL(cls, target=None, templateId=None, deleteTemplateId=None, cancel=False, new=False, copyTemplateId=None):
2397 -The deleteTemplateId param should be set if we want to erase a template.
2398 -The copyTemplateId param should be set if we want to duplicate a template
2399 -The cancel param should be set to True if we return to this url
2400 after cancelling a template creation or edit (it is used to delete
2401 temporary template backgrounds).
2402 -The new param should be set to true if we return to this url
2403 after creating a new template.
2405 url = cls._getURL()
2406 if target is not None:
2407 if target.getId() == 'default':
2408 url = UHBadgeTemplatePrinting._getURL()
2409 url.setParams(target.getLocator())
2410 if templateId is not None:
2411 url.addParam("templateId", templateId)
2412 if deleteTemplateId is not None:
2413 url.addParam("deleteTemplateId", deleteTemplateId)
2414 if copyTemplateId is not None:
2415 url.addParam("copyTemplateId", copyTemplateId)
2416 if cancel:
2417 url.addParam("cancel", True)
2418 if new:
2419 url.addParam("new", True)
2420 return url
2423 class UHBadgeTemplatePrinting(URLHandler):
2424 _endpoint = 'admin.badgeTemplates-badgePrinting'
2427 class UHConfModifBadgeDesign(URLHandler):
2428 _endpoint = 'event_mgmt.confModifTools-badgeDesign'
2430 @classmethod
2431 def getURL(cls, target=None, templateId=None, new=False):
2433 -The templateId param should always be set:
2434 *if we are editing a template, it's the id of the template edited.
2435 *if we are creating a template, it's the id that the template will
2436 have after being stored for the first time.
2437 -The new param should be set to True if we are creating a new template.
2439 url = cls._getURL()
2440 if target is not None:
2441 if target.getId() == 'default':
2442 url = UHModifDefTemplateBadge._getURL()
2443 url.setParams(target.getLocator())
2444 if templateId is not None:
2445 url.addParam("templateId", templateId)
2446 url.addParam("new", new)
2447 return url
2450 class UHModifDefTemplateBadge(URLHandler):
2451 _endpoint = 'admin.badgeTemplates-badgeDesign'
2453 @classmethod
2454 def getURL(cls, target=None, templateId=None, new=False):
2456 -The templateId param should always be set:
2457 *if we are editing a template, it's the id of the template edited.
2458 *if we are creating a template, it's the id that the template will
2459 have after being stored for the first time.
2460 -The new param should be set to True if we are creating a new template.
2462 url = cls._getURL()
2463 if target is not None:
2464 url.setParams(target.getLocator())
2465 if templateId is not None:
2466 url.addParam("templateId", templateId)
2467 url.addParam("new", new)
2468 return url
2471 class UHConfModifBadgeSaveBackground(URLHandler):
2472 _endpoint = 'event_mgmt.confModifTools-badgeSaveBackground'
2474 @classmethod
2475 def getURL(cls, target=None, templateId=None):
2476 url = cls._getURL()
2477 if target is not None and templateId is not None:
2478 url.setParams(target.getLocator())
2479 url.addParam("templateId", templateId)
2480 return url
2483 class UHConfModifBadgeGetBackground(URLHandler):
2484 _endpoint = 'event_mgmt.confModifTools-badgeGetBackground'
2486 @classmethod
2487 def getURL(cls, target=None, templateId=None, backgroundId=None):
2488 url = cls._getURL()
2489 if target is not None and templateId is not None:
2490 url.setParams(target.getLocator())
2491 url.addParam("templateId", templateId)
2492 url.addParam("backgroundId", backgroundId)
2493 return url
2496 class UHConfModifBadgePrintingPDF(URLHandler):
2497 _endpoint = 'event_mgmt.confModifTools-badgePrintingPDF'
2500 # URL Handlers for Poster Printing and Design
2501 class UHConfModifPosterPrinting(URLHandler):
2502 _endpoint = 'event_mgmt.confModifTools-posterPrinting'
2504 @classmethod
2505 def getURL(cls, target=None, templateId=None, deleteTemplateId=None, cancel=False, new=False, copyTemplateId=None):
2507 -The deleteTemplateId param should be set if we want to erase a template.
2508 -The copyTemplateId param should be set if we want to duplicate a template
2509 -The cancel param should be set to True if we return to this url
2510 after cancelling a template creation or edit (it is used to delete
2511 temporary template backgrounds).
2512 -The new param should be set to true if we return to this url
2513 after creating a new template.
2515 url = cls._getURL()
2517 if target is not None:
2518 if target.getId() == 'default':
2519 url = UHPosterTemplatePrinting._getURL()
2520 url.setParams(target.getLocator())
2521 if templateId is not None:
2522 url.addParam("templateId", templateId)
2523 if deleteTemplateId is not None:
2524 url.addParam("deleteTemplateId", deleteTemplateId)
2525 if copyTemplateId is not None:
2526 url.addParam("copyTemplateId", copyTemplateId)
2527 if cancel:
2528 url.addParam("cancel", True)
2529 if new:
2530 url.addParam("new", True)
2531 return url
2534 class UHPosterTemplatePrinting(URLHandler):
2535 _endpoint = 'admin.posterTemplates-posterPrinting'
2538 class UHConfModifPosterDesign(URLHandler):
2539 _endpoint = 'event_mgmt.confModifTools-posterDesign'
2541 @classmethod
2542 def getURL(cls, target=None, templateId=None, new=False):
2544 -The templateId param should always be set:
2545 *if we are editing a template, it's the id of the template edited.
2546 *if we are creating a template, it's the id that the template will
2547 have after being stored for the first time.
2548 -The new param should be set to True if we are creating a new template.
2550 url = cls._getURL()
2551 if target is not None:
2552 if target.getId() == 'default':
2553 url = UHModifDefTemplatePoster._getURL()
2554 url.setParams(target.getLocator())
2555 if templateId is not None:
2556 url.addParam("templateId", templateId)
2557 url.addParam("new", new)
2558 return url
2561 class UHModifDefTemplatePoster(URLHandler):
2562 _endpoint = 'admin.posterTemplates-posterDesign'
2564 @classmethod
2565 def getURL(cls, target=None, templateId=None, new=False):
2567 -The templateId param should always be set:
2568 *if we are editing a template, it's the id of the template edited.
2569 *if we are creating a template, it's the id that the template will
2570 have after being stored for the first time.
2571 -The new param should be set to True if we are creating a new template.
2573 url = cls._getURL()
2574 if target is not None:
2575 url.setParams(target.getLocator())
2576 if templateId is not None:
2577 url.addParam("templateId", templateId)
2578 url.addParam("new", new)
2579 return url
2582 class UHConfModifPosterSaveBackground(URLHandler):
2583 _endpoint = 'event_mgmt.confModifTools-posterSaveBackground'
2585 @classmethod
2586 def getURL(cls, target=None, templateId=None):
2587 url = cls._getURL()
2588 if target is not None and templateId is not None:
2589 url.setParams(target.getLocator())
2590 url.addParam("templateId", templateId)
2591 return url
2594 class UHConfModifPosterGetBackground(URLHandler):
2595 _endpoint = 'event_mgmt.confModifTools-posterGetBackground'
2597 @classmethod
2598 def getURL(cls, target=None, templateId=None, backgroundId=None):
2599 url = cls._getURL()
2600 if target is not None and templateId is not None:
2601 url.setParams(target.getLocator())
2602 url.addParam("templateId", templateId)
2603 url.addParam("backgroundId", backgroundId)
2604 return url
2607 class UHConfModifPosterPrintingPDF(URLHandler):
2608 _endpoint = 'event_mgmt.confModifTools-posterPrintingPDF'
2611 ############
2612 #Evaluation# DISPLAY AREA
2613 ############
2615 class UHConfEvaluationMainInformation(URLHandler):
2616 _endpoint = 'event.confDisplayEvaluation'
2619 class UHConfEvaluationDisplay(URLHandler):
2620 _endpoint = 'event.confDisplayEvaluation-display'
2623 class UHConfEvaluationDisplayModif(URLHandler):
2624 _endpoint = 'event.confDisplayEvaluation-modif'
2627 class UHConfEvaluationSubmit(URLHandler):
2628 _endpoint = 'event.confDisplayEvaluation-submit'
2631 class UHConfEvaluationSubmitted(URLHandler):
2632 _endpoint = 'event.confDisplayEvaluation-submitted'
2635 ############
2636 #Evaluation# MANAGEMENT AREA
2637 ############
2638 class UHConfModifEvaluation(URLHandler):
2639 _endpoint = 'event_mgmt.confModifEvaluation'
2642 class UHConfModifEvaluationSetup(URLHandler):
2643 """same result as UHConfModifEvaluation."""
2644 _endpoint = 'event_mgmt.confModifEvaluation-setup'
2647 class UHConfModifEvaluationSetupChangeStatus(URLHandler):
2648 _endpoint = 'event_mgmt.confModifEvaluation-changeStatus'
2651 class UHConfModifEvaluationSetupSpecialAction(URLHandler):
2652 _endpoint = 'event_mgmt.confModifEvaluation-specialAction'
2655 class UHConfModifEvaluationDataModif(URLHandler):
2656 _endpoint = 'event_mgmt.confModifEvaluation-dataModif'
2659 class UHConfModifEvaluationPerformDataModif(URLHandler):
2660 _endpoint = 'event_mgmt.confModifEvaluation-performDataModif'
2663 class UHConfModifEvaluationEdit(URLHandler):
2664 _endpoint = 'event_mgmt.confModifEvaluation-edit'
2667 class UHConfModifEvaluationEditPerformChanges(URLHandler):
2668 _endpoint = 'event_mgmt.confModifEvaluation-editPerformChanges'
2671 class UHConfModifEvaluationPreview(URLHandler):
2672 _endpoint = 'event_mgmt.confModifEvaluation-preview'
2675 class UHConfModifEvaluationResults(URLHandler):
2676 _endpoint = 'event_mgmt.confModifEvaluation-results'
2679 class UHConfModifEvaluationResultsOptions(URLHandler):
2680 _endpoint = 'event_mgmt.confModifEvaluation-resultsOptions'
2683 class UHConfModifEvaluationResultsSubmittersActions(URLHandler):
2684 _endpoint = 'event_mgmt.confModifEvaluation-resultsSubmittersActions'
2687 class UHResetSession(URLHandler):
2688 _endpoint = 'misc.resetSessionTZ'
2691 ##############
2692 # Reviewing
2693 #############
2694 class UHConfModifReviewingAccess(URLHandler):
2695 _endpoint = 'event_mgmt.confModifReviewing-access'
2698 class UHConfModifReviewingPaperSetup(URLHandler):
2699 _endpoint = 'event_mgmt.confModifReviewing-paperSetup'
2702 class UHSetTemplate(URLHandler):
2703 _endpoint = 'event_mgmt.confModifReviewing-setTemplate'
2706 class UHDownloadContributionTemplate(URLHandler):
2707 _endpoint = 'event_mgmt.confModifReviewing-downloadTemplate'
2710 class UHConfModifReviewingControl(URLHandler):
2711 _endpoint = 'event_mgmt.confModifReviewingControl'
2714 class UHConfModifUserCompetences(URLHandler):
2715 _endpoint = 'event_mgmt.confModifUserCompetences'
2718 class UHConfModifListContribToJudge(URLHandler):
2719 _endpoint = 'event_mgmt.confListContribToJudge'
2722 class UHConfModifListContribToJudgeAsReviewer(URLHandler):
2723 _endpoint = 'event_mgmt.confListContribToJudge-asReviewer'
2726 class UHConfModifListContribToJudgeAsEditor(URLHandler):
2727 _endpoint = 'event_mgmt.confListContribToJudge-asEditor'
2730 class UHConfModifReviewingAssignContributionsList(URLHandler):
2731 _endpoint = 'event_mgmt.assignContributions'
2734 class UHConfModifReviewingDownloadAcceptedPapers(URLHandler):
2735 _endpoint = 'event_mgmt.assignContributions-downloadAcceptedPapers'
2738 #Contribution reviewing
2739 class UHContributionModifReviewing(URLHandler):
2740 _endpoint = 'event_mgmt.contributionReviewing'
2743 class UHContribModifReviewingMaterials(URLHandler):
2744 _endpoint = 'event_mgmt.contributionReviewing-contributionReviewingMaterials'
2747 class UHContributionReviewingJudgements(URLHandler):
2748 _endpoint = 'event_mgmt.contributionReviewing-contributionReviewingJudgements'
2751 class UHAssignReferee(URLHandler):
2752 _endpoint = 'event_mgmt.contributionReviewing-assignReferee'
2755 class UHRemoveAssignReferee(URLHandler):
2756 _endpoint = 'event_mgmt.contributionReviewing-removeAssignReferee'
2759 class UHAssignEditing(URLHandler):
2760 _endpoint = 'event_mgmt.contributionReviewing-assignEditing'
2763 class UHRemoveAssignEditing(URLHandler):
2764 _endpoint = 'event_mgmt.contributionReviewing-removeAssignEditing'
2767 class UHAssignReviewing(URLHandler):
2768 _endpoint = 'event_mgmt.contributionReviewing-assignReviewing'
2771 class UHRemoveAssignReviewing(URLHandler):
2772 _endpoint = 'event_mgmt.contributionReviewing-removeAssignReviewing'
2775 class UHContributionModifReviewingHistory(URLHandler):
2776 _endpoint = 'event_mgmt.contributionReviewing-reviewingHistory'
2779 class UHContributionEditingJudgement(URLHandler):
2780 _endpoint = 'event_mgmt.contributionEditingJudgement'
2783 class UHContributionGiveAdvice(URLHandler):
2784 _endpoint = 'event_mgmt.contributionGiveAdvice'
2787 class UHDownloadPRTemplate(URLHandler):
2788 _endpoint = 'event.paperReviewingDisplay-downloadTemplate'
2791 class UHUploadPaper(URLHandler):
2792 _endpoint = 'event.paperReviewingDisplay-uploadPaper'
2795 class UHPaperReviewingDisplay(URLHandler):
2796 _endpoint = 'event.paperReviewingDisplay'
2799 class UHContact(URLHandler):
2800 _endpoint = 'misc.contact'
2803 class UHHelper(object):
2804 """ Returns the display or modif UH for an object of a given class
2807 modifUHs = {
2808 "Category": UHCategoryModification,
2809 "Conference": UHConferenceModification,
2810 "DefaultConference": UHConferenceModification,
2811 "Contribution": UHContributionModification,
2812 "AcceptedContribution": UHContributionModification,
2813 "Session": UHSessionModification,
2814 "SubContribution": UHSubContributionModification,
2815 "Track": UHTrackModification,
2816 "Abstract": UHAbstractModify
2819 displayUHs = {
2820 "Category": UHCategoryDisplay,
2821 "CategoryMap": UHCategoryMap,
2822 "CategoryOverview": UHCategoryOverview,
2823 "CategoryStatistics": UHCategoryStatistics,
2824 "CategoryCalendar": UHCategoryCalendarOverview,
2825 "Conference": UHConferenceDisplay,
2826 "Contribution": UHContributionDisplay,
2827 "AcceptedContribution": UHContributionDisplay,
2828 "Session": UHSessionDisplay,
2829 "Abstract": UHAbstractDisplay
2832 @classmethod
2833 def getModifUH(cls, klazz):
2834 return cls.modifUHs.get(klazz.__name__, None)
2836 @classmethod
2837 def getDisplayUH(cls, klazz, type=""):
2838 return cls.displayUHs.get("%s%s" % (klazz.__name__, type), None)