private static Set<String> getSubTagNamesGraph(GraphContext graphContext, String subSectorTagName) { TagGraphService tagService = new TagGraphService(graphContext); Set<TagModel> subTags = tagService.getDescendantTags(tagService.getTagByName(subSectorTagName)); return subTags.stream().map(TagModel::getName).collect(Collectors.toSet()); }
private static Set<String> getSubTagNamesGraph(GraphContext graphContext, String subSectorTagName) { TagGraphService tagService = new TagGraphService(graphContext); Set<TagModel> subTags = tagService.getDescendantTags(tagService.getTagByName(subSectorTagName)); return subTags.stream().map(TagModel::getName).collect(Collectors.toSet()); }
@Override public Object exec(@SuppressWarnings("rawtypes") List arguments) throws TemplateModelException { if (arguments.size() != 1) throw new TemplateModelException("Expected one String argument - the name of the tag."); SimpleScalar stringModel = (SimpleScalar) arguments.get(0); String tagName = stringModel.getAsString(); return new TagGraphService(graphContext).getTagByName(tagName); }
@Override public Object exec(@SuppressWarnings("rawtypes") List arguments) throws TemplateModelException { if (arguments.size() != 1) throw new TemplateModelException("Expected one String argument - the name of the tag."); SimpleScalar stringModel = (SimpleScalar) arguments.get(0); String tagName = stringModel.getAsString(); return new TagGraphService(graphContext).getTagByName(tagName); }
/** * Translates the placement tags (labels) to their normalized real tag counterparts. Returns a 2-item array; index 0 has the normal names, index 1 * the placement names. * * Due to bad design, the rules contain column and row titles for the graph, rather than technology tags. To make them fit into the tag system, * this translation is needed. See also the "place:..." tags in the report hierarchy definition. */ private static Set<String> getPlacementTags(GraphContext graphContext, Set<String> potentialPlaceTags) { final TagGraphService tagService = new TagGraphService(graphContext); Set<String> placeNames = new HashSet<>(); potentialPlaceTags.forEach(name -> { final TagModel placeTag = tagService.getTagByName("place:" + Tag.normalizeName(name)); if (null != placeTag) placeNames.add(placeTag.getName()); }); return placeNames; }
/** * Translates the placement tags (labels) to their normalized real tag counterparts. Returns a 2-item array; index 0 has the normal names, index 1 * the placement names. * * Due to bad design, the rules contain column and row titles for the graph, rather than technology tags. To make them fit into the tag system, * this translation is needed. See also the "place:..." tags in the report hierarchy definition. */ private static Set<String> getPlacementTags(GraphContext graphContext, Set<String> potentialPlaceTags) { final TagGraphService tagService = new TagGraphService(graphContext); Set<String> placeNames = new HashSet<>(); potentialPlaceTags.forEach(name -> { final TagModel placeTag = tagService.getTagByName("place:" + Tag.normalizeName(name)); if (null != placeTag) placeNames.add(placeTag.getName()); }); return placeNames; }
@Override public void perform(GraphRewrite event, EvaluationContext context) { new TagGraphService(event.getGraphContext()).feedTheWholeTagStructureToGraph(tagServiceHolder.getTagService()); } }).withId("feedTagsToGraph")
@Override public void perform(GraphRewrite event, EvaluationContext context) { new TagGraphService(event.getGraphContext()).feedTheWholeTagStructureToGraph(tagServiceHolder.getTagService()); } }).withId("feedTagsToGraph")
/** * This relies on the tag structure in the XML when the place:* mapping tags have exactly one parent outside the place: group, which is the tag * they are mapped to. */ private static TechReportPlacement normalizePlacement(GraphContext graphContext, TechReportPlacement placement) { TagGraphService tagService = new TagGraphService(graphContext); final TechReportPlacement normalPlacement = new TechReportPlacement(); normalPlacement.sector = getNonPlaceParent(tagService, placement.sector); normalPlacement.box = getNonPlaceParent(tagService, placement.box); normalPlacement.row = getNonPlaceParent(tagService, placement.row); return normalPlacement; }
/** * This relies on the tag structure in the XML when the place:* mapping tags have exactly one parent outside the place: group, which is the tag * they are mapped to. */ private static TechReportPlacement normalizePlacement(GraphContext graphContext, TechReportPlacement placement) { TagGraphService tagService = new TagGraphService(graphContext); final TechReportPlacement normalPlacement = new TechReportPlacement(); normalPlacement.sector = getNonPlaceParent(tagService, placement.sector); normalPlacement.box = getNonPlaceParent(tagService, placement.box); normalPlacement.row = getNonPlaceParent(tagService, placement.row); return normalPlacement; }
TagGraphService tagService = new TagGraphService(graphContext);
TagGraphService tagService = new TagGraphService(graphContext);
boolean isUnder = new TagGraphService(this.graphContext).isTagUnderTag(subTag, maybeSuperTag, countIfSame);
boolean isUnder = new TagGraphService(this.graphContext).isTagUnderTag(subTag, maybeSuperTag, countIfSame);
TagGraphService tagGraphService = new TagGraphService(event.getGraphContext()); TagModel sectorsTag = tagGraphService.getTagByName(TechReportModel.EDGE_TAG_SECTORS); TagModel rowsTag = tagGraphService.getTagByName(TechReportModel.EDGE_TAG_ROWS);
TagGraphService tagGraphService = new TagGraphService(event.getGraphContext()); TagModel sectorsTag = tagGraphService.getTagByName(TechReportModel.EDGE_TAG_SECTORS); TagModel rowsTag = tagGraphService.getTagByName(TechReportModel.EDGE_TAG_ROWS);