--- cdli/cdli_files.py 2006/06/17 14:53:35 1.26 +++ cdli/cdli_files.py 2006/06/18 12:05:21 1.28 @@ -1054,7 +1054,7 @@ def manage_addCDLIBasketVersion(self,use else: return ob -class CDLIFileObject(versionedFileObject,CatalogAware): +class CDLIFileObject(CatalogAware,versionedFileObject): """CDLI file object""" meta_type="CDLI File Object" @@ -1065,18 +1065,27 @@ class CDLIFileObject(versionedFileObject security.declarePublic('makeThisVersionCurrent') + def PrincipiaSearchSource(self): + """Return cataloguable key for ourselves.""" + return str(self) + def makeThisVersionCurrent_html(self): """form for making this version current""" pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt','makeThisVersionCurrent.zpt')).__of__(self) return pt() - def makeThisVersionCurrent(self,comment,author): + def makeThisVersionCurrent(self,comment,author,RESPONSE=None): """copy this version to current""" parent=self.aq_parent newversion=parent.manage_addCDLIFileObject('',comment,author) newversion.data=self.data[0:] + + if RESPONSE is not None: + RESPONSE.redirect(self.aq_parent.absolute_url()+'/history') + + return True security.declarePublic('view') @@ -1657,15 +1666,15 @@ class CDLIRoot(Folder): return pt(txt='/uploadATF',threadName=threadName) else: -# tmp={} -# for key in self._v_uploadATF[threadName].returnValue.keys(): -# t=self._v_uploadATF[threadName].returnValue[key] -# if type(t) is ListType: -# tmp[key]=self._v_uploadATF[threadName].returnValue[key][0:] -# else: -# tmp[key]=self._v_uploadATF[threadName].returnValue[key] + tmp={} + for key in self._v_uploadATF[threadName].returnValue.keys(): + t=self._v_uploadATF[threadName].returnValue[key] + if type(t) is ListType: + tmp[key]=self._v_uploadATF[threadName].returnValue[key][0:] + else: + tmp[key]=self._v_uploadATF[threadName].returnValue[key] - tmp=self.cdli_main.tmpStore2[threadName] + #tmp=self.cdli_main.tmpStore2[threadName] del(self.cdli_main.tmpStore2[threadName]) self._v_uploadATF[threadName].continueVar=False self.REQUEST.SESSION['changed']=[x[0].getId() for x in tmp['changed']]