Changeset 280

Show
Ignore:
Timestamp:
02/21/07 15:19:14 (2 years ago)
Author:
mikey
Message:

added net.stubbles.websites.processors.stubAbstractProcessor

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/main/php/net/stubbles/websites/memphis/stubMemphisPageProcessor.php

    r279 r280  
    77 * @subpackage  websites_memphis 
    88 */ 
    9 stubClassLoader::load('net.stubbles.websites.processors.stubProcessor', 
     9stubClassLoader::load('net.stubbles.websites.processors.stubAbstractProcessor', 
    1010                      'net.stubbles.ipo.response.stubBaseResponse' 
    1111); 
     
    1616 * @subpackage  websites_memphis 
    1717 */ 
    18 class stubMemphisPageProcessor extends stubBaseObject implements stubProcessor 
     18class stubMemphisPageProcessor extends stubAbstractProcessor 
    1919{ 
    20     /** 
    21      * the request 
    22      * 
    23      * @var  stubRequest 
    24      */ 
    25     protected $request; 
    26     /** 
    27      * current session 
    28      * 
    29      * @var  stubSession 
    30      */ 
    31     protected $session; 
    32     /** 
    33      * the created response 
    34      * 
    35      * @var  stubResponse 
    36      */ 
    37     protected $response; 
    38     /** 
    39      * the factory that creates the page instance 
    40      * 
    41      * @var  stubPageFactory 
    42      */ 
    43     protected $pageFactory; 
    44  
    4520    /** 
    4621     * constructor 
     
    5227    public function __construct(stubRequest $request, stubSession $session, stubPageFactory $pageFactory) 
    5328    { 
    54         $this->request     = $request; 
    55         $this->session     = $session; 
    56         $this->pageFactory = $pageFactory; 
    57         $this->response    = new stubBaseResponse(); 
     29        parent::__construct($request, $session, $pageFactory); 
     30        $this->response = new stubBaseResponse(); 
    5831    } 
    5932 
    6033    /** 
    61      * processes the request 
     34     * does the real processing 
    6235     * 
    6336     * @return  stubProcessor 
    6437     */ 
    65     public function process() 
     38    protected function doProcess() 
    6639    { 
    6740        if ($this->request->hasValue('page') == true) { 
     
    8558            $element->process($this->request, $this->session, $this->response); 
    8659        } 
    87  
    88         return $this; 
    89     } 
    90  
    91     /** 
    92      * returns the created response 
    93      * 
    94      * @return  stubResponse 
    95      */ 
    96     public function getResponse() 
    97     { 
    98         return $this->response; 
    9960    } 
    10061} 
  • trunk/src/main/php/net/stubbles/websites/xml/stubXMLProcessor.php

    r279 r280  
    77 * @subpackage  websites_xml 
    88 */ 
    9 stubClassLoader::load('net.stubbles.websites.processors.stubProcessor', 
     9stubClassLoader::load('net.stubbles.websites.processors.stubAbstractProcessor', 
    1010                      'net.stubbles.ipo.response.stubBaseResponse', 
    1111                      'net.stubbles.util.validators.stubRegexValidator', 
     
    2121 *              stubPage into the stubXMLPagePostInterceptor 
    2222 */ 
    23 class stubXMLProcessor extends stubBaseObject implements stubProcessor 
     23class stubXMLProcessor extends stubAbstractProcessor 
    2424{ 
    25     /** 
    26      * the request 
    27      * 
    28      * @var  stubRequest 
    29      */ 
    30     protected $request; 
    31     /** 
    32      * current session 
    33      * 
    34      * @var  stubSession 
    35      */ 
    36     protected $session; 
    37     /** 
    38      * the created response 
    39      * 
    40      * @var  stubResponse 
    41      */ 
    42     protected $response; 
    43     /** 
    44      * the page factory to use to read the page configuration 
    45      * 
    46      * @var  stubPageFactory 
    47      */ 
    48     protected $pageFactory; 
    49  
    5025    /** 
    5126     * constructor 
     
    5732    public function __construct(stubRequest $request, stubSession $session, stubPageFactory $pageFactory) 
    5833    { 
    59         $this->request     = $request; 
    60         $this->session     = $session; 
    61         $this->pageFactory = $pageFactory; 
    62         $this->response    = new stubBaseResponse(); 
     34        parent::__construct($request, $session, $pageFactory); 
     35        $this->response = new stubBaseResponse(); 
    6336    } 
    6437 
    6538    /** 
    66      * processes the request 
     39     * does the real processing 
    6740     * 
    68      * @return  stubProcessor 
    69      * @todo    think about putting default values into the result document 
     41     * @todo  think about putting default values into the result document 
    7042     */ 
    71     public function process() 
     43    protected function doProcess() 
    7244    { 
    7345        if ($this->request->hasValue('page') == true) { 
     
    9264        $xmlStreamWriter->writeEndElement();  // end document 
    9365        $this->response->replaceData($xmlStreamWriter->asXML()); 
    94  
    95         return $this; 
    9666    } 
    9767 
    98     /** 
    99      * returns the created response 
    100      * 
    101      * @return  stubResponse 
    102      */ 
    103     public function getResponse() 
    104     { 
    105         return $this->response; 
    106     } 
    107      
    10868    /** 
    10969     * returns a xml stream writer