version 1.310.2.1, 2011/10/13 07:48:27
|
version 1.310.2.5, 2012/01/18 16:57:00
|
Line 36 from Globals import Persistent, package_
|
Line 36 from Globals import Persistent, package_
|
from Acquisition import Implicit |
from Acquisition import Implicit |
from Products.ZCatalog.CatalogPathAwareness import CatalogAware |
from Products.ZCatalog.CatalogPathAwareness import CatalogAware |
from Products.ZCTextIndex.ZCTextIndex import manage_addLexicon |
from Products.ZCTextIndex.ZCTextIndex import manage_addLexicon |
|
from Acquisition import aq_parent |
try: |
try: |
from Products.MetaDataProvider.MetaDataClient import MetaDataClient |
from Products.MetaDataProvider.MetaDataClient import MetaDataClient |
except: |
except: |
Line 693 class ECHO_collection(CatalogAware, Fold
|
Line 694 class ECHO_collection(CatalogAware, Fold
|
meta_type='ECHO_collection' |
meta_type='ECHO_collection' |
default_catalog='resourceCatalog' |
default_catalog='resourceCatalog' |
|
|
|
rootMetaTypes = ['ECHO_root', 'ECHO_main', 'ECHO_nav'] |
|
|
# viewClassificationList=viewClassificationListMaster |
# viewClassificationList=viewClassificationListMaster |
displayTypes=displayTypes |
displayTypes=displayTypes |
|
|
Line 705 class ECHO_collection(CatalogAware, Fold
|
Line 708 class ECHO_collection(CatalogAware, Fold
|
return crumbs[0][2].getId() |
return crumbs[0][2].getId() |
|
|
p = self |
p = self |
|
|
sec = None |
sec = None |
# descend parents to the root (and remember the last id) |
# descend parents to the root (and remember the last id) |
while p is not None and p.meta_type != 'ECHO_root' and p.meta_type!='ECHO_main' and p.meta_type!='ECHO_nav': |
while p is not None and p.meta_type not in self.rootMetaTypes: |
sec = p.getId() |
sec = p.getId() |
p = p.aq_parent |
p = aq_parent(p.context) |
|
|
return sec |
return sec |
|
|
Line 724 class ECHO_collection(CatalogAware, Fold
|
Line 726 class ECHO_collection(CatalogAware, Fold
|
sec = None |
sec = None |
subsec = None |
subsec = None |
# descend parents to the root (and remember the last id) |
# descend parents to the root (and remember the last id) |
while p is not None and p.meta_type != 'ECHO_root' and p.meta_type!='ECHO_main' and p.meta_type!='ECHO_nav': |
while p is not None and p.meta_type not in self.rootMetaTypes: |
subsec = sec |
subsec = sec |
sec = p.getId() |
sec = p.getId() |
p = p.aq_parent |
p = aq_parent(p.context) |
|
|
return subsec |
return subsec |
|
|
|
def getHierCrumbs(self): |
|
"""returns a list of hierarchical breadcrumbs from self to the ECHO_root""" |
|
# crumb for this object |
|
crumb = {'obj': self, |
|
'url': self.absolute_url(), |
|
'label': self.getLabel()} |
|
crumbs = [crumb] |
|
# call the parent's method recursively |
|
parent = aq_parent(self) |
|
if hasattr(parent, 'getHierCrumbs'): |
|
if self.title: |
|
return parent.getHierCrumbs() + crumbs |
|
else: |
|
# if there's no title, skip this level |
|
return parent.getHierCrumbs() |
|
|
|
return crumbs |
|
|
|
|
|
|
def exportImportObjects_html(self,RESPONSE): |
def exportImportObjects_html(self,RESPONSE): |
"""ImportObject""" |
"""ImportObject""" |
Line 1130 class ECHO_collection(CatalogAware, Fold
|
Line 1151 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 1479 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 1496 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() |
Line 1526 class ECHO_collection(CatalogAware, Fold
|
Line 1553 class ECHO_collection(CatalogAware, Fold
|
|
|
def area_img(self): |
def area_img(self): |
"""area image""" |
"""area image""" |
bt = BrowserCheck(self) |
bt = browserType(self) |
if bt.isIE or bt.isN4: |
if bt['isIE'] or bt['isN4']: |
return sendFile(self, 'images/red.gif', 'image/gif') |
return sendFile(self, 'images/red.gif', 'image/gif') |
else: |
else: |
return sendFile(self, 'images/reda.png', 'image/png') |
return sendFile(self, 'images/reda.png', 'image/png') |
Line 1901 class ECHO_root(Folder,Persistent,Implic
|
Line 1928 class ECHO_root(Folder,Persistent,Implic
|
def getECHORoot(self): |
def getECHORoot(self): |
return self |
return self |
|
|
|
def getBrowserType(self): |
|
"""returns browserType object""" |
|
return browserType(self) |
|
|
def mod_re_sub(self,pattern,replace,string): |
def mod_re_sub(self,pattern,replace,string): |
"""re.sub aus mod re zur Verfuegung stellen""" |
"""re.sub aus mod re zur Verfuegung stellen""" |