root/trunk/src/main/php/net/stubbles/websites/xml/stubShowLastXMLInterceptor.php

Revision 1426, 1.3 kB (checked in by mikey, 4 months ago)

get rid of stubXMLResponse

Line 
1 <?php
2 /**
3  * Preinterceptor that is able to display the last created XML result document.
4  *
5  * @author      Frank Kleine <mikey@stubbles.net>
6  * @author      Stephan Schmidt <schst@stubbles.net>
7  * @package     stubbles
8  * @subpackage  websites_xml
9  */
10 stubClassLoader::load('net::stubbles::ipo::interceptors::stubPreInterceptor');
11 /**
12  * Preinterceptor that is able to display the last created XML result document.
13  *
14  * This interceptor cancels the request in case the request param
15  * showLastRequestXML is set and the session is not new.
16  *
17  * @package     stubbles
18  * @subpackage  websites_xml
19  */
20 class stubShowLastXMLInterceptor extends stubBaseObject implements stubPreInterceptor
21 {
22     /**
23      * does the preprocessing stuff
24      *
25      * @param  stubRequest   $request   access to request data
26      * @param  stubSession   $session   access to session data
27      * @param  stubResponse  $response  access to response data
28      */
29     public function preProcess(stubRequest $request, stubSession $session, stubResponse $response)
30     {
31         if ($request->hasValue('showLastRequestXML') === true && $session->isNew() === false) {
32             $response->addHeader('Content-type', 'text/xml');
33             $response->write($session->getValue('net.stubbles.websites.lastRequestResponseData'));
34             $request->cancel();
35         }
36     }
37 }
38 ?>
Note: See TracBrowser for help on using the browser.