--- OSAS/OSA_system/OSAS_show.py 2004/06/22 06:39:04 1.23 +++ OSAS/OSA_system/OSAS_show.py 2005/01/20 13:38:03 1.28 @@ -54,6 +54,7 @@ class OSAS_ShowOnline(SimpleItem): return hasMetafile(path) def getMetafile(self,path): + return getMetafile(path) def toggle_view(self,path,file): @@ -106,7 +107,9 @@ class OSAS_StoreOnline(SimpleItem): def rescaleThumbs(self,path): """rescale thumbs of images in path""" - os.popen("ssh archive@nausikaa2.rz-berlin.mpg.de /usr/local/mpiwg/scripts/scaleomat.pl %s /mpiwg/temp/online/scaled/thumb 90 --replace >> /tmp/sc.out &"% re.sub('/mpiwg/online/','',self.REQUEST['path'])) + dlpath = re.sub('/mpiwg/online/','',self.REQUEST['path']) + os.popen("ssh archive@nausikaa2.rz-berlin.mpg.de /usr/local/mpiwg/scripts/scaleomat -src=/mpiwg/online -dest=/mpiwg/temp/online/scaled/thumb -dir=%s -scaleto=90 -sync >> /tmp/sc.out &"%dlpath ) + #os.popen("ssh archive@nausikaa2.rz-berlin.mpg.de /usr/local/mpiwg/scripts/scaleomat.pl %s /mpiwg/temp/online/scaled/thumb 90 --replace >> /tmp/sc.out &"% re.sub('/mpiwg/online/','',self.REQUEST['path'])) self.REQUEST.SESSION['path']=self.REQUEST['path'] #return self.REQUEST.RESPONSE.redirect(self.REQUEST['URL1']) @@ -140,7 +143,8 @@ class OSAS_StoreOnline(SimpleItem): return hasMetafile(path) def getMetafile(self,path): - return getMetafile(path) + + return getMetafile(path).decode('utf-8') def toggle_view(self,path,file): """Oeffnen bzw. schließen der Subfolders""" @@ -159,6 +163,11 @@ class OSAS_StoreOnline(SimpleItem): """Test ob Eintrag ein Folder ist""" return isFullText(path,folder_name) + def isPdf(self,path,folder_name): + """Test ob Eintrag ein Folder mit pdf2 ist""" + return isPdf(path,folder_name) + + def isPresentation(self,path,folder_name): """Test ob Eintrag ein Folder ist""" return isPresentation(path,folder_name) @@ -193,7 +202,7 @@ class OSAS_StoreOnline(SimpleItem): """Editiere das Index Metafile""" try: dom=xml.dom.minidom.parse(path+"/index.meta") - indexmeta=dom.toxml() + indexmeta=dom.toxml(encoding='UTF-8') except: indexmeta="" @@ -956,7 +965,9 @@ def getBib(nodelist): if node.nodeType == node.ELEMENT_NODE: """nothing""" + rc = rc+""+str(node.nodeName)+": "+getText(node.childNodes)+"" + #print rc return rc+"" @@ -1015,7 +1026,7 @@ def getMetafile(path): # html=html.encode('utf-8','replace')+getBib(bib.childNodes).encode('utf-8','replace') - return html + return html.encode('utf-8') def hasMetafile(path): """get index.meta""" @@ -1073,6 +1084,20 @@ def isFullText(path,folder_name): return 0 +def isPdf(path,folder_name): + """check if foldername in path is full text""" + try: + dom=xml.dom.minidom.parse(path+"/index.meta") + for node in dom.getElementsByTagName("dir"): + + if getText(node.getElementsByTagName("content-type")[0].childNodes).lower()=="pdf": + + if getText(node.getElementsByTagName("name")[0].childNodes)==folder_name: + return 1 + return 0 + except: + + return 0 def isPresentation(path,folder_name): """check if foldername in path is full text"""