Changeset 2481


Ignore:
Timestamp:
11/16/07 09:54:53 (7 years ago)
Author:
ems174@…
Message:

Creating a branch to start the content type renaming. Refs #349.

Location:
weblion/FacultyStaffDirectory/branches/class-rename
Files:
15 edited
1 copied

Legend:

Unmodified
Added
Removed
  • weblion/FacultyStaffDirectory/branches/class-rename/Classification.py

    r2468 r2481  
    3535            label_msgid='FacultyStaffDirectory_label_people', 
    3636            i18n_domain='FacultyStaffDirectory', 
    37             base_query={'portal_type':'Person', 'sort_on':'getSortableName'}, 
     37            base_query={'portal_type':'fsdPerson', 'sort_on':'getSortableName'}, 
    3838            allow_browse=0, 
    3939            allow_search=1, 
     
    4141        ), 
    4242        write_permission=ASSIGN_CLASSIFICATIONS_TO_PEOPLE, 
    43         allowed_types=('Person',), 
     43        allowed_types=('fsdPerson',), 
    4444        multiValued=1, 
    4545        relationship='classifications_people' 
  • weblion/FacultyStaffDirectory/branches/class-rename/Committee.py

    r2474 r2481  
    2828            label_msgid='FacultyStaffDirectory_label_members', 
    2929            i18n_domain='FacultyStaffDirectory', 
    30             base_query={'portal_type':'Person', 'sort_on':'getSortableName'}, 
     30            base_query={'portal_type':'fsdPerson', 'sort_on':'getSortableName'}, 
    3131            allow_browse=0, 
    3232            allow_search=1, 
     
    3434        ), 
    3535        write_permission = ASSIGN_COMMITTIES_TO_PEOPLE, 
    36         allowed_types=('Person',), 
     36        allowed_types=('fsdPerson',), 
    3737        multiValued=True, 
    3838        relationship='CommitteeMembership' 
  • weblion/FacultyStaffDirectory/branches/class-rename/Department.py

    r2449 r2481  
    2424            label_msgid='FacultyStaffDirectory_label_members', 
    2525            i18n_domain='FacultyStaffDirectory', 
    26             base_query={'portal_type':'Person', 'sort_on':'getSortableName'}, 
     26            base_query={'portal_type':'fsdPerson', 'sort_on':'getSortableName'}, 
    2727            allow_browse=0, 
    2828            allow_search=1, 
     
    3030        ), 
    3131        write_permission=ASSIGN_DEPARTMENTS_TO_PEOPLE, 
    32         allowed_types=('Person',), 
     32        allowed_types=('fsdPerson',), 
    3333        multiValued=1, 
    3434        relationship='departments_members' 
  • weblion/FacultyStaffDirectory/branches/class-rename/Extensions/AppInstall.py

    r2451 r2481  
    77originalProfileActionId = "MemberPrefs" 
    88newProfileActionId = "fsdMemberPrefs" 
    9 linkableKupuTypes = ['Person', 'Course', 'Classification', 'Department', 'Committee', 'CommitteesFolder', 'Specialty', 'SpecialtiesFolder'] 
     9linkableKupuTypes = ['fsdPerson', 'Course', 'Classification', 'Department', 'Committee', 'CommitteesFolder', 'Specialty', 'SpecialtiesFolder'] 
    1010 
    1111def install(self, product=None, reinstall=None): 
     
    4444    # Set up nav tree: 
    4545    mtntl = list(self.portal_properties.navtree_properties.metaTypesNotToList) 
    46     metaTypes = ['Course', 'Person', 'FacultyStaffDirectoryTool'] 
     46    metaTypes = ['Course', 'fsdPerson', 'FacultyStaffDirectoryTool'] 
    4747    for mType in metaTypes:  
    4848        if not mType in mtntl: 
     
    7171    for type in linkableKupuTypes: 
    7272        addKupuResource('linkable', type) 
    73     addKupuResource('mediaobject','Person') 
     73    addKupuResource('mediaobject','fsdPerson') 
    7474    addKupuResource('collection','FacultyStaffDirectory') 
    7575     
     
    171171        cp = getToolByName(self, "portal_repository") 
    172172        existing = cp.getVersionableContentTypes() 
    173         new = existing + ['Person', 'Committee', 'Specialty'] 
     173        new = existing + ['fsdPerson', 'Committee', 'Specialty'] 
    174174        cp.setVersionableContentTypes(new) 
    175175 
     
    194194    # Remove classes from NavTree_properties: 
    195195    mtntl = list(self.portal_properties.navtree_properties.metaTypesNotToList) 
    196     metaTypes = ['Course', 'Person', 'FacultyStaffDirectoryTool'] 
     196    metaTypes = ['Course', 'fsdPerson', 'FacultyStaffDirectoryTool'] 
    197197    for mType in metaTypes:  
    198198        if mType in self.portal_properties.navtree_properties.metaTypesNotToList: 
     
    299299    for type in linkableKupuTypes: 
    300300        removeKupuResource('linkable', type) 
    301     removeKupuResource('mediaobject','Person') 
     301    removeKupuResource('mediaobject','fsdPerson') 
    302302    removeKupuResource('collection','FacultyStaffDirectory') 
    303303     
     
    315315        new = [] 
    316316        for type in existing: 
    317             if type not in ['Person', 'Committee', 'Specialty']: 
     317            if type not in ['fsdPerson', 'Committee', 'Specialty']: 
    318318                new.append(type) 
    319319        cp.setVersionableContentTypes(new) 
  • weblion/FacultyStaffDirectory/branches/class-rename/Extensions/Install.py

    r2428 r2481  
    8787        "FacultyStaffDirectory", 
    8888        "Classification", 
    89         "Person", 
     89        "fsdPerson", 
    9090        "Course", 
    9191        "CommitteesFolder", 
  • weblion/FacultyStaffDirectory/branches/class-rename/FacultyStaffDirectory.py

    r2439 r2481  
    5252    meta_type = 'FacultyStaffDirectory' 
    5353    portal_type = 'FacultyStaffDirectory' 
    54     allowed_content_types = ['Person', 'Classification', 'Document', 'CommitteesFolder', 'SpecialtiesFolder', 'Topic', 'Department', 'Page'] 
     54    allowed_content_types = ['fsdPerson', 'Classification', 'Document', 'CommitteesFolder', 'SpecialtiesFolder', 'Topic', 'Department', 'Page'] 
    5555    filter_content_types = 1 
    5656    global_allow = 1 
     
    136136        """Return a list of people contained within this FacultyStaffDirectory.""" 
    137137        portal_catalog = getToolByName(self, 'portal_catalog') 
    138         results = portal_catalog(path='/'.join(self.getPhysicalPath()), portal_type='Person', depth=1) 
     138        results = portal_catalog(path='/'.join(self.getPhysicalPath()), portal_type='fsdPerson', depth=1) 
    139139        return [brain.getObject() for brain in results] 
    140140 
  • weblion/FacultyStaffDirectory/branches/class-rename/Person.py

    r2451 r2481  
    420420 
    421421    # This name appears in the 'add' box 
    422     archetype_name = 'Person' 
    423  
    424     meta_type = 'Person' 
    425     portal_type = 'Person' 
     422    archetype_name = 'fsdPerson' 
     423 
     424    meta_type = 'fsdPerson' 
     425    portal_type = 'fsdPerson' 
    426426    allowed_content_types = ['Course', 'BibliographyFolder'] 
    427427    filter_content_types = 1 
  • weblion/FacultyStaffDirectory/branches/class-rename/Specialty.py

    r2449 r2481  
    2727            label_msgid='FacultyStaffDirectory_label_people', 
    2828            i18n_domain='FacultyStaffDirectory', 
    29             base_query={'portal_type':'Person', 'sort_on':'getSortableName'}, 
     29            base_query={'portal_type':'fsdPerson', 'sort_on':'getSortableName'}, 
    3030            allow_browse=0, 
    3131            allow_search=1, 
     
    3333        ), 
    3434        write_permission=ASSIGN_SPECIALTIES_TO_PEOPLE, 
    35         allowed_types=('Person',), 
     35        allowed_types=('fsdPerson',), 
    3636        multiValued=True, 
    3737        relationship='SpecialtyInformation'  # weird relationship name is ArchGenXML's fault 
  • weblion/FacultyStaffDirectory/branches/class-rename/profiles/default/membrane_tool.xml

    r2471 r2481  
    44    <active-workflow-state name="published" /> 
    55  </membrane-type> 
    6   <membrane-type name="Person"> 
     6  <membrane-type name="fsdPerson"> 
    77    <active-workflow-state name="active" /> 
    88  </membrane-type> 
  • weblion/FacultyStaffDirectory/branches/class-rename/profiles/default/workflows.xml

    r2471 r2481  
    55  <object name="fsd_tool_workflow" meta_type="Workflow" />   
    66  <bindings> 
    7     <type type_id="Person"> 
     7    <type type_id="fsdPerson"> 
    88      <bound-workflow workflow_id="fsd_person_workflow" /> 
    99    </type> 
  • weblion/FacultyStaffDirectory/branches/class-rename/relations.xml

    r2085 r2481  
    88                                </allowedSourceType> 
    99                                <allowedTargetType> 
    10                                         Person 
     10                                        fsdPerson 
    1111                                </allowedTargetType> 
    1212                        </TypeConstraint> 
     
    1818                        <TypeConstraint id="type_constraint"> 
    1919                                <allowedSourceType> 
    20                                         Person 
     20                                        fsdPerson 
    2121                                </allowedSourceType> 
    2222                                <allowedTargetType> 
     
    3131                        <TypeConstraint id="type_constraint"> 
    3232                                <allowedSourceType> 
    33                                         Person 
     33                                        fsdPerson 
    3434                                </allowedSourceType> 
    3535                                <allowedTargetType> 
     
    5858                                </allowedSourceType> 
    5959                                <allowedTargetType> 
    60                                         Person 
     60                                        fsdPerson 
    6161                                </allowedTargetType> 
    6262                        </TypeConstraint> 
     
    8282                                </allowedSourceType> 
    8383                                <allowedTargetType> 
    84                                         Person 
     84                                        fsdPerson 
    8585                                </allowedTargetType> 
    8686                        </TypeConstraint> 
     
    103103                        <TypeConstraint id="type_constraint"> 
    104104                                <allowedSourceType> 
    105                                         Person 
     105                                        fsdPerson 
    106106                                </allowedSourceType> 
    107107                                <allowedTargetType> 
     
    130130                                </allowedSourceType> 
    131131                                <allowedTargetType> 
    132                                         Person 
     132                                        fsdPerson 
    133133                                </allowedTargetType> 
    134134                        </TypeConstraint> 
     
    151151                        <TypeConstraint id="type_constraint"> 
    152152                                <allowedSourceType> 
    153                                         Person 
     153                                        fsdPerson 
    154154                                </allowedSourceType> 
    155155                                <allowedTargetType> 
  • weblion/FacultyStaffDirectory/branches/class-rename/tests/testFacultyStaffDirectory.py

    r2385 r2481  
    5454        self.failUnless(person in personList)         
    5555        for c in personList: 
    56             self.failUnless(c.portal_type == 'Person') 
     56            self.failUnless(c.portal_type == 'fsdPerson') 
    5757         
    5858    # tests for membrane integration 
  • weblion/FacultyStaffDirectory/branches/class-rename/tests/testPerson.py

    r2474 r2481  
    104104     
    105105    def testSortableName(self):  
    106         self.directory.invokeFactory('Person', id='a1', firstName = 'Albert', lastName='Williams', classifications=['faculty'])  
    107         self.directory.invokeFactory('Person', id='b2', firstName = 'Albert', lastName='von Whatsit', classifications=['faculty'])  
    108         self.directory.invokeFactory('Person', id='c3', firstName = 'Albert', lastName="d'Example", classifications=['faculty'])  
     106        self.directory.invokeFactory('fsdPerson', id='a1', firstName = 'Albert', lastName='Williams', classifications=['faculty'])  
     107        self.directory.invokeFactory('fsdPerson', id='b2', firstName = 'Albert', lastName='von Whatsit', classifications=['faculty'])  
     108        self.directory.invokeFactory('fsdPerson', id='c3', firstName = 'Albert', lastName="d'Example", classifications=['faculty'])  
    109109        sortedPeople = self.directory['faculty'].getSortedPeople() 
    110110     
     
    244244        """Test that the validate_id method enforces uniqueness for person id.""" 
    245245        #create a different person and try to use their id 
    246         self.directory.invokeFactory(type_name="Person",id="def456",firstName="Joe",lastName="Blow") 
     246        self.directory.invokeFactory(type_name="fsdPerson",id="def456",firstName="Joe",lastName="Blow") 
    247247        self.failUnless('def456' in self.person.validate_id('def456')) 
    248248        #create a different content object and try to use its id 
  • weblion/FacultyStaffDirectory/branches/class-rename/tests/testPlone.py

    r2451 r2481  
    6464        if not directory: 
    6565            directory = self.getEmptyDirectory(portal=portal) 
    66         directory.invokeFactory(type_name="Person", id=id, firstName=firstName, lastName=lastName) 
     66        directory.invokeFactory(type_name="fsdPerson", id=id, firstName=firstName, lastName=lastName) 
    6767        return directory[id] 
    6868 
  • weblion/FacultyStaffDirectory/branches/class-rename/tools/FacultyStaffDirectoryTool.py

    r2478 r2481  
    169169            try: 
    170170                foundUser = mb.searchResults(getUserName=usr.getUserName())[0] # grab the first match 
    171                 if (foundUser.portal_type == 'Person'): 
     171                if (foundUser.portal_type == 'fsdPerson'): 
    172172                    # this is an FSD Person , get its url and go there 
    173173                    url = foundUser.getURL() + '/edit' 
     
    193193            try: 
    194194                foundUser = mb.searchResults(getUserName=usr.getUserName())[0] 
    195                 if (foundUser.portal_type == 'Person'): 
     195                if (foundUser.portal_type == 'fsdPerson'): 
    196196                    # this is an FSD Person , get its url and go there 
    197197                    url = foundUser.getURL() 
     
    214214            try: 
    215215                foundUser = mb.searchResults(getUserName=usr.getUserName())[0] 
    216                 if (foundUser.portal_type == 'Person'): 
     216                if (foundUser.portal_type == 'fsdPerson'): 
    217217                    return True 
    218218                else: 
Note: See TracChangeset for help on using the changeset viewer.