version 1.204, 2005/01/21 16:28:58
|
version 1.205, 2005/01/21 17:32:09
|
Line 1794 class ECHO_collection(Folder, Persistent
|
Line 1794 class ECHO_collection(Folder, Persistent
|
except: |
except: |
return "" |
return "" |
|
|
def getCollectionTreeXML(self): |
def getCollectionTreeXML(self,pwstr=None): |
"""Tree as XML""" |
"""Tree as XML""" |
|
|
def addPassWd(str): |
def addPassWd(str,pwstr=None): |
"""adds a user/passwd to an url""" |
"""adds a user/passwd to an url""" |
|
if pwstr: |
|
txt2=re.sub(r"(http://)(.*?)","\g<1>%s@\g<2>"%pwstr,str) |
|
else: |
txt2=re.sub(r"(http://)(.*?)","\g<1>www:3333@\g<2>",str) |
txt2=re.sub(r"(http://)(.*?)","\g<1>www:3333@\g<2>",str) |
return txt2 |
return txt2 |
|
|
def getCollection(object,depth=0): |
def getCollection(object,depth=0,pwstr=None): |
depth+=1 |
depth+=1 |
collections="" |
collections="" |
for entry in object.__dict__.keys(): |
for entry in object.__dict__.keys(): |
element=getattr(object,entry) |
element=getattr(object,entry) |
try: |
try: |
if element.meta_type in ["ECHO_collection","ECHO_group"]: |
if element.meta_type in ["ECHO_collection","ECHO_group"]: |
collections+="<element name=\""+urllib.quote(element.title)+"\" url=\""+addPassWd(element.absolute_url())+"\">" |
collections+="<element name=\""+urllib.quote(element.title)+"\" url=\""+addPassWd(element.absolute_url(),pwstr=pwstr)+"\">" |
collections+=getCollection(element,depth)+"</element>\n" |
collections+=getCollection(element,depth)+"</element>\n" |
except: |
except: |
"""nothing""" |
"""nothing""" |
return collections |
return collections |
|
|
ret="""<?xml version="1.0" encoding="utf-8" ?>""" |
ret="""<?xml version="1.0" encoding="utf-8" ?>""" |
return ret+"<collection>"+getCollection(self)+"</collection>" |
return ret+"<collection>"+getCollection(self,pwstr=pwstr)+"</collection>" |
|
|
def createAllJSAreas(self): |
def createAllJSAreas(self): |
"""create area calls for JavaScript""" |
"""create area calls for JavaScript""" |