Changeset 7647 for main/waeup.sirp/trunk
- Timestamp:
- 14 Feb 2012, 10:38:04 (13 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/browser/pages.py
r7600 r7647 33 33 IPrincipalRoleManager, IPrincipalRoleMap) 34 34 from zope.component import ( 35 getUtility, createObject,getAllUtilitiesRegisteredFor)35 getUtility, queryUtility, createObject, getAllUtilitiesRegisteredFor) 36 36 #from zope.component.interfaces import Invalid 37 37 from zope.event import notify … … 59 59 from waeup.sirp.authentication import get_principal_role_manager 60 60 from waeup.sirp.utils.helpers import get_user_account 61 from waeup.sirp.browser.layout import jsaction, action 61 from waeup.sirp.browser.layout import jsaction, action, UtilityView 62 62 63 63 grok.context(ISIRPObject) … … 316 316 def entries(self): 317 317 return () 318 319 class ReindexPage(UtilityView, grok.View): 320 """ Reindex view. 321 322 Reindexes a catalog. For managers only. 323 """ 324 grok.context(IUniversity) 325 grok.name('reindex') 326 grok.require('waeup.manageUniversity') 327 328 def update(self,ctlg=None): 329 if ctlg is None: 330 self.flash('No catalog name provided.') 331 return 332 cat = queryUtility(ICatalog, name='%s_catalog' % ctlg) 333 if cat is None: 334 self.flash('%s_catalog does not exist' % ctlg) 335 return 336 cat.updateIndexes() 337 self.flash('%s reindexed.' % ctlg.capitalize()) 338 return 339 340 def render(self): 341 self.redirect(self.url(self.context, '@@index')) 342 return 318 343 319 344 # -
main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py
r7646 r7647 1848 1848 return 1849 1849 1850 class ReindexPage(UtilityView, grok.View):1851 """ Reindex view.1852 1853 Reindexes a catalog.1854 """1855 grok.context(IUniversity)1856 grok.name('reindex')1857 grok.require('waeup.manageUniversity')1858 1859 def update(self,ctlg=None):1860 if ctlg is None:1861 self.flash('No catalog name provided.')1862 return1863 cat = queryUtility(ICatalog, name='%s_catalog' % ctlg)1864 if cat is None:1865 self.flash('%s_catalog does not exist' % ctlg)1866 return1867 cat.updateIndexes()1868 self.flash('%s reindexed.' % ctlg.capitalize())1869 return1870 1871 def render(self):1872 self.redirect(self.url(self.context, '@@index'))1873 return
Note: See TracChangeset for help on using the changeset viewer.