-
Notifications
You must be signed in to change notification settings - Fork 328
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
Replace the outdated HTML report generation #192 #287
Merged
Merged
Changes from all commits
Commits
Show all changes
80 commits
Select commit
Hold shift + click to select a range
21b9bd3
Add vue 3 boilerplate as preparation for #192
sebinside 5fd0f71
Move report-viewer from jplag resources to own folder. Only the dist …
sebinside e63d7a6
Merge branch 'master' into 192-webreport
sebinside b20065b
Merge branch 'master' into 192-webreport
cholakov11 a6c3576
[192-webreport] Created class files for the new reporting
cholakov11 78e208c
[192-webreport] Moved reportV2 package to jplag package
cholakov11 c4cdec3
[192-webreport] Implemented the model classes
cholakov11 439dd47
[192-webreport] Implementing ReportObjectFactory - implemented the cr…
cholakov11 b117e6a
[192-webreport] Created Metric mode, changed OverviewReport to have a…
cholakov11 1af442e
[192-webreport] Changed String file_code in Files of Submission to Li…
cholakov11 39d1770
[192-webreport] Implementing ReportObjectFactory - implemented compar…
cholakov11 1906d38
[192-webreport] Finished ReportObjectFactory
cholakov11 53ed8b0
[192-webreport] Implemented JsonFactory to generate List of json strings
cholakov11 94c8342
[192-webreport] Declared function in ReportingStrtegy to generate rep…
cholakov11 5ba6733
[192-webreport] Fixed start and end lines of match - added usesIndex …
cholakov11 6256e70
[192-webreport] Deleted auto generated from vue project creator code …
cholakov11 f46c7f6
[192-webreport] Disabled prettier/prettier linting in eslint.js
cholakov11 c7a4c2d
[192-webreport] Implemented file upload, file upload page and started…
cholakov11 3504010
[192-webreport] Edited top_comparisons structure in overview json, dy…
cholakov11 5265152
[192-webreport] Created comparison view, implemented left panel of co…
cholakov11 f157f0a
[192-webreport] Implemented side by side code display
cholakov11 985e8e4
Make report-viewer path relative
dfuchss 3675107
Create report-viewer.yml
dfuchss a4d1bd0
Update report-viewer.yml
dfuchss 3f38aea
[192-webreport] Implemented blurring of not matched code and quicklin…
cholakov11 2a5db58
[192-webreport] Added coloring to matches
cholakov11 60eee93
[192-webreport] Added links to matches in code panel, added colors to…
cholakov11 ca32e7e
[192-webreport] Reordered Overview view, app is working with local fi…
cholakov11 2ad92c2
[192-webreport] Saving json report strings to json files
cholakov11 ef20a6c
[192-webreport] Displaying additional info in basic info panel
cholakov11 84e3026
[192-webreport] Major rework of ComparisonView, changed color palette…
cholakov11 074e5b6
[192-webreport] Fixed colors of matches, added navigation to MatchTable
cholakov11 f347c06
[192-webreport] Code and project cleanup
cholakov11 db93c15
[192-webreport] Removed FileUpload
cholakov11 18edb7d
[192-webreport] Added models of Overview and Comparison, with factori…
cholakov11 a046de2
[192-webreport] Added number of tokens per match information to the r…
cholakov11 96ff1cb
Merge branch '192-webreport' of https://github.com/cholakov11/JPlag i…
dfuchss 8d410aa
Update to Node 16 LTS
dfuchss 7f71dbd
[192-webreport] Syntax highlight, changed color scheme
cholakov11 d32fb7c
[192-webreport] Added javadoc
cholakov11 615a77d
[192-webreport] Created new component FilesContainer
cholakov11 cf847c8
[192-webreport] Added blurring in Overview with query params, removed…
cholakov11 1595280
[192-webreport] Added highlighting on demand, changed blur of anonymo…
cholakov11 67fe875
[192-webreport] Vuex store
cholakov11 b8949aa
[192-webreport] Reintroduced file upload window (not finished)
cholakov11 083a6ae
[192-webreport] Reintroduced file upload window, accepting zip, singl…
cholakov11 a90ddb4
Merge pull request #1 from dfuchss/192-webreport
cholakov11 b16ee1e
[192-webreport] Added dialogs to display clusters and clusterdiagram,…
cholakov11 687fc0d
[192-webreport] Finished doc, code and project clean up
cholakov11 32b3f69
[192-webreport] Fixed missing clusters in report error
cholakov11 6c02b78
Merge branch 'master' into 192-webreport
cholakov11 dc14741
[192-webreport] Updated project to the latest state, maven spotless a…
cholakov11 97c0085
[192-webreport] spotless apply
cholakov11 546b9fb
[192-webreport] added Clusters to Report model, factory in generator …
cholakov11 5b26b0a
[192-webreport] git renormalize
cholakov11 f0a99d0
[192-webreport] Static object mapper, switched hardcoded report folde…
cholakov11 2d3b676
[192-webreport] Improved readability in ReportObjectFactory, made fie…
cholakov11 7154433
[192-webreport] Using getExcludedFiles
cholakov11 09bea54
[192-webreport] added JsonProperty annotations, removed underscore na…
cholakov11 df37fd6
[192-webreport] renamed package reportingV2 to reporting2
cholakov11 0977729
[192-webreport] Updated versions in package.json, added npm to depend…
cholakov11 dcc603d
[192-webreport] Removed abbreviated varaibles, removed getExcludedFil…
cholakov11 319bd23
[192-webreport] Switched from single submission folder to multiple su…
cholakov11 55a06fc
[192-webreport] Added check for presence of files folder
cholakov11 0cdd34a
[192-webreport] Checking for two possible file names in ComparisonView
cholakov11 cd4d6b0
[192-webreport] Switched to reporting2 usage in CLI
cholakov11 185b3ea
[192-webreport] Fixed file extensions retrieval
cholakov11 21db19c
[192-webreport] Fixed file extensions retrieval
cholakov11 95f709b
[192-webreport] Switched to nth-child selector
cholakov11 9d667dc
[192-webreport] Switched to nth-child selector
cholakov11 d28c23c
[192-webreport] Set fileString in store.ts to optional
cholakov11 ca4f55f
[192-webreport] Renamed id1,id2, renamed FileUpload, removing logs
cholakov11 676204e
[192-webreport] eslint
cholakov11 8f0b41d
[192-webreport] Fixed redundant chart data, fixed error in clusters l…
cholakov11 61cfff2
[192-webreport] Added missing documentation.
cholakov11 e840754
[192-webreport] Added indication to selected ids in IDsList
cholakov11 76df598
[192-webreport] Removed highlight.js style files, using css important…
cholakov11 1a20445
Merge branch 'master' into 192-webreport
cholakov11 fbeedc1
[192-webreport] mvn spotless
cholakov11 3c3bdaa
[192-webreport] fixed merge error
cholakov11 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Report Viewer Deployment Workflow | ||
|
||
on: | ||
workflow_dispatch: # Use this to dispatch from the Actions Tab | ||
push: | ||
branches: | ||
- 192-webreport # you might change that to main/master later on | ||
|
||
jobs: | ||
build-and-deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout 🛎️ | ||
uses: actions/[email protected] | ||
|
||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: "16" | ||
|
||
- name: Install and Build 🔧 | ||
working-directory: report-viewer | ||
run: | | ||
npm install | ||
npm run build | ||
|
||
- name: Deploy 🚀 | ||
uses: JamesIves/[email protected] | ||
with: | ||
branch: gh-pages | ||
folder: report-viewer/dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package de.jplag.reporting2; | ||
|
||
import java.io.File; | ||
import java.util.List; | ||
|
||
import de.jplag.JPlagResult; | ||
import de.jplag.reporting2.jsonfactory.JsonFactory; | ||
import de.jplag.reporting2.reportobject.ReportObjectFactory; | ||
import de.jplag.reporting2.reportobject.model.JPlagReport; | ||
|
||
// ReportImplementation -> JsonReport | ||
|
||
/** | ||
* A report generator which reports the JPlagResult in Json format. | ||
*/ | ||
public class JsonReport implements Report { | ||
|
||
@Override | ||
public List<String> getReportStrings(JPlagResult result) { | ||
JPlagReport report = ReportObjectFactory.getReportObject(result); | ||
return JsonFactory.getJsonStrings(report); | ||
} | ||
|
||
@Override | ||
public boolean saveReport(JPlagResult result, String path) { | ||
JPlagReport report = ReportObjectFactory.getReportObject(result); | ||
File dir = new File(path); | ||
if (!dir.exists()) { | ||
if (!dir.mkdir()) { | ||
System.out.println("Failed to create dir."); | ||
} | ||
} | ||
return JsonFactory.saveJsonFiles(report, path); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package de.jplag.reporting2; | ||
|
||
import java.util.List; | ||
|
||
import de.jplag.JPlagResult; | ||
|
||
// ReportStrategy -> Report | ||
|
||
/** | ||
* Strategy interface for reporting. A report generator should implement this interface. | ||
*/ | ||
public interface Report { | ||
|
||
/** | ||
* This function returns a list containing the report objects as simple strings. The first element is the string of the | ||
* overview object. Each following element is a string of a comparison report object. | ||
* @param result The result of a JPlag comparison | ||
* @return A list containing report objects to string. First element is Overview. Other elements are comparisons. | ||
*/ | ||
List<String> getReportStrings(JPlagResult result); | ||
|
||
/** | ||
* Creates and saves JPlag report files to the disk. | ||
* @param result The result of a JPlag comparison. | ||
* @param path Path to the directory where the report should be saved. | ||
* @return True if the process is successful, otherwise false. | ||
*/ | ||
boolean saveReport(JPlagResult result, String path); | ||
} |
57 changes: 57 additions & 0 deletions
57
jplag/src/main/java/de/jplag/reporting2/jsonfactory/JsonFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package de.jplag.reporting2.jsonfactory; | ||
|
||
import java.io.IOException; | ||
import java.nio.file.Path; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import com.fasterxml.jackson.core.JsonProcessingException; | ||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
|
||
import de.jplag.reporting2.reportobject.model.ComparisonReport; | ||
import de.jplag.reporting2.reportobject.model.JPlagReport; | ||
|
||
/** | ||
* Factory class, responsible for creating Json strings and writing them to files. | ||
*/ | ||
public class JsonFactory { | ||
|
||
private static final ObjectMapper mapper = new ObjectMapper(); | ||
|
||
/** | ||
* Uses Jackson to create Json Strings from JPlagReport object. | ||
* @return A list, first element is Json String of Overview object. The rest elements are Json Strings of Comparison | ||
* objects. | ||
*/ | ||
public static List<String> getJsonStrings(JPlagReport jPlagReport) { | ||
List<String> jsonReports = new ArrayList<>(); | ||
try { | ||
jsonReports.add(mapper.writeValueAsString(jPlagReport.getOverviewReport())); | ||
for (ComparisonReport comparisonReport : jPlagReport.getComparisons()) { | ||
jsonReports.add(mapper.writeValueAsString(comparisonReport)); | ||
} | ||
} catch (JsonProcessingException e) { | ||
System.out.println("Error converting object to json " + e.getMessage()); | ||
} | ||
return jsonReports; | ||
} | ||
|
||
/** | ||
* Creates Json Files for the given JPlagReport and saves them in the given folder. | ||
* @return A boolean, representing whether the process was successful. | ||
*/ | ||
public static boolean saveJsonFiles(JPlagReport jPlagReport, String folderPath) { | ||
try { | ||
ObjectMapper mapper = new ObjectMapper(); | ||
mapper.writeValue(Path.of(folderPath, "overview.json").toFile(), jPlagReport.getOverviewReport()); | ||
for (ComparisonReport report : jPlagReport.getComparisons()) { | ||
String name = report.getFirstSubmissionId().concat("-").concat(report.getSecondSubmissionId()).concat(".json"); | ||
mapper.writeValue(Path.of(folderPath, name).toFile(), report); | ||
} | ||
} catch (IOException e) { | ||
System.out.println("Failed to save json files: " + e.getMessage()); | ||
return false; | ||
} | ||
return true; | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
See my original comment here :) Now it should be changed to
master