symphonycms / debugdevkit

Debug DevKit for Symphony CMS
http://symphonyextensions.com/extensions/debugdevkit/
Other
8 stars 14 forks source link

Plain XML source #19

Closed nilshoerrmann closed 12 years ago

nilshoerrmann commented 13 years ago

It's my feature request day (sorry!): It would be nice if this devkit would return the plain XML source of the current page when appending ?xml to the URL (no UI and highlighting, just XML).

remie commented 13 years ago

I assume you want to be able to select the view as well? for instance by using ?xml=data and ?xml=result

nilshoerrmann commented 13 years ago

What the XML result? The output after the XSL transformation?

remie commented 13 years ago

yes, indeed. Basically the same as the current available XML and Result views.

remie commented 13 years ago

Is there a way to assign an issue to a non-member of a project / repository?

CC: @brendo, @nickdunn

remie commented 13 years ago

Alright, so here is an initial implementation. Instead of creating the ?xml parameter, I've added a small box in the upper right corner and some javascript to enable switching between views.

Raw XML view: Raw XML

Code Highlighted view: Highlighted

Right now the styling of the raw view is the same as the highlighted, but I guess this should change to white background, black letters, no highlighting.

I've also added support for the XPath and Tag matchers, but perhaps this is not necessary in XML view mode?

remie commented 13 years ago

BTW: while working on this issue I began to wonder what is the use case.. At first I thought it would be to enable easy copy-paste of XML, but this is already possible in the current highlighted view. Why would you want to have a basic non-formated XML view?

nilshoerrmann commented 13 years ago

I think this is a misunderstanding: I was talking about the plain XML source sent with an XML mime type and no surrounding UI. If this source was accessible under a direct link, it would be possible to remotely load the data into a desktop application that offers your syntax highlighting of choice and enables code folding.

remie commented 13 years ago

yeah, after rereading the inital feature request I indeed saw where I went wrong... I will add the ?xml option with correct mime-type.

nilshoerrmann commented 13 years ago

That's very kind. Thanks!

brendo commented 12 years ago

Sorry it's taken so long to review this.

@remie Your implementation slightly breaks the convention. The Debug/Profile Devkits operate under the same $_GET namespace and use parameter values to determine the content (eg. ?debug=params shows the parameters). This commit adds a new one, ?xml, which is not a reserved $_GET variable from Symphony's point of view and may cause some issues in other parts of the system. The convention would be ?debug=xml (but that's taken), so how about ?debug=raw?

I'm also uncertain about the idea of displaying the result, (xml + xslt) as XML as my feeling is that this can be accomplished with the XML page type and shouldn't be part of the Debug Devkit.

remie commented 12 years ago

@brendo: I'm fine with the ?debug=raw, I was just following the feature request made by Nils. Do you want me to adjust this?

brendo commented 12 years ago

Yes please.

brendo commented 12 years ago

Bump @remie :) Would love to have this ready for the 2.3 Beta 3 this weekend.

If you won't be able to get to it that's fine just let me know and I'll jump on it.

remie commented 12 years ago

@brendo: I'll be happy to do this!