Example #1
0
 def __call__(self):
     searchable_text = ''
     for content in self.context.objectValues():
         if ISimplelayoutBlock.providedBy(content):
             searchable_text += indexer.dynamic_searchable_text_indexer(
                 content)()
     return searchable_text
    def get_blocks_without_worfklows(self):
        for obj in self.context.objectValues():
            if not ISimplelayoutBlock.providedBy(obj):
                continue

            state = getMultiAdapter((obj, self.request),
                                    IPublisherContextState)
            if state.has_workflow():
                continue

            yield obj
    def get_blocks_without_worfklows(self):
        # Use contentValues for implicit ftw.trash compatibility.
        for obj in self.context.contentValues():
            if not ISimplelayoutBlock.providedBy(obj):
                continue

            state = getMultiAdapter((obj, self.request),
                                    IPublisherContextState)
            if state.has_workflow():
                continue

            yield obj
Example #4
0
def migrate_simplelayout_page_state(old_page, new_page):
    for block in new_page.listFolderContents():
        if INewSLBlock.providedBy(block):
            raise ValueError('Block must be migrated after pages.')

        if not ISimpleLayoutBlock.providedBy(block):
            continue

        if ISlotBlock.providedBy(block) or IPortletColumn.providedBy(block):
            move_sl_block_into_slot(old_page, new_page, block, 'portletright')

        elif ISlotD.providedBy(block):
            move_sl_block_into_slot(old_page, new_page, block, 'bottom')

        else:
            move_sl_block_into_slot(old_page, new_page, block, 'default')
Example #5
0
 def get_block_content(self):
     block = self.context.aq_parent
     if ISimplelayoutBlock.providedBy(block):
         return get_block_html(block)
     else:
         raise ValueError("The parent needs to be a simplelayout block")
Example #6
0
    def _sl_block(self):
        for obj in aq_chain(self.context):
            if ISimplelayoutBlock.providedBy(obj):
                return obj

        raise AttributeError('No simplelayout block in aq_chain')