Reporting in JPlag can be used to create report files from a JPlagResult, which can then be easily saved, transferred or supplied to an application for displaying. Currently JPlag support reporting in JSON format. Further formats can be specified.
Reporting can be done through the Report interface. It provides two functions - getReportStrings and saveReport.
getReportStrings - takes a JPlagResult, converts it to a JPlagReport and returns a list of strings, where
first string is the overview string and the remaining elements are the strings of
the comparison reports. The strings rpresent the JSON serialization of the JPlagReport
saveReport - uses the getReportString to obtain the JSON strings
of the report and saves them to JSON files in the provided folder path.
Example:
Report report = new JsonReport();
// Returns JSON strings in a list
List<String> jsonStrings = report.getReporStrings(jplagResult);
// Saves JSON strings of the report in the specified folder
report.saveReport(jPlagResult, "./path/to/destination/folder");
Running the Report Viewer
The JPlag Report Viewer is a Vue 3 + Typescript standalone application which can be used to display the JSON files generated by the JPlag reporting. The application requires Node.js and npm to be installed on the system.
Before first run execute: npm i.
To start the application, run the npm run serve command in the /report-viewer folder.
After the application has been started the user can select files to display in the following ways:
by providing overview.json and comparisons JSON files in the /report-viewer/files folder
by dragging and dropping a zip file containing the overview.json and comparisons JSON files
by dragging and dropping a single overview.json or a single comparison JSON file
Start by introducing the two ways in one or two sentences: API and Report Viewer
the description of getReportStrings should mention again that these strings represent the JSON serialization
In the example, getReportString should be stored in type variable to show that it actually returns something and has not only / no side effects
The section about the report viewer should include enough information for non node-users how to setup the viewer, e.g., that node has to be installed, calling npm i, and so on
Typo at containing the overveiw.json
You may add a screenshot from the start page where one can see the drag and drop as well as the use local files button
Reporting using the API
Reporting in JPlag can be used to create report files from a JPlagResult, which can then be easily saved, transferred or supplied to an application for displaying. Currently JPlag support reporting in JSON format. Further formats can be specified. Reporting can be done through the Report interface. It provides two functions - getReportStrings and saveReport.
Example:
Running the Report Viewer
The JPlag Report Viewer is a Vue 3 + Typescript standalone application which can be used to display the JSON files generated by the JPlag reporting. The application requires Node.js and npm to be installed on the system.
npm i
.npm run serve
command in the /report-viewer folder.After the application has been started the user can select files to display in the following ways:
Start page of the application