version 1.75, 2004/05/10 13:51:03
|
version 1.80, 2004/05/11 14:57:35
|
Line 105 def sendFile(self, filename, type):
|
Line 105 def sendFile(self, filename, type):
|
object = self |
object = self |
# look for an object called filename |
# look for an object called filename |
for path in paths: |
for path in paths: |
print "fragment: '"+path+"'" |
|
if hasattr(object, path): |
if hasattr(object, path): |
print " exists" |
|
object = getattr(object, path) |
object = getattr(object, path) |
else: |
else: |
print " doesn't exist" |
|
object = None |
object = None |
break |
break |
if object: |
if object: |
# if the object exists then send it |
# if the object exists then send it |
print "send zope object"+object() |
return object.index_html(self.REQUEST.REQUEST, self.REQUEST.RESPONSE) |
object() |
|
else: |
else: |
# send a local file with the given content-type |
# send a local file with the given content-type |
fn = os.path.join(package_home(globals()), filename) |
fn = os.path.join(package_home(globals()), filename) |
print "send fs file: "+fn |
|
self.REQUEST.RESPONSE.setHeader("Content-Type", type) |
self.REQUEST.RESPONSE.setHeader("Content-Type", type) |
self.REQUEST.RESPONSE.write(file(fn).read()) |
self.REQUEST.RESPONSE.write(file(fn).read()) |
return |
return |
Line 175 def writeMetadata(url,metadict):
|
Line 170 def writeMetadata(url,metadict):
|
metanode.appendChild(metanodeneu) |
metanode.appendChild(metanodeneu) |
|
|
|
|
return dom.toxml().encode('utf-8') |
return dom.topxml().encode('utf-8') |
|
|
def readMetadata(url): |
def readMetadata(url): |
"""Methode zum Auslesen der Metadateninformation zu einer Resource |
"""Methode zum Auslesen der Metadateninformation zu einer Resource |
Line 520 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 873 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 1255 class ECHO_collection(Folder, Persistent
|
Line 1256 class ECHO_collection(Folder, Persistent
|
|
|
def area_img(self): |
def area_img(self): |
"""area image""" |
"""area image""" |
sendFile(self, 'images/red.gif', 'image/gif') |
return sendFile(self, 'images/red.gif', 'image/gif') |
return |
|
|
|
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""" |