--- OSAS/OSA_system/OSAS_add.py 2003/10/05 18:16:19 1.2 +++ OSAS/OSA_system/OSAS_add.py 2003/10/11 10:54:13 1.4 @@ -19,7 +19,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/OSAS_add_new').__of__(self) self.REQUEST.SESSION['path']=self.REQUEST['path'] if no_upload==0: self.REQUEST.SESSION['no_upload']='yes' @@ -33,7 +33,7 @@ def add(self, no_upload=0): def getISO(): - f=file('/Users/dwinter/Documents/Projekte/OSAS/OSA_system/iso639-1.inc','r').readlines() + f=file('/usr/local/mpiwg/Zope/lib/python/Products/OSA_system/iso639-1.inc','r').readlines() ret={} for lineraw in f: line=lineraw.encode('ascii','replace') @@ -57,7 +57,7 @@ def add2(self): #sorted=listed.sort() #print sorted - newtemplate=PageTemplateFile('products/OSA_system/OSAS_add_bibdata').__of__(self) + newtemplate=PageTemplateFile('Products/OSA_system/OSAS_add_bibdata').__of__(self) return newtemplate() #return self.fields @@ -97,7 +97,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/OSAS_add_naming').__of__(self) return newtemplate() @@ -111,12 +111,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/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/OSAS_add_metadata').__of__(self) return newtemplate() def add6(self): @@ -133,7 +133,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/index_meta').__of__(self) newtemplate.content_type="text/plain" renderxml = newtemplate() if self.REQUEST.SESSION.has_key('no_upload'): @@ -152,7 +152,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/OSAS_saved').__of__(self) newtemplate2.content_type="text/html" @@ -172,7 +172,8 @@ def addPresentation(self,path): """add presentation to the path""" dom=xml.dom.minidom.parse(path+"/index.meta") - + + try: author=archive.getText(dom.getElementsByTagName('author')[0].childNodes) except: @@ -197,7 +198,7 @@ def addPresentation(self,path): yes """%(author,title,date) - newtemplate=PageTemplateFile('products/OSA_system/addPresentation').__of__(self) + newtemplate=PageTemplateFile('Products/OSA_system/addPresentation').__of__(self) return newtemplate() def addPresentation2(self): @@ -236,7 +237,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/addText').__of__(self) return newtemplate() def addText2(self): @@ -360,7 +361,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/OSAS_addImages').__of__(self) return newtemplate() def addImages2(self): @@ -374,7 +375,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/OSAS_upload2').__of__(self) return newtemplate() @@ -436,7 +437,7 @@ def combineTextImage(self,path): self.REQUEST.SESSION['imagefolders']=imagefolders self.REQUEST.SESSION['presentationfolders']=presentationfolders self.REQUEST.SESSION['filelanguage']=filelanguage - newtemplate=PageTemplateFile('products/OSA_system/ImageandText').__of__(self) + newtemplate=PageTemplateFile('Products/OSA_system/ImageandText').__of__(self) return newtemplate() @@ -501,5 +502,6 @@ def combineTextImage2(self,path): urllib.urlopen("http://nausikaa2.rz-berlin.mpg.de:86/cgi-bin/toc/admin/reg.cgi?path=%s"%path).readlines() #return urllib.quote("http://nausikaa2.rz-berlin.mpg.de:86/cgi-bin/toc/admin/reg.cgi?path=%s"%path) os.popen("ssh nausikaa2.rz-berlin.mpg.de /usr/local/mpiwg/scripts/scaleomat.pl %s /mpiwg/temp/online/scaled/thumb 90 &"% re.sub('mpiwg/online/','',self.REQUEST['path']+"/"+self.REQUEST['image'])) - return self.REQUEST.RESPONSE.redirect(self.REQUEST['URL2']+'?path='+self.REQUEST['path']) + + #return self.REQUEST.RESPONSE.redirect(self.REQUEST['URL2']+'?path='+self.REQUEST['path'])