Diff for /OSAS/OSA_system/OSAS_addfiles.py between versions 1.17 and 1.18

version 1.17, 2004/03/03 13:02:54 version 1.18, 2004/03/19 21:28:21
Line 1 Line 1
 # Methoden und Classen zum Hinzufuegen von Dokumenten  # Methoden und Classen zum Hinzufuegen von Dokumenten
   
   
   from OSAS_helpers import readArchimedesXML, getISO, getText
   import os
 import xml.dom.minidom  import xml.dom.minidom
 from Products.ECHO_content import ECHO_collection  from Products.ECHO_content import ECHO_collection
 import urllib  import urllib
Line 11  from AccessControl import ClassSecurityI Line 14  from AccessControl import ClassSecurityI
 from Globals import InitializeClass  from Globals import InitializeClass
 from Products.PageTemplates.PageTemplateFile import PageTemplateFile  from Products.PageTemplates.PageTemplateFile import PageTemplateFile
 from Products.PageTemplates.PageTemplate import PageTemplate  from Products.PageTemplates.PageTemplate import PageTemplate
   import archive # check if this is necessary
   
 class OSAS_add_Document(Folder):  class OSAS_add_Document(Folder):
     """Hinzufuegen eines Dokumentes zum Storage"""      """Hinzufuegen eines Dokumentes zum Storage"""
Line 331  def manage_AddOSAS_add_Presentation(self Line 335  def manage_AddOSAS_add_Presentation(self
 InitializeClass(OSAS_add_Presentation)  InitializeClass(OSAS_add_Presentation)
   
 class OSAS_combineTextImage(Folder):  class OSAS_combineTextImage(Folder):
     """Hinzufügen der Combine Text und Image"""      """Hinzufüge der Combine Text und Image"""
     security=ClassSecurityInfo()      security=ClassSecurityInfo()
   
     def __init__(self,id):      def __init__(self,id):
Line 362  class OSAS_combineTextImage(Folder): Line 366  class OSAS_combineTextImage(Folder):
     security.declarePublic('combineTextImage')      security.declarePublic('combineTextImage')
     def combineTextImage(self,path):      def combineTextImage(self,path):
         """Hinzufügen der Presenationsinformation"""          """Hinzufügen der Presenationsinformation"""
         return OSAS_add.combineTextImage(self,path)          """gibt input formular zur erstellung des texttools meta tag aus"""
       files = os.listdir(path)
       
       texts=[]
       imagefolders=[]
       presentationfolders=[]
   
       splitted=path.split("/")
       externxml=readArchimedesXML(splitted[len(splitted)-1])
       
       for filename in files:
           #print "FN",filename
           if archive.isdigilib2(path+"/"+filename):
               imagefolders.append(filename)
               
           if archive.isFullText(path,filename):
               #print "HI"
               texts.append(filename)
           if archive.isPresentation(path,filename):
               presentationfolders.append(filename)
       
       dom=xml.dom.minidom.parse(path+"/index.meta")
       try:
           filelanguage=archive.getText(dom.getElementsByTagName('lang')[0].childNodes)
       except:
           filelanguage=""
                   
       self.REQUEST.SESSION['isolist']=getISO()
       tmp=getISO().keys()
       tmp.sort()
       self.REQUEST.SESSION['isolistsort']=tmp
       self.REQUEST.SESSION['path']=path
       self.REQUEST.SESSION['texts']=texts
       self.REQUEST.SESSION['imagefolders']=imagefolders
       self.REQUEST.SESSION['presentationfolders']=presentationfolders
       self.REQUEST.SESSION['filelanguage']=filelanguage
       self.REQUEST.SESSION['externxml']=externxml
   
       newtemplate=PageTemplateFile('Products/OSA_system/zpt/ImageandText').__of__(self)
       return newtemplate()
       
       def getProjects(self,obj_ids=None):
           """Get the Project title for configuration"""
           ret=[]
   
           try:
               projects=self.ZopeFind(self.projects,obj_metatypes='OSAS_project',obj_ids=obj_ids)#assumes projects folder somewhere in the hierarchie.
               print projects
               for project in projects:
                   ret.append((project[1].title,project[0],project[1]))
               print ret
               return ret
           
           except:
               return [('no Projectfolders','')]
   
       def getTextToolsField(self,path,name,default=''):
           """Lese Textoolsfelder aus index.meta im path aus"""
           
           try:
               dom=xml.dom.minidom.parse(path+"/index.meta")
               node=dom.getElementsByTagName('texttool')[0] #getNode
               subnode=node.getElementsByTagName(name)[0]
               print getText(subnode.childNodes)
               return getText(subnode.childNodes)
           except:
               return default
               
   
     def combineTextImage2(self,path):      def combineTextImage2(self,path):
         """Eingabe von Metadateninformationen"""          """Eingabe von Metadateninformationen"""
Line 378  class OSAS_combineTextImage(Folder): Line 449  class OSAS_combineTextImage(Folder):
   
         return pt()          return pt()
   
       def isSelectedProject(self,obj,id):
           """is ausgewählt"""
           
           if self.REQUEST['project']==id:
               return 1
           else:
               return None
   
 def writeToContext(path,link,description):  def writeToContext(path,link,description):
     """Created an additional entry to the index.meta file of path"""      """Created an additional entry to the index.meta file of path"""

Removed from v.1.17  
changed lines
  Added in v.1.18


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