Exemplo n.º 1
0
def setup_content(context):

    if sht.isNotThisProfile(context, "g24.importer-setup_content.txt"):
        return

    site = context.getSite()

    # delete some default folders AND posts folder
    sht.delete_items(site, ("front-page", "news", "events", "Members"), logger)

    site.setLayout("stream")

    _type = "g24.elements.basetypecontainer"

    posts = create(site, _type)
    posts.id = "posts"
    posts = add(posts, site)
    posts.setLayout("stream")
    posts.title = u"Posts"

    events = create(site, _type)
    events.id = "events"
    events = add(events, site)
    events.setLayout("event_listing")
    events.title = u"Events"

    places = create(site, _type)
    places.id = "places"
    places = add(places, site)
    places.setLayout("stream")
    places.title = u"Places"
Exemplo n.º 2
0
def setup_content(context):
    if sht.isNotThisProfile(context, 'plonetheme.zopeorg_setup_content.txt'):
        return

    site = context.getSite()
    sht.delete_items(site, ('front-page', 'news', 'events'), logger)
    sht.hide_and_retract(site['Members'], logger)

    content_structure = [
        {
            'type': 'Image',
            'title': 'old.zope.org Screenshot',
            'id': u'Screenshotold.zope.org.png',
            'opts': {
                'setExcludeFromNav': True
            },
            'data': {
                'image':
                sht.load_file(globals(),
                              'setupdata/Screenshotold.zope.org.png')
            }
        },
        {
            'type':
            'Folder',
            'title':
            u'Teasers',
            'opts': {
                'workflow': None,  # leave private
                'setLocallyAllowedTypes': [
                    'Teaser',
                ],
                'setImmediatelyAddableTypes': [
                    'Teaser',
                ],
                'setLayout': 'folder_summary_view'
            },
            'childs': [{
                'type': 'Teaser',
                'title': 'The World of Zope',
                'data': {
                    'image':
                    sht.load_file(globals(),
                                  'setupdata/teaser_world-of-zope.jpg'),
                    'importance':
                    u'3'
                }
            }]
        },
        {
            'type':
            'Collage',
            'title':
            u'Start',
            'id':
            'front-page',
            'data': {
                'show_title': False,
                'show_description': False,
            },
            'childs': [
                {
                    'type':
                    'CollageRow',
                    'title':
                    '',
                    'id':
                    '1',
                    'childs': [
                        # the following column should hold a teaser portlet
                        {
                            'type': 'CollageColumn',
                            'title': '',
                            'id': '1'
                        }
                    ]
                },
                {
                    'type':
                    'CollageRow',
                    'title':
                    '',
                    'id':
                    '2',
                    'childs': [
                        {
                            'type':
                            'CollageColumn',
                            'title':
                            '',
                            'id':
                            '1',
                            'childs': [{
                                'type': 'Document',
                                'title': u'Zope Community',
                                'id': u'front-community',
                                'opts': {
                                    'setExcludeFromNav': True
                                },
                                'data': {
                                    'text': START_ZOPE_COMMUNITY_TEXT
                                }
                            }]
                        },
                        {
                            'type':
                            'CollageColumn',
                            'title':
                            '',
                            'id':
                            '2',
                            'childs': [{
                                'type': 'Document',
                                'title': u'Zope Foundation',
                                'id': u'front-foundation',
                                'opts': {
                                    'setExcludeFromNav': True
                                },
                                'data': {
                                    'text': START_ZOPE_FOUNDATION_TEXT
                                }
                            }]
                        },
                        {
                            'type':
                            'CollageColumn',
                            'title':
                            '',
                            'id':
                            '3',
                            'childs': [{
                                'type': 'Document',
                                'title': u'Zope.org legacy',
                                'id': u'front-legacy',
                                'opts': {
                                    'setExcludeFromNav': True
                                },
                                'data': {
                                    'text': START_ZOPEORG_LEGACY_TEXT
                                }
                            }]
                        },
                    ]
                },
            ]
        },
        {
            'type': 'Document',
            'title': u'The World of Zope',
            'id': 'the-world-of-zope',
            'data': {
                'text': THE_WORLD_OF_ZOPE_TEXT
            }
        },
        {
            'type': 'Document',
            'title': u'News & Events',
            'id': u'news-events',
            'data': {
                'text': NEWS_EVENTS_TEXT
            }
        },
        {
            'type': 'Document',
            'title': u'Community',
            'id': u'community',
            'data': {
                'text': COMMUNITY_TEXT
            }
        },
        {
            'type': 'Document',
            'title': u'Resources',
            'id': u'resources',
            'data': {
                'text': RESOURCES_TEXT
            }
        },
        {
            'type': 'Document',
            'title': u'Zope Foundation',
            'id': u'foundation',
            'data': {
                'text': ZOPE_FOUNDATION_TEXT
            }
        },
        {
            'type': 'Document',
            'title': u'Legal',
            'id': u'legal',
            'opts': {
                'setExcludeFromNav': True
            },
            'data': {
                'description': u"""Zope.org Legal Notice.""",
                'text': LEGAL_TEXT
            }
        },
    ]
    sht.create_item_runner(site, content_structure, logger=logger)

    #the collage column will hold a portlet, so the view must be portlets-top
    from Products.Collage.interfaces import IDynamicViewManager
    manager = IDynamicViewManager(site['front-page']['1']['1'])
    manager.setLayout('portlets-top')

    #set the link reference in the teaser
    site['teasers']['the-world-of-zope'].setLink_internal(
        site['the-world-of-zope'])
    site['teasers']['the-world-of-zope'].reindexObject()
