I want to provide a diff report for a non regression test.
My program is Java based but I did not found any API filling my needs.
So I'm using an external tool (CSDiff) that take 2 files as arguments and return an HTML report.
That's nice and easy to setup.
Now the only problem I have is that the HTML report needs some tweaks to be used and I am messing around with the report, trying to transform it into something different (hidding some parts, changing the style, ...)
Does someone know a diff tools that has a powerful command line support, allowing custom report to be generated ?
Nice report options would be 2 panes view, regexp filtering, easy styling options... something like the vim diff view in html would be great.
I've already read stuff about diff tools in stackoverflow but I don't find the stuff I'm looking for.
https://stackoverflow.com/questions/12625/best-diff-tool
Free diff tool that is configurable?
Need a Java and Javascript diff tool written in Java
Many Thanks
I would recommend google-diff-match-patch. This provides HTML or the basic diff components which you could style and transform yourself.
Pretty Diff provides an HTML report either on screen in a web browser or as HTML formatted text that can be saved as an HTML file.
I don't know such library from top of my head but if Google search doesn't bring anything relevant back, I would take a look at Eclipse sources. Eclipse has very good text diff tool which you might be able to reuse, unless it's tied up pretty badly to their UI stuff, which I hope is not the case.
Related
I am looking for a way to create pixel perfect, paginated, styled correspondence in a Java web application.
The requirements for this functionality are
- Ability to define outer/ master template with header/ footer/ logo etc...
- Ability to define inner content template where specific variables/ fields can be substituted with instance values at run time - e.g. employeeName. employeeAddress. The content template would be defined online using rich text editor or something similar
- Supports tables/ list
I believe iText does most/ if not all. Other options that I have considered is BIRT. Are there other/ better choices for this purpose?
Thanks
I have done something like with iText, although our case did not use an online text editor (we had a small number of templates and they were defined as part of the development cycle)
[Note: We did this under an older version of iText when it was still LGPL rather than Affero GPL]
The results were excellent, but in order to get it pixel-perfect we had to do a lot of work ourselves. We did manual layout and pagination - including manual text wrapping, etc. The layout tools that iText provides looked good, but they didn't give us the pixel-perfect control that we needed for the use case we had.
Have a look at iReport.
My target is to assemble a static web site that has a lot of repeating code. Now, I could use JSP includes for that purpose. But the site will be modified infrequently and under very heavy load, also using features like gzip and I don't need the complications.
My idea is to put up a build process with some tool like ant, That build process will concatenate all HTML pieces, preprocess HTML, JS, CSS with minifier and finally apply gzip.
I want an XML configuration that will define the parts that need to go in every html page and their order.
I need advice on ant or any similar tool; how to approach the configuration, any external tools that will help? Any suggestions are much appreciated.
XSLT is perfectly suited to transform XML into another format like HTML.
You can download Apache Xalan to give it a try. Ant has support for XSLT processing.
In the java world, you can take a look at Apache Forrest, which precisely do that kind of things.
In other worlds, there also exist webgen, which is a competent Ruby site builder.
I also vaguey remember there are other alternatives, but i can't find back their name.
I have XMLs(or Objects) that represents data at some point in a business process. I would like to be able to see what has changed between step1 and step5(two versions of the same XML or Object). Id like to implement this like diff function in version control system. how to do it in web app?
P.S. I dont want to just store those files in VCS and than make it do the diff. However if I could somehow emulate VCS without having one that would be cool.
P.S. I know there are some JS frameworks that offer diff functionality, but the XML could have 10MB, so I think it should be dont at server side.
There seem to be quite a few Open Source XML Diff projects written in Java. I'd recommend taking a look at them and see if you can't work them into your project somehow to spit out a preformatted HTML result.
http://www.manageability.org/blog/stuff/open-source-xml-diff-in-java
Web app I'm working on generates HTML using Velocity templates. Problem is that using whitespace in velocity templates and other formatting results in butt-ugly HTML (excessive whitespace, misalignment, etc.)
Looking for a nice (single jar packaging would be nice) Java-based HTML prettifier to run over the generated HTML right before we dump it to the servlet response to make the source nicer to look at.
Third party integrators would like to be able to glance at the HTML and know which templates are causing problems. The first step to this is having the HTML formatted nicely.
Thanks in advance for any guidance you can provide!
JTidy has a JTidyFilter. Just define it in web.xml and the respone HTML will be prettified.
JTidy could be what you're searching for.
I know it's not helping right now, but I think the ideal solution would be for Velocity in first place to support a "better whitespace generation and control" :).
If many users would request and vote such a feature, maybe the Velocity team would include it. Running jTidy or other parsers over the output all the time (e.g. for live requests) consumes quite a few resources, so I'm not sure if it's the best approach especially for dynamic content where caching of that cleaned output doesn't bring much.
There are many HTML parsers here: Open Source HTML Parsers in Java
I'm trying to find a solution to highlight part of a text file in Java.
Basically, what I'm doing is lexing and parsing a text file respecting a certain grammar, storing some information related to the various elements of this file and then logging the information to a database.
I would like to have something more visual like a representation of the text file with some parts highlighted (and an index of the various colors used) - or even better with some context-sensitive information attached to a particular token.
Is there an easy way to do so? Basically what I would like to have, in terms of features, is a really primitive Eclipse plugin for a particular language and stand-alone. Maybe there's a framework to build DSL editors, something like that.
Hope it is clear...
Thanks
I think Xtext is just what you are looking for, it generates an Eclipse editor and more from a grammar.
Although not for Eclipse, there's MPS by JetBrains (the makers of the now open source IntelliJ IDEA) which may be worth taking a look at:
http://www.jetbrains.com/mps/