Show
Ignore:
Timestamp:
03/14/08 17:53:51 (6 months ago)
Author:
mikey
Message:

get rid of stubXMLResponse

Files:

Legend:

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

    r1360 r1426  
    11<?php 
    22/** 
    3  * Interceptor that stores the last XML tree in the session and 
    4  * is able to display it. 
    5  * 
    6  * This interceptor must be added as pre-interceptor AND 
    7  * post-interceptor. In the post-interceptor queue, it should 
    8  * be added prior to the XSL transformation processor. 
    9  * 
    10  * In the pre-interceptor queue, it cancels the request in case 
    11  * the request param showLastRequestXML is set and the session 
    12  * is not new. 
     3 * Preinterceptor that is able to display the last created XML result document. 
    134 * 
    145 * @author      Frank Kleine <mikey@stubbles.net> 
     
    178 * @subpackage  websites_xml 
    189 */ 
    19 stubClassLoader::load('net::stubbles::ipo::interceptors::stubPreInterceptor', 
    20                       'net::stubbles::websites::xml::stubXMLAbstractPostInterceptor' 
    21 ); 
     10stubClassLoader::load('net::stubbles::ipo::interceptors::stubPreInterceptor'); 
    2211/** 
    23  * Interceptor that stores the last XML tree in the session and 
    24  * is able to display it. 
     12 * Preinterceptor that is able to display the last created XML result document. 
    2513 * 
    26  * This interceptor must be added as pre-interceptor AND 
    27  * post-interceptor. In the post-interceptor queue, it should 
    28  * be added prior to the XSL transformation processor. 
    29  * 
    30  * In the pre-interceptor queue, it cancels the request in case 
    31  * the request param showLastRequestXML is set and the session 
    32  * is not new. 
     14 * This interceptor cancels the request in case the request param 
     15 * showLastRequestXML is set and the session is not new. 
    3316 * 
    3417 * @package     stubbles 
    3518 * @subpackage  websites_xml 
    3619 */ 
    37 class stubShowLastXMLInterceptor extends stubXMLAbstractPostInterceptor implements stubPreInterceptor 
     20class stubShowLastXMLInterceptor extends stubBaseObject implements stubPreInterceptor 
    3821{ 
    39     /** 
    40      * key with which last xml is stored in session 
    41      */ 
    42     const SESSION_KEY = 'net.stubbles.websites.lastRequestResponseData'; 
    43  
    4422    /** 
    4523     * does the preprocessing stuff 
     
    5331        if ($request->hasValue('showLastRequestXML') === true && $session->isNew() === false) { 
    5432            $response->addHeader('Content-type', 'text/xml'); 
    55             $response->write($session->getValue(self::SESSION_KEY)); 
     33            $response->write($session->getValue('net.stubbles.websites.lastRequestResponseData')); 
    5634            $request->cancel(); 
    5735        } 
    5836    } 
    59  
    60     /** 
    61      * does the postprocessing stuff 
    62      * 
    63      * @param  stubRequest      $request   access to request data 
    64      * @param  stubSession      $session   access to session data 
    65      * @param  stubXMLResponse  $response  access to response data 
    66      */ 
    67     protected function doPostProcess(stubRequest $request, stubSession $session, stubXMLResponse $response) 
    68     { 
    69         $xmlStreamWriter = $response->getXMLStreamWriter(); 
    70         if ($xmlStreamWriter->isFinished() === false) { 
    71             $xmlStreamWriter->writeEndElement(); 
    72         } 
    73          
    74         $session->putValue(self::SESSION_KEY, $xmlStreamWriter->asXML()); 
    75     } 
    7637} 
    7738?>