Changeset 2264


Ignore:
Timestamp:
20 Sep 2007, 17:36:42 (17 years ago)
Author:
joachim
Message:

faculty import added

Location:
WAeUP_SRP
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/base/PatchQueueCatalogProcessQueue.py

    r2260 r2264  
    9696            catalog_object(obj, uid, cat_indexes)
    9797        else:
    98             import pdb;pdb.set_trace()
     98            #import pdb;pdb.set_trace()
    9999            self._update(uid, already_cataloged and CHANGED or ADDED)
    100100        # Update some of the indexes immediately.
  • WAeUP_SRP/base/WAeUPTool.py

    r2263 r2264  
    6161    meta_type = 'WAeUP Tool'
    6262    _actions = ()
    63 
    6463    security = ClassSecurityInfo()
    6564    security.declareObjectProtected(View)
    66 
    6765    manage_options = ( ActionProviderBase.manage_options
    6866                     + SimpleItem.manage_options
     
    913911    ###)
    914912
     913    security.declareProtected(ModifyPortalContent,'mass_create_faculty') ###(
     914    def mass_create_faculty(self,mapping):
     915        "create a faculty"
     916        logger = logging.getLogger('WAeUPTool.mass_create_faculty')
     917        academics_folder = self.portal_url.getPortalObject().campus.academics
     918        fid = mapping['code']
     919        if getattr(academics_folder,fid,None) is not None:
     920            return '', "Faculty with ID: %s exists" % fid
     921        logger.info('Creating Faculty %(code)s = %(title)s' % mapping)
     922        academics_folder.invokeFactory('Faculty', fid)
     923        f = getattr(academics_folder,fid,None)
     924        f.getContent().edit(mapping=mapping)
     925        return fid,''
     926    ###)
     927
     928    security.declareProtected(ModifyPortalContent,'mass_edit_Faculty') ###(
     929    def mass_edit_faculty(self,mapping):
     930        "edit a faculty"
     931        logger = logging.getLogger('WAeUPTool.mass_edit_faculty')
     932        academics_folder = self.portal_url.getPortalObject().campus.academics
     933        fid = mapping['code']
     934        f = getattr(academics_folder,fid,None)
     935        if f is None:
     936            return '', "Faculty with ID: %s does not exist" % fid
     937        logger.info('Editing Faculty %(code)s = %(title)s' % mapping)
     938        f.getContent().edit(mapping=mapping)
     939        return fid,''
     940    ###)
     941
    915942    security.declareProtected(ModifyPortalContent,'mass_create_department') ###(
    916943    def mass_create_department(self,mapping):
     
    12421269                #import_keys = [k for k in item.keys() if not k.startswith('ignore')]
    12431270                attrs = csv.reader(open("%s/import/%s.csv" % (i_home,filename),"rb")).next()
    1244                 #import pdb;pdb.set_trace()
    12451271                import_keys = [k for k in attrs if not k.startswith('ignore')]
    12461272                diff2schema = set(import_keys).difference(set(schema.keys()))
     
    12561282                format_error = format + ',"%(Error)s"'
    12571283                format = '"%(id)s",'+ format
    1258                 by_pass_queue = getattr(self.portal_catalog,"setBypassQueue",None)
    1259                 if by_pass_queue is not None:
    1260                     bypass_queue(bypass_queue_catalog)
    12611284
    12621285            dm = DataModel(item, adapters,context=self)
     
    12641287            error_string = ""
    12651288            for k in import_keys:
     1289                #import pdb;pdb.set_trace()
    12661290                if not validators[k](ds):
    1267                     error_string += " %s : %s" % (k,ds.getError(k))
     1291                    error_string += " %s : %s" % (k,
     1292                                                  self.translation_service(ds.getError(k),
     1293                                                                           ds.getErrorMapping(k)))
    12681294            if not error_string:
    12691295                item.update(dm)
  • WAeUP_SRP/uniben/profiles/default/layouts.xml

    r2193 r2264  
    1313  <object name="import_department" meta_type="CPS Layout"/>
    1414  <object name="department" meta_type="CPS Layout"/>
     15  <object name="import_faculty" meta_type="CPS Layout"/>
    1516  <object name="faculty" meta_type="CPS Layout"/>
    1617  <object name="import" meta_type="CPS Layout"/>
  • WAeUP_SRP/uniben/profiles/default/schemas.xml

    r2193 r2264  
    1414 <object name="department" meta_type="CPS Schema"/>
    1515 <object name="faculty" meta_type="CPS Schema"/>
     16 <object name="import_faculty" meta_type="CPS Schema"/>
    1617 <object name="members" meta_type="CPS Schema"/>
    1718 <object name="members_search" meta_type="CPS Schema"/>
  • WAeUP_SRP/uniben/profiles/default/vocabularies/import_names.xml

    r2193 r2264  
    77 <property name="acl_write_roles">Manager</property>
    88 <item key="student" msgid="">Student Data</item>
     9 <item key="faculty" msgid="">Faculty Data</item>
    910 <item key="department" msgid="">Department Data</item>
    1011</object>
Note: See TracChangeset for help on using the changeset viewer.