--- OSAS/OSA_system/OSAS_archiver.py 2004/01/08 17:00:39 1.9 +++ OSAS/OSA_system/OSAS_archiver.py 2004/03/03 13:02:54 1.11 @@ -1,4 +1,8 @@ -# Methoden und Klassen fuer den MPIWG Archiver +""" Methoden und Klassen fuer den MPIWG Archiver +20040303 Zur Zeit nur angepasst and das System des MPIWG +nächste schritte: Konfigurierbarkeit der Metadaten / Konfigurierbarkeit der Server + +""" from OFS.Image import Image from OFS.Folder import Folder @@ -42,12 +46,12 @@ class OSAS_archiveInbox(SimpleItem,Persi def index_html(self): """main""" - pt=PageTemplateFile('Products/OSA_system/OSAS_archiveInboxIndex.zpt').__of__(self) + pt=PageTemplateFile('Products/OSA_system/zpt/OSAS_archiveInboxIndex.zpt').__of__(self) return pt() def manage_AddOSAS_archiveInboxForm(self): """interface for adding the OSAS_root""" - pt=PageTemplateFile('Products/OSA_system/AddOSAS_archiveInbox.zpt').__of__(self) + pt=PageTemplateFile('Products/OSA_system/zpt/AddOSAS_archiveInbox.zpt').__of__(self) return pt() @@ -101,7 +105,7 @@ class OSAS_metadataOrganizer(SimpleItem, else: self.REQUEST.SESSION['path']=path - pt=PageTemplateFile('Products/OSA_system/inputRessourceData.zpt').__of__(self) + pt=PageTemplateFile('Products/OSA_system/zpt/inputRessourceData.zpt').__of__(self) return pt() @@ -124,7 +128,7 @@ class OSAS_metadataOrganizer(SimpleItem, def addAcquisition(self,path): """Hinzufügen von Acquisition Daten""" self.REQUEST.SESSION['path']=path - pt=PageTemplateFile('Products/OSA_system/inputAcquisitionData.zpt').__of__(self) + pt=PageTemplateFile('Products/OSA_system/zpt/inputAcquisitionData.zpt').__of__(self) return pt() @@ -156,7 +160,7 @@ class OSAS_metadataOrganizer(SimpleItem, self.metaDataSet=self.metaDataSets[self.mediaToAcquisition[media_type]] self.media_type=self.mediaToAcquisition[media_type] - pt=PageTemplateFile('Products/OSA_system/inputDocumentMetadata.zpt').__of__(self) + pt=PageTemplateFile('Products/OSA_system/zpt/inputDocumentMetadata.zpt').__of__(self) return pt() @@ -181,7 +185,7 @@ class OSAS_metadataOrganizer(SimpleItem, changeNodesInIndexMeta(self.REQUEST.SESSION['path'],"img",subnodes) - pt=PageTemplateFile('Products/OSA_system/inputBiblioMetadata.zpt').__of__(self) + pt=PageTemplateFile('Products/OSA_system/zpt/inputBiblioMetadata.zpt').__of__(self) return pt() def writeBiblioMetadata(self,bibdata_type,RESPONSE=None): @@ -198,15 +202,11 @@ class OSAS_metadataOrganizer(SimpleItem, #return self.REQUEST return self.addRessourceMeta() - - - - def manage_AddOSAS_metadataOrganizerForm(self): """interface for adding the OSAS_root""" - pt=PageTemplateFile('Products/OSA_system/AddOSAS_metadataOrganizer.zpt').__of__(self) + pt=PageTemplateFile('Products/OSA_system/zpt/AddOSAS_metadataOrganizer.zpt').__of__(self) return pt() @@ -233,7 +233,7 @@ class OSAS_processViewer(SimpleItem,Pers def index_html(self): """main page""" - pt=PageTemplateFile('Products/OSA_system/processViewerIndex.zpt').__of__(self) + pt=PageTemplateFile('Products/OSA_system/zpt/processViewerIndex.zpt').__of__(self) return pt() def storeFile(self,something): @@ -283,17 +283,17 @@ class OSAS_processViewer(SimpleItem,Pers def view(self,number): """view page""" self.errnum=number - pt=PageTemplateFile('Products/OSA_system/processViewerView.zpt').__of__(self) + pt=PageTemplateFile('Products/OSA_system/zpt/processViewerView.zpt').__of__(self) return pt() def error(self): """view errors""" - pt=PageTemplateFile('Products/OSA_system/processViewerError.zpt').__of__(self) + pt=PageTemplateFile('Products/OSA_system/zpt/processViewerError.zpt').__of__(self) return pt() def manage_AddOSAS_processViewerForm(self): """interface for adding the OSAS_processViewer""" - pt=PageTemplateFile('Products/OSA_system/AddOSAS_processViewer.zpt').__of__(self) + pt=PageTemplateFile('Products/OSA_system/zpt/AddOSAS_processViewer.zpt').__of__(self) return pt() @@ -337,21 +337,26 @@ class OSAS_archiver(Folder, Persistent,I ## methoden aus dem alten archive.py - - + def isArray(self,path): + """check for array""" + if type(path) == StringType: + return 0 + else: + return 1 + def archiver(self,path): """archive the documents in path""" tmp=archive.archive(path,self.REQUEST.SESSION) - pt=PageTemplateFile('Products/OSA_system/archiveStatus.zpt').__of__(self) + pt=PageTemplateFile('Products/OSA_system/zpt/archiveStatus.zpt').__of__(self) return pt() def archive2(self): - pt=PageTemplateFile('Products/OSA_system/archive2.zpt').__of__(self) + pt=PageTemplateFile('Products/OSA_system/zpt/archive2.zpt').__of__(self) return pt() def metachecker(self,path): - """check the metadata the documents in path""" + """check the metadata of the documents in path""" self.REQUEST.SESSION['path']=self.REQUEST['path'] return archive.metacheck(path) @@ -388,7 +393,6 @@ class OSAS_archiver(Folder, Persistent,I def getfilesystem2(self,start,reload=0): """load filesystem""" - k=filesystem2(start,1) return k @@ -408,12 +412,12 @@ class OSAS_archiver(Folder, Persistent,I def archiver_html(self): """archiver""" - pt=PageTemplateFile('Products/OSA_system/OSAS_Archiver.zpt').__of__(self) + pt=PageTemplateFile('Products/OSA_system/zpt/OSAS_Archiver.zpt').__of__(self) return pt() def index_html(self): """main page""" - pt=PageTemplateFile('Products/OSA_system/archiverIndex.zpt').__of__(self) + pt=PageTemplateFile('Products/OSA_system/zpt/archiverIndex.zpt').__of__(self) return pt() def getDate(self): @@ -422,7 +426,7 @@ class OSAS_archiver(Folder, Persistent,I def newFolders_html(self): """main page""" - pt=PageTemplateFile('Products/OSA_system/newFolders.zpt').__of__(self) + pt=PageTemplateFile('Products/OSA_system/zpt/newFolders.zpt').__of__(self) return pt() def getProducers(self): @@ -448,7 +452,7 @@ class OSAS_archiver(Folder, Persistent,I """Erzeuge Folder im producer Verzeichnis mit ids""" self.REQUEST.SESSION['producer']=producer self.REQUEST.SESSION['ids']=self.idGenerator.giveIdsOut(number) - pt=PageTemplateFile('Products/OSA_system/createFoldersForm.zpt').__of__(self) + pt=PageTemplateFile('Products/OSA_system/zpt/createFoldersForm.zpt').__of__(self) return pt() def createFolders(self,folderList,producer): @@ -466,7 +470,7 @@ class OSAS_archiver(Folder, Persistent,I os.mkdir(self.startPath+"/"+producerFolderName+"/"+folder) os.chmod(self.startPath+"/"+producerFolderName+"/"+folder,0775) self.REQUEST.SESSION['folderList']=folders - pt=PageTemplateFile('Products/OSA_system/createFolders.zpt').__of__(self) + pt=PageTemplateFile('Products/OSA_system/zpt/createFolders.zpt').__of__(self) return pt() def storeerror(self,ret,path,context,i): @@ -498,13 +502,13 @@ class OSAS_archiver(Folder, Persistent,I def error(self): """view errors""" - pt=PageTemplateFile('Products/OSA_system/processViewerError.zpt').__of__(self) + pt=PageTemplateFile('Products/OSA_system/zpt/processViewerError.zpt').__of__(self) return pt() def archiveSelected(self): """Archiviere ausgewaehlte files""" - pt=PageTemplateFile('Products/OSA_system/archiveSelected.zpt').__of__(self) + pt=PageTemplateFile('Products/OSA_system/zpt/archiveSelected.zpt').__of__(self) return pt() def enterAcquisitionMetadata(self): @@ -519,7 +523,7 @@ class OSAS_archiver(Folder, Persistent,I def changeOSAS_archiverForm(self): """change""" - pt=PageTemplateFile('Products/OSA_system/ChangeOSAS_archiver.zpt').__of__(self) + pt=PageTemplateFile('Products/OSA_system/zpt/ChangeOSAS_archiver.zpt').__of__(self) return pt() def changeOSAS_archiver(self,startPath,title="",RESPONSE=None): @@ -533,7 +537,7 @@ class OSAS_archiver(Folder, Persistent,I def manage_AddOSAS_archiverForm(self): """interface for adding the OSAS_root""" - pt=PageTemplateFile('Products/OSA_system/AddOSAS_archiver.zpt').__of__(self) + pt=PageTemplateFile('Products/OSA_system/zpt/AddOSAS_archiver.zpt').__of__(self) return pt() @@ -569,7 +573,7 @@ class OSAS_producer(SimpleItem,Persisten def changeOSAS_producerForm(self): """change""" - pt=PageTemplateFile('Products/OSA_system/ChangeOSAS_producer.zpt').__of__(self) + pt=PageTemplateFile('Products/OSA_system/zpt/ChangeOSAS_producer.zpt').__of__(self) return pt() def changeOSAS_producer(self,title,address,producerFolderName,contact="",url="",RESPONSE=None): @@ -585,7 +589,7 @@ class OSAS_producer(SimpleItem,Persisten def manage_AddOSAS_producerForm(self): """interface for adding the OSAS_root""" - pt=PageTemplateFile('Products/OSA_system/AddOSAS_producer.zpt').__of__(self) + pt=PageTemplateFile('Products/OSA_system/zpt/AddOSAS_producer.zpt').__of__(self) return pt()