@Override public void setContext(GraphRewrite event) { this.classificationService = new ClassificationService(event.getGraphContext()); this.inlineHintService = new InlineHintService(event.getGraphContext()); }
@Override public void setContext(GraphRewrite event) { this.classificationService = new ClassificationService(event.getGraphContext()); this.inlineHintService = new InlineHintService(event.getGraphContext()); }
@Override public void setContext(GraphRewrite event) { this.classificationService = new ClassificationService(event.getGraphContext()); this.inlineHintService = new InlineHintService(event.getGraphContext()); }
@Override public void setContext(GraphRewrite event) { this.classificationService = new ClassificationService(event.getGraphContext()); this.inlineHintService = new InlineHintService(event.getGraphContext()); }
@Override public void setContext(GraphRewrite event) { this.classificationService = new ClassificationService(event.getGraphContext()); this.inlineHintService = new InlineHintService(event.getGraphContext()); }
@Override public void setContext(GraphRewrite event) { this.classificationService = new ClassificationService(event.getGraphContext()); this.inlineHintService = new InlineHintService(event.getGraphContext()); }
private boolean isMavenFile(GraphContext context, FileLocationModel model) { if (!(model.getFile() instanceof XmlFileModel)) { return false; } ClassificationService cs = new ClassificationService(context); for (ClassificationModel cm : cs.getClassificationByName(model.getFile(), "Maven POM (pom.xml)")) { return true; } return false; }
private boolean isMavenFile(GraphContext context, FileLocationModel model) { if (!(model.getFile() instanceof XmlFileModel)) { return false; } ClassificationService cs = new ClassificationService(context); for (ClassificationModel cm : cs.getClassificationByName(model.getFile(), "Maven POM (pom.xml)")) { return true; } return false; }
@Override public Object exec(@SuppressWarnings("rawtypes") List arguments) throws TemplateModelException { ExecutionStatistics.get().begin(NAME); if (arguments.size() != 1) { throw new TemplateModelException("Error, method expects one argument (" + FileModel.class.getSimpleName() + ")"); } StringModel stringModelArg = (StringModel) arguments.get(0); FileModel fileModel = (FileModel) stringModelArg.getWrappedObject(); ClassificationService classificationService = new ClassificationService(context); Iterable<ClassificationModel> result = classificationService.getClassifications(fileModel); ExecutionStatistics.get().end(NAME); return result; }
@Override public Object exec(@SuppressWarnings("rawtypes") List arguments) throws TemplateModelException { ExecutionStatistics.get().begin(NAME); if (arguments.size() != 1) { throw new TemplateModelException("Error, method expects one argument (" + FileModel.class.getSimpleName() + ")"); } StringModel stringModelArg = (StringModel) arguments.get(0); FileModel fileModel = (FileModel) stringModelArg.getWrappedObject(); ClassificationService classificationService = new ClassificationService(context); Iterable<ClassificationModel> result = classificationService.getClassifications(fileModel); ExecutionStatistics.get().end(NAME); return result; }
@Override public List<Map<String, Object>> getClassifications(Long executionID, Integer fileModelID) { GraphContext context = getGraph(executionID); FileService fileService = new FileService(context); FileModel fileModel = fileService.getById(fileModelID); ClassificationService classificationService = new ClassificationService(context); Iterable<ClassificationModel> classificationModels = classificationService.getClassifications(fileModel); return super.frameIterableToResult(executionID, classificationModels, 1); } }
private void addWebXmlMetadata(GraphRewrite event, EvaluationContext evaluationContext, GraphContext context, XmlFileModel xml, Document doc) ClassificationService classificationService = new ClassificationService(context); TechnologyTagService technologyTagService = new TechnologyTagService(context);
private void createParseFailureClassification(GraphRewrite event, EvaluationContext context, XmlFileModel sourceFile) { sourceFile.setGenerateSourceReport(true); ClassificationService classificationService = new ClassificationService(event.getGraphContext()); ClassificationModel model = classificationService.attachClassification(event, context, sourceFile, XmlFileModel.NOT_VALID_XML, null); model.setEffort(0); // do not rely on default 0 value and set it that transparently IssueCategoryRegistry issueCategoryRegistry = IssueCategoryRegistry.instance(event.getRewriteContext()); model.setIssueCategory(issueCategoryRegistry.loadFromGraph(event.getGraphContext(), IssueCategoryRegistry.POTENTIAL)); TagSetService tagSetService = new TagSetService(event.getGraphContext()); model.setTagModel(tagSetService.getOrCreate(event, Collections.singleton(NOT_VALID_XML_TAG))); } }
private void createParseFailureClassification(GraphRewrite event, EvaluationContext context, XmlFileModel sourceFile) { sourceFile.setGenerateSourceReport(true); ClassificationService classificationService = new ClassificationService(event.getGraphContext()); ClassificationModel model = classificationService.attachClassification(event, context, sourceFile, XmlFileModel.NOT_VALID_XML, null); model.setEffort(0); // do not rely on default 0 value and set it that transparently IssueCategoryRegistry issueCategoryRegistry = IssueCategoryRegistry.instance(event.getRewriteContext()); model.setIssueCategory(issueCategoryRegistry.loadFromGraph(event.getGraphContext(), IssueCategoryRegistry.POTENTIAL)); TagSetService tagSetService = new TagSetService(event.getGraphContext()); model.setTagModel(tagSetService.getOrCreate(event, Collections.singleton(NOT_VALID_XML_TAG))); } }
private static List<Classification> getClassifications(GraphContext graphContext) { final List<Classification> classifications = new ArrayList<>(); ClassificationService classificationService = new ClassificationService(graphContext); for (ClassificationModel classificationModel : classificationService.findAll()) { for (FileModel fileModel : classificationModel.getFileModels()) { ClassificationImpl classification = new ClassificationImpl(classificationModel.getElement().id()); classification.setClassification(classificationModel.getClassification()); classification.setDescription(classificationModel.getDescription()); classification.setEffort(classificationModel.getEffort()); classification.setRuleID(classificationModel.getRuleID()); classification.setIssueCategory(new IssueCategoryImpl(classificationModel.getIssueCategory())); classification.setFile(fileModel.asFile()); classification.setLinks(asLinks(classificationModel.getLinks())); classifications.add(classification); classification.setQuickfixes(asQuickfixes(classificationModel.getQuickfixes())); } } return classifications; }
private static List<Classification> getClassifications(GraphContext graphContext) { final List<Classification> classifications = new ArrayList<>(); ClassificationService classificationService = new ClassificationService(graphContext); for (ClassificationModel classificationModel : classificationService.findAll()) { for (FileModel fileModel : classificationModel.getFileModels()) { ClassificationImpl classification = new ClassificationImpl(classificationModel.getElement().id()); classification.setClassification(classificationModel.getClassification()); classification.setDescription(classificationModel.getDescription()); classification.setEffort(classificationModel.getEffort()); classification.setRuleID(classificationModel.getRuleID()); classification.setIssueCategory(new IssueCategoryImpl(classificationModel.getIssueCategory())); classification.setFile(fileModel.asFile()); classification.setLinks(asLinks(classificationModel.getLinks())); classifications.add(classification); classification.setQuickfixes(asQuickfixes(classificationModel.getQuickfixes())); } } return classifications; }
@Override public void perform(GraphRewrite event, EvaluationContext context, XmlFileModel payload) { ClassificationService classificationService = new ClassificationService(event.getGraphContext()); ClassificationModel classificationModel = classificationService.attachClassification(event, context, payload, IssueCategoryRegistry.MANDATORY, "WebSphere web service extension descriptor (ibm-webservices-ext)", "WebSphere Webservice Extension XML Deployment Descriptor. \n" + "This deployment descriptor extension is IBM specific and it needs to be migrated to JBossWS. \n" + "JBossWS implements the latest JAX-WS specification, which users can reference for any vendor-agnostic web service usage need. \n" + "You can migrate deployment descriptors following the links below. \n"); classificationModel.setEffort(3); GraphContext graphContext = event.getGraphContext(); LinkService linkService = new LinkService(graphContext); LinkModel documentationEAP6Link = linkService.create(); documentationEAP6Link.setDescription("JAX-WS Web Services (JBoss EAP 6)"); documentationEAP6Link.setLink( "https://access.redhat.com/documentation/en-US/JBoss_Enterprise_Application_Platform/6.4/html/Development_Guide/chap-JAX-WS_Web_Services.html"); classificationService.attachLink(classificationModel, documentationEAP6Link); LinkModel documentationEAP7Link = linkService.create(); documentationEAP7Link.setDescription("Developing JAX-WS Web Services (JBoss EAP 7)"); documentationEAP7Link.setLink( "https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.0/html/developing_web_services_applications/developing_jax_ws_web_services"); classificationService.attachLink(classificationModel, documentationEAP7Link); LinkModel documentationCommunityLink = linkService.create(); documentationCommunityLink.setDescription("Assigning Client and Endpoint Configurations (JBoss EAP 7)"); documentationCommunityLink.setLink("https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.0/html-single/developing_web_services_applications/#ws_endpoint_assign_config"); classificationService.attachLink(classificationModel, documentationCommunityLink); TechnologyTagService technologyTagService = new TechnologyTagService(event.getGraphContext()); technologyTagService.addTagToFileModel(payload, "WebSphere WS Extension", TechnologyTagLevel.IMPORTANT); }
@Override public void perform(GraphRewrite event, EvaluationContext context, XmlFileModel payload) { ClassificationService classificationService = new ClassificationService(event.getGraphContext()); ClassificationModel classificationModel = classificationService.attachClassification(event, context, payload, IssueCategoryRegistry.MANDATORY, "WebSphere web service extension descriptor (ibm-webservices-ext)", "WebSphere Webservice Extension XML Deployment Descriptor. \n" + "This deployment descriptor extension is IBM specific and it needs to be migrated to JBossWS. \n" + "JBossWS implements the latest JAX-WS specification, which users can reference for any vendor-agnostic web service usage need. \n" + "You can migrate deployment descriptors following the links below. \n"); classificationModel.setEffort(3); GraphContext graphContext = event.getGraphContext(); LinkService linkService = new LinkService(graphContext); LinkModel documentationEAP6Link = linkService.create(); documentationEAP6Link.setDescription("JAX-WS Web Services (JBoss EAP 6)"); documentationEAP6Link.setLink( "https://access.redhat.com/documentation/en-US/JBoss_Enterprise_Application_Platform/6.4/html/Development_Guide/chap-JAX-WS_Web_Services.html"); classificationService.attachLink(classificationModel, documentationEAP6Link); LinkModel documentationEAP7Link = linkService.create(); documentationEAP7Link.setDescription("Developing JAX-WS Web Services (JBoss EAP 7)"); documentationEAP7Link.setLink( "https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.0/html/developing_web_services_applications/developing_jax_ws_web_services"); classificationService.attachLink(classificationModel, documentationEAP7Link); LinkModel documentationCommunityLink = linkService.create(); documentationCommunityLink.setDescription("Assigning Client and Endpoint Configurations (JBoss EAP 7)"); documentationCommunityLink.setLink("https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.0/html-single/developing_web_services_applications/#ws_endpoint_assign_config"); classificationService.attachLink(classificationModel, documentationCommunityLink); TechnologyTagService technologyTagService = new TechnologyTagService(event.getGraphContext()); technologyTagService.addTagToFileModel(payload, "WebSphere WS Extension", TechnologyTagLevel.IMPORTANT); }
@Override public void perform(GraphRewrite event, EvaluationContext context, XmlFileModel payload) ClassificationService classificationService = new ClassificationService(event.getGraphContext());
@Override public void perform(GraphRewrite event, EvaluationContext context, XmlFileModel payload) ClassificationService classificationService = new ClassificationService(event.getGraphContext());