def publishTraverse(self, request, name): raise NotFound(self, name, request)
def add(self, names): raise NotFound(self.context, names, self.request)
def disable(self): """ See IFacetedSubtyper """ raise NotFound(self.context, 'disable', self.request)
def publishTraverse(self, request, name): if self.uid is None: self.uid = name else: raise NotFound(self, name, request) return self
def publishTraverse(self, request, name): if self.tg is None: # ../@@not_translated_yet/translationgroup self.tg = TranslationManager(name) else: raise NotFound(self, name, request) return self
def publishTraverse(self, request, name): if name == 'index.html': return self.index raise NotFound(self, name, request)
def __call__(self, scalename='thumb'): if self.display(scalename): return self.img(scalename) raise NotFound(self.request, scalename)
def traverse(self, name): bookingCalendar = queryAdapter(self.context, IBookingCalendar, name='') if bookingCalendar is None: raise NotFound(self.context, name, self.request) bookingCalendar.request = self.request return bookingCalendar
def publishTraverse(self, request, name): if self.transition is None: self.transition = name else: raise NotFound(self, name, request) return self
def publishTraverse(self, request, name): view = zope.component.queryMultiAdapter((self, request), name=name) if view is None or not IMethodPublisher.providedBy(view): raise NotFound(self, name, request) return view
def __call__(self): photo = self.context.photo if not photo: raise NotFound(self.context, u'photo', self.request) self.request.response.setHeader('Content-Type', "image/jpeg") return photo
def publishTraverse(self, request, name): """See IBrowserPublisher.""" # By default, a LaunchpadView cannot be traversed through. # Those that can be must override this method. raise NotFound(self, name, request=request)
def publishTraverse(self, request, name): """See zope.publisher.interfaces.browser.IBrowserPublisher.""" raise NotFound(self.context, name)
def publishTraverse(self, request, name): '''See interface IBrowserPublisher''' raise NotFound(None, name)
def __call__(self): uid = None itemindex = 0 if self.request.form.has_key('uid'): uid = self.request.form['uid'] if self.request.form.has_key('itemindex'): itemindex = self.request.form['itemindex'] if uid is not None: query = {'UID': uid} pdt = getToolByName(self.context, 'portal_discussion') cat = getToolByName(self.context, 'uid_catalog') resbrains = cat.searchResults(query) if len(resbrains) == 1: item = resbrains[0] contobj = item.getObject() fullpath = item.getPath() splitpath = fullpath.split('/')[:-1] prettypath = '/' + '/'.join(splitpath) URLsuffix = getListingTemplateForContextParent(item) pathlink = self.context.portal_url( ) + prettypath + '/' + URLsuffix pathtitle = prettypath lasttimestamp = DateTime().timeTime() lastcommentid = '0' showxmorelink = True commentscount = 0 xmorecomments = 0 replydict = [] isDiscussable = contobj.isDiscussable() canReply = canreply(contobj) jsondata = getjsondata(self.context, replydict, self.context.portal_url(), contobj.absolute_url()) if isDiscussable: dobj = pdt.getDiscussionFor(contobj) alldiscussions = dobj.objectValues() alldiscussions.sort( lambda x, y: cmp(x.modified(), y.modified()), reverse=True) maxdispcomments = get_displaycountforlist() lastxdiscussions = alldiscussions[:maxdispcomments] commentscount = dobj.replyCount(contobj) if commentscount > maxdispcomments: showxmorelink = True xmorecomments = commentscount - maxdispcomments elif commentscount > 0 and commentscount <= maxdispcomments: showxmorelink = False xmorecomments = 0 else: showxmorelink = True commentscount = 0 xmorecomments = 0 if len(alldiscussions) > 0: lasttimestamp = alldiscussions[0].modified().timeTime() lastcommentid = alldiscussions[0].id lastxdiscussions.sort( lambda x, y: cmp(x.modified(), y.modified())) for eachdisc in lastxdiscussions: reply = dobj.getReply(eachdisc.id) if reply <> None: replydict.append({ 'depth': 0, 'object': reply, 'showoutput': True }) other_data = { 'view_type': 'listview', 'canreply': str(canReply) } jsondata = getjsondata(self.context, replydict, self.context.portal_url(), contobj.absolute_url(), other_data) return self.template(item_type=contobj.portal_type, item_type_title=contobj.Type(), item=item, pathlink=pathlink, pathtitle=pathtitle, contobj=contobj, showxmorelink=showxmorelink, xmorecomments=xmorecomments, allowdiscussion=isDiscussable, usercanreply=canReply, uid=uid, reply_dict=jsondata, title=contobj.Title(), commentcount=commentscount, lasttimestamp=lasttimestamp, lastcommentid=lastcommentid, itemindex=itemindex, view_type='listview') else: raise NotFound('Object not found for request', 'Not found', self.request) else: raise NotFound('uid is not passed', 'Not found', self.request)