[FLOW3-general] .xml output
mario chiari
m at mariochiari.net
Mon Oct 1 21:16:10 CEST 2012
Hi Christian, Robert, all
I get the .xml response I wish by the following:
-- in the definition of
TYPO3.FLOW3/Classes/Http/Request::getNegotiatedMediaType(),
I have just 'break;' (instead of 'break 2;')
-- in the definition of
TYPO3.FLOW3/Classes/Mvc/Controller/AbstractController, I add the line
$this->response->headers->set('Content-Type', $mediaType.'
charset=UTF-8');
('Content-Type: 'text/html' seems to be somehow hardcoded within the
class Http/Response, isn't it?)
Clearly, the above is not the way to fix things around, but I got lost
descending deeper and deeper, class by class.
I am not saying there is a bug. I just do not understand whether/how I
have to configure somehow my controllers.
Any comment is welcome
see you
mario
On Fri, 2012-09-28 at 16:46 +0200, mario chiari wrote:
> Hi Christian,
>
> thanks for the reply.
> I had already done as you suggest, but it does not work, in the
> following sense:
>
> I have defined an xmlAction controller, and both xml.xml and xml.html
> fluid templates (and layouts too). Client side I get the .xml code I
> wish, but still Firefox read it as it were a .html source and does not
> show anything.
>
> I checked the response headers:
> ---------------
> Date: Fri, 28 Sep 2012 14:23:41 GMT
> Server: Apache/2.2.17 (Fedora)
> X-Powered-By: PHP/5.3.8
> Expires: Thu, 19 Nov 1981 08:52:00 GMT
> Cache-Control: no-store, no-cache, must-revalidate, post-check=0,
> pre-check=0
> Pragma: no-cache
> Set-Cookie: FLOW3=00cnhrg94sbe709u75c8227b04; path=/; HttpOnly
> X-FLOW3-Powered: FLOW3/1.1
> Content-Length: 474
> Connection: close
> Content-Type: text/html; charset=UTF-8
>
> 200 OK
> ----------------------
>
> Should Content-Type: be text/xml? How do I force to be so?
> I tried to add
> protected $supportedMediaTypes = array('text/xml', 'text/html');
> but it does not seem to fix the output.
>
> I appreciate your help
>
> mario
>
>
>
>
> On Fri, 2012-09-28 at 13:17 +0200, "Christian Müller (FLOW3 Team)"
> wrote:
> > Actually what should work:
> >
> > Lets say you have some listAction that renders the data you need in HTML
> > you also have a ListAction.html Fluid template for that action, now in
> > the same directory you define a ListAction.xml Fluid template (rendering
> > the xml as you want it) and call the same listAction with an .xml
> > ending. Should give you back the xml.
> >
> > Cheers,
> > Christian
>
>
>
> _______________________________________________
> FLOW3-general mailing list
> FLOW3-general at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/flow3-general
More information about the FLOW3-general
mailing list