def _doValidate(self): #First, one must validate that the information is fine errors = self._abstractData.check() if errors: p = abstracts.WPAbstractModify(self, self._target) pars = self._abstractData.toDict() pars["errors"] = errors pars["action"] = self._action return p.display(**pars) #Then, we create the abstract object and set its data to the one # received self._abstract.setTitle(self._abstractData.title) afm = self._conf.getAbstractMgr().getAbstractFieldsMgr() for f in afm.getFields(): id = f.getId() self._abstract.setField(id, self._abstractData.getFieldValue(id)) self._abstract.clearAuthors() #for authData in self._abstractData.authors.getList(): # auth = self._abstract.newAuthor( title = authData["auth_title"], \ # firstName = authData["auth_firstName"], \ # surName = authData["auth_surName"], \ # email = authData["auth_email"], \ # affiliation = authData["auth_affiliation"], \ # address = authData["auth_address"], \ # telephone = authData["auth_phone"] ) # if authData["auth_speaker"]: # self._abstract.addSpeaker( auth ) # if authData["auth_primary"]: # self._abstract.addPrimaryAuthor( auth ) for authData in self._abstractData.authors.getPrimaryList(): auth=self._abstract.newPrimaryAuthor(title=authData["auth_title"], \ firstName = authData["auth_firstName"], \ surName = authData["auth_surName"], \ email = authData["auth_email"], \ affiliation = authData["auth_affiliation"], \ address = authData["auth_address"], \ telephone = authData["auth_phone"] ) if authData["auth_speaker"]: self._abstract.addSpeaker(auth) for authData in self._abstractData.authors.getSecondaryList(): auth=self._abstract.newCoAuthor(title=authData["auth_title"], \ firstName = authData["auth_firstName"], \ surName = authData["auth_surName"], \ email = authData["auth_email"], \ affiliation = authData["auth_affiliation"], \ address = authData["auth_address"], \ telephone = authData["auth_phone"] ) if authData["auth_speaker"]: self._abstract.addSpeaker(auth) self._abstract.setContribType(self._abstractData.type) #self._abstract.clearTracks() tracks = [] for trackId in self._abstractData.tracks: tracks.append(self._conf.getTrackById(trackId)) self._abstract.setTracks(tracks) self._abstract.setComments(self._abstractData.comments) #We must perform some actions: email warning to the authors #Finally, we display a confirmation form self._redirect(urlHandlers.UHAbstractDisplay.getURL(self._abstract))
def _doValidate(self): #First, one must validate that the information is fine errors = self._abstractData.check() if errors: p = abstracts.WPAbstractModify(self, self._target) pars = self._abstractData.toDict() pars["action"] = self._action # restart the current value of the param attachments to show the existing files pars["attachments"] = self._abstract.getAttachments().values() return p.display(**pars) self._abstract.clearAuthors() self._abstractData.setAbstractData(self._abstract) self._redirect(urlHandlers.UHAbstractDisplay.getURL(self._abstract))
def _processIfOpened( self ): #check if the modification period is not over or if the abstract # is in a different status than Submitted if not self._conf.getAbstractMgr().inModificationPeriod() or \ not isinstance( self._abstract.getCurrentStatus(), \ AbstractStatusSubmitted ): wp = abstracts.WPAbstractCannotBeModified( self, self._abstract ) return wp.display() if self._action == "CANCEL": self._redirect( urlHandlers.UHAbstractDisplay.getURL( self._abstract ) ) elif self._action == "VALIDATE": return self._doValidate() else: p = abstracts.WPAbstractModify( self, self._target ) pars = self._abstractData.toDict() pars["action"] = self._action return p.display( **pars )