--- OSAS/OSA_system/OSAS_show.py 2003/10/09 08:21:16 1.6 +++ OSAS/OSA_system/OSAS_show.py 2003/12/05 14:57:03 1.8 @@ -6,15 +6,20 @@ from OFS.Folder import Folder from OFS.SimpleItem import SimpleItem from Products.PageTemplates.PageTemplateFile import PageTemplateFile from Products.PageTemplates.PageTemplate import PageTemplate +from AccessControl import ClassSecurityInfo +from Globals import InitializeClass class OSAS_ShowOnline(SimpleItem): + security=ClassSecurityInfo() + """OnlineBrowser""" def __init__(self,id): """initialize a new instance""" self.id = id meta_type="OSAS_ShowOnline" - + + security.declareProtected('View','index_html') def index_html(self): """main view""" pt=PageTemplateFile('Products/OSA_system/OSAS_ViewFiles.zpt').__of__(self) @@ -52,7 +57,9 @@ class OSAS_ShowOnline(SimpleItem): """Oeffnen bzw. schließen der Subfolders""" self.tree(path).toggle(path,file) return self.REQUEST.RESPONSE.redirect(self.REQUEST['URL1']+"?path="+path) - + +InitializeClass(OSAS_ShowOnline) + def manage_AddOSAS_ShowOnlineForm(self): """interface for adding the OSAS_root""" pt=PageTemplateFile('Products/OSA_system/AddOSAS_ShowOnline.zpt').__of__(self) @@ -68,13 +75,15 @@ def manage_AddOSAS_ShowOnline(self,id,RE class OSAS_StoreOnline(SimpleItem): """Webfrontend für das Storagesystem""" + security=ClassSecurityInfo() + def __init__(self,id): """initialize a new instance""" self.id = id meta_type="OSAS_StoreOnline" - + security.declareProtected('View','index_html') def index_html(self): """main view""" pt=PageTemplateFile('Products/OSA_system/OSAS_StoreFiles.zpt').__of__(self) @@ -83,8 +92,11 @@ class OSAS_StoreOnline(SimpleItem): def readContexts(self,path): """Zeige Contexte""" if os.path.exists(path+"/index.meta"): + return readContexts(path) + else: + return [] def getfilesystem2(self,start,reload=0): @@ -177,6 +189,7 @@ class OSAS_StoreOnline(SimpleItem): pt=PageTemplateFile('Products/OSA_system/OSAS_addmetadata.zpt').__of__(self) return pt() +InitializeClass(OSAS_StoreOnline) def manage_AddOSAS_StoreOnlineForm(self): """interface for adding the OSAS_root""" @@ -199,12 +212,14 @@ def readContexts(path): nodes=dom.getElementsByTagName('context') ret=[] + for node in nodes: - - link=getText(node.getElementsByTagName('link')[0].childNodes) - name=getText(node.getElementsByTagName('name')[0].childNodes) - ret.append((link,name)) - + try: + link=getText(node.getElementsByTagName('link')[0].childNodes) + name=getText(node.getElementsByTagName('name')[0].childNodes) + ret.append((link,name)) + except: + """nothing""" return ret