Changeset 3824


Ignore:
Timestamp:
19 Dec 2008, 15:44:45 (16 years ago)
Author:
Henrik Bettermann
Message:

implement configuration object (step 1)

Configuration file must be created with create_configuration_file.py

Location:
WAeUP_SRP/trunk
Files:
6 added
16 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/CHANGES.txt

    r3815 r3824  
    130130-----------------
    131131- implement NAU Awka
     132
     1331.26 (2008-12-19)
     134-----------------
     135- implement configuration object (step 1)
  • WAeUP_SRP/trunk/Documents.py

    r2013 r3824  
    7979    ob = WAeUPDocument(id, **kw)
    8080    return CPSBase_adder(container, ob, REQUEST=REQUEST)
     81   
     82   
     83
    8184
    8285###)
  • WAeUP_SRP/trunk/University.py

    r2691 r3824  
    2828    ob = University(id, **kw)
    2929    return CPSBase_adder(container, ob, REQUEST=REQUEST)
     30   
     31       
     32class WAeUPConfiguration(CPSDocument): ###(
     33    """
     34    WAeUP Configuration
     35    """
     36    meta_type = 'WAeUP Configuration'
     37    portal_type = meta_type
     38    security = ClassSecurityInfo()
    3039
     40    def __init__(self, id, **kw):
     41        CPSDocument.__init__(self, id, **kw)
     42
     43InitializeClass(WAeUPConfiguration)
     44
     45def addWAeUPConfiguration(container, id, REQUEST=None, **kw):
     46    """Add a WAeUP Configuration."""
     47    ob = WAeUPConfiguration(id, **kw)
     48    return CPSBase_adder(container, ob, REQUEST=REQUEST)       
     49
  • WAeUP_SRP/trunk/WAeUPTool.py

    r3817 r3824  
    18821882                open(filename,"wb").write(str(image.data))
    18831883    ###)
     1884   
     1885   
     1886    security.declarePublic('getConfigParams')
     1887    def getConfigParams(self,conf_id="configuration"):
     1888        conf = getattr(self.portal_url.getPortalObject().campus,conf_id)
     1889        conf_obj = conf.getContent()
     1890        stool = getToolByName(self, 'portal_schemas')
     1891        schema = stool._getOb('configuration')
     1892        d = {}
     1893        for key in schema.keys():
     1894            d[key] = getattr(conf_obj,key,None)
     1895        return d
     1896
    18841897
    18851898InitializeClass(WAeUPTool)
  • WAeUP_SRP/trunk/__init__.py

    r3815 r3824  
    2222
    2323waeup_types = (
    24     ("University",('University',)),
     24    ("University",
     25       ('University',
     26        'WAeUPConfiguration',
     27        )
     28    ),
    2529    ("Academics",
    2630       ("AcademicsFolder",
  • WAeUP_SRP/trunk/profiles/default/layouts.xml

    r3792 r3824  
    116116  <object name="waeup_common" meta_type="CPS Layout"/>
    117117  <object name="student_gown" meta_type="CPS Layout"/>
     118  <object name="configuration" meta_type="CPS Layout"/>
    118119 
    119120</object>
  • WAeUP_SRP/trunk/profiles/default/layouts/student_firsttime_login.xml

    r3813 r3824  
    5151  <property name="hidden_layout_modes"/>
    5252  <property name="hidden_readonly_layout_modes"/>
    53   <property name="display_width">14</property>
    54   <property name="size_max">14</property>
     53  <property name="display_width">18</property>
     54  <property name="size_max">18</property>
    5555  <property name="matric_no_catalog">students_catalog</property>
    5656  <property name="results_catalog"></property>
  • WAeUP_SRP/trunk/profiles/default/roots/campus.xml

    r3689 r3824  
    88  <object name="uploads" portal_type="UploadsFolder" />
    99  <object name="documents" portal_type="DocumentsFolder" />
     10  <object name="configuration" portal_type="WAeUPConfiguration" />
    1011</object>
  • WAeUP_SRP/trunk/profiles/default/roots/campus/documents.xml

    r3689 r3824  
    11<?xml version="1.0"?>
    2 <object name="students">
     2<object name="documents">
    33  <property name="Title">Documents</property>
    44</object>
  • WAeUP_SRP/trunk/profiles/default/schemas.xml

    r3689 r3824  
    8888 <object name="upload" meta_type="CPS Schema"/>
    8989 <object name="waeup_common" meta_type="CPS Schema"/>
     90 <object name="configuration" meta_type="CPS Schema"/>
    9091 
    9192 
  • WAeUP_SRP/trunk/profiles/default/types.xml

    r3689 r3824  
    139139 <object name="Upload" meta_type="CPS Flexible Type Information"/>
    140140 <object name="StudentPastoralReport" meta_type="CPS Flexible Type Information"/>
     141 <object name="WAeUPConfiguration" meta_type="CPS Flexible Type Information"/>
    141142
    142143
  • WAeUP_SRP/trunk/profiles/default/types/University.xml

    r3689 r3824  
    1616  <element value="AccoFolder"/>
    1717  <element value="StudentsFolder"/>
     18  <element value="WAeUPConfiguration"/>
    1819 </property>
    1920 <property name="allow_discussion">False</property>
  • WAeUP_SRP/trunk/profiles/default/workflows.xml

    r3689 r3824  
    136136   <bound-workflow workflow_id="waeup_document_wf"/>
    137137  </type>
     138  <type type_id="WAeUPConfiguration">
     139   <bound-workflow workflow_id="waeup_section_wf"/>
     140  </type> 
    138141  <type type_id="StudentPastoralReport">
    139142   <bound-workflow workflow_id="waeup_student_subobject_wf"/>
  • WAeUP_SRP/trunk/skins/cps_custom/cpsdocument_create.py

    r3157 r3824  
    2525from Products.CPSDocument.utils import getFormUidUrlArg
    2626
     27request = REQUEST
     28
     29try:
     30    from Products.zdb import set_trace
     31except:
     32    def set_trace():
     33        pass
     34
    2735ti = getToolByName(context, 'portal_types').getTypeInfo(type_name)
    2836
    2937while True:
    3038    if not context.isSectionOfficer():
    31         psm = "illegal access"
    32         break
     39        return request.RESPONSE.redirect("%s/srp_anonymous_view" % context.portal_url())
     40
    3341    is_valid, ds = ti.validateObject(None, layout_mode='create',
    3442                                    request=REQUEST, context=context,
  • WAeUP_SRP/trunk/skins/waeup_default/waeup_document_create_do.py

    r3682 r3824  
    1111request = context.REQUEST
    1212
    13 if type_name in ("StudyLevel","StudentStudyLevel","WAeUPDocument","StudentPastoralReport"):
     13if type_name in ("StudyLevel","StudentStudyLevel","WAeUPDocument","StudentPastoralReport","WAeUPConfiguration"):
    1414    id = datamodel.get('code')
    1515else:
  • WAeUP_SRP/trunk/skins/waeup_student/apply_admission.py

    r3794 r3824  
    5757
    5858deaddates = {}
     59
     60#config_params = context.getConfigParams()
     61#deaddates['pume'] = config_params['dead_pume']
     62
    5963deaddates['pume'] = DateTime.DateTime('2008/08/19 07:00')
    6064deaddates['pde'] = DateTime.DateTime('2008/10/02 23:59')
Note: See TracChangeset for help on using the changeset viewer.