Exemplo n.º 3
0
def setup_content(context):
    if sht.isNotThisProfile(context, 'plonetheme.zopeorg_setup_content.txt'):
        return

    site = context.getSite()
    sht.delete_items(site, ('front-page', 'news', 'events'), logger)
    sht.hide_and_retract(site['Members'], logger)

    content_structure = [

        {'type': 'Image', 'title': 'old.zope.org Screenshot',
         'id': u'Screenshotold.zope.org.png',
         'opts': {'setExcludeFromNav': True},
         'data': {'image': sht.load_file(globals(),
                               'setupdata/Screenshotold.zope.org.png')}},

        {'type': 'Folder', 'title': u'Teasers',
         'opts': {'workflow': None, # leave private
                  'setLocallyAllowedTypes': ['Teaser',],
                  'setImmediatelyAddableTypes':['Teaser',],
                  'setLayout': 'folder_summary_view'},
         'childs': [
             {'type': 'Teaser', 'title': 'The World of Zope',
              'data': {'image': sht.load_file(globals(),
                                'setupdata/teaser_world-of-zope.jpg'),
                       'importance': u'3'}}]},

        {'type': 'Collage', 'title': u'Start', 'id': 'front-page',
         'data': { 'show_title': False, 'show_description': False, },
         'childs': [
             {'type': 'CollageRow', 'title': '', 'id': '1',
              'childs': [
                  # the following column should hold a teaser portlet
                  {'type': 'CollageColumn', 'title': '', 'id': '1'}]},
             {'type': 'CollageRow', 'title': '', 'id': '2',
              'childs': [
                  {'type': 'CollageColumn', 'title': '', 'id': '1',
                   'childs': [
                        {'type': 'Document', 'title': u'Zope Community', 'id': u'front-community',
                         'opts': {'setExcludeFromNav': True},
                         'data': {'text': START_ZOPE_COMMUNITY_TEXT}}]},
                  {'type': 'CollageColumn', 'title': '', 'id': '2',
                   'childs': [
                        {'type': 'Document', 'title': u'Zope Foundation', 'id': u'front-foundation',
                         'opts': {'setExcludeFromNav': True},
                         'data': {'text': START_ZOPE_FOUNDATION_TEXT}}]},
                  {'type': 'CollageColumn', 'title': '', 'id': '3',
                   'childs': [
                        {'type': 'Document', 'title': u'Zope.org legacy', 'id': u'front-legacy',
                         'opts': {'setExcludeFromNav': True},
                         'data': {'text': START_ZOPEORG_LEGACY_TEXT}}]},
            ]},
        ]},

        {'type': 'Document', 'title': u'The World of Zope', 'id': 'the-world-of-zope',
         'data': {'text': THE_WORLD_OF_ZOPE_TEXT}},

        {'type': 'Document', 'title': u'News & Events', 'id': u'news-events',
         'data': {'text': NEWS_EVENTS_TEXT}},

        {'type': 'Document', 'title': u'Community', 'id': u'community',
         'data': {'text': COMMUNITY_TEXT}},

        {'type': 'Document', 'title': u'Resources', 'id': u'resources',
         'data': {'text': RESOURCES_TEXT}},

        {'type': 'Document', 'title': u'Zope Foundation', 'id': u'foundation',
         'data': {'text': ZOPE_FOUNDATION_TEXT}},

        {'type': 'Document', 'title': u'Legal', 'id': u'legal',
         'opts': {'setExcludeFromNav': True},
         'data': {'description':u"""Zope.org Legal Notice.""",
                  'text': LEGAL_TEXT}},
    ]
    sht.create_item_runner(site, content_structure, logger=logger)

    #the collage column will hold a portlet, so the view must be portlets-top
    from Products.Collage.interfaces import IDynamicViewManager
    manager = IDynamicViewManager(site['front-page']['1']['1'])
    manager.setLayout('portlets-top')

    #set the link reference in the teaser
    site['teasers']['the-world-of-zope'].setLink_internal(site['the-world-of-zope'])
    site['teasers']['the-world-of-zope'].reindexObject()