def _find_folder(self, container, entry): folder_url = os.path.dirname(entry['orig_url']) + '.html' if folder_url in [ 'http://oikoumene.org/en/resources/documents.html', 'http://oikoumene.org/de/dokumentation/documents.html', 'http://oikoumene.org/fr/documentation/documents.html', 'http://oikoumene.org/es/documentacion/documents.html', 'http://www.oikoumene.org/en/resources/documents.html', 'http://www.oikoumene.org/de/dokumentation/documents.html', 'http://www.oikoumene.org/fr/documentation/documents.html', 'http://www.oikoumene.org/es/documentacion/documents.html' ]: return container brain = container.portal_catalog(wcc_original_url=folder_url) if not brain: title = os.path.dirname(entry['orig_url']).replace('.html','') title = os.path.basename(title) folder_entry = { 'orig_url': folder_url, 'title': title, 'lang_urls':{}, 'id_url':None } folder = self._find_folder(container, folder_entry) return self._folder_factory(folder, folder_entry) else: result = brain[0].getObject() if not IATFolder.providedBy(result): return aq_parent(result) return result
def _is_document(self, item): if IATNewsItem.providedBy(item): return False if IDocument.providedBy(item): return True if IATFile.providedBy(item): return True if IATFolder.providedBy(item): return True return False
def subregional_churchbodies(self): intids = getUtility(IIntIds) result = [] for i in self.context.values(): if IATFolder.providedBy(i): data = { 'title': i.Title(), 'churchbodies': [ o for o in i.values() if IChurchBody.providedBy(o) ] } if data['churchbodies']: result.append(data) return result
def subregional_churchbodies(self): intids = getUtility(IIntIds) result = [] for i in self.context.values(): if IATFolder.providedBy(i): data = { 'title': i.Title(), 'churchbodies': [o for o in i.values() if IChurchBody.providedBy(o)] } if data['churchbodies']: result.append(data) return result
def is_dev_work_unmanaged(self): return IATFolder.providedBy( self.context) and not IManageDevWork.providedBy(self.context)