version 1.289, 2007/07/19 11:02:28
|
version 1.296, 2008/11/16 12:15:42
|
Line 199 class ECHO_locale(ZopePageTemplate):
|
Line 199 class ECHO_locale(ZopePageTemplate):
|
self.lang=lang |
self.lang=lang |
self.title=title |
self.title=title |
self.label=label |
self.label=label |
if text: |
# default content |
|
if not text: |
|
text = open(self._default_content_fn).read() |
|
content_type = 'text/html' |
self.pt_edit(text, content_type) |
self.pt_edit(text, content_type) |
self.id=id |
self.id=id |
|
|
Line 218 class ECHO_locale(ZopePageTemplate):
|
Line 221 class ECHO_locale(ZopePageTemplate):
|
self.title=title |
self.title=title |
self.label=label |
self.label=label |
if not text is None: |
if not text is None: |
|
if content_type is None: |
|
content_type = self.content_type |
self.pt_edit(text, content_type) |
self.pt_edit(text, content_type) |
|
|
if RESPONSE is not None: |
if RESPONSE is not None: |
Line 307 class ECHO_layoutTemplate(ZopePageTempla
|
Line 312 class ECHO_layoutTemplate(ZopePageTempla
|
if text is None: |
if text is None: |
self._default_content_fn = os.path.join(package_home(globals()),'zpt','ECHO_%s_template_standard.zpt'%EchoType) |
self._default_content_fn = os.path.join(package_home(globals()),'zpt','ECHO_%s_template_standard.zpt'%EchoType) |
text = open(self._default_content_fn).read() |
text = open(self._default_content_fn).read() |
|
if content_type is None: |
|
content_type = self.content_type |
self.pt_edit(text, content_type) |
self.pt_edit(text, content_type) |
|
|
|
|
Line 415 class ECHO_resource(CatalogAware,Folder,
|
Line 422 class ECHO_resource(CatalogAware,Folder,
|
default_catalog='resourceCatalog' |
default_catalog='resourceCatalog' |
|
|
# viewClassificationList=viewClassificationListMaster |
# viewClassificationList=viewClassificationListMaster |
|
def setPID(self,pid): |
|
"""set the pid""" |
|
self.pid=pid |
|
return True |
|
|
|
def getPID(self): |
|
"""get the pid""" |
|
return getattr(self,'pid',None) |
|
|
def PrincipiaSearchSource(self): |
def PrincipiaSearchSource(self): |
"""Return cataloguable key for ourselves.""" |
"""Return cataloguable key for ourselves.""" |
Line 1379 class ECHO_resource(CatalogAware,Folder,
|
Line 1394 class ECHO_resource(CatalogAware,Folder,
|
|
|
ret= self.metaDataHash.get(fieldNameTest,empty) |
ret= self.metaDataHash.get(fieldNameTest,empty) |
|
|
if type(ret) is StringType: |
return unicodify(ret) |
return ret.decode('utf-8') |
|
else: |
|
return ret |
|
|
|
getFieldValue=getMDValue #depricated |
getFieldValue=getMDValue #depricated |
|
|
Line 2010 def manage_addECHO_linkForm(self):
|
Line 2022 def manage_addECHO_linkForm(self):
|
return pt() |
return pt() |
|
|
|
|
def manage_addECHO_link(self,id,title,label,description="",contentType="",responsible="",link="",weight="",coords=[],credits=None,RESPONSE=None): |
def manage_addECHO_link(self,id,title,label,description="",contentType="",responsible="",link="",weight="",coords=[],credits=None,linkType="external",RESPONSE=None): |
"""Add an external Link""" |
"""Add an external Link""" |
|
|
newObj=ECHO_link(id,link,title,label,description,contentType,responsible,credits,weight,coords) |
newObj=ECHO_link(id,link,title,label,description,contentType,responsible,credits,weight,coords,linkType) |
|
|
self._setObject(id,newObj) |
self._setObject(id,newObj) |
|
|
Line 2587 class ECHO_collection(CatalogAware, Fold
|
Line 2599 class ECHO_collection(CatalogAware, Fold
|
manage_addECHO_resource(self,id,title,label,description,responsible,link,metalink,weight,credits=None,coords=None,RESPONSE=None) |
manage_addECHO_resource(self,id,title,label,description,responsible,link,metalink,weight,credits=None,coords=None,RESPONSE=None) |
return "done" |
return "done" |
except: |
except: |
|
logging.error("ECHOcollection: (AddResource): %s %s"%sys.exc_info()[0:2]) |
|
return None |
|
|
|
def addResourceAndCreateLabelAndTitle(self,id,title,label,description,contentType,responsible,link,metalink,weight,credits=None,coords=None,RESPONSE=None): |
|
"""SSS""" |
|
ret = self.addResource(id,title,label,description,contentType,responsible,link,metalink,weight,credits,coords,RESPONSE) |
|
if ret is None: |
return None |
return None |
|
|
|
try: |
|
server2=getattr(self,id) |
|
server2.copyIndex_meta2echo_resource() |
|
server2.generate_label() |
|
server2.generate_title() |
|
except: |
|
logging.error("An Error occured adding the resource A\n %s %s"%sys.exc_info()[0:2]) |
|
return None |
|
return "done" |
def getSecondaryLink(self): |
def getSecondaryLink(self): |
"""secondary link""" |
"""secondary link""" |
try: |
try: |
Line 3511 class ECHO_root(Folder,Persistent,Implic
|
Line 3539 class ECHO_root(Folder,Persistent,Implic
|
"""ret attribute if existing""" |
"""ret attribute if existing""" |
try: |
try: |
|
|
return getattr(found,field).decode('ascii','ignore') |
return getattr(found,field)#.decode('utf-8','ignore') |
except: |
except: |
|
logging.error("can't: decode: %s"%repr(field)) |
|
logging.error(" %s %s"%(sys.exc_info()[0],sys.exc_info()[1])) |
return "" |
return "" |
|
|
security.declarePublic('getImageTag') |
security.declarePublic('getImageTag') |
Line 3749 class ECHO_root(Folder,Persistent,Implic
|
Line 3779 class ECHO_root(Folder,Persistent,Implic
|
|
|
def formatAscii(self,str,url=None): |
def formatAscii(self,str,url=None): |
"""ersetze ascii umbrueche durch <br>""" |
"""ersetze ascii umbrueche durch <br>""" |
#url=None |
|
|
if not str: |
|
return "" |
|
|
if url: |
if url: |
|
|
retStr="" |
retStr="" |
Line 3761 class ECHO_root(Folder,Persistent,Implic
|
Line 3794 class ECHO_root(Folder,Persistent,Implic
|
retStr+="""<a href="%s">%s</a><br/>"""%(strUrl,word) |
retStr+="""<a href="%s">%s</a><br/>"""%(strUrl,word) |
str=retStr |
str=retStr |
if str: |
if str: |
return re.sub(r"[\n]","<br/>",str) |
str = re.sub(r"[\n]","<br/>",str) |
|
return unicodify(str) |
else: |
else: |
return "" |
return u"" |
|
|
link2html=vlp_xmlhelpers.link2html |
link2html=vlp_xmlhelpers.link2html |
related2html=vlp_xmlhelpers.related2html |
related2html=vlp_xmlhelpers.related2html |
Line 4134 class ECHO_linkList(ZopePageTemplate,ECH
|
Line 4168 class ECHO_linkList(ZopePageTemplate,ECH
|
self.ZBindings_edit(self._default_bindings) |
self.ZBindings_edit(self._default_bindings) |
if text is None: |
if text is None: |
text = '' |
text = '' |
|
if content_type is None: |
|
content_type = self.content_type |
self.pt_edit(text, contentType) |
self.pt_edit(text, contentType) |
|
|
|
|