Diff for /OSAS/OSA_system/OSAS_add.py between versions 1.24 and 1.31

version 1.24, 2004/04/15 09:45:29 version 1.31, 2004/06/23 05:36:08
Line 67  def add2(self): Line 67  def add2(self):
     self.bibdata={}      self.bibdata={}
     for referenceType in self.referencetypes:      for referenceType in self.referencetypes:
         #print referenceType          #print referenceType
           if referenceType[1].title == self.reftype: 
         self.bibdata[referenceType[1].title]=referenceType[1].fields          self.bibdata[referenceType[1].title]=referenceType[1].fields
         self.bibdata['data']=referenceType[1]          self.bibdata['data']=referenceType[1]
     self.fields=self.bibdata[self.reftype]      self.fields=self.bibdata[self.reftype]
Line 143  def add4(self): Line 144  def add4(self):
     self.REQUEST.SESSION['folder_name']=self.folder_name      self.REQUEST.SESSION['folder_name']=self.folder_name
     if self.REQUEST['submit']=="upload images":      if self.REQUEST['submit']=="upload images":
         self.REQUEST.SESSION['path']=os.path.join(self.REQUEST.SESSION['path'],self.REQUEST['folder_name'])          self.REQUEST.SESSION['path']=os.path.join(self.REQUEST.SESSION['path'],self.REQUEST['folder_name'])
           
   
           try:    
               os.mkdir(self.REQUEST.SESSION['path'])
               os.chmod(self.REQUEST.SESSION['path'],0774)
           except:
               """nothing"""
   
         self.image_folder_name="pageimg"          self.image_folder_name="pageimg"
         newtemplate=PageTemplateFile('Products/OSA_system/zpt/OSAS_upload').__of__(self)          newtemplate=PageTemplateFile('Products/OSA_system/zpt/OSAS_upload').__of__(self)
         return newtemplate()          return newtemplate()
Line 191  def add6(self): Line 200  def add6(self):
     else:      else:
                 #print self.add_metadata['archive-path']                  #print self.add_metadata['archive-path']
         self.viewpath=re.search(r"/mpiwg/online/(.*)",self.add_metadata['archive-path']).group(1)          self.viewpath=re.search(r"/mpiwg/online/(.*)",self.add_metadata['archive-path']).group(1)
         if not (self.REQUEST.SESSION['no_upload']=="text"):      
       if (self.REQUEST.SESSION.has_key('no_upload')) and (self.REQUEST.SESSION['no_upload']=="text"):
               """text upload"""
               return 1
       else:   
             newtemplate2=PageTemplateFile('Products/OSA_system/zpt/OSAS_saved').__of__(self)              newtemplate2=PageTemplateFile('Products/OSA_system/zpt/OSAS_saved').__of__(self)
             newtemplate2.content_type="text/html"              newtemplate2.content_type="text/html"
             self.REQUEST.response.setHeader('Content-Type','text/html')              self.REQUEST.response.setHeader('Content-Type','text/html')
             return newtemplate2()              return newtemplate2()
         else:  
             """text upload"""  
             return 1  
   
   
   
Line 291  def addPresentation2(self): Line 301  def addPresentation2(self):
 def addText(self,path,folder=None):  def addText(self,path,folder=None):
     """add fulltext to the path"""      """add fulltext to the path"""
     self.REQUEST.SESSION['existing_names']=['pageimg'] # to be done generate list of existing text files      self.REQUEST.SESSION['existing_names']=['pageimg'] # to be done generate list of existing text files
     self.REQUEST.SESSION['path']=path      self.REQUEST.SESSION['pathnew']=path
     newtemplate=PageTemplateFile('Products/OSA_system/zpt/addText').__of__(self)      newtemplate=PageTemplateFile('Products/OSA_system/zpt/addText').__of__(self)
     return newtemplate()      return newtemplate()
   
Line 300  def addText2(self): Line 310  def addText2(self):
     folder_name=self.REQUEST['folder_name']      folder_name=self.REQUEST['folder_name']
     #print self.REQUEST['folder_name']      #print self.REQUEST['folder_name']
     content_description=self.REQUEST['content_description']      content_description=self.REQUEST['content_description']
     path=self.REQUEST.SESSION['path']      path=self.REQUEST.SESSION['pathnew']
     file_name=self.REQUEST['fileupload'].filename      file_name=self.REQUEST['fileupload'].filename
     filedata=self.REQUEST.form['fileupload'].read()      filedata=self.REQUEST.form['fileupload'].read()
     os.mkdir(path+"/"+folder_name)      os.mkdir(path+"/"+folder_name)
