def update_jc(self, results): """ Takes a catalog result to populate the self._jc_ attributes. """ self._jc_links = [ { 'rel': 'bookmark', 'href': view_url(self.context, i), 'prompt': i.Title, } for i in results ]
def update_jc(self, results): """ Instead of doing them as links these are items. The linked items MUST be able to provided a Collection+JSON view. """ self._jc_items = [{ 'href': view_url(self.context, i), 'data': [{ 'name': 'title', 'value': self.context.title, 'prompt': 'Title', }], } for i in results]
def update(self): results = self.context.queryCatalog() self._jc_links = [ { # XXX determine whether relation is the right one. # For the default one, 'section' might be better. 'rel': 'bookmark', 'href': view_url(self.context, i), 'prompt': i.Title, } for i in results ] href = '/'.join([self.context.absolute_url(), self.__name__]) self._jc_href = href
def update_jc(self, results): """ Takes a catalog result to populate the self._jc_ attributes. """ self._jc_links = [ { 'rel': 'bookmark', 'href': view_url(self.context, i), 'prompt': i.Title, } for i in results ] self._jc_items = [{ 'href': '%s/%s' % (self.context.absolute_url(), self.__name__), 'data': [{ 'name': 'title', 'value': self.context.title, 'prompt': 'Title', }], }]
def update_jc(self, results): pt = getToolByName(self.context, 'portal_url') portal = pt.getPortalObject() portal_url = portal.absolute_url() portal_path = '/'.join(portal.getPhysicalPath()) self._jc_items = [] for i in results: item = { 'href': view_url(self.context, i), 'data': [{ 'name': 'title', 'value': i.Title, 'prompt': 'Title', }], 'links': [{ 'href': portal_url + i.pmr2_exposure_workspace.replace(portal_path, ''), 'rel': 'source', 'prompt': 'Workspace', }], } self._jc_items.append(item)