# -*- coding: UTF-8 -*-
# -----------------------------------------------------------------------------
#    xierpa server
#    Copyright (c) 2014+  buro@petr.com, www.petr.com, www.xierpa.com
#    
#    X I E R P A  3
#    Distribution by the MIT License.
#
# -----------------------------------------------------------------------------
#
#    page.py
#
from xierpa3.components.component import Component
from xierpa3.descriptors.blueprint import BluePrint

class Page(Component):
    u"""The <b>Page</b> component builds the content of a single page, dependent on
    the parameters in the url."""
    
    CC = Component # Access constants through parent class.
    
    BLUEPRINT = BluePrint(
        name='Untitled', doc_name=u'Name of the page.',
        class_=CC.CLASS_PAGE, doc_pageClass=u'Class of the page. Defailt = CLASS_PAGE', 
    )
    def reset(self):
        u"""Gets called prior to every page build. Can be redefined by inheriting theme classes.
        Default behavior is to do nothing."""
        pass

    def XXXblock(self, b):
        u"""Start the block by calling the builder method <b>b.div( )</b> with the 
        default class definition."""
        s = self.style
        b.div(class_=s.class_ or self.class_ or self.CLASS_PAGE)
        b.comment(self.name) 
        
    def XXX_block(self, b):
        u"""End the block by calling the builder method <b>b.div( )</b> with the 
        default class definition as comment."""
        s = self.style
        b._div(comment=s.class_ or self.class_ or self.CLASS_PAGE) # End comment is automatic.
        
    def buildBlock(self, b):
        u"""
        Make the builder <i>b</i> open the page and open the block. Then call the builder 
        for all enclosed components. Make the builder <i>b</i> close the block and close the page.
        """
        b.page(self)
        for component in self.components:
            component.build(b) # Dispatch the type of building to be done here.
        b._page(self)

@@ -1024,568 +1024,8 @@
 ss%0A%0A
-    def XXXblock(self, b):%0A        u%22%22%22Start the block by calling the builder method %3Cb%3Eb.div( )%3C/b%3E with the %0A        default class definition.%22%22%22%0A        s = self.style%0A        b.div(class_=s.class_ or self.class_ or self.CLASS_PAGE)%0A        b.comment(self.name) %0A        %0A    def XXX_block(self, b):%0A        u%22%22%22End the block by calling the builder method %3Cb%3Eb.div( )%3C/b%3E with the %0A        default class definition as comment.%22%22%22%0A        s = self.style%0A        b._div(comment=s.class_ or self.class_ or self.CLASS_PAGE) # End comment is automatic.%0A        %0A
     

Remove obsolete methods