-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ARQ-1878 Introduce TableEntry #11
Conversation
Awesome.. Will do :) |
Few things..
|
Do you want to have colspan and rowspan attributes on td's as well? That would make generation of these tables pretty much flexible. However when you want to style it, you are on your own. The best option here is to make your own xsl template and set it in config (it is already done), I just can not think for all possible use cases in advance ...
|
The 'one header per table' feature is nice, but to me that belongs more in a 'GroupEntry' or something. group = new GroupEntry('My Tabled Data')
table = new TableEntry('header 1', 'header 2');
table.getRows().add('data 1', 'data2')
grou.add(table) |
Aha ... well, I have to make my mind about that. GroupEntry is not needed, multiple tables are done in such way you just add multiple TableEntries to properties and in xslt there is iteration over all tables and they get rendered one by one. TableEntry has rows which have cells. Every cell can have colspan and rowspan, by default set to 1 for both. I see what you want ... wait a moment |
You basically want to have this, right? http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_tbody meaning this heading for every column
|
Right, but that would require me to add a TableEntry to a KeyValue property? I only have a 'key'.. |
Lets have TestMethodReport, it has property field like this:
It means that you do
and then it will be added like (via firing these objects in property event)
So in that method report in xslt template, firstly you iterate over key value entries and render them, then over tables and they are rendered as well. You can add whatever you want in that propertyEntries list as long it extends PropertyEntry and it is up to xslt to render it - it looks what that entry really is (if key-value, table or screenshot) and renders it appropriately. You just fire table in that report event the same way you fire key-value. The thing is when you want to add some new entry like we are adding table right now, you have to add it on that propertyEntries among XmlElements for JAXB to be able to marshall it and you have to customize your xslt template to be able to render that new one. It can not be done totally generic because you need to say xslt how some particular entry has to be rendered into html. |
Correct, that's what I'm looking for when I say Table Header. |
I understand how to add it to a PropertyEntry per say. And that is fine. What I'm wondering about is a generic way to say that this data belongs to gather / comes from the same extension. Let's say my extension provide the report with 'n' number of KeyValueEntry elements. I can add a bunch of 'single' KeyValueEntries like "XRebel Request=X", "XRebel SQL=X". With this a part of the key says something about where the data comes from. If we go a bit deeper I might need to say "XRebel Request Stacktrace 1=x", "XRebel Request Stacktrace 2=x". What I was wondering instead, could we have a GroupEntry that defines these as 'one' thing. xrebel = new GroupEntry("XRebel")
xrebel.add(new KeyValueEntry("averageTime", 10))
xrebel.add(new KeyValueEntry("numberOfRequests", 10))
sql = new GroupEntry("SQL");
sql.add(new TableEntry("time", "query").addRows(new TableRowEntry(20, "select * from x")))
xrebel.add(sql); That could render 'roughly' as: <div>
<h3>XRebel</h3>
<dl>
<dt>averageTime</dt>
<dd>10</dd>
<dt>numberOfRequests</dt>
<dd>10</dd>
</dl>
<div>
<h4>SQL</h4>
<table>
<theader>
<tr><th>time</th></tr>
<tr><th>query</th></tr>
</theader>
<tbody>
<tr><td>20</td></tr>
<tr><td>select * from x</td></tr>
</tbody>
</table>
</div>
</div> |
I see, but I do not know how to render it in xslt since this may be recursive as you are adding GroupEntry into GroupEntry. Maybe it could be possible by writing some custom xslt function which calls itself recrusivly but I have to look into it more deeper. |
Maybe xslt is not the best rendering engine for the usecase.. ;) |
oh man, I am getting the same feeling as I want to add something to it, it is not too flexible. There is also asciidoc exporter, maybe that one comes more handy. However I like how that HTML output looks like. I was playing with jquery yesterday and I done that collapsable thing partially. Like when you click on a test method, it gets expanded, when you click on it again, it gets collapsed. When you click on a test class, all test methods are collapsed, when you click on test suite, all test clases are collapsed ... That is the idea. |
* | ||
*/ | ||
@XmlRootElement(name = "groupEntry") | ||
public class GroupEntry extends PropertyEntry { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should give you GroupEntry which can hold other GroupEntries in properties hence you can nested it recursively.
It holds only tables and key-values. Doing it in general is PITA and I think you basically need these two property elements with that xrebel.
XSLT transformation is not yet done, I am curious with that recursive thing.
@aslakknutsen could you give me ack here so I can get rid of this from my todo list, please? |
merged and closing |
@aslakknutsen could you try if it is ok for you, please?