version 1.89, 2008/08/21 07:58:21
|
version 1.95, 2008/12/17 12:02:53
|
Line 27 def logger(txt,method,txt2):
|
Line 27 def logger(txt,method,txt2):
|
|
|
displayTypes = ['ZSQLExtendFolder','ZSQLBibliography','ECHO_group','ECHO_collection','ECHO_resource','ECHO_link','ECHO_sqlElement','ECHO_pageTemplate','ECHO_externalLink','ImageCollectionIFrame','VLP_resource','VLP_essay','ECHO_ZCatalogElement','ImageCollection','versionedFileFolder','extVersionedFileFolder','ECHO_movie'] |
displayTypes = ['ZSQLExtendFolder','ZSQLBibliography','ECHO_group','ECHO_collection','ECHO_resource','ECHO_link','ECHO_sqlElement','ECHO_pageTemplate','ECHO_externalLink','ImageCollectionIFrame','VLP_resource','VLP_essay','ECHO_ZCatalogElement','ImageCollection','versionedFileFolder','extVersionedFileFolder','ECHO_movie'] |
|
|
|
def normalizeCt(str): |
|
"""normalizes content_type""" |
|
#str= str.replace(" ","_") |
|
return str.replace("-"," ").lower() |
|
|
#decode and compress for xmlrpc communication with OSAS_server |
#decode and compress for xmlrpc communication with OSAS_server |
|
|
Line 84 class ECHO_basis:
|
Line 88 class ECHO_basis:
|
management_page_charset="utf-8" |
management_page_charset="utf-8" |
isVisible = True |
isVisible = True |
|
|
|
# Managment for the PID |
|
def setPID(self,pid): |
|
"""set the pid""" |
|
self.pid=pid |
|
return True |
|
|
|
def getPID(self): |
|
"""get the pid""" |
|
pid =getattr(self,'pid',None) |
|
|
|
# teste ob dieses pid wirklich die des objektes und nich vererbt wurde |
|
if pid == self.getParentPID(): |
|
return None |
|
else: |
|
return pid |
|
|
|
def getParentPID(self): |
|
"""get the PID of the parent""" |
|
parent = self.aq_parent |
|
|
|
pidF = getattr(parent,'getPID',None) |
|
|
|
if pidF is None: |
|
return None |
|
|
|
else: |
|
return pidF() |
|
|
def unicodify(self, s): |
def unicodify(self, s): |
"""return unicode object for string (utf-8 or latin1) or unicode object s""" |
"""return unicode object for string (utf-8 or latin1) or unicode object s""" |
Line 207 class ECHO_basis:
|
Line 238 class ECHO_basis:
|
return self.isVisible |
return self.isVisible |
return True |
return True |
|
|
|
def getDescription(self): |
|
"""get content of description field""" |
|
|
|
|
|
return self.unicodify(getattr(self,'description','')); |
|
|
def getTitle(self): |
def getTitle(self): |
"""title""" |
"""title""" |
if hasattr(self,'getLanguage'): |
if hasattr(self,'getLanguage'): |
Line 419 class ECHO_basis:
|
Line 456 class ECHO_basis:
|
"""generate map link""" |
"""generate map link""" |
bt = BrowserCheck(self) |
bt = BrowserCheck(self) |
id = ob.getFullId() |
id = ob.getFullId() |
link = ob.getLinkId() |
url = ob.getTargetUrl() |
|
if url == "": |
|
# ECHOResource with empty link -> no link |
|
href = 'href="#" onclick="return false;"' |
|
else: |
|
href = 'href="%s"'%ob.getLinkId() |
|
|
|
if target is None: |
|
targetattr = "" |
|
else: |
|
targetattr = 'target="%s"'%target |
|
|
if text is None: |
if text is None: |
text = ob.getLabel() |
text = ob.getLabel() |
|
|
if text is None: |
if text is None: |
text = "link" |
text = "link" |
|
|
tiptext = ob.getTip() |
tiptext = ob.getTip() |
tag = "" |
tag = "" |
if bt.isN4: |
if bt.isN4: |
# N4 needs layer for highlighting |
# N4 needs layer for highlighting |
tag += '<ilayer id="a.%s"><a class="maplink" onmouseover="highlightPair(\'%s\', true)" onmouseout="highlightPair(\'%s\', false)" href="%s" target="%s"'%(id,id,id,link,target) |
tag += '<ilayer id="a.%s"><a class="maplink" onmouseover="highlightPair(\'%s\', true)" onmouseout="highlightPair(\'%s\', false)" %s %s'%(id,id,id,href,targetattr) |
tag += ">" + text + "</a></ilayer>" |
tag += ">" + text + "</a></ilayer>" |
else: |
else: |
# a-element |
# a-element |
tag = '<a id="a.%s" class="maplink" onmouseover="highlightPair(\'%s\', true)" onmouseout="highlightPair(\'%s\', false)" href="%s" target="%s"'%(id,id,id,link,target) |
tag = '<a id="a.%s" class="maplink" onmouseover="highlightPair(\'%s\', true)" onmouseout="highlightPair(\'%s\', false)" %s %s'%(id,id,id,href,targetattr) |
if tiptext: |
if tiptext: |
tag += ' title="%s"'%tiptext |
tag += ' title="%s"'%tiptext |
tag += ">" + text + "</a>" |
tag += ">" + text + "</a>" |
Line 443 class ECHO_basis:
|
Line 493 class ECHO_basis:
|
bt = BrowserCheck(self) |
bt = BrowserCheck(self) |
id = ob.getFullId() |
id = ob.getFullId() |
link = ob.getLinkId() |
link = ob.getLinkId() |
|
url = ob.getTargetUrl() |
|
if url == "": |
|
# ECHOResource with empty link -> no link |
|
href = 'href="#" onclick="return false;"' |
|
else: |
|
href = 'href="%s"'%ob.getLinkId() |
|
|
|
if target is None: |
|
targetattr = "" |
|
else: |
|
targetattr = 'target="%s"'%target |
tiptext = ob.getTip() |
tiptext = ob.getTip() |
tag = "" |
tag = "" |
|
|
Line 468 class ECHO_basis:
|
Line 529 class ECHO_basis:
|
|
|
if float(rot) < 0: |
if float(rot) < 0: |
marksrc = circlesrc |
marksrc = circlesrc |
tag += '<a href="%s"><img border="0" src="%s&rot=%s" /></a>'%(link,marksrc,rot) |
tag += '<a %s><img border="0" src="%s&rot=%s" /></a>'%(href,marksrc,rot) |
elif ob.isTypeText(): |
elif ob.isTypeText(): |
# N4 - Text |
# N4 - Text |
tag += '<div id="t.%s" class="maptext"'%(id) |
tag += '<div id="t.%s" class="maptext"'%(id) |
Line 477 class ECHO_basis:
|
Line 538 class ECHO_basis:
|
tag += '</div>' |
tag += '</div>' |
else: |
else: |
# N4 - Area |
# N4 - Area |
tag += '<a href="%s"><img border="0" width="1000" height="1000" src="trans_img"'%(link) |
tag += '<a %s><img border="0" width="1000" height="1000" src="trans_img"'%(href) |
if tiptext: |
if tiptext: |
tag += ' alt="%s"'%tiptext |
tag += ' alt="%s"'%tiptext |
tag += ' /></a>' |
tag += ' /></a>' |
Line 486 class ECHO_basis:
|
Line 547 class ECHO_basis:
|
# |
# |
# (more or less) DOM capable browser |
# (more or less) DOM capable browser |
# |
# |
tag = '<a id="b.%s" class="mapmarklink" onmouseover="highlightPair(\'%s\', true)" onmouseout="highlightPair(\'%s\', false)" href="%s" target="%s">'%(id,id,id,link,target) |
tag = '<a id="b.%s" class="mapmarklink" onmouseover="highlightPair(\'%s\', true)" onmouseout="highlightPair(\'%s\', false)" %s %s>'%(id,id,id,href,targetattr) |
if ob.isTypeArrow(): |
if ob.isTypeArrow(): |
# DOM - Arrow |
# DOM - Arrow |
rot = ob.angle |
rot = ob.angle |
Line 1229 class MapArea(SimpleItem):
|
Line 1290 class MapArea(SimpleItem):
|
return self.aq_parent.label or self.aq_parent.id |
return self.aq_parent.label or self.aq_parent.id |
return self.label |
return self.label |
|
|
|
def getTargetUrl(self): |
|
"""returns the URL of the linked object""" |
|
if hasattr(self, 'aq_parent'): |
|
p = self.aq_parent |
|
# ECHOResource and ECHOLink have 'link' attribute |
|
if hasattr(p, 'link'): |
|
if p.link is None: |
|
# return empty string for empty link |
|
return "" |
|
else: |
|
return p.link |
|
|
|
# return None for unknown type |
|
return None |
|
|
def setLabel(self, label): |
def setLabel(self, label): |
"""sets the label""" |
"""sets the label""" |
self.label = label |
self.label = label |