|
|
| version 1.3, 2003/10/01 08:20:47 | version 1.8, 2003/12/05 14:57:03 |
|---|---|
| Line 1 | Line 1 |
| # Classes for displaying, browsing and organizing the archive | # Classes for displaying, browsing and organizing the archive |
| import addFolder | import addFolder |
| from OFS.Folder import Folder | from OFS.Folder import Folder |
| from OFS.SimpleItem import SimpleItem | from OFS.SimpleItem import SimpleItem |
| from Products.PageTemplates.PageTemplateFile import PageTemplateFile | from Products.PageTemplates.PageTemplateFile import PageTemplateFile |
| from Products.PageTemplates.PageTemplate import PageTemplate | from Products.PageTemplates.PageTemplate import PageTemplate |
| from AccessControl import ClassSecurityInfo | |
| from Globals import InitializeClass | |
| class OSAS_ShowOnline(SimpleItem): | class OSAS_ShowOnline(SimpleItem): |
| security=ClassSecurityInfo() | |
| """OnlineBrowser""" | """OnlineBrowser""" |
| def __init__(self,id): | def __init__(self,id): |
| """initialize a new instance""" | """initialize a new instance""" |
| Line 14 class OSAS_ShowOnline(SimpleItem): | Line 19 class OSAS_ShowOnline(SimpleItem): |
| meta_type="OSAS_ShowOnline" | meta_type="OSAS_ShowOnline" |
| security.declareProtected('View','index_html') | |
| def index_html(self): | def index_html(self): |
| """main view""" | """main view""" |
| pt=PageTemplateFile('products/OSA_system/OSAS_ViewFiles.zpt').__of__(self) | pt=PageTemplateFile('Products/OSA_system/OSAS_ViewFiles.zpt').__of__(self) |
| return pt() | return pt() |
| def getfilesystem2(self,start,reload=0): | def getfilesystem2(self,start,reload=0): |
| Line 52 class OSAS_ShowOnline(SimpleItem): | Line 58 class OSAS_ShowOnline(SimpleItem): |
| self.tree(path).toggle(path,file) | self.tree(path).toggle(path,file) |
| return self.REQUEST.RESPONSE.redirect(self.REQUEST['URL1']+"?path="+path) | return self.REQUEST.RESPONSE.redirect(self.REQUEST['URL1']+"?path="+path) |
| InitializeClass(OSAS_ShowOnline) | |
| def manage_AddOSAS_ShowOnlineForm(self): | def manage_AddOSAS_ShowOnlineForm(self): |
| """interface for adding the OSAS_root""" | """interface for adding the OSAS_root""" |
| pt=PageTemplateFile('products/OSA_system/AddOSAS_ShowOnline.zpt').__of__(self) | pt=PageTemplateFile('Products/OSA_system/AddOSAS_ShowOnline.zpt').__of__(self) |
| return pt() | return pt() |
| def manage_AddOSAS_ShowOnline(self,id,RESPONSE=None): | def manage_AddOSAS_ShowOnline(self,id,RESPONSE=None): |
| Line 67 def manage_AddOSAS_ShowOnline(self,id,RE | Line 75 def manage_AddOSAS_ShowOnline(self,id,RE |
| class OSAS_StoreOnline(SimpleItem): | class OSAS_StoreOnline(SimpleItem): |
| """Webfrontend für das Storagesystem""" | """Webfrontend für das Storagesystem""" |
| security=ClassSecurityInfo() | |
| def __init__(self,id): | def __init__(self,id): |
| """initialize a new instance""" | """initialize a new instance""" |
| self.id = id | self.id = id |
| meta_type="OSAS_StoreOnline" | meta_type="OSAS_StoreOnline" |
| security.declareProtected('View','index_html') | |
| def index_html(self): | def index_html(self): |
| """main view""" | """main view""" |
| pt=PageTemplateFile('products/OSA_system/OSAS_StoreFiles.zpt').__of__(self) | pt=PageTemplateFile('Products/OSA_system/OSAS_StoreFiles.zpt').__of__(self) |
| return pt() | return pt() |
| def readContexts(self,path): | |
| """Zeige Contexte""" | |
| if os.path.exists(path+"/index.meta"): | |
| return readContexts(path) | |
| else: | |
| return [] | |
| def getfilesystem2(self,start,reload=0): | def getfilesystem2(self,start,reload=0): |
| """load filesystem""" | """load filesystem""" |
| Line 125 class OSAS_StoreOnline(SimpleItem): | Line 146 class OSAS_StoreOnline(SimpleItem): |
| def addFolderForm(self,path): | def addFolderForm(self,path): |
| """add a new path""" | """add a new path""" |
| pt=PageTemplateFile('products/OSA_system/OSAS_addFolder.zpt').__of__(self) | pt=PageTemplateFile('Products/OSA_system/OSAS_addFolder.zpt').__of__(self) |
| return pt() | return pt() |
| def date(self): | def date(self): |
| Line 144 class OSAS_StoreOnline(SimpleItem): | Line 165 class OSAS_StoreOnline(SimpleItem): |
| indexmeta="" | indexmeta="" |
| self.REQUEST.SESSION['indexmeta']=indexmeta | self.REQUEST.SESSION['indexmeta']=indexmeta |
| self.REQUEST.SESSION['path']=path | self.REQUEST.SESSION['path']=path |
| newtemplate=PageTemplateFile('products/OSA_system/editindex').__of__(self) | newtemplate=PageTemplateFile('Products/OSA_system/editindex').__of__(self) |
| return newtemplate() | return newtemplate() |
| def EditIndex2(self): | def EditIndex2(self): |
| Line 165 class OSAS_StoreOnline(SimpleItem): | Line 186 class OSAS_StoreOnline(SimpleItem): |
| def add_metafile(self): | def add_metafile(self): |
| """nothing""" | """nothing""" |
| pt=PageTemplateFile('products/OSA_system/OSAS_addmetadata.zpt').__of__(self) | pt=PageTemplateFile('Products/OSA_system/OSAS_addmetadata.zpt').__of__(self) |
| return pt() | return pt() |
| InitializeClass(OSAS_StoreOnline) | |
| def manage_AddOSAS_StoreOnlineForm(self): | def manage_AddOSAS_StoreOnlineForm(self): |
| """interface for adding the OSAS_root""" | """interface for adding the OSAS_root""" |
| pt=PageTemplateFile('products/OSA_system/AddOSAS_StoreOnline.zpt').__of__(self) | pt=PageTemplateFile('Products/OSA_system/AddOSAS_StoreOnline.zpt').__of__(self) |
| return pt() | return pt() |
| def manage_AddOSAS_StoreOnline(self,id,RESPONSE=None): | def manage_AddOSAS_StoreOnline(self,id,RESPONSE=None): |
| Line 183 def manage_AddOSAS_StoreOnline(self,id,R | Line 206 def manage_AddOSAS_StoreOnline(self,id,R |
| def readContexts(path): | |
| """ReadContext from index.meta""" | |
| dom=xml.dom.minidom.parse(path+"/index.meta") | |
| nodes=dom.getElementsByTagName('context') | |
| ret=[] | |
| for node in nodes: | |
| try: | |
| link=getText(node.getElementsByTagName('link')[0].childNodes) | |
| name=getText(node.getElementsByTagName('name')[0].childNodes) | |
| ret.append((link,name)) | |
| except: | |
| """nothing""" | |
| return ret | |
| ### Ab hier Baustelle | ### Ab hier Baustelle |