Line 578  def combineTextImage2(self,path): Line 588  def combineTextImage2(self,path):
             xsltnode.appendChild(xsltnodetext)              xsltnode.appendChild(xsltnodetext)
             subnode.appendChild(xsltnode)              subnode.appendChild(xsltnode)
                           
       if self.REQUEST.has_key('digiliburlprefix'):
           if not self.REQUEST['digiliburlprefix']=="":
               xsltnode=dom.createElement('digiliburlprefix')
               xsltnodetext=dom.createTextNode(self.REQUEST['digiliburlprefix'])
               xsltnode.appendChild(xsltnodetext)
               subnode.appendChild(xsltnode)
               
     node.appendChild(subnode)      node.appendChild(subnode)
           
     try:      try:
Line 618  def combineTextImage2(self,path): Line 635  def combineTextImage2(self,path):
           
           
   
     print urllib.urlopen("http://nausikaa2.rz-berlin.mpg.de:86/cgi-bin/toc/admin/reg.cgi?path=%s"%path).readlines()      urllib.urlopen("http://nausikaa2.rz-berlin.mpg.de:86/cgi-bin/toc/admin/reg.cgi?path=%s"%path).readlines()
   
     if self.REQUEST.has_key('image'): # falls bilder      if self.REQUEST.has_key('image'): # falls bilder
         os.popen("ssh nausikaa2.rz-berlin.mpg.de /usr/local/mpiwg/scripts/scaleomat.pl %s /mpiwg/temp/online/scaled/thumb 90 >> /tmp/sc.out &"% re.sub('/mpiwg/online/','',self.REQUEST['path']+"/"+self.REQUEST['image']))          os.popen("ssh archive@nausikaa2.rz-berlin.mpg.de /usr/local/mpiwg/scripts/scaleomat.pl %s /mpiwg/temp/online/scaled/thumb 90 >> /tmp/sc.out &"% re.sub('/mpiwg/online/','',self.REQUEST['path']+"/"+self.REQUEST['image']))
   
     else: # falls keine Bilder (bug in reg.cgi info file ersetzen)      else: # falls keine Bilder (bug in reg.cgi info file ersetzen)
         f=file("/tmp/tmp_info.xml","w")          f=file("/tmp/tmp_info.xml","w")
Line 629  def combineTextImage2(self,path): Line 646  def combineTextImage2(self,path):
         f.close()          f.close()
         splitted=path.split("/")          splitted=path.split("/")
         fn=splitted[len(splitted)-1]          fn=splitted[len(splitted)-1]
         remotePath="nausikaa2.rz-berlin.mpg.de:/usr/local/share/archimedes/web/docs/proj/echo/1/docs/"+fn+"/info.xml"          remotePath="archive@nausikaa2.rz-berlin.mpg.de:/usr/local/share/archimedes/web/docs/proj/echo/1/docs/"+fn+"/info.xml"
         os.popen("scp /tmp/tmp_info.xml %s"%remotePath)          os.popen("scp /tmp/tmp_info.xml %s"%remotePath)
   
 def patchedInfoXML(path):  def patchedInfoXML(path):
Line 653  def patchedInfoXML(path): Line 670  def patchedInfoXML(path):
         """not"""          """not"""
                   
     ret+="<lang>%s</lang>\n"%archive.getText(dom.getElementsByTagName('lang')[0].childNodes)      ret+="<lang>%s</lang>\n"%archive.getText(dom.getElementsByTagName('lang')[0].childNodes)
       try:
     ret+="<author>%s</author>\n"%archive.getText(dom.getElementsByTagName('author')[0].childNodes)      ret+="<author>%s</author>\n"%archive.getText(dom.getElementsByTagName('author')[0].childNodes)
       except:
           """not"""
       try:
     ret+="<title>%s</title>\n"%archive.getText(dom.getElementsByTagName('title')[0].childNodes)      ret+="<title>%s</title>\n"%archive.getText(dom.getElementsByTagName('title')[0].childNodes)
       except:
           """not"""
           
     ret+="</info>"      ret+="</info>"
   
     return ret      return ret

Removed from v.1.24  
changed lines
  Added in v.1.31


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