Changeset 31a202 in indico
- Timestamp:
- 06/10/10 18:11:34 (3 years ago)
- Branches:
- master, burotel, hello-world-walkthrough, ipv6, new-webex, v0.97-series, v0.98-series, v0.98.2, v0.98.3, v0.98b1, v0.98b2, v0.99, 051b2622c51afb171a1dedb46a0df4fbb0cbd02e, 0da0c1403bae8e51d8229f460181c71b9e6dda72
- Children:
- 5f80ed
- Parents:
- 04afe9
- git-author:
- Jeremy Herr <jeremy.herr@…> (04/06/10 16:09:23)
- git-committer:
- Jeremy Herr <jeremy.herr@…> (06/10/10 18:11:34)
- Location:
- indico/MaKaC/plugins/Collaboration/RecordingManager
- Files:
-
- 4 edited
-
common.py (modified) (8 diffs)
-
options.py (modified) (1 diff)
-
services.py (modified) (4 diffs)
-
tpls/Extra.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
indico/MaKaC/plugins/Collaboration/RecordingManager/common.py
r444cd19 r31a202 37 37 from MaKaC.common.output import outputGenerator, XSLTransformer 38 38 from MaKaC.conference import Link 39 from MaKaC import conference 39 40 40 41 from urllib2 import Request, urlopen … … 268 269 if mE: 269 270 Logger.get('RecMan').info("searched %s, matched %s" % (IndicoID, 'conference')) 271 conference = ConferenceHolder().getById(mE.group(1)) 270 272 return {'type': 'conference', 273 'object': conference, 271 274 'conference': mE.group(1), 272 275 'session': '', … … 275 278 elif mS: 276 279 Logger.get('RecMan').info("searched %s, matched %s" % (IndicoID, 'session')) 280 conference = ConferenceHolder().getById(mS.group(1)) 277 281 return {'type': 'session', 282 'object': conference.getSessionById(mS.group(2)), 278 283 'conference': mS.group(1), 279 284 'session': mS.group(2), … … 282 287 elif mC: 283 288 Logger.get('RecMan').info("searched %s, matched %s" % (IndicoID, 'contribution')) 289 conference = ConferenceHolder().getById(mC.group(1)) 284 290 return {'type': 'contribution', 291 'object': conference.getContributionById(mC.group(2)), 285 292 'conference': mC.group(1), 286 293 'session': '', … … 289 296 elif mSC: 290 297 Logger.get('RecMan').info("searched %s, matched %s" % (IndicoID, 'subcontribution')) 298 conference = ConferenceHolder().getById(mSC.group(1)) 299 contribution = conference.getContributionById(mSC.group(2)) 291 300 return {'type': 'subcontribution', 301 'object': contribution.getSubContributionById(mSC.group(3)), 292 302 'conference': mSC.group(1), 293 303 'session': '', … … 384 394 '''Retrieve a MARC XML string for the given conference, then package it up and send it to CDS.''' 385 395 386 # I don't understand what some of the following lines do. Pedro did some of it for me.396 # Incantation to initialize XML that I don't fully understand 387 397 xmlGen = XMLGen() 388 398 xmlGen.initXml() … … 392 402 og = outputGenerator(aw, xmlGen) 393 403 394 # Generate XML tag to enclose the entire conference404 # Generate XML event tag to enclose the entire conference 395 405 xmlGen.openTag("event") 396 406 … … 559 569 return results 560 570 561 def createIndicoLink(IndicoID ):571 def createIndicoLink(IndicoID, CDSID): 562 572 """Create a link in Indico to the CDS record.""" 563 573 564 eventInfo = parseIndicoID(IndicoID) 574 Logger.get('RecMan').info("in createIndicoLink()") 575 # From IndicoID, get info 576 talkInfo = parseIndicoID(IndicoID) 577 obj = talkInfo["object"] 578 579 # Only one link per talk allowed. 580 if doesExistIndicoLink(obj): 581 pass 582 else: 583 Logger.get('RecMan').info("trying to create new link in Indico") 584 585 # material object holds link object. 586 # First create a material object with title "Video in CDS" or whatever the current text is. 587 material = conference.Material() 588 material.setTitle(CollaborationTools.getOptionValue("RecordingManager", "videoLinkName")) 589 590 videoLink = Link() 591 videoLink.setOwner(material) 592 videoLink.setName("Name goes here") 593 videoLink.setDescription("Description goes here") 594 videoLink.setURL(CollaborationTools.getOptionValue("RecordingManager", "CDSBaseURL") % str(CDSID)) 595 material.addResource(videoLink) 596 obj.addMaterial(material) 565 597 566 598 -
indico/MaKaC/plugins/Collaboration/RecordingManager/options.py
r444cd19 r31a202 95 95 "visible": True} ), 96 96 97 ("CDSBaseURL", {"description" : _("Base URL for CDS record"), 98 "type": str, 99 "defaultValue": "http://cdsweb.cern.ch/record/%s", 100 "editable": True, 101 "visible": True} ), 102 97 103 ("videoLinkName", {"description" : _("Name of Indico link to CDS"), 98 104 "type": str, 99 105 "defaultValue": "Video in CDS", 106 "editable": True, 107 "visible": True} ), 108 109 # need to look over this again: 110 ("mediaArchiveFormatPlainVideo", {"description" : _("Format of plain video filename"), 111 "type": str, 112 "defaultValue": "http://mediaarchive.cern.ch/MediaArchive/Video/Public2/WebLectures/%s/%s", 113 "editable": True, 114 "visible": True} ), 115 116 # need to look over this again: 117 ("mediaArchiveFormatWebLecture", {"description" : _("Format of web lecture filename"), 118 "type": str, 119 "defaultValue": "http://mediaarchive.cern.ch/MediaArchive/Video/Public2/WebLectures/%s/%s", 100 120 "editable": True, 101 121 "visible": True} ), -
indico/MaKaC/plugins/Collaboration/RecordingManager/services.py
r3e6afb r31a202 21 21 22 22 from MaKaC.services.implementation.collaboration import CollaborationPluginServiceBase 23 from MaKaC.plugins.Collaboration.RecordingRequest.common import getTalks24 23 from MaKaC.plugins.Collaboration.RecordingManager.common import RecordingManagerException,\ 25 updateMicala, createCDSRecord 24 updateMicala, createCDSRecord, createIndicoLink 26 25 27 26 … … 47 46 def _checkParams(self): 48 47 CollaborationPluginServiceBase._checkParams(self) #puts the Conference in self._conf 49 self._IndicoID = self._params.get('IndicoID', None)50 self._LOID = self._params.get('LOID', None)51 self._confId = self._params.get('conference', None)48 self._IndicoID = self._params.get('IndicoID', None) 49 self._LOID = self._params.get('LOID', None) 50 self._confId = self._params.get('conference', None) 52 51 self._videoFormat = self._params.get('videoFormat', None) 53 52 self._contentType = self._params.get('contentType', None) … … 88 87 def _checkParams(self): 89 88 CollaborationPluginServiceBase._checkParams(self) #puts the Conference in self._conf 90 self._IndicoID = self._params.get('IndicoID', None)91 self._LOID = self._params.get('LOID', None)89 self._IndicoID = self._params.get('IndicoID', None) 90 self._LOID = self._params.get('LOID', None) 92 91 self._confId = self._params.get('conference', None) 93 92 94 93 if not self._IndicoID: 95 94 raise RecordingManagerException("No IndicoID supplied") 96 if not self._LOID:97 raise RecordingManagerException("No LOID supplied")98 95 if not self._confId: 99 96 raise RecordingManagerException("No conference ID supplied") … … 101 98 def _getAnswer(self): 102 99 # Create the Indico link 103 resultCreateIndicoLink = createIndicoLink(self._IndicoID )100 resultCreateIndicoLink = createIndicoLink(self._IndicoID, "12345") 104 101 105 102 return str(resultCreateIndicoLink) -
indico/MaKaC/plugins/Collaboration/RecordingManager/tpls/Extra.js
r3e6afb r31a202 101 101 102 102 // following added by jherr - I just copied and modified RRUpdateContributionList 103 var ButtonCreateIndicoLink = new DisabledButton(Html.input("button", {disabled:true}, $T("Create Indico Link"))); 104 var ButtonCreateCDSRecord = new DisabledButton(Html.input("button", {disabled:true}, $T("Create CDS Record"))); 105 103 106 var REUpdateOrphanList = function () { 104 107 if (RE_orphans.length > 0) { … … 113 116 } 114 117 115 116 var ButtonCreateIndicoLink = new DisabledButton(Html.input("button", {disabled:true}, $T("Create Indico Link")));117 var ButtonCreateCDSRecord = new DisabledButton(Html.input("button", {disabled:true}, $T("Create CDS Record")));118 119 118 ButtonCreateCDSRecord.observeClick(function(){ 120 119 if (ButtonCreateCDSRecord.isEnabled()) { … … 142 141 143 142 ButtonCreateIndicoLink.observeClick(function(){ 144 if ( !ButtonCreateIndicoLink.isEnabled()) {143 if (ButtonCreateIndicoLink.isEnabled()) { 145 144 if (typeof RMselectedTalkId != 'undefined' && RMselectedTalkId != '' && 146 145 (RMviewMode == 'plain_video' ||
Note: See TracChangeset
for help on using the changeset viewer.
