version 1.6, 2004/01/06 14:39:49
|
version 1.10, 2004/01/09 12:47:04
|
Line 31 class OSAS_archiveInbox(SimpleItem,Persi
|
Line 31 class OSAS_archiveInbox(SimpleItem,Persi
|
self.title=title |
self.title=title |
self.pathes=[] |
self.pathes=[] |
|
|
def addPath(self,path): |
def addPath(self,path,RESPONSE=None): |
|
"""add a path""" |
today=time.localtime() |
today=time.localtime() |
self.pathes.append([path,today]) |
temp=self.pathes[0:] |
|
temp.append([path,today]) |
|
self.pathes=temp[0:] |
|
if RESPONSE: |
|
RESPONSE.redirect("index_html") |
|
|
def index_html(self): |
def index_html(self): |
"""main""" |
"""main""" |
Line 267 class OSAS_processViewer(SimpleItem,Pers
|
Line 272 class OSAS_processViewer(SimpleItem,Pers
|
return ret |
return ret |
|
|
def writefile(self,path,txt,REQUEST): |
def writefile(self,path,txt,REQUEST): |
|
"""writefile""" |
f=open(path,'w') |
f=open(path,'w') |
f.write(txt) |
f.write(txt) |
f.close() |
f.close() |
Line 312 class OSAS_archiver(Folder, Persistent,I
|
Line 318 class OSAS_archiver(Folder, Persistent,I
|
{'label':'Main Config','action':'changeOSAS_archiverForm'}, |
{'label':'Main Config','action':'changeOSAS_archiverForm'}, |
) |
) |
|
|
# to be deleted later |
def unarchive(self,path): |
#startPath="/mpiwg" |
"""unarchive the path""" |
|
f = os.popen("/usr/local/mpiwg/archive/unarchiver "+path,"r") |
|
return f.readlines() |
|
|
|
def checkIfUnarchive(self,path): |
|
if not os.path.exists(path+"/index.meta"): |
|
return 0 |
|
f=file(path+"/index.meta","r").read() |
|
dom=xml.dom.minidom.parseString(f) |
|
archiveStorageDates=dom.getElementsByTagName("archive-storage-date") |
|
if archiveStorageDates: |
|
return 1 |
|
else: |
|
return 0 |
|
|
## methoden aus dem alten archive.py |
## 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): |
def archiver(self,path): |
"""archive the documents in path""" |
"""archive the documents in path""" |
Line 324 class OSAS_archiver(Folder, Persistent,I
|
Line 350 class OSAS_archiver(Folder, Persistent,I
|
pt=PageTemplateFile('Products/OSA_system/archiveStatus.zpt').__of__(self) |
pt=PageTemplateFile('Products/OSA_system/archiveStatus.zpt').__of__(self) |
return pt() |
return pt() |
|
|
|
def archive2(self): |
|
pt=PageTemplateFile('Products/OSA_system/archive2.zpt').__of__(self) |
|
return pt() |
|
|
|
|
def metachecker(self,path): |
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'] |
self.REQUEST.SESSION['path']=self.REQUEST['path'] |
return archive.metacheck(path) |
return archive.metacheck(path) |
|
|
Line 365 class OSAS_archiver(Folder, Persistent,I
|
Line 393 class OSAS_archiver(Folder, Persistent,I
|
|
|
def getfilesystem2(self,start,reload=0): |
def getfilesystem2(self,start,reload=0): |
"""load filesystem""" |
"""load filesystem""" |
|
|
k=filesystem2(start,1) |
k=filesystem2(start,1) |
return k |
return k |
|
|
Line 416 class OSAS_archiver(Folder, Persistent,I
|
Line 443 class OSAS_archiver(Folder, Persistent,I
|
|
|
def getProducer(self,id): |
def getProducer(self,id): |
"""Gebe ProducerObjekt zurück""" |
"""Gebe ProducerObjekt zurück""" |
obj=getattr(self.aq_parent.producerFolder,id) |
obj=getattr(self.producerFolder,id) |
return obj |
return obj |
|
|
|
|
Line 431 class OSAS_archiver(Folder, Persistent,I
|
Line 458 class OSAS_archiver(Folder, Persistent,I
|
def createFolders(self,folderList,producer): |
def createFolders(self,folderList,producer): |
"""Erzeug die entsprechenden Folder""" |
"""Erzeug die entsprechenden Folder""" |
#hack |
#hack |
producer="library" |
#producer="library" |
if type(folderList)==StringType: |
if type(folderList)==StringType: |
folders=[folderList] |
folders=[folderList] |
else: |
else: |
folders=folderList |
folders=folderList |
|
#return producer |
|
producerFolderName=self.getProducer(producer).producerFolderName |
|
|
for folder in folders: |
for folder in folders: |
os.mkdir(self.startPath+"/"+producer+"/"+folder) |
os.mkdir(self.startPath+"/"+producerFolderName+"/"+folder) |
os.chmod(self.startPath+"/"+producer+"/"+folder,0775) |
os.chmod(self.startPath+"/"+producerFolderName+"/"+folder,0775) |
self.REQUEST.SESSION['folderList']=folders |
self.REQUEST.SESSION['folderList']=folders |
pt=PageTemplateFile('Products/OSA_system/createFolders.zpt').__of__(self) |
pt=PageTemplateFile('Products/OSA_system/createFolders.zpt').__of__(self) |
return pt() |
return pt() |
Line 466 class OSAS_archiver(Folder, Persistent,I
|
Line 494 class OSAS_archiver(Folder, Persistent,I
|
return ret |
return ret |
|
|
def writefile(self,path,txt,REQUEST): |
def writefile(self,path,txt,REQUEST): |
|
"""writefile""" |
f=open(path,'w') |
f=open(path,'w') |
f.write(txt) |
f.write(txt) |
f.close() |
f.close() |
rval=self.aq_acquire('archive2') |
return self.archive2() |
return rval() |
|
|
|
def error(self): |
def error(self): |
"""view errors""" |
"""view errors""" |
Line 530 class OSAS_producer(SimpleItem,Persisten
|
Line 558 class OSAS_producer(SimpleItem,Persisten
|
|
|
meta_type="OSAS_producer" |
meta_type="OSAS_producer" |
|
|
def __init__(self,shortName,fullName,address="",url="",contact=""): |
def __init__(self,shortName,fullName,producerFolderName,address="",url="",contact=""): |
|
|
self.id=shortName |
self.id=shortName |
self.title=fullName |
self.title=fullName |
self.address=address |
self.address=address |
self.url=url |
self.url=url |
self.contact=contact |
self.contact=contact |
|
self.producerFolderName=producerFolderName |
|
|
manage_options = SimpleItem.manage_options+( |
manage_options = SimpleItem.manage_options+( |
{'label':'Main Config','action':'changeOSAS_producerForm'}, |
{'label':'Main Config','action':'changeOSAS_producerForm'}, |
Line 547 class OSAS_producer(SimpleItem,Persisten
|
Line 576 class OSAS_producer(SimpleItem,Persisten
|
pt=PageTemplateFile('Products/OSA_system/ChangeOSAS_producer.zpt').__of__(self) |
pt=PageTemplateFile('Products/OSA_system/ChangeOSAS_producer.zpt').__of__(self) |
return pt() |
return pt() |
|
|
def changeOSAS_producer(self,title,address,contact="",url=""): |
def changeOSAS_producer(self,title,address,producerFolderName,contact="",url="",RESPONSE=None): |
"""change""" |
"""change""" |
self.title=fullName |
self.title=title |
self.address=address |
self.address=address |
self.url=url |
self.url=url |
self.contact=contact |
self.contact=contact |
|
self.producerFolderName=producerFolderName |
|
|
|
if RESPONSE: |
|
RESPONSE.redirect("manage_main") |
|
|
def manage_AddOSAS_producerForm(self): |
def manage_AddOSAS_producerForm(self): |
"""interface for adding the OSAS_root""" |
"""interface for adding the OSAS_root""" |
Line 560 def manage_AddOSAS_producerForm(self):
|
Line 593 def manage_AddOSAS_producerForm(self):
|
return pt() |
return pt() |
|
|
|
|
def manage_AddOSAS_producer(self,id,title="",contact="",address="",url="",RESPONSE=None): |
def manage_AddOSAS_producer(self,id,producerFolderName,title="",contact="",address="",url="",RESPONSE=None): |
"""add the OSAS_root""" |
"""add the OSAS_root""" |
if title=="": |
if title=="": |
title=id |
title=id |
|
|
newObj=OSAS_producer(id, title,address,contact,url) |
newObj=OSAS_producer(id, title,producerFolderName,address,contact,url) |
self._setObject(id,newObj) |
self._setObject(id,newObj) |
if RESPONSE is not None: |
if RESPONSE is not None: |
RESPONSE.redirect('manage_main') |
RESPONSE.redirect('manage_main') |