version 1.63, 2004/05/07 14:34:07
|
version 1.65, 2004/05/07 14:51:02
|
Line 76 def getText(nodelist):
|
Line 76 def getText(nodelist):
|
return rc |
return rc |
|
|
|
|
|
def sendFile(self, filename, type): |
|
"""sends an object or a local file (in the product) as response""" |
|
paths = filename.split('/') |
|
object = self |
|
# look for an object called filename |
|
for path in paths: |
|
if hasattr(object, path): |
|
object = getattr(object, path) |
|
else: |
|
object = None |
|
break |
|
if object: |
|
# if the object exists then send it |
|
object() |
|
else: |
|
# send a local file with the given content-type |
|
fn = os.path.join(package_home(globals()), filename) |
|
self.REQUEST.RESPONSE.setHeader("Content-Type", type) |
|
self.REQUEST.RESPONSE.write(file(fn).read()) |
|
return |
|
|
|
|
def readMetadata(url): |
def readMetadata(url): |
"""Methoden zum Auslesen der Metadateninformation zu einer Resource |
"""Methoden zum Auslesen der Metadateninformation zu einer Resource |
Vorerst noch Typ bib""" |
Vorerst noch Typ bib""" |
Line 655 class ECHO_collection(Folder, Persistent
|
Line 677 class ECHO_collection(Folder, Persistent
|
|
|
def createJavaScript(self): |
def createJavaScript(self): |
"""CreateJava""" |
"""CreateJava""" |
ret=javaScriptMain |
#ret=javaScriptMain |
|
ret="" |
|
|
dynamical="" |
dynamical="\n" |
for ob in self.getGraphicCoords(): |
for ob in self.getGraphicCoords(): |
if ob[4][4] == "": |
if ob[4][4] == "": |
dynamical+="""Coords.push(new Coord('%s', Img, %s));\n"""%(ob[1],ob[0]) |
#dynamical+="""Coords.push(new Coord('%s', Img, %s));\n"""%(ob[1],ob[0]) |
|
dynamical+="""addArea('%s', 'overview', %s, 'area');\n"""%(ob[1],ob[0]) |
else: |
else: |
dynamical+="""Coords.push(new Coord('%s', Img, %s));//%s\n"""%(ob[1],ob[0],ob[4][4]) |
dynamical+="""addArea('%s', 'overview', %s, 'arrow');\n"""%(ob[1],ob[0]) |
dynamical+="ShowArrow(new getObj('i.%s'),Img,%s);\n"%(ob[1],ob[0]) |
#dynamical+="""Coords.push(new Coord('%s', Img, %s));//%s\n"""%(ob[1],ob[0],ob[4][4]) |
ret+=javaHandler%dynamical |
#dynamical+="ShowArrow(new getObj('i.%s'),Img,%s);\n"%(ob[1],ob[0]) |
|
#ret+=javaHandler%dynamical |
|
ret+=dynamical |
return ret |
return ret |
|
|
security.declarePublic('getCreditObject') |
security.declarePublic('getCreditObject') |
Line 876 class ECHO_collection(Folder, Persistent
|
Line 902 class ECHO_collection(Folder, Persistent
|
else: |
else: |
return [] |
return [] |
|
|
|
def area_img(self): |
|
"""area image""" |
|
sendFile(self, 'images/red.gif', 'image/gif') |
|
return |
|
|
|
def hl_lib_js(self): |
|
"""javascript""" |
|
sendFile(self, 'js/hl_lib.js', 'text/plain') |
|
return |
|
|
|
def js_lib_js(self): |
|
"""javascript""" |
|
sendFile(self, 'js/js_lib.js', 'text/plain') |
|
return |
|
|
|
|
def getGraphicCoords(self): |
def getGraphicCoords(self): |
Line 889 class ECHO_collection(Folder, Persistent
|
Line 929 class ECHO_collection(Folder, Persistent
|
for coordtemp in object.coords: |
for coordtemp in object.coords: |
if len(coordtemp)>3: |
if len(coordtemp)>3: |
coord=coordtemp[0:4] |
coord=coordtemp[0:4] |
|
label="" |
if hasattr(object,'label') and not object.label=="": |
if hasattr(object,'label') and not object.label=="": |
ids.append([string.join(coord,", "),object.getId(),object.label,object,coordtemp]) |
label=object.label |
elif hasattr(object,'title'): |
elif hasattr(object,'title') and not object.title=="": |
if not object.title=="": |
label=object.title |
ids.append([string.join(coord,", "),object.getId(),object.title,object,coordtemp]) |
|
else: |
|
ids.append([string.join(coord,", "),object.getId(),object.getId(),object,coordtemp]) |
|
else: |
else: |
ids.append([string.join(coord,", "),object.getId(),object.getId(),object,coordtemp]) |
label=object.getId() |
|
ids.append([string.join(coord,", "),object.getId(),label,object,coordtemp,object.getViewClassification()]) |
except: |
except: |
"""nothing""" |
"""nothing""" |
|
|
Line 1100 class ECHO_root(Folder,Persistent,Implic
|
Line 1138 class ECHO_root(Folder,Persistent,Implic
|
def checkIfArrow(obj): |
def checkIfArrow(obj): |
if hasattr(obj,'coords'): |
if hasattr(obj,'coords'): |
for coordtemp in obj.coords: |
for coordtemp in obj.coords: |
if len(coordtemp)>3: |
print obj.title,len(coordtemp) |
|
if (len(coordtemp)>4) and not (coordtemp[4]==''): |
return 4 |
return 4 |
return None |
return None |
return None |
return None |
Line 1113 class ECHO_root(Folder,Persistent,Implic
|
Line 1152 class ECHO_root(Folder,Persistent,Implic
|
for entry in entries: |
for entry in entries: |
|
|
if checkIfArrow(entry[1]): |
if checkIfArrow(entry[1]): |
|
print "VP" |
setattr(entry[1],'viewClassification','view point') |
setattr(entry[1],'viewClassification','view point') |
else: |
else: |
|
print "area" |
setattr(entry[1],'viewClassification','area') |
setattr(entry[1],'viewClassification','area') |
|
|
#entry[1].contentType == entry[1].content_type |
#entry[1].contentType == entry[1].content_type |