Changeset 1429

Show
Ignore:
Timestamp:
11/20/08 10:40:38
Author:
mylan
Message:

Add sitemapType field to Sitemap content type

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • qPloneGoogleSitemaps/branches/contenttype/content/sitemap.py

    r1428 r1429  
    1313from Products.qPloneGoogleSitemaps.config import PROJECTNAME 
    1414 
     15SITEMAPS_LIST = ['content','mobile','news'] 
     16 
    1517SitemapSchema = schemata.ATContentTypeSchema.copy() + atapi.Schema(( 
    1618 
    1719    # -*- Your Archetypes field definitions here ... -*- 
     20    atapi.StringField( 
     21        name='sitemapType', 
     22        storage = atapi.AnnotationStorage(), 
     23        required=True, 
     24        default='content', 
     25        vocabulary=SITEMAPS_LIST, 
     26        widget=atapi.SelectionWidget( 
     27            label=_(u"Sitemap type"), 
     28            description=_(u"Select Type of the sitemap."), 
     29        ), 
     30    ), 
    1831    atapi.LinesField( 
    1932        name='portalTypes', 
    2033        storage = atapi.AnnotationStorage(), 
    21         required=False, 
     34        required=True, 
    2235        default=['Document',], 
    2336        vocabulary="availablePortalTypes", 
     
    3144        name='states', 
    3245        storage = atapi.AnnotationStorage(), 
    33         required=False, 
     46        required=True, 
    3447        default=['published',], 
    3548        vocabulary="getWorkflowStates", 
  • qPloneGoogleSitemaps/branches/contenttype/content/sitemap.py~

    r1428 r1429  
    1313from Products.qPloneGoogleSitemaps.config import PROJECTNAME 
    1414 
     15SITEMAPS_LIST = ['content','mobile','news'] 
     16 
     17 
    1518SitemapSchema = schemata.ATContentTypeSchema.copy() + atapi.Schema(( 
    1619 
    1720    # -*- Your Archetypes field definitions here ... -*- 
     21    atapi.StringField( 
     22        name='sitemapType', 
     23        storage = atapi.AnnotationStorage(), 
     24        required=True, 
     25        default='content', 
     26        vocabulary=SITEMAPS_LIST, 
     27        widget=atapi.SelectionWidget( 
     28            label=_(u"Sitemap type"), 
     29            description=_(u"Select Type of the sitemap."), 
     30        ), 
     31    ), 
    1832    atapi.LinesField( 
    1933        name='portalTypes', 
    2034        storage = atapi.AnnotationStorage(), 
    21         required=False, 
     35        required=True, 
    2236        default=['Document',], 
    2337        vocabulary="availablePortalTypes", 
     
    3145        name='states', 
    3246        storage = atapi.AnnotationStorage(), 
    33         required=False, 
     47        required=True, 
    3448        default=['published',], 
    3549        vocabulary="getWorkflowStates", 
     
    121135    def getWorkflowStates(self): 
    122136        pw = getToolByName(self,'portal_workflow') 
    123         states = set([v for k,v in pw.listWFStatesByTitle()]) 
     137        states = list(set([v for k,v in pw.listWFStatesByTitle()])) 
     138        states.sort() 
    124139        return atapi.DisplayList(zip(states, states)) 
    125140