version 1.77, 2004/05/10 15:27:32
|
version 1.82, 2004/05/11 18:24:52
|
Line 515 class ECHO_resource(Folder):
|
Line 515 class ECHO_resource(Folder):
|
def changeECHO_resource_coords(self,coords,viewClassification,RESPONSE=None): |
def changeECHO_resource_coords(self,coords,viewClassification,RESPONSE=None): |
"""Änderung der Properties - coords""" |
"""Änderung der Properties - coords""" |
|
|
|
if type(coords)==StringType: |
|
coords=[coords] |
|
|
try: |
try: |
coordsnew=[ string.split(x,",") for x in coords] |
coordsnew=[ string.split(x,",") for x in coords] |
except: |
except: |
Line 868 class ECHO_link(ECHO_externalLink):
|
Line 871 class ECHO_link(ECHO_externalLink):
|
|
|
|
|
def content_html(self): |
def content_html(self): |
"""template fuer content""" |
"""template fuer link""" |
|
if hasattr(self,"link_template"): |
return content_html(self,'link') |
return content_html(self,'link') |
|
else: |
|
return content_html(self,'collection') |
|
|
def manage_addECHO_linkForm(self): |
def manage_addECHO_linkForm(self): |
"""Form for external Links""" |
"""Form for external Links""" |
Line 1254 class ECHO_collection(Folder, Persistent
|
Line 1260 class ECHO_collection(Folder, Persistent
|
|
|
def hl_lib_js(self): |
def hl_lib_js(self): |
"""javascript""" |
"""javascript""" |
sendFile(self, 'js/hl_lib.js', 'text/plain') |
return sendFile(self, 'js/hl_lib.js', 'text/plain') |
return |
|
|
|
def js_lib_js(self): |
def js_lib_js(self): |
"""javascript""" |
"""javascript""" |
sendFile(self, 'js/js_lib.js', 'text/plain') |
return sendFile(self, 'js/js_lib.js', 'text/plain') |
return |
|
|
|
def getGraphicCoords(self): |
def getGraphicCoords(self): |
"""Give list of coordinates""" |
"""Give list of coordinates""" |
Line 1700 class ECHO_root(Folder,Persistent,Implic
|
Line 1704 class ECHO_root(Folder,Persistent,Implic
|
ret.append((collection[0].getId(),collection[1].getId(),collection[2])) |
ret.append((collection[0].getId(),collection[1].getId(),collection[2])) |
return ret |
return ret |
|
|
|
def getResourcesHTML(self,viewerType=None,filter=None): |
|
"""gebe all ressourcen aus""" |
|
|
|
def sortHTML(x,y): |
|
return cmp(x[1].title,y[1].title) |
|
|
|
ret="""<html><body><h2>Resources in ECHO</h3>""" |
|
|
|
resources = self.ZopeFind(self,obj_metatypes=['ECHO_resource'],search_sub=1) |
|
ret+="""<h3>Found %i resources</h3>"""%len(resources) |
|
resources.sort(sortHTML) |
|
for resource in resources: |
|
echo_url=resource[1].absolute_url() |
|
|
|
if hasattr(resource[1],'title'): |
|
title=resource[1].title |
|
else: |
|
title="None" |
|
if filter: |
|
if re.search(filter,title): |
|
ret+="""\n<p><a href="%s">%s</a></p>"""%(echo_url,title) |
|
else: |
|
ret+="""\n<p><a href="%s">%s</a></p>"""%(echo_url,title) |
|
|
|
ret +="""\n</body></html>""" |
|
|
|
#self.REQUEST.RESPONSE.setHeader("Content-Type", "text/html") |
|
#self.REQUEST.RESPONSE.write(ret) |
|
return ret |
|
|
|
def getResourcesXML(self,viewerType=None,filter=None): |
|
"""gebe all ressourcen aus""" |
|
ret="""<?xml version="1.0" ?> |
|
<index>""" |
|
for resource in self.ZopeFind(self,obj_metatypes=['ECHO_resource'],search_sub=1): |
|
|
|
echo_url=resource[1].absolute_url() |
|
if hasattr(resource[1],'link'): |
|
viewer_url=resource[1].link |
|
else: |
|
viewer_url="NO URL" |
|
if filter: |
|
if re.search(filter,viewer_url): |
|
ret+="""\n<resource echoLink="%s" viewerLink="%s"/>"""%(urllib.quote(echo_url,safe='/:?'),urllib.quote(viewer_url,safe='/:?')) |
|
else: |
|
ret+="""\n<resource echoLink="%s" viewerLink="%s"/>"""%(urllib.quote(echo_url,safe='/:?'),urllib.quote(viewer_url,safe='/:?')) |
|
ret +="""\n</index>""" |
|
|
|
self.REQUEST.RESPONSE.setHeader("Content-Type", "text/xml") |
|
self.REQUEST.RESPONSE.write(ret) |
|
|
|
|
def manage_addECHO_root(self,id,title,RESPONSE=None): |
def manage_addECHO_root(self,id,title,RESPONSE=None): |