--- ImageArchive/ImageArchive.py 2006/05/16 10:28:08 1.81 +++ ImageArchive/ImageArchive.py 2006/05/16 15:56:18 1.82 @@ -1754,6 +1754,49 @@ class ImageCollectionMD(ImageCollection, except: pass + + def ImportFiles(self,RESPONSE=None): + """Import the existing files of a folder""" + files=os.listdir(self.ImageStoragePath) + ret="" + #print self.__dict__ + for file in files: + if not file[0]==".": + if self.__dict__.has_key(file): + + ret=ret+"
"+file+" already exists!" + else: + ret=ret+"
"+file+" created!" + newObj=ImageDigilib(file,file) + #print newObj,file + #print newObj + try: + self._setObject(file,newObj) + except: + """nothing yet""" + + + args={} + args['_table']=self.imageCollectionConfig.getTable() + args[self.imageCollectionConfig.getKey()]=file + + if not self.ZSQLInlineSearch(args): + self.ZSQLAdd(args) + #print ret + #pt=PageTemplateFile('Products/ImageArchive/out.zpt')).__of__(self) + #print self.ImageStoragePath + + #scale thumb + + + self.scaleThumbs() + + #scale standard + + self.scaleWorkingVersions() + + if RESPONSE: + RESPONSE.redirect('manage_main') def addImage(self): """Add an Image"""