version 1.68, 2005/12/04 09:10:55
|
version 1.72, 2006/02/06 11:00:20
|
Line 50 class ECHO_basis:
|
Line 50 class ECHO_basis:
|
security=ClassSecurityInfo() |
security=ClassSecurityInfo() |
security.declarePublic('getImageTag') |
security.declarePublic('getImageTag') |
|
|
|
management_page_charset="utf-8" |
|
|
def manage_addECHO_locale(self,lang,title,label,text=None,content_type=None,RESPONSE=None): |
def manage_addECHO_locale(self,lang,title,label,text=None,content_type=None,RESPONSE=None): |
return ECHO_collection.manage_addECHO_locale(self,lang,title,label) |
return ECHO_collection.manage_addECHO_locale(self,lang,title,label) |
|
|
Line 148 class ECHO_basis:
|
Line 150 class ECHO_basis:
|
return self.decode(self.title) |
return self.decode(self.title) |
|
|
|
|
try: |
|
return self.title.encode('utf-8','ignore') |
|
except: |
|
self.title=self.title.decode('iso-8859-1','ignore')[0:] #correnct conding error |
|
return self.title.encode('utf-8','ignore') |
|
|
|
def getLabel(self): |
def getLabel(self): |
"""title""" |
"""title""" |
lang=self.getLanguage() |
lang=self.getLanguage() |
Line 175 class ECHO_basis:
|
Line 171 class ECHO_basis:
|
return ret |
return ret |
|
|
return self.decode(self.label) |
return self.decode(self.label) |
try: |
|
return self.label.encode('utf-8','ignore') |
|
except: |
|
self.label=self.label.decode('iso-8859-1','ignore')[0:] #correnct conding error |
|
return self.label.encode('utf-8','ignore') |
|
|
|
|
|
def changeECHOEntriesForm(self): |
def changeECHOEntriesForm(self): |
"""change Entries for the ECHO Navigation environment""" |
"""change Entries for the ECHO Navigation environment""" |
Line 547 def checkOnlyOneInGroup(object):
|
Line 537 def checkOnlyOneInGroup(object):
|
else: return object |
else: return object |
|
|
|
|
def getSubCols(self, sortfield=None, subColTypes=displayTypes, sortFieldMD=None,searchMD=None,searchSimple=None,generic="yes"): |
def getSubCols(self, sortfield=None, subColTypes=displayTypes, sortFieldMD=None,searchMD=None,searchSimple=None,generic="yes",search_sub=0): |
|
|
def sort(x,y): |
def sort(x,y): |
return cmp(x[0],y[0]) |
return cmp(x[0],y[0]) |
Line 565 def getSubCols(self, sortfield=None, sub
|
Line 555 def getSubCols(self, sortfield=None, sub
|
|
|
sortWithMD = lambda sortfield : (lambda x,y : sortfnc(sortfield,x,y)) |
sortWithMD = lambda sortfield : (lambda x,y : sortfnc(sortfield,x,y)) |
ids=[] |
ids=[] |
displayedObjects=self.ZopeFind(self,obj_metatypes=subColTypes) |
displayedObjects=self.ZopeFind(self,obj_metatypes=subColTypes,search_sub=search_sub) |
|
|
if searchSimple and (not (searchSimple==""))and hasattr(self,'resourceCatalog'): |
if searchSimple and (not (searchSimple==""))and hasattr(self,'resourceCatalog'): |
searchString=" AND ".join(searchSimple.split()) |
searchString=" AND ".join(searchSimple.split()) |
ids=[x.getObject() for x in self.resourceCatalog({'getMDValueSimpleSearchField':searchString})] |
ids=[x.getObject() for x in self.resourceCatalog({'getMDValueSimpleSearchField':searchString})] |
else: |
else: |
for entry in displayedObjects: |
for entry in displayedObjects: |
object=entry[1] |
object=entry[1] |
if searchMD and hasattr(object,'getMDValue'): |
if searchMD: |
|
if hasattr(object,'getMDValue'): |
flag=0 |
flag=0 |
for field in searchMD.keys(): |
for field in searchMD.keys(): |
#if object.getMDValue(field,generic=generic)==searchMD[field]: |
#if object.getMDValue(field,generic=generic)==searchMD[field]: |
Line 773 def zptFile(self, path, orphaned=False):
|
Line 765 def zptFile(self, path, orphaned=False):
|
# unusual case |
# unusual case |
pt=PageTemplateFile(os.path.join(package_home(globals()), path)) |
pt=PageTemplateFile(os.path.join(package_home(globals()), path)) |
else: |
else: |
|
|
pt=PageTemplateFile(os.path.join(package_home(globals()), path)).__of__(self) |
pt=PageTemplateFile(os.path.join(package_home(globals()), path)).__of__(self) |
return pt |
return pt |
|
|
Line 863 def writeMetadata(url,metadict,project=N
|
Line 856 def writeMetadata(url,metadict,project=N
|
metanode.appendChild(node) |
metanode.appendChild(node) |
|
|
if xmlfrag: |
if xmlfrag: |
geturl="""<?xml version="1.0" ?> |
geturl="""<?xml version="1.0" encoding="UTF-8" ?> |
<resource type="MPIWG"> |
<resource type="MPIWG"> |
<meta> |
<meta> |
<bib type="Book"> |
<bib type="Book"> |
Line 915 def writeMetadata(url,metadict,project=N
|
Line 908 def writeMetadata(url,metadict,project=N
|
metanode.removeChild(nodeOld[0]).unlink() |
metanode.removeChild(nodeOld[0]).unlink() |
|
|
metanodeneu=dom.createElement(metaData) |
metanodeneu=dom.createElement(metaData) |
metanodetext=dom.createTextNode(metadict[metaData]) |
metanodetext=dom.createTextNode(metadict[metaData].decode('utf-8')) |
#try: |
#try: |
#metanodetext=dom.createTextNode(unicode(metadict[metaData],"utf-8")) |
#metanodetext=dom.createTextNode(unicode(metadict[metaData],"utf-8")) |
#except: |
#except: |
Line 947 def writeMetadata(url,metadict,project=N
|
Line 940 def writeMetadata(url,metadict,project=N
|
updateTextToolNode('digiliburlprefix',digiliburlprefix) |
updateTextToolNode('digiliburlprefix',digiliburlprefix) |
|
|
try: |
try: |
return dom.toxml().encode('utf-8') |
return dom.toxml(encoding='utf-8').encode('utf-8') |
except: |
except: |
return dom.toxml('utf-8') |
return dom.toxml(encoding='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 997 def readMetadata(url):
|
Line 988 def readMetadata(url):
|
except: |
except: |
"""nothing""" |
"""nothing""" |
|
|
|
return (metadict,"") |
return metadict,"" |
|
|
|
|
|
class MapArea(SimpleItem): |
class MapArea(SimpleItem): |