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

version 1.31, 2004/06/23 05:36:08 version 1.34, 2004/07/23 17:50:35
Line 142  def add4(self): Line 142  def add4(self):
     self.folder_name=self.REQUEST['folder_name']      self.folder_name=self.REQUEST['folder_name']
     # next has to be changed -> error if back button is used!!      # next has to be changed -> error if back button is used!!
     self.REQUEST.SESSION['folder_name']=self.folder_name      self.REQUEST.SESSION['folder_name']=self.folder_name
     if self.REQUEST['submit']=="upload images":      #return self.REQUEST['submit']
         self.REQUEST.SESSION['path']=os.path.join(self.REQUEST.SESSION['path'],self.REQUEST['folder_name'])  
           
   
         try:              try:    
             os.mkdir(self.REQUEST.SESSION['path'])              os.mkdir(self.REQUEST.SESSION['path'])
Line 152  def add4(self): Line 150  def add4(self):
         except:          except:
             """nothing"""              """nothing"""
   
       if self.REQUEST['submit']=="upload images":
           self.REQUEST.SESSION['path']=os.path.join(self.REQUEST.SESSION['path'],self.REQUEST['folder_name'])
           
   
         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()
       
       elif self.REQUEST['submit']=="upload pdf":
           os.mkdir(os.path.join(self.REQUEST.SESSION['path'],self.REQUEST['folder_name']))
           return addPdf(self,os.path.join(self.REQUEST.SESSION['path'],self.REQUEST['folder_name']))
     else:      else:
         os.mkdir(os.path.join(self.REQUEST.SESSION['path'],self.REQUEST['folder_name']))          os.mkdir(os.path.join(self.REQUEST.SESSION['path'],self.REQUEST['folder_name']))
         return addText(self,os.path.join(self.REQUEST.SESSION['path'],self.REQUEST['folder_name']))          return addText(self,os.path.join(self.REQUEST.SESSION['path'],self.REQUEST['folder_name']))
Line 298  def addPresentation2(self): Line 304  def addPresentation2(self):
           
     return self.REQUEST.RESPONSE.redirect(self.REQUEST['URL2']+'?path='+path)      return self.REQUEST.RESPONSE.redirect(self.REQUEST['URL2']+'?path='+path)
   
   
   def addPdf(self,path,folder=None):
       """add fulltext to the path"""
       self.REQUEST.SESSION['existing_names']=['pageimg'] # to be done generate list of existing text files
       self.REQUEST.SESSION['pathnew']=path
       newtemplate=PageTemplateFile('Products/OSA_system/zpt/addPdf').__of__(self)
       return newtemplate()
   
   def addPdf2(self):
       """addtext"""
       folder_name="pdf" # foldername fixed
       
       if self.REQUEST['file_name']=="":
           file_name=self.REQUEST['fileupload'].filename
       else:
           file_name=self.REQUEST['file_name']
           
       #print self.REQUEST['folder_name']
       content_description=self.REQUEST['content_description']
       path=self.REQUEST.SESSION['pathnew']
   
       filedata=self.REQUEST.form['fileupload'].read()
       try:
           os.mkdir(path+"/"+folder_name)
       except:
           """nothing"""
       f=open(path+"/"+folder_name+"/"+file_name,"w")
       f.write(filedata)
       f.close()
       os.chmod(path+"/"+folder_name,0755)
       os.chmod(path+"/"+folder_name+"/"+file_name,0644)
       addDirsToIndexMeta(path,folder_name,content_description,'pdf')
   
       return self.REQUEST.RESPONSE.redirect(self.REQUEST['URL2']+'?path='+path)
   
 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
Line 638  def combineTextImage2(self,path): Line 679  def combineTextImage2(self,path):
     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 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']))          dlpath = re.sub('/mpiwg/online/','',self.REQUEST['path'])+"/"+self.REQUEST['image']
           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 -replace >> /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 >> /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")

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


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