Changeset 7321
- Timestamp:
- 10 Dec 2011, 06:15:17 (13 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp
- Files:
-
- 85 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/__init__.py
r7137 r7321 1 1 import grok 2 from waeup.sirp.interfaces import I WAeUPObject2 from waeup.sirp.interfaces import ISIRPObject 3 3 from zope.annotation.attribute import AttributeAnnotations 4 4 from zope.annotation.interfaces import IAnnotations 5 5 6 class WAeUPAttributeAnnotations(AttributeAnnotations, grok.Adapter):7 """An adapter to IAnnotations for any WAeUPObject.6 class SIRPAttributeAnnotations(AttributeAnnotations, grok.Adapter): 7 """An adapter to IAnnotations for any SIRPObject. 8 8 9 Providing this adapter, each WAeUP object becomes (attribute)9 Providing this adapter, each SIRP object becomes (attribute) 10 10 annotatable. 11 11 """ 12 12 grok.provides(IAnnotations) 13 grok.context(I WAeUPObject)13 grok.context(ISIRPObject) -
main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/accesscode.py
r7195 r7321 31 31 from hurry.workflow.interfaces import IWorkflowInfo, IWorkflowState 32 32 from random import SystemRandom as random 33 from waeup.sirp.interfaces import I WAeUPSIRPPluggable, IObjectHistory33 from waeup.sirp.interfaces import ISIRPPluggable, IObjectHistory 34 34 from waeup.sirp.accesscodes.interfaces import ( 35 35 IAccessCode, IAccessCodeBatch, IAccessCodeBatchContainer … … 398 398 class AccessCodePlugin(grok.GlobalUtility): 399 399 grok.name('accesscodes') 400 grok.implements(I WAeUPSIRPPluggable)400 grok.implements(ISIRPPluggable) 401 401 402 402 def setup(self, site, name, logger): -
main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/accesscode.txt
r6632 r7321 7 7 8 8 .. :NOdoctest: 9 .. :NOlayer: waeup.sirp.testing. WAeUPSIRPUnitTestLayer9 .. :NOlayer: waeup.sirp.testing.SIRPUnitTestLayer 10 10 11 11 About access-codes … … 591 591 .. class:: AccessCodePlugin 592 592 593 A `waeup.sirp` plugin that updates existing WAeUPSIRP university593 A `waeup.sirp` plugin that updates existing SIRP university 594 594 instances so that they provide support for access-codes. 595 595 596 .. attribute:: grok.implements(I WAeUPSIRPPluggable)596 .. attribute:: grok.implements(ISIRPPluggable) 597 597 .. attribute:: grok.name('accesscodes') 598 598 … … 608 608 609 609 The AccessCodePlugin is available as a global named utility for the 610 I WAeUPSIRPPluggable interface named ``accesscodes``.610 ISIRPPluggable interface named ``accesscodes``. 611 611 612 612 It is looked up by a university instance when created, so that this … … 615 615 616 616 >>> from zope.component import getUtility 617 >>> from waeup.sirp.interfaces import I WAeUPSIRPPluggable618 >>> plugin = getUtility(I WAeUPSIRPPluggable, name='accesscodes')617 >>> from waeup.sirp.interfaces import ISIRPPluggable 618 >>> plugin = getUtility(ISIRPPluggable, name='accesscodes') 619 619 >>> plugin 620 620 <waeup.sirp.accesscodes.accesscodes.AccessCodePlugin object at 0x...> -
main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/browser.py
r7195 r7321 22 22 from hurry.workflow.interfaces import InvalidTransitionError 23 23 from waeup.sirp.browser.resources import datatable 24 from waeup.sirp.browser import WAeUPPage, WAeUPAddFormPage24 from waeup.sirp.browser import SIRPPage, SIRPAddFormPage 25 25 from waeup.sirp.browser.breadcrumbs import Breadcrumb 26 26 from waeup.sirp.browser.viewlets import ( 27 27 AdminTask, AddActionButton, SearchActionButton, BatchOpButton, ManageLink) 28 from waeup.sirp.interfaces import I WAeUPObject28 from waeup.sirp.interfaces import ISIRPObject 29 29 30 30 from waeup.sirp.accesscodes.interfaces import ( … … 33 33 from waeup.sirp.accesscodes.catalog import search 34 34 35 grok.context(I WAeUPObject)36 37 class BatchContainerPage( WAeUPPage):35 grok.context(ISIRPObject) 36 37 class BatchContainerPage(SIRPPage): 38 38 grok.name('index') 39 39 grok.context(IAccessCodeBatchContainer) … … 61 61 self.flash('Deleted batch %s' % name) 62 62 63 class AddBatchPage( WAeUPAddFormPage):63 class AddBatchPage(SIRPAddFormPage): 64 64 grok.name('add') 65 65 grok.context(IAccessCodeBatchContainer) … … 89 89 self.redirect(self.url(self.context)) 90 90 91 class ReimportBatchPage( WAeUPPage):91 class ReimportBatchPage(SIRPPage): 92 92 """Screen for reimporting AC batches. 93 93 """ … … 123 123 self.redirect(self.url(self.context)) 124 124 125 class BatchContainerSearchPage( WAeUPPage):125 class BatchContainerSearchPage(SIRPPage): 126 126 grok.name('search') 127 127 grok.context(IAccessCodeBatchContainer) -
main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/browser.txt
r6932 r7321 4 4 .. module:: waeup.sirp.accesscodes.browser 5 5 6 Here we visit the access-code related parts of a WAeUPSIRP site using6 Here we visit the access-code related parts of a SIRP site using 7 7 a virtual browser. 8 8 -
main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/interfaces.py
r7195 r7321 20 20 from zope import schema 21 21 from zope.interface import Interface 22 from waeup.sirp.interfaces import I WAeUPObject22 from waeup.sirp.interfaces import ISIRPObject 23 23 24 class IAccessCode(I WAeUPObject):24 class IAccessCode(ISIRPObject): 25 25 """An access code. 26 26 """ … … 91 91 ) 92 92 93 class IAccessCodeBatchContainer(I WAeUPObject):93 class IAccessCodeBatchContainer(ISIRPObject): 94 94 """A container for access code batches. 95 95 """ -
main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/tests/test_accesscode.py
r7195 r7321 29 29 from zope.testing import renormalizing 30 30 from waeup.sirp.app import University 31 from waeup.sirp.interfaces import IObjectHistory, I WAeUPSIRPPluggable31 from waeup.sirp.interfaces import IObjectHistory, ISIRPPluggable 32 32 from waeup.sirp.testing import ( 33 33 FunctionalLayer, FunctionalTestCase, setUp, tearDown, getRootFolder) … … 412 412 def test_iface(self): 413 413 plugin = AccessCodePlugin() 414 assert verifyObject(I WAeUPSIRPPluggable, plugin)415 assert verifyClass(I WAeUPSIRPPluggable, AccessCodePlugin)414 assert verifyObject(ISIRPPluggable, plugin) 415 assert verifyClass(ISIRPPluggable, AccessCodePlugin) 416 416 417 417 def test_update_w_ac_container(self): -
main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/workflow.py
r7195 r7321 24 24 from hurry.workflow.interfaces import IWorkflowState, IWorkflowTransitionEvent 25 25 from waeup.sirp.accesscodes.interfaces import IAccessCode 26 from waeup.sirp.interfaces import IObjectHistory, I WAeUPWorkflowInfo27 from waeup.sirp.workflow import WAeUPWorkflow, WAeUPWorkflowInfo26 from waeup.sirp.interfaces import IObjectHistory, ISIRPWorkflowInfo 27 from waeup.sirp.workflow import SIRPWorkflow, SIRPWorkflowInfo 28 28 29 29 INITIALIZED = 'initialized' … … 104 104 ) 105 105 106 accesscode_workflow = WAeUPWorkflow(ACCESSCODE_TRANSITIONS)106 accesscode_workflow = SIRPWorkflow(ACCESSCODE_TRANSITIONS) 107 107 108 108 class AccessCodeWorkflowState(WorkflowState, grok.Adapter): … … 113 113 state_id = 'wf.accesscode.id' 114 114 115 class AccessCodeWorkflowInfo( WAeUPWorkflowInfo, grok.Adapter):115 class AccessCodeWorkflowInfo(SIRPWorkflowInfo, grok.Adapter): 116 116 grok.context(IAccessCode) 117 grok.provides(I WAeUPWorkflowInfo)117 grok.provides(ISIRPWorkflowInfo) 118 118 119 119 def __init__(self, context): -
main/waeup.sirp/trunk/src/waeup/sirp/app.py
r7193 r7321 26 26 from waeup.sirp.hostels.container import HostelsContainer 27 27 from waeup.sirp.interfaces import ( 28 IUniversity, I WAeUPSIRPPluggable, IObjectUpgradeEvent, )28 IUniversity, ISIRPPluggable, IObjectUpgradeEvent, ) 29 29 from waeup.sirp.userscontainer import UsersContainer 30 30 from waeup.sirp.utils.logger import Logger … … 64 64 """Create instances of all plugins defined somewhere. 65 65 """ 66 for name, plugin in getUtilitiesFor(I WAeUPSIRPPluggable):66 for name, plugin in getUtilitiesFor(ISIRPPluggable): 67 67 plugin.setup(self, name, self.logger) 68 68 return … … 76 76 self.logger.info('Done.') 77 77 self.logger.info('Now upgrading any plugins.') 78 for name, plugin in getUtilitiesFor(I WAeUPSIRPPluggable):78 for name, plugin in getUtilitiesFor(ISIRPPluggable): 79 79 plugin.update(self, name, self.logger) 80 80 self.logger.info('Plugin update finished.') -
main/waeup.sirp/trunk/src/waeup/sirp/app.txt
r7172 r7321 1 :mod:`waeup.sirp.app` -- central components for a WAeUP portal2 **************************************************** **********1 :mod:`waeup.sirp.app` -- central components for SIRP 2 **************************************************** 3 3 4 4 .. :doctest: 5 .. :layer: waeup.sirp.testing. WAeUPSIRPUnitTestLayer5 .. :layer: waeup.sirp.testing.SIRPUnitTestLayer 6 6 7 7 .. module:: waeup.sirp.app … … 9 9 .. class:: University 10 10 11 The main WAeUP application object is given with11 The main SIRP application object is given with 12 12 :class:`University`. It provides the main containers as faculties, 13 13 hostels, etc. … … 76 76 first:: 77 77 78 >>> from waeup.sirp.interfaces import I WAeUPExporter79 >>> exporter = I WAeUPExporter(myuniversity)78 >>> from waeup.sirp.interfaces import ISIRPExporter 79 >>> exporter = ISIRPExporter(myuniversity) 80 80 >>> exporter 81 81 <waeup.sirp.utils.importexport.Exporter object at 0x...> … … 90 90 memory file:: 91 91 92 >>> from waeup.sirp.interfaces import I WAeUPXMLExporter93 >>> exporter = I WAeUPXMLExporter(myuniversity)92 >>> from waeup.sirp.interfaces import ISIRPXMLExporter 93 >>> exporter = ISIRPXMLExporter(myuniversity) 94 94 >>> f = exporter.export() 95 95 >>> f … … 103 103 </pickle> 104 104 105 WAeUPSIRP plugins106 ============ ======105 SIRP plugins 106 ============ 107 107 108 108 waeup.sirp provides an API to 'plugin' components. Things that should 109 be setup at creation time of a WAeUPSIRP application can indicate110 that by providing a utility providing I WAeUPSIRPPlugin.109 be setup at creation time of a SIRP application can indicate 110 that by providing a utility providing ISIRPPlugin. 111 111 112 112 The plugins are looked up by an created app, which then will call the 113 113 ``setup()`` method of each plugin. 114 114 115 >>> from waeup.sirp.interfaces import I WAeUPSIRPPluggable115 >>> from waeup.sirp.interfaces import ISIRPPluggable 116 116 >>> from zope.component import getAdapters, getUtilitiesFor 117 >>> sorted(list(getUtilitiesFor(I WAeUPSIRPPluggable)))117 >>> sorted(list(getUtilitiesFor(ISIRPPluggable))) 118 118 [(u'accesscodes', <waeup.sirp.accesscodes...AccessCodePlugin ...)] 119 119 … … 122 122 123 123 >>> import grok 124 >>> from waeup.sirp.interfaces import I WAeUPSIRPPluggable124 >>> from waeup.sirp.interfaces import ISIRPPluggable 125 125 >>> class MyPlugin(grok.GlobalUtility): 126 ... grok.implements(I WAeUPSIRPPluggable)126 ... grok.implements(ISIRPPluggable) 127 127 ... def setup(self, site, name, logger): 128 128 ... print "Setup was called for" … … 136 136 True 137 137 138 and setup a new WAeUPSIRP instance, we will get a message:138 and setup a new SIRP instance, we will get a message: 139 139 140 140 >>> from waeup.sirp.app import University -
main/waeup.sirp/trunk/src/waeup/sirp/applicants/applicant.py
r7270 r7321 24 24 from hurry.workflow.interfaces import IWorkflowInfo, IWorkflowState 25 25 from waeup.sirp.app import University 26 from waeup.sirp.image import WAeUPImageFile26 from waeup.sirp.image import SIRPImageFile 27 27 from waeup.sirp.imagestorage import DefaultFileStoreHandler 28 28 from waeup.sirp.interfaces import ( … … 220 220 ApplicantImageStoreHandler, self).createFile( 221 221 store, root, filename, file_id, file) 222 return file, path, WAeUPImageFile(222 return file, path, SIRPImageFile( 223 223 file_obj.filename, file_obj.data) 224 224 -
main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser.py
r7318 r7321 34 34 from reportlab.platypus.tables import TableStyle 35 35 from waeup.sirp.browser import ( 36 WAeUPPage, WAeUPEditFormPage, WAeUPAddFormPage, WAeUPDisplayFormPage)36 SIRPPage, SIRPEditFormPage, SIRPAddFormPage, SIRPDisplayFormPage) 37 37 from waeup.sirp.browser.breadcrumbs import Breadcrumb 38 38 from waeup.sirp.browser.layout import NullValidator … … 41 41 from waeup.sirp.browser.viewlets import ManageActionButton, PrimaryNavTab 42 42 from waeup.sirp.interfaces import ( 43 I WAeUPObject, ILocalRolesAssignable, IExtFileStore,43 ISIRPObject, ILocalRolesAssignable, IExtFileStore, 44 44 IFileStoreNameChooser, IPasswordValidator, IUserAccount) 45 45 from waeup.sirp.permissions import get_users_with_local_roles … … 60 60 from waeup.sirp.students.interfaces import IStudentsUtils 61 61 62 grok.context(I WAeUPObject) # Make IWAeUPObject the default context63 64 class ApplicantsRootPage( WAeUPPage):62 grok.context(ISIRPObject) # Make ISIRPObject the default context 63 64 class ApplicantsRootPage(SIRPPage): 65 65 grok.context(IApplicantsRoot) 66 66 grok.name('index') … … 81 81 text = 'Manage application section' 82 82 83 class ApplicantsRootManageFormPage( WAeUPEditFormPage):83 class ApplicantsRootManageFormPage(SIRPEditFormPage): 84 84 grok.context(IApplicantsRoot) 85 85 grok.name('manage') … … 151 151 return del_local_roles(self,2,**data) 152 152 153 class ApplicantsContainerAddFormPage( WAeUPAddFormPage):153 class ApplicantsContainerAddFormPage(SIRPAddFormPage): 154 154 grok.context(IApplicantsRoot) 155 155 grok.require('waeup.manageApplication') … … 229 229 """Applicants tab in primary navigation. 230 230 """ 231 grok.context(I WAeUPObject)231 grok.context(ISIRPObject) 232 232 grok.order(3) 233 233 grok.require('waeup.viewApplicantsTab') … … 273 273 return self.view.application_url() + rel_link 274 274 275 class ApplicantsContainerPage( WAeUPDisplayFormPage):275 class ApplicantsContainerPage(SIRPDisplayFormPage): 276 276 """The standard view for regular applicant containers. 277 277 """ … … 311 311 # target = 'login' 312 312 313 class ApplicantsContainerManageFormPage( WAeUPEditFormPage):313 class ApplicantsContainerManageFormPage(SIRPEditFormPage): 314 314 grok.context(IApplicantsContainer) 315 315 grok.name('manage') … … 404 404 return del_local_roles(self,3,**data) 405 405 406 class ApplicantAddFormPage( WAeUPAddFormPage):406 class ApplicantAddFormPage(SIRPAddFormPage): 407 407 """Add-form to add an applicant. 408 408 """ … … 431 431 return 432 432 433 class ApplicantDisplayFormPage( WAeUPDisplayFormPage):433 class ApplicantDisplayFormPage(SIRPDisplayFormPage): 434 434 grok.context(IApplicant) 435 435 grok.name('index') … … 532 532 533 533 534 class OnlinePaymentDisplayFormPage( WAeUPDisplayFormPage):534 class OnlinePaymentDisplayFormPage(SIRPDisplayFormPage): 535 535 """ Page to view an online payment ticket 536 536 """ … … 700 700 pdf.setAuthor('%s (%s)' % (self.request.principal.title, 701 701 self.request.principal.id)) 702 pdf.setCreator(' WAeUP SIRP')702 pdf.setCreator('SIRP SIRP') 703 703 width, height = A4 704 704 style = getSampleStyleSheet() … … 802 802 return True 803 803 804 class ApplicantManageFormPage( WAeUPEditFormPage):804 class ApplicantManageFormPage(SIRPEditFormPage): 805 805 """A full edit view for applicant data. 806 806 """ -
main/waeup.sirp/trunk/src/waeup/sirp/applicants/interfaces.py
r7317 r7321 30 30 from waeup.sirp.schema import TextLineChoice 31 31 from waeup.sirp.interfaces import ( 32 I WAeUPObject, year_range, validate_email, academic_sessions_vocab)32 ISIRPObject, year_range, validate_email, academic_sessions_vocab) 33 33 from waeup.sirp.university.vocabularies import application_categories 34 34 from waeup.sirp.students.vocabularies import ( … … 118 118 factory.container_title, factory.container_description) 119 119 120 class IApplicantsRoot(I WAeUPObject, IContainer):120 class IApplicantsRoot(ISIRPObject, IContainer): 121 121 """A container for university applicants containers. 122 122 """ 123 123 pass 124 124 125 class IApplicantsContainer(I WAeUPObject):125 class IApplicantsContainer(ISIRPObject): 126 126 """An applicants container contains university applicants. 127 127 … … 275 275 'provider'].order = IApplicantsContainer['provider'].order 276 276 277 class IApplicantBaseData(I WAeUPObject):277 class IApplicantBaseData(ISIRPObject): 278 278 """The data for an applicant. 279 279 -
main/waeup.sirp/trunk/src/waeup/sirp/applicants/root.py
r7192 r7321 23 23 from hurry.query.interfaces import IQuery 24 24 from zope.component import getUtility 25 from waeup.sirp.interfaces import I WAeUPSIRPPluggable25 from waeup.sirp.interfaces import ISIRPPluggable 26 26 from waeup.sirp.applicants.interfaces import IApplicantsRoot 27 27 from waeup.sirp.utils.helpers import get_current_principal … … 49 49 50 50 class ApplicantsPlugin(grok.GlobalUtility): 51 """A WAeUPSIRPPlugin that creates an applicants root in portal.51 """A SIRPPlugin that creates an applicants root in portal. 52 52 53 53 This plugin should be called by a typical … … 56 56 the main site configuration. 57 57 58 Implements :class:`waeup.sirp.interfaces.I WAeUPSIRPPluggable`58 Implements :class:`waeup.sirp.interfaces.ISIRPPluggable` 59 59 """ 60 60 grok.name('applicants') 61 grok.implements(I WAeUPSIRPPluggable)61 grok.implements(ISIRPPluggable) 62 62 log_prefix = 'ApplicantsPlugin' 63 63 -
main/waeup.sirp/trunk/src/waeup/sirp/applicants/tests/test_applicant.py
r7260 r7321 26 26 from zope.interface import verify, implements 27 27 from zope.location.interfaces import ILocation 28 from waeup.sirp.image.interfaces import I WAeUPImageFile28 from waeup.sirp.image.interfaces import ISIRPImageFile 29 29 from waeup.sirp.imagestorage import DefaultStorage 30 30 from waeup.sirp.interfaces import IFileStoreHandler, IFileStoreNameChooser … … 38 38 class FakeImageLocation(object): 39 39 implements(ILocation) 40 adapts(I WAeUPImageFile)40 adapts(ISIRPImageFile) 41 41 def __init__(self, context): 42 42 pass -
main/waeup.sirp/trunk/src/waeup/sirp/applicants/vocabularies.py
r7192 r7321 20 20 from zope.component import getUtility 21 21 from zope.catalog.interfaces import ICatalog 22 from waeup.sirp.interfaces import Simple WAeUPVocabulary22 from waeup.sirp.interfaces import SimpleSIRPVocabulary 23 23 from waeup.sirp.students.vocabularies import CertificateSource 24 24 … … 37 37 ) 38 38 39 #: A :class:`waeup.sirp.interfaces.Simple WAeUPVocabulary` of supported39 #: A :class:`waeup.sirp.interfaces.SimpleSIRPVocabulary` of supported 40 40 #: application or screening types. 41 application_types_vocab = Simple WAeUPVocabulary(41 application_types_vocab = SimpleSIRPVocabulary( 42 42 *[(x[0],x[1]) for x in APPLICATION_TYPES]) 43 application_pins_vocab = Simple WAeUPVocabulary(43 application_pins_vocab = SimpleSIRPVocabulary( 44 44 *[(u"%s (%s)" % (x[2],x[0]),x[2]) for x in APPLICATION_TYPES]) 45 45 -
main/waeup.sirp/trunk/src/waeup/sirp/applicants/workflow.py
r7250 r7321 22 22 from hurry.workflow.interfaces import IWorkflowState, IWorkflowTransitionEvent 23 23 from waeup.sirp.applicants.interfaces import IApplicantBaseData 24 from waeup.sirp.interfaces import IObjectHistory, I WAeUPWorkflowInfo25 from waeup.sirp.workflow import WAeUPWorkflow, WAeUPWorkflowInfo24 from waeup.sirp.interfaces import IObjectHistory, ISIRPWorkflowInfo 25 from waeup.sirp.workflow import SIRPWorkflow, SIRPWorkflowInfo 26 26 from waeup.sirp.utils.helpers import get_current_principal 27 27 … … 127 127 ) 128 128 129 application_workflow = WAeUPWorkflow(APPLICATION_TRANSITIONS)129 application_workflow = SIRPWorkflow(APPLICATION_TRANSITIONS) 130 130 131 131 class ApplicationWorkflowState(WorkflowState, grok.Adapter): … … 138 138 state_id = 'wf.application.id' 139 139 140 class ApplicationWorkflowInfo( WAeUPWorkflowInfo, grok.Adapter):140 class ApplicationWorkflowInfo(SIRPWorkflowInfo, grok.Adapter): 141 141 """Adapter to adapt Applicant objects to workflow info objects. 142 142 """ 143 143 grok.context(IApplicantBaseData) 144 grok.provides(I WAeUPWorkflowInfo)144 grok.provides(ISIRPWorkflowInfo) 145 145 146 146 def __init__(self, context): -
main/waeup.sirp/trunk/src/waeup/sirp/authentication.py
r7315 r7321 16 16 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 ## 18 """Authentication for WAeUP portals.18 """Authentication for SIRP. 19 19 """ 20 20 import grok … … 63 63 return principalRoleManager 64 64 65 class WAeUPSessionCredentialsPlugin(grok.GlobalUtility,65 class SIRPSessionCredentialsPlugin(grok.GlobalUtility, 66 66 SessionCredentialsPlugin): 67 67 grok.provides(ICredentialsPlugin) -
main/waeup.sirp/trunk/src/waeup/sirp/authentication.txt
r7185 r7321 1 WAeUP portalauthentication2 ******************* ********1 SIRP authentication 2 ******************* 3 3 4 4 We need to protect most pieces of our portals from unauthenticated -
main/waeup.sirp/trunk/src/waeup/sirp/browser/__init__.py
r7274 r7321 2 2 3 3 from waeup.sirp.browser.layout import ( 4 WAeUPPage, WAeUPForm, WAeUPLayout, WAeUPDisplayFormPage, WAeUPEditFormPage,5 WAeUPAddFormPage, NullValidator)4 SIRPPage, SIRPForm, SIRPLayout, SIRPDisplayFormPage, SIRPEditFormPage, 5 SIRPAddFormPage, NullValidator) 6 6 from waeup.sirp.browser.pages import ContactAdminForm 7 7 -
main/waeup.sirp/trunk/src/waeup/sirp/browser/breadcrumbs.py
r7195 r7321 33 33 """ 34 34 grok.provides(IBreadcrumb) 35 grok.context(interfaces.I WAeUPObject)35 grok.context(interfaces.ISIRPObject) 36 36 grok.name('index') 37 37 -
main/waeup.sirp/trunk/src/waeup/sirp/browser/browser.txt
r7234 r7321 1 Browsing the WAeUP portal2 ************* ************3 4 Here we visit all parts of a WAeUP portal using a browser.1 Browsing SIRP 2 ************* 3 4 Here we visit all parts of a SIRP portal using a browser. 5 5 6 6 University -
main/waeup.sirp/trunk/src/waeup/sirp/browser/exceptions.py
r7195 r7321 22 22 from zope.publisher.interfaces import INotFound 23 23 from zope.security.interfaces import IUnauthorized 24 from waeup.sirp.browser.layout import WAeUPPage24 from waeup.sirp.browser.layout import SIRPPage 25 25 26 26 grok.templatedir('templates') … … 61 61 62 62 63 class NotFoundPage( WAeUPPage):63 class NotFoundPage(SIRPPage): 64 64 """A page rendered when an object cannot be found. 65 65 -
main/waeup.sirp/trunk/src/waeup/sirp/browser/interfaces.py
r7308 r7321 21 21 from zope.interface import Interface, Attribute 22 22 from waeup.sirp.interfaces import ( 23 I WAeUPObject, IUniversity, IUsersContainer, IDataCenter)23 ISIRPObject, IUniversity, IUsersContainer, IDataCenter) 24 24 from waeup.sirp.university.interfaces import ( 25 25 IFacultyContainer, IFaculty, IFacultyAdd, IDepartment, IDepartmentAdd, -
main/waeup.sirp/trunk/src/waeup/sirp/browser/layout.py
r7274 r7321 29 29 from zope.interface import Interface 30 30 from zope.site.hooks import getSite 31 from waeup.sirp.interfaces import I WAeUPObject, IUserAccount31 from waeup.sirp.interfaces import ISIRPObject, IUserAccount 32 32 from waeup.sirp.browser.interfaces import ITheme 33 from waeup.sirp.browser.theming import get_all_themes, WAeUPThemeGray133 from waeup.sirp.browser.theming import get_all_themes, SIRPThemeGray1 34 34 from waeup.sirp.students.interfaces import IStudentNavigation 35 35 from waeup.sirp.applicants.interfaces import IApplicant … … 101 101 return True 102 102 103 class WAeUPLayout(Layout, UtilityView):103 class SIRPLayout(Layout, UtilityView): 104 104 """A megrok.layout.Layout with additional methods. 105 105 """ 106 106 grok.baseclass() 107 107 108 class WAeUPForm(Form, UtilityView):108 class SIRPForm(Form, UtilityView): 109 109 """A megrok.layout.Form with additional methods. 110 110 """ … … 112 112 113 113 def setUpWidgets(self,ignore_request=False): 114 super( WAeUPForm,self).setUpWidgets(ignore_request)114 super(SIRPForm,self).setUpWidgets(ignore_request) 115 115 if self.widgets.get('subject'): 116 116 self.widgets['subject'].displayWidth = 45 … … 120 120 self.widgets['body'].width = 35 121 121 122 class WAeUPPage(Page):122 class SIRPPage(Page): 123 123 """A megrok.layout page with additional methods. 124 124 """ 125 125 grok.baseclass() 126 126 127 class WAeUPDisplayFormPage(DisplayForm, UtilityView):127 class SIRPDisplayFormPage(DisplayForm, UtilityView): 128 128 """A megrok.layout.DisplayForm with additional methods. 129 129 """ … … 131 131 template = default_waeup_display_template 132 132 133 class WAeUPEditFormPage(EditForm, UtilityView):133 class SIRPEditFormPage(EditForm, UtilityView): 134 134 """A megrok.layout.EditForm with additional methods. 135 135 """ … … 138 138 139 139 def setUpWidgets(self,ignore_request=False): 140 super( WAeUPEditFormPage,self).setUpWidgets(ignore_request)140 super(SIRPEditFormPage,self).setUpWidgets(ignore_request) 141 141 if self.widgets.get('title'): 142 142 self.widgets['title'].displayWidth = 80 … … 148 148 self.widgets['notice'].height = 3 149 149 150 class WAeUPAddFormPage(AddForm, UtilityView):150 class SIRPAddFormPage(AddForm, UtilityView): 151 151 """A megrok.layout.AddForm with additional methods. 152 152 """ … … 154 154 template = default_waeup_edit_template 155 155 156 class SiteLayout( WAeUPLayout):156 class SiteLayout(SIRPLayout): 157 157 """ The general site layout. 158 158 """ 159 grok.context(I WAeUPObject)159 grok.context(ISIRPObject) 160 160 161 161 #: An instance of the default theme to use for the site layout 162 default_theme = WAeUPThemeGray1()162 default_theme = SIRPThemeGray1() 163 163 stafftemp = grok.PageTemplateFile('templates/staffsitelayout.pt') 164 164 studenttemp = grok.PageTemplateFile('templates/studentsitelayout.pt') -
main/waeup.sirp/trunk/src/waeup/sirp/browser/pages.py
r7274 r7321 16 16 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 ## 18 """ Viewing components for WAeUP objects.18 """ Viewing components for SIRP objects. 19 19 """ 20 20 import copy … … 38 38 from zope.session.interfaces import ISession 39 39 from waeup.sirp.browser import ( 40 WAeUPPage, WAeUPForm, WAeUPEditFormPage, WAeUPAddFormPage,41 WAeUPDisplayFormPage, NullValidator)40 SIRPPage, SIRPForm, SIRPEditFormPage, SIRPAddFormPage, 41 SIRPDisplayFormPage, NullValidator) 42 42 from waeup.sirp.browser.interfaces import ( 43 43 IUniversity, IFacultyContainer, IFaculty, IFacultyAdd, … … 46 46 from waeup.sirp.browser.resources import warning, datepicker, tabs, datatable 47 47 from waeup.sirp.interfaces import( 48 I WAeUPObject, IUsersContainer, IUserAccount, IDataCenter,49 I WAeUPXMLImporter, IWAeUPXMLExporter, IBatchProcessor,48 ISIRPObject, IUsersContainer, IUserAccount, IDataCenter, 49 ISIRPXMLImporter, ISIRPXMLExporter, IBatchProcessor, 50 50 ILocalRolesAssignable, DuplicationError, IConfigurationContainer, 51 51 ISessionConfiguration, ISessionConfigurationAdd, … … 60 60 from waeup.sirp.utils.helpers import get_user_account, send_mail 61 61 62 grok.context(I WAeUPObject)62 grok.context(ISIRPObject) 63 63 grok.templatedir('templates') 64 64 … … 139 139 # 140 140 141 class LoginPage( WAeUPPage):141 class LoginPage(SIRPPage): 142 142 """A login page, available for all objects. 143 143 """ 144 144 grok.name('login') 145 grok.context(I WAeUPObject)145 grok.context(ISIRPObject) 146 146 grok.require('waeup.Public') 147 147 title = u'Login' … … 174 174 175 175 176 class LogoutPage( WAeUPPage):176 class LogoutPage(SIRPPage): 177 177 """A logout page. Calling this page will log the current user out. 178 178 """ 179 grok.context(I WAeUPObject)179 grok.context(ISIRPObject) 180 180 grok.require('waeup.Public') 181 181 grok.name('logout') … … 185 185 auth = getUtility(IAuthentication) 186 186 ILogout(auth).logout(self.request) 187 self.flash("You have been logged out. Thanks for using WAeUP SIRP!")187 self.flash("You have been logged out. Thanks for using SIRP SIRP!") 188 188 self.redirect(self.application_url()) 189 189 … … 192 192 # 193 193 194 class ContactAdminForm( WAeUPForm):194 class ContactAdminForm(SIRPForm): 195 195 grok.name('contactadmin') 196 196 #grok.context(IUniversity) … … 263 263 # 264 264 265 class UniversityPage( WAeUPDisplayFormPage):265 class UniversityPage(SIRPDisplayFormPage): 266 266 """ The main university page. 267 267 """ … … 286 286 return view.widgets['frontpage']() 287 287 288 class AdministrationPage( WAeUPPage):288 class AdministrationPage(SIRPPage): 289 289 """ The administration overview page. 290 290 """ … … 333 333 # 334 334 335 class UsersContainerPage( WAeUPPage):335 class UsersContainerPage(SIRPPage): 336 336 """Overview page for all local users. 337 337 """ … … 370 370 return site_roles_string 371 371 372 class AddUserFormPage( WAeUPAddFormPage):372 class AddUserFormPage(SIRPAddFormPage): 373 373 grok.require('waeup.manageUsers') 374 374 grok.context(IUsersContainer) … … 407 407 self.redirect(self.url(self.context)) 408 408 409 class UserManageFormPage( WAeUPEditFormPage):409 class UserManageFormPage(SIRPEditFormPage): 410 410 """Manage a user account. 411 411 """ … … 499 499 return "%s (%s)" % (self.context.title, self.context.__name__) 500 500 501 class MyRolesPage( WAeUPPage):501 class MyRolesPage(SIRPPage): 502 502 """Display site roles and local roles assigned to officers. 503 503 """ … … 535 535 # 536 536 537 class SearchPage( WAeUPPage):537 class SearchPage(SIRPPage): 538 538 """General search page for the academics section. 539 539 """ … … 562 562 # 563 563 564 class ConfigurationContainerDisplayFormPage( WAeUPDisplayFormPage):564 class ConfigurationContainerDisplayFormPage(SIRPDisplayFormPage): 565 565 """View page of the configuration container. 566 566 """ … … 574 574 form_fields['frontpage'].custom_widget = ReSTDisplayWidget 575 575 576 class ConfigurationContainerManageFormPage( WAeUPEditFormPage):576 class ConfigurationContainerManageFormPage(SIRPEditFormPage): 577 577 """Manage page of the configuration container. We always use the 578 578 manage page in the UI not the view page, thus we use the index name here. … … 629 629 return 630 630 631 class SessionConfigurationAddFormPage( WAeUPAddFormPage):631 class SessionConfigurationAddFormPage(SIRPAddFormPage): 632 632 """Add a session configuration object to configuration container. 633 633 """ … … 657 657 return 658 658 659 class SessionConfigurationManageFormPage( WAeUPEditFormPage):659 class SessionConfigurationManageFormPage(SIRPEditFormPage): 660 660 """Manage session configuration object. 661 661 """ … … 692 692 # 693 693 694 class DatacenterPage( WAeUPPage):694 class DatacenterPage(SIRPPage): 695 695 grok.context(IDataCenter) 696 696 grok.name('index') … … 699 699 pnav = 0 700 700 701 class DatacenterUploadPage( WAeUPPage):701 class DatacenterUploadPage(SIRPPage): 702 702 grok.context(IDataCenter) 703 703 grok.name('upload') … … 743 743 return '%s_%s%s' % (base, filtered_username, ext.lower()) 744 744 745 class DatacenterImportStep1( WAeUPPage):745 class DatacenterImportStep1(SIRPPage): 746 746 """Manual import step 1: choose file 747 747 """ … … 773 773 self.redirect(self.url(self.context, '@@import2')) 774 774 775 class DatacenterImportStep2( WAeUPPage):775 class DatacenterImportStep2(SIRPPage): 776 776 """Manual import step 2: choose importer 777 777 """ … … 891 891 self.flash(warnings) 892 892 893 class DatacenterImportStep3( WAeUPPage):893 class DatacenterImportStep3(SIRPPage): 894 894 """Manual import step 3: modify header 895 895 """ … … 995 995 self.flash(warnings) 996 996 997 class DatacenterImportStep4( WAeUPPage):997 class DatacenterImportStep4(SIRPPage): 998 998 """Manual import step 4: do actual import 999 999 """ … … 1052 1052 linenum - (self.warn_num))) 1053 1053 1054 class DatacenterLogsOverview( WAeUPPage):1054 class DatacenterLogsOverview(SIRPPage): 1055 1055 grok.context(IDataCenter) 1056 1056 grok.name('logs') … … 1073 1073 self.files = self.context.getLogFiles() 1074 1074 1075 class DatacenterLogsFileview( WAeUPPage):1075 class DatacenterLogsFileview(SIRPPage): 1076 1076 grok.context(IDataCenter) 1077 1077 grok.name('show') … … 1092 1092 self.filecontents = open(fullpath, 'rb').read() 1093 1093 1094 class DatacenterSettings( WAeUPPage):1094 class DatacenterSettings(SIRPPage): 1095 1095 grok.context(IDataCenter) 1096 1096 grok.name('manage') … … 1132 1132 1133 1133 def render(self): 1134 exporter = I WAeUPXMLExporter(self.context)1134 exporter = ISIRPXMLExporter(self.context) 1135 1135 xml = exporter.export().read() 1136 1136 self.response.setHeader( … … 1138 1138 return xml 1139 1139 1140 class ImportXMLPage( WAeUPPage):1140 class ImportXMLPage(SIRPPage): 1141 1141 """Replace the context object by an object created from an XML 1142 1142 representation. … … 1154 1154 if not xmlfile: 1155 1155 return 1156 importer = I WAeUPXMLImporter(self.context)1156 importer = ISIRPXMLImporter(self.context) 1157 1157 obj = importer.doImport(xmlfile) 1158 1158 if type(obj) != type(self.context): … … 1175 1175 # 1176 1176 1177 class FacultyContainerPage( WAeUPPage):1177 class FacultyContainerPage(SIRPPage): 1178 1178 """ Index page for faculty containers. 1179 1179 """ … … 1186 1186 grok.template('facultypage') 1187 1187 1188 class FacultyContainerManageFormPage( WAeUPEditFormPage):1188 class FacultyContainerManageFormPage(SIRPEditFormPage): 1189 1189 """Manage the basic properties of a `Faculty` instance. 1190 1190 """ … … 1224 1224 1225 1225 1226 class FacultyAddFormPage( WAeUPAddFormPage):1226 class FacultyAddFormPage(SIRPAddFormPage): 1227 1227 """ Page form to add a new faculty to a faculty container. 1228 1228 """ … … 1253 1253 # Faculty pages 1254 1254 # 1255 class FacultyPage( WAeUPPage):1255 class FacultyPage(SIRPPage): 1256 1256 """Index page of faculties. 1257 1257 """ … … 1269 1269 return 'Departments' 1270 1270 1271 class FacultyManageFormPage( WAeUPEditFormPage):1271 class FacultyManageFormPage(SIRPEditFormPage): 1272 1272 """Manage the basic properties of a `Faculty` instance. 1273 1273 """ … … 1341 1341 return del_local_roles(self,3,**data) 1342 1342 1343 class DepartmentAddFormPage( WAeUPAddFormPage):1343 class DepartmentAddFormPage(SIRPAddFormPage): 1344 1344 """Add a department to a faculty. 1345 1345 """ … … 1374 1374 # Department pages 1375 1375 # 1376 class DepartmentPage( WAeUPPage):1376 class DepartmentPage(SIRPPage): 1377 1377 """Department index page. 1378 1378 """ … … 1407 1407 yield(dict(url=url, name=key, container=val)) 1408 1408 1409 class ShowStudentsPage( WAeUPPage):1409 class ShowStudentsPage(SIRPPage): 1410 1410 """Page that lists all students in the department. 1411 1411 """ … … 1430 1430 return 1431 1431 1432 class DepartmentManageFormPage( WAeUPEditFormPage):1432 class DepartmentManageFormPage(SIRPEditFormPage): 1433 1433 """Manage the basic properties of a `Department` instance. 1434 1434 """ … … 1530 1530 return del_local_roles(self,4,**data) 1531 1531 1532 class CourseAddFormPage( WAeUPAddFormPage):1532 class CourseAddFormPage(SIRPAddFormPage): 1533 1533 """Add-form to add course to a department. 1534 1534 """ … … 1571 1571 return 1572 1572 1573 class CertificateAddFormPage( WAeUPAddFormPage):1573 class CertificateAddFormPage(SIRPAddFormPage): 1574 1574 """Add-form to add certificate to a department. 1575 1575 """ … … 1616 1616 # Courses pages 1617 1617 # 1618 class CoursePage( WAeUPPage):1618 class CoursePage(SIRPPage): 1619 1619 """Course index page. 1620 1620 """ … … 1629 1629 return 'Course: %s (%s)' % (self.context.title, self.context.code) 1630 1630 1631 class CourseManageFormPage( WAeUPEditFormPage):1631 class CourseManageFormPage(SIRPEditFormPage): 1632 1632 """Edit form page for courses. 1633 1633 """ … … 1663 1663 # Certificate pages 1664 1664 # 1665 class CertificatePage( WAeUPDisplayFormPage):1665 class CertificatePage(SIRPDisplayFormPage): 1666 1666 """Index page for certificates. 1667 1667 """ … … 1683 1683 return super(CertificatePage, self).update() 1684 1684 1685 class CertificateManageFormPage( WAeUPEditFormPage):1685 class CertificateManageFormPage(SIRPEditFormPage): 1686 1686 """Manage the properties of a `Certificate` instance. 1687 1687 """ … … 1738 1738 1739 1739 1740 class CertificateCourseAddFormPage( WAeUPAddFormPage):1740 class CertificateCourseAddFormPage(SIRPAddFormPage): 1741 1741 """Add-page to add a course ref to a certificate 1742 1742 """ … … 1771 1771 # Certificate course pages... 1772 1772 # 1773 class CertificateCoursePage( WAeUPPage):1773 class CertificateCoursePage(SIRPPage): 1774 1774 """CertificateCourse index page. 1775 1775 """ … … 1788 1788 return course_levels.getTerm(self.context.level).title 1789 1789 1790 class CertificateCourseManageFormPage( WAeUPEditFormPage):1790 class CertificateCourseManageFormPage(SIRPEditFormPage): 1791 1791 """Manage the basic properties of a `CertificateCourse` instance. 1792 1792 """ -
main/waeup.sirp/trunk/src/waeup/sirp/browser/resources.py
r7280 r7321 257 257 depends=[reset_fonts_grids]) 258 258 259 #: Register basic WAeUP base CSS (which is based on ``yuiapp.css`` as a259 #: Register basic SIRP base CSS (which is based on ``yuiapp.css`` as a 260 260 #: resource. 261 261 waeup_base_css = ResourceInclusion( … … 263 263 depends=[yuiapp_css, base]) 264 264 265 #: The red WAeUP theme registered as a resource.265 #: The red SIRP theme registered as a resource. 266 266 waeuptheme_red1 = ResourceInclusion( 267 267 waeup_sirp, 'waeuptheme-red1.css', 268 268 depends=[waeup_base_css]) 269 269 270 #: The gray WAeUP theme registered as a resource.270 #: The gray SIRP theme registered as a resource. 271 271 waeuptheme_gray1 = ResourceInclusion( 272 272 waeup_sirp, 'waeuptheme-gray1.css', -
main/waeup.sirp/trunk/src/waeup/sirp/browser/static/waeup-base.css
r7240 r7321 1 /* This is the base stylesheet for WAeUPSIRP. It defines base styles1 /* This is the base stylesheet for SIRP. It defines base styles 2 2 additionally or modifying yuiapp.css styles and yuirfg.css. For themes, please create 3 3 a stylesheet overriding values set here in a file named -
main/waeup.sirp/trunk/src/waeup/sirp/browser/theming.py
r7195 r7321 23 23 from zope.interface import Interface 24 24 from zope.schema.interfaces import IVocabularyFactory 25 from waeup.sirp.interfaces import Simple WAeUPVocabulary25 from waeup.sirp.interfaces import SimpleSIRPVocabulary 26 26 from waeup.sirp.browser.interfaces import ITheme 27 27 from waeup.sirp.browser.resources import ( … … 30 30 ) 31 31 32 class WAeUPThemeBase(grok.GlobalUtility):32 class SIRPThemeBase(grok.GlobalUtility): 33 33 grok.implements(ITheme) 34 34 grok.name('base waeup theme') … … 39 39 return [waeup_base_css] 40 40 41 class WAeUPThemeRed1(grok.GlobalUtility):41 class SIRPThemeRed1(grok.GlobalUtility): 42 42 grok.implements(ITheme) 43 43 grok.name('red waeup theme') … … 48 48 return [waeuptheme_red1] 49 49 50 class WAeUPThemeGray1(grok.GlobalUtility):50 class SIRPThemeGray1(grok.GlobalUtility): 51 51 grok.implements(ITheme) 52 52 grok.name('gray waeup theme') … … 57 57 return [waeuptheme_gray1] 58 58 59 class WAeUPThemeEmpty(grok.GlobalUtility):59 class SIRPThemeEmpty(grok.GlobalUtility): 60 60 """A theme based on jQuery only. 61 61 … … 113 113 terms = [(theme.description, name) 114 114 for name, theme in get_all_themes()] 115 vocab = Simple WAeUPVocabulary(*terms)115 vocab = SimpleSIRPVocabulary(*terms) 116 116 return vocab -
main/waeup.sirp/trunk/src/waeup/sirp/browser/viewlets.py
r7243 r7321 28 28 IFacultyContainer, IFaculty, IDepartment, ICourse, ICertificate, 29 29 ICertificateCourse, IBreadcrumbContainer, IUniversity, IUsersContainer) 30 from waeup.sirp.interfaces import (I WAeUPObject, IWAeUPXMLExporter,31 I WAeUPXMLImporter, IDataCenter, IUserAccount)32 from waeup.sirp.browser.layout import WAeUPPage, default_primary_nav_template30 from waeup.sirp.interfaces import (ISIRPObject, ISIRPXMLExporter, 31 ISIRPXMLImporter, IDataCenter, IUserAccount) 32 from waeup.sirp.browser.layout import SIRPPage, default_primary_nav_template 33 33 from waeup.sirp.utils.helpers import get_user_account 34 34 35 35 grok.templatedir('templates') 36 grok.context(I WAeUPObject) # Make IWAeUPObject the default context36 grok.context(ISIRPObject) # Make ISIRPObject the default context 37 37 38 38 class LeftSidebar(grok.ViewletManager): … … 74 74 """ 75 75 grok.baseclass() 76 grok.context(I WAeUPObject)76 grok.context(ISIRPObject) 77 77 grok.viewletmanager(ActionBar) 78 78 icon = 'actionicon_modify.png' # File must exist in static/ … … 185 185 186 186 class BreadCrumbs(grok.Viewlet): 187 grok.context(I WAeUPObject)187 grok.context(ISIRPObject) 188 188 grok.viewletmanager(BreadCrumbManager) 189 189 grok.order(1) … … 227 227 grok.baseclass() 228 228 grok.viewletmanager(LeftSidebar) 229 grok.context(I WAeUPObject)229 grok.context(ISIRPObject) 230 230 grok.order(5) 231 231 grok.require('waeup.manageUniversity') … … 279 279 """ 280 280 grok.viewletmanager(LeftSidebar) 281 grok.context(I WAeUPObject)281 grok.context(ISIRPObject) 282 282 grok.view(Interface) 283 283 grok.order(2) … … 313 313 """ 314 314 grok.viewletmanager(LeftSidebar) 315 grok.context(I WAeUPObject)315 grok.context(ISIRPObject) 316 316 grok.view(Interface) 317 317 grok.order(5) … … 519 519 class BrowseActionButton(ActionButton): 520 520 grok.baseclass() 521 grok.context(I WAeUPObject)521 grok.context(ISIRPObject) 522 522 grok.template('actionbutton') 523 523 grok.viewletmanager(ActionBar) -
main/waeup.sirp/trunk/src/waeup/sirp/catalog.py
r7193 r7321 31 31 32 32 # not yet used 33 class WAeUPQuery(Query):33 class SIRPQuery(Query): 34 34 """A hurry.query-like query that supports also ``apply``. 35 35 """ … … 50 50 return results 51 51 52 grok.global_utility( WAeUPQuery)52 grok.global_utility(SIRPQuery) 53 53 54 54 # not yet used -
main/waeup.sirp/trunk/src/waeup/sirp/catalog.txt
r5140 r7321 1 :mod:`waeup.sirp.catalog` -- Cataloging support for WAeUPSIRP2 **************************************************** **********1 :mod:`waeup.sirp.catalog` -- Cataloging support SIRP 2 **************************************************** 3 3 4 4 .. module:: waeup.sirp.catalog 5 5 6 6 Components that support cataloging and searching objects inside a 7 WAeUPSIRP site.7 SIRP site. 8 8 9 9 .. :doctest: 10 .. :layer: waeup.sirp.testing. WAeUPSIRPUnitTestLayer10 .. :layer: waeup.sirp.testing.SIRPUnitTestLayer 11 11 12 12 .. contents:: … … 15 15 ======= 16 16 17 :class:` WAeUPQuery`18 ------------------ -19 20 .. class:: WAeUPQuery()17 :class:`SIRPQuery` 18 ------------------ 19 20 .. class:: SIRPQuery() 21 21 22 22 .. attribute:: grok.implements(hurry.query.interfaces.IQuery) … … 25 25 retrival of plain ``Bree`` result sets as used inside a catalog. 26 26 27 Like `hurry.query.query.Query` objects, ` WAeUPQuery` is some kind27 Like `hurry.query.query.Query` objects, `SIRPQuery` is some kind 28 28 of a meta query or 'compound query' that can give the cataloged 29 29 objects (or their int ids) matching one or more 'subqueries'. … … 55 55 ------------------------------ 56 56 57 We can get a WAeUPQuery object by asking for an unnamed global utility57 We can get a SIRPQuery object by asking for an unnamed global utility 58 58 implementing `hurry.query.interfaces.IQuery`: 59 59 … … 62 62 >>> q = getUtility(IQuery) 63 63 >>> q 64 <waeup.sirp.catalog. WAeUPQuery object at 0x...>64 <waeup.sirp.catalog.SIRPQuery object at 0x...> 65 65 66 66 This query can get 'subqueries' and delivers the objects found or … … 101 101 102 102 We also setup a `zope.intid.interfaces.IIntIds` utility. This is not 103 necessary for plain catalogs, but when we want to use WAeUPQuery (or103 necessary for plain catalogs, but when we want to use SIRPQuery (or 104 104 `hurry.query.query.Query` objects), as to get a unique mapping from 105 105 objects (stored in ZODB) to integer numbers (stored in catalogs), … … 204 204 205 205 This can be done by using the ``searchResults`` method of 206 `` WAeUPQuery``:206 ``SIRPQuery``: 207 207 208 208 >>> r2 = q.searchResults(subquery1) -
main/waeup.sirp/trunk/src/waeup/sirp/datacenter.py
r7193 r7321 16 16 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 ## 18 """ WAeUP data center.18 """SIRP data center. 19 19 20 20 The waeup data center cares for management of upload data and provides -
main/waeup.sirp/trunk/src/waeup/sirp/datacenter.txt
r5140 r7321 1 WAeUP Data Center2 **************** *3 4 The WAeUP data center cares for managing CSV files and importing then.1 SIRP Data Center 2 **************** 3 4 The SIRP data center cares for managing CSV files and importing then. 5 5 6 6 .. :doctest: 7 .. :layer: waeup.sirp.testing. WAeUPSIRPUnitTestLayer7 .. :layer: waeup.sirp.testing.SIRPUnitTestLayer 8 8 9 9 Creating a data center -
main/waeup.sirp/trunk/src/waeup/sirp/hostels/browser.py
r7257 r7321 21 21 import sys 22 22 from waeup.sirp.browser import ( 23 WAeUPEditFormPage, WAeUPAddFormPage, WAeUPDisplayFormPage,23 SIRPEditFormPage, SIRPAddFormPage, SIRPDisplayFormPage, 24 24 NullValidator) 25 25 from waeup.sirp.browser.breadcrumbs import Breadcrumb … … 29 29 from waeup.sirp.browser.viewlets import ( 30 30 ManageActionButton, PrimaryNavTab) 31 from waeup.sirp.interfaces import I WAeUPObject31 from waeup.sirp.interfaces import ISIRPObject 32 32 from waeup.sirp.hostels.vocabularies import NOT_OCCUPIED 33 33 from waeup.sirp.hostels.hostel import Hostel … … 57 57 """ 58 58 59 grok.context(I WAeUPObject)59 grok.context(ISIRPObject) 60 60 grok.order(5) 61 61 grok.require('waeup.viewHostels') … … 91 91 return 'Block %s, Room %s, Bed %s' % (co[1], co[2], co[3]) 92 92 93 class HostelsContainerPage( WAeUPDisplayFormPage):93 class HostelsContainerPage(SIRPDisplayFormPage): 94 94 """The standard view for hostels containers. 95 95 """ … … 109 109 text = 'Manage accommodation section' 110 110 111 class HostelsContainerManagePage( WAeUPDisplayFormPage):111 class HostelsContainerManagePage(SIRPDisplayFormPage): 112 112 """The manage page for hostel containers. 113 113 """ … … 141 141 return 142 142 143 class HostelAddFormPage( WAeUPAddFormPage):143 class HostelAddFormPage(SIRPAddFormPage): 144 144 """Add-form to add a hostel. 145 145 """ … … 169 169 return 170 170 171 class HostelDisplayFormPage( WAeUPDisplayFormPage):171 class HostelDisplayFormPage(SIRPDisplayFormPage): 172 172 """ Page to display hostel data 173 173 """ … … 194 194 target = 'manage' 195 195 196 class HostelManageFormPage( WAeUPEditFormPage):196 class HostelManageFormPage(SIRPEditFormPage): 197 197 """ View to edit hostel data 198 198 """ … … 294 294 return 295 295 296 class BedManageFormPage( WAeUPEditFormPage):296 class BedManageFormPage(SIRPEditFormPage): 297 297 """ View to edit bed data 298 298 """ -
main/waeup.sirp/trunk/src/waeup/sirp/hostels/interfaces.py
r7257 r7321 18 18 from zope.interface import invariant, Invalid 19 19 from zope import schema 20 from waeup.sirp.interfaces import I WAeUPObject20 from waeup.sirp.interfaces import ISIRPObject 21 21 from waeup.sirp.hostels.vocabularies import ( 22 22 bed_letters, blocks, special_handling, StudentSource) 23 23 24 class IHostelsContainer(I WAeUPObject):24 class IHostelsContainer(ISIRPObject): 25 25 """A container for all kind of hostel objects. 26 26 27 27 """ 28 28 29 class IHostel(I WAeUPObject):29 class IHostel(ISIRPObject): 30 30 """A base representation of hostels. 31 31 … … 145 145 raise Invalid('Bed categories overlap.') 146 146 147 class IBed(I WAeUPObject):147 class IBed(ISIRPObject): 148 148 """A base representation of beds. 149 149 -
main/waeup.sirp/trunk/src/waeup/sirp/hostels/vocabularies.py
r7257 r7321 22 22 from zope.catalog.interfaces import ICatalog 23 23 from zc.sourcefactory.contextual import BasicContextualSourceFactory 24 from waeup.sirp.interfaces import Simple WAeUPVocabulary24 from waeup.sirp.interfaces import SimpleSIRPVocabulary 25 25 26 26 NOT_OCCUPIED = u'not occupied' … … 53 53 return "%s - %s" % (value, self.acco_students(context)[value]) 54 54 55 bed_letters = Simple WAeUPVocabulary(55 bed_letters = SimpleSIRPVocabulary( 56 56 ('Bed A','A'), 57 57 ('Bed B','B'), … … 65 65 ) 66 66 67 blocks = Simple WAeUPVocabulary(67 blocks = SimpleSIRPVocabulary( 68 68 ('Block A','A'), 69 69 ('Block B','B'), … … 83 83 ) 84 84 85 special_handling = Simple WAeUPVocabulary(85 special_handling = SimpleSIRPVocabulary( 86 86 ('Regular Hostel','regular'), 87 87 ('Blocked Hostel','blocked'), -
main/waeup.sirp/trunk/src/waeup/sirp/image/README.txt
r6584 r7321 2 2 ======================================== 3 3 4 The image file widget is built on top of the :class:` WAeUPImageFile` object::5 6 >>> from waeup.sirp.image import WAeUPImageFile7 >>> file = WAeUPImageFile('foo.jpg', 'mydata')4 The image file widget is built on top of the :class:`SIRPImageFile` object:: 5 6 >>> from waeup.sirp.image import SIRPImageFile 7 >>> file = SIRPImageFile('foo.jpg', 'mydata') 8 8 >>> file.filename 9 9 'foo.jpg' … … 16 16 'mydata' 17 17 18 We can also create WAeUPImageFile objects from file-like objects::18 We can also create SIRPImageFile objects from file-like objects:: 19 19 20 20 >>> from StringIO import StringIO … … 36 36 ---------------- 37 37 38 The WAeUPImageFile object normally stores the file data using ZODB38 The SIRPImageFile object normally stores the file data using ZODB 39 39 persistence. Files can however also be stored by tramline. If 40 40 tramline is installed in Apache, the Tramline takes care of generating … … 73 73 just '1') will now be created:: 74 74 75 >>> file = WAeUPImageFile('foo.jpg', '1')75 >>> file = SIRPImageFile('foo.jpg', '1') 76 76 77 77 The data is now '1', referring to the real file:: … … 102 102 We expect the same behavior as when tramline is not installed:: 103 103 104 >>> file = WAeUPImageFile('foo.jpg', 'data')104 >>> file = SIRPImageFile('foo.jpg', 'data') 105 105 >>> f = file.file 106 106 >>> f.read() … … 141 141 Traceback (most recent call last): 142 142 ... 143 WrongType: ('asd', <class 'waeup.sirp.image.image. WAeUPImageFile'>, 'foo')143 WrongType: ('asd', <class 'waeup.sirp.image.image.SIRPImageFile'>, 'foo') 144 144 145 145 which means: `ImageFile` fields should better contain 146 :class:` WAeUPImageFile` instances.147 148 We can store normal :class:` WAeUPImageFile` instances:149 150 >>> field.validate( WAeUPImageFile('bar.jpg', 'data')) is None146 :class:`SIRPImageFile` instances. 147 148 We can store normal :class:`SIRPImageFile` instances: 149 150 >>> field.validate(SIRPImageFile('bar.jpg', 'data')) is None 151 151 True 152 152 … … 173 173 174 174 >>> field.validate( 175 ... WAeUPImageFile('bar.jpg', '123456789012')) is None176 True 177 178 >>> field.validate( 179 ... WAeUPImageFile('bar.jpg', '12345')) is None175 ... SIRPImageFile('bar.jpg', '123456789012')) is None 176 True 177 178 >>> field.validate( 179 ... SIRPImageFile('bar.jpg', '12345')) is None 180 180 True 181 181 … … 183 183 184 184 >>> field.validate( 185 ... WAeUPImageFile('bar.jpg', '1234567890123'))185 ... SIRPImageFile('bar.jpg', '1234567890123')) 186 186 Traceback (most recent call last): 187 187 ... … … 189 189 190 190 >>> field.validate( 191 ... WAeUPImageFile('bar.jpg', '1234'))191 ... SIRPImageFile('bar.jpg', '1234')) 192 192 Traceback (most recent call last): 193 193 ... … … 198 198 ---------------------------- 199 199 200 WAeUPImageFile does not reproduce the broken unequal comparison from200 SIRPImageFile does not reproduce the broken unequal comparison from 201 201 its base: 202 202 203 >>> f1 = WAeUPImageFile('bar.jpg', '123456789')204 >>> f2 = WAeUPImageFile('bar.jpg', '123456789')205 >>> f3 = WAeUPImageFile('baz.jpg', '1234')203 >>> f1 = SIRPImageFile('bar.jpg', '123456789') 204 >>> f2 = SIRPImageFile('bar.jpg', '123456789') 205 >>> f3 = SIRPImageFile('baz.jpg', '1234') 206 206 >>> f1 == f2 207 207 True -
main/waeup.sirp/trunk/src/waeup/sirp/image/__init__.py
r7137 r7321 3 3 Includings schemas, widgets and the content components. 4 4 """ 5 from waeup.sirp.image.image import WAeUPImageFile, createWAeUPImageFile5 from waeup.sirp.image.image import SIRPImageFile, createSIRPImageFile 6 6 7 7 __all__ = [ 8 " WAeUPImageFile",9 "create WAeUPImageFile",8 "SIRPImageFile", 9 "createSIRPImageFile", 10 10 ] -
main/waeup.sirp/trunk/src/waeup/sirp/image/browser/tests/image.txt
r6537 r7321 12 12 13 13 >>> import os 14 >>> from waeup.sirp.image import WAeUPImageFile14 >>> from waeup.sirp.image import SIRPImageFile 15 15 >>> testimage = os.path.join(os.path.dirname(__file__), 'sample.jpg') 16 16 >>> testimage2 = os.path.join(os.path.dirname(__file__), 'sample2.jpg') 17 >>> some_file = WAeUPImageFile('foo.jpg', open(testimage, 'rb').read())17 >>> some_file = SIRPImageFile('foo.jpg', open(testimage, 'rb').read()) 18 18 >>> some_file.filename 19 19 'foo.jpg' … … 166 166 prepare some new file: 167 167 168 >>> another_file = WAeUPImageFile('bar.txt', 'bar contents')168 >>> another_file = SIRPImageFile('bar.txt', 'bar contents') 169 169 170 170 We happen to know, due to the implementation of … … 200 200 --------------------------- 201 201 202 As :class:`waeup.sirp.image. WAeUPImageFile` objects support storing202 As :class:`waeup.sirp.image.SIRPImageFile` objects support storing 203 203 image data by using external 'storages', also our widgets should do 204 204 so. … … 220 220 ... contents = f.read() 221 221 ... id_string = hashlib.md5(contents).hexdigest() 222 ... result = WAeUPImageFile(filename, id_string)222 ... result = SIRPImageFile(filename, id_string) 223 223 ... self.storage[id_string] = contents 224 224 ... return result … … 260 260 We now want to simulate, that the field contains already data, 261 261 identified by some `file_id`. To do so, we first store the data in our 262 file retrieval and then create a WAeUPImageFile object with that262 file retrieval and then create a SIRPImageFile object with that 263 263 file_id stored: 264 264 265 >>> from waeup.sirp.image import create WAeUPImageFile266 >>> image = create WAeUPImageFile(265 >>> from waeup.sirp.image import createSIRPImageFile 266 >>> image = createSIRPImageFile( 267 267 ... 'sample.jpg', open(testimage, 'rb')) 268 268 >>> file_id = image.data … … 274 274 '9feac4265077922000aa8b88748e25be' 275 275 276 The new file was stored by our utility, as create WAeUPImageFile looks276 The new file was stored by our utility, as createSIRPImageFile looks 277 277 up IFileRetrieval utilities and uses them: 278 278 -
main/waeup.sirp/trunk/src/waeup/sirp/image/browser/widget.py
r7196 r7321 19 19 """ 20 20 import os 21 from waeup.sirp.image import WAeUPImageFile21 from waeup.sirp.image import SIRPImageFile 22 22 from hurry.file.browser.widget import ( 23 23 EncodingFileWidget, DownloadWidget, FakeFieldStorage) … … 62 62 seek(0) 63 63 return retrieval.createFile(input.filename, input) 64 return WAeUPImageFile(input.filename, data)64 return SIRPImageFile(input.filename, data) 65 65 else: 66 66 return self.context.missing_value … … 143 143 data = file_id.decode('base64') 144 144 filename, filedata = data.split('\n', 1) 145 return WAeUPImageFile(filename, filedata)145 return SIRPImageFile(filename, filedata) 146 146 147 147 class ThumbnailWidget(DownloadWidget): -
main/waeup.sirp/trunk/src/waeup/sirp/image/image.py
r7196 r7321 23 23 from zope.component import getUtility 24 24 from zope.interface import implements 25 from waeup.sirp.image.interfaces import I WAeUPImageFile25 from waeup.sirp.image.interfaces import ISIRPImageFile 26 26 27 class WAeUPImageFile(HurryFile):27 class SIRPImageFile(HurryFile): 28 28 """A file prepared for storing image files. 29 29 … … 32 32 regular hurry files. 33 33 34 To create a :class:` WAeUPImageFile` you should use35 :func:`create WAeUPImageFile`.34 To create a :class:`SIRPImageFile` you should use 35 :func:`createSIRPImageFile`. 36 36 """ 37 implements(I WAeUPImageFile)37 implements(ISIRPImageFile) 38 38 39 39 def __ne__(self, other): … … 45 45 return True 46 46 47 def create WAeUPImageFile(filename, f):47 def createSIRPImageFile(filename, f): 48 48 retrieval = getUtility(IFileRetrieval) 49 49 return retrieval.createFile(filename, f) -
main/waeup.sirp/trunk/src/waeup/sirp/image/interfaces.py
r7196 r7321 24 24 """ 25 25 26 class I WAeUPImageFile(IHurryFile):26 class ISIRPImageFile(IHurryFile): 27 27 """Image file. 28 28 """ -
main/waeup.sirp/trunk/src/waeup/sirp/image/schema.py
r7196 r7321 23 23 from hurry.file.schema import File 24 24 from waeup.sirp.image.interfaces import IImageFile 25 from waeup.sirp.image.image import WAeUPImageFile25 from waeup.sirp.image.image import SIRPImageFile 26 26 27 27 class MinMaxSize(object): … … 82 82 implements(IImageFile) 83 83 84 _type = WAeUPImageFile84 _type = SIRPImageFile -
main/waeup.sirp/trunk/src/waeup/sirp/interfaces.py
r7313 r7321 44 44 os.path.dirname(__file__), 'frontpage.rst'), 'rb').read() 45 45 46 def Simple WAeUPVocabulary(*terms):46 def SimpleSIRPVocabulary(*terms): 47 47 """A well-buildt vocabulary provides terms with a value, token and 48 48 title for each term … … 60 60 return [('%s/%s' % (year,year+1), year) for year in year_range] 61 61 62 academic_sessions_vocab = Simple WAeUPVocabulary(*academic_sessions())63 64 registration_states_vocab = Simple WAeUPVocabulary(62 academic_sessions_vocab = SimpleSIRPVocabulary(*academic_sessions()) 63 64 registration_states_vocab = SimpleSIRPVocabulary( 65 65 ('created', CREATED), 66 66 ('admitted', ADMITTED), … … 140 140 return value 141 141 142 class I WAeUPObject(Interface):143 """A WAeUP object.142 class ISIRPObject(Interface): 143 """A SIRP object. 144 144 145 145 This is merely a marker interface. 146 146 """ 147 147 148 class IUniversity(I WAeUPObject):148 class IUniversity(ISIRPObject): 149 149 """Representation of a university. 150 150 """ 151 151 152 152 153 class I WAeUPContainer(IWAeUPObject):154 """A container for WAeUP objects.155 """ 156 157 class I WAeUPContained(IWAeUPObject):158 """An item contained in an I WAeUPContainer.159 """ 160 161 class I WAeUPExporter(Interface):153 class ISIRPContainer(ISIRPObject): 154 """A container for SIRP objects. 155 """ 156 157 class ISIRPContained(ISIRPObject): 158 """An item contained in an ISIRPContainer. 159 """ 160 161 class ISIRPExporter(Interface): 162 162 """An exporter for objects. 163 163 """ … … 171 171 """ 172 172 173 class I WAeUPXMLExporter(Interface):173 class ISIRPXMLExporter(Interface): 174 174 """An XML exporter for objects. 175 175 """ … … 183 183 """ 184 184 185 class I WAeUPXMLImporter(Interface):185 class ISIRPXMLImporter(Interface): 186 186 """An XML import for objects. 187 187 """ … … 220 220 """ 221 221 222 class IContactForm(I WAeUPObject):222 class IContactForm(ISIRPObject): 223 223 """A contact form. 224 224 """ … … 251 251 252 252 class ISIRPPrincipalInfo(IPrincipalInfo): 253 """Infos about principals that are users of WAeUP SIRP.253 """Infos about principals that are users of SIRP SIRP. 254 254 """ 255 255 email = Attribute("The email address of a user") … … 258 258 259 259 class ISIRPPrincipal(IPrincipal): 260 """A principle for WAeUP SIRP.260 """A principle for SIRP SIRP. 261 261 262 262 This interface extends zope.security.interfaces.IPrincipal and … … 274 274 required=False,) 275 275 276 class IUserAccount(I WAeUPObject):276 class IUserAccount(ISIRPObject): 277 277 """A user account. 278 278 """ … … 318 318 319 319 320 class IUsersContainer(I WAeUPObject):320 class IUsersContainer(ISIRPObject): 321 321 """A container for users (principals). 322 322 … … 343 343 """ 344 344 345 class IConfigurationContainer(I WAeUPObject):345 class IConfigurationContainer(ISIRPObject): 346 346 """A container for session configuration objects. 347 347 """ … … 438 438 ) 439 439 440 class ISessionConfiguration(I WAeUPObject):440 class ISessionConfiguration(ISIRPObject): 441 441 """A session configuration object. 442 442 """ … … 505 505 'academic_session'].order 506 506 507 class IDataCenter(I WAeUPObject):507 class IDataCenter(ISIRPObject): 508 508 """A data center. 509 509 … … 568 568 title = u'Longer description of the item found.') 569 569 570 class I WAeUPSIRPPluggable(Interface):571 """A component that might be plugged into a WAeUP SIRP app.570 class ISIRPPluggable(Interface): 571 """A component that might be plugged into a SIRP SIRP app. 572 572 573 573 Components implementing this interface are referred to as … … 706 706 """ 707 707 708 class I WAeUPWorkflowInfo(IWorkflowInfo):708 class ISIRPWorkflowInfo(IWorkflowInfo): 709 709 """A :class:`hurry.workflow.workflow.WorkflowInfo` with additional 710 710 methods for convenience. … … 719 719 class ISiteLoggers(Interface): 720 720 721 loggers = Attribute("A list or generator of registered WAeUPLoggers")721 loggers = Attribute("A list or generator of registered SIRPLoggers") 722 722 723 723 def register(name, filename=None, site=None, **options): … … 740 740 741 741 def __init__(name, filename=None, site=None, **options): 742 """Create a WAeUP logger instance.742 """Create a SIRP logger instance. 743 743 """ 744 744 … … 872 872 873 873 Returns a tuple ``(raw_file, path, file_like_obj)`` where the 874 ``file_like_obj`` should be a HurryFile, a WAeUPImageFile or874 ``file_like_obj`` should be a HurryFile, a SIRPImageFile or 875 875 similar. ``raw_file`` is the (maybe changed) input file and 876 876 ``path`` the relative internal path to store the file at. -
main/waeup.sirp/trunk/src/waeup/sirp/meta.py
r7193 r7321 16 16 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 ## 18 """Grokkers for WAeUP components.18 """Grokkers for SIRP components. 19 19 20 20 Stuff in here is mainly taken from grok.meta, with some modifications … … 61 61 return False 62 62 63 subscriber = WAeUPIndexesUpgradeSubscriber(63 subscriber = SIRPIndexesUpgradeSubscriber( 64 64 catalog_name, indexes, context, module_info) 65 65 subscribed = (site, IObjectUpgradeEvent) … … 72 72 73 73 74 class WAeUPIndexesUpgradeSubscriber(IndexesSetupSubscriber):74 class SIRPIndexesUpgradeSubscriber(IndexesSetupSubscriber): 75 75 """Helper that sets up indexes when their Grok site is upgraded. 76 76 -
main/waeup.sirp/trunk/src/waeup/sirp/objecthistory.py
r7193 r7321 20 20 from persistent.list import PersistentList 21 21 from zope.annotation.interfaces import IAnnotations 22 from waeup.sirp.interfaces import IObjectHistory, I WAeUPObject22 from waeup.sirp.interfaces import IObjectHistory, ISIRPObject 23 23 from waeup.sirp.utils.helpers import get_current_principal 24 24 … … 26 26 """A history for objects. 27 27 28 For any object implementing `I WAeUPObject` which is annotatable,28 For any object implementing `ISIRPObject` which is annotatable, 29 29 we provide histories. A history for such an object can be obtained 30 30 by adapting it to `IObjectHistory`. 31 31 """ 32 grok.context(I WAeUPObject)32 grok.context(ISIRPObject) 33 33 grok.implements(IObjectHistory) 34 34 -
main/waeup.sirp/trunk/src/waeup/sirp/payments/interfaces.py
r7195 r7321 18 18 from zope.interface import Attribute 19 19 from zope import schema 20 from waeup.sirp.interfaces import I WAeUPObject20 from waeup.sirp.interfaces import ISIRPObject 21 21 from waeup.sirp.payments.vocabularies import ( 22 22 payment_states, payment_categories) 23 23 24 class IPaymentsContainer(I WAeUPObject):24 class IPaymentsContainer(ISIRPObject): 25 25 """A container for all kind of payment objects. 26 26 27 27 """ 28 28 29 class IPayment(I WAeUPObject):29 class IPayment(ISIRPObject): 30 30 """A base representation of payments. 31 31 -
main/waeup.sirp/trunk/src/waeup/sirp/payments/vocabularies.py
r7250 r7321 18 18 """Vocabularies and sources for payments. 19 19 """ 20 from waeup.sirp.interfaces import Simple WAeUPVocabulary20 from waeup.sirp.interfaces import SimpleSIRPVocabulary 21 21 22 payment_states = Simple WAeUPVocabulary(22 payment_states = SimpleSIRPVocabulary( 23 23 ('Not yet paid','unpaid'), 24 24 ('Paid','paid'), 25 25 ) 26 26 27 payment_categories = Simple WAeUPVocabulary(27 payment_categories = SimpleSIRPVocabulary( 28 28 ('School Fee','schoolfee'), 29 29 ('Clearance','clearance'), -
main/waeup.sirp/trunk/src/waeup/sirp/permissions.py
r7250 r7321 128 128 129 129 def get_waeup_roles(also_local=False): 130 """Get all WAeUP roles.131 132 WAeUP roles are ordinary roles whose id by convention starts with130 """Get all SIRP roles. 131 132 SIRP roles are ordinary roles whose id by convention starts with 133 133 a ``waeup.`` prefix. 134 134 135 135 If `also_local` is ``True`` (``False`` by default), also local 136 roles are returned. Local WAeUP roles are such whose id starts136 roles are returned. Local SIRP roles are such whose id starts 137 137 with ``waeup.local.`` prefix (this is also a convention). 138 138 … … 141 141 for name, item in get_all_roles(): 142 142 if not name.startswith('waeup.'): 143 # Ignore non- WAeUP roles...143 # Ignore non-SIRP roles... 144 144 continue 145 145 if not also_local and name.startswith('waeup.local.'): … … 149 149 150 150 def get_waeup_role_names(): 151 """Get the ids of all WAeUP roles.152 153 See :func:`get_waeup_roles` for what a ' WAeUPRole' is.154 155 This function returns a sorted list of WAeUP role names.151 """Get the ids of all SIRP roles. 152 153 See :func:`get_waeup_roles` for what a 'SIRPRole' is. 154 155 This function returns a sorted list of SIRP role names. 156 156 """ 157 157 return sorted([x.id for x in get_waeup_roles()]) -
main/waeup.sirp/trunk/src/waeup/sirp/permissions.txt
r7186 r7321 1 WAeUP permissions and roles2 ************************** *1 SIRP permissions and roles 2 ************************** 3 3 4 Permissions and roles used in a WAeUP portal.4 Permissions and roles used in a SIRP portal. 5 5 6 6 .. :doctest: 7 .. :layer: waeup.sirp.testing. WAeUPSIRPUnitTestLayer7 .. :layer: waeup.sirp.testing.SIRPUnitTestLayer 8 8 9 9 Convenience functions … … 16 16 --------------------- 17 17 18 Gives us all roles defined in a WAeUP SIRP portal. We get tuples of18 Gives us all roles defined in SIRP. We get tuples of 19 19 kind 20 20 … … 34 34 ----------------------- 35 35 36 Gives us all roles, except the WAeUP specific roles. We can get a list36 Gives us all roles, except the SIRP specific roles. We can get a list 37 37 with or without local roles: 38 38 … … 48 48 ---------------------------- 49 49 50 We can get all role names defined in a WAeUP portal(except 'local'50 We can get all role names defined in SIRP (except 'local' 51 51 roles that are meant not to be assigned globally): 52 52 -
main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py
r7318 r7321 32 32 from waeup.sirp.accesscodes.workflow import USED 33 33 from waeup.sirp.browser import ( 34 WAeUPPage, WAeUPEditFormPage, WAeUPAddFormPage, WAeUPDisplayFormPage,34 SIRPPage, SIRPEditFormPage, SIRPAddFormPage, SIRPDisplayFormPage, 35 35 ContactAdminForm) 36 36 from waeup.sirp.browser.breadcrumbs import Breadcrumb … … 39 39 ManageActionButton, AddActionButton) 40 40 from waeup.sirp.interfaces import ( 41 I WAeUPObject, IUserAccount, IExtFileStore, IPasswordValidator, IContactForm)41 ISIRPObject, IUserAccount, IExtFileStore, IPasswordValidator, IContactForm) 42 42 from waeup.sirp.widgets.datewidget import ( 43 43 FriendlyDateWidget, FriendlyDateDisplayWidget, … … 155 155 return self.context.level_title 156 156 157 class StudentsContainerPage( WAeUPPage):157 class StudentsContainerPage(SIRPPage): 158 158 """The standard view for student containers. 159 159 """ … … 188 188 return 189 189 190 class SetPasswordPage( WAeUPPage):191 grok.context(I WAeUPObject)190 class SetPasswordPage(SIRPPage): 191 grok.context(ISIRPObject) 192 192 grok.name('setpassword') 193 193 grok.require('waeup.Public') … … 253 253 254 254 255 class StudentsContainerManagePage( WAeUPPage):255 class StudentsContainerManagePage(SIRPPage): 256 256 """The manage page for student containers. 257 257 """ … … 310 310 target = 'addstudent' 311 311 312 class StudentAddFormPage( WAeUPAddFormPage):312 class StudentAddFormPage(SIRPAddFormPage): 313 313 """Add-form to add a student. 314 314 """ … … 331 331 return 332 332 333 class StudentBaseDisplayFormPage( WAeUPDisplayFormPage):333 class StudentBaseDisplayFormPage(SIRPDisplayFormPage): 334 334 """ Page to display student base data 335 335 """ … … 406 406 target = 'manage_base' 407 407 408 class StudentBaseManageFormPage( WAeUPEditFormPage):408 class StudentBaseManageFormPage(SIRPEditFormPage): 409 409 """ View to manage student base data 410 410 """ … … 467 467 return 468 468 469 class StudentClearanceDisplayFormPage( WAeUPDisplayFormPage):469 class StudentClearanceDisplayFormPage(SIRPDisplayFormPage): 470 470 """ Page to display student clearance data 471 471 """ … … 552 552 self.context.getStudent(), studentview) 553 553 554 class StudentClearanceManageFormPage( WAeUPEditFormPage):554 class StudentClearanceManageFormPage(SIRPEditFormPage): 555 555 """ Page to edit student clearance data 556 556 """ … … 622 622 return 623 623 624 class StudentPersonalDisplayFormPage( WAeUPDisplayFormPage):624 class StudentPersonalDisplayFormPage(SIRPDisplayFormPage): 625 625 """ Page to display student personal data 626 626 """ … … 644 644 target = 'edit_personal' 645 645 646 class StudentPersonalManageFormPage( WAeUPEditFormPage):646 class StudentPersonalManageFormPage(SIRPEditFormPage): 647 647 """ Page to edit student clearance data 648 648 """ … … 660 660 return 661 661 662 class StudyCourseDisplayFormPage( WAeUPDisplayFormPage):662 class StudyCourseDisplayFormPage(SIRPDisplayFormPage): 663 663 """ Page to display the student study course data 664 664 """ … … 703 703 target = 'manage' 704 704 705 class StudyCourseManageFormPage( WAeUPEditFormPage):705 class StudyCourseManageFormPage(SIRPEditFormPage): 706 706 """ Page to edit the student study course data 707 707 """ … … 773 773 return 774 774 775 class StudyLevelDisplayFormPage( WAeUPDisplayFormPage):775 class StudyLevelDisplayFormPage(SIRPDisplayFormPage): 776 776 """ Page to display student study levels 777 777 """ … … 854 854 target = 'manage' 855 855 856 class StudyLevelManageFormPage( WAeUPEditFormPage):856 class StudyLevelManageFormPage(SIRPEditFormPage): 857 857 """ Page to edit the student study level data 858 858 """ … … 913 913 return 914 914 915 class CourseTicketAddFormPage( WAeUPAddFormPage):915 class CourseTicketAddFormPage(SIRPAddFormPage): 916 916 """Add a course ticket. 917 917 """ … … 956 956 self.redirect(self.url(self.context)) 957 957 958 class CourseTicketDisplayFormPage( WAeUPDisplayFormPage):958 class CourseTicketDisplayFormPage(SIRPDisplayFormPage): 959 959 """ Page to display course tickets 960 960 """ … … 983 983 target = 'manage' 984 984 985 class CourseTicketManageFormPage( WAeUPEditFormPage):985 class CourseTicketManageFormPage(SIRPEditFormPage): 986 986 """ Page to manage course tickets 987 987 """ … … 1007 1007 1008 1008 # We don't need the display form page yet 1009 #class PaymentsDisplayFormPage( WAeUPDisplayFormPage):1009 #class PaymentsDisplayFormPage(SIRPDisplayFormPage): 1010 1010 # """ Page to display the student payments 1011 1011 # """ … … 1028 1028 1029 1029 # This manage form page is for both students and students officers. 1030 class PaymentsManageFormPage( WAeUPEditFormPage):1030 class PaymentsManageFormPage(SIRPEditFormPage): 1031 1031 """ Page to manage the student payments 1032 1032 """ … … 1093 1093 # target = 'manage' 1094 1094 1095 class OnlinePaymentAddFormPage( WAeUPAddFormPage):1095 class OnlinePaymentAddFormPage(SIRPAddFormPage): 1096 1096 """ Page to add an online payment ticket 1097 1097 """ … … 1152 1152 return 1153 1153 1154 class OnlinePaymentDisplayFormPage( WAeUPDisplayFormPage):1154 class OnlinePaymentDisplayFormPage(SIRPDisplayFormPage): 1155 1155 """ Page to view an online payment ticket 1156 1156 """ … … 1279 1279 1280 1280 # We don't need the display form page yet 1281 #class AccommodationDisplayFormPage( WAeUPDisplayFormPage):1281 #class AccommodationDisplayFormPage(SIRPDisplayFormPage): 1282 1282 # """ Page to display the student accommodation data 1283 1283 # """ … … 1295 1295 1296 1296 # This manage form page is for both students and students officers. 1297 class AccommodationManageFormPage( WAeUPEditFormPage):1297 class AccommodationManageFormPage(SIRPEditFormPage): 1298 1298 """ Page to manage bed tickets. 1299 1299 """ … … 1358 1358 target = 'add' 1359 1359 1360 class BedTicketAddPage( WAeUPPage):1360 class BedTicketAddPage(SIRPPage): 1361 1361 """ Page to add an online payment ticket 1362 1362 """ … … 1449 1449 return 1450 1450 1451 class BedTicketDisplayFormPage( WAeUPDisplayFormPage):1451 class BedTicketDisplayFormPage(SIRPDisplayFormPage): 1452 1452 """ Page to display bed tickets 1453 1453 """ … … 1576 1576 return 1577 1577 1578 class StudentHistoryPage( WAeUPPage):1578 class StudentHistoryPage(SIRPPage): 1579 1579 """ Page to display student clearance data 1580 1580 """ … … 1624 1624 return self.view.url(self.view.context, self.target) 1625 1625 1626 class StudentBaseEditFormPage( WAeUPEditFormPage):1626 class StudentBaseEditFormPage(SIRPEditFormPage): 1627 1627 """ View to edit student base data 1628 1628 """ … … 1641 1641 return 1642 1642 1643 class StudentChangePasswordPage( WAeUPEditFormPage):1643 class StudentChangePasswordPage(SIRPEditFormPage): 1644 1644 """ View to manage student base data 1645 1645 """ … … 1668 1668 return 1669 1669 1670 class StudentFilesUploadPage( WAeUPPage):1670 class StudentFilesUploadPage(SIRPPage): 1671 1671 """ View to upload files by student 1672 1672 """ … … 1701 1701 return self.view.url(self.view.context, self.target) 1702 1702 1703 class StartClearancePage( WAeUPPage):1703 class StartClearancePage(SIRPPage): 1704 1704 grok.context(IStudent) 1705 1705 grok.name('start_clearance') … … 1823 1823 return 1824 1824 1825 class RequestClearancePage( WAeUPPage):1825 class RequestClearancePage(SIRPPage): 1826 1826 grok.context(IStudent) 1827 1827 grok.name('request_clearance') … … 1870 1870 return self.view.url(self.view.context, self.target) 1871 1871 1872 class StartCourseRegistrationPage( WAeUPPage):1872 class StartCourseRegistrationPage(SIRPPage): 1873 1873 grok.context(IStudentStudyCourse) 1874 1874 grok.name('start_course_registration') … … 1939 1939 return self.view.url(self.view.context, self.target) 1940 1940 1941 class AddStudyLevelFormPage( WAeUPEditFormPage):1941 class AddStudyLevelFormPage(SIRPEditFormPage): 1942 1942 """ Page for students to add current study levels 1943 1943 """ … … 1995 1995 return self.view.url(self.view.context, self.target) 1996 1996 1997 class StudyLevelEditFormPage( WAeUPEditFormPage):1997 class StudyLevelEditFormPage(SIRPEditFormPage): 1998 1998 """ Page to edit the student study level data by students 1999 1999 """ -
main/waeup.sirp/trunk/src/waeup/sirp/students/interfaces.py
r7304 r7321 20 20 from zope import schema 21 21 from waeup.sirp.interfaces import ( 22 I WAeUPObject, academic_sessions_vocab, validate_email)22 ISIRPObject, academic_sessions_vocab, validate_email) 23 23 from waeup.sirp.schema import TextLineChoice 24 24 from waeup.sirp.university.vocabularies import CourseSource, study_modes … … 56 56 """ 57 57 58 class IStudentsContainer(I WAeUPObject):58 class IStudentsContainer(ISIRPObject): 59 59 """A students container contains university students. 60 60 … … 95 95 """ 96 96 97 class IStudentNavigation(I WAeUPObject):97 class IStudentNavigation(ISIRPObject): 98 98 """Interface needed for student navigation. 99 99 … … 104 104 """ 105 105 106 class IStudentBase(I WAeUPObject):106 class IStudentBase(ISIRPObject): 107 107 """Representation of student base data. 108 108 … … 173 173 ) 174 174 175 class IStudentClearance(I WAeUPObject):175 class IStudentClearance(ISIRPObject): 176 176 """Representation of student clearance data. 177 177 … … 194 194 ) 195 195 196 class IStudentPersonal(I WAeUPObject):196 class IStudentPersonal(ISIRPObject): 197 197 """Representation of student personal data. 198 198 … … 228 228 ) 229 229 230 class IStudentStudyCourse(I WAeUPObject):230 class IStudentStudyCourse(ISIRPObject): 231 231 """A container for student study levels. 232 232 … … 295 295 ) 296 296 297 class IStudentStudyLevel(I WAeUPObject):297 class IStudentStudyLevel(ISIRPObject): 298 298 """A container for course tickets. 299 299 … … 317 317 ) 318 318 319 class ICourseTicket(I WAeUPObject):319 class ICourseTicket(ISIRPObject): 320 320 """A course ticket. 321 321 … … 362 362 ) 363 363 364 class IStudentAccommodation(I WAeUPObject):364 class IStudentAccommodation(ISIRPObject): 365 365 """A container for student accommodation objects. 366 366 367 367 """ 368 368 369 class IBedTicket(I WAeUPObject):369 class IBedTicket(ISIRPObject): 370 370 """A ticket for accommodation booking. 371 371 -
main/waeup.sirp/trunk/src/waeup/sirp/students/student.py
r7256 r7321 27 27 from waeup.sirp.interfaces import ( 28 28 IObjectHistory, IUserAccount, IFileStoreNameChooser, IFileStoreHandler) 29 from waeup.sirp.image import WAeUPImageFile29 from waeup.sirp.image import SIRPImageFile 30 30 from waeup.sirp.imagestorage import DefaultFileStoreHandler 31 31 from waeup.sirp.students.interfaces import ( … … 257 257 StudentFileStoreHandler, self).createFile( 258 258 store, root, filename, file_id, file) 259 return file, path, WAeUPImageFile(259 return file, path, SIRPImageFile( 260 260 file_obj.filename, file_obj.data) -
main/waeup.sirp/trunk/src/waeup/sirp/students/viewlets.py
r7319 r7321 21 21 from zope.interface import Interface 22 22 from waeup.sirp.interfaces import ( 23 I WAeUPObject, IExtFileStore, IFileStoreNameChooser)23 ISIRPObject, IExtFileStore, IFileStoreNameChooser) 24 24 from waeup.sirp.utils.helpers import string_from_bytes, file_size 25 25 from waeup.sirp.browser import DEFAULT_IMAGE_PATH … … 32 32 from waeup.sirp.students.interfaces import IStudent, IStudentClearance 33 33 34 grok.context(I WAeUPObject) # Make IWAeUPObject the default context34 grok.context(ISIRPObject) # Make ISIRPObject the default context 35 35 grok.templatedir('browser_templates') 36 36 … … 47 47 grok.baseclass() 48 48 grok.viewletmanager(StudentManageSidebar) 49 grok.context(I WAeUPObject)49 grok.context(ISIRPObject) 50 50 grok.view(Interface) 51 51 grok.order(5) … … 108 108 grok.baseclass() 109 109 grok.viewletmanager(StudentMenu) 110 grok.context(I WAeUPObject)110 grok.context(ISIRPObject) 111 111 grok.view(Interface) 112 112 grok.order(5) … … 162 162 """ 163 163 164 grok.context(I WAeUPObject)164 grok.context(ISIRPObject) 165 165 grok.order(4) 166 166 grok.require('waeup.viewStudentsTab') -
main/waeup.sirp/trunk/src/waeup/sirp/students/vocabularies.py
r7214 r7321 25 25 from zc.sourcefactory.basic import BasicSourceFactory 26 26 from zc.sourcefactory.contextual import BasicContextualSourceFactory 27 from waeup.sirp.interfaces import Simple WAeUPVocabulary27 from waeup.sirp.interfaces import SimpleSIRPVocabulary 28 28 from waeup.sirp.students.lgas import LGAS 29 29 from waeup.sirp.university.vocabularies import course_levels 30 30 31 lgas_vocab = Simple WAeUPVocabulary(31 lgas_vocab = SimpleSIRPVocabulary( 32 32 *sorted([(x[1],x[0]) for x in LGAS])) 33 33 … … 71 71 return title 72 72 73 verdicts = Simple WAeUPVocabulary(73 verdicts = SimpleSIRPVocabulary( 74 74 ('not yet','0'), 75 75 ('Successful student','A'), -
main/waeup.sirp/trunk/src/waeup/sirp/students/workflow.py
r7133 r7321 5 5 from hurry.workflow.interfaces import IWorkflowState, IWorkflowTransitionEvent 6 6 from waeup.sirp.interfaces import ( 7 IObjectHistory, I WAeUPWorkflowInfo,7 IObjectHistory, ISIRPWorkflowInfo, 8 8 CREATED, ADMITTED, CLEARANCE, REQUESTED, CLEARED, PAID, RETURNING, 9 9 REGISTERED, VALIDATED) 10 from waeup.sirp.workflow import WAeUPWorkflow, WAeUPWorkflowInfo10 from waeup.sirp.workflow import SIRPWorkflow, SIRPWorkflowInfo 11 11 from waeup.sirp.utils.helpers import get_current_principal 12 12 from waeup.sirp.students.interfaces import IStudent … … 152 152 UNLOCK_CLEARANCE_TRANS = ('reset3', 'reset4', 'start_clearance') 153 153 154 registration_workflow = WAeUPWorkflow(REGISTRATION_TRANSITIONS)154 registration_workflow = SIRPWorkflow(REGISTRATION_TRANSITIONS) 155 155 156 156 class RegistrationWorkflowState(WorkflowState, grok.Adapter): … … 163 163 state_id = 'wf.registration.id' 164 164 165 class RegistrationWorkflowInfo( WAeUPWorkflowInfo, grok.Adapter):165 class RegistrationWorkflowInfo(SIRPWorkflowInfo, grok.Adapter): 166 166 """Adapter to adapt Student objects to workflow info objects. 167 167 """ 168 168 grok.context(IStudent) 169 grok.provides(I WAeUPWorkflowInfo)169 grok.provides(ISIRPWorkflowInfo) 170 170 171 171 def __init__(self, context): -
main/waeup.sirp/trunk/src/waeup/sirp/testing.py
r7193 r7321 161 161 If you use the Zope testrunner (from :mod:`zope.testing`) 162 162 then you have to use appropriate layers like the 163 :class:`waeup.sirp.testing. WAeUPSIRPUnitTestLayer`.163 :class:`waeup.sirp.testing.SIRPUnitTestLayer`. 164 164 165 165 Usage with :mod:`zope.testing` testrunners … … 170 170 like the one defined in this module. 171 171 172 .. seealso:: :class:`waeup.sirp.testing. WAeUPSIRPUnitTestLayer`172 .. seealso:: :class:`waeup.sirp.testing.SIRPUnitTestLayer` 173 173 174 174 """ … … 187 187 188 188 189 class WAeUPSIRPUnitTestLayer(object):189 class SIRPUnitTestLayer(object): 190 190 """A layer for tests that groks `waeup.sirp`. 191 191 … … 210 210 211 211 import unittest 212 from waeup.sirp.testing import WAeUPSIRPUnitTestLayer212 from waeup.sirp.testing import SIRPUnitTestLayer 213 213 214 214 class MyTestCase(unittest.TestCase): 215 215 216 layer = WAeUPSIRPUnitTestLayer216 layer = SIRPUnitTestLayer 217 217 218 218 # per-test setups and real tests go here... -
main/waeup.sirp/trunk/src/waeup/sirp/tests/test_interfaces.py
r7193 r7321 48 48 # Register a role not visible to waeup portal as its name does 49 49 # not start with 'waeup.' 50 class Non WAeUPRole(grok.Role):50 class NonSIRPRole(grok.Role): 51 51 grok.name('nonwaeup.testrole') 52 52 grok.title('Role not suitable for waeup') 53 53 grok.permissions('waeup.Public') 54 54 grok.testing.grok_component('SomeRole', SomeRole) 55 grok.testing.grok_component('Non WAeUPRole', NonWAeUPRole)55 grok.testing.grok_component('NonSIRPRole', NonSIRPRole) 56 56 return 57 57 -
main/waeup.sirp/trunk/src/waeup/sirp/tests/test_objecthistory.py
r7193 r7321 26 26 from zope.security.testing import Principal, Participation 27 27 from waeup.sirp.app import University 28 from waeup.sirp.interfaces import IObjectHistory, I WAeUPObject28 from waeup.sirp.interfaces import IObjectHistory, ISIRPObject 29 29 from waeup.sirp.testing import FunctionalTestCase, FunctionalLayer 30 30 from waeup.sirp.objecthistory import ObjectHistory 31 31 32 32 class SampleObject(grok.Model): 33 grok.implements(I WAeUPObject)33 grok.implements(ISIRPObject) 34 34 pass 35 35 -
main/waeup.sirp/trunk/src/waeup/sirp/university/certificate.py
r7210 r7321 16 16 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 ## 18 """ WAeUP portalcertificates18 """SIRP certificates 19 19 """ 20 20 import grok -
main/waeup.sirp/trunk/src/waeup/sirp/university/certificate.txt
r6244 r7321 1 :mod:`waeup.sirp.university.certificate` -- Certificates for WAeUP1 :mod:`waeup.sirp.university.certificate` -- Certificates for SIRP 2 2 ****************************************************************** 3 3 … … 7 7 8 8 .. :doctest: 9 .. :layer: waeup.sirp.testing. WAeUPSIRPUnitTestLayer9 .. :layer: waeup.sirp.testing.SIRPUnitTestLayer 10 10 11 11 -
main/waeup.sirp/trunk/src/waeup/sirp/university/certificatecontainer.txt
r6231 r7321 7 7 8 8 .. :doctest: 9 .. :layer: waeup.sirp.testing. WAeUPSIRPUnitTestLayer9 .. :layer: waeup.sirp.testing.SIRPUnitTestLayer 10 10 11 11 -
main/waeup.sirp/trunk/src/waeup/sirp/university/course.txt
r5944 r7321 7 7 8 8 .. :doctest: 9 .. :layer: waeup.sirp.testing. WAeUPSIRPUnitTestLayer9 .. :layer: waeup.sirp.testing.SIRPUnitTestLayer 10 10 11 11 Content Classes (models and containers) -
main/waeup.sirp/trunk/src/waeup/sirp/university/coursecontainer.txt
r6245 r7321 7 7 8 8 .. :doctest: 9 .. :layer: waeup.sirp.testing. WAeUPSIRPUnitTestLayer9 .. :layer: waeup.sirp.testing.SIRPUnitTestLayer 10 10 11 11 -
main/waeup.sirp/trunk/src/waeup/sirp/university/department.txt
r5140 r7321 7 7 8 8 .. :doctest: 9 .. :layer: waeup.sirp.testing. WAeUPSIRPUnitTestLayer9 .. :layer: waeup.sirp.testing.SIRPUnitTestLayer 10 10 11 11 Content Classes (models and containers) -
main/waeup.sirp/trunk/src/waeup/sirp/university/faculty.txt
r6979 r7321 7 7 8 8 .. :doctest: 9 .. :layer: waeup.sirp.testing. WAeUPSIRPUnitTestLayer9 .. :layer: waeup.sirp.testing.SIRPUnitTestLayer 10 10 11 11 -
main/waeup.sirp/trunk/src/waeup/sirp/university/facultycontainer.py
r7195 r7321 19 19 from zope.component.interfaces import IFactory 20 20 from zope.interface import implementedBy 21 from waeup.sirp.interfaces import I WAeUPSIRPPluggable21 from waeup.sirp.interfaces import ISIRPPluggable 22 22 from waeup.sirp.university.interfaces import IFacultyContainer, IFaculty 23 23 … … 51 51 """A plugin that creates a faculty container inside a university. 52 52 """ 53 grok.implements(I WAeUPSIRPPluggable)53 grok.implements(ISIRPPluggable) 54 54 grok.name('faculties') 55 55 56 56 def setup(self, site, name, logger): 57 57 if 'faculties' in site.keys(): 58 logger.warn('Could not create faculty container in WAeUPSIRP.')58 logger.warn('Could not create faculty container in SIRP.') 59 59 return 60 60 site['faculties'] = FacultyContainer() -
main/waeup.sirp/trunk/src/waeup/sirp/university/facultycontainer.txt
r6979 r7321 7 7 8 8 .. :doctest: 9 .. :layer: waeup.sirp.testing. WAeUPSIRPUnitTestLayer9 .. :layer: waeup.sirp.testing.SIRPUnitTestLayer 10 10 11 11 … … 77 77 .. class:: AcademicsPlugin() 78 78 79 .. attribute:: grok.implements(I WAeUPSIRPPluggable)79 .. attribute:: grok.implements(ISIRPPluggable) 80 80 81 81 This plugin component tells under which name (``faculties``) an 82 instance of academics stuff should be created in plain WAeUPSIRP82 instance of academics stuff should be created in plain SIRP 83 83 instances. It also tells the factory name for FacultyContainer 84 instances, which serve as root object for academics stuff in WAeUP 85 SIRP apps. 84 instances, which serve as root object for academics stuff in SIRP apps. 86 85 87 86 -
main/waeup.sirp/trunk/src/waeup/sirp/university/interfaces.py
r7195 r7321 20 20 from zope import schema 21 21 from zope.interface import Attribute 22 from waeup.sirp.interfaces import (I WAeUPObject, IWAeUPContainer)22 from waeup.sirp.interfaces import (ISIRPObject, ISIRPContainer) 23 23 24 24 from waeup.sirp.university.vocabularies import ( … … 32 32 33 33 34 class IFaculty(I WAeUPContainer):34 class IFaculty(ISIRPContainer): 35 35 """Representation of a university faculty. 36 36 """ … … 73 73 IFacultyAdd['code'].order = IFaculty['code'].order 74 74 75 class IFacultyContainer(I WAeUPContainer):75 class IFacultyContainer(ISIRPContainer): 76 76 """A container for faculties. 77 77 """ … … 80 80 81 81 """ 82 class IDepartment(I WAeUPObject):82 class IDepartment(ISIRPObject): 83 83 """Representation of a department. 84 84 """ … … 124 124 IDepartmentAdd['code'].order = IDepartment['code'].order 125 125 126 class ICourseContainer(I WAeUPContainer):126 class ICourseContainer(ISIRPContainer): 127 127 """A container for faculties. 128 128 """ … … 133 133 """ 134 134 135 class ICourse(I WAeUPObject):135 class ICourse(ISIRPObject): 136 136 """Representation of a course. 137 137 """ … … 186 186 ICourseAdd['code'].order = ICourse['code'].order 187 187 188 class ICertificate(I WAeUPObject):188 class ICertificate(ISIRPObject): 189 189 """Representation of a certificate. 190 190 """ … … 248 248 ICertificateAdd['code'].order = ICertificate['code'].order 249 249 250 class ICertificateContainer(I WAeUPContainer):250 class ICertificateContainer(ISIRPContainer): 251 251 """A container for certificates. 252 252 """ … … 257 257 """ 258 258 259 class ICertificateCourse(I WAeUPObject):259 class ICertificateCourse(ISIRPObject): 260 260 """A certificatecourse is referring a course and provides some own 261 261 attributes. -
main/waeup.sirp/trunk/src/waeup/sirp/university/tests/test_facultycontainer.py
r7195 r7321 90 90 self.assertEqual( 91 91 self._logger_factory.get_messages(), 92 'Could not create faculty container in WAeUPSIRP.\n'92 'Could not create faculty container in SIRP.\n' 93 93 ) 94 94 -
main/waeup.sirp/trunk/src/waeup/sirp/university/vocabularies.py
r7195 r7321 21 21 from zope.catalog.interfaces import ICatalog 22 22 from zope.component import getUtility 23 from waeup.sirp.interfaces import Simple WAeUPVocabulary23 from waeup.sirp.interfaces import SimpleSIRPVocabulary 24 24 25 inst_types = Simple WAeUPVocabulary(25 inst_types = SimpleSIRPVocabulary( 26 26 ('Faculty of','faculty'), 27 27 ('Department of','department'), … … 34 34 ) 35 35 36 course_levels = Simple WAeUPVocabulary(36 course_levels = SimpleSIRPVocabulary( 37 37 ('Pre-Studies',0), 38 38 ('100 (Year 1)',100), … … 46 46 ) 47 47 48 semester = Simple WAeUPVocabulary(48 semester = SimpleSIRPVocabulary( 49 49 ('N/A', 0), 50 50 ('First Semester', 1), … … 53 53 ) 54 54 55 application_categories = Simple WAeUPVocabulary(55 application_categories = SimpleSIRPVocabulary( 56 56 ('PUME, PDE, PCE, PRENCE','basic'), 57 57 ('Part-Time, Diploma, Certificate','cest'), … … 60 60 ) 61 61 62 study_modes = Simple WAeUPVocabulary(62 study_modes = SimpleSIRPVocabulary( 63 63 ('UME Full Time','ume_ft'), 64 64 ('Direct Entry Full Time','de_ft'), -
main/waeup.sirp/trunk/src/waeup/sirp/userscontainer.py
r7233 r7321 16 16 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 ## 18 """Users container for the WAeUP portal.18 """Users container for the SIRP portal. 19 19 """ 20 20 import grok -
main/waeup.sirp/trunk/src/waeup/sirp/userscontainer.txt
r7197 r7321 1 User container for the WAeUP portal2 *************************** ********1 User container for the SIRP 2 *************************** 3 3 4 4 .. :doctest: 5 .. :layer: waeup.sirp.testing. WAeUPSIRPUnitTestLayer5 .. :layer: waeup.sirp.testing.SIRPUnitTestLayer 6 6 7 7 Before we can start, we need some password managers available: -
main/waeup.sirp/trunk/src/waeup/sirp/utils/batching.py
r7273 r7321 16 16 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 ## 18 """ WAeUP components for batch processing.18 """SIRP components for batch processing. 19 19 20 20 Batch processors eat CSV files to add, update or remove large numbers -
main/waeup.sirp/trunk/src/waeup/sirp/utils/converters.txt
r6276 r7321 10 10 11 11 .. :NOdoctest: 12 .. :NOlayer: waeup.sirp.testing. WAeUPSIRPUnitTestLayer12 .. :NOlayer: waeup.sirp.testing.SIRPUnitTestLayer 13 13 14 14 … … 672 672 '1' 673 673 674 >>> from waeup.sirp.interfaces import Simple WAeUPVocabulary674 >>> from waeup.sirp.interfaces import SimpleSIRPVocabulary 675 675 >>> field = Choice( 676 676 ... title = u'Favourite Dish', 677 677 ... default = 0, 678 ... vocabulary = Simple WAeUPVocabulary(678 ... vocabulary = SimpleSIRPVocabulary( 679 679 ... ('N/A', 0), ('Pizza', 1), 680 680 ... ('Cake', 2), ('Muffins', 3)), -
main/waeup.sirp/trunk/src/waeup/sirp/utils/helpers.py
r7240 r7321 16 16 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 ## 18 """General helper functions for WAeUP.18 """General helper functions for SIRP. 19 19 """ 20 20 import os -
main/waeup.sirp/trunk/src/waeup/sirp/utils/helpers.txt
r7186 r7321 1 :mod:`waeup.sirp.utils.helpers` -- Helpers for the WAeUP SRP2 *************************************************** *********1 :mod:`waeup.sirp.utils.helpers` -- Helpers for SIRP 2 *************************************************** 3 3 4 4 .. module:: waeup.sirp.utils.helpers 5 5 6 Helper functions for the WAeUP SRP.6 Helper functions for SIRP. 7 7 8 8 .. :doctest: -
main/waeup.sirp/trunk/src/waeup/sirp/utils/importexport.py
r7196 r7321 22 22 from cStringIO import StringIO 23 23 from zope.interface import Interface 24 from waeup.sirp.interfaces import (I WAeUPObject, IWAeUPExporter,25 I WAeUPXMLExporter, IWAeUPXMLImporter)24 from waeup.sirp.interfaces import (ISIRPObject, ISIRPExporter, 25 ISIRPXMLExporter, ISIRPXMLImporter) 26 26 27 27 def readFile(f): … … 40 40 41 41 class Exporter(grok.Adapter): 42 """Export a WAeUP object as pickle.42 """Export a SIRP object as pickle. 43 43 44 44 This all-purpose exporter exports attributes defined in schemata 45 45 and contained objects (if the exported thing is a container). 46 46 """ 47 grok.context(I WAeUPObject)48 grok.provides(I WAeUPExporter)47 grok.context(ISIRPObject) 48 grok.provides(ISIRPExporter) 49 49 50 50 def __init__(self, context): … … 61 61 62 62 class XMLExporter(grok.Adapter): 63 """Export a WAeUP object as XML.63 """Export a SIRP object as XML. 64 64 65 65 This all-purpose exporter exports XML representations of pickable … … 67 67 """ 68 68 grok.context(Interface) 69 grok.provides(I WAeUPXMLExporter)69 grok.provides(ISIRPXMLExporter) 70 70 71 71 def __init__(self, context): … … 84 84 85 85 class XMLImporter(grok.Adapter): 86 """Import a WAeUP object from XML.86 """Import a SIRP object from XML. 87 87 """ 88 88 grok.context(Interface) 89 grok.provides(I WAeUPXMLImporter)89 grok.provides(ISIRPXMLImporter) 90 90 91 91 def __init__(self, context): -
main/waeup.sirp/trunk/src/waeup/sirp/utils/importexport.txt
r5140 r7321 6 6 7 7 .. :doctest: 8 .. :layer: waeup.sirp.testing. WAeUPSIRPUnitTestLayer8 .. :layer: waeup.sirp.testing.SIRPUnitTestLayer 9 9 10 10 As imports and exports of data are a cruical point when doing updates … … 60 60 an exporter:: 61 61 62 >>> from waeup.sirp.interfaces import I WAeUPXMLExporter63 >>> exporter = I WAeUPXMLExporter(mycave)62 >>> from waeup.sirp.interfaces import ISIRPXMLExporter 63 >>> exporter = ISIRPXMLExporter(mycave) 64 64 >>> exporter 65 65 <waeup.sirp.utils.importexport.XMLExporter object at 0x...> … … 101 101 Now we create an importer for that object: 102 102 103 >>> from waeup.sirp.interfaces import I WAeUPXMLImporter104 >>> importer = I WAeUPXMLImporter(mycave)103 >>> from waeup.sirp.interfaces import ISIRPXMLImporter 104 >>> importer = ISIRPXMLImporter(mycave) 105 105 106 106 Importing from filenames -
main/waeup.sirp/trunk/src/waeup/sirp/utils/tests/test_converters.py
r7196 r7321 36 36 from waeup.sirp.utils.converters import IObjectConverter 37 37 from waeup.sirp.utils.helpers import attrs_to_fields 38 from waeup.sirp.interfaces import Simple WAeUPVocabulary39 40 colors = Simple WAeUPVocabulary(38 from waeup.sirp.interfaces import SimpleSIRPVocabulary 39 40 colors = SimpleSIRPVocabulary( 41 41 ('Red', u'red'), 42 42 ('Green', u'green'), 43 43 ('Blue', u'blue'), 44 44 ) 45 car_nums = Simple WAeUPVocabulary(45 car_nums = SimpleSIRPVocabulary( 46 46 ('None', 0), 47 47 ('One', 1), -
main/waeup.sirp/trunk/src/waeup/sirp/widgets/__init__.py
r7137 r7321 1 """JS-driven widgets for WAeUP.1 """JS-driven widgets for SIRP. 2 2 """ -
main/waeup.sirp/trunk/src/waeup/sirp/widgets/objectwidget.py
r7196 r7321 25 25 from zope.schema import getFieldNamesInOrder 26 26 27 class WAeUPObjectWidgetView(ObjectWidgetView):27 class SIRPObjectWidgetView(ObjectWidgetView): 28 28 template = ViewPageTemplateFile('objectwidget.pt') 29 29 30 class WAeUPObjectWidget(ObjectWidget):30 class SIRPObjectWidget(ObjectWidget): 31 31 32 32 def __init__(self, context, request, factory, **kw): … … 58 58 59 59 def _getView(self, request): 60 return WAeUPObjectWidgetView(self, request)60 return SIRPObjectWidgetView(self, request) 61 61 62 class WAeUPObjectDisplayWidget(WAeUPObjectWidget):62 class SIRPObjectDisplayWidget(SIRPObjectWidget): 63 63 64 64 implementsOnly(IDisplayWidget) -
main/waeup.sirp/trunk/src/waeup/sirp/widgets/tests/test_objectwidget.py
r7196 r7321 38 38 from zope.formlib.interfaces import IWidgetInputErrorView 39 39 40 from waeup.sirp.widgets.objectwidget import WAeUPObjectWidget as ObjectWidget40 from waeup.sirp.widgets.objectwidget import SIRPObjectWidget as ObjectWidget 41 41 from waeup.sirp.widgets.objectwidget import ( 42 WAeUPObjectDisplayWidget as ObjectDisplayWidget)42 SIRPObjectDisplayWidget as ObjectDisplayWidget) 43 43 44 44 class ITestContact(Interface): -
main/waeup.sirp/trunk/src/waeup/sirp/workflow.py
r7193 r7321 25 25 from zope.security.interfaces import NoInteraction 26 26 from zope.security.management import getInteraction 27 from waeup.sirp.interfaces import I WAeUPWorkflowInfo27 from waeup.sirp.interfaces import ISIRPWorkflowInfo 28 28 29 class WAeUPWorkflow(Workflow):29 class SIRPWorkflow(Workflow): 30 30 """A :mod:`hurry.workflow` workflow with more appropriate error 31 31 messages. … … 71 71 return False 72 72 73 class WAeUPWorkflowInfo(WorkflowInfo):73 class SIRPWorkflowInfo(WorkflowInfo): 74 74 """A workflow info that provides a convenience transition getter. 75 75 """ 76 76 77 grok.provides(I WAeUPWorkflowInfo)77 grok.provides(ISIRPWorkflowInfo) 78 78 79 79 def getManualTransitions(self):
Note: See TracChangeset for help on using the changeset viewer.