--- OSAS/OSA_system/OSAS_add.py 2004/03/01 17:44:29 1.11 +++ OSAS/OSA_system/OSAS_add.py 2004/03/03 13:02:54 1.12 @@ -9,6 +9,7 @@ from Products.PageTemplates.PageTemplate import string import urllib import xml.dom.minidom +from time import localtime,strftime #referencetypes=['Book','Bic','Journal Article','Manuscript','jiji'] @@ -19,7 +20,7 @@ def add(self, no_upload=0): self.referencetypes=['Book','Journal Article','Manuscript'] - newtemplate=PageTemplateFile('Products/OSA_system/OSAS_add_new').__of__(self) + newtemplate=PageTemplateFile('Products/OSA_system/zpt/OSAS_add_new').__of__(self) self.REQUEST.SESSION['path']=self.REQUEST['path'] if no_upload==0: self.REQUEST.SESSION['no_upload']='yes' @@ -64,7 +65,7 @@ def add2(self): #sorted=listed.sort() #print sorted - newtemplate=PageTemplateFile('Products/OSA_system/OSAS_add_bibdata').__of__(self) + newtemplate=PageTemplateFile('Products/OSA_system/zpt/OSAS_add_bibdata').__of__(self) return newtemplate() #return self.fields @@ -104,7 +105,7 @@ def add3(self): self.REQUEST.SESSION['folder_name']=self.REQUEST.SESSION['path'] return add5(self) else: - newtemplate=PageTemplateFile('Products/OSA_system/OSAS_add_naming').__of__(self) + newtemplate=PageTemplateFile('Products/OSA_system/zpt/OSAS_add_naming').__of__(self) return newtemplate() @@ -118,12 +119,12 @@ def add4(self): self.REQUEST.SESSION['folder_name']=self.folder_name self.image_folder_name="pageimg" - newtemplate=PageTemplateFile('Products/OSA_system/OSAS_upload').__of__(self) + newtemplate=PageTemplateFile('Products/OSA_system/zpt/OSAS_upload').__of__(self) return newtemplate() def add5(self): """ADD INDEX.META""" - newtemplate=PageTemplateFile('Products/OSA_system/OSAS_add_metadata').__of__(self) + newtemplate=PageTemplateFile('Products/OSA_system/zpt/OSAS_add_metadata').__of__(self) return newtemplate() def add6(self): @@ -140,7 +141,7 @@ def add6(self): for tag in self.metadata.keys(): self.metadataprint=self.metadataprint+"<"+tag+">"+self.metadata[tag]+"\n" - newtemplate=PageTemplateFile('Products/OSA_system/index_meta').__of__(self) + newtemplate=PageTemplateFile('Products/OSA_system/zpt/index_meta').__of__(self) newtemplate.content_type="text/plain" renderxml = newtemplate() if self.REQUEST.SESSION.has_key('no_upload'): @@ -160,7 +161,7 @@ def add6(self): else: #print self.add_metadata['archive-path'] self.viewpath=re.search(r"/mpiwg/online/(.*)",self.add_metadata['archive-path']).group(1) - newtemplate2=PageTemplateFile('Products/OSA_system/OSAS_saved').__of__(self) + newtemplate2=PageTemplateFile('Products/OSA_system/zpt/OSAS_saved').__of__(self) newtemplate2.content_type="text/html" @@ -170,7 +171,7 @@ def add6(self): return newtemplate2() -from time import localtime,strftime + def date(self): return strftime("%d.%m.%Y",localtime()) @@ -210,7 +211,7 @@ def addPresentation(self,path): yes """%(author,title,date) - newtemplate=PageTemplateFile('Products/OSA_system/addPresentation').__of__(self) + newtemplate=PageTemplateFile('Products/OSA_system/zpt/addPresentation').__of__(self) return newtemplate() def addPresentation2(self): @@ -249,7 +250,7 @@ def addText(self,path): """add fulltext to the path""" self.REQUEST.SESSION['existing_names']=['pageimg'] # to be done generate list of existing text files self.REQUEST.SESSION['path']=path - newtemplate=PageTemplateFile('Products/OSA_system/addText').__of__(self) + newtemplate=PageTemplateFile('Products/OSA_system/zpt/addText').__of__(self) return newtemplate() def addText2(self): @@ -373,7 +374,7 @@ def addImages(self,path): """Imagesfolder to the path""" self.REQUEST.SESSION['existing_names']=['pageimg'] # to be done generate list of existing pageimages files self.REQUEST.SESSION['path']=path - newtemplate=PageTemplateFile('Products/OSA_system/OSAS_addImages').__of__(self) + newtemplate=PageTemplateFile('Products/OSA_system/zpt/OSAS_addImages').__of__(self) return newtemplate() def addImages2(self): @@ -387,7 +388,7 @@ def addImages2(self): self.content_type='images' addDirsToIndexMeta(self.REQUEST.SESSION['path'],self.image_folder_name,self.content_description,self.content_type) self.REQUEST.SESSION['path']=re.search(r"/mpiwg(.*)",self.REQUEST.SESSION['path']).group(1) - newtemplate=PageTemplateFile('Products/OSA_system/OSAS_upload2').__of__(self) + newtemplate=PageTemplateFile('Products/OSA_system/zpt/OSAS_upload2').__of__(self) return newtemplate() @@ -440,6 +441,7 @@ def readArchimedesXML(folder): return dict[folder] else: return "" + def combineTextImage(self,path): """gibt input formular zur erstellung des texttools meta tag aus""" files = os.listdir(path)