version 1.310.2.1, 2011/10/13 07:48:27
|
version 1.310.2.3, 2012/01/16 18:57:50
|
Line 1130 class ECHO_collection(CatalogAware, Fold
|
Line 1130 class ECHO_collection(CatalogAware, Fold
|
if RESPONSE is not None: |
if RESPONSE is not None: |
RESPONSE.write("<p>Done</p></body></html>") |
RESPONSE.write("<p>Done</p></body></html>") |
|
|
def changeViewerTemplateSets(self,project,xslt,thumbtemplate,topbar,digiLibTemplate,digiliburlprefix,RESPONSE=None): |
|
"""change the templates""" |
|
|
|
resources=self.ZopeFind(self,obj_metatypes=['ECHO_resource'],search_sub=1) |
|
|
|
for resource in resources: |
|
|
|
resource[1].changeViewerTemplateSet(project,xslt,thumbtemplate,topbar,digiLibTemplate,digiliburlprefix) |
|
|
|
if RESPONSE is not None: |
|
RESPONSE.redirect('manage_main') |
|
|
|
|
|
|
|
|
|
def copyTitleToInfoXMLFolder(self,RESPONSE=None): |
def copyTitleToInfoXMLFolder(self,RESPONSE=None): |
Line 1471 class ECHO_collection(CatalogAware, Fold
|
Line 1458 class ECHO_collection(CatalogAware, Fold
|
|
|
def showOverview(self): |
def showOverview(self): |
"""overview""" |
"""overview""" |
if 'ECHO_overview.html' in self.__dict__.keys(): |
# use ECHO_overview.html template in this instance |
return getattr(self,'ECHO_overview.html')() |
if 'ECHO_overview.html' in self: |
|
return self['ECHO_overview.html']() |
|
|
|
# use ECHO_overview_main template in path |
|
if hasattr(self, 'ECHO_overview_main'): |
|
return getattr(self, 'ECHO_overview_main')() |
|
|
|
# use template from Product |
pt=zptFile(self, 'zpt/ECHO_content_overview.zpt') |
pt=zptFile(self, 'zpt/ECHO_content_overview.zpt') |
return pt() |
return pt() |
|
|
Line 1481 class ECHO_collection(CatalogAware, Fold
|
Line 1475 class ECHO_collection(CatalogAware, Fold
|
def index_html(self): |
def index_html(self): |
"""standard page""" |
"""standard page""" |
if self.ZCacheable_isCachingEnabled(): |
if self.ZCacheable_isCachingEnabled(): |
|
|
result = self.ZCacheable_get() |
result = self.ZCacheable_get() |
if result is not None: |
if result is not None: |
# Got a cached value. |
# Got a cached value. |
return result |
return result |
|
|
if 'index.html' in self.__dict__.keys(): |
# old Zope 2.9 method |
ret=getattr(self,'index.html')() |
#if 'index.html' in self.__dict__.keys(): |
|
# ret=getattr(self,'index.html')() |
|
|
|
# use Zope 2.12 IContainer for child access |
|
if 'index.html' in self: |
|
# use index.html template if it exists |
|
ret = self['index.html']() |
|
|
elif 'overview' in self.__dict__.keys(): |
elif 'overview' in self: |
|
# use red-rectangle template when there's an 'overview' |
ret=self.showOverview() |
ret=self.showOverview() |
|
|
|
# use getattr for acquisition |
elif hasattr(self,'collection_index_template'): |
elif hasattr(self,'collection_index_template'): |
|
# use 'collection_index_template' in acquisition path |
ret=self.collection_index_template() |
ret=self.collection_index_template() |
elif hasattr(self,'main_index_template'): |
|
|
|
|
elif hasattr(self,'main_index_template'): |
|
# use 'main_index_template' in acquisition path |
ret=self.main_index_template.__of__(self)(self.main_template) |
ret=self.main_index_template.__of__(self)(self.main_template) |
|
|
else: |
else: |
|
# use template from Product |
pt=zptFile(self, 'zpt/ECHO_main_index_template_standard.zpt') |
pt=zptFile(self, 'zpt/ECHO_main_index_template_standard.zpt') |
pt.content_type="text/html" |
pt.content_type="text/html" |
ret=pt.render() |
ret=pt.render() |