public static Set<String> gatherReportFileTags(ReportFileModel reportFileModel) { Set<String> allTags = new HashSet<>(); for (ClassificationModel classificationModel : reportFileModel.getClassificationModels()) { for (String tag : classificationModel.getTags()) allTags.add(tag); } for (InlineHintModel inlineHintModel : reportFileModel.getInlineHints()) { for (String tag : inlineHintModel.getTags()) allTags.add(tag); } return allTags; } }
/** * Get all {@link ClassificationModel} instances attached to this {@link ReportFileModel} */ @Adjacency(label = ClassificationModel.FILE_MODEL, direction = Direction.IN) default List<ClassificationModel> getClassificationModels() { List<Vertex> vertices = new GraphTraversalSource(getWrappedGraph().getBaseGraph()).V(getElement()) .in(ClassificationModel.FILE_MODEL) .toList(); return vertices.stream().map(v -> getGraph().frameElement(v, ClassificationModel.class)) .collect(Collectors.toList()); }
/** * Gets the source file contents. */ default String getSourceBody() { try { return IOUtils.toString(getSourceFileModel().asInputStream()); } catch (IOException e) { throw new WindupException("Failed to read source file: \"" + getSourceFileModel().getFilePath() + "\" due to: " + e.getMessage(), e); } }
/** * Get the number of {@link InlineHintModel} instances attached to this {@link ReportFileModel} */ default long getInlineHintCount() { return getInlineHints().size(); }
/** * Get the number of {@link ClassificationModel} instances attached to this {@link ReportFileModel} */ default long getClassificationCount() { return getClassificationModels().size(); } }
private static List<ReportLink> getReportLinks(GraphContext graphContext) { final List<ReportLink> reportLinks = new ArrayList<>(); SourceReportService sourceReportService = new SourceReportService(graphContext); ReportService reportService = new ReportService(graphContext); for (SourceReportModel sourceReportModel : sourceReportService.findAll()) { ReportLinkImpl reportLink = new ReportLinkImpl(); reportLink.setInputFile(sourceReportModel.getSourceFileModel().asFile()); Path reportPath = reportService.getReportDirectory().resolve(sourceReportModel.getReportFilename()); reportLink.setReportFile(reportPath.toFile()); reportLinks.add(reportLink); } return reportLinks; }
/** * Get all {@link ClassificationModel} instances attached to this {@link ReportFileModel} */ @Adjacency(label = ClassificationModel.FILE_MODEL, direction = Direction.IN) default List<ClassificationModel> getClassificationModels() { List<Vertex> vertices = new GraphTraversalSource(getWrappedGraph().getBaseGraph()).V(getElement()) .in(ClassificationModel.FILE_MODEL) .toList(); return vertices.stream().map(v -> getGraph().frameElement(v, ClassificationModel.class)) .collect(Collectors.toList()); }
/** * Gets the source file contents. */ default String getSourceBody() { try { return IOUtils.toString(getSourceFileModel().asInputStream()); } catch (IOException e) { throw new WindupException("Failed to read source file: \"" + getSourceFileModel().getFilePath() + "\" due to: " + e.getMessage(), e); } }
/** * Get the number of {@link InlineHintModel} instances attached to this {@link ReportFileModel} */ default long getInlineHintCount() { return getInlineHints().size(); }
/** * Get the number of {@link ClassificationModel} instances attached to this {@link ReportFileModel} */ default long getClassificationCount() { return getClassificationModels().size(); } }
private static List<ReportLink> getReportLinks(GraphContext graphContext) { final List<ReportLink> reportLinks = new ArrayList<>(); SourceReportService sourceReportService = new SourceReportService(graphContext); ReportService reportService = new ReportService(graphContext); for (SourceReportModel sourceReportModel : sourceReportService.findAll()) { ReportLinkImpl reportLink = new ReportLinkImpl(); reportLink.setInputFile(sourceReportModel.getSourceFileModel().asFile()); Path reportPath = reportService.getReportDirectory().resolve(sourceReportModel.getReportFilename()); reportLink.setReportFile(reportPath.toFile()); reportLinks.add(reportLink); } return reportLinks; }
/** * Get all {@link InlineHintModel} instances attached to this {@link ReportFileModel} */ default List<InlineHintModel> getInlineHints() { List<Vertex> vertices = new GraphTraversalSource(getWrappedGraph().getBaseGraph()).V(getElement()) .in(FileReferenceModel.FILE_MODEL) .has(WindupVertexFrame.TYPE_PROP, InlineHintModel.TYPE) .toList(); return vertices.stream().map(v -> getGraph().frameElement(v, InlineHintModel.class)) .collect(Collectors.toList()); }
public static Set<String> gatherReportFileTags(ReportFileModel reportFileModel) { Set<String> allTags = new HashSet<>(); for (ClassificationModel classificationModel : reportFileModel.getClassificationModels()) { for (String tag : classificationModel.getTags()) allTags.add(tag); } for (InlineHintModel inlineHintModel : reportFileModel.getInlineHints()) { for (String tag : inlineHintModel.getTags()) allTags.add(tag); } return allTags; } }
/** * This is used by the Javascript in the source rendering template to provide code assist blocks in the rendered * output. */ default String getSourceBlock() { StringBuilder builder = new StringBuilder(); boolean first = true; for (InlineHintModel line : getSourceFileModel().getInlineHints()) { if (!first) { builder.append(","); } builder.append(line.getLineNumber()); if (first) { first = false; } } return builder.toString(); } }
/** * Get all {@link InlineHintModel} instances attached to this {@link ReportFileModel} */ default List<InlineHintModel> getInlineHints() { List<Vertex> vertices = new GraphTraversalSource(getWrappedGraph().getBaseGraph()).V(getElement()) .in(FileReferenceModel.FILE_MODEL) .has(WindupVertexFrame.TYPE_PROP, InlineHintModel.TYPE) .toList(); return vertices.stream().map(v -> getGraph().frameElement(v, InlineHintModel.class)) .collect(Collectors.toList()); }
/** * This is used by the Javascript in the source rendering template to provide code assist blocks in the rendered * output. */ default String getSourceBlock() { StringBuilder builder = new StringBuilder(); boolean first = true; for (InlineHintModel line : getSourceFileModel().getInlineHints()) { if (!first) { builder.append(","); } builder.append(line.getLineNumber()); if (first) { first = false; } } return builder.toString(); } }