Diff for /OSAS/OSA_system/OSAS_show.py between versions 1.20 and 1.29

version 1.20, 2004/04/15 20:48:01 version 1.29, 2005/01/21 15:54:28
Line 54  class OSAS_ShowOnline(SimpleItem): Line 54  class OSAS_ShowOnline(SimpleItem):
         return hasMetafile(path)          return hasMetafile(path)
   
     def getMetafile(self,path):      def getMetafile(self,path):
         return getMetafile(path)          
           return getMetafile(path).decode('utf-8')
   
     def toggle_view(self,path,file):      def toggle_view(self,path,file):
         """Oeffnen bzw. schließen der Subfolders"""          """Oeffnen bzw. schließen der Subfolders"""
Line 106  class OSAS_StoreOnline(SimpleItem): Line 107  class OSAS_StoreOnline(SimpleItem):
     def rescaleThumbs(self,path):      def rescaleThumbs(self,path):
         """rescale thumbs of images in path"""          """rescale thumbs of images in path"""
   
         os.popen("ssh 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']          self.REQUEST.SESSION['path']=self.REQUEST['path']
         #return self.REQUEST.RESPONSE.redirect(self.REQUEST['URL1'])          #return self.REQUEST.RESPONSE.redirect(self.REQUEST['URL1'])
Line 140  class OSAS_StoreOnline(SimpleItem): Line 143  class OSAS_StoreOnline(SimpleItem):
         return hasMetafile(path)          return hasMetafile(path)
   
     def getMetafile(self,path):      def getMetafile(self,path):
         return getMetafile(path)          
           return getMetafile(path).decode('utf-8')
   
     def toggle_view(self,path,file):      def toggle_view(self,path,file):
         """Oeffnen bzw. schließen der Subfolders"""          """Oeffnen bzw. schließen der Subfolders"""
Line 159  class OSAS_StoreOnline(SimpleItem): Line 163  class OSAS_StoreOnline(SimpleItem):
         """Test ob Eintrag ein Folder ist"""          """Test ob Eintrag ein Folder ist"""
         return isFullText(path,folder_name)          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):      def isPresentation(self,path,folder_name):
         """Test ob Eintrag ein Folder ist"""          """Test ob Eintrag ein Folder ist"""
         return isPresentation(path,folder_name)          return isPresentation(path,folder_name)
Line 193  class OSAS_StoreOnline(SimpleItem): Line 202  class OSAS_StoreOnline(SimpleItem):
         """Editiere das Index Metafile"""          """Editiere das Index Metafile"""
         try:          try:
             dom=xml.dom.minidom.parse(path+"/index.meta")              dom=xml.dom.minidom.parse(path+"/index.meta")
             indexmeta=dom.toxml()              indexmeta=dom.toxml(encoding='UTF-8')
         except:          except:
             indexmeta=""              indexmeta=""
                           
Line 231  class OSAS_StoreOnline(SimpleItem): Line 240  class OSAS_StoreOnline(SimpleItem):
             node=dom.getElementsByTagName('texttool')[0] #getNode              node=dom.getElementsByTagName('texttool')[0] #getNode
             subnode=node.getElementsByTagName(name)[0]              subnode=node.getElementsByTagName(name)[0]
                           
               # bei text wird nur der Folder gebraucht
               if name=="text":
                   splitted=getText(subnode.childNodes).split("/")
                   return splitted[len(splitted)-2]
               else:
             return getText(subnode.childNodes)              return getText(subnode.childNodes)
         except:          except:
             return default              return default
                           
     def getProjects(self,obj_ids=None):      def getViewerTemplateSets(self,obj_ids=None):
         """Get the Project title for configuration"""          """Get the ViewerTemplateSet title for configuration"""
         ret=[]          ret=[]
                   
         try:          try:
             projects=self.ZopeFind(self.projects,obj_metatypes=['OSAS_project'],obj_ids=obj_ids)#assumes projects folder somewhere in the hierarchie.              viewerTemplateSets=self.ZopeFind(self.viewerTemplateSets,obj_metatypes=['OSAS_viewerTemplateSet'],obj_ids=obj_ids)#assumes viewerTemplateSets folder somewhere in the hierarchie.
                           
             for project in projects:              for viewerTemplateSet in viewerTemplateSets:
                 ret.append((project[1].title,project[0],project[1]))                  ret.append((viewerTemplateSet[1].title,viewerTemplateSet[0],viewerTemplateSet[1]))
                           
             return ret              return ret
                   
         except:          except:
             return [('no Projectfolders','')]              return [('no ViewerTemplateSetfolders','')]
   
     def changeTemplatesForm(self,path):      def changeTemplatesForm(self,path):
         """changeform"""          """changeform"""
Line 258  class OSAS_StoreOnline(SimpleItem): Line 272  class OSAS_StoreOnline(SimpleItem):
   
                   
   
     def changeTemplates(self,path):      def changeTemplates(self,path,RESPONSE=None):
         """Andere alle Eintraege in index.meta"""          """Andere alle Eintraege in index.meta"""
         #os.path.walk(path,OSAS_helpers.changeIndexMeta,startpage,xslt,thumbtemplate,topbar,digiLibTemplate)  
         print self.REQUEST.form  
   
   
         os.path.walk(path,OSAS_helpers.changeIndexMeta,self.REQUEST.form)          os.path.walk(path,OSAS_helpers.changeIndexMeta,self.REQUEST.form)
       if RESPONSE is not None:
               RESPONSE.redirect(self.REQUEST['URL1']+"?path="+self.REQUEST.SESSION['path'])
                   
                   
 InitializeClass(OSAS_StoreOnline)  InitializeClass(OSAS_StoreOnline)
Line 953  def getBib(nodelist): Line 965  def getBib(nodelist):
                   
         if node.nodeType == node.ELEMENT_NODE:          if node.nodeType == node.ELEMENT_NODE:
        """nothing"""         """nothing"""
              
        rc = rc+"<tr><td valign='right'>"+str(node.nodeName)+":</td><td> "+getText(node.childNodes)+"</td></tr>"         rc = rc+"<tr><td valign='right'>"+str(node.nodeName)+":</td><td> "+getText(node.childNodes)+"</td></tr>"
              
     #print rc      #print rc
     return rc+"</table>"      return rc+"</table>"
   
Line 1012  def getMetafile(path): Line 1026  def getMetafile(path):
                 
 #        html=html.encode('utf-8','replace')+getBib(bib.childNodes).encode('utf-8','replace')  #        html=html.encode('utf-8','replace')+getBib(bib.childNodes).encode('utf-8','replace')
                 
        return html         return html.encode('utf-8')
   
 def hasMetafile(path):  def hasMetafile(path):
     """get index.meta"""      """get index.meta"""
Line 1070  def isFullText(path,folder_name): Line 1084  def isFullText(path,folder_name):
                           
             return 0              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):  def isPresentation(path,folder_name):
       """check if foldername in path is full text"""        """check if foldername in path is full text"""

Removed from v.1.20  
changed lines
  Added in v.1.29


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>